@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/LICENSE +3 -1141
- package/README.md +0 -1
- package/package.json +14 -14
- package/src/vaadin-crud-controllers.d.ts +1 -1
- package/src/vaadin-crud-controllers.js +10 -4
- package/src/vaadin-crud-dialog.js +2 -1
- package/src/vaadin-crud-edit-column.d.ts +1 -1
- package/src/vaadin-crud-edit-column.js +1 -1
- package/src/vaadin-crud-edit.d.ts +1 -1
- package/src/vaadin-crud-edit.js +1 -1
- package/src/vaadin-crud-form.d.ts +1 -1
- package/src/vaadin-crud-form.js +1 -1
- package/src/vaadin-crud-grid.d.ts +1 -1
- package/src/vaadin-crud-grid.js +1 -1
- package/src/vaadin-crud-helpers.d.ts +1 -1
- package/src/vaadin-crud-helpers.js +1 -1
- package/src/vaadin-crud-include-mixin.d.ts +1 -1
- package/src/vaadin-crud-include-mixin.js +1 -1
- package/src/vaadin-crud.d.ts +1 -1
- package/src/vaadin-crud.js +10 -6
- package/theme/lumo/vaadin-crud-styles.d.ts +4 -0
- package/theme/lumo/vaadin-crud-styles.js +1 -0
- package/theme/lumo/vaadin-crud.d.ts +8 -0
- package/theme/material/vaadin-crud-styles.d.ts +2 -0
- package/theme/material/vaadin-crud-styles.js +1 -0
- package/theme/material/vaadin-crud.d.ts +8 -0
- package/web-types.json +648 -0
- package/web-types.lit.json +307 -0
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
|
[](https://www.npmjs.com/package/@vaadin/crud)
|
|
10
|
-
[](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-
|
|
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-
|
|
41
|
-
"@vaadin/button": "24.4.0-
|
|
42
|
-
"@vaadin/component-base": "24.4.0-
|
|
43
|
-
"@vaadin/confirm-dialog": "24.4.0-
|
|
44
|
-
"@vaadin/dialog": "24.4.0-
|
|
45
|
-
"@vaadin/form-layout": "24.4.0-
|
|
46
|
-
"@vaadin/grid": "24.4.0-
|
|
47
|
-
"@vaadin/overlay": "24.4.0-
|
|
48
|
-
"@vaadin/text-field": "24.4.0-
|
|
49
|
-
"@vaadin/vaadin-lumo-styles": "24.4.0-
|
|
50
|
-
"@vaadin/vaadin-material-styles": "24.4.0-
|
|
51
|
-
"@vaadin/vaadin-themable-mixin": "24.4.0-
|
|
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": "
|
|
63
|
+
"gitHead": "ea3d99e8cf67a337e959d5cab849f80464c7c7e5"
|
|
64
64
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
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
|
-
|
|
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 -
|
|
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
|
`;
|
package/src/vaadin-crud-edit.js
CHANGED
package/src/vaadin-crud-form.js
CHANGED
package/src/vaadin-crud-grid.js
CHANGED
package/src/vaadin-crud.d.ts
CHANGED
package/src/vaadin-crud.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
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,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,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';
|