@vaadin/crud 24.4.0-dev.b3e1d14600 → 24.4.0-rc2

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/README.md CHANGED
@@ -7,7 +7,6 @@ A web component for displaying, editing, creating, and deleting items from a dat
7
7
  [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/crud)
8
8
 
9
9
  [![npm version](https://badgen.net/npm/v/@vaadin/crud)](https://www.npmjs.com/package/@vaadin/crud)
10
- [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
11
10
 
12
11
  ```html
13
12
  <vaadin-crud items='[{"name": "Juan", "surname": "Garcia"}]'></vaadin-crud>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/crud",
3
- "version": "24.4.0-dev.b3e1d14600",
3
+ "version": "24.4.0-rc2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,18 +37,18 @@
37
37
  "dependencies": {
38
38
  "@open-wc/dedupe-mixin": "^1.3.0",
39
39
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/a11y-base": "24.4.0-dev.b3e1d14600",
41
- "@vaadin/button": "24.4.0-dev.b3e1d14600",
42
- "@vaadin/component-base": "24.4.0-dev.b3e1d14600",
43
- "@vaadin/confirm-dialog": "24.4.0-dev.b3e1d14600",
44
- "@vaadin/dialog": "24.4.0-dev.b3e1d14600",
45
- "@vaadin/form-layout": "24.4.0-dev.b3e1d14600",
46
- "@vaadin/grid": "24.4.0-dev.b3e1d14600",
47
- "@vaadin/overlay": "24.4.0-dev.b3e1d14600",
48
- "@vaadin/text-field": "24.4.0-dev.b3e1d14600",
49
- "@vaadin/vaadin-lumo-styles": "24.4.0-dev.b3e1d14600",
50
- "@vaadin/vaadin-material-styles": "24.4.0-dev.b3e1d14600",
51
- "@vaadin/vaadin-themable-mixin": "24.4.0-dev.b3e1d14600"
40
+ "@vaadin/a11y-base": "24.4.0-rc2",
41
+ "@vaadin/button": "24.4.0-rc2",
42
+ "@vaadin/component-base": "24.4.0-rc2",
43
+ "@vaadin/confirm-dialog": "24.4.0-rc2",
44
+ "@vaadin/dialog": "24.4.0-rc2",
45
+ "@vaadin/form-layout": "24.4.0-rc2",
46
+ "@vaadin/grid": "24.4.0-rc2",
47
+ "@vaadin/overlay": "24.4.0-rc2",
48
+ "@vaadin/text-field": "24.4.0-rc2",
49
+ "@vaadin/vaadin-lumo-styles": "24.4.0-rc2",
50
+ "@vaadin/vaadin-material-styles": "24.4.0-rc2",
51
+ "@vaadin/vaadin-themable-mixin": "24.4.0-rc2"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@esm-bundle/chai": "^4.3.4",
@@ -60,5 +60,5 @@
60
60
  "web-types.json",
61
61
  "web-types.lit.json"
62
62
  ],
63
- "gitHead": "502d4f5b03f770a83d270d98078cde230254dd0e"
63
+ "gitHead": "ea3d99e8cf67a337e959d5cab849f80464c7c7e5"
64
64
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -15,8 +15,8 @@ import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
15
15
  * @protected
16
16
  */
17
17
  export class ButtonSlotController extends SlotController {
18
- constructor(host, type, theme) {
19
- super(host, `${type}-button`, 'vaadin-button');
18
+ constructor(host, type, theme, noDefaultNode) {
19
+ super(host, `${type}-button`, noDefaultNode ? null : 'vaadin-button');
20
20
 
21
21
  this.type = type;
22
22
  this.theme = theme;
@@ -31,12 +31,18 @@ export class ButtonSlotController extends SlotController {
31
31
  * @override
32
32
  */
33
33
  initNode(node) {
34
+ // Prevent errors when the `noDefaultNode` flag is set
35
+ if (!node) {
36
+ return;
37
+ }
38
+
34
39
  // Needed by Flow counterpart to apply i18n to custom button
35
40
  if (node._isDefault) {
36
41
  this.defaultNode = node;
37
42
  }
38
43
 
39
- if (node === this.defaultNode) {
44
+ // Respect default theme attribute set by the Flow counterpart
45
+ if (node === this.defaultNode && !node.hasAttribute('theme')) {
40
46
  node.setAttribute('theme', this.theme);
41
47
  }
42
48
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -145,6 +145,7 @@ class CrudDialog extends DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(Po
145
145
  with-backdrop="[[!modeless]]"
146
146
  resizable$="[[resizable]]"
147
147
  fullscreen$="[[fullscreen]]"
148
+ role="dialog"
148
149
  focus-trap
149
150
  ></vaadin-crud-dialog-overlay>
150
151
  `;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -512,6 +512,9 @@ class Crud extends ControllerMixin(ElementMixin(ThemableMixin(PolymerElement)))
512
512
  /**
513
513
  * Number of items in the data set which is reported by the grid.
514
514
  * Typically it reflects the number of filtered items displayed in the grid.
515
+ *
516
+ * Note: As with `<vaadin-grid>`, this property updates automatically only
517
+ * if `items` is used for data.
515
518
  */
516
519
  size: {
517
520
  type: Number,
@@ -660,11 +663,6 @@ class Crud extends ControllerMixin(ElementMixin(ThemableMixin(PolymerElement)))
660
663
  this.__onGridSizeChanged = this.__onGridSizeChanged.bind(this);
661
664
  this.__onGridActiveItemChanged = this.__onGridActiveItemChanged.bind(this);
662
665
 
663
- this._newButtonController = new ButtonSlotController(this, 'new', 'primary');
664
- this._saveButtonController = new ButtonSlotController(this, 'save', 'primary');
665
- this._cancelButtonController = new ButtonSlotController(this, 'cancel', 'tertiary');
666
- this._deleteButtonController = new ButtonSlotController(this, 'delete', 'tertiary error');
667
-
668
666
  this.__focusRestorationController = new FocusRestorationController();
669
667
  }
670
668
 
@@ -704,6 +702,12 @@ class Crud extends ControllerMixin(ElementMixin(ThemableMixin(PolymerElement)))
704
702
 
705
703
  this.addController(new FormSlotController(this));
706
704
 
705
+ // Init controllers in `ready()` (not constructor) so that Flow can set `_noDefaultButtons`
706
+ this._newButtonController = new ButtonSlotController(this, 'new', 'primary', this._noDefaultButtons);
707
+ this._saveButtonController = new ButtonSlotController(this, 'save', 'primary', this._noDefaultButtons);
708
+ this._cancelButtonController = new ButtonSlotController(this, 'cancel', 'tertiary', this._noDefaultButtons);
709
+ this._deleteButtonController = new ButtonSlotController(this, 'delete', 'tertiary error', this._noDefaultButtons);
710
+
707
711
  this.addController(this._newButtonController);
708
712
 
709
713
  // NOTE: order in which buttons are added should match the order of slots in template
@@ -0,0 +1,4 @@
1
+ import '@vaadin/vaadin-lumo-styles/typography.js';
2
+ import '@vaadin/vaadin-lumo-styles/color.js';
3
+ import '@vaadin/vaadin-lumo-styles/font-icons.js';
4
+ import '@vaadin/vaadin-lumo-styles/style.js';
@@ -108,6 +108,7 @@ registerStyles(
108
108
  inset: 0;
109
109
  content: '';
110
110
  box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
111
+ pointer-events: none;
111
112
  }
112
113
 
113
114
  :host(:not([editor-position=''])) [part='editor']:not([hidden]) {
@@ -0,0 +1,8 @@
1
+ import '@vaadin/button/theme/lumo/vaadin-button.js';
2
+ import '@vaadin/confirm-dialog/theme/lumo/vaadin-confirm-dialog.js';
3
+ import '@vaadin/form-layout/theme/lumo/vaadin-form-layout.js';
4
+ import '@vaadin/grid/theme/lumo/vaadin-grid.js';
5
+ import '@vaadin/grid/theme/lumo/vaadin-grid-sorter.js';
6
+ import '@vaadin/text-field/theme/lumo/vaadin-text-field.js';
7
+ import './vaadin-crud-styles.js';
8
+ import '../../src/vaadin-crud.js';
@@ -0,0 +1,2 @@
1
+ import '@vaadin/vaadin-material-styles/typography.js';
2
+ import '@vaadin/vaadin-material-styles/color.js';
@@ -83,6 +83,7 @@ registerStyles(
83
83
  inset: 0;
84
84
  content: '';
85
85
  box-shadow: inset 0 0 0 2px var(--material-primary-color);
86
+ pointer-events: none;
86
87
  }
87
88
 
88
89
  [part='toolbar'] {
@@ -0,0 +1,8 @@
1
+ import '@vaadin/button/theme/material/vaadin-button.js';
2
+ import '@vaadin/confirm-dialog/theme/material/vaadin-confirm-dialog.js';
3
+ import '@vaadin/form-layout/theme/material/vaadin-form-layout.js';
4
+ import '@vaadin/grid/theme/material/vaadin-grid.js';
5
+ import '@vaadin/grid/theme/material/vaadin-grid-sorter.js';
6
+ import '@vaadin/text-field/theme/material/vaadin-text-field.js';
7
+ import './vaadin-crud-styles.js';
8
+ import '../../src/vaadin-crud.js';