diff --git a/packages/skeleton/src/lib/components/TreeView/TreeView.svelte b/packages/skeleton/src/lib/components/TreeView/TreeView.svelte index e3bea0937..9e4b2dd98 100644 --- a/packages/skeleton/src/lib/components/TreeView/TreeView.svelte +++ b/packages/skeleton/src/lib/components/TreeView/TreeView.svelte @@ -53,10 +53,10 @@ */ export function expandAll(): void { const detailsElements = [...tree.querySelectorAll('details.tree-item')] as HTMLDetailsElement[]; - detailsElements.forEach(details => { - if(!details.open) { - const summary : HTMLElement | null = details.querySelector('summary.tree-item-summary'); - if(summary) summary.click(); + detailsElements.forEach((details) => { + if (!details.open) { + const summary: HTMLElement | null = details.querySelector('summary.tree-item-summary'); + if (summary) summary.click(); } }); } @@ -66,10 +66,10 @@ */ export function collapseAll() { const detailsElements = [...tree.querySelectorAll('details.tree-item')] as HTMLDetailsElement[]; - detailsElements.forEach(details => { - if(details.open) { - const summary : HTMLElement | null = details.querySelector('summary.tree-item-summary'); - if(summary) summary.click(); + detailsElements.forEach((details) => { + if (details.open) { + const summary: HTMLElement | null = details.querySelector('summary.tree-item-summary'); + if (summary) summary.click(); } }); } @@ -79,10 +79,10 @@ */ export function selectAll() { const detailsElements = [...tree.querySelectorAll('details.tree-item')] as HTMLDetailsElement[]; - detailsElements.forEach(details => { - const input : HTMLInputElement | null = details.querySelector('input[type="checkbox"].tree-item-checkbox'); - if(!input) return; - if(!input.checked) { + detailsElements.forEach((details) => { + const input: HTMLInputElement | null = details.querySelector('input[type="checkbox"].tree-item-checkbox'); + if (!input) return; + if (!input.checked) { // needs delay setTimeout(() => { input.click(); @@ -96,10 +96,10 @@ */ export function deselectAll() { const detailsElements = [...tree.querySelectorAll('details.tree-item')] as HTMLDetailsElement[]; - detailsElements.forEach(details => { - const input : HTMLInputElement | null = details.querySelector('input[type="checkbox"].tree-item-checkbox'); - if(!input) return; - if(input.checked){ + detailsElements.forEach((details) => { + const input: HTMLInputElement | null = details.querySelector('input[type="checkbox"].tree-item-checkbox'); + if (!input) return; + if (input.checked) { // needs delay setTimeout(() => { input.click(); @@ -130,6 +130,14 @@ let tree: HTMLDivElement; -
+