@vaadin/grid 24.2.0-beta2 → 24.2.0-beta3

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 (34) hide show
  1. package/package.json +10 -10
  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 +5 -355
  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 +3 -876
  11. package/src/vaadin-grid-data-provider-mixin.d.ts +6 -30
  12. package/src/vaadin-grid-data-provider-mixin.js +100 -241
  13. package/src/vaadin-grid-drag-and-drop-mixin.js +1 -1
  14. package/src/vaadin-grid-filter-element-mixin.d.ts +34 -0
  15. package/src/vaadin-grid-filter-element-mixin.js +99 -0
  16. package/src/vaadin-grid-filter.d.ts +4 -21
  17. package/src/vaadin-grid-filter.js +5 -84
  18. package/src/vaadin-grid-keyboard-navigation-mixin.js +2 -2
  19. package/src/vaadin-grid-mixin.js +10 -10
  20. package/src/vaadin-grid-scroll-mixin.js +1 -1
  21. package/src/vaadin-grid-sorter-mixin.d.ts +44 -0
  22. package/src/vaadin-grid-sorter-mixin.js +198 -0
  23. package/src/vaadin-grid-sorter.d.ts +3 -32
  24. package/src/vaadin-grid-sorter.js +5 -181
  25. package/src/vaadin-grid-tree-column-mixin.d.ts +19 -0
  26. package/src/vaadin-grid-tree-column-mixin.js +92 -0
  27. package/src/vaadin-grid-tree-column.d.ts +9 -7
  28. package/src/vaadin-grid-tree-column.js +3 -82
  29. package/src/vaadin-grid-tree-toggle-mixin.d.ts +39 -0
  30. package/src/vaadin-grid-tree-toggle-mixin.js +151 -0
  31. package/src/vaadin-grid-tree-toggle.d.ts +4 -27
  32. package/src/vaadin-grid-tree-toggle.js +9 -141
  33. package/web-types.json +98 -98
  34. package/web-types.lit.json +42 -42
@@ -3,18 +3,11 @@
3
3
  * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
7
6
 
8
- /**
9
- * Fired when the `value` property changes.
10
- */
11
- export type GridFilterValueChangedEvent = CustomEvent<{ value: string }>;
12
-
13
- export interface GridFilterCustomEventMap {
14
- 'value-changed': GridFilterValueChangedEvent;
15
- }
7
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
8
+ import { GridFilterElementMixin, type GridFilterEventMap } from './vaadin-grid-filter-element-mixin.js';
16
9
 
17
- export interface GridFilterEventMap extends HTMLElementEventMap, GridFilterCustomEventMap {}
10
+ export * from './vaadin-grid-filter-element-mixin.js';
18
11
 
19
12
  /**
20
13
  * `<vaadin-grid-filter>` is a helper element for the `<vaadin-grid>` that provides out-of-the-box UI controls,
@@ -41,17 +34,7 @@ export interface GridFilterEventMap extends HTMLElementEventMap, GridFilterCusto
41
34
  *
42
35
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
43
36
  */
