@vaadin/vaadin-grid 22.0.0-alpha6 → 22.0.0-beta1

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 (84) hide show
  1. package/package.json +24 -34
  2. package/src/vaadin-grid-column-group.d.ts +14 -57
  3. package/src/vaadin-grid-column-group.js +4 -311
  4. package/src/vaadin-grid-column.d.ts +14 -142
  5. package/src/vaadin-grid-column.js +4 -759
  6. package/src/vaadin-grid-filter-column.d.ts +14 -30
  7. package/src/vaadin-grid-filter-column.js +4 -111
  8. package/src/vaadin-grid-filter.d.ts +11 -60
  9. package/src/vaadin-grid-filter.js +4 -116
  10. package/src/vaadin-grid-selection-column.d.ts +12 -75
  11. package/src/vaadin-grid-selection-column.js +4 -276
  12. package/src/vaadin-grid-sort-column.d.ts +12 -56
  13. package/src/vaadin-grid-sort-column.js +4 -109
  14. package/src/vaadin-grid-sorter.d.ts +11 -82
  15. package/src/vaadin-grid-sorter.js +4 -221
  16. package/src/vaadin-grid-tree-column.d.ts +14 -31
  17. package/src/vaadin-grid-tree-column.js +4 -110
  18. package/src/vaadin-grid-tree-toggle.d.ts +11 -91
  19. package/src/vaadin-grid-tree-toggle.js +4 -196
  20. package/src/vaadin-grid.d.ts +10 -422
  21. package/src/vaadin-grid.js +4 -1026
  22. package/theme/lumo/vaadin-grid-column-group.js +1 -1
  23. package/theme/lumo/vaadin-grid-column.js +1 -1
  24. package/theme/lumo/vaadin-grid-filter-column.js +1 -2
  25. package/theme/lumo/vaadin-grid-filter.js +1 -2
  26. package/theme/lumo/vaadin-grid-selection-column.js +1 -2
  27. package/theme/lumo/vaadin-grid-sort-column.js +1 -2
  28. package/theme/lumo/vaadin-grid-sorter.js +1 -2
  29. package/theme/lumo/vaadin-grid-tree-column.js +1 -2
  30. package/theme/lumo/vaadin-grid-tree-toggle.js +1 -2
  31. package/theme/lumo/vaadin-grid.js +1 -9
  32. package/theme/material/vaadin-grid-column-group.js +1 -1
  33. package/theme/material/vaadin-grid-column.js +1 -1
  34. package/theme/material/vaadin-grid-filter-column.js +1 -2
  35. package/theme/material/vaadin-grid-filter.js +1 -2
  36. package/theme/material/vaadin-grid-selection-column.js +1 -2
  37. package/theme/material/vaadin-grid-sort-column.js +1 -2
  38. package/theme/material/vaadin-grid-sorter.js +1 -2
  39. package/theme/material/vaadin-grid-tree-column.js +1 -2
  40. package/theme/material/vaadin-grid-tree-toggle.js +1 -2
  41. package/theme/material/vaadin-grid.js +1 -2
  42. package/vaadin-grid.d.ts +0 -1
  43. package/src/array-data-provider.js +0 -145
  44. package/src/interfaces.d.ts +0 -78
  45. package/src/vaadin-grid-a11y-mixin.d.ts +0 -27
  46. package/src/vaadin-grid-a11y-mixin.js +0 -158
  47. package/src/vaadin-grid-active-item-mixin.d.ts +0 -28
  48. package/src/vaadin-grid-active-item-mixin.js +0 -117
  49. package/src/vaadin-grid-array-data-provider-mixin.d.ts +0 -20
  50. package/src/vaadin-grid-array-data-provider-mixin.js +0 -75
  51. package/src/vaadin-grid-column-reordering-mixin.d.ts +0 -47
  52. package/src/vaadin-grid-column-reordering-mixin.js +0 -387
  53. package/src/vaadin-grid-column-resizing-mixin.d.ts +0 -11
  54. package/src/vaadin-grid-column-resizing-mixin.js +0 -111
  55. package/src/vaadin-grid-data-provider-mixin.d.ts +0 -126
  56. package/src/vaadin-grid-data-provider-mixin.js +0 -520
  57. package/src/vaadin-grid-drag-and-drop-mixin.d.ts +0 -73
  58. package/src/vaadin-grid-drag-and-drop-mixin.js +0 -435
  59. package/src/vaadin-grid-dynamic-columns-mixin.d.ts +0 -27
  60. package/src/vaadin-grid-dynamic-columns-mixin.js +0 -180
  61. package/src/vaadin-grid-event-context-mixin.d.ts +0 -33
  62. package/src/vaadin-grid-event-context-mixin.js +0 -57
  63. package/src/vaadin-grid-filter-mixin.d.ts +0 -13
  64. package/src/vaadin-grid-filter-mixin.js +0 -76
  65. package/src/vaadin-grid-helpers.js +0 -23
  66. package/src/vaadin-grid-keyboard-navigation-mixin.d.ts +0 -31
  67. package/src/vaadin-grid-keyboard-navigation-mixin.js +0 -891
  68. package/src/vaadin-grid-row-details-mixin.d.ts +0 -54
  69. package/src/vaadin-grid-row-details-mixin.js +0 -200
  70. package/src/vaadin-grid-scroll-mixin.d.ts +0 -22
  71. package/src/vaadin-grid-scroll-mixin.js +0 -202
  72. package/src/vaadin-grid-selection-mixin.d.ts +0 -39
  73. package/src/vaadin-grid-selection-mixin.js +0 -93
  74. package/src/vaadin-grid-sort-mixin.d.ts +0 -21
  75. package/src/vaadin-grid-sort-mixin.js +0 -139
  76. package/src/vaadin-grid-styles.js +0 -297
  77. package/src/vaadin-grid-styling-mixin.d.ts +0 -37
  78. package/src/vaadin-grid-styling-mixin.js +0 -71
  79. package/theme/lumo/vaadin-grid-sorter-styles.js +0 -54
  80. package/theme/lumo/vaadin-grid-styles.js +0 -380
  81. package/theme/lumo/vaadin-grid-tree-toggle-styles.js +0 -112
  82. package/theme/material/vaadin-grid-sorter-styles.js +0 -72
  83. package/theme/material/vaadin-grid-styles.js +0 -252
  84. package/theme/material/vaadin-grid-tree-toggle-styles.js +0 -42
