@skeletonlabs/skeleton 2.0.0-rc.3 → 2.1.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/AppShell/AppShell.svelte +3 -2
- package/dist/components/AppShell/AppShell.svelte.d.ts +2 -0
- package/dist/components/InputChip/InputChip.svelte +6 -0
- package/dist/index.d.ts +3 -3
- package/dist/utilities/Drawer/stores.d.ts +9 -5
- package/dist/utilities/Drawer/stores.js +8 -4
- package/dist/utilities/Drawer/types.d.ts +1 -0
- 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 +9 -5
- package/dist/utilities/Modal/stores.js +8 -4
- package/dist/utilities/Modal/types.d.ts +1 -0
- package/dist/utilities/TableOfContents/crawler.d.ts +2 -0
- package/dist/utilities/TableOfContents/crawler.js +7 -5
- 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 +9 -5
- package/dist/utilities/Toast/stores.js +8 -4
- package/dist/utilities/Toast/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>export let
|
|
1
|
+
<script>export let scrollbarGutter = "auto";
|
|
2
|
+
export let regionPage = "";
|
|
2
3
|
export let slotHeader = "z-10";
|
|
3
4
|
export let slotSidebarLeft = "w-auto";
|
|
4
5
|
export let slotSidebarRight = "w-auto";
|
|
@@ -43,7 +44,7 @@ $:
|
|
|
43
44
|
{/if}
|
|
44
45
|
|
|
45
46
|
<!-- Page -->
|
|
46
|
-
<div id="page" class="{regionPage} {cPage}" on:scroll>
|
|
47
|
+
<div id="page" class="{regionPage} {cPage}" style:scrollbarGutter on:scroll>
|
|
47
48
|
<!-- Slot: Page Header -->
|
|
48
49
|
{#if $$slots.pageHeader}
|
|
49
50
|
<header id="page-header" class="flex-none {classesPageHeader}"><slot name="pageHeader">(slot:header)</slot></header>
|
|
@@ -10,6 +10,8 @@ import type { SvelteEvent } from '../../index.js';
|
|
|
10
10
|
declare const __propDef: {
|
|
11
11
|
props: {
|
|
12
12
|
[x: string]: any;
|
|
13
|
+
/** Set `scrollbar-gutter` style.*/
|
|
14
|
+
scrollbarGutter?: string | undefined;
|
|
13
15
|
/** Apply arbitrary classes to the entire `#page` region.*/
|
|
14
16
|
regionPage?: string | undefined;
|
|
15
17
|
/** Apply arbitrary classes to the `header` slot container element*/
|
|
@@ -110,6 +110,12 @@ $:
|
|
|
110
110
|
classesChipList = `${cChipList}`;
|
|
111
111
|
$:
|
|
112
112
|
classesInputField = `${cInputField}`;
|
|
113
|
+
$:
|
|
114
|
+
chipValues = value?.map((val, i) => {
|
|
115
|
+
if (chipValues[i]?.val === val)
|
|
116
|
+
return chipValues[i];
|
|
117
|
+
return { id: Math.random(), val };
|
|
118
|
+
}) || [];
|
|
113
119
|
</script>
|
|
114
120
|
|
|
115
121
|
<div class="input-chip {classesBase}" class:opacity-50={$$restProps.disabled}>
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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';
|
|
@@ -3,13 +3,17 @@ import type { DrawerSettings } from './types.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Retrieves the `drawerStore`.
|
|
5
5
|
*
|
|
6
|
+
* This can *ONLY* be called from the **top level** of components!
|
|
7
|
+
*
|
|
6
8
|
* @example
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
+
* ```svelte
|
|
10
|
+
* <script>
|
|
11
|
+
* import { getDrawerStore } from "@skeletonlabs/skeleton";
|
|
9
12
|
*
|
|
10
|
-
*
|
|
13
|
+
* const drawerStore = getDrawerStore();
|
|
11
14
|
*
|
|
12
|
-
*
|
|
15
|
+
* drawerStore.open();
|
|
16
|
+
* </script>
|
|
13
17
|
* ```
|
|
14
18
|
*/
|
|
15
19
|
export declare function getDrawerStore(): DrawerStore;
|
|
@@ -17,7 +21,7 @@ export declare function getDrawerStore(): DrawerStore;
|
|
|
17
21
|
* Initializes the `drawerStore`.
|
|
18
22
|
*/
|
|
19
23
|
export declare function initializeDrawerStore(): DrawerStore;
|
|
20
|
-
type DrawerStore = ReturnType<typeof drawerService>;
|
|
24
|
+
export type DrawerStore = ReturnType<typeof drawerService>;
|
|
21
25
|
declare function drawerService(): {
|
|
22
26
|
subscribe: (this: void, run: import("svelte/store").Subscriber<DrawerSettings>, invalidate?: import("svelte/store").Invalidator<DrawerSettings> | undefined) => import("svelte/store").Unsubscriber;
|
|
23
27
|
set: (this: void, value: DrawerSettings) => void;
|
|
@@ -5,13 +5,17 @@ const DRAWER_STORE_KEY = 'drawerStore';
|
|
|
5
5
|
/**
|
|
6
6
|
* Retrieves the `drawerStore`.
|
|
7
7
|
*
|
|
8
|
+
* This can *ONLY* be called from the **top level** of components!
|
|
9
|
+
*
|
|
8
10
|
* @example
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
+
* ```svelte
|
|
12
|
+
* <script>
|
|
13
|
+
* import { getDrawerStore } from "@skeletonlabs/skeleton";
|
|
11
14
|
*
|
|
12
|
-
*
|
|
15
|
+
* const drawerStore = getDrawerStore();
|
|
13
16
|
*
|
|
14
|
-
*
|
|
17
|
+
* drawerStore.open();
|
|
18
|
+
* </script>
|
|
15
19
|
* ```
|
|
16
20
|
*/
|
|
17
21
|
export function getDrawerStore() {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ModalSettings } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
modalSetting: ModalSettings;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export type ModalTestProps = typeof __propDef.props;
|
|
13
|
+
export type ModalTestEvents = typeof __propDef.events;
|
|
14
|
+
export type ModalTestSlots = typeof __propDef.slots;
|
|
15
|
+
export default class ModalTest extends SvelteComponentTyped<ModalTestProps, ModalTestEvents, ModalTestSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -3,13 +3,17 @@ import type { ModalSettings } from './types.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Retrieves the `modalStore`.
|
|
5
5
|
*
|
|
6
|
+
* This can *ONLY* be called from the **top level** of components!
|
|
7
|
+
*
|
|
6
8
|
* @example
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
+
* ```svelte
|
|
10
|
+
* <script>
|
|
11
|
+
* import { getmodalStore } from "@skeletonlabs/skeleton";
|
|
9
12
|
*
|
|
10
|
-
*
|
|
13
|
+
* const modalStore = getModalStore();
|
|
11
14
|
*
|
|
12
|
-
*
|
|
15
|
+
* modalStore.trigger({ type: "alert", title: "Welcome!" });
|
|
16
|
+
* </script>
|
|
13
17
|
* ```
|
|
14
18
|
*/
|
|
15
19
|
export declare function getModalStore(): ModalStore;
|
|
@@ -17,7 +21,7 @@ export declare function getModalStore(): ModalStore;
|
|
|
17
21
|
* Initializes the `modalStore`.
|
|
18
22
|
*/
|
|
19
23
|
export declare function initializeModalStore(): ModalStore;
|
|
20
|
-
type ModalStore = ReturnType<typeof modalService>;
|
|
24
|
+
export type ModalStore = ReturnType<typeof modalService>;
|
|
21
25
|
declare function modalService(): {
|
|
22
26
|
subscribe: (this: void, run: import("svelte/store").Subscriber<ModalSettings[]>, invalidate?: import("svelte/store").Invalidator<ModalSettings[]> | undefined) => import("svelte/store").Unsubscriber;
|
|
23
27
|
set: (this: void, value: ModalSettings[]) => void;
|
|
@@ -5,13 +5,17 @@ const MODAL_STORE_KEY = 'modalStore';
|
|
|
5
5
|
/**
|
|
6
6
|
* Retrieves the `modalStore`.
|
|
7
7
|
*
|
|
8
|
+
* This can *ONLY* be called from the **top level** of components!
|
|
9
|
+
*
|
|
8
10
|
* @example
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
+
* ```svelte
|
|
12
|
+
* <script>
|
|
13
|
+
* import { getmodalStore } from "@skeletonlabs/skeleton";
|
|
11
14
|
*
|
|
12
|
-
*
|
|
15
|
+
* const modalStore = getModalStore();
|
|
13
16
|
*
|
|
14
|
-
*
|
|
17
|
+
* modalStore.trigger({ type: "alert", title: "Welcome!" });
|
|
18
|
+
* </script>
|
|
15
19
|
* ```
|
|
16
20
|
*/
|
|
17
21
|
export function getModalStore() {
|
|
@@ -6,6 +6,8 @@ interface TOCCrawlerArgs {
|
|
|
6
6
|
scrollTarget?: string;
|
|
7
7
|
/** Reload the action when this key value changes. */
|
|
8
8
|
key?: unknown;
|
|
9
|
+
prefix?: string;
|
|
10
|
+
suffix?: string;
|
|
9
11
|
}
|
|
10
12
|
export declare function tocCrawler(node: HTMLElement, args?: TOCCrawlerArgs): {
|
|
11
13
|
update(newArgs: TOCCrawlerArgs): void;
|
|
@@ -6,16 +6,16 @@ export function tocCrawler(node, args) {
|
|
|
6
6
|
let headings;
|
|
7
7
|
let permalinks = [];
|
|
8
8
|
function init() {
|
|
9
|
-
// Reset headings
|
|
10
|
-
headings = node.querySelectorAll(queryElements);
|
|
11
|
-
// Reset the permalinks array:
|
|
12
|
-
permalinks = [];
|
|
13
9
|
// Set accepted list of query elements
|
|
10
|
+
// (IMPORTANT: must proceed resetting `headings` below)
|
|
14
11
|
if (args?.queryElements)
|
|
15
12
|
queryElements = args.queryElements;
|
|
16
13
|
// Set the desired scroll target to monitor
|
|
17
14
|
if (args?.scrollTarget)
|
|
18
15
|
scrollTarget = args.scrollTarget;
|
|
16
|
+
// Reset local values
|
|
17
|
+
headings = node.querySelectorAll(queryElements);
|
|
18
|
+
permalinks = [];
|
|
19
19
|
// Query and process the headings
|
|
20
20
|
queryHeadings();
|
|
21
21
|
}
|
|
@@ -31,7 +31,9 @@ export function tocCrawler(node, args) {
|
|
|
31
31
|
.replaceAll(/[^a-zA-Z0-9 ]/g, '')
|
|
32
32
|
.replaceAll(' ', '-')
|
|
33
33
|
.toLowerCase();
|
|
34
|
-
|
|
34
|
+
const prefix = args.prefix ? `${args.prefix}-` : '';
|
|
35
|
+
const suffix = args.suffix ? `-${args.suffix}` : '';
|
|
36
|
+
elemHeading.id = prefix + newHeadingId + suffix;
|
|
35
37
|
}
|
|
36
38
|
// Push heading data to the permalink array
|
|
37
39
|
permalinks.push({
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script>import { initializeToastStore, getToastStore } from "./stores.js";
|
|
2
|
+
import Toast from "./Toast.svelte";
|
|
3
|
+
export let toastSettings = [];
|
|
4
|
+
export let max = void 0;
|
|
5
|
+
initializeToastStore();
|
|
6
|
+
const toastStore = getToastStore();
|
|
7
|
+
toastSettings.forEach((element) => {
|
|
8
|
+
toastStore.trigger(element);
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Toast {max} />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ToastSettings } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
toastSettings?: ToastSettings[] | undefined;
|
|
6
|
+
max?: number | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export type ToastTestProps = typeof __propDef.props;
|
|
14
|
+
export type ToastTestEvents = typeof __propDef.events;
|
|
15
|
+
export type ToastTestSlots = typeof __propDef.slots;
|
|
16
|
+
export default class ToastTest extends SvelteComponentTyped<ToastTestProps, ToastTestEvents, ToastTestSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -3,13 +3,17 @@ import type { ToastSettings, Toast } from './types.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Retrieves the `toastStore`.
|
|
5
5
|
*
|
|
6
|
+
* This can *ONLY* be called from the **top level** of components!
|
|
7
|
+
*
|
|
6
8
|
* @example
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
+
* ```svelte
|
|
10
|
+
* <script>
|
|
11
|
+
* import { getToastStore } from "@skeletonlabs/skeleton";
|
|
9
12
|
*
|
|
10
|
-
*
|
|
13
|
+
* const toastStore = getToastStore();
|
|
11
14
|
*
|
|
12
|
-
*
|
|
15
|
+
* toastStore.open({ message: "Welcome!" });
|
|
16
|
+
* </script>
|
|
13
17
|
* ```
|
|
14
18
|
*/
|
|
15
19
|
export declare function getToastStore(): ToastStore;
|
|
@@ -17,7 +21,7 @@ export declare function getToastStore(): ToastStore;
|
|
|
17
21
|
* Initializes the `toastStore`.
|
|
18
22
|
*/
|
|
19
23
|
export declare function initializeToastStore(): ToastStore;
|
|
20
|
-
type ToastStore = ReturnType<typeof toastService>;
|
|
24
|
+
export type ToastStore = ReturnType<typeof toastService>;
|
|
21
25
|
declare function toastService(): {
|
|
22
26
|
subscribe: (this: void, run: import("svelte/store").Subscriber<Toast[]>, invalidate?: import("svelte/store").Invalidator<Toast[]> | undefined) => import("svelte/store").Unsubscriber;
|
|
23
27
|
close: (id: string) => void;
|
|
@@ -6,13 +6,17 @@ const TOAST_STORE_KEY = 'toastStore';
|
|
|
6
6
|
/**
|
|
7
7
|
* Retrieves the `toastStore`.
|
|
8
8
|
*
|
|
9
|
+
* This can *ONLY* be called from the **top level** of components!
|
|
10
|
+
*
|
|
9
11
|
* @example
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
+
* ```svelte
|
|
13
|
+
* <script>
|
|
14
|
+
* import { getToastStore } from "@skeletonlabs/skeleton";
|
|
12
15
|
*
|
|
13
|
-
*
|
|
16
|
+
* const toastStore = getToastStore();
|
|
14
17
|
*
|
|
15
|
-
*
|
|
18
|
+
* toastStore.open({ message: "Welcome!" });
|
|
19
|
+
* </script>
|
|
16
20
|
* ```
|
|
17
21
|
*/
|
|
18
22
|
export function getToastStore() {
|