@vaadin/board 24.7.0-alpha3 → 24.7.0-alpha5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/board",
3
- "version": "24.7.0-alpha3",
3
+ "version": "24.7.0-alpha5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,12 +38,14 @@
38
38
  "polymer"
39
39
  ],
40
40
  "dependencies": {
41
+ "@open-wc/dedupe-mixin": "^1.3.0",
41
42
  "@polymer/polymer": "^3.0.0",
42
- "@vaadin/a11y-base": "24.7.0-alpha3",
43
- "@vaadin/component-base": "24.7.0-alpha3"
43
+ "@vaadin/a11y-base": "24.7.0-alpha5",
44
+ "@vaadin/component-base": "24.7.0-alpha5",
45
+ "lit": "^3.0.0"
44
46
  },
45
47
  "devDependencies": {
46
- "@vaadin/chai-plugins": "24.7.0-alpha3",
48
+ "@vaadin/chai-plugins": "24.7.0-alpha5",
47
49
  "@vaadin/testing-helpers": "^1.1.0",
48
50
  "sinon": "^18.0.0"
49
51
  },
@@ -52,5 +54,5 @@
52
54
  "web-types.json",
53
55
  "web-types.lit.json"
54
56
  ],
55
- "gitHead": "dd5cfad6c9b54e676f5b10dffba2233775378f40"
57
+ "gitHead": "f9fa2bd652780a344d5e0329b8aafbcbd72ebd14"
56
58
  }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import type { Constructor } from '@open-wc/dedupe-mixin';
