@vaadin/dashboard 25.2.0-alpha8 → 25.2.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.
@@ -343,26 +343,6 @@
343
343
  "description": "Shared functionality between widgets and sections",
344
344
  "name": "DashboardItemMixin",
345
345
  "members": [],
346
- "events": [
347
- {
348
- "name": "item-move-mode-changed",
349
- "type": {
350
- "text": "CustomEvent"
351
- }
352
- },
353
- {
354
- "name": "item-resize-mode-changed",
355
- "type": {
356
- "text": "CustomEvent"
357
- }
358
- },
359
- {
360
- "name": "item-selected-changed",
361
- "type": {
362
- "text": "CustomEvent"
363
- }
364
- }
365
- ],
366
346
  "attributes": [],
367
347
  "mixins": [
368
348
  {
@@ -426,14 +406,6 @@
426
406
  "attribute": "root-heading-level"
427
407
  }
428
408
  ],
429
- "events": [
430
- {
431
- "name": "dashboard-root-heading-level-changed",
432
- "type": {
433
- "text": "CustomEvent"
434
- }
435
- }
436
- ],
437
409
  "attributes": [
438
410
  {
439
411
  "name": "dense-layout",
@@ -482,7 +454,7 @@
482
454
  "declarations": [
483
455
  {
484
456
  "kind": "class",
485
- "description": "A responsive, grid-based dashboard layout component\n\n```html\n<vaadin-dashboard-layout>\n <vaadin-dashboard-widget widget-title=\"Widget 1\"></vaadin-dashboard-widget>\n <vaadin-dashboard-widget widget-title=\"Widget 2\"></vaadin-dashboard-widget>\n <vaadin-dashboard-section section-title=\"Section\">\n <vaadin-dashboard-widget widget-title=\"Widget in Section\"></vaadin-dashboard-widget>\n </vaadin-dashboard-section>\n</vaadin-dashboard-layout>\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 layout\n`--vaadin-dashboard-col-max-width` | maximum column width of the layout\n`--vaadin-dashboard-row-min-height` | minimum row height of the layout\n`--vaadin-dashboard-col-max-count` | maximum column count of the layout\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`dense-layout` | Set when the dashboard is in dense mode.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
457
+ "description": "A responsive, grid-based dashboard layout component\n\n```html\n<vaadin-dashboard-layout>\n <vaadin-dashboard-widget widget-title=\"Widget 1\"></vaadin-dashboard-widget>\n <vaadin-dashboard-widget widget-title=\"Widget 2\"></vaadin-dashboard-widget>\n <vaadin-dashboard-section section-title=\"Section\">\n <vaadin-dashboard-widget widget-title=\"Widget in Section\"></vaadin-dashboard-widget>\n </vaadin-dashboard-section>\n</vaadin-dashboard-layout>\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 layout\n`--vaadin-dashboard-col-max-width` | maximum column width of the layout\n`--vaadin-dashboard-row-min-height` | minimum row height of the layout\n`--vaadin-dashboard-row-height` | fixed row height of the layout. Must be in length units. Overrides `--vaadin-dashboard-row-min-height` and prevents rows from growing to fit content\n`--vaadin-dashboard-col-max-count` | maximum column count of the layout\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`dense-layout` | Set when the dashboard is in dense mode.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
486
458
  "name": "DashboardLayout",
487
459
  "members": [
488
460
  {
@@ -568,18 +540,7 @@
568
540
  }
569
541
  }
570
542
  ],
571
- "events": [
572
- {
573
- "name": "dashboard-root-heading-level-changed",
574
- "type": {
575
- "text": "CustomEvent"
576
- },
577
- "inheritedFrom": {
578
- "name": "DashboardLayoutMixin",
579
- "module": "src/vaadin-dashboard-layout-mixin.js"
580
- }
581
- }
582
- ]
543
+ "events": []
583
544
  }
584
545
  ],
585
546
  "exports": [
@@ -651,38 +612,7 @@
651
612
  },
652
613
  "tagName": "vaadin-dashboard-section",
653
614
  "customElement": true,
654
- "events": [
655
- {
656
- "name": "item-move-mode-changed",
657
- "type": {
658
- "text": "CustomEvent"
659
- },
660
- "inheritedFrom": {
661
- "name": "DashboardItemMixin",
662
- "module": "src/vaadin-dashboard-item-mixin.js"
663
- }
664
- },
665
- {
666
- "name": "item-resize-mode-changed",
667
- "type": {
668
- "text": "CustomEvent"
669
- },
670
- "inheritedFrom": {
671
- "name": "DashboardItemMixin",
672
- "module": "src/vaadin-dashboard-item-mixin.js"
673
- }
674
- },
675
- {
676
- "name": "item-selected-changed",
677
- "type": {
678
- "text": "CustomEvent"
679
- },
680
- "inheritedFrom": {
681
- "name": "DashboardItemMixin",
682
- "module": "src/vaadin-dashboard-item-mixin.js"
683
- }
684
- }
685
- ]
615
+ "events": []
686
616
  }
687
617
  ],
688
618
  "exports": [
@@ -754,38 +684,7 @@
754
684
  },
755
685
  "tagName": "vaadin-dashboard-widget",
756
686
  "customElement": true,
