@sellmate/design-system 1.0.78 → 1.2.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-CMqGfEui.js +66 -0
- package/dist/cjs/design-system.cjs.js +2 -2
- package/dist/cjs/{index--F2wGuAi.js → index-Cw-78mnC.js} +1 -1
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{resolveColor-LhfOKtTZ.js → resolveColor-B0hzQNLG.js} +2 -2
- package/dist/cjs/sd-action-modal.cjs.entry.js +3 -3
- package/dist/cjs/sd-badge.cjs.entry.js +2 -3
- package/dist/cjs/sd-barcode-input.cjs.entry.js +3 -3
- package/dist/cjs/{sd-button-v2.config-CnqCQQMi.js → sd-button.config-DH08UNfl.js} +114 -28
- package/dist/cjs/{sd-button-v2_2.cjs.entry.js → sd-button_2.cjs.entry.js} +102 -85
- package/dist/cjs/sd-calendar.cjs.entry.js +15 -15
- package/dist/cjs/sd-card.cjs.entry.js +2 -2
- package/dist/cjs/sd-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/sd-chip.cjs.entry.js +4 -4
- package/dist/cjs/sd-circle-progress.cjs.entry.js +3 -3
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +19 -11
- package/dist/cjs/sd-date-box.cjs.entry.js +9 -4
- package/dist/cjs/{sd-date-picker-calendar.cjs.entry.js → sd-date-picker-calendar_2.cjs.entry.js} +59 -6
- package/dist/cjs/{sd-date-picker.config-CRgCT5dn.js → sd-date-picker.config-CjvrFpYK.js} +1 -2
- package/dist/cjs/sd-date-picker_7.cjs.entry.js +1235 -0
- package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +14 -14
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +32 -27
- package/dist/cjs/{sd-button_4.cjs.entry.js → sd-field_3.cjs.entry.js} +47 -102
- package/dist/cjs/sd-form.cjs.entry.js +5 -5
- package/dist/cjs/sd-ghost-button.cjs.entry.js +12 -10
- package/dist/cjs/sd-guide.cjs.entry.js +11 -11
- package/dist/cjs/sd-key-value-table.cjs.entry.js +230 -0
- package/dist/cjs/sd-linear-progress.cjs.entry.js +3 -3
- package/dist/cjs/sd-loading-container.cjs.entry.js +3 -3
- package/dist/cjs/sd-modal-container.cjs.entry.js +3 -3
- package/dist/cjs/{sd-pagination_5.cjs.entry.js → sd-pagination_4.cjs.entry.js} +136 -325
- package/dist/cjs/sd-popover.cjs.entry.js +18 -11
- package/dist/cjs/sd-popup.cjs.entry.js +112 -0
- package/dist/cjs/sd-portal.cjs.entry.js +3 -3
- package/dist/cjs/sd-radio-button.cjs.entry.js +9 -6
- package/dist/cjs/sd-radio.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-list-item_2.cjs.entry.js +159 -0
- package/dist/cjs/sd-select.config-B19ptCT2.js +178 -0
- package/dist/cjs/{sd-select-list-item_4.cjs.entry.js → sd-select_3.cjs.entry.js} +296 -323
- package/dist/cjs/sd-switch.cjs.entry.js +2 -2
- package/dist/cjs/sd-table.cjs.entry.js +188 -48
- package/dist/cjs/sd-table.config-BIpldZtw.js +76 -0
- package/dist/cjs/sd-tabs.cjs.entry.js +8 -3
- package/dist/cjs/sd-tag.cjs.entry.js +56 -21
- package/dist/cjs/sd-td.cjs.entry.js +52 -10
- package/dist/cjs/sd-text-link.cjs.entry.js +13 -5
- package/dist/cjs/sd-toast-container.cjs.entry.js +5 -5
- package/dist/cjs/sd-toast.cjs.entry.js +35 -5
- package/dist/cjs/sd-toggle.cjs.entry.js +2 -2
- package/dist/cjs/{system-DpTN1vBC.js → system-VmZRYp6V.js} +4 -2
- package/dist/cjs/{tooltipArrow-D1-wcNm1.js → tooltipArrow-BjSFKIUq.js} +1 -1
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/assets/CheckboxCheck.js +5 -0
- package/dist/collection/components/assets/CheckboxIndeterminate.js +5 -0
- package/dist/collection/components/assets/index.js +4 -0
- package/dist/collection/components/sd-action-modal/sd-action-modal.css +1 -1
- package/dist/collection/components/sd-action-modal/sd-action-modal.js +7 -7
- package/dist/collection/components/sd-badge/sd-badge.config.js +10 -1
- package/dist/collection/components/sd-badge/sd-badge.js +1 -22
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +4 -4
- package/dist/collection/components/{sd-button-v2/sd-button-v2.config.js → sd-button/sd-button.config.js} +1 -1
- package/dist/collection/components/sd-button/sd-button.css +47 -93
- package/dist/collection/components/sd-button/sd-button.js +100 -173
- package/dist/collection/components/sd-calendar/sd-calendar.js +14 -14
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-checkbox/sd-checkbox.js +3 -3
- package/dist/collection/components/sd-chip/sd-chip.js +4 -4
- package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +1 -1
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +13 -8
- package/dist/collection/components/sd-date-box/sd-date-box.js +8 -3
- package/dist/collection/components/sd-date-picker/sd-date-picker-calendar/sd-date-picker-calendar.js +4 -4
- package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.css +1 -1
- package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +13 -6
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +4 -4
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +12 -12
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +5 -5
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.config.js +7 -3
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +13 -11
- package/dist/collection/components/sd-field/sd-field.css +6 -2
- package/dist/collection/components/sd-field/sd-field.js +48 -22
- package/dist/collection/components/sd-file-picker/sd-file-picker.js +10 -5
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.css +1 -3
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +6 -6
- package/dist/collection/components/sd-form/sd-form.js +4 -4
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.js +12 -10
- package/dist/collection/components/sd-guide/sd-guide.css +8 -172
- package/dist/collection/components/sd-guide/sd-guide.js +8 -6
- package/dist/collection/components/sd-icon/sd-icon.js +4 -4
- package/dist/collection/components/sd-input/sd-input.css +4 -2
- package/dist/collection/components/sd-input/sd-input.js +6 -6
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.config.js +36 -0
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.css +119 -0
- package/dist/collection/components/sd-key-value-table/sd-key-value-table.js +301 -0
- package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
- package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
- package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +6 -3
- package/dist/collection/components/sd-modal-container/sd-modal-container.js +2 -2
- package/dist/collection/components/sd-number-input/sd-number-input.css +7 -0
- package/dist/collection/components/sd-number-input/sd-number-input.js +8 -5
- package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
- package/dist/collection/components/sd-popover/sd-popover.js +129 -36
- package/dist/collection/components/sd-popup/sd-popup.config.js +34 -0
- package/dist/collection/components/sd-popup/sd-popup.css +73 -0
- package/dist/collection/components/sd-popup/sd-popup.js +163 -0
- package/dist/collection/components/sd-portal/sd-portal.js +2 -2
- package/dist/collection/components/sd-radio/sd-radio.js +1 -1
- package/dist/collection/components/sd-radio-button/sd-radio-button.js +8 -5
- package/dist/collection/components/sd-radio-group/sd-radio-group.js +2 -2
- package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +7 -3
- package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.css +4 -4
- package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +7 -7
- package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +8 -8
- package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +9 -4
- package/dist/collection/components/sd-select/sd-select.js +6 -6
- package/dist/collection/components/sd-switch/sd-switch.js +1 -1
- package/dist/collection/components/sd-table/sd-table.config.js +6 -2
- package/dist/collection/components/sd-table/sd-table.css +30 -11
- package/dist/collection/components/sd-table/sd-table.js +233 -50
- package/dist/collection/components/sd-table/sd-table.stories.helpers.js +2 -3
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +5 -5
- package/dist/collection/components/sd-table/sd-td/sd-td.js +111 -9
- package/dist/collection/components/sd-table/sd-thead/sd-thead.js +30 -16
- package/dist/collection/components/sd-table/sd-tr/sd-tr.css +24 -1
- package/dist/collection/components/sd-table/sd-tr/sd-tr.js +116 -19
- package/dist/collection/components/sd-tabs/sd-tabs.js +7 -2
- package/dist/collection/components/sd-tag/sd-tag.config.js +43 -11
- package/dist/collection/components/sd-tag/sd-tag.js +13 -7
- package/dist/collection/components/sd-text-link/sd-text-link.css +1 -0
- package/dist/collection/components/sd-text-link/sd-text-link.js +10 -4
- package/dist/collection/components/sd-textarea/sd-textarea.css +3 -0
- package/dist/collection/components/sd-textarea/sd-textarea.js +2 -2
- package/dist/collection/components/sd-toast/sd-toast.config.js +14 -0
- package/dist/collection/components/sd-toast/sd-toast.css +3 -5
- package/dist/collection/components/sd-toast/sd-toast.js +52 -5
- package/dist/collection/components/sd-toast-container/sd-toast-container.js +4 -4
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +77 -30
- package/dist/collection/utils/color/resolveColor.js +2 -2
- package/dist/collection/utils/dropdown-manager.js +1 -1
- package/dist/collection/utils/modal.js +1 -1
- package/dist/collection/utils/toast.js +4 -4
- package/dist/components/index.js +1 -1
- package/dist/components/p-2wB9cing.js +1 -0
- package/dist/components/p-B-sK7I83.js +1 -0
- package/dist/components/p-B3D43x7F.js +1 -0
- package/dist/components/p-B7mpdnNl.js +1 -0
- package/dist/components/{p-TwGlKfsC.js → p-BAcmO7w0.js} +1 -1
- package/dist/components/p-BL0ZcHK8.js +1 -0
- package/dist/components/p-BXCyVrle.js +1 -0
- package/dist/components/p-BY1LGlfc.js +1 -0
- package/dist/components/p-BjkROjjt.js +1 -0
- package/dist/components/p-Bm3W_eBv.js +1 -0
- package/dist/components/p-BnfUIhUj.js +1 -0
- package/dist/components/{p-Dcc2Vm6z.js → p-BorUSgEK.js} +1 -1
- package/dist/components/{p-Bvq0Vpln.js → p-BsM-fwYd.js} +1 -1
- package/dist/components/p-C5CH-s6a.js +1 -0
- package/dist/components/p-C7WLft_0.js +1 -0
- package/dist/components/p-CK9ciBIR.js +1 -0
- package/dist/components/p-CQI40kiY.js +1 -0
- package/dist/components/p-CRL7TjSB.js +1 -0
- package/dist/components/p-CdOHomUp.js +1 -0
- package/dist/components/p-Ch5Yu1qd.js +1 -0
- package/dist/components/p-Cktiasfd.js +1 -0
- package/dist/components/p-CsVAx6KV.js +1 -0
- package/dist/components/p-D0Jiw-Zk.js +1 -0
- package/dist/components/p-D5F7wCNo.js +1 -0
- package/dist/components/p-DBFgk0rX.js +1 -0
- package/dist/components/p-DFLCjX1a.js +1 -0
- package/dist/components/p-DL1ac1QS.js +1 -0
- package/dist/components/p-DdLntfiw.js +1 -0
- package/dist/components/p-DeQcDHpn.js +1 -0
- package/dist/components/p-DfK4DiDI.js +1 -0
- package/dist/components/p-DhTcn6jX.js +1 -0
- package/dist/components/p-Dl8TIEQu.js +1 -0
- package/dist/components/p-DyAnn9ea.js +1 -0
- package/dist/components/p-GBlVDmy4.js +1 -0
- package/dist/components/p-Jts7ueOa.js +1 -0
- package/dist/components/p-arZfxxPn.js +1 -0
- package/dist/components/p-mmdt-WnS.js +1 -0
- package/dist/components/p-nOCYbyW4.js +1 -0
- package/dist/components/p-teN3CfOr.js +1 -0
- package/dist/components/p-u8teDaMa.js +1 -0
- package/dist/components/p-wCNRlKLa.js +1 -0
- package/dist/components/sd-action-modal.js +1 -1
- package/dist/components/sd-badge.js +1 -1
- package/dist/components/sd-barcode-input.js +1 -1
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-calendar.js +1 -1
- package/dist/components/sd-card.js +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-chip.js +1 -1
- package/dist/components/sd-circle-progress.js +1 -1
- package/dist/components/sd-confirm-modal.js +1 -1
- package/dist/components/sd-date-box.js +1 -1
- package/dist/components/sd-date-picker-calendar.js +1 -1
- package/dist/components/sd-date-picker-trigger.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker-calendar.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-dropdown-button.js +1 -1
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-file-picker.js +1 -1
- package/dist/components/sd-floating-portal.js +1 -1
- package/dist/components/sd-form.js +1 -1
- package/dist/components/sd-ghost-button.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-icon.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-key-value-table.d.ts +11 -0
- package/dist/components/sd-key-value-table.js +1 -0
- package/dist/components/sd-linear-progress.js +1 -1
- package/dist/components/sd-loading-container.js +1 -1
- package/dist/components/sd-loading-modal.js +1 -1
- package/dist/components/sd-modal-container.js +1 -1
- package/dist/components/sd-number-input.js +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +1 -1
- package/dist/components/{sd-button-v2.d.ts → sd-popup.d.ts} +4 -4
- package/dist/components/sd-popup.js +1 -0
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-radio-button.js +1 -1
- package/dist/components/sd-radio-group.js +1 -1
- package/dist/components/sd-radio.js +1 -1
- package/dist/components/sd-select-list-item-search.js +1 -1
- package/dist/components/sd-select-list-item.js +1 -1
- package/dist/components/sd-select-listbox.js +1 -1
- package/dist/components/sd-select-trigger.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-switch.js +1 -1
- package/dist/components/sd-table.js +1 -1
- package/dist/components/sd-tabs.js +1 -1
- package/dist/components/sd-tag.js +1 -1
- package/dist/components/sd-tbody.js +1 -1
- package/dist/components/sd-td.js +1 -1
- package/dist/components/sd-text-link.js +1 -1
- package/dist/components/sd-textarea.js +1 -1
- package/dist/components/sd-thead.js +1 -1
- package/dist/components/sd-toast-container.js +1 -1
- package/dist/components/sd-toast.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/components/sd-tr.js +1 -1
- package/dist/design-system/design-system.css +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/index.esm.js +1 -1
- package/dist/design-system/p-04fdb4b1.entry.js +1 -0
- package/dist/design-system/p-05611ff7.entry.js +1 -0
- package/dist/design-system/p-0U6dRjlq.js +2 -0
- package/dist/design-system/{p-fe9cef6a.entry.js → p-0fe603a4.entry.js} +1 -1
- package/dist/design-system/p-100f5887.entry.js +1 -0
- package/dist/design-system/p-18c5ae1a.entry.js +1 -0
- package/dist/design-system/p-1baa05ae.entry.js +1 -0
- package/dist/design-system/p-2a1ef965.entry.js +1 -0
- package/dist/design-system/p-2c63404f.entry.js +1 -0
- package/dist/design-system/{p-33bc3176.entry.js → p-435ae69e.entry.js} +1 -1
- package/dist/design-system/p-43e97572.entry.js +1 -0
- package/dist/design-system/p-44d05570.entry.js +1 -0
- package/dist/design-system/p-501fae20.entry.js +1 -0
- package/dist/design-system/{p-ead3e688.entry.js → p-5705e6d6.entry.js} +1 -1
- package/dist/design-system/p-5cbaf1db.entry.js +1 -0
- package/dist/design-system/p-5ed0becf.entry.js +1 -0
- package/dist/design-system/p-5f1c39b8.entry.js +1 -0
- package/dist/design-system/p-66af0ba0.entry.js +1 -0
- package/dist/design-system/p-77690440.entry.js +1 -0
- package/dist/design-system/p-78cc0289.entry.js +1 -0
- package/dist/design-system/p-790165f8.entry.js +1 -0
- package/dist/design-system/p-80466582.entry.js +1 -0
- package/dist/design-system/{p-e5cebccd.entry.js → p-857c44e8.entry.js} +1 -1
- package/dist/design-system/{p-f522c91d.entry.js → p-87c868c3.entry.js} +1 -1
- package/dist/design-system/p-8db7d8f2.entry.js +1 -0
- package/dist/design-system/p-8ee990bd.entry.js +1 -0
- package/dist/design-system/p-8f22106e.entry.js +1 -0
- package/dist/design-system/p-BDjErF_K.js +1 -0
- package/dist/design-system/p-BnfUIhUj.js +1 -0
- package/dist/{components/p-DkJqVXpD.js → design-system/p-C29HUShl.js} +1 -1
- package/dist/design-system/{p-BxPyZJaz.js → p-Ce0cmS4R.js} +1 -1
- package/dist/design-system/p-CxOCk_ge.js +1 -0
- package/dist/design-system/p-GBlVDmy4.js +1 -0
- package/dist/design-system/p-a6545130.entry.js +1 -0
- package/dist/design-system/p-ae2d45a2.entry.js +1 -0
- package/dist/design-system/{p-797517b5.entry.js → p-aeccfb2b.entry.js} +1 -1
- package/dist/design-system/p-b0aad445.entry.js +1 -0
- package/dist/design-system/p-b3c144ff.entry.js +1 -0
- package/dist/design-system/p-caee95b0.entry.js +1 -0
- package/dist/design-system/p-d30c823e.entry.js +1 -0
- package/dist/design-system/{p-3f7bc660.entry.js → p-d3212544.entry.js} +1 -1
- package/dist/design-system/p-d8c41313.entry.js +1 -0
- package/dist/design-system/{p-6bfe3612.entry.js → p-de8bb9ba.entry.js} +1 -1
- package/dist/design-system/p-e2334c1c.entry.js +1 -0
- package/dist/design-system/p-f4d73a0c.entry.js +1 -0
- package/dist/design-system/p-fc973500.entry.js +1 -0
- package/dist/design-system/p-fe0a5368.entry.js +1 -0
- package/dist/design-system/p-mmdt-WnS.js +1 -0
- package/dist/esm/component.table-BnfUIhUj.js +64 -0
- package/dist/esm/design-system.js +3 -3
- package/dist/esm/{index-Cnwbjz1F.js → index-0U6dRjlq.js} +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{resolveColor-BxPyZJaz.js → resolveColor-Ce0cmS4R.js} +2 -2
- package/dist/esm/sd-action-modal.entry.js +3 -3
- package/dist/esm/sd-badge.entry.js +2 -3
- package/dist/esm/sd-barcode-input.entry.js +3 -3
- package/dist/esm/{sd-button-v2.config-CV4xelxV.js → sd-button.config-BDjErF_K.js} +88 -3
- package/dist/esm/{sd-button-v2_2.entry.js → sd-button_2.entry.js} +102 -85
- package/dist/esm/sd-calendar.entry.js +15 -15
- package/dist/esm/sd-card.entry.js +2 -2
- package/dist/esm/sd-checkbox.entry.js +4 -4
- package/dist/esm/sd-chip.entry.js +4 -4
- package/dist/esm/sd-circle-progress.entry.js +3 -3
- package/dist/esm/sd-confirm-modal_2.entry.js +19 -11
- package/dist/esm/sd-date-box.entry.js +9 -4
- package/dist/esm/{sd-date-picker-calendar.entry.js → sd-date-picker-calendar_2.entry.js} +59 -7
- package/dist/esm/{sd-date-picker.config-C2fDbE9d.js → sd-date-picker.config-B6cqMQaM.js} +1 -2
- package/dist/esm/sd-date-picker_7.entry.js +1227 -0
- package/dist/esm/sd-date-range-picker-calendar.entry.js +14 -14
- package/dist/esm/sd-dropdown-button.entry.js +21 -16
- package/dist/esm/{sd-button_4.entry.js → sd-field_3.entry.js} +48 -102
- package/dist/esm/sd-form.entry.js +5 -5
- package/dist/esm/sd-ghost-button.entry.js +12 -10
- package/dist/esm/sd-guide.entry.js +11 -11
- package/dist/esm/sd-key-value-table.entry.js +228 -0
- package/dist/esm/sd-linear-progress.entry.js +3 -3
- package/dist/esm/sd-loading-container.entry.js +3 -3
- package/dist/esm/sd-modal-container.entry.js +3 -3
- package/dist/esm/{sd-pagination_5.entry.js → sd-pagination_4.entry.js} +137 -325
- package/dist/esm/sd-popover.entry.js +18 -11
- package/dist/esm/sd-popup.entry.js +110 -0
- package/dist/esm/sd-portal.entry.js +3 -3
- package/dist/esm/sd-radio-button.entry.js +9 -6
- package/dist/esm/sd-radio.entry.js +2 -2
- package/dist/esm/sd-select-list-item_2.entry.js +156 -0
- package/dist/esm/sd-select.config-CxOCk_ge.js +165 -0
- package/dist/esm/{sd-select-list-item_4.entry.js → sd-select_3.entry.js} +281 -307
- package/dist/esm/sd-switch.entry.js +2 -2
- package/dist/esm/{sd-table.config-Bj-EEo7N.js → sd-table.config-B-VgXXT7.js} +16 -46
- package/dist/esm/sd-table.entry.js +188 -48
- package/dist/esm/sd-tabs.entry.js +8 -3
- package/dist/esm/sd-tag.entry.js +56 -21
- package/dist/esm/sd-td.entry.js +52 -10
- package/dist/esm/sd-text-link.entry.js +13 -5
- package/dist/esm/sd-toast-container.entry.js +5 -5
- package/dist/esm/sd-toast.entry.js +35 -5
- package/dist/esm/sd-toggle.entry.js +2 -2
- package/dist/esm/{system-CZ4ltUOw.js → system-GBlVDmy4.js} +4 -2
- package/dist/esm/{tooltipArrow-D8sr81Xw.js → tooltipArrow-O5LOsHae.js} +1 -1
- package/dist/types/components/assets/CheckboxCheck.d.ts +1 -0
- package/dist/types/components/assets/CheckboxIndeterminate.d.ts +1 -0
- package/dist/types/components/assets/index.d.ts +2 -0
- package/dist/types/components/sd-action-modal/sd-action-modal.d.ts +2 -2
- package/dist/types/components/sd-badge/sd-badge.d.ts +0 -1
- package/dist/types/components/{sd-button-v2/sd-button-v2.config.d.ts → sd-button/sd-button.config.d.ts} +9 -15
- package/dist/types/components/sd-button/sd-button.d.ts +11 -13
- package/dist/types/components/sd-confirm-modal/sd-confirm-modal.config.d.ts +3 -3
- package/dist/types/components/sd-confirm-modal/sd-confirm-modal.d.ts +2 -1
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.config.d.ts +6 -5
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.d.ts +1 -0
- package/dist/types/components/sd-field/sd-field.d.ts +1 -0
- package/dist/types/components/sd-key-value-table/sd-key-value-table.config.d.ts +105 -0
- package/dist/types/components/sd-key-value-table/sd-key-value-table.d.ts +38 -0
- package/dist/types/components/sd-loading-modal/sd-loading-modal.config.d.ts +2 -2
- package/dist/types/components/sd-loading-modal/sd-loading-modal.d.ts +1 -0
- package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +1 -1
- package/dist/types/components/sd-popover/sd-popover.d.ts +16 -10
- package/dist/types/components/sd-popup/sd-popup.config.d.ts +30 -0
- package/dist/types/components/sd-popup/sd-popup.d.ts +11 -0
- package/dist/types/components/sd-table/constants.d.ts +2 -0
- package/dist/types/components/sd-table/sd-table.config.d.ts +4 -0
- package/dist/types/components/sd-table/sd-table.d.ts +21 -15
- package/dist/types/components/sd-table/sd-td/sd-td.d.ts +6 -0
- package/dist/types/components/sd-table/sd-tr/sd-tr.d.ts +9 -0
- package/dist/types/components/sd-tag/sd-tag.d.ts +2 -0
- package/dist/types/components/sd-toast/sd-toast.config.d.ts +5 -1
- package/dist/types/components/sd-toast/sd-toast.d.ts +2 -0
- package/dist/types/components/sd-toast-container/sd-toast-container.config.d.ts +2 -0
- package/dist/types/components/sd-tooltip/sd-tooltip.config.d.ts +2 -13
- package/dist/types/components/sd-tooltip/sd-tooltip.d.ts +6 -4
- package/dist/types/components.d.ts +278 -192
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/form.d.ts +1 -1
- package/dist/types/types/global.d.ts +14 -13
- package/dist/types/utils/toast.d.ts +1 -1
- package/hydrate/index.js +5513 -4761
- package/hydrate/index.mjs +5513 -4761
- package/package.json +111 -97
- package/readme.md +13 -7
- package/dist/cjs/component.button-cqV-iCG5.js +0 -90
- package/dist/cjs/sd-date-picker-trigger.cjs.entry.js +0 -51
- package/dist/cjs/sd-date-picker.cjs.entry.js +0 -117
- package/dist/cjs/sd-date-range-picker.cjs.entry.js +0 -123
- package/dist/cjs/sd-file-picker.cjs.entry.js +0 -244
- package/dist/cjs/sd-input.cjs.entry.js +0 -175
- package/dist/cjs/sd-number-input.cjs.entry.js +0 -409
- package/dist/cjs/sd-radio-group.cjs.entry.js +0 -46
- package/dist/cjs/sd-table.config-Cb0Ot3C6.js +0 -105
- package/dist/cjs/sd-textarea.cjs.entry.js +0 -146
- package/dist/collection/components/sd-button-v2/sd-button-v2.css +0 -125
- package/dist/collection/components/sd-button-v2/sd-button-v2.js +0 -273
- package/dist/components/p-B1XBwjCW.js +0 -1
- package/dist/components/p-B8jXOXtJ.js +0 -1
- package/dist/components/p-BE6TxbtX.js +0 -1
- package/dist/components/p-BJsHakU2.js +0 -1
- package/dist/components/p-BStczlLa.js +0 -1
- package/dist/components/p-BcMNA89i.js +0 -1
- package/dist/components/p-BheX6lAy.js +0 -1
- package/dist/components/p-BmYM7-4v.js +0 -1
- package/dist/components/p-BppjYHF6.js +0 -1
- package/dist/components/p-BwWDMpJc.js +0 -1
- package/dist/components/p-C-kw2p2a.js +0 -1
- package/dist/components/p-C5qZtNLl.js +0 -1
- package/dist/components/p-C7DajKYn.js +0 -1
- package/dist/components/p-CZ4ltUOw.js +0 -1
- package/dist/components/p-CeVMl_M9.js +0 -1
- package/dist/components/p-D1DpOp6M.js +0 -1
- package/dist/components/p-D3gjBBCU.js +0 -1
- package/dist/components/p-DC-6inj0.js +0 -1
- package/dist/components/p-DRF0He-x.js +0 -1
- package/dist/components/p-DegvQLTF.js +0 -1
- package/dist/components/p-Dey-lS6x.js +0 -1
- package/dist/components/p-DfH_fO01.js +0 -1
- package/dist/components/p-DngV3MT1.js +0 -1
- package/dist/components/p-EbjZr2OA.js +0 -1
- package/dist/components/p-LwWOleLJ.js +0 -1
- package/dist/components/p-Nvx13YlG.js +0 -1
- package/dist/components/p-ZMpCZhXP.js +0 -1
- package/dist/components/p-dNJIFthT.js +0 -1
- package/dist/components/p-q0VWISKA.js +0 -1
- package/dist/components/p-xnLvZ-xn.js +0 -1
- package/dist/components/sd-button-v2.js +0 -1
- package/dist/design-system/p-0356c195.entry.js +0 -1
- package/dist/design-system/p-045bc426.entry.js +0 -1
- package/dist/design-system/p-12dfd239.entry.js +0 -1
- package/dist/design-system/p-16d3a485.entry.js +0 -1
- package/dist/design-system/p-1706ed6f.entry.js +0 -1
- package/dist/design-system/p-182548f7.entry.js +0 -1
- package/dist/design-system/p-1a79edce.entry.js +0 -1
- package/dist/design-system/p-1cf87e87.entry.js +0 -1
- package/dist/design-system/p-25a08e98.entry.js +0 -1
- package/dist/design-system/p-2812b9ce.entry.js +0 -1
- package/dist/design-system/p-38f661ea.entry.js +0 -1
- package/dist/design-system/p-429dab5c.entry.js +0 -1
- package/dist/design-system/p-455dccf5.entry.js +0 -1
- package/dist/design-system/p-59313838.entry.js +0 -1
- package/dist/design-system/p-6af01ab0.entry.js +0 -1
- package/dist/design-system/p-70d4903f.entry.js +0 -1
- package/dist/design-system/p-767e99f9.entry.js +0 -1
- package/dist/design-system/p-7c370335.entry.js +0 -1
- package/dist/design-system/p-7fe8be6a.entry.js +0 -1
- package/dist/design-system/p-83b262dc.entry.js +0 -1
- package/dist/design-system/p-881adaa5.entry.js +0 -1
- package/dist/design-system/p-88d7303c.entry.js +0 -1
- package/dist/design-system/p-8a601e0f.entry.js +0 -1
- package/dist/design-system/p-B1XBwjCW.js +0 -1
- package/dist/design-system/p-BsrEibf7.js +0 -1
- package/dist/design-system/p-C5qZtNLl.js +0 -1
- package/dist/design-system/p-CZ4ltUOw.js +0 -1
- package/dist/design-system/p-Cnwbjz1F.js +0 -2
- package/dist/design-system/p-DnCBBIoq.js +0 -1
- package/dist/design-system/p-a82be987.entry.js +0 -1
- package/dist/design-system/p-b917c82a.entry.js +0 -1
- package/dist/design-system/p-b9f00eef.entry.js +0 -1
- package/dist/design-system/p-bcb53788.entry.js +0 -1
- package/dist/design-system/p-c24344ac.entry.js +0 -1
- package/dist/design-system/p-d76192bd.entry.js +0 -1
- package/dist/design-system/p-d9d8c51b.entry.js +0 -1
- package/dist/design-system/p-de67937d.entry.js +0 -1
- package/dist/design-system/p-ea5e6c2c.entry.js +0 -1
- package/dist/design-system/p-eeb1cac2.entry.js +0 -1
- package/dist/design-system/p-f1a74359.entry.js +0 -1
- package/dist/design-system/p-f44786a9.entry.js +0 -1
- package/dist/design-system/p-f69c7539.entry.js +0 -1
- package/dist/esm/component.button-B1XBwjCW.js +0 -88
- package/dist/esm/sd-date-picker-trigger.entry.js +0 -49
- package/dist/esm/sd-date-picker.entry.js +0 -115
- package/dist/esm/sd-date-range-picker.entry.js +0 -121
- package/dist/esm/sd-file-picker.entry.js +0 -242
- package/dist/esm/sd-input.entry.js +0 -173
- package/dist/esm/sd-number-input.entry.js +0 -407
- package/dist/esm/sd-radio-group.entry.js +0 -44
- package/dist/esm/sd-textarea.entry.js +0 -144
- package/dist/types/components/sd-button-v2/sd-button-v2.d.ts +0 -19
- /package/dist/components/{p-C2fDbE9d.js → p-B6cqMQaM.js} +0 -0
- /package/dist/design-system/{p-C2fDbE9d.js → p-B6cqMQaM.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment, a as getElement, H as Host } from './index-
|
|
2
|
-
import { n as nanoid } from './index-CCwNgVmC.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, a as getElement, H as Host } from './index-0U6dRjlq.js';
|
|
3
2
|
import { T as TABLE_ID_ATTR } from './constants-sZMi_32I.js';
|
|
4
|
-
import { r as resolveTableIconColor,
|
|
5
|
-
import './
|
|
3
|
+
import { r as resolveTableIconColor, d as resolveSortIconName, b as TABLE_BORDER, e as TABLE_HEADER_RESIZING_BAR, f as TABLE_HEADER_TYPOGRAPHY, g as TABLE_HEADER_COLORS, h as TABLE_HEADER_LAYOUT, i as TABLE_SEPARATOR, a as TABLE_BODY_TYPOGRAPHY, T as TABLE_BODY_LAYOUT } from './sd-table.config-B-VgXXT7.js';
|
|
4
|
+
import './component.table-BnfUIhUj.js';
|
|
5
|
+
import './system-GBlVDmy4.js';
|
|
6
6
|
|
|
7
7
|
const pagination = {
|
|
8
8
|
height: "24",
|
|
@@ -152,296 +152,17 @@ const SdPagination = class {
|
|
|
152
152
|
'--sd-pagination-bg-selected': PAGINATION_COLORS.bgSelected,
|
|
153
153
|
'--sd-pagination-item-width': `${this.buttonWidth}px`,
|
|
154
154
|
};
|
|
155
|
-
return (h("div", { key: '
|
|
155
|
+
return (h("div", { key: '0a99cc2b09de2f2a893fe88eaee535dc2f39505d', class: {
|
|
156
156
|
'sd-pagination': true,
|
|
157
157
|
'sd-pagination--simple': this.simple,
|
|
158
|
-
}, style: cssVars }, h("div", { key: '
|
|
158
|
+
}, style: cssVars }, h("div", { key: 'ba4e726a23e572c788c8c68689e656a07f21f46e', class: "sd-pagination__group sd-pagination__group--prev" }, this.renderPrevButtons()), this.simple ? (h("div", { class: "sd-pagination__info" }, h("span", { class: "sd-pagination__current" }, this.currentPage), h("span", { class: "sd-pagination__divider" }, "/"), h("span", { class: "sd-pagination__last" }, this.lastPage))) : (h("div", { class: "sd-pagination__numbers" }, this.pageNumbers.map(n => (h("button", { type: "button", "aria-current": this.currentPage === n ? 'page' : undefined, class: {
|
|
159
159
|
'sd-pagination__item': true,
|
|
160
160
|
'sd-pagination__item--selected': this.currentPage === n,
|
|
161
|
-
}, onClick: () => this.handlePageChange(n) }, n))))), h("div", { key: '
|
|
161
|
+
}, onClick: () => this.handlePageChange(n) }, n))))), h("div", { key: 'e3276583ab382b988ac2961e8c67c431d5c4495e', class: "sd-pagination__group sd-pagination__group--next" }, this.renderNextButtons())));
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
SdPagination.style = sdPaginationCss();
|
|
165
165
|
|
|
166
|
-
const sdSelectCss = () => `sd-select{display:inline-flex}sd-select sd-portal{display:none}sd-select .sd-select{position:relative;width:100%;height:100%}`;
|
|
167
|
-
|
|
168
|
-
const SdSelect = class {
|
|
169
|
-
constructor(hostRef) {
|
|
170
|
-
registerInstance(this, hostRef);
|
|
171
|
-
this.update = createEvent(this, "sdUpdate", 7);
|
|
172
|
-
this.dropDownShow = createEvent(this, "sdDropDownShow", 7);
|
|
173
|
-
}
|
|
174
|
-
static VIEWPORT_PADDING = 20;
|
|
175
|
-
static PORTAL_OFFSET_Y = 4;
|
|
176
|
-
static CLOSE_ANIMATION_DURATION = 150;
|
|
177
|
-
get el() { return getElement(this); }
|
|
178
|
-
type = 'default';
|
|
179
|
-
value = null;
|
|
180
|
-
options = [];
|
|
181
|
-
placeholder = '선택';
|
|
182
|
-
maxDropdownWidth = '640px';
|
|
183
|
-
dropdownHeight = '260px';
|
|
184
|
-
disabled = false;
|
|
185
|
-
label = '';
|
|
186
|
-
labelWidth = '';
|
|
187
|
-
addonLabel = '';
|
|
188
|
-
addonAlign = 'start';
|
|
189
|
-
error = false;
|
|
190
|
-
hint = '';
|
|
191
|
-
errorMessage = '';
|
|
192
|
-
rules = [];
|
|
193
|
-
icon = undefined;
|
|
194
|
-
labelTooltip = '';
|
|
195
|
-
labelTooltipProps = null;
|
|
196
|
-
emitValue = false;
|
|
197
|
-
width = '';
|
|
198
|
-
useSearch = false;
|
|
199
|
-
allSelectedLabel = '전체';
|
|
200
|
-
useSelectAll = false;
|
|
201
|
-
isOpen = false;
|
|
202
|
-
isAnimatingOut = false;
|
|
203
|
-
triggerWidth = '200px';
|
|
204
|
-
resolvedDropdownHeight = '260px';
|
|
205
|
-
resolvedMaxDropdownWidth = '640px';
|
|
206
|
-
focused = false;
|
|
207
|
-
hovered = false;
|
|
208
|
-
update;
|
|
209
|
-
dropDownShow;
|
|
210
|
-
async sdFocus() {
|
|
211
|
-
if (this.disabled)
|
|
212
|
-
return;
|
|
213
|
-
await this.triggerComponentRef?.sdFocus();
|
|
214
|
-
}
|
|
215
|
-
async sdOpen() {
|
|
216
|
-
// sdFocus 직후 호출 시 트리거 ref/레이아웃이 안정될 때까지 한 틱 대기
|
|
217
|
-
await new Promise(resolve => setTimeout(resolve, 0));
|
|
218
|
-
if (this.disabled || this.isOpen)
|
|
219
|
-
return;
|
|
220
|
-
this.prepareDropdownGeometry();
|
|
221
|
-
if (this.closeAnimationTimer)
|
|
222
|
-
clearTimeout(this.closeAnimationTimer);
|
|
223
|
-
this.isAnimatingOut = false;
|
|
224
|
-
this.isOpen = true;
|
|
225
|
-
}
|
|
226
|
-
triggerRef;
|
|
227
|
-
triggerComponentRef;
|
|
228
|
-
closeAnimationTimer;
|
|
229
|
-
name = nanoid();
|
|
230
|
-
triggerHasFocus = false;
|
|
231
|
-
watchIsOpen(newValue) {
|
|
232
|
-
this.syncFocusedState(newValue);
|
|
233
|
-
this.dropDownShow.emit({ isOpen: newValue });
|
|
234
|
-
}
|
|
235
|
-
get isMulti() {
|
|
236
|
-
return this.type === 'multi' || this.type === 'multi_depth';
|
|
237
|
-
}
|
|
238
|
-
get displayText() {
|
|
239
|
-
if (this.isMulti) {
|
|
240
|
-
if (!Array.isArray(this.value) || this.value.length === 0)
|
|
241
|
-
return '';
|
|
242
|
-
const nonDisabledLeaves = this.getNonDisabledLeaves(this.options);
|
|
243
|
-
const selected = this.getSelectedOptions();
|
|
244
|
-
const allSelected = nonDisabledLeaves.length > 0 &&
|
|
245
|
-
nonDisabledLeaves.every(leaf => selected.some(s => s.value === leaf.value));
|
|
246
|
-
if (allSelected)
|
|
247
|
-
return this.allSelectedLabel ?? '전체';
|
|
248
|
-
const flat = this.flattenOptions(this.options);
|
|
249
|
-
return this.value
|
|
250
|
-
.map(item => {
|
|
251
|
-
if (item != null && typeof item === 'object') {
|
|
252
|
-
const opt = item;
|
|
253
|
-
return opt.label ?? flat.find(o => o.value === opt.value)?.label ?? '';
|
|
254
|
-
}
|
|
255
|
-
return flat.find(o => o.value === item)?.label ?? '';
|
|
256
|
-
})
|
|
257
|
-
.filter(Boolean)
|
|
258
|
-
.join(', ');
|
|
259
|
-
}
|
|
260
|
-
if (this.value == null)
|
|
261
|
-
return '';
|
|
262
|
-
if (!this.emitValue && typeof this.value === 'object' && !Array.isArray(this.value)) {
|
|
263
|
-
return this.value.label ?? '';
|
|
264
|
-
}
|
|
265
|
-
const flat = this.flattenOptions(this.options);
|
|
266
|
-
const found = flat.find(o => o.value === this.value);
|
|
267
|
-
return found?.label ?? '';
|
|
268
|
-
}
|
|
269
|
-
flattenOptions(options) {
|
|
270
|
-
return options.flatMap(o => (o.children ? this.flattenOptions(o.children) : [o]));
|
|
271
|
-
}
|
|
272
|
-
getNonDisabledLeaves(options) {
|
|
273
|
-
return options.flatMap(o => {
|
|
274
|
-
if (o.disabled)
|
|
275
|
-
return [];
|
|
276
|
-
if (o.children)
|
|
277
|
-
return this.getNonDisabledLeaves(o.children);
|
|
278
|
-
return [o];
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
getSelectedOptions() {
|
|
282
|
-
const val = this.value;
|
|
283
|
-
if (!val || !Array.isArray(val))
|
|
284
|
-
return [];
|
|
285
|
-
if (this.emitValue) {
|
|
286
|
-
return val
|
|
287
|
-
.map(v => this.findOriginalOption(v, this.options))
|
|
288
|
-
.filter((o) => !!o);
|
|
289
|
-
}
|
|
290
|
-
return val;
|
|
291
|
-
}
|
|
292
|
-
toMultiValue(options) {
|
|
293
|
-
return this.emitValue ? options.map(o => o.value) : options;
|
|
294
|
-
}
|
|
295
|
-
parsePixelValue(value, fallback) {
|
|
296
|
-
const parsed = Number.parseFloat(value);
|
|
297
|
-
return Number.isFinite(parsed) ? parsed : fallback;
|
|
298
|
-
}
|
|
299
|
-
updateDropdownViewportConstraints() {
|
|
300
|
-
if (!this.triggerRef)
|
|
301
|
-
return;
|
|
302
|
-
const triggerRect = this.triggerRef.getBoundingClientRect();
|
|
303
|
-
const viewportPadding = SdSelect.VIEWPORT_PADDING;
|
|
304
|
-
const offsetY = SdSelect.PORTAL_OFFSET_Y;
|
|
305
|
-
const preferredHeight = this.parsePixelValue(this.dropdownHeight, 260);
|
|
306
|
-
const preferredWidth = this.parsePixelValue(this.maxDropdownWidth, 640);
|
|
307
|
-
const availableBelow = Math.max(window.innerHeight - triggerRect.bottom - viewportPadding - offsetY, 0);
|
|
308
|
-
const availableAbove = Math.max(triggerRect.top - viewportPadding - offsetY, 0);
|
|
309
|
-
const availableHeight = Math.max(availableBelow, availableAbove);
|
|
310
|
-
const availableWidth = Math.max(window.innerWidth - viewportPadding * 2, 0);
|
|
311
|
-
this.resolvedDropdownHeight = `${Math.min(preferredHeight, availableHeight)}px`;
|
|
312
|
-
this.resolvedMaxDropdownWidth = `${Math.min(preferredWidth, availableWidth)}px`;
|
|
313
|
-
}
|
|
314
|
-
handleViewportResize = () => {
|
|
315
|
-
if (!this.isOpen)
|
|
316
|
-
return;
|
|
317
|
-
this.updateDropdownViewportConstraints();
|
|
318
|
-
};
|
|
319
|
-
findOriginalOption(value, options) {
|
|
320
|
-
for (const opt of options) {
|
|
321
|
-
if (opt.value === value)
|
|
322
|
-
return opt;
|
|
323
|
-
if (opt.children) {
|
|
324
|
-
const found = this.findOriginalOption(value, opt.children);
|
|
325
|
-
if (found)
|
|
326
|
-
return found;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
return undefined;
|
|
330
|
-
}
|
|
331
|
-
closeDropdown() {
|
|
332
|
-
if (!this.isOpen)
|
|
333
|
-
return;
|
|
334
|
-
this.isOpen = false;
|
|
335
|
-
this.isAnimatingOut = true;
|
|
336
|
-
if (this.closeAnimationTimer)
|
|
337
|
-
clearTimeout(this.closeAnimationTimer);
|
|
338
|
-
this.closeAnimationTimer = setTimeout(() => {
|
|
339
|
-
this.isAnimatingOut = false;
|
|
340
|
-
}, SdSelect.CLOSE_ANIMATION_DURATION);
|
|
341
|
-
}
|
|
342
|
-
prepareDropdownGeometry() {
|
|
343
|
-
if (this.triggerRef) {
|
|
344
|
-
this.triggerWidth = `${this.triggerRef.offsetWidth}px`;
|
|
345
|
-
}
|
|
346
|
-
this.updateDropdownViewportConstraints();
|
|
347
|
-
}
|
|
348
|
-
syncFocusedState(isOpen = this.isOpen) {
|
|
349
|
-
this.focused = isOpen || this.triggerHasFocus;
|
|
350
|
-
}
|
|
351
|
-
handleTriggerFocus = () => {
|
|
352
|
-
this.triggerHasFocus = true;
|
|
353
|
-
this.syncFocusedState();
|
|
354
|
-
};
|
|
355
|
-
handleTriggerBlur = () => {
|
|
356
|
-
this.triggerHasFocus = false;
|
|
357
|
-
this.syncFocusedState();
|
|
358
|
-
};
|
|
359
|
-
handleTriggerClick = () => {
|
|
360
|
-
if (this.isOpen) {
|
|
361
|
-
this.closeDropdown();
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
this.prepareDropdownGeometry();
|
|
365
|
-
if (this.closeAnimationTimer)
|
|
366
|
-
clearTimeout(this.closeAnimationTimer);
|
|
367
|
-
this.isAnimatingOut = false;
|
|
368
|
-
this.isOpen = true;
|
|
369
|
-
};
|
|
370
|
-
emitUpdate(value) {
|
|
371
|
-
this.update.emit(value);
|
|
372
|
-
}
|
|
373
|
-
handleOptionSelect = (detail) => {
|
|
374
|
-
const { option, leaves } = detail;
|
|
375
|
-
if (this.isMulti) {
|
|
376
|
-
this.handleMultiSelect(option, leaves);
|
|
377
|
-
}
|
|
378
|
-
else {
|
|
379
|
-
this.closeDropdown();
|
|
380
|
-
this.value = this.emitValue ? option.value : option;
|
|
381
|
-
const nextValue = this.value;
|
|
382
|
-
requestAnimationFrame(() => {
|
|
383
|
-
this.emitUpdate(nextValue);
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
handleMultiSelect(option, leaves) {
|
|
388
|
-
const selected = this.getSelectedOptions();
|
|
389
|
-
const isGroup = !!option.children;
|
|
390
|
-
let newSelected;
|
|
391
|
-
if (isGroup) {
|
|
392
|
-
const allSelected = leaves.every(l => selected.some(s => s.value === l.value));
|
|
393
|
-
if (allSelected) {
|
|
394
|
-
const leafValues = new Set(leaves.map(l => l.value));
|
|
395
|
-
newSelected = selected.filter(s => !leafValues.has(s.value));
|
|
396
|
-
}
|
|
397
|
-
else {
|
|
398
|
-
const existing = new Set(selected.map(s => s.value));
|
|
399
|
-
const toAdd = leaves.filter(l => !existing.has(l.value));
|
|
400
|
-
newSelected = [...selected, ...toAdd];
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
else {
|
|
404
|
-
const exists = selected.some(s => s.value === option.value);
|
|
405
|
-
newSelected = exists ? selected.filter(s => s.value !== option.value) : [...selected, option];
|
|
406
|
-
}
|
|
407
|
-
this.value = this.toMultiValue(newSelected);
|
|
408
|
-
this.emitUpdate(this.value);
|
|
409
|
-
}
|
|
410
|
-
connectedCallback() {
|
|
411
|
-
window.addEventListener('resize', this.handleViewportResize);
|
|
412
|
-
}
|
|
413
|
-
disconnectedCallback() {
|
|
414
|
-
window.removeEventListener('resize', this.handleViewportResize);
|
|
415
|
-
if (this.closeAnimationTimer)
|
|
416
|
-
clearTimeout(this.closeAnimationTimer);
|
|
417
|
-
}
|
|
418
|
-
render() {
|
|
419
|
-
const portalProps = {
|
|
420
|
-
open: this.isOpen,
|
|
421
|
-
parentRef: this.triggerRef,
|
|
422
|
-
viewportPadding: SdSelect.VIEWPORT_PADDING,
|
|
423
|
-
onSdClose: () => {
|
|
424
|
-
this.closeDropdown();
|
|
425
|
-
},
|
|
426
|
-
};
|
|
427
|
-
return (h("sd-field", { key: '76625e332090d20e2f66159bba5ee1b9a11320a6', 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: () => {
|
|
428
|
-
this.hovered = true;
|
|
429
|
-
}, onMouseLeave: () => {
|
|
430
|
-
this.hovered = false;
|
|
431
|
-
} }, h("div", { key: '8a0ae8a5e05459128409dbe21779f5e3d91b3a04', class: "sd-select", ref: el => {
|
|
432
|
-
this.triggerRef = el;
|
|
433
|
-
} }, h("sd-select-trigger", { key: '6b47231914655a8e197e3b38cd8e37c5214efc17', ref: el => {
|
|
434
|
-
this.triggerComponentRef = el;
|
|
435
|
-
}, 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) && (h("sd-portal", { key: 'eaed402d276cc94a1324ede9cbf09bc436f8a1db', ...portalProps }, h("sd-select-listbox", { key: 'a96f75e06d974c8fd88ac72f083fe4b0ef424a0b', 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: event => this.handleOptionSelect(event.detail) })))));
|
|
436
|
-
}
|
|
437
|
-
static get watchers() { return {
|
|
438
|
-
"isOpen": [{
|
|
439
|
-
"watchIsOpen": 0
|
|
440
|
-
}]
|
|
441
|
-
}; }
|
|
442
|
-
};
|
|
443
|
-
SdSelect.style = sdSelectCss();
|
|
444
|
-
|
|
445
166
|
const sdTbodyCss = () => `:host{display:contents}:host *{box-sizing:border-box}.tbody{display:table-row-group}`;
|
|
446
167
|
|
|
447
168
|
const SdTbody = class {
|
|
@@ -484,17 +205,17 @@ const SdTbody = class {
|
|
|
484
205
|
this.tableEl = table;
|
|
485
206
|
const fromMethod = table?.getTableIdSync?.();
|
|
486
207
|
const fromAttr = table?.getAttribute(TABLE_ID_ATTR);
|
|
487
|
-
const resolvedTableId = (fromMethod && fromMethod !== 'undefined' ? fromMethod : null) ??
|
|
488
|
-
(fromAttr && fromAttr !== 'undefined' ? fromAttr : null) ??
|
|
208
|
+
const resolvedTableId = (fromMethod != null && fromMethod !== '' && fromMethod !== 'undefined' ? fromMethod : null) ??
|
|
209
|
+
(fromAttr != null && fromAttr !== '' && fromAttr !== 'undefined' ? fromAttr : null) ??
|
|
489
210
|
'';
|
|
490
|
-
if (resolvedTableId && resolvedTableId !== this.tableId) {
|
|
211
|
+
if (resolvedTableId !== '' && resolvedTableId !== this.tableId) {
|
|
491
212
|
this.tableId = resolvedTableId;
|
|
492
213
|
}
|
|
493
214
|
}
|
|
494
215
|
render() {
|
|
495
|
-
return (h(Host, { key: '
|
|
216
|
+
return (h(Host, { key: '5b55bfd73916ff1402329375de1e1fc2a7629cbd', slot: `${this.tableId}-body` }, h("tbody", { key: 'a09a532d1510166a36d592c2e59ec1765803bbbe', class: { tbody: true } }, [
|
|
496
217
|
this.topSpacerHeight > 0 && (h("tr", { key: "spacer-top", class: "tbody__spacer", style: { height: `${this.topSpacerHeight}px`, display: 'block' } })),
|
|
497
|
-
h("slot", { key: '
|
|
218
|
+
h("slot", { key: 'da3827a9c2fe7a74ec3cb3eb8dee3ab039ea0535' }),
|
|
498
219
|
this.bottomSpacerHeight > 0 && (h("tr", { key: "spacer-bottom", class: "tbody__spacer", style: { height: `${this.bottomSpacerHeight}px`, display: 'block' } })),
|
|
499
220
|
])));
|
|
500
221
|
}
|
|
@@ -535,7 +256,7 @@ const SdThead = class {
|
|
|
535
256
|
tableEl = null;
|
|
536
257
|
handleColumnsChange(newCols) {
|
|
537
258
|
if (Array.isArray(newCols) && (this.columnWidths ?? []).length === 0) {
|
|
538
|
-
this.columnWidths = newCols.map(c => parseInt(c.width || '120', 10));
|
|
259
|
+
this.columnWidths = newCols.map(c => (c.autoWidth ? 0 : parseInt(c.width || '120', 10)));
|
|
539
260
|
}
|
|
540
261
|
}
|
|
541
262
|
componentWillLoad() {
|
|
@@ -543,7 +264,7 @@ const SdThead = class {
|
|
|
543
264
|
this.columnWidths = Array.isArray(this.columnWidths) ? this.columnWidths : [];
|
|
544
265
|
this.resolveConfig();
|
|
545
266
|
if ((this.columnWidths ?? []).length === 0) {
|
|
546
|
-
this.columnWidths = this._columns.map(c => parseInt(c.width || '120', 10));
|
|
267
|
+
this.columnWidths = this._columns.map(c => c.autoWidth ? 0 : parseInt(c.width || '120', 10));
|
|
547
268
|
}
|
|
548
269
|
}
|
|
549
270
|
componentDidLoad() {
|
|
@@ -560,10 +281,10 @@ const SdThead = class {
|
|
|
560
281
|
this.tableEl = table;
|
|
561
282
|
const fromMethod = table?.getTableIdSync?.();
|
|
562
283
|
const fromAttr = table?.getAttribute(TABLE_ID_ATTR);
|
|
563
|
-
const resolvedTableId = (fromMethod && fromMethod !== 'undefined' ? fromMethod : null) ??
|
|
564
|
-
(fromAttr && fromAttr !== 'undefined' ? fromAttr : null) ??
|
|
284
|
+
const resolvedTableId = (fromMethod != null && fromMethod !== '' && fromMethod !== 'undefined' ? fromMethod : null) ??
|
|
285
|
+
(fromAttr != null && fromAttr !== '' && fromAttr !== 'undefined' ? fromAttr : null) ??
|
|
565
286
|
'';
|
|
566
|
-
if (resolvedTableId && resolvedTableId !== this.tableId) {
|
|
287
|
+
if (resolvedTableId !== '' && resolvedTableId !== this.tableId) {
|
|
567
288
|
this.tableId = resolvedTableId;
|
|
568
289
|
}
|
|
569
290
|
}
|
|
@@ -611,13 +332,17 @@ const SdThead = class {
|
|
|
611
332
|
const rightOffset = this.columnWidths
|
|
612
333
|
.filter((_, i) => i >= this.visibleColumns.length - (this._stickyColumn.right || 0) && i > colIdx)
|
|
613
334
|
.reduce((a, b) => a + b, 0);
|
|
614
|
-
|
|
335
|
+
const col = this.visibleColumns[colIdx];
|
|
336
|
+
const base = {
|
|
615
337
|
'--sticky-left-offset': `${leftOffset}px`,
|
|
616
338
|
'--sticky-right-offset': `${rightOffset}px`,
|
|
617
|
-
'width': `${this.columnWidths[colIdx]}px`,
|
|
618
|
-
'minWidth': `${this.columnWidths[colIdx]}px`,
|
|
619
|
-
'maxWidth': `${this.columnWidths[colIdx]}px`,
|
|
620
339
|
};
|
|
340
|
+
if (!col?.autoWidth) {
|
|
341
|
+
base['width'] = `${this.columnWidths[colIdx]}px`;
|
|
342
|
+
base['minWidth'] = `${this.columnWidths[colIdx]}px`;
|
|
343
|
+
base['maxWidth'] = `${this.columnWidths[colIdx]}px`;
|
|
344
|
+
}
|
|
345
|
+
return base;
|
|
621
346
|
}
|
|
622
347
|
handleResize(index, event, reversed = false) {
|
|
623
348
|
if (this.tableEl?.handleResize) {
|
|
@@ -648,6 +373,7 @@ const SdThead = class {
|
|
|
648
373
|
const stickyLeftCols = this.visibleColumns.slice(0, stickyLeftCount);
|
|
649
374
|
const middleCols = this.visibleColumns.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
|
|
650
375
|
const stickyRightCols = this.visibleColumns.slice(this.visibleColumns.length - stickyRightCount);
|
|
376
|
+
const lastColIdx = this.visibleColumns.length - 1;
|
|
651
377
|
const headStyle = {
|
|
652
378
|
'--table-header-height': `${TABLE_HEADER_LAYOUT.height}px`,
|
|
653
379
|
'--table-header-padding-x': `${TABLE_HEADER_LAYOUT.paddingX}px`,
|
|
@@ -663,27 +389,33 @@ const SdThead = class {
|
|
|
663
389
|
'--table-border-color': TABLE_BORDER.color,
|
|
664
390
|
'--table-border-width': `${TABLE_BORDER.width}px`,
|
|
665
391
|
};
|
|
666
|
-
return (h(Host, { key: '
|
|
392
|
+
return (h(Host, { key: '424fa72b833a94bce945ae50e8445cbed0527025', slot: `${this.tableId}-head`, style: headStyle }, h("thead", { key: '1a5704d78992b553c5db5ba92bb3814de7c19898', class: {
|
|
667
393
|
'thead': true,
|
|
668
394
|
'thead--sticky': this._stickyHeader,
|
|
669
|
-
} }, h("tr", { key: '
|
|
395
|
+
} }, h("tr", { key: '1369ff7c99a5691bcd5fa54af4f7c02ff41dceb3', class: "tr" }, this._selectable && (h("th", { key: '72159c6f8ef28b0b93790e180cb9b12345727525', class: {
|
|
670
396
|
'th': true,
|
|
671
397
|
'th--selected': true,
|
|
672
398
|
'sticky-left': true,
|
|
673
399
|
'sticky-left-edge': stickyLeftCount === 0,
|
|
674
400
|
'is-scrolled-left': stickyLeftCount === 0 && this._scrolledLeft,
|
|
675
|
-
}, style: { '--sticky-left-offset': '0px' } }, h("sd-checkbox", { key: '
|
|
401
|
+
}, style: { '--sticky-left-offset': '0px' } }, h("sd-checkbox", { key: '1c5c035346fc6d13d956475480374a8bd93d3d6d', value: this.getIsAllChecked(), disabled: safeRows.length === 0, onSdUpdate: (e) => this.handleSelectAll(e.detail) }))), stickyLeftCols.map((col, idx) => (h("th", { key: col.name, class: {
|
|
676
402
|
'th': true,
|
|
677
403
|
[`${col.thClass}`]: Boolean(col.thClass),
|
|
678
404
|
'sticky-left': true,
|
|
679
405
|
'sticky-left-edge': idx === stickyLeftCount - 1,
|
|
680
406
|
'is-scrolled-left': idx === stickyLeftCount - 1 && this._scrolledLeft,
|
|
681
|
-
}, style: { ...col.thStyle, ...this.getStickyStyle(idx) } }, h("div", { class: `th__content th__content--${col.align || 'left'}` }, h("div", { class: "th__content--label" }, col.label), col.icon && (h("sd-icon", { name: col.icon, size: "12", color: resolveTableIconColor(col.icon, col.iconColor) })), col.sort && (h("sd-icon", { name: resolveSortIconName(col.sort), size: "12", color: resolveTableIconColor(resolveSortIconName(col.sort), col.iconColor), onClick: () => this.handleColumnSort(col), style: { cursor: 'pointer' } })), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this._resizable &&
|
|
407
|
+
}, style: { ...col.thStyle, ...this.getStickyStyle(idx) } }, h("div", { class: `th__content th__content--${col.align || 'left'}` }, h("div", { class: "th__content--label" }, col.label), col.icon && (h("sd-icon", { name: col.icon, size: "12", color: resolveTableIconColor(col.icon, col.iconColor) })), col.sort && (h("sd-icon", { name: resolveSortIconName(col.sort), size: "12", color: resolveTableIconColor(resolveSortIconName(col.sort), col.iconColor), onClick: () => this.handleColumnSort(col), style: { cursor: 'pointer' } })), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this._resizable && idx !== lastColIdx && (
|
|
408
|
+
// column resize 는 마우스 드래그 전용 인터랙션이라 키보드 핸들러를 두지 않는다.
|
|
409
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
410
|
+
h("div", { class: "th__resizer", onMouseDown: (evt) => this.handleResize(idx, evt) }))))), middleCols.map((col, relativeIdx) => {
|
|
682
411
|
const actualColIdx = stickyLeftCount + relativeIdx;
|
|
683
412
|
return (h("th", { key: col.name, class: {
|
|
684
413
|
th: true,
|
|
685
414
|
[`${col.thClass}`]: Boolean(col.thClass),
|
|
686
|
-
}, style: { ...col.thStyle, ...this.getStickyStyle(actualColIdx) } }, h("div", { class: `th__content th__content--${col.align || 'left'}` }, h("div", { class: "th__content--label" }, col.label), col.icon && (h("sd-icon", { name: col.icon, size: "12", color: resolveTableIconColor(col.icon, col.iconColor) })), col.sort && (h("sd-icon", { name: resolveSortIconName(col.sort), size: "12", color: resolveTableIconColor(resolveSortIconName(col.sort), col.iconColor), onClick: () => this.handleColumnSort(col), style: { cursor: 'pointer' } })), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this._resizable &&
|
|
415
|
+
}, style: { ...col.thStyle, ...this.getStickyStyle(actualColIdx) } }, h("div", { class: `th__content th__content--${col.align || 'left'}` }, h("div", { class: "th__content--label" }, col.label), col.icon && (h("sd-icon", { name: col.icon, size: "12", color: resolveTableIconColor(col.icon, col.iconColor) })), col.sort && (h("sd-icon", { name: resolveSortIconName(col.sort), size: "12", color: resolveTableIconColor(resolveSortIconName(col.sort), col.iconColor), onClick: () => this.handleColumnSort(col), style: { cursor: 'pointer' } })), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this._resizable && actualColIdx !== lastColIdx && (
|
|
416
|
+
// column resize 는 마우스 드래그 전용 인터랙션이라 키보드 핸들러를 두지 않는다.
|
|
417
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
418
|
+
h("div", { class: "th__resizer", onMouseDown: (evt) => this.handleResize(actualColIdx, evt) }))));
|
|
687
419
|
}), stickyRightCols.map((col, relativeIdx) => {
|
|
688
420
|
const actualColIdx = this.visibleColumns.length - stickyRightCount + relativeIdx;
|
|
689
421
|
return (h("th", { key: col.name, class: {
|
|
@@ -692,7 +424,10 @@ const SdThead = class {
|
|
|
692
424
|
'sticky-right': true,
|
|
693
425
|
'sticky-right-edge': relativeIdx === 0,
|
|
694
426
|
'is-scrolled-right': relativeIdx === 0 && this._scrolledRight,
|
|
695
|
-
}, style: { ...col.thStyle, ...this.getStickyStyle(actualColIdx) } }, h("div", { class: `th__content th__content--${col.align || 'left'}` }, h("div", { class: "th__content--label" }, col.label), col.icon && (h("sd-icon", { name: col.icon, size: "12", color: resolveTableIconColor(col.icon, col.iconColor) })), col.sort && (h("sd-icon", { name: resolveSortIconName(col.sort), size: "12", color: resolveTableIconColor(resolveSortIconName(col.sort), col.iconColor), onClick: () => this.handleColumnSort(col), style: { cursor: 'pointer' } })), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this._resizable && (
|
|
427
|
+
}, style: { ...col.thStyle, ...this.getStickyStyle(actualColIdx) } }, h("div", { class: `th__content th__content--${col.align || 'left'}` }, h("div", { class: "th__content--label" }, col.label), col.icon && (h("sd-icon", { name: col.icon, size: "12", color: resolveTableIconColor(col.icon, col.iconColor) })), col.sort && (h("sd-icon", { name: resolveSortIconName(col.sort), size: "12", color: resolveTableIconColor(resolveSortIconName(col.sort), col.iconColor), onClick: () => this.handleColumnSort(col), style: { cursor: 'pointer' } })), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this._resizable && (
|
|
428
|
+
// column resize 는 마우스 드래그 전용 인터랙션이라 키보드 핸들러를 두지 않는다.
|
|
429
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
430
|
+
h("div", { class: "th__resizer th__resizer--left", onMouseDown: (evt) => this.handleResize(actualColIdx, evt, true) }))));
|
|
696
431
|
})))));
|
|
697
432
|
}
|
|
698
433
|
static get watchers() { return {
|
|
@@ -703,7 +438,7 @@ const SdThead = class {
|
|
|
703
438
|
};
|
|
704
439
|
SdThead.style = sdTheadCss();
|
|
705
440
|
|
|
706
|
-
const sdTrCss = () => `sd-tr{display:contents}sd-tr *{box-sizing:border-box}.tr{display:table-row}.tr:hover .td{background-color:#F9F9F9}.tr--no-hover:hover .td{background-color:white}.td{display:table-cell;height:var(--table-body-height, 44px);padding:0 var(--table-body-padding-x, 16px);border-bottom:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);background:white;vertical-align:middle;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all}.td--left{text-align:left}.td--center{text-align:center}.td--right{text-align:right}.td--selected{position:relative;width:52px !important;max-width:52px !important;min-width:52px !important;padding:0 10px 0 24px;text-align:left}.td--selected sd-checkbox label{position:relative}.td--selected sd-checkbox label:before{content:"";position:absolute;inset:-6px}.td.sticky-left{position:sticky;background-color:white;z-index:100 !important;left:var(--sticky-left-offset, 0)}.td.sticky-right{position:sticky;background-color:white;z-index:100 !important;right:var(--sticky-right-offset, 0)}.td.sticky-left-edge:after{content:"";position:absolute;top:0;left:100%;right:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset 12px 0 20px -25px;opacity:0;pointer-events:none;transition:opacity 0.2s}.td.sticky-right-edge:after{content:"";position:absolute;top:0;left:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset -12px 0 20px -25px;opacity:0;pointer-events:none;transition:opacity 0.2s}.td.sticky-left-edge.is-scrolled-left{overflow:visible}.td.sticky-left-edge.is-scrolled-left:after{opacity:1}.td.sticky-right-edge.is-scrolled-right{overflow:visible}.td.sticky-right-edge.is-scrolled-right:after{opacity:1}.tr:hover .td.sticky-left,.tr:hover .td.sticky-right{background-color:#F9F9F9}.tr--no-hover:hover .td.sticky-left,.tr--no-hover:hover .td.sticky-right{background-color:white}`;
|
|
441
|
+
const sdTrCss = () => `sd-tr{display:contents}sd-tr *{box-sizing:border-box}.tr{display:table-row}.tr:hover .td{background-color:#F9F9F9}.tr--no-hover:hover .td{background-color:white}.td{display:table-cell;height:var(--table-body-height, 44px);padding:var(--table-body-padding-y, 0) var(--table-body-padding-x, 16px);border-bottom:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1);background:white;vertical-align:middle;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all}.td--left{text-align:left}.td--center{text-align:center}.td--right{text-align:right}.td--selected{position:relative;width:52px !important;max-width:52px !important;min-width:52px !important;padding:0 10px 0 24px;text-align:left}.td--selected sd-checkbox label{position:relative}.td--selected sd-checkbox label:before{content:"";position:absolute;inset:-6px}.td.sticky-left{position:sticky;background-color:white;z-index:100 !important;left:var(--sticky-left-offset, 0)}.td.sticky-right{position:sticky;background-color:white;z-index:100 !important;right:var(--sticky-right-offset, 0)}.td.sticky-left-edge:after{content:"";position:absolute;top:0;left:100%;right:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset 12px 0 20px -25px;opacity:0;pointer-events:none;transition:opacity 0.2s}.td.sticky-right-edge:after{content:"";position:absolute;top:0;left:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset -12px 0 20px -25px;opacity:0;pointer-events:none;transition:opacity 0.2s}.td.sticky-left-edge.is-scrolled-left{overflow:visible}.td.sticky-left-edge.is-scrolled-left:after{opacity:1}.td.sticky-right-edge.is-scrolled-right{overflow:visible}.td.sticky-right-edge.is-scrolled-right:after{opacity:1}.tr:hover .td.sticky-left,.tr:hover .td.sticky-right{background-color:#F9F9F9}.tr--no-hover:hover .td.sticky-left,.tr--no-hover:hover .td.sticky-right{background-color:white}.td.td--last-row{border-bottom:none}.tr--separator .td--separator{height:var(--table-separator-width, 6px);padding:0;background-color:var(--table-separator-color, #eeeeee);border-bottom:none}.td.td--before-separator{border-bottom:none}.td--divider-left{border-left:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1)}.td--divider-right{border-right:var(--table-border-width, 1px) solid var(--table-border-color, #E1E1E1)}`;
|
|
707
442
|
|
|
708
443
|
const SdTr = class {
|
|
709
444
|
constructor(hostRef) {
|
|
@@ -715,6 +450,7 @@ const SdTr = class {
|
|
|
715
450
|
stickyColumn;
|
|
716
451
|
rowKey = '';
|
|
717
452
|
row = {};
|
|
453
|
+
separator;
|
|
718
454
|
tableId = '';
|
|
719
455
|
columnWidths = [];
|
|
720
456
|
isVisible = true;
|
|
@@ -724,16 +460,32 @@ const SdTr = class {
|
|
|
724
460
|
_stickyColumn = { left: 0, right: 0 };
|
|
725
461
|
_scrolledLeft = false;
|
|
726
462
|
_scrolledRight = false;
|
|
463
|
+
_dense = false;
|
|
727
464
|
tableEl = null;
|
|
465
|
+
_prevRowKey = null;
|
|
728
466
|
componentWillLoad() {
|
|
729
467
|
this.syncTableContext();
|
|
730
468
|
this.columnWidths = this.columnWidths ?? [];
|
|
731
469
|
this.resolveConfig();
|
|
732
|
-
this.columnWidths = this._columns.map(c => parseInt(c.width || '120', 10));
|
|
470
|
+
this.columnWidths = this._columns.map(c => (c.autoWidth ? 0 : parseInt(c.width || '120', 10)));
|
|
733
471
|
this.updateVisibilitySync();
|
|
734
472
|
}
|
|
735
473
|
componentDidLoad() {
|
|
736
474
|
this.syncTableContext();
|
|
475
|
+
if (this.separator) {
|
|
476
|
+
const prev = this.el.previousElementSibling;
|
|
477
|
+
if (prev?.tagName?.toLowerCase() === 'sd-tr') {
|
|
478
|
+
const prevRowKey = prev.rowKey;
|
|
479
|
+
this._prevRowKey = prevRowKey;
|
|
480
|
+
this.tableEl?.registerSeparatorSync?.(prevRowKey);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
disconnectedCallback() {
|
|
485
|
+
if (this._prevRowKey !== null) {
|
|
486
|
+
this.tableEl?.unregisterSeparatorSync?.(this._prevRowKey);
|
|
487
|
+
this._prevRowKey = null;
|
|
488
|
+
}
|
|
737
489
|
}
|
|
738
490
|
syncTableContext() {
|
|
739
491
|
// sd-table이 shadow:true이므로 fallback content로 렌더되면 closest가 경계를 못 넘는다.
|
|
@@ -745,10 +497,10 @@ const SdTr = class {
|
|
|
745
497
|
this.tableEl = table;
|
|
746
498
|
const fromMethod = table?.getTableIdSync?.();
|
|
747
499
|
const fromAttr = table?.getAttribute(TABLE_ID_ATTR);
|
|
748
|
-
const resolvedTableId = (fromMethod && fromMethod !== 'undefined' ? fromMethod : null) ??
|
|
749
|
-
(fromAttr && fromAttr !== 'undefined' ? fromAttr : null) ??
|
|
500
|
+
const resolvedTableId = (fromMethod != null && fromMethod !== '' && fromMethod !== 'undefined' ? fromMethod : null) ??
|
|
501
|
+
(fromAttr != null && fromAttr !== '' && fromAttr !== 'undefined' ? fromAttr : null) ??
|
|
750
502
|
'';
|
|
751
|
-
if (resolvedTableId && resolvedTableId !== this.tableId) {
|
|
503
|
+
if (resolvedTableId !== '' && resolvedTableId !== this.tableId) {
|
|
752
504
|
this.tableId = resolvedTableId;
|
|
753
505
|
}
|
|
754
506
|
}
|
|
@@ -759,6 +511,7 @@ const SdTr = class {
|
|
|
759
511
|
this._stickyColumn = this.stickyColumn ?? config?.stickyColumn ?? { left: 0, right: 0 };
|
|
760
512
|
this._scrolledLeft = config?.scrolledLeft ?? false;
|
|
761
513
|
this._scrolledRight = config?.scrolledRight ?? false;
|
|
514
|
+
this._dense = config?.dense ?? false;
|
|
762
515
|
if (config?.columnWidths && (this.columnWidths ?? []).length === 0) {
|
|
763
516
|
this.columnWidths = [...config.columnWidths];
|
|
764
517
|
}
|
|
@@ -804,7 +557,11 @@ const SdTr = class {
|
|
|
804
557
|
}
|
|
805
558
|
getCellValue(column) {
|
|
806
559
|
const { field, format, name } = column;
|
|
807
|
-
const value = typeof field === 'function'
|
|
560
|
+
const value = typeof field === 'function'
|
|
561
|
+
? field(this.row)
|
|
562
|
+
: field !== ''
|
|
563
|
+
? this.row[field]
|
|
564
|
+
: this.row[name];
|
|
808
565
|
return format ? format(value, this.row) : this.formatValue(value);
|
|
809
566
|
}
|
|
810
567
|
getStickyStyle(colIdx) {
|
|
@@ -815,13 +572,17 @@ const SdTr = class {
|
|
|
815
572
|
const rightOffset = this.columnWidths
|
|
816
573
|
.filter((_, i) => i >= this.visibleColumns.length - (this._stickyColumn.right || 0) && i > colIdx)
|
|
817
574
|
.reduce((a, b) => a + b, 0);
|
|
818
|
-
|
|
575
|
+
const col = this.visibleColumns[colIdx];
|
|
576
|
+
const base = {
|
|
819
577
|
'--sticky-left-offset': `${leftOffset}px`,
|
|
820
578
|
'--sticky-right-offset': `${rightOffset}px`,
|
|
821
|
-
'width': `${this.columnWidths[colIdx]}px`,
|
|
822
|
-
'minWidth': `${this.columnWidths[colIdx]}px`,
|
|
823
|
-
'maxWidth': `${this.columnWidths[colIdx]}px`,
|
|
824
579
|
};
|
|
580
|
+
if (!col?.autoWidth) {
|
|
581
|
+
base['width'] = `${this.columnWidths[colIdx]}px`;
|
|
582
|
+
base['minWidth'] = `${this.columnWidths[colIdx]}px`;
|
|
583
|
+
base['maxWidth'] = `${this.columnWidths[colIdx]}px`;
|
|
584
|
+
}
|
|
585
|
+
return base;
|
|
825
586
|
}
|
|
826
587
|
isSelected() {
|
|
827
588
|
if (this.tableEl?.isRowSelectedSync) {
|
|
@@ -851,6 +612,39 @@ const SdTr = class {
|
|
|
851
612
|
const fieldName = typeof col.field === 'string' ? col.field : col.name;
|
|
852
613
|
return this.tableEl.getCellClassSync(this.rowKey, fieldName);
|
|
853
614
|
}
|
|
615
|
+
expandCellClass(classStr) {
|
|
616
|
+
if (classStr == null || classStr === '')
|
|
617
|
+
return {};
|
|
618
|
+
return Object.fromEntries(classStr
|
|
619
|
+
.split(/\s+/)
|
|
620
|
+
.filter(Boolean)
|
|
621
|
+
.map(c => [c, true]));
|
|
622
|
+
}
|
|
623
|
+
isVisualLastRow(col) {
|
|
624
|
+
if (!this.tableEl?.isVisualLastRowSync)
|
|
625
|
+
return false;
|
|
626
|
+
const fieldName = typeof col.field === 'string' ? col.field : col.name;
|
|
627
|
+
return this.tableEl.isVisualLastRowSync(this.rowKey, fieldName);
|
|
628
|
+
}
|
|
629
|
+
// selectable td는 column 정보가 없으므로 빈 field로 평가한다.
|
|
630
|
+
// 해당 위치는 rowspan을 등록할 수 없으므로 spanRegistry에 매칭이 없고,
|
|
631
|
+
// 결과적으로 "내 row 자체가 시각적 마지막인지"가 판정된다.
|
|
632
|
+
isVisualLastRowForSelfRow() {
|
|
633
|
+
if (!this.tableEl?.isVisualLastRowSync)
|
|
634
|
+
return false;
|
|
635
|
+
return this.tableEl.isVisualLastRowSync(this.rowKey, '');
|
|
636
|
+
}
|
|
637
|
+
isVisualLastRowBeforeSeparator(col) {
|
|
638
|
+
if (!this.tableEl?.isVisualLastRowBeforeSeparatorSync)
|
|
639
|
+
return false;
|
|
640
|
+
const fieldName = typeof col.field === 'string' ? col.field : col.name;
|
|
641
|
+
return this.tableEl.isVisualLastRowBeforeSeparatorSync(this.rowKey, fieldName);
|
|
642
|
+
}
|
|
643
|
+
isVisualLastRowBeforeSeparatorForSelfRow() {
|
|
644
|
+
if (!this.tableEl?.isVisualLastRowBeforeSeparatorSync)
|
|
645
|
+
return false;
|
|
646
|
+
return this.tableEl.isVisualLastRowBeforeSeparatorSync(this.rowKey, '');
|
|
647
|
+
}
|
|
854
648
|
render() {
|
|
855
649
|
const stickyLeftCount = this._stickyColumn.left || 0;
|
|
856
650
|
const stickyRightCount = this._stickyColumn.right || 0;
|
|
@@ -858,9 +652,13 @@ const SdTr = class {
|
|
|
858
652
|
const middleCols = this.visibleColumns.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
|
|
859
653
|
const stickyRightCols = this.visibleColumns.slice(this.visibleColumns.length - stickyRightCount);
|
|
860
654
|
const hasRowspan = this.tableEl?.hasRowspanSync?.() ?? false;
|
|
655
|
+
const isUseFrameRow = this.tableEl?.hasUseFrameInRowSync?.(this.rowKey) ?? false;
|
|
656
|
+
const effectiveDense = this._dense && !isUseFrameRow;
|
|
657
|
+
const bodyLayout = effectiveDense ? TABLE_BODY_LAYOUT.dense : TABLE_BODY_LAYOUT.default;
|
|
861
658
|
const rowStyle = {
|
|
862
|
-
display: this.isVisible ? '' : 'none',
|
|
863
|
-
'--table-body-height': `${
|
|
659
|
+
'display': this.isVisible ? '' : 'none',
|
|
660
|
+
'--table-body-height': `${bodyLayout.height}px`,
|
|
661
|
+
'--table-body-padding-y': `${bodyLayout.paddingY}px`,
|
|
864
662
|
'--table-body-padding-x': `${TABLE_BODY_LAYOUT.paddingX}px`,
|
|
865
663
|
'--table-body-font-family': TABLE_BODY_TYPOGRAPHY.fontFamily,
|
|
866
664
|
'--table-body-font-weight': TABLE_BODY_TYPOGRAPHY.fontWeight,
|
|
@@ -869,14 +667,22 @@ const SdTr = class {
|
|
|
869
667
|
'--table-body-text-decoration': TABLE_BODY_TYPOGRAPHY.textDecoration,
|
|
870
668
|
'--table-border-color': TABLE_BORDER.color,
|
|
871
669
|
'--table-border-width': `${TABLE_BORDER.width}px`,
|
|
670
|
+
'--table-separator-color': TABLE_SEPARATOR.color,
|
|
671
|
+
'--table-separator-width': `${TABLE_SEPARATOR.width}px`,
|
|
872
672
|
};
|
|
873
|
-
|
|
673
|
+
if (this.separator) {
|
|
674
|
+
const totalCols = this.visibleColumns.length + (this._selectable ? 1 : 0);
|
|
675
|
+
return (h(Host, { style: rowStyle }, h("tr", { class: "tr tr--separator" }, h("td", { colSpan: totalCols, class: "td td--separator" }))));
|
|
676
|
+
}
|
|
677
|
+
return (h(Host, { style: rowStyle }, h("tr", { class: { 'tr': true, 'tr--no-hover': hasRowspan } }, this._selectable && (h("td", { class: {
|
|
874
678
|
'td': true,
|
|
875
679
|
'td--selected': true,
|
|
680
|
+
'td--last-row': this.isVisualLastRowForSelfRow(),
|
|
681
|
+
'td--before-separator': this.isVisualLastRowBeforeSeparatorForSelfRow(),
|
|
876
682
|
'sticky-left': true,
|
|
877
683
|
'sticky-left-edge': stickyLeftCount === 0,
|
|
878
684
|
'is-scrolled-left': stickyLeftCount === 0 && this._scrolledLeft,
|
|
879
|
-
}, style: { '--sticky-left-offset': '0px' } }, h("sd-checkbox", {
|
|
685
|
+
}, style: { '--sticky-left-offset': '0px' } }, h("sd-checkbox", { value: this.isSelected(), onSdUpdate: () => this.handleSelect() }))), stickyLeftCols.map((col, idx) => {
|
|
880
686
|
if (this.isCovered(idx))
|
|
881
687
|
return null;
|
|
882
688
|
const span = this.getSpanFor(col);
|
|
@@ -884,11 +690,13 @@ const SdTr = class {
|
|
|
884
690
|
return (h("td", { key: col.name, rowSpan: span?.rowspan, colSpan: span?.colspan, class: {
|
|
885
691
|
'td': true,
|
|
886
692
|
[`td--${col.align || 'left'}`]: true,
|
|
693
|
+
'td--last-row': this.isVisualLastRow(col),
|
|
694
|
+
'td--before-separator': this.isVisualLastRowBeforeSeparator(col),
|
|
887
695
|
'sticky-left': true,
|
|
888
696
|
'sticky-left-edge': idx === stickyLeftCount - 1,
|
|
889
697
|
'is-scrolled-left': idx === stickyLeftCount - 1 && this._scrolledLeft,
|
|
890
698
|
[`${col.tdClass}`]: Boolean(col.tdClass),
|
|
891
|
-
|
|
699
|
+
...this.expandCellClass(sdCellClass),
|
|
892
700
|
}, style: this.getStickyStyle(idx) }, h("slot", { name: `${this.tableId}-${typeof col.field === 'string' ? col.field : col.name}-${this.rowKey}` }, h("span", null, this.getCellValue(col)))));
|
|
893
701
|
}), middleCols.map((col, relativeIdx) => {
|
|
894
702
|
const actualColIdx = stickyLeftCount + relativeIdx;
|
|
@@ -898,10 +706,12 @@ const SdTr = class {
|
|
|
898
706
|
const span = this.getSpanFor(col);
|
|
899
707
|
const sdCellClass = this.getCellClassFor(col);
|
|
900
708
|
return (h("td", { key: col.name, rowSpan: span?.rowspan, colSpan: span?.colspan, class: {
|
|
901
|
-
td: true,
|
|
709
|
+
'td': true,
|
|
902
710
|
[`td--${col.align || 'left'}`]: true,
|
|
711
|
+
'td--last-row': this.isVisualLastRow(col),
|
|
712
|
+
'td--before-separator': this.isVisualLastRowBeforeSeparator(col),
|
|
903
713
|
[`${col.tdClass}`]: Boolean(col.tdClass),
|
|
904
|
-
|
|
714
|
+
...this.expandCellClass(sdCellClass),
|
|
905
715
|
}, style: this.getStickyStyle(actualColIdx) }, h("slot", { name: `${this.tableId}-${fieldName}-${this.rowKey}` }, h("span", null, this.getCellValue(col)))));
|
|
906
716
|
}), stickyRightCols.map((col, relativeIdx) => {
|
|
907
717
|
const actualColIdx = this.visibleColumns.length - stickyRightCount + relativeIdx;
|
|
@@ -913,15 +723,17 @@ const SdTr = class {
|
|
|
913
723
|
return (h("td", { key: col.name, rowSpan: span?.rowspan, colSpan: span?.colspan, class: {
|
|
914
724
|
'td': true,
|
|
915
725
|
[`td--${col.align || 'left'}`]: true,
|
|
726
|
+
'td--last-row': this.isVisualLastRow(col),
|
|
727
|
+
'td--before-separator': this.isVisualLastRowBeforeSeparator(col),
|
|
916
728
|
'sticky-right': true,
|
|
917
729
|
'sticky-right-edge': relativeIdx === 0,
|
|
918
730
|
'is-scrolled-right': relativeIdx === 0 && this._scrolledRight,
|
|
919
731
|
[`${col.tdClass}`]: Boolean(col.tdClass),
|
|
920
|
-
|
|
732
|
+
...this.expandCellClass(sdCellClass),
|
|
921
733
|
}, style: this.getStickyStyle(actualColIdx) }, h("slot", { name: `${this.tableId}-${fieldName}-${this.rowKey}` }, h("span", null, this.getCellValue(col)))));
|
|
922
734
|
}))));
|
|
923
735
|
}
|
|
924
736
|
};
|
|
925
737
|
SdTr.style = sdTrCss();
|
|
926
738
|
|
|
927
|
-
export { SdPagination as sd_pagination,
|
|
739
|
+
export { SdPagination as sd_pagination, SdTbody as sd_tbody, SdThead as sd_thead, SdTr as sd_tr };
|