@vaadin/vaadin-board 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -12
- package/package.json +8 -4
- package/src/vaadin-board-row.js +32 -3
- package/src/vaadin-board.js +5 -1
package/README.md
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
[](https://github.com/vaadin/vaadin-board/releases)
|
|
3
|
-
[](https://travis-ci.org/vaadin/vaadin-board)
|
|
4
|
-
[](https://gitter.im/vaadin/web-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
|
5
|
-
|
|
6
|
-
[](https://vaadin.com/directory/component/vaadinvaadin-board)
|
|
7
|
-
[](https://vaadin.com/directory/component/vaadinvaadin-board)
|
|
1
|
+
# \<vaadin-board\>
|
|
8
2
|
|
|
3
|
+
> ⚠️ Starting from Vaadin 20, the source code and issues for this component are migrated to the [`vaadin/web-components`](https://github.com/vaadin/web-components/tree/master/packages/vaadin-board) monorepository.
|
|
4
|
+
> This repository contains the source code and releases of `<vaadin-board>` for the Vaadin versions 10 to 19.
|
|
9
5
|
|
|
10
|
-
|
|
6
|
+
[<vaadin-board>](https://vaadin.com/components/vaadin-board) is a Web component to create flexible responsive layouts and build nice looking dashboard.
|
|
7
|
+
Vaadin Board key feature is how it effectively reorders the widgets on different screen sizes, maximizing the use of space and looking stunning.
|
|
11
8
|
|
|
12
9
|
[Live Demo ↗](https://vaadin.com/components/vaadin-board/html-examples)
|
|
13
10
|
|
|
|
14
11
|
[API documentation ↗](https://vaadin.com/components/vaadin-board/html-api)
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
[
|
|
18
|
-
|
|
13
|
+
[](https://www.npmjs.com/package/@vaadin/vaadin-board)
|
|
14
|
+
[](https://vaadin.com/directory/component/vaadinvaadin-board)
|
|
15
|
+
[](https://discord.gg/PHmkCKC)
|
|
19
16
|
|
|
20
17
|
```html
|
|
21
18
|
<vaadin-board>
|
|
@@ -53,7 +50,7 @@ are only published on npm, not pushed to GitHub repositories.
|
|
|
53
50
|
|
|
54
51
|
### Polymer 2 and HTML Imports compatible version
|
|
55
52
|
|
|
56
|
-
Install `vaadin-board`:
|
|
53
|
+
Install `vaadin-board`:
|
|
57
54
|
|
|
58
55
|
```sh
|
|
59
56
|
$ bower i vaadin/vaadin-board --save
|
package/package.json
CHANGED
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
"repository": "vaadin/vaadin-board",
|
|
14
14
|
"homepage": "https://vaadin.com/components",
|
|
15
15
|
"name": "@vaadin/vaadin-board",
|
|
16
|
-
"version": "2.2.
|
|
16
|
+
"version": "2.2.2",
|
|
17
17
|
"main": "vaadin-board.js",
|
|
18
18
|
"author": "Vaadin Ltd",
|
|
19
19
|
"license": "https://raw.githubusercontent.com/vaadin/vaadin-board/master/LICENSE.txt",
|
|
20
|
+
"cvdlName": "vaadin-board",
|
|
20
21
|
"bugs": {
|
|
21
22
|
"url": "https://github.com/vaadin/vaadin-board/issues"
|
|
22
23
|
},
|
|
@@ -38,10 +39,9 @@
|
|
|
38
39
|
"@vaadin/vaadin-license-checker": "^2.1.0",
|
|
39
40
|
"@vaadin/vaadin-element-mixin": "^2.4.1"
|
|
40
41
|
},
|
|
41
|
-
"scripts": {
|
|
42
|
-
"generate-typings": "gen-typescript-declarations --outDir . --verify"
|
|
43
|
-
},
|
|
44
42
|
"devDependencies": {
|
|
43
|
+
"@web-padawan/gen-typescript-declarations": "^1.6.2",
|
|
44
|
+
"web-component-tester": "6.9.2",
|
|
45
45
|
"@polymer/app-layout": "^3.0.0",
|
|
46
46
|
"wct-browser-legacy": "^1.0.1",
|
|
47
47
|
"@webcomponents/webcomponentsjs": "^2.0.0",
|
|
@@ -49,5 +49,9 @@
|
|
|
49
49
|
"@polymer/iron-icon": "^3.0.0",
|
|
50
50
|
"@vaadin/vaadin-lumo-styles": "^1.6.0",
|
|
51
51
|
"@polymer/iron-component-page": "^4.0.0"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"generate-typings": "gen-typescript-declarations --outDir . --verify",
|
|
55
|
+
"test": "wct --npm"
|
|
52
56
|
}
|
|
53
57
|
}
|
package/src/vaadin-board-row.js
CHANGED
|
@@ -232,9 +232,7 @@ class BoardRowElement extends ElementMixin(mixinBehaviors([IronResizableBehavior
|
|
|
232
232
|
_recalculateFlexBasis(forceResize) {
|
|
233
233
|
const width = this.getBoundingClientRect().width;
|
|
234
234
|
const breakpoints = this._measureBreakpointsInPx();
|
|
235
|
-
if (forceResize || width
|
|
236
|
-
|| breakpoints.smallSize != this._oldBreakpoints.smallSize
|
|
237
|
-
|| breakpoints.mediumSize != this._oldBreakpoints.mediumSize) {
|
|
235
|
+
if (forceResize || this._shouldRecalculate(width, breakpoints)) {
|
|
238
236
|
const nodes = this.$.insertionPoint.assignedNodes({ flatten: true });
|
|
239
237
|
const isElementNode = function (node) {
|
|
240
238
|
return !((node.nodeType === node.TEXT_NODE)
|
|
@@ -257,6 +255,37 @@ class BoardRowElement extends ElementMixin(mixinBehaviors([IronResizableBehavior
|
|
|
257
255
|
}
|
|
258
256
|
}
|
|
259
257
|
|
|
258
|
+
/** @private */
|
|
259
|
+
_shouldRecalculate(width, breakpoints) {
|
|
260
|
+
// Should not recalculate if row is invisible
|
|
261
|
+
if (this._isElementHidden()) {
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
return (
|
|
265
|
+
width !== this._oldWidth ||
|
|
266
|
+
breakpoints.smallSize !== this._oldBreakpoints.smallSize ||
|
|
267
|
+
breakpoints.mediumSize !== this._oldBreakpoints.mediumSize
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** @private */
|
|
272
|
+
_isElementHidden() {
|
|
273
|
+
// `offsetParent` is `null` when the element itself
|
|
274
|
+
// or one of its ancestors is hidden with `display: none`.
|
|
275
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
|
|
276
|
+
// However `offsetParent` is also null when the element is using fixed
|
|
277
|
+
// positioning, so additionally check if the element takes up layout space.
|
|
278
|
+
if (this.offsetParent === null && this.clientWidth === 0 && this.clientHeight === 0) {
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
281
|
+
// Check inline style first to save a re-flow.
|
|
282
|
+
if (this.style.visibility === 'hidden' || this.style.display === 'none') {
|
|
283
|
+
return true;
|
|
284
|
+
}
|
|
285
|
+
const computedStyle = window.getComputedStyle(this);
|
|
286
|
+
return computedStyle.visibility === 'hidden' || computedStyle.display === 'none';
|
|
287
|
+
}
|
|
288
|
+
|
|
260
289
|
/**
|
|
261
290
|
* Measure the breakpoints in pixels.
|
|
262
291
|
*
|
package/src/vaadin-board.js
CHANGED