diff --git a/public/static/images/common/Icon_OFF_Black.png b/public/static/images/common/Icon_OFF_Black.png new file mode 100644 index 00000000..c77f8311 Binary files /dev/null and b/public/static/images/common/Icon_OFF_Black.png differ diff --git a/public/static/images/common/Icon_ON_Black.png b/public/static/images/common/Icon_ON_Black.png new file mode 100644 index 00000000..04c22ff7 Binary files /dev/null and b/public/static/images/common/Icon_ON_Black.png differ diff --git a/src/components/common/input/CalcInput.jsx b/src/components/common/input/CalcInput.jsx index e8a97b93..a92b86c7 100644 --- a/src/components/common/input/CalcInput.jsx +++ b/src/components/common/input/CalcInput.jsx @@ -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 }, 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 [displayValue, setDisplayValue] = useState(value || '0') const [hasOperation, setHasOperation] = useState(false) @@ -478,7 +478,7 @@ export const CalculatorInput = forwardRef( maxLength={maxLength} /> - {showKeypad && !readOnly && ( + {showKeypad && !readOnly && !disableKeypad && (
{getMessage('outerLine.property.info')}
+ diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx index 8010675d..95758b8c 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx @@ -9,11 +9,13 @@ 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 }, @@ -49,12 +51,15 @@ 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 = { @@ -68,6 +73,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) { setArrow1, arrow2, setArrow2, + disableKeypad, } const doublePitchProps = { @@ -89,6 +95,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) { setArrow2, arrow1Ref, arrow2Ref, + disableKeypad, } const angleProps = { @@ -98,6 +105,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) { length1, setLength1, length1Ref, + disableKeypad, } const diagonalLineProps = { @@ -114,6 +122,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) { setArrow1, arrow2, setArrow2, + disableKeypad, } const onClickButton = (button) => { @@ -140,6 +149,9 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
+ diff --git a/src/components/floor-plan/modal/placementSurface/PlacementSurface.jsx b/src/components/floor-plan/modal/placementSurface/PlacementSurface.jsx index 4ede1367..1a7df9d8 100644 --- a/src/components/floor-plan/modal/placementSurface/PlacementSurface.jsx +++ b/src/components/floor-plan/modal/placementSurface/PlacementSurface.jsx @@ -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 } = props + const { id, lines, info, rotate, xInversion, yInversion, disableKeypad } = props let { length1, length2, length3, length4, length5, lengthetc, azimuth } = refs const [azimuthDirection, setAzimuthDirection] = useState(azimuth.current) @@ -114,6 +114,7 @@ const PlacementSurface = forwardRef((props, refs) => { ? length4 : length5 } + disableKeypad={disableKeypad} options={{ allowNegative: false, allowDecimal: false diff --git a/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx b/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx index ae29b778..47a73ab7 100644 --- a/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx +++ b/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx @@ -19,6 +19,7 @@ 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 }) @@ -217,6 +218,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } }) rotate, xInversion, yInversion, + disableKeypad: !useCalcPad, } const getInversionState = () => { @@ -291,7 +293,10 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
-
+
+