@sellmate/design-system 0.0.48 → 0.0.49
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/design-system.cjs.js +1 -1
- package/dist/cjs/{index-DXo1Fhkn.js → index-Bxead0A0.js} +4 -2
- package/dist/cjs/{index-DXo1Fhkn.js.map → index-Bxead0A0.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sd-badge.cjs.entry.js +2 -2
- package/dist/cjs/sd-button.sd-checkbox.sd-icon.sd-input.sd-loading-spinner.sd-pagination.sd-portal.sd-select.sd-select-option.sd-table-backup.sd-tooltip.sd-tooltip-portal.entry.cjs.js.map +1 -1
- package/dist/cjs/sd-button_12.cjs.entry.js +206 -105
- package/dist/cjs/sd-card.cjs.entry.js +2 -2
- package/dist/cjs/sd-date-box.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/sd-date-range-picker.cjs.entry.js +3 -3
- package/dist/cjs/sd-guide.cjs.entry.js +4 -4
- package/dist/cjs/sd-modal-card.cjs.entry.js +1 -1
- package/dist/cjs/sd-popover.cjs.entry.js +4 -4
- package/dist/cjs/sd-progress.cjs.entry.js +3 -3
- package/dist/cjs/sd-select-multiple-group.cjs.entry.js +1 -1
- 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-table.cjs.entry.js +1 -1
- package/dist/cjs/sd-tag.cjs.entry.js +2 -2
- package/dist/cjs/sd-tbody_3.cjs.entry.js +4 -4
- package/dist/cjs/sd-td.cjs.entry.js +3 -3
- package/dist/cjs/{tooltipArrow-DNiGFQNW.js → tooltipArrow-C7cIAuTo.js} +3 -3
- package/dist/cjs/{tooltipArrow-DNiGFQNW.js.map → tooltipArrow-C7cIAuTo.js.map} +1 -1
- package/dist/collection/components/sd-badge/sd-badge.js +1 -1
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +1 -1
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker.js +2 -2
- package/dist/collection/components/sd-guide/sd-guide.js +3 -3
- package/dist/collection/components/sd-icon/sd-icon.js +1 -1
- package/dist/collection/components/sd-input/sd-input.js +2 -2
- package/dist/collection/components/sd-loading-spinner/sd-loading-spinner.js +1 -1
- package/dist/collection/components/sd-pagination/sd-pagination.js +2 -2
- 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-select/sd-select-option/sd-select-option.js +1 -1
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +2 -2
- package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +1 -1
- package/dist/collection/components/sd-table/sd-td/sd-td.js +2 -2
- package/dist/collection/components/sd-table/sd-th/sd-th.js +1 -1
- package/dist/collection/components/sd-table/sd-tr/sd-tr.js +1 -1
- package/dist/collection/components/sd-table-backup/sd-table-backup.css +17 -15
- package/dist/collection/components/sd-table-backup/sd-table-backup.js +191 -90
- package/dist/collection/components/sd-table-backup/sd-table-backup.js.map +1 -1
- package/dist/collection/components/sd-tag/sd-tag.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +4 -4
- package/dist/collection/components/sd-tooltip-portal/sd-tooltip-portal.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-Bn_wuPsh.js → p-BAhPNR2w.js} +8 -8
- package/dist/components/{p-Bn_wuPsh.js.map → p-BAhPNR2w.js.map} +1 -1
- package/dist/components/{p-C9qV_qzP.js → p-BozMKCTh.js} +6 -6
- package/dist/components/{p-C9qV_qzP.js.map → p-BozMKCTh.js.map} +1 -1
- package/dist/components/{p-BvuTaRpn.js → p-BpNH68jy.js} +3 -3
- package/dist/components/{p-BvuTaRpn.js.map → p-BpNH68jy.js.map} +1 -1
- package/dist/components/{p-CIkSynaQ.js → p-C930Kn80.js} +4 -4
- package/dist/components/{p-CIkSynaQ.js.map → p-C930Kn80.js.map} +1 -1
- package/dist/components/{p-Cb33bhDR.js → p-CRB0WJnC.js} +4 -4
- package/dist/components/{p-Cb33bhDR.js.map → p-CRB0WJnC.js.map} +1 -1
- package/dist/components/{p-DWfls6IE.js → p-CVDnYikl.js} +11 -11
- package/dist/components/{p-DWfls6IE.js.map → p-CVDnYikl.js.map} +1 -1
- package/dist/components/{p-BBhUxTuK.js → p-CaLViLir.js} +9 -9
- package/dist/components/{p-BBhUxTuK.js.map → p-CaLViLir.js.map} +1 -1
- package/dist/components/{p-BlDZogGu.js → p-CePRmFej.js} +4 -4
- package/dist/components/{p-BlDZogGu.js.map → p-CePRmFej.js.map} +1 -1
- package/dist/components/{p-lS2AF6uZ.js → p-CxKXdl1J.js} +6 -6
- package/dist/components/{p-lS2AF6uZ.js.map → p-CxKXdl1J.js.map} +1 -1
- package/dist/components/{p-D2rvzY8X.js → p-D2YMmHfl.js} +4 -4
- package/dist/components/{p-D2rvzY8X.js.map → p-D2YMmHfl.js.map} +1 -1
- package/dist/components/{p-B6GiEilD.js → p-D2aGA3BX.js} +4 -4
- package/dist/components/{p-B6GiEilD.js.map → p-D2aGA3BX.js.map} +1 -1
- package/dist/components/{p-CMcI4ZlP.js → p-DC5fpNnQ.js} +4 -4
- package/dist/components/{p-CMcI4ZlP.js.map → p-DC5fpNnQ.js.map} +1 -1
- package/dist/components/{p-Cafw-qR4.js → p-DY6t0qQj.js} +3 -3
- package/dist/components/{p-Cafw-qR4.js.map → p-DY6t0qQj.js.map} +1 -1
- package/dist/components/{p-DsXAGqf9.js → p-Dg_O2miv.js} +4 -4
- package/dist/components/{p-DsXAGqf9.js.map → p-Dg_O2miv.js.map} +1 -1
- package/dist/components/{p-DCDoqfn8.js → p-LziGti_p.js} +4 -4
- package/dist/components/{p-DCDoqfn8.js.map → p-LziGti_p.js.map} +1 -1
- package/dist/components/{p-WhZES_rm.js → p-RZm_wGW3.js} +6 -6
- package/dist/components/{p-WhZES_rm.js.map → p-RZm_wGW3.js.map} +1 -1
- package/dist/components/{p-CbnL1UUF.js → p-TFWJruz2.js} +4 -3
- package/dist/components/p-TFWJruz2.js.map +1 -0
- package/dist/components/{p-t7JZlmXM.js → p-cOQWi_dD.js} +4 -4
- package/dist/components/{p-t7JZlmXM.js.map → p-cOQWi_dD.js.map} +1 -1
- package/dist/components/{p-wA4KCOG0.js → p-gnOKrd57.js} +3 -3
- package/dist/components/{p-wA4KCOG0.js.map → p-gnOKrd57.js.map} +1 -1
- package/dist/components/sd-badge.js +2 -2
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-card.js +2 -2
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-date-box.js +1 -1
- package/dist/components/sd-date-picker.js +6 -6
- package/dist/components/sd-date-range-picker.js +7 -7
- package/dist/components/sd-guide.js +7 -7
- 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 +3 -3
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +7 -7
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-progress.js +3 -3
- package/dist/components/sd-select-multiple-group.js +7 -7
- package/dist/components/sd-select-multiple.js +9 -9
- package/dist/components/sd-select-option-group.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-table-backup.js +203 -102
- package/dist/components/sd-table-backup.js.map +1 -1
- package/dist/components/sd-table.js +14 -14
- package/dist/components/sd-tag.js +2 -2
- package/dist/components/sd-tbody.js +1 -1
- package/dist/components/sd-td.js +3 -3
- package/dist/components/sd-th.js +1 -1
- package/dist/components/sd-tooltip-portal.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/components/sd-tr.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/{p-390283f7.entry.js → p-037de6ce.entry.js} +2 -2
- package/dist/design-system/p-0cada447.entry.js +2 -0
- package/dist/design-system/p-154958ba.entry.js +2 -0
- package/dist/design-system/{p-826c6517.entry.js → p-2285c061.entry.js} +2 -2
- package/dist/design-system/{p-d4b5575e.entry.js → p-267985b3.entry.js} +2 -2
- package/dist/design-system/p-328d7e6c.entry.js +2 -0
- package/dist/design-system/{p-8734ded6.entry.js → p-45bb29cf.entry.js} +2 -2
- package/dist/design-system/{p-871c8d66.entry.js → p-6d81e6f8.entry.js} +2 -2
- package/dist/design-system/p-6f16399e.entry.js +2 -0
- package/dist/design-system/{p-6320b9c6.entry.js.map → p-6f16399e.entry.js.map} +1 -1
- package/dist/design-system/{p-f9d01bdb.entry.js → p-74c0eee4.entry.js} +2 -2
- package/dist/design-system/{p-3574f319.entry.js → p-8d1a2a13.entry.js} +2 -2
- package/dist/design-system/p-927b3333.entry.js +2 -0
- package/dist/design-system/p-927b3333.entry.js.map +1 -0
- package/dist/design-system/p-ClyGLKUd.js +3 -0
- package/dist/design-system/{p-B2T3tS5r.js.map → p-ClyGLKUd.js.map} +1 -1
- package/dist/design-system/p-DXZjHQmQ.js +2 -0
- package/dist/design-system/{p-BE6EMCXm.js.map → p-DXZjHQmQ.js.map} +1 -1
- package/dist/design-system/{p-4386db36.entry.js → p-bea456ad.entry.js} +2 -2
- package/dist/design-system/{p-ce8fe1fd.entry.js → p-d7fe0919.entry.js} +2 -2
- package/dist/design-system/{p-0d776157.entry.js → p-dc6681a7.entry.js} +2 -2
- package/dist/design-system/p-ecb38b6a.entry.js +2 -0
- package/dist/design-system/{p-db0f705b.entry.js.map → p-ecb38b6a.entry.js.map} +1 -1
- package/dist/design-system/p-fb4d628a.entry.js +2 -0
- package/dist/design-system/sd-button.sd-checkbox.sd-icon.sd-input.sd-loading-spinner.sd-pagination.sd-portal.sd-select.sd-select-option.sd-table-backup.sd-tooltip.sd-tooltip-portal.entry.esm.js.map +1 -1
- package/dist/esm/design-system.js +2 -2
- package/dist/esm/{index-B2T3tS5r.js → index-ClyGLKUd.js} +4 -3
- package/dist/esm/{index-B2T3tS5r.js.map → index-ClyGLKUd.js.map} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sd-badge.entry.js +2 -2
- package/dist/esm/sd-button.sd-checkbox.sd-icon.sd-input.sd-loading-spinner.sd-pagination.sd-portal.sd-select.sd-select-option.sd-table-backup.sd-tooltip.sd-tooltip-portal.entry.js.map +1 -1
- package/dist/esm/sd-button_12.entry.js +206 -105
- package/dist/esm/sd-card.entry.js +2 -2
- package/dist/esm/sd-date-box.entry.js +1 -1
- package/dist/esm/sd-date-picker.entry.js +2 -2
- package/dist/esm/sd-date-range-picker.entry.js +3 -3
- package/dist/esm/sd-guide.entry.js +4 -4
- package/dist/esm/sd-modal-card.entry.js +1 -1
- package/dist/esm/sd-popover.entry.js +4 -4
- package/dist/esm/sd-progress.entry.js +3 -3
- package/dist/esm/sd-select-multiple-group.entry.js +1 -1
- 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-table.entry.js +1 -1
- package/dist/esm/sd-tag.entry.js +2 -2
- package/dist/esm/sd-tbody_3.entry.js +4 -4
- package/dist/esm/sd-td.entry.js +3 -3
- package/dist/esm/{tooltipArrow-Pa2XQhpp.js → tooltipArrow-BwO7_hdW.js} +3 -3
- package/dist/esm/{tooltipArrow-Pa2XQhpp.js.map → tooltipArrow-BwO7_hdW.js.map} +1 -1
- package/dist/types/components/sd-table-backup/sd-table-backup.d.ts +15 -0
- package/hydrate/index.js +236 -126
- package/hydrate/index.mjs +236 -126
- package/package.json +2 -2
- package/dist/components/p-CbnL1UUF.js.map +0 -1
- package/dist/design-system/p-043b7fd1.entry.js +0 -2
- package/dist/design-system/p-043b7fd1.entry.js.map +0 -1
- package/dist/design-system/p-059ca6cb.entry.js +0 -2
- package/dist/design-system/p-6320b9c6.entry.js +0 -2
- package/dist/design-system/p-7b4fe5bf.entry.js +0 -2
- package/dist/design-system/p-7e8db11c.entry.js +0 -2
- package/dist/design-system/p-B2T3tS5r.js +0 -3
- package/dist/design-system/p-BE6EMCXm.js +0 -2
- package/dist/design-system/p-d4e043c5.entry.js +0 -2
- package/dist/design-system/p-db0f705b.entry.js +0 -2
- /package/dist/design-system/{p-390283f7.entry.js.map → p-037de6ce.entry.js.map} +0 -0
- /package/dist/design-system/{p-7b4fe5bf.entry.js.map → p-0cada447.entry.js.map} +0 -0
- /package/dist/design-system/{p-059ca6cb.entry.js.map → p-154958ba.entry.js.map} +0 -0
- /package/dist/design-system/{p-826c6517.entry.js.map → p-2285c061.entry.js.map} +0 -0
- /package/dist/design-system/{p-d4b5575e.entry.js.map → p-267985b3.entry.js.map} +0 -0
- /package/dist/design-system/{p-7e8db11c.entry.js.map → p-328d7e6c.entry.js.map} +0 -0
- /package/dist/design-system/{p-8734ded6.entry.js.map → p-45bb29cf.entry.js.map} +0 -0
- /package/dist/design-system/{p-871c8d66.entry.js.map → p-6d81e6f8.entry.js.map} +0 -0
- /package/dist/design-system/{p-f9d01bdb.entry.js.map → p-74c0eee4.entry.js.map} +0 -0
- /package/dist/design-system/{p-3574f319.entry.js.map → p-8d1a2a13.entry.js.map} +0 -0
- /package/dist/design-system/{p-4386db36.entry.js.map → p-bea456ad.entry.js.map} +0 -0
- /package/dist/design-system/{p-ce8fe1fd.entry.js.map → p-d7fe0919.entry.js.map} +0 -0
- /package/dist/design-system/{p-0d776157.entry.js.map → p-dc6681a7.entry.js.map} +0 -0
- /package/dist/design-system/{p-d4e043c5.entry.js.map → p-fb4d628a.entry.js.map} +0 -0
|
@@ -113,7 +113,7 @@ export class SdPortal {
|
|
|
113
113
|
this.sdClose.emit();
|
|
114
114
|
}
|
|
115
115
|
render() {
|
|
116
|
-
return h("slot", { key: '
|
|
116
|
+
return h("slot", { key: '2f6a1908864a2b5bbe86127fbf41b6b44a599666' });
|
|
117
117
|
}
|
|
118
118
|
static get is() { return "sd-portal"; }
|
|
119
119
|
static get properties() {
|
|
@@ -13,10 +13,10 @@ export class SdProgress {
|
|
|
13
13
|
error: '#FB4444',
|
|
14
14
|
};
|
|
15
15
|
render() {
|
|
16
|
-
return (h(Host, { key: '
|
|
16
|
+
return (h(Host, { key: 'fa4a0bdd1e76231bc3ff349c5e94a18f1d747bf4', style: {
|
|
17
17
|
'--progress-color': this.statusColor[this.status],
|
|
18
18
|
'--progress-percentage': `${this.percentage}%`,
|
|
19
|
-
} }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && h("div", { key: '
|
|
19
|
+
} }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && h("div", { key: '2c356835e29ec88765f0be0efbe9ee416f1e27ea', class: "sd-progress__label" }, this.label)));
|
|
20
20
|
}
|
|
21
21
|
renderBarProgress() {
|
|
22
22
|
return (h("div", { class: `sd-progress__bar sd-progress__bar--${this.status}` }, h("div", { class: ['sd-progress__bar__percent', this.percentage < 100 ? 'proceed' : ''].join(' ') }), h("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--left" }, this.percentage, "%"), h("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--right" }, this.percentage, "%")));
|
|
@@ -24,7 +24,7 @@ export class SdSelectOption {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
render() {
|
|
27
|
-
return (h(Host, { key: '
|
|
27
|
+
return (h(Host, { key: '70eafe63e44409063337d0a43846c3be869086df' }, h("div", { key: '21cafb06d87968387f9b9ec91fdd09643cded1ca', class: {
|
|
28
28
|
'sd-select__option': true,
|
|
29
29
|
'sd-select__option--selected': this.isSelected,
|
|
30
30
|
'sd-select__option--disabled': !!this.option.disabled,
|
|
@@ -208,11 +208,11 @@ export class SdSelectMultiple extends BaseDropdownEvent {
|
|
|
208
208
|
'--select-width': this.width || '200px',
|
|
209
209
|
'--select-dropdown-height': this.dropdownHeight || '260px',
|
|
210
210
|
};
|
|
211
|
-
return (h(Host, { key: '
|
|
211
|
+
return (h(Host, { key: '71bf4aa9bb298ddd42fa2df53ffcaa75acd17811', style: style }, h("div", { key: '9f0970babd424f097b82acab1e93d4922cd5a36e', class: {
|
|
212
212
|
'sd-select-multiple': true,
|
|
213
213
|
'sd-select-multiple--open': this.isOpen,
|
|
214
214
|
'sd-select-multiple--disabled': this.disabled,
|
|
215
|
-
}, ref: el => (this.selectRef = el) }, this.renderLabel(this.label), h("div", { key: '
|
|
215
|
+
}, ref: el => (this.selectRef = el) }, this.renderLabel(this.label), h("div", { key: '57d243584fdf590139ec3436c473d54daa477e36', class: "sd-select-multiple__container" }, this.renderTrigger(), this.renderDropdown()))));
|
|
216
216
|
}
|
|
217
217
|
renderLabel(label) {
|
|
218
218
|
if (!label)
|
|
@@ -39,7 +39,7 @@ export class SdSelectOptionGroup {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
render() {
|
|
42
|
-
return (h("div", { key: '
|
|
42
|
+
return (h("div", { key: '1fb3028e6869ec0d77878dd577ad9f4f711edc38', class: {
|
|
43
43
|
'sd-select__option-group': true,
|
|
44
44
|
'sd-select__option-group--selected': !!this.isSelected,
|
|
45
45
|
'sd-select__option-group--disabled': !!this.option.disabled,
|
|
@@ -48,10 +48,10 @@ export class SdSelectOptionGroup {
|
|
|
48
48
|
'sd-select__option-group--group': this.option.type === 'group',
|
|
49
49
|
'sd-select__option-group--subgroup': this.option.type === 'subgroup',
|
|
50
50
|
'sd-select__option-group--item': this.option.type === 'item',
|
|
51
|
-
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, h("div", { key: '
|
|
51
|
+
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, h("div", { key: '5d2f2564587c376d4708921e5eb68bc1d41039ab', class: "sd-select__option-group__label-wrapper" }, this.useCheckbox && (h("sd-checkbox", { key: '0d4e839a0a091d47f0a07f8a248fbc71cf2b67a3', checked: this.isSelected, disabled: this.option.disabled, onClick: e => {
|
|
52
52
|
e.preventDefault();
|
|
53
53
|
this.handleClick(this.option, this.isSelected, e);
|
|
54
|
-
} })), h("span", { key: '
|
|
54
|
+
} })), h("span", { key: '6ff97d5a3c84e97a4712d98f04b4cf5a5fef1895', class: "sd-select__option-group-label" }, this.option.label), this.useIndicator && this.option.type !== 'item' && (h("span", { key: '861bc3ff0ac64af5482783e7412f1ec706fe90e4', class: "sd-select__option-group__count-indicator" }, `(${this.countInfo?.selectedCount}/${this.countInfo?.totalCount})`)))));
|
|
55
55
|
}
|
|
56
56
|
static get is() { return "sd-select-option-group"; }
|
|
57
57
|
static get originalStyleUrls() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class SdTbody {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: 'f981fe2f39d8d1f292f018fba5f6f28f6606fc12' }, h("slot", { key: 'ae556a0c16e782d1842fabc1cb54a495b88f1ce5' })));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "sd-tbody"; }
|
|
7
7
|
static get originalStyleUrls() {
|
|
@@ -5,11 +5,11 @@ export class SdTd {
|
|
|
5
5
|
tdStyle;
|
|
6
6
|
tdClass;
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: '3fe3f8f4ec5b068bda0edd22ebbc5c973ae75b15', role: "cell", class: {
|
|
9
9
|
'sd-td': true,
|
|
10
10
|
[`sd-td--${this.align}`]: true,
|
|
11
11
|
[this.tdClass || '']: Boolean(this.tdClass),
|
|
12
|
-
}, style: this.tdStyle }, h("slot", { key: '
|
|
12
|
+
}, style: this.tdStyle }, h("slot", { key: 'f94a99bafb7723389304e01f809b3003deda067c' })));
|
|
13
13
|
}
|
|
14
14
|
static get is() { return "sd-td"; }
|
|
15
15
|
static get originalStyleUrls() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class SdTh {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: '59aee067627e3ac7c23ea5d9f9401c19a00203bd', role: "columnheader" }, h("slot", { key: 'ea015f9ebcdccd3e08aab46af4e2a8bcb46e4a3a' })));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "sd-th"; }
|
|
7
7
|
static get originalStyleUrls() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class SdTr {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: '90de593581b21ca801462331e50126899946bf43', role: "row" }, h("slot", { key: '58eb2f9b52a36495afe40899d45bd6d1ba62b5d4' })));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "sd-tr"; }
|
|
7
7
|
static get originalStyleUrls() {
|
|
@@ -40,12 +40,27 @@
|
|
|
40
40
|
.sd-table__wrapper .sd-table__container .sd-table__middle {
|
|
41
41
|
overflow: auto;
|
|
42
42
|
will-change: scroll-position;
|
|
43
|
+
min-height: var(--table-container-height, auto);
|
|
43
44
|
}
|
|
44
45
|
.sd-table__wrapper .sd-table__container .sd-table__middle--scrollable {
|
|
45
46
|
height: var(--table-container-height, auto);
|
|
46
47
|
}
|
|
47
48
|
.sd-table__wrapper .sd-table__container .sd-table__middle--loading {
|
|
48
49
|
overflow: hidden !important;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
.sd-table__wrapper .sd-table__container .sd-table__middle--loading__spinner {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 0;
|
|
55
|
+
left: 0;
|
|
56
|
+
width: var(--table-width, 100%);
|
|
57
|
+
height: var(--table-container-height, 100%);
|
|
58
|
+
min-height: var(--table-container-height, 100%);
|
|
59
|
+
background: rgba(255, 255, 255, 0.6);
|
|
60
|
+
z-index: 200;
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
49
64
|
}
|
|
50
65
|
.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table {
|
|
51
66
|
background-color: white;
|
|
@@ -203,19 +218,6 @@
|
|
|
203
218
|
border-left: 1px solid #cccccc;
|
|
204
219
|
border-right: 1px solid #cccccc;
|
|
205
220
|
}
|
|
206
|
-
.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table tbody .sd-table__loading {
|
|
207
|
-
position: absolute;
|
|
208
|
-
top: 0;
|
|
209
|
-
left: 0;
|
|
210
|
-
width: var(--table-width, 100%);
|
|
211
|
-
height: var(--table-container-height, 100%);
|
|
212
|
-
min-height: var(--table-container-height, 100%);
|
|
213
|
-
background: rgba(255, 255, 255, 0.6);
|
|
214
|
-
z-index: 200;
|
|
215
|
-
display: flex;
|
|
216
|
-
align-items: center;
|
|
217
|
-
justify-content: center;
|
|
218
|
-
}
|
|
219
221
|
.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table tbody tr td {
|
|
220
222
|
height: 44px;
|
|
221
223
|
padding: 0 16px;
|
|
@@ -259,11 +261,11 @@
|
|
|
259
261
|
}
|
|
260
262
|
.sd-table__wrapper .sd-table__virtual-spacer,
|
|
261
263
|
.sd-table__wrapper .sd-table__virtual-row-spacer {
|
|
262
|
-
padding: 0;
|
|
264
|
+
padding: 0 !important;
|
|
263
265
|
}
|
|
264
266
|
.sd-table__wrapper .sd-table__virtual-spacer td,
|
|
265
267
|
.sd-table__wrapper .sd-table__virtual-row-spacer td {
|
|
266
|
-
padding: 0;
|
|
268
|
+
padding: 0 !important;
|
|
267
269
|
border: none;
|
|
268
270
|
}
|
|
269
271
|
.sd-table__wrapper .sd-table__virtual-spacer .sd-table__skeleton,
|
|
@@ -1,4 +1,4 @@
|
|
|
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;
|
|
@@ -50,6 +50,7 @@ export class SdTable {
|
|
|
50
50
|
virtualStartColIdx = 0;
|
|
51
51
|
virtualEndColIdx = 0;
|
|
52
52
|
scrollLeftPosition = 0;
|
|
53
|
+
// 가상 스크롤 Raf(Request Animation Frame) 관리
|
|
53
54
|
scrollRequestAnimationFrame = null;
|
|
54
55
|
scrollContainer = null;
|
|
55
56
|
rafScheduled = false;
|
|
@@ -57,19 +58,39 @@ export class SdTable {
|
|
|
57
58
|
vertical: false,
|
|
58
59
|
horizontal: false,
|
|
59
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;
|
|
60
77
|
handleColumnsChange(newCols) {
|
|
61
78
|
this.columnWidths = newCols.map(c => parseInt(c.width || '120', 10));
|
|
79
|
+
this.cleanUpVirtualCache();
|
|
80
|
+
this.stickyStyleCache.clear();
|
|
62
81
|
if (this.useVirtualScroll.horizontal) {
|
|
63
82
|
this.scheduleUpdate('horizontal');
|
|
64
83
|
}
|
|
65
84
|
}
|
|
66
85
|
handleColumnWidthsChange() {
|
|
86
|
+
this.stickyStyleCache.clear();
|
|
67
87
|
if (this.useVirtualScroll.horizontal) {
|
|
68
88
|
this.scheduleUpdate('horizontal');
|
|
69
89
|
}
|
|
70
90
|
}
|
|
71
91
|
handleRowsChange(newRows) {
|
|
72
92
|
this.innerRows = [...newRows];
|
|
93
|
+
this.cleanUpVirtualCache();
|
|
73
94
|
if (this.useVirtualScroll.vertical) {
|
|
74
95
|
this.scheduleUpdate('vertical');
|
|
75
96
|
}
|
|
@@ -77,11 +98,19 @@ export class SdTable {
|
|
|
77
98
|
handleSelectedChange(newSelected) {
|
|
78
99
|
this.innerSelected = new Set(newSelected);
|
|
79
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
|
+
}
|
|
80
109
|
handlePaginationChange(newVal) {
|
|
81
110
|
if (newVal?.page && newVal.page !== this.currentPage) {
|
|
82
111
|
this.currentPage = newVal.page;
|
|
83
112
|
if (this.useVirtualScroll.vertical && this.scrollContainer) {
|
|
84
|
-
this.scrollContainer.
|
|
113
|
+
this.scrollContainer.scrollTo({ top: 0, behavior: 'instant' });
|
|
85
114
|
this.scrollTopPosition = 0;
|
|
86
115
|
this.calculateVisibleRange();
|
|
87
116
|
}
|
|
@@ -96,66 +125,120 @@ export class SdTable {
|
|
|
96
125
|
}
|
|
97
126
|
}
|
|
98
127
|
componentDidLoad() {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
cancelAnimationFrame(this.scrollRequestAnimationFrame);
|
|
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;
|
|
116
144
|
}
|
|
117
|
-
|
|
118
|
-
if (
|
|
119
|
-
this.
|
|
120
|
-
this.calculateVisibleRange();
|
|
121
|
-
}
|
|
122
|
-
if (horizontalChanged) {
|
|
123
|
-
this.scrollLeftPosition = scrollLeft;
|
|
124
|
-
this.calculateVisibleColumnRange();
|
|
145
|
+
if (verticalChanged || horizontalChanged) {
|
|
146
|
+
if (this.scrollRequestAnimationFrame !== null) {
|
|
147
|
+
cancelAnimationFrame(this.scrollRequestAnimationFrame);
|
|
125
148
|
}
|
|
126
|
-
this.scrollRequestAnimationFrame =
|
|
127
|
-
|
|
128
|
-
|
|
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
|
+
this.onScroll();
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
changePage(page) {
|
|
174
|
+
if (!this.useInternalPagination) {
|
|
175
|
+
this.sdPageChange.emit(page);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
this.currentPage = page;
|
|
179
|
+
this.sdPageChange.emit(this.currentPage);
|
|
180
|
+
}
|
|
181
|
+
changeRowsPerPage(perPage) {
|
|
182
|
+
const changedRowsPerPage = perPage ? Number(perPage) : 0;
|
|
183
|
+
if (!this.useInternalPagination) {
|
|
184
|
+
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const newRowsPerPage = Number(perPage || 0);
|
|
188
|
+
let newLastPage = Math.max(1, Math.ceil(this.innerRows.length / newRowsPerPage));
|
|
189
|
+
let newCurrentPage = this.currentPage;
|
|
190
|
+
if (newCurrentPage > newLastPage) {
|
|
191
|
+
newCurrentPage = newLastPage;
|
|
192
|
+
}
|
|
193
|
+
this.pagination = {
|
|
194
|
+
page: newCurrentPage,
|
|
195
|
+
rowsPerPage: newRowsPerPage,
|
|
196
|
+
lastPage: newLastPage,
|
|
129
197
|
};
|
|
130
|
-
|
|
131
|
-
|
|
198
|
+
this.currentPage = newCurrentPage;
|
|
199
|
+
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
132
200
|
}
|
|
133
201
|
disconnectedCallback() {
|
|
202
|
+
if (this.scrollContainer && this.onScroll) {
|
|
203
|
+
this.scrollContainer.removeEventListener('scroll', this.onScroll);
|
|
204
|
+
}
|
|
134
205
|
if (this.scrollRequestAnimationFrame !== null) {
|
|
135
206
|
cancelAnimationFrame(this.scrollRequestAnimationFrame);
|
|
136
207
|
}
|
|
137
208
|
}
|
|
138
209
|
// ----- Derived getters -----
|
|
139
210
|
get visibleColumns() {
|
|
140
|
-
|
|
211
|
+
if (this.cachedVisibleColumns && this.lastColumnsRef === this.columns) {
|
|
212
|
+
return this.cachedVisibleColumns;
|
|
213
|
+
}
|
|
214
|
+
this.lastColumnsRef = this.columns;
|
|
215
|
+
this.cachedVisibleColumns = this.columns.filter(col => col.visible !== false);
|
|
216
|
+
return this.cachedVisibleColumns;
|
|
141
217
|
}
|
|
142
218
|
get paginatedRows() {
|
|
143
219
|
if (!this.pagination || !this.useInternalPagination)
|
|
144
220
|
return this.innerRows;
|
|
145
221
|
const { rowsPerPage = this.rows.length } = this.pagination || {};
|
|
146
|
-
|
|
147
|
-
return result;
|
|
222
|
+
return this.innerRows.slice((this.currentPage - 1) * rowsPerPage, this.currentPage * rowsPerPage);
|
|
148
223
|
}
|
|
149
224
|
get virtualRows() {
|
|
225
|
+
const newVirtualIndexKey = `${this.virtualStartIndex}-${this.virtualEndIndex}`;
|
|
226
|
+
if (this.cachedVirtualRows && this.cachedVirtualIndexKey === newVirtualIndexKey) {
|
|
227
|
+
return this.cachedVirtualRows;
|
|
228
|
+
}
|
|
229
|
+
this.cachedVirtualIndexKey = newVirtualIndexKey;
|
|
150
230
|
if (!this.useVirtualScroll.vertical) {
|
|
151
|
-
|
|
231
|
+
this.cachedVirtualRows = this.paginatedRows.map((row, idx) => ({ row, actualIndex: idx }));
|
|
152
232
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
233
|
+
else {
|
|
234
|
+
this.cachedVirtualRows = this.paginatedRows
|
|
235
|
+
.slice(this.virtualStartIndex, this.virtualEndIndex + 1)
|
|
236
|
+
.map((row, relativeIdx) => ({
|
|
237
|
+
row,
|
|
238
|
+
actualIndex: this.virtualStartIndex + relativeIdx,
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
return this.cachedVirtualRows;
|
|
159
242
|
}
|
|
160
243
|
get topSpacerHeight() {
|
|
161
244
|
if (!this.useVirtualScroll.vertical || this.virtualStartIndex === 0)
|
|
@@ -228,6 +311,7 @@ export class SdTable {
|
|
|
228
311
|
if (newSelected.length === selectedArray.length)
|
|
229
312
|
return;
|
|
230
313
|
this.innerSelected = new Set(newSelected);
|
|
314
|
+
this.cachedIsAllChecked = undefined;
|
|
231
315
|
this.sdSelectChange.emit(Array.from(this.innerSelected));
|
|
232
316
|
}
|
|
233
317
|
toggleSelectAll(checked) {
|
|
@@ -239,16 +323,29 @@ export class SdTable {
|
|
|
239
323
|
const currentPageKeys = this.paginatedRows.map(r => r[this.rowKey]);
|
|
240
324
|
this.innerSelected = new Set([...this.innerSelected].filter(r => !currentPageKeys.includes(r[this.rowKey])));
|
|
241
325
|
}
|
|
326
|
+
this.cachedIsAllChecked = undefined;
|
|
242
327
|
this.sdSelectChange.emit(Array.from(this.innerSelected));
|
|
243
328
|
}
|
|
244
329
|
get isAllChecked() {
|
|
330
|
+
const selectionKey = `${this.paginatedRows.length}-${this.innerSelected.size}`;
|
|
331
|
+
if (this.cachedIsAllChecked !== undefined && this.lastSelectionKey === selectionKey) {
|
|
332
|
+
return this.cachedIsAllChecked;
|
|
333
|
+
}
|
|
245
334
|
const total = this.paginatedRows.length;
|
|
246
335
|
const selectedCount = this.paginatedRows.filter(row => Array.from(this.innerSelected).some(selectedRow => selectedRow[this.rowKey] === row[this.rowKey])).length;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
336
|
+
let result;
|
|
337
|
+
if (selectedCount === 0) {
|
|
338
|
+
result = false; // 아무것도 안 선택됨
|
|
339
|
+
}
|
|
340
|
+
else if (selectedCount === total) {
|
|
341
|
+
result = true; // 전부 선택됨
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
result = null; // 일부만 선택됨
|
|
345
|
+
}
|
|
346
|
+
this.cachedIsAllChecked = result;
|
|
347
|
+
this.lastSelectionKey = selectionKey;
|
|
348
|
+
return result;
|
|
252
349
|
}
|
|
253
350
|
// RAF 통합 관리
|
|
254
351
|
scheduleUpdate(type) {
|
|
@@ -274,13 +371,22 @@ export class SdTable {
|
|
|
274
371
|
return;
|
|
275
372
|
}
|
|
276
373
|
const scrollTop = this.scrollTopPosition;
|
|
277
|
-
|
|
374
|
+
let containerHeight = this.cachedContainerHeight;
|
|
375
|
+
if (containerHeight === 0 && this.scrollContainer) {
|
|
376
|
+
containerHeight = this.scrollContainer.clientHeight;
|
|
377
|
+
this.cachedContainerHeight = containerHeight;
|
|
378
|
+
}
|
|
379
|
+
const bufferSize = this.virtualBufferSize.vertical || 5;
|
|
278
380
|
const startIndex = Math.floor(scrollTop / this.virtualRowHeight);
|
|
279
381
|
const visibleCount = Math.ceil(containerHeight / this.virtualRowHeight);
|
|
280
|
-
const endIndex = startIndex + visibleCount;
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
382
|
+
const endIndex = startIndex + visibleCount - 1;
|
|
383
|
+
const newStartIndex = Math.max(0, startIndex - bufferSize);
|
|
384
|
+
const newEndIndex = Math.min(this.paginatedRows.length - 1, endIndex + bufferSize);
|
|
385
|
+
// 실제로 변경된 경우에만 상태 업데이트
|
|
386
|
+
if (this.virtualStartIndex !== newStartIndex || this.virtualEndIndex !== newEndIndex) {
|
|
387
|
+
this.virtualStartIndex = newStartIndex;
|
|
388
|
+
this.virtualEndIndex = newEndIndex;
|
|
389
|
+
}
|
|
284
390
|
}
|
|
285
391
|
// 가로 가상 스크롤 렌더링 계산
|
|
286
392
|
calculateVisibleColumnRange() {
|
|
@@ -290,7 +396,12 @@ export class SdTable {
|
|
|
290
396
|
return;
|
|
291
397
|
}
|
|
292
398
|
const scrollLeft = this.scrollLeftPosition;
|
|
293
|
-
|
|
399
|
+
// 캐시된 값 사용, 없으면 측정 후 캐시
|
|
400
|
+
let containerWidth = this.cachedContainerWidth;
|
|
401
|
+
if (containerWidth === 0 && this.scrollContainer) {
|
|
402
|
+
containerWidth = this.scrollContainer.clientWidth;
|
|
403
|
+
this.cachedContainerWidth = containerWidth;
|
|
404
|
+
}
|
|
294
405
|
const stickyLeftCount = this.stickyColumn.left || 0;
|
|
295
406
|
const stickyRightCount = this.stickyColumn.right || 0;
|
|
296
407
|
// 가상 스크롤 컬럼 - sticky column 제외
|
|
@@ -330,22 +441,34 @@ export class SdTable {
|
|
|
330
441
|
}
|
|
331
442
|
}
|
|
332
443
|
const bufferSize = this.virtualBufferSize.horizontal || 5;
|
|
333
|
-
|
|
334
|
-
|
|
444
|
+
const newStartColIdx = Math.max(0, startIdx - bufferSize);
|
|
445
|
+
const newEndColIdx = Math.min(virtualColumns.length - 1, endIdx + bufferSize);
|
|
446
|
+
// 실제로 변경된 경우에만 상태 업데이트
|
|
447
|
+
if (this.virtualStartColIdx !== newStartColIdx || this.virtualEndColIdx !== newEndColIdx) {
|
|
448
|
+
this.virtualStartColIdx = newStartColIdx;
|
|
449
|
+
this.virtualEndColIdx = newEndColIdx;
|
|
450
|
+
}
|
|
335
451
|
}
|
|
336
452
|
// ----- Helpers -----
|
|
337
453
|
getStickyStyle(colIdx) {
|
|
454
|
+
// 캐시된 스타일이 있으면 반환
|
|
455
|
+
if (this.stickyStyleCache.has(colIdx)) {
|
|
456
|
+
return this.stickyStyleCache.get(colIdx);
|
|
457
|
+
}
|
|
338
458
|
const leftOffset = this.columnWidths.slice(0, colIdx).reduce((a, b) => a + b, 0) + (this.selectable ? 52 : 0);
|
|
339
459
|
const rightOffset = this.columnWidths
|
|
340
460
|
.filter((_, i) => i >= this.visibleColumns.length - (this.stickyColumn.right || 0) && i > colIdx)
|
|
341
461
|
.reduce((a, b) => a + b, 0);
|
|
342
|
-
|
|
462
|
+
const style = {
|
|
343
463
|
'--sticky-left-offset': `${leftOffset}px`,
|
|
344
464
|
'--sticky-right-offset': `${rightOffset}px`,
|
|
345
465
|
'width': `${this.columnWidths[colIdx]}px`,
|
|
346
466
|
'minWidth': `${this.columnWidths[colIdx]}px`,
|
|
347
467
|
'maxWidth': `${this.columnWidths[colIdx]}px`,
|
|
348
468
|
};
|
|
469
|
+
// 스타일 캐시에 저장
|
|
470
|
+
this.stickyStyleCache.set(colIdx, style);
|
|
471
|
+
return style;
|
|
349
472
|
}
|
|
350
473
|
handleResize(index, event) {
|
|
351
474
|
// SSR 환경 체크
|
|
@@ -375,6 +498,10 @@ export class SdTable {
|
|
|
375
498
|
return format ? format(value, row) : value;
|
|
376
499
|
}
|
|
377
500
|
getColumnRenderedInOrder() {
|
|
501
|
+
const orderKey = `${this.visibleColumns.length}-${this.virtualStartColIdx}-${this.virtualEndColIdx}`;
|
|
502
|
+
if (this.cachedColumnOrder && this.lastColumnOrderKey === orderKey) {
|
|
503
|
+
return this.cachedColumnOrder;
|
|
504
|
+
}
|
|
378
505
|
const stickyLeftCount = this.stickyColumn.left || 0;
|
|
379
506
|
const stickyRightCount = this.stickyColumn.right || 0;
|
|
380
507
|
// Sticky left 컬럼들
|
|
@@ -385,13 +512,15 @@ export class SdTable {
|
|
|
385
512
|
.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount)
|
|
386
513
|
.slice(this.virtualStartColIdx, this.virtualEndColIdx + 1)
|
|
387
514
|
: this.visibleColumns.slice(stickyLeftCount, this.visibleColumns.length - stickyRightCount);
|
|
388
|
-
|
|
515
|
+
this.cachedColumnOrder = {
|
|
389
516
|
stickyLeftCount,
|
|
390
517
|
stickyRightCount,
|
|
391
518
|
stickyLeftCols,
|
|
392
519
|
middleCols,
|
|
393
520
|
stickyRightCols,
|
|
394
521
|
};
|
|
522
|
+
this.lastColumnOrderKey = orderKey;
|
|
523
|
+
return this.cachedColumnOrder;
|
|
395
524
|
}
|
|
396
525
|
// ----- Render -----
|
|
397
526
|
renderHead() {
|
|
@@ -429,7 +558,7 @@ export class SdTable {
|
|
|
429
558
|
}))));
|
|
430
559
|
}
|
|
431
560
|
renderBody() {
|
|
432
|
-
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.
|
|
561
|
+
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 &&
|
|
433
562
|
this.virtualRows.map(({ row, actualIndex }) => this.renderRow(row, actualIndex)), this.useVirtualScroll.vertical &&
|
|
434
563
|
this.bottomSpacerHeight > 0 &&
|
|
435
564
|
this.renderSpacerRow('bottom')));
|
|
@@ -499,44 +628,16 @@ export class SdTable {
|
|
|
499
628
|
}, "aria-hidden": "true" }, h("div", { class: "sd-table__skeleton-cell" })));
|
|
500
629
|
}
|
|
501
630
|
render() {
|
|
502
|
-
return (h(Host, { key: '
|
|
631
|
+
return (h(Host, { key: '8c01d8c3b3428d0fccb37e337fd12412c7aee51a' }, h("div", { key: 'be41d64f4b9daaa1440f2a89e253ce487894758e', class: "sd-table__wrapper", style: {
|
|
503
632
|
'--table-width': this.width,
|
|
504
633
|
'--table-height': this.height,
|
|
505
|
-
} }, h("div", { key: '
|
|
634
|
+
} }, h("div", { key: '580c4ca69d5374585eeacc756561e5caf2ea6e29', class: "sd-table__container", style: {
|
|
506
635
|
'--table-container-height': `calc(${this.height} - ${this.pagination && this.innerRows.length > 0 ? 48 : 0}px)`,
|
|
507
|
-
} }, h("div", { key: '
|
|
636
|
+
} }, h("div", { key: '2832a6e9078923daeefa28512450950abfca0aad', class: {
|
|
508
637
|
'sd-table__middle': true,
|
|
509
638
|
'sd-table__middle--scrollable': this.paginatedRows.length > 0,
|
|
510
639
|
'sd-table__middle--loading': this.isLoading,
|
|
511
|
-
} }, h("table", { key: '
|
|
512
|
-
if (!this.useInternalPagination) {
|
|
513
|
-
this.sdPageChange.emit(e.detail);
|
|
514
|
-
}
|
|
515
|
-
else {
|
|
516
|
-
this.currentPage = e.detail;
|
|
517
|
-
this.sdPageChange.emit(this.currentPage);
|
|
518
|
-
}
|
|
519
|
-
} }), this.useRowsPerPageSelect && (h("sd-select", { key: '3f65639b064a27993dc62a8e4a5dc86b16aec4f8', value: this.pagination.rowsPerPage, options: this.rowsPerPageOption, width: "128px", onSdChange: (e) => {
|
|
520
|
-
const changedRowsPerPage = e.detail.value ? Number(e.detail.value) : 0;
|
|
521
|
-
if (!this.useInternalPagination) {
|
|
522
|
-
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
523
|
-
}
|
|
524
|
-
else {
|
|
525
|
-
const newRowsPerPage = Number(e.detail.value || 0);
|
|
526
|
-
let newLastPage = Math.max(1, Math.ceil(this.innerRows.length / newRowsPerPage));
|
|
527
|
-
let newCurrentPage = this.currentPage;
|
|
528
|
-
if (newCurrentPage > newLastPage) {
|
|
529
|
-
newCurrentPage = newLastPage;
|
|
530
|
-
}
|
|
531
|
-
this.pagination = {
|
|
532
|
-
page: newCurrentPage,
|
|
533
|
-
rowsPerPage: newRowsPerPage,
|
|
534
|
-
lastPage: newLastPage,
|
|
535
|
-
};
|
|
536
|
-
this.currentPage = newCurrentPage;
|
|
537
|
-
this.sdRowsPerPageChange.emit(changedRowsPerPage);
|
|
538
|
-
}
|
|
539
|
-
} })))))));
|
|
640
|
+
} }, this.isLoading && (h("div", { key: '696cc35d6d3c58dabf92aa49dbff9a7034a0ed64', class: "sd-table__middle--loading__spinner" }, h("sd-loading-spinner", { key: '8cbd272006b64c4a6e10c87c58313a0792358451' }))), h("table", { key: 'de78dba38361cfebe39f8c3cddb57a1c93861ff6', part: "table", class: this.sdTableClasses }, this.renderHead(), this.renderBody())), h("div", { key: '662407b29c2ea446d96553dd548bec11e8179185', class: "sd-table__bottom" }, !this.paginatedRows.length && (h("div", { key: '3a475142c5da9cc40f92b761923415893a1366fa', class: "sd-table__no-data" }, h("slot", { key: '49e90e85516b6656c7019b4b33a50f6b36d949a8', name: "no-data" }, this.noDataLabel))))), this.pagination && this.innerRows.length > 0 && (h("div", { key: '460a669cb3841fdc7745e4acb774729910890b42', class: "sd-table__pagination" }, h("sd-pagination", { key: '971f5e41f8df09f4455cdf41f969e5f47d2aac99', currentPage: !this.useInternalPagination ? this.pagination.page : this.currentPage, lastPage: !this.useInternalPagination ? this.pagination.lastPage : this.lastPageNumber, onPageChange: (e) => this.changePage(e.detail) }), this.useRowsPerPageSelect && (h("sd-select", { key: 'ed37b8efc95ae51bf4c903a5c7c5a068ec9bfcca', value: this.pagination.rowsPerPage, options: this.rowsPerPageOption, width: "128px", onSdChange: (e) => this.changeRowsPerPage(e.detail.value) })))))));
|
|
540
641
|
}
|
|
541
642
|
static get is() { return "sd-table-backup"; }
|
|
542
643
|
static get originalStyleUrls() {
|