@sellmate/design-system 1.0.62 → 1.0.63
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.modal-DmQUWbve.js → component.modal-BFelrSMx.js} +14 -0
- package/dist/cjs/constants-DJRV1upE.js +5 -0
- package/dist/cjs/design-system.cjs.js +3 -4
- package/dist/cjs/{index-BQt-JC6r.js → index-nsQP24mV.js} +130 -9
- package/dist/cjs/index.cjs.js +103 -32
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/cjs/sd-action-modal.cjs.entry.js +3 -3
- package/dist/cjs/sd-badge.cjs.entry.js +2 -2
- package/dist/cjs/sd-barcode-input.cjs.entry.js +3 -3
- package/dist/cjs/sd-button-v2_2.cjs.entry.js +9 -8
- package/dist/cjs/sd-button_4.cjs.entry.js +56 -18
- package/dist/cjs/sd-calendar.cjs.entry.js +1 -1
- package/dist/cjs/sd-card.cjs.entry.js +2 -2
- package/dist/cjs/sd-checkbox.cjs.entry.js +30 -5
- package/dist/cjs/sd-circle-progress.cjs.entry.js +71 -0
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +186 -0
- package/dist/cjs/sd-date-box.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-picker-calendar.cjs.entry.js +3 -3
- package/dist/cjs/sd-date-picker-trigger.cjs.entry.js +4 -4
- package/dist/cjs/sd-date-picker.cjs.entry.js +4 -4
- package/dist/cjs/{sd-date-picker.config-DWC_aiD2.js → sd-date-picker.config-D8xSALVj.js} +3 -3
- package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +3 -3
- package/dist/cjs/sd-date-range-picker.cjs.entry.js +4 -4
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +10 -5
- package/dist/cjs/sd-file-picker.cjs.entry.js +1 -1
- package/dist/cjs/sd-form.cjs.entry.js +1 -1
- package/dist/cjs/sd-ghost-button.cjs.entry.js +15 -6
- package/dist/cjs/sd-guide.cjs.entry.js +2 -2
- package/dist/cjs/sd-input_2.cjs.entry.js +7 -7
- package/dist/cjs/sd-loading-container.cjs.entry.js +29 -0
- package/dist/cjs/sd-modal-container.cjs.entry.js +45 -2
- package/dist/cjs/sd-number-input.cjs.entry.js +5 -10
- package/dist/cjs/{sd-select-v2.cjs.entry.js → sd-pagination_2.cjs.entry.js} +90 -4
- package/dist/cjs/sd-popover.cjs.entry.js +4 -4
- package/dist/cjs/sd-portal.cjs.entry.js +2 -2
- package/dist/cjs/sd-progress.cjs.entry.js +3 -3
- package/dist/cjs/sd-radio-button.cjs.entry.js +182 -0
- package/dist/cjs/sd-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/sd-radio.cjs.entry.js +6 -6
- package/dist/cjs/sd-select-dropdown_2.cjs.entry.js +4 -4
- package/dist/cjs/sd-select-group.cjs.entry.js +3 -3
- package/dist/cjs/sd-select-multiple-group.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-multiple.cjs.entry.js +3 -3
- package/dist/cjs/sd-select-option-group.cjs.entry.js +4 -4
- package/dist/cjs/sd-select-v2-list-item_4.cjs.entry.js +661 -0
- package/dist/cjs/sd-select.cjs.entry.js +179 -0
- package/dist/cjs/sd-switch.cjs.entry.js +110 -0
- package/dist/cjs/sd-table.cjs.entry.js +424 -651
- package/dist/cjs/sd-tabs.cjs.entry.js +2 -2
- package/dist/cjs/sd-tag.cjs.entry.js +6 -5
- package/dist/cjs/sd-tbody.cjs.entry.js +66 -0
- package/dist/cjs/sd-td.cjs.entry.js +58 -0
- package/dist/cjs/sd-text-link.cjs.entry.js +10 -12
- package/dist/cjs/sd-textarea.cjs.entry.js +2 -2
- package/dist/cjs/sd-thead.cjs.entry.js +179 -0
- 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 +96 -13
- package/dist/cjs/sd-tr.cjs.entry.js +171 -0
- package/dist/cjs/table-test.cjs.entry.js +96 -0
- package/dist/cjs/{tooltipArrow-CRCpqOYA.js → tooltipArrow-DhevfDPX.js} +1 -1
- package/dist/collection/__mocks__/nanoid-non-secure.js +13 -0
- package/dist/collection/__mocks__/nanoid.js +1 -0
- package/dist/collection/collection-manifest.json +11 -4
- package/dist/collection/components/sd-action-modal/sd-action-modal.js +1 -1
- package/dist/collection/components/sd-badge/sd-badge.js +1 -1
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.css +3 -0
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +1 -1
- package/dist/collection/components/sd-button/sd-button.css +37 -37
- package/dist/collection/components/sd-button-v2/sd-button-v2.css +44 -44
- package/dist/collection/components/sd-button-v2/sd-button-v2.js +31 -6
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-checkbox/sd-checkbox.config.js +3 -0
- package/dist/collection/components/sd-checkbox/sd-checkbox.css +15 -0
- package/dist/collection/components/sd-checkbox/sd-checkbox.js +36 -2
- package/dist/collection/components/sd-circle-progress/sd-circle-progress.config.js +24 -0
- package/dist/collection/components/sd-circle-progress/sd-circle-progress.css +53 -0
- package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +109 -0
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.css +2 -2
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker-calendar/sd-date-picker-calendar.js +1 -1
- package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker.config.js +1 -1
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +5 -5
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +5 -5
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.config.js +5 -0
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.css +46 -36
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +4 -4
- package/dist/collection/components/sd-field/sd-field.config.js +21 -0
- package/dist/collection/components/sd-field/sd-field.css +19 -16
- package/dist/collection/components/sd-field/sd-field.js +46 -11
- package/dist/collection/components/sd-file-picker/sd-file-picker.js +5 -5
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.config.js +7 -1
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.js +3 -3
- package/dist/collection/components/sd-guide/sd-guide.css +37 -37
- package/dist/collection/components/sd-input/sd-input.css +3 -0
- package/dist/collection/components/sd-input/sd-input.js +2 -2
- package/dist/collection/components/sd-loading-container/sd-loading-container.config.js +1 -0
- package/dist/collection/components/sd-loading-container/sd-loading-container.css +40 -0
- package/dist/collection/components/sd-loading-container/sd-loading-container.js +83 -0
- package/dist/collection/components/sd-loading-modal/sd-loading-modal.config.js +31 -0
- package/dist/collection/components/sd-loading-modal/sd-loading-modal.css +37 -0
- package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +184 -0
- package/dist/collection/components/sd-modal-container/sd-modal-container.js +89 -3
- package/dist/collection/components/sd-number-input/sd-number-input.config.js +0 -2
- package/dist/collection/components/sd-number-input/sd-number-input.css +0 -1
- package/dist/collection/components/sd-number-input/sd-number-input.js +3 -4
- package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
- package/dist/collection/components/sd-popover/sd-popover.js +2 -2
- package/dist/collection/components/sd-portal/sd-portal.js +1 -1
- package/dist/collection/components/sd-progress/sd-progress.js +2 -2
- package/dist/collection/components/sd-radio/sd-radio.config.js +1 -1
- package/dist/collection/components/sd-radio-button/sd-radio-button.config.js +45 -0
- package/dist/collection/components/sd-radio-button/sd-radio-button.css +71 -0
- package/dist/collection/components/{sd-radio-button-group/sd-radio-button-group.js → sd-radio-button/sd-radio-button.js} +49 -18
- package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js +2 -2
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
- package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js +3 -3
- package/dist/collection/components/sd-select/sd-select.css +4 -0
- package/dist/collection/components/sd-select-group/sd-select-group.css +4 -0
- package/dist/collection/components/sd-select-group/sd-select-group.js +1 -1
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.css +4 -0
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +1 -1
- package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.css +4 -0
- package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
- package/dist/collection/components/sd-select-v2/sd-select-v2-list-item/sd-select-v2-list-item.js +2 -2
- package/dist/collection/components/sd-select-v2/sd-select-v2-list-item-search/sd-select-v2-list-item-search.css +4 -0
- package/dist/collection/components/sd-select-v2/sd-select-v2-list-item-search/sd-select-v2-list-item-search.js +6 -3
- package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.css +2 -3
- package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.js +2 -1
- package/dist/collection/components/sd-select-v2/sd-select-v2-trigger/sd-select-v2-trigger.js +2 -2
- package/dist/collection/components/sd-select-v2/sd-select-v2.config.js +1 -0
- package/dist/collection/components/sd-select-v2/sd-select-v2.js +3 -3
- package/dist/collection/components/sd-switch/sd-switch.config.js +23 -0
- package/dist/collection/components/sd-switch/sd-switch.css +54 -0
- package/dist/collection/components/{sd-toggle-button/sd-toggle-button.js → sd-switch/sd-switch.js} +30 -27
- package/dist/collection/components/sd-table/constants.js +1 -0
- package/dist/collection/components/sd-table/sd-table.css +76 -248
- package/dist/collection/components/sd-table/sd-table.js +705 -700
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.css +18 -0
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +105 -0
- package/dist/collection/components/sd-table/sd-td/sd-td.css +15 -0
- package/dist/collection/components/sd-table/sd-td/sd-td.js +121 -0
- package/dist/collection/components/sd-table/sd-thead/sd-thead.css +147 -0
- package/dist/collection/components/sd-table/sd-thead/sd-thead.js +442 -0
- package/dist/collection/components/sd-table/sd-tr/sd-tr.css +111 -0
- package/dist/collection/components/sd-table/sd-tr/sd-tr.js +376 -0
- package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
- package/dist/collection/components/sd-tag/sd-tag.js +2 -2
- package/dist/collection/components/sd-text-link/sd-text-link.css +1 -0
- package/dist/collection/components/sd-text-link/sd-text-link.js +7 -13
- 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.config.js +33 -0
- package/dist/collection/components/sd-toggle/sd-toggle.css +38 -50
- package/dist/collection/components/sd-toggle/sd-toggle.js +29 -12
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
- package/dist/collection/components/table-test/table-test.css +59 -0
- package/dist/collection/components/table-test/table-test.js +316 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/loading.js +43 -0
- package/dist/collection/utils/modal.js +26 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-6LkBUj0w.js +1 -0
- package/dist/components/{p-DlujHEXS.js → p-6cueWz-l.js} +1 -1
- package/dist/components/{p-D0wZv01W.js → p-AKpbKrkW.js} +1 -1
- package/dist/components/p-B1S4ybd6.js +1 -0
- package/dist/components/{p-D93Cb_Vw.js → p-B6OgnOKC.js} +1 -1
- package/dist/components/{p-lKwhftf9.js → p-B6RvTdqt.js} +1 -1
- package/dist/components/p-BLC3AWW8.js +1 -0
- package/dist/components/{p-BUAwjF_Z.js → p-BZ7V5xV5.js} +1 -1
- package/dist/components/{p-BWgJ9XTj.js → p-BdsI1E5l.js} +1 -1
- package/dist/components/{p-DdBIc8AE.js → p-BgRPWxrz.js} +1 -1
- package/dist/components/{p-DCv5afjJ.js → p-Bh548Ckv.js} +1 -1
- package/dist/components/p-C2r48NLP.js +1 -0
- package/dist/components/{p-BtH5wWA5.js → p-CGXwtYAv.js} +1 -1
- package/dist/components/p-CGssy8eb.js +1 -0
- package/dist/components/{p-BHQirDZt.js → p-CRl8Anfr.js} +1 -1
- package/dist/components/p-CU095QAR.js +1 -0
- package/dist/components/p-CpclstHV.js +1 -0
- package/dist/components/{p-C2Yw3PoX.js → p-Cpu_hXwN.js} +1 -1
- package/dist/components/{p-gTPCqs3t.js → p-Cr_74QR7.js} +1 -1
- package/dist/components/{p-BsJy4pgR.js → p-D9FDutsj.js} +1 -1
- package/dist/components/p-DBnszF5F.js +1 -0
- package/dist/components/p-DOXMJi-V.js +1 -0
- package/dist/components/p-DRY8HJ-T.js +1 -0
- package/dist/components/{p-BVBMsoZP.js → p-DUqX35W_.js} +1 -1
- package/dist/components/{p-Ci3yfjxH.js → p-DgYBr7xb.js} +1 -1
- package/dist/components/{p-98NWgkAU.js → p-DpsDTjcN.js} +1 -1
- package/dist/components/p-DuYi4aqj.js +1 -0
- package/dist/components/{p-AdSqif48.js → p-DxzgCf_d.js} +1 -1
- package/dist/components/p-TMuoVuhE.js +1 -0
- package/dist/components/{p-CE1Hmoij.js → p-VXLJLI30.js} +1 -1
- package/dist/components/p-aC4HJHug.js +1 -0
- package/dist/components/p-bYCOh35g.js +1 -0
- package/dist/components/p-e35Du7-7.js +1 -0
- package/dist/components/p-e8HA30H_.js +1 -0
- package/dist/components/p-kZ5N_lFC.js +1 -0
- package/dist/components/{p-CqU3a1re.js → p-puZ1xlrr.js} +1 -1
- package/dist/components/p-sZMi_32I.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-v2.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-loading-spinner.d.ts → sd-circle-progress.d.ts} +4 -4
- package/dist/components/sd-circle-progress.js +1 -0
- 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-radio-button-group.d.ts → sd-loading-container.d.ts} +4 -4
- package/dist/components/sd-loading-container.js +1 -0
- package/dist/components/{sd-toggle-button.d.ts → sd-loading-modal.d.ts} +4 -4
- package/dist/components/sd-loading-modal.js +1 -0
- 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-portal.js +1 -1
- package/dist/components/sd-progress.js +1 -1
- package/dist/components/sd-radio-button.d.ts +11 -0
- package/dist/components/sd-radio-button.js +1 -0
- package/dist/components/sd-radio-group.js +1 -1
- package/dist/components/sd-radio.js +1 -1
- package/dist/components/sd-select-dropdown.js +1 -1
- package/dist/components/sd-select-group.js +1 -1
- package/dist/components/sd-select-multiple-group.js +1 -1
- package/dist/components/sd-select-multiple.js +1 -1
- package/dist/components/sd-select-option-group.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select-search-input.js +1 -1
- package/dist/components/sd-select-v2-list-item-search.js +1 -1
- package/dist/components/sd-select-v2-list-item.js +1 -1
- package/dist/components/sd-select-v2-listbox.js +1 -1
- package/dist/components/sd-select-v2-trigger.js +1 -1
- package/dist/components/sd-select-v2.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-switch.d.ts +11 -0
- package/dist/components/sd-switch.js +1 -0
- 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.d.ts +11 -0
- package/dist/components/sd-tbody.js +1 -0
- package/dist/components/sd-td.d.ts +11 -0
- package/dist/components/sd-td.js +1 -0
- package/dist/components/sd-text-link.js +1 -1
- package/dist/components/sd-textarea.js +1 -1
- package/dist/components/sd-thead.d.ts +11 -0
- package/dist/components/sd-thead.js +1 -0
- 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.d.ts +11 -0
- package/dist/components/sd-tr.js +1 -0
- package/dist/components/table-test.d.ts +11 -0
- package/dist/components/table-test.js +1 -0
- 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-03099a57.entry.js +1 -0
- package/dist/design-system/p-04be87a4.entry.js +1 -0
- package/dist/design-system/{p-e9c28bdc.entry.js → p-09ba9dbc.entry.js} +1 -1
- package/dist/design-system/p-0ca594a4.entry.js +1 -0
- package/dist/design-system/p-0fbb6d92.entry.js +1 -0
- package/dist/design-system/p-12a03c88.entry.js +1 -0
- package/dist/design-system/p-15cda79c.entry.js +1 -0
- package/dist/design-system/p-1b9e427e.entry.js +1 -0
- package/dist/design-system/p-1cbe4b22.entry.js +1 -0
- package/dist/design-system/{p-a03ad24f.entry.js → p-1d310832.entry.js} +1 -1
- package/dist/design-system/p-2f64dd95.entry.js +1 -0
- package/dist/design-system/p-33e4ce64.entry.js +1 -0
- package/dist/design-system/{p-14b67a6e.entry.js → p-363da5ff.entry.js} +1 -1
- package/dist/design-system/p-3d341993.entry.js +1 -0
- package/dist/design-system/p-3f79f1d1.entry.js +1 -0
- package/dist/design-system/{p-c59191d3.entry.js → p-40495e05.entry.js} +1 -1
- package/dist/design-system/p-4128c17f.entry.js +1 -0
- package/dist/design-system/{p-614c9883.entry.js → p-4a53d7b0.entry.js} +1 -1
- package/dist/design-system/{p-9ae589c4.entry.js → p-4dcadde3.entry.js} +1 -1
- package/dist/design-system/{p-62992b73.entry.js → p-53bc77f8.entry.js} +1 -1
- package/dist/design-system/{p-28058050.entry.js → p-5a63febd.entry.js} +1 -1
- package/dist/design-system/p-656acb07.entry.js +1 -0
- package/dist/design-system/{p-30055371.entry.js → p-6c71d7b7.entry.js} +1 -1
- package/dist/design-system/{p-7a18a52b.entry.js → p-73acee07.entry.js} +1 -1
- package/dist/design-system/p-748ece8e.entry.js +1 -0
- package/dist/design-system/p-7e09fdd5.entry.js +1 -0
- package/dist/design-system/{p-4272b9e6.entry.js → p-84a329fb.entry.js} +1 -1
- package/dist/design-system/p-867ec4ee.entry.js +1 -0
- package/dist/design-system/p-8acf3b67.entry.js +1 -0
- package/dist/design-system/p-8d2328ae.entry.js +1 -0
- package/dist/design-system/{p-dee605b1.entry.js → p-9af7e19a.entry.js} +1 -1
- package/dist/design-system/p-BqHL8W3c.js +2 -0
- package/dist/design-system/{p-DSRYrM1n.js → p-COK6PVLC.js} +1 -1
- package/dist/design-system/p-DOXMJi-V.js +1 -0
- package/dist/design-system/{p-72b564ed.entry.js → p-a129711d.entry.js} +1 -1
- package/dist/design-system/p-a24c3431.entry.js +1 -0
- package/dist/design-system/{p-3acd076e.entry.js → p-a27718c1.entry.js} +1 -1
- package/dist/design-system/{p-3d10be45.entry.js → p-a9a91e69.entry.js} +1 -1
- package/dist/design-system/p-ae1800c0.entry.js +1 -0
- package/dist/design-system/p-b1fe12f8.entry.js +1 -0
- package/dist/design-system/p-b60ae063.entry.js +1 -0
- package/dist/design-system/p-b6e02544.entry.js +1 -0
- package/dist/design-system/p-bYCOh35g.js +1 -0
- package/dist/design-system/{p-fa8b64c2.entry.js → p-c2f3470f.entry.js} +1 -1
- package/dist/design-system/{p-85e22acd.entry.js → p-c4e68815.entry.js} +1 -1
- package/dist/design-system/p-c98ed6ae.entry.js +1 -0
- package/dist/design-system/p-ca80379a.entry.js +1 -0
- package/dist/design-system/{p-5d2e8779.entry.js → p-d04551be.entry.js} +1 -1
- package/dist/design-system/p-e0f9e5b5.entry.js +1 -0
- package/dist/design-system/p-e1fdd540.entry.js +1 -0
- package/dist/design-system/{p-2bd887ca.entry.js → p-e33389b8.entry.js} +1 -1
- package/dist/design-system/p-e78faea6.entry.js +1 -0
- package/dist/design-system/p-e9f24d23.entry.js +1 -0
- package/dist/design-system/{p-00207f08.entry.js → p-ec79fefd.entry.js} +1 -1
- package/dist/design-system/{p-067b0b3c.entry.js → p-f3a60f61.entry.js} +1 -1
- package/dist/design-system/p-f9b9204d.entry.js +1 -0
- package/dist/design-system/{p-13fed1bd.entry.js → p-fd296c73.entry.js} +1 -1
- package/dist/design-system/p-sZMi_32I.js +1 -0
- package/dist/esm/{component.modal-mO5GcwI3.js → component.modal-DOXMJi-V.js} +14 -0
- package/dist/esm/constants-sZMi_32I.js +3 -0
- package/dist/esm/design-system.js +3 -4
- package/dist/esm/{index-DsU722JF.js → index-BqHL8W3c.js} +128 -10
- package/dist/esm/index.js +103 -33
- package/dist/esm/loader.js +3 -4
- package/dist/esm/sd-action-modal.entry.js +3 -3
- package/dist/esm/sd-badge.entry.js +2 -2
- package/dist/esm/sd-barcode-input.entry.js +3 -3
- package/dist/esm/sd-button-v2_2.entry.js +9 -8
- package/dist/esm/sd-button_4.entry.js +56 -18
- package/dist/esm/sd-calendar.entry.js +1 -1
- package/dist/esm/sd-card.entry.js +2 -2
- package/dist/esm/sd-checkbox.entry.js +30 -5
- package/dist/esm/sd-circle-progress.entry.js +69 -0
- package/dist/esm/sd-confirm-modal_2.entry.js +183 -0
- package/dist/esm/sd-date-box.entry.js +1 -1
- package/dist/esm/sd-date-picker-calendar.entry.js +3 -3
- package/dist/esm/sd-date-picker-trigger.entry.js +4 -4
- package/dist/esm/{sd-date-picker.config-C4i826lM.js → sd-date-picker.config-bYCOh35g.js} +3 -3
- package/dist/esm/sd-date-picker.entry.js +4 -4
- package/dist/esm/sd-date-range-picker-calendar.entry.js +3 -3
- package/dist/esm/sd-date-range-picker.entry.js +4 -4
- package/dist/esm/sd-dropdown-button.entry.js +10 -5
- package/dist/esm/sd-file-picker.entry.js +1 -1
- package/dist/esm/sd-form.entry.js +1 -1
- package/dist/esm/sd-ghost-button.entry.js +15 -6
- package/dist/esm/sd-guide.entry.js +2 -2
- package/dist/esm/sd-input_2.entry.js +7 -7
- package/dist/esm/sd-loading-container.entry.js +27 -0
- package/dist/esm/sd-modal-container.entry.js +45 -2
- package/dist/esm/sd-number-input.entry.js +5 -10
- package/dist/esm/{sd-select-v2.entry.js → sd-pagination_2.entry.js} +90 -5
- package/dist/esm/sd-popover.entry.js +4 -4
- package/dist/esm/sd-portal.entry.js +2 -2
- package/dist/esm/sd-progress.entry.js +3 -3
- package/dist/esm/sd-radio-button.entry.js +180 -0
- package/dist/esm/sd-radio-group.entry.js +1 -1
- package/dist/esm/sd-radio.entry.js +6 -6
- package/dist/esm/sd-select-dropdown_2.entry.js +4 -4
- package/dist/esm/sd-select-group.entry.js +3 -3
- package/dist/esm/sd-select-multiple-group.entry.js +2 -2
- package/dist/esm/sd-select-multiple.entry.js +3 -3
- package/dist/esm/sd-select-option-group.entry.js +4 -4
- package/dist/esm/sd-select-v2-list-item_4.entry.js +656 -0
- package/dist/esm/sd-select.entry.js +177 -0
- package/dist/esm/sd-switch.entry.js +108 -0
- package/dist/esm/sd-table.entry.js +424 -651
- package/dist/esm/sd-tabs.entry.js +2 -2
- package/dist/esm/sd-tag.entry.js +6 -5
- package/dist/esm/sd-tbody.entry.js +64 -0
- package/dist/esm/sd-td.entry.js +56 -0
- package/dist/esm/sd-text-link.entry.js +10 -12
- package/dist/esm/sd-textarea.entry.js +2 -2
- package/dist/esm/sd-thead.entry.js +177 -0
- 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 +96 -13
- package/dist/esm/sd-tr.entry.js +169 -0
- package/dist/esm/table-test.entry.js +94 -0
- package/dist/esm/{tooltipArrow-CJuzsrdH.js → tooltipArrow-BcsrQx1U.js} +1 -1
- package/dist/types/__mocks__/nanoid-non-secure.d.ts +2 -0
- package/dist/types/__mocks__/nanoid.d.ts +1 -0
- package/dist/types/components/sd-button-v2/sd-button-v2.d.ts +1 -0
- package/dist/types/components/sd-checkbox/sd-checkbox.config.d.ts +3 -0
- package/dist/types/components/sd-checkbox/sd-checkbox.d.ts +2 -0
- package/dist/types/components/sd-circle-progress/sd-circle-progress.config.d.ts +9 -0
- package/dist/types/components/sd-circle-progress/sd-circle-progress.d.ts +8 -0
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.config.d.ts +1 -0
- package/dist/types/components/sd-field/sd-field.config.d.ts +9 -0
- package/dist/types/components/sd-field/sd-field.d.ts +2 -0
- package/dist/types/components/sd-ghost-button/sd-ghost-button.config.d.ts +1 -1
- package/dist/types/components/sd-loading-container/sd-loading-container.config.d.ts +4 -0
- package/dist/types/components/sd-loading-container/sd-loading-container.d.ts +8 -0
- package/dist/types/components/sd-loading-modal/sd-loading-modal.config.d.ts +25 -0
- package/dist/types/components/sd-loading-modal/sd-loading-modal.d.ts +15 -0
- package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +10 -0
- package/dist/types/components/sd-modal-container/sd-modal-container.d.ts +6 -2
- package/dist/types/components/sd-number-input/sd-number-input.config.d.ts +0 -1
- package/dist/types/components/sd-radio-button/sd-radio-button.config.d.ts +44 -0
- package/dist/types/components/{sd-radio-button-group/sd-radio-button-group.d.ts → sd-radio-button/sd-radio-button.d.ts} +4 -3
- package/dist/types/components/sd-select-v2/sd-select-v2.config.d.ts +1 -0
- package/dist/types/components/sd-switch/sd-switch.config.d.ts +22 -0
- package/dist/types/components/{sd-toggle-button/sd-toggle-button.d.ts → sd-switch/sd-switch.d.ts} +2 -6
- package/dist/types/components/sd-table/constants.d.ts +44 -0
- package/dist/types/components/sd-table/sd-table.d.ts +103 -115
- package/dist/types/components/sd-table/sd-tbody/sd-tbody.d.ts +14 -0
- package/dist/types/components/sd-table/sd-td/sd-td.d.ts +12 -0
- package/dist/types/components/sd-table/sd-thead/sd-thead.d.ts +36 -0
- package/dist/types/components/sd-table/sd-tr/sd-tr.d.ts +34 -0
- package/dist/types/components/sd-toggle/sd-toggle.config.d.ts +32 -0
- package/dist/types/components/sd-toggle/sd-toggle.d.ts +0 -3
- package/dist/types/components/table-test/table-test.d.ts +46 -0
- package/dist/types/components.d.ts +532 -141
- package/dist/types/index.d.ts +3 -1
- package/dist/types/utils/loading.d.ts +7 -0
- package/dist/types/utils/modal.d.ts +19 -3
- package/hydrate/index.js +2466 -965
- package/hydrate/index.mjs +2466 -965
- package/package.json +1 -1
- package/readme.md +1 -1
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
- package/dist/cjs/sd-confirm-modal.cjs.entry.js +0 -106
- package/dist/cjs/sd-loading-spinner_3.cjs.entry.js +0 -283
- package/dist/cjs/sd-radio-button-group.cjs.entry.js +0 -57
- package/dist/cjs/sd-select-v2-list-item_2.cjs.entry.js +0 -150
- package/dist/cjs/sd-select-v2-listbox_2.cjs.entry.js +0 -353
- package/dist/cjs/sd-select-v2.config-7xBJQhvx.js +0 -171
- package/dist/cjs/sd-toggle-button.cjs.entry.js +0 -49
- package/dist/collection/components/sd-loading-spinner/sd-loading-spinner.css +0 -44
- package/dist/collection/components/sd-loading-spinner/sd-loading-spinner.js +0 -46
- package/dist/collection/components/sd-radio-button-group/sd-radio-button-group.css +0 -85
- package/dist/collection/components/sd-toggle-button/sd-toggle-button.css +0 -47
- package/dist/components/p-5OtzmjLh.js +0 -1
- package/dist/components/p-BFaIxm6b.js +0 -1
- package/dist/components/p-BP-QKaKz.js +0 -1
- package/dist/components/p-BSZadK9N.js +0 -1
- package/dist/components/p-BbtO5CEW.js +0 -1
- package/dist/components/p-BxPyZJaz.js +0 -1
- package/dist/components/p-C-qSDgVU.js +0 -1
- package/dist/components/p-C4i826lM.js +0 -1
- package/dist/components/p-CEa1HSpw.js +0 -1
- package/dist/components/p-CYRGa0VL.js +0 -1
- package/dist/components/p-ClgihpRm.js +0 -1
- package/dist/components/p-D-Y0-FQk.js +0 -1
- package/dist/components/p-D-pFdq6g.js +0 -1
- package/dist/components/p-DPipeCRI.js +0 -1
- package/dist/components/p-DSYw-7RA.js +0 -1
- package/dist/components/p-DXAB0k9r.js +0 -1
- package/dist/components/p-mO5GcwI3.js +0 -1
- package/dist/components/sd-loading-spinner.js +0 -1
- package/dist/components/sd-radio-button-group.js +0 -1
- package/dist/components/sd-toggle-button.js +0 -1
- package/dist/design-system/p-0e6f5a99.entry.js +0 -1
- package/dist/design-system/p-22a4972a.entry.js +0 -1
- package/dist/design-system/p-27df33c1.entry.js +0 -1
- package/dist/design-system/p-3ac6a626.entry.js +0 -1
- package/dist/design-system/p-6610c16b.entry.js +0 -1
- package/dist/design-system/p-739ac181.entry.js +0 -1
- package/dist/design-system/p-7dce4241.entry.js +0 -1
- package/dist/design-system/p-7e4c0a36.entry.js +0 -1
- package/dist/design-system/p-8b5b2866.entry.js +0 -1
- package/dist/design-system/p-90f51f65.entry.js +0 -1
- package/dist/design-system/p-C3eQSZx-.js +0 -1
- package/dist/design-system/p-C4i826lM.js +0 -1
- package/dist/design-system/p-DQuL1Twl.js +0 -1
- package/dist/design-system/p-DsU722JF.js +0 -2
- package/dist/design-system/p-a6bc8512.entry.js +0 -1
- package/dist/design-system/p-afeb740a.entry.js +0 -1
- package/dist/design-system/p-b3e0e6f4.entry.js +0 -1
- package/dist/design-system/p-ba90dc5f.entry.js +0 -1
- package/dist/design-system/p-bad88292.entry.js +0 -1
- package/dist/design-system/p-cbb5575d.entry.js +0 -1
- package/dist/design-system/p-ce6a0b0f.entry.js +0 -1
- package/dist/design-system/p-d07448fe.entry.js +0 -1
- package/dist/design-system/p-d1a94401.entry.js +0 -1
- package/dist/design-system/p-d5b5cfc7.entry.js +0 -1
- package/dist/design-system/p-d75e0dc0.entry.js +0 -1
- package/dist/design-system/p-e9ed9c00.entry.js +0 -1
- package/dist/design-system/p-f8567970.entry.js +0 -1
- package/dist/design-system/p-fa22f13c.entry.js +0 -1
- package/dist/design-system/p-fbac6160.entry.js +0 -1
- package/dist/design-system/p-mO5GcwI3.js +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/sd-confirm-modal.entry.js +0 -104
- package/dist/esm/sd-loading-spinner_3.entry.js +0 -279
- package/dist/esm/sd-radio-button-group.entry.js +0 -55
- package/dist/esm/sd-select-v2-list-item_2.entry.js +0 -147
- package/dist/esm/sd-select-v2-listbox_2.entry.js +0 -350
- package/dist/esm/sd-select-v2.config-C3eQSZx-.js +0 -158
- package/dist/esm/sd-toggle-button.entry.js +0 -47
- package/dist/types/components/sd-loading-spinner/sd-loading-spinner.d.ts +0 -5
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { h,
|
|
1
|
+
import { h, Host, readTask, } from "@stencil/core";
|
|
2
|
+
import { nanoid } from "nanoid";
|
|
3
|
+
import { TABLE_ID_ATTR, } from "./constants";
|
|
2
4
|
export class SdTable {
|
|
5
|
+
static DEFAULT_NO_DATA_LABEL = '데이터가 없습니다.';
|
|
3
6
|
el;
|
|
4
|
-
|
|
7
|
+
tableId = nanoid(8);
|
|
8
|
+
fallbackTableId = nanoid(8);
|
|
9
|
+
columns = [];
|
|
5
10
|
rows;
|
|
6
11
|
selected = [];
|
|
7
12
|
rowKey = 'id';
|
|
@@ -11,603 +16,391 @@ export class SdTable {
|
|
|
11
16
|
height;
|
|
12
17
|
stickyHeader = false;
|
|
13
18
|
stickyColumn = { left: 0, right: 0 };
|
|
14
|
-
noDataLabel =
|
|
19
|
+
noDataLabel = SdTable.DEFAULT_NO_DATA_LABEL;
|
|
20
|
+
resolvedNoDataLabel = SdTable.DEFAULT_NO_DATA_LABEL;
|
|
15
21
|
isLoading = false;
|
|
16
22
|
pagination;
|
|
17
23
|
useInternalPagination = false;
|
|
18
24
|
useRowsPerPageSelect = false;
|
|
25
|
+
// ─── Virtual Scroll ───────────────────────────────────────────────
|
|
26
|
+
useVirtualScroll = false;
|
|
27
|
+
rowHeight = 40;
|
|
28
|
+
virtualBuffer = 5;
|
|
29
|
+
virtualEndThreshold = 10;
|
|
30
|
+
// ─────────────────────────────────────────────────────────────────
|
|
19
31
|
rowsPerPageOption = [
|
|
20
32
|
{ label: '10개씩 보기', value: 10 },
|
|
21
33
|
{ label: '25개씩 보기', value: 25 },
|
|
22
34
|
{ label: '50개씩 보기', value: 50 },
|
|
23
35
|
{ label: '100개씩 보기', value: 100 },
|
|
24
36
|
];
|
|
25
|
-
useVirtualScroll = {}; // 가상 스크롤 사용 여부
|
|
26
|
-
virtualRowHeight = 44; // 가상 스크롤 사용시 각 행의 높이 - 세로 가상 스크롤 사용시 필수값
|
|
27
|
-
// 가상 스크롤 사용시 각 열의 너비 - 가로 가상 스크롤 사용시 필수값
|
|
28
|
-
// 가상화하려는 컬럼의 넓이는 무조건 고정(resizable의 경우 넓이가 변동되는데 이때에는 고려 x)
|
|
29
|
-
virtualColumnWidth = 120;
|
|
30
|
-
virtualBufferSize = {
|
|
31
|
-
vertical: 5,
|
|
32
|
-
horizontal: 5,
|
|
33
|
-
}; // 가상 스크롤 위아래 버퍼 크기
|
|
34
37
|
sdSelectChange;
|
|
35
38
|
sdPageChange;
|
|
36
39
|
sdRowsPerPageChange;
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
sdVirtualUpdate;
|
|
41
|
+
sdVirtualReachEnd;
|
|
42
|
+
currentPage = 1;
|
|
43
|
+
innerRowsPerPage = 10;
|
|
39
44
|
innerSelected = new Set();
|
|
40
45
|
columnWidths = [];
|
|
41
46
|
scrolledLeft = false;
|
|
42
47
|
scrolledRight = false;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
virtualStartColIdx = 0;
|
|
49
|
-
virtualEndColIdx = 0;
|
|
50
|
-
scrollLeftPosition = 0;
|
|
51
|
-
// 가상 스크롤 Raf(Request Animation Frame) 관리
|
|
52
|
-
scrollRequestAnimationFrame = null;
|
|
48
|
+
rowCount = 0;
|
|
49
|
+
loadingScrollTop = 0;
|
|
50
|
+
vsStart = 0;
|
|
51
|
+
vsEnd = 0;
|
|
52
|
+
lastReachEndNotifiedRowCount = -1;
|
|
53
53
|
scrollContainer = null;
|
|
54
|
-
resizeObserver = null;
|
|
55
|
-
rafScheduled = false;
|
|
56
|
-
pendingUpdates = {
|
|
57
|
-
vertical: false,
|
|
58
|
-
horizontal: false,
|
|
59
|
-
};
|
|
60
|
-
// 상태 캐시값
|
|
61
|
-
cachedVirtualRows = null;
|
|
62
|
-
cachedVirtualIndexKey = '';
|
|
63
|
-
cachedColumnOrder = null;
|
|
64
|
-
lastColumnOrderKey = '';
|
|
65
|
-
// DOM 측정 캐시값
|
|
66
|
-
cachedContainerHeight = 0;
|
|
67
|
-
cachedContainerWidth = 0;
|
|
68
|
-
// 스타일 캐시
|
|
69
|
-
stickyStyleCache = new Map();
|
|
70
|
-
// isAllChecked 캐시
|
|
71
|
-
cachedIsAllChecked;
|
|
72
|
-
lastSelectionKey = '';
|
|
73
54
|
onScroll;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
55
|
+
toFiniteNumber(value, fallback) {
|
|
56
|
+
const n = typeof value === 'number' ? value : Number(value);
|
|
57
|
+
return Number.isFinite(n) ? n : fallback;
|
|
77
58
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.refreshColumnLayout();
|
|
81
|
-
if (this.useVirtualScroll.vertical) {
|
|
82
|
-
this.scheduleUpdate('vertical');
|
|
83
|
-
}
|
|
59
|
+
isRowsPerPageValue(value) {
|
|
60
|
+
return value === null || typeof value === 'string' || typeof value === 'number';
|
|
84
61
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
62
|
+
isValidTableId(value) {
|
|
63
|
+
return (typeof value === 'string' &&
|
|
64
|
+
value.trim().length > 0 &&
|
|
65
|
+
value !== 'undefined' &&
|
|
66
|
+
value !== 'null');
|
|
90
67
|
}
|
|
91
|
-
|
|
92
|
-
this.
|
|
68
|
+
getResolvedTableId() {
|
|
69
|
+
if (this.isValidTableId(this.tableId))
|
|
70
|
+
return this.tableId;
|
|
71
|
+
const attrId = this.el?.getAttribute(TABLE_ID_ATTR);
|
|
72
|
+
if (this.isValidTableId(attrId))
|
|
73
|
+
return attrId;
|
|
74
|
+
return this.fallbackTableId;
|
|
93
75
|
}
|
|
94
|
-
|
|
95
|
-
this.
|
|
76
|
+
syncTableIdAttribute() {
|
|
77
|
+
const resolvedTableId = this.getResolvedTableId();
|
|
78
|
+
if (this.el?.getAttribute(TABLE_ID_ATTR) !== resolvedTableId) {
|
|
79
|
+
this.el.setAttribute(TABLE_ID_ATTR, resolvedTableId);
|
|
80
|
+
}
|
|
96
81
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
this.scheduleUpdate('horizontal');
|
|
82
|
+
handleIsLoadingChange(newVal) {
|
|
83
|
+
if (newVal) {
|
|
84
|
+
this.loadingScrollTop = this.scrollContainer?.scrollTop ?? 0;
|
|
101
85
|
}
|
|
102
86
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
this.scheduleUpdate('vertical');
|
|
87
|
+
handleUseVirtualScrollChange(newVal) {
|
|
88
|
+
if (newVal) {
|
|
89
|
+
// DOM이 새 --table-container-height로 업데이트된 후 계산해야 정확함
|
|
90
|
+
readTask(() => this.propagateVirtualUpdate());
|
|
108
91
|
}
|
|
109
92
|
}
|
|
110
|
-
|
|
111
|
-
this.
|
|
112
|
-
this.
|
|
93
|
+
handleColumnsChange(newCols) {
|
|
94
|
+
this.columnWidths = newCols.map(c => parseInt(c.width || '120', 10));
|
|
95
|
+
this.refreshChildrenConfig();
|
|
96
|
+
}
|
|
97
|
+
handleRowsChange(newRows) {
|
|
98
|
+
if (!Array.isArray(newRows))
|
|
99
|
+
return;
|
|
100
|
+
this.rowCount = newRows.length;
|
|
101
|
+
if (this.useVirtualScroll)
|
|
102
|
+
this.propagateVirtualUpdate(true);
|
|
103
|
+
this.pushRowsToChildren(newRows);
|
|
113
104
|
}
|
|
114
|
-
|
|
115
|
-
this.
|
|
116
|
-
this.cachedVirtualIndexKey = '';
|
|
117
|
-
this.cachedColumnOrder = null;
|
|
118
|
-
this.lastColumnOrderKey = '';
|
|
105
|
+
handleTableIdChange() {
|
|
106
|
+
this.syncTableIdAttribute();
|
|
119
107
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
108
|
+
handleNoDataLabelChange(newLabel) {
|
|
109
|
+
if (typeof newLabel === 'string' &&
|
|
110
|
+
newLabel.trim().length > 0 &&
|
|
111
|
+
newLabel !== 'undefined' &&
|
|
112
|
+
newLabel !== 'null') {
|
|
113
|
+
this.resolvedNoDataLabel = newLabel;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.resolvedNoDataLabel = SdTable.DEFAULT_NO_DATA_LABEL;
|
|
125
117
|
}
|
|
126
118
|
}
|
|
127
|
-
|
|
128
|
-
this.
|
|
129
|
-
this.lastSelectionKey = '';
|
|
119
|
+
handleConfigChange() {
|
|
120
|
+
this.refreshChildrenConfig();
|
|
130
121
|
}
|
|
131
|
-
|
|
132
|
-
this.
|
|
133
|
-
this.clearSelectionCache();
|
|
122
|
+
handleSelectedChange(newSelected) {
|
|
123
|
+
this.innerSelected = new Set(newSelected);
|
|
134
124
|
}
|
|
135
125
|
handlePaginationChange(newVal) {
|
|
136
|
-
this.clearRowDerivedCache();
|
|
137
126
|
if (newVal?.page && newVal.page !== this.currentPage) {
|
|
138
127
|
this.currentPage = newVal.page;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
this.calculateVisibleRange();
|
|
143
|
-
}
|
|
128
|
+
}
|
|
129
|
+
if (newVal?.rowsPerPage && newVal.rowsPerPage !== this.innerRowsPerPage) {
|
|
130
|
+
this.innerRowsPerPage = newVal.rowsPerPage;
|
|
144
131
|
}
|
|
145
132
|
}
|
|
146
133
|
componentWillLoad() {
|
|
147
|
-
this.
|
|
148
|
-
this.
|
|
149
|
-
this.
|
|
134
|
+
this.syncTableIdAttribute();
|
|
135
|
+
this.handleNoDataLabelChange(this.noDataLabel);
|
|
136
|
+
this.innerSelected = new Set(this.selected || []);
|
|
137
|
+
this.columnWidths = (this.columns || []).map(c => parseInt(c.width || '120', 10));
|
|
150
138
|
if (this.pagination?.page) {
|
|
151
139
|
this.currentPage = this.pagination.page;
|
|
152
140
|
}
|
|
141
|
+
if (this.pagination?.rowsPerPage) {
|
|
142
|
+
this.innerRowsPerPage = this.pagination.rowsPerPage;
|
|
143
|
+
}
|
|
144
|
+
const el = this.el;
|
|
145
|
+
el.isRowSelectedSync = this.isRowSelectedSync.bind(this);
|
|
146
|
+
el.updateRowSelectSync = this.updateRowSelectSync.bind(this);
|
|
147
|
+
el.toggleSelectAllSync = this.toggleSelectAllSync.bind(this);
|
|
148
|
+
el.getIsAllCheckedSync = this.getIsAllCheckedSync.bind(this);
|
|
149
|
+
el.getStickyStyleSync = this.getStickyStyleSync.bind(this);
|
|
150
|
+
el.setRowCountSync = this.setRowCountSync.bind(this);
|
|
151
|
+
el.handleResize = this.handleResize.bind(this);
|
|
152
|
+
el.getPaginationInfoSync = this.getPaginationInfoSync.bind(this);
|
|
153
|
+
el.getVirtualScrollRangeSync = this.getVirtualScrollRangeSync.bind(this);
|
|
154
|
+
el.getConfigSync = this.getConfigSync.bind(this);
|
|
155
|
+
el.getTableIdSync = () => this.getResolvedTableId();
|
|
156
|
+
el.getVirtualScrollConfigSync = this.getVirtualScrollConfigSync.bind(this);
|
|
157
|
+
el.calculateVisibleRange = this.calculateVisibleRange.bind(this);
|
|
158
|
+
if (Array.isArray(this.rows)) {
|
|
159
|
+
this.rowCount = this.rows.length;
|
|
160
|
+
this.pushRowsToChildren(this.rows);
|
|
161
|
+
}
|
|
153
162
|
}
|
|
154
163
|
componentDidLoad() {
|
|
164
|
+
if (Array.isArray(this.rows)) {
|
|
165
|
+
this.pushRowsToChildren(this.rows);
|
|
166
|
+
}
|
|
155
167
|
readTask(() => {
|
|
156
|
-
const
|
|
157
|
-
if (!
|
|
168
|
+
const wrapper = this.el.shadowRoot?.querySelector('.sd-table__wrapper');
|
|
169
|
+
if (!wrapper)
|
|
158
170
|
return;
|
|
171
|
+
let rafPending = false;
|
|
159
172
|
this.onScroll = () => {
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
const verticalChanged = this.useVirtualScroll.vertical && this.scrollTopPosition !== scrollTop;
|
|
165
|
-
const horizontalChanged = this.useVirtualScroll.horizontal && this.scrollLeftPosition !== scrollLeft;
|
|
173
|
+
// 가로 스크롤 그림자
|
|
174
|
+
const scrollLeft = wrapper.scrollLeft;
|
|
175
|
+
const scrollWidth = wrapper.scrollWidth;
|
|
176
|
+
const clientWidth = wrapper.clientWidth;
|
|
166
177
|
const newScrolledLeft = scrollLeft > 0;
|
|
167
178
|
const newScrolledRight = scrollLeft + clientWidth < scrollWidth;
|
|
168
179
|
if (this.scrolledLeft !== newScrolledLeft || this.scrolledRight !== newScrolledRight) {
|
|
169
180
|
this.scrolledLeft = newScrolledLeft;
|
|
170
181
|
this.scrolledRight = newScrolledRight;
|
|
182
|
+
this.refreshChildrenConfig();
|
|
171
183
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
this.scrollTopPosition = scrollTop;
|
|
179
|
-
this.calculateVisibleRange();
|
|
180
|
-
}
|
|
181
|
-
if (horizontalChanged) {
|
|
182
|
-
this.scrollLeftPosition = scrollLeft;
|
|
183
|
-
this.calculateVisibleColumnRange();
|
|
184
|
-
}
|
|
185
|
-
this.scrollRequestAnimationFrame = null;
|
|
184
|
+
// 세로 가상 스크롤 — RAF로 프레임당 1회만 처리
|
|
185
|
+
if (this.useVirtualScroll && !rafPending) {
|
|
186
|
+
rafPending = true;
|
|
187
|
+
requestAnimationFrame(() => {
|
|
188
|
+
rafPending = false;
|
|
189
|
+
this.propagateVirtualUpdate();
|
|
186
190
|
});
|
|
187
191
|
}
|
|
188
192
|
};
|
|
189
|
-
this.scrollContainer =
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
this.startResizeObserver();
|
|
196
|
-
if (this.useVirtualScroll.vertical) {
|
|
197
|
-
this.calculateVisibleRange();
|
|
198
|
-
}
|
|
199
|
-
if (this.useVirtualScroll.horizontal) {
|
|
200
|
-
this.calculateVisibleColumnRange();
|
|
201
|
-
}
|
|
202
|
-
this.onScroll();
|
|
203
|
-
}
|
|
204
|
-
});
|
|
193
|
+
this.scrollContainer = wrapper;
|
|
194
|
+
wrapper.addEventListener('scroll', this.onScroll, { passive: true });
|
|
195
|
+
this.onScroll();
|
|
196
|
+
if (this.useVirtualScroll) {
|
|
197
|
+
this.propagateVirtualUpdate(); // 초기 렌더
|
|
198
|
+
}
|
|
205
199
|
});
|
|
206
200
|
}
|
|
207
|
-
changePage(page) {
|
|
208
|
-
if (!this.useInternalPagination) {
|
|
209
|
-
this.sdPageChange.emit(page);
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
this.currentPage = page;
|
|
213
|
-
this.clearRowDerivedCache();
|
|
214
|
-
if (this.useVirtualScroll.vertical && this.scrollContainer) {
|
|
215
|
-
this.scrollContainer.scrollTo({ top: 0, behavior: 'instant' });
|
|
216
|
-
this.scrollTopPosition = 0;
|
|
217
|
-
this.calculateVisibleRange();
|
|
218
|
-
}
|
|
219
|
-
this.sdPageChange.emit(this.currentPage);
|
|
220
|
-
}
|
|
221
|
-
changeRowsPerPage(perPage) {
|
|
222
|
-
const changedRowsPerPage = perPage ? Number(perPage) : 0;
|
|
223
|
-
if (!this.useInternalPagination) {
|
|
224
|
-
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
const newRowsPerPage = Number(perPage || 0);
|
|
228
|
-
let newLastPage = Math.max(1, Math.ceil(this.innerRows.length / newRowsPerPage));
|
|
229
|
-
let newCurrentPage = this.currentPage;
|
|
230
|
-
if (newCurrentPage > newLastPage) {
|
|
231
|
-
newCurrentPage = newLastPage;
|
|
232
|
-
}
|
|
233
|
-
this.pagination = {
|
|
234
|
-
page: newCurrentPage,
|
|
235
|
-
rowsPerPage: newRowsPerPage,
|
|
236
|
-
lastPage: newLastPage,
|
|
237
|
-
};
|
|
238
|
-
this.currentPage = newCurrentPage;
|
|
239
|
-
this.clearRowDerivedCache();
|
|
240
|
-
if (this.useVirtualScroll.vertical && this.scrollContainer) {
|
|
241
|
-
this.scrollContainer.scrollTo({ top: 0, behavior: 'instant' });
|
|
242
|
-
this.scrollTopPosition = 0;
|
|
243
|
-
this.calculateVisibleRange();
|
|
244
|
-
}
|
|
245
|
-
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
246
|
-
}
|
|
247
201
|
disconnectedCallback() {
|
|
248
202
|
if (this.scrollContainer && this.onScroll) {
|
|
249
203
|
this.scrollContainer.removeEventListener('scroll', this.onScroll);
|
|
250
204
|
}
|
|
251
|
-
this.resizeObserver?.disconnect();
|
|
252
|
-
if (this.scrollRequestAnimationFrame !== null) {
|
|
253
|
-
cancelAnimationFrame(this.scrollRequestAnimationFrame);
|
|
254
|
-
}
|
|
255
205
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
206
|
+
pushRowsToChildren(rows) {
|
|
207
|
+
const tbody = this.el.querySelector('sd-tbody');
|
|
208
|
+
if (tbody)
|
|
209
|
+
tbody.rows = rows;
|
|
210
|
+
const thead = this.el.querySelector('sd-thead');
|
|
211
|
+
if (thead)
|
|
212
|
+
thead.rows = rows;
|
|
259
213
|
}
|
|
260
|
-
|
|
261
|
-
if (
|
|
262
|
-
|
|
263
|
-
const { rowsPerPage = this.rows.length } = this.pagination || {};
|
|
264
|
-
return this.innerRows.slice((this.currentPage - 1) * rowsPerPage, this.currentPage * rowsPerPage);
|
|
265
|
-
}
|
|
266
|
-
get virtualRows() {
|
|
267
|
-
const pageKey = this.useInternalPagination
|
|
268
|
-
? `${this.currentPage}-${this.pagination?.rowsPerPage ?? 'all'}`
|
|
269
|
-
: 'all';
|
|
270
|
-
const newVirtualIndexKey = `${pageKey}-${this.innerRows.length}-${this.virtualStartIndex}-${this.virtualEndIndex}`;
|
|
271
|
-
if (this.cachedVirtualRows && this.cachedVirtualIndexKey === newVirtualIndexKey) {
|
|
272
|
-
return this.cachedVirtualRows;
|
|
273
|
-
}
|
|
274
|
-
this.cachedVirtualIndexKey = newVirtualIndexKey;
|
|
275
|
-
if (!this.useVirtualScroll.vertical) {
|
|
276
|
-
this.cachedVirtualRows = this.paginatedRows.map((row, idx) => ({ row, actualIndex: idx }));
|
|
214
|
+
handleStructureSlotChange = () => {
|
|
215
|
+
if (Array.isArray(this.rows)) {
|
|
216
|
+
this.pushRowsToChildren(this.rows);
|
|
277
217
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
return this.cachedVirtualRows;
|
|
287
|
-
}
|
|
288
|
-
get topSpacerHeight() {
|
|
289
|
-
if (!this.useVirtualScroll.vertical || this.virtualStartIndex === 0)
|
|
290
|
-
return 0;
|
|
291
|
-
return this.virtualStartIndex * this.virtualRowHeight;
|
|
292
|
-
}
|
|
293
|
-
get bottomSpacerHeight() {
|
|
294
|
-
if (!this.useVirtualScroll.vertical)
|
|
295
|
-
return 0;
|
|
296
|
-
const remainingRows = this.paginatedRows.length - this.virtualEndIndex - 1;
|
|
297
|
-
return remainingRows > 0 ? remainingRows * this.virtualRowHeight : 0;
|
|
218
|
+
this.refreshChildrenConfig();
|
|
219
|
+
};
|
|
220
|
+
refreshChildrenSelection() {
|
|
221
|
+
const thead = this.el.querySelector('sd-thead');
|
|
222
|
+
const rows = this.el.querySelectorAll('sd-tr');
|
|
223
|
+
thead?.refreshSelection?.();
|
|
224
|
+
rows.forEach(tr => tr?.refreshSelection?.());
|
|
298
225
|
}
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
return 0;
|
|
305
|
-
const targetIndex = position === 'left' ? [0, this.virtualStartColIdx] : [this.virtualEndColIdx + 1];
|
|
306
|
-
return virtualColumnWidths.slice(...targetIndex).reduce((sum, width) => sum + width, 0);
|
|
226
|
+
refreshChildrenConfig() {
|
|
227
|
+
const thead = this.el.querySelector('sd-thead');
|
|
228
|
+
const rows = this.el.querySelectorAll('sd-tr');
|
|
229
|
+
thead?.refreshConfig?.();
|
|
230
|
+
rows.forEach(tr => tr?.refreshConfig?.());
|
|
307
231
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
232
|
+
maybeEmitVirtualReachEnd(start, end) {
|
|
233
|
+
const threshold = Math.max(1, this.virtualEndThreshold);
|
|
234
|
+
const nearEnd = end >= Math.max(0, this.rowCount - threshold);
|
|
235
|
+
if (!nearEnd)
|
|
236
|
+
return;
|
|
237
|
+
if (this.lastReachEndNotifiedRowCount === this.rowCount)
|
|
238
|
+
return;
|
|
239
|
+
this.lastReachEndNotifiedRowCount = this.rowCount;
|
|
240
|
+
this.sdVirtualReachEnd.emit({
|
|
241
|
+
from: start,
|
|
242
|
+
to: end,
|
|
243
|
+
rowCount: this.rowCount,
|
|
244
|
+
threshold,
|
|
245
|
+
});
|
|
313
246
|
}
|
|
314
|
-
|
|
315
|
-
if (!this.useVirtualScroll
|
|
316
|
-
return
|
|
247
|
+
propagateVirtualUpdate(forceSpacerUpdate = false) {
|
|
248
|
+
if (!this.scrollContainer || !this.useVirtualScroll)
|
|
249
|
+
return;
|
|
250
|
+
const scrollTop = this.toFiniteNumber(this.scrollContainer.scrollTop, 0);
|
|
251
|
+
const containerHeight = this.toFiniteNumber(this.scrollContainer.clientHeight, 0);
|
|
252
|
+
const { start, end } = this.calculateVisibleRange(scrollTop, containerHeight);
|
|
253
|
+
if (!Number.isFinite(start) || !Number.isFinite(end))
|
|
254
|
+
return;
|
|
255
|
+
const rangeChanged = this.vsStart !== start || this.vsEnd !== end;
|
|
256
|
+
if (!rangeChanged && !forceSpacerUpdate)
|
|
257
|
+
return;
|
|
258
|
+
this.vsStart = start;
|
|
259
|
+
this.vsEnd = end;
|
|
260
|
+
const topHeight = start * this.rowHeight;
|
|
261
|
+
const bottomHeight = Math.max(0, (this.rowCount - end) * this.rowHeight);
|
|
262
|
+
const tbody = this.el.querySelector('sd-tbody');
|
|
263
|
+
tbody?.setSpacersSync?.(topHeight, bottomHeight);
|
|
264
|
+
if (rangeChanged) {
|
|
265
|
+
this.sdVirtualUpdate.emit({
|
|
266
|
+
from: start,
|
|
267
|
+
to: end,
|
|
268
|
+
});
|
|
317
269
|
}
|
|
318
|
-
|
|
270
|
+
this.maybeEmitVirtualReachEnd(start, end);
|
|
319
271
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
get sdTableClasses() {
|
|
330
|
-
return [
|
|
331
|
-
'sd-table',
|
|
332
|
-
this.stickyHeader && 'sd-table--sticky-header',
|
|
333
|
-
this.selectable && 'sd-table--selectable',
|
|
334
|
-
this.resizable && 'sd-table--resizable',
|
|
335
|
-
!this.innerRows.length && 'sd-table--no-data',
|
|
336
|
-
this.hasStickyColumn && 'sd-table--sticky-column',
|
|
337
|
-
this.scrolledLeft && 'sd-table--scrolled-left',
|
|
338
|
-
this.scrolledRight && 'sd-table--scrolled-right',
|
|
339
|
-
]
|
|
340
|
-
.filter(Boolean)
|
|
341
|
-
.join(' ');
|
|
272
|
+
getVirtualScrollConfigSync() {
|
|
273
|
+
return {
|
|
274
|
+
useVirtualScroll: this.useVirtualScroll,
|
|
275
|
+
rowHeight: this.rowHeight,
|
|
276
|
+
virtualBuffer: this.virtualBuffer,
|
|
277
|
+
vsStart: this.vsStart,
|
|
278
|
+
vsEnd: this.vsEnd,
|
|
279
|
+
rowCount: this.rowCount,
|
|
280
|
+
};
|
|
342
281
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
282
|
+
getConfigSync() {
|
|
283
|
+
return {
|
|
284
|
+
columns: this.columns,
|
|
285
|
+
selectable: this.selectable,
|
|
286
|
+
resizable: this.resizable,
|
|
287
|
+
stickyColumn: this.stickyColumn,
|
|
288
|
+
stickyHeader: this.stickyHeader,
|
|
289
|
+
scrolledLeft: this.scrolledLeft,
|
|
290
|
+
scrolledRight: this.scrolledRight,
|
|
291
|
+
columnWidths: this.columnWidths,
|
|
292
|
+
};
|
|
346
293
|
}
|
|
347
|
-
|
|
348
|
-
return this.
|
|
294
|
+
isRowSelectedSync(row) {
|
|
295
|
+
return Array.from(this.innerSelected).some(r => r[this.rowKey] === row[this.rowKey]);
|
|
349
296
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
return Array.from(this.innerSelected).some(r => this.getRowKeyValue(r) === this.getRowKeyValue(row));
|
|
297
|
+
async isRowSelected(row) {
|
|
298
|
+
return this.isRowSelectedSync(row);
|
|
353
299
|
}
|
|
354
|
-
|
|
300
|
+
updateRowSelectSync(row) {
|
|
355
301
|
const selectedArray = Array.from(this.innerSelected);
|
|
356
|
-
const exists = this.
|
|
302
|
+
const exists = this.isRowSelectedSync(row);
|
|
357
303
|
const newSelected = exists
|
|
358
|
-
? selectedArray.filter(r => this.
|
|
304
|
+
? selectedArray.filter(r => r[this.rowKey] !== row[this.rowKey])
|
|
359
305
|
: [...selectedArray, row];
|
|
360
|
-
// 동일 상태면 set하지 않음 → 불필요 렌더 방지
|
|
361
306
|
if (newSelected.length === selectedArray.length)
|
|
362
307
|
return;
|
|
363
|
-
this.innerSelected = new Set(
|
|
364
|
-
this.clearSelectionCache();
|
|
308
|
+
this.innerSelected = new Set(newSelected);
|
|
365
309
|
this.selected = Array.from(this.innerSelected);
|
|
366
310
|
this.sdSelectChange.emit(Array.from(this.innerSelected));
|
|
311
|
+
this.refreshChildrenSelection();
|
|
312
|
+
}
|
|
313
|
+
async updateRowSelect(row) {
|
|
314
|
+
this.updateRowSelectSync(row);
|
|
367
315
|
}
|
|
368
|
-
|
|
369
|
-
const selectedRows = Array.from(this.innerSelected);
|
|
316
|
+
toggleSelectAllSync(checked, rows) {
|
|
370
317
|
if (checked) {
|
|
371
|
-
|
|
318
|
+
const pageRows = new Set([...rows]);
|
|
319
|
+
this.innerSelected = new Set([...this.innerSelected, ...pageRows]);
|
|
372
320
|
}
|
|
373
321
|
else {
|
|
374
|
-
const currentPageKeys =
|
|
375
|
-
this.innerSelected = new Set(
|
|
322
|
+
const currentPageKeys = rows.map(r => r[this.rowKey]);
|
|
323
|
+
this.innerSelected = new Set([...this.innerSelected].filter(r => !currentPageKeys.includes(r[this.rowKey])));
|
|
376
324
|
}
|
|
377
|
-
this.clearSelectionCache();
|
|
378
325
|
this.selected = Array.from(this.innerSelected);
|
|
379
326
|
this.sdSelectChange.emit(Array.from(this.innerSelected));
|
|
327
|
+
this.refreshChildrenSelection();
|
|
380
328
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
const selectedKeys = Array.from(this.innerSelected)
|
|
384
|
-
.map(row => String(this.getRowKeyValue(row)))
|
|
385
|
-
.sort()
|
|
386
|
-
.join('|');
|
|
387
|
-
const selectionKey = `${paginatedKeys}::${selectedKeys}`;
|
|
388
|
-
if (this.cachedIsAllChecked !== undefined && this.lastSelectionKey === selectionKey) {
|
|
389
|
-
return this.cachedIsAllChecked;
|
|
390
|
-
}
|
|
391
|
-
const total = this.paginatedRows.length;
|
|
392
|
-
const selectedCount = this.paginatedRows.filter(row => Array.from(this.innerSelected).some(selectedRow => this.getRowKeyValue(selectedRow) === this.getRowKeyValue(row))).length;
|
|
393
|
-
let result;
|
|
394
|
-
if (selectedCount === 0) {
|
|
395
|
-
result = false; // 아무것도 안 선택됨
|
|
396
|
-
}
|
|
397
|
-
else if (selectedCount === total) {
|
|
398
|
-
result = true; // 전부 선택됨
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
result = null; // 일부만 선택됨
|
|
402
|
-
}
|
|
403
|
-
this.cachedIsAllChecked = result;
|
|
404
|
-
this.lastSelectionKey = selectionKey;
|
|
405
|
-
return result;
|
|
329
|
+
async toggleSelectAll(checked, rows) {
|
|
330
|
+
this.toggleSelectAllSync(checked, rows);
|
|
406
331
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
this.
|
|
410
|
-
if (
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
if (this.pendingUpdates.horizontal)
|
|
416
|
-
this.calculateVisibleColumnRange();
|
|
417
|
-
this.pendingUpdates = { vertical: false, horizontal: false };
|
|
418
|
-
this.rafScheduled = false;
|
|
419
|
-
this.scrollRequestAnimationFrame = null;
|
|
420
|
-
});
|
|
421
|
-
}
|
|
332
|
+
getIsAllCheckedSync(rows) {
|
|
333
|
+
const total = rows.length;
|
|
334
|
+
const selectedCount = rows.filter(row => Array.from(this.innerSelected).some(selectedRow => selectedRow[this.rowKey] === row[this.rowKey])).length;
|
|
335
|
+
if (selectedCount === 0)
|
|
336
|
+
return false;
|
|
337
|
+
if (selectedCount === total)
|
|
338
|
+
return true;
|
|
339
|
+
return null; // indeterminate
|
|
422
340
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
if (!this.useVirtualScroll.vertical) {
|
|
426
|
-
this.virtualStartIndex = 0;
|
|
427
|
-
this.virtualEndIndex = this.paginatedRows.length - 1;
|
|
428
|
-
return;
|
|
429
|
-
}
|
|
430
|
-
const scrollTop = this.scrollTopPosition;
|
|
431
|
-
let containerHeight = this.cachedContainerHeight;
|
|
432
|
-
if (containerHeight === 0 && this.scrollContainer) {
|
|
433
|
-
containerHeight = this.scrollContainer.clientHeight;
|
|
434
|
-
this.cachedContainerHeight = containerHeight;
|
|
435
|
-
}
|
|
436
|
-
const bufferSize = this.virtualBufferSize.vertical || 5;
|
|
437
|
-
const startIndex = Math.floor(scrollTop / this.virtualRowHeight);
|
|
438
|
-
const visibleCount = Math.ceil(containerHeight / this.virtualRowHeight);
|
|
439
|
-
const endIndex = startIndex + visibleCount - 1;
|
|
440
|
-
const newStartIndex = Math.max(0, startIndex - bufferSize);
|
|
441
|
-
const newEndIndex = Math.min(this.paginatedRows.length - 1, endIndex + bufferSize);
|
|
442
|
-
// 실제로 변경된 경우에만 상태 업데이트
|
|
443
|
-
if (this.virtualStartIndex !== newStartIndex || this.virtualEndIndex !== newEndIndex) {
|
|
444
|
-
this.virtualStartIndex = newStartIndex;
|
|
445
|
-
this.virtualEndIndex = newEndIndex;
|
|
446
|
-
}
|
|
341
|
+
async getIsAllChecked(rows) {
|
|
342
|
+
return this.getIsAllCheckedSync(rows);
|
|
447
343
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
this.virtualStartColIdx = 0;
|
|
452
|
-
this.virtualEndColIdx = this.tableColumns.length - 1;
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
const scrollLeft = this.scrollLeftPosition;
|
|
456
|
-
// 캐시된 값 사용, 없으면 측정 후 캐시
|
|
457
|
-
let containerWidth = this.cachedContainerWidth;
|
|
458
|
-
if (containerWidth === 0 && this.scrollContainer) {
|
|
459
|
-
containerWidth = this.scrollContainer.clientWidth;
|
|
460
|
-
this.cachedContainerWidth = containerWidth;
|
|
461
|
-
}
|
|
462
|
-
const { stickyLeftCount, stickyRightCount } = this.getNormalizedStickyCounts();
|
|
463
|
-
// 가상 스크롤 컬럼 - sticky column 제외
|
|
464
|
-
const virtualColumns = this.tableColumns.slice(stickyLeftCount, this.tableColumns.length - stickyRightCount);
|
|
465
|
-
if (virtualColumns.length === 0) {
|
|
466
|
-
this.virtualStartColIdx = 0;
|
|
467
|
-
this.virtualEndColIdx = 0;
|
|
344
|
+
changePage(page) {
|
|
345
|
+
if (!this.useInternalPagination) {
|
|
346
|
+
this.sdPageChange.emit(page);
|
|
468
347
|
return;
|
|
469
348
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
.slice(this.tableColumns.length - stickyRightCount)
|
|
474
|
-
.reduce((sum, width) => sum + width, 0);
|
|
475
|
-
// 가상 스크롤 영역의 너비 계산
|
|
476
|
-
const virtualScrollableWidth = containerWidth - stickyLeftWidth - stickyRightWidth;
|
|
477
|
-
const virtualColumnWidths = this.columnWidths.slice(stickyLeftCount, this.tableColumns.length - stickyRightCount);
|
|
478
|
-
const virtualScrollLeft = Math.max(0, scrollLeft - stickyLeftWidth);
|
|
479
|
-
const reducedVirtualWidth = virtualColumnWidths.reduce((acc, width, idx) => {
|
|
480
|
-
acc.push((acc[idx - 1] || 0) + width);
|
|
481
|
-
return acc;
|
|
482
|
-
}, []);
|
|
483
|
-
let startIdx = 0; // 가상 스크롤 시작 인덱스
|
|
484
|
-
let endIdx = virtualColumns.length - 1; // 가상 스크롤 종료 인덱스
|
|
485
|
-
// sticky left 영역 제외한 스크롤 위치
|
|
486
|
-
for (let i = 0; i < reducedVirtualWidth.length; i++) {
|
|
487
|
-
if (reducedVirtualWidth[i] > virtualScrollLeft) {
|
|
488
|
-
startIdx = Math.max(0, i);
|
|
489
|
-
break;
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
const scrollRight = virtualScrollLeft + virtualScrollableWidth;
|
|
493
|
-
for (let i = startIdx; i < reducedVirtualWidth.length; i++) {
|
|
494
|
-
if (reducedVirtualWidth[i] >= scrollRight) {
|
|
495
|
-
endIdx = Math.min(virtualColumns.length - 1, i);
|
|
496
|
-
break;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
const bufferSize = this.virtualBufferSize.horizontal || 5;
|
|
500
|
-
const newStartColIdx = Math.max(0, startIdx - bufferSize);
|
|
501
|
-
const newEndColIdx = Math.min(virtualColumns.length - 1, endIdx + bufferSize);
|
|
502
|
-
// 실제로 변경된 경우에만 상태 업데이트
|
|
503
|
-
if (this.virtualStartColIdx !== newStartColIdx || this.virtualEndColIdx !== newEndColIdx) {
|
|
504
|
-
this.virtualStartColIdx = newStartColIdx;
|
|
505
|
-
this.virtualEndColIdx = newEndColIdx;
|
|
506
|
-
}
|
|
349
|
+
this.currentPage = page;
|
|
350
|
+
this.sdPageChange.emit(this.currentPage);
|
|
351
|
+
this.updateRowsVisibility();
|
|
507
352
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
if (this.stickyStyleCache.has(colIdx)) {
|
|
512
|
-
return this.stickyStyleCache.get(colIdx);
|
|
513
|
-
}
|
|
514
|
-
const leftOffset = this.columnWidths.slice(0, colIdx).reduce((a, b) => a + b, 0) + (this.selectable ? 52 : 0);
|
|
515
|
-
const { stickyRightCount } = this.getNormalizedStickyCounts();
|
|
516
|
-
const rightOffset = this.columnWidths
|
|
517
|
-
.filter((_, i) => i >= this.tableColumns.length - stickyRightCount && i > colIdx)
|
|
518
|
-
.reduce((a, b) => a + b, 0);
|
|
519
|
-
const style = {
|
|
520
|
-
'--sticky-left-offset': `${leftOffset}px`,
|
|
521
|
-
'--sticky-right-offset': `${rightOffset}px`,
|
|
522
|
-
'width': `${this.columnWidths[colIdx]}px`,
|
|
523
|
-
'minWidth': `${this.columnWidths[colIdx]}px`,
|
|
524
|
-
'maxWidth': `${this.columnWidths[colIdx]}px`,
|
|
525
|
-
};
|
|
526
|
-
// 스타일 캐시에 저장
|
|
527
|
-
this.stickyStyleCache.set(colIdx, style);
|
|
528
|
-
return style;
|
|
353
|
+
updateRowsVisibility() {
|
|
354
|
+
const rows = this.el.querySelectorAll('sd-tr');
|
|
355
|
+
rows.forEach(tr => tr?.updateVisibility?.());
|
|
529
356
|
}
|
|
530
|
-
|
|
531
|
-
|
|
357
|
+
changeRowsPerPage(perPage) {
|
|
358
|
+
const changedRowsPerPage = perPage ? Number(perPage) : 0;
|
|
359
|
+
if (!this.useInternalPagination) {
|
|
360
|
+
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
532
361
|
return;
|
|
533
|
-
this.resizeObserver?.disconnect();
|
|
534
|
-
this.resizeObserver = new ResizeObserver(() => {
|
|
535
|
-
if (!this.scrollContainer)
|
|
536
|
-
return;
|
|
537
|
-
const nextHeight = this.scrollContainer.clientHeight;
|
|
538
|
-
const nextWidth = this.scrollContainer.clientWidth;
|
|
539
|
-
const heightChanged = this.cachedContainerHeight !== nextHeight;
|
|
540
|
-
const widthChanged = this.cachedContainerWidth !== nextWidth;
|
|
541
|
-
if (!heightChanged && !widthChanged)
|
|
542
|
-
return;
|
|
543
|
-
this.cachedContainerHeight = nextHeight;
|
|
544
|
-
this.cachedContainerWidth = nextWidth;
|
|
545
|
-
if (heightChanged && this.useVirtualScroll.vertical) {
|
|
546
|
-
this.scheduleUpdate('vertical');
|
|
547
|
-
}
|
|
548
|
-
if (widthChanged && this.useVirtualScroll.horizontal) {
|
|
549
|
-
this.scheduleUpdate('horizontal');
|
|
550
|
-
}
|
|
551
|
-
});
|
|
552
|
-
this.resizeObserver.observe(this.scrollContainer);
|
|
553
|
-
}
|
|
554
|
-
parseColumnWidth(width, fallbackWidth) {
|
|
555
|
-
if (typeof width === 'number') {
|
|
556
|
-
return Number.isFinite(width) ? width : fallbackWidth;
|
|
557
362
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
return fallbackWidth;
|
|
563
|
-
if (/^\d+(\.\d+)?px$/.test(normalized)) {
|
|
564
|
-
return Number.parseFloat(normalized);
|
|
363
|
+
this.innerRowsPerPage = changedRowsPerPage;
|
|
364
|
+
const newLastPage = Math.max(1, Math.ceil(this.rowCount / changedRowsPerPage));
|
|
365
|
+
if (this.currentPage > newLastPage) {
|
|
366
|
+
this.currentPage = newLastPage;
|
|
565
367
|
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}
|
|
569
|
-
return fallbackWidth;
|
|
570
|
-
}
|
|
571
|
-
getColumnWidths(columns = []) {
|
|
572
|
-
const fallbackWidth = this.useVirtualScroll.horizontal ? this.virtualColumnWidth : 120;
|
|
573
|
-
return columns.map(c => this.parseColumnWidth(c.width, fallbackWidth));
|
|
574
|
-
}
|
|
575
|
-
getNormalizedStickyCounts() {
|
|
576
|
-
const totalColumnCount = this.tableColumns.length;
|
|
577
|
-
const requestedLeft = Number(this.stickyColumn?.left ?? 0) || 0;
|
|
578
|
-
const requestedRight = Number(this.stickyColumn?.right ?? 0) || 0;
|
|
579
|
-
const stickyLeftCount = Math.min(totalColumnCount, Math.max(0, requestedLeft));
|
|
580
|
-
const stickyRightCount = Math.min(Math.max(0, totalColumnCount - stickyLeftCount), Math.max(0, requestedRight));
|
|
581
|
-
return {
|
|
582
|
-
stickyLeftCount,
|
|
583
|
-
stickyRightCount,
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
getRowKeyValue(row) {
|
|
587
|
-
return row?.[this.rowKey];
|
|
368
|
+
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
369
|
+
this.updateRowsVisibility();
|
|
588
370
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
}
|
|
594
|
-
return
|
|
371
|
+
get lastPageNumber() {
|
|
372
|
+
if (this.useInternalPagination) {
|
|
373
|
+
return Math.max(1, Math.ceil(this.rowCount / this.innerRowsPerPage));
|
|
374
|
+
}
|
|
375
|
+
const { lastPage, rowsPerPage = 10 } = this.pagination || {};
|
|
376
|
+
return lastPage ?? Math.max(1, Math.ceil(this.rowCount / rowsPerPage));
|
|
595
377
|
}
|
|
596
|
-
handleResize(index, event) {
|
|
597
|
-
// SSR 환경 체크
|
|
378
|
+
handleResize(index, event, reversed = false) {
|
|
598
379
|
if (typeof document === 'undefined')
|
|
599
380
|
return;
|
|
600
381
|
const startX = event.clientX;
|
|
601
382
|
const startWidth = this.columnWidths[index];
|
|
602
383
|
const handleMouseMove = (moveEvent) => {
|
|
603
|
-
const
|
|
604
|
-
if (!
|
|
384
|
+
const col = this.columns[index];
|
|
385
|
+
if (!col)
|
|
605
386
|
return;
|
|
606
|
-
const
|
|
607
|
-
const
|
|
608
|
-
const
|
|
609
|
-
const newWidth = Math.min(Math.max(startWidth +
|
|
387
|
+
const minWidth = col.minWidth || 50;
|
|
388
|
+
const maxWidth = col.maxWidth || 9999;
|
|
389
|
+
const delta = moveEvent.clientX - startX;
|
|
390
|
+
const newWidth = Math.min(Math.max(startWidth + (reversed ? -delta : delta), minWidth), maxWidth);
|
|
610
391
|
this.columnWidths = this.columnWidths.map((width, idx) => (idx === index ? newWidth : width));
|
|
392
|
+
const thead = this.el.querySelector('sd-thead');
|
|
393
|
+
const rows = this.el.querySelectorAll('sd-tr');
|
|
394
|
+
thead?.setColumnWidths?.(this.columnWidths);
|
|
395
|
+
rows.forEach(tr => tr?.setColumnWidths?.(this.columnWidths));
|
|
396
|
+
const stickyRightCount = this.stickyColumn?.right || 0;
|
|
397
|
+
const visibleColCount = this.columns.filter(c => c.visible !== false).length;
|
|
398
|
+
const isRightStickyEdgeResizer = stickyRightCount > 0 && index === visibleColCount - stickyRightCount;
|
|
399
|
+
if (isRightStickyEdgeResizer) {
|
|
400
|
+
requestAnimationFrame(() => {
|
|
401
|
+
this.onScroll?.();
|
|
402
|
+
});
|
|
403
|
+
}
|
|
611
404
|
};
|
|
612
405
|
const handleMouseUp = () => {
|
|
613
406
|
document.removeEventListener('mousemove', handleMouseMove);
|
|
@@ -616,161 +409,119 @@ export class SdTable {
|
|
|
616
409
|
document.addEventListener('mousemove', handleMouseMove);
|
|
617
410
|
document.addEventListener('mouseup', handleMouseUp);
|
|
618
411
|
}
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
? this.tableColumns
|
|
635
|
-
.slice(stickyLeftCount, this.tableColumns.length - stickyRightCount)
|
|
636
|
-
.slice(this.virtualStartColIdx, this.virtualEndColIdx + 1)
|
|
637
|
-
: this.tableColumns.slice(stickyLeftCount, this.tableColumns.length - stickyRightCount);
|
|
638
|
-
this.cachedColumnOrder = {
|
|
639
|
-
stickyLeftCount,
|
|
640
|
-
stickyRightCount,
|
|
641
|
-
stickyLeftCols,
|
|
642
|
-
middleCols,
|
|
643
|
-
stickyRightCols,
|
|
412
|
+
getStickyStyleSync(colIdx) {
|
|
413
|
+
const leftOffset = this.columnWidths
|
|
414
|
+
.slice(0, colIdx)
|
|
415
|
+
.reduce((a, b) => a + b, this.selectable ? 52 : 0);
|
|
416
|
+
const rightOffset = this.columnWidths
|
|
417
|
+
.filter((_, i) => i >=
|
|
418
|
+
this.columns.filter(c => c.visible !== false).length -
|
|
419
|
+
(this.stickyColumn?.right || 0) && i > colIdx)
|
|
420
|
+
.reduce((a, b) => a + b, 0);
|
|
421
|
+
return {
|
|
422
|
+
'--sticky-left-offset': `${leftOffset}px`,
|
|
423
|
+
'--sticky-right-offset': `${rightOffset}px`,
|
|
424
|
+
'width': `${this.columnWidths[colIdx]}px`,
|
|
425
|
+
'minWidth': `${this.columnWidths[colIdx]}px`,
|
|
426
|
+
'maxWidth': `${this.columnWidths[colIdx]}px`,
|
|
644
427
|
};
|
|
645
|
-
this.lastColumnOrderKey = orderKey;
|
|
646
|
-
return this.cachedColumnOrder;
|
|
647
428
|
}
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
const { stickyLeftCount, stickyRightCount, stickyLeftCols, middleCols, stickyRightCols } = this.getColumnRenderedInOrder();
|
|
651
|
-
return (h("thead", null, h("tr", null, this.selectable && (h("th", { class: {
|
|
652
|
-
'sd-th': true,
|
|
653
|
-
'sd-th--selected': true,
|
|
654
|
-
'sticky-left': true,
|
|
655
|
-
'sticky-left-edge': !this.hasStickyLeftDataColumn,
|
|
656
|
-
}, style: {
|
|
657
|
-
'--sticky-left-offset': '0px',
|
|
658
|
-
} }, h("sd-checkbox", { value: this.isAllChecked, disabled: !this.paginatedRows.length, onSdUpdate: (e) => this.toggleSelectAll(e.detail) }))), stickyLeftCols.map((col, idx) => {
|
|
659
|
-
return (h("th", { key: col.name, class: {
|
|
660
|
-
'sd-th': true,
|
|
661
|
-
[`${col.thClass}`]: Boolean(col.thClass),
|
|
662
|
-
'sticky-left': true,
|
|
663
|
-
'sticky-left-edge': idx === stickyLeftCount - 1,
|
|
664
|
-
}, style: { ...col.thStyle, ...this.getStickyStyle(idx) } }, h("div", { class: `sd-th__content sd-th__content--${col.align || 'left'}` }, h("slot", { name: `header-cell-${col.name}` }, h("div", { class: "sd-th__content--label" }, col.label)), col.usePageMoveIcon && h("sd-icon", { name: "pageMove", size: "12", color: "#006AC1" }), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this.resizable && typeof window !== 'undefined' && (h("div", { class: "sd-th__resizer", onMouseDown: (evt) => this.handleResize(idx, evt) }))));
|
|
665
|
-
}), this.renderSpacerTh('left'), middleCols.map((col, relativeIdx) => {
|
|
666
|
-
const actualColIdx = stickyLeftCount + this.virtualStartColIdx + relativeIdx;
|
|
667
|
-
return (h("th", { key: col.name, class: {
|
|
668
|
-
'sd-th': true,
|
|
669
|
-
[`${col.thClass}`]: Boolean(col.thClass),
|
|
670
|
-
}, style: { ...col.thStyle, ...this.getStickyStyle(actualColIdx) } }, h("div", { class: `sd-th__content sd-th__content--${col.align || 'left'}` }, h("slot", { name: `header-cell-${col.name}` }, h("div", { class: "sd-th__content--label" }, col.label)), col.usePageMoveIcon && h("sd-icon", { name: "pageMove", size: "12", color: "#006AC1" }), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this.resizable && typeof window !== 'undefined' && (h("div", { class: "sd-th__resizer", onMouseDown: (evt) => this.handleResize(actualColIdx, evt) }))));
|
|
671
|
-
}), this.renderSpacerTh('right'), stickyRightCols.map((col, relativeIdx) => {
|
|
672
|
-
const actualColIdx = this.tableColumns.length - stickyRightCount + relativeIdx;
|
|
673
|
-
return (h("th", { key: col.name, class: {
|
|
674
|
-
'sd-th': true,
|
|
675
|
-
[`${col.thClass}`]: Boolean(col.thClass),
|
|
676
|
-
'sticky-right': true,
|
|
677
|
-
'sticky-right-edge': relativeIdx === 0,
|
|
678
|
-
}, style: { ...col.thStyle, ...this.getStickyStyle(actualColIdx) } }, h("div", { class: `sd-th__content sd-th__content--${col.align || 'left'}` }, h("slot", { name: `header-cell-${col.name}` }, h("div", { class: "sd-th__content--label" }, col.label)), col.usePageMoveIcon && h("sd-icon", { name: "pageMove", size: "12", color: "#006AC1" }), col.tooltip && (h("sd-tooltip", { ...col.tooltipOptions }, h("div", { slot: "content" }, col.tooltip.map(text => (h("p", null, text))))))), this.resizable && typeof window !== 'undefined' && (h("div", { class: "sd-th__resizer", onMouseDown: (evt) => this.handleResize(actualColIdx, evt) }))));
|
|
679
|
-
}))));
|
|
429
|
+
async getStickyStyle(colIdx) {
|
|
430
|
+
return this.getStickyStyleSync(colIdx);
|
|
680
431
|
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
this.
|
|
685
|
-
|
|
432
|
+
setRowCountSync(count) {
|
|
433
|
+
const safeCount = Math.max(0, Math.floor(this.toFiniteNumber(count, 0)));
|
|
434
|
+
if (safeCount !== this.rowCount) {
|
|
435
|
+
this.lastReachEndNotifiedRowCount = -1;
|
|
436
|
+
}
|
|
437
|
+
this.rowCount = safeCount;
|
|
438
|
+
if (this.useVirtualScroll) {
|
|
439
|
+
this.propagateVirtualUpdate(true);
|
|
440
|
+
}
|
|
686
441
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
return (h("tr", { key: row[this.rowKey], class: "hover:bg-Grey_Lighten-6", style: this.useVirtualScroll.vertical
|
|
690
|
-
? {
|
|
691
|
-
height: `${this.virtualRowHeight}px`,
|
|
692
|
-
}
|
|
693
|
-
: {} }, this.selectable && (h("td", { class: {
|
|
694
|
-
'sd-td': true,
|
|
695
|
-
'sd-td--selected': true,
|
|
696
|
-
'sticky-left': true,
|
|
697
|
-
'sticky-left-edge': !this.hasStickyLeftDataColumn,
|
|
698
|
-
}, style: {
|
|
699
|
-
'--sticky-left-offset': '0px',
|
|
700
|
-
} }, h("sd-checkbox", { value: this.isRowSelected(row), disabled: !this.paginatedRows.length, onSdUpdate: () => this.updateRowSelect(row) }))), stickyLeftCols.map((column, idx) => {
|
|
701
|
-
return (h("td", { key: column.name, part: `td-${column.name}`, class: {
|
|
702
|
-
'sd-td': true,
|
|
703
|
-
[`sd-td--${column.align || 'left'}`]: true,
|
|
704
|
-
'sticky-left': true,
|
|
705
|
-
'sticky-left-edge': idx === stickyLeftCount - 1,
|
|
706
|
-
[`${column.tdClass}`]: Boolean(column.tdClass),
|
|
707
|
-
}, style: this.getStickyStyle(idx) }, h("slot", { name: `body-cell-${column.name}-${rowIdx}` }, this.getCellValue(column, row))));
|
|
708
|
-
}), this.renderSpacerTd('left', rowIdx), middleCols.map((column, relativeIdx) => {
|
|
709
|
-
const actualColIdx = stickyLeftCount + this.virtualStartColIdx + relativeIdx;
|
|
710
|
-
return (h("td", { key: column.name, part: `td-${column.name}`, class: {
|
|
711
|
-
'sd-td': true,
|
|
712
|
-
[`sd-td--${column.align || 'left'}`]: true,
|
|
713
|
-
[`${column.tdClass}`]: Boolean(column.tdClass),
|
|
714
|
-
}, style: this.getStickyStyle(actualColIdx) }, h("slot", { name: `body-cell-${column.name}-${rowIdx}` }, this.getCellValue(column, row))));
|
|
715
|
-
}), this.renderSpacerTd('right', rowIdx), stickyRightCols.map((column, relativeIdx) => {
|
|
716
|
-
const actualColIdx = this.tableColumns.length - stickyRightCount + relativeIdx;
|
|
717
|
-
return (h("td", { key: column.name, part: `td-${column.name}`, class: {
|
|
718
|
-
'sd-td': true,
|
|
719
|
-
[`sd-td--${column.align || 'left'}`]: true,
|
|
720
|
-
'sticky-right': true,
|
|
721
|
-
'sticky-right-edge': relativeIdx === 0,
|
|
722
|
-
[`${column.tdClass}`]: Boolean(column.tdClass),
|
|
723
|
-
}, style: this.getStickyStyle(actualColIdx) }, h("slot", { name: `body-cell-${column.name}-${rowIdx}` }, this.getCellValue(column, row))));
|
|
724
|
-
})));
|
|
442
|
+
async setRowCount(count) {
|
|
443
|
+
this.setRowCountSync(count);
|
|
725
444
|
}
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
445
|
+
calculateVisibleRange(scrollTop, containerHeight) {
|
|
446
|
+
const safeRowHeight = Math.max(1, this.toFiniteNumber(this.rowHeight, 40));
|
|
447
|
+
const safeBuffer = Math.max(0, Math.floor(this.toFiniteNumber(this.virtualBuffer, 5)));
|
|
448
|
+
const safeScrollTop = Math.max(0, this.toFiniteNumber(scrollTop, 0));
|
|
449
|
+
const safeContainerHeight = Math.max(0, this.toFiniteNumber(containerHeight, 0));
|
|
450
|
+
const safeRowCount = Math.max(0, Math.floor(this.toFiniteNumber(this.rowCount, 0)));
|
|
451
|
+
const firstVisible = Math.floor(safeScrollTop / safeRowHeight);
|
|
452
|
+
const visibleCount = Math.ceil(safeContainerHeight / safeRowHeight);
|
|
453
|
+
const start = Math.max(0, firstVisible - safeBuffer);
|
|
454
|
+
const end = Math.min(safeRowCount, firstVisible + visibleCount + safeBuffer);
|
|
455
|
+
return { start, end };
|
|
733
456
|
}
|
|
734
|
-
|
|
457
|
+
getPaginationInfoSync() {
|
|
458
|
+
if (!this.useInternalPagination || !this.pagination)
|
|
459
|
+
return null;
|
|
460
|
+
const startIndex = (this.currentPage - 1) * this.innerRowsPerPage;
|
|
461
|
+
const endIndex = startIndex + this.innerRowsPerPage;
|
|
735
462
|
return {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
border: 'none',
|
|
463
|
+
startIndex,
|
|
464
|
+
endIndex,
|
|
465
|
+
currentPage: this.currentPage,
|
|
466
|
+
rowsPerPage: this.innerRowsPerPage,
|
|
741
467
|
};
|
|
742
468
|
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
const showSpacer = position === 'left'
|
|
746
|
-
? this.useVirtualScroll.horizontal && this.leftSpacerWidth > 0
|
|
747
|
-
: this.useVirtualScroll.horizontal && this.rightSpacerWidth > 0;
|
|
748
|
-
if (!showSpacer)
|
|
749
|
-
return null;
|
|
750
|
-
return (h("th", { key: `virtual-${position}-spacer-header`, class: "sd-table__virtual-spacer", style: this.getSpacerCellStyle(spacerWidth), "aria-hidden": "true" }, h("div", { class: "sd-table__skeleton-cell" })));
|
|
469
|
+
async getPaginationInfo() {
|
|
470
|
+
return this.getPaginationInfoSync();
|
|
751
471
|
}
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
const showSpacer = position === 'left'
|
|
755
|
-
? this.useVirtualScroll.horizontal && this.leftSpacerWidth > 0
|
|
756
|
-
: this.useVirtualScroll.horizontal && this.rightSpacerWidth > 0;
|
|
757
|
-
if (!showSpacer)
|
|
472
|
+
getVirtualScrollRangeSync() {
|
|
473
|
+
if (!this.useVirtualScroll)
|
|
758
474
|
return null;
|
|
759
|
-
|
|
475
|
+
if (!(this.vsEnd > 0))
|
|
476
|
+
return null;
|
|
477
|
+
return { from: this.vsStart, to: this.vsEnd };
|
|
478
|
+
}
|
|
479
|
+
get tableClasses() {
|
|
480
|
+
return [
|
|
481
|
+
'sd-table',
|
|
482
|
+
this.stickyHeader && 'sd-table--sticky-header',
|
|
483
|
+
this.selectable && 'sd-table--selectable',
|
|
484
|
+
this.resizable && 'sd-table--resizable',
|
|
485
|
+
(this.selectable ||
|
|
486
|
+
(this.stickyColumn?.left ?? 0) > 0 ||
|
|
487
|
+
(this.stickyColumn?.right ?? 0) > 0) &&
|
|
488
|
+
'sd-table--sticky-column',
|
|
489
|
+
this.scrolledLeft && 'sd-table--scrolled-left',
|
|
490
|
+
this.scrolledRight && 'sd-table--scrolled-right',
|
|
491
|
+
this.rowCount === 0 && !this.isLoading && 'sd-table--no-data',
|
|
492
|
+
]
|
|
493
|
+
.filter(Boolean)
|
|
494
|
+
.join(' ');
|
|
760
495
|
}
|
|
761
496
|
render() {
|
|
762
|
-
|
|
497
|
+
const resolvedTableId = this.getResolvedTableId();
|
|
498
|
+
return (h(Host, { key: 'dd25a84ce29a197a7e853d1812ce0f0fbdf043bd' }, h("div", { key: '8b256e995d55c36ff9622148054911fcbe8aa89b', class: "sd-table__container", style: {
|
|
763
499
|
'--table-width': this.width,
|
|
764
500
|
'--table-height': this.height,
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
'sd-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
501
|
+
'--table-container-height': `calc(${this.height || '100%'} - ${this.pagination && this.rowCount > 0 && !this.useVirtualScroll ? 48 : 0}px)`,
|
|
502
|
+
} }, h("div", { key: 'b4949fed8c50b93bcddace22978aff358ea7c210', class: {
|
|
503
|
+
'sd-table__clip': true,
|
|
504
|
+
'sd-table__clip--has-pagination': !!(this.pagination &&
|
|
505
|
+
this.pagination.rowsPerPage > 0 &&
|
|
506
|
+
this.rowCount > 0 &&
|
|
507
|
+
!this.useVirtualScroll),
|
|
508
|
+
} }, h("div", { key: '5fcceeb27568afdd367e7dbf2886fcbd107089c5', class: {
|
|
509
|
+
'sd-table__wrapper': true,
|
|
510
|
+
'sd-table__wrapper--loading': this.isLoading,
|
|
511
|
+
'sd-table__wrapper--no-data': this.rowCount === 0 && !this.isLoading,
|
|
512
|
+
} }, this.isLoading && (h("div", { key: 'edabfb6b601cfad985e3b8614d603f2df1da8f98', class: "sd-table__loading", style: { top: `${this.loadingScrollTop}px` } }, h("sd-circle-progress", { key: '40de9b2b97407523d1b02b97f208682e4946be66', indeterminate: true }))), this.rowCount === 0 && !this.isLoading && (h("div", { key: 'fe0d54f45a2a0a8ca1cc6552a42c7725ecd84c99', class: "sd-table__no-data" }, h("slot", { key: 'f64d232d1b3bd69d7c43a5170d06e73cbc586226', name: "no-data" }, h("span", { key: '71f5dcf2e5af2403032bdefd19a3cc4793a823e9' }, this.resolvedNoDataLabel)))), h("table", { key: 'e32c9f96523db174a57efffa584237836a67214a', class: this.tableClasses }, h("slot", { key: 'ce5e49454ac9044d6b3fcf3ac51809bb1e5465f8', name: `${resolvedTableId}-head`, onSlotchange: this.handleStructureSlotChange }), h("slot", { key: '800b45ddc05aac02cf8827b31beca5d0f363b55f', name: `${resolvedTableId}-body`, onSlotchange: this.handleStructureSlotChange })))), this.pagination &&
|
|
513
|
+
this.pagination.rowsPerPage > 0 &&
|
|
514
|
+
this.rowCount > 0 &&
|
|
515
|
+
!this.useVirtualScroll && (h("div", { key: 'ea2afbe59f7b249d3f4e9d9763ab402438e47008', class: "sd-table__pagination" }, h("sd-pagination", { key: 'a64223b9d2374142cbf12ec582e580f1b9f8f8dc', currentPage: !this.useInternalPagination ? this.pagination.page : this.currentPage, lastPage: !this.useInternalPagination ? this.pagination.lastPage : this.lastPageNumber, onSdPageChange: (e) => this.changePage(e.detail) }), this.useRowsPerPageSelect && (h("sd-select-v2", { key: '597cd596ac0ce2752ab6fc792887ce447c863eb8', value: this.useInternalPagination
|
|
516
|
+
? this.innerRowsPerPage
|
|
517
|
+
: this.pagination.rowsPerPage, options: this.rowsPerPageOption, width: "128px", emitValue: true, onSdUpdate: e => {
|
|
518
|
+
if (!this.isRowsPerPageValue(e.detail))
|
|
519
|
+
return;
|
|
520
|
+
this.changeRowsPerPage(e.detail);
|
|
521
|
+
} })))))));
|
|
772
522
|
}
|
|
773
523
|
static get is() { return "sd-table"; }
|
|
524
|
+
static get encapsulation() { return "shadow"; }
|
|
774
525
|
static get originalStyleUrls() {
|
|
775
526
|
return {
|
|
776
527
|
"$": ["sd-table.scss"]
|
|
@@ -783,6 +534,26 @@ export class SdTable {
|
|
|
783
534
|
}
|
|
784
535
|
static get properties() {
|
|
785
536
|
return {
|
|
537
|
+
"tableId": {
|
|
538
|
+
"type": "string",
|
|
539
|
+
"mutable": false,
|
|
540
|
+
"complexType": {
|
|
541
|
+
"original": "string",
|
|
542
|
+
"resolved": "string",
|
|
543
|
+
"references": {}
|
|
544
|
+
},
|
|
545
|
+
"required": false,
|
|
546
|
+
"optional": false,
|
|
547
|
+
"docs": {
|
|
548
|
+
"tags": [],
|
|
549
|
+
"text": ""
|
|
550
|
+
},
|
|
551
|
+
"getter": false,
|
|
552
|
+
"setter": false,
|
|
553
|
+
"reflect": true,
|
|
554
|
+
"attribute": "table-id",
|
|
555
|
+
"defaultValue": "nanoid(8)"
|
|
556
|
+
},
|
|
786
557
|
"columns": {
|
|
787
558
|
"type": "unknown",
|
|
788
559
|
"mutable": false,
|
|
@@ -791,37 +562,40 @@ export class SdTable {
|
|
|
791
562
|
"resolved": "SdTableColumn[]",
|
|
792
563
|
"references": {
|
|
793
564
|
"SdTableColumn": {
|
|
794
|
-
"location": "
|
|
795
|
-
"path": "
|
|
796
|
-
"id": "src/components/sd-table/
|
|
565
|
+
"location": "import",
|
|
566
|
+
"path": "./constants",
|
|
567
|
+
"id": "src/components/sd-table/constants.ts::SdTableColumn",
|
|
568
|
+
"referenceLocation": "SdTableColumn"
|
|
797
569
|
}
|
|
798
570
|
}
|
|
799
571
|
},
|
|
800
|
-
"required":
|
|
572
|
+
"required": false,
|
|
801
573
|
"optional": false,
|
|
802
574
|
"docs": {
|
|
803
575
|
"tags": [],
|
|
804
576
|
"text": ""
|
|
805
577
|
},
|
|
806
578
|
"getter": false,
|
|
807
|
-
"setter": false
|
|
579
|
+
"setter": false,
|
|
580
|
+
"defaultValue": "[]"
|
|
808
581
|
},
|
|
809
582
|
"rows": {
|
|
810
583
|
"type": "unknown",
|
|
811
|
-
"mutable":
|
|
584
|
+
"mutable": false,
|
|
812
585
|
"complexType": {
|
|
813
586
|
"original": "Row[]",
|
|
814
|
-
"resolved": "Row[]",
|
|
587
|
+
"resolved": "Row[] | undefined",
|
|
815
588
|
"references": {
|
|
816
589
|
"Row": {
|
|
817
|
-
"location": "
|
|
818
|
-
"path": "
|
|
819
|
-
"id": "src/components/sd-table/
|
|
590
|
+
"location": "import",
|
|
591
|
+
"path": "./constants",
|
|
592
|
+
"id": "src/components/sd-table/constants.ts::Row",
|
|
593
|
+
"referenceLocation": "Row"
|
|
820
594
|
}
|
|
821
595
|
}
|
|
822
596
|
},
|
|
823
|
-
"required":
|
|
824
|
-
"optional":
|
|
597
|
+
"required": false,
|
|
598
|
+
"optional": true,
|
|
825
599
|
"docs": {
|
|
826
600
|
"tags": [],
|
|
827
601
|
"text": ""
|
|
@@ -837,9 +611,10 @@ export class SdTable {
|
|
|
837
611
|
"resolved": "Row[]",
|
|
838
612
|
"references": {
|
|
839
613
|
"Row": {
|
|
840
|
-
"location": "
|
|
841
|
-
"path": "
|
|
842
|
-
"id": "src/components/sd-table/
|
|
614
|
+
"location": "import",
|
|
615
|
+
"path": "./constants",
|
|
616
|
+
"id": "src/components/sd-table/constants.ts::Row",
|
|
617
|
+
"referenceLocation": "Row"
|
|
843
618
|
}
|
|
844
619
|
}
|
|
845
620
|
},
|
|
@@ -975,9 +750,16 @@ export class SdTable {
|
|
|
975
750
|
"type": "unknown",
|
|
976
751
|
"mutable": false,
|
|
977
752
|
"complexType": {
|
|
978
|
-
"original": "
|
|
979
|
-
"resolved": "
|
|
980
|
-
"references": {
|
|
753
|
+
"original": "SdTableStickyColumn",
|
|
754
|
+
"resolved": "SdTableStickyColumn",
|
|
755
|
+
"references": {
|
|
756
|
+
"SdTableStickyColumn": {
|
|
757
|
+
"location": "import",
|
|
758
|
+
"path": "./constants",
|
|
759
|
+
"id": "src/components/sd-table/constants.ts::SdTableStickyColumn",
|
|
760
|
+
"referenceLocation": "SdTableStickyColumn"
|
|
761
|
+
}
|
|
762
|
+
}
|
|
981
763
|
},
|
|
982
764
|
"required": false,
|
|
983
765
|
"optional": false,
|
|
@@ -1007,7 +789,7 @@ export class SdTable {
|
|
|
1007
789
|
"setter": false,
|
|
1008
790
|
"reflect": false,
|
|
1009
791
|
"attribute": "no-data-label",
|
|
1010
|
-
"defaultValue": "
|
|
792
|
+
"defaultValue": "SdTable.DEFAULT_NO_DATA_LABEL"
|
|
1011
793
|
},
|
|
1012
794
|
"isLoading": {
|
|
1013
795
|
"type": "boolean",
|
|
@@ -1033,9 +815,16 @@ export class SdTable {
|
|
|
1033
815
|
"type": "unknown",
|
|
1034
816
|
"mutable": false,
|
|
1035
817
|
"complexType": {
|
|
1036
|
-
"original": "
|
|
1037
|
-
"resolved": "
|
|
1038
|
-
"references": {
|
|
818
|
+
"original": "SdTablePagination",
|
|
819
|
+
"resolved": "SdTablePagination | undefined",
|
|
820
|
+
"references": {
|
|
821
|
+
"SdTablePagination": {
|
|
822
|
+
"location": "import",
|
|
823
|
+
"path": "./constants",
|
|
824
|
+
"id": "src/components/sd-table/constants.ts::SdTablePagination",
|
|
825
|
+
"referenceLocation": "SdTablePagination"
|
|
826
|
+
}
|
|
827
|
+
}
|
|
1039
828
|
},
|
|
1040
829
|
"required": false,
|
|
1041
830
|
"optional": true,
|
|
@@ -1086,20 +875,13 @@ export class SdTable {
|
|
|
1086
875
|
"attribute": "use-rows-per-page-select",
|
|
1087
876
|
"defaultValue": "false"
|
|
1088
877
|
},
|
|
1089
|
-
"
|
|
1090
|
-
"type": "
|
|
878
|
+
"useVirtualScroll": {
|
|
879
|
+
"type": "boolean",
|
|
1091
880
|
"mutable": false,
|
|
1092
881
|
"complexType": {
|
|
1093
|
-
"original": "
|
|
1094
|
-
"resolved": "
|
|
1095
|
-
"references": {
|
|
1096
|
-
"SelectOption": {
|
|
1097
|
-
"location": "import",
|
|
1098
|
-
"path": "../sd-select/sd-select",
|
|
1099
|
-
"id": "src/components/sd-select/sd-select.tsx::SelectOption",
|
|
1100
|
-
"referenceLocation": "SelectOption"
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
882
|
+
"original": "boolean",
|
|
883
|
+
"resolved": "boolean",
|
|
884
|
+
"references": {}
|
|
1103
885
|
},
|
|
1104
886
|
"required": false,
|
|
1105
887
|
"optional": false,
|
|
@@ -1109,14 +891,16 @@ export class SdTable {
|
|
|
1109
891
|
},
|
|
1110
892
|
"getter": false,
|
|
1111
893
|
"setter": false,
|
|
1112
|
-
"
|
|
894
|
+
"reflect": false,
|
|
895
|
+
"attribute": "use-virtual-scroll",
|
|
896
|
+
"defaultValue": "false"
|
|
1113
897
|
},
|
|
1114
|
-
"
|
|
1115
|
-
"type": "
|
|
898
|
+
"rowHeight": {
|
|
899
|
+
"type": "number",
|
|
1116
900
|
"mutable": false,
|
|
1117
901
|
"complexType": {
|
|
1118
|
-
"original": "
|
|
1119
|
-
"resolved": "
|
|
902
|
+
"original": "number",
|
|
903
|
+
"resolved": "number",
|
|
1120
904
|
"references": {}
|
|
1121
905
|
},
|
|
1122
906
|
"required": false,
|
|
@@ -1127,9 +911,11 @@ export class SdTable {
|
|
|
1127
911
|
},
|
|
1128
912
|
"getter": false,
|
|
1129
913
|
"setter": false,
|
|
1130
|
-
"
|
|
914
|
+
"reflect": false,
|
|
915
|
+
"attribute": "row-height",
|
|
916
|
+
"defaultValue": "40"
|
|
1131
917
|
},
|
|
1132
|
-
"
|
|
918
|
+
"virtualBuffer": {
|
|
1133
919
|
"type": "number",
|
|
1134
920
|
"mutable": false,
|
|
1135
921
|
"complexType": {
|
|
@@ -1146,10 +932,10 @@ export class SdTable {
|
|
|
1146
932
|
"getter": false,
|
|
1147
933
|
"setter": false,
|
|
1148
934
|
"reflect": false,
|
|
1149
|
-
"attribute": "virtual-
|
|
1150
|
-
"defaultValue": "
|
|
935
|
+
"attribute": "virtual-buffer",
|
|
936
|
+
"defaultValue": "5"
|
|
1151
937
|
},
|
|
1152
|
-
"
|
|
938
|
+
"virtualEndThreshold": {
|
|
1153
939
|
"type": "number",
|
|
1154
940
|
"mutable": false,
|
|
1155
941
|
"complexType": {
|
|
@@ -1166,16 +952,23 @@ export class SdTable {
|
|
|
1166
952
|
"getter": false,
|
|
1167
953
|
"setter": false,
|
|
1168
954
|
"reflect": false,
|
|
1169
|
-
"attribute": "virtual-
|
|
1170
|
-
"defaultValue": "
|
|
955
|
+
"attribute": "virtual-end-threshold",
|
|
956
|
+
"defaultValue": "10"
|
|
1171
957
|
},
|
|
1172
|
-
"
|
|
958
|
+
"rowsPerPageOption": {
|
|
1173
959
|
"type": "unknown",
|
|
1174
960
|
"mutable": false,
|
|
1175
961
|
"complexType": {
|
|
1176
|
-
"original": "
|
|
1177
|
-
"resolved": "
|
|
1178
|
-
"references": {
|
|
962
|
+
"original": "SelectOption[]",
|
|
963
|
+
"resolved": "SelectOption[]",
|
|
964
|
+
"references": {
|
|
965
|
+
"SelectOption": {
|
|
966
|
+
"location": "import",
|
|
967
|
+
"path": "./constants",
|
|
968
|
+
"id": "src/components/sd-table/constants.ts::SelectOption",
|
|
969
|
+
"referenceLocation": "SelectOption"
|
|
970
|
+
}
|
|
971
|
+
}
|
|
1179
972
|
},
|
|
1180
973
|
"required": false,
|
|
1181
974
|
"optional": false,
|
|
@@ -1185,24 +978,21 @@ export class SdTable {
|
|
|
1185
978
|
},
|
|
1186
979
|
"getter": false,
|
|
1187
980
|
"setter": false,
|
|
1188
|
-
"defaultValue": "{\n
|
|
981
|
+
"defaultValue": "[\n { label: '10\uAC1C\uC529 \uBCF4\uAE30', value: 10 },\n { label: '25\uAC1C\uC529 \uBCF4\uAE30', value: 25 },\n { label: '50\uAC1C\uC529 \uBCF4\uAE30', value: 50 },\n { label: '100\uAC1C\uC529 \uBCF4\uAE30', value: 100 },\n ]"
|
|
1189
982
|
}
|
|
1190
983
|
};
|
|
1191
984
|
}
|
|
1192
985
|
static get states() {
|
|
1193
986
|
return {
|
|
987
|
+
"resolvedNoDataLabel": {},
|
|
1194
988
|
"currentPage": {},
|
|
1195
|
-
"
|
|
989
|
+
"innerRowsPerPage": {},
|
|
1196
990
|
"innerSelected": {},
|
|
1197
991
|
"columnWidths": {},
|
|
1198
992
|
"scrolledLeft": {},
|
|
1199
993
|
"scrolledRight": {},
|
|
1200
|
-
"
|
|
1201
|
-
"
|
|
1202
|
-
"scrollTopPosition": {},
|
|
1203
|
-
"virtualStartColIdx": {},
|
|
1204
|
-
"virtualEndColIdx": {},
|
|
1205
|
-
"scrollLeftPosition": {}
|
|
994
|
+
"rowCount": {},
|
|
995
|
+
"loadingScrollTop": {}
|
|
1206
996
|
};
|
|
1207
997
|
}
|
|
1208
998
|
static get events() {
|
|
@@ -1221,9 +1011,10 @@ export class SdTable {
|
|
|
1221
1011
|
"resolved": "Row[]",
|
|
1222
1012
|
"references": {
|
|
1223
1013
|
"Row": {
|
|
1224
|
-
"location": "
|
|
1225
|
-
"path": "
|
|
1226
|
-
"id": "src/components/sd-table/
|
|
1014
|
+
"location": "import",
|
|
1015
|
+
"path": "./constants",
|
|
1016
|
+
"id": "src/components/sd-table/constants.ts::Row",
|
|
1017
|
+
"referenceLocation": "Row"
|
|
1227
1018
|
}
|
|
1228
1019
|
}
|
|
1229
1020
|
}
|
|
@@ -1257,31 +1048,245 @@ export class SdTable {
|
|
|
1257
1048
|
"resolved": "number",
|
|
1258
1049
|
"references": {}
|
|
1259
1050
|
}
|
|
1051
|
+
}, {
|
|
1052
|
+
"method": "sdVirtualUpdate",
|
|
1053
|
+
"name": "sdVirtualUpdate",
|
|
1054
|
+
"bubbles": true,
|
|
1055
|
+
"cancelable": true,
|
|
1056
|
+
"composed": true,
|
|
1057
|
+
"docs": {
|
|
1058
|
+
"tags": [],
|
|
1059
|
+
"text": ""
|
|
1060
|
+
},
|
|
1061
|
+
"complexType": {
|
|
1062
|
+
"original": "{\n from: number;\n to: number;\n }",
|
|
1063
|
+
"resolved": "{ from: number; to: number; }",
|
|
1064
|
+
"references": {}
|
|
1065
|
+
}
|
|
1066
|
+
}, {
|
|
1067
|
+
"method": "sdVirtualReachEnd",
|
|
1068
|
+
"name": "sdVirtualReachEnd",
|
|
1069
|
+
"bubbles": true,
|
|
1070
|
+
"cancelable": true,
|
|
1071
|
+
"composed": true,
|
|
1072
|
+
"docs": {
|
|
1073
|
+
"tags": [],
|
|
1074
|
+
"text": ""
|
|
1075
|
+
},
|
|
1076
|
+
"complexType": {
|
|
1077
|
+
"original": "{\n from: number;\n to: number;\n rowCount: number;\n threshold: number;\n }",
|
|
1078
|
+
"resolved": "{ from: number; to: number; rowCount: number; threshold: number; }",
|
|
1079
|
+
"references": {}
|
|
1080
|
+
}
|
|
1260
1081
|
}];
|
|
1261
1082
|
}
|
|
1083
|
+
static get methods() {
|
|
1084
|
+
return {
|
|
1085
|
+
"isRowSelected": {
|
|
1086
|
+
"complexType": {
|
|
1087
|
+
"signature": "(row: Row) => Promise<boolean>",
|
|
1088
|
+
"parameters": [{
|
|
1089
|
+
"name": "row",
|
|
1090
|
+
"type": "Row",
|
|
1091
|
+
"docs": ""
|
|
1092
|
+
}],
|
|
1093
|
+
"references": {
|
|
1094
|
+
"Promise": {
|
|
1095
|
+
"location": "global",
|
|
1096
|
+
"id": "global::Promise"
|
|
1097
|
+
},
|
|
1098
|
+
"Row": {
|
|
1099
|
+
"location": "import",
|
|
1100
|
+
"path": "./constants",
|
|
1101
|
+
"id": "src/components/sd-table/constants.ts::Row",
|
|
1102
|
+
"referenceLocation": "Row"
|
|
1103
|
+
}
|
|
1104
|
+
},
|
|
1105
|
+
"return": "Promise<boolean>"
|
|
1106
|
+
},
|
|
1107
|
+
"docs": {
|
|
1108
|
+
"text": "",
|
|
1109
|
+
"tags": []
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
"updateRowSelect": {
|
|
1113
|
+
"complexType": {
|
|
1114
|
+
"signature": "(row: Row) => Promise<void>",
|
|
1115
|
+
"parameters": [{
|
|
1116
|
+
"name": "row",
|
|
1117
|
+
"type": "Row",
|
|
1118
|
+
"docs": ""
|
|
1119
|
+
}],
|
|
1120
|
+
"references": {
|
|
1121
|
+
"Promise": {
|
|
1122
|
+
"location": "global",
|
|
1123
|
+
"id": "global::Promise"
|
|
1124
|
+
},
|
|
1125
|
+
"Row": {
|
|
1126
|
+
"location": "import",
|
|
1127
|
+
"path": "./constants",
|
|
1128
|
+
"id": "src/components/sd-table/constants.ts::Row",
|
|
1129
|
+
"referenceLocation": "Row"
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
"return": "Promise<void>"
|
|
1133
|
+
},
|
|
1134
|
+
"docs": {
|
|
1135
|
+
"text": "",
|
|
1136
|
+
"tags": []
|
|
1137
|
+
}
|
|
1138
|
+
},
|
|
1139
|
+
"toggleSelectAll": {
|
|
1140
|
+
"complexType": {
|
|
1141
|
+
"signature": "(checked: boolean, rows: Row[]) => Promise<void>",
|
|
1142
|
+
"parameters": [{
|
|
1143
|
+
"name": "checked",
|
|
1144
|
+
"type": "boolean",
|
|
1145
|
+
"docs": ""
|
|
1146
|
+
}, {
|
|
1147
|
+
"name": "rows",
|
|
1148
|
+
"type": "Row[]",
|
|
1149
|
+
"docs": ""
|
|
1150
|
+
}],
|
|
1151
|
+
"references": {
|
|
1152
|
+
"Promise": {
|
|
1153
|
+
"location": "global",
|
|
1154
|
+
"id": "global::Promise"
|
|
1155
|
+
},
|
|
1156
|
+
"Row": {
|
|
1157
|
+
"location": "import",
|
|
1158
|
+
"path": "./constants",
|
|
1159
|
+
"id": "src/components/sd-table/constants.ts::Row",
|
|
1160
|
+
"referenceLocation": "Row"
|
|
1161
|
+
}
|
|
1162
|
+
},
|
|
1163
|
+
"return": "Promise<void>"
|
|
1164
|
+
},
|
|
1165
|
+
"docs": {
|
|
1166
|
+
"text": "",
|
|
1167
|
+
"tags": []
|
|
1168
|
+
}
|
|
1169
|
+
},
|
|
1170
|
+
"getIsAllChecked": {
|
|
1171
|
+
"complexType": {
|
|
1172
|
+
"signature": "(rows: Row[]) => Promise<boolean | null>",
|
|
1173
|
+
"parameters": [{
|
|
1174
|
+
"name": "rows",
|
|
1175
|
+
"type": "Row[]",
|
|
1176
|
+
"docs": ""
|
|
1177
|
+
}],
|
|
1178
|
+
"references": {
|
|
1179
|
+
"Promise": {
|
|
1180
|
+
"location": "global",
|
|
1181
|
+
"id": "global::Promise"
|
|
1182
|
+
},
|
|
1183
|
+
"Row": {
|
|
1184
|
+
"location": "import",
|
|
1185
|
+
"path": "./constants",
|
|
1186
|
+
"id": "src/components/sd-table/constants.ts::Row",
|
|
1187
|
+
"referenceLocation": "Row"
|
|
1188
|
+
}
|
|
1189
|
+
},
|
|
1190
|
+
"return": "Promise<boolean | null>"
|
|
1191
|
+
},
|
|
1192
|
+
"docs": {
|
|
1193
|
+
"text": "",
|
|
1194
|
+
"tags": []
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
"getStickyStyle": {
|
|
1198
|
+
"complexType": {
|
|
1199
|
+
"signature": "(colIdx: number) => Promise<{ '--sticky-left-offset': string; '--sticky-right-offset': string; width: string; minWidth: string; maxWidth: string; }>",
|
|
1200
|
+
"parameters": [{
|
|
1201
|
+
"name": "colIdx",
|
|
1202
|
+
"type": "number",
|
|
1203
|
+
"docs": ""
|
|
1204
|
+
}],
|
|
1205
|
+
"references": {
|
|
1206
|
+
"Promise": {
|
|
1207
|
+
"location": "global",
|
|
1208
|
+
"id": "global::Promise"
|
|
1209
|
+
}
|
|
1210
|
+
},
|
|
1211
|
+
"return": "Promise<{ '--sticky-left-offset': string; '--sticky-right-offset': string; width: string; minWidth: string; maxWidth: string; }>"
|
|
1212
|
+
},
|
|
1213
|
+
"docs": {
|
|
1214
|
+
"text": "",
|
|
1215
|
+
"tags": []
|
|
1216
|
+
}
|
|
1217
|
+
},
|
|
1218
|
+
"setRowCount": {
|
|
1219
|
+
"complexType": {
|
|
1220
|
+
"signature": "(count: number) => Promise<void>",
|
|
1221
|
+
"parameters": [{
|
|
1222
|
+
"name": "count",
|
|
1223
|
+
"type": "number",
|
|
1224
|
+
"docs": ""
|
|
1225
|
+
}],
|
|
1226
|
+
"references": {
|
|
1227
|
+
"Promise": {
|
|
1228
|
+
"location": "global",
|
|
1229
|
+
"id": "global::Promise"
|
|
1230
|
+
}
|
|
1231
|
+
},
|
|
1232
|
+
"return": "Promise<void>"
|
|
1233
|
+
},
|
|
1234
|
+
"docs": {
|
|
1235
|
+
"text": "",
|
|
1236
|
+
"tags": []
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
"getPaginationInfo": {
|
|
1240
|
+
"complexType": {
|
|
1241
|
+
"signature": "() => Promise<{ startIndex: number; endIndex: number; currentPage: number; rowsPerPage: number; } | null>",
|
|
1242
|
+
"parameters": [],
|
|
1243
|
+
"references": {
|
|
1244
|
+
"Promise": {
|
|
1245
|
+
"location": "global",
|
|
1246
|
+
"id": "global::Promise"
|
|
1247
|
+
}
|
|
1248
|
+
},
|
|
1249
|
+
"return": "Promise<{ startIndex: number; endIndex: number; currentPage: number; rowsPerPage: number; } | null>"
|
|
1250
|
+
},
|
|
1251
|
+
"docs": {
|
|
1252
|
+
"text": "",
|
|
1253
|
+
"tags": []
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1262
1258
|
static get elementRef() { return "el"; }
|
|
1263
1259
|
static get watchers() {
|
|
1264
1260
|
return [{
|
|
1265
|
-
"propName": "
|
|
1266
|
-
"methodName": "
|
|
1261
|
+
"propName": "isLoading",
|
|
1262
|
+
"methodName": "handleIsLoadingChange"
|
|
1267
1263
|
}, {
|
|
1268
1264
|
"propName": "useVirtualScroll",
|
|
1269
1265
|
"methodName": "handleUseVirtualScrollChange"
|
|
1270
1266
|
}, {
|
|
1271
|
-
"propName": "
|
|
1272
|
-
"methodName": "
|
|
1267
|
+
"propName": "columns",
|
|
1268
|
+
"methodName": "handleColumnsChange"
|
|
1269
|
+
}, {
|
|
1270
|
+
"propName": "rows",
|
|
1271
|
+
"methodName": "handleRowsChange"
|
|
1272
|
+
}, {
|
|
1273
|
+
"propName": "tableId",
|
|
1274
|
+
"methodName": "handleTableIdChange"
|
|
1275
|
+
}, {
|
|
1276
|
+
"propName": "noDataLabel",
|
|
1277
|
+
"methodName": "handleNoDataLabelChange"
|
|
1273
1278
|
}, {
|
|
1274
1279
|
"propName": "selectable",
|
|
1275
|
-
"methodName": "
|
|
1280
|
+
"methodName": "handleConfigChange"
|
|
1276
1281
|
}, {
|
|
1277
|
-
"propName": "
|
|
1278
|
-
"methodName": "
|
|
1282
|
+
"propName": "resizable",
|
|
1283
|
+
"methodName": "handleConfigChange"
|
|
1279
1284
|
}, {
|
|
1280
|
-
"propName": "
|
|
1281
|
-
"methodName": "
|
|
1285
|
+
"propName": "stickyColumn",
|
|
1286
|
+
"methodName": "handleConfigChange"
|
|
1282
1287
|
}, {
|
|
1283
|
-
"propName": "
|
|
1284
|
-
"methodName": "
|
|
1288
|
+
"propName": "stickyHeader",
|
|
1289
|
+
"methodName": "handleConfigChange"
|
|
1285
1290
|
}, {
|
|
1286
1291
|
"propName": "selected",
|
|
1287
1292
|
"methodName": "handleSelectedChange"
|