@vaadin/grid 24.3.0-alpha1 → 24.3.0-alpha10
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/package.json +18 -13
- package/src/vaadin-grid-a11y-mixin.js +1 -1
- package/src/vaadin-grid-active-item-mixin.js +1 -0
- package/src/vaadin-grid-array-data-provider-mixin.js +14 -17
- package/src/vaadin-grid-column-group-mixin.d.ts +20 -0
- package/src/vaadin-grid-column-group-mixin.js +364 -0
- package/src/vaadin-grid-column-group.d.ts +4 -14
- package/src/vaadin-grid-column-group.js +5 -355
- package/src/vaadin-grid-column-mixin.d.ts +170 -0
- package/src/vaadin-grid-column-mixin.js +958 -0
- package/src/vaadin-grid-column.d.ts +11 -138
- package/src/vaadin-grid-column.js +5 -876
- package/src/vaadin-grid-data-provider-mixin.d.ts +6 -5
- package/src/vaadin-grid-data-provider-mixin.js +58 -11
- package/src/vaadin-grid-drag-and-drop-mixin.js +17 -5
- package/src/vaadin-grid-dynamic-columns-mixin.js +22 -17
- package/src/vaadin-grid-filter-column-mixin.d.ts +22 -0
- package/src/vaadin-grid-filter-column-mixin.js +106 -0
- package/src/vaadin-grid-filter-column.d.ts +9 -11
- package/src/vaadin-grid-filter-column.js +3 -90
- package/src/vaadin-grid-filter-element-mixin.d.ts +34 -0
- package/src/vaadin-grid-filter-element-mixin.js +108 -0
- package/src/vaadin-grid-filter-mixin.js +4 -4
- package/src/vaadin-grid-filter.d.ts +4 -21
- package/src/vaadin-grid-filter.js +5 -84
- package/src/vaadin-grid-helpers.js +94 -0
- package/src/vaadin-grid-keyboard-navigation-mixin.js +26 -6
- package/src/vaadin-grid-mixin.js +37 -46
- package/src/vaadin-grid-row-details-mixin.js +14 -8
- package/src/vaadin-grid-scroll-mixin.js +9 -3
- package/src/vaadin-grid-selection-column-base-mixin.js +12 -4
- package/src/vaadin-grid-selection-column-mixin.d.ts +24 -0
- package/src/vaadin-grid-selection-column-mixin.js +194 -0
- package/src/vaadin-grid-selection-column.d.ts +13 -17
- package/src/vaadin-grid-selection-column.js +4 -186
- package/src/vaadin-grid-selection-mixin.js +4 -3
- package/src/vaadin-grid-sort-column-mixin.d.ts +36 -0
- package/src/vaadin-grid-sort-column-mixin.js +101 -0
- package/src/vaadin-grid-sort-column.d.ts +8 -26
- package/src/vaadin-grid-sort-column.js +3 -87
- package/src/vaadin-grid-sorter-mixin.d.ts +44 -0
- package/src/vaadin-grid-sorter-mixin.js +200 -0
- package/src/vaadin-grid-sorter.d.ts +3 -32
- package/src/vaadin-grid-sorter.js +5 -181
- package/src/vaadin-grid-styles.js +341 -345
- package/src/vaadin-grid-styling-mixin.js +8 -2
- package/src/vaadin-grid-tree-column-mixin.d.ts +18 -0
- package/src/vaadin-grid-tree-column-mixin.js +99 -0
- package/src/vaadin-grid-tree-column.d.ts +9 -7
- package/src/vaadin-grid-tree-column.js +3 -82
- package/src/vaadin-grid-tree-toggle-mixin.d.ts +39 -0
- package/src/vaadin-grid-tree-toggle-mixin.js +153 -0
- package/src/vaadin-grid-tree-toggle.d.ts +4 -27
- package/src/vaadin-grid-tree-toggle.js +9 -141
- package/src/vaadin-grid.d.ts +3 -0
- package/src/vaadin-grid.js +7 -2
- package/theme/lumo/vaadin-grid-sorter-styles.js +1 -1
- package/theme/lumo/vaadin-grid-styles.js +15 -14
- package/theme/material/vaadin-grid-styles.js +15 -10
- package/web-types.json +331 -126
- package/web-types.lit.json +114 -58
|
@@ -7,21 +7,7 @@ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
|
-
|
|
11
|
-
const template = document.createElement('template');
|
|
12
|
-
|
|
13
|
-
template.innerHTML = `
|
|
14
|
-
<style>
|
|
15
|
-
@font-face {
|
|
16
|
-
font-family: 'vaadin-grid-sorter-icons';
|
|
17
|
-
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');
|
|
18
|
-
font-weight: normal;
|
|
19
|
-
font-style: normal;
|
|
20
|
-
}
|
|
21
|
-
</style>
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
document.head.appendChild(template.content);
|
|
10
|
+
import { GridSorterMixin } from './vaadin-grid-sorter-mixin.js';
|
|
25
11
|
|
|
26
12
|
/**
|
|
27
13
|
* `<vaadin-grid-sorter>` is a helper element for the `<vaadin-grid>` that provides out-of-the-box UI controls,
|
|
@@ -64,50 +50,13 @@ document.head.appendChild(template.content);
|
|
|
64
50
|
*
|
|
65
51
|
* @customElement
|
|
66
52
|
* @extends HTMLElement
|
|
53
|
+
* @mixes GridSorterMixin
|
|
54
|
+
* @mixes ThemableMixin
|
|
55
|
+
* @mixes DirMixin
|
|
67
56
|
*/
|
|
68
|
-
class GridSorter extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
57
|
+
class GridSorter extends GridSorterMixin(ThemableMixin(DirMixin(PolymerElement))) {
|
|
69
58
|
static get template() {
|
|
70
59
|
return html`
|
|
71
|
-
<style>
|
|
72
|
-
:host {
|
|
73
|
-
display: inline-flex;
|
|
74
|
-
cursor: pointer;
|
|
75
|
-
max-width: 100%;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
[part='content'] {
|
|
79
|
-
flex: 1 1 auto;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
[part='indicators'] {
|
|
83
|
-
position: relative;
|
|
84
|
-
align-self: center;
|
|
85
|
-
flex: none;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
[part='order'] {
|
|
89
|
-
display: inline;
|
|
90
|
-
vertical-align: super;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
[part='indicators']::before {
|
|
94
|
-
font-family: 'vaadin-grid-sorter-icons';
|
|
95
|
-
display: inline-block;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
:host(:not([direction])) [part='indicators']::before {
|
|
99
|
-
content: '\\e901';
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
:host([direction='asc']) [part='indicators']::before {
|
|
103
|
-
content: '\\e900';
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
:host([direction='desc']) [part='indicators']::before {
|
|
107
|
-
content: '\\e902';
|
|
108
|
-
}
|
|
109
|
-
</style>
|
|
110
|
-
|
|
111
60
|
<div part="content">
|
|
112
61
|
<slot></slot>
|
|
113
62
|
</div>
|
|
@@ -120,131 +69,6 @@ class GridSorter extends ThemableMixin(DirMixin(PolymerElement)) {
|
|
|
120
69
|
static get is() {
|
|
121
70
|
return 'vaadin-grid-sorter';
|
|
122
71
|
}
|
|
123
|
-
|
|
124
|
-
static get properties() {
|
|
125
|
-
return {
|
|
126
|
-
/**
|
|
127
|
-
* JS Path of the property in the item used for sorting the data.
|
|
128
|
-
*/
|
|
129
|
-
path: String,
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* How to sort the data.
|
|
133
|
-
* Possible values are `asc` to use an ascending algorithm, `desc` to sort the data in
|
|
134
|
-
* descending direction, or `null` for not sorting the data.
|
|
135
|
-
* @type {GridSorterDirection | undefined}
|
|
136
|
-
*/
|
|
137
|
-
direction: {
|
|
138
|
-
type: String,
|
|
139
|
-
reflectToAttribute: true,
|
|
140
|
-
notify: true,
|
|
141
|
-
value: null,
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* @type {number | null}
|
|
146
|
-
* @protected
|
|
147
|
-
*/
|
|
148
|
-
_order: {
|
|
149
|
-
type: Number,
|
|
150
|
-
value: null,
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
/** @private */
|
|
154
|
-
_isConnected: {
|
|
155
|
-
type: Boolean,
|
|
156
|
-
observer: '__isConnectedChanged',
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
static get observers() {
|
|
162
|
-
return ['_pathOrDirectionChanged(path, direction)'];
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/** @protected */
|
|
166
|
-
ready() {
|
|
167
|
-
super.ready();
|
|
168
|
-
this.addEventListener('click', this._onClick.bind(this));
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/** @protected */
|
|
172
|
-
connectedCallback() {
|
|
173
|
-
super.connectedCallback();
|
|
174
|
-
this._isConnected = true;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/** @protected */
|
|
178
|
-
disconnectedCallback() {
|
|
179
|
-
super.disconnectedCallback();
|
|
180
|
-
this._isConnected = false;
|
|
181
|
-
|
|
182
|
-
if (!this.parentNode && this._grid) {
|
|
183
|
-
this._grid.__removeSorters([this]);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/** @private */
|
|
188
|
-
_pathOrDirectionChanged() {
|
|
189
|
-
this.__dispatchSorterChangedEvenIfPossible();
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/** @private */
|
|
193
|
-
__isConnectedChanged(newValue, oldValue) {
|
|
194
|
-
if (oldValue === false) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
this.__dispatchSorterChangedEvenIfPossible();
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/** @private */
|
|
202
|
-
__dispatchSorterChangedEvenIfPossible() {
|
|
203
|
-
if (this.path === undefined || this.direction === undefined || !this._isConnected) {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
this.dispatchEvent(
|
|
208
|
-
new CustomEvent('sorter-changed', {
|
|
209
|
-
detail: { shiftClick: Boolean(this._shiftClick), fromSorterClick: Boolean(this._fromSorterClick) },
|
|
210
|
-
bubbles: true,
|
|
211
|
-
composed: true,
|
|
212
|
-
}),
|
|
213
|
-
);
|
|
214
|
-
// Cleaning up as a programatically sorting can be done after some user interaction
|
|
215
|
-
this._fromSorterClick = false;
|
|
216
|
-
this._shiftClick = false;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/** @private */
|
|
220
|
-
_getDisplayOrder(order) {
|
|
221
|
-
return order === null ? '' : order + 1;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/** @private */
|
|
225
|
-
_onClick(e) {
|
|
226
|
-
if (e.defaultPrevented) {
|
|
227
|
-
// Something else has already handled the click event, do nothing.
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
const activeElement = this.getRootNode().activeElement;
|
|
232
|
-
if (this !== activeElement && this.contains(activeElement)) {
|
|
233
|
-
// Some focusable content inside the sorter was clicked, do nothing.
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
e.preventDefault();
|
|
238
|
-
this._shiftClick = e.shiftKey;
|
|
239
|
-
this._fromSorterClick = true;
|
|
240
|
-
if (this.direction === 'asc') {
|
|
241
|
-
this.direction = 'desc';
|
|
242
|
-
} else if (this.direction === 'desc') {
|
|
243
|
-
this.direction = null;
|
|
244
|
-
} else {
|
|
245
|
-
this.direction = 'asc';
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
72
|
}
|
|
249
73
|
|
|
250
74
|
defineCustomElement(GridSorter);
|