@vaadin/dashboard 24.8.4 → 25.0.0-alpha10

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.
Files changed (42) hide show
  1. package/package.json +12 -10
  2. package/src/styles/vaadin-dashboard-base-styles.d.ts +13 -0
  3. package/src/styles/vaadin-dashboard-base-styles.js +25 -0
  4. package/src/styles/vaadin-dashboard-button-base-styles.d.ts +13 -0
  5. package/src/styles/vaadin-dashboard-button-base-styles.js +24 -0
  6. package/src/styles/vaadin-dashboard-button-core-styles.d.ts +13 -0
  7. package/src/styles/vaadin-dashboard-button-core-styles.js +20 -0
  8. package/src/styles/vaadin-dashboard-core-styles.d.ts +13 -0
  9. package/src/styles/vaadin-dashboard-core-styles.js +25 -0
  10. package/src/styles/vaadin-dashboard-layout-base-styles.d.ts +13 -0
  11. package/src/styles/vaadin-dashboard-layout-base-styles.js +85 -0
  12. package/src/styles/vaadin-dashboard-layout-core-styles.d.ts +13 -0
  13. package/src/styles/vaadin-dashboard-layout-core-styles.js +85 -0
  14. package/src/styles/vaadin-dashboard-section-base-styles.d.ts +13 -0
  15. package/src/styles/vaadin-dashboard-section-base-styles.js +64 -0
  16. package/src/styles/vaadin-dashboard-section-core-styles.d.ts +13 -0
  17. package/src/styles/vaadin-dashboard-section-core-styles.js +53 -0
  18. package/src/styles/vaadin-dashboard-widget-base-styles.d.ts +13 -0
  19. package/src/styles/vaadin-dashboard-widget-base-styles.js +109 -0
  20. package/src/styles/vaadin-dashboard-widget-core-styles.d.ts +13 -0
  21. package/src/styles/vaadin-dashboard-widget-core-styles.js +57 -0
  22. package/src/styles/vaadin-dashboard-widget-section-base-styles.js +297 -0
  23. package/src/{vaadin-dashboard-styles.js → styles/vaadin-dashboard-widget-section-core-styles.js} +1 -7
  24. package/src/vaadin-dashboard-button.js +4 -3
  25. package/src/vaadin-dashboard-item-mixin.js +0 -5
  26. package/src/vaadin-dashboard-layout-mixin.js +0 -78
  27. package/src/vaadin-dashboard-layout.js +9 -1
  28. package/src/vaadin-dashboard-section.js +7 -42
  29. package/src/vaadin-dashboard-widget.js +7 -46
  30. package/src/vaadin-dashboard.js +5 -13
  31. package/theme/lumo/vaadin-dashboard-section-styles.js +0 -6
  32. package/theme/lumo/vaadin-dashboard-widget-styles.js +16 -21
  33. package/web-types.json +2 -2
  34. package/web-types.lit.json +2 -2
  35. package/theme/material/vaadin-dashboard-layout.d.ts +0 -1
  36. package/theme/material/vaadin-dashboard-layout.js +0 -1
  37. package/theme/material/vaadin-dashboard-section.d.ts +0 -1
  38. package/theme/material/vaadin-dashboard-section.js +0 -1
  39. package/theme/material/vaadin-dashboard-widget.d.ts +0 -1
  40. package/theme/material/vaadin-dashboard-widget.js +0 -1
  41. package/theme/material/vaadin-dashboard.d.ts +0 -3
  42. package/theme/material/vaadin-dashboard.js +0 -3
@@ -15,7 +15,9 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
15
15
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
16
16
  import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
