@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,5 +1,5 @@
1
1
  declare namespace svelteHTML {
2
- interface HTMLAttributes {
3
- 'on:copyComplete'?: () => void;
2
+ interface HTMLAttributes<T> {
3
+ 'on:copyComplete'?: (event: any) => any;
4
4
  }
5
5
  }
@@ -1,10 +1,4 @@
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;
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' in args) {
10
+ if (Object.prototype.hasOwnProperty.call(args, 'element')) {
10
11
  const element = document.querySelector(`[data-clipboard="${args.element}"]`);
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);
12
+ copyToClipboard(element?.innerHTML, 'text/html').then(fireCopyCompleteEvent);
14
13
  return;
15
14
  }
16
15
  // Form Input Value
17
- if ('input' in args) {
16
+ if (Object.prototype.hasOwnProperty.call(args, 'input')) {
18
17
  const input = document.querySelector(`[data-clipboard="${args.input}"]`);
19
- if (!input)
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
- 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;
1
+ export declare function filter(node: HTMLElement, filterName: string): {
2
+ update(newArgs: any): void;
5
3
  } | undefined;
6
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton",
3
- "version": "1.8.0-dev.c238d061",
3
+ "version": "1.8.0-dev.ee949507",
4
4
  "description": "A SvelteKit component library.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "repository": {