@vaadin/dashboard 24.7.0-alpha4 → 24.7.0-alpha5

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/dashboard",
3
- "version": "24.7.0-alpha4",
3
+ "version": "24.7.0-alpha5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,15 +37,15 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/button": "24.7.0-alpha4",
41
- "@vaadin/component-base": "24.7.0-alpha4",
42
- "@vaadin/vaadin-lumo-styles": "24.7.0-alpha4",
43
- "@vaadin/vaadin-material-styles": "24.7.0-alpha4",
44
- "@vaadin/vaadin-themable-mixin": "24.7.0-alpha4",
40
+ "@vaadin/button": "24.7.0-alpha5",
41
+ "@vaadin/component-base": "24.7.0-alpha5",
42
+ "@vaadin/vaadin-lumo-styles": "24.7.0-alpha5",
43
+ "@vaadin/vaadin-material-styles": "24.7.0-alpha5",
44
+ "@vaadin/vaadin-themable-mixin": "24.7.0-alpha5",
45
45
  "lit": "^3.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@vaadin/chai-plugins": "24.7.0-alpha4",
48
+ "@vaadin/chai-plugins": "24.7.0-alpha5",
49
49
  "@vaadin/testing-helpers": "^1.1.0"
50
50
  },
51
51
  "cvdlName": "vaadin-dashboard",
@@ -53,5 +53,5 @@
53
53
  "web-types.json",
54
54
  "web-types.lit.json"
55
55
  ],
56
- "gitHead": "d7165cebf9dcf6a7e9e22f6353662d33404b4856"
56
+ "gitHead": "f9fa2bd652780a344d5e0329b8aafbcbd72ebd14"
57
57
  }
@@ -64,9 +64,9 @@ const section = css`
64
64
  }
65
65
 
66
66
  :host([dragging]) {
67
- background: var(--vaadin-dashboard-drop-target-background-color);
68
- outline: var(--vaadin-dashboard-drop-target-border);
69
- box-shadow: 0 0 0 var(--_section-outline-offset) var(--vaadin-dashboard-drop-target-background-color);
67
+ background: var(--_vaadin-dashboard-drop-target-background-color);
68
+ outline: var(--_vaadin-dashboard-drop-target-border);
69
+ box-shadow: 0 0 0 var(--_section-outline-offset) var(--_vaadin-dashboard-drop-target-background-color);
70
70
  }
71
71
 
72
72
  /* Accessible move mode controls */
@@ -4,32 +4,37 @@ import '@vaadin/vaadin-lumo-styles/spacing.js';
4
4
  import '@vaadin/vaadin-lumo-styles/style.js';
5
5
  import '@vaadin/vaadin-lumo-styles/typography.js';
6
6
  import '@vaadin/vaadin-lumo-styles/font-icons.js';
7
- import { addGlobalThemeStyles } from '@vaadin/vaadin-themable-mixin/register-styles';
8
7
  import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
8
 
10
- /* Global styles */
11
- const dashboardWidgetProps = css`
12
- html {
13
- --vaadin-dashboard-widget-background: var(--lumo-base-color);
14
- --vaadin-dashboard-widget-border-radius: var(--lumo-border-radius-l);
15
- --vaadin-dashboard-widget-border-width: 1px;
16
- --vaadin-dashboard-widget-border-color: var(--lumo-contrast-20pct);
17
- --vaadin-dashboard-widget-shadow: 0 0 0 0 transparent;
18
- --vaadin-dashboard-widget-editable-shadow: var(--lumo-box-shadow-s);
19
- --vaadin-dashboard-widget-selected-shadow: 0 2px 4px -1px var(--lumo-primary-color-10pct),
20
- 0 3px 12px -1px var(--lumo-primary-color-50pct);
21
- --vaadin-dashboard-drop-target-background-color: var(--lumo-primary-color-10pct);
22
- --vaadin-dashboard-drop-target-border: 1px dashed var(--lumo-primary-color-50pct);
23
- }
24
- `;
25
- addGlobalThemeStyles('dashboard-widget-props', dashboardWidgetProps);
26
-
27
9
  /* Styles shared between widgets and sections */
28
10
  const dashboardWidgetAndSection = css`
29
11
  /* stylelint-disable rule-empty-line-before */
