@jenesei-software/jenesei-kit-react 1.3.9 → 1.3.10
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-Dnq78ow6.js → area-BYuHpaUX.js} +2 -2
- package/build/{area-Dnq78ow6.js.map → area-BYuHpaUX.js.map} +1 -1
- package/build/{area-DnAf310m.cjs → area-C6XuN6wk.cjs} +2 -2
- package/build/{area-DnAf310m.cjs.map → area-C6XuN6wk.cjs.map} +1 -1
- package/build/{area-CFZW3T1g.js → area-CkM4ZN2F.js} +2 -2
- package/build/{area-CFZW3T1g.js.map → area-CkM4ZN2F.js.map} +1 -1
- package/build/{area-C3wR_pPr.cjs → area-oZm7ewxw.cjs} +2 -2
- package/build/{area-C3wR_pPr.cjs.map → area-oZm7ewxw.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/area-skeleton.es.js +1 -1
- package/build/build-info.txt +3 -3
- package/build/component--jGdo2yq.cjs +2 -0
- package/build/component--jGdo2yq.cjs.map +1 -0
- package/build/component-B1bvPlyB.cjs +90 -0
- package/build/component-B1bvPlyB.cjs.map +1 -0
- package/build/{component-DHq4T6Ku.cjs → component-BYox4gmt.cjs} +2 -2
- package/build/{component-DHq4T6Ku.cjs.map → component-BYox4gmt.cjs.map} +1 -1
- package/build/component-C67KboOB.cjs +245 -0
- package/build/component-C67KboOB.cjs.map +1 -0
- package/build/{component-BiNPQpCQ.cjs → component-CY7lfJVv.cjs} +2 -2
- package/build/{component-BiNPQpCQ.cjs.map → component-CY7lfJVv.cjs.map} +1 -1
- package/build/{component-DfxlJBGv.js → component-CvW0MIM8.js} +3 -3
- package/build/{component-DfxlJBGv.js.map → component-CvW0MIM8.js.map} +1 -1
- package/build/{component-C4ULY0c6.js → component-DJYgewYg.js} +20 -9
- package/build/component-DJYgewYg.js.map +1 -0
- package/build/component-DKMsOpqH.js +710 -0
- package/build/component-DKMsOpqH.js.map +1 -0
- package/build/{component-Bzw_uobM.js → component-DaXKDHnc.js} +48 -7
- package/build/component-DaXKDHnc.js.map +1 -0
- package/build/{component-CQ8fy2gK.js → component-WUYE2soZ.js} +2 -2
- package/build/{component-CQ8fy2gK.js.map → component-WUYE2soZ.js.map} +1 -1
- package/build/component-accordion.cjs.js +1 -1
- package/build/component-accordion.es.js +1 -1
- package/build/component-button-group.cjs.js +1 -1
- package/build/component-button-group.d.ts +18 -1
- package/build/component-button-group.es.js +1 -1
- package/build/component-button.cjs.js +1 -1
- package/build/component-button.d.ts +21 -2
- package/build/component-button.es.js +1 -1
- package/build/component-checkbox-group.cjs.js +1 -1
- package/build/component-checkbox-group.d.ts +20 -3
- package/build/component-checkbox-group.es.js +1 -1
- package/build/component-checkbox.cjs.js +1 -1
- package/build/component-checkbox.d.ts +21 -2
- package/build/component-checkbox.es.js +1 -1
- package/build/component-date-picker.cjs.js +1 -1
- package/build/component-date-picker.d.ts +35 -37
- package/build/component-date-picker.es.js +1 -1
- package/build/component-icon.cjs.js +1 -1
- package/build/component-icon.es.js +1 -1
- package/build/component-image-button.cjs.js +1 -1
- package/build/component-image-button.d.ts +18 -1
- 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 +18 -1
- 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-image.es.js +1 -1
- package/build/component-input-otp.cjs.js +1 -1
- package/build/component-input-otp.d.ts +51 -5
- package/build/component-input-otp.es.js +1 -1
- package/build/component-input.cjs.js +1 -1
- package/build/component-input.d.ts +62 -14
- package/build/component-input.es.js +2 -2
- 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 +18 -1
- package/build/component-pagination.es.js +1 -1
- package/build/component-range.cjs.js +1 -1
- package/build/component-range.d.ts +50 -4
- package/build/component-range.es.js +1 -1
- package/build/component-select.cjs.js +1 -1
- package/build/component-select.d.ts +48 -7
- package/build/component-select.es.js +1 -1
- package/build/component-textarea.cjs.js +1 -1
- package/build/component-textarea.d.ts +50 -7
- package/build/component-textarea.es.js +1 -1
- package/build/component-toggle.cjs.js +1 -1
- package/build/component-toggle.d.ts +51 -2
- package/build/component-toggle.es.js +1 -1
- package/build/component-tooltip.cjs.js +1 -1
- package/build/component-tooltip.d.ts +14 -2
- package/build/component-tooltip.es.js +1 -1
- package/build/component-typography.cjs.js +1 -1
- package/build/component-typography.d.ts +27 -13
- package/build/component-typography.es.js +7 -6
- package/build/component-typography.es.js.map +1 -1
- package/build/{component.components-H_qAeBHw.cjs → component.components-CeKyOsDE.cjs} +2 -2
- package/build/{component.components-H_qAeBHw.cjs.map → component.components-CeKyOsDE.cjs.map} +1 -1
- package/build/{component.components-DX0DVix5.js → component.components-f-tFdB6f.js} +4 -4
- package/build/{component.components-DX0DVix5.js.map → component.components-f-tFdB6f.js.map} +1 -1
- package/build/{component.constants-veAUxKBd.cjs → component.constants-B9xzGc3A.cjs} +2 -2
- package/build/{component.constants-veAUxKBd.cjs.map → component.constants-B9xzGc3A.cjs.map} +1 -1
- package/build/{component.constants-DjYLZpyY.js → component.constants-BrJrCmlA.js} +2 -2
- package/build/{component.constants-DjYLZpyY.js.map → component.constants-BrJrCmlA.js.map} +1 -1
- package/build/{component.constants-DwRduxMm.cjs → component.constants-DRPyaSU8.cjs} +3 -3
- package/build/{component.constants-DwRduxMm.cjs.map → component.constants-DRPyaSU8.cjs.map} +1 -1
- package/build/{component.constants-C7DGbAC8.js → component.constants-amkB3VHg.js} +7 -7
- package/build/{component.constants-C7DGbAC8.js.map → component.constants-amkB3VHg.js.map} +1 -1
- package/build/component.functions-D9ffjEok.cjs +8 -0
- package/build/component.functions-D9ffjEok.cjs.map +1 -0
- package/build/component.functions-DNW6h8kk.js +12 -0
- package/build/component.functions-DNW6h8kk.js.map +1 -0
- package/build/{component.styles-5CVyEjEh.js → component.styles--PEjCgcA.js} +51 -23
- package/build/component.styles--PEjCgcA.js.map +1 -0
- package/build/{component.styles-C3hYZJGh.js → component.styles-B0FFHGeN.js} +26 -20
- package/build/component.styles-B0FFHGeN.js.map +1 -0
- package/build/{component.styles-C1p3V7H6.js → component.styles-BDKsgd6y.js} +32 -19
- package/build/component.styles-BDKsgd6y.js.map +1 -0
- package/build/{component.styles-Cje8zTpf.cjs → component.styles-BELwxHxh.cjs} +7 -7
- package/build/component.styles-BELwxHxh.cjs.map +1 -0
- package/build/{component.styles-DpgkACgI.js → component.styles-BGYbrzvh.js} +2 -2
- package/build/{component.styles-DpgkACgI.js.map → component.styles-BGYbrzvh.js.map} +1 -1
- package/build/{component.styles-DSle6iuF.cjs → component.styles-BKnUDWqO.cjs} +2 -2
- package/build/{component.styles-DSle6iuF.cjs.map → component.styles-BKnUDWqO.cjs.map} +1 -1
- package/build/{component.styles-DLU0S0KI.cjs → component.styles-BTsmbWT6.cjs} +2 -2
- package/build/{component.styles-DLU0S0KI.cjs.map → component.styles-BTsmbWT6.cjs.map} +1 -1
- package/build/{component.styles-DYS_AJ9F.js → component.styles-BbwS_Ekx.js} +9 -10
- package/build/{component.styles-DYS_AJ9F.js.map → component.styles-BbwS_Ekx.js.map} +1 -1
- package/build/component.styles-BeRVOt5T.cjs +137 -0
- package/build/{component.styles-Crx4pACx.cjs.map → component.styles-BeRVOt5T.cjs.map} +1 -1
- package/build/component.styles-BpvpyZax.cjs +73 -0
- package/build/component.styles-BpvpyZax.cjs.map +1 -0
- package/build/{component.styles-BirbSbuD.js → component.styles-CPWNnqqm.js} +3 -3
- package/build/{component.styles-BirbSbuD.js.map → component.styles-CPWNnqqm.js.map} +1 -1
- package/build/component.styles-CsB9986a.cjs +99 -0
- package/build/component.styles-CsB9986a.cjs.map +1 -0
- package/build/{component.styles-5Xz_H-fR.js → component.styles-DARNjy9P.js} +32 -11
- package/build/component.styles-DARNjy9P.js.map +1 -0
- package/build/{component.styles-CggIUAVx.js → component.styles-DOnQEUrI.js} +20 -9
- package/build/{component.styles-CggIUAVx.js.map → component.styles-DOnQEUrI.js.map} +1 -1
- package/build/{component.styles-Bm3Ec-Kd.js → component.styles-DS0ofW1Y.js} +3 -3
- package/build/{component.styles-Bm3Ec-Kd.js.map → component.styles-DS0ofW1Y.js.map} +1 -1
- package/build/component.styles-DWGUgUoF.cjs +21 -0
- package/build/component.styles-DWGUgUoF.cjs.map +1 -0
- package/build/{component.styles-DX_3POUD.js → component.styles-DjoG6jr2.js} +3 -3
- package/build/{component.styles-DX_3POUD.js.map → component.styles-DjoG6jr2.js.map} +1 -1
- package/build/{component.styles-Bfhg18CX.cjs → component.styles-Dpo373cZ.cjs} +2 -2
- package/build/{component.styles-Bfhg18CX.cjs.map → component.styles-Dpo373cZ.cjs.map} +1 -1
- package/build/{component.styles-v0YYECwW.js → component.styles-VrNFgg1_.js} +32 -12
- package/build/component.styles-VrNFgg1_.js.map +1 -0
- package/build/{component.styles-DhAMCZ71.cjs → component.styles-ZU_GyVub.cjs} +2 -2
- package/build/{component.styles-DhAMCZ71.cjs.map → component.styles-ZU_GyVub.cjs.map} +1 -1
- package/build/component.styles-gZHy-64x.cjs +13 -0
- package/build/component.styles-gZHy-64x.cjs.map +1 -0
- package/build/{component.styles--Ug3PJQ6.cjs → component.styles-iHE8mmya.cjs} +7 -7
- package/build/{component.styles--Ug3PJQ6.cjs.map → component.styles-iHE8mmya.cjs.map} +1 -1
- package/build/component.styles-mhkAuWyU.cjs +225 -0
- package/build/component.styles-mhkAuWyU.cjs.map +1 -0
- package/build/component.styles-nl99kkS3.js +94 -0
- package/build/component.styles-nl99kkS3.js.map +1 -0
- package/build/{component.types-BzBjcohg.js → component.types-CSnoBg2y.js} +94 -67
- package/build/component.types-CSnoBg2y.js.map +1 -0
- package/build/component.types-CWp0NPUN.cjs +171 -0
- package/build/component.types-CWp0NPUN.cjs.map +1 -0
- package/build/context-app.cjs.js +1 -1
- package/build/context-app.es.js +1 -1
- package/build/context-dialog.cjs.js +1 -1
- package/build/context-dialog.d.ts +11 -4
- package/build/context-dialog.es.js +1 -1
- package/build/context-sonner.cjs.js +1 -1
- package/build/context-sonner.d.ts +42 -7
- package/build/context-sonner.es.js +1 -1
- package/build/context.constants-ByXsACU7.cjs +32 -0
- package/build/context.constants-ByXsACU7.cjs.map +1 -0
- package/build/context.constants-CTr1U0kI.cjs +98 -0
- package/build/context.constants-CTr1U0kI.cjs.map +1 -0
- package/build/{context.constants-B9Yk6CGe.js → context.constants-CvkvB0XC.js} +8 -5
- package/build/context.constants-CvkvB0XC.js.map +1 -0
- package/build/{context.constants-Bz_5itIx.js → context.constants-DRimaVcG.js} +26 -9
- package/build/context.constants-DRimaVcG.js.map +1 -0
- package/build/{context.hooks-BDEwJHqB.cjs → context.hooks-DOygH-Yj.cjs} +3 -3
- package/build/{context.hooks-BDEwJHqB.cjs.map → context.hooks-DOygH-Yj.cjs.map} +1 -1
- package/build/{context.hooks-DTdppyho.js → context.hooks-kga1DMrX.js} +4 -4
- package/build/{context.hooks-DTdppyho.js.map → context.hooks-kga1DMrX.js.map} +1 -1
- package/build/floating-ui.react--v70Xky9.cjs +2 -0
- package/build/floating-ui.react--v70Xky9.cjs.map +1 -0
- package/build/{component-BoHvC24Q.js → floating-ui.react-Byi6bLb1.js} +17 -704
- package/build/floating-ui.react-Byi6bLb1.js.map +1 -0
- package/build/index.cjs.js +1 -1
- package/build/index.d.ts +83 -89
- package/build/index.es.js +55 -53
- package/build/index.es.js.map +1 -1
- package/build/style-D3Lbn1EL.cjs +32 -0
- package/build/style-D3Lbn1EL.cjs.map +1 -0
- package/build/{style-mc2ST5fY.cjs → style-Df37KnoJ.cjs} +47 -18
- package/build/style-Df37KnoJ.cjs.map +1 -0
- package/build/{style-BgcnmVAY.js → style-RL73t3JD.js} +63 -20
- package/build/style-RL73t3JD.js.map +1 -0
- package/build/style-add.cjs.js +1 -1
- package/build/style-add.d.ts +57 -5
- package/build/style-add.es.js +11 -10
- package/build/style-error.cjs.js +1 -1
- package/build/style-error.d.ts +42 -1
- package/build/style-error.es.js +1 -1
- package/build/style-fRZ6xrVp.cjs.map +1 -1
- package/build/style-plT9Ah7t.js.map +1 -1
- package/build/style-theme.cjs.js +1 -1
- package/build/style-theme.d.ts +2 -2
- package/build/style-theme.es.js +1 -1
- package/build/{style-BQ653xOS.js → style-uVTmdhsH.js} +14 -5
- package/build/style-uVTmdhsH.js.map +1 -0
- package/build/{theme.global-CFUz5Asg.js → theme.global-BgERDJ4e.js} +36 -1
- package/build/theme.global-BgERDJ4e.js.map +1 -0
- package/build/{theme.global-B9t2Fi10.cjs → theme.global-CcoD5bPP.cjs} +2 -2
- package/build/theme.global-CcoD5bPP.cjs.map +1 -0
- package/build/{use-DTZ8c8_g.js → use-DLVWi2kS.js} +6 -6
- package/build/{use-DTZ8c8_g.js.map → use-DLVWi2kS.js.map} +1 -1
- package/build/{use-D7IsSb34.cjs → use-Dg449cuf.cjs} +2 -2
- package/build/{use-D7IsSb34.cjs.map → use-Dg449cuf.cjs.map} +1 -1
- package/package.json +1 -1
- package/build/component-BoHvC24Q.js.map +0 -1
- package/build/component-Bzw_uobM.js.map +0 -1
- package/build/component-C4ULY0c6.js.map +0 -1
- package/build/component-CACoGUK9.cjs +0 -251
- package/build/component-CACoGUK9.cjs.map +0 -1
- package/build/component-Dn-VRY7-.cjs +0 -2
- package/build/component-Dn-VRY7-.cjs.map +0 -1
- package/build/component-u_42PteJ.cjs +0 -90
- package/build/component-u_42PteJ.cjs.map +0 -1
- package/build/component.styles-5CVyEjEh.js.map +0 -1
- package/build/component.styles-5Xz_H-fR.js.map +0 -1
- package/build/component.styles-8tkaznu_.cjs +0 -21
- package/build/component.styles-8tkaznu_.cjs.map +0 -1
- package/build/component.styles-BuzZQhqS.cjs +0 -73
- package/build/component.styles-BuzZQhqS.cjs.map +0 -1
- package/build/component.styles-C1p3V7H6.js.map +0 -1
- package/build/component.styles-C3hYZJGh.js.map +0 -1
- package/build/component.styles-CISd4naT.cjs +0 -13
- package/build/component.styles-CISd4naT.cjs.map +0 -1
- package/build/component.styles-Cje8zTpf.cjs.map +0 -1
- package/build/component.styles-CpFA5YrM.js +0 -71
- package/build/component.styles-CpFA5YrM.js.map +0 -1
- package/build/component.styles-Crx4pACx.cjs +0 -137
- package/build/component.styles-Db3HLiuV.cjs +0 -99
- package/build/component.styles-Db3HLiuV.cjs.map +0 -1
- package/build/component.styles-o7GmI4Ap.cjs +0 -225
- package/build/component.styles-o7GmI4Ap.cjs.map +0 -1
- package/build/component.styles-v0YYECwW.js.map +0 -1
- package/build/component.types-BzBjcohg.js.map +0 -1
- package/build/component.types-ydMLhabS.cjs +0 -174
- package/build/component.types-ydMLhabS.cjs.map +0 -1
- package/build/context.constants-B9Yk6CGe.js.map +0 -1
- package/build/context.constants-Bz_5itIx.js.map +0 -1
- package/build/context.constants-CTfUKury.cjs +0 -32
- package/build/context.constants-CTfUKury.cjs.map +0 -1
- package/build/context.constants-CV8ycctl.cjs +0 -100
- package/build/context.constants-CV8ycctl.cjs.map +0 -1
- package/build/style-B5u4pW5G.cjs +0 -32
- package/build/style-B5u4pW5G.cjs.map +0 -1
- package/build/style-BQ653xOS.js.map +0 -1
- package/build/style-BgcnmVAY.js.map +0 -1
- package/build/style-mc2ST5fY.cjs.map +0 -1
- package/build/theme.global-B9t2Fi10.cjs.map +0 -1
- package/build/theme.global-CFUz5Asg.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.styles-CISd4naT.cjs","sources":["../src/components/input-otp/component.styles.ts","../src/components/input-otp/component.tsx"],"sourcesContent":["import styled, { css } from 'styled-components'\n\nimport { addSX } from '@local/styles/sx'\nimport { IThemeSizePropertyDefault, KEY_SIZE_DATA } from '@local/theme'\n\nimport { InputOTPWrapperProps } from '.'\n\n/****************************************** Size *************************************************/\nexport const InputOTPSize = css<InputOTPWrapperProps>`\n ${props => InputOTPSizeConstructor({ ...KEY_SIZE_DATA[props.$size], ...props })};\n`\nexport const InputOTPSizeConstructor = (props: IThemeSizePropertyDefault & InputOTPWrapperProps) => css`\n gap: ${props.padding - 2}px;\n width: 100%;\n`\n\nexport const InputOTPWrapper = styled.div<InputOTPWrapperProps>`\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n ${InputOTPSize};\n ${addSX};\n`\n","import { ErrorMessage } from '@local/styles/error'\n\nimport { ClipboardEvent, FocusEvent, KeyboardEvent, useCallback, useRef, useState } from 'react'\n\nimport { Input } from '../input'\nimport { InputOTPProps, InputOTPWrapper } from '.'\n\nexport const InputOTP = (props: InputOTPProps) => {\n const [otp, setOtp] = useState<string[]>(new Array(props.length).fill(''))\n const inputsRef = useRef<(HTMLInputElement | null)[]>([])\n const wrapperRef = useRef<HTMLDivElement | null>(null)\n\n const handlePaste = useCallback(\n (index: number, e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault()\n\n const pasteData = e.clipboardData.getData('Text')\n const digits = pasteData.replace(/\\D/g, '').split('')\n\n if (!digits.length) return\n\n setOtp(prevOtp => {\n const newOtp = [...prevOtp]\n let currentIndex = index\n\n for (let i = 0; i < digits.length && currentIndex < newOtp.length; i++) {\n newOtp[currentIndex] = digits[i]\n currentIndex++\n }\n\n const joined = newOtp.join('')\n\n props.onChange?.(joined)\n\n if (newOtp.every(char => char !== '')) {\n props.onComplete?.(joined)\n }\n\n setTimeout(() => {\n const firstEmpty = newOtp.findIndex(char => char === '')\n if (firstEmpty !== -1) {\n inputsRef.current[firstEmpty]?.focus()\n } else if (currentIndex < newOtp.length) {\n inputsRef.current[currentIndex]?.focus()\n }\n }, 0)\n\n return newOtp\n })\n },\n [props]\n )\n\n const handleChange = useCallback(\n (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return\n\n setOtp(prevOtp => {\n const newOtp = [...prevOtp]\n newOtp[index] = value.slice(-1)\n\n if (props.onChange) {\n props.onChange(newOtp.join(''))\n }\n\n if (newOtp.every(char => char !== '')) {\n props.onComplete?.(newOtp.join(''))\n }\n\n if (value && index < prevOtp.length - 1) {\n setTimeout(() => {\n inputsRef.current[index + 1]?.focus()\n }, 0)\n }\n\n return newOtp\n })\n },\n [props]\n )\n\n const handleKeyDown = (index: number, e: KeyboardEvent<HTMLInputElement>) => {\n const input = inputsRef.current[index]\n\n if (!input) return\n\n if (e.key === 'ArrowRight') {\n const nextIndex = index < otp.length - 1 ? index + 1 : 0\n const nextInput = inputsRef.current[nextIndex]\n\n if (nextInput) {\n nextInput.focus()\n setTimeout(() => nextInput.setSelectionRange(0, nextInput.value.length), 0)\n }\n }\n\n if (e.key === 'ArrowLeft') {\n const prevIndex = index > 0 ? index - 1 : otp.length - 1\n const prevInput = inputsRef.current[prevIndex]\n\n if (prevInput) {\n prevInput.focus()\n setTimeout(() => prevInput.setSelectionRange(0, prevInput.value.length), 0)\n }\n }\n\n if (e.key === 'Backspace') {\n if (input.value) {\n setTimeout(() => input.setSelectionRange(0, input.value.length), 0)\n } else if (index > 0) {\n setTimeout(() => {\n const prevInput = inputsRef.current[index - 1]\n if (prevInput) {\n prevInput.focus()\n prevInput.setSelectionRange(0, prevInput.value.length)\n }\n }, 0)\n }\n }\n }\n\n const handleFocusInput = useCallback((e: FocusEvent<HTMLInputElement>) => {\n setTimeout(() => e.target.setSelectionRange(0, e.target.value.length), 0)\n }, [])\n return (\n <>\n <InputOTPWrapper\n $error={props.error}\n $size={props.size}\n id={props.id}\n ref={wrapperRef}\n onBlur={e => {\n setTimeout(() => {\n if (wrapperRef.current && !wrapperRef.current.contains(document.activeElement)) {\n props.onBlur?.(e)\n }\n }, 0)\n }}\n onFocus={e => {\n setTimeout(() => {\n if (wrapperRef.current?.contains(document.activeElement)) {\n props.onFocus?.(e)\n }\n }, 0)\n }}\n $sx={props.sx}\n >\n {otp.map((digit, index) => (\n <Input\n isWidthAsHeight\n key={index}\n tabIndex={index + 1}\n ref={el => {\n inputsRef.current[index] = el\n }}\n variety=\"standard\"\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={digit}\n onFocus={handleFocusInput}\n onPaste={e => handlePaste(index, e)}\n onChange={value => handleChange(index, value)}\n onKeyDown={e => handleKeyDown(index, e)}\n genre={props.genre}\n size={props.size}\n />\n ))}\n </InputOTPWrapper>\n {props?.error ? <ErrorMessage {...props.error} size={props?.error.size ?? props.size} /> : null}\n </>\n )\n}\n"],"names":["InputOTPSize","css","props","InputOTPSizeConstructor","KEY_SIZE_DATA","$size","padding","InputOTPWrapper","styled","div","addSX","otp","setOtp","useState","Array","length","fill","inputsRef","useRef","wrapperRef","handlePaste","useCallback","index","e","preventDefault","digits","clipboardData","getData","replace","split","prevOtp","newOtp","currentIndex","i","joined","join","_a","onChange","call","every","char","_b","onComplete","setTimeout","firstEmpty","findIndex","current","focus","handleChange","value","test","slice","handleFocusInput","target","setSelectionRange","jsxs","Fragment","children","jsx","$error","error","size","id","ref","onBlur","contains","document","activeElement","onFocus","$sx","sx","map","digit","Input","isWidthAsHeight","tabIndex","el","variety","type","inputMode","maxLength","onPaste","onKeyDown","input","key","nextIndex","nextInput","prevIndex","prevInput","handleKeyDown","genre","ErrorMessage"],"mappings":"iTAQaA,EAAeC,EAAAA,GAAAA;IACxBC,GAASC,EAAwB,IAAKC,EAAAA,cAAcF,EAAMG,UAAWH;EAE5DC,EAA2BD,GAA4DD,EAAAA,GAAAA;SAC3FC,EAAMI,QAAU;;EAIZC,EAAkBC,EAAOC,GAAA;;;;IAIlCT;IACAU;mBCdqBR,IACvB,MAAOS,EAAKC,GAAUC,WAAmB,IAAIC,MAAMZ,EAAMa,QAAQC,KAAK,KAChEC,EAAYC,EAAAA,OAAoC,IAChDC,EAAaD,EAAAA,OAA8B,MAE3CE,EAAcC,EAAAA,YAClB,CAACC,EAAeC,KACdA,EAAEC,iBAEF,MACMC,EADYF,EAAEG,cAAcC,QAAQ,QACjBC,QAAQ,MAAO,IAAIC,MAAM,IAE7CJ,EAAOV,QAEZH,EAAOkB,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hCC,IACFA,EAAUzC,QACVJ,WAAW,IAAM6C,EAAUlC,kBAAkB,EAAGkC,EAAUvC,MAAMlC,QAAS,GAC3E,CAGY,cAAVQ,EAAE6D,MACAD,EAAMlC,MACRN,WAAW,IAAMwC,EAAM7B,kBAAkB,EAAG6B,EAAMlC,MAAMlC,QAAS,GACxDO,EAAQ,GACjBqB,WAAW,KACT,MAAM6C,EAAYvE,EAAU6B,QAAQxB,EAAQ,GACxCkE,IACFA,EAAUzC,QACVyC,EAAUlC,kBAAkB,EAAGkC,EAAUvC,MAAMlC,UAEhD,GAhCK,GA+EY0E,CAAcnE,EAAOC,GACrCmE,MAAOxF,EAAMwF,MACb7B,KAAM3D,EAAM2D,MAfPvC,aAmBVpB,WAAO0D,OAAQF,EAAAA,kBAAAA,IAACiC,EAAAA,aAAA,IAAiBzF,EAAM0D,MAAOC,MAAM,MAAA3D,OAAA,EAAAA,EAAO0D,MAAMC,OAAQ3D,EAAM2D,OAAW"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.styles-Cje8zTpf.cjs","sources":["../src/components/toggle/component.styles.ts","../src/components/toggle/component.tsx"],"sourcesContent":["import { addDisabled, addOutline, addTransition } from '@local/styles/add';\nimport { addError } from '@local/styles/error';\nimport { KEY_SIZE_DATA_TOGGLE } from '@local/theme';\n\nimport { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\n\nimport { StyledToggleProps } from '.';\n\n/****************************************** Add *************************************************/\nconst addToggleWrapperSize = css<StyledToggleProps>`\n ${(props) => css`\n height: ${KEY_SIZE_DATA_TOGGLE[props.$size].height}px;\n width: ${KEY_SIZE_DATA_TOGGLE[props.$size].width}px;\n padding: ${KEY_SIZE_DATA_TOGGLE[props.$size].padding}px;\n border-radius: 100px;\n `};\n`;\n\nconst addToggleCenterSize = css<StyledToggleProps>`\n ${(props) => css`\n height: ${KEY_SIZE_DATA_TOGGLE[props.$size].thumb}px;\n width: ${KEY_SIZE_DATA_TOGGLE[props.$size].thumb}px;\n border-radius: 100px;\n `}\n`;\n/****************************************** Standard *************************************************/\nexport const ToggleWrapper = styled(motion.div)<StyledToggleProps>`\n cursor: pointer;\n border: 1px solid transparent;\n\n display: flex;\n align-items: center;\n\n ${addToggleWrapperSize};\n ${addTransition};\n ${addOutline};\n ${addDisabled};\n\n ${(props) =>\n props.$value\n ? css`\n background: ${props.theme.colors.toggle[props.$genre].active.rest.track};\n border-color: ${props.theme.colors.toggle[props.$genre].active.rest.border};\n justify-content: flex-start;\n &:hover {\n background: ${props.theme.colors.toggle[props.$genre].active.hover.track};\n border-color: ${props.theme.colors.toggle[props.$genre].active.hover.border};\n }\n `\n : css`\n background: ${props.theme.colors.toggle[props.$genre].unActive.rest.track};\n border-color: ${props.theme.colors.toggle[props.$genre].unActive.rest.border};\n justify-content: flex-start;\n &:hover {\n background: ${props.theme.colors.toggle[props.$genre].unActive.hover.track};\n border-color: ${props.theme.colors.toggle[props.$genre].unActive.hover.border};\n }\n `};\n\n ${addError};\n`;\n\nexport const ToggleCenter = styled(motion.div)<StyledToggleProps>`\n ${addToggleCenterSize};\n ${addTransition};\n\n ${(props) =>\n props.$value\n ? css`\n background: ${props.theme.colors.toggle[props.$genre].active.rest.thumb};\n box-shadow: ${props.theme.colors.toggle[props.$genre].active.rest.thumbBoxShadow};\n &:hover {\n background: ${props.theme.colors.toggle[props.$genre].active.hover.thumb};\n box-shadow: ${props.theme.colors.toggle[props.$genre].active.hover.thumbBoxShadow};\n }\n `\n : css`\n background: ${props.theme.colors.toggle[props.$genre].unActive.rest.thumb};\n box-shadow: ${props.theme.colors.toggle[props.$genre].unActive.rest.thumbBoxShadow};\n &:hover {\n background: ${props.theme.colors.toggle[props.$genre].unActive.hover.thumb};\n box-shadow: ${props.theme.colors.toggle[props.$genre].unActive.hover.thumbBoxShadow};\n }\n `}\n`;\n","import { KEY_SIZE_DATA_TOGGLE } from '@local/theme';\n\nimport { useMemo } from 'react';\n\nimport { ToggleCenter, ToggleProps, ToggleWrapper } from '.'\n\nexport const Toggle = (props: ToggleProps) => {\n const toggleVariants = useMemo(() => ({\n tap: {\n width: KEY_SIZE_DATA_TOGGLE[props.size].thumb + 4,\n translateX: props.value ? KEY_SIZE_DATA_TOGGLE[props.size].width - KEY_SIZE_DATA_TOGGLE[props.size].thumb - KEY_SIZE_DATA_TOGGLE[props.size].padding * 3 - 4 : 0,\n transition: {\n duration: 0.05,\n },\n },\n checked: {\n translateX: KEY_SIZE_DATA_TOGGLE[props.size].width - KEY_SIZE_DATA_TOGGLE[props.size].thumb - KEY_SIZE_DATA_TOGGLE[props.size].padding * 3,\n transition: { ease: \"circInOut\", duration: 0.05 },\n },\n unchecked: {\n translateX: 0,\n transition: { ease: \"circInOut\", duration: 0.05 },\n },\n }), [props.size, props.value]);\n\n return (\n <ToggleWrapper\n $genre={props.genre}\n $isDisabled={props.isDisabled}\n $value={props.value}\n $size={props.size}\n $error={props.error}\n tabIndex={0}\n onClick={() => props.onChange?.(!props.value)}\n whileTap=\"tap\"\n animate={props.value ? \"checked\" : \"unchecked\"}\n onKeyDown={(e) => {\n if (e.key === 'Enter') props.onChange?.(!props.value)\n }}\n\n >\n <ToggleCenter\n variants={toggleVariants}\n $genre={props.genre}\n $isDisabled={props.isDisabled}\n $value={props.value}\n $size={props.size}\n $error={props.error}\n />\n </ToggleWrapper>\n )\n}\n"],"names":["addToggleWrapperSize","css","props","KEY_SIZE_DATA_TOGGLE","$size","height","width","padding","addToggleCenterSize","thumb","ToggleWrapper","styled","motion","div","addTransition","addOutline","addDisabled","$value","theme","colors","toggle","$genre","active","rest","track","border","hover","unActive","addError","ToggleCenter","thumbBoxShadow","toggleVariants","useMemo","tap","size","translateX","value","transition","duration","checked","ease","unchecked","jsx","genre","$isDisabled","isDisabled","$error","error","tabIndex","onClick","_a","onChange","call","whileTap","animate","onKeyDown","e","key","children","variants"],"mappings":"qPAUMA,EAAuBC,EAAAA,GAAAA;IACxBC,GAAUD,EAAAA,GAAAA;cACDE,uBAAqB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,KAAAlD,GAAkBA,EAAMkC,QACvCiB,SAAS,MACTC,QAASpD,EAAMkC,MAAQ,UAAY,YACnCmB,UAAYC,UACI,UAAVA,EAAEC,iBAAuBN,qBAAYjD,EAAMkC,SAIjDsB,WAAAhB,kBAAAA,IAACb,EAAA,CACC8B,SAAU5B,EACVV,OAAQnB,EAAMyC,MACdC,YAAa1C,EAAM2C,WACnB5B,OAAQf,EAAMkC,MACdhC,MAAOF,EAAMgC,KACbY,OAAQ5C,EAAM6C"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { j as jsxRuntimeExports } from "./jsx-runtime-BrDlu8eK.js";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { C as Checkbox } from "./component.styles-5Xz_H-fR.js";
|
|
4
|
-
import styled, { css } from "styled-components";
|
|
5
|
-
import { g as getFontSizeStyles } from "./component-BoHvC24Q.js";
|
|
6
|
-
import { a as addSX } from "./style-plT9Ah7t.js";
|
|
7
|
-
import { K as KEY_SIZE_DATA } from "./theme.global-CFUz5Asg.js";
|
|
8
|
-
const CheckboxGroup = (props) => {
|
|
9
|
-
const createMarkup = (html) => ({ __html: html });
|
|
10
|
-
const handleCheckboxChange = useCallback(
|
|
11
|
-
(item) => {
|
|
12
|
-
const isSelected = props.value.some((selectedItem) => selectedItem[props.valueField] === item[props.valueField]);
|
|
13
|
-
const updatedSelectedItems = isSelected ? props.value.filter((selectedItem) => selectedItem[props.valueField] !== item[props.valueField]) : props.multiple ? [...props.value, item] : [item];
|
|
14
|
-
if (props.onChange) props.onChange(updatedSelectedItems);
|
|
15
|
-
},
|
|
16
|
-
[props]
|
|
17
|
-
);
|
|
18
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxGroupWrapper, { className: props.className, $sx: props.sx, $size: props.size, children: props.options.map((e, index) => {
|
|
19
|
-
const isChecked = props.value.some((selectedItem) => selectedItem[props.valueField] === e[props.valueField]);
|
|
20
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(CheckboxGroupItem, { onClick: () => !props.isClickOnlyIcon && handleCheckboxChange(e), children: [
|
|
21
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
22
|
-
Checkbox,
|
|
23
|
-
{
|
|
24
|
-
genre: props.checkboxGenre,
|
|
25
|
-
isHiddenBorder: props.checkboxIsHiddenBorder,
|
|
26
|
-
view: props.checkBoxView,
|
|
27
|
-
sx: props.checkboxSX,
|
|
28
|
-
size: props.size,
|
|
29
|
-
checked: isChecked,
|
|
30
|
-
children: props.labelField && (e == null ? void 0 : e[props.labelField]) !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxGroupLabel, { dangerouslySetInnerHTML: createMarkup(e[props.labelField]) })
|
|
31
|
-
}
|
|
32
|
-
),
|
|
33
|
-
props.childrenField && (e == null ? void 0 : e[props.childrenField]) !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxChildren, { children: e[props.childrenField] })
|
|
34
|
-
] }, index);
|
|
35
|
-
}) });
|
|
36
|
-
};
|
|
37
|
-
const CheckboxGroupSize = css`
|
|
38
|
-
${(props) => CheckboxGroupSizeConstructor(KEY_SIZE_DATA[props.$size])};
|
|
39
|
-
`;
|
|
40
|
-
const CheckboxGroupSizeConstructor = (props) => css`
|
|
41
|
-
gap: ${props.padding - 2}px;
|
|
42
|
-
${(params) => getFontSizeStyles(props.font, 700, params.theme.font.family)};
|
|
43
|
-
`;
|
|
44
|
-
const CheckboxGroupWrapper = styled.div`
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
align-items: stretch;
|
|
48
|
-
${CheckboxGroupSize};
|
|
49
|
-
${addSX};
|
|
50
|
-
`;
|
|
51
|
-
const CheckboxGroupItem = styled.div`
|
|
52
|
-
display: flex;
|
|
53
|
-
flex-direction: row;
|
|
54
|
-
align-items: center;
|
|
55
|
-
`;
|
|
56
|
-
const CheckboxGroupLabel = styled.div`
|
|
57
|
-
user-select: none;
|
|
58
|
-
`;
|
|
59
|
-
const CheckboxChildren = styled.div`
|
|
60
|
-
user-select: none;
|
|
61
|
-
`;
|
|
62
|
-
export {
|
|
63
|
-
CheckboxGroup as C,
|
|
64
|
-
CheckboxGroupSize as a,
|
|
65
|
-
CheckboxGroupSizeConstructor as b,
|
|
66
|
-
CheckboxGroupWrapper as c,
|
|
67
|
-
CheckboxGroupItem as d,
|
|
68
|
-
CheckboxGroupLabel as e,
|
|
69
|
-
CheckboxChildren as f
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=component.styles-CpFA5YrM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.styles-CpFA5YrM.js","sources":["../src/components/checkbox-group/component.tsx","../src/components/checkbox-group/component.styles.ts"],"sourcesContent":["import { ReactNode, useCallback } from 'react'\n\nimport { Checkbox } from '@local/components/checkbox'\n\nimport {\n CheckboxChildren,\n CheckboxGroupItem,\n CheckboxGroupLabel,\n CheckboxGroupProps,\n CheckboxGroupWrapper,\n ICheckboxValue\n} from '.'\n\nexport const CheckboxGroup = <T extends ICheckboxValue>(props: CheckboxGroupProps<T>) => {\n const createMarkup = (html: string) => ({ __html: html })\n\n const handleCheckboxChange = useCallback(\n (item: T) => {\n const isSelected = props.value.some(selectedItem => selectedItem[props.valueField] === item[props.valueField])\n\n const updatedSelectedItems = isSelected\n ? props.value.filter(selectedItem => selectedItem[props.valueField] !== item[props.valueField])\n : props.multiple\n ? [...props.value, item]\n : [item]\n if (props.onChange) props.onChange(updatedSelectedItems)\n },\n [props]\n )\n return (\n <CheckboxGroupWrapper className={props.className} $sx={props.sx} $size={props.size}>\n {props.options.map((e, index) => {\n const isChecked = props.value.some(selectedItem => selectedItem[props.valueField] === e[props.valueField])\n return (\n <CheckboxGroupItem key={index} onClick={() => !props.isClickOnlyIcon && handleCheckboxChange(e)}>\n <Checkbox\n genre={props.checkboxGenre}\n isHiddenBorder={props.checkboxIsHiddenBorder}\n view={props.checkBoxView}\n sx={props.checkboxSX}\n size={props.size}\n checked={isChecked}\n >\n {props.labelField && e?.[props.labelField] !== undefined && (\n <CheckboxGroupLabel dangerouslySetInnerHTML={createMarkup(e[props.labelField] as string)} />\n )}\n </Checkbox>\n {props.childrenField && e?.[props.childrenField] !== undefined && (\n <CheckboxChildren>{e[props.childrenField] as ReactNode}</CheckboxChildren>\n )}\n </CheckboxGroupItem>\n )\n })}\n </CheckboxGroupWrapper>\n )\n}\n","import styled, { css } from 'styled-components'\n\nimport { getFontSizeStyles } from '@local/components/typography'\nimport { addSX } from '@local/styles/sx'\nimport { IThemeSizePropertyDefault, KEY_SIZE_DATA } from '@local/theme'\n\nimport { CheckboxGroupWrapperProps } from '.'\n\n/****************************************** Size *************************************************/\nexport const CheckboxGroupSize = css<CheckboxGroupWrapperProps>`\n ${props => CheckboxGroupSizeConstructor(KEY_SIZE_DATA[props.$size])};\n`\nexport const CheckboxGroupSizeConstructor = (props: IThemeSizePropertyDefault) => css`\n gap: ${props.padding - 2}px;\n ${params => getFontSizeStyles(props.font, 700, params.theme.font.family)};\n`\n\n/****************************************** Default *************************************************/\nexport const CheckboxGroupWrapper = styled.div<CheckboxGroupWrapperProps>`\n display: flex;\n flex-direction: column;\n align-items: stretch;\n ${CheckboxGroupSize};\n ${addSX};\n`\n\nexport const CheckboxGroupItem = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n`\n\nexport const CheckboxGroupLabel = styled.div`\n user-select: none;\n`\n\nexport const CheckboxChildren = styled.div`\n user-select: none;\n`\n"],"names":["jsxs","jsx"],"mappings":";;;;;;;AAaO,MAAM,gBAAgB,CAA2B,UAAiC;AACvF,QAAM,eAAe,CAAC,UAAkB,EAAE,QAAQ,KAAA;AAElD,QAAM,uBAAuB;AAAA,IAC3B,CAAC,SAAY;AACX,YAAM,aAAa,MAAM,MAAM,KAAK,CAAA,iBAAgB,aAAa,MAAM,UAAU,MAAM,KAAK,MAAM,UAAU,CAAC;AAE7G,YAAM,uBAAuB,aACzB,MAAM,MAAM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U,kBAAkB,MAAM,MAAM,KAAK,OAAO,MAAM,KAAK,MAAM,CAAC;AAAA;AAInE,MAAM,uBAAuB,OAAO;AAAA;AAAA;AAAA;AAAA,IAIvC,iBAAiB;AAAA,IACjB,KAAK;AAAA;AAGF,MAAM,oBAAoB,OAAO;AAAA;AAAA;AAAA;AAAA;AAMjC,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAIlC,MAAM,mBAAmB,OAAO;AAAA;AAAA;"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./component-CACoGUK9.cjs"),t=require("./style-mc2ST5fY.cjs"),r=require("./style-B5u4pW5G.cjs"),n=require("./style-fRZ6xrVp.cjs"),a=require("./theme.global-B9t2Fi10.cjs"),o=require("framer-motion"),i=require("react"),u=require("styled-components");function l(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 s,c;function d(){}function f(e){return!!(e||"").match(/\d/)}function v(e){return null==e}function g(e){return v(e)||function(e){return"number"==typeof e&&isNaN(e)}(e)||"number"==typeof e&&!isFinite(e)}function p(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function h(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 m(e,t,r){for(var n="",a=r?"0":"",o=0;o<=t-1;o++)n+=e[o]||a;return n}function $(e,t){return Array(t+1).join(e)}function S(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."+$("0",Math.abs(i))+a:i>=u?a+=$("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=h(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?".":"")+m(s[1]||"",t,r)}function x(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)}}(c=s||(s={})).event="event",c.props="prop";var y,w,V,N=(y=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}}},V=void 0,function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return w&&e.length===w.length&&e.every(function(e,t){return e===w[t]})?V:(w=e,V=y.apply(void 0,e))});function I(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 E(e,t){return void 0===e&&(e=" "),"string"==typeof e?e:e[t]||" "}function C(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function O(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 j(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(f(e[r])||f(e[r-1]));return t}function A(e,t,r,n,a,o){void 0===o&&(o=d);var u=function(e){var t=i.useRef(e);t.current=e;var r=i.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 g(e)?(o="",r=""):"number"==typeof e||t?(o="number"==typeof e?S(e):e,r=n(o)):(o=a(e,void 0),r=n(o)),{formattedValue:r,numAsString:o}}),l=i.useState(function(){return u(v(e)?t:e,r)}),s=l[0],c=l[1],f=e,p=r;v(e)&&(f=s.numAsString,p=!0);var h=u(f,p);return i.useMemo(function(){c(h)},[h.formattedValue]),[s,function(e,t){e.formattedValue!==s.formattedValue&&c({formattedValue:e.formattedValue,numAsString:e.value}),o(e,t)}]}function k(e){return e.replace(/[^0-9]/g,"")}function T(e){return e}function B(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,o=e.getInputRef,u=e.format;void 0===u&&(u=T);var c=e.removeFormatting;void 0===c&&(c=k);var v=e.defaultValue,g=e.valueIsNumericString,p=e.onValueChange,h=e.isAllowed,m=e.onChange;void 0===m&&(m=d);var $=e.onKeyDown;void 0===$&&($=d);var S=e.onMouseUp;void 0===S&&(S=d);var b=e.onFocus;void 0===b&&(b=d);var y=e.onBlur;void 0===y&&(y=d);var w=e.value,V=e.getCaretBoundary;void 0===V&&(V=j);var D=e.isValidInputCharacter;void 0===D&&(D=f);var E=e.isCharacterSame,B=l(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),F=A(w,v,Boolean(g),u,c,p),M=F[0],R=M.formattedValue,K=M.numAsString,z=F[1],P=i.useRef(),W=i.useRef({formattedValue:R,numAsString:K}),q=function(e,t){W.current={formattedValue:e.formattedValue,numAsString:e.value},z(e,t)},L=i.useState(!1),H=L[0],_=L[1],Z=i.useRef(null),G=i.useRef({setCaretTimeout:null,focusTimeout:null});i.useEffect(function(){return _(!0),function(){clearTimeout(G.current.setCaretTimeout),clearTimeout(G.current.focusTimeout)}},[]);var U=u,Y=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||(x(e,t),G.current.setCaretTimeout=setTimeout(function(){e.value===r&&e.selectionStart!==t&&x(e,t)},0))},X=function(e,t,r){return O(e,t,V(e),r)},Q=function(e,t,r){var n=V(t),a=function(e,t,r,n,a,o,i){void 0===i&&(i=C);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 g=0,p=c;g<p;g++)if(i({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:v,formattedValueIndex:g})&&!0!==d[g]){f[v]=g,d[g]=!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,E);return a=O(t,a,n)};i.useEffect(function(){var e=W.current,t=e.formattedValue,r=e.numAsString;R===t&&K===r||q(Y(R,K),{event:void 0,source:s.props})},[R,K]);var ee=Z.current?I(Z.current):void 0;("undefined"!=typeof window?i.useLayoutEffect:i.useEffect)(function(){var e=Z.current;if(R!==W.current.formattedValue&&e){var t=Q(W.current.formattedValue,R,ee);e.value=R,J(e,t,R)}},[R]);var te=function(e,t,r){var n=t.target,a=P.current?function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}}(P.current,n.selectionEnd):N(R,e),o=Object.assign(Object.assign({},a),{lastValue:R}),i=c(e,o),u=U(i);if(i=c(u,void 0),h&&!h(Y(u,i))){var l=t.target,s=I(l),d=Q(e,R,s);return l.value=R,J(l,d,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=I(n);n.value=t,void 0!==(r=Q(u,t,l))&&J(n,r,t)}t!==R&&q(Y(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;P.current={selectionStart:r,selectionEnd:n+t}},ne=!H||"undefined"==typeof navigator||navigator.platform&&/iPhone|iPod/.test(navigator.platform)?void 0:"numeric",ae=Object.assign({inputMode:ne},B,{type:t,value:R,onChange:function(e){var t=e.target.value;te(t,e,s.event)&&m(e),P.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()}),S(e),re(t)},onFocus:function(e){e.persist&&e.persist();var t=e.target,r=e.currentTarget;Z.current=t,G.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),b(Object.assign(Object.assign({},e),{currentTarget:r}))},0)},onBlur:function(e){Z.current=null,clearTimeout(G.current.focusTimeout),clearTimeout(G.current.setCaretTimeout),y(e)}});if("text"===r)return a?i.createElement(i.Fragment,null,a(R,B)||null):i.createElement("span",Object.assign({},B,{ref:o}),R);if(n){var oe=n;return i.createElement(oe,Object.assign({},ae,{ref:o}))}return i.createElement("input",Object.assign({},ae,{ref:o}))}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=M(t),s=l.thousandSeparator,c=l.decimalSeparator,d=0!==r&&-1!==e.indexOf(".")||r&&n,f=h(e,i),v=f.beforeDecimal,g=f.afterDecimal,p=f.addNegation;return void 0!==r&&(g=m(g,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&&(g+=o),p&&(v="-"+v),e=v+(d&&c||"")+g}function M(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 R(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,d=s.end,v=M(r),g=v.allowedDecimalSeparators,m=v.decimalSeparator,$=e[d]===m;if(f(e)&&(e===o||e===i)&&""===t.lastValue)return e;if(d-c===1&&-1!==g.indexOf(e[c])){var S=0===u?"":m;e=e.substring(0,c)+S+e.substring(c+1,e.length)}var b=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=b(e,c,d),y=x.hasNegation;e=(n=x).value,c=n.start,d=n.end;var w=b(t.lastValue,l.start,l.end),V=w.start,N=w.end,I=w.value,E=e.substring(c,d);!(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),d-=C;var O=(e=e.substring(C)).length,j=e.length-i.length;e.endsWith(i)?O=j:(d>j||d>e.length-i.length)&&(O=d),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 A=e.indexOf(m),k=h(e=e.replace(new RegExp(p(m),"g"),function(e,t){return t===A?".":""}),a),T=k.beforeDecimal,B=k.afterDecimal,F=k.addNegation;return s.end-s.start<l.end-l.start&&""===T&&$&&!parseFloat(B)&&(e=F?"-":""),e}function K(e){e=function(e){var t=M(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=d);var o=e.onBlur;void 0===o&&(o=d);var i=e.thousandSeparator,u=e.decimalScale,c=e.fixedDecimalScale,p=e.prefix;void 0===p&&(p="");var h=e.defaultValue,m=e.value,$=e.valueIsNumericString,y=e.onValueChange,w=l(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),V=M(e),I=V.decimalSeparator,D=V.allowedDecimalSeparators,E=function(t){return F(t,e)},C=function(t,r){return R(t,r,e)},O=v(m)?h:m,j=null!=$?$: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,p,t);v(m)?v(h)||(j=j||"number"==typeof h):j=j||"number"==typeof m;var k=function(e){return g(e)?e:("number"==typeof e&&(e=S(e)),j&&"number"==typeof u?b(e,u,Boolean(c)):e)},T=A(k(m),k(h),Boolean(j),E,C,y),B=T[0],K=B.numAsString,z=B.formattedValue,P=T[1];return Object.assign(Object.assign({},w),{value:z,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===I||f(e)},isCharacterSame:function(e){var t=e.currentValue,r=e.lastValue,n=e.formattedValue,a=e.currentValueIndex,o=e.formattedValueIndex,i=t[a],l=n[o],s=N(r,t).to,d=function(e){return C(e).indexOf(".")+p.length};return!(0===m&&c&&u&&t[s.start]===I&&d(t)<a&&d(n)>o)&&(!!(a>=s.start&&a<s.end&&D&&D.includes(i)&&l===I)||i===l)},onValueChange:P,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,l=t.selectionEnd,s=t.value;if(void 0===s&&(s=""),("Backspace"===n||"Delete"===n)&&l<p.length)e.preventDefault();else if(o===l){"Backspace"===n&&"-"===s[0]&&o===p.length+1&&r&&x(t,1),u&&c&&("Backspace"===n&&s[o-1]===I?(x(t,o-1),e.preventDefault()):"Delete"===n&&s[o]===I&&e.preventDefault()),(null==D?void 0:D.includes(n))&&s[o]===I&&x(t,o+1);var d=!0===i?",":i;"Backspace"===n&&s[o-1]===d&&x(t,o-1),"Delete"===n&&s[o]===d&&x(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)),c&&u&&(r=b(r,u,c)),r!==K){var a=F(r,e);P({formattedValue:a,value:r,floatValue:parseFloat(r)},{event:t,source:s.event})}o(t)}})}function z(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=d);var a=e.patternChar;void 0===a&&(a="#");var o=e.value,i=e.defaultValue,u=e.valueIsNumericString,s=l(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 c,g,p=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=E(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=v(o)?i:o,m=null!=u?u:(g=t,""===(c=h)||!((null==g?void 0:g.match(/\d/))||"string"!=typeof c||!c.match(/^\d+$/)&&""!==c)),$=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]||E(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)&&f(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 d="",v=0;v<e.length;v++)if(l(v))f(e[v])&&(d+=e[v]);else if(e[v]!==n[v])return c(e);return d}var g=u.substring(0,o.start),p=e.substring(i.start,i.end),h=u.substring(o.end);return""+s(g,0)+c(p)+s(h,o.end)}(e,t,$)},getCaretBoundary:p,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=O(l,s,p(l),c)}else t[s]!==a&&"ArrowLeft"!==r&&"ArrowRight"!==r&&(s=O(l,s+1,p(l),"right"));s!==i&&x(o,s),n(e)}else n(e)}})}const P=u.div`
|
|
2
|
-
position: relative;
|
|
3
|
-
display: flex;
|
|
4
|
-
justify-content: flex-start;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
${e=>e.$isWidthAsHeight?u.css`
|
|
7
|
-
width: ${a.KEY_SIZE_DATA[e.$size].height}px;
|
|
8
|
-
min-width: ${a.KEY_SIZE_DATA[e.$size].height}px;
|
|
9
|
-
& input {
|
|
10
|
-
text-align: center;
|
|
11
|
-
}
|
|
12
|
-
`:null};
|
|
13
|
-
${n.addSX};
|
|
14
|
-
`,W=u.css`
|
|
15
|
-
&::placeholder,
|
|
16
|
-
&::-webkit-input-placeholder {
|
|
17
|
-
${t=>e.getFontSizeStyles(16,t.$isBold?500:400,t.theme.font.family,t.theme.font.lineHeight)};
|
|
18
|
-
color: ${e=>e.theme.colors.input[e.$genre].color.placeholder};
|
|
19
|
-
opacity: 1;
|
|
20
|
-
}
|
|
21
|
-
&:-ms-input-placeholder {
|
|
22
|
-
${t=>e.getFontSizeStyles(16,t.$isBold?500:400,t.theme.font.family,t.theme.font.lineHeight)};
|
|
23
|
-
color: ${e=>e.theme.colors.input[e.$genre].color.placeholder};
|
|
24
|
-
opacity: 1;
|
|
25
|
-
}
|
|
26
|
-
`,q=u.css`
|
|
27
|
-
&::placeholder,
|
|
28
|
-
&::-webkit-input-placeholder {
|
|
29
|
-
${t=>e.getFontSizeStyles(16,t.$isBold?500:400,"Roboto Mono",t.theme.font.lineHeight)};
|
|
30
|
-
color: ${e=>e.theme.colors.input[e.$genre].color.placeholder};
|
|
31
|
-
opacity: 1;
|
|
32
|
-
${t.addNiceNumber};
|
|
33
|
-
background: transparent;
|
|
34
|
-
}
|
|
35
|
-
&:-ms-input-placeholder {
|
|
36
|
-
${t=>e.getFontSizeStyles(16,t.$isBold?500:400,"Roboto Mono",t.theme.font.lineHeight)};
|
|
37
|
-
color: ${e=>e.theme.colors.input[e.$genre].color.placeholder};
|
|
38
|
-
opacity: 1;
|
|
39
|
-
${t.addNiceNumber};
|
|
40
|
-
background: transparent;
|
|
41
|
-
}
|
|
42
|
-
`,L=u.css`
|
|
43
|
-
${e=>u.css`
|
|
44
|
-
background: ${e.theme.colors.input[e.$genre].background.rest};
|
|
45
|
-
border-color: ${e.theme.colors.input[e.$genre].border.rest};
|
|
46
|
-
color: ${e.theme.colors.input[e.$genre].color.rest};
|
|
47
|
-
&:active {
|
|
48
|
-
background: ${e.theme.colors.input[e.$genre].background.rest};
|
|
49
|
-
border-color: ${e.theme.colors.input[e.$genre].border.rest};
|
|
50
|
-
color: ${e.theme.colors.input[e.$genre].color.rest};
|
|
51
|
-
}
|
|
52
|
-
${!e.$isNotShowHoverStyle&&u.css`
|
|
53
|
-
&:hover {
|
|
54
|
-
background: ${e.theme.colors.input[e.$genre].background.hover};
|
|
55
|
-
border-color: ${e.theme.colors.input[e.$genre].border.hover};
|
|
56
|
-
color: ${e.theme.colors.input[e.$genre].color.hover};
|
|
57
|
-
}
|
|
58
|
-
`}
|
|
59
|
-
&:focus-visible {
|
|
60
|
-
background: ${e.theme.colors.input[e.$genre].background.rest};
|
|
61
|
-
border-color: ${e.theme.colors.input[e.$genre].border.rest};
|
|
62
|
-
color: ${e.theme.colors.input[e.$genre].color.rest};
|
|
63
|
-
}
|
|
64
|
-
`};
|
|
65
|
-
`,H=u.css`
|
|
66
|
-
${e=>_(a.KEY_SIZE_DATA[e.$size])};
|
|
67
|
-
`,_=e=>u.css`
|
|
68
|
-
padding: 0px ${e.padding}px;
|
|
69
|
-
height: ${e.height}px;
|
|
70
|
-
min-height: ${e.height}px;
|
|
71
|
-
max-height: ${e.height}px;
|
|
72
|
-
border-radius: ${e.radius}px;
|
|
73
|
-
`,Z=u.css`
|
|
74
|
-
${e=>e.$isInputEffect&&u.css`
|
|
75
|
-
box-shadow: ${e.theme.effects.input};
|
|
76
|
-
`}
|
|
77
|
-
`,G=u.css`
|
|
78
|
-
resize: none;
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
width: 100%;
|
|
81
|
-
border: 1px solid;
|
|
82
|
-
|
|
83
|
-
white-space: nowrap;
|
|
84
|
-
text-overflow: ellipsis;
|
|
85
|
-
overflow: hidden;
|
|
86
|
-
${t=>e.getFontSizeStyles(16,t.$isBold?500:400,t.theme.font.family,t.theme.font.lineHeight)};
|
|
87
|
-
|
|
88
|
-
${H};
|
|
89
|
-
${L};
|
|
90
|
-
${W};
|
|
91
|
-
${t.addDisabled};
|
|
92
|
-
${Z};
|
|
93
|
-
${t.addOutline};
|
|
94
|
-
${t.addTransition};
|
|
95
|
-
${r.addError};
|
|
96
|
-
|
|
97
|
-
${e=>e.$isNiceNumber&&u.css`
|
|
98
|
-
${t.addNiceNumber};
|
|
99
|
-
`};
|
|
100
|
-
${e=>e.$isCenter&&u.css`
|
|
101
|
-
text-align: center;
|
|
102
|
-
justify-content: center;
|
|
103
|
-
`};
|
|
104
|
-
|
|
105
|
-
${e=>e.$prefixChildren&&u.css`
|
|
106
|
-
padding-left: ${`calc(${e.$prefixChildren.width} + ${e.$prefixChildren.right} + ${e.$prefixChildren.left})`};
|
|
107
|
-
`};
|
|
108
|
-
|
|
109
|
-
${e=>e.$postfixChildren&&u.css`
|
|
110
|
-
padding-right: ${`calc(${e.$postfixChildren.width} + ${e.$postfixChildren.right} + ${e.$postfixChildren.left})`};
|
|
111
|
-
`};
|
|
112
|
-
`,U=u.input`
|
|
113
|
-
${G};
|
|
114
|
-
`,Y=u(o.motion.input)`
|
|
115
|
-
${G};
|
|
116
|
-
`,J=u(function(e){var t=z(e);return i.createElement(B,Object.assign({},t))})`
|
|
117
|
-
${G};
|
|
118
|
-
`,X=u(function(e){var t=K(e);return i.createElement(B,Object.assign({},t))})`
|
|
119
|
-
${G};
|
|
120
|
-
`,Q=u.div`
|
|
121
|
-
position: absolute;
|
|
122
|
-
display: flex;
|
|
123
|
-
left: ${e=>e.$left};
|
|
124
|
-
width: ${e=>e.$width};
|
|
125
|
-
height: 100%;
|
|
126
|
-
${t.addDisabled};
|
|
127
|
-
${t.addTransition};
|
|
128
|
-
`,ee=u.div`
|
|
129
|
-
position: absolute;
|
|
130
|
-
display: flex;
|
|
131
|
-
right: ${e=>e.$right};
|
|
132
|
-
width: ${e=>e.$width};
|
|
133
|
-
height: 100%;
|
|
134
|
-
${t.addDisabled};
|
|
135
|
-
${t.addTransition};
|
|
136
|
-
`;exports.InputPostfixChildren=ee,exports.InputPrefixChildren=Q,exports.InputSize=H,exports.InputSizeConstructor=_,exports.StyledInput=U,exports.StyledInputCSS=G,exports.StyledInputNumeric=X,exports.StyledInputPattern=J,exports.StyledInputWrapper=P,exports.StyledMotionInput=Y,exports.addInputIsInputEffect=Z,exports.addInputPlaceholder=W,exports.addInputPlaceholderNiceNumber=q;
|
|
137
|
-
//# sourceMappingURL=component.styles-Crx4pACx.cjs.map
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-BcGej2Kr.cjs"),o=require("./style-B5u4pW5G.cjs"),r=require("./component-CACoGUK9.cjs"),t=require("react"),s=require("styled-components"),i=require("./style-mc2ST5fY.cjs"),n=require("./style-fRZ6xrVp.cjs"),l=require("./theme.global-B9t2Fi10.cjs"),a=s.css`
|
|
2
|
-
${e=>s.css`
|
|
3
|
-
background: ${e.theme.colors.input[e.$genre].background.rest};
|
|
4
|
-
border-color: ${e.theme.colors.input[e.$genre].border.rest};
|
|
5
|
-
color: ${e.theme.colors.input[e.$genre].color.rest};
|
|
6
|
-
|
|
7
|
-
&:active {
|
|
8
|
-
background: ${e.theme.colors.input[e.$genre].background.rest};
|
|
9
|
-
border-color: ${e.theme.colors.input[e.$genre].border.rest};
|
|
10
|
-
color: ${e.theme.colors.input[e.$genre].color.rest};
|
|
11
|
-
}
|
|
12
|
-
&:hover {
|
|
13
|
-
background: ${e.theme.colors.input[e.$genre].background.hover};
|
|
14
|
-
border-color: ${e.theme.colors.input[e.$genre].border.hover};
|
|
15
|
-
color: ${e.theme.colors.input[e.$genre].color.hover};
|
|
16
|
-
}
|
|
17
|
-
&:focus-visible {
|
|
18
|
-
border-color: ${e.theme.colors.input[e.$genre].border.rest};
|
|
19
|
-
background: ${e.theme.colors.input[e.$genre].background.rest};
|
|
20
|
-
color: ${e.theme.colors.input[e.$genre].color.rest};
|
|
21
|
-
}
|
|
22
|
-
`};
|
|
23
|
-
`,c=s.css`
|
|
24
|
-
${e=>e.$isInputEffect&&s.css`
|
|
25
|
-
box-shadow: ${e.theme.effects.input};
|
|
26
|
-
`}
|
|
27
|
-
`,u=s.css`
|
|
28
|
-
${e=>s.css`
|
|
29
|
-
padding: ${l.KEY_SIZE_DATA[e.$size].padding-4}px ${l.KEY_SIZE_DATA[e.$size].padding}px ${l.KEY_SIZE_DATA[e.$size].padding-4}px ${l.KEY_SIZE_DATA[e.$size].padding}px;
|
|
30
|
-
border-radius: ${l.KEY_SIZE_DATA[e.$size].radius}px;
|
|
31
|
-
min-height: ${l.KEY_SIZE_DATA[e.$size].height}px;
|
|
32
|
-
`};
|
|
33
|
-
`,d=s.div`
|
|
34
|
-
border: 1px solid;
|
|
35
|
-
position: relative;
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: flex-start;
|
|
38
|
-
justify-content: flex-start;
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
width: 100%;
|
|
42
|
-
${i.addTransitionWithoutSize};
|
|
43
|
-
${u};
|
|
44
|
-
${a};
|
|
45
|
-
${c};
|
|
46
|
-
${i.addDisabled};
|
|
47
|
-
${i.addOutlineChildren};
|
|
48
|
-
${n.addSX};
|
|
49
|
-
`,$=s.css`
|
|
50
|
-
&::placeholder,
|
|
51
|
-
&::-webkit-input-placeholder {
|
|
52
|
-
${e=>r.getFontSizeStyles(16,e.$isBold?500:400,e.theme.font.family,e.theme.font.lineHeight)};
|
|
53
|
-
color: ${e=>e.theme.colors.input[e.$genre].color.placeholder};
|
|
54
|
-
opacity: 1;
|
|
55
|
-
}
|
|
56
|
-
&:-ms-input-placeholder {
|
|
57
|
-
${e=>r.getFontSizeStyles(16,e.$isBold?500:400,e.theme.font.family,e.theme.font.lineHeight)};
|
|
58
|
-
color: ${e=>e.theme.colors.input[e.$genre].color.placeholder};
|
|
59
|
-
opacity: 1;
|
|
60
|
-
}
|
|
61
|
-
`,h=s.css`
|
|
62
|
-
${e=>s.css`
|
|
63
|
-
color: ${e.theme.colors.input[e.$genre].color.rest};
|
|
64
|
-
border-color: transparent;
|
|
65
|
-
&:active {
|
|
66
|
-
color: ${e.theme.colors.input[e.$genre].color.rest};
|
|
67
|
-
}
|
|
68
|
-
&:hover {
|
|
69
|
-
color: ${e.theme.colors.input[e.$genre].color.hover};
|
|
70
|
-
}
|
|
71
|
-
&:focus-visible {
|
|
72
|
-
color: ${e.theme.colors.input[e.$genre].color.rest};
|
|
73
|
-
}
|
|
74
|
-
`};
|
|
75
|
-
`,p=s.css`
|
|
76
|
-
${e=>!e.$isResize&&s.css`
|
|
77
|
-
resize: none;
|
|
78
|
-
`}
|
|
79
|
-
`,g=s.css`
|
|
80
|
-
overflow-x: hidden;
|
|
81
|
-
width: -webkit-fill-available;
|
|
82
|
-
padding: 0 !important;
|
|
83
|
-
border: none !important;
|
|
84
|
-
margin: 0 !important;
|
|
85
|
-
white-space: normal;
|
|
86
|
-
text-overflow: ellipsis;
|
|
87
|
-
height: auto;
|
|
88
|
-
background-color: transparent;
|
|
89
|
-
${e=>r.getFontSizeStyles(16,e.$isBold?500:400,e.theme.font.family,`${e.$lineHeight}px`)};
|
|
90
|
-
|
|
91
|
-
${h};
|
|
92
|
-
${p};
|
|
93
|
-
${$};
|
|
94
|
-
${i.addRemoveOutline};
|
|
95
|
-
${o.addError};
|
|
96
|
-
`,m=s.textarea`
|
|
97
|
-
${g};
|
|
98
|
-
`;exports.StyledTextArea=m,exports.TextArea=i=>{const n=s.useTheme(),l=t.useRef(null),a=r.useMergeRefs([l,i.ref]),c=t.useMemo(()=>n.font.sizeDefault.default*n.font.lineHeight,[n.font.lineHeight,n.font.sizeDefault.default]),u=t.useMemo(()=>i.maxRows?i.maxRows*c:0,[c,i.maxRows]),$=t.useMemo(()=>i.minRows?i.minRows*c:c,[c,i.minRows]),h=t.useCallback(()=>{const e=l.current;if(e&&i.isAutoHeight){e.style.height="auto";const o=Math.min(e.scrollHeight,u);e.style.height=`${o}px`}},[i.isAutoHeight,u]),p=t.useCallback(e=>{var o,r;if(i.isNoSpaces){const r=e.replace(/\s+/g,"");null==(o=i.onChange)||o.call(i,r)}else null==(r=i.onChange)||r.call(i,e)},[i]);return t.useEffect(()=>{i.isAutoHeight&&requestAnimationFrame(h)},[i.value,h,i.isAutoHeight]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(d,{$isInputEffect:i.isInputEffect,$isDisabled:i.isDisabled,$sx:i.sx,$genre:i.genre,$size:i.size,$lineHeight:c,$isReadOnly:i.isReadOnly,className:i.className,tabIndex:-1,children:e.jsxRuntimeExports.jsx(m,{tabIndex:0,ref:a,$lineHeight:c,$isResize:i.isResize,$error:i.error,$isInputEffect:i.isInputEffect,$isLoading:i.isLoading,$genre:i.genre,$size:i.size,$isBold:i.isBold,$isDisabled:i.isDisabled,maxLength:i.maxLength,minLength:i.minLength,disabled:i.isDisabled,readOnly:i.isReadOnly,required:i.isRequired,defaultValue:null===i.defaultValue?"":i.defaultValue,value:null===i.value?"":i.value,rows:i.minRows,placeholder:i.placeholder,onChange:e=>p(e.target.value),onBlur:i.onBlur,onFocus:i.onFocus,onKeyDown:i.onKeyDown,name:i.name,autoComplete:i.autoComplete,id:i.id,style:{minHeight:`${$}px`,maxHeight:i.isResize?"none":i.isAutoHeight?`${u}px`:`${$}px`}})}),(null==i?void 0:i.error)?e.jsxRuntimeExports.jsx(o.ErrorMessage,{...i.error,size:(null==i?void 0:i.error.size)??i.size}):null]})},exports.TextAreaWrapper=d,exports.addTextArea=g;
|
|
99
|
-
//# sourceMappingURL=component.styles-Db3HLiuV.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.styles-Db3HLiuV.cjs","sources":["../src/components/textarea/component.styles.ts","../src/components/textarea/component.tsx"],"sourcesContent":["import { getFontSizeStyles } from '@local/components/typography';\nimport { addDisabled, addOutlineChildren, addRemoveOutline, addTransitionWithoutSize } 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 ${(props) => getFontSizeStyles(16, props.$isBold ? 500 : 400, props.theme.font.family, props.theme.font.lineHeight)};\n color: ${(props) => props.theme.colors.input[props.$genre].color.placeholder};\n opacity: 1;\n }\n &:-ms-input-placeholder {\n ${(props) => getFontSizeStyles(16, props.$isBold ? 500 : 400, props.theme.font.family, props.theme.font.lineHeight)};\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 ${(props) => getFontSizeStyles(16, props.$isBold ? 500 : 400, props.theme.font.family, `${props.$lineHeight}px`)};\n\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 $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 $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 ? <ErrorMessage {...props.error} size={props?.error.size ?? props.size} /> : 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","getFontSizeStyles","$isBold","font","family","lineHeight","placeholder","addTextAreaGenre","addTextAreaIsResize","$isResize","addTextArea","$lineHeight","addRemoveOutline","addError","StyledTextArea","textarea","useTheme","refLocal","useRef","ref","useMergeRefs","useMemo","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","$sx","sx","genre","size","$isReadOnly","isReadOnly","className","tabIndex","isResize","$error","error","$isLoading","isLoading","isBold","maxLength","minLength","disabled","readOnly","required","isRequired","defaultValue","rows","event","target","onBlur","onFocus","onKeyDown","name","autoComplete","id","ErrorMessage"],"mappings":"kSAWMA,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,EA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