@vaadin/dashboard 25.0.0-alpha1 → 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.
- package/README.md +0 -2
- package/package.json +12 -9
- package/src/styles/vaadin-dashboard-base-styles.d.ts +13 -0
- package/src/styles/vaadin-dashboard-base-styles.js +25 -0
- package/src/styles/vaadin-dashboard-button-base-styles.d.ts +13 -0
- package/src/styles/vaadin-dashboard-button-base-styles.js +24 -0
- package/src/styles/vaadin-dashboard-button-core-styles.d.ts +13 -0
- package/src/styles/vaadin-dashboard-button-core-styles.js +20 -0
- package/src/styles/vaadin-dashboard-core-styles.d.ts +13 -0
- package/src/styles/vaadin-dashboard-core-styles.js +25 -0
- package/src/styles/vaadin-dashboard-layout-base-styles.d.ts +13 -0
- package/src/styles/vaadin-dashboard-layout-base-styles.js +85 -0
- package/src/styles/vaadin-dashboard-layout-core-styles.d.ts +13 -0
- package/src/styles/vaadin-dashboard-layout-core-styles.js +85 -0
- package/src/styles/vaadin-dashboard-section-base-styles.d.ts +13 -0
- package/src/styles/vaadin-dashboard-section-base-styles.js +64 -0
- package/src/styles/vaadin-dashboard-section-core-styles.d.ts +13 -0
- package/src/styles/vaadin-dashboard-section-core-styles.js +53 -0
- package/src/styles/vaadin-dashboard-widget-base-styles.d.ts +13 -0
- package/src/styles/vaadin-dashboard-widget-base-styles.js +109 -0
- package/src/styles/vaadin-dashboard-widget-core-styles.d.ts +13 -0
- package/src/styles/vaadin-dashboard-widget-core-styles.js +57 -0
- package/src/styles/vaadin-dashboard-widget-section-base-styles.js +297 -0
- package/src/{vaadin-dashboard-styles.js → styles/vaadin-dashboard-widget-section-core-styles.js} +1 -7
- package/src/vaadin-dashboard-button.js +4 -7
- package/src/vaadin-dashboard-item-mixin.js +0 -5
- package/src/vaadin-dashboard-layout-mixin.js +0 -78
- package/src/vaadin-dashboard-layout.js +9 -5
- package/src/vaadin-dashboard-section.js +7 -46
- package/src/vaadin-dashboard-widget.js +7 -50
- package/src/vaadin-dashboard.js +5 -17
- package/theme/lumo/vaadin-dashboard-section-styles.js +0 -6
- package/theme/lumo/vaadin-dashboard-widget-styles.js +16 -21
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
|
@@ -12,7 +12,9 @@ import { html, LitElement } from 'lit';
|
|
|
12
12
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
13
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
14
14
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
15
|
-
import {
|
|
15
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
16
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
17
|
+
import { dashboardWidgetStyles } from './styles/vaadin-dashboard-widget-core-styles.js';
|
|
16
18
|
import { findAncestorInstance, SYNCHRONIZED_ATTRIBUTES, WRAPPER_LOCAL_NAME } from './vaadin-dashboard-helpers.js';
|
|
17
19
|
import { DashboardItemMixin } from './vaadin-dashboard-item-mixin.js';
|
|
18
20
|
import { getDefaultI18n } from './vaadin-dashboard-item-mixin.js';
|
|
@@ -102,60 +104,15 @@ import { DashboardSection } from './vaadin-dashboard-section.js';
|
|
|
102
104
|
* @mixes ThemableMixin
|
|
103
105
|
* @mixes DashboardItemMixin
|
|
104
106
|
*/
|
|
105
|
-
class DashboardWidget extends DashboardItemMixin(
|
|
107
|
+
class DashboardWidget extends DashboardItemMixin(
|
|
108
|
+
ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
|
|
109
|
+
) {
|
|
106
110
|
static get is() {
|
|
107
111
|
return 'vaadin-dashboard-widget';
|
|
108
112
|
}
|
|
109
113
|
|
|
110
|
-
static get experimental() {
|
|
111
|
-
return 'dashboardComponent';
|
|
112
|
-
}
|
|
113
|
-
|
|
114
114
|
static get styles() {
|
|
115
|
-
return
|
|
116
|
-
css`
|
|
117
|
-
:host {
|
|
118
|
-
display: flex;
|
|
119
|
-
flex-direction: column;
|
|
120
|
-
grid-column: var(--_item-column);
|
|
121
|
-
grid-row: var(--_item-row);
|
|
122
|
-
position: relative;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
:host([hidden]) {
|
|
126
|
-
display: none !important;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
:host(:not([editable])) [part~='resize-button'] {
|
|
130
|
-
display: none;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
[part~='content'] {
|
|
134
|
-
flex: 1;
|
|
135
|
-
overflow: hidden;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
[part~='resize-button'] {
|
|
139
|
-
position: absolute;
|
|
140
|
-
bottom: 0;
|
|
141
|
-
inset-inline-end: 0;
|
|
142
|
-
z-index: 1;
|
|
143
|
-
overflow: hidden;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
:host([resizing])::after {
|
|
147
|
-
content: '';
|
|
148
|
-
z-index: 2;
|
|
149
|
-
position: absolute;
|
|
150
|
-
top: -1px;
|
|
151
|
-
width: var(--_widget-resizer-width, 0);
|
|
152
|
-
height: var(--_widget-resizer-height, 0);
|
|
153
|
-
background: rgba(0, 0, 0, 0.1);
|
|
154
|
-
border-radius: inherit;
|
|
155
|
-
}
|
|
156
|
-
`,
|
|
157
|
-
super.styles,
|
|
158
|
-
];
|
|
115
|
+
return dashboardWidgetStyles;
|
|
159
116
|
}
|
|
160
117
|
|
|
161
118
|
static get properties() {
|
package/src/vaadin-dashboard.js
CHANGED
|
@@ -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 {
|
|
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,31 +106,18 @@ 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';
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
static get experimental() {
|
|
115
|
-
return 'dashboardComponent';
|
|
116
|
-
}
|
|
117
|
-
|
|
118
115
|
static get cvdlName() {
|
|
119
116
|
return 'vaadin-dashboard';
|
|
120
117
|
}
|
|
121
118
|
|
|
122
119
|
static get styles() {
|
|
123
|
-
return
|
|
124
|
-
super.styles,
|
|
125
|
-
css`
|
|
126
|
-
#grid[item-resizing] {
|
|
127
|
-
-webkit-user-select: none;
|
|
128
|
-
user-select: none;
|
|
129
|
-
}
|
|
130
|
-
`,
|
|
131
|
-
hasWidgetWrappers,
|
|
132
|
-
];
|
|
120
|
+
return dashboardStyles;
|
|
133
121
|
}
|
|
134
122
|
|
|
135
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:
|
|
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:
|
|
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:
|
|
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": "25.0.0-
|
|
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/25.0.0-
|
|
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",
|
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/dashboard",
|
|
4
|
-
"version": "25.0.0-
|
|
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/25.0.0-
|
|
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
|
{
|