Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into feature/redo-undo

This commit is contained in:
hyojun.choi 2026-03-23 10:30:33 +09:00
commit c7238b2e27
40 changed files with 215 additions and 47 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

View File

@ -3,7 +3,7 @@ import { createCalculator } from '@/util/calc-utils'
import '@/styles/calc.scss' import '@/styles/calc.scss'
export const CalculatorInput = forwardRef( export const CalculatorInput = forwardRef(
({ value, onChange, label, options = {}, id, className = 'calculator-input', readOnly = false, placeholder, name='', disabled = false, maxLength = 12 }, ref) => { ({ value, onChange, label, options = {}, id, className = 'calculator-input', readOnly = false, placeholder, name='', disabled = false, maxLength = 12, disableKeypad = false }, ref) => {
const [showKeypad, setShowKeypad] = useState(false) const [showKeypad, setShowKeypad] = useState(false)
const [displayValue, setDisplayValue] = useState(value || '0') const [displayValue, setDisplayValue] = useState(value || '0')
const [hasOperation, setHasOperation] = useState(false) const [hasOperation, setHasOperation] = useState(false)
@ -478,7 +478,7 @@ export const CalculatorInput = forwardRef(
maxLength={maxLength} maxLength={maxLength}
/> />
{showKeypad && !readOnly && ( {showKeypad && !readOnly && !disableKeypad && (
<div className="keypad-container"> <div className="keypad-container">
<div className="keypad-grid"> <div className="keypad-grid">
<button <button

View File

@ -25,7 +25,10 @@ import { QcastContext } from '@/app/QcastProvider'
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu' import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
import {normalizeDigits, normalizeDecimal} from '@/util/input-utils' import {normalizeDigits, normalizeDecimal} from '@/util/input-utils'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
import Image from 'next/image'
export default function Estimate({}) { export default function Estimate({}) {
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const [uniqueData, setUniqueData] = useState([]) const [uniqueData, setUniqueData] = useState([])
const [handlePricingFlag, setHandlePricingFlag] = useState(false) const [handlePricingFlag, setHandlePricingFlag] = useState(false)
const [specialNoteFirstFlg, setSpecialNoteFirstFlg] = useState(false) const [specialNoteFirstFlg, setSpecialNoteFirstFlg] = useState(false)
@ -1980,6 +1983,9 @@ export default function Estimate({}) {
<span className="minus"></span> <span className="minus"></span>
{getMessage('estimate.detail.showPrice.delItem')} {getMessage('estimate.detail.showPrice.delItem')}
</button> </button>
<button style={{ width: 'auto', marginLeft: '8px' }} type="button" onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON.png' : '/static/images/common/Icon_OFF.png'} alt="toggle" width={34} height={34} />
</button>
</div> </div>
</div> </div>
</div> </div>
@ -2148,6 +2154,7 @@ export default function Estimate({}) {
onChange={(value) =>{ onChange={(value) =>{
onChangeAmount(value, item.dispOrder, index) onChangeAmount(value, item.dispOrder, index)
}} }}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -2205,6 +2212,7 @@ export default function Estimate({}) {
onChangeSalePrice(value, item.dispOrder, index) onChangeSalePrice(value, item.dispOrder, index)
}} }}
maxLength={12} maxLength={12}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false

View File

@ -1,5 +1,6 @@
import { MODULE_SETUP_TYPE, POLYGON_TYPE } from '@/common/common' import { MODULE_SETUP_TYPE, POLYGON_TYPE } from '@/common/common'
import WithDraggable from '@/components/common/draggable/WithDraggable' import WithDraggable from '@/components/common/draggable/WithDraggable'
import Image from 'next/image'
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation' import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement' import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
import Placement from '@/components/floor-plan/modal/basic/step/Placement' import Placement from '@/components/floor-plan/modal/basic/step/Placement'
@ -75,6 +76,8 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
const { trigger: placementTrigger } = useCanvasPopupStatusController(3) const { trigger: placementTrigger } = useCanvasPopupStatusController(3)
const [roofsStore, setRoofsStore] = useRecoilState(roofsState) const [roofsStore, setRoofsStore] = useRecoilState(roofsState)
const [isFold, setIsFold] = useState(false) const [isFold, setIsFold] = useState(false)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
// const { initEvent } = useContext(EventContext) // const { initEvent } = useContext(EventContext)
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup, manualModuleLayoutSetup, restoreModuleInstArea } = const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup, manualModuleLayoutSetup, restoreModuleInstArea } =
@ -235,6 +238,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
} }
const orientationProps = { const orientationProps = {
disableKeypad,
roofs, roofs,
setRoofs, setRoofs,
tabNum, tabNum,
@ -270,6 +274,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
updateObjectDataApi, updateObjectDataApi,
} }
const trestleProps = { const trestleProps = {
disableKeypad,
roofs, roofs,
setRoofs, setRoofs,
setRoofsStore, setRoofsStore,
@ -320,7 +325,10 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
)} )}
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
<button style={{ width: 'auto' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
{/* {tabNum === 1 && <button className="btn-frame modal mr5">{getMessage('modal.common.save')}</button>} */} {/* {tabNum === 1 && <button className="btn-frame modal mr5">{getMessage('modal.common.save')}</button>} */}
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && ( {basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && (
<> <>

View File

@ -24,6 +24,7 @@ export const Orientation = forwardRef((props, ref) => {
const [moduleSeriesList, setModuleSeriesList] = useState([]) const [moduleSeriesList, setModuleSeriesList] = useState([])
const [filteredModuleList, setFilteredModuleList] = useState([]) const [filteredModuleList, setFilteredModuleList] = useState([])
const { const {
disableKeypad,
roofs, roofs,
setRoofs, setRoofs,
tabNum, tabNum,
@ -453,15 +454,12 @@ export const Orientation = forwardRef((props, ref) => {
value={inputCompasDeg} value={inputCompasDeg}
readOnly={!hasAnglePassivity} readOnly={!hasAnglePassivity}
onChange={(value) => { onChange={(value) => {
// Convert to number and ensure it's within -180 to 180 range
const numValue = parseInt(value, 10); const numValue = parseInt(value, 10);
if (!isNaN(numValue)) { if (!isNaN(numValue)) {
const clampedValue = Math.min(180, Math.max(-180, numValue)); setInputCompasDeg(Math.min(180, Math.max(-180, numValue)));
setInputCompasDeg(String(clampedValue));
} else {
setInputCompasDeg(value);
} }
}} }}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: true, allowNegative: true,
allowDecimal: false allowDecimal: false
@ -564,6 +562,7 @@ export const Orientation = forwardRef((props, ref) => {
className="input-origin block" className="input-origin block"
value={inputMargin} value={inputMargin}
onChange={(value) => setInputMargin(value)} onChange={(value) => setInputMargin(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -609,6 +608,7 @@ export const Orientation = forwardRef((props, ref) => {
className="input-origin block" className="input-origin block"
value={inputInstallHeight} value={inputInstallHeight}
onChange={(value) => handleChangeInstallHeight(value)} onChange={(value) => handleChangeInstallHeight(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -649,6 +649,7 @@ export const Orientation = forwardRef((props, ref) => {
className="input-origin block" className="input-origin block"
value={inputVerticalSnowCover} value={inputVerticalSnowCover}
onChange={(value) => handleChangeVerticalSnowCover(value)} onChange={(value) => handleChangeVerticalSnowCover(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false

View File

@ -14,7 +14,7 @@ import { normalizeDigits } from '@/util/input-utils'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
const Trestle = forwardRef((props, ref) => { const Trestle = forwardRef((props, ref) => {
const { tabNum, setTabNum, trestleTrigger, roofs, setRoofs, moduleSelectionData, setModuleSelectionData, setRoofsStore } = props const { tabNum, setTabNum, trestleTrigger, roofs, setRoofs, moduleSelectionData, setModuleSelectionData, setRoofsStore, disableKeypad } = props
const { getMessage } = useMessage() const { getMessage } = useMessage()
// const [selectedTrestle, setSelectedTrestle] = useState() // const [selectedTrestle, setSelectedTrestle] = useState()
const currentAngleType = useRecoilValue(currentAngleTypeSelector) const currentAngleType = useRecoilValue(currentAngleTypeSelector)
@ -936,6 +936,7 @@ const Trestle = forwardRef((props, ref) => {
className="input-origin block" className="input-origin block"
value={eavesMargin ?? 0} value={eavesMargin ?? 0}
onChange={(value) => setEavesMargin(value)} onChange={(value) => setEavesMargin(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -961,6 +962,7 @@ const Trestle = forwardRef((props, ref) => {
className="input-origin block" className="input-origin block"
value={ridgeMargin ?? 0} value={ridgeMargin ?? 0}
onChange={(value) => setRidgeMargin(value)} onChange={(value) => setRidgeMargin(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -986,6 +988,7 @@ const Trestle = forwardRef((props, ref) => {
className="input-origin block" className="input-origin block"
value={kerabaMargin ?? 0} value={kerabaMargin ?? 0}
onChange={(value) => setKerabaMargin(value)} onChange={(value) => setKerabaMargin(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false

View File

@ -6,7 +6,7 @@ import { useEffect } from 'react'
export default function Angle({ props }) { export default function Angle({ props }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const { angle1, setAngle1, angle1Ref, length1, setLength1, length1Ref } = props const { angle1, setAngle1, angle1Ref, length1, setLength1, length1Ref, disableKeypad } = props
return ( return (
<> <>
@ -45,6 +45,7 @@ export default function Angle({ props }) {
}} }}
placeholder="45" placeholder="45"
onFocus={() => (angle1Ref.current.value = '')} onFocus={() => (angle1Ref.current.value = '')}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: true, allowNegative: true,
allowDecimal: true allowDecimal: true
@ -80,6 +81,7 @@ export default function Angle({ props }) {
onChange={(value) => setLength1(value)} onChange={(value) => setLength1(value)}
placeholder="3000" placeholder="3000"
onFocus={() => (length1Ref.current.value = '')} onFocus={() => (length1Ref.current.value = '')}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false

View File

@ -19,6 +19,7 @@ export default function Diagonal({ props }) {
setArrow1, setArrow1,
arrow2, arrow2,
setArrow2, setArrow2,
disableKeypad,
} = props } = props
return ( return (
<> <>
@ -50,6 +51,7 @@ export default function Diagonal({ props }) {
onChange={(value) => setDiagonalLength(value)} onChange={(value) => setDiagonalLength(value)}
placeholder="3000" placeholder="3000"
onFocus={() => (diagonalLengthRef.current.value = '')} onFocus={() => (diagonalLengthRef.current.value = '')}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -87,6 +89,7 @@ export default function Diagonal({ props }) {
onChange={(value) => setLength1(value)} onChange={(value) => setLength1(value)}
placeholder="3000" placeholder="3000"
onFocus={() => (length1Ref.current.value = '')} onFocus={() => (length1Ref.current.value = '')}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -160,6 +163,7 @@ export default function Diagonal({ props }) {
onChange={(value) => setLength2(value)} onChange={(value) => setLength2(value)}
placeholder="3000" placeholder="3000"
onFocus={() => (length2Ref.current.value = '')} onFocus={() => (length2Ref.current.value = '')}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false

View File

@ -24,6 +24,7 @@ export default function DoublePitch({ props }) {
setArrow2, setArrow2,
arrow1Ref, arrow1Ref,
arrow2Ref, arrow2Ref,
disableKeypad,
} = props } = props
const getLength2 = (angle1, angle2, length1) => { const getLength2 = (angle1, angle2, length1) => {
@ -68,6 +69,7 @@ export default function DoublePitch({ props }) {
onChange={(value) => setAngle1(value)} onChange={(value) => setAngle1(value)}
placeholder="45" placeholder="45"
onFocus={() => (angle1Ref.current.value = '')} onFocus={() => (angle1Ref.current.value = '')}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true allowDecimal: true
@ -100,6 +102,7 @@ export default function DoublePitch({ props }) {
onChange={(value) => setLength1(value)} onChange={(value) => setLength1(value)}
placeholder="3000" placeholder="3000"
onFocus={() => (length1Ref.current.value = '')} onFocus={() => (length1Ref.current.value = '')}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -180,6 +183,7 @@ export default function DoublePitch({ props }) {
}} }}
placeholder="45" placeholder="45"
onFocus={() => (angle2Ref.current.value = '')} onFocus={() => (angle2Ref.current.value = '')}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true allowDecimal: true

View File

@ -9,7 +9,7 @@ import { useEffect, useRef } from 'react'
export default function OuterLineWall({ props }) { export default function OuterLineWall({ props }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const { length1, setLength1, length1Ref, arrow1, setArrow1 } = props const { length1, setLength1, length1Ref, arrow1, setArrow1, disableKeypad } = props
// //
useEffect(() => { useEffect(() => {
@ -81,6 +81,7 @@ export default function OuterLineWall({ props }) {
}} }}
placeholder={'3000'} placeholder={'3000'}
ref={length1Ref} ref={length1Ref}
disableKeypad={disableKeypad}
onFocus={() => { onFocus={() => {
if (length1Ref.current && length1Ref.current.value === '0') { if (length1Ref.current && length1Ref.current.value === '0') {
length1Ref.current.value = '' length1Ref.current.value = ''

View File

@ -4,7 +4,7 @@ import { CalculatorInput } from '@/components/common/input/CalcInput'
export default function RightAngle({ props }) { export default function RightAngle({ props }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const { length1, setLength1, length1Ref, length2, setLength2, length2Ref, arrow1, setArrow1, arrow2, setArrow2 } = props const { length1, setLength1, length1Ref, length2, setLength2, length2Ref, arrow1, setArrow1, arrow2, setArrow2, disableKeypad } = props
const handleClickArrow = (arrow) => { const handleClickArrow = (arrow) => {
const arrowType = arrow === '↑' ? 'ArrowUp' : arrow === '↓' ? 'ArrowDown' : arrow === '←' ? 'ArrowLeft' : arrow === '→' ? 'ArrowRight' : '' const arrowType = arrow === '↑' ? 'ArrowUp' : arrow === '↓' ? 'ArrowDown' : arrow === '←' ? 'ArrowLeft' : arrow === '→' ? 'ArrowRight' : ''
@ -42,6 +42,7 @@ export default function RightAngle({ props }) {
ref={length1Ref} ref={length1Ref}
onChange={(value) => setLength1(value)} onChange={(value) => setLength1(value)}
onFocus={() => (length1Ref.current.value = '')} onFocus={() => (length1Ref.current.value = '')}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -125,6 +126,7 @@ export default function RightAngle({ props }) {
onFocus={() => (length2Ref.current.value = '')} onFocus={() => (length2Ref.current.value = '')}
onChange={(value) => setLength2(value)} onChange={(value) => setLength2(value)}
placeholder="3000" placeholder="3000"
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false

View File

@ -14,6 +14,7 @@ import TriangleDormer from '@/components/floor-plan/modal/object/type/TriangleDo
import PentagonDormer from '@/components/floor-plan/modal/object/type/PentagonDormer' import PentagonDormer from '@/components/floor-plan/modal/object/type/PentagonDormer'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils' import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
import Image from 'next/image'
export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) { export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
@ -21,6 +22,7 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
const [buttonAct, setButtonAct] = useState(1) const [buttonAct, setButtonAct] = useState(1)
const { swalFire } = useSwal() const { swalFire } = useSwal()
const [isHidden, setIsHidden] = useState(false) const [isHidden, setIsHidden] = useState(false)
const [useCalcPad, setUseCalcPad] = useState(false)
const { applyOpeningAndShadow, applyDormers } = useObjectBatch({ isHidden, setIsHidden }) const { applyOpeningAndShadow, applyDormers } = useObjectBatch({ isHidden, setIsHidden })
const { closePopup } = usePopup() const { closePopup } = usePopup()
@ -112,12 +114,15 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
))} ))}
</div> </div>
<div className="properties-setting-wrap outer"> <div className="properties-setting-wrap outer">
{buttonAct === 1 && <OpenSpace ref={objectPlacement} />} {buttonAct === 1 && <OpenSpace ref={objectPlacement} disableKeypad={!useCalcPad} />}
{buttonAct === 2 && <Shadow ref={objectPlacement} />} {buttonAct === 2 && <Shadow ref={objectPlacement} disableKeypad={!useCalcPad} />}
{buttonAct === 3 && <TriangleDormer ref={dormerPlacement} />} {buttonAct === 3 && <TriangleDormer ref={dormerPlacement} disableKeypad={!useCalcPad} />}
{buttonAct === 4 && <PentagonDormer ref={dormerPlacement} />} {buttonAct === 4 && <PentagonDormer ref={dormerPlacement} disableKeypad={!useCalcPad} />}
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap">
<button className="mr5" style={{ verticalAlign: 'middle' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button <button
className="btn-frame modal act" className="btn-frame modal act"
onClick={() => { onClick={() => {

View File

@ -1,6 +1,7 @@
'use client' 'use client'
import { useRecoilValue } from 'recoil' import { useRecoilValue } from 'recoil'
import Image from 'next/image'
import { useMessage } from '@/hooks/useMessage' import { useMessage } from '@/hooks/useMessage'
import WithDraggable from '@/components/common/draggable/WithDraggable' import WithDraggable from '@/components/common/draggable/WithDraggable'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
@ -23,6 +24,8 @@ export default function SizeSetting(props) {
const heightRef = useRef(null) const heightRef = useRef(null)
const [width, setWidth] = useState(target?.width ? (target.width * 10).toFixed() : 0) const [width, setWidth] = useState(target?.width ? (target.width * 10).toFixed() : 0)
const [height, setHeight] = useState(target?.height ? (target.height * 10) : 0) const [height, setHeight] = useState(target?.height ? (target.height * 10) : 0)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
// const { initEvent } = useEvent() // const { initEvent } = useEvent()
// const { initEvent } = useContext(EventContext) // const { initEvent } = useContext(EventContext)
@ -72,6 +75,7 @@ export default function SizeSetting(props) {
value={width} value={width}
ref={widthRef} ref={widthRef}
onChange={(value) => setWidth(value)} onChange={(value) => setWidth(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -99,6 +103,7 @@ export default function SizeSetting(props) {
value={height} value={height}
ref={heightRef} ref={heightRef}
onChange={(value) => setHeight(value)} onChange={(value) => setHeight(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -117,7 +122,10 @@ export default function SizeSetting(props) {
</div> </div>
</div> </div>
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
<button style={{ width: 'auto' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal act" onClick={() => handleReSizeObject(id)}> <button className="btn-frame modal act" onClick={() => handleReSizeObject(id)}>
{getMessage('write')} {getMessage('write')}
</button> </button>

View File

@ -3,7 +3,7 @@ import { useMessage } from '@/hooks/useMessage'
import { INPUT_TYPE } from '@/common/common' import { INPUT_TYPE } from '@/common/common'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
const OpenSpace = forwardRef((props, refs) => { const OpenSpace = forwardRef(({ disableKeypad }, refs) => {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const [selectedType, setSelectedType] = useState(INPUT_TYPE.FREE) const [selectedType, setSelectedType] = useState(INPUT_TYPE.FREE)
const [width, setWidth] = useState(0) const [width, setWidth] = useState(0)
@ -70,6 +70,7 @@ const OpenSpace = forwardRef((props, refs) => {
ref={refs.widthRef} ref={refs.widthRef}
onChange={(value) => setWidth(value)} onChange={(value) => setWidth(value)}
disabled={selectedType !== INPUT_TYPE.DIMENSION} disabled={selectedType !== INPUT_TYPE.DIMENSION}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -101,6 +102,7 @@ const OpenSpace = forwardRef((props, refs) => {
ref={refs.heightRef} ref={refs.heightRef}
onChange={(value) => setHeight(value)} onChange={(value) => setHeight(value)}
disabled={selectedType !== INPUT_TYPE.DIMENSION} disabled={selectedType !== INPUT_TYPE.DIMENSION}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false

View File

@ -3,7 +3,7 @@ import { useMessage } from '@/hooks/useMessage'
import { forwardRef, useState } from 'react' import { forwardRef, useState } from 'react'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
const PentagonDormer = forwardRef((props, refs) => { const PentagonDormer = forwardRef(({ disableKeypad }, refs) => {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const [direction, setDirection] = useState('down') const [direction, setDirection] = useState('down')
refs.directionRef.current = direction refs.directionRef.current = direction
@ -45,6 +45,7 @@ const PentagonDormer = forwardRef((props, refs) => {
value={height} value={height}
ref={refs.heightRef} ref={refs.heightRef}
onChange={(value) => setHeight(value)} onChange={(value) => setHeight(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -69,6 +70,7 @@ const PentagonDormer = forwardRef((props, refs) => {
value={offsetDepth} value={offsetDepth}
ref={refs.offsetRef} ref={refs.offsetRef}
onChange={(value) => setOffsetDepth(value)} onChange={(value) => setOffsetDepth(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -96,6 +98,7 @@ const PentagonDormer = forwardRef((props, refs) => {
value={width} value={width}
ref={refs.widthRef} ref={refs.widthRef}
onChange={(value) => setWidth(value)} onChange={(value) => setWidth(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -120,6 +123,7 @@ const PentagonDormer = forwardRef((props, refs) => {
value={offsetWidth} value={offsetWidth}
ref={refs.offsetWidthRef} ref={refs.offsetWidthRef}
onChange={(value) => setOffsetWidth(value)} onChange={(value) => setOffsetWidth(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -144,6 +148,7 @@ const PentagonDormer = forwardRef((props, refs) => {
ref={refs.pitchRef} ref={refs.pitchRef}
value={pitch} value={pitch}
onChange={(value) => setPitch(value)} onChange={(value) => setPitch(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),

View File

@ -3,7 +3,7 @@ import { useMessage } from '@/hooks/useMessage'
import { INPUT_TYPE } from '@/common/common' import { INPUT_TYPE } from '@/common/common'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
const Shadow = forwardRef((props, refs) => { const Shadow = forwardRef(({ disableKeypad }, refs) => {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const [selectedType, setSelectedType] = useState(INPUT_TYPE.FREE) const [selectedType, setSelectedType] = useState(INPUT_TYPE.FREE)
@ -70,6 +70,7 @@ const Shadow = forwardRef((props, refs) => {
ref={refs.widthRef} ref={refs.widthRef}
onChange={(value) => setWidth(value)} onChange={(value) => setWidth(value)}
disabled={selectedType !== INPUT_TYPE.DIMENSION} disabled={selectedType !== INPUT_TYPE.DIMENSION}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -101,6 +102,7 @@ const Shadow = forwardRef((props, refs) => {
ref={refs.heightRef} ref={refs.heightRef}
onChange={(value) => setHeight(value)} onChange={(value) => setHeight(value)}
disabled={selectedType !== INPUT_TYPE.DIMENSION} disabled={selectedType !== INPUT_TYPE.DIMENSION}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false

View File

@ -3,7 +3,7 @@ import { useMessage } from '@/hooks/useMessage'
import { forwardRef, useState } from 'react' import { forwardRef, useState } from 'react'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
const TriangleDormer = forwardRef((props, refs) => { const TriangleDormer = forwardRef(({ disableKeypad }, refs) => {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const [direction, setDirection] = useState('down') const [direction, setDirection] = useState('down')
refs.directionRef.current = direction refs.directionRef.current = direction
@ -43,6 +43,7 @@ const [pitch, setPitch] = useState(4)
value={height} value={height}
ref={refs.heightRef} ref={refs.heightRef}
onChange={(value) => setHeight(value)} onChange={(value) => setHeight(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -67,6 +68,7 @@ const [pitch, setPitch] = useState(4)
value={offset} value={offset}
ref={refs.offsetRef} ref={refs.offsetRef}
onChange={(value) => setOffset(value)} onChange={(value) => setOffset(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false
@ -91,6 +93,7 @@ const [pitch, setPitch] = useState(4)
ref={refs.pitchRef} ref={refs.pitchRef}
value={pitch} value={pitch}
onChange={(value) => setPitch(value)} onChange={(value) => setPitch(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true allowDecimal: true

View File

@ -11,6 +11,7 @@ import DoublePitch from '@/components/floor-plan/modal/lineTypes/DoublePitch'
import Diagonal from '@/components/floor-plan/modal/lineTypes/Diagonal' import Diagonal from '@/components/floor-plan/modal/lineTypes/Diagonal'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
import { useState } from 'react' import { useState } from 'react'
import Image from 'next/image'
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
export default function WallLineSetting(props) { export default function WallLineSetting(props) {
@ -18,6 +19,7 @@ export default function WallLineSetting(props) {
const { addPopup, closePopup } = usePopup() const { addPopup, closePopup } = usePopup()
const { getMessage } = useMessage() const { getMessage } = useMessage()
const [propertiesId, setPropertiesId] = useState(uuidv4()) const [propertiesId, setPropertiesId] = useState(uuidv4())
const [useCalcPad, setUseCalcPad] = useState(false)
const { const {
length1, length1,
setLength1, setLength1,
@ -46,12 +48,15 @@ export default function WallLineSetting(props) {
handleFix, handleFix,
} = useOuterLineWall(id, propertiesId) } = useOuterLineWall(id, propertiesId)
const disableKeypad = !useCalcPad
const outerLineProps = { const outerLineProps = {
length1, length1,
setLength1, setLength1,
length1Ref, length1Ref,
arrow1, arrow1,
setArrow1, setArrow1,
disableKeypad,
} }
const rightAngleProps = { const rightAngleProps = {
@ -65,6 +70,7 @@ export default function WallLineSetting(props) {
setArrow1, setArrow1,
arrow2, arrow2,
setArrow2, setArrow2,
disableKeypad,
} }
const doublePitchProps = { const doublePitchProps = {
@ -86,6 +92,7 @@ export default function WallLineSetting(props) {
setArrow2, setArrow2,
arrow1Ref, arrow1Ref,
arrow2Ref, arrow2Ref,
disableKeypad,
} }
const angleProps = { const angleProps = {
@ -95,6 +102,7 @@ export default function WallLineSetting(props) {
length1, length1,
setLength1, setLength1,
length1Ref, length1Ref,
disableKeypad,
} }
const diagonalLineProps = { const diagonalLineProps = {
@ -111,6 +119,7 @@ export default function WallLineSetting(props) {
setArrow1, setArrow1,
arrow2, arrow2,
setArrow2, setArrow2,
disableKeypad,
} }
return ( return (
@ -164,6 +173,9 @@ export default function WallLineSetting(props) {
</div> </div>
<div className="normal-font mt10">{getMessage('outerLine.property.info')}</div> <div className="normal-font mt10">{getMessage('outerLine.property.info')}</div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap">
<button className="mr5" style={{ verticalAlign: 'middle' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal mr5" onClick={handleRollback}> <button className="btn-frame modal mr5" onClick={handleRollback}>
{getMessage('modal.cover.outline.rollback')} {getMessage('modal.cover.outline.rollback')}
</button> </button>

View File

@ -9,11 +9,13 @@ import { OUTER_LINE_TYPE } from '@/store/outerLineAtom'
import OuterLineWall from '@/components/floor-plan/modal/lineTypes/OuterLineWall' import OuterLineWall from '@/components/floor-plan/modal/lineTypes/OuterLineWall'
import { usePlacementShapeDrawing } from '@/hooks/surface/usePlacementShapeDrawing' import { usePlacementShapeDrawing } from '@/hooks/surface/usePlacementShapeDrawing'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
import Image from 'next/image'
export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) { export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const { closePopup } = usePopup() const { closePopup } = usePopup()
const [buttonAct, setButtonAct] = useState(1) const [buttonAct, setButtonAct] = useState(1)
const [useCalcPad, setUseCalcPad] = useState(false)
const types = [ const types = [
{ id: 1, name: getMessage('straight.line'), type: OUTER_LINE_TYPE.OUTER_LINE }, { id: 1, name: getMessage('straight.line'), type: OUTER_LINE_TYPE.OUTER_LINE },
{ id: 2, name: getMessage('right.angle'), type: OUTER_LINE_TYPE.RIGHT_ANGLE }, { id: 2, name: getMessage('right.angle'), type: OUTER_LINE_TYPE.RIGHT_ANGLE },
@ -49,12 +51,15 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
handleFix, handleFix,
} = usePlacementShapeDrawing(id) } = usePlacementShapeDrawing(id)
const disableKeypad = !useCalcPad
const outerLineProps = { const outerLineProps = {
length1, length1,
setLength1, setLength1,
length1Ref, length1Ref,
arrow1, arrow1,
setArrow1, setArrow1,
disableKeypad,
} }
const rightAngleProps = { const rightAngleProps = {
@ -68,6 +73,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
setArrow1, setArrow1,
arrow2, arrow2,
setArrow2, setArrow2,
disableKeypad,
} }
const doublePitchProps = { const doublePitchProps = {
@ -89,6 +95,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
setArrow2, setArrow2,
arrow1Ref, arrow1Ref,
arrow2Ref, arrow2Ref,
disableKeypad,
} }
const angleProps = { const angleProps = {
@ -98,6 +105,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
length1, length1,
setLength1, setLength1,
length1Ref, length1Ref,
disableKeypad,
} }
const diagonalLineProps = { const diagonalLineProps = {
@ -114,6 +122,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
setArrow1, setArrow1,
arrow2, arrow2,
setArrow2, setArrow2,
disableKeypad,
} }
const onClickButton = (button) => { const onClickButton = (button) => {
@ -140,6 +149,9 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap">
<button className="mr5" style={{ verticalAlign: 'middle' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal mr5" onClick={handleRollback}> <button className="btn-frame modal mr5" onClick={handleRollback}>
{getMessage('modal.cover.outline.rollback')} {getMessage('modal.cover.outline.rollback')}
</button> </button>

View File

@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import Image from 'next/image'
import { useMessage } from '@/hooks/useMessage' import { useMessage } from '@/hooks/useMessage'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
@ -35,6 +35,8 @@ export const ROOF_MATERIAL_LAYOUT = {
export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, planNo, openPoint }) { export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, planNo, openPoint }) {
const [showSizeGuideModal, setShowSizeGuidModal] = useState(false) const [showSizeGuideModal, setShowSizeGuidModal] = useState(false)
const [showMaterialGuideModal, setShowMaterialGuidModal] = useState(false) const [showMaterialGuideModal, setShowMaterialGuidModal] = useState(false)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const { getMessage } = useMessage() const { getMessage } = useMessage()
const roofMaterials = useRecoilValue(roofMaterialsAtom) const roofMaterials = useRecoilValue(roofMaterialsAtom)
@ -398,6 +400,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
}} }}
readOnly={currentRoof?.widAuth === 'R'} readOnly={currentRoof?.widAuth === 'R'}
disabled={currentRoof?.roofSizeSet === '3'} disabled={currentRoof?.roofSizeSet === '3'}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false, //(index !== 0), allowDecimal: false, //(index !== 0),
@ -433,6 +436,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
}} }}
readOnly={currentRoof?.lenAuth === 'R'} readOnly={currentRoof?.lenAuth === 'R'}
disabled={currentRoof?.roofSizeSet === '3'} disabled={currentRoof?.roofSizeSet === '3'}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false, //(index !== 0), allowDecimal: false, //(index !== 0),
@ -490,6 +494,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
}} }}
readOnly={currentRoof?.roofPchAuth === 'R'} readOnly={currentRoof?.roofPchAuth === 'R'}
disabled={currentRoof?.roofSizeSet === '3'} disabled={currentRoof?.roofSizeSet === '3'}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false, //(index !== 0), allowDecimal: false, //(index !== 0),
@ -588,6 +593,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
})) }))
} }
}} }}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true, allowDecimal: true,
@ -603,7 +609,10 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
</tbody> </tbody>
</table> </table>
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
<button style={{ width: 'auto' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal act" onClick={handleSaveBtn}> <button className="btn-frame modal act" onClick={handleSaveBtn}>
{getMessage('modal.common.save')} {getMessage('modal.common.save')}
</button> </button>

View File

@ -5,7 +5,7 @@ import { CalculatorInput } from '@/components/common/input/CalcInput'
const PlacementSurface = forwardRef((props, refs) => { const PlacementSurface = forwardRef((props, refs) => {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const { id, lines, info, rotate, xInversion, yInversion } = props const { id, lines, info, rotate, xInversion, yInversion, disableKeypad } = props
let { length1, length2, length3, length4, length5, lengthetc, azimuth } = refs let { length1, length2, length3, length4, length5, lengthetc, azimuth } = refs
const [azimuthDirection, setAzimuthDirection] = useState(azimuth.current) const [azimuthDirection, setAzimuthDirection] = useState(azimuth.current)
@ -114,6 +114,7 @@ const PlacementSurface = forwardRef((props, refs) => {
? length4 ? length4
: length5 : length5
} }
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false allowDecimal: false

View File

@ -19,6 +19,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
const canvas = useRecoilValue(canvasState) const canvas = useRecoilValue(canvasState)
const { closePopup } = usePopup() const { closePopup } = usePopup()
const [isHidden, setIsHidden] = useState(false) const [isHidden, setIsHidden] = useState(false)
const [useCalcPad, setUseCalcPad] = useState(false)
const { applySurfaceShape } = useSurfaceShapeBatch({ isHidden, setIsHidden }) const { applySurfaceShape } = useSurfaceShapeBatch({ isHidden, setIsHidden })
@ -217,6 +218,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
rotate, rotate,
xInversion, xInversion,
yInversion, yInversion,
disableKeypad: !useCalcPad,
} }
const getInversionState = () => { const getInversionState = () => {
@ -291,7 +293,10 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
</div> </div>
<div className="plane-detail-wrap"> <div className="plane-detail-wrap">
<PlacementSurface {...placementSurfaceProps} ref={surfaceRefs} /> <PlacementSurface {...placementSurfaceProps} ref={surfaceRefs} />
<div className="plane-shape-btn"> <div className="plane-shape-btn" style={{ display: 'flex', alignItems: 'center', gap: '5px' }}>
<button style={{ width: 'auto' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal act" onClick={applySurfaces}> <button className="btn-frame modal act" onClick={applySurfaces}>
{getMessage('write')} {getMessage('write')}
</button> </button>

View File

@ -1,5 +1,6 @@
import { useMessage } from '@/hooks/useMessage' import { useMessage } from '@/hooks/useMessage'
import WithDraggable from '@/components/common/draggable/WithDraggable' import WithDraggable from '@/components/common/draggable/WithDraggable'
import Image from 'next/image'
import QSelectBox from '@/components/common/select/QSelectBox' import QSelectBox from '@/components/common/select/QSelectBox'
import { useRoofAllocationSetting } from '@/hooks/roofcover/useRoofAllocationSetting' import { useRoofAllocationSetting } from '@/hooks/roofcover/useRoofAllocationSetting'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
@ -38,6 +39,8 @@ export default function ContextRoofAllocationSetting(props) {
handleChangePitch, handleChangePitch,
} = useRoofAllocationSetting(id) } = useRoofAllocationSetting(id)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const { findCommonCode } = useCommonCode() const { findCommonCode } = useCommonCode()
const pitchText = useRecoilValue(pitchTextSelector) const pitchText = useRecoilValue(pitchTextSelector)
const globalLocale = useRecoilValue(globalLocaleStore) const globalLocale = useRecoilValue(globalLocaleStore)
@ -223,6 +226,7 @@ export default function ContextRoofAllocationSetting(props) {
onChange={(value) => { onChange={(value) => {
handleChangePitch(value, index) handleChangePitch(value, index)
}} }}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),
@ -238,7 +242,10 @@ export default function ContextRoofAllocationSetting(props) {
})} })}
</div> </div>
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
<button style={{ width: 'auto' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal act" onClick={handleSaveContext}> <button className="btn-frame modal act" onClick={handleSaveContext}>
{getMessage('modal.roof.alloc.apply')} {getMessage('modal.roof.alloc.apply')}
</button> </button>

View File

@ -1,5 +1,6 @@
import { useMessage } from '@/hooks/useMessage' import { useMessage } from '@/hooks/useMessage'
import WithDraggable from '@/components/common/draggable/WithDraggable' import WithDraggable from '@/components/common/draggable/WithDraggable'
import Image from 'next/image'
import QSelectBox from '@/components/common/select/QSelectBox' import QSelectBox from '@/components/common/select/QSelectBox'
import { useRoofAllocationSetting } from '@/hooks/roofcover/useRoofAllocationSetting' import { useRoofAllocationSetting } from '@/hooks/roofcover/useRoofAllocationSetting'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
@ -37,6 +38,8 @@ export default function RoofAllocationSetting(props) {
handleChangeInput, handleChangeInput,
handleChangePitch, handleChangePitch,
} = useRoofAllocationSetting(id) } = useRoofAllocationSetting(id)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const pitchText = useRecoilValue(pitchTextSelector) const pitchText = useRecoilValue(pitchTextSelector)
const { findCommonCode } = useCommonCode() const { findCommonCode } = useCommonCode()
const [raftCodes, setRaftCodes] = useState([]) const [raftCodes, setRaftCodes] = useState([])
@ -224,6 +227,7 @@ export default function RoofAllocationSetting(props) {
onChange={(value) => { onChange={(value) => {
handleChangePitch(value, index) handleChangePitch(value, index)
}} }}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),
@ -260,7 +264,10 @@ export default function RoofAllocationSetting(props) {
})} })}
</div> </div>
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
<button style={{ width: 'auto' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal act" onClick={handleSave}> <button className="btn-frame modal act" onClick={handleSave}>
{getMessage('modal.roof.alloc.apply')} {getMessage('modal.roof.alloc.apply')}
</button> </button>

View File

@ -7,9 +7,11 @@ import Direction from '@/components/floor-plan/modal/roofShape/type/Direction'
import { useRoofShapeSetting } from '@/hooks/roofcover/useRoofShapeSetting' import { useRoofShapeSetting } from '@/hooks/roofcover/useRoofShapeSetting'
import { useMessage } from '@/hooks/useMessage' import { useMessage } from '@/hooks/useMessage'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
import { useState } from 'react'
export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) { export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const [useCalcPad, setUseCalcPad] = useState(false)
const { const {
shapeNum, shapeNum,
setShapeNum, setShapeNum,
@ -44,8 +46,10 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
} = useRoofShapeSetting(id) } = useRoofShapeSetting(id)
const { closePopup } = usePopup() const { closePopup } = usePopup()
const ridgeProps = { pitch, setPitch, eavesOffset, setEavesOffset, pitchText } const disableKeypad = !useCalcPad
const patternProps = { pitch, setPitch, eavesOffset, setEavesOffset, gableOffset, setGableOffset, pitchText }
const ridgeProps = { pitch, setPitch, eavesOffset, setEavesOffset, pitchText, disableKeypad }
const patternProps = { pitch, setPitch, eavesOffset, setEavesOffset, gableOffset, setGableOffset, pitchText, disableKeypad }
const sideProps = { const sideProps = {
pitch, pitch,
setPitch, setPitch,
@ -73,6 +77,7 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
handleConfirm, handleConfirm,
handleRollBack, handleRollBack,
pitchText, pitchText,
disableKeypad,
} }
const directionProps = { const directionProps = {
@ -85,6 +90,7 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
shedWidth, shedWidth,
setShedWidth, setShedWidth,
pitchText, pitchText,
disableKeypad,
} }
return ( return (
@ -108,6 +114,9 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
{(shapeNum === 5 || shapeNum === 6 || shapeNum === 7 || shapeNum === 8) && <Direction {...directionProps} />} {(shapeNum === 5 || shapeNum === 6 || shapeNum === 7 || shapeNum === 8) && <Direction {...directionProps} />}
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap">
<button className="mr5" style={{ verticalAlign: 'middle' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal act" onClick={() => handleSave(id)}> <button className="btn-frame modal act" onClick={() => handleSave(id)}>
{getMessage('common.setting.finish')} {getMessage('common.setting.finish')}
</button> </button>

View File

@ -2,7 +2,7 @@ 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' 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, disableKeypad }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
return ( return (
<div className="setting-box"> <div className="setting-box">
@ -24,6 +24,7 @@ export default function Direction({ pitch, setPitch, eavesOffset, setEavesOffset
className="input-origin block" className="input-origin block"
value={pitch} value={pitch}
onChange={(value) => setPitch(value)} onChange={(value) => setPitch(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),
@ -50,6 +51,7 @@ export default function Direction({ pitch, setPitch, eavesOffset, setEavesOffset
className="input-origin block" className="input-origin block"
value={eavesOffset} value={eavesOffset}
onChange={(value) => setEavesOffset(value)} onChange={(value) => setEavesOffset(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),
@ -76,6 +78,7 @@ export default function Direction({ pitch, setPitch, eavesOffset, setEavesOffset
className="input-origin block" className="input-origin block"
value={gableOffset} value={gableOffset}
onChange={(value) => setGableOffset(value)} onChange={(value) => setGableOffset(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),
@ -102,6 +105,7 @@ export default function Direction({ pitch, setPitch, eavesOffset, setEavesOffset
className="input-origin block" className="input-origin block"
value={shedWidth} value={shedWidth}
onChange={(value) => setShedWidth(value)} onChange={(value) => setShedWidth(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),

View File

@ -4,7 +4,7 @@ import { CalculatorInput } from '@/components/common/input/CalcInput'
export default function Pattern(props) { export default function Pattern(props) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const { pitch, setPitch, eavesOffset, setEavesOffset, gableOffset, setGableOffset, pitchText } = props const { pitch, setPitch, eavesOffset, setEavesOffset, gableOffset, setGableOffset, pitchText, disableKeypad } = props
return ( return (
<div className="setting-box"> <div className="setting-box">
<div className="outline-form mb10"> <div className="outline-form mb10">
@ -21,6 +21,7 @@ export default function Pattern(props) {
className="input-origin block" className="input-origin block"
value={pitch} value={pitch}
onChange={(value) => setPitch(value)} onChange={(value) => setPitch(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),
@ -43,6 +44,7 @@ export default function Pattern(props) {
className="input-origin block" className="input-origin block"
value={eavesOffset} value={eavesOffset}
onChange={(value) => setEavesOffset(value)} onChange={(value) => setEavesOffset(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),
@ -65,6 +67,7 @@ export default function Pattern(props) {
className="input-origin block" className="input-origin block"
value={gableOffset} value={gableOffset}
onChange={(value) => setGableOffset(value)} onChange={(value) => setGableOffset(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),

View File

@ -5,7 +5,7 @@ import { CalculatorInput } from '@/components/common/input/CalcInput'
export default function Ridge(props) { export default function Ridge(props) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
const { pitch, setPitch, eavesOffset, setEavesOffset, pitchText } = props const { pitch, setPitch, eavesOffset, setEavesOffset, pitchText, disableKeypad } = props
return ( return (
<div className="setting-box"> <div className="setting-box">
@ -23,6 +23,7 @@ export default function Ridge(props) {
className="input-origin block" className="input-origin block"
value={pitch} value={pitch}
onChange={(value) => setPitch(value)} onChange={(value) => setPitch(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),
@ -45,6 +46,7 @@ export default function Ridge(props) {
className="input-origin block" className="input-origin block"
value={eavesOffset} value={eavesOffset}
onChange={(value) => setEavesOffset(value)} onChange={(value) => setEavesOffset(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),

View File

@ -35,14 +35,15 @@ export default function Side(props) {
pitchText, pitchText,
shedPitch, shedPitch,
setShedPitch, setShedPitch,
disableKeypad,
} = props } = props
const eavesProps = { pitch, setPitch, eavesOffset, setEavesOffset, pitchText } const eavesProps = { pitch, setPitch, eavesOffset, setEavesOffset, pitchText, disableKeypad }
const gableProps = { gableOffset, setGableOffset } const gableProps = { gableOffset, setGableOffset, disableKeypad }
const wallProps = { sleeveOffset, setSleeveOffset, hasSleeve, setHasSleeve } const wallProps = { sleeveOffset, setSleeveOffset, hasSleeve, setHasSleeve, disableKeypad }
const hipAndGableProps = { pitch, setPitch, eavesOffset, setEavesOffset, hipAndGableWidth, setHipAndGableWidth, pitchText } const hipAndGableProps = { pitch, setPitch, eavesOffset, setEavesOffset, hipAndGableWidth, setHipAndGableWidth, pitchText, disableKeypad }
const jerkinheadProps = { gableOffset, setGableOffset, jerkinHeadWidth, setJerkinHeadWidth, jerkinHeadPitch, setJerkinHeadPitch, pitchText } const jerkinheadProps = { gableOffset, setGableOffset, jerkinHeadWidth, setJerkinHeadWidth, jerkinHeadPitch, setJerkinHeadPitch, pitchText, disableKeypad }
const shedProps = { shedWidth, setShedWidth, shedPitch, setShedPitch, pitchText } const shedProps = { shedWidth, setShedWidth, shedPitch, setShedPitch, pitchText, disableKeypad }
const { getMessage } = useMessage() const { getMessage } = useMessage()

View File

@ -2,7 +2,7 @@ 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' 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, disableKeypad }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
return ( return (
<> <>
@ -20,6 +20,7 @@ export default function Eaves({ pitch, setPitch, eavesOffset, setEavesOffset, pi
className="input-origin block" className="input-origin block"
value={pitch} value={pitch}
onChange={(value) => setPitch(value)} onChange={(value) => setPitch(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),
@ -43,6 +44,7 @@ export default function Eaves({ pitch, setPitch, eavesOffset, setEavesOffset, pi
className="input-origin block" className="input-origin block"
value={eavesOffset} value={eavesOffset}
onChange={(value) => setEavesOffset(value)} onChange={(value) => setEavesOffset(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),

View File

@ -3,7 +3,7 @@ import { useEffect } from 'react'
import { normalizeDigits } from '@/util/input-utils' import { normalizeDigits } from '@/util/input-utils'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
export default function Gable({ gableOffset, setGableOffset }) { export default function Gable({ gableOffset, setGableOffset, disableKeypad }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
return ( return (
@ -20,6 +20,7 @@ export default function Gable({ gableOffset, setGableOffset }) {
className="input-origin block" className="input-origin block"
value={gableOffset} value={gableOffset}
onChange={(value) => setGableOffset(value)} onChange={(value) => setGableOffset(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),

View File

@ -2,7 +2,7 @@ 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' 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, disableKeypad }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
return ( return (
<> <>
@ -20,6 +20,7 @@ export default function HipAndGable({ pitch, setPitch, eavesOffset, setEavesOffs
className="input-origin block" className="input-origin block"
value={pitch} value={pitch}
onChange={(value) => setPitch(value)} onChange={(value) => setPitch(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),
@ -42,6 +43,7 @@ export default function HipAndGable({ pitch, setPitch, eavesOffset, setEavesOffs
className="input-origin block" className="input-origin block"
value={eavesOffset} value={eavesOffset}
onChange={(value) => setEavesOffset(value)} onChange={(value) => setEavesOffset(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),
@ -69,6 +71,7 @@ export default function HipAndGable({ pitch, setPitch, eavesOffset, setEavesOffs
className="input-origin block" className="input-origin block"
value={hipAndGableWidth} value={hipAndGableWidth}
onChange={(value) => setHipAndGableWidth(value)} onChange={(value) => setHipAndGableWidth(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),

View File

@ -10,6 +10,7 @@ export default function Jerkinhead({
jerkinHeadPitch, jerkinHeadPitch,
setJerkinHeadPitch, setJerkinHeadPitch,
pitchText, pitchText,
disableKeypad,
}) { }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
return ( return (
@ -28,6 +29,7 @@ export default function Jerkinhead({
className="input-origin block" className="input-origin block"
value={gableOffset} value={gableOffset}
onChange={(value) => setGableOffset(value)} onChange={(value) => setGableOffset(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),
@ -51,6 +53,7 @@ export default function Jerkinhead({
className="input-origin block" className="input-origin block"
value={jerkinHeadWidth} value={jerkinHeadWidth}
onChange={(value) => setJerkinHeadWidth(value)} onChange={(value) => setJerkinHeadWidth(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),
@ -77,6 +80,7 @@ export default function Jerkinhead({
className="input-origin block" className="input-origin block"
value={jerkinHeadPitch} value={jerkinHeadPitch}
onChange={(value) => setJerkinHeadPitch(value)} onChange={(value) => setJerkinHeadPitch(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),

View File

@ -2,7 +2,7 @@ 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' import { CalculatorInput } from '@/components/common/input/CalcInput'
export default function Shed({ shedWidth, setShedWidth, shedPitch, setShedPitch, pitchText }) { export default function Shed({ shedWidth, setShedWidth, shedPitch, setShedPitch, pitchText, disableKeypad }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
return ( return (
<> <>
@ -18,6 +18,7 @@ export default function Shed({ shedWidth, setShedWidth, shedPitch, setShedPitch,
className="input-origin block" className="input-origin block"
value={shedPitch} value={shedPitch}
onChange={(value) => setShedPitch(value)} onChange={(value) => setShedPitch(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),
@ -38,6 +39,7 @@ export default function Shed({ shedWidth, setShedWidth, shedPitch, setShedPitch,
className="input-origin block" className="input-origin block"
value={shedWidth} value={shedWidth}
onChange={(value) => setShedWidth(value)} onChange={(value) => setShedWidth(value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),

View File

@ -3,7 +3,7 @@ import { useMessage } from '@/hooks/useMessage'
import { normalizeDigits } from '@/util/input-utils' import { normalizeDigits } from '@/util/input-utils'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
export default function Wall({ sleeveOffset, setSleeveOffset, hasSleeve, setHasSleeve }) { export default function Wall({ sleeveOffset, setSleeveOffset, hasSleeve, setHasSleeve, disableKeypad }) {
const { getMessage } = useMessage() const { getMessage } = useMessage()
return ( return (
<> <>
@ -43,6 +43,7 @@ export default function Wall({ sleeveOffset, setSleeveOffset, hasSleeve, setHasS
value={sleeveOffset} value={sleeveOffset}
onChange={(value) => setSleeveOffset(value)} onChange={(value) => setSleeveOffset(value)}
readOnly={hasSleeve === '0'} readOnly={hasSleeve === '0'}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false //(index !== 0), allowDecimal: false //(index !== 0),

View File

@ -24,8 +24,11 @@ import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
import { useSwal } from '@/hooks/useSwal' import { useSwal } from '@/hooks/useSwal'
import { sanitizeIntegerInputEvent } from '@/util/input-utils' import { sanitizeIntegerInputEvent } from '@/util/input-utils'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
import Image from 'next/image'
export default function StuffDetail() { export default function StuffDetail() {
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState) const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState)
const { swalFire } = useSwal() const { swalFire } = useSwal()
const { setIsGlobalLoading } = useContext(QcastContext) const { setIsGlobalLoading } = useContext(QcastContext)
@ -1761,6 +1764,9 @@ export default function StuffDetail() {
> >
{getMessage('stuff.detail.btn.moveList')} {getMessage('stuff.detail.btn.moveList')}
</button> </button>
<button style={{ width: 'auto', marginLeft: '8px' }} type="button" onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON.png' : '/static/images/common/Icon_OFF.png'} alt="toggle" width={34} height={34} />
</button>
</div> </div>
</div> </div>
<div className="infomation-table"> <div className="infomation-table">
@ -2161,6 +2167,7 @@ export default function StuffDetail() {
className="input-light" className="input-light"
value={form.watch('verticalSnowCover') || ''} value={form.watch('verticalSnowCover') || ''}
onChange={(value) => form.setValue('verticalSnowCover', value)} onChange={(value) => form.setValue('verticalSnowCover', value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false, allowDecimal: false,
@ -2233,6 +2240,7 @@ export default function StuffDetail() {
className="input-light" className="input-light"
value={form.watch('installHeight') || ''} value={form.watch('installHeight') || ''}
onChange={(value) => form.setValue('installHeight', value)} onChange={(value) => form.setValue('installHeight', value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false, allowDecimal: false,
@ -2286,6 +2294,9 @@ export default function StuffDetail() {
> >
{getMessage('stuff.detail.btn.moveList')} {getMessage('stuff.detail.btn.moveList')}
</button> </button>
<button style={{ width: 'auto', marginLeft: '8px' }} type="button" onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON.png' : '/static/images/common/Icon_OFF.png'} alt="toggle" width={34} height={34} />
</button>
</div> </div>
</div> </div>
</form> </form>
@ -2310,12 +2321,16 @@ export default function StuffDetail() {
> >
{getMessage('stuff.detail.btn.moveList')} {getMessage('stuff.detail.btn.moveList')}
</button> </button>
<button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}> <button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}>
{getMessage('stuff.detail.btn.save')} {getMessage('stuff.detail.btn.save')}
</button> </button>
<button type="button" className="btn-origin grey" onClick={onDelete} style={{ display: showButton }}> <button type="button" className="btn-origin grey" onClick={onDelete} style={{ display: showButton }}>
{getMessage('stuff.detail.btn.delete')} {getMessage('stuff.detail.btn.delete')}
</button> </button>
<button style={{ width: 'auto', marginLeft: '8px', marginRight: '8px' }} type="button" onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON.png' : '/static/images/common/Icon_OFF.png'} alt="toggle" width={34} height={34} />
</button>
</div> </div>
</> </>
) : ( ) : (
@ -2337,6 +2352,9 @@ export default function StuffDetail() {
> >
{getMessage('stuff.detail.btn.moveList')} {getMessage('stuff.detail.btn.moveList')}
</button> </button>
<button style={{ width: 'auto', marginLeft: '8px' }} type="button" onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON.png' : '/static/images/common/Icon_OFF.png'} alt="toggle" width={34} height={34} />
</button>
</div> </div>
</> </>
)} )}
@ -2757,6 +2775,7 @@ export default function StuffDetail() {
className="input-light" className="input-light"
value={form.watch('verticalSnowCover') || ''} value={form.watch('verticalSnowCover') || ''}
onChange={(value) => form.setValue('verticalSnowCover', value)} onChange={(value) => form.setValue('verticalSnowCover', value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false, allowDecimal: false,
@ -2833,6 +2852,7 @@ export default function StuffDetail() {
className="input-light" className="input-light"
value={form.watch('installHeight') || ''} value={form.watch('installHeight') || ''}
onChange={(value) => form.setValue('installHeight', value)} onChange={(value) => form.setValue('installHeight', value)}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false, allowDecimal: false,
@ -2917,12 +2937,16 @@ export default function StuffDetail() {
> >
{getMessage('stuff.detail.btn.moveList')} {getMessage('stuff.detail.btn.moveList')}
</button> </button>
<button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}> <button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}>
{getMessage('stuff.detail.btn.save')} {getMessage('stuff.detail.btn.save')}
</button> </button>
<button type="button" className="btn-origin grey" onClick={onDelete} style={{ display: showButton }}> <button type="button" className="btn-origin grey" onClick={onDelete} style={{ display: showButton }}>
{getMessage('stuff.detail.btn.delete')} {getMessage('stuff.detail.btn.delete')}
</button> </button>
<button style={{ width: 'auto', marginLeft: '8px', marginRight: '8px' }} type="button" onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON.png' : '/static/images/common/Icon_OFF.png'} alt="toggle" width={34} height={34} />
</button>
</div> </div>
</> </>
) : ( ) : (
@ -2944,6 +2968,9 @@ export default function StuffDetail() {
> >
{getMessage('stuff.detail.btn.moveList')} {getMessage('stuff.detail.btn.moveList')}
</button> </button>
<button style={{ width: 'auto', marginLeft: '8px' }} type="button" onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON.png' : '/static/images/common/Icon_OFF.png'} alt="toggle" width={34} height={34} />
</button>
</div> </div>
</> </>
)} )}

View File

@ -106,6 +106,7 @@ export const useTrestle = () => {
console.log('모듈이 없거나 계산 실패:', surface.modules?.length || 0) console.log('모듈이 없거나 계산 실패:', surface.modules?.length || 0)
return return
} }
const centerPoints = result.centerPoints const centerPoints = result.centerPoints
const exposedBottomModules = [] // 아래 두면이 모두 노출 되어있는 경우 const exposedBottomModules = [] // 아래 두면이 모두 노출 되어있는 경우
@ -164,11 +165,8 @@ export const useTrestle = () => {
if (isEaveBar) { if (isEaveBar) {
// 처마력바설치 true인 경우 설치 // 처마력바설치 true인 경우 설치
// exposedBottomModules는 아래가 노출된 최하단 모듈이므로 level 체크 없이 항상 설치
exposedBottomModules.forEach((module) => { exposedBottomModules.forEach((module) => {
const level = module.level
if (level > cvrLmtRow) {
return
}
const bottomPoints = findTopTwoPoints([...module.getCurrentPoints()], direction) const bottomPoints = findTopTwoPoints([...module.getCurrentPoints()], direction)
if (!bottomPoints) return if (!bottomPoints) return
const eaveBar = new fabric.Line([bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y], { const eaveBar = new fabric.Line([bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y], {