17
17
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
18
- import { css, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
18
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
19
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
20
+ import { dashboardStyles } from './styles/vaadin-dashboard-core-styles.js';
19
21
  import {
20
22
  getElementItem,
21
23
  getItemsArrayOfItem,
@@ -26,7 +28,6 @@ import {
26
28
  import { getDefaultI18n } from './vaadin-dashboard-item-mixin.js';
27
29
  import { DashboardLayoutMixin } from './vaadin-dashboard-layout-mixin.js';
28
30
  import { DashboardSection } from './vaadin-dashboard-section.js';
29
- import { hasWidgetWrappers } from './vaadin-dashboard-styles.js';
30
31
  import { WidgetReorderController } from './widget-reorder-controller.js';
31
32
  import { WidgetResizeController } from './widget-resize-controller.js';
32
33
 
@@ -105,7 +106,7 @@ import { WidgetResizeController } from './widget-resize-controller.js';
105
106
  * @mixes ThemableMixin
106
107
  */
107
108
  class Dashboard extends DashboardLayoutMixin(
108
- I18nMixin(getDefaultI18n(), ElementMixin(ThemableMixin(PolylitMixin(LitElement)))),
109
+ I18nMixin(getDefaultI18n(), ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))),
109
110
  ) {
110
111
  static get is() {
111
112
  return 'vaadin-dashboard';
@@ -116,16 +117,7 @@ class Dashboard extends DashboardLayoutMixin(
116
117
  }
117
118
 
118
119
  static get styles() {
119
- return [
120
- super.styles,
121
- css`
122
- #grid[item-resizing] {
123
- -webkit-user-select: none;
124
- user-select: none;
125
- }
126
- `,
127
- hasWidgetWrappers,
128
- ];
120
+ return dashboardStyles;
129
121
  }
130
122
 
131
123
  static get properties() {
@@ -66,12 +66,6 @@ const section = css`
66
66
  --_widget-filter: blur(10px);
67
67
  }
68
68
 
69
- :host([dragging]) {
70
- background: var(--_drop-target-background-color);
71
- outline: var(--_drop-target-border);
72
- box-shadow: 0 0 0 var(--_section-outline-offset) var(--_drop-target-background-color);
73
- }
74
-
75
69
  /* Accessible move mode controls */
76
70
 
77
71
  [part~='move-backward-button'] {
@@ -9,7 +9,6 @@ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themab
9
9
  /* Styles shared between widgets and sections */
10
10
  const dashboardWidgetAndSection = css`
11
11
  /* stylelint-disable rule-empty-line-before */
12
- /* stylelint-disable length-zero-no-unit */
13
12
 
14
13
  :host {
15
14
  --_widget-background: var(--vaadin-dashboard-widget-background, var(--lumo-base-color));
@@ -18,8 +17,8 @@ const dashboardWidgetAndSection = css`
18
17
  --_widget-border-color: var(--vaadin-dashboard-widget-border-color, var(--lumo-contrast-20pct));
19
18
  --_widget-shadow: var(--vaadin-dashboard-widget-shadow, 0 0 0 0 transparent);
20
19
  --_widget-editable-shadow: var(--lumo-box-shadow-s);
21
- --_widget-selected-shadow: 0 2px 4px -1px var(--lumo-primary-color-10pct),
22
- 0 3px 12px -1px var(--lumo-primary-color-50pct);
20
+ --_widget-selected-shadow:
21
+ 0 2px 4px -1px var(--lumo-primary-color-10pct), 0 3px 12px -1px var(--lumo-primary-color-50pct);
23
22
  --_drop-target-background-color: var(
24
23
  --vaadin-dashboard-drop-target-background-color,
25
24
  var(--lumo-primary-color-10pct)
@@ -37,11 +36,6 @@ const dashboardWidgetAndSection = css`
37
36
  filter: var(--_widget-filter);
38
37
  }
39
38
 
40
- :host([selected]) {
41
- opacity: 1;
42
- z-index: 1;
43
- }
44
-
45
39
  :host([focused]) {
46
40
  z-index: 1;
47
41
  }
@@ -86,6 +80,8 @@ const dashboardWidgetAndSection = css`
86
80
  --_icon-color: var(--lumo-primary-text-color);
87
81
  }
88
82
  :host([selected]) {
83
+ opacity: 1;
84
+ z-index: 1;
89
85
  --_icon-color: var(--lumo-primary-text-color);
90
86
  }
91
87
  :host(:is([move-mode], [resize-mode])) {
@@ -257,6 +253,13 @@ const dashboardWidget = css`
257
253
  height: var(--lumo-size-s);
258
254
  padding-right: 0;
259
255
  padding-left: 0;
256
+ border-bottom-left-radius: 0;
257
+ border-bottom-right-radius: 0;
258
+ }
259
+
260
+ [part~='resize-shrink-height-button']:not([hidden]) + [part~='resize-grow-height-button'] {
261
+ border-top-left-radius: 0;
262
+ border-top-right-radius: 0;
260
263
  }
261
264
 
262
265
  [part~='resize-shrink-height-button'] + [part~='resize-grow-height-button'] {
@@ -295,34 +298,26 @@ const dashboardWidget = css`
295
298
  --icon: var(--lumo-icons-minus);
296
299
  }
297
300
 
298
- [part~='resize-grow-height-button'],
299
- [part~='resize-shrink-height-button'] {
300
- border-bottom-left-radius: 0;
301
- border-bottom-right-radius: 0;
302
- }
303
-
304
- [part~='resize-shrink-height-button']:not([hidden]) + [part~='resize-grow-height-button'] {
305
- border-top-left-radius: 0;
306
- border-top-right-radius: 0;
307
- }
308
-
309
301
  /* Windows High Contrast Mode */
310
302
  @media (forced-colors: active) {
311
303
  :host {
312
304
  border: 1px solid;
313
305
  }
306
+
314
307
  :host([focused]) {
315
308
  outline: 2px solid;
316
309
  outline-offset: 1px;
317
310
  }
311
+
318
312
  :host([selected]) {
319
313
  outline-width: 1px;
320
- outline-offset: 0px;
314
+ outline-offset: 0;
321
315
  outline-color: Highlight;
322
316
  }
317
+
323
318
  :host([selected][focused]) {
324
319
  outline-width: 3px;
325
- outline-offset: 0px;
320
+ outline-offset: 0;
326
321
  }
327
322
  }
328
323
  `;
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.8.4",
4
+ "version": "25.0.0-alpha10",
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.8.4/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/24.8.4/#/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/25.0.0-alpha10/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/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.8.4",
4
+ "version": "25.0.0-alpha10",
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.8.4/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/24.8.4/#/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/25.0.0-alpha10/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/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
  {
@@ -1 +0,0 @@
1
- import '../../src/vaadin-dashboard-layout.js';
@@ -1 +0,0 @@
1
- import '../../src/vaadin-dashboard-layout.js';
@@ -1 +0,0 @@
1
- import '../../src/vaadin-dashboard-section.js';
@@ -1 +0,0 @@
1
- import '../../src/vaadin-dashboard-section.js';
@@ -1 +0,0 @@
1
- import '../../src/vaadin-dashboard-widget.js';
@@ -1 +0,0 @@
1
- import '../../src/vaadin-dashboard-widget.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-dashboard-section.js';
2
- import './vaadin-dashboard-widget.js';
3
- import '../../src/vaadin-dashboard.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-dashboard-section.js';
2
- import './vaadin-dashboard-widget.js';
3
- import '../../src/vaadin-dashboard.js';