@vaadin/crud 22.0.0-beta1 → 22.0.1
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 +27 -26
- package/package.json +15 -14
- package/src/vaadin-crud-edit-column.js +1 -1
- package/src/vaadin-crud-edit.js +1 -1
- package/src/vaadin-crud-form.d.ts +0 -7
- package/src/vaadin-crud-form.js +1 -1
- package/src/vaadin-crud-grid.js +2 -2
- package/src/vaadin-crud-include-mixin.d.ts +3 -8
- package/src/vaadin-crud.d.ts +1 -1
- package/src/vaadin-crud.js +5 -5
- package/src/vaadin-dialog-layout.js +2 -2
- package/theme/lumo/vaadin-crud-styles.js +1 -1
- package/theme/material/vaadin-crud-styles.js +1 -1
- package/theme/vaadin-dialog-layout-overlay-styles.js +1 -1
package/README.md
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vaadin/crud
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
|
5
|
-
[API documentation ↗](https://vaadin.com/components/vaadin-crud/html-api)
|
|
3
|
+
A web component for displaying, editing, creating, and deleting items from a dataset.
|
|
6
4
|
|
|
7
|
-
[
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
> ℹ️ A commercial Vaadin [subscription](https://vaadin.com/pricing) is required to use CRUD in your project.
|
|
6
|
+
|
|
7
|
+
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/crud)
|
|
10
8
|
|
|
11
9
|
[](https://www.npmjs.com/package/@vaadin/crud)
|
|
12
|
-
[](https://vaadin.com/directory/component/vaadinvaadin-crud)
|
|
13
10
|
[](https://discord.gg/PHmkCKC)
|
|
14
11
|
|
|
15
12
|
```html
|
|
16
13
|
<vaadin-crud items='[{"name": "Juan", "surname": "Garcia"}]'></vaadin-crud>
|
|
17
14
|
```
|
|
18
15
|
|
|
19
|
-
[<img src="https://raw.githubusercontent.com/vaadin/
|
|
16
|
+
[<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/crud/screenshot.gif" width="702" alt="Screenshot of vaadin-crud">](https://vaadin.com/docs/latest/ds/components/crud)
|
|
20
17
|
|
|
21
18
|
## Installation
|
|
22
19
|
|
|
23
|
-
Install
|
|
20
|
+
Install the component:
|
|
24
21
|
|
|
25
22
|
```sh
|
|
26
|
-
npm i @vaadin/crud
|
|
23
|
+
npm i @vaadin/crud
|
|
27
24
|
```
|
|
28
25
|
|
|
29
|
-
Once installed, import
|
|
26
|
+
Once installed, import the component in your application:
|
|
30
27
|
|
|
31
28
|
```js
|
|
32
|
-
import '@vaadin/crud
|
|
29
|
+
import '@vaadin/crud';
|
|
33
30
|
```
|
|
34
31
|
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
Vaadin components use the Lumo theme by default.
|
|
38
|
-
|
|
39
|
-
To use the Material theme, import the correspondent file from the `theme/material` folder.
|
|
32
|
+
## Themes
|
|
40
33
|
|
|
41
|
-
|
|
34
|
+
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
|
|
35
|
+
The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/crud/vaadin-crud.js) of the package uses the Lumo theme.
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
To use the Material theme, import the component from the `theme/material` folder:
|
|
44
38
|
|
|
45
|
-
|
|
39
|
+
```js
|
|
40
|
+
import '@vaadin/crud/theme/material/vaadin-crud.js';
|
|
41
|
+
```
|
|
46
42
|
|
|
47
|
-
|
|
43
|
+
You can also import the Lumo version of the component explicitly:
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
```js
|
|
46
|
+
import '@vaadin/crud/theme/lumo/vaadin-crud.js';
|
|
47
|
+
```
|
|
50
48
|
|
|
51
|
-
-
|
|
49
|
+
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
52
50
|
|
|
53
|
-
|
|
51
|
+
```js
|
|
52
|
+
import '@vaadin/crud/src/vaadin-crud.js';
|
|
53
|
+
```
|
|
54
54
|
|
|
55
55
|
## Contributing
|
|
56
56
|
|
|
@@ -60,4 +60,5 @@ Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/
|
|
|
60
60
|
|
|
61
61
|
Commercial Vaadin Developer License 4.0 (CVDLv4). For license terms, see LICENSE.
|
|
62
62
|
|
|
63
|
-
Vaadin collects development time
|
|
63
|
+
Vaadin collects usage statistics at development time to improve this product.
|
|
64
|
+
For crud and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/crud",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,25 +32,26 @@
|
|
|
32
32
|
"polymer"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
35
36
|
"@polymer/iron-media-query": "^3.0.0",
|
|
36
37
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/button": "22.0.
|
|
38
|
-
"@vaadin/component-base": "22.0.
|
|
39
|
-
"@vaadin/confirm-dialog": "22.0.
|
|
40
|
-
"@vaadin/dialog": "22.0.
|
|
41
|
-
"@vaadin/form-layout": "22.0.
|
|
42
|
-
"@vaadin/grid": "22.0.
|
|
43
|
-
"@vaadin/text-field": "22.0.
|
|
38
|
+
"@vaadin/button": "^22.0.1",
|
|
39
|
+
"@vaadin/component-base": "^22.0.1",
|
|
40
|
+
"@vaadin/confirm-dialog": "^22.0.1",
|
|
41
|
+
"@vaadin/dialog": "^22.0.1",
|
|
42
|
+
"@vaadin/form-layout": "^22.0.1",
|
|
43
|
+
"@vaadin/grid": "^22.0.1",
|
|
44
|
+
"@vaadin/text-field": "^22.0.1",
|
|
44
45
|
"@vaadin/vaadin-license-checker": "^2.1.0",
|
|
45
|
-
"@vaadin/vaadin-lumo-styles": "22.0.
|
|
46
|
-
"@vaadin/vaadin-material-styles": "22.0.
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "22.0.
|
|
46
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.1",
|
|
47
|
+
"@vaadin/vaadin-material-styles": "^22.0.1",
|
|
48
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.1"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@esm-bundle/chai": "^4.3.4",
|
|
51
|
-
"@vaadin/polymer-legacy-adapter": "22.0.
|
|
52
|
-
"@vaadin/testing-helpers": "^0.3.
|
|
52
|
+
"@vaadin/polymer-legacy-adapter": "^22.0.1",
|
|
53
|
+
"@vaadin/testing-helpers": "^0.3.2",
|
|
53
54
|
"sinon": "^9.2.1"
|
|
54
55
|
},
|
|
55
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "2b0a2bff0369d6020f7cc33ad35506aa2d1f6f68"
|
|
56
57
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
|
-
import { GridColumn } from '@vaadin/grid/src/vaadin-grid-column.js';
|
|
7
6
|
import './vaadin-crud-edit.js';
|
|
7
|
+
import { GridColumn } from '@vaadin/grid/src/vaadin-grid-column.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* `<vaadin-crud-edit-column>` is a helper element for the `<vaadin-grid>`
|
package/src/vaadin-crud-edit.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
7
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -14,13 +14,6 @@ declare class CrudForm<Item> extends IncludedMixin(FormLayout) {
|
|
|
14
14
|
* The item being edited.
|
|
15
15
|
*/
|
|
16
16
|
item: Item | null | undefined;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Auto-generate form fields based on the JSON structure of the object provided.
|
|
20
|
-
*
|
|
21
|
-
* If not called, the method will be executed the first time an item is assigned.
|
|
22
|
-
*/
|
|
23
|
-
_configure(object: Item): void;
|
|
24
17
|
}
|
|
25
18
|
|
|
26
19
|
declare global {
|
package/src/vaadin-crud-form.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
|
-
import { FormLayout } from '@vaadin/form-layout/src/vaadin-form-layout.js';
|
|
7
6
|
import '@vaadin/text-field/src/vaadin-text-field.js';
|
|
7
|
+
import { FormLayout } from '@vaadin/form-layout/src/vaadin-form-layout.js';
|
|
8
8
|
import { IncludedMixin } from './vaadin-crud-include-mixin.js';
|
|
9
9
|
|
|
10
10
|
/**
|
package/src/vaadin-crud-grid.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
|
-
import { Grid } from '@vaadin/grid/src/vaadin-grid.js';
|
|
7
6
|
import '@vaadin/grid/src/vaadin-grid-column.js';
|
|
8
7
|
import '@vaadin/grid/src/vaadin-grid-column-group.js';
|
|
9
8
|
import '@vaadin/grid/src/vaadin-grid-sorter.js';
|
|
10
9
|
import '@vaadin/grid/src/vaadin-grid-filter.js';
|
|
11
|
-
import { IncludedMixin } from './vaadin-crud-include-mixin.js';
|
|
12
10
|
import './vaadin-crud-edit-column.js';
|
|
11
|
+
import { Grid } from '@vaadin/grid/src/vaadin-grid.js';
|
|
12
|
+
import { IncludedMixin } from './vaadin-crud-include-mixin.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* An element used internally by `<vaadin-crud>`. Not intended to be used separately.
|
|
@@ -3,14 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { Constructor } from '@open-wc/dedupe-mixin';
|
|
6
7
|
|
|
7
|
-
declare function IncludedMixin<T extends
|
|
8
|
+
export declare function IncludedMixin<T extends Constructor<HTMLElement>>(base: T): T & Constructor<IncludedMixinClass>;
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
new (...args: any[]): IncludedMixin;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface IncludedMixin {
|
|
10
|
+
export declare class IncludedMixinClass {
|
|
14
11
|
/**
|
|
15
12
|
* A list of item fields that should not be mapped to form fields.
|
|
16
13
|
*
|
|
@@ -27,5 +24,3 @@ interface IncludedMixin {
|
|
|
27
24
|
*/
|
|
28
25
|
include: string | string[] | undefined;
|
|
29
26
|
}
|
|
30
|
-
|
|
31
|
-
export { IncludedMixin, IncludedMixinConstructor };
|
package/src/vaadin-crud.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
7
|
import { GridFilterDefinition, GridSorterDefinition } from '@vaadin/grid/src/vaadin-grid.js';
|
|
8
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
9
|
|
|
10
10
|
export type CrudDataProviderCallback<T> = (items: Array<T>, size?: number) => void;
|
|
11
11
|
|
package/src/vaadin-crud.js
CHANGED
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
|
-
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
|
|
7
|
-
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
8
|
-
import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
9
6
|
import '@polymer/iron-media-query/iron-media-query.js';
|
|
10
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
7
|
import '@vaadin/button/src/vaadin-button.js';
|
|
13
8
|
import '@vaadin/dialog/src/vaadin-dialog.js';
|
|
14
9
|
import '@vaadin/confirm-dialog/src/vaadin-confirm-dialog.js';
|
|
@@ -16,6 +11,11 @@ import '@vaadin/vaadin-license-checker/vaadin-license-checker.js';
|
|
|
16
11
|
import './vaadin-dialog-layout.js';
|
|
17
12
|
import './vaadin-crud-grid.js';
|
|
18
13
|
import './vaadin-crud-form.js';
|
|
14
|
+
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
15
|
+
import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
16
|
+
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
17
|
+
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
18
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
19
19
|
|
|
20
20
|
const HOST_PROPS = {
|
|
21
21
|
save: [{ attr: 'disabled', prop: '__isDirty', parseProp: '__isSaveBtnDisabled' }, { prop: 'i18n.saveItem' }],
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import '@vaadin/dialog/src/vaadin-dialog.js';
|
|
7
|
+
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
|
-
import '@vaadin/dialog/src/vaadin-dialog.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* An element used internally by `<vaadin-crud>`. Not intended to be used separately.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
1
|
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
3
2
|
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
4
3
|
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
5
4
|
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
6
5
|
import '../vaadin-dialog-layout-overlay-styles.js';
|
|
6
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
7
|
|
|
8
8
|
registerStyles(
|
|
9
9
|
'vaadin-crud-edit',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
|
|
2
1
|
import '@vaadin/vaadin-material-styles/typography.js';
|
|
3
2
|
import '@vaadin/vaadin-material-styles/color.js';
|
|
4
3
|
import '../vaadin-dialog-layout-overlay-styles.js';
|
|
4
|
+
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
5
5
|
|
|
6
6
|
registerStyles(
|
|
7
7
|
'vaadin-crud-edit',
|