mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-17 11:11:25 +00:00
chore: format files with Prettier 3
This commit is contained in:
parent
1dcd09bd98
commit
8e996dc683
391 changed files with 3725 additions and 3785 deletions
|
@ -47,12 +47,12 @@
|
|||
|
||||
<TreeView
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
{nodes}
|
||||
bind:activeId
|
||||
bind:selectedIds
|
||||
on:select="{({ detail }) => console.log('select', detail)}"
|
||||
on:toggle="{({ detail }) => console.log('toggle', detail)}"
|
||||
on:focus="{({ detail }) => console.log('focus', detail)}"
|
||||
on:select={({ detail }) => console.log("select", detail)}
|
||||
on:toggle={({ detail }) => console.log("toggle", detail)}
|
||||
on:focus={({ detail }) => console.log("focus", detail)}
|
||||
/>
|
||||
|
||||
<div>Active node id: {activeId}</div>
|
||||
|
|
|
@ -47,12 +47,12 @@
|
|||
|
||||
<TreeView
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
{nodes}
|
||||
bind:activeId
|
||||
bind:selectedIds
|
||||
on:select="{({ detail }) => console.log('select', detail)}"
|
||||
on:toggle="{({ detail }) => console.log('toggle', detail)}"
|
||||
on:focus="{({ detail }) => console.log('focus', detail)}"
|
||||
on:select={({ detail }) => console.log("select", detail)}
|
||||
on:toggle={({ detail }) => console.log("toggle", detail)}
|
||||
on:focus={({ detail }) => console.log("focus", detail)}
|
||||
/>
|
||||
|
||||
<div>Active node id: {activeId}</div>
|
||||
|
|
|
@ -46,14 +46,14 @@
|
|||
</script>
|
||||
|
||||
<div>
|
||||
<Button on:click="{treeview?.collapseAll}">Collapse all</Button>
|
||||
<Button on:click={treeview?.collapseAll}>Collapse all</Button>
|
||||
</div>
|
||||
|
||||
<TreeView
|
||||
bind:this="{treeview}"
|
||||
bind:this={treeview}
|
||||
bind:expandedIds
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
{nodes}
|
||||
/>
|
||||
|
||||
<style>
|
||||
|
|
|
@ -49,19 +49,19 @@
|
|||
|
||||
<div>
|
||||
<Button
|
||||
on:click="{() => {
|
||||
on:click={() => {
|
||||
treeview?.collapseNodes((node) => node.disabled);
|
||||
}}"
|
||||
}}
|
||||
>
|
||||
Collapse disabled nodes
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<TreeView
|
||||
bind:this="{treeview}"
|
||||
bind:this={treeview}
|
||||
bind:expandedIds
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
{nodes}
|
||||
/>
|
||||
|
||||
<style>
|
||||
|
|
|
@ -48,12 +48,12 @@
|
|||
<TreeView
|
||||
size="compact"
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
{nodes}
|
||||
bind:activeId
|
||||
bind:selectedIds
|
||||
on:select="{({ detail }) => console.log('select', detail)}"
|
||||
on:toggle="{({ detail }) => console.log('toggle', detail)}"
|
||||
on:focus="{({ detail }) => console.log('focus', detail)}"
|
||||
on:select={({ detail }) => console.log("select", detail)}
|
||||
on:toggle={({ detail }) => console.log("toggle", detail)}
|
||||
on:focus={({ detail }) => console.log("focus", detail)}
|
||||
/>
|
||||
|
||||
<div>Active node id: {activeId}</div>
|
||||
|
|
|
@ -45,14 +45,10 @@
|
|||
</script>
|
||||
|
||||
<div>
|
||||
<Button on:click="{treeview?.expandAll}">Expand all</Button>
|
||||
<Button on:click={treeview?.expandAll}>Expand all</Button>
|
||||
</div>
|
||||
|
||||
<TreeView
|
||||
bind:this="{treeview}"
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
/>
|
||||
<TreeView bind:this={treeview} labelText="Cloud Products" {nodes} />
|
||||
|
||||
<style>
|
||||
div {
|
||||
|
|
|
@ -46,19 +46,15 @@
|
|||
|
||||
<div>
|
||||
<Button
|
||||
on:click="{() => {
|
||||
on:click={() => {
|
||||
treeview?.expandNodes((node) => /^IBM/.test(node.text));
|
||||
}}"
|
||||
}}
|
||||
>
|
||||
Expand nodes starting with "IBM"
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<TreeView
|
||||
bind:this="{treeview}"
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
/>
|
||||
<TreeView bind:this={treeview} labelText="Cloud Products" {nodes} />
|
||||
|
||||
<style>
|
||||
div {
|
||||
|
|
|
@ -48,13 +48,13 @@
|
|||
|
||||
<TreeView
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
{nodes}
|
||||
bind:activeId
|
||||
bind:selectedIds
|
||||
bind:expandedIds
|
||||
on:select="{({ detail }) => console.log('select', detail)}"
|
||||
on:toggle="{({ detail }) => console.log('toggle', detail)}"
|
||||
on:focus="{({ detail }) => console.log('focus', detail)}"
|
||||
on:select={({ detail }) => console.log("select", detail)}
|
||||
on:toggle={({ detail }) => console.log("toggle", detail)}
|
||||
on:focus={({ detail }) => console.log("focus", detail)}
|
||||
/>
|
||||
|
||||
<div>Active node id: {activeId}</div>
|
||||
|
|
|
@ -76,12 +76,12 @@
|
|||
|
||||
<TreeView
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
{nodes}
|
||||
bind:activeId
|
||||
bind:selectedIds
|
||||
on:select="{({ detail }) => console.log('select', detail)}"
|
||||
on:toggle="{({ detail }) => console.log('toggle', detail)}"
|
||||
on:focus="{({ detail }) => console.log('focus', detail)}"
|
||||
on:select={({ detail }) => console.log("select", detail)}
|
||||
on:toggle={({ detail }) => console.log("toggle", detail)}
|
||||
on:focus={({ detail }) => console.log("focus", detail)}
|
||||
/>
|
||||
|
||||
<div>Active node id: {activeId}</div>
|
||||
|
|
|
@ -47,12 +47,12 @@
|
|||
|
||||
<TreeView
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
{nodes}
|
||||
bind:activeId
|
||||
bind:selectedIds
|
||||
on:select="{({ detail }) => console.log('select', detail)}"
|
||||
on:toggle="{({ detail }) => console.log('toggle', detail)}"
|
||||
on:focus="{({ detail }) => console.log('focus', detail)}"
|
||||
on:select={({ detail }) => console.log("select", detail)}
|
||||
on:toggle={({ detail }) => console.log("toggle", detail)}
|
||||
on:focus={({ detail }) => console.log("focus", detail)}
|
||||
/>
|
||||
|
||||
<div>Active node id: {activeId}</div>
|
||||
|
|
|
@ -31,19 +31,14 @@
|
|||
<ButtonSet style="margin-bottom: var(--cds-spacing-05)">
|
||||
{#each [nodeSpark, nodeBlockchain] as { id, text }}
|
||||
<Button
|
||||
on:click="{() => {
|
||||
on:click={() => {
|
||||
treeview?.showNode(id);
|
||||
}}"
|
||||
}}
|
||||
>
|
||||
Show "{text}"
|
||||
</Button>
|
||||
{/each}
|
||||
<Button kind="tertiary" on:click="{treeview.collapseAll}">Collapse all</Button
|
||||
>
|
||||
<Button kind="tertiary" on:click={treeview.collapseAll}>Collapse all</Button>
|
||||
</ButtonSet>
|
||||
|
||||
<TreeView
|
||||
bind:this="{treeview}"
|
||||
labelText="Cloud Products"
|
||||
nodes="{nodes}"
|
||||
/>
|
||||
<TreeView bind:this={treeview} labelText="Cloud Products" {nodes} />
|
||||
|
|
|
@ -45,16 +45,10 @@
|
|||
];
|
||||
</script>
|
||||
|
||||
<TreeView
|
||||
labelText="Cloud Products"
|
||||
activeId="{activeId}"
|
||||
selectedIds="{selectedIds}"
|
||||
nodes="{nodes}"
|
||||
let:node
|
||||
>
|
||||
<TreeView labelText="Cloud Products" {activeId} {selectedIds} {nodes} let:node>
|
||||
<span
|
||||
style:color="{node.selected ? "var(--cds-interactive-04)" : "inherit"}"
|
||||
style:text-decoration="{node.disabled ? "inherit" : "underline"}"
|
||||
style:color={node.selected ? "var(--cds-interactive-04)" : "inherit"}
|
||||
style:text-decoration={node.disabled ? "inherit" : "underline"}
|
||||
>
|
||||
{node.text} (id: {node.id})
|
||||
</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue