Compare commits

..

No commits in common. "3a903385378d7e7479712052d4753ce861e63976" and "a22137210edd6840ca47f4a17c703fd83d542efe" have entirely different histories.

39 changed files with 38 additions and 212 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 B

View File

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

View File

@ -25,10 +25,7 @@ import { QcastContext } from '@/app/QcastProvider'
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
import {normalizeDigits, normalizeDecimal} from '@/util/input-utils'
import { CalculatorInput } from '@/components/common/input/CalcInput'
import Image from 'next/image'
export default function Estimate({}) {
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const [uniqueData, setUniqueData] = useState([])
const [handlePricingFlag, setHandlePricingFlag] = useState(false)
const [specialNoteFirstFlg, setSpecialNoteFirstFlg] = useState(false)
@ -1983,9 +1980,6 @@ export default function Estimate({}) {
<span className="minus"></span>
{getMessage('estimate.detail.showPrice.delItem')}
</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>
@ -2154,7 +2148,6 @@ export default function Estimate({}) {
onChange={(value) =>{
onChangeAmount(value, item.dispOrder, index)
}}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false
@ -2212,7 +2205,6 @@ export default function Estimate({}) {
onChangeSalePrice(value, item.dispOrder, index)
}}
maxLength={12}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false

View File

@ -1,6 +1,5 @@
import { MODULE_SETUP_TYPE, POLYGON_TYPE } from '@/common/common'
import WithDraggable from '@/components/common/draggable/WithDraggable'
import Image from 'next/image'
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
import Placement from '@/components/floor-plan/modal/basic/step/Placement'
@ -76,8 +75,6 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
const { trigger: placementTrigger } = useCanvasPopupStatusController(3)
const [roofsStore, setRoofsStore] = useRecoilState(roofsState)
const [isFold, setIsFold] = useState(false)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
// const { initEvent } = useContext(EventContext)
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup, manualModuleLayoutSetup, restoreModuleInstArea } =
@ -238,7 +235,6 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
}
const orientationProps = {
disableKeypad,
roofs,
setRoofs,
tabNum,
@ -274,7 +270,6 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
updateObjectDataApi,
}
const trestleProps = {
disableKeypad,
roofs,
setRoofs,
setRoofsStore,
@ -325,10 +320,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
)}
</div>
<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>
<div className="grid-btn-wrap">
{/* {tabNum === 1 && <button className="btn-frame modal mr5">{getMessage('modal.common.save')}</button>} */}
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && (
<>

View File

@ -24,7 +24,6 @@ export const Orientation = forwardRef((props, ref) => {
const [moduleSeriesList, setModuleSeriesList] = useState([])
const [filteredModuleList, setFilteredModuleList] = useState([])
const {
disableKeypad,
roofs,
setRoofs,
tabNum,
@ -463,7 +462,6 @@ export const Orientation = forwardRef((props, ref) => {
setInputCompasDeg(value);
}
}}
disableKeypad={disableKeypad}
options={{
allowNegative: true,
allowDecimal: false
@ -566,7 +564,6 @@ export const Orientation = forwardRef((props, ref) => {
className="input-origin block"
value={inputMargin}
onChange={(value) => setInputMargin(value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false
@ -612,7 +609,6 @@ export const Orientation = forwardRef((props, ref) => {
className="input-origin block"
value={inputInstallHeight}
onChange={(value) => handleChangeInstallHeight(value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false
@ -653,7 +649,6 @@ export const Orientation = forwardRef((props, ref) => {
className="input-origin block"
value={inputVerticalSnowCover}
onChange={(value) => handleChangeVerticalSnowCover(value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,7 +14,6 @@ import TriangleDormer from '@/components/floor-plan/modal/object/type/TriangleDo
import PentagonDormer from '@/components/floor-plan/modal/object/type/PentagonDormer'
import { usePopup } from '@/hooks/usePopup'
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
import Image from 'next/image'
export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
const { getMessage } = useMessage()
@ -22,7 +21,6 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
const [buttonAct, setButtonAct] = useState(1)
const { swalFire } = useSwal()
const [isHidden, setIsHidden] = useState(false)
const [useCalcPad, setUseCalcPad] = useState(false)
const { applyOpeningAndShadow, applyDormers } = useObjectBatch({ isHidden, setIsHidden })
const { closePopup } = usePopup()
@ -114,15 +112,12 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
))}
</div>
<div className="properties-setting-wrap outer">
{buttonAct === 1 && <OpenSpace ref={objectPlacement} disableKeypad={!useCalcPad} />}
{buttonAct === 2 && <Shadow ref={objectPlacement} disableKeypad={!useCalcPad} />}
{buttonAct === 3 && <TriangleDormer ref={dormerPlacement} disableKeypad={!useCalcPad} />}
{buttonAct === 4 && <PentagonDormer ref={dormerPlacement} disableKeypad={!useCalcPad} />}
{buttonAct === 1 && <OpenSpace ref={objectPlacement} />}
{buttonAct === 2 && <Shadow ref={objectPlacement} />}
{buttonAct === 3 && <TriangleDormer ref={dormerPlacement} />}
{buttonAct === 4 && <PentagonDormer ref={dormerPlacement} />}
</div>
<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={() => {

View File

@ -1,7 +1,6 @@
'use client'
import { useRecoilValue } from 'recoil'
import Image from 'next/image'
import { useMessage } from '@/hooks/useMessage'
import WithDraggable from '@/components/common/draggable/WithDraggable'
import { usePopup } from '@/hooks/usePopup'
@ -24,8 +23,6 @@ export default function SizeSetting(props) {
const heightRef = useRef(null)
const [width, setWidth] = useState(target?.width ? (target.width * 10).toFixed() : 0)
const [height, setHeight] = useState(target?.height ? (target.height * 10) : 0)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
// const { initEvent } = useEvent()
// const { initEvent } = useContext(EventContext)
@ -75,7 +72,6 @@ export default function SizeSetting(props) {
value={width}
ref={widthRef}
onChange={(value) => setWidth(value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false
@ -103,7 +99,6 @@ export default function SizeSetting(props) {
value={height}
ref={heightRef}
onChange={(value) => setHeight(value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false
@ -122,10 +117,7 @@ export default function SizeSetting(props) {
</div>
</div>
</div>
<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>
<div className="grid-btn-wrap">
<button className="btn-frame modal act" onClick={() => handleReSizeObject(id)}>
{getMessage('write')}
</button>

View File

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

View File

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

View File

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

View File

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

View File

@ -11,7 +11,6 @@ import DoublePitch from '@/components/floor-plan/modal/lineTypes/DoublePitch'
import Diagonal from '@/components/floor-plan/modal/lineTypes/Diagonal'
import { usePopup } from '@/hooks/usePopup'
import { useState } from 'react'
import Image from 'next/image'
import { v4 as uuidv4 } from 'uuid'
export default function WallLineSetting(props) {
@ -19,7 +18,6 @@ export default function WallLineSetting(props) {
const { addPopup, closePopup } = usePopup()
const { getMessage } = useMessage()
const [propertiesId, setPropertiesId] = useState(uuidv4())
const [useCalcPad, setUseCalcPad] = useState(false)
const {
length1,
setLength1,
@ -48,15 +46,12 @@ export default function WallLineSetting(props) {
handleFix,
} = useOuterLineWall(id, propertiesId)
const disableKeypad = !useCalcPad
const outerLineProps = {
length1,
setLength1,
length1Ref,
arrow1,
setArrow1,
disableKeypad,
}
const rightAngleProps = {
@ -70,7 +65,6 @@ export default function WallLineSetting(props) {
setArrow1,
arrow2,
setArrow2,
disableKeypad,
}
const doublePitchProps = {
@ -92,7 +86,6 @@ export default function WallLineSetting(props) {
setArrow2,
arrow1Ref,
arrow2Ref,
disableKeypad,
}
const angleProps = {
@ -102,7 +95,6 @@ export default function WallLineSetting(props) {
length1,
setLength1,
length1Ref,
disableKeypad,
}
const diagonalLineProps = {
@ -119,7 +111,6 @@ export default function WallLineSetting(props) {
setArrow1,
arrow2,
setArrow2,
disableKeypad,
}
return (
@ -173,9 +164,6 @@ export default function WallLineSetting(props) {
</div>
<div className="normal-font mt10">{getMessage('outerLine.property.info')}</div>
<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}>
{getMessage('modal.cover.outline.rollback')}
</button>

View File

@ -9,13 +9,11 @@ import { OUTER_LINE_TYPE } from '@/store/outerLineAtom'
import OuterLineWall from '@/components/floor-plan/modal/lineTypes/OuterLineWall'
import { usePlacementShapeDrawing } from '@/hooks/surface/usePlacementShapeDrawing'
import { usePopup } from '@/hooks/usePopup'
import Image from 'next/image'
export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
const { getMessage } = useMessage()
const { closePopup } = usePopup()
const [buttonAct, setButtonAct] = useState(1)
const [useCalcPad, setUseCalcPad] = useState(false)
const types = [
{ id: 1, name: getMessage('straight.line'), type: OUTER_LINE_TYPE.OUTER_LINE },
{ id: 2, name: getMessage('right.angle'), type: OUTER_LINE_TYPE.RIGHT_ANGLE },
@ -51,15 +49,12 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
handleFix,
} = usePlacementShapeDrawing(id)
const disableKeypad = !useCalcPad
const outerLineProps = {
length1,
setLength1,
length1Ref,
arrow1,
setArrow1,
disableKeypad,
}
const rightAngleProps = {
@ -73,7 +68,6 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
setArrow1,
arrow2,
setArrow2,
disableKeypad,
}
const doublePitchProps = {
@ -95,7 +89,6 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
setArrow2,
arrow1Ref,
arrow2Ref,
disableKeypad,
}
const angleProps = {
@ -105,7 +98,6 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
length1,
setLength1,
length1Ref,
disableKeypad,
}
const diagonalLineProps = {
@ -122,7 +114,6 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
setArrow1,
arrow2,
setArrow2,
disableKeypad,
}
const onClickButton = (button) => {
@ -149,9 +140,6 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
</div>
<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}>
{getMessage('modal.cover.outline.rollback')}
</button>

View File

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

View File

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

View File

@ -19,7 +19,6 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
const canvas = useRecoilValue(canvasState)
const { closePopup } = usePopup()
const [isHidden, setIsHidden] = useState(false)
const [useCalcPad, setUseCalcPad] = useState(false)
const { applySurfaceShape } = useSurfaceShapeBatch({ isHidden, setIsHidden })
@ -218,7 +217,6 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
rotate,
xInversion,
yInversion,
disableKeypad: !useCalcPad,
}
const getInversionState = () => {
@ -293,10 +291,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
</div>
<div className="plane-detail-wrap">
<PlacementSurface {...placementSurfaceProps} ref={surfaceRefs} />
<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>
<div className="plane-shape-btn">
<button className="btn-frame modal act" onClick={applySurfaces}>
{getMessage('write')}
</button>

View File

@ -1,6 +1,5 @@
import { useMessage } from '@/hooks/useMessage'
import WithDraggable from '@/components/common/draggable/WithDraggable'
import Image from 'next/image'
import QSelectBox from '@/components/common/select/QSelectBox'
import { useRoofAllocationSetting } from '@/hooks/roofcover/useRoofAllocationSetting'
import { usePopup } from '@/hooks/usePopup'
@ -39,8 +38,6 @@ export default function ContextRoofAllocationSetting(props) {
handleChangePitch,
} = useRoofAllocationSetting(id)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const { findCommonCode } = useCommonCode()
const pitchText = useRecoilValue(pitchTextSelector)
const globalLocale = useRecoilValue(globalLocaleStore)
@ -226,7 +223,6 @@ export default function ContextRoofAllocationSetting(props) {
onChange={(value) => {
handleChangePitch(value, index)
}}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: true //(index !== 0),
@ -242,10 +238,7 @@ export default function ContextRoofAllocationSetting(props) {
})}
</div>
</div>
<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>
<div className="grid-btn-wrap">
<button className="btn-frame modal act" onClick={handleSaveContext}>
{getMessage('modal.roof.alloc.apply')}
</button>

View File

@ -1,6 +1,5 @@
import { useMessage } from '@/hooks/useMessage'
import WithDraggable from '@/components/common/draggable/WithDraggable'
import Image from 'next/image'
import QSelectBox from '@/components/common/select/QSelectBox'
import { useRoofAllocationSetting } from '@/hooks/roofcover/useRoofAllocationSetting'
import { usePopup } from '@/hooks/usePopup'
@ -38,8 +37,6 @@ export default function RoofAllocationSetting(props) {
handleChangeInput,
handleChangePitch,
} = useRoofAllocationSetting(id)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const pitchText = useRecoilValue(pitchTextSelector)
const { findCommonCode } = useCommonCode()
const [raftCodes, setRaftCodes] = useState([])
@ -227,7 +224,6 @@ export default function RoofAllocationSetting(props) {
onChange={(value) => {
handleChangePitch(value, index)
}}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: true //(index !== 0),
@ -264,10 +260,7 @@ export default function RoofAllocationSetting(props) {
})}
</div>
</div>
<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>
<div className="grid-btn-wrap">
<button className="btn-frame modal act" onClick={handleSave}>
{getMessage('modal.roof.alloc.apply')}
</button>

View File

@ -7,11 +7,9 @@ import Direction from '@/components/floor-plan/modal/roofShape/type/Direction'
import { useRoofShapeSetting } from '@/hooks/roofcover/useRoofShapeSetting'
import { useMessage } from '@/hooks/useMessage'
import { usePopup } from '@/hooks/usePopup'
import { useState } from 'react'
export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
const { getMessage } = useMessage()
const [useCalcPad, setUseCalcPad] = useState(false)
const {
shapeNum,
setShapeNum,
@ -46,10 +44,8 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
} = useRoofShapeSetting(id)
const { closePopup } = usePopup()
const disableKeypad = !useCalcPad
const ridgeProps = { pitch, setPitch, eavesOffset, setEavesOffset, pitchText, disableKeypad }
const patternProps = { pitch, setPitch, eavesOffset, setEavesOffset, gableOffset, setGableOffset, pitchText, disableKeypad }
const ridgeProps = { pitch, setPitch, eavesOffset, setEavesOffset, pitchText }
const patternProps = { pitch, setPitch, eavesOffset, setEavesOffset, gableOffset, setGableOffset, pitchText }
const sideProps = {
pitch,
setPitch,
@ -77,7 +73,6 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
handleConfirm,
handleRollBack,
pitchText,
disableKeypad,
}
const directionProps = {
@ -90,7 +85,6 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
shedWidth,
setShedWidth,
pitchText,
disableKeypad,
}
return (
@ -114,9 +108,6 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
{(shapeNum === 5 || shapeNum === 6 || shapeNum === 7 || shapeNum === 8) && <Direction {...directionProps} />}
</div>
<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)}>
{getMessage('common.setting.finish')}
</button>

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@ import { useMessage } from '@/hooks/useMessage'
import { normalizeDecimalLimit, normalizeDigits } from '@/util/input-utils'
import { CalculatorInput } from '@/components/common/input/CalcInput'
export default function Eaves({ pitch, setPitch, eavesOffset, setEavesOffset, pitchText, disableKeypad }) {
export default function Eaves({ pitch, setPitch, eavesOffset, setEavesOffset, pitchText }) {
const { getMessage } = useMessage()
return (
<>
@ -20,7 +20,6 @@ export default function Eaves({ pitch, setPitch, eavesOffset, setEavesOffset, pi
className="input-origin block"
value={pitch}
onChange={(value) => setPitch(value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: true //(index !== 0),
@ -44,7 +43,6 @@ export default function Eaves({ pitch, setPitch, eavesOffset, setEavesOffset, pi
className="input-origin block"
value={eavesOffset}
onChange={(value) => setEavesOffset(value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false //(index !== 0),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,11 +24,8 @@ import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
import { useSwal } from '@/hooks/useSwal'
import { sanitizeIntegerInputEvent } from '@/util/input-utils'
import { CalculatorInput } from '@/components/common/input/CalcInput'
import Image from 'next/image'
export default function StuffDetail() {
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState)
const { swalFire } = useSwal()
const { setIsGlobalLoading } = useContext(QcastContext)
@ -1747,9 +1744,6 @@ export default function StuffDetail() {
>
{getMessage('stuff.detail.btn.moveList')}
</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 className="infomation-table">
@ -2150,7 +2144,6 @@ export default function StuffDetail() {
className="input-light"
value={form.watch('verticalSnowCover') || ''}
onChange={(value) => form.setValue('verticalSnowCover', value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false,
@ -2223,7 +2216,6 @@ export default function StuffDetail() {
className="input-light"
value={form.watch('installHeight') || ''}
onChange={(value) => form.setValue('installHeight', value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false,
@ -2277,9 +2269,6 @@ export default function StuffDetail() {
>
{getMessage('stuff.detail.btn.moveList')}
</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>
</form>
@ -2304,16 +2293,12 @@ export default function StuffDetail() {
>
{getMessage('stuff.detail.btn.moveList')}
</button>
<button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}>
{getMessage('stuff.detail.btn.save')}
</button>
<button type="button" className="btn-origin grey" onClick={onDelete} style={{ display: showButton }}>
{getMessage('stuff.detail.btn.delete')}
</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>
</>
) : (
@ -2335,9 +2320,6 @@ export default function StuffDetail() {
>
{getMessage('stuff.detail.btn.moveList')}
</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>
</>
)}
@ -2758,7 +2740,6 @@ export default function StuffDetail() {
className="input-light"
value={form.watch('verticalSnowCover') || ''}
onChange={(value) => form.setValue('verticalSnowCover', value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false,
@ -2835,7 +2816,6 @@ export default function StuffDetail() {
className="input-light"
value={form.watch('installHeight') || ''}
onChange={(value) => form.setValue('installHeight', value)}
disableKeypad={disableKeypad}
options={{
allowNegative: false,
allowDecimal: false,
@ -2920,16 +2900,12 @@ export default function StuffDetail() {
>
{getMessage('stuff.detail.btn.moveList')}
</button>
<button type="button" onClick={() => onValid('save')} className="btn-origin navy mr5" style={{ display: showButton }}>
{getMessage('stuff.detail.btn.save')}
</button>
<button type="button" className="btn-origin grey" onClick={onDelete} style={{ display: showButton }}>
{getMessage('stuff.detail.btn.delete')}
</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>
</>
) : (
@ -2951,9 +2927,6 @@ export default function StuffDetail() {
>
{getMessage('stuff.detail.btn.moveList')}
</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>
</>
)}