@skeletonlabs/skeleton 2.0.0-rc.3 → 2.0.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/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/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 +3 -1
- 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
|
@@ -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() {
|
|
@@ -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;
|
|
@@ -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({
|
|
@@ -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() {
|