@jenesei-software/jenesei-kit-react 1.3.15 → 1.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/area-Bopd6mWj.cjs +2 -0
- package/build/area-Bopd6mWj.cjs.map +1 -0
- package/build/{area-DEwj0-O3.js → area-Cvp3eBBo.js} +4 -4
- package/build/area-Cvp3eBBo.js.map +1 -0
- package/build/{area-DphBWq86.cjs → area-DqLK4RX5.cjs} +4 -4
- package/build/{area-DphBWq86.cjs.map → area-DqLK4RX5.cjs.map} +1 -1
- package/build/area-preview.cjs.js +1 -1
- package/build/area-preview.es.js +1 -1
- package/build/area-skeleton.cjs.js +1 -1
- package/build/build-info.txt +3 -3
- package/build/{component-DkEqMT7w.cjs → component-5o60aes-.cjs} +2 -2
- package/build/{component-DkEqMT7w.cjs.map → component-5o60aes-.cjs.map} +1 -1
- package/build/{component-CLqcB5mM.cjs → component-6hRanOkU.cjs} +2 -2
- package/build/{component-CLqcB5mM.cjs.map → component-6hRanOkU.cjs.map} +1 -1
- package/build/{component-CPzlyKwR.js → component-B80It4vM.js} +3 -3
- package/build/{component-CPzlyKwR.js.map → component-B80It4vM.js.map} +1 -1
- package/build/component-BfppCwz9.cjs +88 -0
- package/build/component-BfppCwz9.cjs.map +1 -0
- package/build/{component--jGdo2yq.cjs → component-Bj7sLW9s.cjs} +2 -2
- package/build/{component--jGdo2yq.cjs.map → component-Bj7sLW9s.cjs.map} +1 -1
- package/build/{component-BkYIZFlr.cjs → component-BxetIWe6.cjs} +6 -6
- package/build/{component-BkYIZFlr.cjs.map → component-BxetIWe6.cjs.map} +1 -1
- package/build/{component-DaXKDHnc.js → component-CKBpm4U4.js} +3 -3
- package/build/{component-DaXKDHnc.js.map → component-CKBpm4U4.js.map} +1 -1
- package/build/{component-CFKFLOAw.js → component-ClnOIQaN.js} +2 -2
- package/build/{component-CFKFLOAw.js.map → component-ClnOIQaN.js.map} +1 -1
- package/build/component-accordion.cjs.js +1 -1
- package/build/component-accordion.d.ts +5 -19
- package/build/component-accordion.es.js +1 -1
- package/build/{component-B9dFCQcm.cjs → component-b4tMFkpE.cjs} +2 -2
- package/build/{component-B9dFCQcm.cjs.map → component-b4tMFkpE.cjs.map} +1 -1
- package/build/component-button-group.cjs.js +1 -1
- package/build/component-button-group.d.ts +23 -186
- package/build/component-button-group.es.js +1 -1
- package/build/component-button.cjs.js +1 -1
- package/build/component-button.d.ts +26 -206
- package/build/component-button.es.js +4 -6
- package/build/component-checkbox-group.cjs.js +1 -1
- package/build/component-checkbox-group.d.ts +26 -170
- package/build/component-checkbox-group.es.js +1 -1
- package/build/component-checkbox.cjs.js +1 -1
- package/build/component-checkbox.d.ts +26 -193
- package/build/component-checkbox.es.js +2 -3
- package/build/component-date-picker.cjs.js +1 -1
- package/build/component-date-picker.d.ts +27 -190
- package/build/component-date-picker.es.js +1 -1
- package/build/{component-BFOHa1GY.js → component-eqTj4VVc.js} +2 -2
- package/build/{component-BFOHa1GY.js.map → component-eqTj4VVc.js.map} +1 -1
- package/build/component-icon.cjs.js +1 -1
- package/build/component-icon.d.ts +45 -166
- package/build/component-icon.es.js +5 -9
- package/build/component-icon.es.js.map +1 -1
- package/build/component-image-button.cjs.js +1 -1
- package/build/component-image-button.d.ts +23 -186
- package/build/component-image-button.es.js +1 -1
- package/build/component-image-select.cjs.js +1 -1
- package/build/component-image-select.d.ts +23 -186
- package/build/component-image-select.es.js +1 -1
- package/build/component-image-slider.cjs.js +1 -1
- package/build/component-image-slider.es.js +1 -1
- package/build/component-image.cjs.js +1 -1
- package/build/component-input-otp.cjs.js +1 -1
- package/build/component-input-otp.es.js +1 -1
- package/build/component-input.cjs.js +1 -1
- package/build/component-input.d.ts +1 -1
- package/build/component-input.es.js +2 -2
- package/build/{component-CeuA5Ry0.js → component-jPLOz52P.js} +51 -126
- package/build/component-jPLOz52P.js.map +1 -0
- package/build/component-map.cjs.js +1 -1
- package/build/component-map.es.js +1 -1
- package/build/component-pagination.cjs.js +1 -1
- package/build/component-pagination.d.ts +23 -186
- package/build/component-pagination.es.js +1 -1
- package/build/component-range.cjs.js +1 -1
- package/build/component-range.es.js +1 -1
- package/build/component-ripple.cjs.js +1 -1
- package/build/component-select.cjs.js +1 -1
- package/build/component-select.d.ts +2 -17
- package/build/component-select.es.js +1 -1
- package/build/component-textarea.cjs.js +1 -1
- package/build/component-textarea.es.js +1 -1
- package/build/component-toggle.cjs.js +1 -1
- package/build/component-toggle.es.js +1 -1
- package/build/component-tooltip.cjs.js +1 -1
- package/build/component-tooltip.es.js +1 -1
- package/build/component-typography.cjs.js +1 -1
- package/build/component-typography.es.js +1 -1
- package/build/{component.components-JtwTIPAB.cjs → component.components-BZX00SGG.cjs} +2 -2
- package/build/{component.components-JtwTIPAB.cjs.map → component.components-BZX00SGG.cjs.map} +1 -1
- package/build/{component.components-B2-Gqe0K.js → component.components-C9TkSqTp.js} +5 -5
- package/build/{component.components-B2-Gqe0K.js.map → component.components-C9TkSqTp.js.map} +1 -1
- package/build/{component.constants-DxcsPL8D.cjs → component.constants-B-ZMDpFv.cjs} +2 -2
- package/build/{component.constants-DxcsPL8D.cjs.map → component.constants-B-ZMDpFv.cjs.map} +1 -1
- package/build/{component.constants-CpnBclql.js → component.constants-C8li5_tq.js} +2 -2
- package/build/{component.constants-CpnBclql.js.map → component.constants-C8li5_tq.js.map} +1 -1
- package/build/{component.constants-Cwl6tQFq.js → component.constants-CnMky3Ym.js} +8 -8
- package/build/component.constants-CnMky3Ym.js.map +1 -0
- package/build/component.constants-Dg6JcWmd.cjs +22 -0
- package/build/component.constants-Dg6JcWmd.cjs.map +1 -0
- package/build/{component.styles-Dz33wmri.js → component.styles-0apMzB81.js} +9 -31
- package/build/component.styles-0apMzB81.js.map +1 -0
- package/build/{component.styles-BDKsgd6y.js → component.styles-AEJ_tw7Y.js} +5 -5
- package/build/{component.styles-BDKsgd6y.js.map → component.styles-AEJ_tw7Y.js.map} +1 -1
- package/build/{component.styles-BELwxHxh.cjs → component.styles-BO8xaSCQ.cjs} +2 -2
- package/build/{component.styles-BELwxHxh.cjs.map → component.styles-BO8xaSCQ.cjs.map} +1 -1
- package/build/component.styles-BVQQkX5c.cjs +57 -0
- package/build/component.styles-BVQQkX5c.cjs.map +1 -0
- package/build/component.styles-BYG4iVCR.cjs +10 -0
- package/build/{component.styles-CUCjXD3k.cjs.map → component.styles-BYG4iVCR.cjs.map} +1 -1
- package/build/{component.styles-B4ZjkzIF.cjs → component.styles-BZ9QLlOU.cjs} +2 -2
- package/build/{component.styles-B4ZjkzIF.cjs.map → component.styles-BZ9QLlOU.cjs.map} +1 -1
- package/build/component.styles-BviHtzJH.cjs +22 -0
- package/build/component.styles-BviHtzJH.cjs.map +1 -0
- package/build/{component.styles-ZU_GyVub.cjs → component.styles-C8ONgWei.cjs} +2 -2
- package/build/{component.styles-ZU_GyVub.cjs.map → component.styles-C8ONgWei.cjs.map} +1 -1
- package/build/{component.styles-CJC0h3Ed.js → component.styles-CHqowxsZ.js} +5 -5
- package/build/component.styles-CHqowxsZ.js.map +1 -0
- package/build/component.styles-CXyyc0xg.cjs +32 -0
- package/build/{component.styles-Py-IeQ2q.cjs.map → component.styles-CXyyc0xg.cjs.map} +1 -1
- package/build/component.styles-CtZeOnGH.js +120 -0
- package/build/component.styles-CtZeOnGH.js.map +1 -0
- package/build/{component.styles-B9jJFDUk.js → component.styles-CwTYpBx_.js} +6 -6
- package/build/{component.styles-B9jJFDUk.js.map → component.styles-CwTYpBx_.js.map} +1 -1
- package/build/{component.styles-CEDSDKXy.cjs → component.styles-CxlbZwr4.cjs} +2 -2
- package/build/{component.styles-CEDSDKXy.cjs.map → component.styles-CxlbZwr4.cjs.map} +1 -1
- package/build/{component.styles-COwP0J6t.cjs → component.styles-CyCy2ymw.cjs} +2 -2
- package/build/{component.styles-COwP0J6t.cjs.map → component.styles-CyCy2ymw.cjs.map} +1 -1
- package/build/{component.styles-B0FFHGeN.js → component.styles-DWDGLfbF.js} +3 -3
- package/build/{component.styles-B0FFHGeN.js.map → component.styles-DWDGLfbF.js.map} +1 -1
- package/build/{component.styles-BbwS_Ekx.js → component.styles-DqJURuJl.js} +3 -3
- package/build/{component.styles-BbwS_Ekx.js.map → component.styles-DqJURuJl.js.map} +1 -1
- package/build/{component.styles-CsB9986a.cjs → component.styles-FMHm5NHm.cjs} +2 -2
- package/build/{component.styles-CsB9986a.cjs.map → component.styles-FMHm5NHm.cjs.map} +1 -1
- package/build/{component.styles-BeRVOt5T.cjs → component.styles-Hx-MJSWX.cjs} +2 -2
- package/build/{component.styles-BeRVOt5T.cjs.map → component.styles-Hx-MJSWX.cjs.map} +1 -1
- package/build/{component.styles-BGYbrzvh.js → component.styles-KBaixm0o.js} +2 -2
- package/build/{component.styles-BGYbrzvh.js.map → component.styles-KBaixm0o.js.map} +1 -1
- package/build/{component.styles-Czdj4SAF.js → component.styles-SZTM0cRW.js} +7 -7
- package/build/{component.styles-Czdj4SAF.js.map → component.styles-SZTM0cRW.js.map} +1 -1
- package/build/{component.styles-gZHy-64x.cjs → component.styles-_keFf_Qj.cjs} +2 -2
- package/build/{component.styles-gZHy-64x.cjs.map → component.styles-_keFf_Qj.cjs.map} +1 -1
- package/build/{component.styles-VrNFgg1_.js → component.styles-cMafDDpP.js} +3 -3
- package/build/{component.styles-VrNFgg1_.js.map → component.styles-cMafDDpP.js.map} +1 -1
- package/build/{component.styles-CxPmtiIy.js → component.styles-euSUJAiA.js} +3 -3
- package/build/{component.styles-CxPmtiIy.js.map → component.styles-euSUJAiA.js.map} +1 -1
- package/build/{component.types-DaiIANRt.cjs → component.types-B7jDbV2B.cjs} +18 -11
- package/build/component.types-B7jDbV2B.cjs.map +1 -0
- package/build/{component.types-B2YOqKzt.js → component.types-p7CYQCe5.js} +20 -10
- package/build/component.types-p7CYQCe5.js.map +1 -0
- package/build/context-app.cjs.js +1 -1
- package/build/context-app.es.js +1 -1
- package/build/context-sonner.cjs.js +1 -1
- package/build/context-sonner.d.ts +71 -100
- package/build/context-sonner.es.js +1 -1
- package/build/{context.constants-C4xdihsb.js → context.constants-Cio0nsYA.js} +7 -6
- package/build/context.constants-Cio0nsYA.js.map +1 -0
- package/build/{context.constants-D0P7bVk9.cjs → context.constants-y9s5VGN2.cjs} +4 -3
- package/build/context.constants-y9s5VGN2.cjs.map +1 -0
- package/build/{context.hooks-Cmgo0uqV.js → context.hooks-BIIK-2HN.js} +3 -3
- package/build/{context.hooks-Cmgo0uqV.js.map → context.hooks-BIIK-2HN.js.map} +1 -1
- package/build/{context.hooks-XBiTuVyt.cjs → context.hooks-DNnrgKb0.cjs} +3 -3
- package/build/{context.hooks-XBiTuVyt.cjs.map → context.hooks-DNnrgKb0.cjs.map} +1 -1
- package/build/{floating-ui.react--v70Xky9.cjs → floating-ui.react-DZzvtpim.cjs} +2 -2
- package/build/{floating-ui.react--v70Xky9.cjs.map → floating-ui.react-DZzvtpim.cjs.map} +1 -1
- package/build/index.cjs.js +1 -1
- package/build/index.d.ts +97 -256
- package/build/index.es.js +140 -141
- package/build/index.es.js.map +1 -1
- package/build/{style-uVTmdhsH.js → style-BzxSHZDV.js} +2 -2
- package/build/{style-uVTmdhsH.js.map → style-BzxSHZDV.js.map} +1 -1
- package/build/{style-D3Lbn1EL.cjs → style-D8DUzG0C.cjs} +2 -2
- package/build/{style-D3Lbn1EL.cjs.map → style-D8DUzG0C.cjs.map} +1 -1
- package/build/style-error.cjs.js +1 -1
- package/build/style-error.es.js +1 -1
- package/build/style-theme.cjs.js +1 -1
- package/build/style-theme.d.ts +29 -0
- package/build/style-theme.es.js +8 -2
- package/build/{theme.global-BgERDJ4e.js → theme.global-BzunMIsv.js} +132 -2
- package/build/theme.global-BzunMIsv.js.map +1 -0
- package/build/theme.global-D67h5YeA.cjs +173 -0
- package/build/theme.global-D67h5YeA.cjs.map +1 -0
- package/build/{use-DWNgOa9w.cjs → use-BLwltPMc.cjs} +2 -2
- package/build/{use-DWNgOa9w.cjs.map → use-BLwltPMc.cjs.map} +1 -1
- package/build/{use-CuHzkWqv.js → use-CnGHh8iL.js} +5 -5
- package/build/{use-CuHzkWqv.js.map → use-CnGHh8iL.js.map} +1 -1
- package/package.json +1 -1
- package/build/area-CZkDIeGx.cjs +0 -2
- package/build/area-CZkDIeGx.cjs.map +0 -1
- package/build/area-DEwj0-O3.js.map +0 -1
- package/build/component-BLWcOf3A.cjs +0 -90
- package/build/component-BLWcOf3A.cjs.map +0 -1
- package/build/component-CeuA5Ry0.js.map +0 -1
- package/build/component.constants-Cwl6tQFq.js.map +0 -1
- package/build/component.constants-D15Kt1bW.cjs +0 -22
- package/build/component.constants-D15Kt1bW.cjs.map +0 -1
- package/build/component.styles-BKnUDWqO.cjs +0 -22
- package/build/component.styles-BKnUDWqO.cjs.map +0 -1
- package/build/component.styles-CJC0h3Ed.js.map +0 -1
- package/build/component.styles-CUCjXD3k.cjs +0 -10
- package/build/component.styles-DS0ofW1Y.js +0 -2193
- package/build/component.styles-DS0ofW1Y.js.map +0 -1
- package/build/component.styles-DhXp_cmE.cjs +0 -73
- package/build/component.styles-DhXp_cmE.cjs.map +0 -1
- package/build/component.styles-Dz33wmri.js.map +0 -1
- package/build/component.styles-Py-IeQ2q.cjs +0 -32
- package/build/component.types-B2YOqKzt.js.map +0 -1
- package/build/component.types-BBQ18Npa.js +0 -143
- package/build/component.types-BBQ18Npa.js.map +0 -1
- package/build/component.types-DaiIANRt.cjs.map +0 -1
- package/build/component.types-DraGq1j_.cjs +0 -2
- package/build/component.types-DraGq1j_.cjs.map +0 -1
- package/build/context.constants-C4xdihsb.js.map +0 -1
- package/build/context.constants-D0P7bVk9.cjs.map +0 -1
- package/build/theme.global-BgERDJ4e.js.map +0 -1
- package/build/theme.global-CcoD5bPP.cjs +0 -173
- package/build/theme.global-CcoD5bPP.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.styles-CsB9986a.cjs","sources":["../src/components/textarea/component.styles.ts","../src/components/textarea/component.tsx"],"sourcesContent":["import {\n addDisabled,\n addFont,\n addOutlineChildren,\n addRemoveOutline,\n addTransitionWithoutSize,\n} from '@local/styles/add';\nimport { addError } from '@local/styles/error';\nimport { addSX } from '@local/styles/sx';\nimport { KEY_SIZE_DATA } from '@local/theme';\n\nimport styled, { css } from 'styled-components';\n\nimport { StyledTextAreaProps, TextAreaWrapperProps } from '.';\n\n/****************************************** Wrapper *************************************************/\nconst addTextAreaWrapperGenre = css<TextAreaWrapperProps>`\n ${(props) => css`\n background: ${props.theme.colors.input[props.$genre].background.rest};\n border-color: ${props.theme.colors.input[props.$genre].border.rest};\n color: ${props.theme.colors.input[props.$genre].color.rest};\n\n &:active {\n background: ${props.theme.colors.input[props.$genre].background.rest};\n border-color: ${props.theme.colors.input[props.$genre].border.rest};\n color: ${props.theme.colors.input[props.$genre].color.rest};\n }\n &:hover {\n background: ${props.theme.colors.input[props.$genre].background.hover};\n border-color: ${props.theme.colors.input[props.$genre].border.hover};\n color: ${props.theme.colors.input[props.$genre].color.hover};\n }\n &:focus-visible {\n border-color: ${props.theme.colors.input[props.$genre].border.rest};\n background: ${props.theme.colors.input[props.$genre].background.rest};\n color: ${props.theme.colors.input[props.$genre].color.rest};\n }\n `};\n`;\n\nconst addTextAreaWrapperIsInputEffect = css<Pick<TextAreaWrapperProps, '$isInputEffect'>>`\n ${(props) =>\n props.$isInputEffect &&\n css`\n box-shadow: ${props.theme.effects.input};\n `}\n`;\nconst addTextAreaWrapperSize = css<TextAreaWrapperProps>`\n ${(props) => css`\n padding: ${KEY_SIZE_DATA[props.$size].padding - 4}px ${KEY_SIZE_DATA[props.$size].padding}px ${KEY_SIZE_DATA[props.$size].padding - 4}px ${KEY_SIZE_DATA[props.$size].padding}px;\n border-radius: ${KEY_SIZE_DATA[props.$size].radius}px;\n min-height: ${KEY_SIZE_DATA[props.$size].height}px;\n `};\n`;\n\nexport const TextAreaWrapper = styled.div<TextAreaWrapperProps>`\n border: 1px solid;\n position: relative;\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n flex-direction: column;\n overflow: hidden;\n width: 100%;\n ${addTransitionWithoutSize};\n ${addTextAreaWrapperSize};\n ${addTextAreaWrapperGenre};\n ${addTextAreaWrapperIsInputEffect};\n ${addDisabled};\n ${addOutlineChildren};\n ${addSX};\n`;\n\n/****************************************** TextArea *************************************************/\nconst addTextAreaPlaceholder = css<StyledTextAreaProps>`\n &::placeholder,\n &::-webkit-input-placeholder {\n ${addFont};\n color: ${(props) => props.theme.colors.input[props.$genre].color.placeholder};\n opacity: 1;\n }\n &:-ms-input-placeholder {\n ${addFont};\n color: ${(props) => props.theme.colors.input[props.$genre].color.placeholder};\n opacity: 1;\n }\n`;\nconst addTextAreaGenre = css<StyledTextAreaProps>`\n ${(props) => css`\n color: ${props.theme.colors.input[props.$genre].color.rest};\n border-color: transparent;\n &:active {\n color: ${props.theme.colors.input[props.$genre].color.rest};\n }\n &:hover {\n color: ${props.theme.colors.input[props.$genre].color.hover};\n }\n &:focus-visible {\n color: ${props.theme.colors.input[props.$genre].color.rest};\n }\n `};\n`;\nconst addTextAreaIsResize = css<Pick<StyledTextAreaProps, '$isResize'>>`\n ${(props) =>\n !props.$isResize &&\n css`\n resize: none;\n `}\n`;\nexport const addTextArea = css<StyledTextAreaProps>`\n overflow-x: hidden;\n width: -webkit-fill-available;\n padding: 0 !important;\n border: none !important;\n margin: 0 !important;\n white-space: normal;\n text-overflow: ellipsis;\n height: auto;\n background-color: transparent;\n\n ${addFont};\n ${addTextAreaGenre};\n ${addTextAreaIsResize};\n ${addTextAreaPlaceholder};\n ${addRemoveOutline};\n ${addError};\n`;\n\nexport const StyledTextArea = styled.textarea<StyledTextAreaProps>`\n ${addTextArea};\n`;\n","import { ErrorMessage } from '@local/styles/error';\n\nimport { useMergeRefs } from '@floating-ui/react';\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { StyledTextArea, TextAreaProps, TextAreaWrapper } from '.';\n\nexport const TextArea = (props: TextAreaProps) => {\n const theme = useTheme();\n\n const refLocal = useRef<HTMLTextAreaElement>(null);\n const ref = useMergeRefs([refLocal, props.ref]);\n\n const lineHeight = useMemo(\n () => theme.font.sizeDefault.default * theme.font.lineHeight,\n [theme.font.lineHeight, theme.font.sizeDefault.default],\n );\n const maxHeight = useMemo(() => (props.maxRows ? props.maxRows * lineHeight : 0), [lineHeight, props.maxRows]);\n const minHeight = useMemo(\n () => (props.minRows ? props.minRows * lineHeight : lineHeight),\n [lineHeight, props.minRows],\n );\n\n const resizeTextarea = useCallback(() => {\n const el = refLocal.current;\n if (el && props.isAutoHeight) {\n el.style.height = 'auto';\n const newHeight = Math.min(el.scrollHeight, maxHeight);\n el.style.height = `${newHeight}px`;\n }\n }, [props.isAutoHeight, maxHeight]);\n\n const handleOnChange = useCallback(\n (value: string) => {\n if (props.isNoSpaces) {\n const valueWithoutSpaces = value.replace(/\\s+/g, '');\n props.onChange?.(valueWithoutSpaces);\n } else {\n props.onChange?.(value);\n }\n },\n [props],\n );\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n if (props.isAutoHeight) {\n requestAnimationFrame(resizeTextarea);\n }\n }, [props.value, resizeTextarea, props.isAutoHeight]);\n return (\n <>\n <TextAreaWrapper\n $isInputEffect={props.isInputEffect}\n $isDisabled={props.isDisabled}\n $isDisabledOutline={props.isDisabled ?? props.isDisabledOutline}\n $isOutlineBoxShadow={props.isOutlineBoxShadow}\n $sx={props.sx}\n $genre={props.genre}\n $size={props.size}\n $lineHeight={lineHeight}\n $isReadOnly={props.isReadOnly}\n className={props.className}\n tabIndex={-1}\n >\n <StyledTextArea\n tabIndex={0}\n ref={ref}\n $font={{\n size: props.font?.size ?? 16,\n weight: props.font?.weight ?? (props.isBold ? 500 : 400),\n family: props.font?.family ?? theme.font.family,\n height: props.font?.height ?? `${lineHeight}px`,\n }}\n $lineHeight={lineHeight}\n $isResize={props.isResize}\n $error={props.error}\n $isInputEffect={props.isInputEffect}\n $isLoading={props.isLoading}\n $genre={props.genre}\n $size={props.size}\n $isBold={props.isBold}\n $isDisabled={props.isDisabled}\n maxLength={props.maxLength}\n minLength={props.minLength}\n disabled={props.isDisabled}\n readOnly={props.isReadOnly}\n required={props.isRequired}\n defaultValue={props.defaultValue === null ? '' : props.defaultValue}\n value={props.value === null ? '' : props.value}\n rows={props.minRows}\n placeholder={props.placeholder}\n onChange={(event) => handleOnChange(event.target.value)}\n onBlur={props.onBlur}\n onFocus={props.onFocus}\n onKeyDown={props.onKeyDown}\n name={props.name}\n autoComplete={props.autoComplete}\n id={props.id}\n style={{\n minHeight: `${minHeight}px`,\n maxHeight: props.isResize ? 'none' : props.isAutoHeight ? `${maxHeight}px` : `${minHeight}px`,\n }}\n />\n </TextAreaWrapper>\n {props?.error ? (\n <ErrorMessage\n {...props.error}\n size={props?.error.size ?? props.size}\n font={{\n size: 12,\n weight: 400,\n family: props.font?.family ?? theme.font.family,\n }}\n />\n ) : null}\n </>\n );\n};\n"],"names":["addTextAreaWrapperGenre","css","props","theme","colors","input","$genre","background","rest","border","color","hover","addTextAreaWrapperIsInputEffect","$isInputEffect","effects","addTextAreaWrapperSize","KEY_SIZE_DATA","$size","padding","radius","height","TextAreaWrapper","styled","div","addTransitionWithoutSize","addDisabled","addOutlineChildren","addSX","addTextAreaPlaceholder","addFont","placeholder","addTextAreaGenre","addTextAreaIsResize","$isResize","addTextArea","addRemoveOutline","addError","StyledTextArea","textarea","useTheme","refLocal","useRef","ref","useMergeRefs","lineHeight","useMemo","font","sizeDefault","default","maxHeight","maxRows","minHeight","minRows","resizeTextarea","useCallback","el","current","isAutoHeight","style","newHeight","Math","min","scrollHeight","handleOnChange","value","isNoSpaces","valueWithoutSpaces","replace","_a","onChange","call","_b","useEffect","requestAnimationFrame","jsxs","Fragment","children","jsx","isInputEffect","$isDisabled","isDisabled","$isDisabledOutline","isDisabledOutline","$isOutlineBoxShadow","isOutlineBoxShadow","$sx","sx","genre","size","$lineHeight","$isReadOnly","isReadOnly","className","tabIndex","$font","weight","isBold","family","_c","_d","isResize","$error","error","$isLoading","isLoading","$isBold","maxLength","minLength","disabled","readOnly","required","isRequired","defaultValue","rows","event","target","onBlur","onFocus","onKeyDown","name","autoComplete","id","ErrorMessage","_e"],"mappings":"0SAgBMA,EAA0BC,EAAAA,GAAAA;IAC3BC,GAAUD,EAAAA,GAAAA;kBACGC,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQC,WAAWC;oBAChDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQG,OAAOD;aACrDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQI,MAAMF;;;oBAGtCN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQC,WAAWC;sBAChDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQG,OAAOD;eACrDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQI,MAAMF;;;oBAGxCN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQC,WAAWI;sBAChDT,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQG,OAAOE;eACrDT,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQI,MAAMC;;;sBAGtCT,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQG,OAAOD;oBAChDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQC,WAAWC;eACvDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQI,MAAMF;;;EAKtDI,EAAkCX,EAAAA,GAAAA;IACnCC,GACDA,EAAMW,gBACNZ,EAAAA,GAAAA;oBACgBC,EAAMC,MAAMW,QAAQT;;EAGlCU,EAAyBd,EAAAA,GAAAA;IAC1BC,GAAUD,EAAAA,GAAAA;eACAe,gBAAcd,EAAMe,OAAOC,QAAU,OAAOF,EAAAA,cAAcd,EAAMe,OAAOC,aAAaF,EAAAA,cAAcd,EAAMe,OAAOC,QAAU,OAAOF,gBAAcd,E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E,EAAY1B,SAAU9F,EAAM2C,KAAKmD,UAG3C"}
|
|
1
|
+
{"version":3,"file":"component.styles-FMHm5NHm.cjs","sources":["../src/components/textarea/component.styles.ts","../src/components/textarea/component.tsx"],"sourcesContent":["import {\n addDisabled,\n addFont,\n addOutlineChildren,\n addRemoveOutline,\n addTransitionWithoutSize,\n} from '@local/styles/add';\nimport { addError } from '@local/styles/error';\nimport { addSX } from '@local/styles/sx';\nimport { KEY_SIZE_DATA } from '@local/theme';\n\nimport styled, { css } from 'styled-components';\n\nimport { StyledTextAreaProps, TextAreaWrapperProps } from '.';\n\n/****************************************** Wrapper *************************************************/\nconst addTextAreaWrapperGenre = css<TextAreaWrapperProps>`\n ${(props) => css`\n background: ${props.theme.colors.input[props.$genre].background.rest};\n border-color: ${props.theme.colors.input[props.$genre].border.rest};\n color: ${props.theme.colors.input[props.$genre].color.rest};\n\n &:active {\n background: ${props.theme.colors.input[props.$genre].background.rest};\n border-color: ${props.theme.colors.input[props.$genre].border.rest};\n color: ${props.theme.colors.input[props.$genre].color.rest};\n }\n &:hover {\n background: ${props.theme.colors.input[props.$genre].background.hover};\n border-color: ${props.theme.colors.input[props.$genre].border.hover};\n color: ${props.theme.colors.input[props.$genre].color.hover};\n }\n &:focus-visible {\n border-color: ${props.theme.colors.input[props.$genre].border.rest};\n background: ${props.theme.colors.input[props.$genre].background.rest};\n color: ${props.theme.colors.input[props.$genre].color.rest};\n }\n `};\n`;\n\nconst addTextAreaWrapperIsInputEffect = css<Pick<TextAreaWrapperProps, '$isInputEffect'>>`\n ${(props) =>\n props.$isInputEffect &&\n css`\n box-shadow: ${props.theme.effects.input};\n `}\n`;\nconst addTextAreaWrapperSize = css<TextAreaWrapperProps>`\n ${(props) => css`\n padding: ${KEY_SIZE_DATA[props.$size].padding - 4}px ${KEY_SIZE_DATA[props.$size].padding}px ${KEY_SIZE_DATA[props.$size].padding - 4}px ${KEY_SIZE_DATA[props.$size].padding}px;\n border-radius: ${KEY_SIZE_DATA[props.$size].radius}px;\n min-height: ${KEY_SIZE_DATA[props.$size].height}px;\n `};\n`;\n\nexport const TextAreaWrapper = styled.div<TextAreaWrapperProps>`\n border: 1px solid;\n position: relative;\n display: flex;\n align-items: flex-start;\n justify-content: flex-start;\n flex-direction: column;\n overflow: hidden;\n width: 100%;\n ${addTransitionWithoutSize};\n ${addTextAreaWrapperSize};\n ${addTextAreaWrapperGenre};\n ${addTextAreaWrapperIsInputEffect};\n ${addDisabled};\n ${addOutlineChildren};\n ${addSX};\n`;\n\n/****************************************** TextArea *************************************************/\nconst addTextAreaPlaceholder = css<StyledTextAreaProps>`\n &::placeholder,\n &::-webkit-input-placeholder {\n ${addFont};\n color: ${(props) => props.theme.colors.input[props.$genre].color.placeholder};\n opacity: 1;\n }\n &:-ms-input-placeholder {\n ${addFont};\n color: ${(props) => props.theme.colors.input[props.$genre].color.placeholder};\n opacity: 1;\n }\n`;\nconst addTextAreaGenre = css<StyledTextAreaProps>`\n ${(props) => css`\n color: ${props.theme.colors.input[props.$genre].color.rest};\n border-color: transparent;\n &:active {\n color: ${props.theme.colors.input[props.$genre].color.rest};\n }\n &:hover {\n color: ${props.theme.colors.input[props.$genre].color.hover};\n }\n &:focus-visible {\n color: ${props.theme.colors.input[props.$genre].color.rest};\n }\n `};\n`;\nconst addTextAreaIsResize = css<Pick<StyledTextAreaProps, '$isResize'>>`\n ${(props) =>\n !props.$isResize &&\n css`\n resize: none;\n `}\n`;\nexport const addTextArea = css<StyledTextAreaProps>`\n overflow-x: hidden;\n width: -webkit-fill-available;\n padding: 0 !important;\n border: none !important;\n margin: 0 !important;\n white-space: normal;\n text-overflow: ellipsis;\n height: auto;\n background-color: transparent;\n\n ${addFont};\n ${addTextAreaGenre};\n ${addTextAreaIsResize};\n ${addTextAreaPlaceholder};\n ${addRemoveOutline};\n ${addError};\n`;\n\nexport const StyledTextArea = styled.textarea<StyledTextAreaProps>`\n ${addTextArea};\n`;\n","import { ErrorMessage } from '@local/styles/error';\n\nimport { useMergeRefs } from '@floating-ui/react';\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport { StyledTextArea, TextAreaProps, TextAreaWrapper } from '.';\n\nexport const TextArea = (props: TextAreaProps) => {\n const theme = useTheme();\n\n const refLocal = useRef<HTMLTextAreaElement>(null);\n const ref = useMergeRefs([refLocal, props.ref]);\n\n const lineHeight = useMemo(\n () => theme.font.sizeDefault.default * theme.font.lineHeight,\n [theme.font.lineHeight, theme.font.sizeDefault.default],\n );\n const maxHeight = useMemo(() => (props.maxRows ? props.maxRows * lineHeight : 0), [lineHeight, props.maxRows]);\n const minHeight = useMemo(\n () => (props.minRows ? props.minRows * lineHeight : lineHeight),\n [lineHeight, props.minRows],\n );\n\n const resizeTextarea = useCallback(() => {\n const el = refLocal.current;\n if (el && props.isAutoHeight) {\n el.style.height = 'auto';\n const newHeight = Math.min(el.scrollHeight, maxHeight);\n el.style.height = `${newHeight}px`;\n }\n }, [props.isAutoHeight, maxHeight]);\n\n const handleOnChange = useCallback(\n (value: string) => {\n if (props.isNoSpaces) {\n const valueWithoutSpaces = value.replace(/\\s+/g, '');\n props.onChange?.(valueWithoutSpaces);\n } else {\n props.onChange?.(value);\n }\n },\n [props],\n );\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n if (props.isAutoHeight) {\n requestAnimationFrame(resizeTextarea);\n }\n }, [props.value, resizeTextarea, props.isAutoHeight]);\n return (\n <>\n <TextAreaWrapper\n $isInputEffect={props.isInputEffect}\n $isDisabled={props.isDisabled}\n $isDisabledOutline={props.isDisabled ?? props.isDisabledOutline}\n $isOutlineBoxShadow={props.isOutlineBoxShadow}\n $sx={props.sx}\n $genre={props.genre}\n $size={props.size}\n $lineHeight={lineHeight}\n $isReadOnly={props.isReadOnly}\n className={props.className}\n tabIndex={-1}\n >\n <StyledTextArea\n tabIndex={0}\n ref={ref}\n $font={{\n size: props.font?.size ?? 16,\n weight: props.font?.weight ?? (props.isBold ? 500 : 400),\n family: props.font?.family ?? theme.font.family,\n height: props.font?.height ?? `${lineHeight}px`,\n }}\n $lineHeight={lineHeight}\n $isResize={props.isResize}\n $error={props.error}\n $isInputEffect={props.isInputEffect}\n $isLoading={props.isLoading}\n $genre={props.genre}\n $size={props.size}\n $isBold={props.isBold}\n $isDisabled={props.isDisabled}\n maxLength={props.maxLength}\n minLength={props.minLength}\n disabled={props.isDisabled}\n readOnly={props.isReadOnly}\n required={props.isRequired}\n defaultValue={props.defaultValue === null ? '' : props.defaultValue}\n value={props.value === null ? '' : props.value}\n rows={props.minRows}\n placeholder={props.placeholder}\n onChange={(event) => handleOnChange(event.target.value)}\n onBlur={props.onBlur}\n onFocus={props.onFocus}\n onKeyDown={props.onKeyDown}\n name={props.name}\n autoComplete={props.autoComplete}\n id={props.id}\n style={{\n minHeight: `${minHeight}px`,\n maxHeight: props.isResize ? 'none' : props.isAutoHeight ? `${maxHeight}px` : `${minHeight}px`,\n }}\n />\n </TextAreaWrapper>\n {props?.error ? (\n <ErrorMessage\n {...props.error}\n size={props?.error.size ?? props.size}\n font={{\n size: 12,\n weight: 400,\n family: props.font?.family ?? theme.font.family,\n }}\n />\n ) : null}\n </>\n );\n};\n"],"names":["addTextAreaWrapperGenre","css","props","theme","colors","input","$genre","background","rest","border","color","hover","addTextAreaWrapperIsInputEffect","$isInputEffect","effects","addTextAreaWrapperSize","KEY_SIZE_DATA","$size","padding","radius","height","TextAreaWrapper","styled","div","addTransitionWithoutSize","addDisabled","addOutlineChildren","addSX","addTextAreaPlaceholder","addFont","placeholder","addTextAreaGenre","addTextAreaIsResize","$isResize","addTextArea","addRemoveOutline","addError","StyledTextArea","textarea","useTheme","refLocal","useRef","ref","useMergeRefs","lineHeight","useMemo","font","sizeDefault","default","maxHeight","maxRows","minHeight","minRows","resizeTextarea","useCallback","el","current","isAutoHeight","style","newHeight","Math","min","scrollHeight","handleOnChange","value","isNoSpaces","valueWithoutSpaces","replace","_a","onChange","call","_b","useEffect","requestAnimationFrame","jsxs","Fragment","children","jsx","isInputEffect","$isDisabled","isDisabled","$isDisabledOutline","isDisabledOutline","$isOutlineBoxShadow","isOutlineBoxShadow","$sx","sx","genre","size","$lineHeight","$isReadOnly","isReadOnly","className","tabIndex","$font","weight","isBold","family","_c","_d","isResize","$error","error","$isLoading","isLoading","$isBold","maxLength","minLength","disabled","readOnly","required","isRequired","defaultValue","rows","event","target","onBlur","onFocus","onKeyDown","name","autoComplete","id","ErrorMessage","_e"],"mappings":"0SAgBMA,EAA0BC,EAAAA,GAAAA;IAC3BC,GAAUD,EAAAA,GAAAA;kBACGC,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQC,WAAWC;oBAChDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQG,OAAOD;aACrDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQI,MAAMF;;;oBAGtCN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQC,WAAWC;sBAChDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQG,OAAOD;eACrDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQI,MAAMF;;;oBAGxCN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQC,WAAWI;sBAChDT,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQG,OAAOE;eACrDT,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQI,MAAMC;;;sBAGtCT,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQG,OAAOD;oBAChDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQC,WAAWC;eACvDN,EAAMC,MAAMC,OAAOC,MAAMH,EAAMI,QAAQI,MAAMF;;;EAKtDI,EAAkCX,EAAAA,GAAAA;IACnCC,GACDA,EAAMW,gBACNZ,EAAAA,GAAAA;oBACgBC,EAAMC,MAAMW,QAAQT;;EAGlCU,EAAyBd,EAAAA,GAAAA;IAC1BC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MAAM,MAAAtF,OAAA,EAAAA,EAAOoG,MAAMd,OAAQtF,EAAMsF,KACjC1C,KAAM,CACJ0C,KAAM,GACNO,OAAQ,IACRE,QAAQ,OAAA0B,EAAAzH,EAAM4C,WAAN,EAAA6E,EAAY1B,SAAU9F,EAAM2C,KAAKmD,UAG3C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./style-Df37KnoJ.cjs"),t=require("./style-D3Lbn1EL.cjs"),r=require("./style-fRZ6xrVp.cjs"),n=require("./theme.global-CcoD5bPP.cjs"),a=require("framer-motion"),o=require("react"),i=require("styled-components");function u(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var l,s;function c(){}function d(e){return!!(e||"").match(/\d/)}function f(e){return null==e}function v(e){return f(e)||function(e){return"number"==typeof e&&isNaN(e)}(e)||"number"==typeof e&&!isFinite(e)}function p(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function g(e,t){void 0===t&&(t=!0);var r="-"===e[0],n=r&&t,a=(e=e.replace("-","")).split(".");return{beforeDecimal:a[0],afterDecimal:a[1]||"",hasNegation:r,addNegation:n}}function h(e,t,r){for(var n="",a=r?"0":"",o=0;o<=t-1;o++)n+=e[o]||a;return n}function m(e,t){return Array(t+1).join(e)}function $(e){var t=e+"",r="-"===t[0]?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),a=n[0],o=n[1];if(!(o=Number(o)))return r+a;var i=1+o,u=(a=a.replace(".","")).length;return i<0?a="0."+m("0",Math.abs(i))+a:i>=u?a+=m("0",i-u):a=(a.substring(0,i)||"0")+"."+a.substring(i),r+a}function b(e,t,r){if(-1!==["","-"].indexOf(e))return e;var n=(-1!==e.indexOf(".")||r)&&t,a=g(e),o=a.beforeDecimal,i=a.afterDecimal,u=a.hasNegation,l=parseFloat("0."+(i||"0")),s=(i.length<=t?"0."+i:l.toFixed(t)).split("."),c=o;return o&&Number(s[0])&&(c=o.split("").reverse().reduce(function(e,t,r){return e.length>r?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},s[0])),""+(u?"-":"")+c+(n?".":"")+h(s[1]||"",t,r)}function S(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}(s=l||(l={})).event="event",s.props="prop";var x,y,w,V=(x=function(e,t){for(var r=0,n=0,a=e.length,o=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[o-1-n]&&o-n>r&&a-n>r;)n++;return{from:{start:r,end:a-n},to:{start:r,end:o-n}}},w=void 0,function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return y&&e.length===y.length&&e.every(function(e,t){return e===y[t]})?w:(y=e,w=x.apply(void 0,e))});function N(e){return Math.max(e.selectionStart,e.selectionEnd)}function D(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function I(e,t){return void 0===e&&(e=" "),"string"==typeof e?e:e[t]||" "}function E(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function C(e,t,r,n){var a,o,i,u=e.length;if(a=t,o=0,i=u,t=Math.min(Math.max(a,o),i),"left"===n){for(;t>=0&&!r[t];)t--;-1===t&&(t=r.indexOf(!0))}else{for(;t<=u&&!r[t];)t++;t>u&&(t=r.lastIndexOf(!0))}return-1===t&&(t=u),t}function O(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=Boolean(d(e[r])||d(e[r-1]));return t}function A(e,t,r,n,a,i){void 0===i&&(i=c);var u=function(e){var t=o.useRef(e);t.current=e;var r=o.useRef(function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return t.current.apply(t,e)});return r.current}(function(e,t){var r,o;return v(e)?(o="",r=""):"number"==typeof e||t?(o="number"==typeof e?$(e):e,r=n(o)):(o=a(e,void 0),r=n(o)),{formattedValue:r,numAsString:o}}),l=o.useState(function(){return u(f(e)?t:e,r)}),s=l[0],d=l[1],p=e,g=r;f(e)&&(p=s.numAsString,g=!0);var h=u(p,g);return o.useMemo(function(){d(h)},[h.formattedValue]),[s,function(e,t){e.formattedValue!==s.formattedValue&&d({formattedValue:e.formattedValue,numAsString:e.value}),i(e,t)}]}function j(e){return e.replace(/[^0-9]/g,"")}function k(e){return e}function T(e){var t=e.type;void 0===t&&(t="text");var r=e.displayType;void 0===r&&(r="input");var n=e.customInput,a=e.renderText,i=e.getInputRef,s=e.format;void 0===s&&(s=k);var f=e.removeFormatting;void 0===f&&(f=j);var v=e.defaultValue,p=e.valueIsNumericString,g=e.onValueChange,h=e.isAllowed,m=e.onChange;void 0===m&&(m=c);var $=e.onKeyDown;void 0===$&&($=c);var b=e.onMouseUp;void 0===b&&(b=c);var x=e.onFocus;void 0===x&&(x=c);var y=e.onBlur;void 0===y&&(y=c);var w=e.value,D=e.getCaretBoundary;void 0===D&&(D=O);var I=e.isValidInputCharacter;void 0===I&&(I=d);var T=e.isCharacterSame,F=u(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),B=A(w,v,Boolean(p),s,f,g),M=B[0],R=M.formattedValue,K=M.numAsString,P=B[1],W=o.useRef(),q=o.useRef({formattedValue:R,numAsString:K}),L=function(e,t){q.current={formattedValue:e.formattedValue,numAsString:e.value},P(e,t)},z=o.useState(!1),_=z[0],Z=z[1],G=o.useRef(null),U=o.useRef({setCaretTimeout:null,focusTimeout:null});o.useEffect(function(){return Z(!0),function(){clearTimeout(U.current.setCaretTimeout),clearTimeout(U.current.focusTimeout)}},[]);var Y=s,H=function(e,t){var r=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(r)?void 0:r}},J=function(e,t,r){0===e.selectionStart&&e.selectionEnd===e.value.length||(S(e,t),U.current.setCaretTimeout=setTimeout(function(){e.value===r&&e.selectionStart!==t&&S(e,t)},0))},X=function(e,t,r){return C(e,t,D(e),r)},Q=function(e,t,r){var n=D(t),a=function(e,t,r,n,a,o,i){void 0===i&&(i=E);var u=a.findIndex(function(e){return e}),l=e.slice(0,u);t||r.startsWith(l)||(t=l,r=l+r,n+=l.length);for(var s=r.length,c=e.length,d={},f=new Array(s),v=0;v<s;v++){f[v]=-1;for(var p=0,g=c;p<g;p++)if(i({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:v,formattedValueIndex:p})&&!0!==d[p]){f[v]=p,d[p]=!0;break}}for(var h=n;h<s&&(-1===f[h]||!o(r[h]));)h++;var m=h===s||-1===f[h]?c:f[h];for(h=n-1;h>0&&-1===f[h];)h--;var $=-1===h||-1===f[h]?0:f[h]+1;return $>m?m:n-$<m-n?$:m}(t,R,e,r,n,I,T);return a=C(t,a,n)};o.useEffect(function(){var e=q.current,t=e.formattedValue,r=e.numAsString;R===t&&K===r||L(H(R,K),{event:void 0,source:l.props})},[R,K]);var ee=G.current?N(G.current):void 0;("undefined"!=typeof window?o.useLayoutEffect:o.useEffect)(function(){var e=G.current;if(R!==q.current.formattedValue&&e){var t=Q(q.current.formattedValue,R,ee);e.value=R,J(e,t,R)}},[R]);var te=function(e,t,r){var n=t.target,a=W.current?function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}}(W.current,n.selectionEnd):V(R,e),o=Object.assign(Object.assign({},a),{lastValue:R}),i=f(e,o),u=Y(i);if(i=f(u,void 0),h&&!h(H(u,i))){var l=t.target,s=N(l),c=Q(e,R,s);return l.value=R,J(l,c,R),!1}return function(e){var t=e.formattedValue;void 0===t&&(t="");var r,n=e.input,a=e.source,o=e.event,i=e.numAsString;if(n){var u=e.inputValue||n.value,l=N(n);n.value=t,void 0!==(r=Q(u,t,l))&&J(n,r,t)}t!==R&&L(H(t,i),{event:o,source:a})}({formattedValue:u,numAsString:i,inputValue:e,event:t,source:r,input:t.target}),!0},re=function(e,t){void 0===t&&(t=0);var r=e.selectionStart,n=e.selectionEnd;W.current={selectionStart:r,selectionEnd:n+t}},ne=!_||"undefined"==typeof navigator||navigator.platform&&/iPhone|iPod/.test(navigator.platform)?void 0:"numeric",ae=Object.assign({inputMode:ne},F,{type:t,value:R,onChange:function(e){var t=e.target.value;te(t,e,l.event)&&m(e),W.current=void 0},onKeyDown:function(e){var t,r=e.target,n=e.key,a=r.selectionStart,o=r.selectionEnd,i=r.value;void 0===i&&(i=""),"ArrowLeft"===n||"Backspace"===n?t=Math.max(a-1,0):"ArrowRight"===n?t=Math.min(a+1,i.length):"Delete"===n&&(t=a);var u=0;"Delete"===n&&a===o&&(u=1);var l="ArrowLeft"===n||"ArrowRight"===n;if(void 0===t||a!==o&&!l)return $(e),void re(r,u);var s=t;l?(s=X(i,t,"ArrowLeft"===n?"left":"right"))!==t&&e.preventDefault():"Delete"!==n||I(i[t])?"Backspace"!==n||I(i[t])||(s=X(i,t,"left")):s=X(i,t,"right");s!==t&&J(r,s,i),$(e),re(r,u)},onMouseUp:function(e){var t=e.target,r=function(){var e=t.selectionStart,r=t.selectionEnd,n=t.value;if(void 0===n&&(n=""),e===r){var a=X(n,e);a!==e&&J(t,a,n)}};r(),requestAnimationFrame(function(){r()}),b(e),re(t)},onFocus:function(e){e.persist&&e.persist();var t=e.target,r=e.currentTarget;G.current=t,U.current.focusTimeout=setTimeout(function(){var n=t.selectionStart,a=t.selectionEnd,o=t.value;void 0===o&&(o="");var i=X(o,n);i===n||0===n&&a===o.length||J(t,i,o),x(Object.assign(Object.assign({},e),{currentTarget:r}))},0)},onBlur:function(e){G.current=null,clearTimeout(U.current.focusTimeout),clearTimeout(U.current.setCaretTimeout),y(e)}});if("text"===r)return a?o.createElement(o.Fragment,null,a(R,F)||null):o.createElement("span",Object.assign({},F,{ref:i}),R);if(n){var oe=n;return o.createElement(oe,Object.assign({},ae,{ref:i}))}return o.createElement("input",Object.assign({},ae,{ref:i}))}function F(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix;void 0===a&&(a="");var o=t.suffix;void 0===o&&(o="");var i=t.allowNegative,u=t.thousandsGroupStyle;if(void 0===u&&(u="thousand"),""===e||"-"===e)return e;var l=B(t),s=l.thousandSeparator,c=l.decimalSeparator,d=0!==r&&-1!==e.indexOf(".")||r&&n,f=g(e,i),v=f.beforeDecimal,p=f.afterDecimal,m=f.addNegation;return void 0!==r&&(p=h(p,r,!!n)),s&&(v=function(e,t,r){var n=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}(r),a=e.search(/[1-9]/);return a=-1===a?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}(v,s,u)),a&&(v=a+v),o&&(p+=o),m&&(v="-"+v),e=v+(d&&c||"")+p}function B(e){var t=e.decimalSeparator;void 0===t&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return!0===r&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function M(e,t,r){var n;void 0===t&&(t=D(e));var a=r.allowNegative,o=r.prefix;void 0===o&&(o="");var i=r.suffix;void 0===i&&(i="");var u=r.decimalScale,l=t.from,s=t.to,c=s.start,f=s.end,v=B(r),h=v.allowedDecimalSeparators,m=v.decimalSeparator,$=e[f]===m;if(d(e)&&(e===o||e===i)&&""===t.lastValue)return e;if(f-c===1&&-1!==h.indexOf(e[c])){var b=0===u?"":m;e=e.substring(0,c)+b+e.substring(c+1,e.length)}var S=function(e,t,r){var n=!1,a=!1;o.startsWith("-")?n=!1:e.startsWith("--")?(n=!1,a=!0):i.startsWith("-")&&e.length===i.length?n=!1:"-"===e[0]&&(n=!0);var u=n?1:0;return a&&(u=2),u&&(e=e.substring(u),t-=u,r-=u),{value:e,start:t,end:r,hasNegation:n}},x=S(e,c,f),y=x.hasNegation;e=(n=x).value,c=n.start,f=n.end;var w=S(t.lastValue,l.start,l.end),V=w.start,N=w.end,I=w.value,E=e.substring(c,f);!(e.length&&I.length&&(V>I.length-i.length||N<o.length))||E&&i.startsWith(E)||(e=I);var C=0;e.startsWith(o)?C+=o.length:c<o.length&&(C=c),f-=C;var O=(e=e.substring(C)).length,A=e.length-i.length;e.endsWith(i)?O=A:(f>A||f>e.length-i.length)&&(O=f),e=e.substring(0,O),e=function(e,t){void 0===e&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),o=n.test(e);return e=e.replace(/-/g,""),a&&!o&&t&&(e="-"+e),e}(y?"-"+e:e,a),e=(e.match(function(e){return new RegExp("(^-)|[0-9]|"+p(e),"g")}(m))||[]).join("");var j=e.indexOf(m),k=g(e=e.replace(new RegExp(p(m),"g"),function(e,t){return t===j?".":""}),a),T=k.beforeDecimal,F=k.afterDecimal,M=k.addNegation;return s.end-s.start<l.end-l.start&&""===T&&$&&!parseFloat(F)&&(e=M?"-":""),e}function R(e){e=function(e){var t=B(e),r=t.thousandSeparator,n=t.decimalSeparator,a=e.prefix;void 0===a&&(a="");var o=e.allowNegative;if(void 0===o&&(o=!0),r===n)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: "+r+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: '+n+" (default value for decimalSeparator is .)\n ");return a.startsWith("-")&&o&&(console.error("\n Prefix can't start with '-' when allowNegative is true.\n prefix: "+a+"\n allowNegative: "+o+"\n "),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,r=e.allowNegative,n=e.allowLeadingZeros,a=e.onKeyDown;void 0===a&&(a=c);var o=e.onBlur;void 0===o&&(o=c);var i=e.thousandSeparator,s=e.decimalScale,p=e.fixedDecimalScale,g=e.prefix;void 0===g&&(g="");var h=e.defaultValue,m=e.value,x=e.valueIsNumericString,y=e.onValueChange,w=u(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),N=B(e),D=N.decimalSeparator,I=N.allowedDecimalSeparators,E=function(t){return F(t,e)},C=function(t,r){return M(t,r,e)},O=f(m)?h:m,j=null!=x?x:function(e,t,r){return""===e||!(null==t?void 0:t.match(/\d/))&&!(null==r?void 0:r.match(/\d/))&&"string"==typeof e&&!isNaN(Number(e))}(O,g,t);f(m)?f(h)||(j=j||"number"==typeof h):j=j||"number"==typeof m;var k=function(e){return v(e)?e:("number"==typeof e&&(e=$(e)),j&&"number"==typeof s?b(e,s,Boolean(p)):e)},T=A(k(m),k(h),Boolean(j),E,C,y),R=T[0],K=R.numAsString,P=R.formattedValue,W=T[1];return Object.assign(Object.assign({},w),{value:P,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===D||d(e)},isCharacterSame:function(e){var t=e.currentValue,r=e.lastValue,n=e.formattedValue,a=e.currentValueIndex,o=e.formattedValueIndex,i=t[a],u=n[o],l=V(r,t).to,c=function(e){return C(e).indexOf(".")+g.length};return!(0===m&&p&&s&&t[l.start]===D&&c(t)<a&&c(n)>o)&&(!!(a>=l.start&&a<l.end&&I&&I.includes(i)&&u===D)||i===u)},onValueChange:W,format:E,removeFormatting:C,getCaretBoundary:function(t){return function(e,t){var r=t.prefix;void 0===r&&(r="");var n=t.suffix;void 0===n&&(n="");var a=Array.from({length:e.length+1}).map(function(){return!0}),o="-"===e[0];a.fill(!1,0,r.length+(o?1:0));var i=e.length;return a.fill(!1,i-n.length+1,i+1),a}(t,e)},onKeyDown:function(e){var t=e.target,n=e.key,o=t.selectionStart,u=t.selectionEnd,l=t.value;if(void 0===l&&(l=""),("Backspace"===n||"Delete"===n)&&u<g.length)e.preventDefault();else if(o===u){"Backspace"===n&&"-"===l[0]&&o===g.length+1&&r&&S(t,1),s&&p&&("Backspace"===n&&l[o-1]===D?(S(t,o-1),e.preventDefault()):"Delete"===n&&l[o]===D&&e.preventDefault()),(null==I?void 0:I.includes(n))&&l[o]===D&&S(t,o+1);var c=!0===i?",":i;"Backspace"===n&&l[o-1]===c&&S(t,o-1),"Delete"===n&&l[o]===c&&S(t,o+1),a(e)}else a(e)},onBlur:function(t){var r=K;if(r.match(/\d/g)||(r=""),n||(r=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(t?"-":"")+n+(a?"."+a:"")}(r)),p&&s&&(r=b(r,s,p)),r!==K){var a=F(r,e);W({formattedValue:a,value:r,floatValue:parseFloat(r)},{event:t,source:l.event})}o(t)}})}function K(e){e.mask,e.allowEmptyFormatting;var t=e.format,r=e.inputMode;void 0===r&&(r="numeric");var n=e.onKeyDown;void 0===n&&(n=c);var a=e.patternChar;void 0===a&&(a="#");var o=e.value,i=e.defaultValue,l=e.valueIsNumericString,s=u(e,["mask","allowEmptyFormatting","format","inputMode","onKeyDown","patternChar","value","defaultValue","valueIsNumericString"]);!function(e){var t=e.mask;if(t&&("string"===t?t:t.toString()).match(/\d/g))throw new Error("Mask "+t+" should not contain numeric character;")}(e);var v,p,g=function(t){return function(e,t){var r=t.format,n=t.mask,a=t.patternChar;void 0===a&&(a="#");var o=Array.from({length:e.length+1}).map(function(){return!0}),i=0,u=-1,l={};r.split("").forEach(function(t,r){var o=void 0;t===a&&(i++,o=I(n,i-1),-1===u&&e[r]===o&&(u=r)),l[r]=o});for(var s=function(t){return r[t]===a&&e[t]!==l[t]},c=0,d=o.length;c<d;c++)o[c]=c===u||s(c)||s(c-1);return o[r.indexOf(a)]=!0,o}(t,e)},h=f(o)?i:o,m=null!=l?l:(p=t,""===(v=h)||!((null==p?void 0:p.match(/\d/))||"string"!=typeof v||!v.match(/^\d+$/)&&""!==v)),$=Object.assign(Object.assign({},e),{valueIsNumericString:m});return Object.assign(Object.assign({},s),{value:o,defaultValue:i,valueIsNumericString:m,inputMode:r,format:function(e){return function(e,t){var r=t.format,n=t.allowEmptyFormatting,a=t.mask,o=t.patternChar;if(void 0===o&&(o="#"),""===e&&!n)return"";for(var i=0,u=r.split(""),l=0,s=r.length;l<s;l++)r[l]===o&&(u[l]=e[i]||I(a,i),i+=1);return u.join("")}(e,$)},removeFormatting:function(e,t){return function(e,t,r){void 0===t&&(t=D(e));var n=r.format,a=r.patternChar;void 0===a&&(a="#");var o=t.from,i=t.to,u=t.lastValue;void 0===u&&(u="");var l=function(e){return n[e]===a},s=function(e,t){for(var r="",n=0;n<e.length;n++)l(t+n)&&d(e[n])&&(r+=e[n]);return r},c=function(e){return e.replace(/[^0-9]/g,"")};if(!n.match(/\d/))return c(e);if((""===u||o.end-o.start===u.length)&&e.length===n.length){for(var f="",v=0;v<e.length;v++)if(l(v))d(e[v])&&(f+=e[v]);else if(e[v]!==n[v])return c(e);return f}var p=u.substring(0,o.start),g=e.substring(i.start,i.end),h=u.substring(o.end);return""+s(p,0)+c(g)+s(h,o.end)}(e,t,$)},getCaretBoundary:g,onKeyDown:function(e){var r=e.key,o=e.target,i=o.selectionStart,u=o.selectionEnd,l=o.value;if(i===u){var s=i;if("Backspace"===r||"Delete"===r){var c="right";if("Backspace"===r){for(;s>0&&t[s-1]!==a;)s--;c="left"}else{for(var d=t.length;s<d&&t[s]!==a;)s++;c="right"}s=C(l,s,g(l),c)}else t[s]!==a&&"ArrowLeft"!==r&&"ArrowRight"!==r&&(s=C(l,s+1,g(l),"right"));s!==i&&S(o,s),n(e)}else n(e)}})}const P=i.div`
|
|
1
|
+
"use strict";const e=require("./style-Df37KnoJ.cjs"),t=require("./style-D8DUzG0C.cjs"),r=require("./style-fRZ6xrVp.cjs"),n=require("./theme.global-D67h5YeA.cjs"),a=require("framer-motion"),o=require("react"),i=require("styled-components");function u(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var l,s;function c(){}function d(e){return!!(e||"").match(/\d/)}function f(e){return null==e}function v(e){return f(e)||function(e){return"number"==typeof e&&isNaN(e)}(e)||"number"==typeof e&&!isFinite(e)}function p(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function g(e,t){void 0===t&&(t=!0);var r="-"===e[0],n=r&&t,a=(e=e.replace("-","")).split(".");return{beforeDecimal:a[0],afterDecimal:a[1]||"",hasNegation:r,addNegation:n}}function h(e,t,r){for(var n="",a=r?"0":"",o=0;o<=t-1;o++)n+=e[o]||a;return n}function m(e,t){return Array(t+1).join(e)}function $(e){var t=e+"",r="-"===t[0]?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),a=n[0],o=n[1];if(!(o=Number(o)))return r+a;var i=1+o,u=(a=a.replace(".","")).length;return i<0?a="0."+m("0",Math.abs(i))+a:i>=u?a+=m("0",i-u):a=(a.substring(0,i)||"0")+"."+a.substring(i),r+a}function b(e,t,r){if(-1!==["","-"].indexOf(e))return e;var n=(-1!==e.indexOf(".")||r)&&t,a=g(e),o=a.beforeDecimal,i=a.afterDecimal,u=a.hasNegation,l=parseFloat("0."+(i||"0")),s=(i.length<=t?"0."+i:l.toFixed(t)).split("."),c=o;return o&&Number(s[0])&&(c=o.split("").reverse().reduce(function(e,t,r){return e.length>r?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},s[0])),""+(u?"-":"")+c+(n?".":"")+h(s[1]||"",t,r)}function S(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}(s=l||(l={})).event="event",s.props="prop";var x,y,w,V=(x=function(e,t){for(var r=0,n=0,a=e.length,o=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[o-1-n]&&o-n>r&&a-n>r;)n++;return{from:{start:r,end:a-n},to:{start:r,end:o-n}}},w=void 0,function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return y&&e.length===y.length&&e.every(function(e,t){return e===y[t]})?w:(y=e,w=x.apply(void 0,e))});function N(e){return Math.max(e.selectionStart,e.selectionEnd)}function I(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function D(e,t){return void 0===e&&(e=" "),"string"==typeof e?e:e[t]||" "}function E(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function C(e,t,r,n){var a,o,i,u=e.length;if(a=t,o=0,i=u,t=Math.min(Math.max(a,o),i),"left"===n){for(;t>=0&&!r[t];)t--;-1===t&&(t=r.indexOf(!0))}else{for(;t<=u&&!r[t];)t++;t>u&&(t=r.lastIndexOf(!0))}return-1===t&&(t=u),t}function O(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=Boolean(d(e[r])||d(e[r-1]));return t}function A(e,t,r,n,a,i){void 0===i&&(i=c);var u=function(e){var t=o.useRef(e);t.current=e;var r=o.useRef(function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return t.current.apply(t,e)});return r.current}(function(e,t){var r,o;return v(e)?(o="",r=""):"number"==typeof e||t?(o="number"==typeof e?$(e):e,r=n(o)):(o=a(e,void 0),r=n(o)),{formattedValue:r,numAsString:o}}),l=o.useState(function(){return u(f(e)?t:e,r)}),s=l[0],d=l[1],p=e,g=r;f(e)&&(p=s.numAsString,g=!0);var h=u(p,g);return o.useMemo(function(){d(h)},[h.formattedValue]),[s,function(e,t){e.formattedValue!==s.formattedValue&&d({formattedValue:e.formattedValue,numAsString:e.value}),i(e,t)}]}function j(e){return e.replace(/[^0-9]/g,"")}function k(e){return e}function T(e){var t=e.type;void 0===t&&(t="text");var r=e.displayType;void 0===r&&(r="input");var n=e.customInput,a=e.renderText,i=e.getInputRef,s=e.format;void 0===s&&(s=k);var f=e.removeFormatting;void 0===f&&(f=j);var v=e.defaultValue,p=e.valueIsNumericString,g=e.onValueChange,h=e.isAllowed,m=e.onChange;void 0===m&&(m=c);var $=e.onKeyDown;void 0===$&&($=c);var b=e.onMouseUp;void 0===b&&(b=c);var x=e.onFocus;void 0===x&&(x=c);var y=e.onBlur;void 0===y&&(y=c);var w=e.value,I=e.getCaretBoundary;void 0===I&&(I=O);var D=e.isValidInputCharacter;void 0===D&&(D=d);var T=e.isCharacterSame,F=u(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),B=A(w,v,Boolean(p),s,f,g),M=B[0],R=M.formattedValue,K=M.numAsString,P=B[1],W=o.useRef(),q=o.useRef({formattedValue:R,numAsString:K}),L=function(e,t){q.current={formattedValue:e.formattedValue,numAsString:e.value},P(e,t)},z=o.useState(!1),_=z[0],Z=z[1],G=o.useRef(null),U=o.useRef({setCaretTimeout:null,focusTimeout:null});o.useEffect(function(){return Z(!0),function(){clearTimeout(U.current.setCaretTimeout),clearTimeout(U.current.focusTimeout)}},[]);var Y=s,H=function(e,t){var r=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(r)?void 0:r}},J=function(e,t,r){0===e.selectionStart&&e.selectionEnd===e.value.length||(S(e,t),U.current.setCaretTimeout=setTimeout(function(){e.value===r&&e.selectionStart!==t&&S(e,t)},0))},X=function(e,t,r){return C(e,t,I(e),r)},Q=function(e,t,r){var n=I(t),a=function(e,t,r,n,a,o,i){void 0===i&&(i=E);var u=a.findIndex(function(e){return e}),l=e.slice(0,u);t||r.startsWith(l)||(t=l,r=l+r,n+=l.length);for(var s=r.length,c=e.length,d={},f=new Array(s),v=0;v<s;v++){f[v]=-1;for(var p=0,g=c;p<g;p++)if(i({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:v,formattedValueIndex:p})&&!0!==d[p]){f[v]=p,d[p]=!0;break}}for(var h=n;h<s&&(-1===f[h]||!o(r[h]));)h++;var m=h===s||-1===f[h]?c:f[h];for(h=n-1;h>0&&-1===f[h];)h--;var $=-1===h||-1===f[h]?0:f[h]+1;return $>m?m:n-$<m-n?$:m}(t,R,e,r,n,D,T);return a=C(t,a,n)};o.useEffect(function(){var e=q.current,t=e.formattedValue,r=e.numAsString;R===t&&K===r||L(H(R,K),{event:void 0,source:l.props})},[R,K]);var ee=G.current?N(G.current):void 0;("undefined"!=typeof window?o.useLayoutEffect:o.useEffect)(function(){var e=G.current;if(R!==q.current.formattedValue&&e){var t=Q(q.current.formattedValue,R,ee);e.value=R,J(e,t,R)}},[R]);var te=function(e,t,r){var n=t.target,a=W.current?function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}}(W.current,n.selectionEnd):V(R,e),o=Object.assign(Object.assign({},a),{lastValue:R}),i=f(e,o),u=Y(i);if(i=f(u,void 0),h&&!h(H(u,i))){var l=t.target,s=N(l),c=Q(e,R,s);return l.value=R,J(l,c,R),!1}return function(e){var t=e.formattedValue;void 0===t&&(t="");var r,n=e.input,a=e.source,o=e.event,i=e.numAsString;if(n){var u=e.inputValue||n.value,l=N(n);n.value=t,void 0!==(r=Q(u,t,l))&&J(n,r,t)}t!==R&&L(H(t,i),{event:o,source:a})}({formattedValue:u,numAsString:i,inputValue:e,event:t,source:r,input:t.target}),!0},re=function(e,t){void 0===t&&(t=0);var r=e.selectionStart,n=e.selectionEnd;W.current={selectionStart:r,selectionEnd:n+t}},ne=!_||"undefined"==typeof navigator||navigator.platform&&/iPhone|iPod/.test(navigator.platform)?void 0:"numeric",ae=Object.assign({inputMode:ne},F,{type:t,value:R,onChange:function(e){var t=e.target.value;te(t,e,l.event)&&m(e),W.current=void 0},onKeyDown:function(e){var t,r=e.target,n=e.key,a=r.selectionStart,o=r.selectionEnd,i=r.value;void 0===i&&(i=""),"ArrowLeft"===n||"Backspace"===n?t=Math.max(a-1,0):"ArrowRight"===n?t=Math.min(a+1,i.length):"Delete"===n&&(t=a);var u=0;"Delete"===n&&a===o&&(u=1);var l="ArrowLeft"===n||"ArrowRight"===n;if(void 0===t||a!==o&&!l)return $(e),void re(r,u);var s=t;l?(s=X(i,t,"ArrowLeft"===n?"left":"right"))!==t&&e.preventDefault():"Delete"!==n||D(i[t])?"Backspace"!==n||D(i[t])||(s=X(i,t,"left")):s=X(i,t,"right");s!==t&&J(r,s,i),$(e),re(r,u)},onMouseUp:function(e){var t=e.target,r=function(){var e=t.selectionStart,r=t.selectionEnd,n=t.value;if(void 0===n&&(n=""),e===r){var a=X(n,e);a!==e&&J(t,a,n)}};r(),requestAnimationFrame(function(){r()}),b(e),re(t)},onFocus:function(e){e.persist&&e.persist();var t=e.target,r=e.currentTarget;G.current=t,U.current.focusTimeout=setTimeout(function(){var n=t.selectionStart,a=t.selectionEnd,o=t.value;void 0===o&&(o="");var i=X(o,n);i===n||0===n&&a===o.length||J(t,i,o),x(Object.assign(Object.assign({},e),{currentTarget:r}))},0)},onBlur:function(e){G.current=null,clearTimeout(U.current.focusTimeout),clearTimeout(U.current.setCaretTimeout),y(e)}});if("text"===r)return a?o.createElement(o.Fragment,null,a(R,F)||null):o.createElement("span",Object.assign({},F,{ref:i}),R);if(n){var oe=n;return o.createElement(oe,Object.assign({},ae,{ref:i}))}return o.createElement("input",Object.assign({},ae,{ref:i}))}function F(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix;void 0===a&&(a="");var o=t.suffix;void 0===o&&(o="");var i=t.allowNegative,u=t.thousandsGroupStyle;if(void 0===u&&(u="thousand"),""===e||"-"===e)return e;var l=B(t),s=l.thousandSeparator,c=l.decimalSeparator,d=0!==r&&-1!==e.indexOf(".")||r&&n,f=g(e,i),v=f.beforeDecimal,p=f.afterDecimal,m=f.addNegation;return void 0!==r&&(p=h(p,r,!!n)),s&&(v=function(e,t,r){var n=function(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}(r),a=e.search(/[1-9]/);return a=-1===a?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}(v,s,u)),a&&(v=a+v),o&&(p+=o),m&&(v="-"+v),e=v+(d&&c||"")+p}function B(e){var t=e.decimalSeparator;void 0===t&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return!0===r&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function M(e,t,r){var n;void 0===t&&(t=I(e));var a=r.allowNegative,o=r.prefix;void 0===o&&(o="");var i=r.suffix;void 0===i&&(i="");var u=r.decimalScale,l=t.from,s=t.to,c=s.start,f=s.end,v=B(r),h=v.allowedDecimalSeparators,m=v.decimalSeparator,$=e[f]===m;if(d(e)&&(e===o||e===i)&&""===t.lastValue)return e;if(f-c===1&&-1!==h.indexOf(e[c])){var b=0===u?"":m;e=e.substring(0,c)+b+e.substring(c+1,e.length)}var S=function(e,t,r){var n=!1,a=!1;o.startsWith("-")?n=!1:e.startsWith("--")?(n=!1,a=!0):i.startsWith("-")&&e.length===i.length?n=!1:"-"===e[0]&&(n=!0);var u=n?1:0;return a&&(u=2),u&&(e=e.substring(u),t-=u,r-=u),{value:e,start:t,end:r,hasNegation:n}},x=S(e,c,f),y=x.hasNegation;e=(n=x).value,c=n.start,f=n.end;var w=S(t.lastValue,l.start,l.end),V=w.start,N=w.end,D=w.value,E=e.substring(c,f);!(e.length&&D.length&&(V>D.length-i.length||N<o.length))||E&&i.startsWith(E)||(e=D);var C=0;e.startsWith(o)?C+=o.length:c<o.length&&(C=c),f-=C;var O=(e=e.substring(C)).length,A=e.length-i.length;e.endsWith(i)?O=A:(f>A||f>e.length-i.length)&&(O=f),e=e.substring(0,O),e=function(e,t){void 0===e&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),o=n.test(e);return e=e.replace(/-/g,""),a&&!o&&t&&(e="-"+e),e}(y?"-"+e:e,a),e=(e.match(function(e){return new RegExp("(^-)|[0-9]|"+p(e),"g")}(m))||[]).join("");var j=e.indexOf(m),k=g(e=e.replace(new RegExp(p(m),"g"),function(e,t){return t===j?".":""}),a),T=k.beforeDecimal,F=k.afterDecimal,M=k.addNegation;return s.end-s.start<l.end-l.start&&""===T&&$&&!parseFloat(F)&&(e=M?"-":""),e}function R(e){e=function(e){var t=B(e),r=t.thousandSeparator,n=t.decimalSeparator,a=e.prefix;void 0===a&&(a="");var o=e.allowNegative;if(void 0===o&&(o=!0),r===n)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: "+r+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: '+n+" (default value for decimalSeparator is .)\n ");return a.startsWith("-")&&o&&(console.error("\n Prefix can't start with '-' when allowNegative is true.\n prefix: "+a+"\n allowNegative: "+o+"\n "),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,r=e.allowNegative,n=e.allowLeadingZeros,a=e.onKeyDown;void 0===a&&(a=c);var o=e.onBlur;void 0===o&&(o=c);var i=e.thousandSeparator,s=e.decimalScale,p=e.fixedDecimalScale,g=e.prefix;void 0===g&&(g="");var h=e.defaultValue,m=e.value,x=e.valueIsNumericString,y=e.onValueChange,w=u(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),N=B(e),I=N.decimalSeparator,D=N.allowedDecimalSeparators,E=function(t){return F(t,e)},C=function(t,r){return M(t,r,e)},O=f(m)?h:m,j=null!=x?x:function(e,t,r){return""===e||!(null==t?void 0:t.match(/\d/))&&!(null==r?void 0:r.match(/\d/))&&"string"==typeof e&&!isNaN(Number(e))}(O,g,t);f(m)?f(h)||(j=j||"number"==typeof h):j=j||"number"==typeof m;var k=function(e){return v(e)?e:("number"==typeof e&&(e=$(e)),j&&"number"==typeof s?b(e,s,Boolean(p)):e)},T=A(k(m),k(h),Boolean(j),E,C,y),R=T[0],K=R.numAsString,P=R.formattedValue,W=T[1];return Object.assign(Object.assign({},w),{value:P,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===I||d(e)},isCharacterSame:function(e){var t=e.currentValue,r=e.lastValue,n=e.formattedValue,a=e.currentValueIndex,o=e.formattedValueIndex,i=t[a],u=n[o],l=V(r,t).to,c=function(e){return C(e).indexOf(".")+g.length};return!(0===m&&p&&s&&t[l.start]===I&&c(t)<a&&c(n)>o)&&(!!(a>=l.start&&a<l.end&&D&&D.includes(i)&&u===I)||i===u)},onValueChange:W,format:E,removeFormatting:C,getCaretBoundary:function(t){return function(e,t){var r=t.prefix;void 0===r&&(r="");var n=t.suffix;void 0===n&&(n="");var a=Array.from({length:e.length+1}).map(function(){return!0}),o="-"===e[0];a.fill(!1,0,r.length+(o?1:0));var i=e.length;return a.fill(!1,i-n.length+1,i+1),a}(t,e)},onKeyDown:function(e){var t=e.target,n=e.key,o=t.selectionStart,u=t.selectionEnd,l=t.value;if(void 0===l&&(l=""),("Backspace"===n||"Delete"===n)&&u<g.length)e.preventDefault();else if(o===u){"Backspace"===n&&"-"===l[0]&&o===g.length+1&&r&&S(t,1),s&&p&&("Backspace"===n&&l[o-1]===I?(S(t,o-1),e.preventDefault()):"Delete"===n&&l[o]===I&&e.preventDefault()),(null==D?void 0:D.includes(n))&&l[o]===I&&S(t,o+1);var c=!0===i?",":i;"Backspace"===n&&l[o-1]===c&&S(t,o-1),"Delete"===n&&l[o]===c&&S(t,o+1),a(e)}else a(e)},onBlur:function(t){var r=K;if(r.match(/\d/g)||(r=""),n||(r=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(t?"-":"")+n+(a?"."+a:"")}(r)),p&&s&&(r=b(r,s,p)),r!==K){var a=F(r,e);W({formattedValue:a,value:r,floatValue:parseFloat(r)},{event:t,source:l.event})}o(t)}})}function K(e){e.mask,e.allowEmptyFormatting;var t=e.format,r=e.inputMode;void 0===r&&(r="numeric");var n=e.onKeyDown;void 0===n&&(n=c);var a=e.patternChar;void 0===a&&(a="#");var o=e.value,i=e.defaultValue,l=e.valueIsNumericString,s=u(e,["mask","allowEmptyFormatting","format","inputMode","onKeyDown","patternChar","value","defaultValue","valueIsNumericString"]);!function(e){var t=e.mask;if(t&&("string"===t?t:t.toString()).match(/\d/g))throw new Error("Mask "+t+" should not contain numeric character;")}(e);var v,p,g=function(t){return function(e,t){var r=t.format,n=t.mask,a=t.patternChar;void 0===a&&(a="#");var o=Array.from({length:e.length+1}).map(function(){return!0}),i=0,u=-1,l={};r.split("").forEach(function(t,r){var o=void 0;t===a&&(i++,o=D(n,i-1),-1===u&&e[r]===o&&(u=r)),l[r]=o});for(var s=function(t){return r[t]===a&&e[t]!==l[t]},c=0,d=o.length;c<d;c++)o[c]=c===u||s(c)||s(c-1);return o[r.indexOf(a)]=!0,o}(t,e)},h=f(o)?i:o,m=null!=l?l:(p=t,""===(v=h)||!((null==p?void 0:p.match(/\d/))||"string"!=typeof v||!v.match(/^\d+$/)&&""!==v)),$=Object.assign(Object.assign({},e),{valueIsNumericString:m});return Object.assign(Object.assign({},s),{value:o,defaultValue:i,valueIsNumericString:m,inputMode:r,format:function(e){return function(e,t){var r=t.format,n=t.allowEmptyFormatting,a=t.mask,o=t.patternChar;if(void 0===o&&(o="#"),""===e&&!n)return"";for(var i=0,u=r.split(""),l=0,s=r.length;l<s;l++)r[l]===o&&(u[l]=e[i]||D(a,i),i+=1);return u.join("")}(e,$)},removeFormatting:function(e,t){return function(e,t,r){void 0===t&&(t=I(e));var n=r.format,a=r.patternChar;void 0===a&&(a="#");var o=t.from,i=t.to,u=t.lastValue;void 0===u&&(u="");var l=function(e){return n[e]===a},s=function(e,t){for(var r="",n=0;n<e.length;n++)l(t+n)&&d(e[n])&&(r+=e[n]);return r},c=function(e){return e.replace(/[^0-9]/g,"")};if(!n.match(/\d/))return c(e);if((""===u||o.end-o.start===u.length)&&e.length===n.length){for(var f="",v=0;v<e.length;v++)if(l(v))d(e[v])&&(f+=e[v]);else if(e[v]!==n[v])return c(e);return f}var p=u.substring(0,o.start),g=e.substring(i.start,i.end),h=u.substring(o.end);return""+s(p,0)+c(g)+s(h,o.end)}(e,t,$)},getCaretBoundary:g,onKeyDown:function(e){var r=e.key,o=e.target,i=o.selectionStart,u=o.selectionEnd,l=o.value;if(i===u){var s=i;if("Backspace"===r||"Delete"===r){var c="right";if("Backspace"===r){for(;s>0&&t[s-1]!==a;)s--;c="left"}else{for(var d=t.length;s<d&&t[s]!==a;)s++;c="right"}s=C(l,s,g(l),c)}else t[s]!==a&&"ArrowLeft"!==r&&"ArrowRight"!==r&&(s=C(l,s+1,g(l),"right"));s!==i&&S(o,s),n(e)}else n(e)}})}const P=i.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: flex-start;
|
|
@@ -134,4 +134,4 @@
|
|
|
134
134
|
${e.addDisabled};
|
|
135
135
|
${e.addTransition};
|
|
136
136
|
`;exports.InputPostfixChildren=Q,exports.InputPrefixChildren=X,exports.InputSize=z,exports.InputSizeConstructor=_,exports.StyledInput=U,exports.StyledInputCSS=G,exports.StyledInputNumeric=J,exports.StyledInputPattern=H,exports.StyledInputWrapper=P,exports.StyledMotionInput=Y,exports.addInputIsInputEffect=Z,exports.addInputPlaceholder=W,exports.addInputPlaceholderNiceNumber=q;
|
|
137
|
-
//# sourceMappingURL=component.styles-
|
|
137
|
+
//# sourceMappingURL=component.styles-Hx-MJSWX.cjs.map
|