x-next 0.0.0-alpha.70 → 0.0.0-alpha.72
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 +74 -70
- package/dist/_hooks/_types.d.ts +3 -0
- package/dist/_hooks/use-scrollbar.d.ts +1 -1
- package/dist/_utils/array.d.ts +2 -0
- package/dist/components/_components/auto-tooltip/auto-tooltip.d.ts +10 -0
- package/dist/components/_components/auto-tooltip/style/index.d.ts +0 -0
- package/dist/components/form-select/index.d.ts +40 -39
- package/dist/components/index.d.ts +2 -0
- package/dist/components/menu/Menu.d.ts +2 -2
- package/dist/components/pagination/Pagination.d.ts +351 -0
- package/dist/components/pagination/index.d.ts +297 -0
- package/dist/components/pagination/interface.d.ts +26 -0
- package/dist/components/pagination/page-item-ellipsis.vue.d.ts +91 -0
- package/dist/components/pagination/page-item-step.vue.d.ts +160 -0
- package/dist/components/pagination/page-item.vue.d.ts +53 -0
- package/dist/components/pagination/page-jumper.vue.d.ts +346 -0
- package/dist/components/pagination/page-options.vue.d.ts +2032 -0
- package/dist/components/pagination/utils.d.ts +4 -0
- package/dist/components/scrollbar-v2/index.d.ts +15 -14
- package/dist/components/table/Table.d.ts +931 -0
- package/dist/components/table/TableColumn.d.ts +292 -0
- package/dist/components/table/context.d.ts +29 -0
- package/dist/components/table/hooks/use-column-filter.d.ts +18 -0
- package/dist/components/table/hooks/use-column-resize.d.ts +10 -0
- package/dist/components/table/hooks/use-column-sorter.d.ts +14 -0
- package/dist/components/table/hooks/use-drag.d.ts +18 -0
- package/dist/components/table/hooks/use-expand.d.ts +20 -0
- package/dist/components/table/hooks/use-filter.d.ts +11 -0
- package/dist/components/table/hooks/use-pagination.d.ts +7 -0
- package/dist/components/table/hooks/use-row-selection.d.ts +26 -0
- package/dist/components/table/hooks/use-sorter.d.ts +17 -0
- package/dist/components/table/hooks/use-span.d.ts +18 -0
- package/dist/components/table/index.d.ts +952 -0
- package/dist/components/table/interface.d.ts +467 -0
- package/dist/components/table/table-col-group.vue.d.ts +38 -0
- package/dist/components/table/table-operation-td.d.ts +573 -0
- package/dist/components/table/table-operation-th.d.ts +41 -0
- package/dist/components/table/table-tbody.d.ts +4 -0
- package/dist/components/table/table-td.d.ts +124 -0
- package/dist/components/table/table-th.d.ts +39 -0
- package/dist/components/table/table-thead.d.ts +4 -0
- package/dist/components/table/table-tr.d.ts +41 -0
- package/dist/components/table/utils.d.ts +38 -0
- package/dist/components/trigger/index.d.ts +1 -0
- package/dist/components/trigger-v2/index.d.ts +1 -0
- package/dist/components/virtual-list-v2/interface.d.ts +1 -1
- package/dist/icons/index.d.ts +2 -2
- package/dist/index.es.js +11590 -7940
- package/dist/index.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
- package/volar.d.ts +75 -72
- package/dist/icons/default/left.d.ts +0 -50
- package/dist/icons/default/right.d.ts +0 -50
@@ -0,0 +1,292 @@
|
|
1
|
+
import { CSSProperties, PropType } from 'vue';
|
2
|
+
import { TableColumnData, TableData, TableFilterable, TableSortable } from './interface';
|
3
|
+
import { ClassName } from '../../_hooks/_types';
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
5
|
+
/**
|
6
|
+
* @zh 列信息的标识,对应TableData中的数据
|
7
|
+
* @en Identifies the column information, corresponding to the data in TableData
|
8
|
+
*/
|
9
|
+
dataIndex: StringConstructor;
|
10
|
+
/**
|
11
|
+
* @zh 列标题
|
12
|
+
* @en Column title
|
13
|
+
*/
|
14
|
+
title: StringConstructor;
|
15
|
+
/**
|
16
|
+
* @zh 列宽度
|
17
|
+
* @en Column width
|
18
|
+
*/
|
19
|
+
width: NumberConstructor;
|
20
|
+
/**
|
21
|
+
* @zh 最小列宽
|
22
|
+
* @en Minimum column width
|
23
|
+
*/
|
24
|
+
minWidth: NumberConstructor;
|
25
|
+
/**
|
26
|
+
* @zh 对齐方向
|
27
|
+
* @en Alignment direction
|
28
|
+
*/
|
29
|
+
align: {
|
30
|
+
type: PropType<TableColumnData["align"]>;
|
31
|
+
};
|
32
|
+
/**
|
33
|
+
* @zh 固定位置
|
34
|
+
* @en Fixed position
|
35
|
+
*/
|
36
|
+
fixed: {
|
37
|
+
type: PropType<TableColumnData["fixed"]>;
|
38
|
+
};
|
39
|
+
/**
|
40
|
+
* @zh 是否显示为省略
|
41
|
+
* @en Whether to display as omitted
|
42
|
+
*/
|
43
|
+
ellipsis: {
|
44
|
+
type: BooleanConstructor;
|
45
|
+
default: boolean;
|
46
|
+
};
|
47
|
+
/**
|
48
|
+
* @zh 排序相关选项
|
49
|
+
* @en Sorting related options
|
50
|
+
*/
|
51
|
+
sortable: {
|
52
|
+
type: PropType<TableSortable>;
|
53
|
+
default: undefined;
|
54
|
+
};
|
55
|
+
/**
|
56
|
+
* @zh 过滤相关选项
|
57
|
+
* @en Filter related options
|
58
|
+
*/
|
59
|
+
filterable: {
|
60
|
+
type: PropType<TableFilterable>;
|
61
|
+
default: undefined;
|
62
|
+
};
|
63
|
+
/**
|
64
|
+
* @zh 自定义单元格类名
|
65
|
+
* @en Custom cell class
|
66
|
+
* @version 2.36.0
|
67
|
+
*/
|
68
|
+
cellClass: {
|
69
|
+
type: PropType<ClassName>;
|
70
|
+
};
|
71
|
+
/**
|
72
|
+
* @zh 自定义表头单元格类名
|
73
|
+
* @en Custom cell class
|
74
|
+
* @version 2.36.0
|
75
|
+
*/
|
76
|
+
headerCellClass: {
|
77
|
+
type: PropType<ClassName>;
|
78
|
+
};
|
79
|
+
/**
|
80
|
+
* @zh 自定义内容单元格类名
|
81
|
+
* @en Custom cell class
|
82
|
+
* @version 2.36.0
|
83
|
+
*/
|
84
|
+
bodyCellClass: {
|
85
|
+
type: PropType<ClassName | ((record: TableData) => ClassName)>;
|
86
|
+
};
|
87
|
+
/**
|
88
|
+
* @zh 自定义总结栏单元格类名
|
89
|
+
* @en Customize summary column cell class
|
90
|
+
* @version 2.36.0
|
91
|
+
*/
|
92
|
+
summaryCellClass: {
|
93
|
+
type: PropType<ClassName | ((record: TableData) => ClassName)>;
|
94
|
+
};
|
95
|
+
/**
|
96
|
+
* @zh 自定义单元格样式
|
97
|
+
* @en Custom cell style
|
98
|
+
* @version 2.11.0
|
99
|
+
*/
|
100
|
+
cellStyle: {
|
101
|
+
type: PropType<CSSProperties>;
|
102
|
+
};
|
103
|
+
/**
|
104
|
+
* @zh 自定义表头单元格样式
|
105
|
+
* @en Custom cell style
|
106
|
+
* @version 2.29.0
|
107
|
+
*/
|
108
|
+
headerCellStyle: {
|
109
|
+
type: PropType<CSSProperties>;
|
110
|
+
};
|
111
|
+
/**
|
112
|
+
* @zh 自定义内容单元格样式
|
113
|
+
* @en Custom cell style
|
114
|
+
* @version 2.29.0
|
115
|
+
*/
|
116
|
+
bodyCellStyle: {
|
117
|
+
type: PropType<CSSProperties | ((record: TableData) => CSSProperties)>;
|
118
|
+
};
|
119
|
+
/**
|
120
|
+
* @zh 自定义总结栏单元格样式
|
121
|
+
* @en Customize summary column cell style
|
122
|
+
* @version 2.30.0
|
123
|
+
*/
|
124
|
+
summaryCellStyle: {
|
125
|
+
type: PropType<CSSProperties | ((record: TableData) => CSSProperties)>;
|
126
|
+
};
|
127
|
+
/**
|
128
|
+
* @zh 用于手动指定选项的 index。2.26.0 版本后不再需要手动指定
|
129
|
+
* @en index for manually specifying option. Manual specification is no longer required after version 2.26.0
|
130
|
+
* @version 2.20.2
|
131
|
+
*/
|
132
|
+
index: {
|
133
|
+
type: NumberConstructor;
|
134
|
+
};
|
135
|
+
/**
|
136
|
+
* @zh 在省略时是否显示文字提示
|
137
|
+
* @en Whether to show text hints when omitted
|
138
|
+
* @version 2.26.0
|
139
|
+
*/
|
140
|
+
tooltip: {
|
141
|
+
type: (BooleanConstructor | ObjectConstructor)[];
|
142
|
+
default: boolean;
|
143
|
+
};
|
144
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
145
|
+
[key: string]: any;
|
146
|
+
}>[] | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
147
|
+
/**
|
148
|
+
* @zh 列信息的标识,对应TableData中的数据
|
149
|
+
* @en Identifies the column information, corresponding to the data in TableData
|
150
|
+
*/
|
151
|
+
dataIndex: StringConstructor;
|
152
|
+
/**
|
153
|
+
* @zh 列标题
|
154
|
+
* @en Column title
|
155
|
+
*/
|
156
|
+
title: StringConstructor;
|
157
|
+
/**
|
158
|
+
* @zh 列宽度
|
159
|
+
* @en Column width
|
160
|
+
*/
|
161
|
+
width: NumberConstructor;
|
162
|
+
/**
|
163
|
+
* @zh 最小列宽
|
164
|
+
* @en Minimum column width
|
165
|
+
*/
|
166
|
+
minWidth: NumberConstructor;
|
167
|
+
/**
|
168
|
+
* @zh 对齐方向
|
169
|
+
* @en Alignment direction
|
170
|
+
*/
|
171
|
+
align: {
|
172
|
+
type: PropType<TableColumnData["align"]>;
|
173
|
+
};
|
174
|
+
/**
|
175
|
+
* @zh 固定位置
|
176
|
+
* @en Fixed position
|
177
|
+
*/
|
178
|
+
fixed: {
|
179
|
+
type: PropType<TableColumnData["fixed"]>;
|
180
|
+
};
|
181
|
+
/**
|
182
|
+
* @zh 是否显示为省略
|
183
|
+
* @en Whether to display as omitted
|
184
|
+
*/
|
185
|
+
ellipsis: {
|
186
|
+
type: BooleanConstructor;
|
187
|
+
default: boolean;
|
188
|
+
};
|
189
|
+
/**
|
190
|
+
* @zh 排序相关选项
|
191
|
+
* @en Sorting related options
|
192
|
+
*/
|
193
|
+
sortable: {
|
194
|
+
type: PropType<TableSortable>;
|
195
|
+
default: undefined;
|
196
|
+
};
|
197
|
+
/**
|
198
|
+
* @zh 过滤相关选项
|
199
|
+
* @en Filter related options
|
200
|
+
*/
|
201
|
+
filterable: {
|
202
|
+
type: PropType<TableFilterable>;
|
203
|
+
default: undefined;
|
204
|
+
};
|
205
|
+
/**
|
206
|
+
* @zh 自定义单元格类名
|
207
|
+
* @en Custom cell class
|
208
|
+
* @version 2.36.0
|
209
|
+
*/
|
210
|
+
cellClass: {
|
211
|
+
type: PropType<ClassName>;
|
212
|
+
};
|
213
|
+
/**
|
214
|
+
* @zh 自定义表头单元格类名
|
215
|
+
* @en Custom cell class
|
216
|
+
* @version 2.36.0
|
217
|
+
*/
|
218
|
+
headerCellClass: {
|
219
|
+
type: PropType<ClassName>;
|
220
|
+
};
|
221
|
+
/**
|
222
|
+
* @zh 自定义内容单元格类名
|
223
|
+
* @en Custom cell class
|
224
|
+
* @version 2.36.0
|
225
|
+
*/
|
226
|
+
bodyCellClass: {
|
227
|
+
type: PropType<ClassName | ((record: TableData) => ClassName)>;
|
228
|
+
};
|
229
|
+
/**
|
230
|
+
* @zh 自定义总结栏单元格类名
|
231
|
+
* @en Customize summary column cell class
|
232
|
+
* @version 2.36.0
|
233
|
+
*/
|
234
|
+
summaryCellClass: {
|
235
|
+
type: PropType<ClassName | ((record: TableData) => ClassName)>;
|
236
|
+
};
|
237
|
+
/**
|
238
|
+
* @zh 自定义单元格样式
|
239
|
+
* @en Custom cell style
|
240
|
+
* @version 2.11.0
|
241
|
+
*/
|
242
|
+
cellStyle: {
|
243
|
+
type: PropType<CSSProperties>;
|
244
|
+
};
|
245
|
+
/**
|
246
|
+
* @zh 自定义表头单元格样式
|
247
|
+
* @en Custom cell style
|
248
|
+
* @version 2.29.0
|
249
|
+
*/
|
250
|
+
headerCellStyle: {
|
251
|
+
type: PropType<CSSProperties>;
|
252
|
+
};
|
253
|
+
/**
|
254
|
+
* @zh 自定义内容单元格样式
|
255
|
+
* @en Custom cell style
|
256
|
+
* @version 2.29.0
|
257
|
+
*/
|
258
|
+
bodyCellStyle: {
|
259
|
+
type: PropType<CSSProperties | ((record: TableData) => CSSProperties)>;
|
260
|
+
};
|
261
|
+
/**
|
262
|
+
* @zh 自定义总结栏单元格样式
|
263
|
+
* @en Customize summary column cell style
|
264
|
+
* @version 2.30.0
|
265
|
+
*/
|
266
|
+
summaryCellStyle: {
|
267
|
+
type: PropType<CSSProperties | ((record: TableData) => CSSProperties)>;
|
268
|
+
};
|
269
|
+
/**
|
270
|
+
* @zh 用于手动指定选项的 index。2.26.0 版本后不再需要手动指定
|
271
|
+
* @en index for manually specifying option. Manual specification is no longer required after version 2.26.0
|
272
|
+
* @version 2.20.2
|
273
|
+
*/
|
274
|
+
index: {
|
275
|
+
type: NumberConstructor;
|
276
|
+
};
|
277
|
+
/**
|
278
|
+
* @zh 在省略时是否显示文字提示
|
279
|
+
* @en Whether to show text hints when omitted
|
280
|
+
* @version 2.26.0
|
281
|
+
*/
|
282
|
+
tooltip: {
|
283
|
+
type: (BooleanConstructor | ObjectConstructor)[];
|
284
|
+
default: boolean;
|
285
|
+
};
|
286
|
+
}>> & Readonly<{}>, {
|
287
|
+
ellipsis: boolean;
|
288
|
+
tooltip: boolean | Record<string, any>;
|
289
|
+
sortable: TableSortable;
|
290
|
+
filterable: TableFilterable;
|
291
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
292
|
+
export default _default;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { InjectionKey, Slots } from 'vue';
|
2
|
+
import { BaseType } from '../../_hooks/_types';
|
3
|
+
import { Filters, Sorter, TableColumnData, TableData, TableDataWithRaw } from './interface';
|
4
|
+
export interface TableContext {
|
5
|
+
loadMore?: (record: TableData, done: (children?: TableData[]) => void) => void;
|
6
|
+
addLazyLoadData: (children: TableData[] | undefined, record: TableDataWithRaw) => void;
|
7
|
+
slots: Slots;
|
8
|
+
sorter: Sorter | undefined;
|
9
|
+
currentAllEnabledRowKeys: BaseType[];
|
10
|
+
currentSelectedRowKeys: BaseType[];
|
11
|
+
checkStrictly: boolean;
|
12
|
+
filters: Filters;
|
13
|
+
filterIconAlignLeft: boolean;
|
14
|
+
resizingColumn: string;
|
15
|
+
addColumn: (id: number, column: TableColumnData) => void;
|
16
|
+
removeColumn: (id: number) => void;
|
17
|
+
onSelectAll: (checked: boolean) => void;
|
18
|
+
onSelect: (checked: boolean, record: TableDataWithRaw) => void;
|
19
|
+
onSelectAllLeafs: (record: TableDataWithRaw, checked: boolean) => void;
|
20
|
+
onSorterChange: (dataIndex: string, direction: 'ascend' | 'descend' | '', ev: Event) => void;
|
21
|
+
onFilterChange: (dataIndex: string, filteredValues: string[], ev: Event) => void;
|
22
|
+
onThMouseDown: (dataIndex: string, ev: MouseEvent) => void;
|
23
|
+
}
|
24
|
+
export interface TableColumnContext {
|
25
|
+
addChild: (id: number, column: TableColumnData) => void;
|
26
|
+
removeChild: (id: number) => void;
|
27
|
+
}
|
28
|
+
export declare const tableInjectionKey: InjectionKey<TableContext>;
|
29
|
+
export declare const tableColumnInjectionKey: InjectionKey<TableColumnContext>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { TableColumnData } from '../interface';
|
3
|
+
import { TableContext } from '../context';
|
4
|
+
export declare const useColumnFilter: ({ column, tableCtx, }: {
|
5
|
+
column: Ref<TableColumnData>;
|
6
|
+
tableCtx: Partial<TableContext>;
|
7
|
+
}) => {
|
8
|
+
filterPopupVisible: Ref<boolean, boolean>;
|
9
|
+
isFilterActive: import('vue').ComputedRef<boolean>;
|
10
|
+
isMultipleFilter: import('vue').ComputedRef<boolean>;
|
11
|
+
columnFilterValue: Ref<string[], string[]>;
|
12
|
+
handleFilterPopupVisibleChange: (value: boolean) => void;
|
13
|
+
setFilterValue: (filterValue: string[]) => void;
|
14
|
+
handleCheckboxFilterChange: (values: string[]) => void;
|
15
|
+
handleRadioFilterChange: (value: string) => void;
|
16
|
+
handleFilterConfirm: (ev: Event) => void;
|
17
|
+
handleFilterReset: (ev: Event) => void;
|
18
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { EmitFn2 } from '../../../_hooks/_types';
|
3
|
+
export declare const useColumnResize: (thRefs: Ref<Record<string, HTMLElement>>, emit: EmitFn2<{
|
4
|
+
columnResize: (dataIndex: string, width: number) => true;
|
5
|
+
}>) => {
|
6
|
+
resizingColumn: Ref<string, string>;
|
7
|
+
columnWidth: Record<string, number>;
|
8
|
+
handleThMouseDown: (dataIndex: string, ev: MouseEvent) => void;
|
9
|
+
handleThMouseUp: () => void;
|
10
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { TableColumnData } from '../interface';
|
3
|
+
import { TableContext } from '../context';
|
4
|
+
export declare const useColumnSorter: ({ column, tableCtx, }: {
|
5
|
+
column: Ref<TableColumnData>;
|
6
|
+
tableCtx: Partial<TableContext>;
|
7
|
+
}) => {
|
8
|
+
sortOrder: import('vue').ComputedRef<"ascend" | "descend" | undefined>;
|
9
|
+
hasSorter: import('vue').ComputedRef<boolean>;
|
10
|
+
hasAscendBtn: import('vue').ComputedRef<boolean>;
|
11
|
+
hasDescendBtn: import('vue').ComputedRef<boolean>;
|
12
|
+
nextSortOrder: import('vue').ComputedRef<"" | "ascend" | "descend">;
|
13
|
+
handleClickSorter: (ev: Event) => void;
|
14
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { TableDraggable } from '../interface';
|
3
|
+
export declare const useDrag: (draggable: Ref<TableDraggable | undefined>) => {
|
4
|
+
dragType: import('vue').ComputedRef<"row" | "handle" | undefined>;
|
5
|
+
dragState: {
|
6
|
+
dragging: boolean;
|
7
|
+
sourceKey: string;
|
8
|
+
sourcePath: number[];
|
9
|
+
targetPath: number[];
|
10
|
+
data: Record<string, unknown>;
|
11
|
+
};
|
12
|
+
handleDragStart: (ev: DragEvent, sourceKey: string, sourcePath: number[], data: Record<string, unknown>) => void;
|
13
|
+
handleDragEnter: (ev: DragEvent, targetPath: number[]) => void;
|
14
|
+
handleDragLeave: (ev: DragEvent) => void;
|
15
|
+
handleDragover: (ev: DragEvent) => void;
|
16
|
+
handleDragEnd: (ev: DragEvent) => void;
|
17
|
+
handleDrop: (ev: DragEvent) => void;
|
18
|
+
};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { TableData, TableExpandable } from '../interface';
|
3
|
+
import { BaseType, EmitFn2 } from '../../../_hooks/_types';
|
4
|
+
export declare const useExpand: ({ expandedKeys, defaultExpandedKeys, defaultExpandAllRows, expandable, allRowKeys, emit, }: {
|
5
|
+
expandedKeys: Ref<BaseType[] | undefined>;
|
6
|
+
defaultExpandedKeys: Ref<BaseType[] | undefined>;
|
7
|
+
defaultExpandAllRows: Ref<boolean>;
|
8
|
+
expandable: Ref<TableExpandable | undefined>;
|
9
|
+
allRowKeys: Ref<BaseType[]>;
|
10
|
+
emit: EmitFn2<{
|
11
|
+
"update:expandedKeys": (rowKeys: BaseType[]) => true;
|
12
|
+
expand: (rowKey: BaseType, record: TableData) => true;
|
13
|
+
expandedChange: (rowKeys: BaseType[]) => true;
|
14
|
+
}>;
|
15
|
+
}) => {
|
16
|
+
expandedRowKeys: import('vue').ComputedRef<BaseType[]>;
|
17
|
+
handleExpand: (rowKey: BaseType, record: TableData) => void;
|
18
|
+
expand: (rowKey: BaseType | BaseType[], expanded?: boolean) => void;
|
19
|
+
expandAll: (expanded?: boolean) => void;
|
20
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { Filters, TableColumnData } from '../interface';
|
3
|
+
export declare const useFilter: ({ columns, onFilterChange, }: {
|
4
|
+
columns: Ref<TableColumnData[]>;
|
5
|
+
onFilterChange: (dataIndex: string, filteredValues: string[]) => void;
|
6
|
+
}) => {
|
7
|
+
_filters: Ref<Filters, Filters>;
|
8
|
+
computedFilters: import('vue').ComputedRef<Filters>;
|
9
|
+
resetFilters: (dataIndex?: string | string[]) => void;
|
10
|
+
clearFilters: (dataIndex?: string | string[]) => void;
|
11
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { TableProps } from '../interface';
|
2
|
+
export declare const usePagination: (props: TableProps, emit: any) => {
|
3
|
+
page: import('vue').ComputedRef<any>;
|
4
|
+
pageSize: import('vue').ComputedRef<any>;
|
5
|
+
handlePageChange: (page: number) => void;
|
6
|
+
handlePageSizeChange: (pageSize: number) => void;
|
7
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { BaseType, EmitFn2 } from '../../../_hooks/_types';
|
3
|
+
import { TableDataWithRaw, TableRowSelection, TableData } from '../interface';
|
4
|
+
export declare const useRowSelection: ({ selectedKeys, defaultSelectedKeys, rowSelection, currentAllRowKeys, currentAllEnabledRowKeys, emit, }: {
|
5
|
+
selectedKeys: Ref<BaseType[] | undefined>;
|
6
|
+
defaultSelectedKeys: Ref<BaseType[] | undefined>;
|
7
|
+
rowSelection: Ref<TableRowSelection | undefined>;
|
8
|
+
currentAllRowKeys: Ref<BaseType[]>;
|
9
|
+
currentAllEnabledRowKeys: Ref<BaseType[]>;
|
10
|
+
emit: EmitFn2<{
|
11
|
+
"update:selectedKeys": (rowKeys: BaseType[]) => true;
|
12
|
+
select: (rowKeys: BaseType[], rowKey: BaseType, record: TableData) => true;
|
13
|
+
selectAll: (checked: boolean) => true;
|
14
|
+
selectionChange: (rowKeys: BaseType[]) => true;
|
15
|
+
}>;
|
16
|
+
}) => {
|
17
|
+
isRadio: import('vue').ComputedRef<boolean>;
|
18
|
+
selectedRowKeys: import('vue').ComputedRef<BaseType[]>;
|
19
|
+
currentSelectedRowKeys: import('vue').ComputedRef<BaseType[]>;
|
20
|
+
handleSelectAll: (checked: boolean) => void;
|
21
|
+
handleSelect: (checked: boolean, record: TableDataWithRaw) => void;
|
22
|
+
handleSelectAllLeafs: (record: TableDataWithRaw, checked: boolean) => void;
|
23
|
+
select: (rowKey: BaseType | BaseType[], checked?: boolean) => void;
|
24
|
+
selectAll: (checked?: boolean) => void;
|
25
|
+
clearSelected: () => void;
|
26
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { Sorter, TableColumnData } from '../interface';
|
3
|
+
export declare const useSorter: ({ columns, onSorterChange, }: {
|
4
|
+
columns: Ref<TableColumnData[]>;
|
5
|
+
onSorterChange: (dataIndex: string, direction: "ascend" | "descend" | "") => void;
|
6
|
+
}) => {
|
7
|
+
_sorter: Ref<{
|
8
|
+
field: string;
|
9
|
+
direction: "ascend" | "descend";
|
10
|
+
} | undefined, Sorter | {
|
11
|
+
field: string;
|
12
|
+
direction: "ascend" | "descend";
|
13
|
+
} | undefined>;
|
14
|
+
computedSorter: import('vue').ComputedRef<Sorter | undefined>;
|
15
|
+
resetSorters: () => void;
|
16
|
+
clearSorters: () => void;
|
17
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Ref } from 'vue';
|
2
|
+
import { TableColumnData, TableData, TableDataWithRaw, TableOperationColumn } from '../interface';
|
3
|
+
export declare const useSpan: ({ spanMethod, data, columns, }: {
|
4
|
+
spanMethod: Ref<((data: {
|
5
|
+
record: TableData;
|
6
|
+
column: TableColumnData | TableOperationColumn;
|
7
|
+
rowIndex: number;
|
8
|
+
columnIndex: number;
|
9
|
+
}) => {
|
10
|
+
rowspan?: number;
|
11
|
+
colspan?: number;
|
12
|
+
} | void) | undefined>;
|
13
|
+
data: Ref<TableDataWithRaw[]>;
|
14
|
+
columns: Ref<(TableColumnData | TableOperationColumn)[]>;
|
15
|
+
}) => {
|
16
|
+
tableSpan: import('vue').ComputedRef<Record<string, [number, number]>>;
|
17
|
+
removedCells: import('vue').ComputedRef<string[]>;
|
18
|
+
};
|