-
-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(tree-view): add "Slottable node"
- Loading branch information
Showing
2 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<script> | ||
import { TreeView } from "carbon-components-svelte"; | ||
let activeId = 0; | ||
let selectedIds = [0, 7, 9]; | ||
let children = [ | ||
{ id: 0, text: "AI / Machine learning" }, | ||
{ | ||
id: 1, | ||
text: "Analytics", | ||
children: [ | ||
{ | ||
id: 2, | ||
text: "IBM Analytics Engine", | ||
children: [ | ||
{ id: 3, text: "Apache Spark" }, | ||
{ id: 4, text: "Hadoop" }, | ||
], | ||
}, | ||
{ id: 5, text: "IBM Cloud SQL Query" }, | ||
{ id: 6, text: "IBM Db2 Warehouse on Cloud" }, | ||
], | ||
}, | ||
{ | ||
id: 7, | ||
text: "Blockchain", | ||
children: [{ id: 8, text: "IBM Blockchain Platform" }], | ||
}, | ||
{ | ||
id: 9, | ||
text: "Databases", | ||
children: [ | ||
{ id: 10, text: "IBM Cloud Databases for Elasticsearch" }, | ||
{ id: 11, text: "IBM Cloud Databases for Enterprise DB" }, | ||
{ id: 12, text: "IBM Cloud Databases for MongoDB" }, | ||
{ id: 13, text: "IBM Cloud Databases for PostgreSQL" }, | ||
], | ||
}, | ||
{ | ||
id: 14, | ||
text: "Integration", | ||
disabled: true, | ||
children: [{ id: 15, text: "IBM API Connect", disabled: true }], | ||
}, | ||
]; | ||
</script> | ||
|
||
<TreeView | ||
labelText="Cloud Products" | ||
activeId="{activeId}" | ||
selectedIds="{selectedIds}" | ||
children="{children}" | ||
let:node | ||
> | ||
<span | ||
style:color="{node.selected ? "var(--cds-interactive-04)" : "inherit"}" | ||
style:text-decoration="{node.disabled ? "inherit" : "underline"}" | ||
> | ||
{node.text} (id: {node.id}) | ||
</span> | ||
</TreeView> |