@@ -3,283 +3,11 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { GridColumnElement } from './vaadin-grid-column.js';
7
- import '@vaadin/checkbox/src/vaadin-checkbox.js';
6
+ import { GridSelectionColumn } from '@vaadin/grid/src/vaadin-grid-selection-column.js';
8
7
 
9
8
  /**
10
- * `<vaadin-grid-selection-column>` is a helper element for the `<vaadin-grid>`
11
- * that provides default renderers and functionality for item selection.
12
- *
13
- * #### Example:
14
- * ```html
15
- * <vaadin-grid items="[[items]]">
16
- * <vaadin-grid-selection-column frozen auto-select></vaadin-grid-selection-column>
17
- *
18
- * <vaadin-grid-column>
19
- * ...
20
- * ```
21
- *
22
- * By default the selection column displays `<vaadin-checkbox>` elements in the
23
- * column cells. The checkboxes in the body rows toggle selection of the corresponding row items.
24
- *
25
- * When the grid data is provided as an array of [`items`](#/elements/vaadin-grid#property-items),
26
- * the column header gets an additional checkbox that can be used for toggling
27
- * selection for all the items at once.
28
- *
29
- * __The default content can also be overridden__
30
- *
31
- * @fires {CustomEvent} select-all-changed - Fired when the `selectAll` property changes.
9
+ * @deprecated Import `GridSelectionColumn` from `@vaadin/grid/vaadin-grid-selection-column` instead.
32
10
  */