757
- "events": [
758
- {
759
- "name": "item-move-mode-changed",
760
- "type": {
761
- "text": "CustomEvent"
762
- },
763
- "inheritedFrom": {
764
- "name": "DashboardItemMixin",
765
- "module": "src/vaadin-dashboard-item-mixin.js"
766
- }
767
- },
768
- {
769
- "name": "item-resize-mode-changed",
770
- "type": {
771
- "text": "CustomEvent"
772
- },
773
- "inheritedFrom": {
774
- "name": "DashboardItemMixin",
775
- "module": "src/vaadin-dashboard-item-mixin.js"
776
- }
777
- },
778
- {
779
- "name": "item-selected-changed",
780
- "type": {
781
- "text": "CustomEvent"
782
- },
783
- "inheritedFrom": {
784
- "name": "DashboardItemMixin",
785
- "module": "src/vaadin-dashboard-item-mixin.js"
786
- }
787
- }
788
- ]
687
+ "events": []
789
688
  }
790
689
  ],
791
690
  "exports": [
@@ -805,7 +704,7 @@
805
704
  "declarations": [
806
705
  {
807
706
  "kind": "class",
808
- "description": "A responsive, grid-based dashboard layout component\n\n### Quick Start\n\nAssign an array to the [`items`](#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](#/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\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.",
707
+ "description": "A responsive, grid-based dashboard layout component\n\n### Quick Start\n\nAssign an array to the [`items`](#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](#/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\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-row-height` | fixed row height of the dashboard. Must be in length units. Overrides `--vaadin-dashboard-row-min-height` and prevents rows from growing to fit content\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.",
809
708
  "name": "Dashboard",
810
709
  "members": [
811
710
  {
@@ -930,16 +829,6 @@
930
829
  },
931
830
  "description": "Fired when an item selected state changed",
932
831
  "name": "dashboard-item-selected-changed"
933
- },
934
- {
935
- "name": "dashboard-root-heading-level-changed",
936
- "type": {
937
- "text": "CustomEvent"
938
- },
939
- "inheritedFrom": {
940
- "name": "DashboardLayoutMixin",
941
- "module": "src/vaadin-dashboard-layout-mixin.js"
942
- }
943
832
  }
944
833
  ],
945
834
  "attributes": [
@@ -1004,11 +893,27 @@
1004
893
  {
1005
894
  "name": "I18nMixin",
1006
895
  "package": "@vaadin/component-base/src/i18n-mixin.js"
896
+ },
897
+ {
898
+ "name": "ElementMixin",
899
+ "package": "@vaadin/component-base/src/element-mixin.js"
900
+ },
901
+ {
902
+ "name": "ThemableMixin",
903
+ "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
904
+ },
905
+ {
906
+ "name": "PolylitMixin",
907
+ "package": "@vaadin/component-base/src/polylit-mixin.js"
908
+ },
909
+ {
910
+ "name": "LumoInjectionMixin",
911
+ "package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
1007
912
  }
1008
913
  ],
1009
914
  "superclass": {
1010
- "name": "DEFAULT_I18N",
1011
- "module": "src/vaadin-dashboard.js"
915
+ "name": "LitElement",
916
+ "package": "lit"
1012
917
  },
1013
918
  "tagName": "vaadin-dashboard",
1014
919
  "customElement": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/dashboard",
3
- "version": "25.2.0-alpha8",
3
+ "version": "25.2.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,18 +37,18 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/a11y-base": "25.2.0-alpha8",
41
- "@vaadin/button": "25.2.0-alpha8",
42
- "@vaadin/component-base": "25.2.0-alpha8",
43
- "@vaadin/vaadin-themable-mixin": "25.2.0-alpha8",
40
+ "@vaadin/a11y-base": "25.2.0-beta1",
41
+ "@vaadin/button": "25.2.0-beta1",
42
+ "@vaadin/component-base": "25.2.0-beta1",
43
+ "@vaadin/vaadin-themable-mixin": "25.2.0-beta1",
44
44
  "lit": "^3.0.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@vaadin/aura": "25.2.0-alpha8",
48
- "@vaadin/chai-plugins": "25.2.0-alpha8",
49
- "@vaadin/test-runner-commands": "25.2.0-alpha8",
47
+ "@vaadin/aura": "25.2.0-beta1",
48
+ "@vaadin/chai-plugins": "25.2.0-beta1",
49
+ "@vaadin/test-runner-commands": "25.2.0-beta1",
50
50
  "@vaadin/testing-helpers": "^2.0.0",
51
- "@vaadin/vaadin-lumo-styles": "25.2.0-alpha8",
51
+ "@vaadin/vaadin-lumo-styles": "25.2.0-beta1",
52
52
  "sinon": "^21.0.2"
53
53
  },
54
54
  "cvdlName": "vaadin-dashboard",
@@ -57,5 +57,5 @@
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "2b82e20cdfc605b1187e9a24ae42869e1500ab68"
60
+ "gitHead": "471a23f60d1eb725f98a33f62cb9664d9c0a4163"
61
61
  }
@@ -10,4 +10,6 @@
10
10
  */
11
11
  import type { CSSResult } from 'lit';
12
12
 
13
+ export const widgetFixedHeightDeclarations: CSSResult;
14
+
13
15
  export const dashboardLayoutStyles: CSSResult;
@@ -9,7 +9,30 @@
9
9
  * license.
10
10
  */
11
11
  import '@vaadin/component-base/src/styles/style-props.js';
