@skeletonlabs/skeleton 1.6.1 → 1.6.2-dev.271f12b0
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/Avatar/Avatar.svelte.d.ts +2 -1
- package/dist/components/Paginator/Paginator.svelte +6 -1
- package/dist/components/Paginator/Paginator.svelte.d.ts +2 -0
- package/dist/components/Stepper/Step.svelte.d.ts +3 -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/TableOfContents/TableOfContents.svelte +3 -2
- package/dist/tailwind/intellisense.cjs +1 -1
- package/dist/utilities/Popup/popup.js +6 -3
- package/dist/utilities/Toast/Toast.svelte +1 -1
- package/package.json +1 -1
|
@@ -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.*/
|
|
@@ -2,6 +2,7 @@
|
|
|
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 showFirstLastButtons = false;
|
|
5
6
|
export let select = "select min-w-[150px]";
|
|
6
7
|
export let justify = "justify-between";
|
|
7
8
|
export let text = "text-xs";
|
|
@@ -31,7 +32,7 @@ function onFirst() {
|
|
|
31
32
|
dispatch("page", settings.offset);
|
|
32
33
|
}
|
|
33
34
|
function onLast() {
|
|
34
|
-
settings.offset = settings.size / settings.limit - 1;
|
|
35
|
+
settings.offset = Math.ceil(settings.size / settings.limit - 1);
|
|
35
36
|
dispatch("page", settings.offset);
|
|
36
37
|
}
|
|
37
38
|
$:
|
|
@@ -58,17 +59,21 @@ $:
|
|
|
58
59
|
</span>
|
|
59
60
|
<!-- Arrows -->
|
|
60
61
|
<div class="paginator-arrows space-x-2">
|
|
62
|
+
{#if showFirstLastButtons}
|
|
61
63
|
<button type="button" class="{buttonClasses}" on:click={() => { onFirst() }} disabled={disabled || settings.offset === 0}>
|
|
62
64
|
{@html buttonTextFirst}
|
|
63
65
|
</button>
|
|
66
|
+
{/if}
|
|
64
67
|
<button type="button" class="{buttonClasses}" on:click={() => { onPrev() }} disabled={disabled || settings.offset === 0}>
|
|
65
68
|
{@html buttonTextPrevious}
|
|
66
69
|
</button>
|
|
67
70
|
<button type="button" class="{buttonClasses}" on:click={() => { onNext() }} disabled={disabled || (settings.offset + 1) * settings.limit >= settings.size}>
|
|
68
71
|
{@html buttonTextNext}
|
|
69
72
|
</button>
|
|
73
|
+
{#if showFirstLastButtons}
|
|
70
74
|
<button type="button" class="{buttonClasses}" on:click={() => { onLast() }} disabled={disabled || (settings.offset + 1) * settings.limit >= settings.size}>
|
|
71
75
|
{@html buttonTextLast}
|
|
72
76
|
</button>
|
|
77
|
+
{/if}
|
|
73
78
|
</div>
|
|
74
79
|
</div>
|
|
@@ -7,6 +7,8 @@ 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
|
+
/** Show First and Last buttons.*/
|
|
11
|
+
showFirstLastButtons?: boolean | undefined;
|
|
10
12
|
/** Provide classes to style the select input.*/
|
|
11
13
|
select?: string | undefined;
|
|
12
14
|
/** Provide classes to set flexbox justification.*/
|
|
@@ -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';
|
|
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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { StepperButton } from './types';
|
|
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.*/
|
|
@@ -42,7 +43,7 @@ declare const __propDef: {
|
|
|
42
43
|
events: {
|
|
43
44
|
[evt: string]: CustomEvent<any>;
|
|
44
45
|
};
|
|
45
|
-
slots: {
|
|
46
|
+
/** Provide the HTML label content for the complete button. */ slots: {
|
|
46
47
|
default: {};
|
|
47
48
|
};
|
|
48
49
|
};
|
|
@@ -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 {};
|
|
@@ -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;
|
|
@@ -17,7 +17,7 @@ export function popup(triggerNode, args) {
|
|
|
17
17
|
let elemArrow;
|
|
18
18
|
function setDomElements() {
|
|
19
19
|
elemPopup = document.querySelector(`[data-popup="${args.target}"]`) ?? document.createElement('div');
|
|
20
|
-
elemArrow = elemPopup
|
|
20
|
+
elemArrow = elemPopup.querySelector(`.arrow`) ?? document.createElement('div');
|
|
21
21
|
}
|
|
22
22
|
setDomElements(); // init
|
|
23
23
|
// Render Floating UI Popup
|
|
@@ -76,7 +76,7 @@ export function popup(triggerNode, args) {
|
|
|
76
76
|
// https://floating-ui.com/docs/arrow
|
|
77
77
|
if (elemArrow) {
|
|
78
78
|
const { x: arrowX, y: arrowY } = middlewareData.arrow;
|
|
79
|
-
// @ts-
|
|
79
|
+
// @ts-expect-error implicit any
|
|
80
80
|
const staticSide = {
|
|
81
81
|
top: 'bottom',
|
|
82
82
|
right: 'left',
|
|
@@ -175,7 +175,10 @@ export function popup(triggerNode, args) {
|
|
|
175
175
|
}
|
|
176
176
|
// On Tab or ArrowDown key
|
|
177
177
|
const triggerMenuFocused = popupState.open && document.activeElement === triggerNode;
|
|
178
|
-
if (triggerMenuFocused &&
|
|
178
|
+
if (triggerMenuFocused &&
|
|
179
|
+
(key === 'ArrowDown' || key === 'Tab') &&
|
|
180
|
+
focusableAllowedList.length > 0 &&
|
|
181
|
+
focusablePopupElements.length > 0) {
|
|
179
182
|
event.preventDefault();
|
|
180
183
|
focusablePopupElements[0].focus();
|
|
181
184
|
}
|
|
@@ -17,7 +17,7 @@ export let buttonAction = "btn variant-filled";
|
|
|
17
17
|
export let buttonDismiss = "btn-icon btn-icon-sm variant-filled";
|
|
18
18
|
export let buttonDismissLabel = "\u2715";
|
|
19
19
|
const cWrapper = "flex fixed top-0 left-0 right-0 bottom-0 pointer-events-none";
|
|
20
|
-
const cSnackbar = "flex flex-col
|
|
20
|
+
const cSnackbar = "flex flex-col gap-y-2";
|
|
21
21
|
const cToast = "flex justify-between items-center pointer-events-auto";
|
|
22
22
|
const cToastActions = "flex items-center space-x-2";
|
|
23
23
|
let cPosition;
|