@vaadin/crud 25.0.0-alpha8 → 25.0.0-beta1
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 +16 -17
- package/src/styles/vaadin-crud-base-styles.js +171 -0
- package/src/styles/vaadin-crud-dialog-overlay-base-styles.js +50 -0
- package/src/styles/vaadin-crud-edit-base-styles.js +28 -0
- package/src/styles/vaadin-crud-grid-base-styles.d.ts +13 -0
- package/src/styles/vaadin-crud-grid-base-styles.js +21 -0
- package/src/vaadin-crud-controllers.js +1 -1
- package/src/vaadin-crud-dialog.js +50 -14
- package/src/vaadin-crud-edit-column.js +4 -4
- package/src/vaadin-crud-edit.js +4 -11
- package/src/vaadin-crud-grid.js +5 -0
- package/src/vaadin-crud-mixin.d.ts +1 -1
- package/src/vaadin-crud-mixin.js +57 -80
- package/src/vaadin-crud.d.ts +17 -2
- package/src/vaadin-crud.js +65 -33
- package/vaadin-crud.js +1 -1
- package/web-types.json +42 -17
- package/web-types.lit.json +20 -13
- package/src/styles/vaadin-crud-core-styles.js +0 -93
- package/src/styles/vaadin-crud-dialog-overlay-core-styles.js +0 -54
- package/theme/lumo/vaadin-crud-styles.d.ts +0 -4
- package/theme/lumo/vaadin-crud-styles.js +0 -155
- package/theme/lumo/vaadin-crud.d.ts +0 -8
- package/theme/lumo/vaadin-crud.js +0 -8
- /package/src/styles/{vaadin-crud-core-styles.d.ts → vaadin-crud-base-styles.d.ts} +0 -0
- /package/src/styles/{vaadin-crud-dialog-overlay-core-styles.d.ts → vaadin-crud-dialog-overlay-base-styles.d.ts} +0 -0
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/crud",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-beta1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -19,6 +19,13 @@
|
|
|
19
19
|
"description": "`<vaadin-crud-edit>` is a helper element for `<vaadin-grid-column>` that provides\nan easily themable button that fires an `edit` event with the row item as detail\nwhen clicked.\n\nTypical usage is in a `<vaadin-grid-column>` of a custom `<vaadin-grid>` inside\na `<vaadin-crud>` to enable editing.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
|
+
{
|
|
23
|
+
"name": "?disabled",
|
|
24
|
+
"description": "When disabled, the button is rendered as \"dimmed\" and prevents all\nuser interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n```js\n// Set before any button is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true\n```",
|
|
25
|
+
"value": {
|
|
26
|
+
"kind": "expression"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
22
29
|
{
|
|
23
30
|
"name": "@edit",
|
|
24
31
|
"description": "Fired when user on the icon.",
|
|
@@ -68,13 +75,6 @@
|
|
|
68
75
|
"kind": "expression"
|
|
69
76
|
}
|
|
70
77
|
},
|
|
71
|
-
{
|
|
72
|
-
"name": "?autoWidth",
|
|
73
|
-
"description": "Automatically sets the width of the column based on the column contents when this is set to `true`.\n\nFor performance reasons the column width is calculated automatically only once when the grid items\nare rendered for the first time and the calculation only considers the rows which are currently\nrendered in DOM (a bit more than what is currently visible). If the grid is scrolled, or the cell\ncontent changes, the column width might not match the contents anymore.\n\nHidden columns are ignored in the calculation and their widths are not automatically updated when\nyou show a column that was initially hidden.\n\nYou can manually trigger the auto sizing behavior again by calling `grid.recalculateColumnWidths()`.\n\nThe column width may still grow larger when `flexGrow` is not 0.",
|
|
74
|
-
"value": {
|
|
75
|
-
"kind": "expression"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
78
|
{
|
|
79
79
|
"name": ".header",
|
|
80
80
|
"description": "Text content to display in the header cell of the column.",
|
|
@@ -117,9 +117,16 @@
|
|
|
117
117
|
"kind": "expression"
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
|
+
{
|
|
121
|
+
"name": ".width",
|
|
122
|
+
"description": "Width of the cells for this column.\n\nPlease note that using the `em` length unit is discouraged as\nit might lead to misalignment issues if the header, body, and footer\ncells have different font sizes. Instead, use `rem` if you need\na length unit relative to the font size.",
|
|
123
|
+
"value": {
|
|
124
|
+
"kind": "expression"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
120
127
|
{
|
|
121
128
|
"name": ".renderer",
|
|
122
|
-
"description": "Custom function for rendering the cell content.\nReceives three arguments:\n\n- `root` The cell content DOM element. Append your content to it.\n- `column` The `<vaadin-grid-column>` element.\n- `model` The object with the properties related with\n the rendered item, contains:\n - `model.index` The index of the item.\n - `model.item` The item.\n - `model.expanded` Sublevel toggle state.\n - `model.level` Level of the tree represented with a horizontal offset of the toggle button.\n - `model.selected` Selected state.\n - `model.detailsOpened` Details opened state.",
|
|
129
|
+
"description": "Custom function for rendering the cell content.\nReceives three arguments:\n\n- `root` The cell content DOM element. Append your content to it.\n- `column` The `<vaadin-grid-column>` element.\n- `model` The object with the properties related with\n the rendered item, contains:\n - `model.index` The index of the item.\n - `model.item` The item.\n - `model.expanded` Sublevel toggle state.\n - `model.level` Level of the tree represented with a horizontal offset of the toggle button.\n - `model.selected` Selected state.\n - `model.detailsOpened` Details opened state.\n - `model.hasChildren` Whether the item has children.",
|
|
123
130
|
"value": {
|
|
124
131
|
"kind": "expression"
|
|
125
132
|
}
|
|
@@ -142,7 +149,7 @@
|
|
|
142
149
|
},
|
|
143
150
|
{
|
|
144
151
|
"name": "vaadin-crud",
|
|
145
|
-
"description": "`<vaadin-crud>` is a Web Component for [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations.\n\n### Quick Start\n\nAssign an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
152
|
+
"description": "`<vaadin-crud>` is a Web Component for [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations.\n\n### Quick Start\n\nAssign an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta1/#/elements/vaadin-crud#property-items) property.\n\nA grid and an editor will be automatically generated and configured based on the data structure provided.\n\n```html\n<vaadin-crud></vaadin-crud>\n```\n```js\nconst crud = document.querySelector('vaadin-crud');\n\ncrud.items = [\n { name: 'John', surname: 'Lennon', role: 'singer' },\n { name: 'Ringo', surname: 'Starr', role: 'drums' },\n // ... more items\n];\n```\n\n### Data Provider Function\n\nOtherwise, you can provide a [`dataProvider`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta1/#/elements/vaadin-crud#property-dataProvider) function.\n\n```js\nconst crud = document.querySelector('vaadin-crud');\n\nconst users = [\n { name: 'John', surname: 'Lennon', role: 'singer' },\n { name: 'Ringo', surname: 'Starr', role: 'drums' },\n // ... more items\n];\n\ncrud.dataProvider = (params, callback) => {\n const chunk = users.slice(params.page * params.pageSize, params.page * params.pageSize + params.pageSize);\n callback(chunk, people.length);\n};\n```\n\nNOTE: The auto-generated editor only supports string types. If you need to handle special cases\ncustomizing the editor is discussed below.\n\n### Customization\n\nAlternatively you can fully configure the component by using `slot` names.\n\nSlot name | Description\n---------------|----------------\n`grid` | To replace the auto-generated grid with a custom one.\n`form` | To replace the auto-generated form.\n`save-button` | To replace the \"Save\" button.\n`cancel-button`| To replace the \"Cancel\" button.\n`delete-button`| To replace the \"Delete\" button.\n`toolbar` | To provide the toolbar content (by default, it's empty).\n`new-button` | To replace the \"New item\" button.\n\n#### Example:\n\n```html\n<vaadin-crud id=\"crud\">\n <vaadin-grid slot=\"grid\">\n <vaadin-crud-edit-column></vaadin-crud-edit-column>\n <vaadin-grid-column id=\"column1\"></vaadin-grid-column>\n <vaadin-grid-column id=\"column2\"></vaadin-grid-column>\n </vaadin-grid>\n\n <vaadin-form-layout slot=\"form\">\n <vaadin-text-field label=\"First\" path=\"name\"></vaadin-text-field>\n <vaadin-text-field label=\"Surname\" path=\"surname\"></vaadin-text-field>\n </vaadin-form-layout>\n\n <div slot=\"toolbar\">Total singers: 2</div>\n <button slot=\"new-button\">New singer</button>\n\n <button slot=\"save-button\">Save changes</button>\n <button slot=\"cancel-button\">Discard changes</button>\n <button slot=\"delete-button\">Delete singer</button>\n</vaadin-crud>\n```\n```js\nconst crud = document.querySelector('#crud');\n\nconst column1 = document.querySelector('#column1');\ncolumn1.headerRenderer = (root, column) => {\n root.textContent = 'Name';\n};\ncolumn1.renderer = (root, column, model) => {\n root.textContent = model.item.name;\n};\n\nconst column2 = document.querySelector('#column2');\ncolumn2.headerRenderer = (root, column) => {\n root.textContent = 'Surname';\n};\ncolumn2.renderer = (root, column, model) => {\n root.textContent = model.item.surname;\n};\n\ncrud.items = [\n { name: 'John', surname: 'Lennon', role: 'singer' },\n { name: 'Ringo', surname: 'Starr', role: 'drums' },\n // ... more items\n];\n```\n\n### Helpers\n\nThe following elements are used to auto-configure the grid and the editor\n- [`<vaadin-crud-edit-column>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta1/#/elements/vaadin-crud-edit-column)\n- `<vaadin-crud-grid>` - can be replaced with custom [`<vaadin-grid>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta1/#/elements/vaadin-grid)\n- `<vaadin-crud-form>` - can be replaced with custom [`<vaadin-form-layout>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta1/#/elements/vaadin-form-layout)\n\n### Styling\n\nThe following shadow DOM parts are available for styling when the editor is rendered next to, or below, the grid:\n\nPart name | Description\n----------------|----------------\n`toolbar` | Toolbar container at the bottom of the grid. By default, it contains the `new` button\n`editor` | The editor container\n`scroller` | The wrapper for the header and the form\n`header` | The header of the editor\n`footer` | The footer of the editor\n\nThe following shadow DOM parts are available for styling when the editor renders as a dialog:\n\nPart name | Description\n----------------|----------------\n`toolbar` | Toolbar container at the bottom of the grid. By default, it contains the `new` button\n`overlay` | The dialog overlay\n`backdrop` | The dialog backdrop\n`header` | The header of the dialog\n`footer` | The footer of the dialog\n`content` | The wrapper for the form\n\nThe following custom properties are available:\n\nCustom Property | Description | Default\n----------------|----------------\n--vaadin-crud-editor-max-height | max height of editor when opened on the bottom | 40%\n--vaadin-crud-editor-max-width | max width of editor when opened on the side | 40%\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
146
153
|
"extension": true,
|
|
147
154
|
"attributes": [
|
|
148
155
|
{
|
|
@@ -189,7 +196,7 @@
|
|
|
189
196
|
},
|
|
190
197
|
{
|
|
191
198
|
"name": ".i18n",
|
|
192
|
-
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n\n
|
|
199
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n\n```js\n{\n newItem: 'New item',\n editItem: 'Edit item',\n saveItem: 'Save',\n cancel: 'Cancel',\n deleteItem: 'Delete...',\n editLabel: 'Edit',\n confirm: {\n delete: {\n title: 'Confirm delete',\n content: 'Are you sure you want to delete the selected item? This action cannot be undone.',\n button: {\n confirm: 'Delete',\n dismiss: 'Cancel'\n }\n },\n cancel: {\n title: 'Unsaved changes',\n content: 'There are unsaved modifications to the item.',\n button: {\n confirm: 'Discard',\n dismiss: 'Continue editing'\n }\n }\n }\n}\n```",
|
|
193
200
|
"value": {
|
|
194
201
|
"kind": "expression"
|
|
195
202
|
}
|
|
@@ -224,14 +231,14 @@
|
|
|
224
231
|
},
|
|
225
232
|
{
|
|
226
233
|
"name": ".include",
|
|
227
|
-
"description": "A comma-separated list of fields to include in the generated grid and the generated editor.\n\nIt can be used to explicitly define the field order.\n\nWhen it is defined [`exclude`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
234
|
+
"description": "A comma-separated list of fields to include in the generated grid and the generated editor.\n\nIt can be used to explicitly define the field order.\n\nWhen it is defined [`exclude`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta1/#/elements/vaadin-crud#property-exclude) is ignored.\n\nDefault is undefined meaning that all properties in the object should be mapped to fields.",
|
|
228
235
|
"value": {
|
|
229
236
|
"kind": "expression"
|
|
230
237
|
}
|
|
231
238
|
},
|
|
232
239
|
{
|
|
233
240
|
"name": ".exclude",
|
|
234
|
-
"description": "A comma-separated list of fields to be excluded from the generated grid and the generated editor.\n\nWhen [`include`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
241
|
+
"description": "A comma-separated list of fields to be excluded from the generated grid and the generated editor.\n\nWhen [`include`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta1/#/elements/vaadin-crud#property-include) is defined, this parameter is ignored.\n\nDefault is to exclude all private fields (those properties starting with underscore)",
|
|
235
242
|
"value": {
|
|
236
243
|
"kind": "expression"
|
|
237
244
|
}
|
|
@@ -1,93 +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 } from 'lit';
|
|
12
|
-
|
|
13
|
-
export const crudStyles = css`
|
|
14
|
-
:host {
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 400px;
|
|
17
|
-
--vaadin-crud-editor-max-height: 40%;
|
|
18
|
-
--vaadin-crud-editor-max-width: 40%;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:host,
|
|
22
|
-
#main {
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
align-self: stretch;
|
|
26
|
-
position: relative;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
#main {
|
|
31
|
-
flex: 1 1 100%;
|
|
32
|
-
height: 100%;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
:host([hidden]),
|
|
36
|
-
[hidden] {
|
|
37
|
-
display: none !important;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[part='toolbar'] {
|
|
41
|
-
display: flex;
|
|
42
|
-
flex-shrink: 0;
|
|
43
|
-
align-items: baseline;
|
|
44
|
-
justify-content: flex-end;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
:host([no-toolbar]) [part='toolbar'] {
|
|
48
|
-
display: none;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
#container {
|
|
52
|
-
display: flex;
|
|
53
|
-
height: 100%;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
:host([editor-position='bottom']) #container {
|
|
57
|
-
flex-direction: column;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
[part='editor'] {
|
|
61
|
-
z-index: 1;
|
|
62
|
-
display: flex;
|
|
63
|
-
flex-direction: column;
|
|
64
|
-
height: 100%;
|
|
65
|
-
outline: none;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
:host(:not([editor-position=''])[editor-opened]:not([fullscreen])) [part='editor'] {
|
|
69
|
-
flex: 1 0 100%;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
:host([editor-position='bottom'][editor-opened]:not([fullscreen])) [part='editor'] {
|
|
73
|
-
max-height: var(--vaadin-crud-editor-max-height);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
:host([editor-position='aside'][editor-opened]:not([fullscreen])) [part='editor'] {
|
|
77
|
-
min-width: 300px;
|
|
78
|
-
max-width: var(--vaadin-crud-editor-max-width);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
[part='scroller'] {
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
overflow: auto;
|
|
85
|
-
flex: auto;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
[part='footer'] {
|
|
89
|
-
display: flex;
|
|
90
|
-
flex: none;
|
|
91
|
-
flex-direction: row-reverse;
|
|
92
|
-
}
|
|
93
|
-
`;
|
|
@@ -1,54 +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 } from 'lit';
|
|
12
|
-
import { dialogOverlayBase } from '@vaadin/dialog/src/styles/vaadin-dialog-overlay-core-styles.js';
|
|
13
|
-
import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-core-styles.js';
|
|
14
|
-
|
|
15
|
-
const crudDialogOverlay = css`
|
|
16
|
-
[part='overlay'] {
|
|
17
|
-
max-width: 54em;
|
|
18
|
-
min-width: 20em;
|
|
19
|
-
display: flex;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.resizer-container {
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
flex-grow: 1;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
[part='footer'] {
|
|
29
|
-
justify-content: flex-start;
|
|
30
|
-
flex-direction: row-reverse;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* Make buttons clickable */
|
|
34
|
-
[part='footer'] ::slotted(:not([disabled])) {
|
|
35
|
-
pointer-events: all;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
:host([fullscreen]) {
|
|
39
|
-
inset: 0;
|
|
40
|
-
padding: 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:host([fullscreen]) [part='overlay'] {
|
|
44
|
-
height: 100vh;
|
|
45
|
-
width: 100vw;
|
|
46
|
-
border-radius: 0 !important;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:host([fullscreen]) [part='content'] {
|
|
50
|
-
flex: 1;
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
53
|
-
|
|
54
|
-
export const crudDialogOverlayStyles = [overlayStyles, dialogOverlayBase, crudDialogOverlay];
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
4
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
5
|
-
import { dialogOverlay } from '@vaadin/dialog/theme/lumo/vaadin-dialog-styles.js';
|
|
6
|
-
import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
|
|
7
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
|
-
|
|
9
|
-
registerStyles(
|
|
10
|
-
'vaadin-crud-edit',
|
|
11
|
-
css`
|
|
12
|
-
:host {
|
|
13
|
-
min-width: auto;
|
|
14
|
-
margin: 0;
|
|
15
|
-
font-family: 'lumo-icons', var(--lumo-font-family);
|
|
16
|
-
font-size: var(--lumo-icon-size-m);
|
|
17
|
-
line-height: 1;
|
|
18
|
-
position: relative;
|
|
19
|
-
width: var(--lumo-size-s);
|
|
20
|
-
height: var(--lumo-size-s);
|
|
21
|
-
outline: none;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
[part='icon']::before {
|
|
25
|
-
content: var(--lumo-icons-edit);
|
|
26
|
-
width: var(--lumo-size-m);
|
|
27
|
-
height: var(--lumo-size-m);
|
|
28
|
-
line-height: var(--lumo-size-m);
|
|
29
|
-
text-align: center;
|
|
30
|
-
position: absolute;
|
|
31
|
-
top: calc((var(--lumo-size-m) - var(--lumo-size-s)) / -2);
|
|
32
|
-
left: calc((var(--lumo-size-m) - var(--lumo-size-s)) / -2);
|
|
33
|
-
}
|
|
34
|
-
`,
|
|
35
|
-
{ moduleId: 'lumo-crud-grid-edit' },
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Shared styles used for the CRUD editor content and buttons regardless of `editorPosition`.
|
|
40
|
-
* They are applied to both `vaadin-crud` and `vaadin-crud-dialog-overlay` components.
|
|
41
|
-
*/
|
|
42
|
-
const editorStyles = css`
|
|
43
|
-
[part='header'] ::slotted(h3) {
|
|
44
|
-
margin-top: 0 !important;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
:host(:not([dir='rtl'])) ::slotted([slot='delete-button']) {
|
|
48
|
-
margin-right: auto;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
:host([dir='rtl']) ::slotted([slot='delete-button']) {
|
|
52
|
-
margin-left: auto;
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
|
|
56
|
-
registerStyles(
|
|
57
|
-
'vaadin-crud',
|
|
58
|
-
[
|
|
59
|
-
editorStyles,
|
|
60
|
-
css`
|
|
61
|
-
:host {
|
|
62
|
-
font-family: var(--lumo-font-family);
|
|
63
|
-
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
|
64
|
-
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
[part='scroller'] {
|
|
68
|
-
padding: var(--lumo-space-l);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
[part='toolbar'] {
|
|
72
|
-
padding: var(--lumo-space-s) var(--lumo-space-m);
|
|
73
|
-
background-color: var(--lumo-contrast-5pct);
|
|
74
|
-
border: 1px solid var(--lumo-contrast-10pct);
|
|
75
|
-
border-top: none;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
:host(:not([dir='rtl'])) [part='toolbar'] ::slotted(*:not(:first-child)) {
|
|
79
|
-
margin-left: var(--lumo-space-s);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
:host([dir='rtl']) [part='toolbar'] ::slotted(*:not(:first-child)) {
|
|
83
|
-
margin-right: var(--lumo-space-s);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
:host([theme~='no-border']) [part='toolbar'] {
|
|
87
|
-
border: 0;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
[part='footer'] {
|
|
91
|
-
background-color: var(--lumo-contrast-5pct);
|
|
92
|
-
padding: var(--lumo-space-s);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
[part='footer'] ::slotted(*) {
|
|
96
|
-
margin-left: var(--lumo-space-s);
|
|
97
|
-
margin-right: var(--lumo-space-s);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
[part='editor'] {
|
|
101
|
-
background: var(--lumo-base-color);
|
|
102
|
-
box-sizing: border-box;
|
|
103
|
-
position: relative;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
[part='editor']:focus::before {
|
|
107
|
-
position: absolute;
|
|
108
|
-
inset: 0;
|
|
109
|
-
content: '';
|
|
110
|
-
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
111
|
-
pointer-events: none;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
:host(:not([editor-position=''])) [part='editor']:not([hidden]) {
|
|
115
|
-
box-shadow: var(--lumo-box-shadow-m);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
:host(:not([theme~='no-border']):not([editor-position=''])) [part='editor']:not([hidden]) {
|
|
119
|
-
border: 1px solid var(--lumo-contrast-20pct);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
:host(:not([theme~='no-border'])[editor-position='bottom']) [part='editor']:not([hidden]) {
|
|
123
|
-
border-top: 0;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
:host(:not([dir='rtl'])[editor-position='aside']) [part='editor']:not([hidden]) {
|
|
127
|
-
border-left: 0;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
:host([dir='rtl']:not([theme~='no-border'])[editor-position='aside']) [part='editor']:not([hidden]) {
|
|
131
|
-
border-right: 0;
|
|
132
|
-
}
|
|
133
|
-
`,
|
|
134
|
-
],
|
|
135
|
-
{ moduleId: 'lumo-crud' },
|
|
136
|
-
);
|
|
137
|
-
|
|
138
|
-
registerStyles(
|
|
139
|
-
'vaadin-crud-dialog-overlay',
|
|
140
|
-
[
|
|
141
|
-
overlay,
|
|
142
|
-
dialogOverlay,
|
|
143
|
-
editorStyles,
|
|
144
|
-
css`
|
|
145
|
-
[part='header'] ::slotted(h3) {
|
|
146
|
-
margin-top: 0 !important;
|
|
147
|
-
margin-bottom: 0 !important;
|
|
148
|
-
margin-inline-start: var(--lumo-space-s);
|
|
149
|
-
}
|
|
150
|
-
`,
|
|
151
|
-
],
|
|
152
|
-
{
|
|
153
|
-
moduleId: 'lumo-crud-dialog-overlay',
|
|
154
|
-
},
|
|
155
|
-
);
|
|
@@ -1,8 +0,0 @@
|
|
|
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';
|
|
@@ -1,8 +0,0 @@
|
|
|
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';
|
|
File without changes
|
|
File without changes
|