@sellmate/design-system 1.0.78 → 1.1.0
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/dist/cjs/component.table-B7brIpIQ.js +56 -0
- package/dist/cjs/design-system.cjs.js +2 -2
- package/dist/cjs/{index--F2wGuAi.js → index-BlxrCRYi.js} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{resolveColor-LhfOKtTZ.js → resolveColor-B0hzQNLG.js} +2 -2
- package/dist/cjs/sd-action-modal.cjs.entry.js +3 -3
- package/dist/cjs/sd-badge.cjs.entry.js +2 -3
- package/dist/cjs/sd-barcode-input.cjs.entry.js +3 -3
- package/dist/cjs/{sd-button-v2.config-CnqCQQMi.js → sd-button.config-DH08UNfl.js} +114 -28
- package/dist/cjs/{sd-button-v2_2.cjs.entry.js → sd-button_2.cjs.entry.js} +101 -85
- package/dist/cjs/sd-calendar.cjs.entry.js +15 -15
- package/dist/cjs/sd-card.cjs.entry.js +2 -2
- package/dist/cjs/sd-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/sd-chip.cjs.entry.js +2 -2
- package/dist/cjs/sd-circle-progress.cjs.entry.js +3 -3
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +19 -11
- package/dist/cjs/sd-date-box.cjs.entry.js +4 -4
- package/dist/cjs/{sd-date-picker-calendar.cjs.entry.js → sd-date-picker-calendar_2.cjs.entry.js} +51 -3
- package/dist/cjs/{sd-date-picker.config-CRgCT5dn.js → sd-date-picker.config-CjvrFpYK.js} +1 -2
- package/dist/cjs/sd-date-picker_7.cjs.entry.js +1230 -0
- package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +3 -3
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +28 -27
- package/dist/cjs/{sd-button_4.cjs.entry.js → sd-field_3.cjs.entry.js} +26 -82
- package/dist/cjs/sd-form.cjs.entry.js +2 -2
- package/dist/cjs/sd-ghost-button.cjs.entry.js +12 -10
- package/dist/cjs/sd-guide.cjs.entry.js +9 -9
- package/dist/cjs/sd-key-value-table.cjs.entry.js +230 -0
- package/dist/cjs/sd-linear-progress.cjs.entry.js +3 -3
- package/dist/cjs/sd-loading-container.cjs.entry.js +3 -3
- package/dist/cjs/sd-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/{sd-pagination_5.cjs.entry.js → sd-pagination_4.cjs.entry.js} +34 -296
- package/dist/cjs/sd-popover.cjs.entry.js +17 -10
- package/dist/cjs/sd-popup.cjs.entry.js +112 -0
- package/dist/cjs/sd-portal.cjs.entry.js +2 -2
- package/dist/cjs/sd-radio-button.cjs.entry.js +4 -4
- package/dist/cjs/sd-radio.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-list-item_2.cjs.entry.js +155 -0
- package/dist/cjs/sd-select.config-B19ptCT2.js +178 -0
- package/dist/cjs/{sd-select-list-item_4.cjs.entry.js → sd-select_3.cjs.entry.js} +286 -318
- package/dist/cjs/sd-switch.cjs.entry.js +2 -2
- package/dist/cjs/sd-table.cjs.entry.js +40 -23
- package/dist/cjs/sd-table.config-CDyioyE2.js +65 -0
- package/dist/cjs/sd-tabs.cjs.entry.js +2 -2
- package/dist/cjs/sd-tag.cjs.entry.js +49 -14
- package/dist/cjs/sd-td.cjs.entry.js +2 -2
- package/dist/cjs/sd-text-link.cjs.entry.js +8 -5
- package/dist/cjs/sd-toast-container.cjs.entry.js +5 -5
- package/dist/cjs/sd-toast.cjs.entry.js +35 -5
- package/dist/cjs/sd-toggle.cjs.entry.js +2 -2
- package/dist/cjs/{system-DpTN1vBC.js → system-VmZRYp6V.js} +4 -2
- package/dist/cjs/{tooltipArrow-D1-wcNm1.js → tooltipArrow-N6nQ1QT-.js} +1 -1
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/assets/CheckboxCheck.js +5 -0
- package/dist/collection/components/assets/CheckboxIndeterminate.js +5 -0
- package/dist/collection/components/assets/index.js +4 -0
- package/dist/collection/components/sd-action-modal/sd-action-modal.css +1 -1
- package/dist/collection/components/sd-action-modal/sd-action-modal.js +7 -7
- package/dist/collection/components/sd-badge/sd-badge.config.js +10 -1
- package/dist/collection/components/sd-badge/sd-badge.js +1 -22
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +4 -4
- package/dist/collection/components/{sd-button-v2/sd-button-v2.config.js → sd-button/sd-button.config.js} +1 -1
- package/dist/collection/components/sd-button/sd-button.css +47 -93
- package/dist/collection/components/sd-button/sd-button.js +99 -173
- package/dist/collection/components/sd-calendar/sd-calendar.js +14 -14
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-checkbox/sd-checkbox.js +3 -3
- package/dist/collection/components/sd-chip/sd-chip.js +1 -1
- package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +1 -1
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +13 -8
- package/dist/collection/components/sd-date-box/sd-date-box.js +3 -3
- package/dist/collection/components/sd-date-picker/sd-date-picker-calendar/sd-date-picker-calendar.js +1 -1
- package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.css +1 -1
- package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +7 -5
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +4 -4
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +4 -4
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.config.js +1 -1
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +13 -11
- package/dist/collection/components/sd-field/sd-field.css +6 -2
- package/dist/collection/components/sd-field/sd-field.js +30 -5
- package/dist/collection/components/sd-file-picker/sd-file-picker.js +4 -4
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.css +1 -3
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +3 -3
- package/dist/collection/components/sd-form/sd-form.js +1 -1
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.js +12 -10
- package/dist/collection/components/sd-guide/sd-guide.css +8 -172
- package/dist/collection/components/sd-guide/sd-guide.js +6 -4
- package/dist/collection/components/sd-icon/sd-icon.js +4 -4
- package/dist/collection/components/sd-input/sd-input.css +4 -2
- package/dist/collection/components/sd-input/sd-input.js +5 -5
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.config.js +36 -0
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.css +119 -0
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.js +301 -0
- package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
- package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
- package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +6 -3
- package/dist/collection/components/sd-number-input/sd-number-input.css +7 -0
- package/dist/collection/components/sd-number-input/sd-number-input.js +6 -3
- package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
- package/dist/collection/components/sd-popover/sd-popover.js +128 -35
- package/dist/collection/components/sd-popup/sd-popup.config.js +34 -0
- package/dist/collection/components/sd-popup/sd-popup.css +73 -0
- package/dist/collection/components/sd-popup/sd-popup.js +163 -0
- package/dist/collection/components/sd-portal/sd-portal.js +1 -1
- package/dist/collection/components/sd-radio/sd-radio.js +1 -1
- package/dist/collection/components/sd-radio-button/sd-radio-button.js +3 -3
- package/dist/collection/components/sd-radio-group/sd-radio-group.js +2 -2
- package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +2 -2
- package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.css +4 -4
- package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +4 -4
- package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +5 -5
- package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
- package/dist/collection/components/sd-select/sd-select.js +5 -5
- package/dist/collection/components/sd-switch/sd-switch.js +1 -1
- package/dist/collection/components/sd-table/sd-table.config.js +2 -2
- package/dist/collection/components/sd-table/sd-table.css +8 -8
- package/dist/collection/components/sd-table/sd-table.js +54 -18
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +2 -2
- package/dist/collection/components/sd-table/sd-td/sd-td.js +1 -1
- package/dist/collection/components/sd-table/sd-thead/sd-thead.js +3 -3
- package/dist/collection/components/sd-table/sd-tr/sd-tr.css +4 -0
- package/dist/collection/components/sd-table/sd-tr/sd-tr.js +21 -3
- package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
- package/dist/collection/components/sd-tag/sd-tag.config.js +40 -8
- package/dist/collection/components/sd-tag/sd-tag.js +9 -6
- package/dist/collection/components/sd-text-link/sd-text-link.css +1 -0
- package/dist/collection/components/sd-text-link/sd-text-link.js +5 -4
- package/dist/collection/components/sd-textarea/sd-textarea.css +3 -0
- package/dist/collection/components/sd-textarea/sd-textarea.js +2 -2
- package/dist/collection/components/sd-toast/sd-toast.config.js +14 -0
- package/dist/collection/components/sd-toast/sd-toast.css +3 -5
- package/dist/collection/components/sd-toast/sd-toast.js +52 -5
- package/dist/collection/components/sd-toast-container/sd-toast-container.js +4 -4
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +77 -30
- package/dist/collection/utils/color/resolveColor.js +2 -2
- package/dist/collection/utils/dropdown-manager.js +1 -1
- package/dist/collection/utils/toast.js +4 -4
- package/dist/components/index.js +1 -1
- package/dist/components/p--t9jBTYS.js +1 -0
- package/dist/components/p-At6nBeyO.js +1 -0
- package/dist/components/p-B1MabGRR.js +1 -0
- package/dist/components/{p-CeVMl_M9.js → p-B73VhbYi.js} +1 -1
- package/dist/components/p-BDQQllAo.js +1 -0
- package/dist/components/p-BDr27lvk.js +1 -0
- package/dist/components/p-BPsOJlCP.js +1 -0
- package/dist/components/p-BQ6at17Y.js +1 -0
- package/dist/components/p-BW_sBt7X.js +1 -0
- package/dist/components/p-BX3TJuQY.js +1 -0
- package/dist/components/p-BeK8amzx.js +1 -0
- package/dist/components/{p-Bvq0Vpln.js → p-BfkuCNCI.js} +1 -1
- package/dist/components/p-Bm_T3qE0.js +1 -0
- package/dist/components/{p-DegvQLTF.js → p-BnzK4uU4.js} +1 -1
- package/dist/components/{p-q0VWISKA.js → p-BqkJ0rZv.js} +1 -1
- package/dist/components/p-C4PmGpW8.js +1 -0
- package/dist/components/{p-Nvx13YlG.js → p-C9CszVFl.js} +1 -1
- package/dist/components/p-CGBnxqG2.js +1 -0
- package/dist/components/p-CGQWERwE.js +1 -0
- package/dist/components/{p-DkJqVXpD.js → p-CT3dfy3K.js} +1 -1
- package/dist/components/p-CZmKBmKx.js +1 -0
- package/dist/components/p-CnarDyZi.js +1 -0
- package/dist/components/p-Cr2ghUra.js +1 -0
- package/dist/components/{p-BStczlLa.js → p-Cspm6LxP.js} +1 -1
- package/dist/components/p-Cx3jXw9J.js +1 -0
- package/dist/components/{p-Dcc2Vm6z.js → p-D5TRyquv.js} +1 -1
- package/dist/components/p-D8WAP9T3.js +1 -0
- package/dist/components/p-DG-4Ifco.js +1 -0
- package/dist/components/{p-TwGlKfsC.js → p-DG45uNxd.js} +1 -1
- package/dist/components/p-DdLntfiw.js +1 -0
- package/dist/components/{p-BJsHakU2.js → p-DfXAgw0E.js} +1 -1
- package/dist/components/p-Dr1AMbBj.js +1 -0
- package/dist/components/p-GBlVDmy4.js +1 -0
- package/dist/components/p-MMkRcTBd.js +1 -0
- package/dist/components/p-MQTl8fGT.js +1 -0
- package/dist/components/p-ZstG0XdT.js +1 -0
- package/dist/components/p-h7eBUL4i.js +1 -0
- package/dist/components/p-lyB7zSp-.js +1 -0
- package/dist/components/{p-D1DpOp6M.js → p-oIM6jNZe.js} +1 -1
- package/dist/components/p-oKHZl8yu.js +1 -0
- package/dist/components/p-ofkgu5aS.js +1 -0
- package/dist/components/sd-action-modal.js +1 -1
- package/dist/components/sd-badge.js +1 -1
- package/dist/components/sd-barcode-input.js +1 -1
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-calendar.js +1 -1
- package/dist/components/sd-card.js +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-chip.js +1 -1
- package/dist/components/sd-circle-progress.js +1 -1
- package/dist/components/sd-confirm-modal.js +1 -1
- package/dist/components/sd-date-box.js +1 -1
- package/dist/components/sd-date-picker-calendar.js +1 -1
- package/dist/components/sd-date-picker-trigger.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker-calendar.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-dropdown-button.js +1 -1
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-file-picker.js +1 -1
- package/dist/components/sd-floating-portal.js +1 -1
- package/dist/components/sd-form.js +1 -1
- package/dist/components/sd-ghost-button.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-icon.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-key-value-table.d.ts +11 -0
- package/dist/components/sd-key-value-table.js +1 -0
- package/dist/components/sd-linear-progress.js +1 -1
- package/dist/components/sd-loading-container.js +1 -1
- package/dist/components/sd-loading-modal.js +1 -1
- package/dist/components/sd-modal-container.js +1 -1
- package/dist/components/sd-number-input.js +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +1 -1
- package/dist/components/{sd-button-v2.d.ts → sd-popup.d.ts} +4 -4
- package/dist/components/sd-popup.js +1 -0
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-radio-button.js +1 -1
- package/dist/components/sd-radio-group.js +1 -1
- package/dist/components/sd-radio.js +1 -1
- package/dist/components/sd-select-list-item-search.js +1 -1
- package/dist/components/sd-select-list-item.js +1 -1
- package/dist/components/sd-select-listbox.js +1 -1
- package/dist/components/sd-select-trigger.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-switch.js +1 -1
- package/dist/components/sd-table.js +1 -1
- package/dist/components/sd-tabs.js +1 -1
- package/dist/components/sd-tag.js +1 -1
- package/dist/components/sd-tbody.js +1 -1
- package/dist/components/sd-td.js +1 -1
- package/dist/components/sd-text-link.js +1 -1
- package/dist/components/sd-textarea.js +1 -1
- package/dist/components/sd-thead.js +1 -1
- package/dist/components/sd-toast-container.js +1 -1
- package/dist/components/sd-toast.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/components/sd-tr.js +1 -1
- package/dist/design-system/design-system.css +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/index.esm.js +1 -1
- package/dist/design-system/p-02289728.entry.js +1 -0
- package/dist/design-system/p-17d66d85.entry.js +1 -0
- package/dist/design-system/p-18466728.entry.js +1 -0
- package/dist/design-system/p-1bb86d69.entry.js +1 -0
- package/dist/design-system/p-20a50702.entry.js +1 -0
- package/dist/design-system/p-21874054.entry.js +1 -0
- package/dist/design-system/p-282cbefa.entry.js +1 -0
- package/dist/design-system/p-29ed11e5.entry.js +1 -0
- package/dist/design-system/p-328fae12.entry.js +1 -0
- package/dist/design-system/p-35dce399.entry.js +1 -0
- package/dist/design-system/{p-1cf87e87.entry.js → p-39ff56b4.entry.js} +1 -1
- package/dist/design-system/p-3cb712a6.entry.js +1 -0
- package/dist/design-system/{p-f522c91d.entry.js → p-4e2953eb.entry.js} +1 -1
- package/dist/design-system/p-7610153d.entry.js +1 -0
- package/dist/design-system/{p-25a08e98.entry.js → p-7722ddeb.entry.js} +1 -1
- package/dist/design-system/{p-6bfe3612.entry.js → p-7882e388.entry.js} +1 -1
- package/dist/design-system/p-7bfa0cf9.entry.js +1 -0
- package/dist/design-system/p-824ecfb5.entry.js +1 -0
- package/dist/design-system/p-9a04b341.entry.js +1 -0
- package/dist/design-system/p-BDjErF_K.js +1 -0
- package/dist/design-system/p-BQ6at17Y.js +1 -0
- package/dist/design-system/p-CGQWERwE.js +1 -0
- package/dist/design-system/p-CLCoul8o.js +2 -0
- package/dist/design-system/{p-BxPyZJaz.js → p-Ce0cmS4R.js} +1 -1
- package/dist/design-system/p-CxOCk_ge.js +1 -0
- package/dist/design-system/{p-DnCBBIoq.js → p-Dmf0PYdM.js} +1 -1
- package/dist/design-system/p-GBlVDmy4.js +1 -0
- package/dist/design-system/{p-455dccf5.entry.js → p-a7a0ca14.entry.js} +1 -1
- package/dist/design-system/{p-f44786a9.entry.js → p-a942dfbe.entry.js} +1 -1
- package/dist/design-system/p-b04b22c6.entry.js +1 -0
- package/dist/design-system/p-b1bb0d72.entry.js +1 -0
- package/dist/design-system/{p-ead3e688.entry.js → p-b6ca4461.entry.js} +1 -1
- package/dist/design-system/p-b96c694c.entry.js +1 -0
- package/dist/design-system/p-baed13e4.entry.js +1 -0
- package/dist/design-system/{p-045bc426.entry.js → p-bd45e65d.entry.js} +1 -1
- package/dist/design-system/p-bf4156d8.entry.js +1 -0
- package/dist/design-system/{p-e5cebccd.entry.js → p-c0f60b00.entry.js} +1 -1
- package/dist/design-system/p-c228c2c7.entry.js +1 -0
- package/dist/design-system/p-cbda9194.entry.js +1 -0
- package/dist/design-system/{p-fe9cef6a.entry.js → p-cd8e4dd6.entry.js} +1 -1
- package/dist/design-system/p-cf382479.entry.js +1 -0
- package/dist/design-system/p-d0de34fd.entry.js +1 -0
- package/dist/design-system/p-d78fbe16.entry.js +1 -0
- package/dist/design-system/p-e1c0a3c9.entry.js +1 -0
- package/dist/design-system/{p-797517b5.entry.js → p-f3cfff78.entry.js} +1 -1
- package/dist/design-system/{p-3f7bc660.entry.js → p-f5576a0d.entry.js} +1 -1
- package/dist/design-system/p-f60cc7be.entry.js +1 -0
- package/dist/design-system/{p-33bc3176.entry.js → p-feeb0cc5.entry.js} +1 -1
- package/dist/esm/component.table-BQ6at17Y.js +54 -0
- package/dist/esm/design-system.js +3 -3
- package/dist/esm/{index-Cnwbjz1F.js → index-CLCoul8o.js} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{resolveColor-BxPyZJaz.js → resolveColor-Ce0cmS4R.js} +2 -2
- package/dist/esm/sd-action-modal.entry.js +3 -3
- package/dist/esm/sd-badge.entry.js +2 -3
- package/dist/esm/sd-barcode-input.entry.js +3 -3
- package/dist/esm/{sd-button-v2.config-CV4xelxV.js → sd-button.config-BDjErF_K.js} +88 -3
- package/dist/esm/{sd-button-v2_2.entry.js → sd-button_2.entry.js} +101 -85
- package/dist/esm/sd-calendar.entry.js +15 -15
- package/dist/esm/sd-card.entry.js +2 -2
- package/dist/esm/sd-checkbox.entry.js +4 -4
- package/dist/esm/sd-chip.entry.js +2 -2
- package/dist/esm/sd-circle-progress.entry.js +3 -3
- package/dist/esm/sd-confirm-modal_2.entry.js +19 -11
- package/dist/esm/sd-date-box.entry.js +4 -4
- package/dist/esm/{sd-date-picker-calendar.entry.js → sd-date-picker-calendar_2.entry.js} +51 -4
- package/dist/esm/{sd-date-picker.config-C2fDbE9d.js → sd-date-picker.config-B6cqMQaM.js} +1 -2
- package/dist/esm/sd-date-picker_7.entry.js +1222 -0
- package/dist/esm/sd-date-range-picker-calendar.entry.js +3 -3
- package/dist/esm/sd-dropdown-button.entry.js +15 -14
- package/dist/esm/{sd-button_4.entry.js → sd-field_3.entry.js} +27 -82
- package/dist/esm/sd-form.entry.js +2 -2
- package/dist/esm/sd-ghost-button.entry.js +12 -10
- package/dist/esm/sd-guide.entry.js +9 -9
- package/dist/esm/sd-key-value-table.entry.js +228 -0
- package/dist/esm/sd-linear-progress.entry.js +3 -3
- package/dist/esm/sd-loading-container.entry.js +3 -3
- package/dist/esm/sd-modal-container.entry.js +1 -1
- package/dist/esm/{sd-pagination_5.entry.js → sd-pagination_4.entry.js} +35 -296
- package/dist/esm/sd-popover.entry.js +17 -10
- package/dist/esm/sd-popup.entry.js +110 -0
- package/dist/esm/sd-portal.entry.js +2 -2
- package/dist/esm/sd-radio-button.entry.js +4 -4
- package/dist/esm/sd-radio.entry.js +2 -2
- package/dist/esm/sd-select-list-item_2.entry.js +152 -0
- package/dist/esm/sd-select.config-CxOCk_ge.js +165 -0
- package/dist/esm/{sd-select-list-item_4.entry.js → sd-select_3.entry.js} +271 -302
- package/dist/esm/sd-switch.entry.js +2 -2
- package/dist/esm/{sd-table.config-Bj-EEo7N.js → sd-table.config-0Te8GLCI.js} +4 -44
- package/dist/esm/sd-table.entry.js +40 -23
- package/dist/esm/sd-tabs.entry.js +2 -2
- package/dist/esm/sd-tag.entry.js +49 -14
- package/dist/esm/sd-td.entry.js +2 -2
- package/dist/esm/sd-text-link.entry.js +8 -5
- package/dist/esm/sd-toast-container.entry.js +5 -5
- package/dist/esm/sd-toast.entry.js +35 -5
- package/dist/esm/sd-toggle.entry.js +2 -2
- package/dist/esm/{system-CZ4ltUOw.js → system-GBlVDmy4.js} +4 -2
- package/dist/esm/{tooltipArrow-D8sr81Xw.js → tooltipArrow-Bc-yw2nt.js} +1 -1
- package/dist/types/components/assets/CheckboxCheck.d.ts +1 -0
- package/dist/types/components/assets/CheckboxIndeterminate.d.ts +1 -0
- package/dist/types/components/assets/index.d.ts +2 -0
- package/dist/types/components/sd-action-modal/sd-action-modal.d.ts +2 -2
- package/dist/types/components/sd-badge/sd-badge.d.ts +0 -1
- package/dist/types/components/{sd-button-v2/sd-button-v2.config.d.ts → sd-button/sd-button.config.d.ts} +9 -15
- package/dist/types/components/sd-button/sd-button.d.ts +11 -13
- package/dist/types/components/sd-confirm-modal/sd-confirm-modal.config.d.ts +3 -3
- package/dist/types/components/sd-confirm-modal/sd-confirm-modal.d.ts +2 -1
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.config.d.ts +3 -3
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.d.ts +1 -0
- package/dist/types/components/sd-field/sd-field.d.ts +1 -0
- package/dist/types/components/sd-key-value-table/sd-key-value-table.config.d.ts +105 -0
- package/dist/types/components/sd-key-value-table/sd-key-value-table.d.ts +38 -0
- package/dist/types/components/sd-loading-modal/sd-loading-modal.config.d.ts +2 -2
- package/dist/types/components/sd-loading-modal/sd-loading-modal.d.ts +1 -0
- package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +1 -1
- package/dist/types/components/sd-popover/sd-popover.d.ts +16 -10
- package/dist/types/components/sd-popup/sd-popup.config.d.ts +30 -0
- package/dist/types/components/sd-popup/sd-popup.d.ts +11 -0
- package/dist/types/components/sd-table/sd-table.d.ts +2 -0
- package/dist/types/components/sd-table/sd-tr/sd-tr.d.ts +2 -0
- package/dist/types/components/sd-tag/sd-tag.d.ts +1 -0
- package/dist/types/components/sd-toast/sd-toast.config.d.ts +5 -1
- package/dist/types/components/sd-toast/sd-toast.d.ts +2 -0
- package/dist/types/components/sd-toast-container/sd-toast-container.config.d.ts +2 -0
- package/dist/types/components/sd-tooltip/sd-tooltip.config.d.ts +2 -13
- package/dist/types/components/sd-tooltip/sd-tooltip.d.ts +6 -4
- package/dist/types/components.d.ts +237 -184
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/form.d.ts +1 -1
- package/dist/types/types/global.d.ts +14 -13
- package/dist/types/utils/toast.d.ts +1 -1
- package/hydrate/index.js +5182 -4738
- package/hydrate/index.mjs +5182 -4738
- package/package.json +111 -97
- package/readme.md +13 -7
- package/dist/cjs/component.button-cqV-iCG5.js +0 -90
- package/dist/cjs/sd-date-picker-trigger.cjs.entry.js +0 -51
- package/dist/cjs/sd-date-picker.cjs.entry.js +0 -117
- package/dist/cjs/sd-date-range-picker.cjs.entry.js +0 -123
- package/dist/cjs/sd-file-picker.cjs.entry.js +0 -244
- package/dist/cjs/sd-input.cjs.entry.js +0 -175
- package/dist/cjs/sd-number-input.cjs.entry.js +0 -409
- package/dist/cjs/sd-radio-group.cjs.entry.js +0 -46
- package/dist/cjs/sd-table.config-Cb0Ot3C6.js +0 -105
- package/dist/cjs/sd-textarea.cjs.entry.js +0 -146
- package/dist/collection/components/sd-button-v2/sd-button-v2.css +0 -125
- package/dist/collection/components/sd-button-v2/sd-button-v2.js +0 -273
- package/dist/components/p-B1XBwjCW.js +0 -1
- package/dist/components/p-B8jXOXtJ.js +0 -1
- package/dist/components/p-BE6TxbtX.js +0 -1
- package/dist/components/p-BcMNA89i.js +0 -1
- package/dist/components/p-BheX6lAy.js +0 -1
- package/dist/components/p-BmYM7-4v.js +0 -1
- package/dist/components/p-BppjYHF6.js +0 -1
- package/dist/components/p-BwWDMpJc.js +0 -1
- package/dist/components/p-C-kw2p2a.js +0 -1
- package/dist/components/p-C5qZtNLl.js +0 -1
- package/dist/components/p-C7DajKYn.js +0 -1
- package/dist/components/p-CZ4ltUOw.js +0 -1
- package/dist/components/p-D3gjBBCU.js +0 -1
- package/dist/components/p-DC-6inj0.js +0 -1
- package/dist/components/p-DRF0He-x.js +0 -1
- package/dist/components/p-Dey-lS6x.js +0 -1
- package/dist/components/p-DfH_fO01.js +0 -1
- package/dist/components/p-DngV3MT1.js +0 -1
- package/dist/components/p-EbjZr2OA.js +0 -1
- package/dist/components/p-LwWOleLJ.js +0 -1
- package/dist/components/p-ZMpCZhXP.js +0 -1
- package/dist/components/p-dNJIFthT.js +0 -1
- package/dist/components/p-xnLvZ-xn.js +0 -1
- package/dist/components/sd-button-v2.js +0 -1
- package/dist/design-system/p-0356c195.entry.js +0 -1
- package/dist/design-system/p-12dfd239.entry.js +0 -1
- package/dist/design-system/p-16d3a485.entry.js +0 -1
- package/dist/design-system/p-1706ed6f.entry.js +0 -1
- package/dist/design-system/p-182548f7.entry.js +0 -1
- package/dist/design-system/p-1a79edce.entry.js +0 -1
- package/dist/design-system/p-2812b9ce.entry.js +0 -1
- package/dist/design-system/p-38f661ea.entry.js +0 -1
- package/dist/design-system/p-429dab5c.entry.js +0 -1
- package/dist/design-system/p-59313838.entry.js +0 -1
- package/dist/design-system/p-6af01ab0.entry.js +0 -1
- package/dist/design-system/p-70d4903f.entry.js +0 -1
- package/dist/design-system/p-767e99f9.entry.js +0 -1
- package/dist/design-system/p-7c370335.entry.js +0 -1
- package/dist/design-system/p-7fe8be6a.entry.js +0 -1
- package/dist/design-system/p-83b262dc.entry.js +0 -1
- package/dist/design-system/p-881adaa5.entry.js +0 -1
- package/dist/design-system/p-88d7303c.entry.js +0 -1
- package/dist/design-system/p-8a601e0f.entry.js +0 -1
- package/dist/design-system/p-B1XBwjCW.js +0 -1
- package/dist/design-system/p-BsrEibf7.js +0 -1
- package/dist/design-system/p-C5qZtNLl.js +0 -1
- package/dist/design-system/p-CZ4ltUOw.js +0 -1
- package/dist/design-system/p-Cnwbjz1F.js +0 -2
- package/dist/design-system/p-a82be987.entry.js +0 -1
- package/dist/design-system/p-b917c82a.entry.js +0 -1
- package/dist/design-system/p-b9f00eef.entry.js +0 -1
- package/dist/design-system/p-bcb53788.entry.js +0 -1
- package/dist/design-system/p-c24344ac.entry.js +0 -1
- package/dist/design-system/p-d76192bd.entry.js +0 -1
- package/dist/design-system/p-d9d8c51b.entry.js +0 -1
- package/dist/design-system/p-de67937d.entry.js +0 -1
- package/dist/design-system/p-ea5e6c2c.entry.js +0 -1
- package/dist/design-system/p-eeb1cac2.entry.js +0 -1
- package/dist/design-system/p-f1a74359.entry.js +0 -1
- package/dist/design-system/p-f69c7539.entry.js +0 -1
- package/dist/esm/component.button-B1XBwjCW.js +0 -88
- package/dist/esm/sd-date-picker-trigger.entry.js +0 -49
- package/dist/esm/sd-date-picker.entry.js +0 -115
- package/dist/esm/sd-date-range-picker.entry.js +0 -121
- package/dist/esm/sd-file-picker.entry.js +0 -242
- package/dist/esm/sd-input.entry.js +0 -173
- package/dist/esm/sd-number-input.entry.js +0 -407
- package/dist/esm/sd-radio-group.entry.js +0 -44
- package/dist/esm/sd-textarea.entry.js +0 -144
- package/dist/types/components/sd-button-v2/sd-button-v2.d.ts +0 -19
- /package/dist/components/{p-C2fDbE9d.js → p-B6cqMQaM.js} +0 -0
- /package/dist/design-system/{p-C2fDbE9d.js → p-B6cqMQaM.js} +0 -0
|
@@ -0,0 +1,1222 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, a as getElement, h } from './index-CLCoul8o.js';
|
|
2
|
+
import { n as nanoid } from './index-CCwNgVmC.js';
|
|
3
|
+
import { D as DATEPICKER_COLORS, a as DATEPICKER_SIZE_MAP } from './sd-date-picker.config-B6cqMQaM.js';
|
|
4
|
+
import { i as inputTokens } from './component.textinput-ByhWX2NK.js';
|
|
5
|
+
|
|
6
|
+
const sdDatePickerCss = () => `sd-date-picker{display:inline-flex}sd-date-picker sd-portal{display:none}sd-date-picker .sd-date-picker{position:relative;width:100%;height:100%}`;
|
|
7
|
+
|
|
8
|
+
const SdDatePicker = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.update = createEvent(this, "sdUpdate", 7);
|
|
12
|
+
this.viewChange = createEvent(this, "sdViewChange", 7);
|
|
13
|
+
}
|
|
14
|
+
static CLOSE_ANIMATION_DURATION = 150;
|
|
15
|
+
get el() { return getElement(this); }
|
|
16
|
+
value = null;
|
|
17
|
+
size = 'sm';
|
|
18
|
+
placeholder = 'YYYY-MM-DD';
|
|
19
|
+
selectable;
|
|
20
|
+
disabled = false;
|
|
21
|
+
width = '';
|
|
22
|
+
// sd-field 공통 props
|
|
23
|
+
label = '';
|
|
24
|
+
labelWidth = '';
|
|
25
|
+
addonLabel = '';
|
|
26
|
+
addonAlign = 'start';
|
|
27
|
+
hint = '';
|
|
28
|
+
errorMessage = '';
|
|
29
|
+
rules = [];
|
|
30
|
+
error = false;
|
|
31
|
+
icon = undefined;
|
|
32
|
+
labelTooltip = '';
|
|
33
|
+
labelTooltipProps = null;
|
|
34
|
+
isOpen = false;
|
|
35
|
+
isAnimatingOut = false;
|
|
36
|
+
focused = false;
|
|
37
|
+
hovered = false;
|
|
38
|
+
update;
|
|
39
|
+
viewChange;
|
|
40
|
+
triggerRef;
|
|
41
|
+
formField;
|
|
42
|
+
closeAnimationTimer;
|
|
43
|
+
name = nanoid();
|
|
44
|
+
watchIsOpen(newValue) {
|
|
45
|
+
this.focused = newValue;
|
|
46
|
+
}
|
|
47
|
+
async sdValidate() {
|
|
48
|
+
return this.formField?.sdValidate();
|
|
49
|
+
}
|
|
50
|
+
async sdReset() {
|
|
51
|
+
return this.formField?.sdReset();
|
|
52
|
+
}
|
|
53
|
+
async sdResetValidate() {
|
|
54
|
+
return this.formField?.sdResetValidation();
|
|
55
|
+
}
|
|
56
|
+
closeDropdown() {
|
|
57
|
+
if (!this.isOpen)
|
|
58
|
+
return;
|
|
59
|
+
this.isOpen = false;
|
|
60
|
+
this.isAnimatingOut = true;
|
|
61
|
+
if (this.closeAnimationTimer)
|
|
62
|
+
clearTimeout(this.closeAnimationTimer);
|
|
63
|
+
this.closeAnimationTimer = setTimeout(() => {
|
|
64
|
+
this.isAnimatingOut = false;
|
|
65
|
+
}, SdDatePicker.CLOSE_ANIMATION_DURATION);
|
|
66
|
+
}
|
|
67
|
+
handleTriggerClick = () => {
|
|
68
|
+
if (this.disabled)
|
|
69
|
+
return;
|
|
70
|
+
if (this.isOpen) {
|
|
71
|
+
this.closeDropdown();
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
if (this.closeAnimationTimer)
|
|
75
|
+
clearTimeout(this.closeAnimationTimer);
|
|
76
|
+
this.isAnimatingOut = false;
|
|
77
|
+
this.isOpen = true;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
handleSelect = (e) => {
|
|
81
|
+
this.closeDropdown();
|
|
82
|
+
this.value = e.detail;
|
|
83
|
+
const nextValue = this.value;
|
|
84
|
+
requestAnimationFrame(() => {
|
|
85
|
+
this.update.emit(nextValue);
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
handleViewChange = (e) => {
|
|
89
|
+
this.viewChange.emit(e.detail);
|
|
90
|
+
};
|
|
91
|
+
disconnectedCallback() {
|
|
92
|
+
if (this.closeAnimationTimer)
|
|
93
|
+
clearTimeout(this.closeAnimationTimer);
|
|
94
|
+
}
|
|
95
|
+
render() {
|
|
96
|
+
const sizeTokens = DATEPICKER_SIZE_MAP[this.size] ?? DATEPICKER_SIZE_MAP.sm;
|
|
97
|
+
const cssVars = {
|
|
98
|
+
'--sd-system-size-field-sm-height': `${sizeTokens.height}px`,
|
|
99
|
+
'--sd-system-radius-field-sm': `${sizeTokens.radius}px`,
|
|
100
|
+
'--sd-system-color-field-border-default': DATEPICKER_COLORS.border.default,
|
|
101
|
+
'--sd-system-color-field-border-focus': DATEPICKER_COLORS.border.focus,
|
|
102
|
+
'--sd-system-color-field-bg-default': DATEPICKER_COLORS.bg.default,
|
|
103
|
+
};
|
|
104
|
+
return (h("sd-field", { key: '7678d58f741276e9848e05759f5c41f576e7fe66', name: this.name, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, addonAlign: this.addonAlign, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, size: this.size, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, h("div", { key: '8b3d615b241860ec1fb314fa0eeef5f51ea32f43', class: "sd-date-picker", ref: el => {
|
|
105
|
+
this.triggerRef = el;
|
|
106
|
+
} }, h("sd-date-picker-trigger", { key: '43185c67462cf0cb559c918e5f709723bf4d5aee', displayText: this.value ?? '', placeholder: this.placeholder, disabled: this.disabled, size: this.size, onSdTriggerClick: this.handleTriggerClick })), (this.isOpen || this.isAnimatingOut) && (h("sd-portal", { key: '2cf151b52b3117de9c4d55bbc3c045b0a7b614e9', open: this.isOpen, parentRef: this.triggerRef, onSdClose: () => this.closeDropdown() }, h("sd-date-picker-calendar", { key: '9f77742d034dcb462eb1c4546b2c2a367544f97e', value: this.value, selectable: this.selectable, onSdSelect: this.handleSelect, onSdViewChange: this.handleViewChange })))));
|
|
107
|
+
}
|
|
108
|
+
static get watchers() { return {
|
|
109
|
+
"isOpen": [{
|
|
110
|
+
"watchIsOpen": 0
|
|
111
|
+
}]
|
|
112
|
+
}; }
|
|
113
|
+
};
|
|
114
|
+
SdDatePicker.style = sdDatePickerCss();
|
|
115
|
+
|
|
116
|
+
const sdDateRangePickerCss = () => `sd-date-range-picker{display:inline-flex}sd-date-range-picker sd-portal{display:none}sd-date-range-picker .sd-date-range-picker{position:relative;width:100%;height:100%}`;
|
|
117
|
+
|
|
118
|
+
const SdDateRangePicker = class {
|
|
119
|
+
constructor(hostRef) {
|
|
120
|
+
registerInstance(this, hostRef);
|
|
121
|
+
this.update = createEvent(this, "sdUpdate", 7);
|
|
122
|
+
this.viewChange = createEvent(this, "sdViewChange", 7);
|
|
123
|
+
}
|
|
124
|
+
static CLOSE_ANIMATION_DURATION = 150;
|
|
125
|
+
get el() { return getElement(this); }
|
|
126
|
+
value = null;
|
|
127
|
+
size = 'sm';
|
|
128
|
+
placeholder = 'YYYY-MM-DD ~ YYYY-MM-DD';
|
|
129
|
+
selectable;
|
|
130
|
+
maxRange;
|
|
131
|
+
disabled = false;
|
|
132
|
+
width = '';
|
|
133
|
+
// sd-field 공통 props
|
|
134
|
+
label = '';
|
|
135
|
+
labelWidth = '';
|
|
136
|
+
addonLabel = '';
|
|
137
|
+
addonAlign = 'start';
|
|
138
|
+
hint = '';
|
|
139
|
+
errorMessage = '';
|
|
140
|
+
rules = [];
|
|
141
|
+
error = false;
|
|
142
|
+
icon = undefined;
|
|
143
|
+
labelTooltip = '';
|
|
144
|
+
labelTooltipProps = null;
|
|
145
|
+
isOpen = false;
|
|
146
|
+
isAnimatingOut = false;
|
|
147
|
+
focused = false;
|
|
148
|
+
hovered = false;
|
|
149
|
+
update;
|
|
150
|
+
viewChange;
|
|
151
|
+
triggerRef;
|
|
152
|
+
formField;
|
|
153
|
+
closeAnimationTimer;
|
|
154
|
+
name = nanoid();
|
|
155
|
+
watchIsOpen(newValue) {
|
|
156
|
+
this.focused = newValue;
|
|
157
|
+
}
|
|
158
|
+
async sdValidate() {
|
|
159
|
+
return this.formField?.sdValidate();
|
|
160
|
+
}
|
|
161
|
+
async sdReset() {
|
|
162
|
+
return this.formField?.sdReset();
|
|
163
|
+
}
|
|
164
|
+
async sdResetValidate() {
|
|
165
|
+
return this.formField?.sdResetValidation();
|
|
166
|
+
}
|
|
167
|
+
closeDropdown() {
|
|
168
|
+
if (!this.isOpen)
|
|
169
|
+
return;
|
|
170
|
+
this.isOpen = false;
|
|
171
|
+
this.isAnimatingOut = true;
|
|
172
|
+
if (this.closeAnimationTimer)
|
|
173
|
+
clearTimeout(this.closeAnimationTimer);
|
|
174
|
+
this.closeAnimationTimer = setTimeout(() => {
|
|
175
|
+
this.isAnimatingOut = false;
|
|
176
|
+
}, SdDateRangePicker.CLOSE_ANIMATION_DURATION);
|
|
177
|
+
}
|
|
178
|
+
handleTriggerClick = () => {
|
|
179
|
+
if (this.disabled)
|
|
180
|
+
return;
|
|
181
|
+
if (this.isOpen) {
|
|
182
|
+
this.closeDropdown();
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
if (this.closeAnimationTimer)
|
|
186
|
+
clearTimeout(this.closeAnimationTimer);
|
|
187
|
+
this.isAnimatingOut = false;
|
|
188
|
+
this.isOpen = true;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
handleSelect = (e) => {
|
|
192
|
+
this.closeDropdown();
|
|
193
|
+
this.value = e.detail;
|
|
194
|
+
const nextValue = this.value;
|
|
195
|
+
requestAnimationFrame(() => {
|
|
196
|
+
this.update.emit(nextValue);
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
handleViewChange = (e) => {
|
|
200
|
+
this.viewChange.emit(e.detail);
|
|
201
|
+
};
|
|
202
|
+
get displayText() {
|
|
203
|
+
if (!this.value || !this.value[0] || !this.value[1])
|
|
204
|
+
return '';
|
|
205
|
+
return `${this.value[0]} ~ ${this.value[1]}`;
|
|
206
|
+
}
|
|
207
|
+
disconnectedCallback() {
|
|
208
|
+
if (this.closeAnimationTimer)
|
|
209
|
+
clearTimeout(this.closeAnimationTimer);
|
|
210
|
+
}
|
|
211
|
+
render() {
|
|
212
|
+
const sizeTokens = DATEPICKER_SIZE_MAP[this.size] ?? DATEPICKER_SIZE_MAP.sm;
|
|
213
|
+
const cssVars = {
|
|
214
|
+
'--sd-system-size-field-sm-height': `${sizeTokens.height}px`,
|
|
215
|
+
'--sd-system-radius-field-sm': `${sizeTokens.radius}px`,
|
|
216
|
+
'--sd-system-color-field-border-default': DATEPICKER_COLORS.border.default,
|
|
217
|
+
'--sd-system-color-field-border-focus': DATEPICKER_COLORS.border.focus,
|
|
218
|
+
'--sd-system-color-field-bg-default': DATEPICKER_COLORS.bg.default,
|
|
219
|
+
};
|
|
220
|
+
return (h("sd-field", { key: 'e44e9a2cf5c610c20c419215bd3b14494cea2980', name: this.name, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, addonAlign: this.addonAlign, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, size: this.size, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, h("div", { key: '29951ae2a98d2a44c2b01a735291dd2ec6d7e5a2', class: "sd-date-range-picker", ref: el => {
|
|
221
|
+
this.triggerRef = el;
|
|
222
|
+
} }, h("sd-date-picker-trigger", { key: '37d379cf054838e5005b00812401a8d7c6d4daa9', displayText: this.displayText, placeholder: this.placeholder, disabled: this.disabled, size: this.size, onSdTriggerClick: this.handleTriggerClick })), (this.isOpen || this.isAnimatingOut) && (h("sd-portal", { key: '1fbc3c2a16c845486e942b0a71ff799a9d1a98c6', open: this.isOpen, parentRef: this.triggerRef, onSdClose: () => this.closeDropdown() }, h("sd-date-range-picker-calendar", { key: '6e53bfaa550c93e6b2c08a2311bc415f359bc2da', value: this.value, selectable: this.selectable, maxRange: this.maxRange, onSdSelect: this.handleSelect, onSdViewChange: this.handleViewChange })))));
|
|
223
|
+
}
|
|
224
|
+
static get watchers() { return {
|
|
225
|
+
"isOpen": [{
|
|
226
|
+
"watchIsOpen": 0
|
|
227
|
+
}]
|
|
228
|
+
}; }
|
|
229
|
+
};
|
|
230
|
+
SdDateRangePicker.style = sdDateRangePickerCss();
|
|
231
|
+
|
|
232
|
+
const filepicker = {
|
|
233
|
+
height: "28",
|
|
234
|
+
paddingX: "12",
|
|
235
|
+
gap: "8",
|
|
236
|
+
radius: "4",
|
|
237
|
+
typography: {
|
|
238
|
+
fontWeight: "400",
|
|
239
|
+
fontSize: "12",
|
|
240
|
+
lineHeight: "20"},
|
|
241
|
+
size: {
|
|
242
|
+
icon: "16"
|
|
243
|
+
},
|
|
244
|
+
text: {
|
|
245
|
+
"default": "#222222",
|
|
246
|
+
placeholder: "#AAAAAA",
|
|
247
|
+
disabled: "#888888"
|
|
248
|
+
},
|
|
249
|
+
icon: {
|
|
250
|
+
disabled: "#BBBBBB"
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
var filePickerTokens = {
|
|
254
|
+
filepicker: filepicker
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
const fp = filePickerTokens.filepicker;
|
|
258
|
+
const FILE_PICKER_LAYOUT = {
|
|
259
|
+
height: fp.height,
|
|
260
|
+
paddingX: fp.paddingX,
|
|
261
|
+
gap: fp.gap,
|
|
262
|
+
radius: fp.radius,
|
|
263
|
+
fontSize: fp.typography.fontSize,
|
|
264
|
+
lineHeight: fp.typography.lineHeight,
|
|
265
|
+
fontWeight: fp.typography.fontWeight,
|
|
266
|
+
iconSize: fp.size.icon};
|
|
267
|
+
const FILE_PICKER_COLORS = {
|
|
268
|
+
text: fp.text,
|
|
269
|
+
icon: {
|
|
270
|
+
default: '#888888', // TODO: 토큰 반영 후 교체
|
|
271
|
+
disabled: fp.icon.disabled,
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
const sdFilePickerCss = () => `sd-file-picker{display:inline-flex;width:100%}.sd-file-picker__content{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--sd-file-picker-padding-x);gap:var(--sd-file-picker-gap);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;vertical-align:middle}.sd-file-picker__text{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--sd-file-picker-font-weight);font-size:var(--sd-file-picker-font-size);line-height:var(--sd-file-picker-line-height);color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker__text--placeholder{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__icon{flex-shrink:0}.sd-file-picker__clear-icon{flex-shrink:0;cursor:pointer;transition:opacity 0.2s ease}.sd-file-picker__clear-icon:hover{opacity:0.7}.sd-file-picker__input{display:none}.sd-file-picker__tooltip{position:absolute;top:calc(100% - 4px);left:50%;transform:translate(-50%);z-index:998;white-space:nowrap;padding:8px 12px;background:rgba(0, 0, 0, 0.8);color:white;font-size:12px;line-height:18px;border-radius:4px;pointer-events:none}.sd-field--disabled .sd-file-picker__content{cursor:not-allowed}.sd-field--disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}.sd-file-picker--inline .sd-file-picker__content{border:none;background-color:transparent;padding:0;height:auto}.sd-file-picker--inline .sd-file-picker__text{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker--inline:hover:not(.sd-file-picker--inline-disabled) .sd-file-picker__text{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline .sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__content{cursor:not-allowed}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}`;
|
|
276
|
+
|
|
277
|
+
const SdFilePicker = class {
|
|
278
|
+
constructor(hostRef) {
|
|
279
|
+
registerInstance(this, hostRef);
|
|
280
|
+
this.update = createEvent(this, "sdUpdate", 7);
|
|
281
|
+
this.reject = createEvent(this, "sdReject", 7);
|
|
282
|
+
}
|
|
283
|
+
get el() { return getElement(this); }
|
|
284
|
+
value = null;
|
|
285
|
+
placeholder = 'Click to upload';
|
|
286
|
+
disabled = false;
|
|
287
|
+
inline = false;
|
|
288
|
+
multiple = false;
|
|
289
|
+
accept;
|
|
290
|
+
maxFileSize;
|
|
291
|
+
maxTotalSize;
|
|
292
|
+
maxFiles;
|
|
293
|
+
// sd-field 패스스루 props
|
|
294
|
+
name = nanoid();
|
|
295
|
+
label = '';
|
|
296
|
+
labelWidth = '';
|
|
297
|
+
addonLabel = '';
|
|
298
|
+
addonAlign = 'start';
|
|
299
|
+
hint = '';
|
|
300
|
+
errorMessage = '';
|
|
301
|
+
width = '';
|
|
302
|
+
rules;
|
|
303
|
+
error = false;
|
|
304
|
+
status;
|
|
305
|
+
icon = undefined;
|
|
306
|
+
labelTooltip = '';
|
|
307
|
+
labelTooltipProps = null;
|
|
308
|
+
focused = false;
|
|
309
|
+
hovered = false;
|
|
310
|
+
internalValue = null;
|
|
311
|
+
showTooltip = false;
|
|
312
|
+
fileInputRef;
|
|
313
|
+
fileNamesRef;
|
|
314
|
+
formField;
|
|
315
|
+
update;
|
|
316
|
+
reject;
|
|
317
|
+
valueChanged(newValue) {
|
|
318
|
+
this.internalValue = newValue;
|
|
319
|
+
}
|
|
320
|
+
componentDidLoad() {
|
|
321
|
+
this.checkOverflow();
|
|
322
|
+
}
|
|
323
|
+
componentDidUpdate() {
|
|
324
|
+
this.checkOverflow();
|
|
325
|
+
}
|
|
326
|
+
async sdValidate() {
|
|
327
|
+
return this.formField?.sdValidate() ?? Promise.resolve(true);
|
|
328
|
+
}
|
|
329
|
+
async sdReset() {
|
|
330
|
+
const clearedValue = this.multiple ? [] : null;
|
|
331
|
+
this.value = clearedValue;
|
|
332
|
+
this.internalValue = clearedValue;
|
|
333
|
+
if (this.fileInputRef) {
|
|
334
|
+
this.fileInputRef.value = '';
|
|
335
|
+
}
|
|
336
|
+
await this.formField?.sdResetValidation();
|
|
337
|
+
}
|
|
338
|
+
async sdResetValidate() {
|
|
339
|
+
await this.formField?.sdResetValidation();
|
|
340
|
+
}
|
|
341
|
+
toBytes(value) {
|
|
342
|
+
if (value == null)
|
|
343
|
+
return undefined;
|
|
344
|
+
return typeof value === 'string' ? Number(value) : value;
|
|
345
|
+
}
|
|
346
|
+
validateFiles(files) {
|
|
347
|
+
const maxFileSize = this.toBytes(this.maxFileSize);
|
|
348
|
+
const maxTotalSize = this.toBytes(this.maxTotalSize);
|
|
349
|
+
const maxFiles = this.maxFiles != null ? Number(this.maxFiles) : undefined;
|
|
350
|
+
if (maxFiles != null && files.length > maxFiles) {
|
|
351
|
+
return { accepted: [], rejected: files, reason: 'max-files' };
|
|
352
|
+
}
|
|
353
|
+
if (maxFileSize != null) {
|
|
354
|
+
const oversized = files.filter(f => f.size > maxFileSize);
|
|
355
|
+
if (oversized.length > 0) {
|
|
356
|
+
return { accepted: [], rejected: oversized, reason: 'max-file-size' };
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (maxTotalSize != null) {
|
|
360
|
+
const totalSize = files.reduce((sum, f) => sum + f.size, 0);
|
|
361
|
+
if (totalSize > maxTotalSize) {
|
|
362
|
+
return { accepted: [], rejected: files, reason: 'max-total-size' };
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return { accepted: files, rejected: [] };
|
|
366
|
+
}
|
|
367
|
+
handleFileChange = (event) => {
|
|
368
|
+
const input = event.target;
|
|
369
|
+
const files = input.files;
|
|
370
|
+
if (!files || files.length === 0) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const fileArray = Array.from(files);
|
|
374
|
+
const { accepted, rejected, reason } = this.validateFiles(fileArray);
|
|
375
|
+
if (reason) {
|
|
376
|
+
this.reject?.emit({ files: rejected, reason });
|
|
377
|
+
if (this.fileInputRef) {
|
|
378
|
+
this.fileInputRef.value = '';
|
|
379
|
+
}
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
if (this.multiple) {
|
|
383
|
+
this.internalValue = accepted;
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
this.internalValue = accepted[0];
|
|
387
|
+
}
|
|
388
|
+
this.value = this.internalValue;
|
|
389
|
+
this.update?.emit(this.value);
|
|
390
|
+
};
|
|
391
|
+
handleClear = (event) => {
|
|
392
|
+
if (this.disabled)
|
|
393
|
+
return;
|
|
394
|
+
event.stopPropagation();
|
|
395
|
+
const clearedValue = this.multiple ? [] : null;
|
|
396
|
+
this.value = clearedValue;
|
|
397
|
+
this.internalValue = clearedValue;
|
|
398
|
+
this.update?.emit(clearedValue);
|
|
399
|
+
if (this.fileInputRef) {
|
|
400
|
+
this.fileInputRef.value = '';
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
handleClick = () => {
|
|
404
|
+
if (this.disabled)
|
|
405
|
+
return;
|
|
406
|
+
this.fileInputRef?.click();
|
|
407
|
+
};
|
|
408
|
+
hasFiles() {
|
|
409
|
+
if (!this.internalValue)
|
|
410
|
+
return false;
|
|
411
|
+
if (Array.isArray(this.internalValue)) {
|
|
412
|
+
return this.internalValue.length > 0;
|
|
413
|
+
}
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
getDisplayText() {
|
|
417
|
+
if (!this.hasFiles())
|
|
418
|
+
return this.placeholder ?? 'Click to upload';
|
|
419
|
+
if (Array.isArray(this.internalValue)) {
|
|
420
|
+
return this.internalValue.map(f => f.name).join(', ');
|
|
421
|
+
}
|
|
422
|
+
return this.internalValue?.name || (this.placeholder ?? 'Click to upload');
|
|
423
|
+
}
|
|
424
|
+
checkOverflow() {
|
|
425
|
+
if (!this.fileNamesRef)
|
|
426
|
+
return;
|
|
427
|
+
const isOverflowing = this.fileNamesRef.scrollWidth > this.fileNamesRef.clientWidth;
|
|
428
|
+
this.showTooltip = isOverflowing;
|
|
429
|
+
}
|
|
430
|
+
getIconColor() {
|
|
431
|
+
return this.disabled ? FILE_PICKER_COLORS.icon.disabled : FILE_PICKER_COLORS.icon.default;
|
|
432
|
+
}
|
|
433
|
+
render() {
|
|
434
|
+
const hasFiles = this.hasFiles();
|
|
435
|
+
const displayText = this.getDisplayText();
|
|
436
|
+
const cssVars = {
|
|
437
|
+
'--sd-file-picker-font-size': `${FILE_PICKER_LAYOUT.fontSize}px`,
|
|
438
|
+
'--sd-file-picker-line-height': `${FILE_PICKER_LAYOUT.lineHeight}px`,
|
|
439
|
+
'--sd-file-picker-font-weight': FILE_PICKER_LAYOUT.fontWeight,
|
|
440
|
+
'--sd-file-picker-padding-x': `${FILE_PICKER_LAYOUT.paddingX}px`,
|
|
441
|
+
'--sd-file-picker-gap': `${FILE_PICKER_LAYOUT.gap}px`,
|
|
442
|
+
'--sd-file-picker-text-color': FILE_PICKER_COLORS.text.default,
|
|
443
|
+
'--sd-file-picker-placeholder-color': FILE_PICKER_COLORS.text.placeholder,
|
|
444
|
+
'--sd-file-picker-disabled-color': FILE_PICKER_COLORS.text.disabled,
|
|
445
|
+
// sd-field 시스템 변수 override
|
|
446
|
+
'--sd-system-size-field-sm-height': `${FILE_PICKER_LAYOUT.height}px`,
|
|
447
|
+
'--sd-system-radius-field-sm': `${FILE_PICKER_LAYOUT.radius}px`,
|
|
448
|
+
};
|
|
449
|
+
const content = (h("div", { class: "sd-file-picker__content", onClick: this.handleClick }, h("input", { ref: el => (this.fileInputRef = el), type: "file", class: "sd-file-picker__input", disabled: this.disabled, multiple: this.multiple, accept: this.accept, onInput: this.handleFileChange, "aria-label": this.placeholder ?? 'Click to upload' }), h("sd-icon", { name: "attachFile", size: Number(FILE_PICKER_LAYOUT.iconSize), color: this.getIconColor(), class: "sd-file-picker__icon" }), h("div", { ref: el => (this.fileNamesRef = el), class: {
|
|
450
|
+
'sd-file-picker__text': true,
|
|
451
|
+
'sd-file-picker__text--placeholder': !hasFiles,
|
|
452
|
+
'sd-file-picker__text--active': hasFiles,
|
|
453
|
+
} }, displayText), !this.disabled && hasFiles && (h("sd-ghost-button", { icon: "close", size: "xxs", ariaLabel: "clear", disabled: this.disabled, class: "sd-file-picker__clear-icon", onClick: this.handleClear })), this.showTooltip && hasFiles && this.hovered && (h("div", { class: "sd-file-picker__tooltip" }, displayText))));
|
|
454
|
+
if (this.inline) {
|
|
455
|
+
return (h("div", { class: {
|
|
456
|
+
'sd-file-picker--inline': true,
|
|
457
|
+
'sd-file-picker--inline-disabled': this.disabled,
|
|
458
|
+
}, style: cssVars, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false) }, content));
|
|
459
|
+
}
|
|
460
|
+
return (h("sd-field", { name: this.name, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, addonAlign: this.addonAlign, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, status: this.status, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, content));
|
|
461
|
+
}
|
|
462
|
+
static get watchers() { return {
|
|
463
|
+
"value": [{
|
|
464
|
+
"valueChanged": 0
|
|
465
|
+
}]
|
|
466
|
+
}; }
|
|
467
|
+
};
|
|
468
|
+
SdFilePicker.style = sdFilePickerCss();
|
|
469
|
+
|
|
470
|
+
const sm$1 = inputTokens.textinput.sm;
|
|
471
|
+
const md$1 = inputTokens.textinput.md;
|
|
472
|
+
const INPUT_SIZE_MAP = {
|
|
473
|
+
sm: {
|
|
474
|
+
height: sm$1.height,
|
|
475
|
+
paddingX: sm$1.paddingX,
|
|
476
|
+
gap: sm$1.gap,
|
|
477
|
+
radius: sm$1.radius,
|
|
478
|
+
fontSize: sm$1.typography.fontSize,
|
|
479
|
+
lineHeight: sm$1.typography.lineHeight,
|
|
480
|
+
fontWeight: sm$1.typography.fontWeight,
|
|
481
|
+
},
|
|
482
|
+
md: {
|
|
483
|
+
height: md$1.height,
|
|
484
|
+
paddingX: md$1.paddingX,
|
|
485
|
+
gap: md$1.gap,
|
|
486
|
+
radius: md$1.radius,
|
|
487
|
+
fontSize: md$1.typography.fontSize,
|
|
488
|
+
lineHeight: md$1.typography.lineHeight,
|
|
489
|
+
fontWeight: md$1.typography.fontWeight,
|
|
490
|
+
},
|
|
491
|
+
};
|
|
492
|
+
const INPUT_COLORS = {
|
|
493
|
+
text: inputTokens.textinput.text,
|
|
494
|
+
icon: inputTokens.textinput.icon,
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
const sdInputCss = () => `sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}sd-input{display:inline-flex}sd-input .sd-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-input-text-color);font-size:var(--sd-input-font-size);line-height:var(--sd-input-line-height);font-weight:var(--sd-input-font-weight);padding:0 var(--sd-input-padding-x);gap:var(--sd-input-gap)}sd-input .sd-input__content .sd-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-input .sd-input__content .sd-input__native[disabled]{cursor:not-allowed;color:var(--sd-input-disabled-color)}sd-input .sd-input__content .sd-input__native[readonly]{color:var(--sd-system-color-field-text-read-only)}sd-input .sd-input__content .sd-input__native::placeholder{color:var(--sd-input-placeholder-color)}sd-input .sd-input__content .sd-input__clear-icon,sd-input .sd-input__content .sd-input__password-icon{flex-shrink:0}sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__password-icon,sd-input .sd-input__content .sd-input__native[readonly]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[readonly]~.sd-input__password-icon{cursor:not-allowed;pointer-events:none}`;
|
|
498
|
+
|
|
499
|
+
const SdInput = class {
|
|
500
|
+
constructor(hostRef) {
|
|
501
|
+
registerInstance(this, hostRef);
|
|
502
|
+
this.input = createEvent(this, "sdUpdate", 7);
|
|
503
|
+
this.focus = createEvent(this, "sdFocus", 7);
|
|
504
|
+
this.blur = createEvent(this, "sdBlur", 7);
|
|
505
|
+
}
|
|
506
|
+
get host() { return getElement(this); }
|
|
507
|
+
value = null;
|
|
508
|
+
type = 'text';
|
|
509
|
+
size = 'sm';
|
|
510
|
+
addonLabel = '';
|
|
511
|
+
addonAlign = 'start';
|
|
512
|
+
placeholder = '입력해 주세요.';
|
|
513
|
+
disabled = false;
|
|
514
|
+
clearable = false;
|
|
515
|
+
width = '';
|
|
516
|
+
rules = [];
|
|
517
|
+
autoFocus = false;
|
|
518
|
+
autocomplete = '';
|
|
519
|
+
maxlength;
|
|
520
|
+
minlength;
|
|
521
|
+
inputmode;
|
|
522
|
+
enterkeyhint;
|
|
523
|
+
spellcheck = false;
|
|
524
|
+
status;
|
|
525
|
+
hint = '';
|
|
526
|
+
errorMessage = '';
|
|
527
|
+
inputClass = '';
|
|
528
|
+
readonly = false;
|
|
529
|
+
error = false;
|
|
530
|
+
focused = false;
|
|
531
|
+
hovered = false;
|
|
532
|
+
// props - label
|
|
533
|
+
label = '';
|
|
534
|
+
labelWidth = '';
|
|
535
|
+
icon = undefined;
|
|
536
|
+
labelTooltip = '';
|
|
537
|
+
labelTooltipProps = null;
|
|
538
|
+
// props - custom styles
|
|
539
|
+
inputStyle = {};
|
|
540
|
+
internalValue = null;
|
|
541
|
+
passwordVisible = false;
|
|
542
|
+
nativeEl = undefined;
|
|
543
|
+
formField;
|
|
544
|
+
name = nanoid();
|
|
545
|
+
input;
|
|
546
|
+
focus;
|
|
547
|
+
blur;
|
|
548
|
+
valueChanged(newValue) {
|
|
549
|
+
this.internalValue = newValue;
|
|
550
|
+
}
|
|
551
|
+
internalValueChanged(newValue) {
|
|
552
|
+
if (newValue !== this.value) {
|
|
553
|
+
this.value = newValue;
|
|
554
|
+
this.input?.emit(this.value);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
async sdGetNativeElement() {
|
|
558
|
+
return this.nativeEl || null;
|
|
559
|
+
}
|
|
560
|
+
async sdValidate() {
|
|
561
|
+
this.formField?.sdValidate();
|
|
562
|
+
}
|
|
563
|
+
async sdReset() {
|
|
564
|
+
this.formField?.sdReset();
|
|
565
|
+
}
|
|
566
|
+
async sdResetValidate() {
|
|
567
|
+
this.formField?.sdResetValidation();
|
|
568
|
+
}
|
|
569
|
+
async sdFocus() {
|
|
570
|
+
this.formField?.sdFocus();
|
|
571
|
+
}
|
|
572
|
+
componentWillLoad() {
|
|
573
|
+
if (this.value) {
|
|
574
|
+
this.internalValue = this.value;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
componentDidLoad() {
|
|
578
|
+
if (this.autoFocus) {
|
|
579
|
+
this.nativeEl?.focus();
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
handleInput = (event) => {
|
|
583
|
+
const target = event.target;
|
|
584
|
+
this.internalValue = target.value;
|
|
585
|
+
};
|
|
586
|
+
handleFocus = async (type, event) => {
|
|
587
|
+
this.focused = type === 'focus';
|
|
588
|
+
if (type === 'blur') {
|
|
589
|
+
// Auto-validate on blur if rules exist
|
|
590
|
+
if (this.rules && this.rules.length > 0) {
|
|
591
|
+
await this.formField?.sdValidate();
|
|
592
|
+
}
|
|
593
|
+
this.blur?.emit(event);
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
this.focus?.emit(event);
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
render() {
|
|
600
|
+
const sizeTokens = INPUT_SIZE_MAP[this.size] ?? INPUT_SIZE_MAP.sm;
|
|
601
|
+
const cssVars = {
|
|
602
|
+
// sd-input 자체 토큰
|
|
603
|
+
'--sd-input-font-size': `${sizeTokens.fontSize}px`,
|
|
604
|
+
'--sd-input-line-height': `${sizeTokens.lineHeight}px`,
|
|
605
|
+
'--sd-input-font-weight': sizeTokens.fontWeight,
|
|
606
|
+
'--sd-input-padding-x': `${sizeTokens.paddingX}px`,
|
|
607
|
+
'--sd-input-gap': `${sizeTokens.gap}px`,
|
|
608
|
+
'--sd-input-text-color': INPUT_COLORS.text.default,
|
|
609
|
+
'--sd-input-placeholder-color': INPUT_COLORS.text.placeholder,
|
|
610
|
+
'--sd-input-disabled-color': INPUT_COLORS.text.disabled,
|
|
611
|
+
'--sd-input-icon-color': INPUT_COLORS.icon.default,
|
|
612
|
+
// sd-field 시스템 변수 override (size별 높이/반경)
|
|
613
|
+
'--sd-system-size-field-sm-height': `${sizeTokens.height}px`,
|
|
614
|
+
'--sd-system-radius-field-sm': `${sizeTokens.radius}px`,
|
|
615
|
+
};
|
|
616
|
+
return (h("sd-field", { key: 'a94dfffaad91682d63a4c0f8e2428aee0f2dc909', name: this.name, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, addonAlign: this.addonAlign, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, readonly: this.readonly, focused: this.focused, hovered: this.hovered, status: this.status, size: this.size, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, h("label", { key: '44a55878936edbe36726b0cd607b607ee2921155', class: "sd-input__content" }, h("slot", { key: 'c3566240fc270059c4a7b4ccd7907a27141fd57e', name: "prefix" }), h("input", { key: '0df6f4eea75f1d5c0ed174902eb2c072dc81c23f', name: this.name, ref: el => (this.nativeEl = el), class: `sd-input__native ${this.inputClass}`, type: this.type === 'password' && this.passwordVisible ? 'text' : (this.type ?? 'text'), value: this.internalValue || '', placeholder: this.placeholder ?? '입력해 주세요.', disabled: this.disabled, readonly: this.readonly, autofocus: this.autoFocus, autocomplete: this.autocomplete || undefined, maxlength: this.maxlength, minlength: this.minlength, inputmode: this.inputmode, enterkeyhint: this.enterkeyhint, spellcheck: this.spellcheck, onInput: this.handleInput, onFocus: event => this.handleFocus('focus', event), onBlur: event => this.handleFocus('blur', event), style: this.inputStyle }), h("slot", { key: '685051959a063e6c2465a01aaa77b0f84c4bb570', name: "suffix" }), this.clearable && this.internalValue && !this.disabled && !this.readonly && (h("sd-ghost-button", { key: '382c86fe50a702b84a7dbc82b2e19d9e534af36a', icon: "close", ariaLabel: "clear", size: "xxs", disabled: this.disabled, class: "sd-input__clear-icon", onClick: async () => {
|
|
617
|
+
if (this.disabled || this.readonly)
|
|
618
|
+
return;
|
|
619
|
+
this.internalValue = '';
|
|
620
|
+
await this.formField?.sdValidate();
|
|
621
|
+
} })), this.type === 'password' && (h("sd-ghost-button", { key: '2ae4ddc84bc8969ff4939d224b56ca7a05ea9115', icon: this.passwordVisible ? 'visibilityOn' : 'visibilityOff', ariaLabel: "visibility", size: "xxs", disabled: this.disabled || this.readonly, class: "sd-input__password-icon", onClick: () => {
|
|
622
|
+
if (this.disabled || this.readonly)
|
|
623
|
+
return;
|
|
624
|
+
this.passwordVisible = !this.passwordVisible;
|
|
625
|
+
} })))));
|
|
626
|
+
}
|
|
627
|
+
static get watchers() { return {
|
|
628
|
+
"value": [{
|
|
629
|
+
"valueChanged": 0
|
|
630
|
+
}],
|
|
631
|
+
"internalValue": [{
|
|
632
|
+
"internalValueChanged": 0
|
|
633
|
+
}]
|
|
634
|
+
}; }
|
|
635
|
+
};
|
|
636
|
+
SdInput.style = sdInputCss();
|
|
637
|
+
|
|
638
|
+
const numberInput = {
|
|
639
|
+
sm: {
|
|
640
|
+
height: "28",
|
|
641
|
+
paddingX: "6",
|
|
642
|
+
radius: "4",
|
|
643
|
+
typography: {
|
|
644
|
+
fontWeight: "400",
|
|
645
|
+
fontSize: "12",
|
|
646
|
+
lineHeight: "20"}},
|
|
647
|
+
md: {
|
|
648
|
+
height: "36",
|
|
649
|
+
paddingX: "8",
|
|
650
|
+
radius: "6",
|
|
651
|
+
typography: {
|
|
652
|
+
fontWeight: "400",
|
|
653
|
+
fontSize: "14",
|
|
654
|
+
lineHeight: "24"
|
|
655
|
+
}},
|
|
656
|
+
contents: {
|
|
657
|
+
gap: "4"
|
|
658
|
+
},
|
|
659
|
+
border: {
|
|
660
|
+
"default": "#AAAAAA",
|
|
661
|
+
focus: "#0075FF",
|
|
662
|
+
danger: "#FB4444"},
|
|
663
|
+
bg: {
|
|
664
|
+
"default": "#FFFFFF"},
|
|
665
|
+
text: {
|
|
666
|
+
"default": "#222222",
|
|
667
|
+
placeholder: "#AAAAAA",
|
|
668
|
+
disabled: "#888888"
|
|
669
|
+
},
|
|
670
|
+
hint: {
|
|
671
|
+
color: "#555555",
|
|
672
|
+
typography: {
|
|
673
|
+
fontSize: "12",
|
|
674
|
+
lineHeight: "20"}
|
|
675
|
+
},
|
|
676
|
+
errorMessage: {
|
|
677
|
+
color: "#E30000",
|
|
678
|
+
typography: {
|
|
679
|
+
fontSize: "12",
|
|
680
|
+
lineHeight: "20"}
|
|
681
|
+
},
|
|
682
|
+
stepper: {
|
|
683
|
+
sm: {
|
|
684
|
+
size: "20"
|
|
685
|
+
},
|
|
686
|
+
md: {
|
|
687
|
+
size: "24"
|
|
688
|
+
},
|
|
689
|
+
radius: "4",
|
|
690
|
+
bg: {
|
|
691
|
+
"default": "#EFF6FF",
|
|
692
|
+
disabled: "#EEEEEE"
|
|
693
|
+
},
|
|
694
|
+
icon: {
|
|
695
|
+
"default": "#0075FF",
|
|
696
|
+
disabled: "#BBBBBB"
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
var numberInputTokens = {
|
|
701
|
+
numberInput: numberInput
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
const sm = numberInputTokens.numberInput.sm;
|
|
705
|
+
const md = numberInputTokens.numberInput.md;
|
|
706
|
+
const NUMBER_INPUT_SIZE_MAP = {
|
|
707
|
+
sm: {
|
|
708
|
+
height: sm.height,
|
|
709
|
+
paddingX: sm.paddingX,
|
|
710
|
+
radius: sm.radius,
|
|
711
|
+
fontSize: sm.typography.fontSize,
|
|
712
|
+
lineHeight: sm.typography.lineHeight,
|
|
713
|
+
fontWeight: sm.typography.fontWeight,
|
|
714
|
+
},
|
|
715
|
+
md: {
|
|
716
|
+
height: md.height,
|
|
717
|
+
paddingX: md.paddingX,
|
|
718
|
+
radius: md.radius,
|
|
719
|
+
fontSize: md.typography.fontSize,
|
|
720
|
+
lineHeight: md.typography.lineHeight,
|
|
721
|
+
fontWeight: md.typography.fontWeight,
|
|
722
|
+
},
|
|
723
|
+
};
|
|
724
|
+
const NUMBER_INPUT_COLORS = {
|
|
725
|
+
border: numberInputTokens.numberInput.border,
|
|
726
|
+
bg: numberInputTokens.numberInput.bg,
|
|
727
|
+
text: numberInputTokens.numberInput.text,
|
|
728
|
+
};
|
|
729
|
+
const NUMBER_INPUT_STEPPER = {
|
|
730
|
+
sm: { size: numberInputTokens.numberInput.stepper.sm.size },
|
|
731
|
+
md: { size: numberInputTokens.numberInput.stepper.md.size },
|
|
732
|
+
radius: numberInputTokens.numberInput.stepper.radius,
|
|
733
|
+
bg: numberInputTokens.numberInput.stepper.bg,
|
|
734
|
+
icon: numberInputTokens.numberInput.stepper.icon,
|
|
735
|
+
};
|
|
736
|
+
const NUMBER_INPUT_HINT = numberInputTokens.numberInput.hint;
|
|
737
|
+
const NUMBER_INPUT_ERROR_MESSAGE = numberInputTokens.numberInput.errorMessage;
|
|
738
|
+
const NUMBER_INPUT_CONTENTS_GAP = numberInputTokens.numberInput.contents.gap;
|
|
739
|
+
|
|
740
|
+
const sdNumberInputCss = () => `sd-number-input{display:inline-flex}sd-number-input .sd-number-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;gap:var(--sd-number-input-padding-x);color:var(--sd-number-input-text-color);font-size:var(--sd-number-input-font-size);line-height:var(--sd-number-input-line-height);font-weight:var(--sd-number-input-font-weight);padding:0 var(--sd-number-input-padding-x)}sd-number-input .sd-number-input__content--no-stepper{padding:0 calc(var(--sd-number-input-padding-x) * 2)}sd-number-input .sd-number-input__content .sd-number-input__native{width:100%;height:100%;min-width:0;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;padding-block:0;padding-inline:0}sd-number-input .sd-number-input__content .sd-number-input__native[disabled]{cursor:not-allowed;color:var(--sd-number-input-disabled-color)}sd-number-input .sd-number-input__content .sd-number-input__native[readonly]{color:var(--sd-system-color-field-text-read-only)}sd-number-input .sd-number-input__content .sd-number-input__native::placeholder{color:var(--sd-number-input-placeholder-color)}sd-number-input .sd-number-input__content .sd-number-input__prefix,sd-number-input .sd-number-input__content .sd-number-input__suffix{flex-shrink:0;white-space:nowrap;color:var(--sd-number-input-placeholder-color);font-size:inherit;line-height:inherit}sd-number-input .sd-number-input__content .sd-number-input__stepper{flex-shrink:0;width:var(--sd-number-input-stepper-size);height:var(--sd-number-input-stepper-size);border:none;border-radius:var(--sd-number-input-stepper-radius);background-color:var(--sd-number-input-stepper-bg);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.15s ease}sd-number-input .sd-number-input__content .sd-number-input__stepper:hover:not(:disabled){filter:brightness(0.95)}sd-number-input .sd-number-input__content .sd-number-input__stepper:disabled{background-color:var(--sd-number-input-stepper-bg-disabled);cursor:not-allowed}`;
|
|
741
|
+
|
|
742
|
+
const SdNumberInput = class {
|
|
743
|
+
constructor(hostRef) {
|
|
744
|
+
registerInstance(this, hostRef);
|
|
745
|
+
this.update = createEvent(this, "sdUpdate", 7);
|
|
746
|
+
this.focus = createEvent(this, "sdFocus", 7);
|
|
747
|
+
this.blur = createEvent(this, "sdBlur", 7);
|
|
748
|
+
}
|
|
749
|
+
get el() { return getElement(this); }
|
|
750
|
+
size = 'sm';
|
|
751
|
+
min = Number.NEGATIVE_INFINITY;
|
|
752
|
+
max = Number.POSITIVE_INFINITY;
|
|
753
|
+
step = 1;
|
|
754
|
+
useButton = false;
|
|
755
|
+
useDecimal = false;
|
|
756
|
+
value = null;
|
|
757
|
+
label;
|
|
758
|
+
labelWidth = '';
|
|
759
|
+
addonLabel = '';
|
|
760
|
+
addonAlign = 'start';
|
|
761
|
+
placeholder = '입력해 주세요.';
|
|
762
|
+
disabled = false;
|
|
763
|
+
width;
|
|
764
|
+
rules = [];
|
|
765
|
+
autoFocus = false;
|
|
766
|
+
status;
|
|
767
|
+
hint = '';
|
|
768
|
+
errorMessage = '';
|
|
769
|
+
inputPrefix = '';
|
|
770
|
+
inputSuffix = '';
|
|
771
|
+
inputClass = '';
|
|
772
|
+
readonly = false;
|
|
773
|
+
inputStyle = {};
|
|
774
|
+
error = false;
|
|
775
|
+
focused = false;
|
|
776
|
+
hovered = false;
|
|
777
|
+
internalValue = null;
|
|
778
|
+
displayValue = '';
|
|
779
|
+
nativeEl = undefined;
|
|
780
|
+
formField;
|
|
781
|
+
name = nanoid();
|
|
782
|
+
update;
|
|
783
|
+
focus;
|
|
784
|
+
blur;
|
|
785
|
+
toNumber(val) {
|
|
786
|
+
if (val === null || val === undefined || val === '')
|
|
787
|
+
return null;
|
|
788
|
+
if (typeof val === 'number')
|
|
789
|
+
return isNaN(val) ? null : val;
|
|
790
|
+
if (typeof val === 'string')
|
|
791
|
+
return this.parseInput(val);
|
|
792
|
+
const num = Number(val);
|
|
793
|
+
return isNaN(num) ? null : num;
|
|
794
|
+
}
|
|
795
|
+
formatWithCommas(value) {
|
|
796
|
+
if (value === null || value === undefined || isNaN(value))
|
|
797
|
+
return '';
|
|
798
|
+
const isNegative = value < 0;
|
|
799
|
+
const absValue = Math.abs(value);
|
|
800
|
+
const [intPart, decPart] = absValue.toString().split('.');
|
|
801
|
+
const formatted = (+intPart).toLocaleString();
|
|
802
|
+
const result = isNegative ? '-' + formatted : formatted;
|
|
803
|
+
return decPart ? result + '.' + decPart : String(result);
|
|
804
|
+
}
|
|
805
|
+
parseInput(input) {
|
|
806
|
+
if (!input || input.trim() === '')
|
|
807
|
+
return null;
|
|
808
|
+
const cleaned = input.replace(/,/g, '').trim();
|
|
809
|
+
if (!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(cleaned)) {
|
|
810
|
+
return null;
|
|
811
|
+
}
|
|
812
|
+
const parsed = parseFloat(cleaned);
|
|
813
|
+
if (isNaN(parsed))
|
|
814
|
+
return null;
|
|
815
|
+
if (!this.useDecimal && cleaned.includes('.')) {
|
|
816
|
+
return null;
|
|
817
|
+
}
|
|
818
|
+
return parsed;
|
|
819
|
+
}
|
|
820
|
+
clampMinMax(value) {
|
|
821
|
+
if (isNaN(value))
|
|
822
|
+
return 0;
|
|
823
|
+
return Math.min(Math.max(value, this.min), this.max);
|
|
824
|
+
}
|
|
825
|
+
updateDisplay() {
|
|
826
|
+
this.displayValue = this.formatWithCommas(this.internalValue);
|
|
827
|
+
}
|
|
828
|
+
isIncrementDisabled() {
|
|
829
|
+
if (this.disabled || this.readonly)
|
|
830
|
+
return true;
|
|
831
|
+
if (this.internalValue !== null) {
|
|
832
|
+
return this.internalValue >= this.max;
|
|
833
|
+
}
|
|
834
|
+
return false;
|
|
835
|
+
}
|
|
836
|
+
isDecrementDisabled() {
|
|
837
|
+
if (this.disabled || this.readonly)
|
|
838
|
+
return true;
|
|
839
|
+
if (this.internalValue !== null) {
|
|
840
|
+
return this.internalValue <= this.min;
|
|
841
|
+
}
|
|
842
|
+
return false;
|
|
843
|
+
}
|
|
844
|
+
valueChanged(newValue) {
|
|
845
|
+
const parsed = this.toNumber(newValue);
|
|
846
|
+
if (parsed !== null) {
|
|
847
|
+
this.internalValue = this.clampMinMax(parsed);
|
|
848
|
+
}
|
|
849
|
+
else {
|
|
850
|
+
this.internalValue = null;
|
|
851
|
+
}
|
|
852
|
+
this.updateDisplay();
|
|
853
|
+
}
|
|
854
|
+
internalValueChanged(newValue) {
|
|
855
|
+
this.updateDisplay();
|
|
856
|
+
if (newValue !== this.value) {
|
|
857
|
+
this.value = newValue;
|
|
858
|
+
this.update?.emit(newValue);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
async sdValidate() {
|
|
862
|
+
this.formField?.sdValidate();
|
|
863
|
+
}
|
|
864
|
+
async sdReset() {
|
|
865
|
+
this.formField?.sdReset();
|
|
866
|
+
}
|
|
867
|
+
async sdResetValidate() {
|
|
868
|
+
this.formField?.sdResetValidation();
|
|
869
|
+
}
|
|
870
|
+
async sdFocus() {
|
|
871
|
+
this.formField?.sdFocus();
|
|
872
|
+
}
|
|
873
|
+
async sdGetNativeElement() {
|
|
874
|
+
return this.nativeEl || null;
|
|
875
|
+
}
|
|
876
|
+
componentWillLoad() {
|
|
877
|
+
const parsed = this.toNumber(this.value);
|
|
878
|
+
if (parsed !== null) {
|
|
879
|
+
this.internalValue = this.clampMinMax(parsed);
|
|
880
|
+
}
|
|
881
|
+
this.updateDisplay();
|
|
882
|
+
}
|
|
883
|
+
componentDidLoad() {
|
|
884
|
+
if (this.autoFocus) {
|
|
885
|
+
this.nativeEl?.focus();
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
// TODO: 현재 숫자를 크게 넣어서 숫자e+21등의 형식으로 변환되면 값이 바뀌지않음 수정 필요
|
|
889
|
+
handleInput = (event) => {
|
|
890
|
+
const target = event.target;
|
|
891
|
+
const inputValue = target.value;
|
|
892
|
+
if (inputValue === '') {
|
|
893
|
+
this.internalValue = null;
|
|
894
|
+
this.displayValue = '';
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
const commasRemoved = inputValue.replace(/,/g, '');
|
|
898
|
+
const decimalCount = (commasRemoved.match(/\./g) || []).length;
|
|
899
|
+
if (decimalCount > 1) {
|
|
900
|
+
target.value = this.displayValue;
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
if (commasRemoved === '-' || commasRemoved === '.' || commasRemoved === '-.') {
|
|
904
|
+
target.value = commasRemoved;
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
if (commasRemoved.endsWith('.') && decimalCount === 1) {
|
|
908
|
+
const numberPart = commasRemoved.slice(0, -1);
|
|
909
|
+
const parsed = this.parseInput(numberPart);
|
|
910
|
+
if (parsed !== null) {
|
|
911
|
+
const formatted = this.formatWithCommas(parsed);
|
|
912
|
+
target.value = formatted + '.';
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
const parsed = this.parseInput(commasRemoved);
|
|
917
|
+
if (parsed !== null) {
|
|
918
|
+
if (parsed < this.min) {
|
|
919
|
+
target.value = this.displayValue;
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
922
|
+
if (parsed > this.max) {
|
|
923
|
+
target.value = this.displayValue;
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
this.internalValue = parsed;
|
|
927
|
+
this.displayValue = this.formatWithCommas(parsed);
|
|
928
|
+
target.value = this.displayValue;
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
target.value = this.displayValue;
|
|
932
|
+
}
|
|
933
|
+
};
|
|
934
|
+
handleFocus = (event) => {
|
|
935
|
+
this.focused = true;
|
|
936
|
+
this.focus?.emit(event);
|
|
937
|
+
};
|
|
938
|
+
handleBlur = async (event) => {
|
|
939
|
+
this.updateDisplay();
|
|
940
|
+
if (this.nativeEl) {
|
|
941
|
+
this.nativeEl.value = this.displayValue;
|
|
942
|
+
}
|
|
943
|
+
if (this.rules && this.rules.length > 0) {
|
|
944
|
+
await this.formField?.sdValidate();
|
|
945
|
+
}
|
|
946
|
+
this.focused = false;
|
|
947
|
+
this.blur?.emit(event);
|
|
948
|
+
};
|
|
949
|
+
handleKeyDown = (event) => {
|
|
950
|
+
if (event.key === 'ArrowUp') {
|
|
951
|
+
event.preventDefault();
|
|
952
|
+
this.handleIncrement();
|
|
953
|
+
}
|
|
954
|
+
else if (event.key === 'ArrowDown') {
|
|
955
|
+
event.preventDefault();
|
|
956
|
+
this.handleDecrement();
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
handleIncrement = () => {
|
|
960
|
+
if (this.isIncrementDisabled())
|
|
961
|
+
return;
|
|
962
|
+
const currentVal = this.internalValue ?? this.min ?? 0;
|
|
963
|
+
let nextVal = currentVal + this.step;
|
|
964
|
+
if (nextVal > this.max) {
|
|
965
|
+
nextVal = this.max;
|
|
966
|
+
}
|
|
967
|
+
if (nextVal === currentVal)
|
|
968
|
+
return;
|
|
969
|
+
this.internalValue = nextVal;
|
|
970
|
+
};
|
|
971
|
+
handleDecrement = () => {
|
|
972
|
+
if (this.isDecrementDisabled())
|
|
973
|
+
return;
|
|
974
|
+
const currentVal = this.internalValue ?? this.min ?? 0;
|
|
975
|
+
let nextVal = currentVal - this.step;
|
|
976
|
+
if (nextVal < this.min) {
|
|
977
|
+
nextVal = this.min;
|
|
978
|
+
}
|
|
979
|
+
if (nextVal === currentVal)
|
|
980
|
+
return;
|
|
981
|
+
this.internalValue = nextVal;
|
|
982
|
+
};
|
|
983
|
+
render() {
|
|
984
|
+
const sizeTokens = NUMBER_INPUT_SIZE_MAP[this.size] ?? NUMBER_INPUT_SIZE_MAP.sm;
|
|
985
|
+
const stepperSize = NUMBER_INPUT_STEPPER[this.size]?.size ?? NUMBER_INPUT_STEPPER.sm.size;
|
|
986
|
+
const iconSize = this.size === 'md' ? 14 : 12;
|
|
987
|
+
const cssVars = {
|
|
988
|
+
// 컴포넌트 로컬 토큰
|
|
989
|
+
'--sd-number-input-font-size': `${sizeTokens.fontSize}px`,
|
|
990
|
+
'--sd-number-input-line-height': `${sizeTokens.lineHeight}px`,
|
|
991
|
+
'--sd-number-input-font-weight': sizeTokens.fontWeight,
|
|
992
|
+
'--sd-number-input-padding-x': `${sizeTokens.paddingX}px`,
|
|
993
|
+
'--sd-number-input-text-color': NUMBER_INPUT_COLORS.text.default,
|
|
994
|
+
'--sd-number-input-placeholder-color': NUMBER_INPUT_COLORS.text.placeholder,
|
|
995
|
+
'--sd-number-input-disabled-color': NUMBER_INPUT_COLORS.text.disabled,
|
|
996
|
+
// 스테퍼 토큰
|
|
997
|
+
'--sd-number-input-stepper-size': `${stepperSize}px`,
|
|
998
|
+
'--sd-number-input-stepper-radius': `${NUMBER_INPUT_STEPPER.radius}px`,
|
|
999
|
+
'--sd-number-input-stepper-bg': NUMBER_INPUT_STEPPER.bg.default,
|
|
1000
|
+
'--sd-number-input-stepper-bg-disabled': NUMBER_INPUT_STEPPER.bg.disabled,
|
|
1001
|
+
'--sd-number-input-stepper-icon-color': NUMBER_INPUT_STEPPER.icon.default,
|
|
1002
|
+
'--sd-number-input-stepper-icon-disabled': NUMBER_INPUT_STEPPER.icon.disabled,
|
|
1003
|
+
// sd-field 시스템 변수 오버라이드
|
|
1004
|
+
'--sd-system-size-field-sm-height': `${sizeTokens.height}px`,
|
|
1005
|
+
'--sd-system-radius-field-sm': `${sizeTokens.radius}px`,
|
|
1006
|
+
'--sd-system-color-field-border-default': NUMBER_INPUT_COLORS.border.default,
|
|
1007
|
+
'--sd-system-color-field-border-focus': NUMBER_INPUT_COLORS.border.focus,
|
|
1008
|
+
'--sd-system-color-field-border-danger': NUMBER_INPUT_COLORS.border.danger,
|
|
1009
|
+
'--sd-system-color-field-bg-default': NUMBER_INPUT_COLORS.bg.default,
|
|
1010
|
+
// 힌트/에러 메시지 오버라이드
|
|
1011
|
+
'--sd-textinput-input-text-error-message': NUMBER_INPUT_ERROR_MESSAGE.color,
|
|
1012
|
+
'--sd-textinput-input-error-message-typography-font-size': `${NUMBER_INPUT_ERROR_MESSAGE.typography.fontSize}px`,
|
|
1013
|
+
'--sd-textinput-input-error-message-typography-line-height': `${NUMBER_INPUT_ERROR_MESSAGE.typography.lineHeight}px`,
|
|
1014
|
+
'--sd-textinput-input-text-hint': NUMBER_INPUT_HINT.color,
|
|
1015
|
+
'--sd-textinput-input-hint-typography-font-size': `${NUMBER_INPUT_HINT.typography.fontSize}px`,
|
|
1016
|
+
'--sd-textinput-input-hint-typography-line-height': `${NUMBER_INPUT_HINT.typography.lineHeight}px`,
|
|
1017
|
+
'--sd-textinput-input-contents-gap': `${NUMBER_INPUT_CONTENTS_GAP}px`,
|
|
1018
|
+
};
|
|
1019
|
+
return (h("sd-field", { key: 'ea9194c50e91def94838d1e886e934944a1fd78d', name: this.name, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, addonAlign: this.addonAlign, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, readonly: this.readonly, focused: this.focused, hovered: this.hovered, status: this.status, size: this.size, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, h("div", { key: '4e65dcfe630b21a7683afebf595f66aca04f5c8c', class: {
|
|
1020
|
+
'sd-number-input__content': true,
|
|
1021
|
+
'sd-number-input__content--no-stepper': !this.useButton,
|
|
1022
|
+
} }, this.useButton && (h("button", { key: 'ee387b4a602007b98e1ebd8cb1ab9a0dd11dfc9d', type: "button", class: "sd-number-input__stepper sd-number-input__stepper--decrement", disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, h("sd-icon", { key: 'a98dd85c4a0c160e8668731d79b4718d8acb989f', name: "minus", size: iconSize, color: this.isDecrementDisabled()
|
|
1023
|
+
? NUMBER_INPUT_STEPPER.icon.disabled
|
|
1024
|
+
: NUMBER_INPUT_STEPPER.icon.default }))), this.inputPrefix && (h("span", { key: 'b49392e692e2349fd9620d39b15c8531bc5ae240', class: "sd-number-input__prefix" }, this.inputPrefix)), h("input", { key: '7128b540d479d6500cfa05782c49b0e06cd999e7', name: this.name, ref: el => (this.nativeEl = el), class: `sd-number-input__native ${this.inputClass}`, type: "text", inputMode: "numeric", value: this.displayValue, placeholder: this.placeholder ?? '입력해 주세요.', disabled: this.disabled, readonly: this.readonly, autofocus: this.autoFocus, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, style: {
|
|
1025
|
+
textAlign: this.useButton ? 'center' : 'right',
|
|
1026
|
+
...this.inputStyle,
|
|
1027
|
+
} }), this.inputSuffix && (h("span", { key: 'e9902ba6872e4a10bcd1106c588e231973632f51', class: "sd-number-input__suffix" }, this.inputSuffix)), this.useButton && (h("button", { key: '297ad8b506e904ba27f3f19beebe7fa503950f7b', type: "button", class: "sd-number-input__stepper sd-number-input__stepper--increment", disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, h("sd-icon", { key: '2f74f2a161d6700981f33b3d1df3bad76b3df87b', name: "add", size: iconSize, color: this.isIncrementDisabled()
|
|
1028
|
+
? NUMBER_INPUT_STEPPER.icon.disabled
|
|
1029
|
+
: NUMBER_INPUT_STEPPER.icon.default }))))));
|
|
1030
|
+
}
|
|
1031
|
+
static get watchers() { return {
|
|
1032
|
+
"value": [{
|
|
1033
|
+
"valueChanged": 0
|
|
1034
|
+
}],
|
|
1035
|
+
"internalValue": [{
|
|
1036
|
+
"internalValueChanged": 0
|
|
1037
|
+
}]
|
|
1038
|
+
}; }
|
|
1039
|
+
};
|
|
1040
|
+
SdNumberInput.style = sdNumberInputCss();
|
|
1041
|
+
|
|
1042
|
+
const sdRadioGroupCss = () => `sd-radio{display:inline-flex;width:fit-content;height:var(--sd-radio-line-height);line-height:0}sd-radio .sd-radio{cursor:pointer;display:inline-flex;align-items:center;gap:var(--sd-radio-gap);height:var(--sd-radio-line-height);max-height:var(--sd-radio-line-height)}sd-radio .sd-radio>input{position:absolute;width:0;height:0;opacity:0;pointer-events:none}sd-radio .sd-radio>input:focus-visible+.sd-radio__circle{box-shadow:0 0 0 2px white, 0 0 0 4px var(--sd-radio-checked-border);outline:none}sd-radio .sd-radio__circle{position:relative;width:var(--sd-radio-size);height:var(--sd-radio-size);border-radius:50%;border:var(--sd-radio-border-width) solid var(--sd-radio-unchecked-border);box-sizing:border-box;background:var(--sd-radio-unchecked-bg);display:inline-flex;flex-shrink:0}sd-radio .sd-radio__label{font-size:var(--sd-radio-font-size);font-weight:var(--sd-radio-font-weight);color:var(--sd-radio-label-color);line-height:var(--sd-radio-line-height)}sd-radio .sd-radio:hover:not(.sd-radio--disabled) .sd-radio__circle{background:var(--sd-radio-unchecked-bg-hover);border-color:var(--sd-radio-unchecked-border-hover)}sd-radio .sd-radio--checked .sd-radio__circle{border-color:var(--sd-radio-checked-border)}sd-radio .sd-radio--checked .sd-radio__circle::after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:var(--sd-radio-dot-size);height:var(--sd-radio-dot-size);border-radius:50%;background:var(--sd-radio-checked-dot)}sd-radio .sd-radio--disabled{cursor:not-allowed}sd-radio .sd-radio--disabled .sd-radio__circle{background:var(--sd-radio-disabled-bg);border-color:var(--sd-radio-disabled-border)}sd-radio .sd-radio--disabled.sd-radio--checked .sd-radio__circle::after{background:var(--sd-radio-disabled-dot)}sd-radio-group{display:inline-block}sd-radio-group .sd-radio-group{display:flex}sd-radio-group .sd-radio-group--vertical{flex-direction:column;gap:8px}sd-radio-group .sd-radio-group--horizontal{flex-direction:row;align-items:center;gap:20px}`;
|
|
1043
|
+
|
|
1044
|
+
const SdRadioGroup = class {
|
|
1045
|
+
constructor(hostRef) {
|
|
1046
|
+
registerInstance(this, hostRef);
|
|
1047
|
+
this.change = createEvent(this, "sdUpdate", 7);
|
|
1048
|
+
}
|
|
1049
|
+
value;
|
|
1050
|
+
options = [];
|
|
1051
|
+
direction = 'vertical';
|
|
1052
|
+
disabled = false;
|
|
1053
|
+
groupName;
|
|
1054
|
+
change;
|
|
1055
|
+
valueChanged(newValue) {
|
|
1056
|
+
this.value = newValue;
|
|
1057
|
+
}
|
|
1058
|
+
handleRadioChange = (optionValue) => {
|
|
1059
|
+
if (this.disabled)
|
|
1060
|
+
return;
|
|
1061
|
+
const matched = this.options.find(o => String(o.value) === String(optionValue));
|
|
1062
|
+
const resolved = matched ? matched.value : optionValue;
|
|
1063
|
+
this.value = resolved;
|
|
1064
|
+
this.change?.emit(resolved);
|
|
1065
|
+
};
|
|
1066
|
+
getGroupClasses() {
|
|
1067
|
+
const classes = ['sd-radio-group', `sd-radio-group--${this.direction ?? 'vertical'}`];
|
|
1068
|
+
return classes.join(' ');
|
|
1069
|
+
}
|
|
1070
|
+
render() {
|
|
1071
|
+
return (h("div", { key: '464497f4968167f9a89e5abdd9f23e4567dc56b3', class: this.getGroupClasses(), role: "radiogroup" }, this.options.map(option => {
|
|
1072
|
+
return (h("sd-radio", { key: `radio-${option.value}`, val: String(option.value), value: String(this.value), label: option.label, disabled: this.disabled || !!option.disabled, onSdUpdate: ({ detail }) => this.handleRadioChange(detail) }));
|
|
1073
|
+
})));
|
|
1074
|
+
}
|
|
1075
|
+
static get watchers() { return {
|
|
1076
|
+
"value": [{
|
|
1077
|
+
"valueChanged": 0
|
|
1078
|
+
}]
|
|
1079
|
+
}; }
|
|
1080
|
+
};
|
|
1081
|
+
SdRadioGroup.style = sdRadioGroupCss();
|
|
1082
|
+
|
|
1083
|
+
const TEXTAREA_TOKENS = {
|
|
1084
|
+
paddingX: inputTokens.textinput.sm.paddingX,
|
|
1085
|
+
paddingY: inputTokens.textinput.sm.paddingY,
|
|
1086
|
+
radius: inputTokens.textinput.sm.radius,
|
|
1087
|
+
fontSize: inputTokens.textinput.sm.typography.fontSize,
|
|
1088
|
+
lineHeight: inputTokens.textinput.sm.typography.lineHeight,
|
|
1089
|
+
fontWeight: inputTokens.textinput.sm.typography.fontWeight};
|
|
1090
|
+
const TEXTAREA_COLORS = {
|
|
1091
|
+
text: inputTokens.textinput.text,
|
|
1092
|
+
bg: inputTokens.textinput.bg,
|
|
1093
|
+
border: inputTokens.textinput.border,
|
|
1094
|
+
resizer: inputTokens.textinput.resizer,
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1097
|
+
const sdTextareaCss = () => `sd-textarea{display:inline-flex}sd-textarea .sd-textarea__content{width:100%;display:flex}sd-textarea .sd-textarea__content .sd-textarea__native{width:100%;min-height:100px;border:none;outline:none;background:transparent;padding:var(--sd-textarea-padding-y) var(--sd-textarea-padding-x);font-family:inherit;font-size:var(--sd-textarea-font-size);line-height:var(--sd-textarea-line-height);font-weight:var(--sd-textarea-font-weight);color:var(--sd-textarea-text-color);resize:vertical}sd-textarea .sd-textarea__content .sd-textarea__native::placeholder{color:var(--sd-textarea-placeholder-color)}sd-textarea .sd-textarea__content .sd-textarea__native:disabled{cursor:not-allowed;color:var(--sd-textarea-disabled-color)}sd-textarea .sd-textarea__content .sd-textarea__native[readonly]{color:var(--sd-system-color-field-text-read-only)}`;
|
|
1098
|
+
|
|
1099
|
+
const SdTextarea = class {
|
|
1100
|
+
constructor(hostRef) {
|
|
1101
|
+
registerInstance(this, hostRef);
|
|
1102
|
+
this.input = createEvent(this, "sdUpdate", 7);
|
|
1103
|
+
this.focus = createEvent(this, "sdFocus", 7);
|
|
1104
|
+
this.blur = createEvent(this, "sdBlur", 7);
|
|
1105
|
+
}
|
|
1106
|
+
get host() { return getElement(this); }
|
|
1107
|
+
value = null;
|
|
1108
|
+
placeholder = '입력해 주세요.';
|
|
1109
|
+
disabled = false;
|
|
1110
|
+
readonly = false;
|
|
1111
|
+
autoFocus = false;
|
|
1112
|
+
textareaClass = '';
|
|
1113
|
+
textareaStyle = {};
|
|
1114
|
+
maxLength;
|
|
1115
|
+
rows;
|
|
1116
|
+
spellcheck = false;
|
|
1117
|
+
width = '';
|
|
1118
|
+
// props - sd-field
|
|
1119
|
+
label = '';
|
|
1120
|
+
labelWidth = '';
|
|
1121
|
+
addonLabel = '';
|
|
1122
|
+
addonAlign = 'start';
|
|
1123
|
+
hint = '';
|
|
1124
|
+
errorMessage = '';
|
|
1125
|
+
icon = undefined;
|
|
1126
|
+
labelTooltip = '';
|
|
1127
|
+
labelTooltipProps = null;
|
|
1128
|
+
rules = [];
|
|
1129
|
+
error = false;
|
|
1130
|
+
status;
|
|
1131
|
+
focused = false;
|
|
1132
|
+
hovered = false;
|
|
1133
|
+
internalValue = null;
|
|
1134
|
+
nativeEl = undefined;
|
|
1135
|
+
formField;
|
|
1136
|
+
name = nanoid();
|
|
1137
|
+
input;
|
|
1138
|
+
focus;
|
|
1139
|
+
blur;
|
|
1140
|
+
valueChanged(newValue) {
|
|
1141
|
+
this.internalValue = newValue;
|
|
1142
|
+
}
|
|
1143
|
+
internalValueChanged(newValue) {
|
|
1144
|
+
if (newValue !== this.value) {
|
|
1145
|
+
this.value = newValue;
|
|
1146
|
+
this.input?.emit(this.value);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
async sdGetNativeElement() {
|
|
1150
|
+
return this.nativeEl || null;
|
|
1151
|
+
}
|
|
1152
|
+
async sdValidate() {
|
|
1153
|
+
this.formField?.sdValidate();
|
|
1154
|
+
}
|
|
1155
|
+
async sdReset() {
|
|
1156
|
+
this.formField?.sdReset();
|
|
1157
|
+
}
|
|
1158
|
+
async sdResetValidate() {
|
|
1159
|
+
this.formField?.sdResetValidation();
|
|
1160
|
+
}
|
|
1161
|
+
async sdFocus() {
|
|
1162
|
+
this.formField?.sdFocus();
|
|
1163
|
+
}
|
|
1164
|
+
componentWillLoad() {
|
|
1165
|
+
if (this.value !== null && this.value !== undefined) {
|
|
1166
|
+
this.internalValue = this.value;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
componentDidLoad() {
|
|
1170
|
+
if (this.autoFocus) {
|
|
1171
|
+
this.nativeEl?.focus();
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
handleInput = (event) => {
|
|
1175
|
+
const target = event.target;
|
|
1176
|
+
this.internalValue = target.value;
|
|
1177
|
+
};
|
|
1178
|
+
handleFocus = async (type, event) => {
|
|
1179
|
+
this.focused = type === 'focus';
|
|
1180
|
+
if (type === 'blur') {
|
|
1181
|
+
if (this.rules && this.rules.length > 0) {
|
|
1182
|
+
await this.formField?.sdValidate();
|
|
1183
|
+
}
|
|
1184
|
+
this.blur?.emit(event);
|
|
1185
|
+
}
|
|
1186
|
+
else {
|
|
1187
|
+
this.focus?.emit(event);
|
|
1188
|
+
}
|
|
1189
|
+
};
|
|
1190
|
+
render() {
|
|
1191
|
+
const cssVars = {
|
|
1192
|
+
'--sd-textarea-font-size': `${TEXTAREA_TOKENS.fontSize}px`,
|
|
1193
|
+
'--sd-textarea-line-height': `${TEXTAREA_TOKENS.lineHeight}px`,
|
|
1194
|
+
'--sd-textarea-font-weight': TEXTAREA_TOKENS.fontWeight,
|
|
1195
|
+
'--sd-textarea-padding-x': `${TEXTAREA_TOKENS.paddingX}px`,
|
|
1196
|
+
'--sd-textarea-padding-y': `${TEXTAREA_TOKENS.paddingY}px`,
|
|
1197
|
+
'--sd-textarea-radius': `${TEXTAREA_TOKENS.radius}px`,
|
|
1198
|
+
'--sd-textarea-text-color': TEXTAREA_COLORS.text.default,
|
|
1199
|
+
'--sd-textarea-placeholder-color': TEXTAREA_COLORS.text.placeholder,
|
|
1200
|
+
'--sd-textarea-disabled-color': TEXTAREA_COLORS.text.disabled,
|
|
1201
|
+
'--sd-textarea-bg-color': TEXTAREA_COLORS.bg.default,
|
|
1202
|
+
'--sd-textarea-disabled-bg-color': TEXTAREA_COLORS.bg.disabled,
|
|
1203
|
+
'--sd-textarea-border-color': TEXTAREA_COLORS.border.default,
|
|
1204
|
+
'--sd-textarea-resizer-color': TEXTAREA_COLORS.resizer.color,
|
|
1205
|
+
// sd-field 시스템 변수 override (textarea는 고정 높이가 아닌 auto)
|
|
1206
|
+
'--sd-system-size-field-sm-height': 'auto',
|
|
1207
|
+
'--sd-system-radius-field-sm': `${TEXTAREA_TOKENS.radius}px`,
|
|
1208
|
+
};
|
|
1209
|
+
return (h("sd-field", { key: '3c5bd837d531d12fb0c7c4a80845752f9708f633', name: this.name, label: this.label, labelWidth: this.labelWidth, addonLabel: this.addonLabel, addonAlign: this.addonAlign, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, readonly: this.readonly, focused: this.focused, hovered: this.hovered, status: this.status, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, h("div", { key: '4bc1c0dad520d30f6758c057eecb25027aaa6615', class: "sd-textarea__content" }, h("textarea", { key: 'cfe1004e8d765bd047f72642eb03b239059d7234', name: this.name, ref: el => (this.nativeEl = el), class: `sd-textarea__native ${this.textareaClass}`, value: this.internalValue || '', placeholder: this.placeholder ?? '입력해 주세요.', disabled: this.disabled, readOnly: this.readonly, autofocus: this.autoFocus, maxLength: this.maxLength, rows: this.rows, spellcheck: this.spellcheck, onInput: this.handleInput, onFocus: event => this.handleFocus('focus', event), onBlur: event => this.handleFocus('blur', event), style: this.textareaStyle }))));
|
|
1210
|
+
}
|
|
1211
|
+
static get watchers() { return {
|
|
1212
|
+
"value": [{
|
|
1213
|
+
"valueChanged": 0
|
|
1214
|
+
}],
|
|
1215
|
+
"internalValue": [{
|
|
1216
|
+
"internalValueChanged": 0
|
|
1217
|
+
}]
|
|
1218
|
+
}; }
|
|
1219
|
+
};
|
|
1220
|
+
SdTextarea.style = sdTextareaCss();
|
|
1221
|
+
|
|
1222
|
+
export { SdDatePicker as sd_date_picker, SdDateRangePicker as sd_date_range_picker, SdFilePicker as sd_file_picker, SdInput as sd_input, SdNumberInput as sd_number_input, SdRadioGroup as sd_radio_group, SdTextarea as sd_textarea };
|