@vaadin/crud 24.4.0-dev.223e39f050 → 24.4.0-dev.4b20a0c55.3

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.223e39f050",
3
+ "version": "24.4.0-dev.4b20a0c55.3",
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.223e39f050",
41
- "@vaadin/button": "24.4.0-dev.223e39f050",
42
- "@vaadin/component-base": "24.4.0-dev.223e39f050",
43
- "@vaadin/confirm-dialog": "24.4.0-dev.223e39f050",
44
- "@vaadin/dialog": "24.4.0-dev.223e39f050",
45
- "@vaadin/form-layout": "24.4.0-dev.223e39f050",
46
- "@vaadin/grid": "24.4.0-dev.223e39f050",
47
- "@vaadin/overlay": "24.4.0-dev.223e39f050",
48
- "@vaadin/text-field": "24.4.0-dev.223e39f050",
49
- "@vaadin/vaadin-lumo-styles": "24.4.0-dev.223e39f050",
50
- "@vaadin/vaadin-material-styles": "24.4.0-dev.223e39f050",
51
- "@vaadin/vaadin-themable-mixin": "24.4.0-dev.223e39f050"
40
+ "@vaadin/a11y-base": "24.4.0-dev.4b20a0c55.3",
41
+ "@vaadin/button": "24.4.0-dev.4b20a0c55.3",
42
+ "@vaadin/component-base": "24.4.0-dev.4b20a0c55.3",
43
+ "@vaadin/confirm-dialog": "24.4.0-dev.4b20a0c55.3",
44
+ "@vaadin/dialog": "24.4.0-dev.4b20a0c55.3",
45
+ "@vaadin/form-layout": "24.4.0-dev.4b20a0c55.3",
46
+ "@vaadin/grid": "24.4.0-dev.4b20a0c55.3",
47
+ "@vaadin/overlay": "24.4.0-dev.4b20a0c55.3",
48
+ "@vaadin/text-field": "24.4.0-dev.4b20a0c55.3",
49
+ "@vaadin/vaadin-lumo-styles": "24.4.0-dev.4b20a0c55.3",
50
+ "@vaadin/vaadin-material-styles": "24.4.0-dev.4b20a0c55.3",
51
+ "@vaadin/vaadin-themable-mixin": "24.4.0-dev.4b20a0c55.3"
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": "5e2e3bfc811c95aed9354235fab93fdbf43eb354"
63
+ "gitHead": "41cf17453d7506fb635c088a0425e20b6e82b89b"
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
  *
@@ -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
  *
@@ -660,11 +660,6 @@ class Crud extends ControllerMixin(ElementMixin(ThemableMixin(PolymerElement)))
660
660
  this.__onGridSizeChanged = this.__onGridSizeChanged.bind(this);
661
661
  this.__onGridActiveItemChanged = this.__onGridActiveItemChanged.bind(this);
662
662
 
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
663
  this.__focusRestorationController = new FocusRestorationController();
669
664
  }
670
665
 
@@ -704,6 +699,12 @@ class Crud extends ControllerMixin(ElementMixin(ThemableMixin(PolymerElement)))
704
699
 
705
700
  this.addController(new FormSlotController(this));
706
701
 
702
+ // Init controllers in `ready()` (not constructor) so that Flow can set `_noDefaultButtons`
703
+ this._newButtonController = new ButtonSlotController(this, 'new', 'primary', this._noDefaultButtons);
704
+ this._saveButtonController = new ButtonSlotController(this, 'save', 'primary', this._noDefaultButtons);
705
+ this._cancelButtonController = new ButtonSlotController(this, 'cancel', 'tertiary', this._noDefaultButtons);
706
+ this._deleteButtonController = new ButtonSlotController(this, 'delete', 'tertiary error', this._noDefaultButtons);
707
+
707
708
  this.addController(this._newButtonController);
708
709
 
709
710
  // NOTE: order in which buttons are added should match the order of slots in template