@skeletonlabs/skeleton 1.8.0-dev.c238d061 → 1.8.0-dev.ee949507
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,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
} | {
|
|
4
|
-
input: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function clipboard(node: HTMLElement, args: ClipboardArgs): {
|
|
7
|
-
update(newArgs: ClipboardArgs): void;
|
|
1
|
+
export declare function clipboard(node: HTMLElement, args: any): {
|
|
2
|
+
update(newArgs: any): void;
|
|
8
3
|
destroy(): void;
|
|
9
4
|
};
|
|
10
|
-
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Action: Clipboard
|
|
1
2
|
export function clipboard(node, args) {
|
|
2
3
|
const fireCopyCompleteEvent = () => {
|
|
3
4
|
node.dispatchEvent(new CustomEvent('copyComplete'));
|
|
@@ -6,19 +7,15 @@ export function clipboard(node, args) {
|
|
|
6
7
|
// Handle `data-clipboard` target based on object key
|
|
7
8
|
if (typeof args === 'object') {
|
|
8
9
|
// Element Inner HTML
|
|
9
|
-
if ('element'
|
|
10
|
+
if (Object.prototype.hasOwnProperty.call(args, 'element')) {
|
|
10
11
|
const element = document.querySelector(`[data-clipboard="${args.element}"]`);
|
|
11
|
-
|
|
12
|
-
throw new Error(`Missing HTMLElement with an attribute of [data-clipboard="${args.element}"]`);
|
|
13
|
-
copyToClipboard(element.innerHTML, 'text/html').then(fireCopyCompleteEvent);
|
|
12
|
+
copyToClipboard(element?.innerHTML, 'text/html').then(fireCopyCompleteEvent);
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
15
|
// Form Input Value
|
|
17
|
-
if ('input'
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(args, 'input')) {
|
|
18
17
|
const input = document.querySelector(`[data-clipboard="${args.input}"]`);
|
|
19
|
-
|
|
20
|
-
throw new Error(`Missing HTMLInputElement with an attribute of [data-clipboard="${args.input}"]`);
|
|
21
|
-
copyToClipboard(input.value).then(fireCopyCompleteEvent);
|
|
18
|
+
copyToClipboard(input?.value).then(fireCopyCompleteEvent);
|
|
22
19
|
return;
|
|
23
20
|
}
|
|
24
21
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function filter(node: HTMLElement, filterName: FilterName): {
|
|
4
|
-
update(newArgs: FilterName): void;
|
|
1
|
+
export declare function filter(node: HTMLElement, filterName: string): {
|
|
2
|
+
update(newArgs: any): void;
|
|
5
3
|
} | undefined;
|
|
6
|
-
export {};
|