@skeletonlabs/skeleton 1.6.1 → 1.6.2-dev.14fd2520
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/AppRailAnchor.svelte +1 -1
- package/dist/components/AppRail/AppRailTile.svelte +2 -1
- package/dist/components/AppRail/AppRailTile.svelte.d.ts +2 -0
- package/dist/components/Autocomplete/Autocomplete.svelte +1 -1
- package/dist/components/Autocomplete/Autocomplete.svelte.d.ts +1 -1
- package/dist/components/Avatar/Avatar.svelte.d.ts +2 -1
- package/dist/components/ConicGradient/ConicGradient.svelte +3 -2
- package/dist/components/ConicGradient/ConicGradient.svelte.d.ts +3 -1
- package/dist/components/ListBox/ListBoxItem.svelte +18 -1
- package/dist/components/Paginator/Paginator.svelte +139 -41
- package/dist/components/Paginator/Paginator.svelte.d.ts +24 -10
- package/dist/components/SlideToggle/SlideToggle.svelte +2 -1
- package/dist/components/SlideToggle/SlideToggle.svelte.d.ts +3 -1
- package/dist/components/Stepper/Step.svelte +13 -3
- package/dist/components/Stepper/Step.svelte.d.ts +4 -2
- package/dist/components/Stepper/Stepper.svelte.d.ts +5 -4
- package/dist/components/Stepper/types.d.ts +9 -0
- package/dist/components/Stepper/types.js +1 -0
- package/dist/components/Table/Table.svelte +1 -1
- package/dist/components/Table/Table.svelte.d.ts +1 -1
- package/dist/components/TableOfContents/TableOfContents.svelte +4 -3
- package/dist/index.d.ts +21 -21
- package/dist/index.js +13 -13
- package/dist/styles/all.css +1 -1
- package/dist/styles/skeleton.css +1 -1
- package/dist/tailwind/generated/intellisense-classes.cjs +1 -1
- package/dist/tailwind/generated/intellisense-classes.d.cts +73 -0
- package/dist/tailwind/intellisense.cjs +1 -1
- package/dist/tailwind/tokens/backgrounds.cjs +1 -0
- package/dist/utilities/CodeBlock/CodeBlock.svelte +2 -2
- package/dist/utilities/DataTable/DataTable.d.ts +3 -3
- package/dist/utilities/DataTable/DataTable.js +2 -2
- package/dist/utilities/DataTable/types.d.ts +1 -1
- package/dist/utilities/Drawer/Drawer.svelte +11 -7
- package/dist/utilities/Drawer/Drawer.svelte.d.ts +4 -0
- package/dist/utilities/Drawer/stores.d.ts +1 -1
- package/dist/utilities/LightSwitch/LightSwitch.svelte +3 -2
- package/dist/utilities/LightSwitch/lightswitch.js +1 -1
- package/dist/utilities/Modal/Modal.svelte +17 -5
- package/dist/utilities/Modal/Modal.svelte.d.ts +3 -1
- package/dist/utilities/Modal/stores.d.ts +1 -1
- package/dist/utilities/Popup/popup.d.ts +1 -1
- package/dist/utilities/Popup/popup.js +8 -3
- package/dist/utilities/Toast/Toast.svelte +2 -2
- package/dist/utilities/Toast/stores.d.ts +1 -1
- package/package.json +16 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { getContext } from "svelte";
|
|
2
2
|
export let selected = false;
|
|
3
|
-
export let regionLead = "";
|
|
3
|
+
export let regionLead = "flex justify-center items-center";
|
|
4
4
|
export let regionLabel = "";
|
|
5
5
|
export let hover = getContext("hover");
|
|
6
6
|
export let active = getContext("active");
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export let group;
|
|
3
3
|
export let name;
|
|
4
4
|
export let value;
|
|
5
|
+
export let title = "";
|
|
5
6
|
export let regionLead = "";
|
|
6
7
|
export let regionLabel = "";
|
|
7
8
|
export let hover = getContext("hover");
|
|
@@ -30,7 +31,7 @@ function prunedRestProps() {
|
|
|
30
31
|
}
|
|
31
32
|
</script>
|
|
32
33
|
|
|
33
|
-
<label class="app-rail-tile {classesBase}" data-testid="app-rail-tile">
|
|
34
|
+
<label class="app-rail-tile {classesBase}" data-testid="app-rail-tile" {title}>
|
|
34
35
|
<!-- A11y attributes are not allowed on <label> -->
|
|
35
36
|
<div class="app-rail-wrapper {classesWrapper}" on:keydown on:keyup on:keypress>
|
|
36
37
|
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
name: string;
|
|
9
9
|
/** Set the input's value.*/
|
|
10
10
|
value: any;
|
|
11
|
+
/** Provide a hoverable title attribute for the tile.*/
|
|
12
|
+
title?: string | undefined;
|
|
11
13
|
/** Provide arbitrary classes to style the lead region.*/
|
|
12
14
|
regionLead?: string | undefined;
|
|
13
15
|
/** Provide arbitrary classes to style the label region.*/
|
|
@@ -74,7 +74,7 @@ $:
|
|
|
74
74
|
{#if optionsFiltered.length > 0}
|
|
75
75
|
<nav class="autocomplete-nav {classesNav}">
|
|
76
76
|
<ul class="autocomplete-list {classesList}">
|
|
77
|
-
{#each optionsFiltered.slice(0, sliceLimit) as option
|
|
77
|
+
{#each optionsFiltered.slice(0, sliceLimit) as option (option)}
|
|
78
78
|
<li class="autocomplete-item {classesItem}">
|
|
79
79
|
<button class="autocomplete-button {classesButton}" type="button" on:click={() => onSelection(option)} on:click on:keypress>
|
|
80
80
|
{@html option.label}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Action } from 'svelte/action';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
@@ -11,7 +12,7 @@ declare const __propDef: {
|
|
|
11
12
|
/** Provide the fallback image element source.*/
|
|
12
13
|
fallback?: string | undefined;
|
|
13
14
|
/** Image only. Provide an Svelte action reference, such as `filter`.*/
|
|
14
|
-
action?: any;
|
|
15
|
+
action?: Action<HTMLElement, any, Record<never, any>> | undefined;
|
|
15
16
|
/** Image only. Provide Svelte action params, such as Apollo.*/
|
|
16
17
|
actionParams?: string | undefined;
|
|
17
18
|
/** Provide classes to set background styles.*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script>import { afterUpdate } from "svelte";
|
|
2
|
-
import { tailwindDefaultColors } from "./settings";
|
|
2
|
+
import { tailwindDefaultColors } from "./settings.js";
|
|
3
3
|
export let stops = [{ color: ["neutral", 500], start: 0, end: 100 }];
|
|
4
4
|
export let legend = false;
|
|
5
5
|
export let spin = false;
|
|
6
6
|
export let width = "w-24";
|
|
7
7
|
export let hover = "bg-primary-hover-token";
|
|
8
|
+
export let digits = 0;
|
|
8
9
|
export let regionCaption = "";
|
|
9
10
|
export let regionCone = "";
|
|
10
11
|
export let regionLegend = "";
|
|
@@ -32,7 +33,7 @@ function genLegend() {
|
|
|
32
33
|
return {
|
|
33
34
|
label: v.label,
|
|
34
35
|
color: setColorValue(v.color),
|
|
35
|
-
value: v.end - v.start
|
|
36
|
+
value: (v.end - v.start).toFixed(digits)
|
|
36
37
|
};
|
|
37
38
|
});
|
|
38
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { ConicStop } from './types';
|
|
2
|
+
import type { ConicStop } from './types.js';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
@@ -13,6 +13,8 @@ declare const __propDef: {
|
|
|
13
13
|
width?: string | undefined;
|
|
14
14
|
/** Style the legend hover effect.*/
|
|
15
15
|
hover?: string | undefined;
|
|
16
|
+
/** Set the number of digits on the legend values.*/
|
|
17
|
+
digits?: number | undefined;
|
|
16
18
|
/** Style the caption region above the gradient.*/
|
|
17
19
|
regionCaption?: string | undefined;
|
|
18
20
|
/** Style the conic gradient region.*/
|
|
@@ -11,6 +11,23 @@ const cBase = "cursor-pointer -outline-offset-[3px]";
|
|
|
11
11
|
const cLabel = "flex items-center space-x-4";
|
|
12
12
|
let checked;
|
|
13
13
|
let elemInput;
|
|
14
|
+
function areDeeplyEqual(param1, param2) {
|
|
15
|
+
if (param1 === param2)
|
|
16
|
+
return true;
|
|
17
|
+
if (!(param1 instanceof Object) || !(param2 instanceof Object))
|
|
18
|
+
return false;
|
|
19
|
+
const keys1 = Object.keys(param1);
|
|
20
|
+
const keys2 = Object.keys(param2);
|
|
21
|
+
if (keys1.length !== keys2.length)
|
|
22
|
+
return false;
|
|
23
|
+
for (const key of keys1) {
|
|
24
|
+
const value1 = param1[key];
|
|
25
|
+
const value2 = param2[key];
|
|
26
|
+
if (!areDeeplyEqual(value1, value2))
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
14
31
|
$:
|
|
15
32
|
if (multiple)
|
|
16
33
|
updateCheckbox(group);
|
|
@@ -41,7 +58,7 @@ function onKeyDown(event) {
|
|
|
41
58
|
}
|
|
42
59
|
}
|
|
43
60
|
$:
|
|
44
|
-
selected = multiple ? group.
|
|
61
|
+
selected = multiple ? group.some((groupVal) => areDeeplyEqual(value, groupVal)) : areDeeplyEqual(group, value);
|
|
45
62
|
$:
|
|
46
63
|
classesActive = selected ? active : hover;
|
|
47
64
|
$:
|
|
@@ -2,38 +2,77 @@
|
|
|
2
2
|
const dispatch = createEventDispatcher();
|
|
3
3
|
export let settings = { offset: 0, limit: 5, size: 0, amounts: [1, 2, 5, 10] };
|
|
4
4
|
export let disabled = false;
|
|
5
|
-
export let
|
|
5
|
+
export let showPreviousNextButtons = true;
|
|
6
|
+
export let showFirstLastButtons = false;
|
|
7
|
+
export let showNumerals = false;
|
|
8
|
+
export let maxNumerals = 1;
|
|
6
9
|
export let justify = "justify-between";
|
|
7
|
-
export let
|
|
10
|
+
export let select = "select min-w-[150px]";
|
|
8
11
|
export let amountText = "Items";
|
|
9
|
-
export let
|
|
12
|
+
export let regionControl = "btn-group";
|
|
13
|
+
export let controlVariant = "variant-filled";
|
|
14
|
+
export let controlSeparator = "";
|
|
15
|
+
export let active = "variant-filled-primary";
|
|
16
|
+
export let buttonClasses = "!px-3 !py-1.5";
|
|
10
17
|
export let buttonTextPrevious = "←";
|
|
11
18
|
export let buttonTextNext = "→";
|
|
12
19
|
export let buttonTextFirst = "«";
|
|
13
20
|
export let buttonTextLast = "»";
|
|
14
21
|
const cBase = "flex flex-col md:flex-row items-center space-y-4 md:space-y-0 md:space-x-4";
|
|
15
22
|
const cLabel = "w-full md:w-auto";
|
|
16
|
-
|
|
23
|
+
let lastPage = Math.ceil(settings.size / settings.limit - 1);
|
|
24
|
+
let controlPages = getNumerals();
|
|
17
25
|
function onChangeLength() {
|
|
18
26
|
settings.offset = 0;
|
|
19
27
|
dispatch("amount", settings.limit);
|
|
28
|
+
lastPage = Math.ceil(settings.size / settings.limit - 1);
|
|
29
|
+
controlPages = getNumerals();
|
|
20
30
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
31
|
+
function gotoPage(page) {
|
|
32
|
+
if (page < 0)
|
|
33
|
+
return;
|
|
34
|
+
settings.offset = page;
|
|
23
35
|
dispatch("page", settings.offset);
|
|
36
|
+
controlPages = getNumerals();
|
|
24
37
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
function getFullNumerals() {
|
|
39
|
+
const pages = [];
|
|
40
|
+
for (let index = 0; index <= lastPage; index++) {
|
|
41
|
+
pages.push(index);
|
|
42
|
+
}
|
|
43
|
+
return pages;
|
|
28
44
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
function getNumerals() {
|
|
46
|
+
const pages = [];
|
|
47
|
+
const isWithinLeftSection = settings.offset < maxNumerals + 2;
|
|
48
|
+
const isWithinRightSection = settings.offset > lastPage - (maxNumerals + 2);
|
|
49
|
+
if (lastPage <= maxNumerals * 2 + 1)
|
|
50
|
+
return getFullNumerals();
|
|
51
|
+
pages.push(0);
|
|
52
|
+
if (!isWithinLeftSection)
|
|
53
|
+
pages.push(-1);
|
|
54
|
+
if (isWithinLeftSection || isWithinRightSection) {
|
|
55
|
+
const sectionStart = isWithinLeftSection ? 1 : lastPage - (maxNumerals + 2);
|
|
56
|
+
const sectionEnd = isWithinRightSection ? lastPage - 1 : maxNumerals + 2;
|
|
57
|
+
for (let i = sectionStart; i <= sectionEnd; i++) {
|
|
58
|
+
pages.push(i);
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
for (let i = settings.offset - maxNumerals; i <= settings.offset + maxNumerals; i++) {
|
|
62
|
+
pages.push(i);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (!isWithinRightSection)
|
|
66
|
+
pages.push(-1);
|
|
67
|
+
pages.push(lastPage);
|
|
68
|
+
return pages;
|
|
36
69
|
}
|
|
70
|
+
$:
|
|
71
|
+
classesButtonActive = (page) => {
|
|
72
|
+
return page === settings.offset ? `${active} pointer-events-none` : "";
|
|
73
|
+
};
|
|
74
|
+
$:
|
|
75
|
+
maxNumerals, onChangeLength();
|
|
37
76
|
$:
|
|
38
77
|
classesBase = `${cBase} ${justify} ${$$props.class ?? ""}`;
|
|
39
78
|
$:
|
|
@@ -41,34 +80,93 @@ $:
|
|
|
41
80
|
$:
|
|
42
81
|
classesSelect = `${select}`;
|
|
43
82
|
$:
|
|
44
|
-
|
|
83
|
+
classesControls = `${regionControl} ${controlVariant} ${controlSeparator}`;
|
|
45
84
|
</script>
|
|
46
85
|
|
|
47
|
-
<!-- prettier-ignore -->
|
|
48
86
|
<div class="paginator {classesBase}" data-testid="paginator">
|
|
49
87
|
<!-- Select Amount -->
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
88
|
+
{#if settings.amounts.length}
|
|
89
|
+
<label class="paginator-label {classesLabel}">
|
|
90
|
+
<select
|
|
91
|
+
bind:value={settings.limit}
|
|
92
|
+
on:change={onChangeLength}
|
|
93
|
+
class="paginator-select {classesSelect}"
|
|
94
|
+
{disabled}
|
|
95
|
+
aria-label="Select Amount"
|
|
96
|
+
>
|
|
97
|
+
{#each settings.amounts as amount}<option value={amount}>{amount} {amountText}</option>{/each}
|
|
98
|
+
</select>
|
|
99
|
+
</label>
|
|
100
|
+
{/if}
|
|
101
|
+
<!-- Controls -->
|
|
102
|
+
<div class="paginator-controls {classesControls}">
|
|
103
|
+
<!-- Button: First -->
|
|
104
|
+
{#if showFirstLastButtons}
|
|
105
|
+
<button
|
|
106
|
+
type="button"
|
|
107
|
+
class={buttonClasses}
|
|
108
|
+
on:click={() => {
|
|
109
|
+
gotoPage(0);
|
|
110
|
+
}}
|
|
111
|
+
disabled={disabled || settings.offset === 0}
|
|
112
|
+
>
|
|
113
|
+
{@html buttonTextFirst}
|
|
114
|
+
</button>
|
|
115
|
+
{/if}
|
|
116
|
+
<!-- Button: Back -->
|
|
117
|
+
{#if showPreviousNextButtons}
|
|
118
|
+
<button
|
|
119
|
+
type="button"
|
|
120
|
+
class={buttonClasses}
|
|
121
|
+
on:click={() => {
|
|
122
|
+
gotoPage(settings.offset - 1);
|
|
123
|
+
}}
|
|
124
|
+
disabled={disabled || settings.offset === 0}
|
|
125
|
+
>
|
|
126
|
+
{@html buttonTextPrevious}
|
|
127
|
+
</button>
|
|
128
|
+
{/if}
|
|
129
|
+
<!-- Center -->
|
|
130
|
+
{#if showNumerals === false}
|
|
131
|
+
<!-- Details -->
|
|
132
|
+
<button type="button" class="{buttonClasses} pointer-events-none !text-sm">
|
|
133
|
+
{settings.offset * settings.limit + 1}-{Math.min(settings.offset * settings.limit + settings.limit, settings.size)} <span
|
|
134
|
+
class="opacity-50">of {settings.size}</span
|
|
135
|
+
>
|
|
136
|
+
</button>
|
|
137
|
+
{:else}
|
|
138
|
+
<!-- Numeric Row -->
|
|
139
|
+
{#each controlPages as page}
|
|
140
|
+
<button type="button" class="{buttonClasses} {classesButtonActive(page)}" on:click={() => gotoPage(page)}>
|
|
141
|
+
{page >= 0 ? page + 1 : '...'}
|
|
142
|
+
</button>
|
|
143
|
+
{/each}
|
|
144
|
+
{/if}
|
|
145
|
+
<!-- Button: Next -->
|
|
146
|
+
{#if showPreviousNextButtons}
|
|
147
|
+
<button
|
|
148
|
+
type="button"
|
|
149
|
+
class={buttonClasses}
|
|
150
|
+
on:click={() => {
|
|
151
|
+
gotoPage(settings.offset + 1);
|
|
152
|
+
}}
|
|
153
|
+
disabled={disabled || (settings.offset + 1) * settings.limit >= settings.size}
|
|
154
|
+
>
|
|
155
|
+
{@html buttonTextNext}
|
|
156
|
+
</button>
|
|
157
|
+
{/if}
|
|
158
|
+
<!-- Button: last -->
|
|
159
|
+
{#if showFirstLastButtons}
|
|
160
|
+
<button
|
|
161
|
+
type="button"
|
|
162
|
+
class={buttonClasses}
|
|
163
|
+
on:click={() => {
|
|
164
|
+
gotoPage(lastPage);
|
|
165
|
+
}}
|
|
166
|
+
disabled={disabled || (settings.offset + 1) * settings.limit >= settings.size}
|
|
167
|
+
>
|
|
168
|
+
{@html buttonTextLast}
|
|
169
|
+
</button>
|
|
170
|
+
{/if}
|
|
73
171
|
</div>
|
|
74
172
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { PaginationSettings } from '
|
|
2
|
+
import type { PaginationSettings } from '../../index.js';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
@@ -7,23 +7,37 @@ declare const __propDef: {
|
|
|
7
7
|
settings?: PaginationSettings | undefined;
|
|
8
8
|
/** Sets selection and buttons to disabled state on-demand.*/
|
|
9
9
|
disabled?: boolean | undefined;
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/** Show Previous and Next buttons.*/
|
|
11
|
+
showPreviousNextButtons?: boolean | undefined;
|
|
12
|
+
/** Show First and Last buttons.*/
|
|
13
|
+
showFirstLastButtons?: boolean | undefined;
|
|
14
|
+
/** Displays a numeric row of page buttons.*/
|
|
15
|
+
showNumerals?: boolean | undefined;
|
|
16
|
+
/** Maximum number of active page siblings in the numeric row.*/
|
|
17
|
+
maxNumerals?: number | undefined;
|
|
12
18
|
/** Provide classes to set flexbox justification.*/
|
|
13
19
|
justify?: string | undefined;
|
|
14
|
-
/** Provide classes to style
|
|
15
|
-
|
|
20
|
+
/** Provide classes to style the select input.*/
|
|
21
|
+
select?: string | undefined;
|
|
16
22
|
/** Set the text for the amount selection input.*/
|
|
17
23
|
amountText?: string | undefined;
|
|
18
|
-
/**
|
|
24
|
+
/** Set the base classes for the control element.*/
|
|
25
|
+
regionControl?: string | undefined;
|
|
26
|
+
/** Provide variant style for the control button group.*/
|
|
27
|
+
controlVariant?: string | undefined;
|
|
28
|
+
/** Provide separator style for the control button group.*/
|
|
29
|
+
controlSeparator?: string | undefined;
|
|
30
|
+
/** Provide arbitrary classes to the active page buttons.*/
|
|
31
|
+
active?: string | undefined;
|
|
32
|
+
/** * Set the base button classes.*/
|
|
19
33
|
buttonClasses?: string | undefined;
|
|
20
|
-
/** Set the
|
|
34
|
+
/** Set the label for the Previous button.*/
|
|
21
35
|
buttonTextPrevious?: string | undefined;
|
|
22
|
-
/** Set the
|
|
36
|
+
/** Set the label for the Next button.*/
|
|
23
37
|
buttonTextNext?: string | undefined;
|
|
24
|
-
/** Set the
|
|
38
|
+
/** Set the label for the First button.*/
|
|
25
39
|
buttonTextFirst?: string | undefined;
|
|
26
|
-
/** Set the
|
|
40
|
+
/** Set the label for the Last button.*/
|
|
27
41
|
buttonTextLast?: string | undefined;
|
|
28
42
|
};
|
|
29
43
|
events: {
|
|
@@ -3,6 +3,7 @@ const dispatch = createEventDispatcher();
|
|
|
3
3
|
export let name;
|
|
4
4
|
export let checked = false;
|
|
5
5
|
export let size = "md";
|
|
6
|
+
export let background = "bg-surface-400 dark:bg-surface-700";
|
|
6
7
|
export let active = "bg-surface-900 dark:bg-surface-300";
|
|
7
8
|
export let border = "";
|
|
8
9
|
export let rounded = "rounded-full";
|
|
@@ -30,7 +31,7 @@ function onKeyDown(event) {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
$:
|
|
33
|
-
cTrackActive = checked ? active :
|
|
34
|
+
cTrackActive = checked ? active : `${background} cursor-pointer`;
|
|
34
35
|
$:
|
|
35
36
|
cThumbBackground = checked ? "bg-white/75" : "bg-white";
|
|
36
37
|
$:
|
|
@@ -8,7 +8,9 @@ declare const __propDef: {
|
|
|
8
8
|
checked?: boolean | undefined;
|
|
9
9
|
/** Sets the size of the component.*/
|
|
10
10
|
size?: string | undefined;
|
|
11
|
-
/** Provide
|
|
11
|
+
/** Provide classe to set the inactive state background color.*/
|
|
12
|
+
background?: string | undefined;
|
|
13
|
+
/** Provide classes to set the active state background color.*/
|
|
12
14
|
active?: string | undefined;
|
|
13
15
|
/** Provide classes to set the border styles.*/
|
|
14
16
|
border?: string | undefined;
|
|
@@ -67,10 +67,19 @@ onDestroy(() => {
|
|
|
67
67
|
<!-- Navigation -->
|
|
68
68
|
{#if $state.total > 1}
|
|
69
69
|
<div class="step-navigation {classesNavigation}" transition:fade|local={{ duration: 100 }}>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
{#if stepIndex === 0 && $$slots.navigation}
|
|
71
|
+
<!-- Slot: Navigation -->
|
|
72
|
+
<div class="step-navigation-slot">
|
|
73
|
+
<slot name="navigation" />
|
|
74
|
+
</div>
|
|
75
|
+
{:else}
|
|
76
|
+
<!-- Button: Back -->
|
|
77
|
+
<button type={buttonBackType} class="btn {buttonBack}" on:click={onBack} disabled={$state.current === 0}>
|
|
78
|
+
{@html buttonBackLabel}
|
|
79
|
+
</button>
|
|
80
|
+
{/if}
|
|
73
81
|
{#if stepIndex < $state.total - 1}
|
|
82
|
+
<!-- Button: Next -->
|
|
74
83
|
<button type={buttonNextType} class="btn {buttonNext}" on:click={onNext} disabled={locked}>
|
|
75
84
|
{#if locked}
|
|
76
85
|
<svg class="w-3 aspect-square" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
@@ -82,6 +91,7 @@ onDestroy(() => {
|
|
|
82
91
|
<span>{@html buttonNextLabel}</span>
|
|
83
92
|
</button>
|
|
84
93
|
{:else}
|
|
94
|
+
<!-- Button: Complete -->
|
|
85
95
|
<button type={buttonCompleteType} class="btn {buttonComplete}" on:click={onComplete} disabled={locked}>
|
|
86
96
|
{@html buttonCompleteLabel}
|
|
87
97
|
</button>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { Writable } from 'svelte/store';
|
|
3
|
+
import type { StepperDispatchParent, StepperState } from './types.js';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
[x: string]: any;
|
|
@@ -10,8 +11,8 @@ declare const __propDef: {
|
|
|
10
11
|
regionContent?: string | undefined;
|
|
11
12
|
/** Provide arbitrary classes to the step navigation region.*/
|
|
12
13
|
regionNavigation?: string | undefined;
|
|
13
|
-
state?: Writable<
|
|
14
|
-
dispatchParent?:
|
|
14
|
+
state?: Writable<StepperState> | undefined;
|
|
15
|
+
dispatchParent?: StepperDispatchParent | undefined;
|
|
15
16
|
stepTerm?: string | undefined;
|
|
16
17
|
gap?: string | undefined;
|
|
17
18
|
justify?: string | undefined;
|
|
@@ -31,6 +32,7 @@ declare const __propDef: {
|
|
|
31
32
|
slots: {
|
|
32
33
|
header: {};
|
|
33
34
|
default: {};
|
|
35
|
+
navigation: {};
|
|
34
36
|
};
|
|
35
37
|
};
|
|
36
38
|
export type StepProps = typeof __propDef.props;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { StepperButton } from './types.js';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
@@ -19,19 +20,19 @@ declare const __propDef: {
|
|
|
19
20
|
/** Provide arbitrary classes to style the back button.*/
|
|
20
21
|
buttonBack?: string | undefined;
|
|
21
22
|
/** Set the type of the back button.*/
|
|
22
|
-
buttonBackType?:
|
|
23
|
+
buttonBackType?: StepperButton | undefined;
|
|
23
24
|
/** Provide the HTML label content for the back button.*/
|
|
24
25
|
buttonBackLabel?: string | undefined;
|
|
25
26
|
/** Provide arbitrary classes to style the next button.*/
|
|
26
27
|
buttonNext?: string | undefined;
|
|
27
28
|
/** Set the type of the next button.*/
|
|
28
|
-
buttonNextType?:
|
|
29
|
+
buttonNextType?: StepperButton | undefined;
|
|
29
30
|
/** Provide the HTML label content for the next button.*/
|
|
30
31
|
buttonNextLabel?: string | undefined;
|
|
31
32
|
/** Provide arbitrary classes to style the complete button.*/
|
|
32
33
|
buttonComplete?: string | undefined;
|
|
33
34
|
/** Set the type of the complete button.*/
|
|
34
|
-
buttonCompleteType?:
|
|
35
|
+
buttonCompleteType?: StepperButton | undefined;
|
|
35
36
|
/** Provide the HTML label content for the complete button.*/
|
|
36
37
|
buttonCompleteLabel?: string | undefined;
|
|
37
38
|
/** Provide arbitrary classes to the stepper header region.*/
|
|
@@ -44,7 +45,7 @@ declare const __propDef: {
|
|
|
44
45
|
};
|
|
45
46
|
slots: {
|
|
46
47
|
default: {};
|
|
47
|
-
};
|
|
48
|
+
}; /** Provide the HTML label content for the complete button. */
|
|
48
49
|
};
|
|
49
50
|
export type StepperProps = typeof __propDef.props;
|
|
50
51
|
export type StepperEvents = typeof __propDef.events;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface StepperState {
|
|
2
|
+
current: number;
|
|
3
|
+
total: number;
|
|
4
|
+
}
|
|
5
|
+
export type StepperButton = 'submit' | 'reset' | 'button';
|
|
6
|
+
export type StepperDispatchParent = <EventKey extends string>(type: EventKey, detail: {
|
|
7
|
+
step: number;
|
|
8
|
+
state: StepperState;
|
|
9
|
+
}) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
-
import { tableA11y } from "../../utilities/DataTable/actions";
|
|
2
|
+
import { tableA11y } from "../../utilities/DataTable/actions.js";
|
|
3
3
|
const dispatch = createEventDispatcher();
|
|
4
4
|
export let source;
|
|
5
5
|
export let interactive = false;
|
|
@@ -16,7 +16,7 @@ const cLabel = "p-4 pt-0";
|
|
|
16
16
|
const cList = "list-none space-y-1";
|
|
17
17
|
const cListItem = "px-4 py-2 cursor-pointer";
|
|
18
18
|
let elemScrollParent;
|
|
19
|
-
let allowedHeadingsList
|
|
19
|
+
let allowedHeadingsList;
|
|
20
20
|
let filteredHeadingsList = [];
|
|
21
21
|
let activeHeaderId;
|
|
22
22
|
function queryAllowedHeadingsList() {
|
|
@@ -51,7 +51,8 @@ function setHeadingClasses(headingElem) {
|
|
|
51
51
|
}
|
|
52
52
|
function scrollToHeading(headingElem) {
|
|
53
53
|
const elemTarget = document.querySelector(`#${headingElem.id}`);
|
|
54
|
-
elemTarget
|
|
54
|
+
if (elemTarget)
|
|
55
|
+
elemTarget.scrollIntoView({ behavior: "smooth" });
|
|
55
56
|
}
|
|
56
57
|
function pageScrollHandler() {
|
|
57
58
|
const headingSizeThreshold = 40;
|
|
@@ -91,7 +92,7 @@ $:
|
|
|
91
92
|
<div class="toc {classesBase}" transition:fade|local={{ duration: 100 }}>
|
|
92
93
|
<nav class="toc-list {classesList}">
|
|
93
94
|
<div class="toc-label {classesLabel}">{label}</div>
|
|
94
|
-
{#each filteredHeadingsList as headingElem
|
|
95
|
+
{#each filteredHeadingsList as headingElem}
|
|
95
96
|
<!-- prettier-ignore -->
|
|
96
97
|
<li
|
|
97
98
|
class="toc-list-item {classesListItem} {setHeadingClasses(headingElem)} {headingElem.id === activeHeaderId ? active : ''}"
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export type { AutocompleteOption } from './components/Autocomplete/types';
|
|
2
|
-
export type { ConicStop } from './components/ConicGradient/types';
|
|
3
|
-
export type { DrawerSettings } from './utilities/Drawer/types';
|
|
4
|
-
export type { ModalSettings, ModalComponent } from './utilities/Modal/types';
|
|
5
|
-
export type { ToastSettings } from './utilities/Toast/types';
|
|
6
|
-
export type { TableSource } from './components/Table/types';
|
|
7
|
-
export type { PaginationSettings } from './components/Paginator/types';
|
|
8
|
-
export type { PopupSettings } from './utilities/Popup/types';
|
|
1
|
+
export type { AutocompleteOption } from './components/Autocomplete/types.js';
|
|
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';
|
|
6
|
+
export type { TableSource } from './components/Table/types.js';
|
|
7
|
+
export type { PaginationSettings } from './components/Paginator/types.js';
|
|
8
|
+
export type { PopupSettings } from './utilities/Popup/types.js';
|
|
9
9
|
export type CssClasses = string;
|
|
10
|
-
export { storeHighlightJs } from './utilities/CodeBlock/stores';
|
|
11
|
-
export { storePopup } from './utilities/Popup/popup';
|
|
12
|
-
export { drawerStore } from './utilities/Drawer/stores';
|
|
13
|
-
export { modalStore } from './utilities/Modal/stores';
|
|
14
|
-
export { toastStore } from './utilities/Toast/stores';
|
|
15
|
-
export { type DataTableModel, type DataTableOptions, createDataTableStore, dataTableHandler, tableInteraction, tableA11y } from './utilities/DataTable/DataTable';
|
|
16
|
-
export { modeOsPrefers, modeUserPrefers, modeCurrent, getModeOsPrefers, getModeUserPrefers, getModeAutoPrefers, setModeUserPrefers, setModeCurrent, setInitialClassState, autoModeWatcher } from './utilities/LightSwitch/lightswitch';
|
|
17
|
-
export { localStorageStore } from './utilities/LocalStorageStore/LocalStorageStore';
|
|
18
|
-
export { tableSourceMapper, tableSourceValues, tableMapperValues } from './components/Table/utils';
|
|
19
|
-
export { clipboard } from './actions/Clipboard/clipboard';
|
|
20
|
-
export { filter } from './actions/Filters/filter';
|
|
21
|
-
export { focusTrap } from './actions/FocusTrap/focusTrap';
|
|
22
|
-
export { popup } from './utilities/Popup/popup';
|
|
10
|
+
export { storeHighlightJs } from './utilities/CodeBlock/stores.js';
|
|
11
|
+
export { storePopup } from './utilities/Popup/popup.js';
|
|
12
|
+
export { drawerStore } from './utilities/Drawer/stores.js';
|
|
13
|
+
export { modalStore } from './utilities/Modal/stores.js';
|
|
14
|
+
export { toastStore } from './utilities/Toast/stores.js';
|
|
15
|
+
export { type DataTableModel, type DataTableOptions, createDataTableStore, dataTableHandler, tableInteraction, tableA11y } from './utilities/DataTable/DataTable.js';
|
|
16
|
+
export { modeOsPrefers, modeUserPrefers, modeCurrent, getModeOsPrefers, getModeUserPrefers, getModeAutoPrefers, setModeUserPrefers, setModeCurrent, setInitialClassState, autoModeWatcher } from './utilities/LightSwitch/lightswitch.js';
|
|
17
|
+
export { localStorageStore } from './utilities/LocalStorageStore/LocalStorageStore.js';
|
|
18
|
+
export { tableSourceMapper, tableSourceValues, tableMapperValues } from './components/Table/utils.js';
|
|
19
|
+
export { clipboard } from './actions/Clipboard/clipboard.js';
|
|
20
|
+
export { filter } from './actions/Filters/filter.js';
|
|
21
|
+
export { focusTrap } from './actions/FocusTrap/focusTrap.js';
|
|
22
|
+
export { popup } from './utilities/Popup/popup.js';
|
|
23
23
|
export { default as Accordion } from './components/Accordion/Accordion.svelte';
|
|
24
24
|
export { default as AccordionItem } from './components/Accordion/AccordionItem.svelte';
|
|
25
25
|
export { default as AppBar } from './components/AppBar/AppBar.svelte';
|