Merge pull request '補助線サイズ変更/移動/コピー 모달에 계산기패드 토글 버튼 추가' (#814) from dev into dev-deploy
Reviewed-on: #814
This commit is contained in:
commit
ea59dd8523
@ -4,6 +4,7 @@ import { usePopup } from '@/hooks/usePopup'
|
|||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
import { contextPopupPositionState } from '@/store/popupAtom'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
import Image from 'next/image'
|
||||||
import { currentObjectState } from '@/store/canvasAtom'
|
import { currentObjectState } from '@/store/canvasAtom'
|
||||||
import { useAuxiliaryDrawing } from '@/hooks/roofcover/useAuxiliaryDrawing'
|
import { useAuxiliaryDrawing } from '@/hooks/roofcover/useAuxiliaryDrawing'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
@ -22,6 +23,8 @@ export default function AuxiliaryEdit(props) {
|
|||||||
const [arrow2, setArrow2] = useState(null)
|
const [arrow2, setArrow2] = useState(null)
|
||||||
const currentObject = useRecoilValue(currentObjectState)
|
const currentObject = useRecoilValue(currentObjectState)
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
|
const [useCalcPad, setUseCalcPad] = useState(false)
|
||||||
|
const disableKeypad = !useCalcPad
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
if ((!arrow1 && !arrow2) || (+verticalSize === 0 && +horizonSize === 0)) {
|
if ((!arrow1 && !arrow2) || (+verticalSize === 0 && +horizonSize === 0)) {
|
||||||
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
|
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
|
||||||
@ -75,6 +78,7 @@ export default function AuxiliaryEdit(props) {
|
|||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={verticalSize}
|
value={verticalSize}
|
||||||
onChange={(value) => setVerticalSize(value)}
|
onChange={(value) => setVerticalSize(value)}
|
||||||
|
disableKeypad={disableKeypad}
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
@ -109,6 +113,7 @@ export default function AuxiliaryEdit(props) {
|
|||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={horizonSize}
|
value={horizonSize}
|
||||||
onChange={(value) => setHorizonSize(value)}
|
onChange={(value) => setHorizonSize(value)}
|
||||||
|
disableKeypad={disableKeypad}
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
@ -136,7 +141,10 @@ export default function AuxiliaryEdit(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={handleSave}>
|
<button className="btn-frame modal act" onClick={handleSave}>
|
||||||
{getMessage('modal.common.save')}
|
{getMessage('modal.common.save')}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { useRecoilValue } from 'recoil'
|
|||||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
import { contextPopupPositionState } from '@/store/popupAtom'
|
||||||
import { canvasState, currentObjectState } from '@/store/canvasAtom'
|
import { canvasState, currentObjectState } from '@/store/canvasAtom'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
|
import Image from 'next/image'
|
||||||
import Big from 'big.js'
|
import Big from 'big.js'
|
||||||
import { calcLineActualSize, calcLinePlaneSize } from '@/util/qpolygon-utils'
|
import { calcLineActualSize, calcLinePlaneSize } from '@/util/qpolygon-utils'
|
||||||
import { normalizeDigits } from '@/util/input-utils'
|
import { normalizeDigits } from '@/util/input-utils'
|
||||||
@ -21,6 +22,8 @@ export default function AuxiliarySize(props) {
|
|||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const currentObject = useRecoilValue(currentObjectState)
|
const currentObject = useRecoilValue(currentObjectState)
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
|
const [useCalcPad, setUseCalcPad] = useState(false)
|
||||||
|
const disableKeypad = !useCalcPad
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -141,6 +144,7 @@ export default function AuxiliarySize(props) {
|
|||||||
value={value1}
|
value={value1}
|
||||||
onChange={handleInput}
|
onChange={handleInput}
|
||||||
readOnly={checkedRadio !== 1}
|
readOnly={checkedRadio !== 1}
|
||||||
|
disableKeypad={disableKeypad}
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
@ -173,6 +177,7 @@ export default function AuxiliarySize(props) {
|
|||||||
value={value2}
|
value={value2}
|
||||||
onChange={handleInput}
|
onChange={handleInput}
|
||||||
readOnly={checkedRadio !== 2}
|
readOnly={checkedRadio !== 2}
|
||||||
|
disableKeypad={disableKeypad}
|
||||||
options={{
|
options={{
|
||||||
allowNegative: false,
|
allowNegative: false,
|
||||||
allowDecimal: false
|
allowDecimal: false
|
||||||
@ -182,7 +187,10 @@ export default function AuxiliarySize(props) {
|
|||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</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.common.save')}
|
{getMessage('modal.common.save')}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user