12
- import { css } from 'lit';
12
+ import { css, unsafeCSS } from 'lit';
13
+
14
+ /**
15
+ * Declarations that pin the host or slotted element to the fixed
16
+ * `--vaadin-dashboard-row-height` (scaled by `--vaadin-dashboard-widget-rowspan` and the
17
+ * inter-row `--_gap`). Imported by the widget host and the section's slotted rule
18
+ * because the calc must live on each capped element so `var(--vaadin-dashboard-widget-rowspan)`
19
+ * resolves against that element's own context.
20
+ *
21
+ * The cap is `!important` so an inline `min-height`/`max-height` on a widget can't widen
22
+ * the cell beyond the row height. When `--vaadin-dashboard-row-height` is unset the calc
23
+ * is invalid, the property becomes invalid at computed value time and falls back to its
24
+ * initial value (`auto` for `min-height`, `none` for `max-height`) — these initial values
25
+ * are still applied with `!important`, so an inline `min-height`/`max-height` on a widget
26
+ * is a no-op even when no fixed row height is configured. See the variable's docs.
27
+ */
28
+ export const widgetFixedHeightDeclarations = unsafeCSS`
29
+ --_widget-fixed-height: calc(
30
+ var(--vaadin-dashboard-widget-rowspan, 1) * var(--vaadin-dashboard-row-height) +
31
+ (var(--vaadin-dashboard-widget-rowspan, 1) - 1) * var(--_gap)
32
+ );
33
+ min-height: var(--_widget-fixed-height) !important;
34
+ max-height: var(--_widget-fixed-height) !important;
35
+ `;
13
36
 
14
37
  export const dashboardLayoutStyles = css`
15
38
  :host {
@@ -56,8 +79,9 @@ export const dashboardLayoutStyles = css`
56
79
 
57
80
  /* Default row min height */
58
81
  --_default-row-min-height: 12em;
59
- /* Effective row min height */
60
- --_row-min-height: var(--vaadin-dashboard-row-min-height, var(--_default-row-min-height));
82
+ /* Effective row min height. A fixed row height takes precedence so the parent track also collapses to it. */
83
+ /* prettier-ignore */
84
+ --_row-min-height: var(--vaadin-dashboard-row-height, var(--vaadin-dashboard-row-min-height, var(--_default-row-min-height)));
61
85
  /* Effective row height */
62
86
  --_row-height: minmax(var(--_row-min-height, auto), auto);
63
87
 
@@ -83,4 +107,9 @@ export const dashboardLayoutStyles = css`
83
107
  --_item-row: span var(--vaadin-dashboard-widget-rowspan, 1);
84
108
  grid-row: var(--_item-row);
85
109
  }
110
+
111
+ /* Pin slotted children to the fixed row height when one is set. Sections are excluded so they can grow to wrap multiple sub-rows. */
112
+ ::slotted(:not(vaadin-dashboard-section)) {
113
+ ${widgetFixedHeightDeclarations};
114
+ }
86
115
  `;
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import '@vaadin/component-base/src/styles/style-props.js';
12
12
  import { css } from 'lit';
13
+ import { widgetFixedHeightDeclarations } from './vaadin-dashboard-layout-base-styles.js';
13
14
  import { dashboardWidgetAndSectionStyles } from './vaadin-dashboard-widget-section-base-styles.js';
14
15
 
15
16
  const sectionStyles = css`
@@ -42,12 +43,13 @@ const sectionStyles = css`
42
43
  grid-row: var(--_item-row);
43
44
  }
44
45
 