12
+ import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
13
+
14
+ export declare function BoardRowMixin<T extends Constructor<HTMLElement>>(
15
+ base: T,
16
+ ): Constructor<BoardRowMixinClass> & Constructor<ResizeMixinClass> & T;
17
+
18
+ export declare class BoardRowMixinClass {
19
+ /**
20
+ * Redraws the row, if necessary.
21
+ *
22
+ * In most cases, a board row will redraw itself if your reconfigure it.
23
+ * If you dynamically change breakpoints
24
+ * `--vaadin-board-width-small` or `--vaadin-board-width-medium`,
25
+ * then you need to call this method.
26
+ */
27
+ redraw(): void;
28
+ }
@@ -0,0 +1,230 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import { isElementHidden } from '@vaadin/a11y-base/src/focus-utils.js';
12
+ import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
13
+
14
+ const CLASSES = {
15
+ SMALL: 'small',
16
+ MEDIUM: 'medium',
17
+ LARGE: 'large',
18
+ };
19
+
20
+ /**
21
+ * @polymerMixin
22
+ * @mixes ResizeMixin
23
+ */
24
+ export const BoardRowMixin = (superClass) =>
25
+ class BoardRowMixinClass extends ResizeMixin(superClass) {
26
+ constructor() {
27
+ super();
28
+ this._oldWidth = 0;
29
+ this._oldBreakpoints = { smallSize: 600, mediumSize: 960 };
30
+ this._oldFlexBasis = [];
31
+ }
32
+
33
+ /** @protected */
34
+ ready() {
35
+ super.ready();
36
+
37
+ this.$.insertionPoint.addEventListener('slotchange', () => this.redraw());
38
+ }
39
+
40
+ /** @protected */
41
+ connectedCallback() {
42
+ super.connectedCallback();
43
+ this._onResize();
44
+ }
45
+
46
+ /**
47
+ * Adds styles for board row based on width.
48
+ * @private
49
+ */
50
+ _addStyleNames(width, breakpoints) {
51
+ if (width < breakpoints.smallSize) {
52
+ this.classList.add(CLASSES.SMALL);
53
+ this.classList.remove(CLASSES.MEDIUM);
54
+ this.classList.remove(CLASSES.LARGE);
55
+ } else if (width < breakpoints.mediumSize) {
56
+ this.classList.remove(CLASSES.SMALL);
57
+ this.classList.add(CLASSES.MEDIUM);
58
+ this.classList.remove(CLASSES.LARGE);
59
+ } else {
60
+ this.classList.remove(CLASSES.SMALL);
61
+ this.classList.remove(CLASSES.MEDIUM);
62
+ this.classList.add(CLASSES.LARGE);
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Calculates flex basis based on colSpan, width and breakpoints.
68
+ * @param {number} colSpan colspan value of the row
69
+ * @param {number} width width of the row in px
70
+ * @param {number} colsInRow number of columns in the row
71
+ * @param {object} breakpoints object with smallSize and mediumSize number properties, which tells
72
+ * where the row should switch rendering size in pixels.
73
+ * @private
74
+ */
75
+ _calculateFlexBasis(colSpan, width, colsInRow, breakpoints) {
76
+ if (width < breakpoints.smallSize) {
77
+ colsInRow = 1;
78
+ } else if (width < breakpoints.mediumSize && colsInRow === 4) {
79
+ colsInRow = 2;
80
+ }
81
+ let flexBasis = (colSpan / colsInRow) * 100;
82
+ flexBasis = flexBasis > 100 ? 100 : flexBasis;
83
+ return `${flexBasis}%`;
84
+ }
85
+
86
+ /** @private */
87
+ _reportError() {
88
+ const errorMessage = 'The column configuration is not valid; column count should add up to 3 or 4.';
89
+ console.warn(errorMessage, `check: \r\n${this.outerHTML}`);
90
+ }
91
+
92
+ /**
93
+ * Parses board-cols from DOM.
94
+ * If there is not enough space in the row drop board cols.
95
+ * @param {!Array<!Node>} nodes array of nodes
96
+ * @return {!Array<number>} array of boardCols
97
+ * @private
98
+ */
99
+ _parseBoardCols(nodes) {
100
+ const boardCols = nodes.map((node) => {
101
+ if (node.getAttribute('board-cols')) {
102
+ return parseInt(node.getAttribute('board-cols'));
103
+ }
104
+ return 1;
105
+ });
106
+
107
+ let spaceLeft = 4;
108
+ let returnBoardCols = [];
109
+ nodes.forEach((_node, i) => {
110
+ spaceLeft -= boardCols[i];
111
+ });
112
+
113
+ if (spaceLeft < 0) {
114
+ this._reportError();
115
+ boardCols.forEach((_node, i) => {
116
+ returnBoardCols[i] = 1;
117
+ });
118
+ } else {
119
+ returnBoardCols = boardCols.slice(0);
120
+ }
121
+
122
+ return returnBoardCols;
123
+ }
124
+
125
+ /**
126
+ * If there is not enough space in the row.
127
+ * Extra items are dropped from DOM.
128
+ * @param {!Array<number>} boardCols array of board-cols for every node
129
+ * @param {!Array<!Node>} nodes array of nodes
130
+ * @return {!Array<!Node>} filtered array of nodes
131
+ * @private
132
+ */
133
+ _removeExtraNodesFromDOM(boardCols, nodes) {
134
+ let isErrorReported = false;
135
+ let spaceLeft = 4;
136
+ const returnNodes = [];
137
+ nodes.forEach((node, i) => {
138
+ spaceLeft -= boardCols[i];
139
+ if (spaceLeft < 0) {
140
+ if (!isErrorReported) {
141
+ isErrorReported = true;
142
+ this._reportError();
143
+ }
144
+ this.removeChild(node);
145
+ } else {
146
+ returnNodes[i] = node;
147
+ }
148
+ });
149
+ return returnNodes;
150
+ }
151
+
152
+ /**
153
+ * Redraws the row, if necessary.
154
+ *
155
+ * In most cases, a board row will redraw itself if your reconfigure it.
156
+ * If you dynamically change breakpoints
157
+ * --vaadin-board-width-small or --vaadin-board-width-medium,
158
+ * then you need to call this method.
159
+ */
160
+ redraw() {
161
+ this._recalculateFlexBasis(true);
162
+ }
163
+
164
+ /**
165
+ * @protected
166
+ * @override
167
+ */
168
+ _onResize() {
169
+ this._recalculateFlexBasis(false);
170
+ }
171
+
172
+ /** @private */
173
+ _recalculateFlexBasis(forceResize) {
174
+ const width = this.getBoundingClientRect().width;
175
+ const breakpoints = this._measureBreakpointsInPx();
176
+ if (forceResize || this._shouldRecalculate(width, breakpoints)) {
177
+ const nodes = this.$.insertionPoint.assignedNodes({ flatten: true });
178
+ const filteredNodes = nodes.filter((node) => node.nodeType === Node.ELEMENT_NODE);
179
+ this._addStyleNames(width, breakpoints);
180
+ const boardCols = this._parseBoardCols(filteredNodes);
181
+ const colsInRow = boardCols.reduce((a, b) => a + b, 0);
182
+ this._removeExtraNodesFromDOM(boardCols, filteredNodes).forEach((e, i) => {
183
+ const newFlexBasis = this._calculateFlexBasis(boardCols[i], width, colsInRow, breakpoints);
184
+ if (forceResize || !this._oldFlexBasis[i] || this._oldFlexBasis[i] !== newFlexBasis) {
185
+ this._oldFlexBasis[i] = newFlexBasis;
186
+ e.style.flexBasis = newFlexBasis;
187
+ }
188
+ });
189
+ this._oldWidth = width;
190
+ this._oldBreakpoints = breakpoints;
191
+ }
192
+ }
193
+
194
+ /** @private */
195
+ _shouldRecalculate(width, breakpoints) {
196
+ // Should not recalculate if row is invisible
197
+ if (isElementHidden(this)) {
198
+ return false;
199
+ }
200
+ return (
201
+ width !== this._oldWidth ||
202
+ breakpoints.smallSize !== this._oldBreakpoints.smallSize ||
203
+ breakpoints.mediumSize !== this._oldBreakpoints.mediumSize
204
+ );
205
+ }
206
+
207
+ /**
208
+ * Measure the breakpoints in pixels.
209
+ *
210
+ * The breakpoints for `small` and `medium` can be given in any unit: `px`, `em`, `in` etc.
211
+ * We need to know them in `px` so that they are comparable with the actual size.
212
+ *
213
+ * @return {object} object with smallSize and mediumSize number properties, which tells
214
+ * where the row should switch rendering size in pixels.
215
+ * @private
216
+ */
217
+ _measureBreakpointsInPx() {
218
+ // Convert minWidth to px units for comparison
219
+ const breakpoints = {};
220
+ const tmpStyleProp = 'background-position';
221
+ const smallSize = getComputedStyle(this).getPropertyValue('--small-size');
222
+ const mediumSize = getComputedStyle(this).getPropertyValue('--medium-size');
223
+ this.style.setProperty(tmpStyleProp, smallSize);
224
+ breakpoints.smallSize = parseFloat(getComputedStyle(this).getPropertyValue(tmpStyleProp));
225
+ this.style.setProperty(tmpStyleProp, mediumSize);
226
+ breakpoints.mediumSize = parseFloat(getComputedStyle(this).getPropertyValue(tmpStyleProp));
227
+ this.style.removeProperty(tmpStyleProp);
228
+ return breakpoints;
229
+ }
230
+ };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -9,7 +9,7 @@
9
9
  * license.
10
10
  */
11
11
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
- import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
12
+ import { BoardRowMixin } from './vaadin-board-row-mixin.js';
13
13
 
14
14
  /**
15
15
  * `<vaadin-board-row>` is a web component that together with `<vaadin-board>` component allows
@@ -45,17 +45,7 @@ import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
45
45
  * `--vaadin-board-width-small` | Determines the width where mode changes from `small` to `medium` | `600px`
46
46
  * `--vaadin-board-width-medium` | Determines the width where mode changes from `medium` to `large` | `960px`
47
47
  */
48
- declare class BoardRow extends ResizeMixin(ElementMixin(HTMLElement)) {
49
- /**
50
- * Redraws the row, if necessary.
51
- *
52
- * In most cases, a board row will redraw itself if your reconfigure it.
53
- * If you dynamically change breakpoints
54
- * `--vaadin-board-width-small` or `--vaadin-board-width-medium`,
55
- * then you need to call this method.
56
- */
57
- redraw(): void;
58
- }
48
+ declare class BoardRow extends BoardRowMixin(ElementMixin(HTMLElement)) {}
59
49
 
60
50
  declare global {
61
51
  interface HTMLElementTagNameMap {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -9,16 +9,9 @@
9
9
  * license.
10
10
  */
11
11
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
12
- import { isElementHidden } from '@vaadin/a11y-base/src/focus-utils.js';
13
12
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
14
13
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
15
- import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
16
-
17
- const CLASSES = {
18
- SMALL: 'small',
19
- MEDIUM: 'medium',
20
- LARGE: 'large',
21
- };
14
+ import { BoardRowMixin } from './vaadin-board-row-mixin.js';
22
15
 
23
16
  /**
24
17
  * `<vaadin-board-row>` is a web component that together with `<vaadin-board>` component allows
@@ -57,9 +50,9 @@ const CLASSES = {
57
50
  * @customElement
58
51
  * @extends HTMLElement
59
52
  * @mixes ElementMixin
60
- * @mixes ResizeMixin
53
+ * @mixes BoardRowMixin
61
54
  */
62
- class BoardRow extends ResizeMixin(ElementMixin(PolymerElement)) {
55
+ class BoardRow extends BoardRowMixin(ElementMixin(PolymerElement)) {
63
56
  static get template() {
64
57
  return html`
65
58
  <style>
@@ -71,6 +64,10 @@ class BoardRow extends ResizeMixin(ElementMixin(PolymerElement)) {
71
64
  --medium-size: var(--vaadin-board-width-medium, 960px);
72
65
  }
73
66
 
67
+ :host([hidden]) {
68
+ display: none !important;
69
+ }
70
+
74
71
  :host ::slotted(*) {
75
72
  box-sizing: border-box;
76
73
  flex-grow: 1;
@@ -84,211 +81,6 @@ class BoardRow extends ResizeMixin(ElementMixin(PolymerElement)) {
84
81
  static get is() {
85
82
  return 'vaadin-board-row';
86
83
  }
87
-
88
- constructor() {
89
- super();
90
- this._oldWidth = 0;
91
- this._oldBreakpoints = { smallSize: 600, mediumSize: 960 };
92
- this._oldFlexBasis = [];
93
- }
94
-
95
- /** @protected */
96
- ready() {
97
- super.ready();
98
-
99
- this.$.insertionPoint.addEventListener('slotchange', () => this.redraw());
100
- }
101
-
102
- /** @protected */
103
- connectedCallback() {
104
- super.connectedCallback();
105
- this._onResize();
106
- }
107
-
108
- /**
109
- * Adds styles for board row based on width.
110
- * @private
111
- */
112
- _addStyleNames(width, breakpoints) {
113
- if (width < breakpoints.smallSize) {
114
- this.classList.add(CLASSES.SMALL);
115
- this.classList.remove(CLASSES.MEDIUM);
116
- this.classList.remove(CLASSES.LARGE);
117
- } else if (width < breakpoints.mediumSize) {
118
- this.classList.remove(CLASSES.SMALL);
119
- this.classList.add(CLASSES.MEDIUM);
120
- this.classList.remove(CLASSES.LARGE);
121
- } else {
122
- this.classList.remove(CLASSES.SMALL);
123
- this.classList.remove(CLASSES.MEDIUM);
124
- this.classList.add(CLASSES.LARGE);
125
- }
126
- }
127
-
128
- /**
129
- * Calculates flex basis based on colSpan, width and breakpoints.
130
- * @param {number} colSpan colspan value of the row
131
- * @param {number} width width of the row in px
132
- * @param {number} colsInRow number of columns in the row
133
- * @param {object} breakpoints object with smallSize and mediumSize number properties, which tells
134
- * where the row should switch rendering size in pixels.
135
- * @private
136
- */
137
- _calculateFlexBasis(colSpan, width, colsInRow, breakpoints) {
138
- if (width < breakpoints.smallSize) {
139
- colsInRow = 1;
140
- } else if (width < breakpoints.mediumSize && colsInRow === 4) {
141
- colsInRow = 2;
142
- }
143
- let flexBasis = (colSpan / colsInRow) * 100;
144
- flexBasis = flexBasis > 100 ? 100 : flexBasis;
145
- return `${flexBasis}%`;
146
- }
147
-
148
- /** @private */
149
- _reportError() {
150
- const errorMessage = 'The column configuration is not valid; column count should add up to 3 or 4.';
151
- console.warn(errorMessage, `check: \r\n${this.outerHTML}`);
152
- }
153
-
154
- /**
155
- * Parses board-cols from DOM.
156
- * If there is not enough space in the row drop board cols.
157
- * @param {!Array<!Node>} nodes array of nodes
158
- * @return {!Array<number>} array of boardCols
159
- * @private
160
- */
161
- _parseBoardCols(nodes) {
162
- const boardCols = nodes.map((node) => {
163
- if (node.getAttribute('board-cols')) {
164
- return parseInt(node.getAttribute('board-cols'));
165
- }
166
- return 1;
167
- });
168
-
169
- let spaceLeft = 4;
170
- let returnBoardCols = [];
171
- nodes.forEach((_node, i) => {
172
- spaceLeft -= boardCols[i];
173
- });
174
-
175
- if (spaceLeft < 0) {
176
- this._reportError();
177
- boardCols.forEach((_node, i) => {
178
- returnBoardCols[i] = 1;
179
- });
180
- } else {
181
- returnBoardCols = boardCols.slice(0);
182
- }
183
-
184
- return returnBoardCols;
185
- }
186
-
187
- /**
188
- * If there is not enough space in the row.
189
- * Extra items are dropped from DOM.
190
- * @param {!Array<number>} boardCols array of board-cols for every node
191
- * @param {!Array<!Node>} nodes array of nodes
192
- * @return {!Array<!Node>} filtered array of nodes
193
- * @private
194
- */
195
- _removeExtraNodesFromDOM(boardCols, nodes) {
196
- let isErrorReported = false;
197
- let spaceLeft = 4;
198
- const returnNodes = [];
199
- nodes.forEach((node, i) => {
200
- spaceLeft -= boardCols[i];
201
- if (spaceLeft < 0) {
202
- if (!isErrorReported) {
203
- isErrorReported = true;
204
- this._reportError();
205
- }
206
- this.removeChild(node);
207
- } else {
208
- returnNodes[i] = node;
209
- }
210
- });
211
- return returnNodes;
212
- }
213
-
214
- /**
215
- * Redraws the row, if necessary.
216
- *
217
- * In most cases, a board row will redraw itself if your reconfigure it.
218
- * If you dynamically change breakpoints
219
- * --vaadin-board-width-small or --vaadin-board-width-medium,
220
- * then you need to call this method.
221
- */
222
- redraw() {
223
- this._recalculateFlexBasis(true);
224
- }
225
-
226
- /**
227
- * @protected
228
- * @override
229
- */
230
- _onResize() {
231
- this._recalculateFlexBasis(false);
232
- }
233
-
234
- /** @private */
235
- _recalculateFlexBasis(forceResize) {
236
- const width = this.getBoundingClientRect().width;
237
- const breakpoints = this._measureBreakpointsInPx();
238
- if (forceResize || this._shouldRecalculate(width, breakpoints)) {
239
- const nodes = this.$.insertionPoint.assignedNodes({ flatten: true });
240
- const filteredNodes = nodes.filter((node) => node.nodeType === Node.ELEMENT_NODE);
241
- this._addStyleNames(width, breakpoints);
242
- const boardCols = this._parseBoardCols(filteredNodes);
243
- const colsInRow = boardCols.reduce((a, b) => a + b, 0);
244
- this._removeExtraNodesFromDOM(boardCols, filteredNodes).forEach((e, i) => {
245
- const newFlexBasis = this._calculateFlexBasis(boardCols[i], width, colsInRow, breakpoints);
246
- if (forceResize || !this._oldFlexBasis[i] || this._oldFlexBasis[i] !== newFlexBasis) {
247
- this._oldFlexBasis[i] = newFlexBasis;
248
- e.style.flexBasis = newFlexBasis;
249
- }
250
- });
251
- this._oldWidth = width;
252
- this._oldBreakpoints = breakpoints;
253
- }
254
- }
255
-
256
- /** @private */
257
- _shouldRecalculate(width, breakpoints) {
258
- // Should not recalculate if row is invisible
259
- if (isElementHidden(this)) {
260
- return false;
261
- }
262
- return (
263
- width !== this._oldWidth ||
264
- breakpoints.smallSize !== this._oldBreakpoints.smallSize ||
265
- breakpoints.mediumSize !== this._oldBreakpoints.mediumSize
266
- );
267
- }
268
-
269
- /**
270
- * Measure the breakpoints in pixels.
271
- *
272
- * The breakpoints for `small` and `medium` can be given in any unit: `px`, `em`, `in` etc.
273
- * We need to know them in `px` so that they are comparable with the actual size.
274
- *
275
- * @return {object} object with smallSize and mediumSize number properties, which tells
276
- * where the row should switch rendering size in pixels.
277
- * @private
278
- */
279
- _measureBreakpointsInPx() {
280
- // Convert minWidth to px units for comparison
281
- const breakpoints = {};
282
- const tmpStyleProp = 'background-position';
283
- const smallSize = getComputedStyle(this).getPropertyValue('--small-size');
284
- const mediumSize = getComputedStyle(this).getPropertyValue('--medium-size');
285
- this.style.setProperty(tmpStyleProp, smallSize);
286
- breakpoints.smallSize = parseFloat(getComputedStyle(this).getPropertyValue(tmpStyleProp));
287
- this.style.setProperty(tmpStyleProp, mediumSize);
288
- breakpoints.mediumSize = parseFloat(getComputedStyle(this).getPropertyValue(tmpStyleProp));
289
- this.style.removeProperty(tmpStyleProp);
290
- return breakpoints;
291
- }
292
84
  }
293
85
 
294
86
  defineCustomElement(BoardRow);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -44,6 +44,10 @@ class Board extends ElementMixin(PolymerElement) {
44
44
  :host {
45
45
  display: block;
46
46
  }
47
+
48
+ :host([hidden]) {
49
+ display: none !important;
50
+ }
47
51
  </style>
48
52
  <slot></slot>
49
53
  `;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ export * from './vaadin-board-row.js';
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import { css, html, LitElement } from 'lit';
12
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
13
+ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
14
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
15
+ import { BoardRowMixin } from './vaadin-board-row-mixin.js';
16
+
17
+ /**
18
+ * LitElement based version of `<vaadin-board-row>` web component.
19
+ *
20
+ * ## Disclaimer
21
+ *
22
+ * This component is an experiment and not yet a part of Vaadin platform.
23
+ * There is no ETA regarding specific Vaadin version where it'll land.
24
+ */
25
+ class BoardRow extends BoardRowMixin(ElementMixin(PolylitMixin(LitElement))) {
26
+ static get is() {
27
+ return 'vaadin-board-row';
28
+ }
29
+
30
+ static get styles() {
31
+ return css`
32
+ :host {
33
+ display: flex;
34
+ flex-flow: row wrap;
35
+ align-items: stretch;
36
+ --small-size: var(--vaadin-board-width-small, 600px);
37
+ --medium-size: var(--vaadin-board-width-medium, 960px);
38
+ }
39
+
40
+ :host([hidden]) {
41
+ display: none !important;
42
+ }
43
+
44
+ :host ::slotted(*) {
45
+ box-sizing: border-box;
46
+ flex-grow: 1;
47
+ overflow: hidden;
48
+ }
49
+ `;
50
+ }
51
+
52
+ /** @protected */
53
+ render() {
54
+ return html`<slot id="insertionPoint"></slot>`;
55
+ }
56
+ }
57
+
58
+ defineCustomElement(BoardRow);
59
+
60
+ export { BoardRow };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ export * from './vaadin-board.js';
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
10
+ */
11
+ import './vaadin-lit-board-row.js';
12
+ import { css, html, LitElement } from 'lit';
13
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
14
+ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
15
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
16
+ import { BoardRow } from './vaadin-lit-board-row.js';
17
+
18
+ /**
19
+ * LitElement based version of `<vaadin-board>` web component.
20
+ *
21
+ * ## Disclaimer
22
+ *
23
+ * This component is an experiment and not yet a part of Vaadin platform.
24
+ * There is no ETA regarding specific Vaadin version where it'll land.
25
+ */
26
+ class Board extends ElementMixin(PolylitMixin(LitElement)) {
27
+ static get is() {
28
+ return 'vaadin-board';
29
+ }
30
+
31
+ static get cvdlName() {
32
+ return 'vaadin-board';
33
+ }
34
+
35
+ static get styles() {
36
+ return css`
37
+ :host {
38
+ display: block;
39
+ }
40
+
41
+ :host([hidden]) {
42
+ display: none !important;
43
+ }
44
+ `;
45
+ }
46
+
47
+ /** @protected */
48
+ render() {
49
+ return html`<slot></slot>`;
50
+ }
51
+
52
+ /**
53
+ * Redraws the board and all rows inside it, if necessary.
54
+ *
55
+ * In most cases, board will redraw itself if your reconfigure it. If you dynamically change
56
+ * breakpoints `--vaadin-board-width-small` or `--vaadin-board-width-medium`,
57
+ * then you need to call this method.
58
+ */
59
+ redraw() {
60
+ [...this.querySelectorAll('*')].filter((node) => node instanceof BoardRow).forEach((row) => row.redraw());
61
+ }
62
+ }
63
+
64
+ defineCustomElement(Board);
65
+
66
+ export { Board };
@@ -0,0 +1 @@
1
+ import '../../src/vaadin-lit-board-row.js';
@@ -0,0 +1 @@
1
+ import '../../src/vaadin-lit-board-row.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-lit-board-row.js';
2
+ import '../../src/vaadin-lit-board.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-lit-board-row.js';
2
+ import '../../src/vaadin-lit-board.js';
@@ -0,0 +1 @@
1
+ import '../../src/vaadin-lit-board-row.js';
@@ -0,0 +1 @@
1
+ import '../../src/vaadin-lit-board-row.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-lit-board-row.js';
2
+ import '../../src/vaadin-lit-board.js';
@@ -0,0 +1,2 @@
1
+ import './vaadin-lit-board-row.js';
2
+ import '../../src/vaadin-lit-board.js';
@@ -0,0 +1 @@
1
+ export * from './src/vaadin-board-row.js';
@@ -0,0 +1,2 @@
1
+ import './theme/lumo/vaadin-lit-board-row.js';
2
+ export * from './src/vaadin-lit-board-row.js';
@@ -0,0 +1 @@
1
+ export * from './src/vaadin-board.js';
@@ -0,0 +1,2 @@
1
+ import './theme/lumo/vaadin-lit-board.js';
2
+ export * from './src/vaadin-lit-board.js';
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/board",
4
- "version": "24.7.0-alpha3",
4
+ "version": "24.7.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/board",
4
- "version": "24.7.0-alpha3",
4
+ "version": "24.7.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {