@skyservice-developers/vue-dev-kit 2.10.1 → 2.12.0
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 +292 -37
- package/dist/features/data-table/SkyDataTable.vue.d.ts +210 -0
- package/dist/features/data-table/SkyDataTableColumnToggle.vue.d.ts +36 -0
- package/dist/features/data-table/index.d.ts +2 -0
- package/dist/features/index.d.ts +2 -0
- package/dist/features/table/TableColumnSettings.vue.d.ts +31 -0
- package/dist/features/table/TableMassActions.vue.d.ts +56 -0
- package/dist/features/table/TableVirtualBody.vue.d.ts +65 -0
- package/dist/features/table/index.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/shared/lib/table/index.d.ts +8 -0
- package/dist/shared/lib/table/tableFeatures.d.ts +110 -0
- package/dist/shared/lib/table/useColumnVisibility.d.ts +29 -0
- package/dist/shared/lib/table/useTableSelection.d.ts +34 -0
- package/dist/shared/lib/table/useTableSort.d.ts +28 -0
- package/dist/shared/ui/Dialog/Dialog.vue.d.ts +1 -4
- package/dist/shared/ui/DialogModal/DialogModal.vue.d.ts +3 -0
- package/dist/shared/ui/DialogNext/DialogNext.vue.d.ts +3 -0
- package/dist/shared/ui/Modal/Modal.vue.d.ts +3 -0
- package/dist/shared/ui/SkyDateRangePicker/SkyDateRangePicker.vue.d.ts +749 -0
- package/dist/shared/ui/SkyDateRangePicker/index.d.ts +1 -0
- package/dist/shared/ui/SkyTable/DynamicScroller.vue.d.ts +2 -2
- package/dist/shared/ui/SkyTable/Row.vue.d.ts +2 -2
- package/dist/shared/ui/SkyTable/items/itemDefault.vue.d.ts +2 -2
- package/dist/shared/ui/SkyTable/items/itemInput.vue.d.ts +1 -1
- package/dist/shared/ui/SkyTable/items/itemSelect.vue.d.ts +2 -2
- package/dist/shared/ui/SkyTable/items/itemTagEditor.vue.d.ts +2 -2
- package/dist/shared/ui/SkyTable/items/itemTags.vue.d.ts +1 -1
- package/dist/shared/ui/functional-calendar/components/Arrows.vue.d.ts +49 -0
- package/dist/shared/ui/functional-calendar/components/Day.vue.d.ts +81 -0
- package/dist/shared/ui/functional-calendar/components/Footer.vue.d.ts +2 -0
- package/dist/shared/ui/functional-calendar/components/FunctionalCalendar.vue.d.ts +554 -0
- package/dist/shared/ui/functional-calendar/components/MonthYearPicker.vue.d.ts +27 -0
- package/dist/shared/ui/functional-calendar/components/PickerInputs.vue.d.ts +41 -0
- package/dist/shared/ui/functional-calendar/components/TimePicker.vue.d.ts +23 -0
- package/dist/shared/ui/functional-calendar/components/WeekNumbers.vue.d.ts +22 -0
- package/dist/shared/ui/index.d.ts +3 -0
- package/dist/shared/ui/table/SkyTableBody.vue.d.ts +11 -0
- package/dist/shared/ui/table/SkyTableCell.vue.d.ts +45 -0
- package/dist/shared/ui/table/SkyTableEmpty.vue.d.ts +39 -0
- package/dist/shared/ui/table/SkyTableHead.vue.d.ts +34 -0
- package/dist/shared/ui/table/SkyTableHeader.vue.d.ts +40 -0
- package/dist/shared/ui/table/SkyTableRoot.vue.d.ts +50 -0
- package/dist/shared/ui/table/SkyTableRow.vue.d.ts +49 -0
- package/dist/shared/ui/table/index.d.ts +9 -0
- package/dist/shared/ui/table/types.d.ts +36 -0
- package/dist/style.css +1 -1
- package/dist/vue-dev-kit.cjs +14 -12
- package/dist/vue-dev-kit.js +11879 -8743
- package/package.json +11 -2
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { ColumnDef, SortingState, TableFeatures } from '@tanstack/vue-table';
|
|
2
|
+
|
|
3
|
+
declare const _default: <TData extends Record<string, any>>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
5
|
+
readonly "onRow-click"?: ((row: TData) => any) | undefined;
|
|
6
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & {
|
|
7
|
+
/** Опис колонок у форматі TanStack. Ширину беремо з `size` / `meta.widthFr`. */
|
|
8
|
+
columns: ColumnDef<any, TData, any>[];
|
|
9
|
+
data: TData[];
|
|
10
|
+
/**
|
|
11
|
+
* Набір фіч. За замовчуванням — сортування, вибір, видимість колонок,
|
|
12
|
+
* пагінація і фільтрація. Потрібно більше — зберіть свій через `tableFeatures()`.
|
|
13
|
+
*/
|
|
14
|
+
features?: TableFeatures;
|
|
15
|
+
/** Ключ рядка. Без нього TanStack бере індекс, і вибір «поїде» після сортування. */
|
|
16
|
+
rowId?: string | ((row: TData) => string);
|
|
17
|
+
/** Розмір сторінки. `0` вимикає пагінацію — рендеряться всі рядки. */
|
|
18
|
+
pageSize?: number;
|
|
19
|
+
/** Показати поле глобального пошуку в тулбарі. */
|
|
20
|
+
searchable?: boolean;
|
|
21
|
+
searchPlaceholder?: string;
|
|
22
|
+
initialSorting?: SortingState;
|
|
23
|
+
emptyText?: string;
|
|
24
|
+
/** Курсор-вказівник і hover на рядках. */
|
|
25
|
+
interactiveRows?: boolean;
|
|
26
|
+
}, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
27
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
28
|
+
table: import('@tanstack/vue-table').VueTable<{
|
|
29
|
+
columnFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
30
|
+
columnSizingFeature: import('@tanstack/table-core').TableFeature;
|
|
31
|
+
columnVisibilityFeature: import('@tanstack/table-core').TableFeature;
|
|
32
|
+
globalFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
33
|
+
rowPaginationFeature: import('@tanstack/table-core').TableFeature;
|
|
34
|
+
rowSelectionFeature: import('@tanstack/table-core').TableFeature;
|
|
35
|
+
rowSortingFeature: import('@tanstack/table-core').TableFeature;
|
|
36
|
+
coreRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
37
|
+
filteredRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
38
|
+
sortedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
39
|
+
paginatedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
40
|
+
sortFns: {
|
|
41
|
+
alphanumeric: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
42
|
+
alphanumericCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
43
|
+
basic: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
44
|
+
datetime: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
45
|
+
text: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
46
|
+
textCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
47
|
+
};
|
|
48
|
+
filterFns: {
|
|
49
|
+
arrIncludes: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
50
|
+
arrIncludesAll: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
51
|
+
arrHas: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
52
|
+
arrIncludesSome: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
53
|
+
between: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
54
|
+
betweenInclusive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
55
|
+
empty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
56
|
+
endsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
57
|
+
equals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
58
|
+
equalsString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
59
|
+
equalsStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
60
|
+
inDateRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
61
|
+
inNumberRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
62
|
+
includesString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
63
|
+
includesStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
64
|
+
notEmpty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
65
|
+
startsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
66
|
+
weakEquals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
67
|
+
};
|
|
68
|
+
}, TData>;
|
|
69
|
+
}>): void;
|
|
70
|
+
attrs: any;
|
|
71
|
+
slots: ReturnType<() => {
|
|
72
|
+
toolbar?(_: {
|
|
73
|
+
table: import('@tanstack/vue-table').VueTable<{
|
|
74
|
+
columnFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
75
|
+
columnSizingFeature: import('@tanstack/table-core').TableFeature;
|
|
76
|
+
columnVisibilityFeature: import('@tanstack/table-core').TableFeature;
|
|
77
|
+
globalFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
78
|
+
rowPaginationFeature: import('@tanstack/table-core').TableFeature;
|
|
79
|
+
rowSelectionFeature: import('@tanstack/table-core').TableFeature;
|
|
80
|
+
rowSortingFeature: import('@tanstack/table-core').TableFeature;
|
|
81
|
+
coreRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
82
|
+
filteredRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
83
|
+
sortedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
84
|
+
paginatedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
85
|
+
sortFns: {
|
|
86
|
+
alphanumeric: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
87
|
+
alphanumericCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
88
|
+
basic: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
89
|
+
datetime: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
90
|
+
text: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
91
|
+
textCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
92
|
+
};
|
|
93
|
+
filterFns: {
|
|
94
|
+
arrIncludes: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
95
|
+
arrIncludesAll: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
96
|
+
arrHas: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
97
|
+
arrIncludesSome: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
98
|
+
between: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
99
|
+
betweenInclusive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
100
|
+
empty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
101
|
+
endsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
102
|
+
equals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
103
|
+
equalsString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
104
|
+
equalsStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
105
|
+
inDateRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
106
|
+
inNumberRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
107
|
+
includesString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
108
|
+
includesStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
109
|
+
notEmpty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
110
|
+
startsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
111
|
+
weakEquals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
112
|
+
};
|
|
113
|
+
}, TData>;
|
|
114
|
+
}): any;
|
|
115
|
+
actions?(_: {
|
|
116
|
+
table: import('@tanstack/vue-table').VueTable<{
|
|
117
|
+
columnFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
118
|
+
columnSizingFeature: import('@tanstack/table-core').TableFeature;
|
|
119
|
+
columnVisibilityFeature: import('@tanstack/table-core').TableFeature;
|
|
120
|
+
globalFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
121
|
+
rowPaginationFeature: import('@tanstack/table-core').TableFeature;
|
|
122
|
+
rowSelectionFeature: import('@tanstack/table-core').TableFeature;
|
|
123
|
+
rowSortingFeature: import('@tanstack/table-core').TableFeature;
|
|
124
|
+
coreRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
125
|
+
filteredRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
126
|
+
sortedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
127
|
+
paginatedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
128
|
+
sortFns: {
|
|
129
|
+
alphanumeric: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
130
|
+
alphanumericCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
131
|
+
basic: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
132
|
+
datetime: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
133
|
+
text: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
134
|
+
textCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
135
|
+
};
|
|
136
|
+
filterFns: {
|
|
137
|
+
arrIncludes: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
138
|
+
arrIncludesAll: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
139
|
+
arrHas: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
140
|
+
arrIncludesSome: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
141
|
+
between: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
142
|
+
betweenInclusive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
143
|
+
empty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
144
|
+
endsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
145
|
+
equals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
146
|
+
equalsString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
147
|
+
equalsStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
148
|
+
inDateRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
149
|
+
inNumberRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
150
|
+
includesString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
151
|
+
includesStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
152
|
+
notEmpty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
153
|
+
startsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
154
|
+
weakEquals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
155
|
+
};
|
|
156
|
+
}, TData>;
|
|
157
|
+
}): any;
|
|
158
|
+
empty?(_: {}): any;
|
|
159
|
+
footer?(_: {
|
|
160
|
+
table: import('@tanstack/vue-table').VueTable<{
|
|
161
|
+
columnFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
162
|
+
columnSizingFeature: import('@tanstack/table-core').TableFeature;
|
|
163
|
+
columnVisibilityFeature: import('@tanstack/table-core').TableFeature;
|
|
164
|
+
globalFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
165
|
+
rowPaginationFeature: import('@tanstack/table-core').TableFeature;
|
|
166
|
+
rowSelectionFeature: import('@tanstack/table-core').TableFeature;
|
|
167
|
+
rowSortingFeature: import('@tanstack/table-core').TableFeature;
|
|
168
|
+
coreRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
169
|
+
filteredRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
170
|
+
sortedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
171
|
+
paginatedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
172
|
+
sortFns: {
|
|
173
|
+
alphanumeric: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
174
|
+
alphanumericCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
175
|
+
basic: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
176
|
+
datetime: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
177
|
+
text: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
178
|
+
textCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
179
|
+
};
|
|
180
|
+
filterFns: {
|
|
181
|
+
arrIncludes: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
182
|
+
arrIncludesAll: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
183
|
+
arrHas: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
184
|
+
arrIncludesSome: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
185
|
+
between: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
186
|
+
betweenInclusive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
187
|
+
empty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
188
|
+
endsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
189
|
+
equals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
190
|
+
equalsString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
191
|
+
equalsStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
192
|
+
inDateRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
193
|
+
inNumberRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
194
|
+
includesString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
195
|
+
includesStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
196
|
+
notEmpty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
197
|
+
startsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
198
|
+
weakEquals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
199
|
+
};
|
|
200
|
+
}, TData>;
|
|
201
|
+
}): any;
|
|
202
|
+
}>;
|
|
203
|
+
emit: (evt: "row-click", row: TData) => void;
|
|
204
|
+
}>) => import('vue').VNode & {
|
|
205
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
206
|
+
};
|
|
207
|
+
export default _default;
|
|
208
|
+
type __VLS_Prettify<T> = {
|
|
209
|
+
[K in keyof T]: T[K];
|
|
210
|
+
} & {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
table: any;
|
|
3
|
+
title?: string;
|
|
4
|
+
resetLabel?: string;
|
|
5
|
+
}>, {
|
|
6
|
+
title: string;
|
|
7
|
+
resetLabel: string;
|
|
8
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
9
|
+
table: any;
|
|
10
|
+
title?: string;
|
|
11
|
+
resetLabel?: string;
|
|
12
|
+
}>, {
|
|
13
|
+
title: string;
|
|
14
|
+
resetLabel: string;
|
|
15
|
+
}>>> & Readonly<{}>, {
|
|
16
|
+
title: string;
|
|
17
|
+
resetLabel: string;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
22
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
+
} : {
|
|
25
|
+
type: import('vue').PropType<T[K]>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type __VLS_WithDefaults<P, D> = {
|
|
30
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
31
|
+
default: D[K];
|
|
32
|
+
}> : P[K];
|
|
33
|
+
};
|
|
34
|
+
type __VLS_Prettify<T> = {
|
|
35
|
+
[K in keyof T]: T[K];
|
|
36
|
+
} & {};
|
package/dist/features/index.d.ts
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SkyTableColumn } from '../../shared/ui/table/types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
columns: SkyTableColumn[];
|
|
5
|
+
/** Мапа `name → показувати` з useColumnVisibility. */
|
|
6
|
+
modelValue: Record<string, boolean>;
|
|
7
|
+
title?: string;
|
|
8
|
+
resetLabel?: string;
|
|
9
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
"update:modelValue": (value: Record<string, boolean>) => void;
|
|
11
|
+
reset: () => void;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
columns: SkyTableColumn[];
|
|
14
|
+
/** Мапа `name → показувати` з useColumnVisibility. */
|
|
15
|
+
modelValue: Record<string, boolean>;
|
|
16
|
+
title?: string;
|
|
17
|
+
resetLabel?: string;
|
|
18
|
+
}>>> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: ((value: Record<string, boolean>) => any) | undefined;
|
|
20
|
+
onReset?: (() => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
24
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
25
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
26
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
27
|
+
} : {
|
|
28
|
+
type: import('vue').PropType<T[K]>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
default?(_: {}): any;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
/** Скільки рядків обрано. При 0 панель не рендериться. */
|
|
6
|
+
count: number;
|
|
7
|
+
/** Доступні масові дії. */
|
|
8
|
+
actions: {
|
|
9
|
+
value: string;
|
|
10
|
+
title: string;
|
|
11
|
+
}[];
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
}>, {
|
|
14
|
+
placeholder: string;
|
|
15
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
+
action: (value: string) => void;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
18
|
+
/** Скільки рядків обрано. При 0 панель не рендериться. */
|
|
19
|
+
count: number;
|
|
20
|
+
/** Доступні масові дії. */
|
|
21
|
+
actions: {
|
|
22
|
+
value: string;
|
|
23
|
+
title: string;
|
|
24
|
+
}[];
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
}>, {
|
|
27
|
+
placeholder: string;
|
|
28
|
+
}>>> & Readonly<{
|
|
29
|
+
onAction?: ((value: string) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
placeholder: string;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
36
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
37
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
38
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
39
|
+
} : {
|
|
40
|
+
type: import('vue').PropType<T[K]>;
|
|
41
|
+
required: true;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
type __VLS_WithDefaults<P, D> = {
|
|
45
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
46
|
+
default: D[K];
|
|
47
|
+
}> : P[K];
|
|
48
|
+
};
|
|
49
|
+
type __VLS_Prettify<T> = {
|
|
50
|
+
[K in keyof T]: T[K];
|
|
51
|
+
} & {};
|
|
52
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
53
|
+
new (): {
|
|
54
|
+
$slots: S;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
default?(_: {
|
|
4
|
+
item: any;
|
|
5
|
+
index: any;
|
|
6
|
+
active: any;
|
|
7
|
+
}): any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
10
|
+
items: any[];
|
|
11
|
+
/** Ключ ідентифікатора рядка. */
|
|
12
|
+
keyField?: string;
|
|
13
|
+
/** Очікувана мінімальна висота рядка — база для розрахунку вікна. */
|
|
14
|
+
minItemSize?: number;
|
|
15
|
+
/** Поля, зміна яких змінює висоту рядка (розкриті модифікації, теги). */
|
|
16
|
+
sizeDependencies?: (row: any) => unknown[];
|
|
17
|
+
}>, {
|
|
18
|
+
keyField: string;
|
|
19
|
+
minItemSize: number;
|
|
20
|
+
sizeDependencies: undefined;
|
|
21
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
+
"reach-end": () => void;
|
|
23
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
24
|
+
items: any[];
|
|
25
|
+
/** Ключ ідентифікатора рядка. */
|
|
26
|
+
keyField?: string;
|
|
27
|
+
/** Очікувана мінімальна висота рядка — база для розрахунку вікна. */
|
|
28
|
+
minItemSize?: number;
|
|
29
|
+
/** Поля, зміна яких змінює висоту рядка (розкриті модифікації, теги). */
|
|
30
|
+
sizeDependencies?: (row: any) => unknown[];
|
|
31
|
+
}>, {
|
|
32
|
+
keyField: string;
|
|
33
|
+
minItemSize: number;
|
|
34
|
+
sizeDependencies: undefined;
|
|
35
|
+
}>>> & Readonly<{
|
|
36
|
+
"onReach-end"?: (() => any) | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
keyField: string;
|
|
39
|
+
minItemSize: number;
|
|
40
|
+
sizeDependencies: (row: any) => unknown[];
|
|
41
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
42
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
45
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
46
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
47
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
48
|
+
} : {
|
|
49
|
+
type: import('vue').PropType<T[K]>;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
type __VLS_WithDefaults<P, D> = {
|
|
54
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
55
|
+
default: D[K];
|
|
56
|
+
}> : P[K];
|
|
57
|
+
};
|
|
58
|
+
type __VLS_Prettify<T> = {
|
|
59
|
+
[K in keyof T]: T[K];
|
|
60
|
+
} & {};
|
|
61
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
62
|
+
new (): {
|
|
63
|
+
$slots: S;
|
|
64
|
+
};
|
|
65
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { skyTableFeatures, createSkyColumnHelper } from './tableFeatures';
|
|
2
|
+
export type { SkyTableFeatures } from './tableFeatures';
|
|
3
|
+
export { useTableSort } from './useTableSort';
|
|
4
|
+
export { useTableSelection } from './useTableSelection';
|
|
5
|
+
export { useColumnVisibility } from './useColumnVisibility';
|
|
6
|
+
export type { UseTableSortOptions, UseTableSortReturn } from './useTableSort';
|
|
7
|
+
export type { UseTableSelectionOptions, UseTableSelectionReturn, } from './useTableSelection';
|
|
8
|
+
export type { UseColumnVisibilityOptions, UseColumnVisibilityReturn, } from './useColumnVisibility';
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/vue-table';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Стабільний набір фіч для гріда — визначається один раз статично, поза
|
|
5
|
+
* компонентом, як і радить TanStack v9. Сюди входять лише ті плагіни, що
|
|
6
|
+
* реально потрібні продукту: сортування, вибір рядків, видимість колонок,
|
|
7
|
+
* пагінація і фільтрація (колонкова + глобальний пошук).
|
|
8
|
+
*
|
|
9
|
+
* Разом із плагінами тут же живуть слоти row-моделей і реєстри функцій
|
|
10
|
+
* (`sortFns` / `filterFns`) — їхні ключі стають валідними значеннями для
|
|
11
|
+
* `sortFn` та `filterFn` у визначеннях колонок, з повним виведенням типів.
|
|
12
|
+
*
|
|
13
|
+
* Потрібно щось поза цим набором (групування, пінінг, розгортання рядків) —
|
|
14
|
+
* зберіть власний обʼєкт через `tableFeatures()` і передайте в `SkyDataTable`
|
|
15
|
+
* пропом `features`: те, чого немає в наборі, не потрапляє ні в типи, ні в бандл.
|
|
16
|
+
*/
|
|
17
|
+
export declare const skyTableFeatures: {
|
|
18
|
+
columnFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
19
|
+
columnSizingFeature: import('@tanstack/table-core').TableFeature;
|
|
20
|
+
columnVisibilityFeature: import('@tanstack/table-core').TableFeature;
|
|
21
|
+
globalFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
22
|
+
rowPaginationFeature: import('@tanstack/table-core').TableFeature;
|
|
23
|
+
rowSelectionFeature: import('@tanstack/table-core').TableFeature;
|
|
24
|
+
rowSortingFeature: import('@tanstack/table-core').TableFeature;
|
|
25
|
+
coreRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
26
|
+
filteredRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
27
|
+
sortedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
28
|
+
paginatedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
29
|
+
sortFns: {
|
|
30
|
+
alphanumeric: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
31
|
+
alphanumericCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
32
|
+
basic: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
33
|
+
datetime: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
34
|
+
text: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
35
|
+
textCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
36
|
+
};
|
|
37
|
+
filterFns: {
|
|
38
|
+
arrIncludes: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
39
|
+
arrIncludesAll: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
40
|
+
arrHas: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
41
|
+
arrIncludesSome: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
42
|
+
between: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
43
|
+
betweenInclusive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
44
|
+
empty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
45
|
+
endsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
46
|
+
equals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
47
|
+
equalsString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
48
|
+
equalsStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
49
|
+
inDateRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
50
|
+
inNumberRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
51
|
+
includesString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
52
|
+
includesStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
53
|
+
notEmpty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
54
|
+
startsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
55
|
+
weakEquals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export type SkyTableFeatures = typeof skyTableFeatures;
|
|
59
|
+
/**
|
|
60
|
+
* Типізований помічник для опису колонок під наш набір фіч.
|
|
61
|
+
*
|
|
62
|
+
* ```ts
|
|
63
|
+
* const column = createSkyColumnHelper<Product>()
|
|
64
|
+
* const columns = [
|
|
65
|
+
* column.accessor('name', { header: 'Назва' }),
|
|
66
|
+
* column.display({ id: 'actions', cell: ({ row }) => h(RowActions, { row }) }),
|
|
67
|
+
* ]
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare function createSkyColumnHelper<TData extends RowData>(): import('@tanstack/table-core').ColumnHelper<{
|
|
71
|
+
columnFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
72
|
+
columnSizingFeature: import('@tanstack/table-core').TableFeature;
|
|
73
|
+
columnVisibilityFeature: import('@tanstack/table-core').TableFeature;
|
|
74
|
+
globalFilteringFeature: import('@tanstack/table-core').TableFeature;
|
|
75
|
+
rowPaginationFeature: import('@tanstack/table-core').TableFeature;
|
|
76
|
+
rowSelectionFeature: import('@tanstack/table-core').TableFeature;
|
|
77
|
+
rowSortingFeature: import('@tanstack/table-core').TableFeature;
|
|
78
|
+
coreRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
79
|
+
filteredRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
80
|
+
sortedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
81
|
+
paginatedRowModel: (table: import('@tanstack/table-core').Table<any, any>) => () => import('@tanstack/table-core').RowModel<any, any>;
|
|
82
|
+
sortFns: {
|
|
83
|
+
alphanumeric: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
84
|
+
alphanumericCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
85
|
+
basic: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
86
|
+
datetime: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
87
|
+
text: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
88
|
+
textCaseSensitive: import('@tanstack/table-core').CreatedSortFn<any, any>;
|
|
89
|
+
};
|
|
90
|
+
filterFns: {
|
|
91
|
+
arrIncludes: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
92
|
+
arrIncludesAll: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
93
|
+
arrHas: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
94
|
+
arrIncludesSome: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
95
|
+
between: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
96
|
+
betweenInclusive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
97
|
+
empty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
98
|
+
endsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
99
|
+
equals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
100
|
+
equalsString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
101
|
+
equalsStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
102
|
+
inDateRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
103
|
+
inNumberRange: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
104
|
+
includesString: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
105
|
+
includesStringSensitive: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
106
|
+
notEmpty: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
107
|
+
startsWith: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
108
|
+
weakEquals: import('@tanstack/table-core').CreatedFilterFn<any, any>;
|
|
109
|
+
};
|
|
110
|
+
}, TData>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { SkyTableColumn } from '../../ui/table/types';
|
|
3
|
+
|
|
4
|
+
type MaybeRef<T> = T | Ref<T> | ComputedRef<T>;
|
|
5
|
+
export interface UseColumnVisibilityOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Ключ у localStorage для збереження вибору користувача. Без нього
|
|
8
|
+
* налаштування живуть лише до перезавантаження сторінки.
|
|
9
|
+
*/
|
|
10
|
+
storageKey?: string;
|
|
11
|
+
/** Колонки, приховані за замовчуванням. */
|
|
12
|
+
hidden?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface UseColumnVisibilityReturn {
|
|
15
|
+
/** Мапа `name → показувати`. Придатна для v-model у налаштуваннях колонок. */
|
|
16
|
+
visibility: Ref<Record<string, boolean>>;
|
|
17
|
+
/** Колонки, які треба віддати в SkyTableRoot. */
|
|
18
|
+
visibleColumns: ComputedRef<SkyTableColumn[]>;
|
|
19
|
+
toggle: (name: string) => void;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Видимість колонок із опційним збереженням у localStorage.
|
|
24
|
+
*
|
|
25
|
+
* Стара таблиця тримала це у внутрішньому стані й дублювала в `header[].enable`,
|
|
26
|
+
* тож зовні дізнатись про вибір користувача було нічим.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useColumnVisibility(columns: MaybeRef<SkyTableColumn[]>, options?: UseColumnVisibilityOptions): UseColumnVisibilityReturn;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
type MaybeRef<T> = T | Ref<T> | ComputedRef<T>;
|
|
4
|
+
export interface UseTableSelectionOptions<T> {
|
|
5
|
+
/** Ключ ідентифікатора рядка або функція, що його дістає. */
|
|
6
|
+
rowId?: string | ((row: T) => string | number);
|
|
7
|
+
/** Рядки, які не можна обрати (напр. вкладені модифікації). */
|
|
8
|
+
selectable?: (row: T) => boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface UseTableSelectionReturn<T> {
|
|
11
|
+
selected: Ref<T[]>;
|
|
12
|
+
selectedIds: ComputedRef<(string | number)[]>;
|
|
13
|
+
isSelected: (row: T) => boolean;
|
|
14
|
+
/** Усі доступні для вибору рядки обрані. */
|
|
15
|
+
allSelected: ComputedRef<boolean>;
|
|
16
|
+
/** Обрано частину — для indeterminate-стану чекбокса в шапці. */
|
|
17
|
+
someSelected: ComputedRef<boolean>;
|
|
18
|
+
/** Перемкнути рядок. `shift: true` виділяє діапазон від попереднього кліку. */
|
|
19
|
+
toggle: (row: T, index: number, options?: {
|
|
20
|
+
shift?: boolean;
|
|
21
|
+
}) => void;
|
|
22
|
+
toggleAll: () => void;
|
|
23
|
+
clear: () => void;
|
|
24
|
+
/** Прибрати рядок із вибору за id — напр. після видалення. */
|
|
25
|
+
remove: (id: string | number) => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Вибір рядків: одиночний, shift-діапазон і select-all.
|
|
29
|
+
*
|
|
30
|
+
* На відміну від старої таблиці, нічого не мутує в чужих пропсах — стан живе
|
|
31
|
+
* тут, а назовні віддається через `selected`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useTableSelection<T extends Record<string, any>>(rows: MaybeRef<T[]>, options?: UseTableSelectionOptions<T>): UseTableSelectionReturn<T>;
|
|
34
|
+
export {};
|