44
- declare class GridFilter extends ControllerMixin(HTMLElement) {
45
- /**
46
- * JS Path of the property in the item used for filtering the data.
47
- */
48
- path: string | null | undefined;
49
-
50
- /**
51
- * Current filter value.
52
- */
53
- value: string | null | undefined;
54
-
37
+ declare class GridFilter extends GridFilterElementMixin(ThemableMixin(HTMLElement)) {
55
38
  addEventListener<K extends keyof GridFilterEventMap>(
56
39
  type: K,
57
40
  listener: (this: GridFilter, ev: GridFilterEventMap[K]) => void,
@@ -5,11 +5,9 @@
5
5
  */
6
6
  import '@vaadin/text-field/src/vaadin-text-field.js';
7
7
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
- import { timeOut } from '@vaadin/component-base/src/async.js';
9
- import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
10
- import { Debouncer } from '@vaadin/component-base/src/debounce.js';
11
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
12
- import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
9
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin';
10
+ import { GridFilterElementMixin } from './vaadin-grid-filter-element-mixin.js';
13
11
 
14
12
  /**
15
13
  * `<vaadin-grid-filter>` is a helper element for the `<vaadin-grid>` that provides out-of-the-box UI controls,
@@ -38,93 +36,16 @@ import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
38
36
  *
39
37
  * @customElement
40
38
  * @extends HTMLElement
39
+ * @mixes GridFilterElementMixin
41
40
  */
42
- class GridFilter extends ControllerMixin(PolymerElement) {
41
+ class GridFilter extends GridFilterElementMixin(ThemableMixin(PolymerElement)) {
43
42
  static get template() {
44
- return html`
45
- <style>
46
- :host {
47
- display: inline-flex;
48
- max-width: 100%;
49
- }
50
-
51
- ::slotted(*) {
52
- width: 100%;
53
- box-sizing: border-box;
54
- }
55
- </style>
56
- <slot></slot>
57
- `;
43
+ return html`<slot></slot>`;
58
44
  }
59
45
 
60
46
  static get is() {
61
47
  return 'vaadin-grid-filter';
62
48
  }
63
-
64
- static get properties() {
65
- return {
66
- /**
67
- * JS Path of the property in the item used for filtering the data.
68
- */
69
- path: String,
70
-
71
- /**
72
- * Current filter value.
73
- */
74
- value: {
75
- type: String,
76
- notify: true,
77
- },
78
-
79
- /** @private */
80
- _textField: {
81
- type: Object,
82
- },
83
- };
84
- }
85
-
86
- static get observers() {
87
- return ['_filterChanged(path, value, _textField)'];
88
- }
89
-
90
- /** @protected */
91
- ready() {
92
- super.ready();
93
-
94
- this._filterController = new SlotController(this, '', 'vaadin-text-field', {
95
- initializer: (field) => {
96
- field.addEventListener('value-changed', (e) => {
97
- this.value = e.detail.value;
98
- });
99
-
100
- this._textField = field;
101
- },
102
- });
103
- this.addController(this._filterController);
104
- }
105
-
106
- /** @private */
107
- _filterChanged(path, value, textField) {
108
- if (path === undefined || value === undefined || !textField) {
109
- return;
110
- }
111
- if (this._previousValue === undefined && value === '') {
112
- return;
113
- }
114
-
115
- textField.value = value;
116
- this._previousValue = value;
117
-
118
- this._debouncerFilterChanged = Debouncer.debounce(this._debouncerFilterChanged, timeOut.after(200), () => {
119
- this.dispatchEvent(new CustomEvent('filter-changed', { bubbles: true }));
120
- });
121
- }
122
-
123
- focus() {
124
- if (this._textField) {
125
- this._textField.focus();
126
- }
127
- }
128
49
  }
129
50
 
130
51
  defineCustomElement(GridFilter);
@@ -443,7 +443,7 @@ export const KeyboardNavigationMixin = (superClass) =>
443
443
  __navigateRows(dy, activeRow, activeCell) {
444
444
  const currentRowIndex = this.__getIndexInGroup(activeRow, this._focusedItemIndex);
445
445
  const activeRowGroup = activeRow.parentNode;
446
- const maxRowIndex = (activeRowGroup === this.$.items ? this._effectiveSize : activeRowGroup.children.length) - 1;
446
+ const maxRowIndex = (activeRowGroup === this.$.items ? this._flatSize : activeRowGroup.children.length) - 1;
447
447
 
448
448
  // Index of the destination row
449
449
  let dstRowIndex = Math.max(0, Math.min(currentRowIndex + dy, maxRowIndex));
@@ -476,7 +476,7 @@ export const KeyboardNavigationMixin = (superClass) =>
476
476
  // Row details navigation logic
477
477
  if (activeRowGroup === this.$.items) {
478
478
  const item = activeRow._item;
479
- const dstItem = this._cache.getItemForIndex(dstRowIndex);
479
+ const { item: dstItem } = this._dataProviderController.getFlatIndexContext(dstRowIndex);
480
480
  // Should we navigate to row details?
481
481
  if (isRowDetails) {
482
482
  dstIsRowDetails = dy === 0;
@@ -58,8 +58,8 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
58
58
  * @mixes DragAndDropMixin
59
59
  */
60
60
  export const GridMixin = (superClass) =>
61
- class extends DataProviderMixin(
62
- ArrayDataProviderMixin(
61
+ class extends ArrayDataProviderMixin(
62
+ DataProviderMixin(
63
63
  DynamicColumnsMixin(
64
64
  ActiveItemMixin(
65
65
  ScrollMixin(
@@ -88,7 +88,7 @@ export const GridMixin = (superClass) =>
88
88
  static get observers() {
89
89
  return [
90
90
  '_columnTreeChanged(_columnTree, _columnTree.*)',
91
- '_effectiveSizeChanged(_effectiveSize, __virtualizer, _hasData, _columnTree)',
91
+ '_flatSizeChanged(_flatSize, __virtualizer, _hasData, _columnTree)',
92
92
  ];
93
93
  }
94
94
 
@@ -294,20 +294,20 @@ export const GridMixin = (superClass) =>
294
294
  }
295
295
 
296
296
  /** @private */
297
- _effectiveSizeChanged(effectiveSize, virtualizer, hasData, columnTree) {
297
+ _flatSizeChanged(flatSize, virtualizer, hasData, columnTree) {
298
298
  if (virtualizer && hasData && columnTree) {
299
299
  // Changing the virtualizer size may result in the row with focus getting hidden
300
300
  const cell = this.shadowRoot.activeElement;
301
301
  const cellCoordinates = this.__getBodyCellCoordinates(cell);
302
302
 
303
303
  const previousSize = virtualizer.size || 0;
304
- virtualizer.size = effectiveSize;
304
+ virtualizer.size = flatSize;
305
305
 
306
306
  // Request an update for the previous last row to have the "last" state removed
307
307
  virtualizer.update(previousSize - 1, previousSize - 1);
308
- if (effectiveSize < previousSize) {
308
+ if (flatSize < previousSize) {
309
309
  // Size was decreased, so the new last row requires an explicit update
310
- virtualizer.update(effectiveSize - 1, effectiveSize - 1);
310
+ virtualizer.update(flatSize - 1, flatSize - 1);
311
311
  }
312
312
 
313
313
  // If the focused cell's parent row got hidden by the size change, focus the corresponding new cell
@@ -463,7 +463,7 @@ export const GridMixin = (superClass) =>
463
463
  if (!this._columnTree) {
464
464
  return; // No columns
465
465
  }
466
- if (isElementHidden(this) || this._cache.isLoading()) {
466
+ if (isElementHidden(this) || this._dataProviderController.isLoading()) {
467
467
  this.__pendingRecalculateColumnWidths = true;
468
468
  return;
469
469
  }
@@ -476,7 +476,7 @@ export const GridMixin = (superClass) =>
476
476
  if (
477
477
  this.__pendingRecalculateColumnWidths &&
478
478
  !isElementHidden(this) &&
479
- !this._cache.isLoading() &&
479
+ !this._dataProviderController.isLoading() &&
480
480
  this.__hasRowsWithClientHeight()
481
481
  ) {
482
482
  this.__pendingRecalculateColumnWidths = false;
@@ -801,7 +801,7 @@ export const GridMixin = (superClass) =>
801
801
  _updateRowOrderParts(row, index = row.index) {
802
802
  updateBooleanRowStates(row, {
803
803
  first: index === 0,
804
- last: index === this._effectiveSize - 1,
804
+ last: index === this._flatSize - 1,
805
805
  odd: index % 2 !== 0,
806
806
  even: index % 2 === 0,
807
807
  });
@@ -160,7 +160,7 @@ export const ScrollMixin = (superClass) =>
160
160
  * @protected
161
161
  */
162
162
  _scrollToFlatIndex(index) {
163
- index = Math.min(this._effectiveSize - 1, Math.max(0, index));
163
+ index = Math.min(this._flatSize - 1, Math.max(0, index));
164
164
  this.__virtualizer.scrollToIndex(index);
165
165
  this.__scrollIntoViewport(index);
166
166
  }
@@ -0,0 +1,44 @@
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
+
8
+ export type GridSorterDirection = 'asc' | 'desc' | null;
9
+
10
+ /**
11
+ * Fired when the `path` or `direction` property changes.
12
+ */
13
+ export type GridSorterChangedEvent = CustomEvent<{ shiftClick: boolean; fromSorterClick: boolean }>;
14
+
15
+ /**
16
+ * Fired when the `direction` property changes.
17
+ */
18
+ export type GridSorterDirectionChangedEvent = CustomEvent<{ value: GridSorterDirection }>;
19
+
20
+ export interface GridSorterCustomEventMap {
21
+ 'sorter-changed': GridSorterChangedEvent;
22
+
23
+ 'direction-changed': GridSorterDirectionChangedEvent;
24
+ }
25
+
26
+ export interface GridSorterEventMap extends HTMLElementEventMap, GridSorterCustomEventMap {}
27
+
28
+ export declare function GridSorterMixin<T extends Constructor<HTMLElement>>(
29
+ base: T,
30
+ ): Constructor<GridSorterMixinClass> & T;
31
+
32
+ declare class GridSorterMixinClass {
33
+ /**
34
+ * JS Path of the property in the item used for sorting the data.
35
+ */
36
+ path: string | null | undefined;
37
+
38
+ /**
39
+ * How to sort the data.
40
+ * Possible values are `asc` to use an ascending algorithm, `desc` to sort the data in
41
+ * descending direction, or `null` for not sorting the data.
42
+ */
43
+ direction: GridSorterDirection | null | undefined;
44
+ }
@@ -0,0 +1,198 @@
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 { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
7
+
8
+ const template = document.createElement('template');
9
+
10
+ template.innerHTML = `
11
+ <style>
12
+ @font-face {
13
+ font-family: 'vaadin-grid-sorter-icons';
14
+ src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAQwAA0AAAAABuwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAEFAAAABkAAAAcfep+mUdERUYAAAP4AAAAHAAAAB4AJwAOT1MvMgAAAZgAAAA/AAAAYA8TBPpjbWFwAAAB7AAAAFUAAAFeF1fZ4mdhc3AAAAPwAAAACAAAAAgAAAAQZ2x5ZgAAAlgAAABcAAAAnMvguMloZWFkAAABMAAAAC8AAAA2C5Ap72hoZWEAAAFgAAAAHQAAACQGbQPHaG10eAAAAdgAAAAUAAAAHAoAAABsb2NhAAACRAAAABIAAAASAIwAYG1heHAAAAGAAAAAFgAAACAACwAKbmFtZQAAArQAAAECAAACZxWCgKhwb3N0AAADuAAAADUAAABZCrApUXicY2BkYGAA4rDECVrx/DZfGbhZGEDgyqNPOxH0/wNMq5kPALkcDEwgUQBWRA0dAHicY2BkYGA+8P8AAwMLAwgwrWZgZEAFbABY4QM8AAAAeJxjYGRgYOAAQiYGEICQSAAAAi8AFgAAeJxjYGY6yziBgZWBgWkm0xkGBoZ+CM34msGYkZMBFTAKoAkwODAwvmRiPvD/AIMDMxCD1CDJKjAwAgBktQsXAHicY2GAAMZQCM0EwqshbAALxAEKeJxjYGBgZoBgGQZGBhCIAPIYwXwWBhsgzcXAwcAEhIwMCi+Z/v/9/x+sSuElA4T9/4k4K1gHFwMMMILMY2QDYmaoABOQYGJABUA7WBiGNwAAJd4NIQAAAAAAAAAACAAIABAAGAAmAEAATgAAeJyNjLENgDAMBP9tIURJwQCMQccSZgk2i5fIYBDAidJjycXr7x5EPwE2wY8si7jmyBNXGo/bNBerxJNrpxhbO3/fEFpx8ZICpV+ghxJ74fAMe+h7Ox14AbrsHB14nK2QQWrDMBRER4mTkhQK3ZRQKOgCNk7oGQqhhEIX2WSlWEI1BAlkJ5CDdNsj5Ey9Rncdi38ES+jzNJo/HwTgATcoDEthhY3wBHc4CE+pfwsX5F/hGe7Vo/AcK/UhvMSz+mGXKhZU6pww8ISz3oWn1BvhgnwTnuEJf8Jz1OpFeIlX9YULDLdFi4ASHolkSR0iuYdjLak1vAequBhj21D61Nqyi6l3qWybGPjySbPHGScGJl6dP58MYcQRI0bts7mjebBqrFENH7t3qWtj0OuqHnXcW7b0HOTZFnKryRGW2hFX1m0O2vEM3opNMfTau+CS6Z3Vx6veNnEXY6jwDxhsc2gAAHicY2BiwA84GBgYmRiYGJkZmBlZGFkZ2djScyoLMgzZS/MyDQwMwLSrpYEBlIbxjQDrzgsuAAAAAAEAAf//AA94nGNgZGBg4AFiMSBmYmAEQnYgZgHzGAAD6wA2eJxjYGBgZACCKyoz1cD0o087YTQATOcIewAAAA==) format('woff');
15
+ font-weight: normal;
16
+ font-style: normal;
17
+ }
18
+ </style>
19
+ `;
20
+
21
+ document.head.appendChild(template.content);
22
+
23
+ registerStyles(
24
+ 'vaadin-grid-sorter',
25
+ css`
26
+ :host {
27
+ display: inline-flex;
28
+ cursor: pointer;
29
+ max-width: 100%;
30
+ }
31
+
32
+ [part='content'] {
33
+ flex: 1 1 auto;
34
+ }
35
+
36
+ [part='indicators'] {
37
+ position: relative;
38
+ align-self: center;
39
+ flex: none;
40
+ }
41
+
42
+ [part='order'] {
43
+ display: inline;
44
+ vertical-align: super;
45
+ }
46
+
47
+ [part='indicators']::before {
48
+ font-family: 'vaadin-grid-sorter-icons';
49
+ display: inline-block;
50
+ }
51
+
52
+ :host(:not([direction])) [part='indicators']::before {
53
+ content: '\\e901';
54
+ }
55
+
56
+ :host([direction='asc']) [part='indicators']::before {
57
+ content: '\\e900';
58
+ }
59
+
60
+ :host([direction='desc']) [part='indicators']::before {
61
+ content: '\\e902';
62
+ }
63
+ `,
64
+ { moduleId: 'vaadin-grid-sorter-styles' },
65
+ );
66
+
67
+ /**
68
+ * A mixin providing common sorter functionality.
69
+ *
70
+ * @polymerMixin
71
+ */
72
+ export const GridSorterMixin = (superClass) =>
73
+ class GridSorterMixinClass extends superClass {
74
+ static get properties() {
75
+ return {
76
+ /**
77
+ * JS Path of the property in the item used for sorting the data.
78
+ */
79
+ path: String,
80
+
81
+ /**
82
+ * How to sort the data.
83
+ * Possible values are `asc` to use an ascending algorithm, `desc` to sort the data in
84
+ * descending direction, or `null` for not sorting the data.
85
+ * @type {GridSorterDirection | undefined}
86
+ */
87
+ direction: {
88
+ type: String,
89
+ reflectToAttribute: true,
90
+ notify: true,
91
+ value: null,
92
+ },
93
+
94
+ /**
95
+ * @type {number | null}
96
+ * @protected
97
+ */
98
+ _order: {
99
+ type: Number,
100
+ value: null,
101
+ },
102
+
103
+ /** @private */
104
+ _isConnected: {
105
+ type: Boolean,
106
+ observer: '__isConnectedChanged',
107
+ },
108
+ };
109
+ }
110
+
111
+ static get observers() {
112
+ return ['_pathOrDirectionChanged(path, direction)'];
113
+ }
114
+
115
+ /** @protected */
116
+ ready() {
117
+ super.ready();
118
+ this.addEventListener('click', this._onClick.bind(this));
119
+ }
120
+
121
+ /** @protected */
122
+ connectedCallback() {
123
+ super.connectedCallback();
124
+ this._isConnected = true;
125
+ }
126
+
127
+ /** @protected */
128
+ disconnectedCallback() {
129
+ super.disconnectedCallback();
130
+ this._isConnected = false;
131
+
132
+ if (!this.parentNode && this._grid) {
133
+ this._grid.__removeSorters([this]);
134
+ }
135
+ }
136
+
137
+ /** @private */
138
+ _pathOrDirectionChanged() {
139
+ this.__dispatchSorterChangedEvenIfPossible();
140
+ }
141
+
142
+ /** @private */
143
+ __isConnectedChanged(newValue, oldValue) {
144
+ if (oldValue === false) {
145
+ return;
146
+ }
147
+
148
+ this.__dispatchSorterChangedEvenIfPossible();
149
+ }
150
+
151
+ /** @private */
152
+ __dispatchSorterChangedEvenIfPossible() {
153
+ if (this.path === undefined || this.direction === undefined || !this._isConnected) {
154
+ return;
155
+ }
156
+
157
+ this.dispatchEvent(
158
+ new CustomEvent('sorter-changed', {
159
+ detail: { shiftClick: Boolean(this._shiftClick), fromSorterClick: Boolean(this._fromSorterClick) },
160
+ bubbles: true,
161
+ composed: true,
162
+ }),
163
+ );
164
+ // Cleaning up as a programatically sorting can be done after some user interaction
165
+ this._fromSorterClick = false;
166
+ this._shiftClick = false;
167
+ }
168
+
169
+ /** @private */
170
+ _getDisplayOrder(order) {
171
+ return order === null ? '' : order + 1;
172
+ }
173
+
174
+ /** @private */
175
+ _onClick(e) {
176
+ if (e.defaultPrevented) {
177
+ // Something else has already handled the click event, do nothing.
178
+ return;
179
+ }
180
+
181
+ const activeElement = this.getRootNode().activeElement;
182
+ if (this !== activeElement && this.contains(activeElement)) {
183
+ // Some focusable content inside the sorter was clicked, do nothing.
184
+ return;
185
+ }
186
+
187
+ e.preventDefault();
188
+ this._shiftClick = e.shiftKey;
189
+ this._fromSorterClick = true;
190
+ if (this.direction === 'asc') {
191
+ this.direction = 'desc';
192
+ } else if (this.direction === 'desc') {
193
+ this.direction = null;
194
+ } else {
195
+ this.direction = 'asc';
196
+ }
197
+ }
198
+ };
@@ -5,26 +5,9 @@
5
5
  */
6
6
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
7
7
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
+ import { type GridSorterEventMap, GridSorterMixin } from './vaadin-grid-sorter-mixin.js';
8
9
 
9
- export type GridSorterDirection = 'asc' | 'desc' | null;
10
-
11
- /**
12
- * Fired when the `path` or `direction` property changes.
13
- */
14
- export type GridSorterChangedEvent = CustomEvent<{ shiftClick: boolean; fromSorterClick: boolean }>;
15
-
16
- /**
17
- * Fired when the `direction` property changes.
18
- */
19
- export type GridSorterDirectionChangedEvent = CustomEvent<{ value: GridSorterDirection }>;
20
-
21
- export interface GridSorterCustomEventMap {
22
- 'sorter-changed': GridSorterChangedEvent;
23
-
24
- 'direction-changed': GridSorterDirectionChangedEvent;
25
- }
26
-
27
- export interface GridSorterEventMap extends HTMLElementEventMap, GridSorterCustomEventMap {}
10
+ export * from './vaadin-grid-sorter-mixin.js';
28
11
 
29
12
  /**
30
13
  * `<vaadin-grid-sorter>` is a helper element for the `<vaadin-grid>` that provides out-of-the-box UI controls,
@@ -65,19 +48,7 @@ export interface GridSorterEventMap extends HTMLElementEventMap, GridSorterCusto
65
48
  * @fires {CustomEvent} direction-changed - Fired when the `direction` property changes.
66
49
  * @fires {CustomEvent} sorter-changed - Fired when the `path` or `direction` property changes.
67
50
  */
68
- declare class GridSorter extends ThemableMixin(DirMixin(HTMLElement)) {
69
- /**
70
- * JS Path of the property in the item used for sorting the data.
71
- */
72
- path: string | null | undefined;
73
-
74
- /**
75
- * How to sort the data.
76
- * Possible values are `asc` to use an ascending algorithm, `desc` to sort the data in
77
- * descending direction, or `null` for not sorting the data.
78
- */
79
- direction: GridSorterDirection | null | undefined;
80
-
51
+ declare class GridSorter extends GridSorterMixin(ThemableMixin(DirMixin(HTMLElement))) {
81
52
  addEventListener<K extends keyof GridSorterEventMap>(
82
53
  type: K,
83
54
  listener: (this: GridSorter, ev: GridSorterEventMap[K]) => void,