45
- header {
46
- grid-column: var(--_section-column);
46
+ /* Mirror the layout's cap so non-widget children inside a section also stay pinned to the fixed row height. Sections nested inside a section are excluded so they can still grow. */
47
+ ::slotted(:not(vaadin-dashboard-section)) {
48
+ ${widgetFixedHeightDeclarations};
47
49
  }
48
50
 
49
- :host::before {
50
- z-index: 2 !important;
51
+ header {
52
+ grid-column: var(--_section-column);
51
53
  }
52
54
 
53
55
  ::slotted(vaadin-dashboard-widget-wrapper) {
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import '@vaadin/component-base/src/styles/style-props.js';
12
12
  import { css } from 'lit';
13
+ import { widgetFixedHeightDeclarations } from './vaadin-dashboard-layout-base-styles.js';
13
14
  import { dashboardWidgetAndSectionStyles } from './vaadin-dashboard-widget-section-base-styles.js';
14
15
 
15
16
  const widgetStyles = css`
@@ -22,19 +23,10 @@ const widgetStyles = css`
22
23
  background: var(--_widget-background);
23
24
  border-radius: var(--_widget-border-radius);
24
25
  box-shadow: var(--_widget-shadow);
25
- border-color: var(--_widget-border-color);
26
- }
26
+ border: var(--_widget-border-width) solid var(--_widget-border-color);
27
27
 
28
- :host::before {
29
- content: '';
30
- position: absolute;
31
- inset: 0;
32
- border-color: inherit;
33
- border-width: var(--_widget-border-width);
34
- border-style: solid;
35
- border-radius: inherit;
36
- pointer-events: none;
37
- z-index: 1;
28
+ /* Pin to the fixed row height when one is set. The widget host's own definition is needed so widgets nested inside sections in vaadin-dashboard-layout (where the layout-level cap doesn't reach) still get capped. */
29
+ ${widgetFixedHeightDeclarations};
38
30
  }
39
31
 
40
32
  :host([hidden]) {
@@ -21,8 +21,11 @@ export const dashboardWidgetAndSectionStyles = css`
21
21
  --_widget-shadow: var(--vaadin-dashboard-widget-shadow, 0 0 0 0 transparent);
22
22
  --_widget-editable-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.3);
23
23
  --_widget-selected-shadow: 0 3px 12px -1px rgba(0, 0, 0, 0.3);
24
- --_drop-target-background: var(--vaadin-dashboard-drop-target-background, var(--vaadin-background-container));
25
- --_drop-target-border-color: var(--vaadin-dashboard-drop-target-border-color, var(--vaadin-border-color-secondary));
24
+ --_drop-target-background-color: var(
25
+ --vaadin-dashboard-drop-target-background-color,
26
+ var(--vaadin-background-container)
27
+ );
28
+ --_drop-target-border: var(--vaadin-dashboard-drop-target-border, 1px dashed var(--vaadin-border-color-secondary));
26
29
  --_focus-ring-color: var(--vaadin-focus-ring-color);
27
30
  --_focus-ring-width: var(--vaadin-focus-ring-width);
28
31
  }
@@ -34,9 +37,9 @@ export const dashboardWidgetAndSectionStyles = css`
34
37
  }
35
38
 
36
39
  :host([dragging]) {
37
- box-shadow: none;
38
- background: var(--_drop-target-background);
39
- border-color: var(--_drop-target-border-color);
40
+ box-shadow: none !important;
41
+ background: var(--_drop-target-background-color) !important;
42
+ border: var(--_drop-target-border) !important;
40
43
  }
41
44
 
42
45
  :host([dragging]) * {
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -23,9 +22,6 @@ import { dashboardButtonStyles } from './styles/vaadin-dashboard-button-base-sty
23
22
  *
24
23
  * @customElement vaadin-dashboard-button
25
24
  * @extends HTMLElement
26
- * @mixes ButtonMixin
27
- * @mixes ElementMixin
28
- * @mixes ThemableMixin
29
25
  * @protected
30
26
  */
31
27
  class DashboardButton extends ButtonMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
@@ -52,7 +52,7 @@ export function getItemsArrayOfItem(item, items) {
52
52
  */
53
53
  export function getElementItem(element) {
54
54
  const wrapper = element.closest(WRAPPER_LOCAL_NAME);
55
- return wrapper && wrapper.__item;
55
+ return wrapper?.__item;
56
56
  }
57
57
 
58
58
  /**
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -40,9 +39,6 @@ export function getDefaultI18n() {
40
39
 
41
40
  /**
42
41
  * Shared functionality between widgets and sections
43
- *
44
- * @polymerMixin
45
- * @mixes ResizeMixin
46
42
  */
47
43
  export const DashboardItemMixin = (superClass) =>
48
44
  class DashboardItemMixinClass extends ResizeMixin(superClass) {
@@ -316,6 +312,7 @@ export const DashboardItemMixin = (superClass) =>
316
312
  if (!!selected === !!oldSelected) {
317
313
  return;
318
314
  }
315
+ /** @internal to not document it in CEM */
319
316
  this.dispatchEvent(new CustomEvent('item-selected-changed', { bubbles: true, detail: { value: selected } }));
320
317
  if (selected) {
321
318
  this.__focusTrapController.trapFocus(this.$.focustrap);
@@ -386,6 +383,7 @@ export const DashboardItemMixin = (superClass) =>
386
383
  if (!!moveMode === !!oldMoveMode) {
387
384
  return;
388
385
  }
386
+ /** @internal to not document it in CEM */
389
387
  this.dispatchEvent(new CustomEvent('item-move-mode-changed', { bubbles: true, detail: { value: moveMode } }));
390
388
  }
391
389
 
@@ -394,6 +392,7 @@ export const DashboardItemMixin = (superClass) =>
394
392
  if (!!resizeMode === !!oldResizeMode) {
395
393
  return;
396
394
  }
395
+ /** @internal to not document it in CEM */
397
396
  this.dispatchEvent(new CustomEvent('item-resize-mode-changed', { bubbles: true, detail: { value: resizeMode } }));
398
397
  }
399
398
 
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -12,9 +11,6 @@ import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
12
11
 
13
12
  /**
14
13
  * A mixin to enable the dashboard layout functionality
15
- *
16
- * @polymerMixin
17
- * @mixes ResizeMixin
18
14
  */
19
15
  export const DashboardLayoutMixin = (superClass) =>
20
16
  class DashboardLayoutMixinClass extends ResizeMixin(superClass) {
@@ -92,6 +88,7 @@ export const DashboardLayoutMixin = (superClass) =>
92
88
 
93
89
  /** @private */
94
90
  __rootHeadingLevelChanged(rootHeadingLevel) {
91
+ /** @internal to not document it in CEM */
95
92
  this.dispatchEvent(
96
93
  new CustomEvent('dashboard-root-heading-level-changed', { detail: { value: rootHeadingLevel } }),
97
94
  );
@@ -34,6 +34,7 @@ import { DashboardLayoutMixin } from './vaadin-dashboard-layout-mixin.js';
34
34
  * `--vaadin-dashboard-col-min-width` | minimum column width of the layout
35
35
  * `--vaadin-dashboard-col-max-width` | maximum column width of the layout
36
36
  * `--vaadin-dashboard-row-min-height` | minimum row height of the layout
37
+ * `--vaadin-dashboard-row-height` | fixed row height of the layout. Must be in length units. Overrides `--vaadin-dashboard-row-min-height` and prevents rows from growing to fit content
37
38
  * `--vaadin-dashboard-col-max-count` | maximum column count of the layout
38
39
  * `--vaadin-dashboard-gap` | gap between child elements. Must be in length units (0 is not allowed, 0px is)
39
40
  * `--vaadin-dashboard-padding` | space around the dashboard's outer edges. Must be in length units (0 is not allowed, 0px is)
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -39,6 +38,7 @@ import { DashboardLayoutMixin } from './vaadin-dashboard-layout-mixin.js';
39
38
  * `--vaadin-dashboard-col-min-width` | minimum column width of the layout
40
39
  * `--vaadin-dashboard-col-max-width` | maximum column width of the layout
41
40
  * `--vaadin-dashboard-row-min-height` | minimum row height of the layout
41
+ * `--vaadin-dashboard-row-height` | fixed row height of the layout. Must be in length units. Overrides `--vaadin-dashboard-row-min-height` and prevents rows from growing to fit content
42
42
  * `--vaadin-dashboard-col-max-count` | maximum column count of the layout
43
43
  * `--vaadin-dashboard-gap` | gap between child elements. Must be in length units (0 is not allowed, 0px is)
44
44
  * `--vaadin-dashboard-padding` | space around the dashboard's outer edges. Must be in length units (0 is not allowed, 0px is)
@@ -53,9 +53,6 @@ import { DashboardLayoutMixin } from './vaadin-dashboard-layout-mixin.js';
53
53
  *
54
54
  * @customElement vaadin-dashboard-layout
55
55
  * @extends HTMLElement
56
- * @mixes DashboardLayoutMixin
57
- * @mixes ElementMixin
58
- * @mixes ThemableMixin
59
56
  */
60
57
  class DashboardLayout extends DashboardLayoutMixin(
61
58
  ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -67,9 +66,6 @@ import { getDefaultI18n } from './vaadin-dashboard-item-mixin.js';
67
66
  *
68
67
  * @customElement vaadin-dashboard-section
69
68
  * @extends HTMLElement
70
- * @mixes ElementMixin
71
- * @mixes ThemableMixin
72
- * @mixes DashboardItemMixin
73
69
  */
74
70
  class DashboardSection extends DashboardItemMixin(
75
71
  ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -101,9 +100,6 @@ import { DashboardSection } from './vaadin-dashboard-section.js';
101
100
  *
102
101
  * @customElement vaadin-dashboard-widget
103
102
  * @extends HTMLElement
104
- * @mixes ElementMixin
105
- * @mixes ThemableMixin
106
- * @mixes DashboardItemMixin
107
103
  */
108
104
  class DashboardWidget extends DashboardItemMixin(
109
105
  ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
@@ -211,6 +211,7 @@ export interface DashboardI18n {
211
211
  * `--vaadin-dashboard-col-min-width` | minimum column width of the dashboard
212
212
  * `--vaadin-dashboard-col-max-width` | maximum column width of the dashboard
213
213
  * `--vaadin-dashboard-row-min-height` | minimum row height of the dashboard
214
+ * `--vaadin-dashboard-row-height` | fixed row height of the dashboard. Must be in length units. Overrides `--vaadin-dashboard-row-min-height` and prevents rows from growing to fit content
214
215
  * `--vaadin-dashboard-col-max-count` | maximum column count of the dashboard
215
216
  * `--vaadin-dashboard-gap` | gap between child elements. Must be in length units (0 is not allowed, 0px is)
216
217
  * `--vaadin-dashboard-padding` | space around the dashboard's outer edges. Must be in length units (0 is not allowed, 0px is)
@@ -234,7 +235,7 @@ export interface DashboardI18n {
234
235
  * @fires {CustomEvent} dashboard-item-resize-mode-changed - Fired when an item resize mode changed
235
236
  */
236
237
  declare class Dashboard<TItem extends DashboardItem = DashboardItem> extends DashboardLayoutMixin(
237
- I18nMixin({} as DashboardI18n, ElementMixin(ThemableMixin(HTMLElement))),
238
+ I18nMixin<typeof HTMLElement, DashboardI18n>(ElementMixin(ThemableMixin(HTMLElement))),
238
239
  ) {
239
240
  /**
240
241
  * An array containing the items of the dashboard
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
7
- *
8
7
  * See https://vaadin.com/commercial-license-and-service-terms for the full
9
8
  * license.
10
9
  */
@@ -79,6 +78,7 @@ const DEFAULT_I18N = getDefaultI18n();
79
78
  * `--vaadin-dashboard-col-min-width` | minimum column width of the dashboard
80
79
  * `--vaadin-dashboard-col-max-width` | maximum column width of the dashboard
81
80
  * `--vaadin-dashboard-row-min-height` | minimum row height of the dashboard
81
+ * `--vaadin-dashboard-row-height` | fixed row height of the dashboard. Must be in length units. Overrides `--vaadin-dashboard-row-min-height` and prevents rows from growing to fit content
82
82
  * `--vaadin-dashboard-col-max-count` | maximum column count of the dashboard
83
83
  * `--vaadin-dashboard-gap` | gap between child elements. Must be in length units (0 is not allowed, 0px is)
84
84
  * `--vaadin-dashboard-padding` | space around the dashboard's outer edges. Must be in length units (0 is not allowed, 0px is)
@@ -103,13 +103,9 @@ const DEFAULT_I18N = getDefaultI18n();
103
103
  *
104
104
  * @customElement vaadin-dashboard
105
105
  * @extends HTMLElement
106
- * @mixes ElementMixin
107
- * @mixes DashboardLayoutMixin
108
- * @mixes I18nMixin
109
- * @mixes ThemableMixin
110
106
  */
111
107
  class Dashboard extends DashboardLayoutMixin(
112
- I18nMixin(DEFAULT_I18N, ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))),
108
+ I18nMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))),
113
109
  ) {
114
110
  static get is() {
115
111
  return 'vaadin-dashboard';
@@ -173,6 +169,10 @@ class Dashboard extends DashboardLayoutMixin(
173
169
  return ['__itemsOrRendererChanged(items, renderer, editable, __effectiveI18n)'];
174
170
  }
175
171
 
172
+ static get defaultI18n() {
173
+ return DEFAULT_I18N;
174
+ }
175
+
176
176
  /**
177
177
  * The object used to localize this component. To change the default
178
178
  * localization, replace this with an object that provides all properties, or
@@ -266,6 +266,7 @@ class Dashboard extends DashboardLayoutMixin(
266
266
  let wrappers = [...hostElement.children].filter((el) => el.localName === WRAPPER_LOCAL_NAME);
267
267
 
268
268
  const focusedWrapper = wrappers.find((wrapper) => wrapper.querySelector(':focus'));
269
+ const focusedElement = focusedWrapper?.querySelector(':focus');
269
270
  const focusedWrapperWillBeRemoved = focusedWrapper && !this.__isActiveWrapper(focusedWrapper);
270
271
  const wrapperClosestToRemovedFocused =
271
272
  focusedWrapperWillBeRemoved && this.__getClosestActiveWrapper(focusedWrapper);
@@ -313,6 +314,10 @@ class Dashboard extends DashboardLayoutMixin(
313
314
  if (focusedWrapperWillBeRemoved) {
314
315
  // The wrapper containing the focused element was removed. Try to focus the element in the closest wrapper.
315
316
  this.__focusWrapperContent(wrapperClosestToRemovedFocused || this.querySelector(WRAPPER_LOCAL_NAME));
317
+ } else if (focusedElement && !focusedElement.matches(':focus')) {
318
+ // Firefox loses focus from a slotted element when the <slot> it was projected through is
319
+ // removed during the shadow re-render, even after re-projection through a different slot.
320
+ focusedElement.focus();
316
321
  }
317
322
 
318
323
  const focusedItem = this.querySelector(':focus');
@@ -347,7 +352,7 @@ class Dashboard extends DashboardLayoutMixin(
347
352
 
348
353
  /** @private */
349
354
  __focusWrapperContent(wrapper) {
350
- if (wrapper && wrapper.firstElementChild) {
355
+ if (wrapper?.firstElementChild) {
351
356
  wrapper.firstElementChild.focus();
352
357
  }
353
358
  }
@@ -501,48 +506,6 @@ class Dashboard extends DashboardLayoutMixin(
501
506
  });
502
507
  }
503
508
  }
504
-
505
- /**
506
- * Fired when an item selected state changed
507
- *
508
- * @event dashboard-item-selected-changed
509
- */
510
-
511
- /**
512
- * Fired when an item move mode changed
513
- *
514
- * @event dashboard-item-move-mode-changed
515
- */
516
-
517
- /**
518
- * Fired when an item resize mode changed
519
- *
520
- * @event dashboard-item-resize-mode-changed
521
- */
522
-
523
- /**
524
- * Fired when an item was moved
525
- *
526
- * @event dashboard-item-moved
527
- */
528
-
529
- /**
530
- * Fired when an item was resized
531
- *
532
- * @event dashboard-item-resized
533
- */
534
-
535
- /**
536
- * Fired before an item is removed
537
- *
538
- * @event dashboard-item-before-remove
539
- */
540
-
541
- /**
542
- * Fired when an item was removed
543
- *
544
- * @event dashboard-item-removed
545
- */
546
509
  }
547
510
 
548
511
  defineCustomElement(Dashboard);
package/web-types.json CHANGED
@@ -1,23 +1,21 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/dashboard",
4
- "version": "25.2.0-alpha8",
4
+ "version": "25.2.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-dashboard-layout",
11
- "description": "A responsive, grid-based dashboard layout component\n\n```html\n<vaadin-dashboard-layout>\n <vaadin-dashboard-widget widget-title=\"Widget 1\"></vaadin-dashboard-widget>\n <vaadin-dashboard-widget widget-title=\"Widget 2\"></vaadin-dashboard-widget>\n <vaadin-dashboard-section section-title=\"Section\">\n <vaadin-dashboard-widget widget-title=\"Widget in Section\"></vaadin-dashboard-widget>\n </vaadin-dashboard-section>\n</vaadin-dashboard-layout>\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 layout\n`--vaadin-dashboard-col-max-width` | maximum column width of the layout\n`--vaadin-dashboard-row-min-height` | minimum row height of the layout\n`--vaadin-dashboard-col-max-count` | maximum column count of the layout\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`dense-layout` | Set when the dashboard is in dense mode.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "A responsive, grid-based dashboard layout component\n\n```html\n<vaadin-dashboard-layout>\n <vaadin-dashboard-widget widget-title=\"Widget 1\"></vaadin-dashboard-widget>\n <vaadin-dashboard-widget widget-title=\"Widget 2\"></vaadin-dashboard-widget>\n <vaadin-dashboard-section section-title=\"Section\">\n <vaadin-dashboard-widget widget-title=\"Widget in Section\"></vaadin-dashboard-widget>\n </vaadin-dashboard-section>\n</vaadin-dashboard-layout>\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 layout\n`--vaadin-dashboard-col-max-width` | maximum column width of the layout\n`--vaadin-dashboard-row-min-height` | minimum row height of the layout\n`--vaadin-dashboard-row-height` | fixed row height of the layout. Must be in length units. Overrides `--vaadin-dashboard-row-min-height` and prevents rows from growing to fit content\n`--vaadin-dashboard-col-max-count` | maximum column count of the layout\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`dense-layout` | Set when the dashboard is in dense mode.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "dense-layout",
15
15
  "description": "Whether the dashboard layout is dense.",
16
16
  "value": {
17
17
  "type": [
18
- "boolean",
19
- "null",
20
- "undefined"
18
+ "boolean"
21
19
  ]
22
20
  }
23
21
  },
@@ -26,9 +24,7 @@
26
24
  "description": "Root heading level for sections and widgets. Defaults to 2.\n\nIf changed to e.g. 1:\n- sections will have the attribute `aria-level` with value 1\n- non-nested widgets will have the attribute `aria-level` with value 1\n- nested widgets will have the attribute `aria-level` with value 2",
27
25
  "value": {
28
26
  "type": [
29
- "number",
30
- "null",
31
- "undefined"
27
+ "number"
32
28
  ]
33
29
  }
34
30
  },
@@ -51,9 +47,7 @@
51
47
  "description": "Whether the dashboard layout is dense.",
52
48
  "value": {
53
49
  "type": [
54
- "boolean",
55
- "null",
56
- "undefined"
50
+ "boolean"
57
51
  ]
58
52
  }
59
53
  },
@@ -62,9 +56,7 @@
62
56
  "description": "Root heading level for sections and widgets. Defaults to 2.\n\nIf changed to e.g. 1:\n- sections will have the attribute `aria-level` with value 1\n- non-nested widgets will have the attribute `aria-level` with value 1\n- nested widgets will have the attribute `aria-level` with value 2",
63
57
  "value": {
64
58
  "type": [
65
- "number",
66
- "null",
67
- "undefined"
59
+ "number"
68
60
  ]
69
61
  }
70
62
  }
@@ -81,9 +73,7 @@
81
73
  "description": "The title of the section",
82
74
  "value": {
83
75
  "type": [
84
- "string",
85
- "null",
86
- "undefined"
76
+ "string"
87
77
  ]
88
78
  }
89
79
  },
@@ -106,9 +96,7 @@
106
96
  "description": "The title of the section",
107
97
  "value": {
108
98
  "type": [
109
- "string",
110
- "null",
111
- "undefined"
99
+ "string"
112
100
  ]
113
101
  }
114
102
  }
@@ -136,9 +124,7 @@
136
124
  "description": "The title of the widget.",
137
125
  "value": {
138
126
  "type": [
139
- "string",
140
- "null",
141
- "undefined"
127
+ "string"
142
128
  ]
143
129
  }
144
130
  }
@@ -150,9 +136,7 @@
150
136
  "description": "The title of the widget.",
151
137
  "value": {
152
138
  "type": [
153
- "string",
154
- "null",
155
- "undefined"
139
+ "string"
156
140
  ]
157
141
  }
158
142
  }
@@ -162,16 +146,14 @@
162
146
  },
163
147
  {
164
148
  "name": "vaadin-dashboard",
165
- "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.2.0-alpha8/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha8/#/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.",
149
+ "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.2.0-beta1/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-beta1/#/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-row-height` | fixed row height of the dashboard. Must be in length units. Overrides `--vaadin-dashboard-row-min-height` and prevents rows from growing to fit content\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.",
166
150
  "attributes": [
167
151
  {
168
152
  "name": "dense-layout",
169
153
  "description": "Whether the dashboard layout is dense.",
170
154
  "value": {
171
155
  "type": [
172
- "boolean",
173
- "null",
174
- "undefined"
156
+ "boolean"
175
157
  ]
176
158
  }
177
159
  },
@@ -180,20 +162,7 @@
180
162
  "description": "Whether the dashboard is editable.",
181
163
  "value": {
182
164
  "type": [
183
- "boolean",
184
- "null",
185
- "undefined"
186
- ]
187
- }
188
- },
189
- {
190
- "name": "i18n",
191
- "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\nShould be overridden by subclasses to provide a custom JSDoc with the\ndefault I18N properties.",
192
- "value": {
193
- "type": [
194
- "Object",
195
- "null",
196
- "undefined"
165
+ "boolean"
197
166
  ]
198
167
  }
199
168
  },
@@ -202,9 +171,7 @@
202
171
  "description": "Root heading level for sections and widgets. Defaults to 2.\n\nIf changed to e.g. 1:\n- sections will have the attribute `aria-level` with value 1\n- non-nested widgets will have the attribute `aria-level` with value 1\n- nested widgets will have the attribute `aria-level` with value 2",
203
172
  "value": {
204
173
  "type": [
205
- "number",
206
- "null",
207
- "undefined"
174
+ "number"
208
175
  ]
209
176
  }
210
177
  },
@@ -227,9 +194,7 @@
227
194
  "description": "Whether the dashboard layout is dense.",
228
195
  "value": {
229
196
  "type": [
230
- "boolean",
231
- "null",
232
- "undefined"
197
+ "boolean"
233
198
  ]
234
199
  }
235
200
  },
@@ -238,9 +203,7 @@
238
203
  "description": "Whether the dashboard is editable.",
239
204
  "value": {
240
205
  "type": [
241
- "boolean",
242
- "null",
243
- "undefined"
206
+ "boolean"
244
207
  ]
245
208
  }
246
209
  },
@@ -249,7 +212,7 @@
249
212
  "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 structure and default values:\n```js\n{\n selectSection: 'Select section for editing',\n selectWidget: 'Select widget for editing',\n remove: 'Remove',\n resize: 'Resize',\n resizeApply: 'Apply',\n resizeShrinkWidth: 'Shrink width',\n resizeGrowWidth: 'Grow width',\n resizeShrinkHeight: 'Shrink height',\n resizeGrowHeight: 'Grow height',\n move: 'Move',\n moveApply: 'Apply',\n moveForward: 'Move Forward',\n moveBackward: 'Move Backward',\n}\n```",
250
213
  "value": {
251
214
  "type": [
252
- "?"
215
+ "Object"
253
216
  ]
254
217
  }
255
218
  },
@@ -258,7 +221,7 @@
258
221
  "description": "An array containing the items of the dashboard",
259
222
  "value": {
260
223
  "type": [
261
- "Array.<DashboardItem>",
224
+ "Array<DashboardItem>",
262
225
  "null",
263
226
  "undefined"
264
227
  ]
@@ -280,9 +243,7 @@
280
243
  "description": "Root heading level for sections and widgets. Defaults to 2.\n\nIf changed to e.g. 1:\n- sections will have the attribute `aria-level` with value 1\n- non-nested widgets will have the attribute `aria-level` with value 1\n- nested widgets will have the attribute `aria-level` with value 2",
281
244
  "value": {
282
245
  "type": [
283
- "number",
284
- "null",
285
- "undefined"
246
+ "number"
286
247
  ]
287
248
  }
288
249
  }
@@ -290,7 +251,7 @@
290
251
  "events": [
291
252
  {
292
253
  "name": "dashboard-item-before-remove",
293
- "description": "Fired before an item is removed"
254
+ "description": "Fired before an item is removed. Calling preventDefault() on the event will cancel the removal."
294
255
  },
295
256
  {
296
257
  "name": "dashboard-item-move-mode-changed",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/dashboard",
4
- "version": "25.2.0-alpha8",
4
+ "version": "25.2.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-dashboard-layout",
19
- "description": "A responsive, grid-based dashboard layout component\n\n```html\n<vaadin-dashboard-layout>\n <vaadin-dashboard-widget widget-title=\"Widget 1\"></vaadin-dashboard-widget>\n <vaadin-dashboard-widget widget-title=\"Widget 2\"></vaadin-dashboard-widget>\n <vaadin-dashboard-section section-title=\"Section\">\n <vaadin-dashboard-widget widget-title=\"Widget in Section\"></vaadin-dashboard-widget>\n </vaadin-dashboard-section>\n</vaadin-dashboard-layout>\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 layout\n`--vaadin-dashboard-col-max-width` | maximum column width of the layout\n`--vaadin-dashboard-row-min-height` | minimum row height of the layout\n`--vaadin-dashboard-col-max-count` | maximum column count of the layout\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`dense-layout` | Set when the dashboard is in dense mode.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "A responsive, grid-based dashboard layout component\n\n```html\n<vaadin-dashboard-layout>\n <vaadin-dashboard-widget widget-title=\"Widget 1\"></vaadin-dashboard-widget>\n <vaadin-dashboard-widget widget-title=\"Widget 2\"></vaadin-dashboard-widget>\n <vaadin-dashboard-section section-title=\"Section\">\n <vaadin-dashboard-widget widget-title=\"Widget in Section\"></vaadin-dashboard-widget>\n </vaadin-dashboard-section>\n</vaadin-dashboard-layout>\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 layout\n`--vaadin-dashboard-col-max-width` | maximum column width of the layout\n`--vaadin-dashboard-row-min-height` | minimum row height of the layout\n`--vaadin-dashboard-row-height` | fixed row height of the layout. Must be in length units. Overrides `--vaadin-dashboard-row-min-height` and prevents rows from growing to fit content\n`--vaadin-dashboard-col-max-count` | maximum column count of the layout\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`dense-layout` | Set when the dashboard is in dense mode.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -65,7 +65,7 @@
65
65
  },
66
66
  {
67
67
  "name": "vaadin-dashboard",
68
- "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.2.0-alpha8/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-alpha8/#/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.",
68
+ "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.2.0-beta1/#/elements/vaadin-dashboard#property-items) property.\nSet a renderer function to the [`renderer`](https://cdn.vaadin.com/vaadin-web-components/25.2.0-beta1/#/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-row-height` | fixed row height of the dashboard. Must be in length units. Overrides `--vaadin-dashboard-row-min-height` and prevents rows from growing to fit content\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.",
69
69
  "extension": true,
70
70
  "attributes": [
71
71
  {
@@ -112,7 +112,7 @@
112
112
  },
113
113
  {
114
114
  "name": "@dashboard-item-before-remove",
115
- "description": "Fired before an item is removed",
115
+ "description": "Fired before an item is removed. Calling preventDefault() on the event will cancel the removal.",
116
116
  "value": {
117
117
  "kind": "expression"
118
118
  }