33
- class GridSelectionColumnElement extends GridColumnElement {
34
- static get is() {
35
- return 'vaadin-grid-selection-column';
36
- }
11
+ export const GridSelectionColumnElement = GridSelectionColumn;
37
12
 
38
- static get properties() {
39
- return {
40
- /**
41
- * Width of the cells for this column.
42
- */
43
- width: {
44
- type: String,
45
- value: '58px'
46
- },
47
-
48
- /**
49
- * Flex grow ratio for the cell widths. When set to 0, cell width is fixed.
50
- * @attr {number} flex-grow
51
- * @type {number}
52
- */
53
- flexGrow: {
54
- type: Number,
55
- value: 0
56
- },
57
-
58
- /**
59
- * When true, all the items are selected.
60
- * @attr {boolean} select-all
61
- * @type {boolean}
62
- */
63
- selectAll: {
64
- type: Boolean,
65
- value: false,
66
- notify: true
67
- },
68
-
69
- /**
70
- * When true, the active gets automatically selected.
71
- * @attr {boolean} auto-select
72
- * @type {boolean}
73
- */
74
- autoSelect: {
75
- type: Boolean,
76
- value: false
77
- },
78
-
79
- /** @private */
80
- __indeterminate: Boolean,
81
-
82
- /**
83
- * The previous state of activeItem. When activeItem turns to `null`,
84
- * previousActiveItem will have an Object with just unselected activeItem
85
- * @private
86
- */
87
- __previousActiveItem: Object,
88
-
89
- /** @private */
90
- __selectAllHidden: Boolean
91
- };
92
- }
93
-
94
- static get observers() {
95
- return [
96
- '__onSelectAllChanged(selectAll)',
97
- '_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header, selectAll, __indeterminate, __selectAllHidden)'
98
- ];
99
- }
100
-
101
- constructor() {
102
- super();
103
-
104
- this.__boundOnActiveItemChanged = this.__onActiveItemChanged.bind(this);
105
- this.__boundOnDataProviderChanged = this.__onDataProviderChanged.bind(this);
106
- this.__boundOnSelectedItemsChanged = this.__onSelectedItemsChanged.bind(this);
107
- }
108
-
109
- /** @protected */
110
- disconnectedCallback() {
111
- this._grid.removeEventListener('active-item-changed', this.__boundOnActiveItemChanged);
112
- this._grid.removeEventListener('data-provider-changed', this.__boundOnDataProviderChanged);
113
- this._grid.removeEventListener('filter-changed', this.__boundOnSelectedItemsChanged);
114
- this._grid.removeEventListener('selected-items-changed', this.__boundOnSelectedItemsChanged);
115
-
116
- super.disconnectedCallback();
117
- }
118
-
119
- /** @protected */
120
- connectedCallback() {
121
- super.connectedCallback();
122
- if (this._grid) {
123
- this._grid.addEventListener('active-item-changed', this.__boundOnActiveItemChanged);
124
- this._grid.addEventListener('data-provider-changed', this.__boundOnDataProviderChanged);
125
- this._grid.addEventListener('filter-changed', this.__boundOnSelectedItemsChanged);
126
- this._grid.addEventListener('selected-items-changed', this.__boundOnSelectedItemsChanged);
127
- }
128
- }
129
-
130
- /**
131
- * Renders the Select All checkbox to the header cell.
132
- *
133
- * @override
134
- */
135
- _defaultHeaderRenderer(root, _column) {
136
- let checkbox = root.firstElementChild;
137
- if (!checkbox) {
138
- checkbox = document.createElement('vaadin-checkbox');
139
- checkbox.setAttribute('aria-label', 'Select All');
140
- checkbox.classList.add('vaadin-grid-select-all-checkbox');
141
- checkbox.addEventListener('checked-changed', this.__onSelectAllCheckedChanged.bind(this));
142
- root.appendChild(checkbox);
143
- }
144
-
145
- const checked = this.__isChecked(this.selectAll, this.__indeterminate);
146
- checkbox.__rendererChecked = checked;
147
- checkbox.checked = checked;
148
- checkbox.hidden = this.__selectAllHidden;
149
- checkbox.indeterminate = this.__indeterminate;
150
- }
151
-
152
- /**
153
- * Renders the Select Row checkbox to the body cell.
154
- *
155
- * @override
156
- */
157
- _defaultRenderer(root, _column, { item, selected }) {
158
- let checkbox = root.firstElementChild;
159
- if (!checkbox) {
160
- checkbox = document.createElement('vaadin-checkbox');
161
- checkbox.setAttribute('aria-label', 'Select Row');
162
- checkbox.addEventListener('checked-changed', this.__onSelectRowCheckedChanged.bind(this));
163
- root.appendChild(checkbox);
164
- }
165
-
166
- checkbox.__item = item;
167
- checkbox.__rendererChecked = selected;
168
- checkbox.checked = selected;
169
- }
170
-
171
- /** @private */
172
- __onSelectAllChanged(selectAll) {
173
- if (selectAll === undefined || !this._grid) {
174
- return;
175
- }
176
-
177
- if (!this.__selectAllInitialized) {
178
- // The initial value for selectAll property was applied, avoid clearing pre-selected items
179
- this.__selectAllInitialized = true;
180
- return;
181
- }
182
-
183
- if (this._selectAllChangeLock) {
184
- return;
185
- }
186
-
187
- this._grid.selectedItems = selectAll && Array.isArray(this._grid.items) ? this.__getRootLevelItems() : [];
188
- }
189
-
190
- /**
191
- * Return true if array `a` contains all the items in `b`
192
- * We need this when sorting or to preserve selection after filtering.
193
- * @private
194
- */
195
- __arrayContains(a, b) {
196
- return Array.isArray(a) && Array.isArray(b) && b.every((i) => a.includes(i));
197
- }
198
-
199
- /**
200
- * Enables or disables the Select All mode once the Select All checkbox is switched.
201
- * The listener handles only user-fired events.
202
- *
203
- * @private
204
- */
205
- __onSelectAllCheckedChanged(e) {
206
- // Skip if the state is changed by the renderer.
207
- if (e.target.checked === e.target.__rendererChecked) {
208
- return;
209
- }
210
-
211
- this.selectAll = this.__indeterminate || e.target.checked;
212
- }
213
-
214
- /**
215
- * Selects or deselects the row once the Select Row checkbox is switched.
216
- * The listener handles only user-fired events.
217
- *
218
- * @private
219
- */
220
- __onSelectRowCheckedChanged(e) {
221
- // Skip if the state is changed by the renderer.
222
- if (e.target.checked === e.target.__rendererChecked) {
223
- return;
224
- }
225
-
226
- if (e.target.checked) {
227
- this._grid.selectItem(e.target.__item);
228
- } else {
229
- this._grid.deselectItem(e.target.__item);
230
- }
231
- }
232
-
233
- /**
234
- * iOS needs indeterminated + checked at the same time
235
- * @private
236
- */
237
- __isChecked(selectAll, indeterminate) {
238
- return indeterminate || selectAll;
239
- }
240
-
241
- /** @private */
242
- __onActiveItemChanged(e) {
243
- const activeItem = e.detail.value;
244
- if (this.autoSelect) {
245
- const item = activeItem || this.__previousActiveItem;
246
- if (item) {
247
- this._grid._toggleItem(item);
248
- }
249
- }
250
- this.__previousActiveItem = activeItem;
251
- }
252
-
253
- /** @private */
254
- __getRootLevelItems() {
255
- const rootCache = this._grid._cache;
256
- return [...Array(rootCache.size)].map((_, idx) => rootCache.items[idx]);
257
- }
258
-
259
- /** @private */
260
- __onSelectedItemsChanged() {
261
- this._selectAllChangeLock = true;
262
- if (Array.isArray(this._grid.items)) {
263
- if (!this._grid.selectedItems.length) {
264
- this.selectAll = false;
265
- this.__indeterminate = false;
266
- } else if (this.__arrayContains(this._grid.selectedItems, this.__getRootLevelItems())) {
267
- this.selectAll = true;
268
- this.__indeterminate = false;
269
- } else {
270
- this.selectAll = false;
271
- this.__indeterminate = true;
272
- }
273
- }
274
- this._selectAllChangeLock = false;
275
- }
276
-
277
- /** @private */
278
- __onDataProviderChanged() {
279
- this.__selectAllHidden = !Array.isArray(this._grid.items);
280
- }
281
- }
282
-
283
- customElements.define(GridSelectionColumnElement.is, GridSelectionColumnElement);
284
-
285
- export { GridSelectionColumnElement };
13
+ export * from '@vaadin/grid/src/vaadin-grid-selection-column.js';
@@ -1,63 +1,19 @@
1
- import { GridDefaultItem, GridSorterDirection } from './interfaces';
2
-
3
- import { GridColumnElement } from './vaadin-grid-column.js';
4
-
5
1
  /**
6
- * Fired when the `direction` property changes.
2
+ * @license
3
+ * Copyright (c) 2021 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
7
5
  */
