@vaadin/crud 25.2.0-alpha9 → 25.2.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.
- package/custom-elements.json +5 -5
- package/package.json +16 -16
- package/src/vaadin-crud-dialog.js +0 -4
- package/src/vaadin-crud-edit.js +1 -8
- package/src/vaadin-crud-form.js +0 -2
- package/src/vaadin-crud-grid-mixin.js +1 -5
- package/src/vaadin-crud-grid.js +0 -2
- package/src/vaadin-crud-include-mixin.js +0 -4
- package/src/vaadin-crud-mixin.js +6 -47
- package/src/vaadin-crud.d.ts +5 -5
- package/src/vaadin-crud.js +5 -9
- package/web-types.json +116 -210
- package/web-types.lit.json +79 -72
package/custom-elements.json
CHANGED
|
@@ -1465,28 +1465,28 @@
|
|
|
1465
1465
|
"type": {
|
|
1466
1466
|
"text": "CustomEvent"
|
|
1467
1467
|
},
|
|
1468
|
-
"description": "Fired when user discards edition.",
|
|
1468
|
+
"description": "Fired when user discards edition. If the default is prevented, no action is performed; the listener is responsible for closing the dialog and resetting the item and grid.",
|
|
1469
1469
|
"name": "cancel"
|
|
1470
1470
|
},
|
|
1471
1471
|
{
|
|
1472
1472
|
"type": {
|
|
1473
1473
|
"text": "CustomEvent"
|
|
1474
1474
|
},
|
|
1475
|
-
"description": "Fired when user wants to delete item.",
|
|
1475
|
+
"description": "Fired when user wants to delete item. If the default is prevented, no action is performed: the items array is not modified and the dialog is not closed.",
|
|
1476
1476
|
"name": "delete"
|
|
1477
1477
|
},
|
|
1478
1478
|
{
|
|
1479
1479
|
"type": {
|
|
1480
1480
|
"text": "CustomEvent"
|
|
1481
1481
|
},
|
|
1482
|
-
"description": "Fired when user wants to edit an existing item.",
|
|
1482
|
+
"description": "Fired when user wants to edit an existing item. If the default is prevented, a new item is not assigned to the form, but the dialog is still opened.",
|
|
1483
1483
|
"name": "edit"
|
|
1484
1484
|
},
|
|
1485
1485
|
{
|
|
1486
1486
|
"type": {
|
|
1487
1487
|
"text": "CustomEvent"
|
|
1488
1488
|
},
|
|
1489
|
-
"description": "Fired when `editedItem` property changes.",
|
|
1489
|
+
"description": "Fired when the `editedItem` property changes.",
|
|
1490
1490
|
"name": "edited-item-changed"
|
|
1491
1491
|
},
|
|
1492
1492
|
{
|
|
@@ -1514,7 +1514,7 @@
|
|
|
1514
1514
|
"type": {
|
|
1515
1515
|
"text": "CustomEvent"
|
|
1516
1516
|
},
|
|
1517
|
-
"description": "Fired when user wants to save a new or an existing item.",
|
|
1517
|
+
"description": "Fired when user wants to save a new or an existing item. If the default is prevented, no action is performed: the items array is not modified and the dialog is not closed.",
|
|
1518
1518
|
"name": "save"
|
|
1519
1519
|
},
|
|
1520
1520
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/crud",
|
|
3
|
-
"version": "25.2.0-
|
|
3
|
+
"version": "25.2.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,24 +35,24 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.2.0-
|
|
39
|
-
"@vaadin/button": "25.2.0-
|
|
40
|
-
"@vaadin/component-base": "25.2.0-
|
|
41
|
-
"@vaadin/confirm-dialog": "25.2.0-
|
|
42
|
-
"@vaadin/dialog": "25.2.0-
|
|
43
|
-
"@vaadin/form-layout": "25.2.0-
|
|
44
|
-
"@vaadin/grid": "25.2.0-
|
|
45
|
-
"@vaadin/overlay": "25.2.0-
|
|
46
|
-
"@vaadin/text-field": "25.2.0-
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "25.2.0-
|
|
38
|
+
"@vaadin/a11y-base": "25.2.0-beta1",
|
|
39
|
+
"@vaadin/button": "25.2.0-beta1",
|
|
40
|
+
"@vaadin/component-base": "25.2.0-beta1",
|
|
41
|
+
"@vaadin/confirm-dialog": "25.2.0-beta1",
|
|
42
|
+
"@vaadin/dialog": "25.2.0-beta1",
|
|
43
|
+
"@vaadin/form-layout": "25.2.0-beta1",
|
|
44
|
+
"@vaadin/grid": "25.2.0-beta1",
|
|
45
|
+
"@vaadin/overlay": "25.2.0-beta1",
|
|
46
|
+
"@vaadin/text-field": "25.2.0-beta1",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "25.2.0-beta1",
|
|
48
48
|
"lit": "^3.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@vaadin/aura": "25.2.0-
|
|
52
|
-
"@vaadin/chai-plugins": "25.2.0-
|
|
53
|
-
"@vaadin/test-runner-commands": "25.2.0-
|
|
51
|
+
"@vaadin/aura": "25.2.0-beta1",
|
|
52
|
+
"@vaadin/chai-plugins": "25.2.0-beta1",
|
|
53
|
+
"@vaadin/test-runner-commands": "25.2.0-beta1",
|
|
54
54
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
55
|
-
"@vaadin/vaadin-lumo-styles": "25.2.0-
|
|
55
|
+
"@vaadin/vaadin-lumo-styles": "25.2.0-beta1",
|
|
56
56
|
"sinon": "^21.0.2"
|
|
57
57
|
},
|
|
58
58
|
"cvdlName": "vaadin-crud",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"web-types.json",
|
|
62
62
|
"web-types.lit.json"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "471a23f60d1eb725f98a33f62cb9664d9c0a4163"
|
|
65
65
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
7
|
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
8
|
* license.
|
|
10
9
|
*/
|
|
@@ -25,9 +24,6 @@ import { crudDialogOverlayStyles } from './styles/vaadin-crud-dialog-overlay-bas
|
|
|
25
24
|
*
|
|
26
25
|
* @customElement vaadin-crud-dialog
|
|
27
26
|
* @extends HTMLElement
|
|
28
|
-
* @mixes DirMixin
|
|
29
|
-
* @mixes OverlayMixin
|
|
30
|
-
* @mixes ThemableMixin
|
|
31
27
|
* @private
|
|
32
28
|
*/
|
|
33
29
|
class CrudDialogOverlay extends OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
package/src/vaadin-crud-edit.js
CHANGED
|
@@ -51,18 +51,11 @@ class CrudEdit extends Button {
|
|
|
51
51
|
/** @private */
|
|
52
52
|
__onClick(e) {
|
|
53
53
|
const tr = e.target.parentElement.assignedSlot.parentElement.parentElement;
|
|
54
|
+
/** @internal to not document it in CEM */
|
|
54
55
|
tr.dispatchEvent(
|
|
55
56
|
new CustomEvent('edit', { detail: { item: tr._item, index: tr.index }, bubbles: true, composed: true }),
|
|
56
57
|
);
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Fired when user on the icon.
|
|
61
|
-
*
|
|
62
|
-
* @event edit
|
|
63
|
-
* @param {Object} detail.item the item to edit
|
|
64
|
-
* @param {Object} detail.index the index of the item in the data set
|
|
65
|
-
*/
|
|
66
59
|
}
|
|
67
60
|
|
|
68
61
|
defineCustomElement(CrudEdit);
|
package/src/vaadin-crud-form.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
7
|
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
8
|
* license.
|
|
10
9
|
*/
|
|
@@ -19,7 +18,6 @@ import { IncludedMixin } from './vaadin-crud-include-mixin.js';
|
|
|
19
18
|
*
|
|
20
19
|
* @customElement vaadin-crud-form
|
|
21
20
|
* @extends FormLayout
|
|
22
|
-
* @mixes IncludedMixin
|
|
23
21
|
* @private
|
|
24
22
|
*/
|
|
25
23
|
class CrudForm extends IncludedMixin(FormLayout) {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
7
|
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
8
|
* license.
|
|
10
9
|
*/
|
|
@@ -13,9 +12,6 @@ import { IncludedMixin } from './vaadin-crud-include-mixin.js';
|
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* A mixin providing common crud-grid functionality.
|
|
16
|
-
*
|
|
17
|
-
* @polymerMixin
|
|
18
|
-
* @mixes IncludedMixin
|
|
19
15
|
*/
|
|
20
16
|
export const CrudGridMixin = (superClass) =>
|
|
21
17
|
class extends IncludedMixin(superClass) {
|
|
@@ -62,7 +58,7 @@ export const CrudGridMixin = (superClass) =>
|
|
|
62
58
|
|
|
63
59
|
/** @private */
|
|
64
60
|
__onItemsChange(items) {
|
|
65
|
-
if ((!this.dataProvider || this.dataProvider === this._arrayDataProvider) && !this.include && items
|
|
61
|
+
if ((!this.dataProvider || this.dataProvider === this._arrayDataProvider) && !this.include && items?.[0]) {
|
|
66
62
|
this._configure(items[0]);
|
|
67
63
|
}
|
|
68
64
|
}
|
package/src/vaadin-crud-grid.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
7
|
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
8
|
* license.
|
|
10
9
|
*/
|
|
@@ -22,7 +21,6 @@ import { CrudGridMixin } from './vaadin-crud-grid-mixin.js';
|
|
|
22
21
|
* An element used internally by `<vaadin-crud>`. Not intended to be used separately.
|
|
23
22
|
*
|
|
24
23
|
* @extends Grid
|
|
25
|
-
* @mixes CrudGridMixin
|
|
26
24
|
* @private
|
|
27
25
|
*/
|
|
28
26
|
class CrudGrid extends CrudGridMixin(Grid) {
|
|
@@ -4,15 +4,11 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
7
|
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
8
|
* license.
|
|
10
9
|
*/
|
|
11
10
|
import { setProperty } from './vaadin-crud-helpers.js';
|
|
12
11
|
|
|
13
|
-
/**
|
|
14
|
-
* @polymerMixin
|
|
15
|
-
*/
|
|
16
12
|
export const IncludedMixin = (superClass) =>
|
|
17
13
|
class IncludedMixin extends superClass {
|
|
18
14
|
static get properties() {
|
package/src/vaadin-crud-mixin.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
7
|
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
8
|
* license.
|
|
10
9
|
*/
|
|
@@ -44,12 +43,9 @@ const DEFAULT_I18N = {
|
|
|
44
43
|
|
|
45
44
|
/**
|
|
46
45
|
* A mixin providing common crud functionality.
|
|
47
|
-
*
|
|
48
|
-
* @polymerMixin
|
|
49
|
-
* @mixes I18nMixin
|
|
50
46
|
*/
|
|
51
47
|
export const CrudMixin = (superClass) =>
|
|
52
|
-
class extends I18nMixin(
|
|
48
|
+
class extends I18nMixin(superClass) {
|
|
53
49
|
static get properties() {
|
|
54
50
|
return {
|
|
55
51
|
/**
|
|
@@ -304,6 +300,10 @@ export const CrudMixin = (superClass) =>
|
|
|
304
300
|
];
|
|
305
301
|
}
|
|
306
302
|
|
|
303
|
+
static get defaultI18n() {
|
|
304
|
+
return DEFAULT_I18N;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
307
|
/**
|
|
308
308
|
* The object used to localize this component. To change the default
|
|
309
309
|
* localization, replace this with an object that provides all properties, or
|
|
@@ -793,7 +793,7 @@ export const CrudMixin = (superClass) =>
|
|
|
793
793
|
__createDataProviderProxy(dataProvider) {
|
|
794
794
|
return (params, callback) => {
|
|
795
795
|
const callbackProxy = (chunk, size) => {
|
|
796
|
-
if (chunk
|
|
796
|
+
if (chunk?.[0]) {
|
|
797
797
|
this.__model = chunk[0];
|
|
798
798
|
}
|
|
799
799
|
|
|
@@ -1003,45 +1003,4 @@ export const CrudMixin = (superClass) =>
|
|
|
1003
1003
|
element.removeAttribute('aria-hidden');
|
|
1004
1004
|
}
|
|
1005
1005
|
}
|
|
1006
|
-
|
|
1007
|
-
/**
|
|
1008
|
-
* Fired when user wants to edit an existing item. If the default is prevented, then
|
|
1009
|
-
* a new item is not assigned to the form, giving that responsibility to the app, though
|
|
1010
|
-
* dialog is always opened.
|
|
1011
|
-
*
|
|
1012
|
-
* @event edit
|
|
1013
|
-
* @param {Object} detail.item the item to edit
|
|
1014
|
-
*/
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* Fired when user wants to create a new item.
|
|
1018
|
-
*
|
|
1019
|
-
* @event new
|
|
1020
|
-
*/
|
|
1021
|
-
|
|
1022
|
-
/**
|
|
1023
|
-
* Fired when user wants to delete item. If the default is prevented, then
|
|
1024
|
-
* no action is performed, items array is not modified nor dialog closed
|
|
1025
|
-
*
|
|
1026
|
-
* @event delete
|
|
1027
|
-
* @param {Object} detail.item the item to delete
|
|
1028
|
-
*/
|
|
1029
|
-
|
|
1030
|
-
/**
|
|
1031
|
-
* Fired when user discards edition. If the default is prevented, then
|
|
1032
|
-
* no action is performed, user is responsible to close dialog and reset
|
|
1033
|
-
* item and grid.
|
|
1034
|
-
*
|
|
1035
|
-
* @event cancel
|
|
1036
|
-
* @param {Object} detail.item the item to delete
|
|
1037
|
-
*/
|
|
1038
|
-
|
|
1039
|
-
/**
|
|
1040
|
-
* Fired when user wants to save a new or an existing item. If the default is prevented, then
|
|
1041
|
-
* no action is performed, items array is not modified nor dialog closed
|
|
1042
|
-
*
|
|
1043
|
-
* @event save
|
|
1044
|
-
* @param {Object} detail.item the item to save
|
|
1045
|
-
* @param {Object} detail.new whether the item is a new one
|
|
1046
|
-
*/
|
|
1047
1006
|
};
|
package/src/vaadin-crud.d.ts
CHANGED
|
@@ -178,14 +178,14 @@ export * from './vaadin-crud-mixin.js';
|
|
|
178
178
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
179
179
|
*
|
|
180
180
|
* @fires {CustomEvent} editor-opened-changed - Fired when the `editorOpened` property changes.
|
|
181
|
-
* @fires {CustomEvent} edited-item-changed - Fired when `editedItem` property changes.
|
|
181
|
+
* @fires {CustomEvent} edited-item-changed - Fired when the `editedItem` property changes.
|
|
182
182
|
* @fires {CustomEvent} items-changed - Fired when the `items` property changes.
|
|
183
183
|
* @fires {CustomEvent} size-changed - Fired when the `size` property changes.
|
|
184
184
|
* @fires {CustomEvent} new - Fired when user wants to create a new item.
|
|
185
|
-
* @fires {CustomEvent} edit - Fired when user wants to edit an existing item.
|
|
186
|
-
* @fires {CustomEvent} delete - Fired when user wants to delete item.
|
|
187
|
-
* @fires {CustomEvent} save - Fired when user wants to save a new or an existing item.
|
|
188
|
-
* @fires {CustomEvent} cancel - Fired when user discards edition.
|
|
185
|
+
* @fires {CustomEvent} edit - Fired when user wants to edit an existing item. If the default is prevented, a new item is not assigned to the form, but the dialog is still opened.
|
|
186
|
+
* @fires {CustomEvent} delete - Fired when user wants to delete item. If the default is prevented, no action is performed: the items array is not modified and the dialog is not closed.
|
|
187
|
+
* @fires {CustomEvent} save - Fired when user wants to save a new or an existing item. If the default is prevented, no action is performed: the items array is not modified and the dialog is not closed.
|
|
188
|
+
* @fires {CustomEvent} cancel - Fired when user discards edition. If the default is prevented, no action is performed; the listener is responsible for closing the dialog and resetting the item and grid.
|
|
189
189
|
*/
|
|
190
190
|
declare class Crud<Item = GridDefaultItem> extends HTMLElement {
|
|
191
191
|
addEventListener<K extends keyof CrudEventMap<Item>>(
|
package/src/vaadin-crud.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
7
|
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
8
|
* license.
|
|
10
9
|
*/
|
|
@@ -186,20 +185,17 @@ import { CrudMixin } from './vaadin-crud-mixin.js';
|
|
|
186
185
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
187
186
|
*
|
|
188
187
|
* @fires {CustomEvent} editor-opened-changed - Fired when the `editorOpened` property changes.
|
|
189
|
-
* @fires {CustomEvent} edited-item-changed - Fired when `editedItem` property changes.
|
|
188
|
+
* @fires {CustomEvent} edited-item-changed - Fired when the `editedItem` property changes.
|
|
190
189
|
* @fires {CustomEvent} items-changed - Fired when the `items` property changes.
|
|
191
190
|
* @fires {CustomEvent} size-changed - Fired when the `size` property changes.
|
|
192
191
|
* @fires {CustomEvent} new - Fired when user wants to create a new item.
|
|
193
|
-
* @fires {CustomEvent} edit - Fired when user wants to edit an existing item.
|
|
194
|
-
* @fires {CustomEvent} delete - Fired when user wants to delete item.
|
|
195
|
-
* @fires {CustomEvent} save - Fired when user wants to save a new or an existing item.
|
|
196
|
-
* @fires {CustomEvent} cancel - Fired when user discards edition.
|
|
192
|
+
* @fires {CustomEvent} edit - Fired when user wants to edit an existing item. If the default is prevented, a new item is not assigned to the form, but the dialog is still opened.
|
|
193
|
+
* @fires {CustomEvent} delete - Fired when user wants to delete item. If the default is prevented, no action is performed: the items array is not modified and the dialog is not closed.
|
|
194
|
+
* @fires {CustomEvent} save - Fired when user wants to save a new or an existing item. If the default is prevented, no action is performed: the items array is not modified and the dialog is not closed.
|
|
195
|
+
* @fires {CustomEvent} cancel - Fired when user discards edition. If the default is prevented, no action is performed; the listener is responsible for closing the dialog and resetting the item and grid.
|
|
197
196
|
*
|
|
198
197
|
* @customElement vaadin-crud
|
|
199
198
|
* @extends HTMLElement
|
|
200
|
-
* @mixes ElementMixin
|
|
201
|
-
* @mixes ThemableMixin
|
|
202
|
-
* @mixes CrudMixin
|
|
203
199
|
*/
|
|
204
200
|
class Crud extends CrudMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
205
201
|
static get is() {
|