@vaadin/board 24.6.5 → 24.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/board",
3
- "version": "24.6.5",
3
+ "version": "24.7.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,13 +38,15 @@
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.6.5",
43
- "@vaadin/component-base": "~24.6.5"
43
+ "@vaadin/a11y-base": "24.7.0-alpha10",
44
+ "@vaadin/component-base": "24.7.0-alpha10",
45
+ "lit": "^3.0.0"
44
46
  },
45
47
  "devDependencies": {
46
- "@vaadin/chai-plugins": "~24.6.5",
47
- "@vaadin/test-runner-commands": "~24.6.5",
48
+ "@vaadin/chai-plugins": "24.7.0-alpha10",
49
+ "@vaadin/test-runner-commands": "24.7.0-alpha10",
48
50
  "@vaadin/testing-helpers": "^1.1.0",
49
51
  "sinon": "^18.0.0"
50
52
  },
@@ -53,5 +55,5 @@
53
55
  "web-types.json",
54
56
  "web-types.lit.json"
55
57
  ],
56
- "gitHead": "fc109a4234a1f60e89717ab1c0dc8fb4451aa418"
58
+ "gitHead": "c0f8933df2a6a40648d3fb9cfbae6bbf86a8aa90"
57
59
  }
@@ -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>
@@ -88,211 +81,6 @@ class BoardRow extends ResizeMixin(ElementMixin(PolymerElement)) {
88
81
  static get is() {
89
82
  return 'vaadin-board-row';
90
83
  }
91
-
92
- constructor() {
93
- super();
94
- this._oldWidth = 0;
95
- this._oldBreakpoints = { smallSize: 600, mediumSize: 960 };
96
- this._oldFlexBasis = [];
97
- }
98
-
99
- /** @protected */
100
- ready() {
101
- super.ready();
102
-
103
- this.$.insertionPoint.addEventListener('slotchange', () => this.redraw());
104
- }
105
-
106
- /** @protected */
107
- connectedCallback() {
108
- super.connectedCallback();
109
- this._onResize();
110
- }
111
-
112
- /**
113
- * Adds styles for board row based on width.
114
- * @private
115
- */
116
- _addStyleNames(width, breakpoints) {
117
- if (width < breakpoints.smallSize) {
118
- this.classList.add(CLASSES.SMALL);
119
- this.classList.remove(CLASSES.MEDIUM);
120
- this.classList.remove(CLASSES.LARGE);
121
- } else if (width < breakpoints.mediumSize) {
122
- this.classList.remove(CLASSES.SMALL);
123
- this.classList.add(CLASSES.MEDIUM);
124
- this.classList.remove(CLASSES.LARGE);
125
- } else {
126
- this.classList.remove(CLASSES.SMALL);
127
- this.classList.remove(CLASSES.MEDIUM);
128
- this.classList.add(CLASSES.LARGE);
129
- }
130
- }
131
-
132
- /**
133
- * Calculates flex basis based on colSpan, width and breakpoints.
134
- * @param {number} colSpan colspan value of the row
135
- * @param {number} width width of the row in px
136
- * @param {number} colsInRow number of columns in the row
137
- * @param {object} breakpoints object with smallSize and mediumSize number properties, which tells
138
- * where the row should switch rendering size in pixels.
139
- * @private
140
- */
141
- _calculateFlexBasis(colSpan, width, colsInRow, breakpoints) {
142
- if (width < breakpoints.smallSize) {
143
- colsInRow = 1;
144
- } else if (width < breakpoints.mediumSize && colsInRow === 4) {
145
- colsInRow = 2;
146
- }
147
- let flexBasis = (colSpan / colsInRow) * 100;
148
- flexBasis = flexBasis > 100 ? 100 : flexBasis;
149
- return `${flexBasis}%`;
150
- }
151
-
152
- /** @private */
153
- _reportError() {
154
- const errorMessage = 'The column configuration is not valid; column count should add up to 3 or 4.';
155
- console.warn(errorMessage, `check: \r\n${this.outerHTML}`);
156
- }
157
-
158
- /**
159
- * Parses board-cols from DOM.
160
- * If there is not enough space in the row drop board cols.
161
- * @param {!Array<!Node>} nodes array of nodes
162
- * @return {!Array<number>} array of boardCols
163
- * @private
164
- */
165
- _parseBoardCols(nodes) {
166
- const boardCols = nodes.map((node) => {
167
- if (node.getAttribute('board-cols')) {
168
- return parseInt(node.getAttribute('board-cols'));
169
- }
170
- return 1;
171
- });
172
-
173
- let spaceLeft = 4;
174
- let returnBoardCols = [];
175
- nodes.forEach((_node, i) => {
176
- spaceLeft -= boardCols[i];
177
- });
178
-
179
- if (spaceLeft < 0) {
180
- this._reportError();
181
- boardCols.forEach((_node, i) => {
182
- returnBoardCols[i] = 1;
183
- });
184
- } else {
185
- returnBoardCols = boardCols.slice(0);
186
- }
187
-
188
- return returnBoardCols;
189
- }
190
-
191
- /**
192
- * If there is not enough space in the row.
193
- * Extra items are dropped from DOM.
194
- * @param {!Array<number>} boardCols array of board-cols for every node
195
- * @param {!Array<!Node>} nodes array of nodes
196
- * @return {!Array<!Node>} filtered array of nodes
197
- * @private
198
- */
199
- _removeExtraNodesFromDOM(boardCols, nodes) {
200
- let isErrorReported = false;
201
- let spaceLeft = 4;
202
- const returnNodes = [];
203
- nodes.forEach((node, i) => {
204
- spaceLeft -= boardCols[i];
205
- if (spaceLeft < 0) {
206
- if (!isErrorReported) {
207
- isErrorReported = true;
208
- this._reportError();
209
- }
210
- this.removeChild(node);
211
- } else {
212
- returnNodes[i] = node;
213
- }
214
- });
215
- return returnNodes;
216
- }
217
-
218
- /**
219
- * Redraws the row, if necessary.
220
- *
221
- * In most cases, a board row will redraw itself if your reconfigure it.
222
- * If you dynamically change breakpoints
223
- * --vaadin-board-width-small or --vaadin-board-width-medium,
224
- * then you need to call this method.
225
- */
226
- redraw() {
227
- this._recalculateFlexBasis(true);
228
- }
229
-
230
- /**
231
- * @protected
232
- * @override
233
- */
234
- _onResize() {
235
- this._recalculateFlexBasis(false);
236
- }
237
-
238
- /** @private */
239
- _recalculateFlexBasis(forceResize) {
240
- const width = this.getBoundingClientRect().width;
241
- const breakpoints = this._measureBreakpointsInPx();
242
- if (forceResize || this._shouldRecalculate(width, breakpoints)) {
243
- const nodes = this.$.insertionPoint.assignedNodes({ flatten: true });
244
- const filteredNodes = nodes.filter((node) => node.nodeType === Node.ELEMENT_NODE);
245
- this._addStyleNames(width, breakpoints);
246
- const boardCols = this._parseBoardCols(filteredNodes);
247
- const colsInRow = boardCols.reduce((a, b) => a + b, 0);
248
- this._removeExtraNodesFromDOM(boardCols, filteredNodes).forEach((e, i) => {
249
- const newFlexBasis = this._calculateFlexBasis(boardCols[i], width, colsInRow, breakpoints);
250
- if (forceResize || !this._oldFlexBasis[i] || this._oldFlexBasis[i] !== newFlexBasis) {
251
- this._oldFlexBasis[i] = newFlexBasis;
252
- e.style.flexBasis = newFlexBasis;
253
- }
254
- });
255
- this._oldWidth = width;
256
- this._oldBreakpoints = breakpoints;
257
- }
258
- }
259
-
260
- /** @private */
261
- _shouldRecalculate(width, breakpoints) {
262
- // Should not recalculate if row is invisible
263
- if (isElementHidden(this)) {
264
- return false;
265
- }
266
- return (
267
- width !== this._oldWidth ||
268
- breakpoints.smallSize !== this._oldBreakpoints.smallSize ||
269
- breakpoints.mediumSize !== this._oldBreakpoints.mediumSize
270
- );
271
- }
272
-
273
- /**
274
- * Measure the breakpoints in pixels.
275
- *
276
- * The breakpoints for `small` and `medium` can be given in any unit: `px`, `em`, `in` etc.
277
- * We need to know them in `px` so that they are comparable with the actual size.
278
- *
279
- * @return {object} object with smallSize and mediumSize number properties, which tells
280
- * where the row should switch rendering size in pixels.
281
- * @private
282
- */
283
- _measureBreakpointsInPx() {
284
- // Convert minWidth to px units for comparison
285
- const breakpoints = {};
286
- const tmpStyleProp = 'background-position';
287
- const smallSize = getComputedStyle(this).getPropertyValue('--small-size');
288
- const mediumSize = getComputedStyle(this).getPropertyValue('--medium-size');
289
- this.style.setProperty(tmpStyleProp, smallSize);
290
- breakpoints.smallSize = parseFloat(getComputedStyle(this).getPropertyValue(tmpStyleProp));
291
- this.style.setProperty(tmpStyleProp, mediumSize);
292
- breakpoints.mediumSize = parseFloat(getComputedStyle(this).getPropertyValue(tmpStyleProp));
293
- this.style.removeProperty(tmpStyleProp);
294
- return breakpoints;
295
- }
296
84
  }
297
85
 
298
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
  *
@@ -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.6.5",
4
+ "version": "24.7.0-alpha10",
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.6.5",
4
+ "version": "24.7.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {