Skip to content

Commit

Permalink
docs(treeview): update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Nov 9, 2024
1 parent bcec1ba commit faa5631
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 82 deletions.
14 changes: 7 additions & 7 deletions docs/src/pages/framed/TreeView/TreeView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
let activeId = "";
let selectedIds = [];
let children = [
let nodes = [
{ id: 0, text: "AI / Machine learning" },
{
id: 1,
text: "Analytics",
children: [
nodes: [
{
id: 2,
text: "IBM Analytics Engine",
children: [
nodes: [
{ id: 3, text: "Apache Spark" },
{ id: 4, text: "Hadoop" },
],
Expand All @@ -24,12 +24,12 @@
{
id: 7,
text: "Blockchain",
children: [{ id: 8, text: "IBM Blockchain Platform" }],
nodes: [{ id: 8, text: "IBM Blockchain Platform" }],
},
{
id: 9,
text: "Databases",
children: [
nodes: [
{ 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" },
Expand All @@ -40,14 +40,14 @@
id: 14,
text: "Integration",
disabled: true,
children: [{ id: 15, text: "IBM API Connect", disabled: true }],
nodes: [{ id: 15, text: "IBM API Connect", disabled: true }],
},
];
</script>

<TreeView
labelText="Cloud Products"
children="{children}"
nodes="{nodes}"
bind:activeId
bind:selectedIds
on:select="{({ detail }) => console.log('select', detail)}"
Expand Down
14 changes: 7 additions & 7 deletions docs/src/pages/framed/TreeView/TreeViewActive.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
let activeId = 0;
let selectedIds = [];
let children = [
let nodes = [
{ id: 0, text: "AI / Machine learning" },
{
id: 1,
text: "Analytics",
children: [
nodes: [
{
id: 2,
text: "IBM Analytics Engine",
children: [
nodes: [
{ id: 3, text: "Apache Spark" },
{ id: 4, text: "Hadoop" },
],
Expand All @@ -24,12 +24,12 @@
{
id: 7,
text: "Blockchain",
children: [{ id: 8, text: "IBM Blockchain Platform" }],
nodes: [{ id: 8, text: "IBM Blockchain Platform" }],
},
{
id: 9,
text: "Databases",
children: [
nodes: [
{ 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" },
Expand All @@ -40,14 +40,14 @@
id: 14,
text: "Integration",
disabled: true,
children: [{ id: 15, text: "IBM API Connect", disabled: true }],
nodes: [{ id: 15, text: "IBM API Connect", disabled: true }],
},
];
</script>

<TreeView
labelText="Cloud Products"
children="{children}"
nodes="{nodes}"
bind:activeId
bind:selectedIds
on:select="{({ detail }) => console.log('select', detail)}"
Expand Down
14 changes: 7 additions & 7 deletions docs/src/pages/framed/TreeView/TreeViewCollapseAll.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
let treeview = null;
let expandedIds = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
let children = [
let nodes = [
{ id: 0, text: "AI / Machine learning" },
{
id: 1,
text: "Analytics",
children: [
nodes: [
{
id: 2,
text: "IBM Analytics Engine",
children: [
nodes: [
{ id: 3, text: "Apache Spark" },
{ id: 4, text: "Hadoop" },
],
Expand All @@ -24,12 +24,12 @@
{
id: 7,
text: "Blockchain",
children: [{ id: 8, text: "IBM Blockchain Platform" }],
nodes: [{ id: 8, text: "IBM Blockchain Platform" }],
},
{
id: 9,
text: "Databases",
children: [
nodes: [
{ 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" },
Expand All @@ -40,7 +40,7 @@
id: 14,
text: "Integration",
disabled: true,
children: [{ id: 15, text: "IBM API Connect", disabled: true }],
nodes: [{ id: 15, text: "IBM API Connect", disabled: true }],
},
];
</script>
Expand All @@ -53,7 +53,7 @@
bind:this="{treeview}"
bind:expandedIds
labelText="Cloud Products"
children="{children}"
nodes="{nodes}"
/>

<style>
Expand Down
14 changes: 7 additions & 7 deletions docs/src/pages/framed/TreeView/TreeViewCollapseNodes.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
let treeview = null;
let expandedIds = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14];
let children = [
let nodes = [
{ id: 0, text: "AI / Machine learning" },
{
id: 1,
text: "Analytics",
disabled: true,
children: [
nodes: [
{
id: 2,
text: "IBM Analytics Engine",
disabled: true,
children: [
nodes: [
{ id: 3, text: "Apache Spark", disabled: true },
{ id: 4, text: "Hadoop", disabled: true },
],
Expand All @@ -26,12 +26,12 @@
{
id: 7,
text: "Blockchain",
children: [{ id: 8, text: "IBM Blockchain Platform" }],
nodes: [{ id: 8, text: "IBM Blockchain Platform" }],
},
{
id: 9,
text: "Databases",
children: [
nodes: [
{ 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" },
Expand All @@ -42,7 +42,7 @@
id: 14,
text: "Integration",
disabled: true,
children: [{ id: 15, text: "IBM API Connect", disabled: true }],
nodes: [{ id: 15, text: "IBM API Connect", disabled: true }],
},
];
</script>
Expand All @@ -61,7 +61,7 @@
bind:this="{treeview}"
bind:expandedIds
labelText="Cloud Products"
children="{children}"
nodes="{nodes}"
/>

<style>
Expand Down
14 changes: 7 additions & 7 deletions docs/src/pages/framed/TreeView/TreeViewCompact.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
let activeId = 0;
let selectedIds = [];
let children = [
let nodes = [
{ id: 0, text: "AI / Machine learning" },
{
id: 1,
text: "Analytics",
children: [
nodes: [
{
id: 2,
text: "IBM Analytics Engine",
children: [
nodes: [
{ id: 3, text: "Apache Spark" },
{ id: 4, text: "Hadoop" },
],
Expand All @@ -24,12 +24,12 @@
{
id: 7,
text: "Blockchain",
children: [{ id: 8, text: "IBM Blockchain Platform" }],
nodes: [{ id: 8, text: "IBM Blockchain Platform" }],
},
{
id: 9,
text: "Databases",
children: [
nodes: [
{ 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" },
Expand All @@ -40,15 +40,15 @@
id: 14,
text: "Integration",
disabled: true,
children: [{ id: 15, text: "IBM API Connect", disabled: true }],
nodes: [{ id: 15, text: "IBM API Connect", disabled: true }],
},
];
</script>

<TreeView
size="compact"
labelText="Cloud Products"
children="{children}"
nodes="{nodes}"
bind:activeId
bind:selectedIds
on:select="{({ detail }) => console.log('select', detail)}"
Expand Down
14 changes: 7 additions & 7 deletions docs/src/pages/framed/TreeView/TreeViewExpandAll.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
import { TreeView, Button } from "carbon-components-svelte";
let treeview = null;
let children = [
let nodes = [
{ id: 0, text: "AI / Machine learning" },
{
id: 1,
text: "Analytics",
children: [
nodes: [
{
id: 2,
text: "IBM Analytics Engine",
children: [
nodes: [
{ id: 3, text: "Apache Spark" },
{ id: 4, text: "Hadoop" },
],
Expand All @@ -23,12 +23,12 @@
{
id: 7,
text: "Blockchain",
children: [{ id: 8, text: "IBM Blockchain Platform" }],
nodes: [{ id: 8, text: "IBM Blockchain Platform" }],
},
{
id: 9,
text: "Databases",
children: [
nodes: [
{ 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" },
Expand All @@ -39,7 +39,7 @@
id: 14,
text: "Integration",
disabled: true,
children: [{ id: 15, text: "IBM API Connect", disabled: true }],
nodes: [{ id: 15, text: "IBM API Connect", disabled: true }],
},
];
</script>
Expand All @@ -51,7 +51,7 @@
<TreeView
bind:this="{treeview}"
labelText="Cloud Products"
children="{children}"
nodes="{nodes}"
/>

<style>
Expand Down
14 changes: 7 additions & 7 deletions docs/src/pages/framed/TreeView/TreeViewExpandNodes.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
import { TreeView, Button } from "carbon-components-svelte";
let treeview = null;
let children = [
let nodes = [
{ id: 0, text: "AI / Machine learning" },
{
id: 1,
text: "Analytics",
children: [
nodes: [
{
id: 2,
text: "IBM Analytics Engine",
children: [
nodes: [
{ id: 3, text: "Apache Spark" },
{ id: 4, text: "Hadoop" },
],
Expand All @@ -23,12 +23,12 @@
{
id: 7,
text: "Blockchain",
children: [{ id: 8, text: "IBM Blockchain Platform" }],
nodes: [{ id: 8, text: "IBM Blockchain Platform" }],
},
{
id: 9,
text: "Databases",
children: [
nodes: [
{ 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" },
Expand All @@ -39,7 +39,7 @@
id: 14,
text: "Integration",
disabled: true,
children: [{ id: 15, text: "IBM API Connect", disabled: true }],
nodes: [{ id: 15, text: "IBM API Connect", disabled: true }],
},
];
</script>
Expand All @@ -57,7 +57,7 @@
<TreeView
bind:this="{treeview}"
labelText="Cloud Products"
children="{children}"
nodes="{nodes}"
/>

<style>
Expand Down
Loading

0 comments on commit faa5631

Please sign in to comment.