@open-grid/vue-ui 0.1.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/LICENSE +21 -0
- package/README.md +57 -0
- package/dist/index.css +1132 -0
- package/dist/index.d.ts +370 -0
- package/dist/index.js +1742 -0
- package/package.json +61 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { DefineComponent, PropType, VNodeChild, VNode } from 'vue';
|
|
3
|
+
import { GridOptions, Grid, Row, HeaderContext, CellContext, Column, CellFillOptions, ClipboardPasteResult, ClipboardPasteOptions, ExportFile } from '@open-grid/core';
|
|
4
|
+
export { AccessorColumnOptions, AccessorFnColumnDef, AccessorKey, AccessorKeyColumnDef, AnyColumnDef, CellContext, CellCoordinate, CellEditEvent, CellEditEventParams, CellEditHistoryAction, CellEditHistoryState, CellEditOption, CellEditParserContext, CellEditPhase, CellEditValidationContext, CellEditValidationResult, CellEditValidationState, CellEditingState, CellFillOptions, CellInteractionEvent, CellInteractionEventParams, CellRange, CellRangeSelectionState, ClipboardCellContext, ClipboardCopyOptions, ClipboardPasteCellContext, ClipboardPasteCommittedCell, ClipboardPasteOptions, ClipboardPasteResult, ClipboardPasteSkippedCell, ClipboardPasteSkippedReason, ClipboardPasteValidationError, Column, ColumnDef, ColumnFilter, ColumnFiltersState, ColumnHelper, ColumnId, ColumnMovePosition, ColumnOrderState, ColumnPinningPosition, ColumnPinningState, ColumnResizeEvent, ColumnResizeEventParams, ColumnResizePhase, ColumnSizingState, ColumnVisibilityState, DisplayColumnDef, ExpandedState, ExportFile, ExportFileOptions, FilterFn, FitColumnsToWidthOptions, Grid, GridCacheDiagnostics, GridCacheDiagnosticsEntry, GridCacheKey, GridOptions, GridState, GroupColumnDef, GroupingState, Header, HeaderContext, HeaderGroup, MoveFocusOptions, PaginationState, Row, RowId, RowInteractionEvent, RowInteractionEventParams, RowModel, RowSelectionCleanupScope, RowSelectionState, SortFn, SortingRule, SortingState, Updater, fitColumnsToWidth } from '@open-grid/core';
|
|
5
|
+
import { ColumnVirtualizationPrimitiveOptions, GridDensity, RowVirtualizationPrimitiveOptions } from '@open-grid/primitives';
|
|
6
|
+
export { GRID_PREFERENCES_VERSION, GridDensity, GridPreferences, GridPreferencesOptions, GridPreferencesState, GridPreferencesStorageEnvironmentLike, GridPreferencesStorageLike, createGridPreferences, getBrowserGridPreferencesStorage, parseGridPreferences, readGridPreferences, removeGridPreferences, serializeGridPreferences, writeGridPreferences } from '@open-grid/primitives';
|
|
7
|
+
export { createColumnHelper, useGrid } from '@open-grid/vue';
|
|
8
|
+
|
|
9
|
+
interface DataGridProps<TData> {
|
|
10
|
+
ariaLabel?: string;
|
|
11
|
+
options: GridOptions<TData>;
|
|
12
|
+
emptyState?: VNodeChild;
|
|
13
|
+
error?: boolean;
|
|
14
|
+
errorState?: VNodeChild;
|
|
15
|
+
onRetry?: () => void;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
loadingState?: VNodeChild;
|
|
18
|
+
onGridReady?: GridReadyHandler<TData>;
|
|
19
|
+
getRowClassName?: (row: Row<TData>) => string | undefined;
|
|
20
|
+
getHeaderClassName?: (context: HeaderContext<TData, unknown>) => string | undefined;
|
|
21
|
+
getCellClassName?: (context: CellContext<TData, unknown>) => string | undefined;
|
|
22
|
+
groupingPanel?: boolean;
|
|
23
|
+
quickFilterControl?: boolean;
|
|
24
|
+
rowSelectionControls?: boolean;
|
|
25
|
+
columnVisibilityControls?: boolean;
|
|
26
|
+
density?: GridDensity;
|
|
27
|
+
defaultDensity?: GridDensity;
|
|
28
|
+
densityControl?: boolean;
|
|
29
|
+
onDensityChange?: (density: GridDensity) => void;
|
|
30
|
+
columnFilterControls?: boolean;
|
|
31
|
+
paginationControls?: boolean;
|
|
32
|
+
pageSizeOptions?: readonly number[];
|
|
33
|
+
columnPinningControls?: boolean;
|
|
34
|
+
headerActionMenu?: boolean;
|
|
35
|
+
headerActionMenuItems?: HeaderActionMenuItems<TData>;
|
|
36
|
+
rowVirtualization?: boolean | RowVirtualizationOptions;
|
|
37
|
+
columnVirtualization?: boolean | ColumnVirtualizationOptions;
|
|
38
|
+
cellFillOptions?: Omit<CellFillOptions, "sourceEvent">;
|
|
39
|
+
clipboardPasteOptions?: Omit<ClipboardPasteOptions, "sourceEvent">;
|
|
40
|
+
onClipboardPaste?: (result: ClipboardPasteResult<TData>) => void;
|
|
41
|
+
style?: unknown;
|
|
42
|
+
class?: unknown;
|
|
43
|
+
}
|
|
44
|
+
type DataGridComponent<TData> = DefineComponent<DataGridProps<TData>>;
|
|
45
|
+
type GridReadyHandler<TData> = (grid: Grid<TData>) => void | (() => void);
|
|
46
|
+
type RowVirtualizationOptions = RowVirtualizationPrimitiveOptions;
|
|
47
|
+
type ColumnVirtualizationOptions = ColumnVirtualizationPrimitiveOptions;
|
|
48
|
+
interface HeaderActionMenuActionItem<TData> {
|
|
49
|
+
type?: "action";
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
onSelect: (context: HeaderActionMenuContext<TData>) => void;
|
|
54
|
+
}
|
|
55
|
+
interface HeaderActionMenuLabelItem {
|
|
56
|
+
type: "label";
|
|
57
|
+
id: string;
|
|
58
|
+
label: string;
|
|
59
|
+
}
|
|
60
|
+
interface HeaderActionMenuSeparatorItem {
|
|
61
|
+
type: "separator";
|
|
62
|
+
id: string;
|
|
63
|
+
label?: string;
|
|
64
|
+
}
|
|
65
|
+
interface HeaderActionMenuCustomItem<TData> {
|
|
66
|
+
type: "custom";
|
|
67
|
+
id: string;
|
|
68
|
+
label?: string;
|
|
69
|
+
render: (context: HeaderActionMenuContext<TData>) => VNodeChild;
|
|
70
|
+
}
|
|
71
|
+
type HeaderActionMenuItem<TData> = HeaderActionMenuActionItem<TData> | HeaderActionMenuLabelItem | HeaderActionMenuSeparatorItem | HeaderActionMenuCustomItem<TData>;
|
|
72
|
+
interface HeaderActionMenuContext<TData> {
|
|
73
|
+
grid: Grid<TData>;
|
|
74
|
+
column: Column<TData, unknown>;
|
|
75
|
+
sortDirection: "asc" | "desc" | false;
|
|
76
|
+
pinningPosition: "left" | "right" | false;
|
|
77
|
+
isGrouped: boolean;
|
|
78
|
+
canMoveLeft: boolean;
|
|
79
|
+
canMoveRight: boolean;
|
|
80
|
+
defaultItems: Array<HeaderActionMenuActionItem<TData>>;
|
|
81
|
+
}
|
|
82
|
+
type HeaderActionMenuItems<TData> = (context: HeaderActionMenuContext<TData>) => Array<HeaderActionMenuItem<TData> | null | false | undefined>;
|
|
83
|
+
declare const DataGrid: DefineComponent<vue.ExtractPropTypes<{
|
|
84
|
+
ariaLabel: {
|
|
85
|
+
type: StringConstructor;
|
|
86
|
+
default: string;
|
|
87
|
+
};
|
|
88
|
+
options: {
|
|
89
|
+
type: PropType<GridOptions<unknown>>;
|
|
90
|
+
required: true;
|
|
91
|
+
};
|
|
92
|
+
emptyState: {
|
|
93
|
+
type: PropType<VNodeChild>;
|
|
94
|
+
default: string;
|
|
95
|
+
};
|
|
96
|
+
error: {
|
|
97
|
+
type: BooleanConstructor;
|
|
98
|
+
default: boolean;
|
|
99
|
+
};
|
|
100
|
+
errorState: {
|
|
101
|
+
type: PropType<VNodeChild>;
|
|
102
|
+
default: () => string;
|
|
103
|
+
};
|
|
104
|
+
onRetry: {
|
|
105
|
+
type: PropType<() => void>;
|
|
106
|
+
default: undefined;
|
|
107
|
+
};
|
|
108
|
+
loading: {
|
|
109
|
+
type: BooleanConstructor;
|
|
110
|
+
default: boolean;
|
|
111
|
+
};
|
|
112
|
+
loadingState: {
|
|
113
|
+
type: PropType<VNodeChild>;
|
|
114
|
+
default: () => string;
|
|
115
|
+
};
|
|
116
|
+
onGridReady: {
|
|
117
|
+
type: PropType<GridReadyHandler<unknown>>;
|
|
118
|
+
default: undefined;
|
|
119
|
+
};
|
|
120
|
+
getRowClassName: {
|
|
121
|
+
type: PropType<(row: Row<unknown>) => string | undefined>;
|
|
122
|
+
default: undefined;
|
|
123
|
+
};
|
|
124
|
+
getHeaderClassName: {
|
|
125
|
+
type: PropType<(context: HeaderContext<unknown, unknown>) => string | undefined>;
|
|
126
|
+
default: undefined;
|
|
127
|
+
};
|
|
128
|
+
getCellClassName: {
|
|
129
|
+
type: PropType<(context: CellContext<unknown, unknown>) => string | undefined>;
|
|
130
|
+
default: undefined;
|
|
131
|
+
};
|
|
132
|
+
groupingPanel: {
|
|
133
|
+
type: BooleanConstructor;
|
|
134
|
+
default: boolean;
|
|
135
|
+
};
|
|
136
|
+
quickFilterControl: {
|
|
137
|
+
type: BooleanConstructor;
|
|
138
|
+
default: boolean;
|
|
139
|
+
};
|
|
140
|
+
rowSelectionControls: {
|
|
141
|
+
type: BooleanConstructor;
|
|
142
|
+
default: boolean;
|
|
143
|
+
};
|
|
144
|
+
columnVisibilityControls: {
|
|
145
|
+
type: BooleanConstructor;
|
|
146
|
+
default: boolean;
|
|
147
|
+
};
|
|
148
|
+
density: {
|
|
149
|
+
type: PropType<GridDensity>;
|
|
150
|
+
default: undefined;
|
|
151
|
+
};
|
|
152
|
+
defaultDensity: {
|
|
153
|
+
type: PropType<GridDensity>;
|
|
154
|
+
default: undefined;
|
|
155
|
+
};
|
|
156
|
+
densityControl: {
|
|
157
|
+
type: BooleanConstructor;
|
|
158
|
+
default: boolean;
|
|
159
|
+
};
|
|
160
|
+
onDensityChange: {
|
|
161
|
+
type: PropType<(density: GridDensity) => void>;
|
|
162
|
+
default: undefined;
|
|
163
|
+
};
|
|
164
|
+
columnFilterControls: {
|
|
165
|
+
type: BooleanConstructor;
|
|
166
|
+
default: boolean;
|
|
167
|
+
};
|
|
168
|
+
paginationControls: {
|
|
169
|
+
type: BooleanConstructor;
|
|
170
|
+
default: boolean;
|
|
171
|
+
};
|
|
172
|
+
pageSizeOptions: {
|
|
173
|
+
type: PropType<readonly number[]>;
|
|
174
|
+
default: undefined;
|
|
175
|
+
};
|
|
176
|
+
columnPinningControls: {
|
|
177
|
+
type: BooleanConstructor;
|
|
178
|
+
default: boolean;
|
|
179
|
+
};
|
|
180
|
+
headerActionMenu: {
|
|
181
|
+
type: BooleanConstructor;
|
|
182
|
+
default: boolean;
|
|
183
|
+
};
|
|
184
|
+
headerActionMenuItems: {
|
|
185
|
+
type: PropType<HeaderActionMenuItems<unknown>>;
|
|
186
|
+
default: undefined;
|
|
187
|
+
};
|
|
188
|
+
rowVirtualization: {
|
|
189
|
+
type: PropType<boolean | RowVirtualizationOptions>;
|
|
190
|
+
default: boolean;
|
|
191
|
+
};
|
|
192
|
+
columnVirtualization: {
|
|
193
|
+
type: PropType<boolean | ColumnVirtualizationOptions>;
|
|
194
|
+
default: boolean;
|
|
195
|
+
};
|
|
196
|
+
cellFillOptions: {
|
|
197
|
+
type: PropType<Omit<CellFillOptions, "sourceEvent">>;
|
|
198
|
+
default: undefined;
|
|
199
|
+
};
|
|
200
|
+
onClipboardPaste: {
|
|
201
|
+
type: PropType<(result: ClipboardPasteResult<unknown>) => void>;
|
|
202
|
+
default: undefined;
|
|
203
|
+
};
|
|
204
|
+
clipboardPasteOptions: {
|
|
205
|
+
type: PropType<Omit<ClipboardPasteOptions, "sourceEvent">>;
|
|
206
|
+
default: undefined;
|
|
207
|
+
};
|
|
208
|
+
}>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
209
|
+
[key: string]: any;
|
|
210
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
211
|
+
ariaLabel: {
|
|
212
|
+
type: StringConstructor;
|
|
213
|
+
default: string;
|
|
214
|
+
};
|
|
215
|
+
options: {
|
|
216
|
+
type: PropType<GridOptions<unknown>>;
|
|
217
|
+
required: true;
|
|
218
|
+
};
|
|
219
|
+
emptyState: {
|
|
220
|
+
type: PropType<VNodeChild>;
|
|
221
|
+
default: string;
|
|
222
|
+
};
|
|
223
|
+
error: {
|
|
224
|
+
type: BooleanConstructor;
|
|
225
|
+
default: boolean;
|
|
226
|
+
};
|
|
227
|
+
errorState: {
|
|
228
|
+
type: PropType<VNodeChild>;
|
|
229
|
+
default: () => string;
|
|
230
|
+
};
|
|
231
|
+
onRetry: {
|
|
232
|
+
type: PropType<() => void>;
|
|
233
|
+
default: undefined;
|
|
234
|
+
};
|
|
235
|
+
loading: {
|
|
236
|
+
type: BooleanConstructor;
|
|
237
|
+
default: boolean;
|
|
238
|
+
};
|
|
239
|
+
loadingState: {
|
|
240
|
+
type: PropType<VNodeChild>;
|
|
241
|
+
default: () => string;
|
|
242
|
+
};
|
|
243
|
+
onGridReady: {
|
|
244
|
+
type: PropType<GridReadyHandler<unknown>>;
|
|
245
|
+
default: undefined;
|
|
246
|
+
};
|
|
247
|
+
getRowClassName: {
|
|
248
|
+
type: PropType<(row: Row<unknown>) => string | undefined>;
|
|
249
|
+
default: undefined;
|
|
250
|
+
};
|
|
251
|
+
getHeaderClassName: {
|
|
252
|
+
type: PropType<(context: HeaderContext<unknown, unknown>) => string | undefined>;
|
|
253
|
+
default: undefined;
|
|
254
|
+
};
|
|
255
|
+
getCellClassName: {
|
|
256
|
+
type: PropType<(context: CellContext<unknown, unknown>) => string | undefined>;
|
|
257
|
+
default: undefined;
|
|
258
|
+
};
|
|
259
|
+
groupingPanel: {
|
|
260
|
+
type: BooleanConstructor;
|
|
261
|
+
default: boolean;
|
|
262
|
+
};
|
|
263
|
+
quickFilterControl: {
|
|
264
|
+
type: BooleanConstructor;
|
|
265
|
+
default: boolean;
|
|
266
|
+
};
|
|
267
|
+
rowSelectionControls: {
|
|
268
|
+
type: BooleanConstructor;
|
|
269
|
+
default: boolean;
|
|
270
|
+
};
|
|
271
|
+
columnVisibilityControls: {
|
|
272
|
+
type: BooleanConstructor;
|
|
273
|
+
default: boolean;
|
|
274
|
+
};
|
|
275
|
+
density: {
|
|
276
|
+
type: PropType<GridDensity>;
|
|
277
|
+
default: undefined;
|
|
278
|
+
};
|
|
279
|
+
defaultDensity: {
|
|
280
|
+
type: PropType<GridDensity>;
|
|
281
|
+
default: undefined;
|
|
282
|
+
};
|
|
283
|
+
densityControl: {
|
|
284
|
+
type: BooleanConstructor;
|
|
285
|
+
default: boolean;
|
|
286
|
+
};
|
|
287
|
+
onDensityChange: {
|
|
288
|
+
type: PropType<(density: GridDensity) => void>;
|
|
289
|
+
default: undefined;
|
|
290
|
+
};
|
|
291
|
+
columnFilterControls: {
|
|
292
|
+
type: BooleanConstructor;
|
|
293
|
+
default: boolean;
|
|
294
|
+
};
|
|
295
|
+
paginationControls: {
|
|
296
|
+
type: BooleanConstructor;
|
|
297
|
+
default: boolean;
|
|
298
|
+
};
|
|
299
|
+
pageSizeOptions: {
|
|
300
|
+
type: PropType<readonly number[]>;
|
|
301
|
+
default: undefined;
|
|
302
|
+
};
|
|
303
|
+
columnPinningControls: {
|
|
304
|
+
type: BooleanConstructor;
|
|
305
|
+
default: boolean;
|
|
306
|
+
};
|
|
307
|
+
headerActionMenu: {
|
|
308
|
+
type: BooleanConstructor;
|
|
309
|
+
default: boolean;
|
|
310
|
+
};
|
|
311
|
+
headerActionMenuItems: {
|
|
312
|
+
type: PropType<HeaderActionMenuItems<unknown>>;
|
|
313
|
+
default: undefined;
|
|
314
|
+
};
|
|
315
|
+
rowVirtualization: {
|
|
316
|
+
type: PropType<boolean | RowVirtualizationOptions>;
|
|
317
|
+
default: boolean;
|
|
318
|
+
};
|
|
319
|
+
columnVirtualization: {
|
|
320
|
+
type: PropType<boolean | ColumnVirtualizationOptions>;
|
|
321
|
+
default: boolean;
|
|
322
|
+
};
|
|
323
|
+
cellFillOptions: {
|
|
324
|
+
type: PropType<Omit<CellFillOptions, "sourceEvent">>;
|
|
325
|
+
default: undefined;
|
|
326
|
+
};
|
|
327
|
+
onClipboardPaste: {
|
|
328
|
+
type: PropType<(result: ClipboardPasteResult<unknown>) => void>;
|
|
329
|
+
default: undefined;
|
|
330
|
+
};
|
|
331
|
+
clipboardPasteOptions: {
|
|
332
|
+
type: PropType<Omit<ClipboardPasteOptions, "sourceEvent">>;
|
|
333
|
+
default: undefined;
|
|
334
|
+
};
|
|
335
|
+
}>> & Readonly<{}>, {
|
|
336
|
+
ariaLabel: string;
|
|
337
|
+
emptyState: VNodeChild;
|
|
338
|
+
error: boolean;
|
|
339
|
+
errorState: VNodeChild;
|
|
340
|
+
onRetry: () => void;
|
|
341
|
+
loading: boolean;
|
|
342
|
+
loadingState: VNodeChild;
|
|
343
|
+
onGridReady: GridReadyHandler<unknown>;
|
|
344
|
+
getRowClassName: (row: Row<unknown>) => string | undefined;
|
|
345
|
+
getHeaderClassName: (context: HeaderContext<unknown, unknown>) => string | undefined;
|
|
346
|
+
getCellClassName: (context: CellContext<unknown, unknown>) => string | undefined;
|
|
347
|
+
groupingPanel: boolean;
|
|
348
|
+
quickFilterControl: boolean;
|
|
349
|
+
rowSelectionControls: boolean;
|
|
350
|
+
columnVisibilityControls: boolean;
|
|
351
|
+
density: "compact" | "standard" | "comfortable";
|
|
352
|
+
defaultDensity: "compact" | "standard" | "comfortable";
|
|
353
|
+
densityControl: boolean;
|
|
354
|
+
onDensityChange: (density: GridDensity) => void;
|
|
355
|
+
columnFilterControls: boolean;
|
|
356
|
+
paginationControls: boolean;
|
|
357
|
+
pageSizeOptions: readonly number[];
|
|
358
|
+
columnPinningControls: boolean;
|
|
359
|
+
headerActionMenu: boolean;
|
|
360
|
+
headerActionMenuItems: HeaderActionMenuItems<unknown>;
|
|
361
|
+
rowVirtualization: boolean | RowVirtualizationPrimitiveOptions;
|
|
362
|
+
columnVirtualization: boolean | ColumnVirtualizationPrimitiveOptions;
|
|
363
|
+
cellFillOptions: Omit<CellFillOptions, "sourceEvent">;
|
|
364
|
+
clipboardPasteOptions: Omit<ClipboardPasteOptions, "sourceEvent">;
|
|
365
|
+
onClipboardPaste: (result: ClipboardPasteResult<unknown>) => void;
|
|
366
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
367
|
+
declare function createDataGrid<TData>(): DataGridComponent<TData>;
|
|
368
|
+
declare function downloadExportFile(file: ExportFile): boolean;
|
|
369
|
+
|
|
370
|
+
export { type ColumnVirtualizationOptions, DataGrid, type DataGridComponent, type DataGridProps, type GridReadyHandler, type HeaderActionMenuActionItem, type HeaderActionMenuContext, type HeaderActionMenuCustomItem, type HeaderActionMenuItem, type HeaderActionMenuItems, type HeaderActionMenuLabelItem, type HeaderActionMenuSeparatorItem, type RowVirtualizationOptions, createDataGrid, downloadExportFile };
|