8
- export type GridSortColumnDirectionChangedEvent = CustomEvent<{ value: GridSorterDirection }>;
9
-
10
- export interface GridSortColumnElementEventMap {
11
- 'direction-changed': GridSortColumnDirectionChangedEvent;
12
- }
13
-
14
- export interface GridSortColumnEventMap extends HTMLElementEventMap, GridSortColumnElementEventMap {}
6
+ import { GridDefaultItem } from '@vaadin/grid/src/vaadin-grid.js';
7
+ import { GridSortColumn } from '@vaadin/grid/src/vaadin-grid-sort-column.js';
15
8
 
16
9
  /**
17
- * `<vaadin-grid-sort-column>` is a helper element for the `<vaadin-grid>`
18
- * that provides default header renderer and functionality for sorting.
19
- *
20
- * #### Example:
21
- * ```html
22
- * <vaadin-grid items="[[items]]">
23
- * <vaadin-grid-sort-column path="name.first" direction="asc"></vaadin-grid-sort-column>
24
- *
25
- * <vaadin-grid-column>
26
- * ...
27
- * ```
28
- *
29
- * @fires {CustomEvent} direction-changed - Fired when the `direction` property changes.
10
+ * @deprecated Import `GridSortColumn` from `@vaadin/grid/vaadin-grid-sort-column` instead.
30
11
  */
