@vaadin/grid 22.0.0-rc1 → 22.0.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/package.json +9 -9
- package/src/vaadin-grid.d.ts +16 -25
- package/src/vaadin-grid.js +16 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/grid",
|
|
3
|
-
"version": "22.0.0
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -40,19 +40,19 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
42
42
|
"@polymer/polymer": "^3.0.0",
|
|
43
|
-
"@vaadin/checkbox": "22.0.0
|
|
44
|
-
"@vaadin/component-base": "22.0.0
|
|
45
|
-
"@vaadin/text-field": "22.0.0
|
|
46
|
-
"@vaadin/vaadin-lumo-styles": "22.0.0
|
|
47
|
-
"@vaadin/vaadin-material-styles": "22.0.0
|
|
48
|
-
"@vaadin/vaadin-themable-mixin": "22.0.0
|
|
43
|
+
"@vaadin/checkbox": "^22.0.0",
|
|
44
|
+
"@vaadin/component-base": "^22.0.0",
|
|
45
|
+
"@vaadin/text-field": "^22.0.0",
|
|
46
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.0",
|
|
47
|
+
"@vaadin/vaadin-material-styles": "^22.0.0",
|
|
48
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@esm-bundle/chai": "^4.3.4",
|
|
52
|
-
"@vaadin/polymer-legacy-adapter": "22.0.0
|
|
52
|
+
"@vaadin/polymer-legacy-adapter": "^22.0.0",
|
|
53
53
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
54
54
|
"lit": "^2.0.0",
|
|
55
55
|
"sinon": "^9.2.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "b668e9b1a975227fbe34beb70d1cd5b03dce2348"
|
|
58
58
|
}
|
package/src/vaadin-grid.d.ts
CHANGED
|
@@ -253,20 +253,16 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
|
|
|
253
253
|
* in the second argument of the data provider callback:__
|
|
254
254
|
*
|
|
255
255
|
* ```javascript
|
|
256
|
-
* grid.dataProvider =
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
* );
|
|
267
|
-
* };
|
|
268
|
-
* xhr.open('GET', url, true);
|
|
269
|
-
* xhr.send();
|
|
256
|
+
* grid.dataProvider = ({page, pageSize}, callback) => {
|
|
257
|
+
* // page: the requested page index
|
|
258
|
+
* // pageSize: number of items on one page
|
|
259
|
+
* const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;
|
|
260
|
+
*
|
|
261
|
+
* fetch(url)
|
|
262
|
+
* .then((res) => res.json())
|
|
263
|
+
* .then(({ employees, totalSize }) => {
|
|
264
|
+
* callback(employees, totalSize);
|
|
265
|
+
* });
|
|
270
266
|
* };
|
|
271
267
|
* ```
|
|
272
268
|
*
|
|
@@ -274,17 +270,12 @@ export interface GridEventMap<TItem> extends HTMLElementEventMap, GridCustomEven
|
|
|
274
270
|
*
|
|
275
271
|
* ```javascript
|
|
276
272
|
* grid.size = 200; // The total number of items
|
|
277
|
-
* grid.dataProvider =
|
|
278
|
-
* const url =
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
* const response = JSON.parse(xhr.responseText);
|
|
284
|
-
* callback(response.employees);
|
|
285
|
-
* };
|
|
286
|
-
* xhr.open('GET', url, true);
|
|
287
|
-
* xhr.send();
|
|
273
|
+
* grid.dataProvider = ({page, pageSize}, callback) => {
|
|
274
|
+
* const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;
|
|
275
|
+
*
|
|
276
|
+
* fetch(url)
|
|
277
|
+
* .then((res) => res.json())
|
|
278
|
+
* .then((resJson) => callback(resJson.employees));
|
|
288
279
|
* };
|
|
289
280
|
* ```
|
|
290
281
|
*
|
package/src/vaadin-grid.js
CHANGED
|
@@ -139,20 +139,16 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
|
|
|
139
139
|
* in the second argument of the data provider callback:__
|
|
140
140
|
*
|
|
141
141
|
* ```javascript
|
|
142
|
-
* grid.dataProvider =
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* );
|
|
153
|
-
* };
|
|
154
|
-
* xhr.open('GET', url, true);
|
|
155
|
-
* xhr.send();
|
|
142
|
+
* grid.dataProvider = ({page, pageSize}, callback) => {
|
|
143
|
+
* // page: the requested page index
|
|
144
|
+
* // pageSize: number of items on one page
|
|
145
|
+
* const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;
|
|
146
|
+
*
|
|
147
|
+
* fetch(url)
|
|
148
|
+
* .then((res) => res.json())
|
|
149
|
+
* .then(({ employees, totalSize }) => {
|
|
150
|
+
* callback(employees, totalSize);
|
|
151
|
+
* });
|
|
156
152
|
* };
|
|
157
153
|
* ```
|
|
158
154
|
*
|
|
@@ -160,17 +156,12 @@ import { StylingMixin } from './vaadin-grid-styling-mixin.js';
|
|
|
160
156
|
*
|
|
161
157
|
* ```javascript
|
|
162
158
|
* grid.size = 200; // The total number of items
|
|
163
|
-
* grid.dataProvider =
|
|
164
|
-
* const url =
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* const response = JSON.parse(xhr.responseText);
|
|
170
|
-
* callback(response.employees);
|
|
171
|
-
* };
|
|
172
|
-
* xhr.open('GET', url, true);
|
|
173
|
-
* xhr.send();
|
|
159
|
+
* grid.dataProvider = ({page, pageSize}, callback) => {
|
|
160
|
+
* const url = `https://api.example/data?page=${page}&per_page=${pageSize}`;
|
|
161
|
+
*
|
|
162
|
+
* fetch(url)
|
|
163
|
+
* .then((res) => res.json())
|
|
164
|
+
* .then((resJson) => callback(resJson.employees));
|
|
174
165
|
* };
|
|
175
166
|
* ```
|
|
176
167
|
*
|