@sellmate/design-system-vue 1.0.61 → 1.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components.d.ts +11 -3
- package/dist/components.js +96 -11
- package/dist/index.d.ts +5 -2
- package/dist/index.js +2 -1
- package/dist/sdModal.d.ts +2 -1
- package/dist/sdModal.js +3 -0
- package/lib/components.ts +116 -14
- package/lib/composables/useSdTableVirtualScroll.ts +84 -0
- package/lib/index.ts +4 -2
- package/lib/sdModal.ts +5 -0
- package/package.json +2 -2
- package/lib/SdTable.ts +0 -260
package/README.md
CHANGED
|
@@ -93,7 +93,7 @@ const handleClick = () => {
|
|
|
93
93
|
- `SdInput` - Input component
|
|
94
94
|
- `SdCheckbox` - Checkbox component
|
|
95
95
|
- `SdSelect` - Select dropdown component
|
|
96
|
-
- `
|
|
96
|
+
- `SdTableBackup` - Table component
|
|
97
97
|
- `SdTag` - Tag component
|
|
98
98
|
- `SdIcon` - Icon component
|
|
99
99
|
- `SdTooltip` - Tooltip component
|
package/dist/components.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const SdButtonV2: StencilVueComponent<JSX.SdButtonV2>;
|
|
|
8
8
|
export declare const SdCalendar: StencilVueComponent<JSX.SdCalendar>;
|
|
9
9
|
export declare const SdCard: StencilVueComponent<JSX.SdCard>;
|
|
10
10
|
export declare const SdCheckbox: StencilVueComponent<JSX.SdCheckbox, JSX.SdCheckbox["value"]>;
|
|
11
|
+
export declare const SdCircleProgress: StencilVueComponent<JSX.SdCircleProgress>;
|
|
11
12
|
export declare const SdConfirmModal: StencilVueComponent<JSX.SdConfirmModal>;
|
|
12
13
|
export declare const SdDateBox: StencilVueComponent<JSX.SdDateBox>;
|
|
13
14
|
export declare const SdDatePicker: StencilVueComponent<JSX.SdDatePicker, JSX.SdDatePicker["value"]>;
|
|
@@ -24,7 +25,8 @@ export declare const SdGhostButton: StencilVueComponent<JSX.SdGhostButton>;
|
|
|
24
25
|
export declare const SdGuide: StencilVueComponent<JSX.SdGuide>;
|
|
25
26
|
export declare const SdIcon: StencilVueComponent<JSX.SdIcon>;
|
|
26
27
|
export declare const SdInput: StencilVueComponent<JSX.SdInput, JSX.SdInput["value"]>;
|
|
27
|
-
export declare const
|
|
28
|
+
export declare const SdLoadingContainer: StencilVueComponent<JSX.SdLoadingContainer>;
|
|
29
|
+
export declare const SdLoadingModal: StencilVueComponent<JSX.SdLoadingModal>;
|
|
28
30
|
export declare const SdModalContainer: StencilVueComponent<JSX.SdModalContainer>;
|
|
29
31
|
export declare const SdNumberInput: StencilVueComponent<JSX.SdNumberInput, JSX.SdNumberInput["value"]>;
|
|
30
32
|
export declare const SdPagination: StencilVueComponent<JSX.SdPagination, JSX.SdPagination["currentPage"]>;
|
|
@@ -32,7 +34,7 @@ export declare const SdPopover: StencilVueComponent<JSX.SdPopover>;
|
|
|
32
34
|
export declare const SdPortal: StencilVueComponent<JSX.SdPortal>;
|
|
33
35
|
export declare const SdProgress: StencilVueComponent<JSX.SdProgress>;
|
|
34
36
|
export declare const SdRadio: StencilVueComponent<JSX.SdRadio, JSX.SdRadio["value"]>;
|
|
35
|
-
export declare const
|
|
37
|
+
export declare const SdRadioButton: StencilVueComponent<JSX.SdRadioButton, JSX.SdRadioButton["value"]>;
|
|
36
38
|
export declare const SdRadioGroup: StencilVueComponent<JSX.SdRadioGroup, JSX.SdRadioGroup["value"]>;
|
|
37
39
|
export declare const SdSelect: StencilVueComponent<JSX.SdSelect, JSX.SdSelect["value"]>;
|
|
38
40
|
export declare const SdSelectDropdown: StencilVueComponent<JSX.SdSelectDropdown>;
|
|
@@ -47,12 +49,18 @@ export declare const SdSelectV2ListItem: StencilVueComponent<JSX.SdSelectV2ListI
|
|
|
47
49
|
export declare const SdSelectV2ListItemSearch: StencilVueComponent<JSX.SdSelectV2ListItemSearch>;
|
|
48
50
|
export declare const SdSelectV2Listbox: StencilVueComponent<JSX.SdSelectV2Listbox>;
|
|
49
51
|
export declare const SdSelectV2Trigger: StencilVueComponent<JSX.SdSelectV2Trigger>;
|
|
52
|
+
export declare const SdSwitch: StencilVueComponent<JSX.SdSwitch, JSX.SdSwitch["value"]>;
|
|
53
|
+
export declare const SdTable: StencilVueComponent<JSX.SdTable, JSX.SdTable["selected"]>;
|
|
50
54
|
export declare const SdTabs: StencilVueComponent<JSX.SdTabs, JSX.SdTabs["value"]>;
|
|
51
55
|
export declare const SdTag: StencilVueComponent<JSX.SdTag>;
|
|
56
|
+
export declare const SdTbody: StencilVueComponent<JSX.SdTbody>;
|
|
57
|
+
export declare const SdTd: StencilVueComponent<JSX.SdTd>;
|
|
52
58
|
export declare const SdTextLink: StencilVueComponent<JSX.SdTextLink>;
|
|
53
59
|
export declare const SdTextarea: StencilVueComponent<JSX.SdTextarea, JSX.SdTextarea["value"]>;
|
|
60
|
+
export declare const SdThead: StencilVueComponent<JSX.SdThead>;
|
|
54
61
|
export declare const SdToast: StencilVueComponent<JSX.SdToast>;
|
|
55
62
|
export declare const SdToastContainer: StencilVueComponent<JSX.SdToastContainer>;
|
|
56
63
|
export declare const SdToggle: StencilVueComponent<JSX.SdToggle, JSX.SdToggle["value"]>;
|
|
57
|
-
export declare const SdToggleButton: StencilVueComponent<JSX.SdToggleButton, JSX.SdToggleButton["value"]>;
|
|
58
64
|
export declare const SdTooltip: StencilVueComponent<JSX.SdTooltip>;
|
|
65
|
+
export declare const SdTr: StencilVueComponent<JSX.SdTr>;
|
|
66
|
+
export declare const TableTest: StencilVueComponent<JSX.TableTest>;
|
package/dist/components.js
CHANGED
|
@@ -67,6 +67,7 @@ export const SdButtonV2 = /*@__PURE__*/ defineContainer('sd-button-v2', undefine
|
|
|
67
67
|
'name',
|
|
68
68
|
'label',
|
|
69
69
|
'icon',
|
|
70
|
+
'rightIcon',
|
|
70
71
|
'ariaLabel',
|
|
71
72
|
'disabled',
|
|
72
73
|
'type',
|
|
@@ -93,11 +94,17 @@ export const SdCheckbox = /*@__PURE__*/ defineContainer('sd-checkbox', undefined
|
|
|
93
94
|
'value',
|
|
94
95
|
'val',
|
|
95
96
|
'disabled',
|
|
97
|
+
'inverse',
|
|
96
98
|
'label',
|
|
97
99
|
'sdUpdate'
|
|
98
100
|
], [
|
|
99
101
|
'sdUpdate'
|
|
100
102
|
], 'value', 'sdUpdate', undefined);
|
|
103
|
+
export const SdCircleProgress = /*@__PURE__*/ defineContainer('sd-circle-progress', undefined, [
|
|
104
|
+
'indeterminate',
|
|
105
|
+
'value',
|
|
106
|
+
'type'
|
|
107
|
+
]);
|
|
101
108
|
export const SdConfirmModal = /*@__PURE__*/ defineContainer('sd-confirm-modal', undefined, [
|
|
102
109
|
'type',
|
|
103
110
|
'modalTitle',
|
|
@@ -231,6 +238,7 @@ export const SdField = /*@__PURE__*/ defineContainer('sd-field', undefined, [
|
|
|
231
238
|
'hint',
|
|
232
239
|
'errorMessage',
|
|
233
240
|
'width',
|
|
241
|
+
'size',
|
|
234
242
|
'label',
|
|
235
243
|
'addonLabel',
|
|
236
244
|
'icon',
|
|
@@ -350,8 +358,16 @@ export const SdInput = /*@__PURE__*/ defineContainer('sd-input', undefined, [
|
|
|
350
358
|
'sdFocus',
|
|
351
359
|
'sdBlur'
|
|
352
360
|
], 'value', 'sdUpdate', undefined);
|
|
353
|
-
export const
|
|
354
|
-
|
|
361
|
+
export const SdLoadingContainer = /*@__PURE__*/ defineContainer('sd-loading-container', undefined);
|
|
362
|
+
export const SdLoadingModal = /*@__PURE__*/ defineContainer('sd-loading-modal', undefined, [
|
|
363
|
+
'state',
|
|
364
|
+
'message',
|
|
365
|
+
'buttonLabel',
|
|
366
|
+
'width',
|
|
367
|
+
'height',
|
|
368
|
+
'sdClick'
|
|
369
|
+
], [
|
|
370
|
+
'sdClick'
|
|
355
371
|
]);
|
|
356
372
|
export const SdModalContainer = /*@__PURE__*/ defineContainer('sd-modal-container', undefined);
|
|
357
373
|
export const SdNumberInput = /*@__PURE__*/ defineContainer('sd-number-input', undefined, [
|
|
@@ -440,7 +456,7 @@ export const SdRadio = /*@__PURE__*/ defineContainer('sd-radio', undefined, [
|
|
|
440
456
|
], [
|
|
441
457
|
'sdUpdate'
|
|
442
458
|
], 'value', 'sdUpdate', undefined);
|
|
443
|
-
export const
|
|
459
|
+
export const SdRadioButton = /*@__PURE__*/ defineContainer('sd-radio-button', undefined, [
|
|
444
460
|
'value',
|
|
445
461
|
'options',
|
|
446
462
|
'size',
|
|
@@ -692,6 +708,48 @@ export const SdSelectV2Trigger = /*@__PURE__*/ defineContainer('sd-select-v2-tri
|
|
|
692
708
|
], [
|
|
693
709
|
'sdTriggerClick'
|
|
694
710
|
]);
|
|
711
|
+
export const SdSwitch = /*@__PURE__*/ defineContainer('sd-switch', undefined, [
|
|
712
|
+
'value',
|
|
713
|
+
'label',
|
|
714
|
+
'disabled',
|
|
715
|
+
'sdUpdate'
|
|
716
|
+
], [
|
|
717
|
+
'sdUpdate'
|
|
718
|
+
], 'value', 'sdUpdate', undefined);
|
|
719
|
+
export const SdTable = /*@__PURE__*/ defineContainer('sd-table', undefined, [
|
|
720
|
+
'tableId',
|
|
721
|
+
'columns',
|
|
722
|
+
'rows',
|
|
723
|
+
'selected',
|
|
724
|
+
'rowKey',
|
|
725
|
+
'selectable',
|
|
726
|
+
'resizable',
|
|
727
|
+
'width',
|
|
728
|
+
'height',
|
|
729
|
+
'stickyHeader',
|
|
730
|
+
'stickyColumn',
|
|
731
|
+
'noDataLabel',
|
|
732
|
+
'isLoading',
|
|
733
|
+
'pagination',
|
|
734
|
+
'useInternalPagination',
|
|
735
|
+
'useRowsPerPageSelect',
|
|
736
|
+
'useVirtualScroll',
|
|
737
|
+
'rowHeight',
|
|
738
|
+
'virtualBuffer',
|
|
739
|
+
'virtualEndThreshold',
|
|
740
|
+
'rowsPerPageOption',
|
|
741
|
+
'sdSelectChange',
|
|
742
|
+
'sdPageChange',
|
|
743
|
+
'sdRowsPerPageChange',
|
|
744
|
+
'sdVirtualUpdate',
|
|
745
|
+
'sdVirtualReachEnd'
|
|
746
|
+
], [
|
|
747
|
+
'sdSelectChange',
|
|
748
|
+
'sdPageChange',
|
|
749
|
+
'sdRowsPerPageChange',
|
|
750
|
+
'sdVirtualUpdate',
|
|
751
|
+
'sdVirtualReachEnd'
|
|
752
|
+
], 'selected', 'sdSelectChange', undefined);
|
|
695
753
|
export const SdTabs = /*@__PURE__*/ defineContainer('sd-tabs', undefined, [
|
|
696
754
|
'value',
|
|
697
755
|
'tabs',
|
|
@@ -707,6 +765,14 @@ export const SdTag = /*@__PURE__*/ defineContainer('sd-tag', undefined, [
|
|
|
707
765
|
'icon',
|
|
708
766
|
'isLeft'
|
|
709
767
|
]);
|
|
768
|
+
export const SdTbody = /*@__PURE__*/ defineContainer('sd-tbody', undefined, [
|
|
769
|
+
'rows'
|
|
770
|
+
]);
|
|
771
|
+
export const SdTd = /*@__PURE__*/ defineContainer('sd-td', undefined, [
|
|
772
|
+
'field',
|
|
773
|
+
'rowKey',
|
|
774
|
+
'align'
|
|
775
|
+
]);
|
|
710
776
|
export const SdTextLink = /*@__PURE__*/ defineContainer('sd-text-link', undefined, [
|
|
711
777
|
'label',
|
|
712
778
|
'icon',
|
|
@@ -751,6 +817,17 @@ export const SdTextarea = /*@__PURE__*/ defineContainer('sd-textarea', undefined
|
|
|
751
817
|
'sdFocus',
|
|
752
818
|
'sdBlur'
|
|
753
819
|
], 'value', 'sdUpdate', undefined);
|
|
820
|
+
export const SdThead = /*@__PURE__*/ defineContainer('sd-thead', undefined, [
|
|
821
|
+
'columns',
|
|
822
|
+
'selectable',
|
|
823
|
+
'resizable',
|
|
824
|
+
'stickyColumn',
|
|
825
|
+
'stickyHeader',
|
|
826
|
+
'scrolledLeft',
|
|
827
|
+
'scrolledRight',
|
|
828
|
+
'rows',
|
|
829
|
+
'columnWidths'
|
|
830
|
+
]);
|
|
754
831
|
export const SdToast = /*@__PURE__*/ defineContainer('sd-toast', undefined, [
|
|
755
832
|
'icon',
|
|
756
833
|
'message',
|
|
@@ -781,14 +858,6 @@ export const SdToggle = /*@__PURE__*/ defineContainer('sd-toggle', undefined, [
|
|
|
781
858
|
], [
|
|
782
859
|
'sdUpdate'
|
|
783
860
|
], 'value', 'sdUpdate', undefined);
|
|
784
|
-
export const SdToggleButton = /*@__PURE__*/ defineContainer('sd-toggle-button', undefined, [
|
|
785
|
-
'value',
|
|
786
|
-
'label',
|
|
787
|
-
'disabled',
|
|
788
|
-
'sdUpdate'
|
|
789
|
-
], [
|
|
790
|
-
'sdUpdate'
|
|
791
|
-
], 'value', 'sdUpdate', undefined);
|
|
792
861
|
export const SdTooltip = /*@__PURE__*/ defineContainer('sd-tooltip', undefined, [
|
|
793
862
|
'trigger',
|
|
794
863
|
'placement',
|
|
@@ -802,3 +871,19 @@ export const SdTooltip = /*@__PURE__*/ defineContainer('sd-tooltip', undefined,
|
|
|
802
871
|
'noHover',
|
|
803
872
|
'sdClass'
|
|
804
873
|
]);
|
|
874
|
+
export const SdTr = /*@__PURE__*/ defineContainer('sd-tr', undefined, [
|
|
875
|
+
'columns',
|
|
876
|
+
'selectable',
|
|
877
|
+
'stickyColumn',
|
|
878
|
+
'rowKey',
|
|
879
|
+
'row'
|
|
880
|
+
]);
|
|
881
|
+
export const TableTest = /*@__PURE__*/ defineContainer('table-test', undefined, [
|
|
882
|
+
'columns',
|
|
883
|
+
'rows',
|
|
884
|
+
'bordered',
|
|
885
|
+
'striped',
|
|
886
|
+
'tableReady'
|
|
887
|
+
], [
|
|
888
|
+
'tableReady'
|
|
889
|
+
]);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import '@sellmate/design-system/styles.css';
|
|
2
2
|
export * from './components';
|
|
3
3
|
export * from './plugin';
|
|
4
|
+
export { useSdTableVirtualScroll } from './composables/useSdTableVirtualScroll';
|
|
5
|
+
export type { VirtualRow } from './composables/useSdTableVirtualScroll';
|
|
4
6
|
export { sdModal, SdModalVuePlugin } from './sdModal';
|
|
5
|
-
export {
|
|
6
|
-
export type {
|
|
7
|
+
export { sdLoading } from '@sellmate/design-system/utils';
|
|
8
|
+
export type { SdLoadingShowOptions } from '@sellmate/design-system/utils';
|
|
9
|
+
export type { SdTableColumn, Row as SdTableRow, SelectOption, SelectOptionGroup, SelectEvents, SelectMultipleEvents, SelectStyleProps, RadioValue, RadioOption, ButtonVariant, ButtonSize, ButtonV2Name, DropdownButtonItem, DropdownButtonName, DropdownButtonSize, DropdownButtonValue, Rule, ValidatableField, SdTooltipProps, TagName, ToastType, CheckedType, Type as DateBoxType, TabOption, } from '@sellmate/design-system';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '@sellmate/design-system/styles.css';
|
|
2
2
|
export * from './components';
|
|
3
3
|
export * from './plugin';
|
|
4
|
+
export { useSdTableVirtualScroll } from './composables/useSdTableVirtualScroll';
|
|
4
5
|
export { sdModal, SdModalVuePlugin } from './sdModal';
|
|
5
|
-
export {
|
|
6
|
+
export { sdLoading } from '@sellmate/design-system/utils';
|
package/dist/sdModal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type App, type Component } from 'vue';
|
|
2
|
-
import { type ConfirmModalOptions, type ModalDialogRef, type SdModalCreateOption as CoreSdModalCreateOption, type SdModalGlobalOptions } from '@sellmate/design-system/utils';
|
|
2
|
+
import { type ConfirmModalOptions, type LoadingModalOptions, type ModalDialogRef, type SdModalCreateOption as CoreSdModalCreateOption, type SdModalGlobalOptions } from '@sellmate/design-system/utils';
|
|
3
3
|
/**
|
|
4
4
|
* Vue 플러그인. `app.use(SdModalVuePlugin)` 로 설치하면
|
|
5
5
|
* 이후 `sdModal.create({ component: MyModal, componentProps: { ... } })` 호출 시
|
|
@@ -36,6 +36,7 @@ export interface SdModalCreateOption extends Omit<CoreSdModalCreateOption, 'comp
|
|
|
36
36
|
*/
|
|
37
37
|
export declare const sdModal: {
|
|
38
38
|
confirm(options: ConfirmModalOptions): ModalDialogRef;
|
|
39
|
+
loading(options?: LoadingModalOptions): ModalDialogRef;
|
|
39
40
|
configure(options: SdModalGlobalOptions): void;
|
|
40
41
|
create(input: SdModalCreateOption): ModalDialogRef;
|
|
41
42
|
};
|
package/dist/sdModal.js
CHANGED
package/lib/components.ts
CHANGED
|
@@ -82,6 +82,7 @@ export const SdButtonV2: StencilVueComponent<JSX.SdButtonV2> = /*@__PURE__*/ def
|
|
|
82
82
|
'name',
|
|
83
83
|
'label',
|
|
84
84
|
'icon',
|
|
85
|
+
'rightIcon',
|
|
85
86
|
'ariaLabel',
|
|
86
87
|
'disabled',
|
|
87
88
|
'type',
|
|
@@ -114,6 +115,7 @@ export const SdCheckbox: StencilVueComponent<JSX.SdCheckbox, JSX.SdCheckbox["val
|
|
|
114
115
|
'value',
|
|
115
116
|
'val',
|
|
116
117
|
'disabled',
|
|
118
|
+
'inverse',
|
|
117
119
|
'label',
|
|
118
120
|
'sdUpdate'
|
|
119
121
|
], [
|
|
@@ -122,6 +124,13 @@ export const SdCheckbox: StencilVueComponent<JSX.SdCheckbox, JSX.SdCheckbox["val
|
|
|
122
124
|
'value', 'sdUpdate', undefined);
|
|
123
125
|
|
|
124
126
|
|
|
127
|
+
export const SdCircleProgress: StencilVueComponent<JSX.SdCircleProgress> = /*@__PURE__*/ defineContainer<JSX.SdCircleProgress>('sd-circle-progress', undefined, [
|
|
128
|
+
'indeterminate',
|
|
129
|
+
'value',
|
|
130
|
+
'type'
|
|
131
|
+
]);
|
|
132
|
+
|
|
133
|
+
|
|
125
134
|
export const SdConfirmModal: StencilVueComponent<JSX.SdConfirmModal> = /*@__PURE__*/ defineContainer<JSX.SdConfirmModal>('sd-confirm-modal', undefined, [
|
|
126
135
|
'type',
|
|
127
136
|
'modalTitle',
|
|
@@ -273,6 +282,7 @@ export const SdField: StencilVueComponent<JSX.SdField> = /*@__PURE__*/ defineCon
|
|
|
273
282
|
'hint',
|
|
274
283
|
'errorMessage',
|
|
275
284
|
'width',
|
|
285
|
+
'size',
|
|
276
286
|
'label',
|
|
277
287
|
'addonLabel',
|
|
278
288
|
'icon',
|
|
@@ -410,8 +420,18 @@ export const SdInput: StencilVueComponent<JSX.SdInput, JSX.SdInput["value"]> = /
|
|
|
410
420
|
'value', 'sdUpdate', undefined);
|
|
411
421
|
|
|
412
422
|
|
|
413
|
-
export const
|
|
414
|
-
|
|
423
|
+
export const SdLoadingContainer: StencilVueComponent<JSX.SdLoadingContainer> = /*@__PURE__*/ defineContainer<JSX.SdLoadingContainer>('sd-loading-container', undefined);
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
export const SdLoadingModal: StencilVueComponent<JSX.SdLoadingModal> = /*@__PURE__*/ defineContainer<JSX.SdLoadingModal>('sd-loading-modal', undefined, [
|
|
427
|
+
'state',
|
|
428
|
+
'message',
|
|
429
|
+
'buttonLabel',
|
|
430
|
+
'width',
|
|
431
|
+
'height',
|
|
432
|
+
'sdClick'
|
|
433
|
+
], [
|
|
434
|
+
'sdClick'
|
|
415
435
|
]);
|
|
416
436
|
|
|
417
437
|
|
|
@@ -519,7 +539,7 @@ export const SdRadio: StencilVueComponent<JSX.SdRadio, JSX.SdRadio["value"]> = /
|
|
|
519
539
|
'value', 'sdUpdate', undefined);
|
|
520
540
|
|
|
521
541
|
|
|
522
|
-
export const
|
|
542
|
+
export const SdRadioButton: StencilVueComponent<JSX.SdRadioButton, JSX.SdRadioButton["value"]> = /*@__PURE__*/ defineContainer<JSX.SdRadioButton, JSX.SdRadioButton["value"]>('sd-radio-button', undefined, [
|
|
523
543
|
'value',
|
|
524
544
|
'options',
|
|
525
545
|
'size',
|
|
@@ -807,6 +827,54 @@ export const SdSelectV2Trigger: StencilVueComponent<JSX.SdSelectV2Trigger> = /*@
|
|
|
807
827
|
]);
|
|
808
828
|
|
|
809
829
|
|
|
830
|
+
export const SdSwitch: StencilVueComponent<JSX.SdSwitch, JSX.SdSwitch["value"]> = /*@__PURE__*/ defineContainer<JSX.SdSwitch, JSX.SdSwitch["value"]>('sd-switch', undefined, [
|
|
831
|
+
'value',
|
|
832
|
+
'label',
|
|
833
|
+
'disabled',
|
|
834
|
+
'sdUpdate'
|
|
835
|
+
], [
|
|
836
|
+
'sdUpdate'
|
|
837
|
+
],
|
|
838
|
+
'value', 'sdUpdate', undefined);
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
export const SdTable: StencilVueComponent<JSX.SdTable, JSX.SdTable["selected"]> = /*@__PURE__*/ defineContainer<JSX.SdTable, JSX.SdTable["selected"]>('sd-table', undefined, [
|
|
842
|
+
'tableId',
|
|
843
|
+
'columns',
|
|
844
|
+
'rows',
|
|
845
|
+
'selected',
|
|
846
|
+
'rowKey',
|
|
847
|
+
'selectable',
|
|
848
|
+
'resizable',
|
|
849
|
+
'width',
|
|
850
|
+
'height',
|
|
851
|
+
'stickyHeader',
|
|
852
|
+
'stickyColumn',
|
|
853
|
+
'noDataLabel',
|
|
854
|
+
'isLoading',
|
|
855
|
+
'pagination',
|
|
856
|
+
'useInternalPagination',
|
|
857
|
+
'useRowsPerPageSelect',
|
|
858
|
+
'useVirtualScroll',
|
|
859
|
+
'rowHeight',
|
|
860
|
+
'virtualBuffer',
|
|
861
|
+
'virtualEndThreshold',
|
|
862
|
+
'rowsPerPageOption',
|
|
863
|
+
'sdSelectChange',
|
|
864
|
+
'sdPageChange',
|
|
865
|
+
'sdRowsPerPageChange',
|
|
866
|
+
'sdVirtualUpdate',
|
|
867
|
+
'sdVirtualReachEnd'
|
|
868
|
+
], [
|
|
869
|
+
'sdSelectChange',
|
|
870
|
+
'sdPageChange',
|
|
871
|
+
'sdRowsPerPageChange',
|
|
872
|
+
'sdVirtualUpdate',
|
|
873
|
+
'sdVirtualReachEnd'
|
|
874
|
+
],
|
|
875
|
+
'selected', 'sdSelectChange', undefined);
|
|
876
|
+
|
|
877
|
+
|
|
810
878
|
export const SdTabs: StencilVueComponent<JSX.SdTabs, JSX.SdTabs["value"]> = /*@__PURE__*/ defineContainer<JSX.SdTabs, JSX.SdTabs["value"]>('sd-tabs', undefined, [
|
|
811
879
|
'value',
|
|
812
880
|
'tabs',
|
|
@@ -827,6 +895,18 @@ export const SdTag: StencilVueComponent<JSX.SdTag> = /*@__PURE__*/ defineContain
|
|
|
827
895
|
]);
|
|
828
896
|
|
|
829
897
|
|
|
898
|
+
export const SdTbody: StencilVueComponent<JSX.SdTbody> = /*@__PURE__*/ defineContainer<JSX.SdTbody>('sd-tbody', undefined, [
|
|
899
|
+
'rows'
|
|
900
|
+
]);
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
export const SdTd: StencilVueComponent<JSX.SdTd> = /*@__PURE__*/ defineContainer<JSX.SdTd>('sd-td', undefined, [
|
|
904
|
+
'field',
|
|
905
|
+
'rowKey',
|
|
906
|
+
'align'
|
|
907
|
+
]);
|
|
908
|
+
|
|
909
|
+
|
|
830
910
|
export const SdTextLink: StencilVueComponent<JSX.SdTextLink> = /*@__PURE__*/ defineContainer<JSX.SdTextLink>('sd-text-link', undefined, [
|
|
831
911
|
'label',
|
|
832
912
|
'icon',
|
|
@@ -876,6 +956,19 @@ export const SdTextarea: StencilVueComponent<JSX.SdTextarea, JSX.SdTextarea["val
|
|
|
876
956
|
'value', 'sdUpdate', undefined);
|
|
877
957
|
|
|
878
958
|
|
|
959
|
+
export const SdThead: StencilVueComponent<JSX.SdThead> = /*@__PURE__*/ defineContainer<JSX.SdThead>('sd-thead', undefined, [
|
|
960
|
+
'columns',
|
|
961
|
+
'selectable',
|
|
962
|
+
'resizable',
|
|
963
|
+
'stickyColumn',
|
|
964
|
+
'stickyHeader',
|
|
965
|
+
'scrolledLeft',
|
|
966
|
+
'scrolledRight',
|
|
967
|
+
'rows',
|
|
968
|
+
'columnWidths'
|
|
969
|
+
]);
|
|
970
|
+
|
|
971
|
+
|
|
879
972
|
export const SdToast: StencilVueComponent<JSX.SdToast> = /*@__PURE__*/ defineContainer<JSX.SdToast>('sd-toast', undefined, [
|
|
880
973
|
'icon',
|
|
881
974
|
'message',
|
|
@@ -913,17 +1006,6 @@ export const SdToggle: StencilVueComponent<JSX.SdToggle, JSX.SdToggle["value"]>
|
|
|
913
1006
|
'value', 'sdUpdate', undefined);
|
|
914
1007
|
|
|
915
1008
|
|
|
916
|
-
export const SdToggleButton: StencilVueComponent<JSX.SdToggleButton, JSX.SdToggleButton["value"]> = /*@__PURE__*/ defineContainer<JSX.SdToggleButton, JSX.SdToggleButton["value"]>('sd-toggle-button', undefined, [
|
|
917
|
-
'value',
|
|
918
|
-
'label',
|
|
919
|
-
'disabled',
|
|
920
|
-
'sdUpdate'
|
|
921
|
-
], [
|
|
922
|
-
'sdUpdate'
|
|
923
|
-
],
|
|
924
|
-
'value', 'sdUpdate', undefined);
|
|
925
|
-
|
|
926
|
-
|
|
927
1009
|
export const SdTooltip: StencilVueComponent<JSX.SdTooltip> = /*@__PURE__*/ defineContainer<JSX.SdTooltip>('sd-tooltip', undefined, [
|
|
928
1010
|
'trigger',
|
|
929
1011
|
'placement',
|
|
@@ -938,3 +1020,23 @@ export const SdTooltip: StencilVueComponent<JSX.SdTooltip> = /*@__PURE__*/ defin
|
|
|
938
1020
|
'sdClass'
|
|
939
1021
|
]);
|
|
940
1022
|
|
|
1023
|
+
|
|
1024
|
+
export const SdTr: StencilVueComponent<JSX.SdTr> = /*@__PURE__*/ defineContainer<JSX.SdTr>('sd-tr', undefined, [
|
|
1025
|
+
'columns',
|
|
1026
|
+
'selectable',
|
|
1027
|
+
'stickyColumn',
|
|
1028
|
+
'rowKey',
|
|
1029
|
+
'row'
|
|
1030
|
+
]);
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
export const TableTest: StencilVueComponent<JSX.TableTest> = /*@__PURE__*/ defineContainer<JSX.TableTest>('table-test', undefined, [
|
|
1034
|
+
'columns',
|
|
1035
|
+
'rows',
|
|
1036
|
+
'bordered',
|
|
1037
|
+
'striped',
|
|
1038
|
+
'tableReady'
|
|
1039
|
+
], [
|
|
1040
|
+
'tableReady'
|
|
1041
|
+
]);
|
|
1042
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ref, computed, onMounted, onUnmounted, type Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface VirtualRow<T = Record<string, any>> {
|
|
4
|
+
/** 전체 rows 기준 절대 인덱스 — sd-tr의 rowKey로 사용 */
|
|
5
|
+
index: number;
|
|
6
|
+
row: T;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface SdVirtualUpdateDetail {
|
|
10
|
+
from: number;
|
|
11
|
+
to: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function useSdTableVirtualScroll<T extends Record<string, any>>(
|
|
15
|
+
tableRef: Ref<any>,
|
|
16
|
+
rows: Ref<T[]>,
|
|
17
|
+
) {
|
|
18
|
+
const range = ref<{ from: number; to: number } | null>(null);
|
|
19
|
+
|
|
20
|
+
let targetEl: HTMLElement | null = null;
|
|
21
|
+
let rafId = 0;
|
|
22
|
+
|
|
23
|
+
const onVirtualUpdate = (e: Event) => {
|
|
24
|
+
const { from, to } = (e as CustomEvent<SdVirtualUpdateDetail>).detail;
|
|
25
|
+
range.value = { from, to };
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const syncRange = (el: HTMLElement): boolean => {
|
|
29
|
+
const currentRange = (el as any).getVirtualScrollRangeSync?.();
|
|
30
|
+
if (
|
|
31
|
+
currentRange &&
|
|
32
|
+
typeof currentRange.from === 'number' &&
|
|
33
|
+
typeof currentRange.to === 'number'
|
|
34
|
+
) {
|
|
35
|
+
range.value = { from: currentRange.from, to: currentRange.to };
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const attachWhenReady = () => {
|
|
42
|
+
// Stencil Vue 래퍼는 expose()를 사용하지 않으므로 $el로 실제 custom element에 접근
|
|
43
|
+
const raw = (tableRef.value as any)?.$el ?? tableRef.value;
|
|
44
|
+
const el: HTMLElement | null = raw instanceof HTMLElement ? raw : null;
|
|
45
|
+
if (!el) {
|
|
46
|
+
rafId = requestAnimationFrame(attachWhenReady);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
targetEl = el;
|
|
51
|
+
targetEl.addEventListener('sdVirtualUpdate', onVirtualUpdate);
|
|
52
|
+
|
|
53
|
+
const trySync = () => {
|
|
54
|
+
if (!targetEl) return;
|
|
55
|
+
if (!syncRange(targetEl)) {
|
|
56
|
+
rafId = requestAnimationFrame(trySync);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
trySync();
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
onMounted(() => {
|
|
64
|
+
attachWhenReady();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
onUnmounted(() => {
|
|
68
|
+
cancelAnimationFrame(rafId);
|
|
69
|
+
targetEl?.removeEventListener('sdVirtualUpdate', onVirtualUpdate);
|
|
70
|
+
targetEl = null;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const virtualRows = computed<VirtualRow<T>[]>(() => {
|
|
74
|
+
if (!range.value) return [];
|
|
75
|
+
const { from, to } = range.value;
|
|
76
|
+
return rows.value.slice(from, to).map((row, i) => ({ index: from + i, row }));
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
virtualRows,
|
|
81
|
+
from: computed(() => range.value?.from ?? 0),
|
|
82
|
+
to: computed(() => range.value?.to ?? 0),
|
|
83
|
+
};
|
|
84
|
+
}
|
package/lib/index.ts
CHANGED
|
@@ -2,13 +2,15 @@ import '@sellmate/design-system/styles.css';
|
|
|
2
2
|
|
|
3
3
|
export * from './components';
|
|
4
4
|
export * from './plugin';
|
|
5
|
+
export { useSdTableVirtualScroll } from './composables/useSdTableVirtualScroll';
|
|
6
|
+
export type { VirtualRow } from './composables/useSdTableVirtualScroll';
|
|
5
7
|
export { sdModal, SdModalVuePlugin } from './sdModal';
|
|
6
|
-
export {
|
|
8
|
+
export { sdLoading } from '@sellmate/design-system/utils';
|
|
9
|
+
export type { SdLoadingShowOptions } from '@sellmate/design-system/utils';
|
|
7
10
|
|
|
8
11
|
// Export commonly used types for Vue usage
|
|
9
12
|
export type {
|
|
10
13
|
// Table types
|
|
11
|
-
SdTableSortDir,
|
|
12
14
|
SdTableColumn,
|
|
13
15
|
Row as SdTableRow,
|
|
14
16
|
// Select types
|
package/lib/sdModal.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
_createSdModalRef,
|
|
11
11
|
_attachSdModalWithRef,
|
|
12
12
|
type ConfirmModalOptions,
|
|
13
|
+
type LoadingModalOptions,
|
|
13
14
|
type ModalDialogRef,
|
|
14
15
|
type SdModalCreateOption as CoreSdModalCreateOption,
|
|
15
16
|
type SdModalGlobalOptions,
|
|
@@ -92,6 +93,10 @@ export const sdModal = {
|
|
|
92
93
|
return coreSdModal.confirm(options);
|
|
93
94
|
},
|
|
94
95
|
|
|
96
|
+
loading(options: LoadingModalOptions = {}): ModalDialogRef {
|
|
97
|
+
return coreSdModal.loading(options);
|
|
98
|
+
},
|
|
99
|
+
|
|
95
100
|
configure(options: SdModalGlobalOptions): void {
|
|
96
101
|
coreSdModal.configure(options);
|
|
97
102
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellmate/design-system-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.63",
|
|
4
4
|
"description": "Design System - Vue Component Wrappers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vue": "^3.4.38"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@sellmate/design-system": "^1.0.
|
|
48
|
+
"@sellmate/design-system": "^1.0.63",
|
|
49
49
|
"@stencil/vue-output-target": "^0.11.8"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
package/lib/SdTable.ts
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
defineComponent,
|
|
4
|
-
h,
|
|
5
|
-
ref,
|
|
6
|
-
useAttrs,
|
|
7
|
-
useSlots,
|
|
8
|
-
watch,
|
|
9
|
-
type PropType,
|
|
10
|
-
} from 'vue';
|
|
11
|
-
import type { Row as SdTableRow, SdTableColumn, SelectOption } from '@sellmate/design-system';
|
|
12
|
-
|
|
13
|
-
type TablePagination = {
|
|
14
|
-
page: number;
|
|
15
|
-
rowsPerPage: number;
|
|
16
|
-
lastPage?: number;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type TableVirtualScroll = {
|
|
20
|
-
vertical?: boolean;
|
|
21
|
-
horizontal?: boolean;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
type TableVirtualBufferSize = {
|
|
25
|
-
vertical?: number;
|
|
26
|
-
horizontal?: number;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const SLOT_WRAPPER_STYLE = {
|
|
30
|
-
display: 'contents',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const getCellValue = (column: SdTableColumn, row: SdTableRow) => {
|
|
34
|
-
const { field, format, name } = column;
|
|
35
|
-
const value = typeof field === 'function' ? field(row) : field ? row[field] : row[name];
|
|
36
|
-
return format ? format(value, row) : value;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default defineComponent({
|
|
40
|
-
name: 'SdTable',
|
|
41
|
-
inheritAttrs: false,
|
|
42
|
-
props: {
|
|
43
|
-
columns: {
|
|
44
|
-
type: Array as PropType<SdTableColumn[]>,
|
|
45
|
-
required: true,
|
|
46
|
-
},
|
|
47
|
-
rows: {
|
|
48
|
-
type: Array as PropType<SdTableRow[]>,
|
|
49
|
-
required: true,
|
|
50
|
-
},
|
|
51
|
-
modelValue: {
|
|
52
|
-
type: Array as PropType<SdTableRow[]>,
|
|
53
|
-
default: undefined,
|
|
54
|
-
},
|
|
55
|
-
selected: {
|
|
56
|
-
type: Array as PropType<SdTableRow[]>,
|
|
57
|
-
default: undefined,
|
|
58
|
-
},
|
|
59
|
-
rowKey: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: 'id',
|
|
62
|
-
},
|
|
63
|
-
selectable: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: false,
|
|
66
|
-
},
|
|
67
|
-
resizable: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: false,
|
|
70
|
-
},
|
|
71
|
-
width: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: undefined,
|
|
74
|
-
},
|
|
75
|
-
height: {
|
|
76
|
-
type: String,
|
|
77
|
-
default: undefined,
|
|
78
|
-
},
|
|
79
|
-
stickyHeader: {
|
|
80
|
-
type: Boolean,
|
|
81
|
-
default: false,
|
|
82
|
-
},
|
|
83
|
-
stickyColumn: {
|
|
84
|
-
type: Object as PropType<{ left?: number; right?: number }>,
|
|
85
|
-
default: () => ({ left: 0, right: 0 }),
|
|
86
|
-
},
|
|
87
|
-
noDataLabel: {
|
|
88
|
-
type: String,
|
|
89
|
-
default: '데이터가 없습니다.',
|
|
90
|
-
},
|
|
91
|
-
isLoading: {
|
|
92
|
-
type: Boolean,
|
|
93
|
-
default: false,
|
|
94
|
-
},
|
|
95
|
-
pagination: {
|
|
96
|
-
type: Object as PropType<TablePagination | undefined>,
|
|
97
|
-
default: undefined,
|
|
98
|
-
},
|
|
99
|
-
useInternalPagination: {
|
|
100
|
-
type: Boolean,
|
|
101
|
-
default: false,
|
|
102
|
-
},
|
|
103
|
-
useRowsPerPageSelect: {
|
|
104
|
-
type: Boolean,
|
|
105
|
-
default: false,
|
|
106
|
-
},
|
|
107
|
-
rowsPerPageOption: {
|
|
108
|
-
type: Array as PropType<SelectOption[]>,
|
|
109
|
-
default: () => [
|
|
110
|
-
{ label: '10개씩 보기', value: 10 },
|
|
111
|
-
{ label: '25개씩 보기', value: 25 },
|
|
112
|
-
{ label: '50개씩 보기', value: 50 },
|
|
113
|
-
{ label: '100개씩 보기', value: 100 },
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
useVirtualScroll: {
|
|
117
|
-
type: Object as PropType<TableVirtualScroll>,
|
|
118
|
-
default: () => ({}),
|
|
119
|
-
},
|
|
120
|
-
virtualRowHeight: {
|
|
121
|
-
type: Number,
|
|
122
|
-
default: 44,
|
|
123
|
-
},
|
|
124
|
-
virtualColumnWidth: {
|
|
125
|
-
type: Number,
|
|
126
|
-
default: 120,
|
|
127
|
-
},
|
|
128
|
-
virtualBufferSize: {
|
|
129
|
-
type: Object as PropType<TableVirtualBufferSize>,
|
|
130
|
-
default: () => ({
|
|
131
|
-
vertical: 5,
|
|
132
|
-
horizontal: 5,
|
|
133
|
-
}),
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
emits: ['update:modelValue', 'sdSelectChange', 'sdPageChange', 'sdRowsPerPageChange'],
|
|
137
|
-
setup(props, { emit }) {
|
|
138
|
-
const attrs = useAttrs();
|
|
139
|
-
const slots = useSlots();
|
|
140
|
-
const normalizedRows = computed(() => props.rows ?? []);
|
|
141
|
-
const currentPage = ref(props.pagination?.page || 1);
|
|
142
|
-
const currentRowsPerPage = ref(props.pagination?.rowsPerPage || normalizedRows.value.length || 0);
|
|
143
|
-
|
|
144
|
-
watch(
|
|
145
|
-
() => props.pagination,
|
|
146
|
-
pagination => {
|
|
147
|
-
currentPage.value = pagination?.page || 1;
|
|
148
|
-
currentRowsPerPage.value = pagination?.rowsPerPage || normalizedRows.value.length || 0;
|
|
149
|
-
},
|
|
150
|
-
{ immediate: true, deep: true },
|
|
151
|
-
);
|
|
152
|
-
|
|
153
|
-
watch(
|
|
154
|
-
() => normalizedRows.value.length,
|
|
155
|
-
rowLength => {
|
|
156
|
-
if (!currentRowsPerPage.value) {
|
|
157
|
-
currentRowsPerPage.value = rowLength;
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
const renderedRows = computed(() => {
|
|
163
|
-
if (!props.useInternalPagination || !currentRowsPerPage.value) {
|
|
164
|
-
return normalizedRows.value;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const startIndex = (currentPage.value - 1) * currentRowsPerPage.value;
|
|
168
|
-
return normalizedRows.value.slice(startIndex, startIndex + currentRowsPerPage.value);
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
return () => {
|
|
172
|
-
const slotChildren = [];
|
|
173
|
-
|
|
174
|
-
const noDataSlot = slots['no-data'];
|
|
175
|
-
if (noDataSlot) {
|
|
176
|
-
slotChildren.push(
|
|
177
|
-
h(
|
|
178
|
-
'span',
|
|
179
|
-
{
|
|
180
|
-
key: 'no-data',
|
|
181
|
-
slot: 'no-data',
|
|
182
|
-
style: SLOT_WRAPPER_STYLE,
|
|
183
|
-
},
|
|
184
|
-
noDataSlot(),
|
|
185
|
-
),
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
props.columns.forEach(column => {
|
|
190
|
-
const headerSlot = slots[`header-${column.name}`] || slots.header;
|
|
191
|
-
|
|
192
|
-
if (headerSlot) {
|
|
193
|
-
slotChildren.push(
|
|
194
|
-
h(
|
|
195
|
-
'span',
|
|
196
|
-
{
|
|
197
|
-
key: `header-${column.name}`,
|
|
198
|
-
slot: `header-cell-${column.name}`,
|
|
199
|
-
style: SLOT_WRAPPER_STYLE,
|
|
200
|
-
},
|
|
201
|
-
headerSlot({ column }),
|
|
202
|
-
),
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
renderedRows.value.forEach((row, rowIndex) => {
|
|
208
|
-
props.columns.forEach(column => {
|
|
209
|
-
const cellSlot = slots[`cell-${column.name}`] || slots.cell;
|
|
210
|
-
|
|
211
|
-
if (!cellSlot) return;
|
|
212
|
-
|
|
213
|
-
slotChildren.push(
|
|
214
|
-
h(
|
|
215
|
-
'span',
|
|
216
|
-
{
|
|
217
|
-
key: `cell-${column.name}-${rowIndex}`,
|
|
218
|
-
slot: `body-cell-${column.name}-${rowIndex}`,
|
|
219
|
-
style: SLOT_WRAPPER_STYLE,
|
|
220
|
-
},
|
|
221
|
-
cellSlot({
|
|
222
|
-
column,
|
|
223
|
-
row,
|
|
224
|
-
rowIndex,
|
|
225
|
-
value: getCellValue(column, row),
|
|
226
|
-
}),
|
|
227
|
-
),
|
|
228
|
-
);
|
|
229
|
-
});
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
return h(
|
|
233
|
-
'sd-table',
|
|
234
|
-
{
|
|
235
|
-
...attrs,
|
|
236
|
-
...props,
|
|
237
|
-
rows: normalizedRows.value,
|
|
238
|
-
selected: props.modelValue ?? props.selected,
|
|
239
|
-
onSdSelectChange: (event: CustomEvent<SdTableRow[]>) => {
|
|
240
|
-
emit('update:modelValue', event.detail);
|
|
241
|
-
emit('sdSelectChange', event);
|
|
242
|
-
},
|
|
243
|
-
onSdPageChange: (event: CustomEvent<number>) => {
|
|
244
|
-
currentPage.value = event.detail;
|
|
245
|
-
emit('sdPageChange', event);
|
|
246
|
-
},
|
|
247
|
-
onSdRowsPerPageChange: (event: CustomEvent<number>) => {
|
|
248
|
-
currentRowsPerPage.value = event.detail;
|
|
249
|
-
const lastPage = Math.max(1, Math.ceil(normalizedRows.value.length / event.detail));
|
|
250
|
-
currentPage.value = Math.min(currentPage.value, lastPage);
|
|
251
|
-
emit('sdRowsPerPageChange', event);
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
default: () => slotChildren,
|
|
256
|
-
},
|
|
257
|
-
);
|
|
258
|
-
};
|
|
259
|
-
},
|
|
260
|
-
});
|