31
- declare class GridSortColumnElement<TItem = GridDefaultItem> extends GridColumnElement<TItem> {
32
- /**
33
- * JS Path of the property in the item used for sorting the data.
34
- */
35
- path: string | null | undefined;
36
-
37
- /**
38
- * How to sort the data.
39
- * Possible values are `asc` to use an ascending algorithm, `desc` to sort the data in
40
- * descending direction, or `null` for not sorting the data.
41
- */
42
- direction: GridSorterDirection | null | undefined;
12
+ export type GridSortColumnElement<TItem = GridDefaultItem> = GridSortColumn<TItem>;
43
13
 
44
- addEventListener<K extends keyof GridSortColumnEventMap>(
45
- type: K,
46
- listener: (this: GridSortColumnElement<TItem>, ev: GridSortColumnEventMap[K]) => void,
47
- options?: boolean | AddEventListenerOptions
48
- ): void;
49
-
50
- removeEventListener<K extends keyof GridSortColumnEventMap>(
51
- type: K,
52
- listener: (this: GridSortColumnElement<TItem>, ev: GridSortColumnEventMap[K]) => void,
53
- options?: boolean | EventListenerOptions
54
- ): void;
55
- }
56
-
57
- declare global {
58
- interface HTMLElementTagNameMap {
59
- 'vaadin-grid-sort-column': GridSortColumnElement<GridDefaultItem>;
60
- }
61
- }
14
+ /**
15
+ * @deprecated Import `GridSortColumn` from `@vaadin/grid/vaadin-grid-sort-column` instead.
16
+ */
17
+ export const GridSortColumnElement: typeof GridSortColumn;
62
18
 
