@pixelium/web-vue 0.0.4 → 0.0.5
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/index.d.ts +162 -120
- package/dist/pixelium-vue.cjs +1 -1
- package/dist/pixelium-vue.css +1 -1
- package/dist/pixelium-vue.js +19 -21
- package/dist/pixelium-vue.umd.cjs +1 -1
- package/es/alert/index.d.ts +3 -2
- package/es/alert/type.d.ts +15 -15
- package/es/aside/index.d.ts +3 -2
- package/es/auto-complete/index.d.ts +2 -1
- package/es/avatar/index.d.ts +3 -2
- package/es/back-top/index.d.ts +21 -0
- package/es/back-top/type.d.ts +46 -0
- package/es/badge/index.d.ts +3 -2
- package/es/badge/type.d.ts +12 -12
- package/es/breadcrumb/index.d.ts +12 -0
- package/es/breadcrumb/type.d.ts +52 -0
- package/es/breadcrumb-item/index.d.ts +27 -0
- package/es/breadcrumb-item/type.d.ts +49 -0
- package/es/button/index.d.ts +3 -2
- package/es/button-group/index.d.ts +3 -2
- package/es/checkbox/index.d.ts +3 -2
- package/es/checkbox-group/index.d.ts +3 -2
- package/es/col/index.d.ts +3 -2
- package/es/container/index.d.ts +3 -2
- package/es/dialog/dialog-wrapped.d.ts +9 -8
- package/es/dialog/dialog.d.ts +9 -8
- package/es/dialog/type.d.ts +58 -58
- package/es/divider/index.d.ts +2 -1
- package/es/drop-down/index.d.ts +36 -0
- package/es/drop-down/type.d.ts +140 -0
- package/es/drop-down-list/index.d.ts +10 -0
- package/es/drop-down-list/type.d.ts +19 -0
- package/es/empty/index.d.ts +3 -2
- package/es/footer/index.d.ts +3 -2
- package/es/form/index.d.ts +3 -2
- package/es/form-item/index.d.ts +9 -8
- package/es/grid/index.d.ts +3 -2
- package/es/grid-item/index.d.ts +3 -2
- package/es/header/index.d.ts +3 -2
- package/es/icon/index.d.ts +3 -2
- package/es/image/index.d.ts +3 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/input/index.d.ts +7 -6
- package/es/input-group/index.d.ts +3 -2
- package/es/input-group-label/index.d.ts +3 -2
- package/es/input-number/index.d.ts +5 -4
- package/es/input-tag/index.css +1 -0
- package/es/input-tag/index.d.ts +13 -12
- package/es/link/index.d.ts +3 -2
- package/es/main/index.d.ts +3 -2
- package/es/mask/index.d.ts +2 -1
- package/es/menu/index.d.ts +24 -0
- package/es/menu/type.d.ts +145 -0
- package/es/menu-group/index.d.ts +16 -0
- package/es/menu-group/type.d.ts +19 -0
- package/es/menu-item/index.d.ts +26 -0
- package/es/menu-item/type.d.ts +44 -0
- package/es/message/index.d.ts +2 -1
- package/es/message-box/message-box-wrapped.d.ts +2 -1
- package/es/message-box/message-box.d.ts +2 -1
- package/es/option-list/index.d.ts +2 -1
- package/es/popconfirm/index.d.ts +2 -1
- package/es/popconfirm/type.d.ts +35 -35
- package/es/popover/index.d.ts +2 -1
- package/es/popup/index.d.ts +2 -1
- package/es/popup/use-mouse-position.d.ts +1 -0
- package/es/popup/util.d.ts +6 -0
- package/es/popup-content/index.d.ts +5 -4
- package/es/popup-portal/index.d.ts +5 -4
- package/es/popup-trigger/index.d.ts +2 -1
- package/es/popup-wrapper/index.d.ts +5 -4
- package/es/popup-wrapper/use-popup-wrapper-manager.d.ts +22 -1
- package/es/progress/index.d.ts +4 -3
- package/es/progress/type.d.ts +14 -14
- package/es/radio/index.d.ts +3 -2
- package/es/radio-group/index.d.ts +3 -2
- package/es/row/index.d.ts +3 -2
- package/es/scroll-bar/index.d.ts +40 -0
- package/es/scroll-bar/type.d.ts +85 -0
- package/es/scroll-bar/use-scroll-bar.d.ts +1 -0
- package/es/select/index.css +1 -1
- package/es/select/index.d.ts +2 -1
- package/es/share/hook/use-expand.d.ts +2 -0
- package/es/share/hook/use-hidden-measure.d.ts +1 -0
- package/es/share/hook/use-pixel-size.d.ts +1 -0
- package/es/share/util/locale.d.ts +4 -0
- package/es/share/util/scroll.d.ts +2 -0
- package/es/slider/index.d.ts +16 -15
- package/es/space/index.d.ts +2 -1
- package/es/spin/index.d.ts +6 -5
- package/es/submenu/index.d.ts +28 -0
- package/es/submenu/type.d.ts +60 -0
- package/es/switch/index.d.ts +3 -2
- package/es/table/index.d.ts +68 -0
- package/es/table/module/cell-span.d.ts +7 -0
- package/es/table/module/column.d.ts +46 -0
- package/es/table/module/draw.d.ts +11 -0
- package/es/table/module/event.d.ts +9 -0
- package/es/table/module/expandable.d.ts +20 -0
- package/es/table/module/filterable.d.ts +9 -0
- package/es/table/module/selection.d.ts +20 -0
- package/es/table/module/share.d.ts +8 -0
- package/es/table/module/sortable.d.ts +10 -0
- package/es/table/module/summary.d.ts +2 -0
- package/es/table/type.d.ts +733 -0
- package/es/tag/index.css +3 -3
- package/es/tag/index.d.ts +3 -2
- package/es/text-outline/index.d.ts +3 -2
- package/es/textarea/index.d.ts +5 -4
- package/es/theme/theme.d.ts +21 -0
- package/es/{share/util → theme}/theme.js +22 -22
- package/es/tooltip/index.d.ts +2 -1
- package/es/vendor.js +1 -1
- package/es/virtual-list/index.d.ts +2 -1
- package/package.json +1 -1
- package/es/share/hook/use-props-detect.d.ts +0 -2
- package/es/share/util/pixel.d.ts +0 -4
- package/es/share/util/theme.d.ts +0 -7
|
@@ -0,0 +1,733 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { EmitEvent, RestAttrs } from '../share/type';
|
|
3
|
+
import type { JSX } from 'vue/jsx-runtime';
|
|
4
|
+
import type { Option } from '../share/type';
|
|
5
|
+
import type { PopoverEvents, PopoverProps } from '../popover/type';
|
|
6
|
+
export type TableProps = {
|
|
7
|
+
/**
|
|
8
|
+
* @property {TableData[]} [data=[]]
|
|
9
|
+
* @version 0.1.0
|
|
10
|
+
*/
|
|
11
|
+
data?: TableData[];
|
|
12
|
+
/**
|
|
13
|
+
* @property {TableColumn[]} [columns=[]]
|
|
14
|
+
* @version 0.1.0
|
|
15
|
+
*/
|
|
16
|
+
columns?: TableColumn[];
|
|
17
|
+
/**
|
|
18
|
+
* @property {boolean | TableBordered} [bordered=true]
|
|
19
|
+
* @version 0.1.0
|
|
20
|
+
*/
|
|
21
|
+
bordered?: boolean | TableBordered;
|
|
22
|
+
/**
|
|
23
|
+
* @property {'normal' | 'striped' | 'checkered'} [variant='normal']
|
|
24
|
+
* @version 0.1.0
|
|
25
|
+
*/
|
|
26
|
+
variant?: 'normal' | 'striped' | 'checkered';
|
|
27
|
+
/**
|
|
28
|
+
* @property {boolean} [fixedHead=true]
|
|
29
|
+
* @version 0.1.0
|
|
30
|
+
*/
|
|
31
|
+
fixedHead?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @property {(options: TableOptionsArg) => void | { colspan?: number, rowspan?: number}} [spanMethod]
|
|
34
|
+
* @version 0.1.0
|
|
35
|
+
*/
|
|
36
|
+
spanMethod?: (options: TableOptionsArg) => void | {
|
|
37
|
+
colspan?: number;
|
|
38
|
+
rowspan?: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* @property {string} [rowKey='key']
|
|
42
|
+
* @version 0.1.0
|
|
43
|
+
*/
|
|
44
|
+
rowKey?: string;
|
|
45
|
+
/**
|
|
46
|
+
* @property {{ x?: number | string }} [scroll]
|
|
47
|
+
* @version 0.1.0
|
|
48
|
+
*/
|
|
49
|
+
scroll?: {
|
|
50
|
+
x?: number | string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* @property {boolean | TableSelection} [selection=false]
|
|
54
|
+
* @version 0.1.0
|
|
55
|
+
*/
|
|
56
|
+
selection?: boolean | TableSelection;
|
|
57
|
+
/**
|
|
58
|
+
* @property {any[] | null} [selectedKeys]
|
|
59
|
+
* @version 0.1.0
|
|
60
|
+
*/
|
|
61
|
+
selectedKeys?: any[] | null;
|
|
62
|
+
/**
|
|
63
|
+
* @property {any[] | null} [defaultSelectedKeys]
|
|
64
|
+
* @version 0.1.0
|
|
65
|
+
*/
|
|
66
|
+
defaultSelectedKeys?: any[] | null;
|
|
67
|
+
/**
|
|
68
|
+
* @property {boolean | TableExpandable} [expandable=false]
|
|
69
|
+
* @version 0.1.0
|
|
70
|
+
*/
|
|
71
|
+
expandable?: boolean | TableExpandable;
|
|
72
|
+
/**
|
|
73
|
+
* @property {any[] | null} [expandedKeys]
|
|
74
|
+
* @version 0.1.0
|
|
75
|
+
*/
|
|
76
|
+
expandedKeys?: any[] | null;
|
|
77
|
+
/**
|
|
78
|
+
* @property {any[] | null} [defaultExpandedKeys]
|
|
79
|
+
* @version 0.1.0
|
|
80
|
+
*/
|
|
81
|
+
defaultExpandedKeys?: any[] | null;
|
|
82
|
+
/**
|
|
83
|
+
* @property {TableSummary} [summary]
|
|
84
|
+
* @version 0.1.0
|
|
85
|
+
*/
|
|
86
|
+
summary?: TableSummary;
|
|
87
|
+
/**
|
|
88
|
+
* @property {FilterValue | null} [filterValue]
|
|
89
|
+
* @version 0.1.0
|
|
90
|
+
*/
|
|
91
|
+
filterValue?: FilterValue | null;
|
|
92
|
+
/**
|
|
93
|
+
* @property {FilterValue | null} [defaultFilterValue]
|
|
94
|
+
* @version 0.1.0
|
|
95
|
+
*/
|
|
96
|
+
defaultFilterValue?: FilterValue | null;
|
|
97
|
+
/**
|
|
98
|
+
* @property {SortOrder | null} [sortOrder]
|
|
99
|
+
* @version 0.1.0
|
|
100
|
+
*/
|
|
101
|
+
sortOrder?: SortOrder | null;
|
|
102
|
+
/**
|
|
103
|
+
* @property {SortOrder | null} [defaultSortOrder]
|
|
104
|
+
* @version 0.1.0
|
|
105
|
+
*/
|
|
106
|
+
defaultSortOrder?: SortOrder | null;
|
|
107
|
+
/**
|
|
108
|
+
* @property {number} [borderRadius]
|
|
109
|
+
* @version 0.1.0
|
|
110
|
+
*/
|
|
111
|
+
borderRadius?: number;
|
|
112
|
+
/**
|
|
113
|
+
* @property {boolean} [pollSizeChange]
|
|
114
|
+
* @version 0.1.0
|
|
115
|
+
*/
|
|
116
|
+
pollSizeChange?: boolean;
|
|
117
|
+
};
|
|
118
|
+
export type TableEvents = {
|
|
119
|
+
/**
|
|
120
|
+
* @event update:selectedKey
|
|
121
|
+
* @version 0.1.0
|
|
122
|
+
* @param {any[]} value
|
|
123
|
+
*/
|
|
124
|
+
'update:selectedKeys': [value: any[]];
|
|
125
|
+
/**
|
|
126
|
+
* @event select
|
|
127
|
+
* @version 0.1.0
|
|
128
|
+
* @param {boolean} value
|
|
129
|
+
* @param {any} key
|
|
130
|
+
* @param {TableData} record
|
|
131
|
+
* @param {InputEvent} event
|
|
132
|
+
*/
|
|
133
|
+
select: [value: boolean, key: any, record: TableData, event: InputEvent];
|
|
134
|
+
/**
|
|
135
|
+
* @event selectAll
|
|
136
|
+
* @version 0.1.0
|
|
137
|
+
* @param {boolean} value
|
|
138
|
+
* @param {InputEvent} event
|
|
139
|
+
*/
|
|
140
|
+
selectAll: [value: boolean, event: InputEvent];
|
|
141
|
+
/**
|
|
142
|
+
* @event selectedChange
|
|
143
|
+
* @version 0.1.0
|
|
144
|
+
* @param {any[]} value
|
|
145
|
+
*/
|
|
146
|
+
selectedChange: [value: any[]];
|
|
147
|
+
/**
|
|
148
|
+
* @event update:expandedKeys
|
|
149
|
+
* @version 0.1.0
|
|
150
|
+
* @param {any[]} value
|
|
151
|
+
*/
|
|
152
|
+
'update:expandedKeys': [value: any[]];
|
|
153
|
+
/**
|
|
154
|
+
* @event expand
|
|
155
|
+
* @version 0.1.0
|
|
156
|
+
* @param {boolean} value
|
|
157
|
+
* @param {any} key
|
|
158
|
+
* @param {TableData} record
|
|
159
|
+
* @param {MouseEvent} event
|
|
160
|
+
*/
|
|
161
|
+
expand: [value: boolean, key: any, record: TableData, event: MouseEvent];
|
|
162
|
+
/**
|
|
163
|
+
* @event expandedChange
|
|
164
|
+
* @version 0.1.0
|
|
165
|
+
* @param {any[]} value
|
|
166
|
+
*/
|
|
167
|
+
expandedChange: [value: any[]];
|
|
168
|
+
/**
|
|
169
|
+
* @event update:filterValue
|
|
170
|
+
* @version 0.1.0
|
|
171
|
+
* @param {FilterValue} value
|
|
172
|
+
*/
|
|
173
|
+
'update:filterValue': [value: FilterValue];
|
|
174
|
+
/**
|
|
175
|
+
* @event filterSelect
|
|
176
|
+
* @version 0.1.0
|
|
177
|
+
* @param {any[]} value
|
|
178
|
+
* @param {string | number | symbol} key
|
|
179
|
+
* @param {TableFilterOption | string} option
|
|
180
|
+
* @param {TableColumn} column
|
|
181
|
+
* @param {InputEvent} event
|
|
182
|
+
*/
|
|
183
|
+
filterSelect: [
|
|
184
|
+
value: any[],
|
|
185
|
+
key: string | number | symbol,
|
|
186
|
+
option: TableFilterOption | string,
|
|
187
|
+
column: TableColumn,
|
|
188
|
+
event: InputEvent
|
|
189
|
+
];
|
|
190
|
+
/**
|
|
191
|
+
* @event filterConfirm
|
|
192
|
+
* @version 0.1.0
|
|
193
|
+
* @param {string | number | symbol} key
|
|
194
|
+
* @param {MouseEvent} event
|
|
195
|
+
*/
|
|
196
|
+
filterConfirm: [key: string | number | symbol, event: MouseEvent];
|
|
197
|
+
/**
|
|
198
|
+
* @event filterReset
|
|
199
|
+
* @version 0.1.0
|
|
200
|
+
* @param {string | number | symbol} key
|
|
201
|
+
* @param {MouseEvent} event
|
|
202
|
+
*/
|
|
203
|
+
filterReset: [key: string | number | symbol, event: MouseEvent];
|
|
204
|
+
/**
|
|
205
|
+
* @event filterChange
|
|
206
|
+
* @version 0.1.0
|
|
207
|
+
* @param {FilterValue} value
|
|
208
|
+
*/
|
|
209
|
+
filterChange: [value: FilterValue];
|
|
210
|
+
/**
|
|
211
|
+
* @event update:sortOrder
|
|
212
|
+
* @version 0.1.0
|
|
213
|
+
* @param {SortOrder} value
|
|
214
|
+
*/
|
|
215
|
+
'update:sortOrder': [value: SortOrder];
|
|
216
|
+
/**
|
|
217
|
+
* @event sortSelect
|
|
218
|
+
* @version 0.1.0
|
|
219
|
+
* @param {'asc' | 'desc' | 'none'} value
|
|
220
|
+
* @param {string | number | symbol} key
|
|
221
|
+
* @param {TableColumn} column
|
|
222
|
+
* @param {MouseEvent} event
|
|
223
|
+
*/
|
|
224
|
+
sortSelect: [
|
|
225
|
+
value: 'asc' | 'desc' | 'none',
|
|
226
|
+
key: string | number | symbol,
|
|
227
|
+
column: TableColumn,
|
|
228
|
+
event: MouseEvent
|
|
229
|
+
];
|
|
230
|
+
/**
|
|
231
|
+
* @event sortOrderChange
|
|
232
|
+
* @version 0.1.0
|
|
233
|
+
* @param {SortOrder} value
|
|
234
|
+
*/
|
|
235
|
+
sortOrderChange: [value: SortOrder];
|
|
236
|
+
/**
|
|
237
|
+
* @event cellMouseenter
|
|
238
|
+
* @version 0.1.0
|
|
239
|
+
* @param {TableColumn} column
|
|
240
|
+
* @param {TableData} record
|
|
241
|
+
* @param {number} colIndex
|
|
242
|
+
* @param {number} rowIndex
|
|
243
|
+
* @param {MouseEvent} event
|
|
244
|
+
*/
|
|
245
|
+
cellMouseenter: [
|
|
246
|
+
column: TableColumn,
|
|
247
|
+
record: TableData,
|
|
248
|
+
colIndex: number,
|
|
249
|
+
rowIndex: number,
|
|
250
|
+
event: MouseEvent
|
|
251
|
+
];
|
|
252
|
+
/**
|
|
253
|
+
* @event cellMouseleave
|
|
254
|
+
* @version 0.1.0
|
|
255
|
+
* @param {TableColumn} column
|
|
256
|
+
* @param {TableData} record
|
|
257
|
+
* @param {number} colIndex
|
|
258
|
+
* @param {number} rowIndex
|
|
259
|
+
* @param {MouseEvent} event
|
|
260
|
+
*/
|
|
261
|
+
cellMouseleave: [
|
|
262
|
+
column: TableColumn,
|
|
263
|
+
record: TableData,
|
|
264
|
+
colIndex: number,
|
|
265
|
+
rowIndex: number,
|
|
266
|
+
event: MouseEvent
|
|
267
|
+
];
|
|
268
|
+
/**
|
|
269
|
+
* @event cellClick
|
|
270
|
+
* @version 0.1.0
|
|
271
|
+
* @param {TableColumn} column
|
|
272
|
+
* @param {TableData} record
|
|
273
|
+
* @param {number} colIndex
|
|
274
|
+
* @param {number} rowIndex
|
|
275
|
+
* @param {MouseEvent} event
|
|
276
|
+
*/
|
|
277
|
+
cellClick: [
|
|
278
|
+
column: TableColumn,
|
|
279
|
+
record: TableData,
|
|
280
|
+
colIndex: number,
|
|
281
|
+
rowIndex: number,
|
|
282
|
+
event: MouseEvent
|
|
283
|
+
];
|
|
284
|
+
/**
|
|
285
|
+
* @event cellDblclick
|
|
286
|
+
* @version 0.1.0
|
|
287
|
+
* @param {TableColumn} column
|
|
288
|
+
* @param {TableData} record
|
|
289
|
+
* @param {number} colIndex
|
|
290
|
+
* @param {number} rowIndex
|
|
291
|
+
* @param {MouseEvent} event
|
|
292
|
+
*/
|
|
293
|
+
cellDblclick: [
|
|
294
|
+
column: TableColumn,
|
|
295
|
+
record: TableData,
|
|
296
|
+
colIndex: number,
|
|
297
|
+
rowIndex: number,
|
|
298
|
+
event: MouseEvent
|
|
299
|
+
];
|
|
300
|
+
/**
|
|
301
|
+
* @event cellContextmenu
|
|
302
|
+
* @version 0.1.0
|
|
303
|
+
* @param {TableColumn} column
|
|
304
|
+
* @param {TableData} record
|
|
305
|
+
* @param {number} colIndex
|
|
306
|
+
* @param {number} rowIndex
|
|
307
|
+
* @param {MouseEvent} event
|
|
308
|
+
*/
|
|
309
|
+
cellContextmenu: [
|
|
310
|
+
column: TableColumn,
|
|
311
|
+
record: TableData,
|
|
312
|
+
colIndex: number,
|
|
313
|
+
rowIndex: number,
|
|
314
|
+
event: MouseEvent
|
|
315
|
+
];
|
|
316
|
+
/**
|
|
317
|
+
* @event headCellClick
|
|
318
|
+
* @version 0.1.0
|
|
319
|
+
* @param {TableColumn} column
|
|
320
|
+
* @param {number[]} indexPath
|
|
321
|
+
* @param {MouseEvent} event
|
|
322
|
+
*/
|
|
323
|
+
headCellClick: [column: TableColumn, indexPath: number[], event: MouseEvent];
|
|
324
|
+
/**
|
|
325
|
+
* @event headCellDblclick
|
|
326
|
+
* @version 0.1.0
|
|
327
|
+
* @param {TableColumn} column
|
|
328
|
+
* @param {number[]} indexPath
|
|
329
|
+
* @param {MouseEvent} event
|
|
330
|
+
*/
|
|
331
|
+
headCellDblclick: [column: TableColumn, indexPath: number[], event: MouseEvent];
|
|
332
|
+
/**
|
|
333
|
+
* @event headCellContextmenu
|
|
334
|
+
* @version 0.1.0
|
|
335
|
+
* @param {TableColumn} column
|
|
336
|
+
* @param {number[]} indexPath
|
|
337
|
+
* @param {MouseEvent} event
|
|
338
|
+
*/
|
|
339
|
+
headCellContextmenu: [column: TableColumn, indexPath: number[], event: MouseEvent];
|
|
340
|
+
/**
|
|
341
|
+
* @event rowClick
|
|
342
|
+
* @version 0.1.0
|
|
343
|
+
* @param {TableData} record
|
|
344
|
+
* @param {number} rowIndex
|
|
345
|
+
* @param {MouseEvent} event
|
|
346
|
+
*/
|
|
347
|
+
rowClick: [record: TableData, rowIndex: number, event: MouseEvent];
|
|
348
|
+
/**
|
|
349
|
+
* @event rowDblclick
|
|
350
|
+
* @version 0.1.0
|
|
351
|
+
* @param {TableData} record
|
|
352
|
+
* @param {number} rowIndex
|
|
353
|
+
* @param {MouseEvent} event
|
|
354
|
+
*/
|
|
355
|
+
rowDblclick: [record: TableData, rowIndex: number, event: MouseEvent];
|
|
356
|
+
/**
|
|
357
|
+
* @event rowContextmenu
|
|
358
|
+
* @version 0.1.0
|
|
359
|
+
* @param {TableData} record
|
|
360
|
+
* @param {number} rowIndex
|
|
361
|
+
* @param {MouseEvent} event
|
|
362
|
+
*/
|
|
363
|
+
rowContextmenu: [record: TableData, rowIndex: number, event: MouseEvent];
|
|
364
|
+
};
|
|
365
|
+
export type TableSlots = {
|
|
366
|
+
/**
|
|
367
|
+
* @slot \[columns\[\].labelSlotName\]
|
|
368
|
+
* @param {number} rowIndex
|
|
369
|
+
* @param {number} colIndex
|
|
370
|
+
* @param {TableColumn} column
|
|
371
|
+
* @version 0.1.0
|
|
372
|
+
*/
|
|
373
|
+
'[columns[].labelSlotName]': {};
|
|
374
|
+
/**
|
|
375
|
+
* @slot \[columns\[\].slotName\]
|
|
376
|
+
* @param {number} colIndex
|
|
377
|
+
* @param {number} rowIndex
|
|
378
|
+
* @param {TableColumn} column
|
|
379
|
+
* @param {TableData} record
|
|
380
|
+
* @version 0.1.0
|
|
381
|
+
*/
|
|
382
|
+
'[columns[].slotName]': {};
|
|
383
|
+
/**
|
|
384
|
+
* @slot expand
|
|
385
|
+
* @param {number} rowIndex
|
|
386
|
+
* @param {TableData} record
|
|
387
|
+
* @version 0.1.0
|
|
388
|
+
*/
|
|
389
|
+
expand: {};
|
|
390
|
+
};
|
|
391
|
+
export type TableExpose = {
|
|
392
|
+
getCurrentData: () => TableData[];
|
|
393
|
+
};
|
|
394
|
+
export type TableData = {
|
|
395
|
+
/**
|
|
396
|
+
* @property {boolean | string | (( arg: Pick<TableOptionsArg, 'record' | 'rowIndex'>) => VNode | string | JSX.Element | null | void)} [expand]
|
|
397
|
+
* @version 0.1.0
|
|
398
|
+
*/
|
|
399
|
+
expand?: boolean | string | ((arg: Pick<TableOptionsArg, 'record' | 'rowIndex'>) => VNode | string | JSX.Element | null | void);
|
|
400
|
+
/**
|
|
401
|
+
* @property {boolean} [disabled=false]
|
|
402
|
+
* @version 0.1.0
|
|
403
|
+
*/
|
|
404
|
+
disabled?: boolean;
|
|
405
|
+
/**
|
|
406
|
+
* @property {any} [\[x: string | number | symbol\]]
|
|
407
|
+
* @version 0.1.0
|
|
408
|
+
*/
|
|
409
|
+
[x: string | number | symbol]: any;
|
|
410
|
+
};
|
|
411
|
+
export type TableColumn = {
|
|
412
|
+
/**
|
|
413
|
+
* @property {number | string | symbol} key
|
|
414
|
+
* @version 0.1.0
|
|
415
|
+
*/
|
|
416
|
+
key: number | string | symbol;
|
|
417
|
+
/**
|
|
418
|
+
* @property {string} [label]
|
|
419
|
+
* @version 0.1.0
|
|
420
|
+
*/
|
|
421
|
+
label?: string;
|
|
422
|
+
/**
|
|
423
|
+
* @property {string} [field]
|
|
424
|
+
* @version 0.1.0
|
|
425
|
+
*/
|
|
426
|
+
field?: string;
|
|
427
|
+
/**
|
|
428
|
+
* @property {number} [width=80]
|
|
429
|
+
* @version 0.1.0
|
|
430
|
+
*/
|
|
431
|
+
width?: number;
|
|
432
|
+
/**
|
|
433
|
+
* @property {number} [minWidth=0]
|
|
434
|
+
* @version 0.1.0
|
|
435
|
+
*/
|
|
436
|
+
minWidth?: number;
|
|
437
|
+
/**
|
|
438
|
+
* @property {'left' | 'center' | 'right'} [align='left']
|
|
439
|
+
* @version 0.1.0
|
|
440
|
+
*/
|
|
441
|
+
align?: 'left' | 'center' | 'right';
|
|
442
|
+
/**
|
|
443
|
+
* @property {'left' | 'right' | 'none'} [fixed='none']
|
|
444
|
+
* @version 0.1.0
|
|
445
|
+
*/
|
|
446
|
+
fixed?: 'left' | 'right' | 'none';
|
|
447
|
+
/**
|
|
448
|
+
* @property {string} [slotName]
|
|
449
|
+
* @version 0.1.0
|
|
450
|
+
*/
|
|
451
|
+
slotName?: string;
|
|
452
|
+
/**
|
|
453
|
+
* @property {string | ((arg: TableOptionsArg) => VNode | string | JSX.Element | null | void)} [render]
|
|
454
|
+
* @version 0.1.0
|
|
455
|
+
*/
|
|
456
|
+
render?: string | ((arg: TableOptionsArg) => VNode | string | JSX.Element | null | void);
|
|
457
|
+
/**
|
|
458
|
+
* @property {string} [labelSlotName]
|
|
459
|
+
* @version 0.1.0
|
|
460
|
+
*/
|
|
461
|
+
labelSlotName?: string;
|
|
462
|
+
/**
|
|
463
|
+
* @property {string | ((arg: Omit<TableOptionsArg, 'record'>) => VNode | string | JSX.Element | null | void)} [labelRender]
|
|
464
|
+
* @version 0.1.0
|
|
465
|
+
*/
|
|
466
|
+
labelRender?: string | ((arg: Omit<TableOptionsArg, 'record'>) => VNode | string | JSX.Element | null | void);
|
|
467
|
+
/**
|
|
468
|
+
* @property {TableColumn[]} [children]
|
|
469
|
+
* @version 0.1.0
|
|
470
|
+
*/
|
|
471
|
+
children?: TableColumn[];
|
|
472
|
+
/**
|
|
473
|
+
* @property {TableFilterable} [filterable]
|
|
474
|
+
* @version 0.1.0
|
|
475
|
+
*/
|
|
476
|
+
filterable?: TableFilterable;
|
|
477
|
+
/**
|
|
478
|
+
* @property {TableSortable} [sortable]
|
|
479
|
+
* @version 0.1.0
|
|
480
|
+
*/
|
|
481
|
+
sortable?: TableSortable;
|
|
482
|
+
/**
|
|
483
|
+
* @property {RestAttrs} [cellProps]
|
|
484
|
+
* @version 0.1.0
|
|
485
|
+
*/
|
|
486
|
+
cellProps?: RestAttrs;
|
|
487
|
+
/**
|
|
488
|
+
* @property {RestAttrs} [labelCellProps]
|
|
489
|
+
* @version 0.1.0
|
|
490
|
+
*/
|
|
491
|
+
labelCellProps?: RestAttrs;
|
|
492
|
+
/**
|
|
493
|
+
* @property {RestAttrs} [contentProps]
|
|
494
|
+
* @version 0.1.0
|
|
495
|
+
*/
|
|
496
|
+
contentProps?: RestAttrs;
|
|
497
|
+
/**
|
|
498
|
+
* @property {RestAttrs} [labelContentProps]
|
|
499
|
+
* @version 0.1.0
|
|
500
|
+
*/
|
|
501
|
+
labelContentProps?: RestAttrs;
|
|
502
|
+
};
|
|
503
|
+
export type TableBordered = {
|
|
504
|
+
/**
|
|
505
|
+
* @property {boolean} [table=true]
|
|
506
|
+
* @version 0.1.0
|
|
507
|
+
*/
|
|
508
|
+
table?: boolean;
|
|
509
|
+
/**
|
|
510
|
+
* @property {boolean} [row=true]
|
|
511
|
+
* @version 0.1.0
|
|
512
|
+
*/
|
|
513
|
+
row?: boolean;
|
|
514
|
+
/**
|
|
515
|
+
* @property {boolean} [col=true]
|
|
516
|
+
* @version 0.1.0
|
|
517
|
+
*/
|
|
518
|
+
col?: boolean;
|
|
519
|
+
/**
|
|
520
|
+
* @property {boolean} [head=true]
|
|
521
|
+
* @version 0.1.0
|
|
522
|
+
*/
|
|
523
|
+
head?: boolean;
|
|
524
|
+
/**
|
|
525
|
+
* @property {boolean} [side=true]
|
|
526
|
+
* @version 0.1.0
|
|
527
|
+
*/
|
|
528
|
+
side?: boolean;
|
|
529
|
+
};
|
|
530
|
+
export type TableSelection = {
|
|
531
|
+
/**
|
|
532
|
+
* @property {boolean} [multiple=false]
|
|
533
|
+
* @version 0.1.0
|
|
534
|
+
*/
|
|
535
|
+
multiple?: boolean;
|
|
536
|
+
/**
|
|
537
|
+
* @property {boolean} [showSelectAll=true]
|
|
538
|
+
* @version 0.1.0
|
|
539
|
+
*/
|
|
540
|
+
showSelectAll?: boolean;
|
|
541
|
+
/**
|
|
542
|
+
* @property {string} [label]
|
|
543
|
+
* @version 0.1.0
|
|
544
|
+
*/
|
|
545
|
+
label?: string;
|
|
546
|
+
/**
|
|
547
|
+
* @property {number} [width=48]
|
|
548
|
+
* @version 0.1.0
|
|
549
|
+
*/
|
|
550
|
+
width?: number;
|
|
551
|
+
/**
|
|
552
|
+
* @property {number} [minWidth=0]
|
|
553
|
+
* @version 0.1.0
|
|
554
|
+
*/
|
|
555
|
+
minWidth?: number;
|
|
556
|
+
/**
|
|
557
|
+
* @property {boolean} [fixed=false]
|
|
558
|
+
* @version 0.1.0
|
|
559
|
+
*/
|
|
560
|
+
fixed?: boolean;
|
|
561
|
+
/**
|
|
562
|
+
* @property {boolean} [onlyCurrent=false]
|
|
563
|
+
* @version 0.1.0
|
|
564
|
+
*/
|
|
565
|
+
onlyCurrent?: boolean;
|
|
566
|
+
/**
|
|
567
|
+
* @property {RestAttrs} [cellProps]
|
|
568
|
+
* @version 0.1.0
|
|
569
|
+
*/
|
|
570
|
+
cellProps?: RestAttrs;
|
|
571
|
+
/**
|
|
572
|
+
* @property {RestAttrs} [labelCellProps]
|
|
573
|
+
* @version 0.1.0
|
|
574
|
+
*/
|
|
575
|
+
labelCellProps?: RestAttrs;
|
|
576
|
+
/**
|
|
577
|
+
* @property {RestAttrs} [contentProps]
|
|
578
|
+
* @version 0.1.0
|
|
579
|
+
*/
|
|
580
|
+
contentProps?: RestAttrs;
|
|
581
|
+
/**
|
|
582
|
+
* @property {RestAttrs} [labelContentProps]
|
|
583
|
+
* @version 0.1.0
|
|
584
|
+
*/
|
|
585
|
+
labelContentProps?: RestAttrs;
|
|
586
|
+
};
|
|
587
|
+
export type TableExpandable = {
|
|
588
|
+
/**
|
|
589
|
+
* @property {boolean} [defaultExpandAllRows=false]
|
|
590
|
+
* @version 0.1.0
|
|
591
|
+
*/
|
|
592
|
+
defaultExpandAllRows?: boolean;
|
|
593
|
+
/**
|
|
594
|
+
* @property {string} [label]
|
|
595
|
+
* @version 0.1.0
|
|
596
|
+
*/
|
|
597
|
+
label?: string;
|
|
598
|
+
/**
|
|
599
|
+
* @property {number} [width=48]
|
|
600
|
+
* @version 0.1.0
|
|
601
|
+
*/
|
|
602
|
+
width?: number;
|
|
603
|
+
/**
|
|
604
|
+
* @property {number} [minWidth=0]
|
|
605
|
+
* @version 0.1.0
|
|
606
|
+
*/
|
|
607
|
+
minWidth?: number;
|
|
608
|
+
/**
|
|
609
|
+
* @property {boolean} [fixed=false]
|
|
610
|
+
* @version 0.1.0
|
|
611
|
+
*/
|
|
612
|
+
fixed?: boolean;
|
|
613
|
+
/**
|
|
614
|
+
* @property {RestAttrs} [cellProps]
|
|
615
|
+
* @version 0.1.0
|
|
616
|
+
*/
|
|
617
|
+
cellProps?: RestAttrs;
|
|
618
|
+
/**
|
|
619
|
+
* @property {RestAttrs} [labelCellProps]
|
|
620
|
+
* @version 0.1.0
|
|
621
|
+
*/
|
|
622
|
+
labelCellProps?: RestAttrs;
|
|
623
|
+
/**
|
|
624
|
+
* @property {RestAttrs} [contentProps]
|
|
625
|
+
* @version 0.1.0
|
|
626
|
+
*/
|
|
627
|
+
contentProps?: RestAttrs;
|
|
628
|
+
/**
|
|
629
|
+
* @property {RestAttrs} [labelContentProps]
|
|
630
|
+
* @version 0.1.0
|
|
631
|
+
*/
|
|
632
|
+
labelContentProps?: RestAttrs;
|
|
633
|
+
};
|
|
634
|
+
export type TableSummary = {
|
|
635
|
+
/**
|
|
636
|
+
* @property {TableData | TableData[]} [data]
|
|
637
|
+
* @version 0.1.0
|
|
638
|
+
*/
|
|
639
|
+
data?: TableData | TableData[];
|
|
640
|
+
/**
|
|
641
|
+
* @property {'end' | 'start'} [placement='end']
|
|
642
|
+
* @version 0.1.0
|
|
643
|
+
*/
|
|
644
|
+
placement?: 'end' | 'start';
|
|
645
|
+
/**
|
|
646
|
+
* @property {string | string[]} [summaryText]
|
|
647
|
+
* @version 0.1.0
|
|
648
|
+
*/
|
|
649
|
+
summaryText?: string | string[];
|
|
650
|
+
/**
|
|
651
|
+
* @property {boolean} [fixed=true]
|
|
652
|
+
* @version 0.1.0
|
|
653
|
+
*/
|
|
654
|
+
fixed?: boolean;
|
|
655
|
+
/**
|
|
656
|
+
* @property {(options: TableOptionsArg) => void | { colspan?: number, rowspan?: number }} [spanMethod]
|
|
657
|
+
* @version 0.1.0
|
|
658
|
+
*/
|
|
659
|
+
spanMethod?: (options: TableOptionsArg) => void | {
|
|
660
|
+
colspan?: number;
|
|
661
|
+
rowspan?: number;
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
export interface TableFilterOption<T = any> extends Option<T> {
|
|
665
|
+
disabled?: boolean;
|
|
666
|
+
key?: string | number | symbol;
|
|
667
|
+
}
|
|
668
|
+
export type TableFilterable = {
|
|
669
|
+
/**
|
|
670
|
+
* @property {(string | TableFilterOption)[]} [filterOptions]
|
|
671
|
+
* @version 0.1.0
|
|
672
|
+
*/
|
|
673
|
+
filterOptions?: (string | TableFilterOption)[];
|
|
674
|
+
/**
|
|
675
|
+
* @property {(filteredValue: any[], record: TableData, field?: string) => boolean} [filterMethod]
|
|
676
|
+
* @version 0.1.0
|
|
677
|
+
*/
|
|
678
|
+
filterMethod?: (filteredValue: any[], record: TableData, field?: string) => boolean;
|
|
679
|
+
/**
|
|
680
|
+
* @property {any[] | null} [defaultFilterValue]
|
|
681
|
+
* @version 0.1.0
|
|
682
|
+
*/
|
|
683
|
+
defaultFilterValue?: any[] | null;
|
|
684
|
+
/**
|
|
685
|
+
* @property {boolean} [multiple=false]
|
|
686
|
+
* @version 0.1.0
|
|
687
|
+
*/
|
|
688
|
+
multiple?: boolean;
|
|
689
|
+
/**
|
|
690
|
+
* @property {Omit<PopoverProps, 'visible' | 'content'> & EmitEvent<PopoverEvents>} [popoverProps]
|
|
691
|
+
* @version 0.1.0
|
|
692
|
+
*/
|
|
693
|
+
popoverProps?: Omit<PopoverProps, 'visible' | 'content'> & EmitEvent<PopoverEvents>;
|
|
694
|
+
};
|
|
695
|
+
export type TableSortable = {
|
|
696
|
+
/**
|
|
697
|
+
* @property {('asc' | 'desc')[] | Readonly<('asc' | 'desc')[]>} [orders]
|
|
698
|
+
* @version 0.1.0
|
|
699
|
+
*/
|
|
700
|
+
orders?: ('asc' | 'desc')[] | Readonly<('asc' | 'desc')[]>;
|
|
701
|
+
/**
|
|
702
|
+
* @property {'custom' | ((a: TableData, b: TableData, order: 'asc' | 'desc', field?: string) => number)} [sortMethod]
|
|
703
|
+
* @version 0.1.0
|
|
704
|
+
*/
|
|
705
|
+
sortMethod?: 'custom' | ((a: TableData, b: TableData, order: 'asc' | 'desc', field?: string) => number);
|
|
706
|
+
/**
|
|
707
|
+
* @property {'asc' | 'desc' | 'none' | null} [defaultSortOrder]
|
|
708
|
+
* @version 0.1.0
|
|
709
|
+
*/
|
|
710
|
+
defaultSortOrder?: 'asc' | 'desc' | 'none' | null;
|
|
711
|
+
/**
|
|
712
|
+
* @property {boolean} [multiple=false]
|
|
713
|
+
* @version 0.1.0
|
|
714
|
+
*/
|
|
715
|
+
multiple?: boolean;
|
|
716
|
+
/**
|
|
717
|
+
* @property {number} [priority=0]
|
|
718
|
+
* @version 0.1.0
|
|
719
|
+
*/
|
|
720
|
+
priority?: number;
|
|
721
|
+
};
|
|
722
|
+
export type TableOptionsArg = {
|
|
723
|
+
rowIndex: number;
|
|
724
|
+
colIndex: number;
|
|
725
|
+
record: TableData;
|
|
726
|
+
column: TableColumn;
|
|
727
|
+
};
|
|
728
|
+
export type SortOrder = {
|
|
729
|
+
[key: string | number | symbol]: 'asc' | 'desc' | 'none' | null | undefined;
|
|
730
|
+
};
|
|
731
|
+
export type FilterValue = {
|
|
732
|
+
[key: string | number | symbol]: any[] | null | undefined;
|
|
733
|
+
};
|