@vaadin/grid 24.2.0-dev.f254716fe → 24.3.0-alpha2

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.
Files changed (40) hide show
  1. package/package.json +11 -11
  2. package/src/vaadin-grid-array-data-provider-mixin.js +1 -1
  3. package/src/vaadin-grid-column-group-mixin.d.ts +20 -0
  4. package/src/vaadin-grid-column-group-mixin.js +369 -0
  5. package/src/vaadin-grid-column-group.d.ts +4 -14
  6. package/src/vaadin-grid-column-group.js +8 -356
  7. package/src/vaadin-grid-column-mixin.d.ts +156 -0
  8. package/src/vaadin-grid-column-mixin.js +887 -0
  9. package/src/vaadin-grid-column.d.ts +11 -138
  10. package/src/vaadin-grid-column.js +6 -876
  11. package/src/vaadin-grid-data-provider-mixin.d.ts +6 -5
  12. package/src/vaadin-grid-data-provider-mixin.js +51 -20
  13. package/src/vaadin-grid-drag-and-drop-mixin.js +1 -1
  14. package/src/vaadin-grid-dynamic-columns-mixin.js +1 -1
  15. package/src/vaadin-grid-filter-column.js +5 -1
  16. package/src/vaadin-grid-filter-element-mixin.d.ts +34 -0
  17. package/src/vaadin-grid-filter-element-mixin.js +99 -0
  18. package/src/vaadin-grid-filter.d.ts +4 -21
  19. package/src/vaadin-grid-filter.js +8 -85
  20. package/src/vaadin-grid-keyboard-navigation-mixin.js +24 -4
  21. package/src/vaadin-grid-mixin.d.ts +218 -0
  22. package/src/vaadin-grid-mixin.js +1022 -0
  23. package/src/vaadin-grid-scroll-mixin.js +1 -1
  24. package/src/vaadin-grid-selection-column-base-mixin.d.ts +6 -0
  25. package/src/vaadin-grid-selection-column-base-mixin.js +151 -0
  26. package/src/vaadin-grid-selection-column.js +4 -1
  27. package/src/vaadin-grid-sort-column.js +5 -1
  28. package/src/vaadin-grid-sorter-mixin.d.ts +44 -0
  29. package/src/vaadin-grid-sorter-mixin.js +198 -0
  30. package/src/vaadin-grid-sorter.d.ts +3 -32
  31. package/src/vaadin-grid-sorter.js +8 -182
  32. package/src/vaadin-grid-tree-column-mixin.d.ts +19 -0
  33. package/src/vaadin-grid-tree-column-mixin.js +92 -0
  34. package/src/vaadin-grid-tree-column.d.ts +9 -7
  35. package/src/vaadin-grid-tree-column.js +7 -82
  36. package/src/vaadin-grid-tree-toggle.js +3 -1
  37. package/src/vaadin-grid.d.ts +5 -190
  38. package/src/vaadin-grid.js +7 -1018
  39. package/web-types.json +2311 -0
  40. package/web-types.lit.json +1007 -0
