@vaadin/crud 23.1.12 → 23.1.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/crud",
3
- "version": "23.1.12",
3
+ "version": "23.1.14",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,22 +36,22 @@
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/button": "~23.1.12",
40
- "@vaadin/component-base": "~23.1.12",
41
- "@vaadin/confirm-dialog": "~23.1.12",
42
- "@vaadin/dialog": "~23.1.12",
43
- "@vaadin/form-layout": "~23.1.12",
44
- "@vaadin/grid": "~23.1.12",
45
- "@vaadin/text-field": "~23.1.12",
39
+ "@vaadin/button": "~23.1.14",
40
+ "@vaadin/component-base": "~23.1.14",
41
+ "@vaadin/confirm-dialog": "~23.1.14",
42
+ "@vaadin/dialog": "~23.1.14",
43
+ "@vaadin/form-layout": "~23.1.14",
44
+ "@vaadin/grid": "~23.1.14",
45
+ "@vaadin/text-field": "~23.1.14",
46
46
  "@vaadin/vaadin-license-checker": "^2.1.0",
47
- "@vaadin/vaadin-lumo-styles": "~23.1.12",
48
- "@vaadin/vaadin-material-styles": "~23.1.12",
49
- "@vaadin/vaadin-themable-mixin": "~23.1.12"
47
+ "@vaadin/vaadin-lumo-styles": "~23.1.14",
48
+ "@vaadin/vaadin-material-styles": "~23.1.14",
49
+ "@vaadin/vaadin-themable-mixin": "~23.1.14"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@esm-bundle/chai": "^4.3.4",
53
53
  "@vaadin/testing-helpers": "^0.3.2",
54
54
  "sinon": "^13.0.2"
55
55
  },
56
- "gitHead": "0e0e63f33a535bc37103065550126a440f575b10"
56
+ "gitHead": "3065d26b1e7417c4efed0eb72c54e429031dc86c"
57
57
  }
@@ -76,7 +76,7 @@ export type CrudNewEvent = CustomEvent<{ item: null }>;
76
76
  /**
77
77
  * Fired when user wants to edit an existing item.
78
78
  */
79
- export type CrudEditEvent<T> = CustomEvent<{ item: T }>;
79
+ export type CrudEditEvent<T> = CustomEvent<{ item: T; index: number }>;
80
80
 
81
81
  /**
82
82
  * Fired when user wants to delete item.
@@ -153,11 +153,14 @@ export type CrudEventMap<T> = CrudCustomEventMap<T> & HTMLElementEventMap;
153
153
  *
154
154
  * Alternatively you can fully configure the component by using `slot` names.
155
155
  *
156
- * Slot name | Description
157
- * ----------------|----------------
158
- * `grid` | To replace the auto-generated grid with a custom one.
159
- * `form` | To replace the auto-generated form.
160
- * `toolbar` | To replace the toolbar content. Add an element with the attribute `new-button` for the new item action.
156
+ * Slot name | Description
157
+ * ---------------|----------------
158
+ * `grid` | To replace the auto-generated grid with a custom one.
159
+ * `form` | To replace the auto-generated form.
160
+ * `save-button` | To replace the "Save" button.
161
+ * `cancel-button`| To replace the "Cancel" button.
162
+ * `delete-button`| To replace the "Delete" button.
163
+ * `toolbar` | To replace the toolbar content. Add an element with the attribute `new-button` for the new item action.
161
164
  *
162
165
  * #### Example:
163
166
  *
@@ -182,6 +185,10 @@ export type CrudEventMap<T> = CrudCustomEventMap<T> & HTMLElementEventMap;
182
185
  * Total singers: [[size]]
183
186
  * <button new-button>New singer</button>
184
187
  * </div>
188
+ *
189
+ * <button slot="save-button">Save changes</button>
190
+ * <button slot="cancel-button">Discard changes</button>
191
+ * <button slot="delete-button">Delete singer</button>
185
192
  * </vaadin-crud>
186
193
  * ```
187
194
  * ```js
@@ -57,11 +57,14 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
57
57
  *
58
58
  * Alternatively you can fully configure the component by using `slot` names.
59
59
  *
60
- * Slot name | Description
61
- * ----------------|----------------
62
- * `grid` | To replace the auto-generated grid with a custom one.
63
- * `form` | To replace the auto-generated form.
64
- * `toolbar` | To replace the toolbar content. Add an element with the attribute `new-button` for the new item action.
60
+ * Slot name | Description
61
+ * ---------------|----------------
62
+ * `grid` | To replace the auto-generated grid with a custom one.
63
+ * `form` | To replace the auto-generated form.
64
+ * `save-button` | To replace the "Save" button.
65
+ * `cancel-button`| To replace the "Cancel" button.
66
+ * `delete-button`| To replace the "Delete" button.
67
+ * `toolbar` | To replace the toolbar content. Add an element with the attribute `new-button` for the new item action.
65
68
  *
66
69
  * #### Example:
67
70
  *
@@ -86,6 +89,10 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
86
89
  * Total singers: [[size]]
87
90
  * <button new-button>New singer</button>
88
91
  * </div>
92
+ *
93
+ * <button slot="save-button">Save changes</button>
94
+ * <button slot="cancel-button">Discard changes</button>
95
+ * <button slot="delete-button">Delete singer</button>
89
96
  * </vaadin-crud>
90
97
  * ```
91
98
  * ```js
@@ -940,7 +947,12 @@ class Crud extends SlotMixin(ControllerMixin(ElementMixin(ThemableMixin(PolymerE
940
947
  if (form) {
941
948
  form.include = include;
942
949
  form.exclude = exclude;
943
- form.setAttribute('theme', theme);
950
+
951
+ if (theme) {
952
+ form.setAttribute('theme', theme);
953
+ } else {
954
+ form.removeAttribute('theme');
955
+ }
944
956
  }
945
957
  }
946
958