@vaadin/crud 24.8.0-alpha9 → 25.0.0-alpha1
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 +0 -23
- package/package.json +16 -19
- package/src/vaadin-crud-dialog.js +32 -31
- package/src/vaadin-crud-edit-column.d.ts +1 -1
- package/src/vaadin-crud-edit-column.js +1 -1
- package/src/vaadin-crud-edit.js +18 -21
- package/src/vaadin-crud-form.js +4 -1
- package/src/vaadin-crud-helpers.js +3 -3
- package/src/vaadin-crud-mixin.js +2 -2
- package/src/vaadin-crud.d.ts +1 -6
- package/src/vaadin-crud.js +31 -28
- package/web-types.json +7 -7
- package/web-types.lit.json +5 -5
- package/src/vaadin-lit-crud-dialog.d.ts +0 -11
- package/src/vaadin-lit-crud-dialog.js +0 -128
- package/src/vaadin-lit-crud-edit-column.d.ts +0 -11
- package/src/vaadin-lit-crud-edit-column.js +0 -70
- package/src/vaadin-lit-crud-edit.d.ts +0 -11
- package/src/vaadin-lit-crud-edit.js +0 -75
- package/src/vaadin-lit-crud-form.d.ts +0 -11
- package/src/vaadin-lit-crud-form.js +0 -80
- package/src/vaadin-lit-crud-grid.d.ts +0 -11
- package/src/vaadin-lit-crud-grid.js +0 -35
- package/src/vaadin-lit-crud.js +0 -122
- package/theme/lumo/vaadin-lit-crud.d.ts +0 -8
- package/theme/lumo/vaadin-lit-crud.js +0 -8
- package/theme/material/vaadin-crud-styles.d.ts +0 -2
- package/theme/material/vaadin-crud-styles.js +0 -157
- package/theme/material/vaadin-crud.d.ts +0 -8
- package/theme/material/vaadin-crud.js +0 -8
- package/theme/material/vaadin-lit-crud.d.ts +0 -8
- package/theme/material/vaadin-lit-crud.js +0 -8
- package/vaadin-lit-crud-edit .js +0 -1
- package/vaadin-lit-crud-edit-column.js +0 -1
- package/vaadin-lit-crud.js +0 -2
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
export * from './vaadin-crud-dialog.js';
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
import { css, html, LitElement } from 'lit';
|
|
12
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
13
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
14
|
-
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
15
|
-
import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
16
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
17
|
-
import { DialogBaseMixin } from '@vaadin/dialog/src/vaadin-dialog-base-mixin.js';
|
|
18
|
-
import { dialogOverlay, resizableOverlay } from '@vaadin/dialog/src/vaadin-dialog-styles.js';
|
|
19
|
-
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
20
|
-
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
21
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
22
|
-
import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
|
|
23
|
-
import { crudDialogOverlayStyles } from './vaadin-crud-styles.js';
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* An element used internally by `<vaadin-crud>`. Not intended to be used separately.
|
|
27
|
-
*
|
|
28
|
-
* @extends HTMLElement
|
|
29
|
-
* @mixes DirMixin
|
|
30
|
-
* @mixes OverlayMixin
|
|
31
|
-
* @mixes ThemableMixin
|
|
32
|
-
* @private
|
|
33
|
-
*/
|
|
34
|
-
class CrudDialogOverlay extends OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
35
|
-
static get is() {
|
|
36
|
-
return 'vaadin-crud-dialog-overlay';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static get styles() {
|
|
40
|
-
return [overlayStyles, dialogOverlay, resizableOverlay, crudDialogOverlayStyles];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** @protected */
|
|
44
|
-
render() {
|
|
45
|
-
return html`
|
|
46
|
-
<div part="backdrop" id="backdrop" ?hidden="${!this.withBackdrop}"></div>
|
|
47
|
-
<div part="overlay" id="overlay" tabindex="0">
|
|
48
|
-
<section id="resizerContainer" class="resizer-container">
|
|
49
|
-
<header part="header"><slot name="header"></slot></header>
|
|
50
|
-
<div part="content" id="content">
|
|
51
|
-
<slot name="form"></slot>
|
|
52
|
-
</div>
|
|
53
|
-
<footer part="footer" role="toolbar">
|
|
54
|
-
<slot name="save-button"></slot>
|
|
55
|
-
<slot name="cancel-button"></slot>
|
|
56
|
-
<slot name="delete-button"></slot>
|
|
57
|
-
</footer>
|
|
58
|
-
</section>
|
|
59
|
-
</div>
|
|
60
|
-
`;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* @protected
|
|
65
|
-
* @override
|
|
66
|
-
*/
|
|
67
|
-
ready() {
|
|
68
|
-
super.ready();
|
|
69
|
-
|
|
70
|
-
// CRUD has header and footer but does not use renderers
|
|
71
|
-
this.setAttribute('has-header', '');
|
|
72
|
-
this.setAttribute('has-footer', '');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
defineCustomElement(CrudDialogOverlay);
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* An element used internally by `<vaadin-crud>`. Not intended to be used separately.
|
|
80
|
-
* @private
|
|
81
|
-
*/
|
|
82
|
-
class CrudDialog extends DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(PolylitMixin(LitElement)))) {
|
|
83
|
-
static get is() {
|
|
84
|
-
return 'vaadin-crud-dialog';
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
static get styles() {
|
|
88
|
-
return css`
|
|
89
|
-
:host {
|
|
90
|
-
display: none;
|
|
91
|
-
}
|
|
92
|
-
`;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
static get properties() {
|
|
96
|
-
return {
|
|
97
|
-
ariaLabel: {
|
|
98
|
-
type: String,
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
fullscreen: {
|
|
102
|
-
type: Boolean,
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/** @protected */
|
|
108
|
-
render() {
|
|
109
|
-
return html`
|
|
110
|
-
<vaadin-crud-dialog-overlay
|
|
111
|
-
id="overlay"
|
|
112
|
-
.opened="${this.opened}"
|
|
113
|
-
aria-label="${ifDefined(this.ariaLabel)}"
|
|
114
|
-
@opened-changed="${this._onOverlayOpened}"
|
|
115
|
-
@mousedown="${this._bringOverlayToFront}"
|
|
116
|
-
@touchstart="${this._bringOverlayToFront}"
|
|
117
|
-
theme="${ifDefined(this._theme)}"
|
|
118
|
-
.modeless="${this.modeless}"
|
|
119
|
-
.withBackdrop="${!this.modeless}"
|
|
120
|
-
?fullscreen="${this.fullscreen}"
|
|
121
|
-
role="dialog"
|
|
122
|
-
focus-trap
|
|
123
|
-
></vaadin-crud-dialog-overlay>
|
|
124
|
-
`;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
defineCustomElement(CrudDialog);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
export * from './vaadin-crud-edit-column.js';
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
import './vaadin-lit-crud-edit.js';
|
|
12
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
|
-
import { GridColumn } from '@vaadin/grid/src/vaadin-lit-grid-column.js';
|
|
14
|
-
import { editColumnDefaultRenderer } from './vaadin-crud-helpers.js';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* LitElement based version of `<vaadin-crud-edit-column>` web component.
|
|
18
|
-
*
|
|
19
|
-
* ## Disclaimer
|
|
20
|
-
*
|
|
21
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
22
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
23
|
-
*/
|
|
24
|
-
class CrudEditColumn extends GridColumn {
|
|
25
|
-
static get is() {
|
|
26
|
-
return 'vaadin-crud-edit-column';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static get properties() {
|
|
30
|
-
return {
|
|
31
|
-
/**
|
|
32
|
-
* Width of the cells for this column.
|
|
33
|
-
* @private
|
|
34
|
-
*/
|
|
35
|
-
width: {
|
|
36
|
-
type: String,
|
|
37
|
-
value: '4rem',
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Flex grow ratio for the cell widths. When set to 0, cell width is fixed.
|
|
42
|
-
* @private
|
|
43
|
-
*/
|
|
44
|
-
flexGrow: {
|
|
45
|
-
type: Number,
|
|
46
|
-
value: 0,
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
/** The arial-label for the edit button */
|
|
50
|
-
ariaLabel: String,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
static get observers() {
|
|
55
|
-
return ['_onRendererOrBindingChanged(_renderer, _cells, _bodyContentHidden, _cells.*, path, ariaLabel)'];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Renders the crud edit element to the body cell.
|
|
60
|
-
*
|
|
61
|
-
* @override
|
|
62
|
-
*/
|
|
63
|
-
_defaultRenderer(root, column) {
|
|
64
|
-
editColumnDefaultRenderer(root, column);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
defineCustomElement(CrudEditColumn);
|
|
69
|
-
|
|
70
|
-
export { CrudEditColumn };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
export * from './vaadin-crud-edit.js';
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { html } from 'lit';
|
|
13
|
-
import { Button } from '@vaadin/button/src/vaadin-lit-button.js';
|
|
14
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
15
|
-
import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* LitElement based version of `<vaadin-crud-edit>` web component.
|
|
19
|
-
*
|
|
20
|
-
* ## Disclaimer
|
|
21
|
-
*
|
|
22
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
23
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
24
|
-
*/
|
|
25
|
-
class CrudEdit extends Button {
|
|
26
|
-
static get is() {
|
|
27
|
-
return 'vaadin-crud-edit';
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static get styles() {
|
|
31
|
-
return [
|
|
32
|
-
super.styles,
|
|
33
|
-
css`
|
|
34
|
-
:host {
|
|
35
|
-
display: block;
|
|
36
|
-
}
|
|
37
|
-
`,
|
|
38
|
-
];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** @protected */
|
|
42
|
-
render() {
|
|
43
|
-
return html`
|
|
44
|
-
<div part="icon"></div>
|
|
45
|
-
<slot name="tooltip"></slot>
|
|
46
|
-
`;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** @protected */
|
|
50
|
-
ready() {
|
|
51
|
-
super.ready();
|
|
52
|
-
this.addEventListener('click', this.__onClick);
|
|
53
|
-
this.setAttribute('aria-label', 'Edit');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/** @private */
|
|
57
|
-
__onClick(e) {
|
|
58
|
-
const tr = e.target.parentElement.assignedSlot.parentElement.parentElement;
|
|
59
|
-
tr.dispatchEvent(
|
|
60
|
-
new CustomEvent('edit', { detail: { item: tr._item, index: tr.index }, bubbles: true, composed: true }),
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Fired when user on the icon.
|
|
66
|
-
*
|
|
67
|
-
* @event edit
|
|
68
|
-
* @param {Object} detail.item the item to edit
|
|
69
|
-
* @param {Object} detail.index the index of the item in the data set
|
|
70
|
-
*/
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
defineCustomElement(CrudEdit);
|
|
74
|
-
|
|
75
|
-
export { CrudEdit };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
export * from './vaadin-crud-form.js';
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
import '@vaadin/text-field/src/vaadin-lit-text-field.js';
|
|
12
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
|
-
import { FormLayout } from '@vaadin/form-layout/src/vaadin-lit-form-layout.js';
|
|
14
|
-
import { createField, createFields } from './vaadin-crud-helpers.js';
|
|
15
|
-
import { IncludedMixin } from './vaadin-crud-include-mixin.js';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* An element used internally by `<vaadin-crud>`. Not intended to be used separately.
|
|
19
|
-
*
|
|
20
|
-
* @extends FormLayout
|
|
21
|
-
* @mixes IncludedMixin
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
|
-
class CrudForm extends IncludedMixin(FormLayout) {
|
|
25
|
-
static get is() {
|
|
26
|
-
return 'vaadin-crud-form';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static get properties() {
|
|
30
|
-
return {
|
|
31
|
-
/**
|
|
32
|
-
* The item being edited.
|
|
33
|
-
* @type {unknown}
|
|
34
|
-
*/
|
|
35
|
-
item: {
|
|
36
|
-
type: Object,
|
|
37
|
-
sync: true,
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
static get observers() {
|
|
43
|
-
return ['__onItemChange(item)'];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Auto-generate form fields based on the JSON structure of the object provided.
|
|
48
|
-
*
|
|
49
|
-
* If not called, the method will be executed the first time an item is assigned.
|
|
50
|
-
* @param {unknown} object
|
|
51
|
-
* @protected
|
|
52
|
-
*/
|
|
53
|
-
_configure(object) {
|
|
54
|
-
this.innerHTML = '';
|
|
55
|
-
this._fields = [];
|
|
56
|
-
this.__createFields(this, object);
|
|
57
|
-
this._updateLayout();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** @private */
|
|
61
|
-
__onItemChange(item) {
|
|
62
|
-
if (!this._fields) {
|
|
63
|
-
this._configure(item);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** @private */
|
|
68
|
-
__createField(parent, path) {
|
|
69
|
-
return createField(this, parent, path);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** @private */
|
|
73
|
-
__createFields(parent, object, path) {
|
|
74
|
-
return createFields(this, parent, object, path);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
defineCustomElement(CrudForm);
|
|
79
|
-
|
|
80
|
-
export { CrudForm };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
export * from './vaadin-crud-grid.js';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
import '@vaadin/grid/src/vaadin-lit-grid-column-group.js';
|
|
12
|
-
import '@vaadin/grid/src/vaadin-lit-grid-column.js';
|
|
13
|
-
import '@vaadin/grid/src/vaadin-lit-grid-filter.js';
|
|
14
|
-
import '@vaadin/grid/src/vaadin-lit-grid-sorter.js';
|
|
15
|
-
import './vaadin-lit-crud-edit-column.js';
|
|
16
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
17
|
-
import { Grid } from '@vaadin/grid/src/vaadin-lit-grid.js';
|
|
18
|
-
import { CrudGridMixin } from './vaadin-crud-grid-mixin.js';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* An element used internally by `<vaadin-crud>`. Not intended to be used separately.
|
|
22
|
-
*
|
|
23
|
-
* @extends Grid
|
|
24
|
-
* @mixes CrudGridMixin
|
|
25
|
-
* @private
|
|
26
|
-
*/
|
|
27
|
-
class CrudGrid extends CrudGridMixin(Grid) {
|
|
28
|
-
static get is() {
|
|
29
|
-
return 'vaadin-crud-grid';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
defineCustomElement(CrudGrid);
|
|
34
|
-
|
|
35
|
-
export { CrudGrid };
|
package/src/vaadin-lit-crud.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2000 - 2025 Vaadin Ltd.
|
|
4
|
-
*
|
|
5
|
-
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
-
* license.
|
|
10
|
-
*/
|
|
11
|
-
import '@vaadin/button/src/vaadin-lit-button.js';
|
|
12
|
-
import '@vaadin/confirm-dialog/src/vaadin-lit-confirm-dialog.js';
|
|
13
|
-
import './vaadin-lit-crud-dialog.js';
|
|
14
|
-
import './vaadin-lit-crud-grid.js';
|
|
15
|
-
import './vaadin-lit-crud-form.js';
|
|
16
|
-
import { html, LitElement } from 'lit';
|
|
17
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
18
|
-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
19
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
20
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
21
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
22
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
23
|
-
import { CrudMixin } from './vaadin-crud-mixin.js';
|
|
24
|
-
import { crudStyles } from './vaadin-crud-styles.js';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* LitElement based version of `<vaadin-crud>` web component.
|
|
28
|
-
*
|
|
29
|
-
* ## Disclaimer
|
|
30
|
-
*
|
|
31
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
32
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
33
|
-
*/
|
|
34
|
-
class Crud extends ControllerMixin(ElementMixin(ThemableMixin(CrudMixin(PolylitMixin(LitElement))))) {
|
|
35
|
-
static get styles() {
|
|
36
|
-
return crudStyles;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** @protected */
|
|
40
|
-
render() {
|
|
41
|
-
return html`
|
|
42
|
-
<div id="container">
|
|
43
|
-
<div id="main">
|
|
44
|
-
<slot name="grid"></slot>
|
|
45
|
-
|
|
46
|
-
<div id="toolbar" part="toolbar">
|
|
47
|
-
<slot name="toolbar"></slot>
|
|
48
|
-
<slot name="new-button"></slot>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
<div
|
|
53
|
-
part="editor"
|
|
54
|
-
id="editor"
|
|
55
|
-
role="group"
|
|
56
|
-
aria-labelledby="header"
|
|
57
|
-
?hidden="${this.__computeEditorHidden(this.editorOpened, this._fullscreen, this.editorPosition)}"
|
|
58
|
-
>
|
|
59
|
-
<div part="scroller" id="scroller">
|
|
60
|
-
<div part="header" id="header">
|
|
61
|
-
<slot name="header"></slot>
|
|
62
|
-
</div>
|
|
63
|
-
<slot name="form"></slot>
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<div part="footer" role="toolbar">
|
|
67
|
-
<slot name="save-button"></slot>
|
|
68
|
-
<slot name="cancel-button"></slot>
|
|
69
|
-
<slot name="delete-button"></slot>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<vaadin-crud-dialog
|
|
75
|
-
id="dialog"
|
|
76
|
-
.opened="${this.__computeDialogOpened(this.editorOpened, this._fullscreen, this.editorPosition)}"
|
|
77
|
-
.fullscreen="${this._fullscreen}"
|
|
78
|
-
.ariaLabel="${this.__dialogAriaLabel}"
|
|
79
|
-
.noCloseOnOutsideClick="${this.__isDirty}"
|
|
80
|
-
.noCloseOnEsc="${this.__isDirty}"
|
|
81
|
-
theme="${ifDefined(this._theme)}"
|
|
82
|
-
@opened-changed="${this.__onDialogOpened}"
|
|
83
|
-
></vaadin-crud-dialog>
|
|
84
|
-
|
|
85
|
-
<vaadin-confirm-dialog
|
|
86
|
-
theme="${ifDefined(this._theme)}"
|
|
87
|
-
id="confirmCancel"
|
|
88
|
-
@confirm="${this.__confirmCancel}"
|
|
89
|
-
cancel-button-visible
|
|
90
|
-
.confirmText="${this.__effectiveI18n.confirm.cancel.button.confirm}"
|
|
91
|
-
.cancelText="${this.__effectiveI18n.confirm.cancel.button.dismiss}"
|
|
92
|
-
.header="${this.__effectiveI18n.confirm.cancel.title}"
|
|
93
|
-
.message="${this.__effectiveI18n.confirm.cancel.content}"
|
|
94
|
-
confirm-theme="primary"
|
|
95
|
-
></vaadin-confirm-dialog>
|
|
96
|
-
|
|
97
|
-
<vaadin-confirm-dialog
|
|
98
|
-
theme="${ifDefined(this._theme)}"
|
|
99
|
-
id="confirmDelete"
|
|
100
|
-
@confirm="${this.__confirmDelete}"
|
|
101
|
-
cancel-button-visible
|
|
102
|
-
.confirmText="${this.__effectiveI18n.confirm.delete.button.confirm}"
|
|
103
|
-
.cancelText="${this.__effectiveI18n.confirm.delete.button.dismiss}"
|
|
104
|
-
.header="${this.__effectiveI18n.confirm.delete.title}"
|
|
105
|
-
.message="${this.__effectiveI18n.confirm.delete.content}"
|
|
106
|
-
confirm-theme="primary error"
|
|
107
|
-
></vaadin-confirm-dialog>
|
|
108
|
-
`;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
static get is() {
|
|
112
|
-
return 'vaadin-crud';
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
static get cvdlName() {
|
|
116
|
-
return 'vaadin-crud';
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
defineCustomElement(Crud);
|
|
121
|
-
|
|
122
|
-
export { Crud };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import '@vaadin/button/theme/lumo/vaadin-lit-button.js';
|
|
2
|
-
import '@vaadin/confirm-dialog/theme/lumo/vaadin-lit-confirm-dialog.js';
|
|
3
|
-
import '@vaadin/form-layout/theme/lumo/vaadin-lit-form-layout.js';
|
|
4
|
-
import '@vaadin/grid/theme/lumo/vaadin-lit-grid.js';
|
|
5
|
-
import '@vaadin/grid/theme/lumo/vaadin-lit-grid-sorter.js';
|
|
6
|
-
import '@vaadin/text-field/theme/lumo/vaadin-lit-text-field.js';
|
|
7
|
-
import './vaadin-crud-styles.js';
|
|
8
|
-
import '../../src/vaadin-lit-crud.js';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import '@vaadin/button/theme/lumo/vaadin-lit-button.js';
|
|
2
|
-
import '@vaadin/confirm-dialog/theme/lumo/vaadin-lit-confirm-dialog.js';
|
|
3
|
-
import '@vaadin/form-layout/theme/lumo/vaadin-lit-form-layout.js';
|
|
4
|
-
import '@vaadin/grid/theme/lumo/vaadin-lit-grid.js';
|
|
5
|
-
import '@vaadin/grid/theme/lumo/vaadin-lit-grid-sorter.js';
|
|
6
|
-
import '@vaadin/text-field/theme/lumo/vaadin-lit-text-field.js';
|
|
7
|
-
import './vaadin-crud-styles.js';
|
|
8
|
-
import '../../src/vaadin-lit-crud.js';
|