Merge pull request 'dev' (#418) from dev into prd-deploy
Reviewed-on: #418
This commit is contained in:
commit
9fa7d2afd4
@ -42,12 +42,15 @@ function WithDraggableHeader({ title, onClose, children }) {
|
|||||||
return (
|
return (
|
||||||
<div className="modal-head modal-handle">
|
<div className="modal-head modal-handle">
|
||||||
<h1 className="title">{title}</h1>
|
<h1 className="title">{title}</h1>
|
||||||
|
<div className='modal-btn-wrap'>
|
||||||
|
<button className='modal-fold act'></button>
|
||||||
{onClose && (
|
{onClose && (
|
||||||
<button className="modal-close" onClick={() => onClose()}>
|
<button className="modal-close" onClick={() => onClose()}>
|
||||||
닫기
|
닫기
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,14 +48,23 @@ export const CalculatorInput = forwardRef(
|
|||||||
const calculator = calculatorRef.current
|
const calculator = calculatorRef.current
|
||||||
let newDisplayValue = ''
|
let newDisplayValue = ''
|
||||||
|
|
||||||
|
// 소수점 이하 2자리 제한 로직 추가
|
||||||
|
const shouldPreventInput = (value) => {
|
||||||
|
const decimalParts = (value || '').split('.')
|
||||||
|
return decimalParts.length > 1 && decimalParts[1].length >= 2
|
||||||
|
}
|
||||||
|
|
||||||
if (hasOperation) {
|
if (hasOperation) {
|
||||||
// 연산자 이후 숫자 입력 시
|
// 연산자 이후 숫자 입력 시
|
||||||
if (calculator.currentOperand === '0' || calculator.shouldResetDisplay) {
|
if (calculator.currentOperand === '0' || calculator.shouldResetDisplay) {
|
||||||
calculator.currentOperand = num.toString()
|
calculator.currentOperand = num.toString()
|
||||||
calculator.shouldResetDisplay = false
|
calculator.shouldResetDisplay = false
|
||||||
} else {
|
}else if (!shouldPreventInput(calculator.currentOperand)) { //소수점 이하2자리
|
||||||
calculator.currentOperand = (calculator.currentOperand || '') + num
|
calculator.currentOperand = (calculator.currentOperand || '') + num
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// calculator.currentOperand = (calculator.currentOperand || '') + num
|
||||||
|
// }
|
||||||
newDisplayValue = calculator.previousOperand + calculator.operation + calculator.currentOperand
|
newDisplayValue = calculator.previousOperand + calculator.operation + calculator.currentOperand
|
||||||
setDisplayValue(newDisplayValue)
|
setDisplayValue(newDisplayValue)
|
||||||
} else {
|
} else {
|
||||||
@ -68,7 +77,7 @@ export const CalculatorInput = forwardRef(
|
|||||||
if (!hasOperation) {
|
if (!hasOperation) {
|
||||||
onChange(calculator.currentOperand)
|
onChange(calculator.currentOperand)
|
||||||
}
|
}
|
||||||
} else {
|
} else if (!shouldPreventInput(calculator.currentOperand)) { //소수점 이하2자리
|
||||||
calculator.currentOperand = (calculator.currentOperand || '') + num
|
calculator.currentOperand = (calculator.currentOperand || '') + num
|
||||||
newDisplayValue = calculator.currentOperand
|
newDisplayValue = calculator.currentOperand
|
||||||
setDisplayValue(newDisplayValue)
|
setDisplayValue(newDisplayValue)
|
||||||
@ -76,6 +85,14 @@ export const CalculatorInput = forwardRef(
|
|||||||
onChange(newDisplayValue)
|
onChange(newDisplayValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// calculator.currentOperand = (calculator.currentOperand || '') + num
|
||||||
|
// newDisplayValue = calculator.currentOperand
|
||||||
|
// setDisplayValue(newDisplayValue)
|
||||||
|
// if (!hasOperation) {
|
||||||
|
// onChange(newDisplayValue)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 커서를 텍스트 끝으로 이동하고 스크롤 처리
|
// 커서를 텍스트 끝으로 이동하고 스크롤 처리
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
||||||
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Direction({ pitch, setPitch, eavesOffset, setEavesOffset, gableOffset, setGableOffset, shedWidth, setShedWidth, pitchText }) {
|
export default function Direction({ pitch, setPitch, eavesOffset, setEavesOffset, gableOffset, setGableOffset, shedWidth, setShedWidth, pitchText }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -10,12 +11,24 @@ export default function Direction({ pitch, setPitch, eavesOffset, setEavesOffset
|
|||||||
{getMessage('slope')}
|
{getMessage('slope')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-origin block"*/}
|
||||||
|
{/* value={pitch}*/}
|
||||||
|
{/* onChange={(e) => setPitch(normalizeDecimalLimit(e.target.value, 2))}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={pitch}
|
value={pitch}
|
||||||
onChange={(e) => setPitch(normalizeDecimalLimit(e.target.value, 2))}
|
onChange={(value) => setPitch(value)}
|
||||||
/>
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: true //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">{pitchText}</span>
|
<span className="thin">{pitchText}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -24,12 +37,24 @@ export default function Direction({ pitch, setPitch, eavesOffset, setEavesOffset
|
|||||||
{getMessage('eaves.offset')}
|
{getMessage('eaves.offset')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-origin block"*/}
|
||||||
|
{/* value={eavesOffset}*/}
|
||||||
|
{/* onChange={(e) => setEavesOffset(normalizeDigits(e.target.value))}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={eavesOffset}
|
value={eavesOffset}
|
||||||
onChange={(e) => setEavesOffset(normalizeDigits(e.target.value))}
|
onChange={(value) => setEavesOffset(value)}
|
||||||
/>
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
@ -38,12 +63,24 @@ export default function Direction({ pitch, setPitch, eavesOffset, setEavesOffset
|
|||||||
{getMessage('gable.offset')}
|
{getMessage('gable.offset')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-origin block"*/}
|
||||||
|
{/* value={gableOffset}*/}
|
||||||
|
{/* onChange={(e) => setGableOffset(normalizeDigits(e.target.value))}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={gableOffset}
|
value={gableOffset}
|
||||||
onChange={(e) => setGableOffset(normalizeDigits(e.target.value))}
|
onChange={(value) => setGableOffset(value)}
|
||||||
/>
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
@ -52,12 +89,24 @@ export default function Direction({ pitch, setPitch, eavesOffset, setEavesOffset
|
|||||||
{getMessage('windage.width')}
|
{getMessage('windage.width')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-origin block"*/}
|
||||||
|
{/* value={shedWidth}*/}
|
||||||
|
{/* onChange={(e) => setShedWidth(normalizeDigits(e.target.value))}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={shedWidth}
|
value={shedWidth}
|
||||||
onChange={(e) => setShedWidth(normalizeDigits(e.target.value))}
|
onChange={(value) => setShedWidth(value)}
|
||||||
/>
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
||||||
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Pattern(props) {
|
export default function Pattern(props) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -11,7 +12,20 @@ export default function Pattern(props) {
|
|||||||
{getMessage('slope')}
|
{getMessage('slope')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={pitch} onChange={(e) => setPitch(normalizeDecimalLimit(e.target.value, 2))} />
|
{/*<input type="text" className="input-origin block" value={pitch} */}
|
||||||
|
{/* onChange={(e) => setPitch(normalizeDecimalLimit(e.target.value, 2))} />*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
|
className="input-origin block"
|
||||||
|
value={pitch}
|
||||||
|
onChange={(value) => setPitch(value)}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: true //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin"> {pitchText}</span>
|
<span className="thin"> {pitchText}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -20,7 +34,20 @@ export default function Pattern(props) {
|
|||||||
{getMessage('eaves.offset')}
|
{getMessage('eaves.offset')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={eavesOffset} onChange={(e) => setEavesOffset(normalizeDigits(e.target.value))} />
|
{/*<input type="text" className="input-origin block" value={eavesOffset} */}
|
||||||
|
{/* onChange={(e) => setEavesOffset(normalizeDigits(e.target.value))} />*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
|
className="input-origin block"
|
||||||
|
value={eavesOffset}
|
||||||
|
onChange={(value) => setEavesOffset(value)}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
@ -29,7 +56,20 @@ export default function Pattern(props) {
|
|||||||
{getMessage('gable.offset')}
|
{getMessage('gable.offset')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={gableOffset} onChange={(e) => setGableOffset(normalizeDigits(e.target.value))} />
|
{/*<input type="text" className="input-origin block" value={gableOffset} */}
|
||||||
|
{/* onChange={(e) => setGableOffset(normalizeDigits(e.target.value))} />*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
|
className="input-origin block"
|
||||||
|
value={gableOffset}
|
||||||
|
onChange={(value) => setGableOffset(value)}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
||||||
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Ridge(props) {
|
export default function Ridge(props) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -13,7 +14,20 @@ export default function Ridge(props) {
|
|||||||
{getMessage('slope')}
|
{getMessage('slope')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={pitch} onChange={(e) => setPitch(normalizeDecimalLimit(e.target.value, 2))} />
|
{/*<input type="text" className="input-origin block" value={pitch} */}
|
||||||
|
{/* onChange={(e) => setPitch(normalizeDecimalLimit(e.target.value, 2))} />*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
|
className="input-origin block"
|
||||||
|
value={pitch}
|
||||||
|
onChange={(value) => setPitch(value)}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: true //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">{pitchText}</span>
|
<span className="thin">{pitchText}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -22,7 +36,20 @@ export default function Ridge(props) {
|
|||||||
{getMessage('eaves.offset')}
|
{getMessage('eaves.offset')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={eavesOffset} onChange={(e) => setEavesOffset(normalizeDigits(e.target.value))} />
|
{/*<input type="text" className="input-origin block" value={eavesOffset} */}
|
||||||
|
{/* onChange={(e) => setEavesOffset(normalizeDigits(e.target.value))} />*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
|
className="input-origin block"
|
||||||
|
value={eavesOffset}
|
||||||
|
onChange={(value) => setEavesOffset(value)}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
||||||
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Eaves({ pitch, setPitch, eavesOffset, setEavesOffset, pitchText }) {
|
export default function Eaves({ pitch, setPitch, eavesOffset, setEavesOffset, pitchText }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -10,7 +11,21 @@ export default function Eaves({ pitch, setPitch, eavesOffset, setEavesOffset, pi
|
|||||||
{getMessage('slope')}
|
{getMessage('slope')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={pitch} onChange={(e) => setPitch(normalizeDecimalLimit(e.target.value, 2))} />
|
{/*<input type="text" className="input-origin block" value={pitch} */}
|
||||||
|
{/* onChange={(e) => setPitch(normalizeDecimalLimit(e.target.value, 2))} />*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
|
className="input-origin block"
|
||||||
|
value={pitch}
|
||||||
|
onChange={(value) => setPitch(value)}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: true //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">{pitchText}</span>
|
<span className="thin">{pitchText}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -19,7 +34,20 @@ export default function Eaves({ pitch, setPitch, eavesOffset, setEavesOffset, pi
|
|||||||
{getMessage('eaves.offset')}
|
{getMessage('eaves.offset')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={eavesOffset} onChange={(e) => setEavesOffset(normalizeDigits(e.target.value))} />
|
{/*<input type="text" className="input-origin block" value={eavesOffset} */}
|
||||||
|
{/* onChange={(e) => setEavesOffset(normalizeDigits(e.target.value))} />*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
|
className="input-origin block"
|
||||||
|
value={eavesOffset}
|
||||||
|
onChange={(value) => setEavesOffset(value)}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import { normalizeDigits } from '@/util/input-utils'
|
import { normalizeDigits } from '@/util/input-utils'
|
||||||
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Gable({ gableOffset, setGableOffset }) {
|
export default function Gable({ gableOffset, setGableOffset }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -10,7 +11,20 @@ export default function Gable({ gableOffset, setGableOffset }) {
|
|||||||
<div className="outline-form">
|
<div className="outline-form">
|
||||||
<span className="mr10">{getMessage('gable.offset')}</span>
|
<span className="mr10">{getMessage('gable.offset')}</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={gableOffset} onChange={(e) => setGableOffset(normalizeDigits(e.target.value))} />
|
{/*<input type="text" className="input-origin block" value={gableOffset}*/}
|
||||||
|
{/* onChange={(e) => setGableOffset(normalizeDigits(e.target.value))} />*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
|
className="input-origin block"
|
||||||
|
value={gableOffset}
|
||||||
|
onChange={(value) => setGableOffset(value)}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
||||||
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function HipAndGable({ pitch, setPitch, eavesOffset, setEavesOffset, hipAndGableWidth, setHipAndGableWidth, pitchText }) {
|
export default function HipAndGable({ pitch, setPitch, eavesOffset, setEavesOffset, hipAndGableWidth, setHipAndGableWidth, pitchText }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -10,7 +11,8 @@ export default function HipAndGable({ pitch, setPitch, eavesOffset, setEavesOffs
|
|||||||
{getMessage('slope')}
|
{getMessage('slope')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={pitch} onChange={(e) => setPitch(normalizeDecimalLimit(e.target.value, 2))} />
|
<input type="text" className="input-origin block" value={pitch}
|
||||||
|
onChange={(e) => setPitch(normalizeDecimalLimit(e.target.value, 2))} />
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">{pitchText}</span>
|
<span className="thin">{pitchText}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -19,7 +21,8 @@ export default function HipAndGable({ pitch, setPitch, eavesOffset, setEavesOffs
|
|||||||
{getMessage('eaves.offset')}
|
{getMessage('eaves.offset')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={eavesOffset} onChange={(e) => setEavesOffset(normalizeDigits(e.target.value))} />
|
<input type="text" className="input-origin block" value={eavesOffset}
|
||||||
|
onChange={(e) => setEavesOffset(normalizeDigits(e.target.value))} />
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
@ -28,12 +31,24 @@ export default function HipAndGable({ pitch, setPitch, eavesOffset, setEavesOffs
|
|||||||
{getMessage('hipandgable.width')}
|
{getMessage('hipandgable.width')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-origin block"*/}
|
||||||
|
{/* value={hipAndGableWidth}*/}
|
||||||
|
{/* onChange={(e) => setHipAndGableWidth(normalizeDigits(e.target.value))}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={hipAndGableWidth}
|
value={hipAndGableWidth}
|
||||||
onChange={(e) => setHipAndGableWidth(normalizeDigits(e.target.value))}
|
onChange={(value) => setHipAndGableWidth(value)}
|
||||||
/>
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
|
||||||
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Jerkinhead({
|
export default function Jerkinhead({
|
||||||
gableOffset,
|
gableOffset,
|
||||||
@ -18,7 +19,20 @@ export default function Jerkinhead({
|
|||||||
{getMessage('gable.offset')}
|
{getMessage('gable.offset')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={gableOffset} onChange={(e) => setGableOffset(normalizeDigits(e.target.value))} />
|
<input type="text" className="input-origin block" value={gableOffset}
|
||||||
|
onChange={(e) => setGableOffset(normalizeDigits(e.target.value))} />
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
|
className="input-origin block"
|
||||||
|
value={gableOffset}
|
||||||
|
onChange={(value) => setGableOffset(value)}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
@ -27,7 +41,21 @@ export default function Jerkinhead({
|
|||||||
{getMessage('jerkinhead.width')}
|
{getMessage('jerkinhead.width')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={jerkinHeadWidth} onChange={(e) => setJerkinHeadWidth(normalizeDigits(e.target.value))} />
|
{/*<input type="text" className="input-origin block" value={jerkinHeadWidth}*/}
|
||||||
|
{/* onChange={(e) => setJerkinHeadWidth(normalizeDigits(e.target.value))} />*/}
|
||||||
|
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
|
className="input-origin block"
|
||||||
|
value={jerkinHeadWidth}
|
||||||
|
onChange={(value) => setJerkinHeadWidth(value)}
|
||||||
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
@ -36,12 +64,24 @@ export default function Jerkinhead({
|
|||||||
{getMessage('jerkinhead.slope')}
|
{getMessage('jerkinhead.slope')}
|
||||||
</span>
|
</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-origin block"*/}
|
||||||
|
{/* value={jerkinHeadPitch}*/}
|
||||||
|
{/* onChange={(e) => setJerkinHeadPitch(normalizeDecimalLimit(e.target.value, 2))}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={jerkinHeadPitch}
|
value={jerkinHeadPitch}
|
||||||
onChange={(e) => setJerkinHeadPitch(normalizeDecimalLimit(e.target.value, 2))}
|
onChange={(value) => jerkinHeadPitch(value)}
|
||||||
/>
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: true //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">{pitchText}</span>
|
<span className="thin">{pitchText}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -8,14 +8,16 @@ export default function Shed({ shedWidth, setShedWidth, shedPitch, setShedPitch,
|
|||||||
<div className="outline-form mb10">
|
<div className="outline-form mb10">
|
||||||
<span className="mr10">{getMessage('slope')}</span>
|
<span className="mr10">{getMessage('slope')}</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={shedPitch} onChange={(e) => setShedPitch(normalizeDecimalLimit(e.target.value, 2))} />
|
<input type="text" className="input-origin block" value={shedPitch}
|
||||||
|
onChange={(e) => setShedPitch(normalizeDecimalLimit(e.target.value, 2))} />
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">{pitchText}</span>
|
<span className="thin">{pitchText}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="outline-form">
|
<div className="outline-form">
|
||||||
<span className="mr10">{getMessage('shed.width')}</span>
|
<span className="mr10">{getMessage('shed.width')}</span>
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input type="text" className="input-origin block" value={shedWidth} onChange={(e) => setShedWidth(normalizeDigits(e.target.value))} />
|
<input type="text" className="input-origin block" value={shedWidth}
|
||||||
|
onChange={(e) => setShedWidth(normalizeDigits(e.target.value))} />
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { normalizeDigits } from '@/util/input-utils'
|
import { normalizeDigits } from '@/util/input-utils'
|
||||||
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Wall({ sleeveOffset, setSleeveOffset, hasSleeve, setHasSleeve }) {
|
export default function Wall({ sleeveOffset, setSleeveOffset, hasSleeve, setHasSleeve }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -10,7 +11,8 @@ export default function Wall({ sleeveOffset, setSleeveOffset, hasSleeve, setHasS
|
|||||||
<div className="eaves-keraba-item">
|
<div className="eaves-keraba-item">
|
||||||
<div className="eaves-keraba-th">
|
<div className="eaves-keraba-th">
|
||||||
<div className="d-check-radio pop">
|
<div className="d-check-radio pop">
|
||||||
<input type="radio" name="radio01" checked={hasSleeve === '0'} id="ra01" value={'0'} onChange={(e) => setHasSleeve(e.target.value)} />
|
<input type="radio" name="radio01" checked={hasSleeve === '0'} id="ra01" value={'0'}
|
||||||
|
onChange={(e) => setHasSleeve(e.target.value)} />
|
||||||
<label htmlFor="ra01">{getMessage('has.not.sleeve')}</label>
|
<label htmlFor="ra01">{getMessage('has.not.sleeve')}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -18,20 +20,34 @@ export default function Wall({ sleeveOffset, setSleeveOffset, hasSleeve, setHasS
|
|||||||
<div className="eaves-keraba-item">
|
<div className="eaves-keraba-item">
|
||||||
<div className="eaves-keraba-th">
|
<div className="eaves-keraba-th">
|
||||||
<div className="d-check-radio pop">
|
<div className="d-check-radio pop">
|
||||||
<input type="radio" name="radio01" checked={hasSleeve !== '0'} id="ra02" value={'1'} onChange={(e) => setHasSleeve(e.target.value)} />
|
<input type="radio" name="radio01" checked={hasSleeve !== '0'} id="ra02" value={'1'}
|
||||||
|
onChange={(e) => setHasSleeve(e.target.value)} />
|
||||||
<label htmlFor="ra02">{getMessage('has.sleeve')}</label>
|
<label htmlFor="ra02">{getMessage('has.sleeve')}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="eaves-keraba-td">
|
<div className="eaves-keraba-td">
|
||||||
<div className="outline-form">
|
<div className="outline-form">
|
||||||
<div className="input-grid mr5" style={{ width: '100px' }}>
|
<div className="input-grid mr5" style={{ width: '100px' }}>
|
||||||
<input
|
{/*<input*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
|
{/* className="input-origin block"*/}
|
||||||
|
{/* value={sleeveOffset}*/}
|
||||||
|
{/* onChange={(e) => setSleeveOffset(normalizeDigits(e.target.value))}*/}
|
||||||
|
{/* readOnly={hasSleeve === '0'}*/}
|
||||||
|
{/*/>*/}
|
||||||
|
<CalculatorInput
|
||||||
|
id=""
|
||||||
|
name=""
|
||||||
|
label=""
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={sleeveOffset}
|
value={sleeveOffset}
|
||||||
onChange={(e) => setSleeveOffset(normalizeDigits(e.target.value))}
|
onChange={(value) => setSleeveOffset(value)}
|
||||||
readOnly={hasSleeve === '0'}
|
readOnly={hasSleeve === '0'}
|
||||||
/>
|
options={{
|
||||||
|
allowNegative: false,
|
||||||
|
allowDecimal: false //(index !== 0),
|
||||||
|
}}
|
||||||
|
></CalculatorInput>
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -133,8 +133,23 @@ $alert-color: #101010;
|
|||||||
color: $pop-color;
|
color: $pop-color;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
.modal-close{
|
.modal-btn-wrap{
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 15px;
|
||||||
|
}
|
||||||
|
.modal-fold{
|
||||||
|
display: block;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
background: url(../../public/static/images/canvas/penal_arr_white.svg)no-repeat center;
|
||||||
|
background-size: contain;
|
||||||
|
&.act{
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.modal-close{
|
||||||
color: transparent;
|
color: transparent;
|
||||||
font-size: 0;
|
font-size: 0;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user