@vaadin/crud 25.1.2 → 25.2.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/custom-elements.json +7 -7
- package/package.json +16 -16
- package/src/vaadin-crud-edit.js +1 -8
- package/src/vaadin-crud-grid-mixin.js +1 -1
- package/src/vaadin-crud-mixin.js +1 -42
- package/src/vaadin-crud.d.ts +5 -5
- package/src/vaadin-crud.js +5 -5
- package/web-types.json +116 -210
- package/web-types.lit.json +79 -72
package/custom-elements.json
CHANGED
|
@@ -531,7 +531,7 @@
|
|
|
531
531
|
"type": {
|
|
532
532
|
"text": "boolean"
|
|
533
533
|
},
|
|
534
|
-
"description": "When disabled, the button is rendered as \"dimmed\"
|
|
534
|
+
"description": "When disabled, the button is rendered as \"dimmed\".\n\nBy default, disabled buttons are not focusable and don't react to hover.\nAs a result, they are hidden from assistive technologies, and it's not\npossible to show a tooltip to explain why they are disabled. This can\nbe addressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being activated:\n\n```js\n// Set before any button is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true\n```",
|
|
535
535
|
"attribute": "disabled",
|
|
536
536
|
"inheritedFrom": {
|
|
537
537
|
"name": "Button",
|
|
@@ -551,7 +551,7 @@
|
|
|
551
551
|
"type": {
|
|
552
552
|
"text": "boolean"
|
|
553
553
|
},
|
|
554
|
-
"description": "When disabled, the button is rendered as \"dimmed\"
|
|
554
|
+
"description": "When disabled, the button is rendered as \"dimmed\".\n\nBy default, disabled buttons are not focusable and don't react to hover.\nAs a result, they are hidden from assistive technologies, and it's not\npossible to show a tooltip to explain why they are disabled. This can\nbe addressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being activated:\n\n```js\n// Set before any button is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true\n```",
|
|
555
555
|
"fieldName": "disabled",
|
|
556
556
|
"inheritedFrom": {
|
|
557
557
|
"name": "Button",
|
|
@@ -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.
|
|
3
|
+
"version": "25.2.0-alpha10",
|
|
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": "
|
|
39
|
-
"@vaadin/button": "
|
|
40
|
-
"@vaadin/component-base": "
|
|
41
|
-
"@vaadin/confirm-dialog": "
|
|
42
|
-
"@vaadin/dialog": "
|
|
43
|
-
"@vaadin/form-layout": "
|
|
44
|
-
"@vaadin/grid": "
|
|
45
|
-
"@vaadin/overlay": "
|
|
46
|
-
"@vaadin/text-field": "
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
38
|
+
"@vaadin/a11y-base": "25.2.0-alpha10",
|
|
39
|
+
"@vaadin/button": "25.2.0-alpha10",
|
|
40
|
+
"@vaadin/component-base": "25.2.0-alpha10",
|
|
41
|
+
"@vaadin/confirm-dialog": "25.2.0-alpha10",
|
|
42
|
+
"@vaadin/dialog": "25.2.0-alpha10",
|
|
43
|
+
"@vaadin/form-layout": "25.2.0-alpha10",
|
|
44
|
+
"@vaadin/grid": "25.2.0-alpha10",
|
|
45
|
+
"@vaadin/overlay": "25.2.0-alpha10",
|
|
46
|
+
"@vaadin/text-field": "25.2.0-alpha10",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "25.2.0-alpha10",
|
|
48
48
|
"lit": "^3.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@vaadin/aura": "
|
|
52
|
-
"@vaadin/chai-plugins": "
|
|
53
|
-
"@vaadin/test-runner-commands": "
|
|
51
|
+
"@vaadin/aura": "25.2.0-alpha10",
|
|
52
|
+
"@vaadin/chai-plugins": "25.2.0-alpha10",
|
|
53
|
+
"@vaadin/test-runner-commands": "25.2.0-alpha10",
|
|
54
54
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
55
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
55
|
+
"@vaadin/vaadin-lumo-styles": "25.2.0-alpha10",
|
|
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": "1303b6a3eeecb44a9d26f2b53cb56d9e906febdf"
|
|
65
65
|
}
|
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);
|
|
@@ -62,7 +62,7 @@ export const CrudGridMixin = (superClass) =>
|
|
|
62
62
|
|
|
63
63
|
/** @private */
|
|
64
64
|
__onItemsChange(items) {
|
|
65
|
-
if ((!this.dataProvider || this.dataProvider === this._arrayDataProvider) && !this.include && items
|
|
65
|
+
if ((!this.dataProvider || this.dataProvider === this._arrayDataProvider) && !this.include && items?.[0]) {
|
|
66
66
|
this._configure(items[0]);
|
|
67
67
|
}
|
|
68
68
|
}
|
package/src/vaadin-crud-mixin.js
CHANGED
|
@@ -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
|
@@ -186,14 +186,14 @@ import { CrudMixin } from './vaadin-crud-mixin.js';
|
|
|
186
186
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
187
187
|
*
|
|
188
188
|
* @fires {CustomEvent} editor-opened-changed - Fired when the `editorOpened` property changes.
|
|
189
|
-
* @fires {CustomEvent} edited-item-changed - Fired when `editedItem` property changes.
|
|
189
|
+
* @fires {CustomEvent} edited-item-changed - Fired when the `editedItem` property changes.
|
|
190
190
|
* @fires {CustomEvent} items-changed - Fired when the `items` property changes.
|
|
191
191
|
* @fires {CustomEvent} size-changed - Fired when the `size` property changes.
|
|
192
192
|
* @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.
|
|
193
|
+
* @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.
|
|
194
|
+
* @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.
|
|
195
|
+
* @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.
|
|
196
|
+
* @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
197
|
*
|
|
198
198
|
* @customElement vaadin-crud
|
|
199
199
|
* @extends HTMLElement
|