@vaadin/crud 25.2.0-alpha1 → 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.
@@ -531,7 +531,7 @@
531
531
  "type": {
532
532
  "text": "boolean"
533
533
  },
534
- "description": "When disabled, the button is rendered as \"dimmed\" and prevents all\nuser interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n```js\n// Set before any button is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true\n```",
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\" and prevents all\nuser interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n```js\n// Set before any button is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true\n```",
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",
@@ -1259,7 +1259,7 @@
1259
1259
  "declarations": [
1260
1260
  {
1261
1261
  "kind": "class",
1262
- "description": "`<vaadin-crud>` is a Web Component for [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations.\n\n### Quick Start\n\nAssign an array to the [`items`](#/elements/vaadin-crud#property-items) property.\n\nA grid and an editor will be automatically generated and configured based on the data structure provided.\n\n```html\n<vaadin-crud></vaadin-crud>\n```\n\n```js\nconst crud = document.querySelector('vaadin-crud');\n\ncrud.items = [\n { name: 'John', surname: 'Lennon', role: 'singer' },\n { name: 'Ringo', surname: 'Starr', role: 'drums' },\n // ... more items\n];\n```\n\n### Data Provider Function\n\nOtherwise, you can provide a [`dataProvider`](#/elements/vaadin-crud#property-dataProvider) function.\n\n```js\nconst crud = document.querySelector('vaadin-crud');\n\nconst users = [\n { name: 'John', surname: 'Lennon', role: 'singer' },\n { name: 'Ringo', surname: 'Starr', role: 'drums' },\n // ... more items\n];\n\ncrud.dataProvider = (params, callback) => {\n const chunk = users.slice(params.page * params.pageSize, params.page * params.pageSize + params.pageSize);\n callback(chunk, people.length);\n};\n```\n\nNOTE: The auto-generated editor only supports string types. If you need to handle special cases\ncustomizing the editor is discussed below.\n\n### Customization\n\nAlternatively you can fully configure the component by using `slot` names.\n\nSlot name | Description\n---------------|----------------\n`grid` | To replace the auto-generated grid with a custom one.\n`form` | To replace the auto-generated form.\n`save-button` | To replace the \"Save\" button.\n`cancel-button`| To replace the \"Cancel\" button.\n`delete-button`| To replace the \"Delete\" button.\n`toolbar` | To provide the toolbar content (by default, it's empty).\n`new-button` | To replace the \"New item\" button.\n\n#### Example:\n\n```html\n<vaadin-crud id=\"crud\">\n <vaadin-grid slot=\"grid\">\n <vaadin-crud-edit-column></vaadin-crud-edit-column>\n <vaadin-grid-column id=\"column1\"></vaadin-grid-column>\n <vaadin-grid-column id=\"column2\"></vaadin-grid-column>\n </vaadin-grid>\n\n <vaadin-form-layout slot=\"form\">\n <vaadin-text-field label=\"First\" path=\"name\"></vaadin-text-field>\n <vaadin-text-field label=\"Surname\" path=\"surname\"></vaadin-text-field>\n </vaadin-form-layout>\n\n <div slot=\"toolbar\">Total singers: 2</div>\n <button slot=\"new-button\">New singer</button>\n\n <button slot=\"save-button\">Save changes</button>\n <button slot=\"cancel-button\">Discard changes</button>\n <button slot=\"delete-button\">Delete singer</button>\n</vaadin-crud>\n```\n```js\nconst crud = document.querySelector('#crud');\n\nconst column1 = document.querySelector('#column1');\ncolumn1.headerRenderer = (root, column) => {\n root.textContent = 'Name';\n};\ncolumn1.renderer = (root, column, model) => {\n root.textContent = model.item.name;\n};\n\nconst column2 = document.querySelector('#column2');\ncolumn2.headerRenderer = (root, column) => {\n root.textContent = 'Surname';\n};\ncolumn2.renderer = (root, column, model) => {\n root.textContent = model.item.surname;\n};\n\ncrud.items = [\n { name: 'John', surname: 'Lennon', role: 'singer' },\n { name: 'Ringo', surname: 'Starr', role: 'drums' },\n // ... more items\n];\n```\n\n### Helpers\n\nThe following elements are used to auto-configure the grid and the editor\n- [`<vaadin-crud-edit-column>`](#/elements/vaadin-crud-edit-column)\n- `<vaadin-crud-grid>` - can be replaced with custom [`<vaadin-grid>`](#/elements/vaadin-grid)\n- `<vaadin-crud-form>` - can be replaced with custom [`<vaadin-form-layout>`](#/elements/vaadin-form-layout)\n\n### Styling\n\nThe following shadow DOM parts are available for styling when the editor is rendered next to, or below, the grid:\n\nPart name | Description\n----------------|----------------\n`toolbar` | Toolbar container at the bottom of the grid. By default, it contains the `new` button\n`editor` | The editor container\n`scroller` | The wrapper for the header and the form\n`header` | The header of the editor\n`footer` | The footer of the editor\n\nThe following shadow DOM parts are available for styling when the editor renders as a dialog:\n\nPart name | Description\n----------------|----------------\n`toolbar` | Toolbar container at the bottom of the grid. By default, it contains the `new` button\n`overlay` | The dialog overlay\n`backdrop` | The dialog backdrop\n`header` | The header of the dialog\n`footer` | The footer of the dialog\n`content` | The wrapper for the form\n\nThe following custom properties are available:\n\nCustom Property | Description | Default\n----------------|----------------\n--vaadin-crud-editor-max-height | max height of editor when opened on the bottom | 40%\n--vaadin-crud-editor-max-width | max width of editor when opened on the side | 40%\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
1262
+ "description": "`<vaadin-crud>` is a Web Component for [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations.\n\n### Quick Start\n\nAssign an array to the [`items`](#/elements/vaadin-crud#property-items) property.\n\nA grid and an editor will be automatically generated and configured based on the data structure provided.\n\n```html\n<vaadin-crud></vaadin-crud>\n```\n\n```js\nconst crud = document.querySelector('vaadin-crud');\n\ncrud.items = [\n { name: 'John', surname: 'Lennon', role: 'singer' },\n { name: 'Ringo', surname: 'Starr', role: 'drums' },\n // ... more items\n];\n```\n\n### Data Provider Function\n\nOtherwise, you can provide a [`dataProvider`](#/elements/vaadin-crud#property-dataProvider) function.\n\n```js\nconst crud = document.querySelector('vaadin-crud');\n\nconst users = [\n { name: 'John', surname: 'Lennon', role: 'singer' },\n { name: 'Ringo', surname: 'Starr', role: 'drums' },\n // ... more items\n];\n\ncrud.dataProvider = (params, callback) => {\n const chunk = users.slice(params.page * params.pageSize, params.page * params.pageSize + params.pageSize);\n callback(chunk, people.length);\n};\n```\n\nNOTE: The auto-generated editor only supports string types. If you need to handle special cases\ncustomizing the editor is discussed below.\n\n### Customization\n\nAlternatively you can fully configure the component by using `slot` names.\n\nSlot name | Description\n---------------|----------------\n`grid` | To replace the auto-generated grid with a custom one.\n`form` | To replace the auto-generated form.\n`save-button` | To replace the \"Save\" button.\n`cancel-button`| To replace the \"Cancel\" button.\n`delete-button`| To replace the \"Delete\" button.\n`toolbar` | To provide the toolbar content (by default, it's empty).\n`new-button` | To replace the \"New item\" button.\n\n#### Example:\n\n```html\n<vaadin-crud id=\"crud\">\n <vaadin-grid slot=\"grid\">\n <vaadin-crud-edit-column></vaadin-crud-edit-column>\n <vaadin-grid-column id=\"column1\"></vaadin-grid-column>\n <vaadin-grid-column id=\"column2\"></vaadin-grid-column>\n </vaadin-grid>\n\n <vaadin-form-layout slot=\"form\">\n <vaadin-text-field label=\"First\" path=\"name\"></vaadin-text-field>\n <vaadin-text-field label=\"Surname\" path=\"surname\"></vaadin-text-field>\n </vaadin-form-layout>\n\n <div slot=\"toolbar\">Total singers: 2</div>\n <button slot=\"new-button\">New singer</button>\n\n <button slot=\"save-button\">Save changes</button>\n <button slot=\"cancel-button\">Discard changes</button>\n <button slot=\"delete-button\">Delete singer</button>\n</vaadin-crud>\n```\n```js\nconst crud = document.querySelector('#crud');\n\nconst column1 = document.querySelector('#column1');\ncolumn1.headerRenderer = (root, column) => {\n root.textContent = 'Name';\n};\ncolumn1.renderer = (root, column, model) => {\n root.textContent = model.item.name;\n};\n\nconst column2 = document.querySelector('#column2');\ncolumn2.headerRenderer = (root, column) => {\n root.textContent = 'Surname';\n};\ncolumn2.renderer = (root, column, model) => {\n root.textContent = model.item.surname;\n};\n\ncrud.items = [\n { name: 'John', surname: 'Lennon', role: 'singer' },\n { name: 'Ringo', surname: 'Starr', role: 'drums' },\n // ... more items\n];\n```\n\n### Helpers\n\nThe following elements are used to auto-configure the grid and the editor\n- [`<vaadin-crud-edit-column>`](#/elements/vaadin-crud-edit-column)\n- `<vaadin-crud-grid>` - can be replaced with custom [`<vaadin-grid>`](#/elements/vaadin-grid)\n- `<vaadin-crud-form>` - can be replaced with custom [`<vaadin-form-layout>`](#/elements/vaadin-form-layout)\n\n### Styling\n\nThe following shadow DOM parts are available for styling when the editor is rendered next to, or below, the grid:\n\nPart name | Description\n----------------|----------------\n`toolbar` | Toolbar container at the bottom of the grid. By default, it contains the `new` button\n`editor` | The editor container\n`scroller` | The wrapper for the header and the form\n`header` | The header of the editor\n`footer` | The footer of the editor\n\nThe following shadow DOM parts are available for styling when the editor renders as a dialog:\n\nPart name | Description\n----------------|----------------\n`toolbar` | Toolbar container at the bottom of the grid. By default, it contains the `new` button\n`overlay` | The dialog overlay\n`backdrop` | The dialog backdrop\n`header` | The header of the dialog\n`footer` | The footer of the dialog\n`content` | The wrapper for the form\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------|\n| `--vaadin-crud-background` |\n| `--vaadin-crud-border-color` |\n| `--vaadin-crud-border-radius` |\n| `--vaadin-crud-border-width` |\n| `--vaadin-crud-editor-max-height` |\n| `--vaadin-crud-editor-max-width` |\n| `--vaadin-crud-footer-background` |\n| `--vaadin-crud-footer-gap` |\n| `--vaadin-crud-footer-padding` |\n| `--vaadin-crud-form-padding` |\n| `--vaadin-crud-header-color` |\n| `--vaadin-crud-header-font-size` |\n| `--vaadin-crud-header-font-weight` |\n| `--vaadin-crud-header-line-height` |\n| `--vaadin-crud-header-padding` |\n| `--vaadin-crud-toolbar-background` |\n| `--vaadin-crud-toolbar-padding` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
1263
1263
  "name": "Crud",
1264
1264
  "members": [
1265
1265
  {
@@ -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-alpha1",
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": "25.2.0-alpha1",
39
- "@vaadin/button": "25.2.0-alpha1",
40
- "@vaadin/component-base": "25.2.0-alpha1",
41
- "@vaadin/confirm-dialog": "25.2.0-alpha1",
42
- "@vaadin/dialog": "25.2.0-alpha1",
43
- "@vaadin/form-layout": "25.2.0-alpha1",
44
- "@vaadin/grid": "25.2.0-alpha1",
45
- "@vaadin/overlay": "25.2.0-alpha1",
46
- "@vaadin/text-field": "25.2.0-alpha1",
47
- "@vaadin/vaadin-themable-mixin": "25.2.0-alpha1",
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": "25.2.0-alpha1",
52
- "@vaadin/chai-plugins": "25.2.0-alpha1",
53
- "@vaadin/test-runner-commands": "25.2.0-alpha1",
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": "25.2.0-alpha1",
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": "866f813f89655a351cbd25328eba1fcb317e267d"
64
+ "gitHead": "1303b6a3eeecb44a9d26f2b53cb56d9e906febdf"
65
65
  }
@@ -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 && items[0]) {
65
+ if ((!this.dataProvider || this.dataProvider === this._arrayDataProvider) && !this.include && items?.[0]) {
66
66
  this._configure(items[0]);
67
67
  }
68
68
  }
@@ -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 && chunk[0]) {
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
  };
@@ -153,24 +153,39 @@ export * from './vaadin-crud-mixin.js';
153
153
  * `footer` | The footer of the dialog
154
154
  * `content` | The wrapper for the form
155
155
  *
156
- * The following custom properties are available:
157
- *
158
- * Custom Property | Description | Default
159
- * ----------------|----------------
160
- * --vaadin-crud-editor-max-height | max height of editor when opened on the bottom | 40%
161
- * --vaadin-crud-editor-max-width | max width of editor when opened on the side | 40%
156
+ * The following custom CSS properties are available for styling:
157
+ *
158
+ * Custom CSS property |
159
+ * :--------------------------------------|
160
+ * | `--vaadin-crud-background` |
161
+ * | `--vaadin-crud-border-color` |
162
+ * | `--vaadin-crud-border-radius` |
163
+ * | `--vaadin-crud-border-width` |
164
+ * | `--vaadin-crud-editor-max-height` |
165
+ * | `--vaadin-crud-editor-max-width` |
166
+ * | `--vaadin-crud-footer-background` |
167
+ * | `--vaadin-crud-footer-gap` |
168
+ * | `--vaadin-crud-footer-padding` |
169
+ * | `--vaadin-crud-form-padding` |
170
+ * | `--vaadin-crud-header-color` |
171
+ * | `--vaadin-crud-header-font-size` |
172
+ * | `--vaadin-crud-header-font-weight` |
173
+ * | `--vaadin-crud-header-line-height` |
174
+ * | `--vaadin-crud-header-padding` |
175
+ * | `--vaadin-crud-toolbar-background` |
176
+ * | `--vaadin-crud-toolbar-padding` |
162
177
  *
163
178
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
164
179
  *
165
180
  * @fires {CustomEvent} editor-opened-changed - Fired when the `editorOpened` property changes.
166
- * @fires {CustomEvent} edited-item-changed - Fired when `editedItem` property changes.
181
+ * @fires {CustomEvent} edited-item-changed - Fired when the `editedItem` property changes.
167
182
  * @fires {CustomEvent} items-changed - Fired when the `items` property changes.
168
183
  * @fires {CustomEvent} size-changed - Fired when the `size` property changes.
169
184
  * @fires {CustomEvent} new - Fired when user wants to create a new item.
170
- * @fires {CustomEvent} edit - Fired when user wants to edit an existing item.
171
- * @fires {CustomEvent} delete - Fired when user wants to delete item.
172
- * @fires {CustomEvent} save - Fired when user wants to save a new or an existing item.
173
- * @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.
174
189
  */
175
190
  declare class Crud<Item = GridDefaultItem> extends HTMLElement {
176
191
  addEventListener<K extends keyof CrudEventMap<Item>>(
@@ -161,24 +161,39 @@ import { CrudMixin } from './vaadin-crud-mixin.js';
161
161
  * `footer` | The footer of the dialog
162
162
  * `content` | The wrapper for the form
163
163
  *
164
- * The following custom properties are available:
165
- *
166
- * Custom Property | Description | Default
167
- * ----------------|----------------
168
- * --vaadin-crud-editor-max-height | max height of editor when opened on the bottom | 40%
169
- * --vaadin-crud-editor-max-width | max width of editor when opened on the side | 40%
164
+ * The following custom CSS properties are available for styling:
165
+ *
166
+ * Custom CSS property |
167
+ * :--------------------------------------|
168
+ * | `--vaadin-crud-background` |
169
+ * | `--vaadin-crud-border-color` |
170
+ * | `--vaadin-crud-border-radius` |
171
+ * | `--vaadin-crud-border-width` |
172
+ * | `--vaadin-crud-editor-max-height` |
173
+ * | `--vaadin-crud-editor-max-width` |
174
+ * | `--vaadin-crud-footer-background` |
175
+ * | `--vaadin-crud-footer-gap` |
176
+ * | `--vaadin-crud-footer-padding` |
177
+ * | `--vaadin-crud-form-padding` |
178
+ * | `--vaadin-crud-header-color` |
179
+ * | `--vaadin-crud-header-font-size` |
180
+ * | `--vaadin-crud-header-font-weight` |
181
+ * | `--vaadin-crud-header-line-height` |
182
+ * | `--vaadin-crud-header-padding` |
183
+ * | `--vaadin-crud-toolbar-background` |
184
+ * | `--vaadin-crud-toolbar-padding` |
170
185
  *
171
186
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
172
187
  *
173
188
  * @fires {CustomEvent} editor-opened-changed - Fired when the `editorOpened` property changes.
174
- * @fires {CustomEvent} edited-item-changed - Fired when `editedItem` property changes.
189
+ * @fires {CustomEvent} edited-item-changed - Fired when the `editedItem` property changes.
175
190
  * @fires {CustomEvent} items-changed - Fired when the `items` property changes.
176
191
  * @fires {CustomEvent} size-changed - Fired when the `size` property changes.
177
192
  * @fires {CustomEvent} new - Fired when user wants to create a new item.
178
- * @fires {CustomEvent} edit - Fired when user wants to edit an existing item.
179
- * @fires {CustomEvent} delete - Fired when user wants to delete item.
180
- * @fires {CustomEvent} save - Fired when user wants to save a new or an existing item.
181
- * @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.
182
197
  *
183
198
  * @customElement vaadin-crud
184
199
  * @extends HTMLElement