30
12
  /* stylelint-disable length-zero-no-unit */
31
13
 
32
14
  :host {
15
+ --_vaadin-dashboard-widget-background: var(--vaadin-dashboard-widget-background, var(--lumo-base-color));
16
+ --_vaadin-dashboard-widget-border-radius: var(--vaadin-dashboard-widget-border-radius, var(--lumo-border-radius-l));
17
+ --_vaadin-dashboard-widget-border-width: var(--vaadin-dashboard-widget-border-width, 1px);
18
+ --_vaadin-dashboard-widget-border-color: var(--vaadin-dashboard-widget-border-color, var(--lumo-contrast-20pct));
19
+ --_vaadin-dashboard-widget-shadow: var(--vaadin-dashboard-widget-shadow, 0 0 0 0 transparent);
20
+ --_vaadin-dashboard-widget-editable-shadow: var(
21
+ --vaadin-dashboard-widget-editable-shadow,
22
+ var(--lumo-box-shadow-s)
23
+ );
24
+ --_vaadin-dashboard-widget-selected-shadow: var(
25
+ --vaadin-dashboard-widget-selected-shadow,
26
+ 0 2px 4px -1px var(--lumo-primary-color-10pct),
27
+ 0 3px 12px -1px var(--lumo-primary-color-50pct)
28
+ );
29
+ --_vaadin-dashboard-drop-target-background-color: var(
30
+ --vaadin-dashboard-drop-target-background-color,
31
+ var(--lumo-primary-color-10pct)
32
+ );
33
+ --_vaadin-dashboard-drop-target-border: var(
34
+ --vaadin-dashboard-drop-target-border,
35
+ 1px dashed var(--lumo-primary-color-50pct)
36
+ );
37
+
33
38
  color: var(--lumo-body-text-color);
34
39
  font-family: var(--lumo-font-family);
35
40
  font-size: var(--lumo-font-size-m);
@@ -137,17 +142,17 @@ const dashboardWidgetAndSection = css`
137
142
  /* Widget styles */
138
143
  const dashboardWidget = css`
139
144
  :host {
140
- background: var(--vaadin-dashboard-widget-background);
141
- border-radius: var(--vaadin-dashboard-widget-border-radius);
142
- --_border-shadow: 0 0 0 var(--vaadin-dashboard-widget-border-width) var(--vaadin-dashboard-widget-border-color);
143
- --_shadow: var(--vaadin-dashboard-widget-shadow);
145
+ background: var(--_vaadin-dashboard-widget-background);
146
+ border-radius: var(--_vaadin-dashboard-widget-border-radius);
147
+ --_border-shadow: 0 0 0 var(--_vaadin-dashboard-widget-border-width) var(--_vaadin-dashboard-widget-border-color);
148
+ --_shadow: var(--_vaadin-dashboard-widget-shadow);
144
149
  box-shadow: var(--_shadow), var(--_border-shadow);
145
150
  }
146
151
 
147
152
  /* Widget states */
148
153
 
149
154
  :host([editable]) {
150
- --_shadow: var(--vaadin-dashboard-widget-editable-shadow);
155
+ --_shadow: var(--_vaadin-dashboard-widget-editable-shadow);
151
156
  }
152
157
 
153
158
  :host([focused]) {
@@ -155,19 +160,19 @@ const dashboardWidget = css`
155
160
  }
156
161
 
157
162
  :host([selected]) {
158
- --_shadow: var(--vaadin-dashboard-widget-selected-shadow);
163
+ --_shadow: var(--_vaadin-dashboard-widget-selected-shadow);
159
164
  background: var(--lumo-primary-color-10pct);
160
165
  }
161
166
 
162
167
  :host([dragging]) {
163
168
  box-shadow: none;
164
- background: var(--vaadin-dashboard-drop-target-background-color);
165
- border: var(--vaadin-dashboard-drop-target-border);
169
+ background: var(--_vaadin-dashboard-drop-target-background-color);
170
+ border: var(--_vaadin-dashboard-drop-target-border);
166
171
  }
167
172
 
168
173
  :host([resizing])::after {
169
- background: var(--vaadin-dashboard-drop-target-background-color);
170
- border: var(--vaadin-dashboard-drop-target-border);
174
+ background: var(--_vaadin-dashboard-drop-target-background-color);
175
+ border: var(--_vaadin-dashboard-drop-target-border);
171
176
  }
172
177
 
173
178
  /* Widget parts */
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/dashboard",
4
- "version": "24.7.0-alpha4",
4
+ "version": "24.7.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -136,7 +136,7 @@
136
136
  },
137
137
  {
138
138
  "name": "vaadin-dashboard",
139
- "description": "A responsive, grid-based dashboard layout component\n\n### Quick Start\n\nAssign an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha4/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha4/#/elements/vaadin-dashboard#property-renderer) property.\n\nThe widgets and the sections will be generated and configured based on the renderer and the items provided.\n\n```html\n<vaadin-dashboard></vaadin-dashboard>\n```\n```js\nconst dashboard = document.querySelector('vaadin-dashboard');\n\ndashboard.items = [\n { title: 'Widget 1 title', content: 'Text 1', rowspan: 2 },\n { title: 'Widget 2 title', content: 'Text 2', colspan: 2 },\n {\n title: 'Section title',\n items: [{ title: 'Widget in section title', content: 'Text 3' }]\n },\n // ... more items\n];\n\ndashboard.renderer = (root, _dashboard, { item }) => {\n const widget = root.firstElementChild || document.createElement('vaadin-dashboard-widget');\n if (!root.contains(widget)) {\n root.appendChild(widget);\n }\n widget.widgetTitle = item.title;\n widget.textContent = item.content;\n};\n```\n\n### Styling\n\nThe following custom properties are available:\n\nCustom Property | Description\n------------------------------------|-------------\n`--vaadin-dashboard-col-min-width` | minimum column width of the dashboard\n`--vaadin-dashboard-col-max-width` | maximum column width of the dashboard\n`--vaadin-dashboard-row-min-height` | minimum row height of the dashboard\n`--vaadin-dashboard-col-max-count` | maximum column count of the dashboard\n`--vaadin-dashboard-gap` | gap between child elements. Must be in length units (0 is not allowed, 0px is)\n`--vaadin-dashboard-padding` | space around the dashboard's outer edges. Must be in length units (0 is not allowed, 0px is)\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------|-------------\n`editable` | Set when the dashboard is editable.\n`dense-layout` | Set when the dashboard is in dense mode.\n`item-selected`| Set when an item is selected.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
139
+ "description": "A responsive, grid-based dashboard layout component\n\n### Quick Start\n\nAssign an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha5/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha5/#/elements/vaadin-dashboard#property-renderer) property.\n\nThe widgets and the sections will be generated and configured based on the renderer and the items provided.\n\n```html\n<vaadin-dashboard></vaadin-dashboard>\n```\n```js\nconst dashboard = document.querySelector('vaadin-dashboard');\n\ndashboard.items = [\n { title: 'Widget 1 title', content: 'Text 1', rowspan: 2 },\n { title: 'Widget 2 title', content: 'Text 2', colspan: 2 },\n {\n title: 'Section title',\n items: [{ title: 'Widget in section title', content: 'Text 3' }]\n },\n // ... more items\n];\n\ndashboard.renderer = (root, _dashboard, { item }) => {\n const widget = root.firstElementChild || document.createElement('vaadin-dashboard-widget');\n if (!root.contains(widget)) {\n root.appendChild(widget);\n }\n widget.widgetTitle = item.title;\n widget.textContent = item.content;\n};\n```\n\n### Styling\n\nThe following custom properties are available:\n\nCustom Property | Description\n------------------------------------|-------------\n`--vaadin-dashboard-col-min-width` | minimum column width of the dashboard\n`--vaadin-dashboard-col-max-width` | maximum column width of the dashboard\n`--vaadin-dashboard-row-min-height` | minimum row height of the dashboard\n`--vaadin-dashboard-col-max-count` | maximum column count of the dashboard\n`--vaadin-dashboard-gap` | gap between child elements. Must be in length units (0 is not allowed, 0px is)\n`--vaadin-dashboard-padding` | space around the dashboard's outer edges. Must be in length units (0 is not allowed, 0px is)\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------|-------------\n`editable` | Set when the dashboard is editable.\n`dense-layout` | Set when the dashboard is in dense mode.\n`item-selected`| Set when an item is selected.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
140
140
  "attributes": [
141
141
  {
142
142
  "name": "dense-layout",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/dashboard",
4
- "version": "24.7.0-alpha4",
4
+ "version": "24.7.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -58,7 +58,7 @@
58
58
  },
59
59
  {
60
60
  "name": "vaadin-dashboard",
61
- "description": "A responsive, grid-based dashboard layout component\n\n### Quick Start\n\nAssign an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha4/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha4/#/elements/vaadin-dashboard#property-renderer) property.\n\nThe widgets and the sections will be generated and configured based on the renderer and the items provided.\n\n```html\n<vaadin-dashboard></vaadin-dashboard>\n```\n```js\nconst dashboard = document.querySelector('vaadin-dashboard');\n\ndashboard.items = [\n { title: 'Widget 1 title', content: 'Text 1', rowspan: 2 },\n { title: 'Widget 2 title', content: 'Text 2', colspan: 2 },\n {\n title: 'Section title',\n items: [{ title: 'Widget in section title', content: 'Text 3' }]\n },\n // ... more items\n];\n\ndashboard.renderer = (root, _dashboard, { item }) => {\n const widget = root.firstElementChild || document.createElement('vaadin-dashboard-widget');\n if (!root.contains(widget)) {\n root.appendChild(widget);\n }\n widget.widgetTitle = item.title;\n widget.textContent = item.content;\n};\n```\n\n### Styling\n\nThe following custom properties are available:\n\nCustom Property | Description\n------------------------------------|-------------\n`--vaadin-dashboard-col-min-width` | minimum column width of the dashboard\n`--vaadin-dashboard-col-max-width` | maximum column width of the dashboard\n`--vaadin-dashboard-row-min-height` | minimum row height of the dashboard\n`--vaadin-dashboard-col-max-count` | maximum column count of the dashboard\n`--vaadin-dashboard-gap` | gap between child elements. Must be in length units (0 is not allowed, 0px is)\n`--vaadin-dashboard-padding` | space around the dashboard's outer edges. Must be in length units (0 is not allowed, 0px is)\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------|-------------\n`editable` | Set when the dashboard is editable.\n`dense-layout` | Set when the dashboard is in dense mode.\n`item-selected`| Set when an item is selected.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
61
+ "description": "A responsive, grid-based dashboard layout component\n\n### Quick Start\n\nAssign an array to the [`items`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha5/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/24.7.0-alpha5/#/elements/vaadin-dashboard#property-renderer) property.\n\nThe widgets and the sections will be generated and configured based on the renderer and the items provided.\n\n```html\n<vaadin-dashboard></vaadin-dashboard>\n```\n```js\nconst dashboard = document.querySelector('vaadin-dashboard');\n\ndashboard.items = [\n { title: 'Widget 1 title', content: 'Text 1', rowspan: 2 },\n { title: 'Widget 2 title', content: 'Text 2', colspan: 2 },\n {\n title: 'Section title',\n items: [{ title: 'Widget in section title', content: 'Text 3' }]\n },\n // ... more items\n];\n\ndashboard.renderer = (root, _dashboard, { item }) => {\n const widget = root.firstElementChild || document.createElement('vaadin-dashboard-widget');\n if (!root.contains(widget)) {\n root.appendChild(widget);\n }\n widget.widgetTitle = item.title;\n widget.textContent = item.content;\n};\n```\n\n### Styling\n\nThe following custom properties are available:\n\nCustom Property | Description\n------------------------------------|-------------\n`--vaadin-dashboard-col-min-width` | minimum column width of the dashboard\n`--vaadin-dashboard-col-max-width` | maximum column width of the dashboard\n`--vaadin-dashboard-row-min-height` | minimum row height of the dashboard\n`--vaadin-dashboard-col-max-count` | maximum column count of the dashboard\n`--vaadin-dashboard-gap` | gap between child elements. Must be in length units (0 is not allowed, 0px is)\n`--vaadin-dashboard-padding` | space around the dashboard's outer edges. Must be in length units (0 is not allowed, 0px is)\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------|-------------\n`editable` | Set when the dashboard is editable.\n`dense-layout` | Set when the dashboard is in dense mode.\n`item-selected`| Set when an item is selected.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
62
62
  "extension": true,
63
63
  "attributes": [
64
64
  {