@@ -0,0 +1,218 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
+ import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
8
+ import type { ActiveItemMixinClass } from './vaadin-grid-active-item-mixin.js';
9
+ import type { ArrayDataProviderMixinClass } from './vaadin-grid-array-data-provider-mixin.js';
10
+ import type { GridColumn } from './vaadin-grid-column.js';
11
+ import { GridBodyRenderer, GridHeaderFooterRenderer } from './vaadin-grid-column.js';
12
+ import type { ColumnReorderingMixinClass } from './vaadin-grid-column-reordering-mixin.js';
13
+ import type { DataProviderMixinClass } from './vaadin-grid-data-provider-mixin.js';
14
+ import {
15
+ GridDataProvider,
16
+ GridDataProviderCallback,
17
+ GridDataProviderParams,
18
+ GridFilterDefinition,
19
+ GridSorterDefinition,
20
+ GridSorterDirection,
21
+ } from './vaadin-grid-data-provider-mixin.js';
22
+ import type { DragAndDropMixinClass } from './vaadin-grid-drag-and-drop-mixin.js';
23
+ import { GridDragAndDropFilter, GridDropLocation, GridDropMode } from './vaadin-grid-drag-and-drop-mixin.js';
24
+ import type { EventContextMixinClass } from './vaadin-grid-event-context-mixin.js';
25
+ import { GridEventContext } from './vaadin-grid-event-context-mixin.js';
26
+ import type { RowDetailsMixinClass } from './vaadin-grid-row-details-mixin.js';
27
+ import { GridRowDetailsRenderer } from './vaadin-grid-row-details-mixin.js';
28
+ import type { ScrollMixinClass } from './vaadin-grid-scroll-mixin.js';
29
+ import type { SelectionMixinClass } from './vaadin-grid-selection-mixin.js';
30
+ import type { SortMixinClass } from './vaadin-grid-sort-mixin.js';
31
+ import type {
32
+ GridCellClassNameGenerator,
33
+ GridCellPartNameGenerator,
34
+ StylingMixinClass,
35
+ } from './vaadin-grid-styling-mixin.js';
36
+
37
+ export {
38
+ GridBodyRenderer,
39
+ GridCellClassNameGenerator,
40
+ GridCellPartNameGenerator,
41
+ GridDataProvider,
42
+ GridDataProviderCallback,
43
+ GridDataProviderParams,
44
+ GridDragAndDropFilter,
45
+ GridDropLocation,
46
+ GridDropMode,
47
+ GridEventContext,
48
+ GridFilterDefinition,
49
+ GridHeaderFooterRenderer,
50
+ GridRowDetailsRenderer,
51
+ GridSorterDefinition,
52
+ GridSorterDirection,
53
+ };
54
+
55
+ export interface GridItemModel<TItem> {
56
+ index: number;
57
+ item: TItem;
58
+ selected?: boolean;
59
+ expanded?: boolean;
60
+ level?: number;
61
+ detailsOpened?: boolean;
62
+ }
63
+
64
+ /**
65
+ * Fired when the `activeItem` property changes.
66
+ */
67
+ export type GridActiveItemChangedEvent<TItem> = CustomEvent<{ value: TItem | null | undefined }>;
68
+
69
+ /**
70
+ * Fired when the cell is activated with click or keyboard.
71
+ */
72
+ export type GridCellActivateEvent<TItem> = CustomEvent<{ model: GridItemModel<TItem> }>;
73
+
74
+ /**
75
+ * Fired when a cell is focused with click or keyboard navigation.
76
+ */
77
+ export type GridCellFocusEvent<TItem> = CustomEvent<{ context: GridEventContext<TItem> }>;
78
+
79
+ /**
80
+ * Fired when the columns in the grid are reordered.
81
+ */
82
+ export type GridColumnReorderEvent<TItem> = CustomEvent<{ columns: Array<GridColumn<TItem>> }>;
83
+
84
+ /**
85
+ * Fired when the grid column resize is finished.
86
+ */
87
+ export type GridColumnResizeEvent<TItem> = CustomEvent<{ resizedColumn: GridColumn<TItem> }>;
88
+
89
+ /**
90
+ * Fired when the `dataProvider` property changes.
91
+ */
92
+ export type GridDataProviderChangedEvent<TItem> = CustomEvent<{ value: GridDataProvider<TItem> }>;
93
+
94
+ /**
95
+ * Fired when the `expandedItems` property changes.
96
+ */
97
+ export type GridExpandedItemsChangedEvent<TItem> = CustomEvent<{ value: TItem[] }>;
98
+
99
+ /**
100
+ * Fired when starting to drag grid rows.
101
+ */
102
+ export type GridDragStartEvent<TItem> = CustomEvent<{
103
+ draggedItems: TItem[];
104
+ setDraggedItemsCount(count: number): void;
105
+ setDragData(type: string, data: string): void;
106
+ }>;
107
+
108
+ /**
109
+ * Fired when a drop occurs on top of the grid.
110
+ */
111
+ export type GridDropEvent<TItem> = CustomEvent<{
112
+ dropTargetItem: TItem;
113
+ dropLocation: GridDropLocation;
114
+ dragData: Array<{ type: string; data: string }>;
115
+ }>;
116
+
117
+ /**
118
+ * Fired when the `loading` property changes.
119
+ */
120
+ export type GridLoadingChangedEvent = CustomEvent<{ value: boolean }>;
121
+
122
+ /**
123
+ * Fired when the `selectedItems` property changes.
124
+ */
125
+ export type GridSelectedItemsChangedEvent<TItem> = CustomEvent<{ value: TItem[] }>;
126
+
127
+ /**
128
+ * Fired when the `size` property changes.
129
+ */
130
+ export type GridSizeChangedEvent = CustomEvent<{ value: number }>;
131
+
132
+ export interface GridCustomEventMap<TItem> {
133
+ 'active-item-changed': GridActiveItemChangedEvent<TItem>;
134
+
135
+ 'cell-activate': GridCellActivateEvent<TItem>;
136
+
137
+ 'cell-focus': GridCellFocusEvent<TItem>;
138
+
139
+ 'column-reorder': GridColumnReorderEvent<TItem>;
140
+
141
+ 'column-resize': GridColumnResizeEvent<TItem>;
142
+
143
+ 'data-provider-changed': GridDataProviderChangedEvent<TItem>;
144
+
145
+ 'expanded-items-changed': GridExpandedItemsChangedEvent<TItem>;
146
+
147
+ 'grid-dragstart': GridDragStartEvent<TItem>;
148
+
149
+ 'grid-dragend': Event;
150
+
151
+ 'grid-drop': GridDropEvent<TItem>;
152
+
153
+ 'loading-changed': GridLoadingChangedEvent;
154
+
155
+ 'selected-items-changed': GridSelectedItemsChangedEvent<TItem>;
156
+
157
+ 'size-changed': GridSizeChangedEvent;
158
+ }
159
+
160
+ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEventMap<TItem> {}
161
+
162
+ export declare function GridMixin<TItem, T extends Constructor<HTMLElement>>(
163
+ base: T,
164
+ ): Constructor<ActiveItemMixinClass<TItem>> &
165
+ Constructor<ArrayDataProviderMixinClass<TItem>> &
166
+ Constructor<ColumnReorderingMixinClass> &
167
+ Constructor<DataProviderMixinClass<TItem>> &
168
+ Constructor<DisabledMixinClass> &
169
+ Constructor<DragAndDropMixinClass<TItem>> &
170
+ Constructor<EventContextMixinClass<TItem>> &
171
+ Constructor<GridMixinClass<TItem>> &
172
+ Constructor<RowDetailsMixinClass<TItem>> &
173
+ Constructor<ScrollMixinClass> &
174
+ Constructor<SelectionMixinClass<TItem>> &
175
+ Constructor<SortMixinClass> &
176
+ Constructor<StylingMixinClass<TItem>> &
177
+ T;
178
+
179
+ export interface GridMixinClass<TItem>
180
+ extends DisabledMixinClass,
181
+ ActiveItemMixinClass<TItem>,
182
+ ArrayDataProviderMixinClass<TItem>,
183
+ DataProviderMixinClass<TItem>,
184
+ RowDetailsMixinClass<TItem>,
185
+ ScrollMixinClass,
186
+ SelectionMixinClass<TItem>,
187
+ SortMixinClass,
188
+ ColumnReorderingMixinClass,
189
+ EventContextMixinClass<TItem>,
190
+ StylingMixinClass<TItem>,
191
+ DragAndDropMixinClass<TItem> {
192
+ /**
193
+ * If true, the grid's height is defined by its rows.
194
+ *
195
+ * Effectively, this disables the grid's virtual scrolling so that all the rows are rendered in the DOM at once.
196
+ * If the grid has a large number of items, using the feature is discouraged to avoid performance issues.
197
+ * @attr {boolean} all-rows-visible
198
+ */
199
+ allRowsVisible: boolean;
200
+
201
+ /**
202
+ * Updates the `width` of all columns which have `autoWidth` set to `true`.
203
+ */
204
+ recalculateColumnWidths(): void;
205
+
206
+ /**
207
+ * Requests an update for the content of cells.
208
+ *
209
+ * While performing the update, the following renderers are invoked:
210
+ * - `Grid.rowDetailsRenderer`
211
+ * - `GridColumn.renderer`
212
+ * - `GridColumn.headerRenderer`
213
+ * - `GridColumn.footerRenderer`
214
+ *
215
+ * It is not guaranteed that the update happens immediately (synchronously) after it is requested.
216
+ */
217
+ requestContentUpdate(): void;
218
+ }