@sellmate/design-system 1.5.0 → 1.6.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-qOFez3z3.js → component.table-DIxmbGBT.js} +4 -1
- package/dist/cjs/design-system.cjs.js +2 -2
- package/dist/cjs/{index-Cw-78mnC.js → index-BGwB03Tk.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sd-action-modal.cjs.entry.js +1 -1
- package/dist/cjs/sd-badge.cjs.entry.js +1 -1
- package/dist/cjs/sd-barcode-input.cjs.entry.js +1 -1
- package/dist/cjs/{sd-button.config-DH08UNfl.js → sd-button.config-BSHkfgdC.js} +17 -12
- package/dist/cjs/sd-button_2.cjs.entry.js +2 -2
- package/dist/cjs/sd-calendar_2.cjs.entry.js +1 -1
- package/dist/cjs/sd-callout.cjs.entry.js +1 -1
- package/dist/cjs/sd-card.cjs.entry.js +1 -1
- package/dist/cjs/sd-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/sd-chip.cjs.entry.js +1 -1
- package/dist/cjs/sd-circle-progress.cjs.entry.js +2 -2
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +2 -2
- package/dist/cjs/sd-date-box.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-picker_7.cjs.entry.js +11 -8
- package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +1 -1
- package/dist/cjs/sd-divider.cjs.entry.js +27 -0
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +47 -22
- package/dist/cjs/sd-field_3.cjs.entry.js +5 -5
- package/dist/cjs/sd-form.cjs.entry.js +1 -1
- package/dist/cjs/sd-ghost-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-guide.cjs.entry.js +2 -2
- package/dist/cjs/sd-key-value-table.cjs.entry.js +3 -3
- 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_4.cjs.entry.js +31 -51
- package/dist/cjs/sd-popover.cjs.entry.js +5 -6
- package/dist/cjs/sd-popup.cjs.entry.js +3 -3
- package/dist/cjs/sd-portal.cjs.entry.js +1 -1
- package/dist/cjs/sd-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-radio.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-list-item_2.cjs.entry.js +7 -7
- package/dist/cjs/sd-select_3.cjs.entry.js +9 -9
- package/dist/cjs/sd-switch.cjs.entry.js +2 -2
- package/dist/cjs/sd-table.cjs.entry.js +15 -49
- package/dist/cjs/{sd-table.config-DqgNOdXO.js → sd-table.config-BjJW74Zx.js} +7 -3
- package/dist/cjs/sd-tabs.cjs.entry.js +2 -2
- package/dist/cjs/sd-tag.cjs.entry.js +1 -1
- package/dist/cjs/sd-td.cjs.entry.js +2 -2
- package/dist/cjs/sd-text-link.cjs.entry.js +1 -1
- package/dist/cjs/sd-toast-container.cjs.entry.js +2 -2
- package/dist/cjs/sd-toast.cjs.entry.js +3 -3
- package/dist/cjs/sd-toggle.cjs.entry.js +2 -2
- package/dist/cjs/{system-wrt-tcOq.js → system-CdAyz3ej.js} +3 -0
- package/dist/cjs/{tooltipArrow-BjSFKIUq.js → tooltipArrow-COD-SNZL.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/sd-divider/sd-divider.config.js +4 -0
- package/dist/collection/components/sd-divider/sd-divider.css +25 -0
- package/dist/collection/components/sd-divider/sd-divider.js +47 -0
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.config.js +3 -3
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.css +29 -10
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +74 -15
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
- package/dist/collection/components/sd-input/sd-input.js +2 -2
- 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 +1 -1
- package/dist/collection/components/sd-number-input/sd-number-input.js +75 -4
- package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
- package/dist/collection/components/sd-popover/sd-popover.js +3 -24
- package/dist/collection/components/sd-popup/sd-popup.js +1 -1
- 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.js +4 -4
- package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +2 -2
- package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
- package/dist/collection/components/sd-select/sd-select.js +4 -4
- package/dist/collection/components/sd-switch/sd-switch.js +1 -1
- package/dist/collection/components/sd-table/sd-table.config.js +4 -1
- package/dist/collection/components/sd-table/sd-table.css +1 -1
- package/dist/collection/components/sd-table/sd-table.js +17 -51
- 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.css +15 -5
- package/dist/collection/components/sd-table/sd-thead/sd-thead.js +6 -5
- package/dist/collection/components/sd-table/sd-tr/sd-tr.css +6 -7
- package/dist/collection/components/sd-table/sd-tr/sd-tr.js +20 -40
- package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
- package/dist/collection/components/sd-textarea/sd-textarea.js +1 -1
- package/dist/collection/components/sd-toast/sd-toast.js +2 -2
- package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
- package/dist/components/index.js +1 -1
- package/dist/components/{p-CJ-QHG0F.js → p-2aQ4cVXp.js} +1 -1
- package/dist/components/{p-fpzgqVv1.js → p-BCeq6-MU.js} +1 -1
- package/dist/components/{p-wOAxmZ1V.js → p-BDJJQALT.js} +1 -1
- package/dist/components/p-BE-21GLH.js +1 -0
- package/dist/components/{p-C54v30vB.js → p-BNUsawW7.js} +1 -1
- package/dist/components/{p-BZCvsLRf.js → p-BUW6I_d5.js} +1 -1
- package/dist/components/{p-FKKk7Bk8.js → p-BYRvYsiC.js} +1 -1
- package/dist/components/{p-IThoLpLs.js → p-BYU3wOaN.js} +1 -1
- package/dist/components/{p-Cvk-Luhs.js → p-BZRMoE3E.js} +1 -1
- package/dist/components/{p-DmaopssQ.js → p-B_2U9h3P.js} +1 -1
- package/dist/{design-system/p-C29HUShl.js → components/p-BasCjDiE.js} +1 -1
- package/dist/components/p-BqYASycS.js +1 -0
- package/dist/components/{p-VuxN5d2D.js → p-CAP-9lnL.js} +1 -1
- package/dist/components/{p-Co3H5873.js → p-CARYLqH9.js} +1 -1
- package/dist/components/{p-BZabVWBD.js → p-CJRGLvgC.js} +1 -1
- package/dist/components/{p-m_OtjUs1.js → p-CK6jFkqR.js} +1 -1
- package/dist/components/{p-DrrsZftV.js → p-CRq8zgt_.js} +1 -1
- package/dist/components/{p-BqrZA_Nl.js → p-CSbyXQa9.js} +1 -1
- package/dist/components/p-CvfW21oo.js +1 -0
- package/dist/components/{p-BGb86o0p.js → p-CwQTEZWO.js} +1 -1
- package/dist/components/{p-BSQsJHnV.js → p-Cye8r1MG.js} +1 -1
- package/dist/components/{p-J3eT660D.js → p-D4mjSR0u.js} +1 -1
- package/dist/components/{p-DQFHAKL_.js → p-D6GUzecR.js} +1 -1
- package/dist/components/p-DGyTYauz.js +1 -0
- package/dist/components/{p-BLhu2So8.js → p-DP0Dp12H.js} +1 -1
- package/dist/components/{p-BSfu4DO2.js → p-DQj-S8AC.js} +1 -1
- package/dist/components/{p-uHITnW_J.js → p-DSIM5Mkt.js} +1 -1
- package/dist/components/{p-DeK3og10.js → p-DZ_3ZYMC.js} +1 -1
- package/dist/components/{p-D7nYP2a4.js → p-DfKa36bs.js} +1 -1
- package/dist/components/p-DoREs-rv.js +1 -0
- package/dist/components/{p-DyZNk1VT.js → p-Dwko_Bx3.js} +1 -1
- package/dist/components/{p-AO2RGdjH.js → p-EcuI_UmK.js} +1 -1
- package/dist/components/p-_zllPZMm.js +1 -0
- package/dist/components/p-j2khhcHY.js +1 -0
- package/dist/components/{p-D5inekTL.js → p-lOVBaLB7.js} +1 -1
- package/dist/components/{p-CbXb6ylI.js → p-pTx5xpqU.js} +1 -1
- package/dist/components/p-pwNG5WaX.js +1 -0
- package/dist/components/{p-yH47DvUh.js → p-sRzhIrJR.js} +1 -1
- package/dist/components/{p-CgYjGJEh.js → p-uVZjhyvS.js} +1 -1
- package/dist/components/{p-B3sb3aIX.js → p-z564gmGG.js} +1 -1
- 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-callout.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-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-divider.d.ts +11 -0
- package/dist/components/sd-divider.js +1 -0
- 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.js +1 -1
- 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-popup.js +1 -1
- 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/{p-819e28fe.entry.js → p-07b0d118.entry.js} +1 -1
- package/dist/design-system/{p-d39e515d.entry.js → p-0964c79a.entry.js} +1 -1
- package/dist/design-system/{p-eae21a79.entry.js → p-1219699a.entry.js} +1 -1
- package/dist/design-system/{p-b868d747.entry.js → p-1743651a.entry.js} +1 -1
- package/dist/design-system/{p-435ae69e.entry.js → p-17883b40.entry.js} +1 -1
- package/dist/design-system/p-18057222.entry.js +1 -0
- package/dist/design-system/{p-0894c492.entry.js → p-18d3ae55.entry.js} +1 -1
- package/dist/design-system/{p-3f4a281f.entry.js → p-1aafbc7b.entry.js} +1 -1
- package/dist/design-system/{p-4473c051.entry.js → p-20a2e0d2.entry.js} +1 -1
- package/dist/design-system/{p-399d416c.entry.js → p-25fad267.entry.js} +1 -1
- package/dist/design-system/{p-c3e4853c.entry.js → p-2c0a8333.entry.js} +1 -1
- package/dist/design-system/p-3a848c36.entry.js +1 -0
- package/dist/design-system/{p-b8e34533.entry.js → p-4b43648c.entry.js} +1 -1
- package/dist/design-system/{p-843d4b16.entry.js → p-4bd9f005.entry.js} +1 -1
- package/dist/design-system/{p-61f4238b.entry.js → p-4cf1c8ae.entry.js} +1 -1
- package/dist/design-system/{p-9681b0ba.entry.js → p-521e5d2e.entry.js} +1 -1
- package/dist/design-system/p-54086285.entry.js +1 -0
- package/dist/design-system/{p-aeccfb2b.entry.js → p-696764b0.entry.js} +1 -1
- package/dist/design-system/{p-795bae4c.entry.js → p-70f47e43.entry.js} +1 -1
- package/dist/design-system/{p-c7099e9e.entry.js → p-733aa107.entry.js} +1 -1
- package/dist/design-system/{p-352c68ae.entry.js → p-7444d475.entry.js} +1 -1
- package/dist/design-system/{p-03badf68.entry.js → p-840f592d.entry.js} +1 -1
- package/dist/design-system/{p-d3cc8538.entry.js → p-8d2815cf.entry.js} +1 -1
- package/dist/design-system/{p-9404ab06.entry.js → p-8fc49d2d.entry.js} +1 -1
- package/dist/design-system/{p-aac84d22.entry.js → p-95bbba4f.entry.js} +1 -1
- package/dist/design-system/p-969665c0.entry.js +1 -0
- package/dist/design-system/{p-fa670cc4.entry.js → p-97b405aa.entry.js} +1 -1
- package/dist/design-system/p-C7p6g_sM.js +1 -0
- package/dist/design-system/{p-DQFHAKL_.js → p-D6GUzecR.js} +1 -1
- package/dist/design-system/p-DGyTYauz.js +1 -0
- package/dist/design-system/p-DNWwGHho.js +2 -0
- package/dist/design-system/p-LIf7YMBN.js +1 -0
- package/dist/design-system/{p-1e530c87.entry.js → p-a5930cbd.entry.js} +1 -1
- package/dist/design-system/{p-2bdceecb.entry.js → p-a6c9baa5.entry.js} +1 -1
- package/dist/design-system/{p-4a91875c.entry.js → p-afdca5bb.entry.js} +1 -1
- package/dist/design-system/{p-00b2c850.entry.js → p-b08ca29b.entry.js} +1 -1
- package/dist/design-system/p-c5c4a66b.entry.js +1 -0
- package/dist/design-system/p-c73cadc7.entry.js +1 -0
- package/dist/design-system/{p-679bce6c.entry.js → p-d8292621.entry.js} +1 -1
- package/dist/design-system/{p-339cb954.entry.js → p-deec1ef0.entry.js} +1 -1
- package/dist/design-system/{p-d226bd61.entry.js → p-e6bd8ab1.entry.js} +1 -1
- package/dist/design-system/{p-e902a3f4.entry.js → p-e9079238.entry.js} +1 -1
- package/dist/design-system/{p-14e30f67.entry.js → p-ea17a361.entry.js} +1 -1
- package/dist/design-system/{p-a71d4947.entry.js → p-eef5f8d7.entry.js} +1 -1
- package/dist/design-system/{p-8ee990bd.entry.js → p-f97b75d3.entry.js} +1 -1
- package/dist/design-system/{p-06a6798d.entry.js → p-ff33d019.entry.js} +1 -1
- package/dist/design-system/p-j2khhcHY.js +1 -0
- package/dist/esm/{component.table-DQFHAKL_.js → component.table-D6GUzecR.js} +4 -1
- package/dist/esm/design-system.js +3 -3
- package/dist/esm/{index-0U6dRjlq.js → index-DNWwGHho.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/sd-action-modal.entry.js +1 -1
- package/dist/esm/sd-badge.entry.js +1 -1
- package/dist/esm/sd-barcode-input.entry.js +1 -1
- package/dist/esm/{sd-button.config-BDjErF_K.js → sd-button.config-C7p6g_sM.js} +17 -12
- package/dist/esm/sd-button_2.entry.js +2 -2
- package/dist/esm/sd-calendar_2.entry.js +1 -1
- package/dist/esm/sd-callout.entry.js +1 -1
- package/dist/esm/sd-card.entry.js +1 -1
- package/dist/esm/sd-checkbox.entry.js +1 -1
- package/dist/esm/sd-chip.entry.js +1 -1
- package/dist/esm/sd-circle-progress.entry.js +2 -2
- package/dist/esm/sd-confirm-modal_2.entry.js +2 -2
- package/dist/esm/sd-date-box.entry.js +1 -1
- package/dist/esm/sd-date-picker_7.entry.js +11 -8
- package/dist/esm/sd-date-range-picker-calendar.entry.js +1 -1
- package/dist/esm/sd-divider.entry.js +25 -0
- package/dist/esm/sd-dropdown-button.entry.js +47 -22
- package/dist/esm/sd-field_3.entry.js +5 -5
- package/dist/esm/sd-form.entry.js +1 -1
- package/dist/esm/sd-ghost-button.entry.js +1 -1
- package/dist/esm/sd-guide.entry.js +2 -2
- package/dist/esm/sd-key-value-table.entry.js +3 -3
- 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_4.entry.js +31 -51
- package/dist/esm/sd-popover.entry.js +5 -6
- package/dist/esm/sd-popup.entry.js +3 -3
- package/dist/esm/sd-portal.entry.js +1 -1
- package/dist/esm/sd-radio-button.entry.js +1 -1
- package/dist/esm/sd-radio.entry.js +1 -1
- package/dist/esm/sd-select-list-item_2.entry.js +7 -7
- package/dist/esm/sd-select_3.entry.js +9 -9
- package/dist/esm/sd-switch.entry.js +2 -2
- package/dist/esm/{sd-table.config-CFHtQ8LX.js → sd-table.config-D9meRqTx.js} +7 -4
- package/dist/esm/sd-table.entry.js +15 -49
- package/dist/esm/sd-tabs.entry.js +2 -2
- package/dist/esm/sd-tag.entry.js +1 -1
- package/dist/esm/sd-td.entry.js +2 -2
- package/dist/esm/sd-text-link.entry.js +1 -1
- package/dist/esm/sd-toast-container.entry.js +2 -2
- package/dist/esm/sd-toast.entry.js +3 -3
- package/dist/esm/sd-toggle.entry.js +2 -2
- package/dist/esm/{system-DGlmvjGc.js → system-j2khhcHY.js} +3 -0
- package/dist/esm/{tooltipArrow-O5LOsHae.js → tooltipArrow-Cj3AqWK0.js} +1 -1
- package/dist/types/components/sd-divider/sd-divider.config.d.ts +3 -0
- package/dist/types/components/sd-divider/sd-divider.d.ts +5 -0
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.d.ts +5 -0
- package/dist/types/components/sd-number-input/sd-number-input.d.ts +4 -0
- package/dist/types/components/sd-popover/sd-popover.d.ts +0 -1
- package/dist/types/components/sd-table/sd-table.config.d.ts +2 -0
- package/dist/types/components/sd-table/sd-table.d.ts +1 -6
- package/dist/types/components/sd-table/sd-tr/sd-tr.d.ts +1 -5
- package/dist/types/components.d.ts +80 -21
- package/hydrate/index.js +192 -170
- package/hydrate/index.mjs +192 -170
- package/package.json +1 -1
- package/dist/components/p-BjkROjjt.js +0 -1
- package/dist/components/p-DChOBMCc.js +0 -1
- package/dist/components/p-DGlmvjGc.js +0 -1
- package/dist/components/p-DUcbofDO.js +0 -1
- package/dist/components/p-DZbc1mgp.js +0 -1
- package/dist/components/p-DdLntfiw.js +0 -1
- package/dist/components/p-DhTcn6jX.js +0 -1
- package/dist/components/p-HK6Bwtz8.js +0 -1
- package/dist/components/p-iCuIUhaK.js +0 -1
- package/dist/design-system/p-0U6dRjlq.js +0 -2
- package/dist/design-system/p-3d61e68f.entry.js +0 -1
- package/dist/design-system/p-40bdbe5a.entry.js +0 -1
- package/dist/design-system/p-786c72e9.entry.js +0 -1
- package/dist/design-system/p-78de36f2.entry.js +0 -1
- package/dist/design-system/p-92f368a2.entry.js +0 -1
- package/dist/design-system/p-BDjErF_K.js +0 -1
- package/dist/design-system/p-DGlmvjGc.js +0 -1
- package/dist/design-system/p-DZbc1mgp.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as a,h as d}from"./p-0U6dRjlq.js";import{u as r,t as n,W as t,C as i}from"./p-BGtUaScP.js";import{a as l,D as s}from"./p-TF8_Lyhq.js";import"./p-BQn6le_Y.js";const c=class{constructor(d){e(this,d),this.update=a(this,"sdUpdate",7),this.viewChange=a(this,"sdViewChange",7)}value=null;selectable;events;elevated=!1;currentYear;currentMonth;update;viewChange;dateUtil=r();_eventMapCache;get eventMap(){const e=this._eventMapCache;if(e&&e.src===this.events)return e.map;const a=new Map;return(this.events??[]).forEach((e=>e.dates.forEach((d=>{const r=a.get(d)??[];r.push({color:e.color,label:e.label}),a.set(d,r)})))),this._eventMapCache={src:this.events,map:a},a}get legendItems(){const e=new Set,a=[];return(this.events??[]).forEach((d=>{const r=`${d.color}|${d.label}`;e.has(r)||(e.add(r),a.push({color:d.color,label:d.label}))})),a}componentWillLoad(){this.syncViewFromValue()}handleValueChange(){this.syncViewFromValue()}syncViewFromValue(){const e=this.value||n,[a,d]=e.split("-").map(Number);this.currentYear=a,this.currentMonth=d}formatDate(e,a,d){return`${e}-${String(a).padStart(2,"0")}-${String(d).padStart(2,"0")}`}get cells(){const e=this.currentYear,a=this.currentMonth,d=new Date(e,a-1,1).getDay(),r=new Date(e,a,0).getDate(),n=1===a?12:a-1,t=1===a?e-1:e,i=new Date(t,n,0).getDate(),l=12===a?1:a+1,s=12===a?e+1:e,c=[];for(let e=d-1;e>=0;e--){const a=i-e;c.push({date:this.formatDate(t,n,a),day:a,inCurrentMonth:!1})}for(let d=1;d<=r;d++)c.push({date:this.formatDate(e,a,d),day:d,inCurrentMonth:!0});const o=(7-c.length%7)%7;for(let e=1;e<=o;e++)c.push({date:this.formatDate(s,l,e),day:e,inCurrentMonth:!1});return c}emitViewChange(){this.viewChange.emit({year:this.currentYear,month:this.currentMonth})}goPrevYear=e=>{e.stopPropagation(),this.currentYear-=1,this.emitViewChange()};goNextYear=e=>{e.stopPropagation(),this.currentYear+=1,this.emitViewChange()};goPrevMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"prev");this.currentYear=a,this.currentMonth=d,this.emitViewChange()};goNextMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"next");this.currentYear=a,this.currentMonth=d,this.emitViewChange()};isDisabled(e){if(!this.selectable)return!1;const[a,d]=this.selectable;return""!==a&&e<a||""!==d&&e>d}handleDayClick(e){this.isDisabled(e.date)||(this.value=e.date,this.update.emit(e.date))}render(){const e={"--calendar-bg":i.bg,"--calendar-padding":`${i.paddingXY}px`,"--calendar-gap":`${i.gap}px`,"--calendar-radius":`${i.radius}px`,"--calendar-header-gap":`${i.header.gap}px`,"--calendar-header-divider":i.header.divider,"--calendar-header-font-size":`${i.header.fontSize}px`,"--calendar-header-line-height":`${i.header.lineHeight}px`,"--calendar-header-font-weight":i.header.fontWeight,"--calendar-week-font-size":`${i.week.fontSize}px`,"--calendar-week-line-height":`${i.week.lineHeight}px`,"--calendar-week-font-weight":i.week.fontWeight,"--calendar-week-color":i.week.color,"--calendar-grid-row-gap":`${i.grid.rowGap}px`,"--calendar-day-size":`${i.day.size}px`,"--calendar-day-circle-size":`${i.day.circleSize}px`,"--calendar-day-circle-radius":`${i.day.circleRadius}px`,"--calendar-day-text":i.day.defaultText,"--calendar-day-hover-text":i.day.hoverText,"--calendar-day-hover-border":i.day.hoverBorder,"--calendar-day-select-bg":i.day.selectBg,"--calendar-day-select-text":i.day.selectText,"--calendar-day-disabled-text":i.day.disabledText,"--calendar-day-font-size":`${i.day.fontSize}px`,"--calendar-day-line-height":`${i.day.lineHeight}px`,"--calendar-day-font-weight":i.day.fontWeight,"--calendar-day-bold-font-weight":i.day.boldFontWeight,"--calendar-day-dot-size":`${i.day.dot.size}px`,"--calendar-day-dot-gap":`${i.day.dot.gap}px`,"--calendar-day-dot-padding-y":`${i.day.dot.paddingY}px`,"--calendar-legend-font-size":`${i.legend.fontSize}px`,"--calendar-legend-line-height":`${i.legend.lineHeight}px`,"--calendar-legend-font-weight":i.legend.fontWeight,"--calendar-legend-gap":`${i.legend.gap}px`,"--calendar-legend-group-gap":`${i.legend.groupGap}px`},a=this.eventMap,r=this.legendItems,l=(this.events?.length??0)>0;return d("div",{key:"0ed0317b3cecffea4015de8688888e0ab2a38586",class:{"sd-calendar":!0,"sd-calendar--elevated":this.elevated},style:e},d("div",{key:"b915f275a31617711d06d98c8a4d9369ddd36af5",class:"sd-calendar__header"},d("div",{key:"cd3b625e4e26af4b11f6af8b22c02099e8ab68a5",class:"sd-calendar__nav-group"},d("sd-ghost-button",{key:"e0ebfed48a7fdb61fd082371e7247176c02a8fb1",ariaLabel:"prevYear",size:"xxs",icon:"chevronLeft",onClick:this.goPrevYear}),d("span",{key:"6bfebc94dce54ca472ad5b3e03a7630e32676c3f",class:"sd-calendar__label"},this.currentYear),d("sd-ghost-button",{key:"2e42ad52cd7d1b5d3502d578347c997910f3efc3",ariaLabel:"nextYear",size:"xxs",icon:"chevronRight",onClick:this.goNextYear})),d("span",{key:"95be4ab5e03d7378e82006221f190ffd55659cf1",class:"sd-calendar__divider","aria-hidden":"true"}),d("div",{key:"edce7cf91a873cdaeed68e50372bdfa20af7507d",class:"sd-calendar__nav-group sd-calendar__nav-group-month"},d("sd-ghost-button",{key:"9ba274e9db32177d30d8c218303384855b7a3f60",ariaLabel:"prevMonth",size:"xxs",icon:"chevronLeft",onClick:this.goPrevMonth}),d("span",{key:"bc113063e769fe12c2a39732cd82060752b7d9eb",class:"sd-calendar__label sd-calendar__label-month"},this.currentMonth,"월"),d("sd-ghost-button",{key:"52cfde203e06334c5eee85abc9d82d6889bf511c",ariaLabel:"nextMonth",size:"xxs",icon:"chevronRight",onClick:this.goNextMonth}))),d("div",{key:"9ae80aee03a4e6392a1d9a4ef28e565db20faea3",class:"sd-calendar__week"},t.map((e=>d("span",{key:e,class:"sd-calendar__week-cell"},e)))),d("div",{key:"7c47907311ea24f1af030931b8efd11955e55436",class:"sd-calendar__grid"},this.cells.map((e=>{const r=e.inCurrentMonth&&""!==this.value&&this.value===e.date,t=e.inCurrentMonth&&n===e.date,i=e.inCurrentMonth&&this.isDisabled(e.date),s=e.inCurrentMonth?a.get(e.date):void 0;return d("button",{type:"button",key:e.date,class:{"sd-calendar__day":!0,"sd-calendar__day--empty":!e.inCurrentMonth,"sd-calendar__day--today":t,"sd-calendar__day--selected":r,"sd-calendar__day--disabled":i},disabled:!e.inCurrentMonth||i,tabindex:e.inCurrentMonth?void 0:-1,"aria-hidden":e.inCurrentMonth?void 0:"true",onClick:()=>e.inCurrentMonth&&this.handleDayClick(e)},d("span",{class:"sd-calendar__day-circle"},e.inCurrentMonth?e.day:""),l&&d("span",{class:"sd-calendar__dot-row","aria-hidden":"true"},s?.map(((e,a)=>d("span",{key:`${e.color}|${e.label}|${a}`,class:"sd-calendar__dot",style:{backgroundColor:e.color}})))))}))),r.length>0&&[d("span",{key:"4ba064cad3188db8342f51ca017e4bf5af8aa460",class:"sd-calendar__divider-bottom","aria-hidden":"true"}),d("div",{key:"ac132a1f1f948e618ee75d4c01a1c99a0dfc2c0a",class:"sd-calendar__legend"},r.map((e=>d("span",{key:`${e.color}|${e.label}`,class:"sd-calendar__legend-item"},d("span",{class:"sd-calendar__legend-dot",style:{backgroundColor:e.color},"aria-hidden":"true"}),d("span",{class:"sd-calendar__legend-label"},e.label)))))])}static get watchers(){return{value:[{handleValueChange:0}]}}};c.style="sd-calendar{display:block}sd-calendar .sd-calendar{display:flex;flex-direction:column;gap:var(--calendar-gap);width:328px;min-height:328px;padding:var(--calendar-padding);background:var(--calendar-bg);border-radius:var(--calendar-radius);user-select:none}sd-calendar .sd-calendar--elevated{box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}sd-calendar .sd-calendar__header{display:flex;align-items:center;justify-content:center;gap:var(--calendar-header-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__nav-group{display:inline-flex;align-items:center;gap:var(--calendar-gap)}sd-calendar .sd-calendar__nav-group-month{width:100%}sd-calendar .sd-calendar__label{display:inline-flex;align-items:center;justify-content:center;min-width:40px;text-align:center}sd-calendar .sd-calendar__label-month{width:100%}sd-calendar .sd-calendar__divider{display:inline-block;width:1px;height:16px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__week{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size))}sd-calendar .sd-calendar__week-cell{display:inline-flex;align-items:center;justify-content:center;height:20px;font-size:var(--calendar-week-font-size);line-height:var(--calendar-week-line-height);font-weight:var(--calendar-week-font-weight);color:var(--calendar-week-color)}sd-calendar .sd-calendar__grid{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size));row-gap:var(--calendar-grid-row-gap)}sd-calendar .sd-calendar__day{display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-start;width:var(--calendar-day-size);min-height:var(--calendar-day-circle-size);padding:0;border:none;background:transparent;cursor:pointer;font-size:var(--calendar-day-font-size);line-height:var(--calendar-day-line-height);font-weight:var(--calendar-day-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__day-circle{display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-circle-size);height:var(--calendar-day-circle-size);border-radius:calc(var(--calendar-day-circle-radius) * 1px);border:1px solid transparent;box-sizing:border-box}sd-calendar .sd-calendar__day:not(:disabled):hover .sd-calendar__day-circle{border-radius:16px;border:1px solid var(--calendar-day-hover-border)}sd-calendar .sd-calendar__day--today .sd-calendar__day-circle{font-weight:700}sd-calendar .sd-calendar__day--selected .sd-calendar__day-circle{border-radius:16px;background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--selected:not(:disabled):hover .sd-calendar__day-circle{background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--disabled{color:var(--calendar-day-disabled-text);background:none !important;cursor:not-allowed}sd-calendar .sd-calendar__day--empty{visibility:hidden;pointer-events:none}sd-calendar .sd-calendar__dot-row{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--calendar-day-dot-gap);box-sizing:border-box;width:100%;min-height:14px;padding-top:var(--calendar-day-dot-padding-y);padding-bottom:var(--calendar-day-dot-padding-y)}sd-calendar .sd-calendar__dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%}sd-calendar .sd-calendar__divider-bottom{display:block;width:100%;height:1px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__legend{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;column-gap:var(--calendar-legend-group-gap);row-gap:4px;font-size:var(--calendar-legend-font-size);line-height:var(--calendar-legend-line-height);font-weight:var(--calendar-legend-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__legend-item{display:inline-flex;align-items:center;gap:var(--calendar-legend-gap)}sd-calendar .sd-calendar__legend-dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%;flex-shrink:0}sd-calendar .sd-calendar__legend-label{display:inline-block}";const o=class{constructor(d){e(this,d),this.triggerClick=a(this,"sdTriggerClick",7)}displayText="";placeholder="YYYY-MM-DD";disabled=!1;size="sm";triggerClick;handleClick=()=>{this.disabled||this.triggerClick.emit()};render(){const e=l[this.size]??l.sm,a=""!==this.displayText;return d("div",{key:"df53dd75ead71167d7089daab5718c7ff1c990ae",role:"button",tabindex:this.disabled?-1:0,class:{"sd-date-picker-trigger":!0,"sd-date-picker-trigger--disabled":this.disabled},style:{"--trigger-padding-x":`${e.paddingX}px`,"--trigger-gap":`${e.gap}px`,"--trigger-icon-size":`${e.iconSize}px`,"--trigger-font-size":`${e.fontSize}px`,"--trigger-line-height":`${e.lineHeight}px`,"--trigger-font-weight":e.fontWeight,"--trigger-radius":`${e.radius}px`,"--trigger-text-min-width":("md"===this.size?104:80)+"px","--trigger-text-color":this.disabled?s.text.disabled:a?s.text.default:s.text.hint,"--trigger-icon-color":this.disabled?s.icon.disabled:s.icon.default},onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())}},d("sd-icon",{key:"76f41c99e1695eaa191cbc81ae057e65cb78e955",name:"date",size:Number(e.iconSize),color:"var(--trigger-icon-color)",class:"sd-date-picker-trigger__icon"}),d("span",{key:"4e1a4b2b41737f05dc1a4e642d317f5fc93bf9b2",class:"sd-date-picker-trigger__text"},a?this.displayText:this.placeholder))}};o.style="sd-date-picker-trigger{display:block;width:100%;height:100%}sd-date-picker-trigger .sd-date-picker-trigger{display:flex;align-items:center;gap:var(--trigger-gap);width:100%;height:100%;padding:0 var(--trigger-padding-x);cursor:pointer;user-select:none;overflow:hidden;border-radius:var(--trigger-radius)}sd-date-picker-trigger .sd-date-picker-trigger--disabled{cursor:not-allowed}sd-date-picker-trigger .sd-date-picker-trigger__icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}sd-date-picker-trigger .sd-date-picker-trigger__text{flex:1;min-width:var(--trigger-text-min-width, 80px);font-size:var(--trigger-font-size);line-height:var(--trigger-line-height);font-weight:var(--trigger-font-weight);color:var(--trigger-text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}";export{c as sd_calendar,o as sd_date_picker_trigger}
|
|
1
|
+
import{r as e,c as a,h as d}from"./p-DNWwGHho.js";import{u as r,t as n,W as t,C as i}from"./p-BGtUaScP.js";import{a as l,D as s}from"./p-TF8_Lyhq.js";import"./p-BQn6le_Y.js";const c=class{constructor(d){e(this,d),this.update=a(this,"sdUpdate",7),this.viewChange=a(this,"sdViewChange",7)}value=null;selectable;events;elevated=!1;currentYear;currentMonth;update;viewChange;dateUtil=r();_eventMapCache;get eventMap(){const e=this._eventMapCache;if(e&&e.src===this.events)return e.map;const a=new Map;return(this.events??[]).forEach((e=>e.dates.forEach((d=>{const r=a.get(d)??[];r.push({color:e.color,label:e.label}),a.set(d,r)})))),this._eventMapCache={src:this.events,map:a},a}get legendItems(){const e=new Set,a=[];return(this.events??[]).forEach((d=>{const r=`${d.color}|${d.label}`;e.has(r)||(e.add(r),a.push({color:d.color,label:d.label}))})),a}componentWillLoad(){this.syncViewFromValue()}handleValueChange(){this.syncViewFromValue()}syncViewFromValue(){const e=this.value||n,[a,d]=e.split("-").map(Number);this.currentYear=a,this.currentMonth=d}formatDate(e,a,d){return`${e}-${String(a).padStart(2,"0")}-${String(d).padStart(2,"0")}`}get cells(){const e=this.currentYear,a=this.currentMonth,d=new Date(e,a-1,1).getDay(),r=new Date(e,a,0).getDate(),n=1===a?12:a-1,t=1===a?e-1:e,i=new Date(t,n,0).getDate(),l=12===a?1:a+1,s=12===a?e+1:e,c=[];for(let e=d-1;e>=0;e--){const a=i-e;c.push({date:this.formatDate(t,n,a),day:a,inCurrentMonth:!1})}for(let d=1;d<=r;d++)c.push({date:this.formatDate(e,a,d),day:d,inCurrentMonth:!0});const o=(7-c.length%7)%7;for(let e=1;e<=o;e++)c.push({date:this.formatDate(s,l,e),day:e,inCurrentMonth:!1});return c}emitViewChange(){this.viewChange.emit({year:this.currentYear,month:this.currentMonth})}goPrevYear=e=>{e.stopPropagation(),this.currentYear-=1,this.emitViewChange()};goNextYear=e=>{e.stopPropagation(),this.currentYear+=1,this.emitViewChange()};goPrevMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"prev");this.currentYear=a,this.currentMonth=d,this.emitViewChange()};goNextMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"next");this.currentYear=a,this.currentMonth=d,this.emitViewChange()};isDisabled(e){if(!this.selectable)return!1;const[a,d]=this.selectable;return""!==a&&e<a||""!==d&&e>d}handleDayClick(e){this.isDisabled(e.date)||(this.value=e.date,this.update.emit(e.date))}render(){const e={"--calendar-bg":i.bg,"--calendar-padding":`${i.paddingXY}px`,"--calendar-gap":`${i.gap}px`,"--calendar-radius":`${i.radius}px`,"--calendar-header-gap":`${i.header.gap}px`,"--calendar-header-divider":i.header.divider,"--calendar-header-font-size":`${i.header.fontSize}px`,"--calendar-header-line-height":`${i.header.lineHeight}px`,"--calendar-header-font-weight":i.header.fontWeight,"--calendar-week-font-size":`${i.week.fontSize}px`,"--calendar-week-line-height":`${i.week.lineHeight}px`,"--calendar-week-font-weight":i.week.fontWeight,"--calendar-week-color":i.week.color,"--calendar-grid-row-gap":`${i.grid.rowGap}px`,"--calendar-day-size":`${i.day.size}px`,"--calendar-day-circle-size":`${i.day.circleSize}px`,"--calendar-day-circle-radius":`${i.day.circleRadius}px`,"--calendar-day-text":i.day.defaultText,"--calendar-day-hover-text":i.day.hoverText,"--calendar-day-hover-border":i.day.hoverBorder,"--calendar-day-select-bg":i.day.selectBg,"--calendar-day-select-text":i.day.selectText,"--calendar-day-disabled-text":i.day.disabledText,"--calendar-day-font-size":`${i.day.fontSize}px`,"--calendar-day-line-height":`${i.day.lineHeight}px`,"--calendar-day-font-weight":i.day.fontWeight,"--calendar-day-bold-font-weight":i.day.boldFontWeight,"--calendar-day-dot-size":`${i.day.dot.size}px`,"--calendar-day-dot-gap":`${i.day.dot.gap}px`,"--calendar-day-dot-padding-y":`${i.day.dot.paddingY}px`,"--calendar-legend-font-size":`${i.legend.fontSize}px`,"--calendar-legend-line-height":`${i.legend.lineHeight}px`,"--calendar-legend-font-weight":i.legend.fontWeight,"--calendar-legend-gap":`${i.legend.gap}px`,"--calendar-legend-group-gap":`${i.legend.groupGap}px`},a=this.eventMap,r=this.legendItems,l=(this.events?.length??0)>0;return d("div",{key:"0ed0317b3cecffea4015de8688888e0ab2a38586",class:{"sd-calendar":!0,"sd-calendar--elevated":this.elevated},style:e},d("div",{key:"b915f275a31617711d06d98c8a4d9369ddd36af5",class:"sd-calendar__header"},d("div",{key:"cd3b625e4e26af4b11f6af8b22c02099e8ab68a5",class:"sd-calendar__nav-group"},d("sd-ghost-button",{key:"e0ebfed48a7fdb61fd082371e7247176c02a8fb1",ariaLabel:"prevYear",size:"xxs",icon:"chevronLeft",onClick:this.goPrevYear}),d("span",{key:"6bfebc94dce54ca472ad5b3e03a7630e32676c3f",class:"sd-calendar__label"},this.currentYear),d("sd-ghost-button",{key:"2e42ad52cd7d1b5d3502d578347c997910f3efc3",ariaLabel:"nextYear",size:"xxs",icon:"chevronRight",onClick:this.goNextYear})),d("span",{key:"95be4ab5e03d7378e82006221f190ffd55659cf1",class:"sd-calendar__divider","aria-hidden":"true"}),d("div",{key:"edce7cf91a873cdaeed68e50372bdfa20af7507d",class:"sd-calendar__nav-group sd-calendar__nav-group-month"},d("sd-ghost-button",{key:"9ba274e9db32177d30d8c218303384855b7a3f60",ariaLabel:"prevMonth",size:"xxs",icon:"chevronLeft",onClick:this.goPrevMonth}),d("span",{key:"bc113063e769fe12c2a39732cd82060752b7d9eb",class:"sd-calendar__label sd-calendar__label-month"},this.currentMonth,"월"),d("sd-ghost-button",{key:"52cfde203e06334c5eee85abc9d82d6889bf511c",ariaLabel:"nextMonth",size:"xxs",icon:"chevronRight",onClick:this.goNextMonth}))),d("div",{key:"9ae80aee03a4e6392a1d9a4ef28e565db20faea3",class:"sd-calendar__week"},t.map((e=>d("span",{key:e,class:"sd-calendar__week-cell"},e)))),d("div",{key:"7c47907311ea24f1af030931b8efd11955e55436",class:"sd-calendar__grid"},this.cells.map((e=>{const r=e.inCurrentMonth&&""!==this.value&&this.value===e.date,t=e.inCurrentMonth&&n===e.date,i=e.inCurrentMonth&&this.isDisabled(e.date),s=e.inCurrentMonth?a.get(e.date):void 0;return d("button",{type:"button",key:e.date,class:{"sd-calendar__day":!0,"sd-calendar__day--empty":!e.inCurrentMonth,"sd-calendar__day--today":t,"sd-calendar__day--selected":r,"sd-calendar__day--disabled":i},disabled:!e.inCurrentMonth||i,tabindex:e.inCurrentMonth?void 0:-1,"aria-hidden":e.inCurrentMonth?void 0:"true",onClick:()=>e.inCurrentMonth&&this.handleDayClick(e)},d("span",{class:"sd-calendar__day-circle"},e.inCurrentMonth?e.day:""),l&&d("span",{class:"sd-calendar__dot-row","aria-hidden":"true"},s?.map(((e,a)=>d("span",{key:`${e.color}|${e.label}|${a}`,class:"sd-calendar__dot",style:{backgroundColor:e.color}})))))}))),r.length>0&&[d("span",{key:"4ba064cad3188db8342f51ca017e4bf5af8aa460",class:"sd-calendar__divider-bottom","aria-hidden":"true"}),d("div",{key:"ac132a1f1f948e618ee75d4c01a1c99a0dfc2c0a",class:"sd-calendar__legend"},r.map((e=>d("span",{key:`${e.color}|${e.label}`,class:"sd-calendar__legend-item"},d("span",{class:"sd-calendar__legend-dot",style:{backgroundColor:e.color},"aria-hidden":"true"}),d("span",{class:"sd-calendar__legend-label"},e.label)))))])}static get watchers(){return{value:[{handleValueChange:0}]}}};c.style="sd-calendar{display:block}sd-calendar .sd-calendar{display:flex;flex-direction:column;gap:var(--calendar-gap);width:328px;min-height:328px;padding:var(--calendar-padding);background:var(--calendar-bg);border-radius:var(--calendar-radius);user-select:none}sd-calendar .sd-calendar--elevated{box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}sd-calendar .sd-calendar__header{display:flex;align-items:center;justify-content:center;gap:var(--calendar-header-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__nav-group{display:inline-flex;align-items:center;gap:var(--calendar-gap)}sd-calendar .sd-calendar__nav-group-month{width:100%}sd-calendar .sd-calendar__label{display:inline-flex;align-items:center;justify-content:center;min-width:40px;text-align:center}sd-calendar .sd-calendar__label-month{width:100%}sd-calendar .sd-calendar__divider{display:inline-block;width:1px;height:16px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__week{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size))}sd-calendar .sd-calendar__week-cell{display:inline-flex;align-items:center;justify-content:center;height:20px;font-size:var(--calendar-week-font-size);line-height:var(--calendar-week-line-height);font-weight:var(--calendar-week-font-weight);color:var(--calendar-week-color)}sd-calendar .sd-calendar__grid{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size));row-gap:var(--calendar-grid-row-gap)}sd-calendar .sd-calendar__day{display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-start;width:var(--calendar-day-size);min-height:var(--calendar-day-circle-size);padding:0;border:none;background:transparent;cursor:pointer;font-size:var(--calendar-day-font-size);line-height:var(--calendar-day-line-height);font-weight:var(--calendar-day-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__day-circle{display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-circle-size);height:var(--calendar-day-circle-size);border-radius:calc(var(--calendar-day-circle-radius) * 1px);border:1px solid transparent;box-sizing:border-box}sd-calendar .sd-calendar__day:not(:disabled):hover .sd-calendar__day-circle{border-radius:16px;border:1px solid var(--calendar-day-hover-border)}sd-calendar .sd-calendar__day--today .sd-calendar__day-circle{font-weight:700}sd-calendar .sd-calendar__day--selected .sd-calendar__day-circle{border-radius:16px;background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--selected:not(:disabled):hover .sd-calendar__day-circle{background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--disabled{color:var(--calendar-day-disabled-text);background:none !important;cursor:not-allowed}sd-calendar .sd-calendar__day--empty{visibility:hidden;pointer-events:none}sd-calendar .sd-calendar__dot-row{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--calendar-day-dot-gap);box-sizing:border-box;width:100%;min-height:14px;padding-top:var(--calendar-day-dot-padding-y);padding-bottom:var(--calendar-day-dot-padding-y)}sd-calendar .sd-calendar__dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%}sd-calendar .sd-calendar__divider-bottom{display:block;width:100%;height:1px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__legend{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;column-gap:var(--calendar-legend-group-gap);row-gap:4px;font-size:var(--calendar-legend-font-size);line-height:var(--calendar-legend-line-height);font-weight:var(--calendar-legend-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__legend-item{display:inline-flex;align-items:center;gap:var(--calendar-legend-gap)}sd-calendar .sd-calendar__legend-dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%;flex-shrink:0}sd-calendar .sd-calendar__legend-label{display:inline-block}";const o=class{constructor(d){e(this,d),this.triggerClick=a(this,"sdTriggerClick",7)}displayText="";placeholder="YYYY-MM-DD";disabled=!1;size="sm";triggerClick;handleClick=()=>{this.disabled||this.triggerClick.emit()};render(){const e=l[this.size]??l.sm,a=""!==this.displayText;return d("div",{key:"df53dd75ead71167d7089daab5718c7ff1c990ae",role:"button",tabindex:this.disabled?-1:0,class:{"sd-date-picker-trigger":!0,"sd-date-picker-trigger--disabled":this.disabled},style:{"--trigger-padding-x":`${e.paddingX}px`,"--trigger-gap":`${e.gap}px`,"--trigger-icon-size":`${e.iconSize}px`,"--trigger-font-size":`${e.fontSize}px`,"--trigger-line-height":`${e.lineHeight}px`,"--trigger-font-weight":e.fontWeight,"--trigger-radius":`${e.radius}px`,"--trigger-text-min-width":("md"===this.size?104:80)+"px","--trigger-text-color":this.disabled?s.text.disabled:a?s.text.default:s.text.hint,"--trigger-icon-color":this.disabled?s.icon.disabled:s.icon.default},onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())}},d("sd-icon",{key:"76f41c99e1695eaa191cbc81ae057e65cb78e955",name:"date",size:Number(e.iconSize),color:"var(--trigger-icon-color)",class:"sd-date-picker-trigger__icon"}),d("span",{key:"4e1a4b2b41737f05dc1a4e642d317f5fc93bf9b2",class:"sd-date-picker-trigger__text"},a?this.displayText:this.placeholder))}};o.style="sd-date-picker-trigger{display:block;width:100%;height:100%}sd-date-picker-trigger .sd-date-picker-trigger{display:flex;align-items:center;gap:var(--trigger-gap);width:100%;height:100%;padding:0 var(--trigger-padding-x);cursor:pointer;user-select:none;overflow:hidden;border-radius:var(--trigger-radius)}sd-date-picker-trigger .sd-date-picker-trigger--disabled{cursor:not-allowed}sd-date-picker-trigger .sd-date-picker-trigger__icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}sd-date-picker-trigger .sd-date-picker-trigger__text{flex:1;min-width:var(--trigger-text-min-width, 80px);font-size:var(--trigger-font-size);line-height:var(--trigger-line-height);font-weight:var(--trigger-font-weight);color:var(--trigger-text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}";export{c as sd_calendar,o as sd_date_picker_trigger}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as o,h as e}from"./p-
|
|
1
|
+
import{r as t,c as o,h as e}from"./p-DNWwGHho.js";var d={height:"24",paddingX:"8",typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"}},i={height:"28",paddingX:"12",typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"}},r="4",a={width:"1",default:"#CCCCCC",select:"#0075FF",disabled:"#CCCCCC"},n={default:"#FFFFFF",hover:"#0075FF",select:"#FFFFFF",disabled:"#E1E1E1"},s={default:"#555555",hover:"#FFFFFF",select:"#0075FF",disabled:"#888888"},b={gap:"-1"};const l={xs:{height:Number(d.height),paddingX:Number(d.paddingX),fontSize:Number(d.typography.fontSize),lineHeight:Number(d.typography.lineHeight),fontWeight:d.typography.fontWeight,fontFamily:d.typography.fontFamily,textDecoration:d.typography.textDecoration},sm:{height:Number(i.height),paddingX:Number(i.paddingX),fontSize:Number(i.typography.fontSize),lineHeight:Number(i.typography.lineHeight),fontWeight:i.typography.fontWeight,fontFamily:i.typography.fontFamily,textDecoration:i.typography.textDecoration}},u=Number(r),h=Number(a.width),c=Number(b.gap),p={border:{default:a.default,select:a.select,disabled:a.disabled},bg:{default:n.default,hover:n.hover,select:n.select,disabled:n.disabled},content:{default:s.default,hover:s.hover,select:s.select,disabled:s.disabled}},g=class{constructor(e){t(this,e),this.change=o(this,"sdUpdate",7)}value;options=[];size="sm";disabled=!1;name;change;componentWillLoad(){this.size??="sm",this.options??=[],this.disabled??=!1}handleRadioChange=(t,o)=>{this.disabled||o||(this.value=t,this.change.emit(t))};isOptionSelected(t){return this.value===t.value}isOptionDisabled(t){return this.disabled||!!t.disabled}getButtonClasses(t){const o=["sd-radio-button__option",this.isOptionSelected(t)?"sd-radio-button__option--selected":"sd-radio-button__option--unselected"];return this.isOptionDisabled(t)&&o.push("sd-radio-button__option--disabled"),o.join(" ")}getGroupClasses(){return["sd-radio-button",`sd-radio-button--${this.size??"sm"}`].join(" ")}_groupName;get groupName(){return null!=this._groupName&&""!==this._groupName||(this._groupName=null!=this.name&&""!==this.name?this.name:`sd-radio-button-${crypto.randomUUID()}`),this._groupName}render(){const t=l[this.size??"sm"]??l.sm,o={"--sd-radio-button-height":`${t.height}px`,"--sd-radio-button-padding-x":`${t.paddingX}px`,"--sd-radio-button-font-family":t.fontFamily,"--sd-radio-button-font-weight":t.fontWeight,"--sd-radio-button-font-size":`${t.fontSize}px`,"--sd-radio-button-line-height":`${t.lineHeight}px`,"--sd-radio-button-text-decoration":t.textDecoration,"--sd-radio-button-radius":`${u}px`,"--sd-radio-button-border-width":`${h}px`,"--sd-radio-button-group-gap":`${c}px`,"--sd-radio-button-border-default":p.border.default,"--sd-radio-button-border-select":p.border.select,"--sd-radio-button-border-disabled":p.border.disabled,"--sd-radio-button-bg-default":p.bg.default,"--sd-radio-button-bg-hover":p.bg.hover,"--sd-radio-button-bg-select":p.bg.select,"--sd-radio-button-bg-disabled":p.bg.disabled,"--sd-radio-button-content-default":p.content.default,"--sd-radio-button-content-hover":p.content.hover,"--sd-radio-button-content-select":p.content.select,"--sd-radio-button-content-disabled":p.content.disabled};return e("div",{key:"d1f572315ee66c5defebc4386e815fb21928b548",class:this.getGroupClasses(),style:o,role:"radiogroup","aria-disabled":this.disabled.toString()},this.options.map((t=>{const o=this.isOptionSelected(t),d=this.isOptionDisabled(t);return e("label",{key:`radio-${t.value}`,class:this.getButtonClasses(t),"aria-label":t.label||"radio option","data-label":t.label},e("input",{type:"radio",name:this.groupName,value:t.value.toString(),checked:o,disabled:d,onInput:()=>this.handleRadioChange(t.value,t.disabled)}),t.label&&e("span",{class:"sd-radio-button__label"},t.label))})))}};g.style="sd-radio-button{display:inline-flex;width:fit-content;height:fit-content}.sd-radio-button{display:inline-flex;flex-flow:row nowrap;gap:0}.sd-radio-button__option{display:flex;align-items:center;justify-content:center;position:relative;box-sizing:border-box;height:var(--sd-radio-button-height);padding:0 var(--sd-radio-button-padding-x);border:var(--sd-radio-button-border-width) solid var(--sd-radio-button-border-default);background-color:var(--sd-radio-button-bg-default);color:var(--sd-radio-button-content-default);font-family:var(--sd-radio-button-font-family);font-weight:var(--sd-radio-button-font-weight);font-size:var(--sd-radio-button-font-size);line-height:var(--sd-radio-button-line-height);text-decoration:var(--sd-radio-button-text-decoration);cursor:pointer;user-select:none;-webkit-user-select:none;transition:background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease}.sd-radio-button__option input{display:none}.sd-radio-button__option:not(:first-child){margin-left:var(--sd-radio-button-group-gap)}.sd-radio-button__option:first-child{border-top-left-radius:var(--sd-radio-button-radius);border-bottom-left-radius:var(--sd-radio-button-radius)}.sd-radio-button__option:last-child{border-top-right-radius:var(--sd-radio-button-radius);border-bottom-right-radius:var(--sd-radio-button-radius)}.sd-radio-button__option:only-child{border-radius:var(--sd-radio-button-radius)}.sd-radio-button__option--selected{background-color:var(--sd-radio-button-bg-select);border-color:var(--sd-radio-button-border-select);color:var(--sd-radio-button-content-select);z-index:1}.sd-radio-button__option:hover:not(.sd-radio-button__option--disabled){background-color:var(--sd-radio-button-bg-hover);border-color:var(--sd-radio-button-border-select);color:var(--sd-radio-button-content-hover);z-index:2}.sd-radio-button__option--disabled{background-color:var(--sd-radio-button-bg-disabled);border-color:var(--sd-radio-button-border-disabled);color:var(--sd-radio-button-content-disabled);cursor:not-allowed}.sd-radio-button__label{user-select:none;-webkit-user-select:none}";export{g as sd_radio_button}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,a as i,h as e}from"./p-
|
|
1
|
+
import{r as t,c as s,a as i,h as e}from"./p-DNWwGHho.js";const h=class{constructor(i){t(this,i),this.close=s(this,"sdClose",3)}get hostEl(){return i(this)}to="body";parentRef=null;offset=[0,4];viewportPadding=0;zIndex=998;open=!1;close;container;wrapper;rafId;isInsideClick=!1;closeTransitionTimer;handleObservedScroll=()=>this.updatePosition();resizeObserver;mutationObserver;scrollParents=[];isObserved=!1;handleOpenChange(){this.syncPortalState()}componentDidLoad(){this.container=this.resolveContainer(),this.syncPortalState()}componentDidRender(){this.syncPortalState()}disconnectedCallback(){if(this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.unobserveParent(),this.wrapper?.parentNode)try{this.wrapper.parentNode.removeChild(this.wrapper)}catch{}}resolveContainer(){const t="string"==typeof this.to?document.querySelector(this.to):this.to;return t instanceof HTMLElement?t:document.body}createWrapper(){this.wrapper=document.createElement("div"),Object.assign(this.wrapper.style,{position:"absolute",top:"0",left:"0",zIndex:(this.zIndex??998).toString(),opacity:"0",transition:"opacity 0.15s ease-out",boxSizing:"border-box",visibility:"hidden"}),this.container.appendChild(this.wrapper)}ensureWrapper(){this.wrapper||(this.container||=this.resolveContainer(),this.createWrapper(),this.moveSlotContent())}syncPortalState(){if(!this.open)return this.wrapper&&(this.wrapper.style.transition="opacity 0.15s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="none",this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.closeTransitionTimer=setTimeout((()=>{this.wrapper&&!this.open&&(this.wrapper.style.display="none")}),150)),void this.unobserveParent();this.closeTransitionTimer&&clearTimeout(this.closeTransitionTimer),this.ensureWrapper(),this.wrapper&&(this.wrapper.style.display="block",this.wrapper.style.transition="opacity 0.25s ease-out",this.wrapper.style.opacity="0",this.wrapper.style.pointerEvents="",this.observeParent(),this.updatePosition())}moveSlotContent(){this.wrapper&&Array.from(this.hostEl.childNodes).filter((t=>t.nodeType!==Node.COMMENT_NODE)).forEach((t=>this.wrapper.appendChild(t)))}updatePosition(){void 0!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{if(!this.parentRef||!this.wrapper)return;const t=this.parentRef.getBoundingClientRect(),s=window.innerWidth,i=window.innerHeight,e=this.offset??[0,4],h=Math.max(0,this.viewportPadding??0),o=Math.max(s-2*h,0),n=Math.max(i-2*h,0);this.wrapper.style.maxWidth=`${o}px`,this.wrapper.style.maxHeight=`${n}px`;const r=this.wrapper.getBoundingClientRect(),a=i-t.bottom-e[1]-h;let d=t.bottom+window.scrollY+e[1],l=t.left+window.scrollX+e[0];a<r.height&&t.top-e[1]-h>a&&(d=t.top+window.scrollY-r.height-e[1]);const c=window.scrollY+h,u=window.scrollY+i-h-r.height;d=u<c?c:Math.min(Math.max(d,c),u),t.left+r.width+e[0]>s-h&&(l=t.right+window.scrollX-r.width-e[0]);const p=window.scrollX+h,w=window.scrollX+s-h-r.width;l=w<p?p:Math.min(Math.max(l,p),w),this.wrapper.style.top=`${d}px`,this.wrapper.style.left=`${l}px`,this.wrapper.style.visibility="visible",this.wrapper.style.opacity="1"}))}observeParent(){this.parentRef&&!this.isObserved&&(this.observeScrollParents(this.parentRef),"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updatePosition())),this.resizeObserver.observe(this.parentRef)),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver((()=>this.updatePosition())),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0})),this.isObserved=!0)}unobserveParent(){this.isObserved&&(this.unobserveScrollParents(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.mutationObserver?.disconnect(),this.mutationObserver=void 0,this.isObserved=!1)}observeScrollParents(t){const s=this.getScrollParents(t);s.forEach((t=>{t.addEventListener("scroll",this.handleObservedScroll,{passive:!0})})),this.scrollParents=s}unobserveScrollParents(){this.scrollParents.forEach((t=>{t.removeEventListener("scroll",this.handleObservedScroll)})),this.scrollParents=[]}getScrollParents(t){const s=[];let i=t.parentElement;for(;i;){const{overflow:t,overflowX:e,overflowY:h}=getComputedStyle(i);[t,e,h].some((t=>/(auto|scroll|overlay)/.test(t)))&&s.push(i),i=i.parentElement}return s}handleMouseDown(t){this.isInsideClick=!(!this.wrapper||!this.wrapper.contains(t.target))}handleWindowClick(t){this.isInsideClick?this.isInsideClick=!1:this.wrapper?.contains(t.target)||this.close.emit()}render(){return e("slot",{key:"a227fa8a0639de7fd3a014762998692151284f87"})}static get watchers(){return{open:[{handleOpenChange:0}]}}};export{h as sd_portal}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e}from"./p-
|
|
1
|
+
import{r as t,c as s,h as e}from"./p-DNWwGHho.js";var o={size:"16",icon:"12"},i={size:"24",icon:"16"},n={size:"28",icon:"20"},r={size:"36",icon:"24"},a={size:"62",icon:"32"},d={sm:"4",md:"6"},b={opacity:"5%"},c={disabled:"#BBBBBB"},h={content:"#888888",hover:{bg:"#222222"}},u={content:"#E30000",hover:{bg:"#E30000"}},l={content:"#025497",hover:{bg:"#0075FF"}},g={content:"#FFFFFF",disabled:"#E1E1E1",hover:{bg:"#FFFFFF"}};const m={xxs:{size:Number(o.size),icon:Number(o.icon)},xs:{size:Number(i.size),icon:Number(i.icon)},sm:{size:Number(n.size),icon:Number(n.icon)},md:{size:Number(r.size),icon:Number(r.icon)},lg:{size:Number(a.size),icon:Number(a.icon)}},f={xxs:Number(d.sm),xs:Number(d.sm),sm:Number(d.sm),md:Number(d.md),lg:Number(d.md)},v=b.opacity,p={default:h.content,danger:u.content,action:l.content,inverse:g.content},x={default:h.hover.bg,danger:u.hover.bg,action:l.hover.bg,inverse:g.hover.bg},z=c.disabled,F={default:z,danger:z,action:z,inverse:g.disabled},N=class{constructor(e){t(this,e),this.click=s(this,"sdClick",7)}icon;size="sm";intent="default";ariaLabel="";disabled=!1;click;hasWarnedMissingAriaLabel=!1;componentWillLoad(){this.size??="sm",this.intent??="default",this.ariaLabel??=""}handleClick=t=>{this.disabled?t.preventDefault():this.click.emit(t)};componentWillRender(){this.warnIfMissingAriaLabel()}warnIfMissingAriaLabel(){""===(this.ariaLabel??"").trim()?this.hasWarnedMissingAriaLabel||(console.warn(`[sd-ghost-button] icon-only buttons require \`ariaLabel\`. Received icon="${this.icon}".`),this.hasWarnedMissingAriaLabel=!0):this.hasWarnedMissingAriaLabel=!1}render(){const t=this.size??"sm",s=this.intent??"default",o=m[t]??m.sm,i=this.disabled?F[s]:p[s],n=(this.ariaLabel??"").trim()||void 0;return e("button",{key:"0707c0067aded10ea53bffbca0dbddbfdef35dc6",class:{"sd-ghost-button":!0,"sd-ghost-button--disabled":this.disabled},type:"button",disabled:this.disabled,"aria-label":n,style:{"--sd-ghost-button-size":`${o.size}px`,"--sd-ghost-button-radius":`${f[t]}px`,"--sd-ghost-button-hover-bg":x[s],"--sd-ghost-button-hover-opacity":v,"--sd-ghost-button-accent":"#0075FF"},onClick:this.handleClick},e("sd-icon",{key:"c362f7da310fc5b20fbbf0b08da4959b6f4a5374",name:this.icon,size:o.icon,color:i}))}};N.style='sd-ghost-button{display:inline-flex;width:fit-content;height:fit-content}.sd-ghost-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--sd-ghost-button-size);height:var(--sd-ghost-button-size);padding:0;border:none;border-radius:var(--sd-ghost-button-radius);background:transparent;cursor:pointer;box-sizing:border-box;transition:box-shadow 0.2s ease;-webkit-user-select:none;user-select:none}.sd-ghost-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--sd-ghost-button-hover-bg);opacity:0;transition:opacity 0.2s ease;pointer-events:none}.sd-ghost-button:hover:not(.sd-ghost-button--disabled)::before{opacity:var(--sd-ghost-button-hover-opacity)}.sd-ghost-button:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-ghost-button-accent)}.sd-ghost-button--disabled{cursor:not-allowed}';export{N as sd_ghost_button}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-
|
|
1
|
+
import{r as t,h as e}from"./p-DNWwGHho.js";var n={height:"20",paddingX:"8",gap:"4",typography:{fontSize:"11",fontWeight:"500",lineHeight:"18"},radius:"6"},i={height:"24",paddingX:"8",gap:"4",typography:{fontSize:"12",fontWeight:"700",lineHeight:"20"},radius:"6"},a={height:"28",paddingX:"12",gap:"6",typography:{fontSize:"14",fontWeight:"700",lineHeight:"24"},radius:"8"},g={content:"#FB4444",bg:"#FCEFEF"},s={content:"#FF6B00",bg:"#FEF1EA"},o={content:"#916C0D",bg:"#FFF7DD"},d={content:"#00973C",bg:"#E8F9EF"},r={content:"#0075FF",bg:"#E6F1FF"},c={content:"#006AC1",bg:"#EAF5FE"},h={content:"#004290",bg:"#EFF6FF"},p={content:"#737373",bg:"#EEEEEE"};const l=["xs","sm","md"],u=["grey","red","orange","yellow","green","blue","darkblue","indigo"],b={grey:{background:p.bg,content:p.content,icon:p.content},red:{background:g.bg,content:g.content,icon:g.content},orange:{background:s.bg,content:s.content,icon:s.content},yellow:{background:o.bg,content:o.content,icon:o.content},green:{background:d.bg,content:d.content,icon:d.content},blue:{background:r.bg,content:r.content,icon:r.content},darkblue:{background:c.bg,content:c.content,icon:c.content},indigo:{background:h.bg,content:h.content,icon:h.content}},x={xs:{height:`${n.height}px`,paddingX:`${n.paddingX}px`,gap:`${n.gap}px`,fontSize:`${n.typography.fontSize}px`,fontWeight:n.typography.fontWeight,lineHeight:`${n.typography.lineHeight}px`,iconSize:12,radius:`${n.radius}px`},sm:{height:`${i.height}px`,paddingX:`${i.paddingX}px`,gap:`${i.gap}px`,fontSize:`${i.typography.fontSize}px`,fontWeight:i.typography.fontWeight,lineHeight:`${i.typography.lineHeight}px`,iconSize:16,radius:`${i.radius}px`},md:{height:`${a.height}px`,paddingX:`${a.paddingX}px`,gap:`${a.gap}px`,fontSize:`${a.typography.fontSize}px`,fontWeight:a.typography.fontWeight,lineHeight:`${a.typography.lineHeight}px`,iconSize:16,radius:`${a.radius}px`}},f={xs:{...x.xs,radius:"999px"},sm:{...x.sm,radius:"999px"},md:{...x.md,radius:"999px"}},F=Object.fromEntries(["square","pill"].flatMap((t=>l.flatMap((e=>u.map((n=>[`${t}_${e}_${n}`,{shape:t,size:e,color:n,..."square"===t?x[e]:f[e],...b[n]}]))))))),y=class{constructor(e){t(this,e)}name="square_sm_grey";label="";icon;isLeft=!0;componentWillLoad(){this.name=this.name??"square_sm_grey"}get resolvedName(){if(!Object.prototype.hasOwnProperty.call(F,this.name))throw new Error(`Invalid sd-tag name: "${this.name}"`);return this.name}get resolvedConfig(){return F[this.resolvedName]}renderIcon(t,n){return null==this.icon?null:e("sd-icon",{class:"sd-tag__icon",name:this.icon,size:n,color:t})}render(){const t=this.resolvedConfig,n=this.renderIcon(t.icon,t.iconSize);return e("span",{key:"c8b8b88e2c83401bb9d3e05004b0517d7e4a3a6a",class:"sd-tag",style:{"--sd-tag-background":t.background,"--sd-tag-content":t.content,"--sd-tag-height":t.height,"--sd-tag-padding-x":t.paddingX,"--sd-tag-gap":t.gap,"--sd-tag-font-size":t.fontSize,"--sd-tag-font-weight":t.fontWeight,"--sd-tag-line-height":t.lineHeight,"--sd-tag-radius":t.radius},"aria-label":this.label||"tag"},this.icon&&this.isLeft&&n,e("span",{key:"67094b09ab1d7b7e865c9f6b8017f8c5c3f8274a",class:"sd-tag__label"},this.label),this.icon&&!this.isLeft&&n)}};y.style="sd-tag{display:inline-flex;width:fit-content;height:fit-content}.sd-tag{display:inline-flex;align-items:center;justify-content:center;gap:var(--sd-tag-gap, 5px);min-height:var(--sd-tag-height, 24px);padding:0 var(--sd-tag-padding-x, 8px);border-radius:var(--sd-tag-radius, 4px);background:var(--sd-tag-background, #f3f3f3);color:var(--sd-tag-content, #7a7a7a);box-sizing:border-box;white-space:nowrap;-webkit-user-select:none;user-select:none}.sd-tag__icon{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center}.sd-tag__label{display:inline-flex;align-items:center;justify-content:center;min-width:0;font-size:var(--sd-tag-font-size, 12px);font-weight:var(--sd-tag-font-weight, 700);line-height:var(--sd-tag-line-height, 20px)}";export{y as sd_tag}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as a}from"./p-
|
|
1
|
+
import{r as e,c as t,h as a}from"./p-DNWwGHho.js";import{s as l}from"./p-j2khhcHY.js";import{t as d}from"./p-D6GUzecR.js";const s=d.table,r=Number(s.keyValue.height),i=Number(s.radius),n=Number(s.body.paddingX),o=Number(s.keyValue.body.padding),v=Number(s.header.gap),u=Number(s.content.gap),b=Number(s.border.width),k=Number(s.keyValue.search.paddingX),h={border:s.border.color,thBg:s.header.bg,thLabel:l.color.fg.primary,required:l.color.fg.accent,helpIcon:l.color.fg.success,tdBg:l.color.bg.frame,tdText:l.color.fg.primary,searchBg:s.keyValue.search.bg},c={labelFontFamily:s.header.typography.fontFamily,labelFontSize:Number(s.header.typography.fontSize),labelFontWeight:Number(s.header.typography.fontWeight),labelLineHeight:Number(s.header.typography.lineHeight),tdFontFamily:s.body.typography.fontFamily,tdFontSize:Number(s.body.typography.fontSize),tdFontWeight:Number(s.body.typography.fontWeight),tdLineHeight:Number(s.body.typography.lineHeight)},p=class{constructor(a){e(this,a),this.change=t(this,"sdChange",7),this.searchEvent=t(this,"sdSearch",7)}fields=[];search=!1;useTop=!1;change;searchEvent;emit=(e,t)=>{this.change.emit({name:e,value:t})};handleSearchClick=()=>{this.searchEvent.emit()};renderField(e){const t=t=>this.emit(e.name,t.detail);switch(e.type){case"input":return a("sd-input",{width:"100%",...e.options??{},onSdUpdate:t});case"textarea":return a("sd-textarea",{width:"100%",...e.options??{},onSdUpdate:t});case"number-input":return a("sd-number-input",{width:"100%",...e.options??{},onSdUpdate:t});case"select":return a("sd-select",{width:"100%",...e.options??{},onSdUpdate:t});case"radio":{const{value:l,direction:d,...s}=e.options??{};return a("sd-radio-group",{...s,value:l,direction:d??"horizontal",onSdUpdate:t})}case"checkbox":{const{value:l,...d}=e.options??{};return a("sd-checkbox",{...d,value:l,onSdUpdate:t})}case"date-picker":return a("sd-date-picker",{width:"100%",...e.options??{},onSdUpdate:t});case"date-range-picker":return a("sd-date-range-picker",{width:"100%",...e.options??{},onSdUpdate:t});case"file-picker":return a("sd-file-picker",{width:"100%",...e.options??{},onSdUpdate:t});default:return a("span",{class:"sd-key-value-table__text"},e.options?.value??"")}}renderHelpIcon(e){return a("span",{class:"sd-key-value-table__help"},a("sd-tooltip",{icon:"helpOutline",iconSize:16,color:h.helpIcon,trigger:"hover"},e))}computeAutoSkipTh(){const e=this.fields.map((e=>e.map((()=>!1))));return this.fields.forEach(((t,a)=>{t.forEach(((t,l)=>{const d=null!=t.thRowSpan&&t.thRowSpan>1?t.thRowSpan:1;if(!(d<=1))for(let t=1;t<d;t++){const d=e[a+t];d&&l<d.length&&(d[l]=!0)}}))})),e}computeMaxCols(e){let t=0;return this.fields.forEach(((a,l)=>{let d=0;a.forEach(((t,a)=>{let s;s=t.hideTh?0:e[l]?.[a]?1:null!=t.thColSpan&&t.thColSpan>1?t.thColSpan:1,d+=s+(null!=t.tdColSpan&&t.tdColSpan>1?t.tdColSpan:1)})),d>t&&(t=d)})),t}renderTh(e,t,l){const d=null!=e.thRowSpan&&e.thRowSpan>1?e.thRowSpan:void 0,s=null!=e.thColSpan&&e.thColSpan>1?e.thColSpan:void 0,r={"sd-key-value-table__th":!0};return"string"==typeof e.thClass?r[e.thClass]=!0:Array.isArray(e.thClass)&&e.thClass.forEach((e=>r[e]=!0)),a("th",{key:`th-${t}-${l}`,class:r,style:e.thStyle,scope:"row",rowSpan:d,colSpan:s},a("div",{class:"sd-key-value-table__th-inner"},a("span",{class:"sd-key-value-table__label"},e.label,e.required&&a("sd-icon",{class:"sd-key-value-table__required",name:"star",size:12,color:h.required,label:"required"})),e.helpText&&this.renderHelpIcon(e.helpText)))}renderTd(e,t,l){return a("td",{key:`td-${t}-${l}`,class:"sd-key-value-table__td",rowSpan:null!=e.tdRowSpan&&e.tdRowSpan>1?e.tdRowSpan:void 0,colSpan:null!=e.tdColSpan&&e.tdColSpan>1?e.tdColSpan:void 0},a("div",{class:"sd-key-value-table__td-inner"},a("slot",{name:`field-${e.name}`},this.renderField(e))))}warnDuplicateNames(){const e=new Set,t=new Set;this.fields.forEach((a=>a.forEach((a=>{e.has(a.name)?t.add(a.name):e.add(a.name)})))),t.size>0&&console.warn(`[sd-key-value-table] Duplicate field name(s) detected: ${[...t].join(", ")}. Slot names ("field-{name}") and sdChange events rely on unique names.`)}render(){if(0===this.fields.length)return null;const e={"--sd-kvt-row-height":`${r}px`,"--sd-kvt-th-width":"120px","--sd-kvt-radius":`${i}px`,"--sd-kvt-padding-x":`${n}px`,"--sd-kvt-padding-y":`${o}px`,"--sd-kvt-gap":`${v}px`,"--sd-kvt-label-gap":`${u}px`,"--sd-kvt-border-width":`${b}px`,"--sd-kvt-border-color":h.border,"--sd-kvt-th-bg":h.thBg,"--sd-kvt-th-color":h.thLabel,"--sd-kvt-required-color":h.required,"--sd-kvt-td-bg":h.tdBg,"--sd-kvt-td-color":h.tdText,"--sd-kvt-label-font-family":c.labelFontFamily,"--sd-kvt-label-font-size":`${c.labelFontSize}px`,"--sd-kvt-label-font-weight":`${c.labelFontWeight}`,"--sd-kvt-label-line-height":`${c.labelLineHeight}px`,"--sd-kvt-td-font-family":c.tdFontFamily,"--sd-kvt-td-font-size":`${c.tdFontSize}px`,"--sd-kvt-td-font-weight":`${c.tdFontWeight}`,"--sd-kvt-td-line-height":`${c.tdLineHeight}px`,"--sd-kvt-search-bg":h.searchBg,"--sd-kvt-search-padding-x":`${k}px`};this.warnDuplicateNames();const t=this.computeAutoSkipTh(),l=this.computeMaxCols(t),d=a("table",{class:{"sd-key-value-table":!0,"sd-key-value-table--use-top":this.useTop},style:e},a("colgroup",null,Array.from({length:l},((e,t)=>a("col",{key:`col-${t}`,style:t%2==0?{width:"120px"}:void 0})))),a("tbody",null,this.fields.map(((e,l)=>a("tr",{class:"sd-key-value-table__row",key:`row-${l}`},e.map(((e,a)=>[e.hideTh||t[l][a]?null:this.renderTh(e,l,a),this.renderTd(e,l,a)])))))));return this.search?a("div",{class:{"sd-key-value-table__wrapper":!0,"sd-key-value-table__wrapper--use-top":this.useTop},style:e},d,a("div",{class:"sd-key-value-table__search-panel"},a("sd-button",{label:"검색",name:"neutral_outline_md",onSdClick:this.handleSearchClick}))):d}};p.style="sd-key-value-table{display:block}sd-key-value-table .sd-key-value-table__wrapper{display:flex;align-items:stretch;width:100%;border:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color);border-radius:var(--sd-kvt-radius);overflow:hidden}sd-key-value-table .sd-key-value-table__wrapper .sd-key-value-table{flex:1 1 auto;border:0;border-radius:0}sd-key-value-table .sd-key-value-table__wrapper.sd-key-value-table__wrapper--use-top{border-top-left-radius:0;border-top-right-radius:0}sd-key-value-table .sd-key-value-table__search-panel{display:flex;align-items:center;justify-content:center;flex:0 0 auto;padding:var(--sd-kvt-padding-y) var(--sd-kvt-search-padding-x);background:var(--sd-kvt-search-bg);border-left:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color)}sd-key-value-table .sd-key-value-table{width:100%;table-layout:fixed;border:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color);border-radius:var(--sd-kvt-radius);border-collapse:separate;border-spacing:0;overflow:hidden}sd-key-value-table .sd-key-value-table.sd-key-value-table--use-top{border-top-left-radius:0;border-top-right-radius:0}sd-key-value-table .sd-key-value-table__th,sd-key-value-table .sd-key-value-table__td{height:var(--sd-kvt-row-height);padding:var(--sd-kvt-padding-y) var(--sd-kvt-padding-x);box-sizing:border-box;vertical-align:middle;text-align:left;font-weight:normal;border-top:var(--sd-kvt-border-width) solid var(--sd-kvt-border-color)}sd-key-value-table .sd-key-value-table tbody>tr:first-child>.sd-key-value-table__th,sd-key-value-table .sd-key-value-table tbody>tr:first-child>.sd-key-value-table__td{border-top:0}sd-key-value-table .sd-key-value-table__th{width:var(--sd-kvt-th-width);background:var(--sd-kvt-th-bg);color:var(--sd-kvt-th-color)}sd-key-value-table .sd-key-value-table__th-inner{display:flex;align-items:center;justify-content:space-between;gap:var(--sd-kvt-gap);width:100%;height:100%}sd-key-value-table .sd-key-value-table__label{display:inline-flex;align-items:center;gap:var(--sd-kvt-label-gap);font-family:var(--sd-kvt-label-font-family);font-size:var(--sd-kvt-label-font-size);font-weight:var(--sd-kvt-label-font-weight);line-height:var(--sd-kvt-label-line-height);color:var(--sd-kvt-th-color)}sd-key-value-table .sd-key-value-table__required{display:inline-flex;align-items:center;flex-shrink:0}sd-key-value-table .sd-key-value-table__help{display:inline-flex;align-items:center;flex-shrink:0}sd-key-value-table .sd-key-value-table__td{background:var(--sd-kvt-td-bg);color:var(--sd-kvt-td-color)}sd-key-value-table .sd-key-value-table__td-inner{display:flex;align-items:center;width:100%;height:100%}sd-key-value-table .sd-key-value-table__td-inner>slot{display:block;flex:1 1 auto;min-width:0}sd-key-value-table .sd-key-value-table__td-inner sd-input,sd-key-value-table .sd-key-value-table__td-inner sd-textarea,sd-key-value-table .sd-key-value-table__td-inner sd-number-input,sd-key-value-table .sd-key-value-table__td-inner sd-select,sd-key-value-table .sd-key-value-table__td-inner sd-date-picker,sd-key-value-table .sd-key-value-table__td-inner sd-date-range-picker,sd-key-value-table .sd-key-value-table__td-inner sd-file-picker{width:100%}sd-key-value-table .sd-key-value-table__text{font-family:var(--sd-kvt-td-font-family);font-size:var(--sd-kvt-td-font-size);font-weight:var(--sd-kvt-td-font-weight);line-height:var(--sd-kvt-td-line-height);color:var(--sd-kvt-td-color)}";export{p as sd_key_value_table}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e}from"./p-
|
|
1
|
+
import{r as t,c as s,h as e}from"./p-DNWwGHho.js";var a={tab:{main:{lg:{height:"44",paddingX:"32"},md:{height:"36",paddingX:"24"},gap:"8",container:{gap:"4"},radius:"6",border:{width:"1"},selected:{bg:"#FFFFFF",text:"#0075FF",border:"#0075FF",typography:{fontWeight:"700"}},default:{bg:"#F6F6F6",text:"#888888",border:"#CCCCCC",typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontWeight:"400",fontSize:"12",lineHeight:"20"}}},sub:{selected:{text:"#0075FF",line:"#0075FF",typography:{fontWeight:"700"}},default:{text:"#222222",typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontWeight:"400",fontSize:"12",lineHeight:"20"}},border:{width:"1"},gap:"24",content:{gap:"4"}}}};const d={md:{height:Number(a.tab.main.md.height),paddingX:Number(a.tab.main.md.paddingX)},lg:{height:Number(a.tab.main.lg.height),paddingX:Number(a.tab.main.lg.paddingX)},gap:Number(a.tab.main.gap),containerGap:Number(a.tab.main.container.gap),radius:Number(a.tab.main.radius),borderWidth:Number(a.tab.main.border.width)},b={selected:{bg:a.tab.main.selected.bg,text:a.tab.main.selected.text,border:a.tab.main.selected.border},default:{bg:a.tab.main.default.bg,text:a.tab.main.default.text,border:a.tab.main.default.border}},i={selected:a.tab.main.selected.typography,default:a.tab.main.default.typography},r=Number(a.tab.sub.gap),n=Number(a.tab.sub.content.gap),o=Number(a.tab.sub.border.width),l={selected:{text:a.tab.sub.selected.text,line:a.tab.sub.selected.line},default:{text:a.tab.sub.default.text}},u={selected:a.tab.sub.selected.typography,default:a.tab.sub.default.typography},g=class{constructor(e){t(this,e),this.update=s(this,"sdUpdate",7)}value;tabs=[];size="md";isSub=!1;update;valueChanged(t){this.value=t}handleTabClick=t=>{this.value=t.value,this.update.emit(t.value)};isTabSelected(t){return this.value===t.value}getTabClasses(t){return["sd-tabs__tab",this.isTabSelected(t)?"sd-tabs__tab--selected":"sd-tabs__tab--unselected"].join(" ")}getContainerClasses(){const t=["sd-tabs",`sd-tabs--${this.size??"md"}`];return this.isSub&&t.push("sd-tabs--sub"),t.join(" ")}getBadgeName(t){return"square_xs_"+(this.isTabSelected(t)?"blue":"grey")}buildCssVars(){const t=d[this.size??"md"];return{"--sd-tabs-main-height":`${t.height}px`,"--sd-tabs-main-padding-x":`${t.paddingX}px`,"--sd-tabs-main-gap":`${d.gap}px`,"--sd-tabs-main-container-gap":`${d.containerGap}px`,"--sd-tabs-main-radius":`${d.radius}px`,"--sd-tabs-main-border-width":`${d.borderWidth}px`,"--sd-tabs-main-selected-bg":b.selected.bg,"--sd-tabs-main-selected-text":b.selected.text,"--sd-tabs-main-selected-border":b.selected.border,"--sd-tabs-main-default-bg":b.default.bg,"--sd-tabs-main-default-text":b.default.text,"--sd-tabs-main-default-border":b.default.border,"--sd-tabs-main-font-family":i.default.fontFamily,"--sd-tabs-main-font-size":`${i.default.fontSize}px`,"--sd-tabs-main-line-height":`${i.default.lineHeight}px`,"--sd-tabs-main-font-weight-default":i.default.fontWeight,"--sd-tabs-main-font-weight-selected":i.selected.fontWeight,"--sd-tabs-sub-gap":`${r}px`,"--sd-tabs-sub-content-gap":`${n}px`,"--sd-tabs-sub-border-width":`${o}px`,"--sd-tabs-sub-selected-text":l.selected.text,"--sd-tabs-sub-selected-line":l.selected.line,"--sd-tabs-sub-default-text":l.default.text,"--sd-tabs-sub-font-family":u.default.fontFamily,"--sd-tabs-sub-font-size":`${u.default.fontSize}px`,"--sd-tabs-sub-line-height":`${u.default.lineHeight}px`,"--sd-tabs-sub-font-weight-default":u.default.fontWeight,"--sd-tabs-sub-font-weight-selected":u.selected.fontWeight}}render(){return e("div",{key:"92384577bf4ce85de90ae05a32e44715e595fe16",class:this.getContainerClasses(),style:this.buildCssVars()},this.tabs.map(((t,s)=>{const a=this.getBadgeName(t);return e("div",{key:`tab-${s}`,role:"tab",tabindex:0,"aria-selected":t.value===this.value?"true":"false",class:this.getTabClasses(t),"aria-label":t.label||"tab",onClick:()=>this.handleTabClick(t),onKeyDown:s=>{"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),this.handleTabClick(t))}},e("span",{"data-label":t.label,class:"sd-tabs__label"},t.label),null!=t.badge&&""!==t.badge&&e("sd-tag",{name:a,label:t.badge.toString()}))})))}static get watchers(){return{value:[{valueChanged:0}]}}};g.style='sd-tabs{display:inline-block;width:100%}sd-tabs .sd-tabs{display:flex;flex-direction:row;gap:var(--sd-tabs-main-container-gap);border-bottom:var(--sd-tabs-main-border-width) solid var(--sd-tabs-main-selected-border);font-family:var(--sd-tabs-main-font-family)}sd-tabs .sd-tabs__tab{display:flex;align-items:center;justify-content:center;gap:var(--sd-tabs-main-gap);cursor:pointer;box-sizing:border-box;height:var(--sd-tabs-main-height);padding:0 var(--sd-tabs-main-padding-x);border:var(--sd-tabs-main-border-width) solid var(--sd-tabs-main-default-border);border-bottom:none;border-top-left-radius:var(--sd-tabs-main-radius);border-top-right-radius:var(--sd-tabs-main-radius);background-color:var(--sd-tabs-main-default-bg);color:var(--sd-tabs-main-default-text);font-size:var(--sd-tabs-main-font-size);line-height:var(--sd-tabs-main-line-height);font-weight:var(--sd-tabs-main-font-weight-default);transition:all 0.2s ease;position:relative;user-select:none}sd-tabs .sd-tabs__tab::before{content:"";position:absolute;inset:0;opacity:0;transition:all 0.2s;pointer-events:none}sd-tabs .sd-tabs__tab--selected{border-color:var(--sd-tabs-main-selected-border);color:var(--sd-tabs-main-selected-text);background-color:var(--sd-tabs-main-selected-bg)}sd-tabs .sd-tabs__tab--selected .sd-tabs__label::before{font-weight:var(--sd-tabs-main-font-weight-selected)}sd-tabs .sd-tabs__tab--selected:hover::before{background-color:var(--sd-tabs-main-selected-border);opacity:0.15}sd-tabs .sd-tabs__tab--unselected:hover::before{background-color:var(--sd-tabs-main-default-text);opacity:0.15}sd-tabs .sd-tabs__label{user-select:none;font-weight:var(--sd-tabs-main-font-weight-selected);visibility:hidden;position:relative;white-space:nowrap}sd-tabs .sd-tabs__label::before{content:attr(data-label);visibility:visible;position:absolute;inset:0;font-weight:var(--sd-tabs-main-font-weight-default);transition:font-weight 0.2s ease}sd-tabs .sd-tabs--sub{gap:var(--sd-tabs-sub-gap);border-bottom:none;font-family:var(--sd-tabs-sub-font-family)}sd-tabs .sd-tabs--sub .sd-tabs__tab{height:auto;padding:0 0 var(--sd-tabs-sub-content-gap) 0;border:none;border-radius:0;background-color:transparent;color:var(--sd-tabs-sub-default-text);font-size:var(--sd-tabs-sub-font-size);line-height:var(--sd-tabs-sub-line-height);font-weight:var(--sd-tabs-sub-font-weight-default)}sd-tabs .sd-tabs--sub .sd-tabs__tab::before{content:"";position:absolute;left:0;right:0;bottom:0;height:var(--sd-tabs-sub-border-width);width:100%;background-color:var(--sd-tabs-sub-selected-line);opacity:0;transition:opacity 0.2s ease;inset:auto 0 0 0;pointer-events:none}sd-tabs .sd-tabs--sub .sd-tabs__tab--selected{color:var(--sd-tabs-sub-selected-text);background-color:transparent}sd-tabs .sd-tabs--sub .sd-tabs__tab--selected::before{opacity:1}sd-tabs .sd-tabs--sub .sd-tabs__tab--selected .sd-tabs__label::before{font-weight:var(--sd-tabs-sub-font-weight-selected)}sd-tabs .sd-tabs--sub .sd-tabs__label{font-weight:var(--sd-tabs-sub-font-weight-selected)}sd-tabs .sd-tabs--sub .sd-tabs__label::before{font-weight:var(--sd-tabs-sub-font-weight-default)}';export{g as sd_tabs}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,a as s,d as i,f as h,h as a,H as n}from"./p-DNWwGHho.js";import{T as r}from"./p-sZMi_32I.js";import{T as l,a as o,b as d,c,d as u}from"./p-DGyTYauz.js";import"./p-D6GUzecR.js";import"./p-j2khhcHY.js";let b=(t=21)=>{let e="",s=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&s[t]];return e};const g=class{constructor(s){t(this,s),this.sdSelectChange=e(this,"sdSelectChange",7),this.sdPageChange=e(this,"sdPageChange",7),this.sdRowsPerPageChange=e(this,"sdRowsPerPageChange",7),this.sdVirtualUpdate=e(this,"sdVirtualUpdate",7),this.sdVirtualReachEnd=e(this,"sdVirtualReachEnd",7)}static DEFAULT_NO_DATA_LABEL="데이터가 없습니다.";get el(){return s(this)}tableId=b(8);fallbackTableId=b(8);columns=[];rows;selected=[];rowKey="id";selectable=!1;resizable=!1;width;height;stickyHeader=!1;stickyColumn={left:0,right:0};useTop=!1;noDataLabel=g.DEFAULT_NO_DATA_LABEL;resolvedNoDataLabel=g.DEFAULT_NO_DATA_LABEL;isLoading=!1;pagination;useInternalPagination=!1;useRowsPerPageSelect=!1;dense=!1;useVirtualScroll=!1;rowHeight;get effectiveRowHeight(){return null!=this.rowHeight?this.rowHeight:Number(this.dense?l.dense.height:l.default.height)}virtualBuffer=5;virtualEndThreshold=10;rowsPerPageOption=[{label:"10개씩 보기",value:10},{label:"25개씩 보기",value:25},{label:"50개씩 보기",value:50},{label:"100개씩 보기",value:100}];sdSelectChange;sdPageChange;sdRowsPerPageChange;sdVirtualUpdate;sdVirtualReachEnd;currentPage=1;innerRowsPerPage=10;innerSelected=new Set;columnWidths=[];scrolledLeft=!1;scrolledRight=!1;rowCount=0;loadingScrollTop=0;noDataBodyHeight=60;autoThead=!1;autoTbody=!1;vsStart=0;vsEnd=0;lastReachEndNotifiedRowCount=-1;scrollContainer=null;noDataContentEl=null;noDataContentResizeObserver;onScroll;spanRegistry=new Map;useFrameRegistry=new Map;cellClassRegistry=new Map;rowIndexMap=new Map;rebuildRowIndexMap(){if(this.rowIndexMap.clear(),!Array.isArray(this.rows))return;const t=this.rowKey;this.rows.forEach(((e,s)=>{const i=e?.[t];null!=i&&this.rowIndexMap.set(String(i),s)}))}resolveRowIndex(t){const e=this.rowIndexMap.get(t);if(void 0!==e)return e;const s=Number(t);return Number.isFinite(s)?s:null}toFiniteNumber(t,e){const s="number"==typeof t?t:Number(t);return Number.isFinite(s)?s:e}isRowsPerPageValue(t){return null===t||"string"==typeof t||"number"==typeof t}isValidTableId(t){return"string"==typeof t&&t.trim().length>0&&"undefined"!==t&&"null"!==t}getResolvedTableId(){if(this.isValidTableId(this.tableId))return this.tableId;const t=this.el?.getAttribute(r);return this.isValidTableId(t)?t:this.fallbackTableId}syncTableIdAttribute(){const t=this.getResolvedTableId();this.el?.getAttribute(r)!==t&&this.el.setAttribute(r,t)}handleIsLoadingChange(t){t&&(this.loadingScrollTop=this.scrollContainer?.scrollTop??0),this.syncNoDataContentObserver()}handleUseVirtualScrollChange(t){t&&i((()=>this.propagateVirtualUpdate()))}handleColumnsChange(t){this.columnWidths=t.map((t=>t.autoWidth?0:parseInt(t.width||"120",10))),this.refreshChildrenConfig()}handleRowsChange(t){Array.isArray(t)&&(this.rowCount=t.length,this.rebuildRowIndexMap(),this.useVirtualScroll&&this.propagateVirtualUpdate(!0),this.pushRowsToChildren(t),this.syncNoDataContentObserver())}handleRowKeyChange(){this.rebuildRowIndexMap()}handleTableIdChange(){this.syncTableIdAttribute()}handleNoDataLabelChange(t){this.resolvedNoDataLabel="string"==typeof t&&t.trim().length>0&&"undefined"!==t&&"null"!==t?t:g.DEFAULT_NO_DATA_LABEL}handleConfigChange(){this.refreshChildrenConfig()}handleSelectedChange(t){this.innerSelected=new Set(t)}handlePaginationChange(t){null!=t?.page&&t.page!==this.currentPage&&(this.currentPage=t.page),null!=t?.rowsPerPage&&t.rowsPerPage!==this.innerRowsPerPage&&(this.innerRowsPerPage=t.rowsPerPage)}detectChildren(){const t=!!this.el.querySelector(":scope > sd-thead"),e=!!this.el.querySelector(":scope > sd-tbody");this.autoThead=!t,this.autoTbody=!e}componentWillLoad(){this.syncTableIdAttribute(),this.handleNoDataLabelChange(this.noDataLabel),this.detectChildren(),this.innerSelected=new Set(this.selected||[]),this.columnWidths=(this.columns||[]).map((t=>t.autoWidth?0:parseInt(t.width||"120",10))),this.rebuildRowIndexMap(),null!=this.pagination?.page&&(this.currentPage=this.pagination.page),null!=this.pagination?.rowsPerPage&&(this.innerRowsPerPage=this.pagination.rowsPerPage);const t=this.el;t.isRowSelectedSync=this.isRowSelectedSync.bind(this),t.updateRowSelectSync=this.updateRowSelectSync.bind(this),t.toggleSelectAllSync=this.toggleSelectAllSync.bind(this),t.getIsAllCheckedSync=this.getIsAllCheckedSync.bind(this),t.getStickyStyleSync=this.getStickyStyleSync.bind(this),t.setRowCountSync=this.setRowCountSync.bind(this),t.handleResize=this.handleResize.bind(this),t.getPaginationInfoSync=this.getPaginationInfoSync.bind(this),t.getVirtualScrollRangeSync=this.getVirtualScrollRangeSync.bind(this),t.getConfigSync=this.getConfigSync.bind(this),t.getTableIdSync=()=>this.getResolvedTableId(),t.getVirtualScrollConfigSync=this.getVirtualScrollConfigSync.bind(this),t.calculateVisibleRange=this.calculateVisibleRange.bind(this),t.registerSpanSync=this.registerSpanSync.bind(this),t.unregisterSpanSync=this.unregisterSpanSync.bind(this),t.getSpanSync=this.getSpanSync.bind(this),t.isCoveredSync=this.isCoveredSync.bind(this),t.hasRowspanSync=this.hasRowspanSync.bind(this),t.registerCellClassSync=this.registerCellClassSync.bind(this),t.unregisterCellClassSync=this.unregisterCellClassSync.bind(this),t.getCellClassSync=this.getCellClassSync.bind(this),t.registerUseFrameSync=this.registerUseFrameSync.bind(this),t.unregisterUseFrameSync=this.unregisterUseFrameSync.bind(this),t.hasUseFrameInRowSync=this.hasUseFrameInRowSync.bind(this),t.isCellUseFrameSync=this.isCellUseFrameSync.bind(this),Array.isArray(this.rows)&&(this.rowCount=this.rows.length,this.pushRowsToChildren(this.rows))}componentDidLoad(){Array.isArray(this.rows)&&this.pushRowsToChildren(this.rows),i((()=>{const t=this.el.shadowRoot?.querySelector(".sd-table__scroll-container");if(!t)return;let e=!1;this.onScroll=()=>{const s=t.scrollLeft,i=s>0,h=s+t.clientWidth<t.scrollWidth;this.scrolledLeft===i&&this.scrolledRight===h||(this.scrolledLeft=i,this.scrolledRight=h,this.refreshChildrenConfig()),this.useVirtualScroll&&!e&&(e=!0,requestAnimationFrame((()=>{e=!1,this.propagateVirtualUpdate()})))},this.scrollContainer=t,t.addEventListener("scroll",this.onScroll,{passive:!0}),this.onScroll(),this.useVirtualScroll&&this.propagateVirtualUpdate()})),this.syncNoDataContentObserver()}disconnectedCallback(){this.scrollContainer&&this.onScroll&&this.scrollContainer.removeEventListener("scroll",this.onScroll),this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=void 0}syncNoDataContentObserver(){if(0!==this.rowCount||this.isLoading)return this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=void 0,void(this.noDataBodyHeight=60);this.observeNoDataContentHeight()}observeNoDataContentHeight(){if("undefined"==typeof ResizeObserver)return;const t=this.noDataContentEl;t&&(this.noDataContentResizeObserver?.disconnect(),this.noDataContentResizeObserver=new ResizeObserver((()=>{const e=Math.ceil(t.scrollHeight),s=Math.max(60,e);s!==this.noDataBodyHeight&&(this.noDataBodyHeight=s)})),this.noDataContentResizeObserver.observe(t),i((()=>{if(!this.noDataContentEl)return;const t=Math.ceil(this.noDataContentEl.scrollHeight),e=Math.max(60,t);e!==this.noDataBodyHeight&&(this.noDataBodyHeight=e)})))}queryChildEl(t){return this.el.querySelector(t)??this.el.shadowRoot?.querySelector(t)??null}queryAllTr(){return[...Array.from(this.el.querySelectorAll("sd-tr")),...Array.from(this.el.shadowRoot?.querySelectorAll("sd-tr")??[])]}pushRowsToChildren(t){const e=this.queryChildEl("sd-tbody");e&&(e.rows=t);const s=this.queryChildEl("sd-thead");s&&(s.rows=t)}handleStructureSlotChange=()=>{Array.isArray(this.rows)&&this.pushRowsToChildren(this.rows),this.refreshChildrenConfig()};refreshChildrenSelection(){const t=this.queryChildEl("sd-thead");t?.refreshSelection?.(),this.queryAllTr().forEach((t=>t.refreshSelection?.()))}refreshChildrenConfig(){const t=this.queryChildEl("sd-thead");t?.refreshConfig?.(),this.queryAllTr().forEach((t=>t.refreshConfig?.()))}maybeEmitVirtualReachEnd(t,e){const s=Math.max(1,this.virtualEndThreshold);e>=Math.max(0,this.rowCount-s)&&this.lastReachEndNotifiedRowCount!==this.rowCount&&(this.lastReachEndNotifiedRowCount=this.rowCount,this.sdVirtualReachEnd.emit({from:t,to:e,rowCount:this.rowCount,threshold:s}))}propagateVirtualUpdate(t=!1){if(!this.scrollContainer||!this.useVirtualScroll)return;const e=this.toFiniteNumber(this.scrollContainer.scrollTop,0),s=this.toFiniteNumber(this.scrollContainer.clientHeight,0),{start:i,end:h}=this.calculateVisibleRange(e,s);if(!Number.isFinite(i)||!Number.isFinite(h))return;const a=this.vsStart!==i||this.vsEnd!==h;if(!a&&!t)return;this.vsStart=i,this.vsEnd=h;const n=i*this.effectiveRowHeight,r=Math.max(0,(this.rowCount-h)*this.effectiveRowHeight),l=this.queryChildEl("sd-tbody");l?.setSpacersSync?.(n,r),a&&this.sdVirtualUpdate.emit({from:i,to:h}),this.maybeEmitVirtualReachEnd(i,h)}getVirtualScrollConfigSync(){return{useVirtualScroll:this.useVirtualScroll,rowHeight:this.effectiveRowHeight,virtualBuffer:this.virtualBuffer,vsStart:this.vsStart,vsEnd:this.vsEnd,rowCount:this.rowCount}}getConfigSync(){return{columns:this.columns,selectable:this.selectable,resizable:this.resizable,stickyColumn:this.stickyColumn,stickyHeader:this.stickyHeader,scrolledLeft:this.scrolledLeft,scrolledRight:this.scrolledRight,columnWidths:this.columnWidths,dense:this.dense}}registerUseFrameSync(t,e){if(null==t||""===e)return;let s=this.useFrameRegistry.get(t);s||(s=new Set,this.useFrameRegistry.set(t,s)),s.add(e)}unregisterUseFrameSync(t,e){if(null==t||""===e)return;const s=this.useFrameRegistry.get(t);s&&(s.delete(e),0===s.size&&this.useFrameRegistry.delete(t))}hasUseFrameInRowSync(t){const e=this.useFrameRegistry.get(t);return null!=e&&e.size>0}isCellUseFrameSync(t,e){return this.useFrameRegistry.get(t)?.has(e)??!1}isRowSelectedSync(t){return Array.from(this.innerSelected).some((e=>e[this.rowKey??"id"]===t[this.rowKey??"id"]))}async isRowSelected(t){return this.isRowSelectedSync(t)}updateRowSelectSync(t){const e=Array.from(this.innerSelected),s=this.isRowSelectedSync(t)?e.filter((e=>e[this.rowKey??"id"]!==t[this.rowKey??"id"])):[...e,t];s.length!==e.length&&(this.innerSelected=new Set(s),this.selected=Array.from(this.innerSelected),this.sdSelectChange.emit(Array.from(this.innerSelected)),this.refreshChildrenSelection())}async updateRowSelect(t){this.updateRowSelectSync(t)}toggleSelectAllSync(t,e){if(t){const t=new Set([...e]);this.innerSelected=new Set([...this.innerSelected,...t])}else{const t=e.map((t=>t[this.rowKey??"id"]));this.innerSelected=new Set([...this.innerSelected].filter((e=>!t.includes(e[this.rowKey??"id"]))))}this.selected=Array.from(this.innerSelected),this.sdSelectChange.emit(Array.from(this.innerSelected)),this.refreshChildrenSelection()}async toggleSelectAll(t,e){this.toggleSelectAllSync(t,e)}getIsAllCheckedSync(t){const e=t.length,s=t.filter((t=>Array.from(this.innerSelected).some((e=>e[this.rowKey??"id"]===t[this.rowKey??"id"])))).length;return 0!==s&&(s===e||null)}async getIsAllChecked(t){return this.getIsAllCheckedSync(t)}changePage(t){this.useInternalPagination?(this.currentPage=t,this.sdPageChange.emit(this.currentPage),this.updateRowsVisibility()):this.sdPageChange.emit(t)}updateRowsVisibility(){this.queryAllTr().forEach((t=>t.updateVisibility?.()))}changeRowsPerPage(t){const e=null!=t&&""!==t?Number(t):0;if(!this.useInternalPagination)return void this.sdRowsPerPageChange.emit(e);this.innerRowsPerPage=e;const s=Math.max(1,Math.ceil(this.rowCount/e));this.currentPage>s&&(this.currentPage=s),this.sdRowsPerPageChange.emit(e),this.updateRowsVisibility()}get lastPageNumber(){if(this.useInternalPagination)return Math.max(1,Math.ceil(this.rowCount/this.innerRowsPerPage));const{lastPage:t,rowsPerPage:e=10}=this.pagination||{};return t??Math.max(1,Math.ceil(this.rowCount/e))}handleResize(t,e,s=!1){if("undefined"==typeof document)return;const i=e.clientX,h=this.columnWidths[t],a=e=>{const a=this.columns[t];if(null==a)return;const n=a.maxWidth||9999,r=e.clientX-i,l=Math.min(Math.max(h+(s?-r:r),a.minWidth||50),n);this.columnWidths=this.columnWidths.map(((e,s)=>s===t?l:e));const o=this.queryChildEl("sd-thead");o?.setColumnWidths?.(this.columnWidths),this.queryAllTr().forEach((t=>t.setColumnWidths?.(this.columnWidths)));const d=this.stickyColumn?.right||0,c=this.columns.filter((t=>!1!==t.visible)).length;d>0&&t===c-d&&requestAnimationFrame((()=>{this.onScroll?.()}))},n=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",n)}getStickyStyleSync(t){const e=this.columnWidths.slice(0,t).reduce(((t,e)=>t+e),this.selectable?o:0),s=this.columnWidths.filter(((e,s)=>s>=this.columns.filter((t=>!1!==t.visible)).length-(this.stickyColumn?.right||0)&&s>t)).reduce(((t,e)=>t+e),0),i=this.columns.filter((t=>!1!==t.visible))[t],h={"--sticky-left-offset":`${e}px`,"--sticky-right-offset":`${s}px`};return i?.autoWidth||(h.width=`${this.columnWidths[t]}px`,h.minWidth=`${this.columnWidths[t]}px`,h.maxWidth=`${this.columnWidths[t]}px`),h}async getStickyStyle(t){return this.getStickyStyleSync(t)}spanKey(t,e){return`${t}::${e}`}requestAllTrUpdate(){this.queryAllTr().forEach((t=>{"function"==typeof t.bumpSpansVersion?t.bumpSpansVersion():h(t)}))}registerSpanSync(t,e,s,i){if(null==t||""===e)return;const h=Math.max(1,Math.floor(s||1)),a=Math.max(1,Math.floor(i||1)),n=this.spanKey(t,e),r=this.spanRegistry.get(n);if(1===h&&1===a){if(!r)return;return this.spanRegistry.delete(n),void this.requestAllTrUpdate()}r&&r.rowspan===h&&r.colspan===a||(this.spanRegistry.set(n,{rowspan:h,colspan:a}),this.requestAllTrUpdate())}unregisterSpanSync(t,e){if(null==t||""===e)return;const s=this.spanKey(t,e);this.spanRegistry.has(s)&&(this.spanRegistry.delete(s),this.requestAllTrUpdate())}getSpanSync(t,e){return this.spanRegistry.get(this.spanKey(t,e))}registerCellClassSync(t,e,s){if(null==t||""===e)return;const i=this.spanKey(t,e),h=(s??"").trim();""!==h?this.cellClassRegistry.set(i,h):this.cellClassRegistry.delete(i)}unregisterCellClassSync(t,e){null!=t&&""!==e&&this.cellClassRegistry.delete(this.spanKey(t,e))}getCellClassSync(t,e){return this.cellClassRegistry.get(this.spanKey(t,e))}hasRowspanSync(){for(const t of this.spanRegistry.values())if(t.rowspan>1)return!0;return!1}isCoveredSync(t,e,s){if(0===this.spanRegistry.size)return!1;const i=s.filter((t=>!1!==t.visible));for(let s=0;s<e;s++){const h=i[s];if(null==h)continue;const a=this.spanRegistry.get(this.spanKey(t,"string"==typeof h.field?h.field:h.name));if(a&&s+a.colspan>e)return!0}const h=this.resolveRowIndex(t);if(null==h)return!1;for(const[t,s]of this.spanRegistry){if(s.rowspan<=1)continue;const a=t.indexOf("::");if(a<0)continue;const n=t.slice(0,a),r=t.slice(a+2),l=this.resolveRowIndex(n);if(null==l)continue;if(l>=h)continue;if(l+s.rowspan<=h)continue;const o=i.findIndex((t=>("string"==typeof t.field?t.field:t.name)===r));if(!(o<0)&&o<=e&&o+s.colspan>e)return!0}return!1}setRowCountSync(t){const e=Math.max(0,Math.floor(this.toFiniteNumber(t,0)));e!==this.rowCount&&(this.lastReachEndNotifiedRowCount=-1),this.rowCount=e,this.useVirtualScroll&&this.propagateVirtualUpdate(!0)}async setRowCount(t){this.setRowCountSync(t)}calculateVisibleRange(t,e){const s=Math.max(1,this.toFiniteNumber(this.effectiveRowHeight,40)),i=Math.max(0,Math.floor(this.toFiniteNumber(this.virtualBuffer,5))),h=Math.max(0,this.toFiniteNumber(t,0)),a=Math.max(0,this.toFiniteNumber(e,0)),n=Math.max(0,Math.floor(this.toFiniteNumber(this.rowCount,0))),r=Math.floor(h/s),l=Math.ceil(a/s);return{start:Math.max(0,r-i),end:Math.min(n,r+l+i)}}getPaginationInfoSync(){if(!this.useInternalPagination||!this.pagination)return null;const t=(this.currentPage-1)*this.innerRowsPerPage;return{startIndex:t,endIndex:t+this.innerRowsPerPage,currentPage:this.currentPage,rowsPerPage:this.innerRowsPerPage}}async getPaginationInfo(){return this.getPaginationInfoSync()}getVirtualScrollRangeSync(){return this.useVirtualScroll&&this.vsEnd>0?{from:this.vsStart,to:this.vsEnd}:null}renderAutoRows(){if(this.useVirtualScroll)return null;const t=this.rows??[],e=this.getPaginationInfoSync(),s=e?.startIndex??0;return(e?t.slice(e.startIndex,e.endIndex):t).map(((t,e)=>{const i=s+e;return a("sd-tr",{key:i,"row-key":String(i),row:t})}))}get tableClasses(){return["sd-table",this.stickyHeader&&"sd-table--sticky-header",this.selectable&&"sd-table--selectable",this.resizable&&"sd-table--resizable",(this.selectable||(this.stickyColumn?.left??0)>0||(this.stickyColumn?.right??0)>0)&&"sd-table--sticky-column",this.scrolledLeft&&"sd-table--scrolled-left",this.scrolledRight&&"sd-table--scrolled-right",0===this.rowCount&&!this.isLoading&&"sd-table--no-data"].filter(Boolean).join(" ")}render(){const t=this.getResolvedTableId(),e=0===this.rowCount&&!this.isLoading,s=e?`max(${this.height||"96px"}, ${36+this.noDataBodyHeight}px)`:this.height||"100%";return a(n,{key:"4596e04bd57aca00fa6378fd26ce33a06a795eaf",style:{"--table-radius":`${u}px`,"--table-border-color":c.color,"--table-border-width":`${c.width}px`,"--table-body-font-family":d.fontFamily,"--table-body-font-weight":d.fontWeight,"--table-body-font-size":`${d.fontSize}px`,"--table-body-line-height":`${d.lineHeight}px`,"--table-body-text-decoration":d.textDecoration,"--table-selectable-width":`${o}px`}},a("div",{key:"11a20d327410b0be659cede32917164e036e796c",class:"sd-table__container",style:{"--table-width":this.width,"--table-height":s,"--table-container-height":`calc(${s} - ${this.pagination&&this.rowCount>0&&!this.useVirtualScroll?48:0}px)`}},a("div",{key:"f4f3acf584dc4eacdae25b11aa2b62b73ffab949",class:{"sd-table__wrapper":!0,"sd-table__wrapper--use-top":this.useTop}},a("div",{key:"c8ab618b9c990a22b8e9466a5bfb5f02f4de8b12",class:{"sd-table__scroll-container":!0,"sd-table__scroll-container--loading":this.isLoading,"sd-table__scroll-container--no-data":e}},this.isLoading&&a("div",{key:"a696933a70799ba282fc743281d0af27fd691a2e",class:"sd-table__loading",style:{top:`${this.loadingScrollTop}px`}},a("sd-circle-progress",{key:"cba6ac47367ef6499bf338b9b757ee74fdd7e6c1",indeterminate:!0})),e&&a(a.Fragment,null,a("div",{key:"6e22156bf5b0fb9814d9bf9cad57506758c6284b",class:"sd-table__no-data-header-overlay"}),a("div",{key:"b72f9fabcc8acb8e700ad55acc4d7aff08355a1c",class:"sd-table__no-data"},a("div",{key:"43f271a8803121362f16e8153748328658f073ec",class:"sd-table__no-data-content",ref:t=>{this.noDataContentEl=t,t&&this.syncNoDataContentObserver()}},a("slot",{key:"4b8533115bbc81962b80c9c2533fe4b44a87193c",name:"no-data"},a("span",{key:"d94c4f7cf9eca7901b99434f712480a7b20c869a"},this.resolvedNoDataLabel))))),a("table",{key:"a9a353aca09124ed8a82fcd2f8a0a7de09b234f5",class:this.tableClasses},this.autoThead?a("slot",{name:`${t}-head`,onSlotchange:this.handleStructureSlotChange},a("sd-thead",{rows:this.rows??[]})):a("slot",{name:`${t}-head`,onSlotchange:this.handleStructureSlotChange}),this.autoTbody?a("slot",{name:`${t}-body`,onSlotchange:this.handleStructureSlotChange},a("sd-tbody",{rows:this.rows??[]},this.renderAutoRows())):a("slot",{name:`${t}-body`,onSlotchange:this.handleStructureSlotChange})))),this.pagination&&this.pagination.rowsPerPage>0&&this.rowCount>0&&!this.useVirtualScroll&&a("div",{key:"8afeb9398c3d7540a54b9a3660fb9685ae1cddca",class:"sd-table__pagination"},a("sd-pagination",{key:"e2cbb3f7414f65b81ab2d33eaec5d9f28bed6cc8",currentPage:this.useInternalPagination?this.currentPage:this.pagination.page,lastPage:this.useInternalPagination?this.lastPageNumber:this.pagination.lastPage,onSdPageChange:t=>this.changePage(t.detail)}),this.useRowsPerPageSelect&&a("sd-select",{key:"ce723544dbc7e4cc0d77ced3b685b8575cf67e6f",value:this.useInternalPagination?this.innerRowsPerPage:this.pagination.rowsPerPage,options:this.rowsPerPageOption,width:"128px",emitValue:!0,onSdUpdate:t=>{this.isRowsPerPageValue(t.detail)&&this.changeRowsPerPage(t.detail)}}))))}static get watchers(){return{isLoading:[{handleIsLoadingChange:0}],useVirtualScroll:[{handleUseVirtualScrollChange:0}],columns:[{handleColumnsChange:0}],rows:[{handleRowsChange:0}],rowKey:[{handleRowKeyChange:0}],tableId:[{handleTableIdChange:0}],noDataLabel:[{handleNoDataLabelChange:0}],selectable:[{handleConfigChange:0}],resizable:[{handleConfigChange:0}],stickyColumn:[{handleConfigChange:0}],stickyHeader:[{handleConfigChange:0}],dense:[{handleConfigChange:0}],selected:[{handleSelectedChange:0}],pagination:[{handlePaginationChange:0}]}}};g.style="sd-table,:host{display:block;width:100%;max-width:100%;min-width:0}sd-table *,:host *{box-sizing:border-box}.sd-table__container{height:var(--table-height, 100%);width:var(--table-width, 100%);max-width:100%;min-width:0;color:#222222;display:flex;flex-direction:column}.sd-table__wrapper{width:100%;min-width:0;height:var(--table-container-height, 400px);border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);border-radius:var(--table-radius, 8px);overflow:hidden}.sd-table__wrapper--use-top{border-radius:0 0 var(--table-radius, 8px) var(--table-radius, 8px)}.sd-table__scroll-container{width:100%;height:100%;display:flex;flex-direction:column;position:relative;font-family:var(--table-body-font-family, inherit);font-weight:var(--table-body-font-weight, 400);font-size:var(--table-body-font-size, 12px);line-height:var(--table-body-line-height, 20px);text-decoration:var(--table-body-text-decoration, none);overflow:auto;background:#FFFFFF}.sd-table__scroll-container--loading{overflow:hidden !important;pointer-events:none}.sd-table__scroll-container--no-data{overflow:hidden;pointer-events:none}.sd-table__no-data{position:absolute;top:36px;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;font-size:var(--table-body-font-size, 12px);color:#888888;pointer-events:none;z-index:200;background:rgba(255, 255, 255, 0.6)}.sd-table__no-data-header-overlay{position:absolute;top:0;left:0;right:0;height:36px;background:rgba(255, 255, 255, 0.6);z-index:210;pointer-events:none}.sd-table__no-data-content{pointer-events:auto;min-height:60px;width:100%;display:flex;align-items:center;justify-content:center}.sd-table__loading{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(255, 255, 255, 0.6);z-index:200;display:flex;align-items:center;justify-content:center;pointer-events:none}.sd-table{background-color:white;display:table;width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.sd-table--selectable sd-thead,.sd-table--selectable sd-tbody{--selectable:true}.sd-table--sticky-header sd-thead thead{position:sticky;top:0;z-index:120}.sd-table--sticky-column sd-thead,.sd-table--sticky-column sd-tbody{--sticky-column:true}.sd-table--scrolled-left sd-thead,.sd-table--scrolled-left sd-tbody{--scrolled-left:true}.sd-table--scrolled-right sd-thead,.sd-table--scrolled-right sd-tbody{--scrolled-right:true}.sd-table--resizable sd-thead{--resizable:true}.sd-table--no-data sd-thead{opacity:0.4}.sd-table__pagination{position:relative;background:#F9F9F9;height:48px;display:flex;align-items:center;justify-content:center;border:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);margin-top:-1px;border-radius:var(--table-radius, 8px)}.sd-table__pagination sd-select{position:absolute;right:10px;top:50%;transform:translateY(-50%)}";export{g as sd_table}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,a as s,h as i}from"./p-0U6dRjlq.js";import{n as r}from"./p-CCwNgVmC.js";import{c as h,S as o,f as l,E as n,L as d,a as c,b as a,d as u}from"./p-CxOCk_ge.js";const g=class{constructor(s){t(this,s),this.update=e(this,"sdUpdate",7),this.dropDownShow=e(this,"sdDropDownShow",7)}static VIEWPORT_PADDING=20;static PORTAL_OFFSET_Y=4;static CLOSE_ANIMATION_DURATION=150;get el(){return s(this)}type="default";value=null;options=[];placeholder="선택";maxDropdownWidth="640px";dropdownHeight="260px";disabled=!1;label="";labelWidth="";addonLabel="";addonAlign="start";error=!1;hint="";errorMessage="";rules=[];icon=void 0;labelTooltip="";labelTooltipProps=null;emitValue=!1;width="";useSearch=!1;allSelectedLabel="전체";useSelectAll=!1;isOpen=!1;isAnimatingOut=!1;triggerWidth="200px";resolvedDropdownHeight="260px";resolvedMaxDropdownWidth="640px";focused=!1;hovered=!1;update;dropDownShow;async sdFocus(){this.disabled||await(this.triggerComponentRef?.sdFocus())}async sdOpen(){await new Promise((t=>setTimeout(t,0))),this.disabled||this.isOpen||(this.prepareDropdownGeometry(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)}triggerRef;triggerComponentRef;closeAnimationTimer;name=r();triggerHasFocus=!1;watchIsOpen(t){this.syncFocusedState(t),this.dropDownShow.emit({isOpen:t})}get isMulti(){return"multi"===this.type||"multi_depth"===this.type}get displayText(){if(this.isMulti){if(!Array.isArray(this.value)||0===this.value.length)return"";const t=this.getNonDisabledLeaves(this.options),e=this.getSelectedOptions();if(t.length>0&&t.every((t=>e.some((e=>e.value===t.value)))))return this.allSelectedLabel??"전체";const s=this.flattenOptions(this.options);return this.value.map((t=>{if(null!=t&&"object"==typeof t){const e=t;return e.label??s.find((t=>t.value===e.value))?.label??""}return s.find((e=>e.value===t))?.label??""})).filter(Boolean).join(", ")}if(null==this.value)return"";if(!this.emitValue&&"object"==typeof this.value&&!Array.isArray(this.value))return this.value.label??"";const t=this.flattenOptions(this.options).find((t=>t.value===this.value));return t?.label??""}flattenOptions(t){return t.flatMap((t=>t.children?this.flattenOptions(t.children):[t]))}getNonDisabledLeaves(t){return t.flatMap((t=>t.disabled?[]:t.children?this.getNonDisabledLeaves(t.children):[t]))}getSelectedOptions(){const t=this.value;return null!=t&&Array.isArray(t)?this.emitValue?t.map((t=>this.findOriginalOption(t,this.options))).filter((t=>!!t)):t:[]}toMultiValue(t){return this.emitValue?t.map((t=>t.value)):t}parsePixelValue(t,e){const s=Number.parseFloat(t);return Number.isFinite(s)?s:e}updateDropdownViewportConstraints(){if(!this.triggerRef)return;const t=this.triggerRef.getBoundingClientRect(),e=g.VIEWPORT_PADDING,s=g.PORTAL_OFFSET_Y,i=this.parsePixelValue(this.dropdownHeight,260),r=this.parsePixelValue(this.maxDropdownWidth,640),h=Math.max(window.innerHeight-t.bottom-e-s,0),o=Math.max(t.top-e-s,0),l=Math.max(h,o),n=Math.max(window.innerWidth-2*e,0);this.resolvedDropdownHeight=`${Math.min(i,l)}px`,this.resolvedMaxDropdownWidth=`${Math.min(r,n)}px`}handleViewportResize=()=>{this.isOpen&&this.updateDropdownViewportConstraints()};findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),g.CLOSE_ANIMATION_DURATION))}prepareDropdownGeometry(){this.triggerRef&&(this.triggerWidth=`${this.triggerRef.offsetWidth}px`),this.updateDropdownViewportConstraints()}syncFocusedState(t=this.isOpen){this.focused=t||this.triggerHasFocus}handleTriggerFocus=()=>{this.triggerHasFocus=!0,this.syncFocusedState()};handleTriggerBlur=()=>{this.triggerHasFocus=!1,this.syncFocusedState()};handleTriggerClick=()=>{this.isOpen?this.closeDropdown():(this.prepareDropdownGeometry(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)};emitUpdate(t){this.update.emit(t)}handleOptionSelect=t=>{const{option:e,leaves:s}=t;if(this.isMulti)this.handleMultiSelect(e,s);else{this.closeDropdown(),this.value=this.emitValue?e.value:e;const t=this.value;requestAnimationFrame((()=>{this.emitUpdate(t)}))}};handleMultiSelect(t,e){const s=this.getSelectedOptions();let i;if(t.children)if(e.every((t=>s.some((e=>e.value===t.value))))){const t=new Set(e.map((t=>t.value)));i=s.filter((e=>!t.has(e.value)))}else{const t=new Set(s.map((t=>t.value))),r=e.filter((e=>!t.has(e.value)));i=[...s,...r]}else i=s.some((e=>e.value===t.value))?s.filter((e=>e.value!==t.value)):[...s,t];this.value=this.toMultiValue(i),this.emitUpdate(this.value)}connectedCallback(){window.addEventListener("resize",this.handleViewportResize)}disconnectedCallback(){window.removeEventListener("resize",this.handleViewportResize),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const t={open:this.isOpen,parentRef:this.triggerRef,viewportPadding:g.VIEWPORT_PADDING,onSdClose:()=>{this.closeDropdown()}};return i("sd-field",{key:"21849c194994f51c36b2fa5eafd606230b21e365",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,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,onMouseEnter:()=>{this.hovered=!0},onMouseLeave:()=>{this.hovered=!1}},i("div",{key:"bcba54ed8d325a540d14af14c9b3bf332f631ce8",class:"sd-select",ref:t=>{this.triggerRef=t}},i("sd-select-trigger",{key:"72e361ca6e162eee56b82398902e89226e980d3d",ref:t=>{this.triggerComponentRef=t},displayText:this.displayText,placeholder:this.placeholder??"선택",disabled:this.disabled,isOpen:this.isOpen,onSdTriggerClick:this.handleTriggerClick,onSdTriggerFocus:this.handleTriggerFocus,onSdTriggerBlur:this.handleTriggerBlur})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"0ff55857cbc146db57caa53d560752d0fae8413b",...t},i("sd-select-listbox",{key:"20c103309dc7f2eaf4bee6abae271606b64ace8b",type:this.type,options:this.options,value:this.value,emitValue:this.emitValue,useSearch:this.useSearch,useSelectAll:this.useSelectAll,triggerWidth:this.triggerWidth,maxWidth:this.resolvedMaxDropdownWidth,maxHeight:this.resolvedDropdownHeight,onSdOptionSelect:t=>this.handleOptionSelect(t.detail)})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}};g.style="sd-select{display:inline-flex}sd-select sd-portal{display:none}sd-select .sd-select{position:relative;width:100%;height:100%}";const p=class{constructor(s){t(this,s),this.optionSelect=e(this,"sdOptionSelect",7)}type="default";options=[];value=null;emitValue=!1;useSearch=!1;useSelectAll=!1;triggerWidth="200px";maxWidth="640px";maxHeight="260px";searchKeyword="";isScrolled=!1;focusedIndex=-1;optionSelect;listEl;lastScrolledIndex=-1;keydownAttached=!1;suppressHover=!1;get isDepth(){return"default_depth"===this.type||"multi_depth"===this.type}get isMulti(){return"multi"===this.type||"multi_depth"===this.type}static SELECT_ALL_OPTION={value:"__select_all__",label:"전체"};get showSelectAll(){return this.useSelectAll&&this.isMulti}getAllNonDisabledLeaves(){const t=e=>e.flatMap((e=>e.disabled?[]:e.children?t(e.children):[e]));return t(this.options)}get selectAllState(){if(!this.showSelectAll)return!1;const t=this.getAllNonDisabledLeaves();if(0===t.length)return!1;const e=this.getSelectedValues(),s=t.filter((t=>e.has(t.value))).length;return 0!==s&&(s===t.length||null)}get showSearch(){return!!this.useSearch&&(this.isDepth?h(this.options):this.options.length)>=o}get filteredOptions(){if(""===this.searchKeyword)return this.options;if(this.isDepth)return l(this.options,this.searchKeyword);const t=this.searchKeyword.toLowerCase();return this.options.filter((e=>e.label.toLowerCase().includes(t)))}get isEmpty(){return this.isDepth?0===h(this.filteredOptions)&&0===this.filteredOptions.length:0===this.filteredOptions.length}getSelectedValues(){return null!=this.value&&Array.isArray(this.value)?this.emitValue?new Set(this.value):new Set(this.value.map((t=>t.value))):new Set}isOptionSelected(t){return this.isMulti?this.getSelectedValues().has(t.value):this.emitValue||null==this.value||"object"!=typeof this.value||Array.isArray(this.value)?this.value===t.value:this.value.value===t.value}getGroupSelectionState(t){if(!this.isMulti||!t.children)return!1;const e=this.getSelectedValues();if(0===e.size)return!1;const s=this.collectVisibleLeaves(t);if(0===s.length)return!1;const i=s.filter((t=>e.has(t.value))).length;return 0!==i&&(i===s.length||null)}getCountInfo(t){if(!this.isMulti||!t.children)return;const e=this.getSelectedValues(),s=this.collectVisibleLeaves(t);return{selected:s.filter((t=>e.has(t.value))).length,total:s.length}}findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}collectLeaves(t){return t.children?t.children.flatMap((t=>this.collectLeaves(t))):[t]}collectVisibleLeaves(t){if(t.disabled)return[];if(!t.children)return[t];if(0===t.children.length){const e=this.findOriginalOption(t.value,this.options);return e?this.collectLeaves(e).filter((t=>!t.disabled)):[]}return t.children.flatMap((t=>this.collectVisibleLeaves(t)))}get navigableOptions(){const t=[];this.showSelectAll&&t.push(p.SELECT_ALL_OPTION);const e=s=>{for(const i of s){const s=!!i.children;(!s||this.isMulti)&&!i.disabled&&t.push(i),s&&i.children&&i.children.length>0&&e(i.children)}};return e(this.filteredOptions),t}isSelectAllOption(t){return this.showSelectAll&&t.value===p.SELECT_ALL_OPTION.value}emitSelectAll(){if(!this.showSelectAll)return;const t=this.getAllNonDisabledLeaves();this.optionSelect.emit({option:{...p.SELECT_ALL_OPTION,children:t},leaves:t})}handleSelectAllClick=t=>{t.stopPropagation(),this.emitSelectAll()};isOptionFocused(t){if(this.focusedIndex<0)return!1;const e=this.navigableOptions[this.focusedIndex];return null!=e&&e.value===t.value}resetFocusOnFilter(){this.focusedIndex=this.navigableOptions.length>0?0:-1,this.suppressHover&&(document.removeEventListener("mousemove",this.releaseHoverSuppress,!0),this.suppressHover=!1)}handleSearchFilter=t=>{this.searchKeyword=t.detail};handleScroll=t=>{this.isScrolled=t.target.scrollTop>0};emitOptionSelect(t){this.optionSelect.emit({option:t,leaves:this.collectVisibleLeaves(t)})}handleOptionClick=t=>{t.stopPropagation(),this.emitOptionSelect(t.detail)};handleOptionHover=t=>{if(this.suppressHover)return;const e=this.navigableOptions.findIndex((e=>e.value===t.value));e>=0&&(this.focusedIndex=e)};releaseHoverSuppress=()=>{this.suppressHover=!1,document.removeEventListener("mousemove",this.releaseHoverSuppress,!0)};handleKeyDown=t=>{const e=this.navigableOptions;if("ArrowDown"===t.key){if(0===e.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<0?0:(this.focusedIndex+1)%e.length,this.beginHoverSuppression()}else if("ArrowUp"===t.key){if(0===e.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<=0?e.length-1:this.focusedIndex-1,this.beginHoverSuppression()}else if("Enter"===t.key){if(this.focusedIndex<0||this.focusedIndex>=e.length)return;t.preventDefault(),t.stopPropagation();const s=e[this.focusedIndex];this.isSelectAllOption(s)?this.emitSelectAll():this.emitOptionSelect(s)}};beginHoverSuppression(){this.suppressHover||(this.suppressHover=!0,document.addEventListener("mousemove",this.releaseHoverSuppress,!0))}scrollFocusedIntoView(){const t=this.listEl,e=t?.querySelector(".sd-select-list-item--focused");if(!t||!e)return;const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();i.top<s.top?t.scrollTop+=i.top-s.top:i.bottom>s.bottom&&(t.scrollTop+=i.bottom-s.bottom)}connectedCallback(){this.keydownAttached||(document.addEventListener("keydown",this.handleKeyDown,!0),this.keydownAttached=!0)}disconnectedCallback(){this.keydownAttached&&(document.removeEventListener("keydown",this.handleKeyDown,!0),this.keydownAttached=!1),this.suppressHover&&(document.removeEventListener("mousemove",this.releaseHoverSuppress,!0),this.suppressHover=!1)}componentDidRender(){this.focusedIndex!==this.lastScrolledIndex&&(this.lastScrolledIndex=this.focusedIndex,this.focusedIndex>=0&&this.scrollFocusedIntoView())}renderOptions(t,e=1){return t.map((t=>{const s=!!t.children;return[i("sd-select-list-item",{option:t,depth:e,isSelected:s?this.getGroupSelectionState(t):this.isOptionSelected(t),isFocused:this.isOptionFocused(t),useCheckbox:this.isMulti,countInfo:this.getCountInfo(t),onSdListItemClick:this.handleOptionClick,onMouseEnter:()=>this.handleOptionHover(t)}),s&&t.children?this.renderOptions(t.children,e+1):null]}))}render(){return i("div",{key:"1834dbfee219988e78ad47d3640ebafb9983298c",class:"sd-select-listbox",style:{"--listbox-trigger-width":this.triggerWidth??"200px","--listbox-max-width":this.maxWidth??"640px","--listbox-max-height":this.maxHeight??"260px","--listbox-radius":`${d.radius}px`}},this.showSearch&&i("sd-select-list-item-search",{key:"28fbfce57184f2a8c090d628c5b33cecf9337c3c",isScrolled:this.isScrolled,onSdSearchFilter:this.handleSearchFilter}),i("div",{key:"b7430d72cdb26cad59b226af8cf98d796645390c",class:"sd-select-listbox__list",onScroll:this.handleScroll,ref:t=>{this.listEl=t}},this.showSelectAll&&i("sd-select-list-item",{key:"8f159cdef838c0f39bb7aad1717a88c04c75dbda",option:p.SELECT_ALL_OPTION,depth:1,isSelected:this.selectAllState,isFocused:this.isOptionFocused(p.SELECT_ALL_OPTION),useCheckbox:!0,onSdListItemClick:this.handleSelectAllClick,onMouseEnter:()=>this.handleOptionHover(p.SELECT_ALL_OPTION)}),this.isEmpty?i("div",{class:"sd-select-listbox__empty"},n):this.isDepth?this.renderOptions(this.filteredOptions):this.filteredOptions.map((t=>i("sd-select-list-item",{option:t,depth:1,isSelected:this.isOptionSelected(t),isFocused:this.isOptionFocused(t),useCheckbox:this.isMulti,onSdListItemClick:this.handleOptionClick,onMouseEnter:()=>this.handleOptionHover(t)})))))}static get watchers(){return{searchKeyword:[{resetFocusOnFilter:0}]}}};p.style=":host{display:block}:host .sd-select-listbox{display:flex;flex-direction:column;width:var(--listbox-trigger-width);max-width:var(--listbox-max-width);max-height:var(--listbox-max-height);border-radius:var(--listbox-radius);background:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);overflow:hidden;outline:none}:host .sd-select-listbox__list{flex:1;min-height:0;overflow-y:auto;padding-bottom:0}:host .sd-select-listbox__empty{padding:12px;text-align:center;font-size:12px;line-height:20px;color:#888888}";const f=class{constructor(s){t(this,s),this.triggerClick=e(this,"sdTriggerClick",7),this.triggerFocus=e(this,"sdTriggerFocus",7),this.triggerBlur=e(this,"sdTriggerBlur",7)}displayText="";placeholder="선택";disabled=!1;isOpen=!1;triggerClick;triggerFocus;triggerBlur;triggerEl;async sdFocus(){this.disabled||this.triggerEl?.focus()}handleClick=()=>{this.disabled||this.triggerClick.emit()};handleFocus=()=>{this.triggerFocus.emit()};handleBlur=()=>{this.triggerBlur.emit()};render(){const t=""!==this.displayText;return i("div",{key:"645d8e7ff5065664a3510b127628cb54d97fb613",ref:t=>{this.triggerEl=t},role:"button","aria-haspopup":"listbox","aria-expanded":this.isOpen?"true":"false",tabindex:this.disabled?-1:0,class:{"sd-select-trigger":!0,"sd-select-trigger--open":this.isOpen,"sd-select-trigger--disabled":this.disabled},style:{"--trigger-padding-x":`${u.paddingX}px`,"--trigger-gap":`${u.gap}px`,"--trigger-font-size":`${a.fontSize}px`,"--trigger-line-height":`${a.lineHeight}px`,"--trigger-font-weight":a.fontWeight,"--trigger-color":this.disabled?c.text.disabled:t?c.text.default:c.icon.default,"--trigger-icon-color":this.disabled?c.icon.disabled:c.icon.default},onClick:this.handleClick,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleClick())},onFocus:this.handleFocus,onBlur:this.handleBlur},i("div",{key:"515dda6d98ad09b0854e0ef0e04f0bf8c9592d1a",class:"sd-select-trigger__content"},i("span",{key:"9d92577675d0c7e6ba32174ae0cdd754788dbccb",class:"sd-select-trigger__text"},t?this.displayText:this.placeholder??"선택"),i("sd-icon",{key:"347532a73d9ff2929d9f716fb8d2e314af7d7069",name:"chevronDown",size:12,color:"var(--trigger-icon-color)",class:{"sd-select-trigger__icon":!0,"sd-select-trigger__icon--open":this.isOpen}})))}};f.style="sd-select-trigger{display:block;width:100%;height:100%}sd-select-trigger .sd-select-trigger{display:flex;width:100%;height:100%;cursor:pointer;user-select:none;overflow:hidden;border-radius:3px}sd-select-trigger .sd-select-trigger--disabled{cursor:not-allowed}sd-select-trigger .sd-select-trigger__content{display:flex;align-items:center;gap:var(--trigger-gap);flex:1;padding:0 var(--trigger-padding-x);min-width:0}sd-select-trigger .sd-select-trigger__text{flex:1;font-size:var(--trigger-font-size);line-height:var(--trigger-line-height);font-weight:var(--trigger-font-weight);color:var(--trigger-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}sd-select-trigger .sd-select-trigger__icon{flex-shrink:0;transition:transform 0.2s ease}sd-select-trigger .sd-select-trigger__icon--open{transform:rotate(180deg)}";export{g as sd_select,p as sd_select_listbox,f as sd_select_trigger}
|
|
1
|
+
import{r as t,c as e,a as s,h as i}from"./p-DNWwGHho.js";import{n as r}from"./p-CCwNgVmC.js";import{c as h,S as o,f as l,E as n,L as c,a as d,b as a,d as u}from"./p-CxOCk_ge.js";const g=class{constructor(s){t(this,s),this.update=e(this,"sdUpdate",7),this.dropDownShow=e(this,"sdDropDownShow",7)}static VIEWPORT_PADDING=20;static PORTAL_OFFSET_Y=4;static CLOSE_ANIMATION_DURATION=150;get el(){return s(this)}type="default";value=null;options=[];placeholder="선택";maxDropdownWidth="640px";dropdownHeight="260px";disabled=!1;label="";labelWidth="";addonLabel="";addonAlign="start";error=!1;hint="";errorMessage="";rules=[];icon=void 0;labelTooltip="";labelTooltipProps=null;emitValue=!1;width="";useSearch=!1;allSelectedLabel="전체";useSelectAll=!1;isOpen=!1;isAnimatingOut=!1;triggerWidth="200px";resolvedDropdownHeight="260px";resolvedMaxDropdownWidth="640px";focused=!1;hovered=!1;update;dropDownShow;async sdFocus(){this.disabled||await(this.triggerComponentRef?.sdFocus())}async sdOpen(){await new Promise((t=>setTimeout(t,0))),this.disabled||this.isOpen||(this.prepareDropdownGeometry(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)}triggerRef;triggerComponentRef;closeAnimationTimer;name=r();triggerHasFocus=!1;watchIsOpen(t){this.syncFocusedState(t),this.dropDownShow.emit({isOpen:t})}get isMulti(){return"multi"===this.type||"multi_depth"===this.type}get displayText(){if(this.isMulti){if(!Array.isArray(this.value)||0===this.value.length)return"";const t=this.getNonDisabledLeaves(this.options),e=this.getSelectedOptions();if(t.length>0&&t.every((t=>e.some((e=>e.value===t.value)))))return this.allSelectedLabel??"전체";const s=this.flattenOptions(this.options);return this.value.map((t=>{if(null!=t&&"object"==typeof t){const e=t;return e.label??s.find((t=>t.value===e.value))?.label??""}return s.find((e=>e.value===t))?.label??""})).filter(Boolean).join(", ")}if(null==this.value)return"";if(!this.emitValue&&"object"==typeof this.value&&!Array.isArray(this.value))return this.value.label??"";const t=this.flattenOptions(this.options).find((t=>t.value===this.value));return t?.label??""}flattenOptions(t){return t.flatMap((t=>t.children?this.flattenOptions(t.children):[t]))}getNonDisabledLeaves(t){return t.flatMap((t=>t.disabled?[]:t.children?this.getNonDisabledLeaves(t.children):[t]))}getSelectedOptions(){const t=this.value;return null!=t&&Array.isArray(t)?this.emitValue?t.map((t=>this.findOriginalOption(t,this.options))).filter((t=>!!t)):t:[]}toMultiValue(t){return this.emitValue?t.map((t=>t.value)):t}parsePixelValue(t,e){const s=Number.parseFloat(t);return Number.isFinite(s)?s:e}updateDropdownViewportConstraints(){if(!this.triggerRef)return;const t=this.triggerRef.getBoundingClientRect(),e=g.VIEWPORT_PADDING,s=g.PORTAL_OFFSET_Y,i=this.parsePixelValue(this.dropdownHeight,260),r=this.parsePixelValue(this.maxDropdownWidth,640),h=Math.max(window.innerHeight-t.bottom-e-s,0),o=Math.max(t.top-e-s,0),l=Math.max(h,o),n=Math.max(window.innerWidth-2*e,0);this.resolvedDropdownHeight=`${Math.min(i,l)}px`,this.resolvedMaxDropdownWidth=`${Math.min(r,n)}px`}handleViewportResize=()=>{this.isOpen&&this.updateDropdownViewportConstraints()};findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),g.CLOSE_ANIMATION_DURATION))}prepareDropdownGeometry(){this.triggerRef&&(this.triggerWidth=`${this.triggerRef.offsetWidth}px`),this.updateDropdownViewportConstraints()}syncFocusedState(t=this.isOpen){this.focused=t||this.triggerHasFocus}handleTriggerFocus=()=>{this.triggerHasFocus=!0,this.syncFocusedState()};handleTriggerBlur=()=>{this.triggerHasFocus=!1,this.syncFocusedState()};handleTriggerClick=()=>{this.isOpen?this.closeDropdown():(this.prepareDropdownGeometry(),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0)};emitUpdate(t){this.update.emit(t)}handleOptionSelect=t=>{const{option:e,leaves:s}=t;if(this.isMulti)this.handleMultiSelect(e,s);else{this.closeDropdown(),this.value=this.emitValue?e.value:e;const t=this.value;requestAnimationFrame((()=>{this.emitUpdate(t)}))}};handleMultiSelect(t,e){const s=this.getSelectedOptions();let i;if(t.children)if(e.every((t=>s.some((e=>e.value===t.value))))){const t=new Set(e.map((t=>t.value)));i=s.filter((e=>!t.has(e.value)))}else{const t=new Set(s.map((t=>t.value))),r=e.filter((e=>!t.has(e.value)));i=[...s,...r]}else i=s.some((e=>e.value===t.value))?s.filter((e=>e.value!==t.value)):[...s,t];this.value=this.toMultiValue(i),this.emitUpdate(this.value)}connectedCallback(){window.addEventListener("resize",this.handleViewportResize)}disconnectedCallback(){window.removeEventListener("resize",this.handleViewportResize),this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const t={open:this.isOpen,parentRef:this.triggerRef,viewportPadding:g.VIEWPORT_PADDING,onSdClose:()=>{this.closeDropdown()}};return i("sd-field",{key:"3c188cbdd8c612e78780d18c03acc382d32080c9",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,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,onMouseEnter:()=>{this.hovered=!0},onMouseLeave:()=>{this.hovered=!1}},i("div",{key:"be596d399856ed966408ba1525fea9dbdf8fcc7e",class:"sd-select",ref:t=>{this.triggerRef=t}},i("sd-select-trigger",{key:"f8a29b1ac2469c60af8c7101d05157674566f00f",ref:t=>{this.triggerComponentRef=t},displayText:this.displayText,placeholder:this.placeholder??"선택",disabled:this.disabled,isOpen:this.isOpen,onSdTriggerClick:this.handleTriggerClick,onSdTriggerFocus:this.handleTriggerFocus,onSdTriggerBlur:this.handleTriggerBlur})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"3cef3f95f69b09d0e4e8f6b01615df4cca031cff",...t},i("sd-select-listbox",{key:"e8833c547aa2e8084754c7a439d3860df5c97e5b",type:this.type,options:this.options,value:this.value,emitValue:this.emitValue,useSearch:this.useSearch,useSelectAll:this.useSelectAll,triggerWidth:this.triggerWidth,maxWidth:this.resolvedMaxDropdownWidth,maxHeight:this.resolvedDropdownHeight,onSdOptionSelect:t=>this.handleOptionSelect(t.detail)})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}};g.style="sd-select{display:inline-flex}sd-select sd-portal{display:none}sd-select .sd-select{position:relative;width:100%;height:100%}";const p=class{constructor(s){t(this,s),this.optionSelect=e(this,"sdOptionSelect",7)}type="default";options=[];value=null;emitValue=!1;useSearch=!1;useSelectAll=!1;triggerWidth="200px";maxWidth="640px";maxHeight="260px";searchKeyword="";isScrolled=!1;focusedIndex=-1;optionSelect;listEl;lastScrolledIndex=-1;keydownAttached=!1;suppressHover=!1;get isDepth(){return"default_depth"===this.type||"multi_depth"===this.type}get isMulti(){return"multi"===this.type||"multi_depth"===this.type}static SELECT_ALL_OPTION={value:"__select_all__",label:"전체"};get showSelectAll(){return this.useSelectAll&&this.isMulti}getAllNonDisabledLeaves(){const t=e=>e.flatMap((e=>e.disabled?[]:e.children?t(e.children):[e]));return t(this.options)}get selectAllState(){if(!this.showSelectAll)return!1;const t=this.getAllNonDisabledLeaves();if(0===t.length)return!1;const e=this.getSelectedValues(),s=t.filter((t=>e.has(t.value))).length;return 0!==s&&(s===t.length||null)}get showSearch(){return!!this.useSearch&&(this.isDepth?h(this.options):this.options.length)>=o}get filteredOptions(){if(""===this.searchKeyword)return this.options;if(this.isDepth)return l(this.options,this.searchKeyword);const t=this.searchKeyword.toLowerCase();return this.options.filter((e=>e.label.toLowerCase().includes(t)))}get isEmpty(){return this.isDepth?0===h(this.filteredOptions)&&0===this.filteredOptions.length:0===this.filteredOptions.length}getSelectedValues(){return null!=this.value&&Array.isArray(this.value)?this.emitValue?new Set(this.value):new Set(this.value.map((t=>t.value))):new Set}isOptionSelected(t){return this.isMulti?this.getSelectedValues().has(t.value):this.emitValue||null==this.value||"object"!=typeof this.value||Array.isArray(this.value)?this.value===t.value:this.value.value===t.value}getGroupSelectionState(t){if(!this.isMulti||!t.children)return!1;const e=this.getSelectedValues();if(0===e.size)return!1;const s=this.collectVisibleLeaves(t);if(0===s.length)return!1;const i=s.filter((t=>e.has(t.value))).length;return 0!==i&&(i===s.length||null)}getCountInfo(t){if(!this.isMulti||!t.children)return;const e=this.getSelectedValues(),s=this.collectVisibleLeaves(t);return{selected:s.filter((t=>e.has(t.value))).length,total:s.length}}findOriginalOption(t,e){for(const s of e){if(s.value===t)return s;if(s.children){const e=this.findOriginalOption(t,s.children);if(e)return e}}}collectLeaves(t){return t.children?t.children.flatMap((t=>this.collectLeaves(t))):[t]}collectVisibleLeaves(t){if(t.disabled)return[];if(!t.children)return[t];if(0===t.children.length){const e=this.findOriginalOption(t.value,this.options);return e?this.collectLeaves(e).filter((t=>!t.disabled)):[]}return t.children.flatMap((t=>this.collectVisibleLeaves(t)))}get navigableOptions(){const t=[];this.showSelectAll&&t.push(p.SELECT_ALL_OPTION);const e=s=>{for(const i of s){const s=!!i.children;(!s||this.isMulti)&&!i.disabled&&t.push(i),s&&i.children&&i.children.length>0&&e(i.children)}};return e(this.filteredOptions),t}isSelectAllOption(t){return this.showSelectAll&&t.value===p.SELECT_ALL_OPTION.value}emitSelectAll(){if(!this.showSelectAll)return;const t=this.getAllNonDisabledLeaves();this.optionSelect.emit({option:{...p.SELECT_ALL_OPTION,children:t},leaves:t})}handleSelectAllClick=t=>{t.stopPropagation(),this.emitSelectAll()};isOptionFocused(t){if(this.focusedIndex<0)return!1;const e=this.navigableOptions[this.focusedIndex];return null!=e&&e.value===t.value}resetFocusOnFilter(){this.focusedIndex=this.navigableOptions.length>0?0:-1,this.suppressHover&&(document.removeEventListener("mousemove",this.releaseHoverSuppress,!0),this.suppressHover=!1)}handleSearchFilter=t=>{this.searchKeyword=t.detail};handleScroll=t=>{this.isScrolled=t.target.scrollTop>0};emitOptionSelect(t){this.optionSelect.emit({option:t,leaves:this.collectVisibleLeaves(t)})}handleOptionClick=t=>{t.stopPropagation(),this.emitOptionSelect(t.detail)};handleOptionHover=t=>{if(this.suppressHover)return;const e=this.navigableOptions.findIndex((e=>e.value===t.value));e>=0&&(this.focusedIndex=e)};releaseHoverSuppress=()=>{this.suppressHover=!1,document.removeEventListener("mousemove",this.releaseHoverSuppress,!0)};handleKeyDown=t=>{const e=this.navigableOptions;if("ArrowDown"===t.key){if(0===e.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<0?0:(this.focusedIndex+1)%e.length,this.beginHoverSuppression()}else if("ArrowUp"===t.key){if(0===e.length)return;t.preventDefault(),t.stopPropagation(),this.focusedIndex=this.focusedIndex<=0?e.length-1:this.focusedIndex-1,this.beginHoverSuppression()}else if("Enter"===t.key){if(this.focusedIndex<0||this.focusedIndex>=e.length)return;t.preventDefault(),t.stopPropagation();const s=e[this.focusedIndex];this.isSelectAllOption(s)?this.emitSelectAll():this.emitOptionSelect(s)}};beginHoverSuppression(){this.suppressHover||(this.suppressHover=!0,document.addEventListener("mousemove",this.releaseHoverSuppress,!0))}scrollFocusedIntoView(){const t=this.listEl,e=t?.querySelector(".sd-select-list-item--focused");if(!t||!e)return;const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();i.top<s.top?t.scrollTop+=i.top-s.top:i.bottom>s.bottom&&(t.scrollTop+=i.bottom-s.bottom)}connectedCallback(){this.keydownAttached||(document.addEventListener("keydown",this.handleKeyDown,!0),this.keydownAttached=!0)}disconnectedCallback(){this.keydownAttached&&(document.removeEventListener("keydown",this.handleKeyDown,!0),this.keydownAttached=!1),this.suppressHover&&(document.removeEventListener("mousemove",this.releaseHoverSuppress,!0),this.suppressHover=!1)}componentDidRender(){this.focusedIndex!==this.lastScrolledIndex&&(this.lastScrolledIndex=this.focusedIndex,this.focusedIndex>=0&&this.scrollFocusedIntoView())}renderOptions(t,e=1){return t.map((t=>{const s=!!t.children;return[i("sd-select-list-item",{option:t,depth:e,isSelected:s?this.getGroupSelectionState(t):this.isOptionSelected(t),isFocused:this.isOptionFocused(t),useCheckbox:this.isMulti,countInfo:this.getCountInfo(t),onSdListItemClick:this.handleOptionClick,onMouseEnter:()=>this.handleOptionHover(t)}),s&&t.children?this.renderOptions(t.children,e+1):null]}))}render(){return i("div",{key:"7505e221ddb890880f0ba5088c3fdc76700e3b2f",class:"sd-select-listbox",style:{"--listbox-trigger-width":this.triggerWidth??"200px","--listbox-max-width":this.maxWidth??"640px","--listbox-max-height":this.maxHeight??"260px","--listbox-radius":`${c.radius}px`}},this.showSearch&&i("sd-select-list-item-search",{key:"54b97ad40c5e7abe92b478689d09337843736652",isScrolled:this.isScrolled,onSdSearchFilter:this.handleSearchFilter}),i("div",{key:"f7417f923cc34cbb2c2a56ae70ed54701d013d3d",class:"sd-select-listbox__list",onScroll:this.handleScroll,ref:t=>{this.listEl=t}},this.showSelectAll&&i("sd-select-list-item",{key:"5e8cfcb1f9f0953b9eaa6fc73de992b52a0a23d7",option:p.SELECT_ALL_OPTION,depth:1,isSelected:this.selectAllState,isFocused:this.isOptionFocused(p.SELECT_ALL_OPTION),useCheckbox:!0,onSdListItemClick:this.handleSelectAllClick,onMouseEnter:()=>this.handleOptionHover(p.SELECT_ALL_OPTION)}),this.isEmpty?i("div",{class:"sd-select-listbox__empty"},n):this.isDepth?this.renderOptions(this.filteredOptions):this.filteredOptions.map((t=>i("sd-select-list-item",{option:t,depth:1,isSelected:this.isOptionSelected(t),isFocused:this.isOptionFocused(t),useCheckbox:this.isMulti,onSdListItemClick:this.handleOptionClick,onMouseEnter:()=>this.handleOptionHover(t)})))))}static get watchers(){return{searchKeyword:[{resetFocusOnFilter:0}]}}};p.style=":host{display:block}:host .sd-select-listbox{display:flex;flex-direction:column;width:var(--listbox-trigger-width);max-width:var(--listbox-max-width);max-height:var(--listbox-max-height);border-radius:var(--listbox-radius);background:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);overflow:hidden;outline:none}:host .sd-select-listbox__list{flex:1;min-height:0;overflow-y:auto;padding-bottom:0}:host .sd-select-listbox__empty{padding:12px;text-align:center;font-size:12px;line-height:20px;color:#888888}";const f=class{constructor(s){t(this,s),this.triggerClick=e(this,"sdTriggerClick",7),this.triggerFocus=e(this,"sdTriggerFocus",7),this.triggerBlur=e(this,"sdTriggerBlur",7)}displayText="";placeholder="선택";disabled=!1;isOpen=!1;triggerClick;triggerFocus;triggerBlur;triggerEl;async sdFocus(){this.disabled||this.triggerEl?.focus()}handleClick=()=>{this.disabled||this.triggerClick.emit()};handleFocus=()=>{this.triggerFocus.emit()};handleBlur=()=>{this.triggerBlur.emit()};render(){const t=""!==this.displayText;return i("div",{key:"3a97ed909e3088528714682050a3986081e19433",ref:t=>{this.triggerEl=t},role:"button","aria-haspopup":"listbox","aria-expanded":this.isOpen?"true":"false",tabindex:this.disabled?-1:0,class:{"sd-select-trigger":!0,"sd-select-trigger--open":this.isOpen,"sd-select-trigger--disabled":this.disabled},style:{"--trigger-padding-x":`${u.paddingX}px`,"--trigger-gap":`${u.gap}px`,"--trigger-font-size":`${a.fontSize}px`,"--trigger-line-height":`${a.lineHeight}px`,"--trigger-font-weight":a.fontWeight,"--trigger-color":this.disabled?d.text.disabled:t?d.text.default:d.icon.default,"--trigger-icon-color":this.disabled?d.icon.disabled:d.icon.default},onClick:this.handleClick,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleClick())},onFocus:this.handleFocus,onBlur:this.handleBlur},i("div",{key:"986faba7d79980f0bcd10fff32495d2100e1805f",class:"sd-select-trigger__content"},i("span",{key:"c51b268186de7cdabcf06ac3d540ccb570c9e865",class:"sd-select-trigger__text"},t?this.displayText:this.placeholder??"선택"),i("sd-icon",{key:"8a03b400d5aef2e0ca9aeb4b1f6122db2932455a",name:"chevronDown",size:12,color:"var(--trigger-icon-color)",class:{"sd-select-trigger__icon":!0,"sd-select-trigger__icon--open":this.isOpen}})))}};f.style="sd-select-trigger{display:block;width:100%;height:100%}sd-select-trigger .sd-select-trigger{display:flex;width:100%;height:100%;cursor:pointer;user-select:none;overflow:hidden;border-radius:3px}sd-select-trigger .sd-select-trigger--disabled{cursor:not-allowed}sd-select-trigger .sd-select-trigger__content{display:flex;align-items:center;gap:var(--trigger-gap);flex:1;padding:0 var(--trigger-padding-x);min-width:0}sd-select-trigger .sd-select-trigger__text{flex:1;font-size:var(--trigger-font-size);line-height:var(--trigger-line-height);font-weight:var(--trigger-font-weight);color:var(--trigger-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}sd-select-trigger .sd-select-trigger__icon{flex-shrink:0;transition:transform 0.2s ease}sd-select-trigger .sd-select-trigger__icon--open{transform:rotate(180deg)}";export{g as sd_select,p as sd_select_listbox,f as sd_select_trigger}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r={button:{xs:{icon:"12"},sm:{icon:"16"},md:{icon:"20"},lg:{icon:"24"},border:{disabled:"#CCCCCC"},bg:{disabled:"#E1E1E1"},text:{disabled:"#888888"},brand:{strong:{bg:{default:"#025497",hover:"#004177"},content:"#FFFFFF"},subtle:{bg:{default:"#1F8AE1",hover:"#006AC1"},content:"#FFFFFF"},outline:{bg:{default:"#FFFFFF",hover:"#EAF5FE"},border:"#025497",content:"#025497"}},dropdown:{brand:{strong:{split:"#006AC1"},subtle:{split:"#5CB0F3"}},danger:{strong:{split:"#FF7C7C"}}},neutral:{outline:{bg:{default:"#FFFFFF",hover:"#EEEEEE"},border:"#888888",content:"#222222"}},danger:{strong:{bg:{default:"#E30000",hover:"#AD0000"},content:"#FFFFFF"},outline:{bg:{default:"#FFFFFF",hover:"#FCEFEF"},border:"#E30000",content:"#E30000"}}}};const a="#0075FF",e={primary:r.button.brand.strong.bg.default,secondary:r.button.brand.subtle.bg.default,primary_outline:r.button.brand.outline.bg.default,neutral_outline:r.button.neutral.outline.bg.default,danger:r.button.danger.strong.bg.default,danger_outline:r.button.danger.outline.bg.default},n={primary_xs:{variant:"primary",size:"xs",color:e.primary},secondary_xs:{variant:"primary",size:"xs",color:e.secondary},primary_outline_xs:{variant:"outline",size:"xs",color:e.primary_outline},neutral_outline_xs:{variant:"outline",size:"xs",color:e.neutral_outline},danger_xs:{variant:"primary",size:"xs",color:e.danger},danger_outline_xs:{variant:"outline",size:"xs",color:e.danger_outline},primary_sm:{variant:"primary",size:"sm",color:e.primary},secondary_sm:{variant:"primary",size:"sm",color:e.secondary},primary_outline_sm:{variant:"outline",size:"sm",color:e.primary_outline},neutral_outline_sm:{variant:"outline",size:"sm",color:e.neutral_outline},danger_sm:{variant:"primary",size:"sm",color:e.danger},danger_outline_sm:{variant:"outline",size:"sm",color:e.danger_outline},primary_md:{variant:"primary",size:"md",color:e.primary},secondary_md:{variant:"primary",size:"md",color:e.secondary},primary_outline_md:{variant:"outline",size:"md",color:e.primary_outline},neutral_outline_md:{variant:"outline",size:"md",color:e.neutral_outline},danger_md:{variant:"primary",size:"md",color:e.danger},danger_outline_md:{variant:"outline",size:"md",color:e.danger_outline},primary_lg:{variant:"primary",size:"lg",color:e.primary},secondary_lg:{variant:"primary",size:"lg",color:e.secondary},primary_outline_lg:{variant:"outline",size:"lg",color:e.primary_outline},neutral_outline_lg:{variant:"outline",size:"lg",color:e.neutral_outline},danger_lg:{variant:"primary",size:"lg",color:e.danger},danger_outline_lg:{variant:"outline",size:"lg",color:e.danger_outline}},i={xs:Number(r.button.xs.icon),sm:Number(r.button.sm.icon),md:Number(r.button.md.icon),lg:Number(r.button.lg.icon)},o={primary:r.button.brand.strong.bg.hover,secondary:r.button.brand.subtle.bg.hover,primary_outline:r.button.brand.outline.bg.hover,neutral_outline:r.button.neutral.outline.bg.hover,danger:r.button.danger.strong.bg.hover,danger_outline:r.button.danger.outline.bg.hover},t={primary:r.button.brand.strong.content,secondary:r.button.brand.subtle.content,primary_outline:r.button.brand.outline.content,neutral_outline:r.button.neutral.outline.content,danger:r.button.danger.strong.content,danger_outline:r.button.danger.outline.content},l={primary:"transparent",secondary:"transparent",primary_outline:r.button.brand.outline.border,neutral_outline:r.button.neutral.outline.border,danger:"transparent",danger_outline:r.button.danger.outline.border},s=/_(xs|sm|md|lg)$/,d=r=>r in n,m=r=>r.replace(s,"");export{n as B,t as P,i as a,a as b,l as c,o as d,r as e,m as g,d as i}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={table:{header:{height:"36",paddingX:"16",gap:"4",bg:"#F5FAFF",typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontWeight:"500",fontSize:"12",lineHeight:"20",textDecoration:"none"},resizingBar:{color:"#CCCCCC",height:"16"}},body:{default:{height:"44",paddingY:"8"},dense:{height:"32",paddingY:"6"},paddingX:"16",frame:{padding:"8"},typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontWeight:"400",fontSize:"12",lineHeight:"20",textDecoration:"none"}},border:{color:"#E1E1E1",width:"1"},content:{gap:"8"},radius:"8",keyValue:{body:{padding:"8"},height:"44",search:{paddingX:"32",bg:"#F9F9F9"}},separator:{color:"#EEEEEE",
|
|
1
|
+
var e={table:{header:{height:"36",paddingX:"16",gap:"4",bg:"#F5FAFF",typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontWeight:"500",fontSize:"12",lineHeight:"20",textDecoration:"none"},resizingBar:{color:"#CCCCCC",height:"16"}},body:{default:{height:"44",paddingY:"8"},dense:{height:"32",paddingY:"6"},paddingX:"16",frame:{padding:"8"},typography:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontWeight:"400",fontSize:"12",lineHeight:"20",textDecoration:"none"}},border:{color:"#E1E1E1",width:"1"},content:{gap:"8"},radius:"8",keyValue:{body:{padding:"8"},height:"44",search:{paddingX:"32",bg:"#F9F9F9"}},separator:{color:"#EEEEEE",width:{default:"6",dense:"4"}}}};export{e as t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as a}from"./p-D6GUzecR.js";import{s as o}from"./p-j2khhcHY.js";const t={height:a.table.header.height,paddingX:a.table.header.paddingX,gap:a.table.header.gap},e={fontFamily:a.table.header.typography.fontFamily,fontWeight:a.table.header.typography.fontWeight,fontSize:a.table.header.typography.fontSize,lineHeight:a.table.header.typography.lineHeight,textDecoration:a.table.header.typography.textDecoration},i={bg:a.table.header.bg},s={color:a.table.header.resizingBar.color,height:a.table.header.resizingBar.height},n={default:{height:a.table.body.default.height,paddingY:a.table.body.default.paddingY},dense:{height:a.table.body.dense.height,paddingY:a.table.body.dense.paddingY},paddingX:a.table.body.paddingX,framePadding:a.table.body.frame.padding},d={fontFamily:a.table.body.typography.fontFamily,fontWeight:a.table.body.typography.fontWeight,fontSize:a.table.body.typography.fontSize,lineHeight:a.table.body.typography.lineHeight,textDecoration:a.table.body.typography.textDecoration},r={color:a.table.border.color,width:a.table.border.width},g={color:a.table.separator.color,width:a.table.separator.width.default,denseWidth:a.table.separator.width.dense},h=a.table.radius,p=48,c={pageEdit:o.color.darkblue.strong,arrowDown:o.color.darkblue.strong,arrowUp:o.color.darkblue.strong,updown:o.color.grey.strong,pageMove:o.color.darkblue.strong,star:o.color.blue.strong},f=(a,o)=>o??c[a],w=a=>"asc"===a?"arrowDown":"desc"===a?"arrowUp":"updown";export{n as T,p as a,d as b,r as c,h as d,w as e,s as f,e as g,i as h,t as i,g as j,f as r}
|