@skeletonlabs/skeleton 2.4.0 → 2.5.0-dev.71cd5b98
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/AppRail/AppRailTile.svelte +12 -3
- package/dist/components/AppRail/AppRailTile.svelte.d.ts +0 -1
- package/dist/components/Autocomplete/Autocomplete.svelte +2 -1
- package/dist/components/Autocomplete/Autocomplete.svelte.d.ts +2 -0
- package/dist/components/ProgressBar/ProgressBar.svelte +3 -2
- package/dist/components/ProgressBar/ProgressBar.svelte.d.ts +4 -2
- package/dist/components/ProgressRadial/ProgressRadial.svelte +3 -2
- package/dist/components/ProgressRadial/ProgressRadial.svelte.d.ts +2 -0
- package/dist/components/Table/Table.svelte +3 -4
- package/dist/components/TreeView/RecursiveTreeViewItem.svelte +20 -19
- package/dist/components/TreeView/TreeViewItem.svelte +9 -13
- package/dist/utilities/Drawer/Drawer.svelte +4 -3
- package/dist/utilities/Modal/stores.d.ts +1 -1
- package/dist/utilities/Modal/stores.js +1 -1
- package/dist/utilities/Popup/popup.js +3 -0
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ export let spacing = getContext("spacing");
|
|
|
11
11
|
export let width = getContext("width");
|
|
12
12
|
export let aspectRatio = getContext("aspectRatio");
|
|
13
13
|
const cBase = "cursor-pointer";
|
|
14
|
-
const cWrapper = "flex flex-col justify-center items-stretch";
|
|
14
|
+
const cWrapper = "flex flex-col justify-center items-stretch w-full";
|
|
15
15
|
const cInterface = "text-center";
|
|
16
16
|
const cLabel = "font-bold text-xs";
|
|
17
17
|
let elemInput;
|
|
@@ -27,6 +27,15 @@ $:
|
|
|
27
27
|
classesLead = `${regionLead}`;
|
|
28
28
|
$:
|
|
29
29
|
classesLabel = `${cLabel} ${regionLabel}`;
|
|
30
|
+
function onKeyDown(event) {
|
|
31
|
+
if (["Enter", "Space"].includes(event.code)) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
selectElemInput();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function selectElemInput() {
|
|
37
|
+
elemInput.click();
|
|
38
|
+
}
|
|
30
39
|
function prunedRestProps() {
|
|
31
40
|
delete $$restProps.class;
|
|
32
41
|
return $$restProps;
|
|
@@ -37,7 +46,7 @@ function prunedRestProps() {
|
|
|
37
46
|
<!-- A11y attributes are not allowed on <label> -->
|
|
38
47
|
<!-- FIXME: resolve a11y warnings -->
|
|
39
48
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
40
|
-
<
|
|
49
|
+
<button class="app-rail-wrapper {classesWrapper}" tabindex="0" on:click={selectElemInput} on:keydown={onKeyDown} on:keyup on:keypress>
|
|
41
50
|
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
42
51
|
<div class="h-0 w-0 overflow-hidden">
|
|
43
52
|
<input bind:this={elemInput} type="radio" bind:group {name} {value} {...prunedRestProps()} tabindex="-1" on:click on:change />
|
|
@@ -47,5 +56,5 @@ function prunedRestProps() {
|
|
|
47
56
|
{#if $$slots.lead}<div class="app-rail-lead {classesLead}"><slot name="lead" /></div>{/if}
|
|
48
57
|
<div class="app-rail-label {classesLabel}"><slot /></div>
|
|
49
58
|
</div>
|
|
50
|
-
</
|
|
59
|
+
</button>
|
|
51
60
|
</label>
|
|
@@ -20,6 +20,7 @@ export let regionList = "list-nav";
|
|
|
20
20
|
export let regionItem = "";
|
|
21
21
|
export let regionButton = "w-full";
|
|
22
22
|
export let regionEmpty = "text-center";
|
|
23
|
+
export let filter = filterOptions;
|
|
23
24
|
export let transitions = !$prefersReducedMotionStore;
|
|
24
25
|
export let transitionIn = slide;
|
|
25
26
|
export let transitionInParams = { duration: 200 };
|
|
@@ -56,7 +57,7 @@ function onSelection(option) {
|
|
|
56
57
|
$:
|
|
57
58
|
filterByAllowDeny(allowlist, denylist);
|
|
58
59
|
$:
|
|
59
|
-
optionsFiltered = input ?
|
|
60
|
+
optionsFiltered = input ? filter() : listedOptions;
|
|
60
61
|
$:
|
|
61
62
|
sliceLimit = limit ?? optionsFiltered.length;
|
|
62
63
|
$:
|
|
@@ -28,6 +28,8 @@ declare class __sveltets_Render<Value = unknown, Meta = unknown, TransitionIn ex
|
|
|
28
28
|
regionButton?: string | undefined;
|
|
29
29
|
/** Provide arbitrary classes to empty message.*/
|
|
30
30
|
regionEmpty?: string | undefined;
|
|
31
|
+
/** Provide a custom filter function.*/
|
|
32
|
+
filter?: (() => AutocompleteOption<Value, Meta>[]) | undefined;
|
|
31
33
|
/** Enable/Disable transitions*/
|
|
32
34
|
transitions?: boolean | undefined;
|
|
33
35
|
/** Provide the transition used on entry.*/
|
|
@@ -3,6 +3,7 @@ export let min = 0;
|
|
|
3
3
|
export let max = 100;
|
|
4
4
|
export let height = "h-2";
|
|
5
5
|
export let rounded = "rounded-token";
|
|
6
|
+
export let transition = "transition-[width]";
|
|
6
7
|
export let meter = "bg-surface-900-50-token";
|
|
7
8
|
export let track = "bg-surface-200-700-token";
|
|
8
9
|
export let labelledby = "";
|
|
@@ -15,9 +16,9 @@ $:
|
|
|
15
16
|
$:
|
|
16
17
|
classesIndeterminate = indeterminate ? "animIndeterminate" : "";
|
|
17
18
|
$:
|
|
18
|
-
classesTrack = `${cTrack} ${
|
|
19
|
+
classesTrack = `${cTrack} ${track} ${height} ${rounded} ${$$props.class ?? ""}`;
|
|
19
20
|
$:
|
|
20
|
-
classesMeter = `${cMeter} ${rounded} ${classesIndeterminate} ${
|
|
21
|
+
classesMeter = `${cMeter} ${meter} ${rounded} ${classesIndeterminate} ${transition}`;
|
|
21
22
|
</script>
|
|
22
23
|
|
|
23
24
|
<!-- Track -->
|
|
@@ -12,9 +12,11 @@ declare const __propDef: {
|
|
|
12
12
|
height?: string | undefined;
|
|
13
13
|
/** Provide classes to set rounded styles.*/
|
|
14
14
|
rounded?: string | undefined;
|
|
15
|
-
/** Provide
|
|
15
|
+
/** Provide classes to set the meter transition styles.*/
|
|
16
|
+
transition?: string | undefined;
|
|
17
|
+
/** Sets the base classes of the meter element.*/
|
|
16
18
|
meter?: string | undefined;
|
|
17
|
-
/**
|
|
19
|
+
/** Sets the base classes of the track element.*/
|
|
18
20
|
track?: string | undefined;
|
|
19
21
|
/** Provide the ARIA labelledby value.*/
|
|
20
22
|
labelledby?: string | undefined;
|
|
@@ -4,6 +4,7 @@ export let value = void 0;
|
|
|
4
4
|
export let stroke = 40;
|
|
5
5
|
export let font = 56;
|
|
6
6
|
export let strokeLinecap = "butt";
|
|
7
|
+
export let transition = "transition-[stroke-dashoffset]";
|
|
7
8
|
export let width = "w-36";
|
|
8
9
|
export let meter = "stroke-surface-900 dark:stroke-surface-50";
|
|
9
10
|
export let track = "stroke-surface-500/30";
|
|
@@ -11,7 +12,7 @@ export let fill = "fill-token";
|
|
|
11
12
|
export let labelledby = "";
|
|
12
13
|
const cBase = "progress-radial relative overflow-hidden";
|
|
13
14
|
const cBaseTrack = "fill-transparent";
|
|
14
|
-
const cBaseMeter = "fill-transparent
|
|
15
|
+
const cBaseMeter = "fill-transparent -rotate-90 origin-[50%_50%]";
|
|
15
16
|
const baseSize = 512;
|
|
16
17
|
const radius = baseSize / 2 - stroke / 2;
|
|
17
18
|
let circumference = radius;
|
|
@@ -45,7 +46,7 @@ $:
|
|
|
45
46
|
|
|
46
47
|
<!-- Meter -->
|
|
47
48
|
<circle
|
|
48
|
-
class="progress-radial-meter {cBaseMeter} {meter}"
|
|
49
|
+
class="progress-radial-meter {cBaseMeter} {meter} {transition}"
|
|
49
50
|
stroke-width={stroke}
|
|
50
51
|
r={radius}
|
|
51
52
|
cx="50%"
|
|
@@ -10,6 +10,8 @@ declare const __propDef: {
|
|
|
10
10
|
font?: number | undefined;
|
|
11
11
|
/** Sets the stoke-linecap value*/
|
|
12
12
|
strokeLinecap?: "butt" | "round" | "square" | undefined;
|
|
13
|
+
/** Provide classes to set the meter transition styles.*/
|
|
14
|
+
transition?: string | undefined;
|
|
13
15
|
/** Provide classes to set the width.*/
|
|
14
16
|
width?: string | undefined;
|
|
15
17
|
/** Provide classes to set meter color.*/
|
|
@@ -36,7 +36,7 @@ $:
|
|
|
36
36
|
<table
|
|
37
37
|
class="{classesTable}"
|
|
38
38
|
class:table-interactive={interactive}
|
|
39
|
-
role="grid"
|
|
39
|
+
role={interactive ? "grid" : "table"}
|
|
40
40
|
use:tableA11y
|
|
41
41
|
>
|
|
42
42
|
<!-- on:keydown={(e) => onTableKeydown(elemTable, e)} -->
|
|
@@ -44,7 +44,7 @@ $:
|
|
|
44
44
|
<thead class="table-head {regionHead}">
|
|
45
45
|
<tr>
|
|
46
46
|
{#each source.head as heading }
|
|
47
|
-
<th class="{regionHeadCell}">{@html heading}</th>
|
|
47
|
+
<th class="{regionHeadCell}" role="columnheader">{@html heading}</th>
|
|
48
48
|
{/each}
|
|
49
49
|
</tr>
|
|
50
50
|
</thead>
|
|
@@ -60,12 +60,11 @@ $:
|
|
|
60
60
|
>
|
|
61
61
|
{#each row as cell, cellIndex}
|
|
62
62
|
<!-- Cell -->
|
|
63
|
-
<!-- prettier-ignore -->
|
|
64
63
|
<td
|
|
65
64
|
class="{regionCell}"
|
|
66
65
|
role="gridcell"
|
|
67
66
|
aria-colindex={cellIndex + 1}
|
|
68
|
-
tabindex={cellIndex === 0 ? 0 : -1}
|
|
67
|
+
tabindex={cellIndex === 0 && interactive ? 0 : -1}
|
|
69
68
|
>
|
|
70
69
|
{@html Number(cell) === 0 ? cell : (cell ? cell : '-')}
|
|
71
70
|
</td>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import TreeViewItem from "./TreeViewItem.svelte";
|
|
2
2
|
import RecursiveTreeViewItem from "./RecursiveTreeViewItem.svelte";
|
|
3
|
-
import { createEventDispatcher, getContext, onMount
|
|
3
|
+
import { createEventDispatcher, getContext, onMount } from "svelte";
|
|
4
4
|
export let nodes = [];
|
|
5
5
|
export let expandedNodes = [];
|
|
6
6
|
export let disabledNodes = [];
|
|
@@ -9,8 +9,7 @@ export let indeterminateNodes = [];
|
|
|
9
9
|
let selection = getContext("selection");
|
|
10
10
|
let multiple = getContext("multiple");
|
|
11
11
|
let relational = getContext("relational");
|
|
12
|
-
let
|
|
13
|
-
let group;
|
|
12
|
+
let group = multiple ? [] : "";
|
|
14
13
|
let name = "";
|
|
15
14
|
const dispatch = createEventDispatcher();
|
|
16
15
|
function toggleNode(node, open) {
|
|
@@ -52,27 +51,29 @@ function checkNode(node, checked, indeterminate) {
|
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
|
-
|
|
54
|
+
if (selection) {
|
|
55
|
+
if (multiple) {
|
|
56
|
+
nodes.forEach((node) => {
|
|
57
|
+
if (!Array.isArray(group))
|
|
58
|
+
return;
|
|
59
|
+
if (checkedNodes.includes(node.id) && !group.includes(node.id)) {
|
|
60
|
+
group.push(node.id);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
group = group;
|
|
64
|
+
} else {
|
|
65
|
+
nodes.forEach((node) => {
|
|
66
|
+
if (checkedNodes.includes(node.id) && group !== node.id) {
|
|
67
|
+
group = node.id;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
56
72
|
onMount(async () => {
|
|
57
73
|
if (selection) {
|
|
58
74
|
name = String(Math.random());
|
|
59
|
-
if (group === void 0) {
|
|
60
|
-
if (multiple) {
|
|
61
|
-
group = [];
|
|
62
|
-
nodes.forEach((node) => {
|
|
63
|
-
if (checkedNodes.includes(node.id) && Array.isArray(group))
|
|
64
|
-
group.push(node.id);
|
|
65
|
-
});
|
|
66
|
-
group = group;
|
|
67
|
-
} else if (!nodes.some((node) => checkedNodes.includes(node.id))) {
|
|
68
|
-
group = "";
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
75
|
if (!relational)
|
|
72
76
|
treeItems = [];
|
|
73
|
-
checkedNodes = [];
|
|
74
|
-
await tick();
|
|
75
|
-
checkedNodes = [...tempCheckedNodes];
|
|
76
77
|
}
|
|
77
78
|
});
|
|
78
79
|
export let treeItems = [];
|
|
@@ -37,23 +37,12 @@ $:
|
|
|
37
37
|
$:
|
|
38
38
|
if (multiple)
|
|
39
39
|
updateGroup(checked, indeterminate);
|
|
40
|
-
$:
|
|
41
|
-
if (!multiple)
|
|
42
|
-
updateRadio(group);
|
|
43
|
-
$:
|
|
44
|
-
if (!multiple)
|
|
45
|
-
updateRadioGroup(checked);
|
|
46
|
-
let initUpdate = true;
|
|
47
40
|
function updateCheckbox(group2, indeterminate2) {
|
|
48
41
|
if (!Array.isArray(group2))
|
|
49
42
|
return;
|
|
50
43
|
checked = group2.indexOf(value) >= 0;
|
|
51
44
|
dispatch("groupChange", { checked, indeterminate: indeterminate2 });
|
|
52
45
|
dispatch("childChange");
|
|
53
|
-
if (initUpdate) {
|
|
54
|
-
onParentChange();
|
|
55
|
-
initUpdate = false;
|
|
56
|
-
}
|
|
57
46
|
}
|
|
58
47
|
function updateGroup(checked2, indeterminate2) {
|
|
59
48
|
if (!Array.isArray(group))
|
|
@@ -63,16 +52,23 @@ function updateGroup(checked2, indeterminate2) {
|
|
|
63
52
|
if (index < 0) {
|
|
64
53
|
group.push(value);
|
|
65
54
|
group = group;
|
|
66
|
-
onParentChange();
|
|
67
55
|
}
|
|
68
56
|
} else {
|
|
69
57
|
if (index >= 0) {
|
|
70
58
|
group.splice(index, 1);
|
|
71
59
|
group = group;
|
|
72
|
-
onParentChange();
|
|
73
60
|
}
|
|
74
61
|
}
|
|
62
|
+
if (!indeterminate2) {
|
|
63
|
+
onParentChange();
|
|
64
|
+
}
|
|
75
65
|
}
|
|
66
|
+
$:
|
|
67
|
+
if (!multiple)
|
|
68
|
+
updateRadio(group);
|
|
69
|
+
$:
|
|
70
|
+
if (!multiple)
|
|
71
|
+
updateRadioGroup(checked);
|
|
76
72
|
function updateRadio(group2) {
|
|
77
73
|
checked = group2 === value;
|
|
78
74
|
dispatch("groupChange", { checked, indeterminate: false });
|
|
@@ -6,6 +6,7 @@ import { focusTrap } from "../../actions/FocusTrap/focusTrap.js";
|
|
|
6
6
|
import { getDrawerStore } from "./stores.js";
|
|
7
7
|
import { fade, fly } from "svelte/transition";
|
|
8
8
|
import { dynamicTransition } from "../../internal/transitions.js";
|
|
9
|
+
import { cubicIn } from "svelte/easing";
|
|
9
10
|
export let position = "left";
|
|
10
11
|
export let bgDrawer = "bg-surface-100-800-token";
|
|
11
12
|
export let border = "";
|
|
@@ -138,8 +139,8 @@ $:
|
|
|
138
139
|
class="drawer-backdrop {classesBackdrop}"
|
|
139
140
|
data-testid="drawer-backdrop"
|
|
140
141
|
on:mousedown={onDrawerInteraction}
|
|
141
|
-
on:touchstart
|
|
142
|
-
on:touchend
|
|
142
|
+
on:touchstart|passive
|
|
143
|
+
on:touchend|passive
|
|
143
144
|
on:keypress
|
|
144
145
|
in:dynamicTransition|local={{
|
|
145
146
|
transition: fade,
|
|
@@ -170,7 +171,7 @@ $:
|
|
|
170
171
|
}}
|
|
171
172
|
out:dynamicTransition|local={{
|
|
172
173
|
transition: fly,
|
|
173
|
-
params: { x: anim.x, y: anim.y, duration, opacity: opacityTransition ? undefined : 1 },
|
|
174
|
+
params: { x: anim.x, y: anim.y, duration, opacity: opacityTransition ? undefined : 1, easing: cubicIn },
|
|
174
175
|
enabled: transitions
|
|
175
176
|
}}
|
|
176
177
|
>
|
|
@@ -157,6 +157,9 @@ export function popup(triggerNode, args) {
|
|
|
157
157
|
}
|
|
158
158
|
// Handle Close Query State
|
|
159
159
|
const closeQueryString = args.closeQuery === undefined ? 'a[href], button' : args.closeQuery;
|
|
160
|
+
// Return if no closeQuery is provided
|
|
161
|
+
if (closeQueryString === '')
|
|
162
|
+
return;
|
|
160
163
|
const closableMenuElements = elemPopup?.querySelectorAll(closeQueryString);
|
|
161
164
|
closableMenuElements?.forEach((elem) => {
|
|
162
165
|
if (elem.contains(event.target))
|