63
- export { GridSortColumnElement };
19
+ export * from '@vaadin/grid/src/vaadin-grid-sort-column.js';
@@ -3,116 +3,11 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { GridColumnElement } from './vaadin-grid-column.js';
7
- import './vaadin-grid-sorter.js';
6
+ import { GridSortColumn } from '@vaadin/grid/src/vaadin-grid-sort-column.js';
8
7
 
9
8
  /**
10
- * `<vaadin-grid-sort-column>` is a helper element for the `<vaadin-grid>`
11
- * that provides default header renderer and functionality for sorting.
12
- *
13
- * #### Example:
14
- * ```html
15
- * <vaadin-grid items="[[items]]">
16
- * <vaadin-grid-sort-column path="name.first" direction="asc"></vaadin-grid-sort-column>
17
- *
18
- * <vaadin-grid-column>
19
- * ...
20
- * ```
21
- *
22
- * @fires {CustomEvent} direction-changed - Fired when the `direction` property changes.
9
+ * @deprecated Import `GridSortColumn` from `@vaadin/grid/vaadin-grid-sort-column` instead.
23
10
  */
24
- class GridSortColumnElement extends GridColumnElement {
25
- static get is() {
26
- return 'vaadin-grid-sort-column';
27
- }
11
+ export const GridSortColumnElement = GridSortColumn;
28
12
 
29
- static get properties() {
30
- return {
31
- /**
32
- * JS Path of the property in the item used for sorting the data.
33
- */
34
- path: String,
35
-
36
- /**
37
- * How to sort the data.
38
- * Possible values are `asc` to use an ascending algorithm, `desc` to sort the data in
39
- * descending direction, or `null` for not sorting the data.
40
- * @type {GridSorterDirection | undefined}
41
- */
42
- direction: {
43
- type: String,
44
- notify: true
45
- }
46
- };
47
- }
48
-
49
- static get observers() {
50
- return ['_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header, direction)'];
51
- }
52
-
53
- constructor() {
54
- super();
55
-
56
- this.__boundOnDirectionChanged = this.__onDirectionChanged.bind(this);
57
- }
58
-
59
- /**
60
- * Renders the grid sorter to the header cell.
61
- *
62
- * @override
63
- */
64
- _defaultHeaderRenderer(root, _column) {
65
- let sorter = root.firstElementChild;
66
- if (!sorter) {
67
- sorter = document.createElement('vaadin-grid-sorter');
68
- sorter.addEventListener('direction-changed', this.__boundOnDirectionChanged);
69
- root.appendChild(sorter);
70
- }
71
-
72
- sorter.path = this.path;
73
- sorter.__rendererDirection = this.direction;
74
- sorter.direction = this.direction;
75
- sorter.textContent = this.__getHeader(this.header, this.path);
76
- }
77
-
78
- /**
79
- * The sort column doesn't allow to use a custom header renderer
80
- * to override the header cell content.
81
- * It always renders the grid sorter to the header cell.
82
- *
83
- * @override
84
- */
85
- _computeHeaderRenderer() {
86
- return this._defaultHeaderRenderer;
87
- }
88
-
89
- /**
90
- * Updates the sorting direction once the grid sorter's direction is changed.
91
- * The listener handles only user-fired events.
92
- *
93
- * @private
94
- */
95
- __onDirectionChanged(e) {
96
- // Skip if the direction is changed by the renderer.
97
- if (e.detail.value === e.target.__rendererDirection) {
98
- return;
99
- }
100
-
101
- this.direction = e.detail.value;
102
- }
103
-
104
- /** @private */
105
- __getHeader(header, path) {
106
- if (header) {
107
- return header;
108
- }
109
-
110
- if (path) {
111
- return this._generateHeader(path);
112
- }
113
- }
114
- }
115
-
116
- customElements.define(GridSortColumnElement.is, GridSortColumnElement);
117
-
118
- export { GridSortColumnElement };
13
+ export * from '@vaadin/grid/src/vaadin-grid-sort-column.js';
@@ -1,89 +1,18 @@
1
- import { GridSorterDirection } from './interfaces';
2
-
3
1
  /**
4
- * Fired when the `direction` property changes.
2
+ * @license
3
+ * Copyright (c) 2021 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- export type GridSorterDirectionChangedEvent = CustomEvent<{ value: GridSorterDirection }>;
7
-
8
- export interface GridSorterElementEventMap {
9
- 'sorter-changed': Event;
10
-
11
- 'direction-changed': GridSorterDirectionChangedEvent;
12
- }
13
-
14
- export interface GridSorterEventMap extends HTMLElementEventMap, GridSorterElementEventMap {}
6
+ import { GridSorter } from '@vaadin/grid/src/vaadin-grid-sorter.js';
15
7
 
16
8
  /**
17
- * `<vaadin-grid-sorter>` is a helper element for the `<vaadin-grid>` that provides out-of-the-box UI controls,
18
- * visual feedback, and handlers for sorting the grid data.
19
- *
20
- * #### Example:
21
- * ```html
22
- * <vaadin-grid-column id="column"></vaadin-grid-column>
23
- * ```
24
- * ```js
25
- * const column = document.querySelector('#column');
26
- * column.renderer = (root, column, model) => {
27
- * let sorter = root.firstElementChild;
28
- * if (!sorter) {
29
- * sorter = document.createElement('vaadin-grid-sorter');
30
- * root.appendChild(sorter);
31
- * }
32
- * sorter.path = 'name.first';
33
- * };
34
- * ```
35
- *
36
- * ### Styling
37
- *
38
- * The following shadow DOM parts are available for styling:
39
- *
40
- * Part name | Description
41
- * ----------------|----------------
42
- * `content` | The slotted content wrapper
43
- * `indicators` | The internal sorter indicators.
44
- * `order` | The internal sorter order
45
- *
46
- * The following state attributes are available for styling:
47
- *
48
- * Attribute | Description | Part name
49
- * -------------|-------------|------------
50
- * `direction` | Sort direction of a sorter | :host
51
- *
52
- * @fires {CustomEvent} direction-changed - Fired when the `direction` property changes.
53
- * @fires {CustomEvent} sorter-changed - Fired when the `path` or `direction` property changes.
9
+ * @deprecated Import `GridSorter` from `@vaadin/grid/vaadin-grid-sorter` instead.
54
10
  */
