@skeletonlabs/skeleton 1.8.0-dev.ee949507 → 1.8.0-dev.f48b8ca0
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.
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type ClipboardArgs = string | {
|
|
2
|
+
element: string;
|
|
3
|
+
} | {
|
|
4
|
+
input: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function clipboard(node: HTMLElement, args: ClipboardArgs): {
|
|
7
|
+
update(newArgs: ClipboardArgs): void;
|
|
3
8
|
destroy(): void;
|
|
4
9
|
};
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Action: Clipboard
|
|
2
1
|
export function clipboard(node, args) {
|
|
3
2
|
const fireCopyCompleteEvent = () => {
|
|
4
3
|
node.dispatchEvent(new CustomEvent('copyComplete'));
|
|
@@ -7,15 +6,19 @@ export function clipboard(node, args) {
|
|
|
7
6
|
// Handle `data-clipboard` target based on object key
|
|
8
7
|
if (typeof args === 'object') {
|
|
9
8
|
// Element Inner HTML
|
|
10
|
-
if (
|
|
9
|
+
if ('element' in args) {
|
|
11
10
|
const element = document.querySelector(`[data-clipboard="${args.element}"]`);
|
|
12
|
-
|
|
11
|
+
if (!element)
|
|
12
|
+
throw new Error(`Missing HTMLElement with an attribute of [data-clipboard="${args.element}"]`);
|
|
13
|
+
copyToClipboard(element.innerHTML, 'text/html').then(fireCopyCompleteEvent);
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
16
|
// Form Input Value
|
|
16
|
-
if (
|
|
17
|
+
if ('input' in args) {
|
|
17
18
|
const input = document.querySelector(`[data-clipboard="${args.input}"]`);
|
|
18
|
-
|
|
19
|
+
if (!input)
|
|
20
|
+
throw new Error(`Missing HTMLInputElement with an attribute of [data-clipboard="${args.input}"]`);
|
|
21
|
+
copyToClipboard(input.value).then(fireCopyCompleteEvent);
|
|
19
22
|
return;
|
|
20
23
|
}
|
|
21
24
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type Filters = ['Apollo', 'BlueNight', 'Emerald', 'GreenFall', 'Noir', 'NoirLight', 'Rustic', 'Summer84', 'XPro'];
|
|
2
|
+
type FilterName = `#${Filters[number]}` | (string & {});
|
|
3
|
+
export declare function filter(node: HTMLElement, filterName: FilterName): {
|
|
4
|
+
update(newArgs: FilterName): void;
|
|
3
5
|
} | undefined;
|
|
6
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export let display = "inline-flex";
|
|
3
3
|
export let background = "bg-surface-200-700-token";
|
|
4
4
|
export let border = "border-token border-surface-400-500-token";
|
|
5
|
-
export let spacing = "
|
|
5
|
+
export let spacing = "";
|
|
6
6
|
export let rounded = "rounded-token";
|
|
7
7
|
export let padding = "px-4 py-1";
|
|
8
8
|
export let active = "variant-filled";
|
|
@@ -17,6 +17,8 @@ setContext("hover", hover);
|
|
|
17
17
|
setContext("color", color);
|
|
18
18
|
setContext("fill", fill);
|
|
19
19
|
const cBase = "p-1";
|
|
20
|
+
$:
|
|
21
|
+
spacing = `${display.includes("flex-col") ? "" : "space-x-1"}`;
|
|
20
22
|
$:
|
|
21
23
|
classesBase = `${cBase} ${display} ${background} ${border} ${spacing} ${rounded} ${$$props.class ?? ""}`;
|
|
22
24
|
</script>
|