compote-ui 0.2.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/button.svelte +16 -0
- package/dist/components/button/{Button.svelte.d.ts → button.svelte.d.ts} +3 -2
- package/dist/components/button/button.variants.d.ts +46 -0
- package/dist/components/button/button.variants.js +20 -0
- package/dist/components/carousel/carousel.svelte +120 -0
- package/dist/components/carousel/carousel.svelte.d.ts +19 -0
- package/dist/components/checkbox/{Checkbox-group.svelte → checkbox-group.svelte} +1 -1
- package/dist/components/checkbox/{Checkbox.svelte → checkbox.svelte} +6 -2
- package/dist/components/combobox/{Combobox.svelte → combobox.svelte} +22 -25
- package/dist/components/combobox/types.d.ts +1 -1
- package/dist/components/dialog/alert-dialog.svelte +73 -0
- package/dist/components/dialog/alert-dialog.svelte.d.ts +13 -0
- package/dist/components/dialog/dialog.svelte +68 -0
- package/dist/components/dialog/dialog.svelte.d.ts +14 -0
- package/dist/components/field/field-error-text.svelte +11 -0
- package/dist/components/field/field-error-text.svelte.d.ts +4 -0
- package/dist/components/field/field-helper-text.svelte +11 -0
- package/dist/components/field/field-helper-text.svelte.d.ts +4 -0
- package/dist/components/field/field-input.svelte +38 -0
- package/dist/components/field/field-input.svelte.d.ts +4 -0
- package/dist/components/field/field-label.svelte +18 -0
- package/dist/components/field/field-label.svelte.d.ts +4 -0
- package/dist/components/field/field-textarea.svelte +16 -0
- package/dist/components/field/field-textarea.svelte.d.ts +4 -0
- package/dist/components/field/field.svelte +11 -0
- package/dist/components/field/field.svelte.d.ts +5 -0
- package/dist/components/field/index.d.ts +7 -0
- package/dist/components/field/index.js +6 -0
- package/dist/components/field/types.d.ts +22 -0
- package/dist/components/field/types.js +1 -0
- package/dist/components/file-upload/basic-document.svelte +89 -0
- package/dist/components/file-upload/basic-document.svelte.d.ts +4 -0
- package/dist/components/file-upload/basic.svelte +50 -0
- package/dist/components/file-upload/basic.svelte.d.ts +18 -0
- package/dist/components/file-upload/dropzone.svelte +26 -0
- package/dist/components/file-upload/dropzone.svelte.d.ts +4 -0
- package/dist/components/file-upload/files-list.svelte +97 -0
- package/dist/components/file-upload/files-list.svelte.d.ts +18 -0
- package/dist/components/file-upload/icons.d.ts +3 -0
- package/dist/components/file-upload/icons.js +39 -0
- package/dist/components/file-upload/types.d.ts +6 -0
- package/dist/components/file-upload/types.js +1 -0
- package/dist/components/file-upload/utils.d.ts +13 -0
- package/dist/components/file-upload/utils.js +18 -0
- package/dist/components/image-cropper/image-cropper.svelte +109 -0
- package/dist/components/image-cropper/image-cropper.svelte.d.ts +5 -0
- package/dist/components/image-cropper/types.d.ts +16 -0
- package/dist/components/image-cropper/types.js +1 -0
- package/dist/components/listbox/listbox.svelte +116 -0
- package/dist/components/listbox/listbox.svelte.d.ts +27 -0
- package/dist/components/listbox/types.d.ts +16 -0
- package/dist/components/listbox/types.js +1 -0
- package/dist/components/menu/index.d.ts +14 -0
- package/dist/components/menu/index.js +14 -0
- package/dist/components/menu/menu-checkbox-item.svelte +31 -0
- package/dist/components/menu/menu-checkbox-item.svelte.d.ts +12 -0
- package/dist/components/menu/menu-content.svelte +23 -0
- package/dist/components/menu/menu-content.svelte.d.ts +8 -0
- package/dist/components/menu/menu-context-trigger.svelte +20 -0
- package/dist/components/menu/menu-context-trigger.svelte.d.ts +8 -0
- package/dist/components/menu/menu-indicator.svelte +19 -0
- package/dist/components/menu/menu-indicator.svelte.d.ts +9 -0
- package/dist/components/menu/menu-item-group-label.svelte +17 -0
- package/dist/components/menu/menu-item-group-label.svelte.d.ts +9 -0
- package/dist/components/menu/menu-item-group.svelte +14 -0
- package/dist/components/menu/menu-item-group.svelte.d.ts +9 -0
- package/dist/components/menu/menu-item-indicator.svelte +14 -0
- package/dist/components/menu/menu-item-indicator.svelte.d.ts +9 -0
- package/dist/components/menu/menu-item.svelte +20 -0
- package/dist/components/menu/menu-item.svelte.d.ts +9 -0
- package/dist/components/menu/menu-radio-item-group.svelte +14 -0
- package/dist/components/menu/menu-radio-item-group.svelte.d.ts +9 -0
- package/dist/components/menu/menu-radio-item.svelte +28 -0
- package/dist/components/menu/menu-radio-item.svelte.d.ts +10 -0
- package/dist/components/menu/menu-separator.svelte +11 -0
- package/dist/components/menu/menu-separator.svelte.d.ts +7 -0
- package/dist/components/menu/menu-trigger-item.svelte +20 -0
- package/dist/components/menu/menu-trigger-item.svelte.d.ts +9 -0
- package/dist/components/menu/menu-trigger.svelte +19 -0
- package/dist/components/menu/menu-trigger.svelte.d.ts +12 -0
- package/dist/components/menu/menu.svelte +12 -0
- package/dist/components/menu/menu.svelte.d.ts +4 -0
- package/dist/components/number-input/number-input.svelte +67 -0
- package/dist/components/number-input/number-input.svelte.d.ts +5 -0
- package/dist/components/number-input/types.d.ts +7 -0
- package/dist/components/number-input/types.js +1 -0
- package/dist/components/select/select.svelte +93 -0
- package/dist/components/select/select.svelte.d.ts +26 -0
- package/dist/components/select/types.d.ts +13 -0
- package/dist/components/select/types.js +1 -0
- package/dist/components/splitter/splitter.svelte +60 -0
- package/dist/components/splitter/splitter.svelte.d.ts +5 -0
- package/dist/components/splitter/types.d.ts +9 -0
- package/dist/components/splitter/types.js +1 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/switch/switch.svelte +40 -0
- package/dist/components/switch/switch.svelte.d.ts +8 -0
- package/dist/components/switch/types.d.ts +5 -0
- package/dist/components/switch/types.js +1 -0
- package/dist/components/tabs/index.d.ts +4 -0
- package/dist/components/tabs/index.js +3 -0
- package/dist/components/tabs/tab-content.svelte +18 -0
- package/dist/components/tabs/tab-content.svelte.d.ts +7 -0
- package/dist/components/tabs/tab-trigger.svelte +18 -0
- package/dist/components/tabs/tab-trigger.svelte.d.ts +7 -0
- package/dist/components/tabs/tabs.svelte +39 -0
- package/dist/components/tabs/tabs.svelte.d.ts +5 -0
- package/dist/components/tabs/types.d.ts +8 -0
- package/dist/components/tabs/types.js +1 -0
- package/dist/components/tree-view/tree-view.svelte +210 -0
- package/dist/components/tree-view/tree-view.svelte.d.ts +26 -0
- package/dist/components/tree-view/types.d.ts +12 -0
- package/dist/components/tree-view/types.js +1 -0
- package/dist/icons/PhArrowLeft.svelte +18 -0
- package/dist/icons/PhArrowLeft.svelte.d.ts +5 -0
- package/dist/icons/PhArrowRight.svelte +18 -0
- package/dist/icons/PhArrowRight.svelte.d.ts +5 -0
- package/dist/icons/PhArrowsInSimple.svelte +17 -0
- package/dist/icons/PhArrowsInSimple.svelte.d.ts +5 -0
- package/dist/icons/PhCaretDown.svelte +2 -1
- package/dist/icons/PhCaretRight.svelte +17 -0
- package/dist/icons/PhCaretRight.svelte.d.ts +5 -0
- package/dist/icons/PhCaretUp.svelte +18 -0
- package/dist/icons/PhCaretUp.svelte.d.ts +5 -0
- package/dist/icons/PhCheck.svelte +2 -1
- package/dist/icons/PhFile.svelte +19 -0
- package/dist/icons/PhFile.svelte.d.ts +5 -0
- package/dist/icons/PhFileArchive.svelte +18 -0
- package/dist/icons/PhFileArchive.svelte.d.ts +5 -0
- package/dist/icons/PhFileText.svelte +18 -0
- package/dist/icons/PhFileText.svelte.d.ts +5 -0
- package/dist/icons/PhHeadphones.svelte +17 -0
- package/dist/icons/PhHeadphones.svelte.d.ts +5 -0
- package/dist/icons/PhImage.svelte +18 -0
- package/dist/icons/PhImage.svelte.d.ts +5 -0
- package/dist/icons/PhListMagnifyingGlass.svelte +17 -0
- package/dist/icons/PhListMagnifyingGlass.svelte.d.ts +5 -0
- package/dist/icons/PhMagnifyingGlass.svelte +17 -0
- package/dist/icons/PhMagnifyingGlass.svelte.d.ts +5 -0
- package/dist/icons/PhMicrosoftExcelLogo.svelte +17 -0
- package/dist/icons/PhMicrosoftExcelLogo.svelte.d.ts +5 -0
- package/dist/icons/PhStar.svelte +18 -0
- package/dist/icons/PhStar.svelte.d.ts +5 -0
- package/dist/icons/PhUploadSimple.svelte +18 -0
- package/dist/icons/PhUploadSimple.svelte.d.ts +5 -0
- package/dist/icons/PhUser.svelte +18 -0
- package/dist/icons/PhUser.svelte.d.ts +5 -0
- package/dist/icons/PhVideoCamera.svelte +17 -0
- package/dist/icons/PhVideoCamera.svelte.d.ts +5 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.js +17 -4
- package/dist/open-props/props.colors-oklch-hues.css +14 -0
- package/dist/open-props/props.colors-oklch.css +19 -0
- package/dist/open-props/props.gray-oklch.css +18 -0
- package/dist/theme.css +19 -5
- package/package.json +4 -3
- package/dist/components/button/Button.svelte +0 -33
- package/dist/gray-oklch.min.css +0 -1
- package/dist/green-hsl.min.css +0 -1
- package/dist/props.colors-oklch-hues.css +0 -14
- package/dist/props.colors-oklch.css +0 -19
- package/dist/props.gray-oklch.css +0 -18
- /package/dist/components/checkbox/{Checkbox-group.svelte.d.ts → checkbox-group.svelte.d.ts} +0 -0
- /package/dist/components/checkbox/{Checkbox.svelte.d.ts → checkbox.svelte.d.ts} +0 -0
- /package/dist/components/combobox/{Combobox.svelte.d.ts → combobox.svelte.d.ts} +0 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<script lang="ts" generics="T extends TreeNode">
|
|
2
|
+
import { TreeView, createTreeCollection } from '@ark-ui/svelte/tree-view';
|
|
3
|
+
import { useFilter } from '@ark-ui/svelte/locale';
|
|
4
|
+
import type { TreeNode, TreeViewProps } from './types';
|
|
5
|
+
import { Debounced } from 'runed';
|
|
6
|
+
import PhX from '../../icons/PhX.svelte';
|
|
7
|
+
import PhCaretRight from '../../icons/PhCaretRight.svelte';
|
|
8
|
+
import PhMinus from '../../icons/PhMinus.svelte';
|
|
9
|
+
import PhCheck from '../../icons/PhCheck.svelte';
|
|
10
|
+
import PhListMagnifyingGlass from '../../icons/PhListMagnifyingGlass.svelte';
|
|
11
|
+
import PhArrowsInSimple from '../../icons/PhArrowsInSimple.svelte';
|
|
12
|
+
import { Button, Field } from '../..';
|
|
13
|
+
import { SvelteSet } from 'svelte/reactivity';
|
|
14
|
+
import PhMagnifyingGlass from '../../icons/PhMagnifyingGlass.svelte';
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
items = [],
|
|
18
|
+
label,
|
|
19
|
+
// eslint-disable-next-line no-useless-assignment
|
|
20
|
+
contextNode = $bindable(null),
|
|
21
|
+
selectedValue = $bindable([]),
|
|
22
|
+
checkedValue = $bindable([]),
|
|
23
|
+
selectionMode = 'single',
|
|
24
|
+
onSelectionChange,
|
|
25
|
+
onExpandedChange,
|
|
26
|
+
onCheckedChange,
|
|
27
|
+
...restProps
|
|
28
|
+
}: TreeViewProps<T> = $props();
|
|
29
|
+
|
|
30
|
+
const filterFns = useFilter({ sensitivity: 'base' });
|
|
31
|
+
let searchTerm: string | undefined = $state();
|
|
32
|
+
const debouncedSearchTerm = new Debounced(() => searchTerm, 250);
|
|
33
|
+
const baseCollection = $derived(
|
|
34
|
+
createTreeCollection<T>({
|
|
35
|
+
nodeToValue: (node) => node.value.toString(),
|
|
36
|
+
nodeToString: (node) => node.label,
|
|
37
|
+
rootNode: { value: 'ROOT', label: '', children: items } as unknown as T
|
|
38
|
+
})
|
|
39
|
+
);
|
|
40
|
+
const collection = $derived.by(() => {
|
|
41
|
+
const term = debouncedSearchTerm.current ?? '';
|
|
42
|
+
return term.length > 0
|
|
43
|
+
? baseCollection.filter((node) => filterFns().contains(node.label, term))
|
|
44
|
+
: baseCollection;
|
|
45
|
+
});
|
|
46
|
+
const getParentValues = (targetValues: string[]): string[] => {
|
|
47
|
+
if (!targetValues?.length) return [];
|
|
48
|
+
const allParentValues = new SvelteSet<string>();
|
|
49
|
+
for (const targetValue of targetValues) {
|
|
50
|
+
const parentNodes = baseCollection.getParentNodes(targetValue);
|
|
51
|
+
if (parentNodes) {
|
|
52
|
+
parentNodes.forEach((node) => allParentValues.add(node.value.toString()));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return Array.from(allParentValues);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// User's manually expanded state — initialized from selected parents
|
|
59
|
+
let userExpandedValue = $state<string[]>(getParentValues(selectedValue ?? []));
|
|
60
|
+
|
|
61
|
+
// When search is active, expand everything; otherwise use user's state
|
|
62
|
+
const expandedValue = $derived.by(() => {
|
|
63
|
+
const cur = debouncedSearchTerm.current ?? '';
|
|
64
|
+
return cur.length > 0 ? baseCollection.getBranchValues() : userExpandedValue;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
function handleContextMenu(event: MouseEvent) {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
const target = event.target as HTMLElement;
|
|
70
|
+
const targetNode = target.closest('[data-part="item"], [data-part="branch-control"]');
|
|
71
|
+
if (targetNode) {
|
|
72
|
+
const nodeId = targetNode.getAttribute('data-value');
|
|
73
|
+
contextNode = nodeId ?? null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
$inspect('searchTerm:', searchTerm);
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<div class="flex h-full flex-col" role="none" oncontextmenu={handleContextMenu}>
|
|
80
|
+
<!--
|
|
81
|
+
| Varijabla | Vrednost | Opis |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| `--tree-indent` | `0.75rem` | indent po nivou |
|
|
84
|
+
| `--tree-icon` | `1rem` | širina ikone |
|
|
85
|
+
| `--tree-gap` | `0.5rem` | razmak između elemenata |
|
|
86
|
+
| `--tree-px` | `0.75rem` | bazni levi padding
|
|
87
|
+
-->
|
|
88
|
+
<TreeView.Root
|
|
89
|
+
{...restProps}
|
|
90
|
+
{collection}
|
|
91
|
+
{selectionMode}
|
|
92
|
+
{selectedValue}
|
|
93
|
+
{expandedValue}
|
|
94
|
+
{checkedValue}
|
|
95
|
+
onSelectionChange={(details) => {
|
|
96
|
+
onSelectionChange?.(details);
|
|
97
|
+
}}
|
|
98
|
+
onExpandedChange={(details) => {
|
|
99
|
+
userExpandedValue = details.expandedValue;
|
|
100
|
+
onExpandedChange?.(details);
|
|
101
|
+
}}
|
|
102
|
+
onCheckedChange={(details) => {
|
|
103
|
+
checkedValue = details.checkedValue;
|
|
104
|
+
onCheckedChange?.(details);
|
|
105
|
+
}}
|
|
106
|
+
class="flex h-full flex-col"
|
|
107
|
+
style="--tree-indent: 0rem; --tree-icon: 1rem; --tree-gap: 0.5rem; --tree-px: 0.75rem"
|
|
108
|
+
>
|
|
109
|
+
{#if label}
|
|
110
|
+
<TreeView.Label class="px-3 pt-3 text-sm font-medium">{label}</TreeView.Label>
|
|
111
|
+
{/if}
|
|
112
|
+
|
|
113
|
+
<div class="flex gap-2 p-3">
|
|
114
|
+
<TreeView.Context>
|
|
115
|
+
{#snippet render(tree)}
|
|
116
|
+
<Button
|
|
117
|
+
variant="outline"
|
|
118
|
+
size="icon"
|
|
119
|
+
title="Collapse all"
|
|
120
|
+
onclick={() => tree().collapse()}
|
|
121
|
+
>
|
|
122
|
+
<PhArrowsInSimple class="size-4" />
|
|
123
|
+
</Button>
|
|
124
|
+
{/snippet}
|
|
125
|
+
</TreeView.Context>
|
|
126
|
+
|
|
127
|
+
<div class="flex-1">
|
|
128
|
+
<Field.Root>
|
|
129
|
+
<Field.Input bind:value={searchTerm} placeholder="Search...">
|
|
130
|
+
{#snippet startIcon()}
|
|
131
|
+
<PhMagnifyingGlass class="size-4" />
|
|
132
|
+
{/snippet}
|
|
133
|
+
{#snippet endIcon()}
|
|
134
|
+
<Button variant="ghost" size="icon" onclick={() => (searchTerm = '')}>
|
|
135
|
+
<PhX />
|
|
136
|
+
</Button>
|
|
137
|
+
{/snippet}
|
|
138
|
+
</Field.Input>
|
|
139
|
+
</Field.Root>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<div class="flex-1 overflow-x-hidden overflow-y-auto">
|
|
144
|
+
<TreeView.Tree class="flex flex-col text-sm">
|
|
145
|
+
{#each collection.rootNode.children ?? [] as node, index (node.value)}
|
|
146
|
+
{@render renderNode(node as T, [index])}
|
|
147
|
+
{/each}
|
|
148
|
+
</TreeView.Tree>
|
|
149
|
+
</div>
|
|
150
|
+
</TreeView.Root>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
{#snippet nodeCheckbox()}
|
|
154
|
+
<TreeView.NodeCheckbox
|
|
155
|
+
class="border-input bg-background text-primary-foreground inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-sm border data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary"
|
|
156
|
+
>
|
|
157
|
+
<TreeView.NodeCheckboxIndicator>
|
|
158
|
+
{#snippet indeterminate()}
|
|
159
|
+
<PhMinus class="size-3" />
|
|
160
|
+
{/snippet}
|
|
161
|
+
{#snippet fallback()}
|
|
162
|
+
<span class="size-3"></span>
|
|
163
|
+
{/snippet}
|
|
164
|
+
<PhCheck class="size-3" />
|
|
165
|
+
</TreeView.NodeCheckboxIndicator>
|
|
166
|
+
</TreeView.NodeCheckbox>
|
|
167
|
+
{/snippet}
|
|
168
|
+
|
|
169
|
+
{#snippet renderNode(node: T, indexPath: number[])}
|
|
170
|
+
<TreeView.NodeProvider {node} {indexPath}>
|
|
171
|
+
{#if node.children}
|
|
172
|
+
<TreeView.Branch class="relative">
|
|
173
|
+
<TreeView.BranchControl
|
|
174
|
+
class="hover:bg-accent data-selected:bg-accent data-selected:text-accent-foreground flex w-full cursor-pointer items-center gap-2 rounded-md py-1.5 pr-3 text-sm select-none"
|
|
175
|
+
style="padding-inline-start: calc(var(--tree-px) + (var(--depth) - 1) * (var(--tree-indent) + var(--tree-icon) * 0.5))"
|
|
176
|
+
>
|
|
177
|
+
{#if selectionMode === 'multiple'}
|
|
178
|
+
{@render nodeCheckbox()}
|
|
179
|
+
{/if}
|
|
180
|
+
<TreeView.BranchIndicator
|
|
181
|
+
class="text-muted-foreground inline-flex items-center justify-center transition-transform duration-150 data-[state=open]:rotate-90"
|
|
182
|
+
>
|
|
183
|
+
<PhCaretRight class="size-3.5" />
|
|
184
|
+
</TreeView.BranchIndicator>
|
|
185
|
+
<TreeView.BranchText class="flex-1 truncate">
|
|
186
|
+
{node.label}
|
|
187
|
+
</TreeView.BranchText>
|
|
188
|
+
</TreeView.BranchControl>
|
|
189
|
+
<TreeView.BranchContent class="relative">
|
|
190
|
+
<TreeView.BranchIndentGuide class="bg-border absolute inset-y-0 w-px" />
|
|
191
|
+
{#each node.children as child, childIndex (child.value)}
|
|
192
|
+
{@render renderNode(child as T, [...indexPath, childIndex])}
|
|
193
|
+
{/each}
|
|
194
|
+
</TreeView.BranchContent>
|
|
195
|
+
</TreeView.Branch>
|
|
196
|
+
{:else}
|
|
197
|
+
<TreeView.Item
|
|
198
|
+
class="hover:bg-accent data-selected:bg-accent data-selected:text-accent-foreground flex w-full cursor-pointer items-center gap-2 rounded-md py-1.5 pr-3 text-sm select-none"
|
|
199
|
+
style="padding-inline-start: calc(var(--tree-px) + (var(--depth) - 1) * (var(--tree-indent) + var(--tree-icon) * 0.5) + var(--tree-icon) + var(--tree-gap))"
|
|
200
|
+
>
|
|
201
|
+
{#if selectionMode === 'multiple'}
|
|
202
|
+
{@render nodeCheckbox()}
|
|
203
|
+
{/if}
|
|
204
|
+
<TreeView.ItemText class="flex-1 truncate">
|
|
205
|
+
{node.label}
|
|
206
|
+
</TreeView.ItemText>
|
|
207
|
+
</TreeView.Item>
|
|
208
|
+
{/if}
|
|
209
|
+
</TreeView.NodeProvider>
|
|
210
|
+
{/snippet}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TreeView } from '@ark-ui/svelte/tree-view';
|
|
2
|
+
import type { TreeNode, TreeViewProps } from './types';
|
|
3
|
+
declare function $$render<T extends TreeNode>(): {
|
|
4
|
+
props: TreeViewProps<T>;
|
|
5
|
+
exports: {};
|
|
6
|
+
bindings: "selectedValue" | "checkedValue" | "contextNode";
|
|
7
|
+
slots: {};
|
|
8
|
+
events: {};
|
|
9
|
+
};
|
|
10
|
+
declare class __sveltets_Render<T extends TreeNode> {
|
|
11
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
12
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
13
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
14
|
+
bindings(): "selectedValue" | "checkedValue" | "contextNode";
|
|
15
|
+
exports(): {};
|
|
16
|
+
}
|
|
17
|
+
interface $$IsomorphicComponent {
|
|
18
|
+
new <T extends TreeNode>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
19
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
20
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
+
<T extends TreeNode>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
22
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
23
|
+
}
|
|
24
|
+
declare const TreeView: $$IsomorphicComponent;
|
|
25
|
+
type TreeView<T extends TreeNode> = InstanceType<typeof TreeView<T>>;
|
|
26
|
+
export default TreeView;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UseTreeViewProps } from '@ark-ui/svelte/tree-view';
|
|
2
|
+
export interface TreeNode {
|
|
3
|
+
value: number | string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
children?: TreeNode[];
|
|
7
|
+
}
|
|
8
|
+
export interface TreeViewProps<T extends TreeNode> extends Omit<UseTreeViewProps<T>, 'collection'> {
|
|
9
|
+
items?: T[];
|
|
10
|
+
label?: string;
|
|
11
|
+
contextNode?: string | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M224 128a8 8 0 0 1-8 8H59.31l58.35 58.34a8 8 0 0 1-11.32 11.32l-72-72a8 8 0 0 1 0-11.32l72-72a8 8 0 0 1 11.32 11.32L59.31 120H216a8 8 0 0 1 8 8"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="m221.66 133.66l-72 72a8 8 0 0 1-11.32-11.32L196.69 136H40a8 8 0 0 1 0-16h156.69l-58.35-58.34a8 8 0 0 1 11.32-11.32l72 72a8 8 0 0 1 0 11.32"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE --><path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M213.66 53.66L163.31 104H192a8 8 0 0 1 0 16h-48a8 8 0 0 1-8-8V64a8 8 0 0 1 16 0v28.69l50.34-50.35a8 8 0 0 1 11.32 11.32M112 136H64a8 8 0 0 0 0 16h28.69l-50.35 50.34a8 8 0 0 0 11.32 11.32L104 163.31V192a8 8 0 0 0 16 0v-48a8 8 0 0 0-8-8"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
let { class: className = '', ...restProps } = $props();
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
|
-
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
6
5
|
<svg
|
|
7
6
|
xmlns="http://www.w3.org/2000/svg"
|
|
8
7
|
width="1em"
|
|
@@ -16,3 +15,5 @@
|
|
|
16
15
|
d="m213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32"
|
|
17
16
|
/>
|
|
18
17
|
</svg>
|
|
18
|
+
|
|
19
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE --><path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="m181.66 133.66l-80 80a8 8 0 0 1-11.32-11.32L164.69 128L90.34 53.66a8 8 0 0 1 11.32-11.32l80 80a8 8 0 0 1 0 11.32"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M213.66 165.66a8 8 0 0 1-11.32 0L128 91.31l-74.34 74.35a8 8 0 0 1-11.32-11.32l80-80a8 8 0 0 1 11.32 0l80 80a8 8 0 0 1 0 11.32"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
let { class: className = '', ...restProps } = $props();
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
|
-
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
6
5
|
<svg
|
|
7
6
|
xmlns="http://www.w3.org/2000/svg"
|
|
8
7
|
width="1em"
|
|
@@ -16,3 +15,5 @@
|
|
|
16
15
|
d="m229.66 77.66l-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69L218.34 66.34a8 8 0 0 1 11.32 11.32"
|
|
17
16
|
/>
|
|
18
17
|
</svg>
|
|
18
|
+
|
|
19
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="m213.66 82.34l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v176a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V88a8 8 0 0 0-2.34-5.66M160 51.31L188.69 80H160ZM200 216H56V40h88v48a8 8 0 0 0 8 8h48z"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
|
|
19
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
14
|
+
<path
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
d="m213.66 82.34l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v176a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V88a8 8 0 0 0-2.34-5.66M160 51.31L188.69 80H160ZM200 216h-88v-16h8a8 8 0 0 0 0-16h-8v-16h8a8 8 0 0 0 0-16h-8v-16h8a8 8 0 0 0 0-16h-8v-8a8 8 0 0 0-16 0v8h-8a8 8 0 0 0 0 16h8v16h-8a8 8 0 0 0 0 16h8v16h-8a8 8 0 0 0 0 16h8v16H56V40h88v48a8 8 0 0 0 8 8h48z"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="m213.66 82.34l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v176a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V88a8 8 0 0 0-2.34-5.66M160 51.31L188.69 80H160ZM200 216H56V40h88v48a8 8 0 0 0 8 8h48zm-32-80a8 8 0 0 1-8 8H96a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8m0 32a8 8 0 0 1-8 8H96a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
><!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M201.89 54.66A103.43 103.43 0 0 0 128.79 24H128A104 104 0 0 0 24 128v56a24 24 0 0 0 24 24h16a24 24 0 0 0 24-24v-40a24 24 0 0 0-24-24H40.36A88 88 0 0 1 128 40h.67a87.71 87.71 0 0 1 87 80H192a24 24 0 0 0-24 24v40a24 24 0 0 0 24 24h16a24 24 0 0 0 24-24v-56a103.4 103.4 0 0 0-30.11-73.34M64 136a8 8 0 0 1 8 8v40a8 8 0 0 1-8 8H48a8 8 0 0 1-8-8v-48Zm152 48a8 8 0 0 1-8 8h-16a8 8 0 0 1-8-8v-40a8 8 0 0 1 8-8h24Z"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m0 16v102.75l-26.07-26.06a16 16 0 0 0-22.63 0l-20 20l-44-44a16 16 0 0 0-22.62 0L40 149.37V56ZM40 172l52-52l80 80H40Zm176 28h-21.37l-36-36l20-20L216 181.38zm-72-100a12 12 0 1 1 12 12a12 12 0 0 1-12-12"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE --><path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M32 64a8 8 0 0 1 8-8h176a8 8 0 0 1 0 16H40a8 8 0 0 1-8-8m8 72h72a8 8 0 0 0 0-16H40a8 8 0 0 0 0 16m88 48H40a8 8 0 0 0 0 16h88a8 8 0 0 0 0-16m109.66 13.66a8 8 0 0 1-11.32 0L206 177.36A40 40 0 1 1 217.36 166l20.3 20.3a8 8 0 0 1 0 11.36M184 168a24 24 0 1 0-24-24a24 24 0 0 0 24 24"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE --><path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="m229.66 218.34l-50.07-50.06a88.11 88.11 0 1 0-11.31 11.31l50.06 50.07a8 8 0 0 0 11.32-11.32M40 112a72 72 0 1 1 72 72a72.08 72.08 0 0 1-72-72"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
><!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M200 24H72a16 16 0 0 0-16 16v24H40a16 16 0 0 0-16 16v96a16 16 0 0 0 16 16h16v24a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V40a16 16 0 0 0-16-16m-40 80h40v48h-40Zm40-16h-40v-8a16 16 0 0 0-16-16V40h56ZM72 40h56v24H72ZM40 80h104v96H40Zm32 112h56v24H72Zm72 24v-24a16 16 0 0 0 16-16v-8h40v48Zm-78.15-69.12L81.59 128l-15.74-18.88a8 8 0 0 1 12.3-10.24L92 115.5l13.85-16.62a8 8 0 1 1 12.3 10.24L102.41 128l15.74 18.88a8 8 0 0 1-12.3 10.24L92 140.5l-13.85 16.62a8 8 0 0 1-12.3-10.24"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { class: className = '', ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="1em"
|
|
8
|
+
height="1em"
|
|
9
|
+
viewBox="0 0 256 256"
|
|
10
|
+
class={className}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M239.18 97.26A16.38 16.38 0 0 0 224.92 86l-59-4.76l-22.78-55.09a16.36 16.36 0 0 0-30.27 0L90.11 81.23L31.08 86a16.46 16.46 0 0 0-9.37 28.86l45 38.83L53 211.75a16.38 16.38 0 0 0 24.5 17.82l50.5-31.08l50.53 31.08A16.4 16.4 0 0 0 203 211.75l-13.76-58.07l45-38.83a16.43 16.43 0 0 0 4.94-17.59m-15.34 5.47l-48.7 42a8 8 0 0 0-2.56 7.91l14.88 62.8a.37.37 0 0 1-.17.48c-.18.14-.23.11-.38 0l-54.72-33.65a8 8 0 0 0-8.38 0l-54.72 33.67c-.15.09-.19.12-.38 0a.37.37 0 0 1-.17-.48l14.88-62.8a8 8 0 0 0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16a8 8 0 0 0 6.72-4.94l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153 91.86a8 8 0 0 0 6.75 4.92l63.92 5.16c.15 0 .24 0 .33.29s0 .4-.16.5"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
<!-- Icon from Phosphor by Phosphor Icons - https://github.com/phosphor-icons/core/blob/main/LICENSE -->
|