@sellmate/design-system 0.0.55 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{select-keyboard-navigation-6fO_V4En.js → base-dropdown-event-Dc6AuxR4.js} +26 -26
- package/dist/cjs/base-dropdown-event-Dc6AuxR4.js.map +1 -0
- package/dist/cjs/design-system.cjs.js +2 -2
- package/dist/cjs/{index-B7tkxTye.js → index-D_J8ScR5.js} +3 -3
- package/dist/cjs/index-D_J8ScR5.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{resolveColor-DxvExwgo.js → resolveColor-B7Ku3IGq.js} +4 -5
- package/dist/{esm/resolveColor-BYf-ybt2.js.map → cjs/resolveColor-B7Ku3IGq.js.map} +1 -1
- package/dist/cjs/sd-badge.cjs.entry.js +4 -4
- package/dist/cjs/{sd-button_24.cjs.entry.js → sd-button_6.cjs.entry.js} +292 -2842
- package/dist/cjs/sd-card.cjs.entry.js +4 -4
- package/dist/cjs/sd-checkbox.cjs.entry.js +89 -0
- package/dist/cjs/sd-date-box.cjs.entry.js +10 -10
- package/dist/cjs/sd-date-picker.cjs.entry.js +5 -5
- package/dist/cjs/sd-date-range-picker.cjs.entry.js +8 -8
- package/dist/cjs/sd-field_3.cjs.entry.js +422 -0
- package/dist/cjs/sd-file-picker.cjs.entry.js +121 -0
- package/dist/cjs/sd-form.cjs.entry.js +74 -0
- package/dist/cjs/sd-guide.cjs.entry.js +81 -0
- package/dist/cjs/sd-loading-spinner_2.cjs.entry.js +195 -0
- package/dist/cjs/sd-modal-card.cjs.entry.js +8 -8
- package/dist/cjs/sd-number-input.cjs.entry.js +261 -0
- package/dist/cjs/sd-popover.cjs.entry.js +7 -7
- package/dist/cjs/sd-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-radio-button-group.cjs.entry.js +8 -21
- package/dist/cjs/sd-radio-group.cjs.entry.js +71 -0
- package/dist/cjs/sd-select-dropdown_3.cjs.entry.js +266 -0
- package/dist/cjs/sd-select-multiple-group.cjs.entry.js +446 -0
- package/dist/cjs/sd-select-multiple.cjs.entry.js +74 -152
- package/dist/cjs/sd-select-option-group.cjs.entry.js +69 -0
- package/dist/cjs/sd-table.cjs.entry.js +515 -85
- package/dist/cjs/sd-tabs.cjs.entry.js +66 -0
- package/dist/cjs/sd-tag.cjs.entry.js +57 -0
- package/dist/cjs/sd-toast-message.cjs.entry.js +61 -0
- package/dist/cjs/sd-toggle-button.cjs.entry.js +50 -0
- package/dist/cjs/sd-toggle.cjs.entry.js +46 -0
- package/dist/cjs/{tooltipArrow-8I9A3AOE.js → tooltipArrow-DU2DB2AD.js} +3 -3
- package/dist/cjs/{tooltipArrow-8I9A3AOE.js.map → tooltipArrow-DU2DB2AD.js.map} +1 -1
- package/dist/collection/collection-manifest.json +7 -8
- package/dist/collection/components/sd-badge/sd-badge.css +8 -9
- package/dist/collection/components/sd-badge/sd-badge.js +1 -2
- package/dist/collection/components/sd-badge/sd-badge.js.map +1 -1
- package/dist/collection/components/sd-button/sd-button.css +2 -1
- package/dist/collection/components/sd-button/sd-button.js +2 -34
- package/dist/collection/components/sd-button/sd-button.js.map +1 -1
- package/dist/collection/components/sd-card/sd-card.css +1 -3
- package/dist/collection/components/sd-card/sd-card.js +6 -6
- package/dist/collection/components/sd-card/sd-card.js.map +1 -1
- package/dist/collection/components/sd-checkbox/sd-checkbox.js +16 -16
- package/dist/collection/components/sd-checkbox/sd-checkbox.js.map +1 -1
- package/dist/collection/components/sd-date-box/sd-date-box.css +1 -0
- package/dist/collection/components/sd-date-box/sd-date-box.js +8 -8
- package/dist/collection/components/sd-date-box/sd-date-box.js.map +1 -1
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +5 -5
- package/dist/collection/components/sd-date-picker/sd-date-picker.js.map +1 -1
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.css +9 -6
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +8 -8
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js.map +1 -1
- package/dist/collection/components/sd-field/sd-field.css +100 -0
- package/dist/collection/components/sd-field/sd-field.js +472 -0
- package/dist/collection/components/sd-field/sd-field.js.map +1 -0
- package/dist/collection/components/sd-file-picker/sd-file-picker.css +6 -0
- package/dist/collection/components/sd-file-picker/sd-file-picker.js +8 -8
- package/dist/collection/components/sd-file-picker/sd-file-picker.js.map +1 -1
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.css +103 -0
- package/dist/collection/components/{sd-tooltip-portal/sd-tooltip-portal.js → sd-floating-portal/sd-floating-portal.js} +18 -9
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js.map +1 -0
- package/dist/collection/components/sd-form/sd-form.js +200 -0
- package/dist/collection/components/sd-form/sd-form.js.map +1 -0
- package/dist/collection/components/sd-guide/sd-guide.css +3 -2
- package/dist/collection/components/sd-guide/sd-guide.js +7 -8
- package/dist/collection/components/sd-guide/sd-guide.js.map +1 -1
- package/dist/collection/components/sd-icon/sd-icon.js +1 -1
- package/dist/collection/components/sd-input/sd-input.css +43 -100
- package/dist/collection/components/sd-input/sd-input.js +285 -114
- package/dist/collection/components/sd-input/sd-input.js.map +1 -1
- package/dist/collection/components/sd-modal-card/sd-modal-card.css +1 -0
- package/dist/collection/components/sd-modal-card/sd-modal-card.js +5 -5
- package/dist/collection/components/sd-modal-card/sd-modal-card.js.map +1 -1
- package/dist/collection/components/sd-number-input/sd-number-input.js +18 -84
- package/dist/collection/components/sd-number-input/sd-number-input.js.map +1 -1
- package/dist/collection/components/sd-pagination/sd-pagination.js +4 -3
- package/dist/collection/components/sd-pagination/sd-pagination.js.map +1 -1
- package/dist/collection/components/sd-popover/sd-popover.css +2 -2
- package/dist/collection/components/sd-popover/sd-popover.js +4 -5
- package/dist/collection/components/sd-popover/sd-popover.js.map +1 -1
- package/dist/collection/components/sd-portal/sd-portal.js +4 -4
- package/dist/collection/components/sd-portal/sd-portal.js.map +1 -1
- package/dist/collection/components/sd-radio-button-group/sd-radio-button-group.js +9 -30
- package/dist/collection/components/sd-radio-button-group/sd-radio-button-group.js.map +1 -1
- package/dist/collection/components/sd-radio-group/sd-radio-group.js +5 -5
- package/dist/collection/components/sd-radio-group/sd-radio-group.js.map +1 -1
- package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.css +52 -0
- package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js +441 -0
- package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js.map +1 -0
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +4 -4
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js.map +1 -1
- package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.css +11 -3
- package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js +15 -15
- package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js.map +1 -1
- package/dist/collection/components/sd-select/sd-select.css +9 -97
- package/dist/collection/components/sd-select/sd-select.js +320 -219
- package/dist/collection/components/sd-select/sd-select.js.map +1 -1
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.css +16 -102
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +328 -179
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js.map +1 -1
- package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.css +8 -45
- package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.js +265 -47
- package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.js.map +1 -1
- 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-multiple-group/sd-select-option-group/sd-select-option-group.js.map +1 -1
- package/dist/collection/components/sd-table/sd-table.css +121 -30
- package/dist/collection/components/sd-table/sd-table.js +629 -92
- package/dist/collection/components/sd-table/sd-table.js.map +1 -1
- package/dist/collection/components/sd-tabs/sd-tabs.css +10 -7
- package/dist/collection/components/sd-tabs/sd-tabs.js +10 -17
- package/dist/collection/components/sd-tabs/sd-tabs.js.map +1 -1
- package/dist/collection/components/sd-tag/sd-tag.js +1 -1
- package/dist/collection/components/sd-textarea/sd-textarea.css +66 -0
- package/dist/collection/components/sd-textarea/sd-textarea.js +400 -0
- package/dist/collection/components/sd-textarea/sd-textarea.js.map +1 -0
- package/dist/collection/components/sd-toast-message/sd-toast-message.js +11 -11
- package/dist/collection/components/sd-toast-message/sd-toast-message.js.map +1 -1
- package/dist/collection/components/sd-toggle/sd-toggle.js +8 -14
- package/dist/collection/components/sd-toggle/sd-toggle.js.map +1 -1
- package/dist/collection/components/sd-toggle-button/sd-toggle-button.js +5 -5
- package/dist/collection/components/sd-toggle-button/sd-toggle-button.js.map +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.css +6 -65
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +12 -29
- package/dist/collection/components/sd-tooltip/sd-tooltip.js.map +1 -1
- package/dist/collection/types/select.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-7xekTQRB.js +104 -0
- package/dist/components/p-7xekTQRB.js.map +1 -0
- package/dist/components/{p-BDkKpeVz.js → p-BKSlQGJv.js} +3 -3
- package/dist/components/{p-BDkKpeVz.js.map → p-BKSlQGJv.js.map} +1 -1
- package/dist/components/{p-njRAT-yp.js → p-CVMprLsE.js} +17 -15
- package/dist/components/p-CVMprLsE.js.map +1 -0
- package/dist/components/p-CdGD6AqM.js +92 -0
- package/dist/components/p-CdGD6AqM.js.map +1 -0
- package/dist/components/p-CpRkV7pg.js +201 -0
- package/dist/components/p-CpRkV7pg.js.map +1 -0
- package/dist/components/p-D2movWkD.js +289 -0
- package/dist/components/p-D2movWkD.js.map +1 -0
- package/dist/components/p-D54IEoI6.js +238 -0
- package/dist/components/p-D54IEoI6.js.map +1 -0
- package/dist/components/{p-D5BkkT2U.js → p-DbebUQwg.js} +7 -7
- package/dist/components/{p-D5BkkT2U.js.map → p-DbebUQwg.js.map} +1 -1
- package/dist/components/{p-BYf-ybt2.js → p-DcGvp3RM.js} +5 -5
- package/dist/components/p-DcGvp3RM.js.map +1 -0
- package/dist/components/{p-nqDJZ_gy.js → p-DdKGhMHk.js} +4 -4
- package/dist/components/{p-nqDJZ_gy.js.map → p-DdKGhMHk.js.map} +1 -1
- package/dist/components/{p-BxPT3VKO.js → p-DlJtPR_C.js} +12 -12
- package/dist/components/p-DlJtPR_C.js.map +1 -0
- package/dist/components/{p-vhe6g4Qt.js → p-DnQF6htq.js} +5 -5
- package/dist/components/{p-vhe6g4Qt.js.map → p-DnQF6htq.js.map} +1 -1
- package/dist/components/{p-BA38jFi5.js → p-DssRJcAn.js} +4 -4
- package/dist/components/{p-BA38jFi5.js.map → p-DssRJcAn.js.map} +1 -1
- package/dist/components/{p-B3H_uLbl.js → p-Dt-KAeBx.js} +3 -3
- package/dist/components/{p-B3H_uLbl.js.map → p-Dt-KAeBx.js.map} +1 -1
- package/dist/components/{p-DRGcUx0C.js → p-DxSmO6Tr.js} +8 -7
- package/dist/components/p-DxSmO6Tr.js.map +1 -0
- package/dist/components/{p-CWwMpVqI.js → p-JF61vPAh.js} +9 -9
- package/dist/components/p-JF61vPAh.js.map +1 -0
- package/dist/components/p-RhBqdixM.js +102 -0
- package/dist/components/p-RhBqdixM.js.map +1 -0
- package/dist/components/{p-CKhzpdPk.js → p-UZEmuyIR.js} +19 -19
- package/dist/components/p-UZEmuyIR.js.map +1 -0
- package/dist/components/{p-CQBrru3e.js → p-YLoygqPr.js} +3 -3
- package/dist/components/p-YLoygqPr.js.map +1 -0
- package/dist/components/p-s4Mg_xSz.js +260 -0
- package/dist/components/p-s4Mg_xSz.js.map +1 -0
- package/dist/components/{p-MRYVk6Qh.js → p-zvZtN3nR.js} +8 -8
- package/dist/components/{p-MRYVk6Qh.js.map → p-zvZtN3nR.js.map} +1 -1
- package/dist/components/sd-badge.js +5 -5
- package/dist/components/sd-badge.js.map +1 -1
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-card.js +5 -5
- package/dist/components/sd-card.js.map +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-date-box.js +1 -1
- package/dist/components/sd-date-picker.js +37 -13
- package/dist/components/sd-date-picker.js.map +1 -1
- package/dist/components/sd-date-range-picker.js +41 -17
- package/dist/components/sd-date-range-picker.js.map +1 -1
- package/dist/components/{sd-td.d.ts → sd-field.d.ts} +4 -4
- package/dist/components/sd-field.js +9 -0
- package/dist/components/sd-field.js.map +1 -0
- package/dist/components/sd-file-picker.js +10 -10
- package/dist/components/sd-file-picker.js.map +1 -1
- package/dist/components/{sd-table-backup.d.ts → sd-floating-portal.d.ts} +4 -4
- package/dist/components/sd-floating-portal.js +9 -0
- package/dist/components/sd-floating-portal.js.map +1 -0
- package/dist/components/{sd-th.d.ts → sd-form.d.ts} +4 -4
- package/dist/components/sd-form.js +99 -0
- package/dist/components/sd-form.js.map +1 -0
- package/dist/components/sd-guide.js +12 -13
- package/dist/components/sd-guide.js.map +1 -1
- package/dist/components/sd-icon.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-loading-spinner.js +1 -1
- package/dist/components/sd-modal-card.js +10 -10
- package/dist/components/sd-modal-card.js.map +1 -1
- package/dist/components/sd-number-input.js +19 -43
- package/dist/components/sd-number-input.js.map +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +14 -15
- package/dist/components/sd-popover.js.map +1 -1
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-progress.js +1 -1
- package/dist/components/sd-radio-button-group.js +10 -26
- package/dist/components/sd-radio-button-group.js.map +1 -1
- package/dist/components/sd-radio-group.js +5 -5
- package/dist/components/sd-radio-group.js.map +1 -1
- package/dist/components/{sd-tbody.d.ts → sd-select-dropdown.d.ts} +4 -4
- package/dist/components/sd-select-dropdown.js +9 -0
- package/dist/components/sd-select-dropdown.js.map +1 -0
- package/dist/components/sd-select-multiple-group.js +97 -40
- package/dist/components/sd-select-multiple-group.js.map +1 -1
- package/dist/components/sd-select-multiple.js +133 -168
- package/dist/components/sd-select-multiple.js.map +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.js +1 -1
- package/dist/components/sd-table.js +555 -113
- package/dist/components/sd-table.js.map +1 -1
- package/dist/components/sd-tabs.js +13 -16
- package/dist/components/sd-tabs.js.map +1 -1
- package/dist/components/sd-tag.js +1 -1
- package/dist/components/{sd-tr.d.ts → sd-textarea.d.ts} +4 -4
- package/dist/components/sd-textarea.js +145 -0
- package/dist/components/sd-textarea.js.map +1 -0
- package/dist/components/sd-toast-message.js +14 -14
- package/dist/components/sd-toast-message.js.map +1 -1
- package/dist/components/sd-toggle-button.js +5 -5
- package/dist/components/sd-toggle-button.js.map +1 -1
- package/dist/components/sd-toggle.js +9 -11
- package/dist/components/sd-toggle.js.map +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/design-system/design-system.css +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/p-02e23509.entry.js +2 -0
- package/dist/design-system/p-02e23509.entry.js.map +1 -0
- package/dist/design-system/p-0a2f733d.entry.js +2 -0
- package/dist/design-system/p-0a2f733d.entry.js.map +1 -0
- package/dist/design-system/p-0d3f019d.entry.js +2 -0
- package/dist/design-system/p-0d3f019d.entry.js.map +1 -0
- package/dist/design-system/p-15dd1289.entry.js +2 -0
- package/dist/design-system/p-15dd1289.entry.js.map +1 -0
- package/dist/design-system/p-216c6543.entry.js +2 -0
- package/dist/design-system/p-216c6543.entry.js.map +1 -0
- package/dist/design-system/p-2400d67b.entry.js +2 -0
- package/dist/design-system/p-2400d67b.entry.js.map +1 -0
- package/dist/design-system/p-282f4087.entry.js +2 -0
- package/dist/design-system/p-282f4087.entry.js.map +1 -0
- package/dist/design-system/{p-7b94b34e.entry.js → p-388d5b9f.entry.js} +2 -2
- package/dist/design-system/p-4d7bb5b6.entry.js +2 -0
- package/dist/design-system/p-4d7bb5b6.entry.js.map +1 -0
- package/dist/design-system/p-53972259.entry.js +2 -0
- package/dist/design-system/p-53972259.entry.js.map +1 -0
- package/dist/design-system/p-6277b220.entry.js +2 -0
- package/dist/design-system/p-6277b220.entry.js.map +1 -0
- package/dist/design-system/p-652c4d37.entry.js +2 -0
- package/dist/design-system/p-652c4d37.entry.js.map +1 -0
- package/dist/design-system/p-661c4553.entry.js +2 -0
- package/dist/design-system/p-661c4553.entry.js.map +1 -0
- package/dist/design-system/p-686958c5.entry.js +2 -0
- package/dist/design-system/p-686958c5.entry.js.map +1 -0
- package/dist/design-system/p-811c5aa4.entry.js +2 -0
- package/dist/design-system/p-811c5aa4.entry.js.map +1 -0
- package/dist/design-system/p-827ca975.entry.js +2 -0
- package/dist/design-system/p-827ca975.entry.js.map +1 -0
- package/dist/design-system/p-8df72aa2.entry.js +2 -0
- package/dist/design-system/p-8df72aa2.entry.js.map +1 -0
- package/dist/design-system/p-9d2459ed.entry.js +2 -0
- package/dist/design-system/p-9d2459ed.entry.js.map +1 -0
- package/dist/design-system/p-BShXSO5x.js +2 -0
- package/dist/design-system/p-BShXSO5x.js.map +1 -0
- package/dist/design-system/{p-7X2nzJWz.js → p-C3qNZ7Qh.js} +3 -3
- package/dist/design-system/p-C3qNZ7Qh.js.map +1 -0
- package/dist/design-system/{p-CdbtuKYR.js → p-DPxE68eG.js} +2 -2
- package/dist/design-system/{p-CdbtuKYR.js.map → p-DPxE68eG.js.map} +1 -1
- package/dist/design-system/{p-BYf-ybt2.js → p-DcGvp3RM.js} +2 -2
- package/dist/design-system/{p-BYf-ybt2.js.map → p-DcGvp3RM.js.map} +1 -1
- package/dist/design-system/p-a7d4c6bd.entry.js +2 -0
- package/dist/design-system/p-a7d4c6bd.entry.js.map +1 -0
- package/dist/design-system/p-ac29c52c.entry.js +2 -0
- package/dist/design-system/p-ac29c52c.entry.js.map +1 -0
- package/dist/design-system/{p-7a424f6b.entry.js → p-b0277422.entry.js} +2 -2
- package/dist/design-system/p-b0277422.entry.js.map +1 -0
- package/dist/design-system/p-c25c4bd6.entry.js +2 -0
- package/dist/design-system/p-c25c4bd6.entry.js.map +1 -0
- package/dist/design-system/p-c3061828.entry.js +2 -0
- package/dist/design-system/p-c3061828.entry.js.map +1 -0
- package/dist/design-system/p-cde56c79.entry.js +2 -0
- package/dist/design-system/{p-2c57bdea.entry.js.map → p-cde56c79.entry.js.map} +1 -1
- package/dist/design-system/p-d77422e4.entry.js +2 -0
- package/dist/design-system/p-d77422e4.entry.js.map +1 -0
- package/dist/design-system/p-dc410414.entry.js +2 -0
- package/dist/design-system/p-dc410414.entry.js.map +1 -0
- package/dist/design-system/p-f254b09a.entry.js +2 -0
- package/dist/design-system/p-f254b09a.entry.js.map +1 -0
- package/dist/design-system/p-f3287206.entry.js +2 -0
- package/dist/design-system/p-f3287206.entry.js.map +1 -0
- package/dist/esm/{select-keyboard-navigation-C2JaR3A6.js → base-dropdown-event-BShXSO5x.js} +26 -26
- package/dist/esm/base-dropdown-event-BShXSO5x.js.map +1 -0
- package/dist/esm/design-system.js +3 -3
- package/dist/esm/{index-7X2nzJWz.js → index-C3qNZ7Qh.js} +3 -3
- package/dist/esm/index-C3qNZ7Qh.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{resolveColor-BYf-ybt2.js → resolveColor-DcGvp3RM.js} +5 -5
- package/dist/{cjs/resolveColor-DxvExwgo.js.map → esm/resolveColor-DcGvp3RM.js.map} +1 -1
- package/dist/esm/sd-badge.entry.js +4 -4
- package/dist/esm/sd-badge.entry.js.map +1 -1
- package/dist/esm/{sd-button_24.entry.js → sd-button_6.entry.js} +291 -2823
- package/dist/esm/sd-card.entry.js +4 -4
- package/dist/esm/sd-card.entry.js.map +1 -1
- package/dist/esm/sd-checkbox.entry.js +87 -0
- package/dist/esm/sd-checkbox.entry.js.map +1 -0
- package/dist/esm/sd-date-box.entry.js +10 -10
- package/dist/esm/sd-date-box.entry.js.map +1 -1
- package/dist/esm/sd-date-picker.entry.js +5 -5
- package/dist/esm/sd-date-picker.entry.js.map +1 -1
- package/dist/esm/sd-date-range-picker.entry.js +8 -8
- package/dist/esm/sd-date-range-picker.entry.js.map +1 -1
- package/dist/esm/sd-field_3.entry.js +418 -0
- package/dist/esm/sd-file-picker.entry.js +119 -0
- package/dist/esm/sd-file-picker.entry.js.map +1 -0
- package/dist/esm/sd-form.entry.js +72 -0
- package/dist/esm/sd-form.entry.js.map +1 -0
- package/dist/esm/sd-guide.entry.js +79 -0
- package/dist/esm/sd-guide.entry.js.map +1 -0
- package/dist/esm/sd-loading-spinner_2.entry.js +192 -0
- package/dist/esm/sd-modal-card.entry.js +8 -8
- package/dist/esm/sd-modal-card.entry.js.map +1 -1
- package/dist/esm/sd-number-input.entry.js +259 -0
- package/dist/esm/sd-number-input.entry.js.map +1 -0
- package/dist/esm/sd-popover.entry.js +7 -7
- package/dist/esm/sd-popover.entry.js.map +1 -1
- package/dist/esm/sd-progress.entry.js +1 -1
- package/dist/esm/sd-radio-button-group.entry.js +8 -21
- package/dist/esm/sd-radio-button-group.entry.js.map +1 -1
- package/dist/esm/sd-radio-group.entry.js +69 -0
- package/dist/esm/sd-radio-group.entry.js.map +1 -0
- package/dist/esm/sd-select-dropdown_3.entry.js +262 -0
- package/dist/esm/sd-select-multiple-group.entry.js +444 -0
- package/dist/esm/sd-select-multiple-group.entry.js.map +1 -0
- package/dist/esm/sd-select-multiple.entry.js +72 -150
- package/dist/esm/sd-select-multiple.entry.js.map +1 -1
- package/dist/esm/sd-select-option-group.entry.js +67 -0
- package/dist/esm/sd-select-option-group.entry.js.map +1 -0
- package/dist/esm/sd-table.entry.js +515 -85
- package/dist/esm/sd-table.entry.js.map +1 -1
- package/dist/esm/sd-tabs.entry.js +64 -0
- package/dist/esm/sd-tabs.entry.js.map +1 -0
- package/dist/esm/sd-tag.entry.js +55 -0
- package/dist/esm/sd-tag.entry.js.map +1 -0
- package/dist/esm/sd-toast-message.entry.js +59 -0
- package/dist/esm/sd-toast-message.entry.js.map +1 -0
- package/dist/esm/sd-toggle-button.entry.js +48 -0
- package/dist/esm/sd-toggle-button.entry.js.map +1 -0
- package/dist/esm/sd-toggle.entry.js +44 -0
- package/dist/esm/sd-toggle.entry.js.map +1 -0
- package/dist/esm/{tooltipArrow-DFRZWz6D.js → tooltipArrow-Ck_14rXC.js} +3 -3
- package/dist/esm/{tooltipArrow-DFRZWz6D.js.map → tooltipArrow-Ck_14rXC.js.map} +1 -1
- package/dist/types/components/sd-button/sd-button.d.ts +0 -3
- package/dist/types/components/sd-card/sd-card.d.ts +1 -1
- package/dist/types/components/sd-checkbox/sd-checkbox.d.ts +2 -2
- package/dist/types/components/sd-date-box/sd-date-box.d.ts +2 -2
- package/dist/types/components/sd-date-picker/sd-date-picker.d.ts +1 -1
- package/dist/types/components/sd-date-range-picker/sd-date-range-picker.d.ts +1 -1
- package/dist/types/components/sd-field/sd-field.d.ts +34 -0
- package/dist/types/components/sd-file-picker/sd-file-picker.d.ts +1 -1
- package/dist/types/components/{sd-tooltip-portal/sd-tooltip-portal.d.ts → sd-floating-portal/sd-floating-portal.d.ts} +2 -2
- package/dist/types/components/sd-form/sd-form.d.ts +23 -0
- package/dist/types/components/sd-input/sd-input.d.ts +23 -14
- package/dist/types/components/sd-modal-card/sd-modal-card.d.ts +2 -2
- package/dist/types/components/sd-number-input/sd-number-input.d.ts +4 -14
- package/dist/types/components/sd-portal/sd-portal.d.ts +1 -1
- package/dist/types/components/sd-radio-button-group/sd-radio-button-group.d.ts +2 -4
- package/dist/types/components/sd-radio-group/sd-radio-group.d.ts +1 -1
- package/dist/types/components/sd-select/sd-select-dropdown/sd-select-dropdown.d.ts +41 -0
- package/dist/types/components/sd-select/sd-select-option/sd-select-option.d.ts +1 -1
- package/dist/types/components/sd-select/sd-select-search-input/sd-select-search-input.d.ts +4 -4
- package/dist/types/components/sd-select/sd-select.d.ts +28 -21
- package/dist/types/components/sd-select-multiple/sd-select-multiple.d.ts +26 -20
- package/dist/types/components/sd-select-multiple-group/sd-select-multiple-group.d.ts +19 -4
- package/dist/types/components/sd-table/sd-table.d.ts +62 -3
- package/dist/types/components/sd-tabs/sd-tabs.d.ts +1 -2
- package/dist/types/components/sd-textarea/sd-textarea.d.ts +32 -0
- package/dist/types/components/sd-toast-message/sd-toast-message.d.ts +3 -3
- package/dist/types/components/sd-toggle/sd-toggle.d.ts +1 -2
- package/dist/types/components/sd-toggle-button/sd-toggle-button.d.ts +1 -1
- package/dist/types/components/sd-tooltip/sd-tooltip.d.ts +14 -2
- package/dist/types/components.d.ts +705 -399
- package/dist/types/types/form.d.ts +1 -0
- package/dist/types/types/select.d.ts +1 -1
- package/hydrate/index.js +1394 -1322
- package/hydrate/index.mjs +1394 -1322
- package/package.json +4 -3
- package/dist/cjs/index-B7tkxTye.js.map +0 -1
- package/dist/cjs/sd-tbody_3.cjs.entry.js +0 -44
- package/dist/cjs/sd-td.cjs.entry.js +0 -26
- package/dist/cjs/select-keyboard-navigation-6fO_V4En.js.map +0 -1
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.css +0 -3
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +0 -18
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js.map +0 -1
- package/dist/collection/components/sd-table/sd-td/sd-td.css +0 -9
- package/dist/collection/components/sd-table/sd-td/sd-td.js +0 -111
- package/dist/collection/components/sd-table/sd-td/sd-td.js.map +0 -1
- package/dist/collection/components/sd-table/sd-th/sd-th.css +0 -8
- package/dist/collection/components/sd-table/sd-th/sd-th.js +0 -18
- package/dist/collection/components/sd-table/sd-th/sd-th.js.map +0 -1
- package/dist/collection/components/sd-table/sd-tr/sd-tr.css +0 -3
- package/dist/collection/components/sd-table/sd-tr/sd-tr.js +0 -18
- package/dist/collection/components/sd-table/sd-tr/sd-tr.js.map +0 -1
- package/dist/collection/components/sd-table-backup/sd-table-backup.css +0 -309
- package/dist/collection/components/sd-table-backup/sd-table-backup.js +0 -1219
- package/dist/collection/components/sd-table-backup/sd-table-backup.js.map +0 -1
- package/dist/collection/components/sd-tooltip-portal/sd-tooltip-portal.js.map +0 -1
- package/dist/components/p-BESbtjDi.js +0 -102
- package/dist/components/p-BESbtjDi.js.map +0 -1
- package/dist/components/p-BLidMbc_.js +0 -34
- package/dist/components/p-BLidMbc_.js.map +0 -1
- package/dist/components/p-BYf-ybt2.js.map +0 -1
- package/dist/components/p-BxPT3VKO.js.map +0 -1
- package/dist/components/p-CKhzpdPk.js.map +0 -1
- package/dist/components/p-CQBrru3e.js.map +0 -1
- package/dist/components/p-CWwMpVqI.js.map +0 -1
- package/dist/components/p-CfKJNKMH.js +0 -175
- package/dist/components/p-CfKJNKMH.js.map +0 -1
- package/dist/components/p-DD9g6GYA.js +0 -34
- package/dist/components/p-DD9g6GYA.js.map +0 -1
- package/dist/components/p-DKoWHxRI.js +0 -34
- package/dist/components/p-DKoWHxRI.js.map +0 -1
- package/dist/components/p-DMqinLuj.js +0 -326
- package/dist/components/p-DMqinLuj.js.map +0 -1
- package/dist/components/p-DRGcUx0C.js.map +0 -1
- package/dist/components/p-DroKiQ6J.js +0 -121
- package/dist/components/p-DroKiQ6J.js.map +0 -1
- package/dist/components/p-QNYqIsvU.js +0 -78
- package/dist/components/p-QNYqIsvU.js.map +0 -1
- package/dist/components/p-njRAT-yp.js.map +0 -1
- package/dist/components/sd-table-backup.js +0 -802
- package/dist/components/sd-table-backup.js.map +0 -1
- package/dist/components/sd-tbody.js +0 -9
- package/dist/components/sd-tbody.js.map +0 -1
- package/dist/components/sd-td.js +0 -50
- package/dist/components/sd-td.js.map +0 -1
- package/dist/components/sd-th.js +0 -9
- package/dist/components/sd-th.js.map +0 -1
- package/dist/components/sd-tooltip-portal.d.ts +0 -11
- package/dist/components/sd-tooltip-portal.js +0 -9
- package/dist/components/sd-tooltip-portal.js.map +0 -1
- package/dist/components/sd-tr.js +0 -9
- package/dist/components/sd-tr.js.map +0 -1
- package/dist/design-system/p-0d2814dc.entry.js +0 -2
- package/dist/design-system/p-0d2814dc.entry.js.map +0 -1
- package/dist/design-system/p-27985b84.entry.js +0 -2
- package/dist/design-system/p-27985b84.entry.js.map +0 -1
- package/dist/design-system/p-2c57bdea.entry.js +0 -2
- package/dist/design-system/p-3bc4effa.entry.js +0 -2
- package/dist/design-system/p-3bc4effa.entry.js.map +0 -1
- package/dist/design-system/p-5acdd14a.entry.js +0 -2
- package/dist/design-system/p-5acdd14a.entry.js.map +0 -1
- package/dist/design-system/p-665c5c48.entry.js +0 -2
- package/dist/design-system/p-665c5c48.entry.js.map +0 -1
- package/dist/design-system/p-7X2nzJWz.js.map +0 -1
- package/dist/design-system/p-7a424f6b.entry.js.map +0 -1
- package/dist/design-system/p-97b271a7.entry.js +0 -2
- package/dist/design-system/p-97b271a7.entry.js.map +0 -1
- package/dist/design-system/p-9ade8cd7.entry.js +0 -2
- package/dist/design-system/p-9ade8cd7.entry.js.map +0 -1
- package/dist/design-system/p-C2JaR3A6.js +0 -2
- package/dist/design-system/p-C2JaR3A6.js.map +0 -1
- package/dist/design-system/p-b1b828e6.entry.js +0 -2
- package/dist/design-system/p-b1b828e6.entry.js.map +0 -1
- package/dist/design-system/p-de826a92.entry.js +0 -2
- package/dist/design-system/p-de826a92.entry.js.map +0 -1
- package/dist/design-system/p-e5065700.entry.js +0 -2
- package/dist/design-system/p-e5065700.entry.js.map +0 -1
- package/dist/design-system/p-fc3580fd.entry.js +0 -2
- package/dist/design-system/p-fc3580fd.entry.js.map +0 -1
- package/dist/esm/index-7X2nzJWz.js.map +0 -1
- package/dist/esm/sd-tbody_3.entry.js +0 -40
- package/dist/esm/sd-td.entry.js +0 -24
- package/dist/esm/sd-td.entry.js.map +0 -1
- package/dist/esm/select-keyboard-navigation-C2JaR3A6.js.map +0 -1
- package/dist/types/components/sd-table/sd-tbody/sd-tbody.d.ts +0 -3
- package/dist/types/components/sd-table/sd-td/sd-td.d.ts +0 -7
- package/dist/types/components/sd-table/sd-th/sd-th.d.ts +0 -3
- package/dist/types/components/sd-table/sd-tr/sd-tr.d.ts +0 -3
- package/dist/types/components/sd-table-backup/sd-table-backup.d.ts +0 -135
- /package/dist/design-system/{p-7b94b34e.entry.js.map → p-388d5b9f.entry.js.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { h, Host, } from "@stencil/core";
|
|
1
|
+
import { h, Host, readTask, } from "@stencil/core";
|
|
2
2
|
export class SdTable {
|
|
3
3
|
el;
|
|
4
4
|
columns;
|
|
5
5
|
rows;
|
|
6
|
-
selected =
|
|
6
|
+
selected = [];
|
|
7
7
|
rowKey = 'id';
|
|
8
8
|
selectable = false;
|
|
9
9
|
resizable = false;
|
|
@@ -14,6 +14,7 @@ export class SdTable {
|
|
|
14
14
|
noDataLabel = '데이터가 없습니다.';
|
|
15
15
|
isLoading = false;
|
|
16
16
|
pagination;
|
|
17
|
+
headerCellRenderer;
|
|
17
18
|
bodyCellRenderer;
|
|
18
19
|
useInternalPagination = false;
|
|
19
20
|
useRowsPerPageSelect = false;
|
|
@@ -23,6 +24,15 @@ export class SdTable {
|
|
|
23
24
|
{ label: '50개씩 보기', value: 50 },
|
|
24
25
|
{ label: '100개씩 보기', value: 100 },
|
|
25
26
|
];
|
|
27
|
+
useVirtualScroll = {}; // 가상 스크롤 사용 여부
|
|
28
|
+
virtualRowHeight = 44; // 가상 스크롤 사용시 각 행의 높이 - 세로 가상 스크롤 사용시 필수값
|
|
29
|
+
// 가상 스크롤 사용시 각 열의 너비 - 가로 가상 스크롤 사용시 필수값
|
|
30
|
+
// 가상화하려는 컬럼의 넓이는 무조건 고정(resizable의 경우 넓이가 변동되는데 이때에는 고려 x)
|
|
31
|
+
virtualColumnWidth = 120;
|
|
32
|
+
virtualBufferSize = {
|
|
33
|
+
vertical: 5,
|
|
34
|
+
horizontal: 5,
|
|
35
|
+
}; // 가상 스크롤 위아래 버퍼 크기
|
|
26
36
|
sdSelectChange;
|
|
27
37
|
sdPageChange;
|
|
28
38
|
sdRowsPerPageChange;
|
|
@@ -32,49 +42,247 @@ export class SdTable {
|
|
|
32
42
|
columnWidths = [];
|
|
33
43
|
scrolledLeft = false;
|
|
34
44
|
scrolledRight = false;
|
|
45
|
+
// 세로 가상 스크롤 상태값
|
|
46
|
+
virtualStartIndex = 0;
|
|
47
|
+
virtualEndIndex = 0;
|
|
48
|
+
scrollTopPosition = 0;
|
|
49
|
+
// 가로 가상 스크롤 상태값
|
|
50
|
+
virtualStartColIdx = 0;
|
|
51
|
+
virtualEndColIdx = 0;
|
|
52
|
+
scrollLeftPosition = 0;
|
|
53
|
+
// 가상 스크롤 Raf(Request Animation Frame) 관리
|
|
54
|
+
scrollRequestAnimationFrame = null;
|
|
55
|
+
scrollContainer = null;
|
|
56
|
+
rafScheduled = false;
|
|
57
|
+
pendingUpdates = {
|
|
58
|
+
vertical: false,
|
|
59
|
+
horizontal: false,
|
|
60
|
+
};
|
|
61
|
+
// 상태 캐시값
|
|
62
|
+
cachedVisibleColumns = null;
|
|
63
|
+
lastColumnsRef = null;
|
|
64
|
+
cachedVirtualRows = null;
|
|
65
|
+
cachedVirtualIndexKey = '';
|
|
66
|
+
cachedColumnOrder = null;
|
|
67
|
+
lastColumnOrderKey = '';
|
|
68
|
+
// DOM 측정 캐시값
|
|
69
|
+
cachedContainerHeight = 0;
|
|
70
|
+
cachedContainerWidth = 0;
|
|
71
|
+
// 스타일 캐시
|
|
72
|
+
stickyStyleCache = new Map();
|
|
73
|
+
// isAllChecked 캐시
|
|
74
|
+
cachedIsAllChecked;
|
|
75
|
+
lastSelectionKey = '';
|
|
76
|
+
onScroll;
|
|
35
77
|
handleColumnsChange(newCols) {
|
|
36
78
|
this.columnWidths = newCols.map(c => parseInt(c.width || '120', 10));
|
|
79
|
+
this.cleanUpVirtualCache();
|
|
80
|
+
this.stickyStyleCache.clear();
|
|
81
|
+
if (this.useVirtualScroll.horizontal) {
|
|
82
|
+
this.scheduleUpdate('horizontal');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
handleColumnWidthsChange() {
|
|
86
|
+
this.stickyStyleCache.clear();
|
|
87
|
+
if (this.useVirtualScroll.horizontal) {
|
|
88
|
+
this.scheduleUpdate('horizontal');
|
|
89
|
+
}
|
|
37
90
|
}
|
|
38
91
|
handleRowsChange(newRows) {
|
|
39
92
|
this.innerRows = [...newRows];
|
|
93
|
+
this.cleanUpVirtualCache();
|
|
94
|
+
if (this.useVirtualScroll.vertical) {
|
|
95
|
+
this.scheduleUpdate('vertical');
|
|
96
|
+
}
|
|
40
97
|
}
|
|
41
98
|
handleSelectedChange(newSelected) {
|
|
42
99
|
this.innerSelected = new Set(newSelected);
|
|
43
100
|
}
|
|
101
|
+
cleanUpVirtualCache() {
|
|
102
|
+
this.cachedVisibleColumns = null;
|
|
103
|
+
this.lastColumnsRef = null;
|
|
104
|
+
this.cachedVirtualRows = null;
|
|
105
|
+
this.cachedVirtualIndexKey = '';
|
|
106
|
+
this.cachedColumnOrder = null;
|
|
107
|
+
this.lastColumnOrderKey = '';
|
|
108
|
+
}
|
|
44
109
|
handlePaginationChange(newVal) {
|
|
45
|
-
if (newVal?.page && newVal.page !== this.currentPage)
|
|
110
|
+
if (newVal?.page && newVal.page !== this.currentPage) {
|
|
46
111
|
this.currentPage = newVal.page;
|
|
112
|
+
if (this.useVirtualScroll.vertical && this.scrollContainer) {
|
|
113
|
+
this.scrollContainer.scrollTo({ top: 0, behavior: 'instant' });
|
|
114
|
+
this.scrollTopPosition = 0;
|
|
115
|
+
this.calculateVisibleRange();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
47
118
|
}
|
|
48
119
|
componentWillLoad() {
|
|
49
120
|
this.innerRows = [...(this.rows || [])];
|
|
50
|
-
this.innerSelected = new Set(this.selected);
|
|
121
|
+
this.innerSelected = new Set(this.selected || []);
|
|
51
122
|
this.columnWidths = (this.columns || []).map(c => parseInt(c.width || '120', 10));
|
|
123
|
+
if (this.pagination?.page) {
|
|
124
|
+
this.currentPage = this.pagination.page;
|
|
125
|
+
}
|
|
52
126
|
}
|
|
53
127
|
componentDidLoad() {
|
|
54
|
-
|
|
55
|
-
|
|
128
|
+
readTask(() => {
|
|
129
|
+
const middle = this.el.querySelector('.sd-table__middle');
|
|
130
|
+
if (!middle)
|
|
131
|
+
return;
|
|
132
|
+
this.onScroll = () => {
|
|
133
|
+
const scrollLeft = middle.scrollLeft;
|
|
134
|
+
const scrollWidth = middle.scrollWidth;
|
|
135
|
+
const clientWidth = middle.clientWidth;
|
|
136
|
+
const scrollTop = middle.scrollTop;
|
|
137
|
+
const verticalChanged = this.useVirtualScroll.vertical && this.scrollTopPosition !== scrollTop;
|
|
138
|
+
const horizontalChanged = this.useVirtualScroll.horizontal && this.scrollLeftPosition !== scrollLeft;
|
|
139
|
+
const newScrolledLeft = scrollLeft > 0;
|
|
140
|
+
const newScrolledRight = scrollLeft + clientWidth < scrollWidth;
|
|
141
|
+
if (this.scrolledLeft !== newScrolledLeft || this.scrolledRight !== newScrolledRight) {
|
|
142
|
+
this.scrolledLeft = newScrolledLeft;
|
|
143
|
+
this.scrolledRight = newScrolledRight;
|
|
144
|
+
}
|
|
145
|
+
if (verticalChanged || horizontalChanged) {
|
|
146
|
+
if (this.scrollRequestAnimationFrame !== null) {
|
|
147
|
+
cancelAnimationFrame(this.scrollRequestAnimationFrame);
|
|
148
|
+
}
|
|
149
|
+
this.scrollRequestAnimationFrame = requestAnimationFrame(() => {
|
|
150
|
+
if (verticalChanged) {
|
|
151
|
+
this.scrollTopPosition = scrollTop;
|
|
152
|
+
this.calculateVisibleRange();
|
|
153
|
+
}
|
|
154
|
+
if (horizontalChanged) {
|
|
155
|
+
this.scrollLeftPosition = scrollLeft;
|
|
156
|
+
this.calculateVisibleColumnRange();
|
|
157
|
+
}
|
|
158
|
+
this.scrollRequestAnimationFrame = null;
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
this.scrollContainer = middle;
|
|
163
|
+
requestAnimationFrame(() => {
|
|
164
|
+
if (this.scrollContainer && this.onScroll) {
|
|
165
|
+
this.cachedContainerHeight = this.scrollContainer.clientHeight;
|
|
166
|
+
this.cachedContainerWidth = this.scrollContainer.clientWidth;
|
|
167
|
+
middle.addEventListener('scroll', this.onScroll, { passive: true });
|
|
168
|
+
if (this.useVirtualScroll.vertical) {
|
|
169
|
+
this.calculateVisibleRange();
|
|
170
|
+
}
|
|
171
|
+
if (this.useVirtualScroll.horizontal) {
|
|
172
|
+
this.calculateVisibleColumnRange();
|
|
173
|
+
}
|
|
174
|
+
this.onScroll();
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
changePage(page) {
|
|
180
|
+
if (!this.useInternalPagination) {
|
|
181
|
+
this.sdPageChange.emit(page);
|
|
56
182
|
return;
|
|
57
|
-
|
|
58
|
-
|
|
183
|
+
}
|
|
184
|
+
this.currentPage = page;
|
|
185
|
+
this.sdPageChange.emit(this.currentPage);
|
|
186
|
+
}
|
|
187
|
+
changeRowsPerPage(perPage) {
|
|
188
|
+
const changedRowsPerPage = perPage ? Number(perPage) : 0;
|
|
189
|
+
if (!this.useInternalPagination) {
|
|
190
|
+
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
59
191
|
return;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
192
|
+
}
|
|
193
|
+
const newRowsPerPage = Number(perPage || 0);
|
|
194
|
+
let newLastPage = Math.max(1, Math.ceil(this.innerRows.length / newRowsPerPage));
|
|
195
|
+
let newCurrentPage = this.currentPage;
|
|
196
|
+
if (newCurrentPage > newLastPage) {
|
|
197
|
+
newCurrentPage = newLastPage;
|
|
198
|
+
}
|
|
199
|
+
this.pagination = {
|
|
200
|
+
page: newCurrentPage,
|
|
201
|
+
rowsPerPage: newRowsPerPage,
|
|
202
|
+
lastPage: newLastPage,
|
|
64
203
|
};
|
|
65
|
-
|
|
66
|
-
|
|
204
|
+
this.currentPage = newCurrentPage;
|
|
205
|
+
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
206
|
+
}
|
|
207
|
+
disconnectedCallback() {
|
|
208
|
+
if (this.scrollContainer && this.onScroll) {
|
|
209
|
+
this.scrollContainer.removeEventListener('scroll', this.onScroll);
|
|
210
|
+
}
|
|
211
|
+
if (this.scrollRequestAnimationFrame !== null) {
|
|
212
|
+
cancelAnimationFrame(this.scrollRequestAnimationFrame);
|
|
213
|
+
}
|
|
67
214
|
}
|
|
68
215
|
// ----- Derived getters -----
|
|
69
216
|
get visibleColumns() {
|
|
70
|
-
|
|
217
|
+
if (this.cachedVisibleColumns && this.lastColumnsRef === this.columns) {
|
|
218
|
+
return this.cachedVisibleColumns;
|
|
219
|
+
}
|
|
220
|
+
this.lastColumnsRef = this.columns;
|
|
221
|
+
this.cachedVisibleColumns = this.columns.filter(col => col.visible !== false);
|
|
222
|
+
return this.cachedVisibleColumns;
|
|
71
223
|
}
|
|
72
224
|
get paginatedRows() {
|
|
73
225
|
if (!this.pagination || !this.useInternalPagination)
|
|
74
226
|
return this.innerRows;
|
|
75
227
|
const { rowsPerPage = this.rows.length } = this.pagination || {};
|
|
76
|
-
|
|
77
|
-
|
|
228
|
+
return this.innerRows.slice((this.currentPage - 1) * rowsPerPage, this.currentPage * rowsPerPage);
|
|
229
|
+
}
|
|
230
|
+
get virtualRows() {
|
|
231
|
+
const newVirtualIndexKey = `${this.virtualStartIndex}-${this.virtualEndIndex}`;
|
|
232
|
+
if (this.cachedVirtualRows && this.cachedVirtualIndexKey === newVirtualIndexKey) {
|
|
233
|
+
return this.cachedVirtualRows;
|
|
234
|
+
}
|
|
235
|
+
this.cachedVirtualIndexKey = newVirtualIndexKey;
|
|
236
|
+
if (!this.useVirtualScroll.vertical) {
|
|
237
|
+
this.cachedVirtualRows = this.paginatedRows.map((row, idx) => ({ row, actualIndex: idx }));
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
this.cachedVirtualRows = this.paginatedRows
|
|
241
|
+
.slice(this.virtualStartIndex, this.virtualEndIndex + 1)
|
|
242
|
+
.map((row, relativeIdx) => ({
|
|
243
|
+
row,
|
|
244
|
+
actualIndex: this.virtualStartIndex + relativeIdx,
|
|
245
|
+
}));
|
|
246
|
+
}
|
|
247
|
+
return this.cachedVirtualRows;
|
|
248
|
+
}
|
|
249
|
+
get topSpacerHeight() {
|
|
250
|
+
if (!this.useVirtualScroll.vertical || this.virtualStartIndex === 0)
|
|
251
|
+
return 0;
|
|
252
|
+
return this.virtualStartIndex * this.virtualRowHeight;
|
|
253
|
+
}
|
|
254
|
+
get bottomSpacerHeight() {
|
|
255
|
+
if (!this.useVirtualScroll.vertical)
|
|
256
|
+
return 0;
|
|
257
|
+
const remainingRows = this.paginatedRows.length - this.virtualEndIndex - 1;
|
|
258
|
+
return remainingRows > 0 ? remainingRows * this.virtualRowHeight : 0;
|
|
259
|
+
}
|
|
260
|
+
getHorizontalSpacerWidth(position) {
|
|
261
|
+
const stickyLeftCount = this.stickyColumn.left || 0;
|
|
262
|
+
const stickyRightCount = this.stickyColumn.right || 0;
|
|
263
|
+
const virtualColumnWidths = this.columnWidths.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
|
|
264
|
+
const remainingCols = virtualColumnWidths.length - this.virtualEndColIdx - 1;
|
|
265
|
+
if (position === 'right' && remainingCols <= 0)
|
|
266
|
+
return 0;
|
|
267
|
+
const targetIndex = position === 'left' ? [0, this.virtualStartColIdx] : [this.virtualEndColIdx + 1];
|
|
268
|
+
return virtualColumnWidths.slice(...targetIndex).reduce((sum, width) => sum + width, 0);
|
|
269
|
+
}
|
|
270
|
+
get leftSpacerWidth() {
|
|
271
|
+
if (!this.useVirtualScroll.horizontal || this.virtualStartColIdx === 0) {
|
|
272
|
+
return 0;
|
|
273
|
+
}
|
|
274
|
+
return this.getHorizontalSpacerWidth('left');
|
|
275
|
+
}
|
|
276
|
+
get rightSpacerWidth() {
|
|
277
|
+
if (!this.useVirtualScroll.horizontal) {
|
|
278
|
+
return 0;
|
|
279
|
+
}
|
|
280
|
+
return this.getHorizontalSpacerWidth('right');
|
|
281
|
+
}
|
|
282
|
+
get totalVirtualHeight() {
|
|
283
|
+
if (!this.useVirtualScroll.vertical)
|
|
284
|
+
return 0;
|
|
285
|
+
return this.paginatedRows.length * this.virtualRowHeight;
|
|
78
286
|
}
|
|
79
287
|
get lastPageNumber() {
|
|
80
288
|
const { lastPage, rowsPerPage = this.rows.length } = this.pagination || {};
|
|
@@ -96,20 +304,23 @@ export class SdTable {
|
|
|
96
304
|
.join(' ');
|
|
97
305
|
}
|
|
98
306
|
// ----- Selection -----
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
307
|
+
isRowSelected(row) {
|
|
308
|
+
return Array.from(this.innerSelected).some(r => r[this.rowKey] === row[this.rowKey]);
|
|
309
|
+
}
|
|
310
|
+
updateRowSelect(row) {
|
|
311
|
+
const selectedArray = Array.from(this.innerSelected);
|
|
312
|
+
const exists = this.isRowSelected(row);
|
|
313
|
+
const newSelected = exists
|
|
314
|
+
? selectedArray.filter(r => r[this.rowKey] !== row[this.rowKey])
|
|
315
|
+
: [...selectedArray, row];
|
|
316
|
+
// 동일 상태면 set하지 않음 → 불필요 렌더 방지
|
|
317
|
+
if (newSelected.length === selectedArray.length)
|
|
318
|
+
return;
|
|
319
|
+
this.innerSelected = new Set(newSelected);
|
|
320
|
+
this.cachedIsAllChecked = undefined;
|
|
321
|
+
this.selected = Array.from(this.innerSelected);
|
|
322
|
+
this.sdSelectChange.emit(Array.from(this.innerSelected));
|
|
323
|
+
}
|
|
113
324
|
toggleSelectAll(checked) {
|
|
114
325
|
if (checked) {
|
|
115
326
|
const pageRows = new Set([...this.paginatedRows]);
|
|
@@ -119,30 +330,153 @@ export class SdTable {
|
|
|
119
330
|
const currentPageKeys = this.paginatedRows.map(r => r[this.rowKey]);
|
|
120
331
|
this.innerSelected = new Set([...this.innerSelected].filter(r => !currentPageKeys.includes(r[this.rowKey])));
|
|
121
332
|
}
|
|
333
|
+
this.cachedIsAllChecked = undefined;
|
|
334
|
+
this.selected = Array.from(this.innerSelected);
|
|
122
335
|
this.sdSelectChange.emit(Array.from(this.innerSelected));
|
|
123
336
|
}
|
|
124
337
|
get isAllChecked() {
|
|
338
|
+
const selectionKey = `${this.paginatedRows.length}-${this.innerSelected.size}`;
|
|
339
|
+
if (this.cachedIsAllChecked !== undefined && this.lastSelectionKey === selectionKey) {
|
|
340
|
+
return this.cachedIsAllChecked;
|
|
341
|
+
}
|
|
125
342
|
const total = this.paginatedRows.length;
|
|
126
343
|
const selectedCount = this.paginatedRows.filter(row => Array.from(this.innerSelected).some(selectedRow => selectedRow[this.rowKey] === row[this.rowKey])).length;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
344
|
+
let result;
|
|
345
|
+
if (selectedCount === 0) {
|
|
346
|
+
result = false; // 아무것도 안 선택됨
|
|
347
|
+
}
|
|
348
|
+
else if (selectedCount === total) {
|
|
349
|
+
result = true; // 전부 선택됨
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
result = null; // 일부만 선택됨
|
|
353
|
+
}
|
|
354
|
+
this.cachedIsAllChecked = result;
|
|
355
|
+
this.lastSelectionKey = selectionKey;
|
|
356
|
+
return result;
|
|
357
|
+
}
|
|
358
|
+
// RAF 통합 관리
|
|
359
|
+
scheduleUpdate(type) {
|
|
360
|
+
this.pendingUpdates[type] = true;
|
|
361
|
+
if (!this.rafScheduled) {
|
|
362
|
+
this.rafScheduled = true;
|
|
363
|
+
this.scrollRequestAnimationFrame = requestAnimationFrame(() => {
|
|
364
|
+
if (this.pendingUpdates.vertical)
|
|
365
|
+
this.calculateVisibleRange();
|
|
366
|
+
if (this.pendingUpdates.horizontal)
|
|
367
|
+
this.calculateVisibleColumnRange();
|
|
368
|
+
this.pendingUpdates = { vertical: false, horizontal: false };
|
|
369
|
+
this.rafScheduled = false;
|
|
370
|
+
this.scrollRequestAnimationFrame = null;
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
// 세로 가상 스크롤 렌더링 계산
|
|
375
|
+
calculateVisibleRange() {
|
|
376
|
+
if (!this.useVirtualScroll.vertical) {
|
|
377
|
+
this.virtualStartIndex = 0;
|
|
378
|
+
this.virtualEndIndex = this.paginatedRows.length - 1;
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
const scrollTop = this.scrollTopPosition;
|
|
382
|
+
let containerHeight = this.cachedContainerHeight;
|
|
383
|
+
if (containerHeight === 0 && this.scrollContainer) {
|
|
384
|
+
containerHeight = this.scrollContainer.clientHeight;
|
|
385
|
+
this.cachedContainerHeight = containerHeight;
|
|
386
|
+
}
|
|
387
|
+
const bufferSize = this.virtualBufferSize.vertical || 5;
|
|
388
|
+
const startIndex = Math.floor(scrollTop / this.virtualRowHeight);
|
|
389
|
+
const visibleCount = Math.ceil(containerHeight / this.virtualRowHeight);
|
|
390
|
+
const endIndex = startIndex + visibleCount - 1;
|
|
391
|
+
const newStartIndex = Math.max(0, startIndex - bufferSize);
|
|
392
|
+
const newEndIndex = Math.min(this.paginatedRows.length - 1, endIndex + bufferSize);
|
|
393
|
+
// 실제로 변경된 경우에만 상태 업데이트
|
|
394
|
+
if (this.virtualStartIndex !== newStartIndex || this.virtualEndIndex !== newEndIndex) {
|
|
395
|
+
this.virtualStartIndex = newStartIndex;
|
|
396
|
+
this.virtualEndIndex = newEndIndex;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
// 가로 가상 스크롤 렌더링 계산
|
|
400
|
+
calculateVisibleColumnRange() {
|
|
401
|
+
if (!this.useVirtualScroll.horizontal) {
|
|
402
|
+
this.virtualStartColIdx = 0;
|
|
403
|
+
this.virtualEndColIdx = this.visibleColumns.length - 1;
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
const scrollLeft = this.scrollLeftPosition;
|
|
407
|
+
// 캐시된 값 사용, 없으면 측정 후 캐시
|
|
408
|
+
let containerWidth = this.cachedContainerWidth;
|
|
409
|
+
if (containerWidth === 0 && this.scrollContainer) {
|
|
410
|
+
containerWidth = this.scrollContainer.clientWidth;
|
|
411
|
+
this.cachedContainerWidth = containerWidth;
|
|
412
|
+
}
|
|
413
|
+
const stickyLeftCount = this.stickyColumn.left || 0;
|
|
414
|
+
const stickyRightCount = this.stickyColumn.right || 0;
|
|
415
|
+
// 가상 스크롤 컬럼 - sticky column 제외
|
|
416
|
+
const virtualColumns = this.visibleColumns.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
|
|
417
|
+
if (virtualColumns.length === 0) {
|
|
418
|
+
this.virtualStartColIdx = 0;
|
|
419
|
+
this.virtualEndColIdx = 0;
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
const stickyLeftWidth = this.columnWidths.slice(0, stickyLeftCount).reduce((sum, width) => sum + width, 0) +
|
|
423
|
+
(this.selectable ? 52 : 0);
|
|
424
|
+
const stickyRightWidth = this.columnWidths
|
|
425
|
+
.slice(this.visibleColumns.length - stickyRightCount)
|
|
426
|
+
.reduce((sum, width) => sum + width, 0);
|
|
427
|
+
// 가상 스크롤 영역의 너비 계산
|
|
428
|
+
const virtualScrollableWidth = containerWidth - stickyLeftWidth - stickyRightWidth;
|
|
429
|
+
const virtualColumnWidths = this.columnWidths.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
|
|
430
|
+
const virtualScrollLeft = Math.max(0, scrollLeft - stickyLeftWidth);
|
|
431
|
+
const reducedVirtualWidth = virtualColumnWidths.reduce((acc, width, idx) => {
|
|
432
|
+
acc.push((acc[idx - 1] || 0) + width);
|
|
433
|
+
return acc;
|
|
434
|
+
}, []);
|
|
435
|
+
let startIdx = 0; // 가상 스크롤 시작 인덱스
|
|
436
|
+
let endIdx = virtualColumns.length - 1; // 가상 스크롤 종료 인덱스
|
|
437
|
+
// sticky left 영역 제외한 스크롤 위치
|
|
438
|
+
for (let i = 0; i < reducedVirtualWidth.length; i++) {
|
|
439
|
+
if (reducedVirtualWidth[i] > virtualScrollLeft) {
|
|
440
|
+
startIdx = Math.max(0, i);
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
const scrollRight = virtualScrollLeft + virtualScrollableWidth;
|
|
445
|
+
for (let i = startIdx; i < reducedVirtualWidth.length; i++) {
|
|
446
|
+
if (reducedVirtualWidth[i] >= scrollRight) {
|
|
447
|
+
endIdx = Math.min(virtualColumns.length - 1, i);
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
const bufferSize = this.virtualBufferSize.horizontal || 5;
|
|
452
|
+
const newStartColIdx = Math.max(0, startIdx - bufferSize);
|
|
453
|
+
const newEndColIdx = Math.min(virtualColumns.length - 1, endIdx + bufferSize);
|
|
454
|
+
// 실제로 변경된 경우에만 상태 업데이트
|
|
455
|
+
if (this.virtualStartColIdx !== newStartColIdx || this.virtualEndColIdx !== newEndColIdx) {
|
|
456
|
+
this.virtualStartColIdx = newStartColIdx;
|
|
457
|
+
this.virtualEndColIdx = newEndColIdx;
|
|
458
|
+
}
|
|
132
459
|
}
|
|
133
460
|
// ----- Helpers -----
|
|
134
461
|
getStickyStyle(colIdx) {
|
|
462
|
+
// 캐시된 스타일이 있으면 반환
|
|
463
|
+
if (this.stickyStyleCache.has(colIdx)) {
|
|
464
|
+
return this.stickyStyleCache.get(colIdx);
|
|
465
|
+
}
|
|
135
466
|
const leftOffset = this.columnWidths.slice(0, colIdx).reduce((a, b) => a + b, 0) + (this.selectable ? 52 : 0);
|
|
136
467
|
const rightOffset = this.columnWidths
|
|
137
468
|
.filter((_, i) => i >= this.visibleColumns.length - (this.stickyColumn.right || 0) && i > colIdx)
|
|
138
469
|
.reduce((a, b) => a + b, 0);
|
|
139
|
-
|
|
470
|
+
const style = {
|
|
140
471
|
'--sticky-left-offset': `${leftOffset}px`,
|
|
141
472
|
'--sticky-right-offset': `${rightOffset}px`,
|
|
142
473
|
'width': `${this.columnWidths[colIdx]}px`,
|
|
143
474
|
'minWidth': `${this.columnWidths[colIdx]}px`,
|
|
144
475
|
'maxWidth': `${this.columnWidths[colIdx]}px`,
|
|
145
476
|
};
|
|
477
|
+
// 스타일 캐시에 저장
|
|
478
|
+
this.stickyStyleCache.set(colIdx, style);
|
|
479
|
+
return style;
|
|
146
480
|
}
|
|
147
481
|
handleResize(index, event) {
|
|
148
482
|
// SSR 환경 체크
|
|
@@ -151,7 +485,12 @@ export class SdTable {
|
|
|
151
485
|
const startX = event.clientX;
|
|
152
486
|
const startWidth = this.columnWidths[index];
|
|
153
487
|
const handleMouseMove = (moveEvent) => {
|
|
154
|
-
const
|
|
488
|
+
const targetColumn = this.columnWidths[index];
|
|
489
|
+
if (!targetColumn)
|
|
490
|
+
return;
|
|
491
|
+
const minWidth = this.columns[index]?.minWidth || 50;
|
|
492
|
+
const maxWidth = this.columns[index]?.maxWidth || 9999;
|
|
493
|
+
const newWidth = Math.min(Math.max(startWidth + moveEvent.clientX - startX, minWidth), maxWidth);
|
|
155
494
|
this.columnWidths = this.columnWidths.map((width, idx) => (idx === index ? newWidth : width));
|
|
156
495
|
};
|
|
157
496
|
const handleMouseUp = () => {
|
|
@@ -161,62 +500,152 @@ export class SdTable {
|
|
|
161
500
|
document.addEventListener('mousemove', handleMouseMove);
|
|
162
501
|
document.addEventListener('mouseup', handleMouseUp);
|
|
163
502
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
503
|
+
getCellValue(column, row) {
|
|
504
|
+
const { field, format, name } = column;
|
|
505
|
+
const value = typeof field === 'function' ? field(row) : field ? row[field] : row[name];
|
|
506
|
+
return format ? format(value, row) : value;
|
|
507
|
+
}
|
|
508
|
+
getColumnRenderedInOrder() {
|
|
509
|
+
const orderKey = `${this.visibleColumns.length}-${this.virtualStartColIdx}-${this.virtualEndColIdx}`;
|
|
510
|
+
if (this.cachedColumnOrder && this.lastColumnOrderKey === orderKey) {
|
|
511
|
+
return this.cachedColumnOrder;
|
|
512
|
+
}
|
|
513
|
+
const stickyLeftCount = this.stickyColumn.left || 0;
|
|
514
|
+
const stickyRightCount = this.stickyColumn.right || 0;
|
|
515
|
+
// Sticky left 컬럼들
|
|
516
|
+
const stickyLeftCols = this.visibleColumns.slice(0, stickyLeftCount);
|
|
517
|
+
const stickyRightCols = this.visibleColumns.slice(this.visibleColumns.length - stickyRightCount);
|
|
518
|
+
const middleCols = this.useVirtualScroll.horizontal
|
|
519
|
+
? this.visibleColumns
|
|
520
|
+
.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount)
|
|
521
|
+
.slice(this.virtualStartColIdx, this.virtualEndColIdx + 1)
|
|
522
|
+
: this.visibleColumns.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
|
|
523
|
+
this.cachedColumnOrder = {
|
|
524
|
+
stickyLeftCount,
|
|
525
|
+
stickyRightCount,
|
|
526
|
+
stickyLeftCols,
|
|
527
|
+
middleCols,
|
|
528
|
+
stickyRightCols,
|
|
529
|
+
};
|
|
530
|
+
this.lastColumnOrderKey = orderKey;
|
|
531
|
+
return this.cachedColumnOrder;
|
|
532
|
+
}
|
|
169
533
|
// ----- Render -----
|
|
170
|
-
|
|
171
|
-
|
|
534
|
+
renderHead() {
|
|
535
|
+
const { stickyLeftCount, stickyRightCount, stickyLeftCols, middleCols, stickyRightCols } = this.getColumnRenderedInOrder();
|
|
536
|
+
return (h("thead", null, h("tr", null, this.selectable && (h("th", { class: {
|
|
172
537
|
'sd-th': true,
|
|
173
538
|
'sd-th--selected': true,
|
|
174
539
|
'sticky-left': Boolean(this.stickyColumn.left && this.stickyColumn.left > 0),
|
|
175
540
|
}, style: {
|
|
176
541
|
'--sticky-left-offset': '0px',
|
|
177
|
-
} }, h("sd-checkbox", {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
542
|
+
} }, h("sd-checkbox", { value: this.isAllChecked, disabled: !this.paginatedRows.length, onSdUpdate: (e) => this.toggleSelectAll(e.detail) }))), stickyLeftCols.map((col, idx) => {
|
|
543
|
+
const rendered = this.headerCellRenderer?.(col);
|
|
544
|
+
return (h("th", { key: col.name, class: {
|
|
545
|
+
'sd-th': true,
|
|
546
|
+
[`${col.thClass}`]: Boolean(col.thClass),
|
|
547
|
+
'sticky-left': true,
|
|
548
|
+
'sticky-left-edge': idx === stickyLeftCount - 1,
|
|
549
|
+
}, 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" }, rendered ? (typeof rendered === 'string' ? (h("span", { innerHTML: rendered })) : (rendered)) : (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) }))));
|
|
550
|
+
}), this.renderSpacerTd('left', -1), middleCols.map((col, relativeIdx) => {
|
|
551
|
+
const actualColIdx = stickyLeftCount + this.virtualStartColIdx + relativeIdx;
|
|
552
|
+
const rendered = this.headerCellRenderer?.(col);
|
|
553
|
+
return (h("th", { key: col.name, class: {
|
|
554
|
+
'sd-th': true,
|
|
555
|
+
[`${col.thClass}`]: Boolean(col.thClass),
|
|
556
|
+
}, 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" }, rendered ? (typeof rendered === 'string' ? (h("span", { innerHTML: rendered })) : (rendered)) : (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) }))));
|
|
557
|
+
}), this.renderSpacerTd('right', -1), stickyRightCols.map((col, relativeIdx) => {
|
|
558
|
+
const actualColIdx = this.visibleColumns.length - stickyRightCount + relativeIdx;
|
|
559
|
+
const rendered = this.headerCellRenderer?.(col);
|
|
560
|
+
return (h("th", { key: col.name, class: {
|
|
561
|
+
'sd-th': true,
|
|
562
|
+
[`${col.thClass}`]: Boolean(col.thClass),
|
|
563
|
+
'sticky-right': true,
|
|
564
|
+
'sticky-right-edge': relativeIdx === 0,
|
|
565
|
+
}, 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" }, rendered ? (typeof rendered === 'string' ? (h("span", { innerHTML: rendered })) : (rendered)) : (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) }))));
|
|
566
|
+
}))));
|
|
567
|
+
}
|
|
568
|
+
renderBody() {
|
|
569
|
+
return (h("tbody", { ...(!this.paginatedRows.length && { part: 'tbody-empty' }), class: `sd-table-tbody ${this.useVirtualScroll.vertical ? 'sd-table-tbody--virtual-scroll' : ''}`, style: { '--total-virtual-height': `${this.totalVirtualHeight}px` } }, this.useVirtualScroll.vertical && this.topSpacerHeight > 0 && this.renderSpacerRow('top'), this.paginatedRows.length > 0 &&
|
|
570
|
+
this.virtualRows.map(({ row, actualIndex }) => this.renderRow(row, actualIndex)), this.useVirtualScroll.vertical &&
|
|
571
|
+
this.bottomSpacerHeight > 0 &&
|
|
572
|
+
this.renderSpacerRow('bottom')));
|
|
573
|
+
}
|
|
574
|
+
renderRow(row, rowIdx) {
|
|
575
|
+
const { stickyLeftCount, stickyRightCount, stickyLeftCols, middleCols, stickyRightCols } = this.getColumnRenderedInOrder();
|
|
576
|
+
return (h("tr", { key: row[this.rowKey], class: "hover:bg-Grey_Lighten-6", style: this.useVirtualScroll.vertical
|
|
577
|
+
? {
|
|
578
|
+
height: `${this.virtualRowHeight}px`,
|
|
579
|
+
}
|
|
580
|
+
: {} }, this.selectable && (h("td", { class: {
|
|
581
|
+
'sd-td': true,
|
|
582
|
+
'sd-td--selected': true,
|
|
583
|
+
'sticky-left': Boolean(this.stickyColumn.left && this.stickyColumn.left > 0),
|
|
584
|
+
}, style: {
|
|
585
|
+
'--sticky-left-offset': '0px',
|
|
586
|
+
} }, h("sd-checkbox", { value: this.isRowSelected(row), disabled: !this.paginatedRows.length, onSdUpdate: () => this.updateRowSelect(row) }))), stickyLeftCols.map((column, idx) => {
|
|
587
|
+
const rendered = this.bodyCellRenderer?.(column, row);
|
|
588
|
+
return (h("td", { key: column.name, part: `td-${column.name}`, class: {
|
|
589
|
+
'sd-td': true,
|
|
590
|
+
[`sd-td--${column.align || 'left'}`]: true,
|
|
591
|
+
'sticky-left': true,
|
|
592
|
+
'sticky-left-edge': idx === stickyLeftCount - 1,
|
|
593
|
+
[`${column.tdClass}`]: Boolean(column.tdClass),
|
|
594
|
+
}, style: this.getStickyStyle(idx) }, h("slot", { name: `body-cell-${column.name}-${rowIdx}` }, rendered ? (typeof rendered === 'string' ? (h("span", { innerHTML: rendered })) : (rendered)) : (this.getCellValue(column, row)))));
|
|
595
|
+
}), this.renderSpacerTd('left', rowIdx), middleCols.map((column, relativeIdx) => {
|
|
596
|
+
const actualColIdx = stickyLeftCount + this.virtualStartColIdx + relativeIdx;
|
|
597
|
+
const rendered = this.bodyCellRenderer?.(column, row);
|
|
598
|
+
return (h("td", { key: column.name, part: `td-${column.name}`, class: {
|
|
599
|
+
'sd-td': true,
|
|
600
|
+
[`sd-td--${column.align || 'left'}`]: true,
|
|
601
|
+
[`${column.tdClass}`]: Boolean(column.tdClass),
|
|
602
|
+
}, style: this.getStickyStyle(actualColIdx) }, h("slot", { name: `body-cell-${column.name}-${rowIdx}` }, rendered ? (typeof rendered === 'string' ? (h("span", { innerHTML: rendered })) : (rendered)) : (this.getCellValue(column, row)))));
|
|
603
|
+
}), this.renderSpacerTd('right', rowIdx), stickyRightCols.map((column, relativeIdx) => {
|
|
604
|
+
const actualColIdx = this.visibleColumns.length - stickyRightCount + relativeIdx;
|
|
605
|
+
const rendered = this.bodyCellRenderer?.(column, row);
|
|
606
|
+
return (h("td", { key: column.name, part: `td-${column.name}`, class: {
|
|
607
|
+
'sd-td': true,
|
|
608
|
+
[`sd-td--${column.align || 'left'}`]: true,
|
|
609
|
+
'sticky-right': true,
|
|
610
|
+
'sticky-right-edge': relativeIdx === 0,
|
|
611
|
+
[`${column.tdClass}`]: Boolean(column.tdClass),
|
|
612
|
+
}, style: this.getStickyStyle(actualColIdx) }, h("slot", { name: `body-cell-${column.name}-${rowIdx}` }, rendered ? (typeof rendered === 'string' ? (h("span", { innerHTML: rendered })) : (rendered)) : (this.getCellValue(column, row)))));
|
|
613
|
+
})));
|
|
614
|
+
}
|
|
615
|
+
renderSpacerRow(position) {
|
|
616
|
+
const spacerHeight = position === 'top' ? this.topSpacerHeight : this.bottomSpacerHeight;
|
|
617
|
+
return (h("tr", { key: `virtual-${position}-spacer`, class: "sd-table__virtual-row-spacer", style: {
|
|
618
|
+
height: `${spacerHeight}px`,
|
|
619
|
+
}, "aria-hidden": "true" }, h("td", { colSpan: this.visibleColumns.length + (this.selectable ? 1 : 0) }, h("div", { class: "sd-table__skeleton", style: {
|
|
620
|
+
'--row-height': `${this.virtualRowHeight}px`,
|
|
621
|
+
} }))));
|
|
622
|
+
}
|
|
623
|
+
renderSpacerTd(position, rowIdx) {
|
|
624
|
+
const spacerWidth = position === 'left' ? this.leftSpacerWidth : this.rightSpacerWidth;
|
|
625
|
+
const showSpacer = position === 'left'
|
|
626
|
+
? this.useVirtualScroll.horizontal && this.leftSpacerWidth > 0
|
|
627
|
+
: this.useVirtualScroll.horizontal && this.rightSpacerWidth > 0;
|
|
628
|
+
if (!showSpacer)
|
|
629
|
+
return null;
|
|
630
|
+
return (h("td", { key: `virtual-${position}-spacer-${rowIdx}`, class: "sd-table__virtual-spacer", style: {
|
|
631
|
+
width: `${spacerWidth}px`,
|
|
632
|
+
minWidth: `${spacerWidth}px`,
|
|
633
|
+
maxWidth: `${spacerWidth}px`,
|
|
634
|
+
padding: '0',
|
|
635
|
+
border: 'none',
|
|
636
|
+
}, "aria-hidden": "true" }, h("div", { class: "sd-table__skeleton-cell" })));
|
|
186
637
|
}
|
|
187
638
|
render() {
|
|
188
|
-
return (h(Host, { key: '
|
|
639
|
+
return (h(Host, { key: 'e6ec01e7493b69bab1bf2766d9c322cee388b274' }, h("div", { key: 'cc717d111a6ce64c34b6a23b1feb9cc8933a0438', class: "sd-table__wrapper", style: {
|
|
189
640
|
'--table-width': this.width,
|
|
190
641
|
'--table-height': this.height,
|
|
191
|
-
} }, h("div", { key: '
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
} }), this.useRowsPerPageSelect && (h("sd-select", { key: '005995ad1681f5e7dc16b0a711e87eccc2bedb01', value: this.pagination.rowsPerPage, options: this.rowsPerPageOption, width: "128px", onSdChange: (e) => {
|
|
200
|
-
const changedRowsPerPage = e.detail.value ? Number(e.detail.value) : 0;
|
|
201
|
-
if (!this.useInternalPagination) {
|
|
202
|
-
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
const newRowsPerPage = Number(e.detail.value || 0);
|
|
206
|
-
let newLastPage = Math.max(1, Math.ceil(this.innerRows.length / newRowsPerPage));
|
|
207
|
-
let newCurrentPage = this.currentPage;
|
|
208
|
-
if (newCurrentPage > newLastPage) {
|
|
209
|
-
newCurrentPage = newLastPage;
|
|
210
|
-
}
|
|
211
|
-
this.pagination = {
|
|
212
|
-
page: newCurrentPage,
|
|
213
|
-
rowsPerPage: newRowsPerPage,
|
|
214
|
-
lastPage: newLastPage,
|
|
215
|
-
};
|
|
216
|
-
this.currentPage = newCurrentPage;
|
|
217
|
-
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
218
|
-
}
|
|
219
|
-
} })))))));
|
|
642
|
+
} }, h("div", { key: '0c89a798a475bb25c10c5959b5e50c81f01503c4', class: "sd-table__container", style: {
|
|
643
|
+
'--table-container-height': `calc(${this.height} - ${this.pagination && this.innerRows.length > 0 ? 48 : 0}px)`,
|
|
644
|
+
} }, h("div", { key: 'e83ee499928d95e719ffca0411a422deeed162d0', class: {
|
|
645
|
+
'sd-table__middle': true,
|
|
646
|
+
'sd-table__middle--scrollable': this.paginatedRows.length > 0,
|
|
647
|
+
'sd-table__middle--loading': this.isLoading,
|
|
648
|
+
} }, this.isLoading && (h("div", { key: '30d8283122a21484e0029128e637fdd9a5c6ae8c', class: "sd-table__middle--loading__spinner" }, h("sd-loading-spinner", { key: '92911a08fa4d0776712e8c30be2f16d59d512cbc' }))), h("table", { key: '209eb39f61bb46e9027046be619da492be2b080e', part: "table", class: this.sdTableClasses }, this.renderHead(), this.renderBody())), !this.paginatedRows.length && (h("div", { key: 'cb1fccb96bb51a4e14d40c2ff286f17d8bc8ce11', class: "sd-table__bottom" }, h("div", { key: '9149ee50257114145d14e0666239f72dcfc5b01a', class: "sd-table__no-data" }, h("slot", { key: 'a5ead23bc5a2e32418473f6f6737f3b156177842', name: "no-data" }, this.noDataLabel))))), this.pagination && this.innerRows.length > 0 && (h("div", { key: 'd5482e1bb04d20579a88841bf8d885d08c1593b1', class: "sd-table__pagination" }, h("sd-pagination", { key: '65425eff37a1f2c1add27b8923cd86fe8d98ba98', 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", { key: 'dfb3ba8654e33dc334392f37189f422d6a1f1416', value: this.pagination.rowsPerPage, options: this.rowsPerPageOption, width: "128px", onSdUpdate: (e) => this.changeRowsPerPage(e.detail.value) })))))));
|
|
220
649
|
}
|
|
221
650
|
static get is() { return "sd-table"; }
|
|
222
651
|
static get originalStyleUrls() {
|
|
@@ -281,13 +710,9 @@ export class SdTable {
|
|
|
281
710
|
"type": "unknown",
|
|
282
711
|
"mutable": true,
|
|
283
712
|
"complexType": {
|
|
284
|
-
"original": "
|
|
285
|
-
"resolved": "
|
|
713
|
+
"original": "Row[]",
|
|
714
|
+
"resolved": "Row[]",
|
|
286
715
|
"references": {
|
|
287
|
-
"Set": {
|
|
288
|
-
"location": "global",
|
|
289
|
-
"id": "global::Set"
|
|
290
|
-
},
|
|
291
716
|
"Row": {
|
|
292
717
|
"location": "local",
|
|
293
718
|
"path": "/Users/meijing/Documents/sellmate/frontend/design-system/packages/stencil/src/components/sd-table/sd-table.tsx",
|
|
@@ -303,7 +728,7 @@ export class SdTable {
|
|
|
303
728
|
},
|
|
304
729
|
"getter": false,
|
|
305
730
|
"setter": false,
|
|
306
|
-
"defaultValue": "
|
|
731
|
+
"defaultValue": "[]"
|
|
307
732
|
},
|
|
308
733
|
"rowKey": {
|
|
309
734
|
"type": "string",
|
|
@@ -498,6 +923,33 @@ export class SdTable {
|
|
|
498
923
|
"getter": false,
|
|
499
924
|
"setter": false
|
|
500
925
|
},
|
|
926
|
+
"headerCellRenderer": {
|
|
927
|
+
"type": "unknown",
|
|
928
|
+
"mutable": false,
|
|
929
|
+
"complexType": {
|
|
930
|
+
"original": "(column: SdTableColumn) => HTMLElement | string | null | undefined",
|
|
931
|
+
"resolved": "((column: SdTableColumn) => string | HTMLElement | null | undefined) | undefined",
|
|
932
|
+
"references": {
|
|
933
|
+
"SdTableColumn": {
|
|
934
|
+
"location": "local",
|
|
935
|
+
"path": "/Users/meijing/Documents/sellmate/frontend/design-system/packages/stencil/src/components/sd-table/sd-table.tsx",
|
|
936
|
+
"id": "src/components/sd-table/sd-table.tsx::SdTableColumn"
|
|
937
|
+
},
|
|
938
|
+
"HTMLElement": {
|
|
939
|
+
"location": "global",
|
|
940
|
+
"id": "global::HTMLElement"
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
"required": false,
|
|
945
|
+
"optional": true,
|
|
946
|
+
"docs": {
|
|
947
|
+
"tags": [],
|
|
948
|
+
"text": ""
|
|
949
|
+
},
|
|
950
|
+
"getter": false,
|
|
951
|
+
"setter": false
|
|
952
|
+
},
|
|
501
953
|
"bodyCellRenderer": {
|
|
502
954
|
"type": "unknown",
|
|
503
955
|
"mutable": false,
|
|
@@ -593,6 +1045,82 @@ export class SdTable {
|
|
|
593
1045
|
"getter": false,
|
|
594
1046
|
"setter": false,
|
|
595
1047
|
"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 ]"
|
|
1048
|
+
},
|
|
1049
|
+
"useVirtualScroll": {
|
|
1050
|
+
"type": "unknown",
|
|
1051
|
+
"mutable": false,
|
|
1052
|
+
"complexType": {
|
|
1053
|
+
"original": "{ vertical?: boolean; horizontal?: boolean }",
|
|
1054
|
+
"resolved": "{ vertical?: boolean | undefined; horizontal?: boolean | undefined; }",
|
|
1055
|
+
"references": {}
|
|
1056
|
+
},
|
|
1057
|
+
"required": false,
|
|
1058
|
+
"optional": false,
|
|
1059
|
+
"docs": {
|
|
1060
|
+
"tags": [],
|
|
1061
|
+
"text": ""
|
|
1062
|
+
},
|
|
1063
|
+
"getter": false,
|
|
1064
|
+
"setter": false,
|
|
1065
|
+
"defaultValue": "{}"
|
|
1066
|
+
},
|
|
1067
|
+
"virtualRowHeight": {
|
|
1068
|
+
"type": "number",
|
|
1069
|
+
"mutable": false,
|
|
1070
|
+
"complexType": {
|
|
1071
|
+
"original": "number",
|
|
1072
|
+
"resolved": "number",
|
|
1073
|
+
"references": {}
|
|
1074
|
+
},
|
|
1075
|
+
"required": false,
|
|
1076
|
+
"optional": false,
|
|
1077
|
+
"docs": {
|
|
1078
|
+
"tags": [],
|
|
1079
|
+
"text": ""
|
|
1080
|
+
},
|
|
1081
|
+
"getter": false,
|
|
1082
|
+
"setter": false,
|
|
1083
|
+
"reflect": false,
|
|
1084
|
+
"attribute": "virtual-row-height",
|
|
1085
|
+
"defaultValue": "44"
|
|
1086
|
+
},
|
|
1087
|
+
"virtualColumnWidth": {
|
|
1088
|
+
"type": "number",
|
|
1089
|
+
"mutable": false,
|
|
1090
|
+
"complexType": {
|
|
1091
|
+
"original": "number",
|
|
1092
|
+
"resolved": "number",
|
|
1093
|
+
"references": {}
|
|
1094
|
+
},
|
|
1095
|
+
"required": false,
|
|
1096
|
+
"optional": false,
|
|
1097
|
+
"docs": {
|
|
1098
|
+
"tags": [],
|
|
1099
|
+
"text": ""
|
|
1100
|
+
},
|
|
1101
|
+
"getter": false,
|
|
1102
|
+
"setter": false,
|
|
1103
|
+
"reflect": false,
|
|
1104
|
+
"attribute": "virtual-column-width",
|
|
1105
|
+
"defaultValue": "120"
|
|
1106
|
+
},
|
|
1107
|
+
"virtualBufferSize": {
|
|
1108
|
+
"type": "unknown",
|
|
1109
|
+
"mutable": false,
|
|
1110
|
+
"complexType": {
|
|
1111
|
+
"original": "{ vertical?: number; horizontal?: number }",
|
|
1112
|
+
"resolved": "{ vertical?: number | undefined; horizontal?: number | undefined; }",
|
|
1113
|
+
"references": {}
|
|
1114
|
+
},
|
|
1115
|
+
"required": false,
|
|
1116
|
+
"optional": false,
|
|
1117
|
+
"docs": {
|
|
1118
|
+
"tags": [],
|
|
1119
|
+
"text": ""
|
|
1120
|
+
},
|
|
1121
|
+
"getter": false,
|
|
1122
|
+
"setter": false,
|
|
1123
|
+
"defaultValue": "{\n vertical: 5,\n horizontal: 5,\n }"
|
|
596
1124
|
}
|
|
597
1125
|
};
|
|
598
1126
|
}
|
|
@@ -603,7 +1131,13 @@ export class SdTable {
|
|
|
603
1131
|
"innerSelected": {},
|
|
604
1132
|
"columnWidths": {},
|
|
605
1133
|
"scrolledLeft": {},
|
|
606
|
-
"scrolledRight": {}
|
|
1134
|
+
"scrolledRight": {},
|
|
1135
|
+
"virtualStartIndex": {},
|
|
1136
|
+
"virtualEndIndex": {},
|
|
1137
|
+
"scrollTopPosition": {},
|
|
1138
|
+
"virtualStartColIdx": {},
|
|
1139
|
+
"virtualEndColIdx": {},
|
|
1140
|
+
"scrollLeftPosition": {}
|
|
607
1141
|
};
|
|
608
1142
|
}
|
|
609
1143
|
static get events() {
|
|
@@ -665,6 +1199,9 @@ export class SdTable {
|
|
|
665
1199
|
return [{
|
|
666
1200
|
"propName": "columns",
|
|
667
1201
|
"methodName": "handleColumnsChange"
|
|
1202
|
+
}, {
|
|
1203
|
+
"propName": "columnWidths",
|
|
1204
|
+
"methodName": "handleColumnWidthsChange"
|
|
668
1205
|
}, {
|
|
669
1206
|
"propName": "rows",
|
|
670
1207
|
"methodName": "handleRowsChange"
|