From ea7c0d446e989a9435788a9edacdc0542b683da0 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 26 Mar 2022 11:44:17 -0700 Subject: [PATCH] v0.62.3 --- CHANGELOG.md | 8 ++++++++ COMPONENT_INDEX.md | 28 ++++++++++++++-------------- docs/src/COMPONENT_API.json | 4 ++-- package.json | 2 +- preprocess/api.json | 2 +- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd31e239..8b62f982 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [0.62.3](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.62.3) - 2022-03-26 + +**Fixes** + +- fix `TreeView` filter logic in expandNodes/collapseNodes +- correctly render slotted label in `NumberInput` +- only render expandable `DataTable` row content when expanded + ## [0.62.2](https://github.com/carbon-design-system/carbon-components-svelte/releases/tag/v0.62.2) - 2022-03-23 **Fixes** diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 082c9066..3a14760e 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -1,6 +1,6 @@ # Component Index -> 171 components exported from carbon-components-svelte@0.62.2. +> 171 components exported from carbon-components-svelte@0.62.3. ## Components @@ -4777,19 +4777,19 @@ export interface TreeNode { ### Props -| Prop name | Kind | Reactive | Type | Default value | Description | -| :------------ | :-------------------- | :------- | :------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | -| expandedIds | let | Yes | TreeNodeId[] | [] | Set the node ids to be expanded | -| selectedIds | let | Yes | TreeNodeId[] | [] | Set the node ids to be selected | -| activeId | let | Yes | TreeNodeId | "" | Set the current active node id
Only one node can be active | -| children | let | No | Array | [] | Provide an array of children nodes to render | -| size | let | No | "default" | "compact" | "default" | Specify the TreeView size | -| labelText | let | No | string | "" | Specify the label text | -| hideLabel | let | No | boolean | false | Set to `true` to visually hide the label text | -| expandAll | function | No | () => void | () => { expandedIds = [...nodeIds]; } | Programmatically expand all nodes | -| collapseAll | function | No | () => void | () => { expandedIds = []; } | Programmatically collapse all nodes | -| expandNodes | function | No | (filterId?: (node: TreeNode) => boolean) => void | () => { expandedIds = nodes .filter((node) => !filterNode(node)) .map((node) => node.id); } | Programmatically expand a subset of nodes.
Expands all nodes if no argument is provided | -| collapseNodes | function | No | (filterId?: (node: TreeNode) => boolean) => void | () => { expandedIds = nodes .filter((node) => !filterNode(node)) .map((node) => node.id); } | Programmatically collapse a subset of nodes.
Collapses all nodes if no argument is provided | +| Prop name | Kind | Reactive | Type | Default value | Description | +| :------------ | :-------------------- | :------- | :------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| expandedIds | let | Yes | TreeNodeId[] | [] | Set the node ids to be expanded | +| selectedIds | let | Yes | TreeNodeId[] | [] | Set the node ids to be selected | +| activeId | let | Yes | TreeNodeId | "" | Set the current active node id
Only one node can be active | +| children | let | No | Array | [] | Provide an array of children nodes to render | +| size | let | No | "default" | "compact" | "default" | Specify the TreeView size | +| labelText | let | No | string | "" | Specify the label text | +| hideLabel | let | No | boolean | false | Set to `true` to visually hide the label text | +| expandAll | function | No | () => void | () => { expandedIds = [...nodeIds]; } | Programmatically expand all nodes | +| collapseAll | function | No | () => void | () => { expandedIds = []; } | Programmatically collapse all nodes | +| expandNodes | function | No | (filterId?: (node: TreeNode) => boolean) => void | () => { expandedIds = nodes .filter( (node) => filterNode(node) || node.children?.some((child) => filterNode(child) && child.children) ) .map((node) => node.id); } | Programmatically expand a subset of nodes.
Expands all nodes if no argument is provided | +| collapseNodes | function | No | (filterId?: (node: TreeNode) => boolean) => void | () => { expandedIds = nodes .filter((node) => expandedIds.includes(node.id) && !filterNode(node)) .map((node) => node.id); } | Programmatically collapse a subset of nodes.
Collapses all nodes if no argument is provided | ### Slots diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index eb7625f3..9167e4bb 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -13721,7 +13721,7 @@ "kind": "function", "description": "Programmatically expand a subset of nodes.\nExpands all nodes if no argument is provided", "type": "(filterId?: (node: TreeNode) => boolean) => void", - "value": "() => { expandedIds = nodes .filter((node) => !filterNode(node)) .map((node) => node.id); }", + "value": "() => { expandedIds = nodes .filter( (node) => filterNode(node) || node.children?.some((child) => filterNode(child) && child.children) ) .map((node) => node.id); }", "isFunction": true, "isFunctionDeclaration": true, "constant": false, @@ -13732,7 +13732,7 @@ "kind": "function", "description": "Programmatically collapse a subset of nodes.\nCollapses all nodes if no argument is provided", "type": "(filterId?: (node: TreeNode) => boolean) => void", - "value": "() => { expandedIds = nodes .filter((node) => !filterNode(node)) .map((node) => node.id); }", + "value": "() => { expandedIds = nodes .filter((node) => expandedIds.includes(node.id) && !filterNode(node)) .map((node) => node.id); }", "isFunction": true, "isFunctionDeclaration": true, "constant": false, diff --git a/package.json b/package.json index 9fc219bf..6a5dd745 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "carbon-components-svelte", - "version": "0.62.2", + "version": "0.62.3", "license": "Apache-2.0", "description": "Svelte implementation of the Carbon Design System", "svelte": "./src/index.js", diff --git a/preprocess/api.json b/preprocess/api.json index 5b53bf46..e8c7faf0 100644 --- a/preprocess/api.json +++ b/preprocess/api.json @@ -1,5 +1,5 @@ { - "version": "0.62.2", + "version": "0.62.3", "components": { "Accordion": { "path": "carbon-components-svelte/src/Accordion/Accordion.svelte"