yuyeon 0.3.1 → 0.3.2-rc.10
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/yuyeon.js +4861 -4714
- package/dist/yuyeon.umd.cjs +3 -3
- package/lib/components/dialog/YDialog.js +6 -1
- package/lib/components/dialog/YDialog.js.map +1 -1
- package/lib/components/divider/YDivider.scss +21 -0
- package/lib/components/field-input/YFieldInput.js +4 -1
- package/lib/components/field-input/YFieldInput.js.map +1 -1
- package/lib/components/input/YInput.js +2 -1
- package/lib/components/input/YInput.js.map +1 -1
- package/lib/components/select/YSelect.js.map +1 -1
- package/lib/components/slider/YSlider.js +1 -0
- package/lib/components/slider/YSlider.js.map +1 -1
- package/lib/components/slider/YSlider.scss +3 -0
- package/lib/components/slider/index.js +1 -1
- package/lib/components/slider/index.js.map +1 -1
- package/lib/components/slider/slider.js +2 -0
- package/lib/components/slider/slider.js.map +1 -0
- package/lib/components/table/YDataTable.js +32 -16
- package/lib/components/table/YDataTable.js.map +1 -1
- package/lib/components/table/YDataTableBody.js +26 -8
- package/lib/components/table/YDataTableBody.js.map +1 -1
- package/lib/components/table/YDataTableControl.js +1 -1
- package/lib/components/table/YDataTableControl.js.map +1 -1
- package/lib/components/table/YDataTableHead.js +3 -3
- package/lib/components/table/YDataTableHead.js.map +1 -1
- package/lib/components/table/YDataTableLayer.js +11 -4
- package/lib/components/table/YDataTableLayer.js.map +1 -1
- package/lib/components/table/YDataTableLayerRow.vue +146 -0
- package/lib/components/table/YDataTableRow.js +14 -6
- package/lib/components/table/YDataTableRow.js.map +1 -1
- package/lib/components/table/YDataTableServer.js +34 -19
- package/lib/components/table/YDataTableServer.js.map +1 -1
- package/lib/components/table/YTable.js +8 -3
- package/lib/components/table/YTable.js.map +1 -1
- package/lib/components/table/composables/expand.js +49 -0
- package/lib/components/table/composables/expand.js.map +1 -0
- package/lib/components/table/composables/header.js +127 -0
- package/lib/components/table/composables/header.js.map +1 -0
- package/lib/components/table/composables/items.js +52 -0
- package/lib/components/table/composables/items.js.map +1 -0
- package/lib/components/table/composables/measure.js +55 -0
- package/lib/components/table/composables/measure.js.map +1 -0
- package/lib/components/table/composables/options.js +33 -0
- package/lib/components/table/composables/options.js.map +1 -0
- package/lib/components/table/composables/pagination.js +99 -0
- package/lib/components/table/composables/pagination.js.map +1 -0
- package/lib/components/table/composables/provides.js +3 -0
- package/lib/components/table/composables/provides.js.map +1 -0
- package/lib/components/table/composables/selection.js +196 -0
- package/lib/components/table/composables/selection.js.map +1 -0
- package/lib/components/table/composables/sorted-items.js +50 -0
- package/lib/components/table/composables/sorted-items.js.map +1 -0
- package/lib/components/table/composables/sorting.js +73 -0
- package/lib/components/table/composables/sorting.js.map +1 -0
- package/lib/components/table/composibles/measure.js +21 -5
- package/lib/components/table/composibles/measure.js.map +1 -1
- package/lib/components/table/types/index.js.map +1 -1
- package/lib/components/table/types/item.js.map +1 -1
- package/lib/components/tree-view/YTreeView.js +8 -4
- package/lib/components/tree-view/YTreeView.js.map +1 -1
- package/lib/components/tree-view/tree-view.js +34 -4
- package/lib/components/tree-view/tree-view.js.map +1 -1
- package/lib/components/tree-view/types.js.map +1 -1
- package/lib/composables/theme/setting.js +3 -2
- package/lib/composables/theme/setting.js.map +1 -1
- package/lib/util/color/index.js +1 -1
- package/lib/util/color/index.js.map +1 -1
- package/package.json +1 -1
- package/types/abstract/items.d.ts +4 -4
- package/types/components/badge/YBadge.d.ts +4 -4
- package/types/components/button/YButton.d.ts +8 -8
- package/types/components/chip/YChip.d.ts +1 -1
- package/types/components/date-picker/YDateCalendar.d.ts +1 -1
- package/types/components/date-picker/YDatePicker.d.ts +12 -12
- package/types/components/date-picker/YDatePickerControl.d.ts +10 -10
- package/types/components/dialog/YDialog.d.ts +72 -72
- package/types/components/dropdown/YDropdown.d.ts +55 -55
- package/types/components/field-input/YFieldInput.d.ts +13 -13
- package/types/components/hover/YHover.d.ts +3 -3
- package/types/components/icon/YIcon.d.ts +2 -2
- package/types/components/img/YImg.d.ts +5 -5
- package/types/components/input/YInput.d.ts +10 -9
- package/types/components/ip-field/YIpv4Field.d.ts +1 -1
- package/types/components/layer/YLayer.d.ts +26 -26
- package/types/components/layer/content.d.ts +1 -1
- package/types/components/layer/scroll-strategies.d.ts +1 -1
- package/types/components/list/YListItem.d.ts +1 -1
- package/types/components/menu/YMenu.d.ts +9 -9
- package/types/components/pagination/YPagination.d.ts +5 -5
- package/types/components/select/YSelect.d.ts +101 -101
- package/types/components/slider/index.d.ts +1 -0
- package/types/components/slider/slider.d.ts +0 -0
- package/types/components/snackbar/YSnackbar.d.ts +33 -33
- package/types/components/switch/YSwitch.d.ts +10 -10
- package/types/components/tab/YTab.d.ts +12 -12
- package/types/components/tab/YTabs.d.ts +4 -4
- package/types/components/table/YDataTable.d.ts +37 -15
- package/types/components/table/YDataTableBody.d.ts +5 -3
- package/types/components/table/YDataTableControl.d.ts +2 -2
- package/types/components/table/YDataTableHead.d.ts +2 -2
- package/types/components/table/YDataTableLayer.d.ts +4 -1
- package/types/components/table/YDataTableServer.d.ts +40 -18
- package/types/components/table/YTable.d.ts +4 -4
- package/types/components/table/composables/expand.d.ts +42 -0
- package/types/components/table/composables/header.d.ts +207 -0
- package/types/components/table/composables/items.d.ts +55 -0
- package/types/components/table/composables/measure.d.ts +8 -0
- package/types/components/table/composables/options.d.ts +11 -0
- package/types/components/table/composables/pagination.d.ts +81 -0
- package/types/components/table/composables/provides.d.ts +15 -0
- package/types/components/table/composables/selection.d.ts +82 -0
- package/types/components/table/composables/sorted-items.d.ts +7 -0
- package/types/components/table/composables/sorting.d.ts +62 -0
- package/types/components/table/types/index.d.ts +2 -1
- package/types/components/table/types/item.d.ts +2 -1
- package/types/components/textarea/YTextarea.d.ts +18 -18
- package/types/components/tooltip/YTooltip.d.ts +46 -46
- package/types/components/tree-view/YTreeView.d.ts +21 -9
- package/types/components/tree-view/YTreeViewNode.d.ts +8 -8
- package/types/components/tree-view/tree-view.d.ts +2 -1
- package/types/components/tree-view/types.d.ts +8 -6
- package/types/composables/choice.d.ts +1 -1
- package/types/composables/coordinate/index.d.ts +8 -8
- package/types/composables/form.d.ts +2 -2
- package/types/composables/icon.d.ts +2 -2
- package/types/composables/list-items.d.ts +10 -10
- package/types/composables/theme/setting.d.ts +1 -0
- package/types/composables/transition.d.ts +1 -1
- package/types/composables/validation.d.ts +3 -3
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { DeepReadonly, InjectionKey, PropType, Ref } from 'vue';
|
|
2
|
+
import { DataTableHeader, InternalDataTableHeader } from '../types';
|
|
3
|
+
|
|
4
|
+
export declare const pressDataTableHeader: <Defaults extends {
|
|
5
|
+
headers?: unknown;
|
|
6
|
+
} = {}>(defaults?: Defaults | undefined) => {
|
|
7
|
+
headers: unknown extends Defaults["headers"] ? {
|
|
8
|
+
type: PropType<readonly {
|
|
9
|
+
readonly key: string;
|
|
10
|
+
readonly text: string;
|
|
11
|
+
readonly value?: any;
|
|
12
|
+
readonly colspan?: number | undefined;
|
|
13
|
+
readonly rowspan?: number | undefined;
|
|
14
|
+
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
15
|
+
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
16
|
+
readonly headerClasses?: string | readonly string[] | undefined;
|
|
17
|
+
readonly align?: "start" | "end" | "center" | undefined;
|
|
18
|
+
readonly width?: string | number | undefined;
|
|
19
|
+
readonly minWidth?: string | undefined;
|
|
20
|
+
readonly maxWidth?: string | undefined;
|
|
21
|
+
readonly sortable?: boolean | undefined;
|
|
22
|
+
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
23
|
+
readonly mustSort?: boolean | undefined;
|
|
24
|
+
}[]>;
|
|
25
|
+
default: () => never[];
|
|
26
|
+
} : Omit<{
|
|
27
|
+
type: PropType<readonly {
|
|
28
|
+
readonly key: string;
|
|
29
|
+
readonly text: string;
|
|
30
|
+
readonly value?: any;
|
|
31
|
+
readonly colspan?: number | undefined;
|
|
32
|
+
readonly rowspan?: number | undefined;
|
|
33
|
+
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
34
|
+
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
35
|
+
readonly headerClasses?: string | readonly string[] | undefined;
|
|
36
|
+
readonly align?: "start" | "end" | "center" | undefined;
|
|
37
|
+
readonly width?: string | number | undefined;
|
|
38
|
+
readonly minWidth?: string | undefined;
|
|
39
|
+
readonly maxWidth?: string | undefined;
|
|
40
|
+
readonly sortable?: boolean | undefined;
|
|
41
|
+
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
42
|
+
readonly mustSort?: boolean | undefined;
|
|
43
|
+
}[]>;
|
|
44
|
+
default: () => never[];
|
|
45
|
+
}, "default" | "type"> & {
|
|
46
|
+
type: PropType<unknown extends Defaults["headers"] ? readonly {
|
|
47
|
+
readonly key: string;
|
|
48
|
+
readonly text: string;
|
|
49
|
+
readonly value?: any;
|
|
50
|
+
readonly colspan?: number | undefined;
|
|
51
|
+
readonly rowspan?: number | undefined;
|
|
52
|
+
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
53
|
+
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
54
|
+
readonly headerClasses?: string | readonly string[] | undefined;
|
|
55
|
+
readonly align?: "start" | "end" | "center" | undefined;
|
|
56
|
+
readonly width?: string | number | undefined;
|
|
57
|
+
readonly minWidth?: string | undefined;
|
|
58
|
+
readonly maxWidth?: string | undefined;
|
|
59
|
+
readonly sortable?: boolean | undefined;
|
|
60
|
+
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
61
|
+
readonly mustSort?: boolean | undefined;
|
|
62
|
+
}[] : readonly {
|
|
63
|
+
readonly key: string;
|
|
64
|
+
readonly text: string;
|
|
65
|
+
readonly value?: any;
|
|
66
|
+
readonly colspan?: number | undefined;
|
|
67
|
+
readonly rowspan?: number | undefined;
|
|
68
|
+
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
69
|
+
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
70
|
+
readonly headerClasses?: string | readonly string[] | undefined;
|
|
71
|
+
readonly align?: "start" | "end" | "center" | undefined;
|
|
72
|
+
readonly width?: string | number | undefined;
|
|
73
|
+
readonly minWidth?: string | undefined;
|
|
74
|
+
readonly maxWidth?: string | undefined;
|
|
75
|
+
readonly sortable?: boolean | undefined;
|
|
76
|
+
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
77
|
+
readonly mustSort?: boolean | undefined;
|
|
78
|
+
}[] | Defaults["headers"]>;
|
|
79
|
+
default: unknown extends Defaults["headers"] ? readonly {
|
|
80
|
+
readonly key: string;
|
|
81
|
+
readonly text: string;
|
|
82
|
+
readonly value?: any;
|
|
83
|
+
readonly colspan?: number | undefined;
|
|
84
|
+
readonly rowspan?: number | undefined;
|
|
85
|
+
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
86
|
+
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
87
|
+
readonly headerClasses?: string | readonly string[] | undefined;
|
|
88
|
+
readonly align?: "start" | "end" | "center" | undefined;
|
|
89
|
+
readonly width?: string | number | undefined;
|
|
90
|
+
readonly minWidth?: string | undefined;
|
|
91
|
+
readonly maxWidth?: string | undefined;
|
|
92
|
+
readonly sortable?: boolean | undefined;
|
|
93
|
+
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
94
|
+
readonly mustSort?: boolean | undefined;
|
|
95
|
+
}[] : readonly {
|
|
96
|
+
readonly key: string;
|
|
97
|
+
readonly text: string;
|
|
98
|
+
readonly value?: any;
|
|
99
|
+
readonly colspan?: number | undefined;
|
|
100
|
+
readonly rowspan?: number | undefined;
|
|
101
|
+
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
102
|
+
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
103
|
+
readonly headerClasses?: string | readonly string[] | undefined;
|
|
104
|
+
readonly align?: "start" | "end" | "center" | undefined;
|
|
105
|
+
readonly width?: string | number | undefined;
|
|
106
|
+
readonly minWidth?: string | undefined;
|
|
107
|
+
readonly maxWidth?: string | undefined;
|
|
108
|
+
readonly sortable?: boolean | undefined;
|
|
109
|
+
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
110
|
+
readonly mustSort?: boolean | undefined;
|
|
111
|
+
}[] | Defaults["headers"];
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export declare const Y_DATA_TABLE_HEADER_KEY: InjectionKey<{
|
|
115
|
+
headers: Ref<InternalDataTableHeader[][]>;
|
|
116
|
+
columns: Ref<InternalDataTableHeader[]>;
|
|
117
|
+
}>;
|
|
118
|
+
type HeaderProps = {
|
|
119
|
+
headers: DeepReadonly<DataTableHeader[]> | undefined;
|
|
120
|
+
};
|
|
121
|
+
export declare function createHeader(props: HeaderProps, options?: {
|
|
122
|
+
enableSelect?: Ref<boolean>;
|
|
123
|
+
}): {
|
|
124
|
+
headers: Ref<{
|
|
125
|
+
key: string;
|
|
126
|
+
text: string;
|
|
127
|
+
value?: any;
|
|
128
|
+
colspan?: number | undefined;
|
|
129
|
+
rowspan?: number | undefined;
|
|
130
|
+
fixed?: boolean | "left" | "right" | undefined;
|
|
131
|
+
classes?: string | string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
132
|
+
headerClasses?: string | string[] | undefined;
|
|
133
|
+
align?: "start" | "end" | "center" | undefined;
|
|
134
|
+
width?: string | number | undefined;
|
|
135
|
+
minWidth?: string | undefined;
|
|
136
|
+
maxWidth?: string | undefined;
|
|
137
|
+
sortable: boolean;
|
|
138
|
+
sort?: import('../types').DataTableCompareFn | undefined;
|
|
139
|
+
mustSort?: boolean | undefined;
|
|
140
|
+
fixedOffset?: number | undefined;
|
|
141
|
+
lastFixed?: boolean | undefined;
|
|
142
|
+
rightOffset?: number | undefined;
|
|
143
|
+
}[][], InternalDataTableHeader[][] | {
|
|
144
|
+
key: string;
|
|
145
|
+
text: string;
|
|
146
|
+
value?: any;
|
|
147
|
+
colspan?: number | undefined;
|
|
148
|
+
rowspan?: number | undefined;
|
|
149
|
+
fixed?: boolean | "left" | "right" | undefined;
|
|
150
|
+
classes?: string | string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
151
|
+
headerClasses?: string | string[] | undefined;
|
|
152
|
+
align?: "start" | "end" | "center" | undefined;
|
|
153
|
+
width?: string | number | undefined;
|
|
154
|
+
minWidth?: string | undefined;
|
|
155
|
+
maxWidth?: string | undefined;
|
|
156
|
+
sortable: boolean;
|
|
157
|
+
sort?: import('../types').DataTableCompareFn | undefined;
|
|
158
|
+
mustSort?: boolean | undefined;
|
|
159
|
+
fixedOffset?: number | undefined;
|
|
160
|
+
lastFixed?: boolean | undefined;
|
|
161
|
+
rightOffset?: number | undefined;
|
|
162
|
+
}[][]>;
|
|
163
|
+
columns: Ref<{
|
|
164
|
+
key: string;
|
|
165
|
+
text: string;
|
|
166
|
+
value?: any;
|
|
167
|
+
colspan?: number | undefined;
|
|
168
|
+
rowspan?: number | undefined;
|
|
169
|
+
fixed?: boolean | "left" | "right" | undefined;
|
|
170
|
+
classes?: string | string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
171
|
+
headerClasses?: string | string[] | undefined;
|
|
172
|
+
align?: "start" | "end" | "center" | undefined;
|
|
173
|
+
width?: string | number | undefined;
|
|
174
|
+
minWidth?: string | undefined;
|
|
175
|
+
maxWidth?: string | undefined;
|
|
176
|
+
sortable: boolean;
|
|
177
|
+
sort?: import('../types').DataTableCompareFn | undefined;
|
|
178
|
+
mustSort?: boolean | undefined;
|
|
179
|
+
fixedOffset?: number | undefined;
|
|
180
|
+
lastFixed?: boolean | undefined;
|
|
181
|
+
rightOffset?: number | undefined;
|
|
182
|
+
}[], InternalDataTableHeader[] | {
|
|
183
|
+
key: string;
|
|
184
|
+
text: string;
|
|
185
|
+
value?: any;
|
|
186
|
+
colspan?: number | undefined;
|
|
187
|
+
rowspan?: number | undefined;
|
|
188
|
+
fixed?: boolean | "left" | "right" | undefined;
|
|
189
|
+
classes?: string | string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
190
|
+
headerClasses?: string | string[] | undefined;
|
|
191
|
+
align?: "start" | "end" | "center" | undefined;
|
|
192
|
+
width?: string | number | undefined;
|
|
193
|
+
minWidth?: string | undefined;
|
|
194
|
+
maxWidth?: string | undefined;
|
|
195
|
+
sortable: boolean;
|
|
196
|
+
sort?: import('../types').DataTableCompareFn | undefined;
|
|
197
|
+
mustSort?: boolean | undefined;
|
|
198
|
+
fixedOffset?: number | undefined;
|
|
199
|
+
lastFixed?: boolean | undefined;
|
|
200
|
+
rightOffset?: number | undefined;
|
|
201
|
+
}[]>;
|
|
202
|
+
};
|
|
203
|
+
export declare function useHeader(): {
|
|
204
|
+
headers: Ref<InternalDataTableHeader[][], InternalDataTableHeader[][]>;
|
|
205
|
+
columns: Ref<InternalDataTableHeader[], InternalDataTableHeader[]>;
|
|
206
|
+
};
|
|
207
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { PropType, Ref } from 'vue';
|
|
2
|
+
import { DataTableItem, InternalDataTableHeader } from '../types';
|
|
3
|
+
|
|
4
|
+
export type DataTableItemsProps = {
|
|
5
|
+
items: any[];
|
|
6
|
+
itemKey: any;
|
|
7
|
+
itemSelectable: any;
|
|
8
|
+
returnItem: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const pressDataTableItemsProps: <Defaults extends {
|
|
11
|
+
items?: unknown;
|
|
12
|
+
itemKey?: unknown;
|
|
13
|
+
itemSelectable?: unknown;
|
|
14
|
+
returnItem?: unknown;
|
|
15
|
+
} = {}>(defaults?: Defaults | undefined) => {
|
|
16
|
+
items: unknown extends Defaults["items"] ? {
|
|
17
|
+
type: PropType<any[]>;
|
|
18
|
+
default: () => never[];
|
|
19
|
+
} : Omit<{
|
|
20
|
+
type: PropType<any[]>;
|
|
21
|
+
default: () => never[];
|
|
22
|
+
}, "default" | "type"> & {
|
|
23
|
+
type: PropType<unknown extends Defaults["items"] ? any[] : any[] | Defaults["items"]>;
|
|
24
|
+
default: unknown extends Defaults["items"] ? any[] : any[] | Defaults["items"];
|
|
25
|
+
};
|
|
26
|
+
itemKey: unknown extends Defaults["itemKey"] ? {
|
|
27
|
+
type: PropType<any>;
|
|
28
|
+
default: string;
|
|
29
|
+
} : Omit<{
|
|
30
|
+
type: PropType<any>;
|
|
31
|
+
default: string;
|
|
32
|
+
}, "default" | "type"> & {
|
|
33
|
+
type: PropType<unknown extends Defaults["itemKey"] ? any : any>;
|
|
34
|
+
default: unknown extends Defaults["itemKey"] ? any : any;
|
|
35
|
+
};
|
|
36
|
+
itemSelectable: unknown extends Defaults["itemSelectable"] ? {
|
|
37
|
+
type: PropType<any>;
|
|
38
|
+
default: null;
|
|
39
|
+
} : Omit<{
|
|
40
|
+
type: PropType<any>;
|
|
41
|
+
default: null;
|
|
42
|
+
}, "default" | "type"> & {
|
|
43
|
+
type: PropType<unknown extends Defaults["itemSelectable"] ? any : any>;
|
|
44
|
+
default: unknown extends Defaults["itemSelectable"] ? any : any;
|
|
45
|
+
};
|
|
46
|
+
returnItem: unknown extends Defaults["returnItem"] ? BooleanConstructor : {
|
|
47
|
+
type: PropType<unknown extends Defaults["returnItem"] ? boolean : boolean | Defaults["returnItem"]>;
|
|
48
|
+
default: unknown extends Defaults["returnItem"] ? boolean : boolean | Defaults["returnItem"];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare function updateItem(props: Omit<DataTableItemsProps, 'items'>, item: any, index: number, columns: InternalDataTableHeader[]): DataTableItem;
|
|
52
|
+
export declare function updateItems(props: Omit<DataTableItemsProps, 'items'>, items: DataTableItemsProps['items'], columns: InternalDataTableHeader[]): DataTableItem[];
|
|
53
|
+
export declare function useItems(props: DataTableItemsProps, columns: Ref<InternalDataTableHeader[]>): {
|
|
54
|
+
items: import('vue').ComputedRef<DataTableItem<any>[]>;
|
|
55
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function useRectMeasure(): {
|
|
2
|
+
containerRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
3
|
+
wrapperRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
4
|
+
tableRef: import('vue').Ref<HTMLTableElement | undefined, HTMLTableElement | undefined>;
|
|
5
|
+
containerRect: import('vue').ShallowRef<DOMRectReadOnly | undefined, DOMRectReadOnly | undefined>;
|
|
6
|
+
wrapperRect: import('vue').ShallowRef<DOMRectReadOnly | undefined, DOMRectReadOnly | undefined>;
|
|
7
|
+
tableRect: import('vue').ShallowRef<DOMRectReadOnly | undefined, DOMRectReadOnly | undefined>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { SortOption } from '../types';
|
|
3
|
+
|
|
4
|
+
type DataTableOptionsState = {
|
|
5
|
+
page: Ref<number>;
|
|
6
|
+
pageSize: Ref<number>;
|
|
7
|
+
sortBy: Ref<readonly SortOption[]>;
|
|
8
|
+
search: Ref<string | undefined>;
|
|
9
|
+
};
|
|
10
|
+
export declare function useOptions({ page, pageSize, sortBy, search }: DataTableOptionsState, emit: Function): void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { InjectionKey, PropType, Ref } from 'vue';
|
|
2
|
+
import { DataTableProvidePaginationData } from '../types';
|
|
3
|
+
|
|
4
|
+
export declare const Y_DATA_TABLE_PAGINATION_KEY: InjectionKey<{
|
|
5
|
+
page: Ref<number>;
|
|
6
|
+
pageSize: Ref<number>;
|
|
7
|
+
startIndex: Ref<number>;
|
|
8
|
+
endIndex: Ref<number>;
|
|
9
|
+
pageLength: Ref<number>;
|
|
10
|
+
total: Ref<number>;
|
|
11
|
+
prevPage: () => void;
|
|
12
|
+
nextPage: () => void;
|
|
13
|
+
setPage: (page: number) => void;
|
|
14
|
+
setPageSize: (size: number) => void;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const pressDataTablePaginationProps: <Defaults extends {
|
|
17
|
+
page?: unknown;
|
|
18
|
+
pageSize?: unknown;
|
|
19
|
+
} = {}>(defaults?: Defaults | undefined) => {
|
|
20
|
+
page: unknown extends Defaults["page"] ? {
|
|
21
|
+
type: PropType<string | number>;
|
|
22
|
+
default: number;
|
|
23
|
+
} : Omit<{
|
|
24
|
+
type: PropType<string | number>;
|
|
25
|
+
default: number;
|
|
26
|
+
}, "default" | "type"> & {
|
|
27
|
+
type: PropType<unknown extends Defaults["page"] ? string | number : NonNullable<string | number> | Defaults["page"]>;
|
|
28
|
+
default: unknown extends Defaults["page"] ? string | number : NonNullable<string | number> | Defaults["page"];
|
|
29
|
+
};
|
|
30
|
+
pageSize: unknown extends Defaults["pageSize"] ? {
|
|
31
|
+
type: PropType<string | number>;
|
|
32
|
+
default: number;
|
|
33
|
+
} : Omit<{
|
|
34
|
+
type: PropType<string | number>;
|
|
35
|
+
default: number;
|
|
36
|
+
}, "default" | "type"> & {
|
|
37
|
+
type: PropType<unknown extends Defaults["pageSize"] ? string | number : NonNullable<string | number> | Defaults["pageSize"]>;
|
|
38
|
+
default: unknown extends Defaults["pageSize"] ? string | number : NonNullable<string | number> | Defaults["pageSize"];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type PaginationProps = {
|
|
42
|
+
page: number | string;
|
|
43
|
+
'onUpdate:page': ((v: any) => void) | undefined;
|
|
44
|
+
pageSize: number | string;
|
|
45
|
+
'onUpdate:pageSize': ((v: any) => void) | undefined;
|
|
46
|
+
total?: number | string;
|
|
47
|
+
};
|
|
48
|
+
export declare function createPagination(props: PaginationProps): {
|
|
49
|
+
page: Ref<any, any> & {
|
|
50
|
+
readonly rxValue: any;
|
|
51
|
+
};
|
|
52
|
+
pageSize: Ref<any, any> & {
|
|
53
|
+
readonly rxValue: any;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export declare function providePagination(options: {
|
|
57
|
+
page: Ref<number>;
|
|
58
|
+
pageSize: Ref<number>;
|
|
59
|
+
total: Ref<number>;
|
|
60
|
+
}): DataTableProvidePaginationData;
|
|
61
|
+
export declare function usePagination(): {
|
|
62
|
+
page: Ref<number, number>;
|
|
63
|
+
pageSize: Ref<number, number>;
|
|
64
|
+
startIndex: Ref<number, number>;
|
|
65
|
+
endIndex: Ref<number, number>;
|
|
66
|
+
pageLength: Ref<number, number>;
|
|
67
|
+
total: Ref<number, number>;
|
|
68
|
+
prevPage: () => void;
|
|
69
|
+
nextPage: () => void;
|
|
70
|
+
setPage: (page: number) => void;
|
|
71
|
+
setPageSize: (size: number) => void;
|
|
72
|
+
};
|
|
73
|
+
export declare function usePaginatedItems<T>(options: {
|
|
74
|
+
items: Ref<readonly T[]>;
|
|
75
|
+
startIndex: Ref<number>;
|
|
76
|
+
endIndex: Ref<number>;
|
|
77
|
+
pageSize: Ref<number>;
|
|
78
|
+
}): {
|
|
79
|
+
paginatedItems: import('vue').ComputedRef<readonly T[]>;
|
|
80
|
+
};
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InjectionKey, Ref, ShallowRef } from 'vue';
|
|
2
|
+
import { InternalDataTableHeader } from '../types';
|
|
3
|
+
import { createSorting } from './sorting';
|
|
4
|
+
|
|
5
|
+
export declare const YTableInjectionKey: InjectionKey<{
|
|
6
|
+
tableRef: Ref<HTMLTableElement | undefined>;
|
|
7
|
+
containerRect: ShallowRef<DOMRectReadOnly | undefined>;
|
|
8
|
+
wrapperRef: Ref<HTMLElement | undefined>;
|
|
9
|
+
wrapperRect: ShallowRef<DOMRectReadOnly | undefined>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const YDataTableInjectionKey: InjectionKey<{
|
|
12
|
+
toggleSort: (column: InternalDataTableHeader) => void;
|
|
13
|
+
sortBy: ReturnType<typeof createSorting>['sortBy'];
|
|
14
|
+
headRect: Ref<DOMRectReadOnly | undefined>;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { InjectionKey, PropType, Ref } from 'vue';
|
|
2
|
+
import { deepEqual } from '../../../util/common';
|
|
3
|
+
import { DataTableProvideSelectionData } from '../types';
|
|
4
|
+
import { DataTableItemsProps } from './items';
|
|
5
|
+
|
|
6
|
+
export interface SelectableItem {
|
|
7
|
+
key: string;
|
|
8
|
+
value: any;
|
|
9
|
+
selectable: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface DataTableSelectStrategy {
|
|
12
|
+
showSelectAll: boolean;
|
|
13
|
+
allSelected: (data: {
|
|
14
|
+
allItems: SelectableItem[];
|
|
15
|
+
pageItems: SelectableItem[];
|
|
16
|
+
}) => SelectableItem[];
|
|
17
|
+
select: (data: {
|
|
18
|
+
items: SelectableItem[];
|
|
19
|
+
value: boolean;
|
|
20
|
+
selected: Set<unknown>;
|
|
21
|
+
}) => Set<unknown>;
|
|
22
|
+
selectAll: (data: {
|
|
23
|
+
value: boolean;
|
|
24
|
+
allItems: SelectableItem[];
|
|
25
|
+
pageItems: SelectableItem[];
|
|
26
|
+
selected: Set<unknown>;
|
|
27
|
+
}) => Set<unknown>;
|
|
28
|
+
}
|
|
29
|
+
export declare const pressDataTableSelectionProps: <Defaults extends {
|
|
30
|
+
enableSelect?: unknown;
|
|
31
|
+
selectStrategy?: unknown;
|
|
32
|
+
modelValue?: unknown;
|
|
33
|
+
itemComparator?: unknown;
|
|
34
|
+
} = {}>(defaults?: Defaults | undefined) => {
|
|
35
|
+
enableSelect: unknown extends Defaults["enableSelect"] ? BooleanConstructor : {
|
|
36
|
+
type: PropType<unknown extends Defaults["enableSelect"] ? boolean : boolean | Defaults["enableSelect"]>;
|
|
37
|
+
default: unknown extends Defaults["enableSelect"] ? boolean : boolean | Defaults["enableSelect"];
|
|
38
|
+
};
|
|
39
|
+
selectStrategy: unknown extends Defaults["selectStrategy"] ? {
|
|
40
|
+
type: PropType<"page" | "all" | "single">;
|
|
41
|
+
default: string;
|
|
42
|
+
} : Omit<{
|
|
43
|
+
type: PropType<"page" | "all" | "single">;
|
|
44
|
+
default: string;
|
|
45
|
+
}, "default" | "type"> & {
|
|
46
|
+
type: PropType<unknown extends Defaults["selectStrategy"] ? "page" | "all" | "single" : Defaults["selectStrategy"] | NonNullable<"page" | "all" | "single">>;
|
|
47
|
+
default: unknown extends Defaults["selectStrategy"] ? "page" | "all" | "single" : Defaults["selectStrategy"] | NonNullable<"page" | "all" | "single">;
|
|
48
|
+
};
|
|
49
|
+
modelValue: unknown extends Defaults["modelValue"] ? {
|
|
50
|
+
type: PropType<readonly any[]>;
|
|
51
|
+
default: () => never[];
|
|
52
|
+
} : Omit<{
|
|
53
|
+
type: PropType<readonly any[]>;
|
|
54
|
+
default: () => never[];
|
|
55
|
+
}, "default" | "type"> & {
|
|
56
|
+
type: PropType<unknown extends Defaults["modelValue"] ? readonly any[] : readonly any[] | Defaults["modelValue"]>;
|
|
57
|
+
default: unknown extends Defaults["modelValue"] ? readonly any[] : readonly any[] | Defaults["modelValue"];
|
|
58
|
+
};
|
|
59
|
+
itemComparator: unknown extends Defaults["itemComparator"] ? {
|
|
60
|
+
type: PropType<string | typeof deepEqual>;
|
|
61
|
+
default: () => typeof deepEqual;
|
|
62
|
+
} : Omit<{
|
|
63
|
+
type: PropType<string | typeof deepEqual>;
|
|
64
|
+
default: () => typeof deepEqual;
|
|
65
|
+
}, "default" | "type"> & {
|
|
66
|
+
type: PropType<unknown extends Defaults["itemComparator"] ? string | typeof deepEqual : Defaults["itemComparator"] | NonNullable<string | typeof deepEqual>>;
|
|
67
|
+
default: unknown extends Defaults["itemComparator"] ? string | typeof deepEqual : Defaults["itemComparator"] | NonNullable<string | typeof deepEqual>;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
type DataTableSelectionProps = Pick<DataTableItemsProps, 'itemKey'> & {
|
|
71
|
+
modelValue: readonly any[];
|
|
72
|
+
selectStrategy: 'single' | 'page' | 'all';
|
|
73
|
+
'onUpdate:modelValue': ((value: any[]) => void) | undefined;
|
|
74
|
+
itemComparator: ((a: any, b: any) => boolean) | string;
|
|
75
|
+
};
|
|
76
|
+
export declare const Y_DATA_TABLE_SELECTION_KEY: InjectionKey<ReturnType<typeof provideSelection>>;
|
|
77
|
+
export declare function provideSelection(props: DataTableSelectionProps, { allItems, pageItems, }: {
|
|
78
|
+
allItems: Ref<SelectableItem[]>;
|
|
79
|
+
pageItems: Ref<SelectableItem[]>;
|
|
80
|
+
}): DataTableProvideSelectionData;
|
|
81
|
+
export declare function useSelection(): DataTableProvideSelectionData;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { SortOption } from '../types';
|
|
3
|
+
|
|
4
|
+
export declare function useSortedItems(props: any, items: Ref<any[]>, sortBy: Ref<readonly SortOption[]>, options?: {}): {
|
|
5
|
+
sortedItems: import('vue').ComputedRef<any[]>;
|
|
6
|
+
};
|
|
7
|
+
export declare function sortItems(items: any[], sortOptions: readonly SortOption[], locale: string): any[];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PropType, Ref } from 'vue';
|
|
2
|
+
import { DataTableProvideSortingData, InternalDataTableHeader, SortOption } from '../types';
|
|
3
|
+
|
|
4
|
+
export declare const pressDataTableSortProps: <Defaults extends {
|
|
5
|
+
sortBy?: unknown;
|
|
6
|
+
multiSort?: unknown;
|
|
7
|
+
} = {}>(defaults?: Defaults | undefined) => {
|
|
8
|
+
sortBy: unknown extends Defaults["sortBy"] ? {
|
|
9
|
+
type: PropType<readonly {
|
|
10
|
+
readonly key: string;
|
|
11
|
+
readonly order?: boolean | "desc" | "asc" | undefined;
|
|
12
|
+
}[]>;
|
|
13
|
+
default: () => never[];
|
|
14
|
+
} : Omit<{
|
|
15
|
+
type: PropType<readonly {
|
|
16
|
+
readonly key: string;
|
|
17
|
+
readonly order?: boolean | "desc" | "asc" | undefined;
|
|
18
|
+
}[]>;
|
|
19
|
+
default: () => never[];
|
|
20
|
+
}, "default" | "type"> & {
|
|
21
|
+
type: PropType<unknown extends Defaults["sortBy"] ? readonly {
|
|
22
|
+
readonly key: string;
|
|
23
|
+
readonly order?: boolean | "desc" | "asc" | undefined;
|
|
24
|
+
}[] : readonly {
|
|
25
|
+
readonly key: string;
|
|
26
|
+
readonly order?: boolean | "desc" | "asc" | undefined;
|
|
27
|
+
}[] | Defaults["sortBy"]>;
|
|
28
|
+
default: unknown extends Defaults["sortBy"] ? readonly {
|
|
29
|
+
readonly key: string;
|
|
30
|
+
readonly order?: boolean | "desc" | "asc" | undefined;
|
|
31
|
+
}[] : readonly {
|
|
32
|
+
readonly key: string;
|
|
33
|
+
readonly order?: boolean | "desc" | "asc" | undefined;
|
|
34
|
+
}[] | Defaults["sortBy"];
|
|
35
|
+
};
|
|
36
|
+
multiSort: unknown extends Defaults["multiSort"] ? BooleanConstructor : {
|
|
37
|
+
type: PropType<unknown extends Defaults["multiSort"] ? boolean : boolean | Defaults["multiSort"]>;
|
|
38
|
+
default: unknown extends Defaults["multiSort"] ? boolean : boolean | Defaults["multiSort"];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type SortProps = {
|
|
42
|
+
sortBy: readonly SortOption[];
|
|
43
|
+
'onUpdate:sortBy': ((value: any) => void) | undefined;
|
|
44
|
+
multiSort: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare function createSorting(props: SortProps): {
|
|
47
|
+
sortBy: Ref<any, any> & {
|
|
48
|
+
readonly rxValue: any;
|
|
49
|
+
};
|
|
50
|
+
multiSort: Ref<boolean, boolean>;
|
|
51
|
+
};
|
|
52
|
+
export declare function provideSorting(options: {
|
|
53
|
+
sortBy: Ref<readonly SortOption[]>;
|
|
54
|
+
page?: Ref<number>;
|
|
55
|
+
multiSort?: Ref<boolean>;
|
|
56
|
+
}): DataTableProvideSortingData;
|
|
57
|
+
export declare function useSorting(): {
|
|
58
|
+
sortBy: Ref<readonly SortOption[], readonly SortOption[]>;
|
|
59
|
+
toggleSort: (col: InternalDataTableHeader) => void;
|
|
60
|
+
isSorted: (col: InternalDataTableHeader) => boolean;
|
|
61
|
+
};
|
|
62
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComputedRef, Ref, UnwrapRef } from 'vue';
|
|
2
|
-
import { SelectableItem } from '../
|
|
2
|
+
import { SelectableItem } from '../composables/selection';
|
|
3
3
|
import { DataTableCompareFn } from './common';
|
|
4
4
|
import { DataTableHeader, InternalDataTableHeader } from './header';
|
|
5
5
|
import { DataTableItem, ItemKeySlot } from './item';
|
|
@@ -54,5 +54,6 @@ export type YDataTableSlotProps = {
|
|
|
54
54
|
items: readonly DataTableItem[];
|
|
55
55
|
columns: InternalDataTableHeader[];
|
|
56
56
|
headers: InternalDataTableHeader[][];
|
|
57
|
+
TableBodyRef: Ref<any>;
|
|
57
58
|
};
|
|
58
59
|
export type FixedPropType = 'lead' | 'trail' | 'lead-last' | 'trail-last';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SelectableItem, provideSelection } from '../
|
|
1
|
+
import { SelectableItem, provideSelection } from '../composables/selection';
|
|
2
2
|
import { InternalDataTableHeader } from './header';
|
|
3
3
|
|
|
4
4
|
type ItemSlotBase<T> = {
|
|
@@ -17,5 +17,6 @@ export interface DataTableItem<T = any> extends SelectableItem {
|
|
|
17
17
|
index: number;
|
|
18
18
|
columns: Record<string, any>;
|
|
19
19
|
raw: T;
|
|
20
|
+
rowRef?: any;
|
|
20
21
|
}
|
|
21
22
|
export {};
|