55
- declare class GridSorterElement extends HTMLElement {
56
- /**
57
- * JS Path of the property in the item used for sorting the data.
58
- */
59
- path: string | null | undefined;
60
-
61
- /**
62
- * How to sort the data.
63
- * Possible values are `asc` to use an ascending algorithm, `desc` to sort the data in
64
- * descending direction, or `null` for not sorting the data.
65
- */
66
- direction: GridSorterDirection | null | undefined;
11
+ export type GridSorterElement = GridSorter;
67
12
 
68
- _order: number | null;
69
-
70
- addEventListener<K extends keyof GridSorterEventMap>(
71
- type: K,
72
- listener: (this: GridSorterElement, ev: GridSorterEventMap[K]) => void,
73
- options?: boolean | AddEventListenerOptions
74
- ): void;
75
-
76
- removeEventListener<K extends keyof GridSorterEventMap>(
77
- type: K,
78
- listener: (this: GridSorterElement, ev: GridSorterEventMap[K]) => void,
79
- options?: boolean | EventListenerOptions
80
- ): void;
81
- }
82
-
83
- declare global {
84
- interface HTMLElementTagNameMap {
85
- 'vaadin-grid-sorter': GridSorterElement;
86
- }
87
- }
13
+ /**
14
+ * @deprecated Import `GridSorter` from `@vaadin/grid/vaadin-grid-sorter` instead.
15
+ */
16
+ export const GridSorterElement: typeof GridSorter;
88
17
 
89
- export { GridSorterElement };
18
+ export * from '@vaadin/grid/src/vaadin-grid-sorter.js';