@sellmate/design-system-vue 1.0.62 → 1.0.64
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 +109 -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 +129 -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
|
@@ -34,6 +34,7 @@ export const SdBarcodeInput = /*@__PURE__*/ defineContainer('sd-barcode-input',
|
|
|
34
34
|
'focused',
|
|
35
35
|
'hovered',
|
|
36
36
|
'label',
|
|
37
|
+
'labelWidth',
|
|
37
38
|
'icon',
|
|
38
39
|
'labelTooltip',
|
|
39
40
|
'labelTooltipProps',
|
|
@@ -67,6 +68,7 @@ export const SdButtonV2 = /*@__PURE__*/ defineContainer('sd-button-v2', undefine
|
|
|
67
68
|
'name',
|
|
68
69
|
'label',
|
|
69
70
|
'icon',
|
|
71
|
+
'rightIcon',
|
|
70
72
|
'ariaLabel',
|
|
71
73
|
'disabled',
|
|
72
74
|
'type',
|
|
@@ -93,11 +95,17 @@ export const SdCheckbox = /*@__PURE__*/ defineContainer('sd-checkbox', undefined
|
|
|
93
95
|
'value',
|
|
94
96
|
'val',
|
|
95
97
|
'disabled',
|
|
98
|
+
'inverse',
|
|
96
99
|
'label',
|
|
97
100
|
'sdUpdate'
|
|
98
101
|
], [
|
|
99
102
|
'sdUpdate'
|
|
100
103
|
], 'value', 'sdUpdate', undefined);
|
|
104
|
+
export const SdCircleProgress = /*@__PURE__*/ defineContainer('sd-circle-progress', undefined, [
|
|
105
|
+
'indeterminate',
|
|
106
|
+
'value',
|
|
107
|
+
'type'
|
|
108
|
+
]);
|
|
101
109
|
export const SdConfirmModal = /*@__PURE__*/ defineContainer('sd-confirm-modal', undefined, [
|
|
102
110
|
'type',
|
|
103
111
|
'modalTitle',
|
|
@@ -142,6 +150,7 @@ export const SdDatePicker = /*@__PURE__*/ defineContainer('sd-date-picker', unde
|
|
|
142
150
|
'disabled',
|
|
143
151
|
'width',
|
|
144
152
|
'label',
|
|
153
|
+
'labelWidth',
|
|
145
154
|
'addonLabel',
|
|
146
155
|
'hint',
|
|
147
156
|
'errorMessage',
|
|
@@ -184,6 +193,7 @@ export const SdDateRangePicker = /*@__PURE__*/ defineContainer('sd-date-range-pi
|
|
|
184
193
|
'disabled',
|
|
185
194
|
'width',
|
|
186
195
|
'label',
|
|
196
|
+
'labelWidth',
|
|
187
197
|
'addonLabel',
|
|
188
198
|
'hint',
|
|
189
199
|
'errorMessage',
|
|
@@ -231,7 +241,9 @@ export const SdField = /*@__PURE__*/ defineContainer('sd-field', undefined, [
|
|
|
231
241
|
'hint',
|
|
232
242
|
'errorMessage',
|
|
233
243
|
'width',
|
|
244
|
+
'size',
|
|
234
245
|
'label',
|
|
246
|
+
'labelWidth',
|
|
235
247
|
'addonLabel',
|
|
236
248
|
'icon',
|
|
237
249
|
'labelTooltip',
|
|
@@ -249,6 +261,7 @@ export const SdFilePicker = /*@__PURE__*/ defineContainer('sd-file-picker', unde
|
|
|
249
261
|
'maxFiles',
|
|
250
262
|
'name',
|
|
251
263
|
'label',
|
|
264
|
+
'labelWidth',
|
|
252
265
|
'addonLabel',
|
|
253
266
|
'hint',
|
|
254
267
|
'errorMessage',
|
|
@@ -338,6 +351,7 @@ export const SdInput = /*@__PURE__*/ defineContainer('sd-input', undefined, [
|
|
|
338
351
|
'focused',
|
|
339
352
|
'hovered',
|
|
340
353
|
'label',
|
|
354
|
+
'labelWidth',
|
|
341
355
|
'icon',
|
|
342
356
|
'labelTooltip',
|
|
343
357
|
'labelTooltipProps',
|
|
@@ -350,8 +364,16 @@ export const SdInput = /*@__PURE__*/ defineContainer('sd-input', undefined, [
|
|
|
350
364
|
'sdFocus',
|
|
351
365
|
'sdBlur'
|
|
352
366
|
], 'value', 'sdUpdate', undefined);
|
|
353
|
-
export const
|
|
354
|
-
|
|
367
|
+
export const SdLoadingContainer = /*@__PURE__*/ defineContainer('sd-loading-container', undefined);
|
|
368
|
+
export const SdLoadingModal = /*@__PURE__*/ defineContainer('sd-loading-modal', undefined, [
|
|
369
|
+
'state',
|
|
370
|
+
'message',
|
|
371
|
+
'buttonLabel',
|
|
372
|
+
'width',
|
|
373
|
+
'height',
|
|
374
|
+
'sdClick'
|
|
375
|
+
], [
|
|
376
|
+
'sdClick'
|
|
355
377
|
]);
|
|
356
378
|
export const SdModalContainer = /*@__PURE__*/ defineContainer('sd-modal-container', undefined);
|
|
357
379
|
export const SdNumberInput = /*@__PURE__*/ defineContainer('sd-number-input', undefined, [
|
|
@@ -363,6 +385,7 @@ export const SdNumberInput = /*@__PURE__*/ defineContainer('sd-number-input', un
|
|
|
363
385
|
'useDecimal',
|
|
364
386
|
'value',
|
|
365
387
|
'label',
|
|
388
|
+
'labelWidth',
|
|
366
389
|
'addonLabel',
|
|
367
390
|
'placeholder',
|
|
368
391
|
'disabled',
|
|
@@ -440,7 +463,7 @@ export const SdRadio = /*@__PURE__*/ defineContainer('sd-radio', undefined, [
|
|
|
440
463
|
], [
|
|
441
464
|
'sdUpdate'
|
|
442
465
|
], 'value', 'sdUpdate', undefined);
|
|
443
|
-
export const
|
|
466
|
+
export const SdRadioButton = /*@__PURE__*/ defineContainer('sd-radio-button', undefined, [
|
|
444
467
|
'value',
|
|
445
468
|
'options',
|
|
446
469
|
'size',
|
|
@@ -472,6 +495,7 @@ export const SdSelect = /*@__PURE__*/ defineContainer('sd-select', undefined, [
|
|
|
472
495
|
'clearable',
|
|
473
496
|
'searchable',
|
|
474
497
|
'label',
|
|
498
|
+
'labelWidth',
|
|
475
499
|
'addonLabel',
|
|
476
500
|
'icon',
|
|
477
501
|
'labelTooltip',
|
|
@@ -515,6 +539,7 @@ export const SdSelectGroup = /*@__PURE__*/ defineContainer('sd-select-group', un
|
|
|
515
539
|
'clearable',
|
|
516
540
|
'searchable',
|
|
517
541
|
'label',
|
|
542
|
+
'labelWidth',
|
|
518
543
|
'addonLabel',
|
|
519
544
|
'icon',
|
|
520
545
|
'labelTooltip',
|
|
@@ -547,6 +572,7 @@ export const SdSelectMultiple = /*@__PURE__*/ defineContainer('sd-select-multipl
|
|
|
547
572
|
'useAll',
|
|
548
573
|
'useCheckbox',
|
|
549
574
|
'label',
|
|
575
|
+
'labelWidth',
|
|
550
576
|
'icon',
|
|
551
577
|
'labelTooltip',
|
|
552
578
|
'labelTooltipProps',
|
|
@@ -574,6 +600,7 @@ export const SdSelectMultipleGroup = /*@__PURE__*/ defineContainer('sd-select-mu
|
|
|
574
600
|
'allCheckedLabel',
|
|
575
601
|
'allCheckOptionLabel',
|
|
576
602
|
'label',
|
|
603
|
+
'labelWidth',
|
|
577
604
|
'icon',
|
|
578
605
|
'labelTooltip',
|
|
579
606
|
'labelTooltipProps',
|
|
@@ -635,6 +662,7 @@ export const SdSelectV2 = /*@__PURE__*/ defineContainer('sd-select-v2', undefine
|
|
|
635
662
|
'dropdownHeight',
|
|
636
663
|
'disabled',
|
|
637
664
|
'label',
|
|
665
|
+
'labelWidth',
|
|
638
666
|
'addonLabel',
|
|
639
667
|
'error',
|
|
640
668
|
'hint',
|
|
@@ -692,6 +720,48 @@ export const SdSelectV2Trigger = /*@__PURE__*/ defineContainer('sd-select-v2-tri
|
|
|
692
720
|
], [
|
|
693
721
|
'sdTriggerClick'
|
|
694
722
|
]);
|
|
723
|
+
export const SdSwitch = /*@__PURE__*/ defineContainer('sd-switch', undefined, [
|
|
724
|
+
'value',
|
|
725
|
+
'label',
|
|
726
|
+
'disabled',
|
|
727
|
+
'sdUpdate'
|
|
728
|
+
], [
|
|
729
|
+
'sdUpdate'
|
|
730
|
+
], 'value', 'sdUpdate', undefined);
|
|
731
|
+
export const SdTable = /*@__PURE__*/ defineContainer('sd-table', undefined, [
|
|
732
|
+
'tableId',
|
|
733
|
+
'columns',
|
|
734
|
+
'rows',
|
|
735
|
+
'selected',
|
|
736
|
+
'rowKey',
|
|
737
|
+
'selectable',
|
|
738
|
+
'resizable',
|
|
739
|
+
'width',
|
|
740
|
+
'height',
|
|
741
|
+
'stickyHeader',
|
|
742
|
+
'stickyColumn',
|
|
743
|
+
'noDataLabel',
|
|
744
|
+
'isLoading',
|
|
745
|
+
'pagination',
|
|
746
|
+
'useInternalPagination',
|
|
747
|
+
'useRowsPerPageSelect',
|
|
748
|
+
'useVirtualScroll',
|
|
749
|
+
'rowHeight',
|
|
750
|
+
'virtualBuffer',
|
|
751
|
+
'virtualEndThreshold',
|
|
752
|
+
'rowsPerPageOption',
|
|
753
|
+
'sdSelectChange',
|
|
754
|
+
'sdPageChange',
|
|
755
|
+
'sdRowsPerPageChange',
|
|
756
|
+
'sdVirtualUpdate',
|
|
757
|
+
'sdVirtualReachEnd'
|
|
758
|
+
], [
|
|
759
|
+
'sdSelectChange',
|
|
760
|
+
'sdPageChange',
|
|
761
|
+
'sdRowsPerPageChange',
|
|
762
|
+
'sdVirtualUpdate',
|
|
763
|
+
'sdVirtualReachEnd'
|
|
764
|
+
], 'selected', 'sdSelectChange', undefined);
|
|
695
765
|
export const SdTabs = /*@__PURE__*/ defineContainer('sd-tabs', undefined, [
|
|
696
766
|
'value',
|
|
697
767
|
'tabs',
|
|
@@ -707,6 +777,14 @@ export const SdTag = /*@__PURE__*/ defineContainer('sd-tag', undefined, [
|
|
|
707
777
|
'icon',
|
|
708
778
|
'isLeft'
|
|
709
779
|
]);
|
|
780
|
+
export const SdTbody = /*@__PURE__*/ defineContainer('sd-tbody', undefined, [
|
|
781
|
+
'rows'
|
|
782
|
+
]);
|
|
783
|
+
export const SdTd = /*@__PURE__*/ defineContainer('sd-td', undefined, [
|
|
784
|
+
'field',
|
|
785
|
+
'rowKey',
|
|
786
|
+
'align'
|
|
787
|
+
]);
|
|
710
788
|
export const SdTextLink = /*@__PURE__*/ defineContainer('sd-text-link', undefined, [
|
|
711
789
|
'label',
|
|
712
790
|
'icon',
|
|
@@ -732,6 +810,7 @@ export const SdTextarea = /*@__PURE__*/ defineContainer('sd-textarea', undefined
|
|
|
732
810
|
'spellcheck',
|
|
733
811
|
'width',
|
|
734
812
|
'label',
|
|
813
|
+
'labelWidth',
|
|
735
814
|
'addonLabel',
|
|
736
815
|
'hint',
|
|
737
816
|
'errorMessage',
|
|
@@ -751,6 +830,17 @@ export const SdTextarea = /*@__PURE__*/ defineContainer('sd-textarea', undefined
|
|
|
751
830
|
'sdFocus',
|
|
752
831
|
'sdBlur'
|
|
753
832
|
], 'value', 'sdUpdate', undefined);
|
|
833
|
+
export const SdThead = /*@__PURE__*/ defineContainer('sd-thead', undefined, [
|
|
834
|
+
'columns',
|
|
835
|
+
'selectable',
|
|
836
|
+
'resizable',
|
|
837
|
+
'stickyColumn',
|
|
838
|
+
'stickyHeader',
|
|
839
|
+
'scrolledLeft',
|
|
840
|
+
'scrolledRight',
|
|
841
|
+
'rows',
|
|
842
|
+
'columnWidths'
|
|
843
|
+
]);
|
|
754
844
|
export const SdToast = /*@__PURE__*/ defineContainer('sd-toast', undefined, [
|
|
755
845
|
'icon',
|
|
756
846
|
'message',
|
|
@@ -781,14 +871,6 @@ export const SdToggle = /*@__PURE__*/ defineContainer('sd-toggle', undefined, [
|
|
|
781
871
|
], [
|
|
782
872
|
'sdUpdate'
|
|
783
873
|
], '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
874
|
export const SdTooltip = /*@__PURE__*/ defineContainer('sd-tooltip', undefined, [
|
|
793
875
|
'trigger',
|
|
794
876
|
'placement',
|
|
@@ -802,3 +884,19 @@ export const SdTooltip = /*@__PURE__*/ defineContainer('sd-tooltip', undefined,
|
|
|
802
884
|
'noHover',
|
|
803
885
|
'sdClass'
|
|
804
886
|
]);
|
|
887
|
+
export const SdTr = /*@__PURE__*/ defineContainer('sd-tr', undefined, [
|
|
888
|
+
'columns',
|
|
889
|
+
'selectable',
|
|
890
|
+
'stickyColumn',
|
|
891
|
+
'rowKey',
|
|
892
|
+
'row'
|
|
893
|
+
]);
|
|
894
|
+
export const TableTest = /*@__PURE__*/ defineContainer('table-test', undefined, [
|
|
895
|
+
'columns',
|
|
896
|
+
'rows',
|
|
897
|
+
'bordered',
|
|
898
|
+
'striped',
|
|
899
|
+
'tableReady'
|
|
900
|
+
], [
|
|
901
|
+
'tableReady'
|
|
902
|
+
]);
|
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
|
@@ -44,6 +44,7 @@ export const SdBarcodeInput: StencilVueComponent<JSX.SdBarcodeInput, JSX.SdBarco
|
|
|
44
44
|
'focused',
|
|
45
45
|
'hovered',
|
|
46
46
|
'label',
|
|
47
|
+
'labelWidth',
|
|
47
48
|
'icon',
|
|
48
49
|
'labelTooltip',
|
|
49
50
|
'labelTooltipProps',
|
|
@@ -82,6 +83,7 @@ export const SdButtonV2: StencilVueComponent<JSX.SdButtonV2> = /*@__PURE__*/ def
|
|
|
82
83
|
'name',
|
|
83
84
|
'label',
|
|
84
85
|
'icon',
|
|
86
|
+
'rightIcon',
|
|
85
87
|
'ariaLabel',
|
|
86
88
|
'disabled',
|
|
87
89
|
'type',
|
|
@@ -114,6 +116,7 @@ export const SdCheckbox: StencilVueComponent<JSX.SdCheckbox, JSX.SdCheckbox["val
|
|
|
114
116
|
'value',
|
|
115
117
|
'val',
|
|
116
118
|
'disabled',
|
|
119
|
+
'inverse',
|
|
117
120
|
'label',
|
|
118
121
|
'sdUpdate'
|
|
119
122
|
], [
|
|
@@ -122,6 +125,13 @@ export const SdCheckbox: StencilVueComponent<JSX.SdCheckbox, JSX.SdCheckbox["val
|
|
|
122
125
|
'value', 'sdUpdate', undefined);
|
|
123
126
|
|
|
124
127
|
|
|
128
|
+
export const SdCircleProgress: StencilVueComponent<JSX.SdCircleProgress> = /*@__PURE__*/ defineContainer<JSX.SdCircleProgress>('sd-circle-progress', undefined, [
|
|
129
|
+
'indeterminate',
|
|
130
|
+
'value',
|
|
131
|
+
'type'
|
|
132
|
+
]);
|
|
133
|
+
|
|
134
|
+
|
|
125
135
|
export const SdConfirmModal: StencilVueComponent<JSX.SdConfirmModal> = /*@__PURE__*/ defineContainer<JSX.SdConfirmModal>('sd-confirm-modal', undefined, [
|
|
126
136
|
'type',
|
|
127
137
|
'modalTitle',
|
|
@@ -170,6 +180,7 @@ export const SdDatePicker: StencilVueComponent<JSX.SdDatePicker, JSX.SdDatePicke
|
|
|
170
180
|
'disabled',
|
|
171
181
|
'width',
|
|
172
182
|
'label',
|
|
183
|
+
'labelWidth',
|
|
173
184
|
'addonLabel',
|
|
174
185
|
'hint',
|
|
175
186
|
'errorMessage',
|
|
@@ -219,6 +230,7 @@ export const SdDateRangePicker: StencilVueComponent<JSX.SdDateRangePicker, JSX.S
|
|
|
219
230
|
'disabled',
|
|
220
231
|
'width',
|
|
221
232
|
'label',
|
|
233
|
+
'labelWidth',
|
|
222
234
|
'addonLabel',
|
|
223
235
|
'hint',
|
|
224
236
|
'errorMessage',
|
|
@@ -273,7 +285,9 @@ export const SdField: StencilVueComponent<JSX.SdField> = /*@__PURE__*/ defineCon
|
|
|
273
285
|
'hint',
|
|
274
286
|
'errorMessage',
|
|
275
287
|
'width',
|
|
288
|
+
'size',
|
|
276
289
|
'label',
|
|
290
|
+
'labelWidth',
|
|
277
291
|
'addonLabel',
|
|
278
292
|
'icon',
|
|
279
293
|
'labelTooltip',
|
|
@@ -293,6 +307,7 @@ export const SdFilePicker: StencilVueComponent<JSX.SdFilePicker, JSX.SdFilePicke
|
|
|
293
307
|
'maxFiles',
|
|
294
308
|
'name',
|
|
295
309
|
'label',
|
|
310
|
+
'labelWidth',
|
|
296
311
|
'addonLabel',
|
|
297
312
|
'hint',
|
|
298
313
|
'errorMessage',
|
|
@@ -395,6 +410,7 @@ export const SdInput: StencilVueComponent<JSX.SdInput, JSX.SdInput["value"]> = /
|
|
|
395
410
|
'focused',
|
|
396
411
|
'hovered',
|
|
397
412
|
'label',
|
|
413
|
+
'labelWidth',
|
|
398
414
|
'icon',
|
|
399
415
|
'labelTooltip',
|
|
400
416
|
'labelTooltipProps',
|
|
@@ -410,8 +426,18 @@ export const SdInput: StencilVueComponent<JSX.SdInput, JSX.SdInput["value"]> = /
|
|
|
410
426
|
'value', 'sdUpdate', undefined);
|
|
411
427
|
|
|
412
428
|
|
|
413
|
-
export const
|
|
414
|
-
|
|
429
|
+
export const SdLoadingContainer: StencilVueComponent<JSX.SdLoadingContainer> = /*@__PURE__*/ defineContainer<JSX.SdLoadingContainer>('sd-loading-container', undefined);
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
export const SdLoadingModal: StencilVueComponent<JSX.SdLoadingModal> = /*@__PURE__*/ defineContainer<JSX.SdLoadingModal>('sd-loading-modal', undefined, [
|
|
433
|
+
'state',
|
|
434
|
+
'message',
|
|
435
|
+
'buttonLabel',
|
|
436
|
+
'width',
|
|
437
|
+
'height',
|
|
438
|
+
'sdClick'
|
|
439
|
+
], [
|
|
440
|
+
'sdClick'
|
|
415
441
|
]);
|
|
416
442
|
|
|
417
443
|
|
|
@@ -427,6 +453,7 @@ export const SdNumberInput: StencilVueComponent<JSX.SdNumberInput, JSX.SdNumberI
|
|
|
427
453
|
'useDecimal',
|
|
428
454
|
'value',
|
|
429
455
|
'label',
|
|
456
|
+
'labelWidth',
|
|
430
457
|
'addonLabel',
|
|
431
458
|
'placeholder',
|
|
432
459
|
'disabled',
|
|
@@ -519,7 +546,7 @@ export const SdRadio: StencilVueComponent<JSX.SdRadio, JSX.SdRadio["value"]> = /
|
|
|
519
546
|
'value', 'sdUpdate', undefined);
|
|
520
547
|
|
|
521
548
|
|
|
522
|
-
export const
|
|
549
|
+
export const SdRadioButton: StencilVueComponent<JSX.SdRadioButton, JSX.SdRadioButton["value"]> = /*@__PURE__*/ defineContainer<JSX.SdRadioButton, JSX.SdRadioButton["value"]>('sd-radio-button', undefined, [
|
|
523
550
|
'value',
|
|
524
551
|
'options',
|
|
525
552
|
'size',
|
|
@@ -557,6 +584,7 @@ export const SdSelect: StencilVueComponent<JSX.SdSelect, JSX.SdSelect["value"]>
|
|
|
557
584
|
'clearable',
|
|
558
585
|
'searchable',
|
|
559
586
|
'label',
|
|
587
|
+
'labelWidth',
|
|
560
588
|
'addonLabel',
|
|
561
589
|
'icon',
|
|
562
590
|
'labelTooltip',
|
|
@@ -605,6 +633,7 @@ export const SdSelectGroup: StencilVueComponent<JSX.SdSelectGroup> = /*@__PURE__
|
|
|
605
633
|
'clearable',
|
|
606
634
|
'searchable',
|
|
607
635
|
'label',
|
|
636
|
+
'labelWidth',
|
|
608
637
|
'addonLabel',
|
|
609
638
|
'icon',
|
|
610
639
|
'labelTooltip',
|
|
@@ -639,6 +668,7 @@ export const SdSelectMultiple: StencilVueComponent<JSX.SdSelectMultiple, JSX.SdS
|
|
|
639
668
|
'useAll',
|
|
640
669
|
'useCheckbox',
|
|
641
670
|
'label',
|
|
671
|
+
'labelWidth',
|
|
642
672
|
'icon',
|
|
643
673
|
'labelTooltip',
|
|
644
674
|
'labelTooltipProps',
|
|
@@ -669,6 +699,7 @@ export const SdSelectMultipleGroup: StencilVueComponent<JSX.SdSelectMultipleGrou
|
|
|
669
699
|
'allCheckedLabel',
|
|
670
700
|
'allCheckOptionLabel',
|
|
671
701
|
'label',
|
|
702
|
+
'labelWidth',
|
|
672
703
|
'icon',
|
|
673
704
|
'labelTooltip',
|
|
674
705
|
'labelTooltipProps',
|
|
@@ -739,6 +770,7 @@ export const SdSelectV2: StencilVueComponent<JSX.SdSelectV2, JSX.SdSelectV2["val
|
|
|
739
770
|
'dropdownHeight',
|
|
740
771
|
'disabled',
|
|
741
772
|
'label',
|
|
773
|
+
'labelWidth',
|
|
742
774
|
'addonLabel',
|
|
743
775
|
'error',
|
|
744
776
|
'hint',
|
|
@@ -807,6 +839,54 @@ export const SdSelectV2Trigger: StencilVueComponent<JSX.SdSelectV2Trigger> = /*@
|
|
|
807
839
|
]);
|
|
808
840
|
|
|
809
841
|
|
|
842
|
+
export const SdSwitch: StencilVueComponent<JSX.SdSwitch, JSX.SdSwitch["value"]> = /*@__PURE__*/ defineContainer<JSX.SdSwitch, JSX.SdSwitch["value"]>('sd-switch', undefined, [
|
|
843
|
+
'value',
|
|
844
|
+
'label',
|
|
845
|
+
'disabled',
|
|
846
|
+
'sdUpdate'
|
|
847
|
+
], [
|
|
848
|
+
'sdUpdate'
|
|
849
|
+
],
|
|
850
|
+
'value', 'sdUpdate', undefined);
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
export const SdTable: StencilVueComponent<JSX.SdTable, JSX.SdTable["selected"]> = /*@__PURE__*/ defineContainer<JSX.SdTable, JSX.SdTable["selected"]>('sd-table', undefined, [
|
|
854
|
+
'tableId',
|
|
855
|
+
'columns',
|
|
856
|
+
'rows',
|
|
857
|
+
'selected',
|
|
858
|
+
'rowKey',
|
|
859
|
+
'selectable',
|
|
860
|
+
'resizable',
|
|
861
|
+
'width',
|
|
862
|
+
'height',
|
|
863
|
+
'stickyHeader',
|
|
864
|
+
'stickyColumn',
|
|
865
|
+
'noDataLabel',
|
|
866
|
+
'isLoading',
|
|
867
|
+
'pagination',
|
|
868
|
+
'useInternalPagination',
|
|
869
|
+
'useRowsPerPageSelect',
|
|
870
|
+
'useVirtualScroll',
|
|
871
|
+
'rowHeight',
|
|
872
|
+
'virtualBuffer',
|
|
873
|
+
'virtualEndThreshold',
|
|
874
|
+
'rowsPerPageOption',
|
|
875
|
+
'sdSelectChange',
|
|
876
|
+
'sdPageChange',
|
|
877
|
+
'sdRowsPerPageChange',
|
|
878
|
+
'sdVirtualUpdate',
|
|
879
|
+
'sdVirtualReachEnd'
|
|
880
|
+
], [
|
|
881
|
+
'sdSelectChange',
|
|
882
|
+
'sdPageChange',
|
|
883
|
+
'sdRowsPerPageChange',
|
|
884
|
+
'sdVirtualUpdate',
|
|
885
|
+
'sdVirtualReachEnd'
|
|
886
|
+
],
|
|
887
|
+
'selected', 'sdSelectChange', undefined);
|
|
888
|
+
|
|
889
|
+
|
|
810
890
|
export const SdTabs: StencilVueComponent<JSX.SdTabs, JSX.SdTabs["value"]> = /*@__PURE__*/ defineContainer<JSX.SdTabs, JSX.SdTabs["value"]>('sd-tabs', undefined, [
|
|
811
891
|
'value',
|
|
812
892
|
'tabs',
|
|
@@ -827,6 +907,18 @@ export const SdTag: StencilVueComponent<JSX.SdTag> = /*@__PURE__*/ defineContain
|
|
|
827
907
|
]);
|
|
828
908
|
|
|
829
909
|
|
|
910
|
+
export const SdTbody: StencilVueComponent<JSX.SdTbody> = /*@__PURE__*/ defineContainer<JSX.SdTbody>('sd-tbody', undefined, [
|
|
911
|
+
'rows'
|
|
912
|
+
]);
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
export const SdTd: StencilVueComponent<JSX.SdTd> = /*@__PURE__*/ defineContainer<JSX.SdTd>('sd-td', undefined, [
|
|
916
|
+
'field',
|
|
917
|
+
'rowKey',
|
|
918
|
+
'align'
|
|
919
|
+
]);
|
|
920
|
+
|
|
921
|
+
|
|
830
922
|
export const SdTextLink: StencilVueComponent<JSX.SdTextLink> = /*@__PURE__*/ defineContainer<JSX.SdTextLink>('sd-text-link', undefined, [
|
|
831
923
|
'label',
|
|
832
924
|
'icon',
|
|
@@ -854,6 +946,7 @@ export const SdTextarea: StencilVueComponent<JSX.SdTextarea, JSX.SdTextarea["val
|
|
|
854
946
|
'spellcheck',
|
|
855
947
|
'width',
|
|
856
948
|
'label',
|
|
949
|
+
'labelWidth',
|
|
857
950
|
'addonLabel',
|
|
858
951
|
'hint',
|
|
859
952
|
'errorMessage',
|
|
@@ -876,6 +969,19 @@ export const SdTextarea: StencilVueComponent<JSX.SdTextarea, JSX.SdTextarea["val
|
|
|
876
969
|
'value', 'sdUpdate', undefined);
|
|
877
970
|
|
|
878
971
|
|
|
972
|
+
export const SdThead: StencilVueComponent<JSX.SdThead> = /*@__PURE__*/ defineContainer<JSX.SdThead>('sd-thead', undefined, [
|
|
973
|
+
'columns',
|
|
974
|
+
'selectable',
|
|
975
|
+
'resizable',
|
|
976
|
+
'stickyColumn',
|
|
977
|
+
'stickyHeader',
|
|
978
|
+
'scrolledLeft',
|
|
979
|
+
'scrolledRight',
|
|
980
|
+
'rows',
|
|
981
|
+
'columnWidths'
|
|
982
|
+
]);
|
|
983
|
+
|
|
984
|
+
|
|
879
985
|
export const SdToast: StencilVueComponent<JSX.SdToast> = /*@__PURE__*/ defineContainer<JSX.SdToast>('sd-toast', undefined, [
|
|
880
986
|
'icon',
|
|
881
987
|
'message',
|
|
@@ -913,17 +1019,6 @@ export const SdToggle: StencilVueComponent<JSX.SdToggle, JSX.SdToggle["value"]>
|
|
|
913
1019
|
'value', 'sdUpdate', undefined);
|
|
914
1020
|
|
|
915
1021
|
|
|
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
1022
|
export const SdTooltip: StencilVueComponent<JSX.SdTooltip> = /*@__PURE__*/ defineContainer<JSX.SdTooltip>('sd-tooltip', undefined, [
|
|
928
1023
|
'trigger',
|
|
929
1024
|
'placement',
|
|
@@ -938,3 +1033,23 @@ export const SdTooltip: StencilVueComponent<JSX.SdTooltip> = /*@__PURE__*/ defin
|
|
|
938
1033
|
'sdClass'
|
|
939
1034
|
]);
|
|
940
1035
|
|
|
1036
|
+
|
|
1037
|
+
export const SdTr: StencilVueComponent<JSX.SdTr> = /*@__PURE__*/ defineContainer<JSX.SdTr>('sd-tr', undefined, [
|
|
1038
|
+
'columns',
|
|
1039
|
+
'selectable',
|
|
1040
|
+
'stickyColumn',
|
|
1041
|
+
'rowKey',
|
|
1042
|
+
'row'
|
|
1043
|
+
]);
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
export const TableTest: StencilVueComponent<JSX.TableTest> = /*@__PURE__*/ defineContainer<JSX.TableTest>('table-test', undefined, [
|
|
1047
|
+
'columns',
|
|
1048
|
+
'rows',
|
|
1049
|
+
'bordered',
|
|
1050
|
+
'striped',
|
|
1051
|
+
'tableReady'
|
|
1052
|
+
], [
|
|
1053
|
+
'tableReady'
|
|
1054
|
+
]);
|
|
1055
|
+
|
|
@@ -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.64",
|
|
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.64",
|
|
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
|
-
});
|