Compare commits
No commits in common. "25fd99064e4a4afffa9a0c77effb984f06777283" and "dd7ffb3fd159f5147c58b4598af8be7d4c911594" have entirely different histories.
25fd99064e
...
dd7ffb3fd1
@ -8,17 +8,14 @@ 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 { useAuxiliaryDrawing } from '@/hooks/roofcover/useAuxiliaryDrawing'
|
import { useAuxiliaryDrawing } from '@/hooks/roofcover/useAuxiliaryDrawing'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect } from 'react'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { canvasState } from '@/store/canvasAtom'
|
import { canvasState } from '@/store/canvasAtom'
|
||||||
import Image from 'next/image'
|
|
||||||
|
|
||||||
export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) {
|
export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const [useCalcPad, setUseCalcPad] = useState(false)
|
|
||||||
const disableKeypad = !useCalcPad
|
|
||||||
|
|
||||||
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 },
|
||||||
@ -74,7 +71,6 @@ export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
length1Ref,
|
length1Ref,
|
||||||
arrow1,
|
arrow1,
|
||||||
setArrow1,
|
setArrow1,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const rightAngleProps = {
|
const rightAngleProps = {
|
||||||
@ -88,7 +84,6 @@ export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
setArrow1,
|
setArrow1,
|
||||||
arrow2,
|
arrow2,
|
||||||
setArrow2,
|
setArrow2,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const doublePitchProps = {
|
const doublePitchProps = {
|
||||||
@ -110,7 +105,6 @@ export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
setArrow2,
|
setArrow2,
|
||||||
arrow1Ref,
|
arrow1Ref,
|
||||||
arrow2Ref,
|
arrow2Ref,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const angleProps = {
|
const angleProps = {
|
||||||
@ -120,7 +114,6 @@ export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
length1,
|
length1,
|
||||||
setLength1,
|
setLength1,
|
||||||
length1Ref,
|
length1Ref,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const diagonalLineProps = {
|
const diagonalLineProps = {
|
||||||
@ -137,7 +130,6 @@ export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
setArrow1,
|
setArrow1,
|
||||||
arrow2,
|
arrow2,
|
||||||
setArrow2,
|
setArrow2,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClickButton = (button) => {
|
const onClickButton = (button) => {
|
||||||
@ -168,10 +160,7 @@ export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
{buttonAct === 4 && <Angle props={angleProps} />}
|
{buttonAct === 4 && <Angle props={angleProps} />}
|
||||||
{buttonAct === 5 && <Diagonal props={diagonalLineProps} />}
|
{buttonAct === 5 && <Diagonal props={diagonalLineProps} />}
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
|
<div className="grid-btn-wrap">
|
||||||
<button style={{ width: 'auto' }} type="button" 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>
|
||||||
|
|||||||
@ -6,14 +6,10 @@ import WallMerge from '@/components/floor-plan/modal/eavesGable/type/WallMerge'
|
|||||||
import Shed from '@/components/floor-plan/modal/eavesGable/type/Shed'
|
import Shed from '@/components/floor-plan/modal/eavesGable/type/Shed'
|
||||||
import { useEavesGableEdit } from '@/hooks/roofcover/useEavesGableEdit'
|
import { useEavesGableEdit } from '@/hooks/roofcover/useEavesGableEdit'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { useState } from 'react'
|
|
||||||
import Image from 'next/image'
|
|
||||||
|
|
||||||
export default function EavesGableEdit({ id, pos = { x: 50, y: 230 } }) {
|
export default function EavesGableEdit({ id, pos = { x: 50, y: 230 } }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const [useCalcPad, setUseCalcPad] = useState(false)
|
|
||||||
const disableKeypad = !useCalcPad
|
|
||||||
|
|
||||||
const { type, setType, buttonMenu, TYPES, pitchRef, offsetRef, widthRef, radioTypeRef, pitchText } = useEavesGableEdit(id)
|
const { type, setType, buttonMenu, TYPES, pitchRef, offsetRef, widthRef, radioTypeRef, pitchText } = useEavesGableEdit(id)
|
||||||
const eavesProps = {
|
const eavesProps = {
|
||||||
@ -22,7 +18,6 @@ export default function EavesGableEdit({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
widthRef,
|
widthRef,
|
||||||
radioTypeRef,
|
radioTypeRef,
|
||||||
pitchText,
|
pitchText,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const gableProps = {
|
const gableProps = {
|
||||||
@ -31,18 +26,15 @@ export default function EavesGableEdit({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
widthRef,
|
widthRef,
|
||||||
radioTypeRef,
|
radioTypeRef,
|
||||||
pitchText,
|
pitchText,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const wallMergeProps = {
|
const wallMergeProps = {
|
||||||
offsetRef,
|
offsetRef,
|
||||||
radioTypeRef,
|
radioTypeRef,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const shedProps = {
|
const shedProps = {
|
||||||
offsetRef,
|
offsetRef,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -56,13 +48,8 @@ export default function EavesGableEdit({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className="properties-setting-wrap outer" style={{margin: '10px'}}>
|
<div className="properties-setting-wrap outer">
|
||||||
<div className="setting-tit" style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
<div className="setting-tit">{getMessage('setting')}</div>
|
||||||
<span>{getMessage('setting')}</span>
|
|
||||||
<button style={{ width: 'auto' }} type="button" 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>
|
|
||||||
{type === TYPES.EAVES && <Eaves {...eavesProps} />}
|
{type === TYPES.EAVES && <Eaves {...eavesProps} />}
|
||||||
{type === TYPES.GABLE && <Gable {...gableProps} />}
|
{type === TYPES.GABLE && <Gable {...gableProps} />}
|
||||||
{type === TYPES.WALL_MERGE && <WallMerge {...wallMergeProps} />}
|
{type === TYPES.WALL_MERGE && <WallMerge {...wallMergeProps} />}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { ANGLE_TYPE, currentAngleTypeSelector } from '@/store/canvasAtom'
|
|||||||
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({ pitchRef, offsetRef, widthRef, radioTypeRef, pitchText, disableKeypad }) {
|
export default function Eaves({ pitchRef, offsetRef, widthRef, radioTypeRef, pitchText }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const [type, setType] = useState('1')
|
const [type, setType] = useState('1')
|
||||||
const onChange = (e) => {
|
const onChange = (e) => {
|
||||||
@ -43,7 +43,6 @@ export default function Eaves({ pitchRef, offsetRef, widthRef, radioTypeRef, pit
|
|||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
if (pitchRef?.current) pitchRef.current.value = value
|
if (pitchRef?.current) pitchRef.current.value = value
|
||||||
}}
|
}}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: true //(index !== 0),
|
allowDecimal: true //(index !== 0),
|
||||||
@ -78,7 +77,6 @@ export default function Eaves({ pitchRef, offsetRef, widthRef, radioTypeRef, pit
|
|||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
if (offsetRef?.current) offsetRef.current.value = value
|
if (offsetRef?.current) offsetRef.current.value = value
|
||||||
}}
|
}}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false //(index !== 0),
|
allowDecimal: false //(index !== 0),
|
||||||
@ -146,7 +144,6 @@ export default function Eaves({ pitchRef, offsetRef, widthRef, radioTypeRef, pit
|
|||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
if (widthRef?.current) widthRef.current.value = value
|
if (widthRef?.current) widthRef.current.value = value
|
||||||
}}
|
}}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false //(index !== 0),
|
allowDecimal: false //(index !== 0),
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { useRecoilValue } from 'recoil'
|
|||||||
import { ANGLE_TYPE, currentAngleTypeSelector } from '@/store/canvasAtom'
|
import { ANGLE_TYPE, currentAngleTypeSelector } from '@/store/canvasAtom'
|
||||||
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Gable({ pitchRef, offsetRef, widthRef, radioTypeRef, pitchText, disableKeypad }) {
|
export default function Gable({ pitchRef, offsetRef, widthRef, radioTypeRef, pitchText }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const [type, setType] = useState('1')
|
const [type, setType] = useState('1')
|
||||||
const onChange = (e) => {
|
const onChange = (e) => {
|
||||||
@ -30,7 +30,6 @@ export default function Gable({ pitchRef, offsetRef, widthRef, radioTypeRef, pit
|
|||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
ref={offsetRef}
|
ref={offsetRef}
|
||||||
value={300}
|
value={300}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false //(index !== 0),
|
allowDecimal: false //(index !== 0),
|
||||||
@ -97,7 +96,6 @@ export default function Gable({ pitchRef, offsetRef, widthRef, radioTypeRef, pit
|
|||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
if (pitchRef?.current) pitchRef.current.value = value
|
if (pitchRef?.current) pitchRef.current.value = value
|
||||||
}}
|
}}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: true //(index !== 0),
|
allowDecimal: true //(index !== 0),
|
||||||
@ -131,7 +129,6 @@ export default function Gable({ pitchRef, offsetRef, widthRef, radioTypeRef, pit
|
|||||||
ref={widthRef}
|
ref={widthRef}
|
||||||
value={800}
|
value={800}
|
||||||
readOnly={type === '1'}
|
readOnly={type === '1'}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false //(index !== 0),
|
allowDecimal: false //(index !== 0),
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Shed({ offsetRef, disableKeypad }) {
|
export default function Shed({ offsetRef }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -19,7 +19,6 @@ export default function Shed({ offsetRef, disableKeypad }) {
|
|||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
ref={offsetRef}
|
ref={offsetRef}
|
||||||
value={300}
|
value={300}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false //(index !== 0),
|
allowDecimal: false //(index !== 0),
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import Image from 'next/image'
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function WallMerge({ offsetRef, radioTypeRef, disableKeypad }) {
|
export default function WallMerge({ offsetRef, radioTypeRef }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const [type, setType] = useState('1')
|
const [type, setType] = useState('1')
|
||||||
const onChange = (e) => {
|
const onChange = (e) => {
|
||||||
@ -61,7 +61,6 @@ export default function WallMerge({ offsetRef, radioTypeRef, disableKeypad }) {
|
|||||||
ref={offsetRef}
|
ref={offsetRef}
|
||||||
value={300}
|
value={300}
|
||||||
readOnly={type === '1'}
|
readOnly={type === '1'}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false //(index !== 0),
|
allowDecimal: false //(index !== 0),
|
||||||
|
|||||||
@ -3,22 +3,16 @@ import WithDraggable from '@/components/common/draggable/WithDraggable'
|
|||||||
import FlowLine from '@/components/floor-plan/modal/movement/type/FlowLine'
|
import FlowLine from '@/components/floor-plan/modal/movement/type/FlowLine'
|
||||||
import Updown from '@/components/floor-plan/modal/movement/type/Updown'
|
import Updown from '@/components/floor-plan/modal/movement/type/Updown'
|
||||||
import { useMovementSetting } from '@/hooks/roofcover/useMovementSetting'
|
import { useMovementSetting } from '@/hooks/roofcover/useMovementSetting'
|
||||||
import { useState } from 'react'
|
|
||||||
import Image from 'next/image'
|
|
||||||
|
|
||||||
export default function MovementSetting({ id, pos = { x: 50, y: 230 } }) {
|
export default function MovementSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { TYPE, closePopup, buttonType, type, setType, FLOW_LINE_REF, UP_DOWN_REF, handleSave } = useMovementSetting(id)
|
const { TYPE, closePopup, buttonType, type, setType, FLOW_LINE_REF, UP_DOWN_REF, handleSave } = useMovementSetting(id)
|
||||||
const [useCalcPad, setUseCalcPad] = useState(false)
|
|
||||||
const disableKeypad = !useCalcPad
|
|
||||||
|
|
||||||
const flowLineProps = {
|
const flowLineProps = {
|
||||||
FLOW_LINE_REF,
|
FLOW_LINE_REF,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
const updownProps = {
|
const updownProps = {
|
||||||
UP_DOWN_REF,
|
UP_DOWN_REF,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -36,10 +30,7 @@ export default function MovementSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
{type === TYPE.FLOW_LINE && <FlowLine {...flowLineProps} />}
|
{type === TYPE.FLOW_LINE && <FlowLine {...flowLineProps} />}
|
||||||
{type === TYPE.UP_DOWN && <Updown {...updownProps} />}
|
{type === TYPE.UP_DOWN && <Updown {...updownProps} />}
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
|
<div className="grid-btn-wrap">
|
||||||
<button style={{ width: 'auto' }} type="button" 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.common.save')}
|
{getMessage('modal.common.save')}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -9,7 +9,7 @@ const FLOW_LINE_TYPE = {
|
|||||||
UP_RIGHT: 'upRight',
|
UP_RIGHT: 'upRight',
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function FlowLine({ FLOW_LINE_REF, disableKeypad }) {
|
export default function FlowLine({ FLOW_LINE_REF }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const [type, setType] = useState(FLOW_LINE_TYPE.DOWN_LEFT)
|
const [type, setType] = useState(FLOW_LINE_TYPE.DOWN_LEFT)
|
||||||
const [filledInput, setFilledInput] = useState('')
|
const [filledInput, setFilledInput] = useState('')
|
||||||
@ -87,7 +87,6 @@ export default function FlowLine({ FLOW_LINE_REF, disableKeypad }) {
|
|||||||
value={filledInput}
|
value={filledInput}
|
||||||
onFocus={handleFocus}
|
onFocus={handleFocus}
|
||||||
onChange={(value)=>{setFilledInput(value)}}
|
onChange={(value)=>{setFilledInput(value)}}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
|
|||||||
@ -10,7 +10,7 @@ const UP_DOWN_TYPE = {
|
|||||||
DOWN: 'down',
|
DOWN: 'down',
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Updown({ UP_DOWN_REF, disableKeypad }) {
|
export default function Updown({ UP_DOWN_REF }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const [type, setType] = useState(UP_DOWN_TYPE.UP)
|
const [type, setType] = useState(UP_DOWN_TYPE.UP)
|
||||||
const [filledInput, setFilledInput] = useState('100')
|
const [filledInput, setFilledInput] = useState('100')
|
||||||
@ -87,7 +87,6 @@ export default function Updown({ UP_DOWN_REF, disableKeypad }) {
|
|||||||
value={filledInput}
|
value={filledInput}
|
||||||
onFocus={handleFocus}
|
onFocus={handleFocus}
|
||||||
onChange={(value)=>{setFilledInput(value)}}
|
onChange={(value)=>{setFilledInput(value)}}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
|
|||||||
@ -5,34 +5,27 @@ import Shed from '@/components/floor-plan/modal/roofShape/passivity/Shed'
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useRoofShapePassivitySetting } from '@/hooks/roofcover/useRoofShapePassivitySetting'
|
import { useRoofShapePassivitySetting } from '@/hooks/roofcover/useRoofShapePassivitySetting'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { useState } from 'react'
|
|
||||||
import Image from 'next/image'
|
|
||||||
|
|
||||||
export default function RoofShapePassivitySetting({ id, pos = { x: 50, y: 230 } }) {
|
export default function RoofShapePassivitySetting({ id, pos = { x: 50, y: 230 } }) {
|
||||||
const { handleSave, handleConfirm, handleRollback, buttons, type, setType, TYPES, offsetRef, pitchRef, pitchText } =
|
const { handleSave, handleConfirm, handleRollback, buttons, type, setType, TYPES, offsetRef, pitchRef, pitchText } =
|
||||||
useRoofShapePassivitySetting(id)
|
useRoofShapePassivitySetting(id)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const [useCalcPad, setUseCalcPad] = useState(false)
|
|
||||||
const disableKeypad = !useCalcPad
|
|
||||||
|
|
||||||
const eavesProps = {
|
const eavesProps = {
|
||||||
offsetRef,
|
offsetRef,
|
||||||
pitchRef,
|
pitchRef,
|
||||||
pitchText,
|
pitchText,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const gableProps = {
|
const gableProps = {
|
||||||
offsetRef,
|
offsetRef,
|
||||||
pitchRef,
|
pitchRef,
|
||||||
pitchText,
|
pitchText,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const shedProps = {
|
const shedProps = {
|
||||||
offsetRef,
|
offsetRef,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -62,10 +55,7 @@ export default function RoofShapePassivitySetting({ id, pos = { x: 50, y: 230 }
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
|
<div className="grid-btn-wrap">
|
||||||
<button style={{ width: 'auto' }} type="button" 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>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { selectedRoofMaterialSelector } from '@/store/settingAtom'
|
|||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Eaves({ offsetRef, pitchRef, pitchText, disableKeypad }) {
|
export default function Eaves({ offsetRef, pitchRef, pitchText }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
||||||
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
|
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
|
||||||
@ -30,7 +30,6 @@ export default function Eaves({ offsetRef, pitchRef, pitchText, disableKeypad })
|
|||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
ref={pitchRef}
|
ref={pitchRef}
|
||||||
value={currentAngleType === ANGLE_TYPE.SLOPE ? selectedRoofMaterial.pitch : selectedRoofMaterial.angle}
|
value={currentAngleType === ANGLE_TYPE.SLOPE ? selectedRoofMaterial.pitch : selectedRoofMaterial.angle}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: true //(index !== 0),
|
allowDecimal: true //(index !== 0),
|
||||||
@ -53,7 +52,6 @@ export default function Eaves({ offsetRef, pitchRef, pitchText, disableKeypad })
|
|||||||
value={offsetRef.current?.value ?? 500} // Set default value to 500
|
value={offsetRef.current?.value ?? 500} // Set default value to 500
|
||||||
ref={offsetRef}
|
ref={offsetRef}
|
||||||
onChange={() => {}}
|
onChange={() => {}}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { useRecoilValue } from 'recoil'
|
|||||||
import { currentAngleTypeSelector } from '@/store/canvasAtom'
|
import { currentAngleTypeSelector } from '@/store/canvasAtom'
|
||||||
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Gable({ offsetRef, disableKeypad }) {
|
export default function Gable({ offsetRef }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
||||||
return (
|
return (
|
||||||
@ -22,7 +22,6 @@ export default function Gable({ offsetRef, disableKeypad }) {
|
|||||||
value={offsetRef.current?.value ?? 300} // Set default value to 500
|
value={offsetRef.current?.value ?? 300} // Set default value to 500
|
||||||
ref={offsetRef}
|
ref={offsetRef}
|
||||||
onChange={() => {}}
|
onChange={() => {}}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Shed({ offsetRef, disableKeypad }) {
|
export default function Shed({ offsetRef }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -19,7 +19,6 @@ export default function Shed({ offsetRef, disableKeypad }) {
|
|||||||
value={offsetRef.current?.value ?? 300} // Set default value to 500
|
value={offsetRef.current?.value ?? 300} // Set default value to 500
|
||||||
ref={offsetRef}
|
ref={offsetRef}
|
||||||
onChange={() => {}}
|
onChange={() => {}}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
|
|||||||
@ -4,14 +4,10 @@ import WallLine from '@/components/floor-plan/modal/wallLineOffset/type/WallLine
|
|||||||
import Offset from '@/components/floor-plan/modal/wallLineOffset/type/Offset'
|
import Offset from '@/components/floor-plan/modal/wallLineOffset/type/Offset'
|
||||||
import { useWallLineOffsetSetting } from '@/hooks/roofcover/useWallLineOffsetSetting'
|
import { useWallLineOffsetSetting } from '@/hooks/roofcover/useWallLineOffsetSetting'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { useState } from 'react'
|
|
||||||
import Image from 'next/image'
|
|
||||||
|
|
||||||
export default function WallLineOffsetSetting({ id, pos = { x: 50, y: 230 } }) {
|
export default function WallLineOffsetSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const [useCalcPad, setUseCalcPad] = useState(false)
|
|
||||||
const disableKeypad = !useCalcPad
|
|
||||||
const {
|
const {
|
||||||
type,
|
type,
|
||||||
setType,
|
setType,
|
||||||
@ -34,14 +30,12 @@ export default function WallLineOffsetSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
arrow2Ref,
|
arrow2Ref,
|
||||||
radioTypeRef,
|
radioTypeRef,
|
||||||
currentWallLineRef,
|
currentWallLineRef,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const offsetProps = {
|
const offsetProps = {
|
||||||
length1Ref,
|
length1Ref,
|
||||||
arrow1Ref,
|
arrow1Ref,
|
||||||
currentWallLineRef,
|
currentWallLineRef,
|
||||||
disableKeypad,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -60,10 +54,7 @@ export default function WallLineOffsetSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
{type === TYPES.WALL_LINE_EDIT && <WallLine ref={wallLineEditRef} {...wallLineProps} />}
|
{type === TYPES.WALL_LINE_EDIT && <WallLine ref={wallLineEditRef} {...wallLineProps} />}
|
||||||
{type === TYPES.OFFSET && <Offset {...offsetProps} />}
|
{type === TYPES.OFFSET && <Offset {...offsetProps} />}
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
|
<div className="grid-btn-wrap">
|
||||||
<button style={{ width: 'auto' }} type="button" 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.common.save')}
|
{getMessage('modal.common.save')}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { useEffect, useState } from 'react'
|
|||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default function Offset({ length1Ref, arrow1Ref, currentWallLineRef, disableKeypad }) {
|
export default function Offset({ length1Ref, arrow1Ref, currentWallLineRef }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { addDocumentEventListener, initEvent } = useEvent()
|
const { addDocumentEventListener, initEvent } = useEvent()
|
||||||
// const { addDocumentEventListener, initEvent } = useContext(EventContext)
|
// const { addDocumentEventListener, initEvent } = useContext(EventContext)
|
||||||
@ -84,7 +84,6 @@ export default function Offset({ length1Ref, arrow1Ref, currentWallLineRef, disa
|
|||||||
value={length1Ref.current?.value ?? 0}
|
value={length1Ref.current?.value ?? 0}
|
||||||
ref={length1Ref}
|
ref={length1Ref}
|
||||||
onChange={() => {}}
|
onChange={() => {}}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { forwardRef, useEffect, useImperativeHandle, useState } from 'react'
|
|||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
|
|
||||||
export default forwardRef(function WallLine({ length1Ref, length2Ref, arrow1Ref, arrow2Ref, radioTypeRef, currentWallLineRef, disableKeypad }, ref) {
|
export default forwardRef(function WallLine({ length1Ref, length2Ref, arrow1Ref, arrow2Ref, radioTypeRef, currentWallLineRef }, ref) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { addDocumentEventListener, initEvent } = useEvent()
|
const { addDocumentEventListener, initEvent } = useEvent()
|
||||||
// const { addDocumentEventListener, initEvent } = useContext(EventContext)
|
// const { addDocumentEventListener, initEvent } = useContext(EventContext)
|
||||||
@ -57,7 +57,6 @@ export default forwardRef(function WallLine({ length1Ref, length2Ref, arrow1Ref,
|
|||||||
ref={length1Ref}
|
ref={length1Ref}
|
||||||
onChange={() => {}}
|
onChange={() => {}}
|
||||||
readOnly={type !== 1}
|
readOnly={type !== 1}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
@ -106,7 +105,6 @@ export default forwardRef(function WallLine({ length1Ref, length2Ref, arrow1Ref,
|
|||||||
ref={length2Ref}
|
ref={length2Ref}
|
||||||
onChange={() => {}}
|
onChange={() => {}}
|
||||||
readOnly={type !== 2}
|
readOnly={type !== 2}
|
||||||
disableKeypad={disableKeypad}
|
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import { useEffect, useRef } from 'react'
|
|||||||
import { fabric } from 'fabric'
|
import { fabric } from 'fabric'
|
||||||
import { calculateAngle } from '@/util/qpolygon-utils'
|
import { calculateAngle } from '@/util/qpolygon-utils'
|
||||||
import {
|
import {
|
||||||
OUTER_LINE_TYPE,
|
|
||||||
placementShapeDrawingAngle1State,
|
placementShapeDrawingAngle1State,
|
||||||
placementShapeDrawingAngle2State,
|
placementShapeDrawingAngle2State,
|
||||||
placementShapeDrawingArrow1State,
|
placementShapeDrawingArrow1State,
|
||||||
@ -93,7 +92,6 @@ export function usePlacementShapeDrawing(id) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setPoints([])
|
setPoints([])
|
||||||
setType(OUTER_LINE_TYPE.OUTER_LINE)
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
const placementShapeDrawingStartPoint = canvas.getObjects().find((obj) => obj.name === 'placementShapeDrawingStartPoint')
|
const placementShapeDrawingStartPoint = canvas.getObjects().find((obj) => obj.name === 'placementShapeDrawingStartPoint')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user