@skeletonlabs/skeleton 1.12.0 → 2.0.0-dev.b15f66c2
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/Accordion/Accordion.svelte +15 -3
- package/dist/components/Accordion/Accordion.svelte.d.ts +17 -23
- package/dist/components/Accordion/AccordionItem.svelte +8 -3
- package/dist/components/Accordion/AccordionItem.svelte.d.ts +15 -25
- package/dist/components/AppRail/AppRailTile.svelte +1 -1
- package/dist/components/Autocomplete/Autocomplete.svelte +17 -7
- package/dist/components/Autocomplete/Autocomplete.svelte.d.ts +17 -27
- package/dist/components/Avatar/Avatar.svelte +1 -1
- package/dist/components/ConicGradient/ConicGradient.svelte +1 -1
- package/dist/components/FileButton/FileButton.svelte +2 -3
- package/dist/components/InputChip/InputChip.svelte +31 -4
- package/dist/components/InputChip/InputChip.svelte.d.ts +22 -27
- package/dist/components/Paginator/Paginator.svelte +17 -15
- package/dist/components/Paginator/Paginator.svelte.d.ts +2 -2
- package/dist/components/Paginator/types.d.ts +2 -2
- package/dist/components/Ratings/Ratings.svelte +1 -1
- package/dist/components/Stepper/Step.svelte +11 -2
- package/dist/components/Stepper/Step.svelte.d.ts +15 -12
- package/dist/components/Stepper/Stepper.svelte +21 -3
- package/dist/components/Stepper/Stepper.svelte.d.ts +17 -27
- package/dist/components/Tab/TabGroup.svelte +1 -1
- package/dist/components/Table/Table.svelte +1 -1
- package/dist/components/TreeView/TreeView.svelte +45 -2
- package/dist/components/TreeView/TreeView.svelte.d.ts +21 -0
- package/dist/components/TreeView/TreeViewDataDrivenItem.svelte +90 -0
- package/dist/components/TreeView/TreeViewDataDrivenItem.svelte.d.ts +27 -0
- package/dist/components/TreeView/TreeViewItem.svelte +220 -10
- package/dist/components/TreeView/TreeViewItem.svelte.d.ts +95 -2
- package/dist/components/TreeView/types.d.ts +18 -0
- package/dist/components/TreeView/types.js +1 -0
- package/dist/index.d.ts +15 -12
- package/dist/index.js +11 -12
- package/dist/internal/transitions.d.ts +10 -0
- package/dist/internal/transitions.js +11 -0
- package/dist/transitions/crossfade.d.ts +1 -0
- package/dist/transitions/crossfade.js +21 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.js +1 -0
- package/dist/utilities/Drawer/Drawer.svelte +33 -12
- package/dist/utilities/Drawer/Drawer.svelte.d.ts +4 -2
- package/dist/utilities/Drawer/stores.d.ts +24 -1
- package/dist/utilities/Drawer/stores.js +31 -2
- package/dist/utilities/Drawer/types.d.ts +3 -0
- package/dist/utilities/Modal/Modal.svelte +21 -23
- package/dist/utilities/Modal/Modal.svelte.d.ts +17 -37
- package/dist/utilities/Modal/ModalTest.svelte +8 -0
- package/dist/utilities/Modal/ModalTest.svelte.d.ts +17 -0
- package/dist/utilities/Modal/stores.d.ts +24 -1
- package/dist/utilities/Modal/stores.js +31 -1
- package/dist/utilities/Modal/types.d.ts +1 -0
- package/dist/utilities/PrefersReducedMotion/PrefersReducedMotion.d.ts +7 -0
- package/dist/utilities/PrefersReducedMotion/PrefersReducedMotion.js +26 -0
- package/dist/utilities/TableOfContents/TableOfContents.svelte +56 -0
- package/dist/utilities/TableOfContents/TableOfContents.svelte.d.ts +34 -0
- package/dist/utilities/TableOfContents/crawler.d.ts +16 -0
- package/dist/utilities/TableOfContents/crawler.js +78 -0
- package/dist/utilities/TableOfContents/stores.d.ts +6 -0
- package/dist/utilities/TableOfContents/stores.js +5 -0
- package/dist/utilities/TableOfContents/types.d.ts +5 -0
- package/dist/utilities/TableOfContents/types.js +2 -0
- package/dist/utilities/Toast/Toast.svelte +24 -23
- package/dist/utilities/Toast/Toast.svelte.d.ts +17 -24
- package/dist/utilities/Toast/ToastTest.svelte +12 -0
- package/dist/utilities/Toast/ToastTest.svelte.d.ts +18 -0
- package/dist/utilities/Toast/stores.d.ts +27 -5
- package/dist/utilities/Toast/stores.js +60 -29
- package/dist/utilities/Toast/types.d.ts +1 -0
- package/dist/utilities/index.d.ts +18 -0
- package/dist/utilities/index.js +25 -0
- package/package.json +3 -16
- package/dist/components/TableOfContents/TableOfContents.svelte +0 -111
- package/dist/components/TableOfContents/TableOfContents.svelte.d.ts +0 -44
- package/dist/styles/all.css +0 -30
- package/dist/styles/elements/alerts.css +0 -17
- package/dist/styles/elements/badges.css +0 -31
- package/dist/styles/elements/breadcrumbs.css +0 -36
- package/dist/styles/elements/buttons.css +0 -109
- package/dist/styles/elements/cards.css +0 -32
- package/dist/styles/elements/chips.css +0 -22
- package/dist/styles/elements/codeblocks.css +0 -16
- package/dist/styles/elements/forms.css +0 -283
- package/dist/styles/elements/lists.css +0 -51
- package/dist/styles/elements/logo-clouds.css +0 -29
- package/dist/styles/elements/modals.css +0 -15
- package/dist/styles/elements/placeholders.css +0 -17
- package/dist/styles/elements/popups.css +0 -16
- package/dist/styles/elements/tables.css +0 -102
- package/dist/styles/partials/core.css +0 -66
- package/dist/styles/partials/elements.css +0 -20
- package/dist/styles/partials/tailwind.css +0 -16
- package/dist/styles/partials/typography-next.css +0 -99
- package/dist/styles/partials/typography-prose.css +0 -49
- package/dist/styles/partials/typography.css +0 -99
- package/dist/styles/partials/variants.css +0 -204
- package/dist/styles/skeleton-minimal.css +0 -30
- package/dist/styles/skeleton.css +0 -30
- package/dist/tailwind/core.cjs +0 -37
- package/dist/tailwind/core.d.cts +0 -5
- package/dist/tailwind/generated/intellisense-classes.cjs +0 -1
- package/dist/tailwind/generated/intellisense-classes.d.cts +0 -2729
- package/dist/tailwind/intellisense.cjs +0 -21
- package/dist/tailwind/intellisense.d.cts +0 -5
- package/dist/tailwind/settings.cjs +0 -20
- package/dist/tailwind/settings.d.cts +0 -6
- package/dist/tailwind/skeleton.cjs +0 -19
- package/dist/tailwind/skeleton.d.cts +0 -7
- package/dist/tailwind/theme/colors.cjs +0 -18
- package/dist/tailwind/theme/colors.d.cts +0 -2
- package/dist/tailwind/tokens/backgrounds.cjs +0 -39
- package/dist/tailwind/tokens/backgrounds.d.cts +0 -2
- package/dist/tailwind/tokens/border-radius.cjs +0 -21
- package/dist/tailwind/tokens/border-radius.d.cts +0 -33
- package/dist/tailwind/tokens/borders.cjs +0 -20
- package/dist/tailwind/tokens/borders.d.cts +0 -6
- package/dist/tailwind/tokens/fills.cjs +0 -20
- package/dist/tailwind/tokens/fills.d.cts +0 -15
- package/dist/tailwind/tokens/rings.cjs +0 -50
- package/dist/tailwind/tokens/rings.d.cts +0 -22
- package/dist/tailwind/tokens/text.cjs +0 -31
- package/dist/tailwind/tokens/text.d.cts +0 -21
- package/dist/themes/theme-crimson.css +0 -100
- package/dist/themes/theme-gold-nouveau.css +0 -143
- package/dist/themes/theme-hamlindigo.css +0 -109
- package/dist/themes/theme-modern.css +0 -134
- package/dist/themes/theme-rocket.css +0 -120
- package/dist/themes/theme-sahara.css +0 -133
- package/dist/themes/theme-seafoam.css +0 -128
- package/dist/themes/theme-seasonal.css +0 -114
- package/dist/themes/theme-skeleton.css +0 -119
- package/dist/themes/theme-test.css +0 -96
- package/dist/themes/theme-vintage.css +0 -131
- package/dist/utilities/DataTable/DataTable.d.ts +0 -19
- package/dist/utilities/DataTable/DataTable.js +0 -137
- package/dist/utilities/DataTable/types.d.ts +0 -33
- package/dist/utilities/DataTable/types.js +0 -2
- /package/dist/{utilities/DataTable → components/Table}/actions.d.ts +0 -0
- /package/dist/{utilities/DataTable → components/Table}/actions.js +0 -0
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
<!-- To access props and events using reference -->
|
|
2
|
+
<svelte:options accessors />
|
|
3
|
+
|
|
1
4
|
<script>import { getContext, createEventDispatcher } from "svelte";
|
|
2
|
-
export let
|
|
5
|
+
export let group = void 0;
|
|
6
|
+
export let name = void 0;
|
|
7
|
+
export let value = void 0;
|
|
8
|
+
export let children = [];
|
|
3
9
|
export let spacing = "space-x-4";
|
|
10
|
+
export let open = getContext("open");
|
|
11
|
+
export let selection = getContext("selection");
|
|
12
|
+
export let multiple = getContext("multiple");
|
|
13
|
+
export let disabled = getContext("disabled");
|
|
14
|
+
export let indeterminate = false;
|
|
4
15
|
export let padding = getContext("padding");
|
|
5
16
|
export let indent = getContext("indent");
|
|
6
17
|
export let hover = getContext("hover");
|
|
@@ -8,22 +19,199 @@ export let rounded = getContext("rounded");
|
|
|
8
19
|
export let caretOpen = getContext("caretOpen");
|
|
9
20
|
export let caretClosed = getContext("caretClosed");
|
|
10
21
|
export let hyphenOpacity = getContext("hyphenOpacity");
|
|
11
|
-
export let regionSummary = "";
|
|
22
|
+
export let regionSummary = getContext("regionSummary");
|
|
12
23
|
export let regionSymbol = getContext("regionSymbol");
|
|
13
24
|
export let regionChildren = getContext("regionChildren");
|
|
25
|
+
export let hideLead = false;
|
|
26
|
+
export let hideChildren = false;
|
|
27
|
+
let checked = false;
|
|
28
|
+
let treeItem;
|
|
29
|
+
let childrenDiv;
|
|
30
|
+
function onSummaryClick(event) {
|
|
31
|
+
if (disabled)
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
}
|
|
34
|
+
$:
|
|
35
|
+
if (multiple)
|
|
36
|
+
updateCheckbox(group);
|
|
37
|
+
$:
|
|
38
|
+
if (multiple)
|
|
39
|
+
updateGroup(checked);
|
|
40
|
+
function updateCheckbox(group2) {
|
|
41
|
+
if (!Array.isArray(group2))
|
|
42
|
+
return;
|
|
43
|
+
checked = group2.indexOf(value) >= 0;
|
|
44
|
+
}
|
|
45
|
+
function updateGroup(checked2) {
|
|
46
|
+
if (!Array.isArray(group))
|
|
47
|
+
return;
|
|
48
|
+
const index = group.indexOf(value);
|
|
49
|
+
if (checked2) {
|
|
50
|
+
if (index < 0) {
|
|
51
|
+
group.push(value);
|
|
52
|
+
group = group;
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
if (index >= 0) {
|
|
56
|
+
group.splice(index, 1);
|
|
57
|
+
group = group;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function onChildValueChange() {
|
|
62
|
+
if (multiple) {
|
|
63
|
+
if (!Array.isArray(group))
|
|
64
|
+
return;
|
|
65
|
+
const childrenValues = children.map((c) => c.value);
|
|
66
|
+
const childrenGroup = children[0].group;
|
|
67
|
+
const index = group.indexOf(value);
|
|
68
|
+
if (children.some((c) => c.indeterminate)) {
|
|
69
|
+
indeterminate = true;
|
|
70
|
+
} else if (childrenValues.every((c) => Array.isArray(childrenGroup) && childrenGroup.includes(c))) {
|
|
71
|
+
indeterminate = false;
|
|
72
|
+
if (index < 0) {
|
|
73
|
+
group.push(value);
|
|
74
|
+
group = group;
|
|
75
|
+
}
|
|
76
|
+
} else if (childrenValues.some((c) => Array.isArray(childrenGroup) && childrenGroup.includes(c))) {
|
|
77
|
+
indeterminate = true;
|
|
78
|
+
} else {
|
|
79
|
+
indeterminate = false;
|
|
80
|
+
if (index >= 0) {
|
|
81
|
+
group.splice(index, 1);
|
|
82
|
+
group = group;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
if (group !== value) {
|
|
87
|
+
group = value;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
dispatch("change");
|
|
91
|
+
}
|
|
92
|
+
export function onParentChange() {
|
|
93
|
+
if (!multiple || !children || children.length === 0)
|
|
94
|
+
return;
|
|
95
|
+
if (!Array.isArray(group))
|
|
96
|
+
return;
|
|
97
|
+
const index = group.indexOf(value);
|
|
98
|
+
const checkChild = (child) => {
|
|
99
|
+
if (!child || !Array.isArray(child.group))
|
|
100
|
+
return;
|
|
101
|
+
child.indeterminate = false;
|
|
102
|
+
if (child.group.indexOf(child.value) < 0) {
|
|
103
|
+
child.group.push(child.value);
|
|
104
|
+
child.group = child.group;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const uncheckChild = (child) => {
|
|
108
|
+
if (!child || !Array.isArray(child.group))
|
|
109
|
+
return;
|
|
110
|
+
child.indeterminate = false;
|
|
111
|
+
const childIndex = child.group.indexOf(child.value);
|
|
112
|
+
if (childIndex >= 0) {
|
|
113
|
+
child.group.splice(childIndex, 1);
|
|
114
|
+
child.group = child.group;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
children.forEach((child) => {
|
|
118
|
+
index >= 0 ? checkChild(child) : uncheckChild(child);
|
|
119
|
+
child.onParentChange();
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
$:
|
|
123
|
+
if (!multiple && group) {
|
|
124
|
+
if (group !== value) {
|
|
125
|
+
children.forEach((child) => {
|
|
126
|
+
if (child)
|
|
127
|
+
child.group = [];
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
14
131
|
const dispatch = createEventDispatcher();
|
|
15
132
|
$:
|
|
16
133
|
dispatch("toggle", { open });
|
|
134
|
+
$:
|
|
135
|
+
children.forEach((child) => {
|
|
136
|
+
if (child)
|
|
137
|
+
child.$on("change", () => onChildValueChange());
|
|
138
|
+
});
|
|
139
|
+
function onKeyDown(event) {
|
|
140
|
+
function getRootTree() {
|
|
141
|
+
let currentElement = treeItem;
|
|
142
|
+
while (currentElement !== null) {
|
|
143
|
+
if (currentElement.classList.contains("tree"))
|
|
144
|
+
return currentElement;
|
|
145
|
+
currentElement = currentElement.parentElement;
|
|
146
|
+
}
|
|
147
|
+
return void 0;
|
|
148
|
+
}
|
|
149
|
+
let rootTree = void 0;
|
|
150
|
+
let lastVisibleElement = null;
|
|
151
|
+
switch (event.code) {
|
|
152
|
+
case "ArrowRight":
|
|
153
|
+
if (!open)
|
|
154
|
+
open = true;
|
|
155
|
+
else if ($$slots.children && !hideChildren) {
|
|
156
|
+
const child = childrenDiv.querySelector("details>summary");
|
|
157
|
+
if (child)
|
|
158
|
+
child.focus();
|
|
159
|
+
}
|
|
160
|
+
break;
|
|
161
|
+
case "ArrowLeft":
|
|
162
|
+
if (open)
|
|
163
|
+
open = false;
|
|
164
|
+
else {
|
|
165
|
+
const parent = treeItem.parentElement?.parentElement;
|
|
166
|
+
if (parent && parent.tagName === "DETAILS")
|
|
167
|
+
parent.querySelector("summary")?.focus();
|
|
168
|
+
}
|
|
169
|
+
break;
|
|
170
|
+
case "Home":
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
rootTree = getRootTree();
|
|
173
|
+
if (rootTree)
|
|
174
|
+
rootTree?.querySelector("summary")?.focus();
|
|
175
|
+
break;
|
|
176
|
+
case "End":
|
|
177
|
+
event.preventDefault();
|
|
178
|
+
rootTree = getRootTree();
|
|
179
|
+
if (rootTree) {
|
|
180
|
+
const detailsElements = rootTree?.querySelectorAll("details");
|
|
181
|
+
if (!detailsElements)
|
|
182
|
+
return;
|
|
183
|
+
for (let i = detailsElements.length - 1; i >= 0; i--) {
|
|
184
|
+
const details = detailsElements[i];
|
|
185
|
+
if (details.parentElement?.classList?.contains("tree") || details.parentElement?.parentElement?.getAttribute("open") !== null) {
|
|
186
|
+
lastVisibleElement = details;
|
|
187
|
+
break;
|
|
188
|
+
} else if (details.parentElement?.parentElement?.tagName !== "details") {
|
|
189
|
+
lastVisibleElement = details.parentElement.parentElement;
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (lastVisibleElement) {
|
|
194
|
+
const summary = lastVisibleElement.querySelector("summary");
|
|
195
|
+
if (summary)
|
|
196
|
+
summary.focus();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
17
202
|
const cBase = "";
|
|
18
|
-
const cSummary = "list-none flex items-center cursor-pointer";
|
|
203
|
+
const cSummary = "list-none [&::-webkit-details-marker]:hidden flex items-center cursor-pointer";
|
|
19
204
|
const cSymbol = "fill-current w-3 text-center transition-transform duration-[200ms]";
|
|
20
205
|
const cChildren = "";
|
|
206
|
+
const cDisabled = "opacity-50 !cursor-not-allowed";
|
|
207
|
+
$:
|
|
208
|
+
classesCaretState = open && $$slots.children && !hideChildren ? caretOpen : caretClosed;
|
|
21
209
|
$:
|
|
22
|
-
|
|
210
|
+
classesDisabled = disabled ? cDisabled : "";
|
|
23
211
|
$:
|
|
24
212
|
classesBase = `${cBase} ${$$props.class ?? ""}`;
|
|
25
213
|
$:
|
|
26
|
-
classesSummary = `${cSummary} ${spacing} ${rounded} ${padding} ${hover} ${regionSummary}`;
|
|
214
|
+
classesSummary = `${cSummary} ${classesDisabled} ${spacing} ${rounded} ${padding} ${hover} ${regionSummary}`;
|
|
27
215
|
$:
|
|
28
216
|
classesSymbol = `${cSymbol} ${classesCaret} ${regionSymbol}`;
|
|
29
217
|
$:
|
|
@@ -34,19 +222,21 @@ $:
|
|
|
34
222
|
classesChildren = `${cChildren} ${indent} ${regionChildren}`;
|
|
35
223
|
</script>
|
|
36
224
|
|
|
37
|
-
<details bind:open class="tree-item {classesBase}" data-testid="tree-item">
|
|
225
|
+
<details bind:this={treeItem} bind:open class="tree-item {classesBase}" data-testid="tree-item" aria-disabled={disabled}>
|
|
38
226
|
<summary
|
|
39
227
|
class="tree-item-summary {classesSummary}"
|
|
40
228
|
role="treeitem"
|
|
41
|
-
aria-selected=
|
|
229
|
+
aria-selected={selection ? checked : undefined}
|
|
42
230
|
aria-expanded={$$slots.children ? open : undefined}
|
|
231
|
+
on:click={onSummaryClick}
|
|
43
232
|
on:click
|
|
233
|
+
on:keydown={onKeyDown}
|
|
44
234
|
on:keydown
|
|
45
235
|
on:keyup
|
|
46
236
|
>
|
|
47
237
|
<!-- Symbol -->
|
|
48
238
|
<div class="tree-summary-symbol {classesSymbol}">
|
|
49
|
-
{#if $$slots.children}
|
|
239
|
+
{#if $$slots.children && !hideChildren}
|
|
50
240
|
<!-- SVG Caret -->
|
|
51
241
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
52
242
|
<path
|
|
@@ -59,8 +249,28 @@ $:
|
|
|
59
249
|
</svg>
|
|
60
250
|
{/if}
|
|
61
251
|
</div>
|
|
252
|
+
|
|
253
|
+
<!-- Selection -->
|
|
254
|
+
{#if selection && name && group !== undefined}
|
|
255
|
+
{#if multiple}
|
|
256
|
+
<input
|
|
257
|
+
class="checkbox tree-item-checkbox"
|
|
258
|
+
type="checkbox"
|
|
259
|
+
{name}
|
|
260
|
+
{value}
|
|
261
|
+
bind:checked
|
|
262
|
+
bind:indeterminate
|
|
263
|
+
on:click
|
|
264
|
+
on:change
|
|
265
|
+
on:change={onParentChange}
|
|
266
|
+
/>
|
|
267
|
+
{:else}
|
|
268
|
+
<input class="radio tree-item-radio" type="radio" bind:group {name} {value} on:click on:change />
|
|
269
|
+
{/if}
|
|
270
|
+
{/if}
|
|
271
|
+
|
|
62
272
|
<!-- Slot: Lead -->
|
|
63
|
-
{#if $$slots.lead}
|
|
273
|
+
{#if $$slots.lead && !hideLead}
|
|
64
274
|
<div class="tree-item-lead">
|
|
65
275
|
<slot name="lead" />
|
|
66
276
|
</div>
|
|
@@ -70,7 +280,7 @@ $:
|
|
|
70
280
|
<slot />
|
|
71
281
|
</div>
|
|
72
282
|
</summary>
|
|
73
|
-
<div class="tree-item-children {classesChildren}" role="group">
|
|
283
|
+
<div bind:this={childrenDiv} class="tree-item-children {classesChildren}" role="group">
|
|
74
284
|
<slot name="children" />
|
|
75
285
|
</div>
|
|
76
286
|
</details>
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TreeViewItem } from '../../index.js';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
5
|
-
/** Set
|
|
6
|
-
|
|
6
|
+
/** Set the radio group binding value.*/
|
|
7
|
+
group?: unknown;
|
|
8
|
+
/** Set a unique name value for the input.*/
|
|
9
|
+
name?: string | undefined;
|
|
10
|
+
/** Set the input's value.*/
|
|
11
|
+
value?: unknown;
|
|
12
|
+
/** Provide children references to support relational checking.*/
|
|
13
|
+
children?: TreeViewItem[] | undefined;
|
|
7
14
|
/** Provide classes to set the horizontal spacing.*/
|
|
8
15
|
spacing?: string | undefined;
|
|
16
|
+
/** Set open by default on load.*/
|
|
17
|
+
open?: boolean | undefined;
|
|
18
|
+
/** Enable tree-view selection*/
|
|
19
|
+
selection?: boolean | undefined;
|
|
20
|
+
/** Enable selection of multiple items.*/
|
|
21
|
+
multiple?: boolean | undefined;
|
|
22
|
+
/** Set the tree item disabled state*/
|
|
23
|
+
disabled?: boolean | undefined;
|
|
24
|
+
/** Set the check state to indeterminate(-).*/
|
|
25
|
+
indeterminate?: boolean | undefined;
|
|
9
26
|
/** Provide classes to set the tree item padding styles.*/
|
|
10
27
|
padding?: string | undefined;
|
|
11
28
|
/** Provide classes to set the tree children indentation*/
|
|
@@ -25,11 +42,17 @@ declare const __propDef: {
|
|
|
25
42
|
regionSymbol?: string | undefined;
|
|
26
43
|
/** Provide arbitrary classes to the children region.*/
|
|
27
44
|
regionChildren?: string | undefined;
|
|
45
|
+
/** Don't use this prop, workaround until svelte implements conditional slots*/
|
|
46
|
+
hideLead?: boolean | undefined;
|
|
47
|
+
/** Don't use this prop, workaround until svelte implements conditional slots*/
|
|
48
|
+
hideChildren?: boolean | undefined;
|
|
49
|
+
onParentChange?: (() => void) | undefined;
|
|
28
50
|
};
|
|
29
51
|
events: {
|
|
30
52
|
click: MouseEvent;
|
|
31
53
|
keydown: KeyboardEvent;
|
|
32
54
|
keyup: KeyboardEvent;
|
|
55
|
+
change: Event;
|
|
33
56
|
toggle: CustomEvent<any>;
|
|
34
57
|
} & {
|
|
35
58
|
[evt: string]: CustomEvent<any>;
|
|
@@ -44,5 +67,75 @@ export type TreeViewItemProps = typeof __propDef.props;
|
|
|
44
67
|
export type TreeViewItemEvents = typeof __propDef.events;
|
|
45
68
|
export type TreeViewItemSlots = typeof __propDef.slots;
|
|
46
69
|
export default class TreeViewItem extends SvelteComponentTyped<TreeViewItemProps, TreeViewItemEvents, TreeViewItemSlots> {
|
|
70
|
+
get onParentChange(): () => void;
|
|
71
|
+
get group(): unknown;
|
|
72
|
+
/**accessor*/
|
|
73
|
+
set group(_: unknown);
|
|
74
|
+
get name(): string | undefined;
|
|
75
|
+
/**accessor*/
|
|
76
|
+
set name(_: string | undefined);
|
|
77
|
+
get value(): unknown;
|
|
78
|
+
/**accessor*/
|
|
79
|
+
set value(_: unknown);
|
|
80
|
+
get children(): TreeViewItem[] | undefined;
|
|
81
|
+
/**accessor*/
|
|
82
|
+
set children(_: TreeViewItem[] | undefined);
|
|
83
|
+
get spacing(): string | undefined;
|
|
84
|
+
/**accessor*/
|
|
85
|
+
set spacing(_: string | undefined);
|
|
86
|
+
get open(): boolean | undefined;
|
|
87
|
+
/**accessor*/
|
|
88
|
+
set open(_: boolean | undefined);
|
|
89
|
+
get selection(): boolean | undefined;
|
|
90
|
+
/**accessor*/
|
|
91
|
+
set selection(_: boolean | undefined);
|
|
92
|
+
get multiple(): boolean | undefined;
|
|
93
|
+
/**accessor*/
|
|
94
|
+
set multiple(_: boolean | undefined);
|
|
95
|
+
get disabled(): boolean | undefined;
|
|
96
|
+
/**accessor*/
|
|
97
|
+
set disabled(_: boolean | undefined);
|
|
98
|
+
get indeterminate(): boolean | undefined;
|
|
99
|
+
/**accessor*/
|
|
100
|
+
set indeterminate(_: boolean | undefined);
|
|
101
|
+
get padding(): string | undefined;
|
|
102
|
+
/**accessor*/
|
|
103
|
+
set padding(_: string | undefined);
|
|
104
|
+
get indent(): string | undefined;
|
|
105
|
+
/**accessor*/
|
|
106
|
+
set indent(_: string | undefined);
|
|
107
|
+
get hover(): string | undefined;
|
|
108
|
+
/**accessor*/
|
|
109
|
+
set hover(_: string | undefined);
|
|
110
|
+
get rounded(): string | undefined;
|
|
111
|
+
/**accessor*/
|
|
112
|
+
set rounded(_: string | undefined);
|
|
113
|
+
get caretOpen(): string | undefined;
|
|
114
|
+
/**accessor*/
|
|
115
|
+
set caretOpen(_: string | undefined);
|
|
116
|
+
get caretClosed(): string | undefined;
|
|
117
|
+
/**accessor*/
|
|
118
|
+
set caretClosed(_: string | undefined);
|
|
119
|
+
get hyphenOpacity(): string | undefined;
|
|
120
|
+
/**accessor*/
|
|
121
|
+
set hyphenOpacity(_: string | undefined);
|
|
122
|
+
get regionSummary(): string | undefined;
|
|
123
|
+
/**accessor*/
|
|
124
|
+
set regionSummary(_: string | undefined);
|
|
125
|
+
get regionSymbol(): string | undefined;
|
|
126
|
+
/**accessor*/
|
|
127
|
+
set regionSymbol(_: string | undefined);
|
|
128
|
+
get regionChildren(): string | undefined;
|
|
129
|
+
/**accessor*/
|
|
130
|
+
set regionChildren(_: string | undefined);
|
|
131
|
+
get hideLead(): boolean | undefined;
|
|
132
|
+
/**accessor*/
|
|
133
|
+
set hideLead(_: boolean | undefined);
|
|
134
|
+
get hideChildren(): boolean | undefined;
|
|
135
|
+
/**accessor*/
|
|
136
|
+
set hideChildren(_: boolean | undefined);
|
|
137
|
+
get undefined(): any;
|
|
138
|
+
/**accessor*/
|
|
139
|
+
set undefined(_: any);
|
|
47
140
|
}
|
|
48
141
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface TreeViewNode {
|
|
2
|
+
/** Main content. accepts HTML. */
|
|
3
|
+
content: string;
|
|
4
|
+
/** Lead content. accepts HTML. */
|
|
5
|
+
lead?: string;
|
|
6
|
+
/** Set open by default on load. */
|
|
7
|
+
open?: boolean;
|
|
8
|
+
/** Set the tree disabled state. */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** children nodes. */
|
|
11
|
+
children?: TreeViewNode[];
|
|
12
|
+
/** Set the input's value. */
|
|
13
|
+
value?: unknown;
|
|
14
|
+
/** input checked */
|
|
15
|
+
checked?: boolean;
|
|
16
|
+
/** input is set to indeterminate, only availabe in multiple selection mode. */
|
|
17
|
+
indeterminate?: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
export type { AutocompleteOption } from './components/Autocomplete/types.js';
|
|
2
2
|
export type { ConicStop } from './components/ConicGradient/types.js';
|
|
3
|
-
export type { DrawerSettings } from './utilities/Drawer/types.js';
|
|
4
|
-
export type { ModalSettings, ModalComponent } from './utilities/Modal/types.js';
|
|
5
|
-
export type { ToastSettings } from './utilities/Toast/types.js';
|
|
3
|
+
export type { DrawerSettings, DrawerStore } from './utilities/Drawer/types.js';
|
|
4
|
+
export type { ModalSettings, ModalComponent, ModalStore } from './utilities/Modal/types.js';
|
|
5
|
+
export type { ToastSettings, ToastStore } from './utilities/Toast/types.js';
|
|
6
6
|
export type { TableSource } from './components/Table/types.js';
|
|
7
7
|
export type { PaginationSettings } from './components/Paginator/types.js';
|
|
8
8
|
export type { PopupSettings } from './utilities/Popup/types.js';
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
};
|
|
9
|
+
export type { Transition, TransitionParams } from './internal/transitions.js';
|
|
10
|
+
export type { TreeViewNode } from './components/TreeView/types.js';
|
|
11
|
+
export type { CssClasses, SvelteEvent } from './types.js';
|
|
13
12
|
export { storeHighlightJs } from './utilities/CodeBlock/stores.js';
|
|
14
13
|
export { storePopup } from './utilities/Popup/popup.js';
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
14
|
+
export { tocStore } from './utilities/TableOfContents/stores.js';
|
|
15
|
+
export { getDrawerStore } from './utilities/Drawer/stores.js';
|
|
16
|
+
export { getModalStore } from './utilities/Modal/stores.js';
|
|
17
|
+
export { getToastStore } from './utilities/Toast/stores.js';
|
|
18
|
+
export { initializeStores } from './utilities/index.js';
|
|
19
19
|
export { modeOsPrefers, modeUserPrefers, modeCurrent, getModeOsPrefers, getModeUserPrefers, getModeAutoPrefers, setModeUserPrefers, setModeCurrent, setInitialClassState, autoModeWatcher } from './utilities/LightSwitch/lightswitch.js';
|
|
20
20
|
export { localStorageStore } from './utilities/LocalStorageStore/LocalStorageStore.js';
|
|
21
|
+
export { prefersReducedMotionStore } from './utilities/PrefersReducedMotion/PrefersReducedMotion.js';
|
|
21
22
|
export { tableSourceMapper, tableSourceValues, tableMapperValues } from './components/Table/utils.js';
|
|
22
23
|
export { clipboard } from './actions/Clipboard/clipboard.js';
|
|
23
24
|
export { filter } from './actions/Filters/filter.js';
|
|
24
25
|
export { focusTrap } from './actions/FocusTrap/focusTrap.js';
|
|
25
26
|
export { popup } from './utilities/Popup/popup.js';
|
|
27
|
+
export { tocCrawler } from './utilities/TableOfContents/crawler.js';
|
|
26
28
|
export { default as Accordion } from './components/Accordion/Accordion.svelte';
|
|
27
29
|
export { default as AccordionItem } from './components/Accordion/AccordionItem.svelte';
|
|
28
30
|
export { default as AppBar } from './components/AppBar/AppBar.svelte';
|
|
@@ -52,14 +54,15 @@ export { default as Table } from './components/Table/Table.svelte';
|
|
|
52
54
|
export { default as TabGroup } from './components/Tab/TabGroup.svelte';
|
|
53
55
|
export { default as Tab } from './components/Tab/Tab.svelte';
|
|
54
56
|
export { default as TabAnchor } from './components/Tab/TabAnchor.svelte';
|
|
55
|
-
export { default as TableOfContents } from './components/TableOfContents/TableOfContents.svelte';
|
|
56
57
|
export { default as TreeView } from './components/TreeView/TreeView.svelte';
|
|
57
58
|
export { default as TreeViewItem } from './components/TreeView/TreeViewItem.svelte';
|
|
59
|
+
export { default as TreeViewDataDrivenItem } from './components/TreeView/TreeViewDataDrivenItem.svelte';
|
|
58
60
|
export { default as CodeBlock } from './utilities/CodeBlock/CodeBlock.svelte';
|
|
59
61
|
export { default as Modal } from './utilities/Modal/Modal.svelte';
|
|
60
62
|
export { default as Drawer } from './utilities/Drawer/Drawer.svelte';
|
|
61
63
|
export { default as LightSwitch } from './utilities/LightSwitch/LightSwitch.svelte';
|
|
62
64
|
export { default as Toast } from './utilities/Toast/Toast.svelte';
|
|
65
|
+
export { default as TableOfContents } from './utilities/TableOfContents/TableOfContents.svelte';
|
|
63
66
|
export { default as Apollo } from './actions/Filters/svg-filters/Apollo.svelte';
|
|
64
67
|
export { default as BlueNight } from './actions/Filters/svg-filters/BlueNight.svelte';
|
|
65
68
|
export { default as Emerald } from './actions/Filters/svg-filters/Emerald.svelte';
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
// This file defines the short path imports for the package (ex: @skeletonlabs/skeleton/*)
|
|
2
|
-
//
|
|
2
|
+
// Utilities ---
|
|
3
3
|
export { storeHighlightJs } from './utilities/CodeBlock/stores.js';
|
|
4
4
|
export { storePopup } from './utilities/Popup/popup.js';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
// Utilities
|
|
12
|
-
createDataTableStore, dataTableHandler,
|
|
13
|
-
// Svelte Actions
|
|
14
|
-
tableInteraction, tableA11y } from './utilities/DataTable/DataTable.js';
|
|
5
|
+
export { tocStore } from './utilities/TableOfContents/stores.js';
|
|
6
|
+
export { getDrawerStore } from './utilities/Drawer/stores.js';
|
|
7
|
+
export { getModalStore } from './utilities/Modal/stores.js';
|
|
8
|
+
export { getToastStore } from './utilities/Toast/stores.js';
|
|
9
|
+
export { initializeStores } from './utilities/index.js';
|
|
15
10
|
// Lightswitch
|
|
16
11
|
export {
|
|
17
12
|
// Stores
|
|
@@ -20,6 +15,8 @@ modeOsPrefers, modeUserPrefers, modeCurrent,
|
|
|
20
15
|
getModeOsPrefers, getModeUserPrefers, getModeAutoPrefers, setModeUserPrefers, setModeCurrent, setInitialClassState, autoModeWatcher } from './utilities/LightSwitch/lightswitch.js';
|
|
21
16
|
// Local Storage Store
|
|
22
17
|
export { localStorageStore } from './utilities/LocalStorageStore/LocalStorageStore.js';
|
|
18
|
+
// Prefers-reduced-motion
|
|
19
|
+
export { prefersReducedMotionStore } from './utilities/PrefersReducedMotion/PrefersReducedMotion.js';
|
|
23
20
|
// Component Utilities
|
|
24
21
|
export { tableSourceMapper, tableSourceValues, tableMapperValues } from './components/Table/utils.js';
|
|
25
22
|
// Svelte Actions ---
|
|
@@ -28,6 +25,7 @@ export { filter } from './actions/Filters/filter.js';
|
|
|
28
25
|
export { focusTrap } from './actions/FocusTrap/focusTrap.js';
|
|
29
26
|
// Utility Actions
|
|
30
27
|
export { popup } from './utilities/Popup/popup.js';
|
|
28
|
+
export { tocCrawler } from './utilities/TableOfContents/crawler.js';
|
|
31
29
|
// Svelte Components ---
|
|
32
30
|
export { default as Accordion } from './components/Accordion/Accordion.svelte';
|
|
33
31
|
export { default as AccordionItem } from './components/Accordion/AccordionItem.svelte';
|
|
@@ -58,15 +56,16 @@ export { default as Table } from './components/Table/Table.svelte';
|
|
|
58
56
|
export { default as TabGroup } from './components/Tab/TabGroup.svelte';
|
|
59
57
|
export { default as Tab } from './components/Tab/Tab.svelte';
|
|
60
58
|
export { default as TabAnchor } from './components/Tab/TabAnchor.svelte';
|
|
61
|
-
export { default as TableOfContents } from './components/TableOfContents/TableOfContents.svelte';
|
|
62
59
|
export { default as TreeView } from './components/TreeView/TreeView.svelte';
|
|
63
60
|
export { default as TreeViewItem } from './components/TreeView/TreeViewItem.svelte';
|
|
61
|
+
export { default as TreeViewDataDrivenItem } from './components/TreeView/TreeViewDataDrivenItem.svelte';
|
|
64
62
|
// Utility Components
|
|
65
63
|
export { default as CodeBlock } from './utilities/CodeBlock/CodeBlock.svelte';
|
|
66
64
|
export { default as Modal } from './utilities/Modal/Modal.svelte';
|
|
67
65
|
export { default as Drawer } from './utilities/Drawer/Drawer.svelte';
|
|
68
66
|
export { default as LightSwitch } from './utilities/LightSwitch/LightSwitch.svelte';
|
|
69
67
|
export { default as Toast } from './utilities/Toast/Toast.svelte';
|
|
68
|
+
export { default as TableOfContents } from './utilities/TableOfContents/TableOfContents.svelte';
|
|
70
69
|
// Filter Components
|
|
71
70
|
export { default as Apollo } from './actions/Filters/svg-filters/Apollo.svelte';
|
|
72
71
|
export { default as BlueNight } from './actions/Filters/svg-filters/BlueNight.svelte';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TransitionConfig } from 'svelte/transition';
|
|
2
|
+
export declare function dynamicTransition<T extends Transition>(node: Element, dynParams: DynamicTransitionParams<T>): TransitionConfig;
|
|
3
|
+
type DynamicTransitionParams<T extends Transition> = {
|
|
4
|
+
transition: T;
|
|
5
|
+
params: TransitionParams<T>;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type Transition = (node: Element, params?: any) => TransitionConfig;
|
|
9
|
+
export type TransitionParams<T extends Transition> = Parameters<T>[1];
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Transitions ---
|
|
2
|
+
export function dynamicTransition(node, dynParams) {
|
|
3
|
+
const { transition, params, enabled } = dynParams;
|
|
4
|
+
if (enabled)
|
|
5
|
+
return transition(node, params);
|
|
6
|
+
// it's better to just set the `duration` to 0 to prevent flickering
|
|
7
|
+
if ('duration' in params)
|
|
8
|
+
return transition(node, { duration: 0 });
|
|
9
|
+
// if the transition doesn't provide a `duration` prop, then we'll just return this as a last resort
|
|
10
|
+
return { duration: 0 };
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cubicInOut } from 'svelte/easing';
|
|
2
|
+
import { crossfade } from 'svelte/transition';
|
|
3
|
+
// TODO: convert to js transitions on revisit.
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
+
function swoop(duration, x, y) {
|
|
6
|
+
return crossfade({
|
|
7
|
+
duration: (d) => Math.sqrt(d * duration),
|
|
8
|
+
fallback(node) {
|
|
9
|
+
const style = getComputedStyle(node);
|
|
10
|
+
const transform = style.transform === 'none' ? '' : style.transform;
|
|
11
|
+
return {
|
|
12
|
+
duration,
|
|
13
|
+
easing: cubicInOut,
|
|
14
|
+
css: (t, u) => `
|
|
15
|
+
transform: ${transform} scale(${t}) translate(${u * x}%, ${u * y}%);
|
|
16
|
+
opacity: ${t}
|
|
17
|
+
`
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This type alias is to identify CSS classes within component props,
|
|
3
|
+
* which enables Tailwind IntelliSense
|
|
4
|
+
*/
|
|
5
|
+
export type CssClasses = string;
|
|
6
|
+
export type SvelteEvent<E extends Event = Event, T extends EventTarget = Element> = E & {
|
|
7
|
+
currentTarget: EventTarget & T;
|
|
8
|
+
};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|