@vaadin/grid
Advanced tools
Comparing version 23.0.0-beta3 to 23.0.0-beta4
{ | ||
"name": "@vaadin/grid", | ||
"version": "23.0.0-beta3", | ||
"version": "23.0.0-beta4", | ||
"publishConfig": { | ||
@@ -44,12 +44,12 @@ "access": "public" | ||
"@polymer/polymer": "^3.0.0", | ||
"@vaadin/checkbox": "23.0.0-beta3", | ||
"@vaadin/component-base": "23.0.0-beta3", | ||
"@vaadin/text-field": "23.0.0-beta3", | ||
"@vaadin/vaadin-lumo-styles": "23.0.0-beta3", | ||
"@vaadin/vaadin-material-styles": "23.0.0-beta3", | ||
"@vaadin/vaadin-themable-mixin": "23.0.0-beta3" | ||
"@vaadin/checkbox": "23.0.0-beta4", | ||
"@vaadin/component-base": "23.0.0-beta4", | ||
"@vaadin/text-field": "23.0.0-beta4", | ||
"@vaadin/vaadin-lumo-styles": "23.0.0-beta4", | ||
"@vaadin/vaadin-material-styles": "23.0.0-beta4", | ||
"@vaadin/vaadin-themable-mixin": "23.0.0-beta4" | ||
}, | ||
"devDependencies": { | ||
"@esm-bundle/chai": "^4.3.4", | ||
"@vaadin/polymer-legacy-adapter": "23.0.0-beta3", | ||
"@vaadin/polymer-legacy-adapter": "23.0.0-beta4", | ||
"@vaadin/testing-helpers": "^0.3.2", | ||
@@ -59,3 +59,3 @@ "lit": "^2.0.0", | ||
}, | ||
"gitHead": "4c87216666541f9eb58f56c475964727822aad53" | ||
"gitHead": "d0b447f1c31ca4256a5e26f2dcd27784447ff79b" | ||
} |
@@ -105,2 +105,8 @@ /** | ||
/** | ||
* Path to an item sub-property that indicates whether the item has child items. | ||
* @attr {string} item-has-children-path | ||
*/ | ||
itemHasChildrenPath: string; | ||
/** | ||
* Path to an item sub-property that identifies the item. | ||
@@ -107,0 +113,0 @@ * @attr {string} item-id-path |
@@ -190,2 +190,11 @@ /** | ||
/** | ||
* Path to an item sub-property that indicates whether the item has child items. | ||
* @attr {string} item-has-children-path | ||
*/ | ||
itemHasChildrenPath: { | ||
type: String, | ||
value: 'children' | ||
}, | ||
/** | ||
* Path to an item sub-property that identifies the item. | ||
@@ -192,0 +201,0 @@ * @attr {string} item-id-path |
@@ -219,10 +219,8 @@ /** | ||
// TODO: A tree toggle component should not be the way to determine if the row is expandable | ||
/** @private */ | ||
__isRowExpandable(row) { | ||
const treeToggle = [...row.children].reduce( | ||
(value, cell) => value || cell._content.querySelector('vaadin-grid-tree-toggle'), | ||
null | ||
); | ||
return treeToggle && !treeToggle.expanded && !treeToggle.leaf; | ||
if (this.itemHasChildrenPath) { | ||
const item = row._item; | ||
return item && this.get(this.itemHasChildrenPath, item) && !this._isExpanded(item); | ||
} | ||
} | ||
@@ -229,0 +227,0 @@ |
@@ -31,2 +31,3 @@ /** | ||
* @attr {string} item-has-children-path | ||
* @deprecated Use `grid.itemHasChildrenPath` instead. | ||
*/ | ||
@@ -33,0 +34,0 @@ itemHasChildrenPath: string | null | undefined; |
@@ -37,6 +37,7 @@ /** | ||
* @attr {string} item-has-children-path | ||
* @deprecated Use `grid.itemHasChildrenPath` instead. | ||
*/ | ||
itemHasChildrenPath: { | ||
type: String, | ||
value: 'children' | ||
observer: '_itemHasChildrenPathChanged' | ||
} | ||
@@ -72,3 +73,3 @@ }; | ||
toggle.expanded = expanded; | ||
toggle.leaf = this.__isLeafItem(item, this.itemHasChildrenPath); | ||
toggle.leaf = this.__isLeafItem(item, this._grid.itemHasChildrenPath); | ||
toggle.textContent = this.__getToggleContent(this.path, item); | ||
@@ -89,2 +90,15 @@ toggle.level = level; | ||
/** @private */ | ||
_itemHasChildrenPathChanged(itemHasChildrenPath) { | ||
if (itemHasChildrenPath) { | ||
console.warn( | ||
`WARNING: Since Vaadin 23, itemHasChildrenPath on <vaadin-grid-tree-column> is deprecated. Please set this property on the <vaadin-grid> instead.` | ||
); | ||
if (this._grid) { | ||
this._grid.itemHasChildrenPath = itemHasChildrenPath; | ||
} | ||
} | ||
} | ||
/** | ||
@@ -91,0 +105,0 @@ * Expands or collapses the row once the tree toggle is switched. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
330300
8988
+ Added@vaadin/checkbox@23.0.0-beta4(transitive)
+ Added@vaadin/component-base@23.0.0-beta4(transitive)
+ Added@vaadin/field-base@23.0.0-beta4(transitive)
+ Added@vaadin/icon@23.0.0-beta4(transitive)
+ Added@vaadin/input-container@23.0.0-beta4(transitive)
+ Added@vaadin/text-field@23.0.0-beta4(transitive)
+ Added@vaadin/vaadin-lumo-styles@23.0.0-beta4(transitive)
+ Added@vaadin/vaadin-material-styles@23.0.0-beta4(transitive)
+ Added@vaadin/vaadin-themable-mixin@23.0.0-beta4(transitive)
- Removed@vaadin/checkbox@23.0.0-beta3(transitive)
- Removed@vaadin/component-base@23.0.0-beta3(transitive)
- Removed@vaadin/field-base@23.0.0-beta3(transitive)
- Removed@vaadin/icon@23.0.0-beta3(transitive)
- Removed@vaadin/input-container@23.0.0-beta3(transitive)
- Removed@vaadin/text-field@23.0.0-beta3(transitive)
- Removed@vaadin/vaadin-lumo-styles@23.0.0-beta3(transitive)
- Removed@vaadin/vaadin-material-styles@23.0.0-beta3(transitive)
- Removed@vaadin/vaadin-themable-mixin@23.0.0-beta3(transitive)