@sveltia/ui 0.2.2 → 0.2.4

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.
Files changed (75) hide show
  1. package/package/components/composite/calendar.svelte +4 -1
  2. package/package/components/composite/calendar.svelte.d.ts +1 -1
  3. package/package/components/composite/checkbox-group.svelte +2 -3
  4. package/package/components/composite/combobox.svelte +9 -6
  5. package/package/components/composite/combobox.svelte.d.ts +4 -4
  6. package/package/components/composite/disclosure.svelte +2 -2
  7. package/package/components/composite/grid.svelte +2 -2
  8. package/package/components/composite/grid.svelte.d.ts +1 -1
  9. package/package/components/composite/listbox.svelte +2 -2
  10. package/package/components/composite/listbox.svelte.d.ts +1 -1
  11. package/package/components/composite/menu-item-group.svelte +1 -1
  12. package/package/components/composite/menu.svelte +2 -2
  13. package/package/components/composite/menu.svelte.d.ts +1 -1
  14. package/package/components/composite/radio-button-group.svelte +2 -2
  15. package/package/components/composite/radio-button-group.svelte.d.ts +1 -1
  16. package/package/components/composite/select-button-group.svelte +2 -2
  17. package/package/components/composite/select-button-group.svelte.d.ts +1 -1
  18. package/package/components/composite/select.svelte +2 -2
  19. package/package/components/composite/select.svelte.d.ts +1 -1
  20. package/package/components/composite/tab-list.svelte +2 -2
  21. package/package/components/composite/tab-list.svelte.d.ts +1 -1
  22. package/package/components/core/button.svelte +9 -10
  23. package/package/components/core/button.svelte.d.ts +9 -9
  24. package/package/components/core/checkbox.svelte +7 -7
  25. package/package/components/core/checkbox.svelte.d.ts +1 -1
  26. package/package/components/core/dialog.svelte +13 -3
  27. package/package/components/core/dialog.svelte.d.ts +2 -2
  28. package/package/components/core/drawer.svelte +12 -2
  29. package/package/components/core/grid-cell.svelte +1 -2
  30. package/package/components/core/group.svelte +1 -1
  31. package/package/components/core/icon.svelte +1 -1
  32. package/package/components/core/menu-button.svelte +2 -2
  33. package/package/components/core/menu-button.svelte.d.ts +2 -2
  34. package/package/components/core/menu-item-checkbox.svelte +1 -1
  35. package/package/components/core/menu-item-radio.svelte +1 -1
  36. package/package/components/core/number-input.svelte +8 -2
  37. package/package/components/core/number-input.svelte.d.ts +1 -1
  38. package/package/components/core/option.svelte +1 -1
  39. package/package/components/core/password-input.svelte +2 -2
  40. package/package/components/core/password-input.svelte.d.ts +1 -1
  41. package/package/components/core/radio-button.svelte +5 -5
  42. package/package/components/core/radio-button.svelte.d.ts +1 -1
  43. package/package/components/core/row-group.svelte +1 -2
  44. package/package/components/core/row.svelte +1 -2
  45. package/package/components/core/search-bar.svelte +2 -2
  46. package/package/components/core/select-button.svelte +1 -1
  47. package/package/components/core/separator.svelte +2 -1
  48. package/package/components/core/separator.svelte.d.ts +2 -2
  49. package/package/components/core/slider.svelte +25 -3
  50. package/package/components/core/spacer.svelte +2 -2
  51. package/package/components/core/switch.svelte +1 -1
  52. package/package/components/core/tab-panel.svelte +1 -2
  53. package/package/components/core/tab.svelte +1 -1
  54. package/package/components/core/text-area.svelte +53 -16
  55. package/package/components/core/text-area.svelte.d.ts +2 -2
  56. package/package/components/core/text-input.svelte +4 -4
  57. package/package/components/core/text-input.svelte.d.ts +5 -5
  58. package/package/components/core/toolbar.svelte +1 -2
  59. package/package/components/editor/markdown.svelte +1 -1
  60. package/package/components/editor/markdown.svelte.d.ts +1 -1
  61. package/package/components/helpers/group.d.ts +1 -37
  62. package/package/components/helpers/group.js +23 -18
  63. package/package/components/helpers/popup.d.ts +1 -2
  64. package/package/components/helpers/popup.js +8 -7
  65. package/package/components/helpers/util.js +6 -0
  66. package/package/components/util/app-shell.svelte +7 -1
  67. package/package/components/util/misc.js +0 -2
  68. package/package/components/util/popup.svelte +14 -4
  69. package/package/components/util/popup.svelte.d.ts +10 -10
  70. package/package/components/util/portal.svelte +1 -1
  71. package/package/index.d.ts +4 -1
  72. package/package/index.js +45 -0
  73. package/package/typedef.d.ts +1 -0
  74. package/package/typedef.js +4 -0
  75. package/package.json +15 -17
@@ -5,7 +5,7 @@
5
5
  import Separator from '../core/separator.svelte';
6
6
  import Spacer from '../core/spacer.svelte';
7
7
 
8
- /** @type {(String|undefined)} */
8
+ /** @type {string?} */
9
9
  export let value = undefined;
10
10
 
11
11
  const dayList = [];
@@ -16,6 +16,9 @@
16
16
  $: firstDayOfMonth = new Date(date.getUTCFullYear(), date.getUTCMonth(), 1);
17
17
  $: firstDay = new Date(firstDayOfMonth);
18
18
 
19
+ /**
20
+ *
21
+ */
19
22
  const getWeeks = () => {
20
23
  const cursor = new Date(firstDay);
21
24
 
@@ -15,7 +15,7 @@ export type CalendarSlots = typeof __propDef.slots;
15
15
  import { SvelteComponentTyped } from "svelte";
16
16
  declare const __propDef: {
17
17
  props: {
18
- value?: (string | undefined);
18
+ value?: string | null;
19
19
  };
20
20
  events: {
21
21
  click: MouseEvent;
@@ -5,16 +5,15 @@
5
5
  <script>
6
6
  /**
7
7
  * CSS class name on the button.
8
- * @type {String}
8
+ * @type {string}
9
9
  */
10
- // eslint-disable-next-line padding-line-between-statements
11
10
  let className = '';
12
11
 
13
12
  export { className as class };
14
13
 
15
14
  /**
16
15
  * The `aria-label` attribute on the button element.
17
- * @type {String}
16
+ * @type {string}
18
17
  */
19
18
  export let ariaLabel = '';
20
19
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  /**
18
18
  * CSS class name on the button.
19
- * @type {String}
19
+ * @type {string}
20
20
  */
21
21
  let className = '';
22
22
 
@@ -39,16 +39,16 @@
39
39
 
40
40
  /**
41
41
  * Selected option’s value.
42
- * @type {(String|undefined)}
42
+ * @type {(string | number | undefined)}
43
43
  */
44
44
  export let value = undefined;
45
45
 
46
46
  const dispatch = createEventDispatcher();
47
47
  const id = getRandomId('combobox');
48
48
  let comboboxElement;
49
- /** @type {(TextInput| undefined)} */
49
+ /** @type {TextInput?} */
50
50
  let inputComponent;
51
- /** @type {(Popup| undefined)} */
51
+ /** @type {Popup?} */
52
52
  let popupComponent;
53
53
  let isPopupOpen = writable(false);
54
54
  </script>
@@ -117,8 +117,11 @@
117
117
  bind:this={popupComponent}
118
118
  >
119
119
  <Listbox
120
- on:click={({ target }) => {
121
- if (target.matches('[role="option"]')) {
120
+ on:click={(event) => {
121
+ if (/** @type {HTMLElement} */ (event.target).matches('[role="option"]')) {
122
+ // eslint-disable-next-line prefer-destructuring
123
+ const target = /** @type {HTMLButtonElement?} */ (event.target);
124
+
122
125
  // @todo support more types
123
126
  value = target.dataset.type === 'number' ? Number(target.value) : target.value;
124
127
  label = target.querySelector('.label')?.textContent || target.value;
@@ -8,10 +8,10 @@
8
8
  export default class Combobox extends SvelteComponentTyped<{
9
9
  [x: string]: any;
10
10
  label?: string;
11
- position?: any;
11
+ position?: PopupPosition;
12
12
  class?: string;
13
13
  disabled?: boolean;
14
- value?: string;
14
+ value?: string | number;
15
15
  readOnly?: boolean;
16
16
  }, {
17
17
  change: CustomEvent<any>;
@@ -29,10 +29,10 @@ declare const __propDef: {
29
29
  props: {
30
30
  [x: string]: any;
31
31
  label?: string;
32
- position?: any;
32
+ position?: PopupPosition;
33
33
  class?: string;
34
34
  disabled?: boolean;
35
- value?: (string | undefined);
35
+ value?: (string | number | undefined);
36
36
  readOnly?: boolean;
37
37
  };
38
38
  events: {
@@ -10,7 +10,7 @@
10
10
 
11
11
  /**
12
12
  * CSS class name on the button.
13
- * @type {String}
13
+ * @type {string}
14
14
  */
15
15
  let className = '';
16
16
 
@@ -36,7 +36,7 @@
36
36
  <Icon name="expand_more" />
37
37
  {label}
38
38
  </Button>
39
- <div class="content" id="{id}-content" hidden={!expanded ? 'hidden' : undefined}>
39
+ <div class="content" id="{id}-content" hidden={!expanded ? true : undefined}>
40
40
  <slot />
41
41
  </div>
42
42
  </div>
@@ -3,13 +3,13 @@
3
3
 
4
4
  /**
5
5
  * CSS class name on the button.
6
- * @type {String}
6
+ * @type {string}
7
7
  */
8
8
  let className = '';
9
9
 
10
10
  export { className as class };
11
11
 
12
- /** @type {(HTMLElement|undefined)} */
12
+ /** @type {HTMLElement?} */
13
13
  export let element = undefined;
14
14
  </script>
15
15
 
@@ -19,7 +19,7 @@ declare const __propDef: {
19
19
  props: {
20
20
  [x: string]: any;
21
21
  class?: string;
22
- element?: (HTMLElement | undefined);
22
+ element?: HTMLElement | null;
23
23
  };
24
24
  events: {
25
25
  [evt: string]: CustomEvent<any>;
@@ -10,13 +10,13 @@
10
10
 
11
11
  /**
12
12
  * CSS class name on the button.
13
- * @type {String}
13
+ * @type {string}
14
14
  */
15
15
  let className = '';
16
16
 
17
17
  export { className as class };
18
18
 
19
- /** @type {(HTMLElement|undefined)} */
19
+ /** @type {HTMLElement?} */
20
20
  export let element = undefined;
21
21
 
22
22
  export let multiple = false;
@@ -36,7 +36,7 @@ declare const __propDef: {
36
36
  props: {
37
37
  [x: string]: any;
38
38
  class?: string;
39
- element?: (HTMLElement | undefined);
39
+ element?: HTMLElement | null;
40
40
  multiple?: boolean;
41
41
  };
42
42
  events: {
@@ -3,7 +3,7 @@
3
3
 
4
4
  /**
5
5
  * CSS class name on the button.
6
- * @type {String}
6
+ * @type {string}
7
7
  */
8
8
  let className = '';
9
9
 
@@ -10,13 +10,13 @@
10
10
 
11
11
  /**
12
12
  * CSS class name on the button.
13
- * @type {String}
13
+ * @type {string}
14
14
  */
15
15
  let className = '';
16
16
 
17
17
  export { className as class };
18
18
 
19
- /** @type {(HTMLElement|undefined)} */
19
+ /** @type {HTMLElement?} */
20
20
  export let element = undefined;
21
21
  </script>
22
22
 
@@ -29,7 +29,7 @@ declare const __propDef: {
29
29
  props: {
30
30
  [x: string]: any;
31
31
  class?: string;
32
- element?: (HTMLElement | undefined);
32
+ element?: HTMLElement | null;
33
33
  };
34
34
  events: {
35
35
  [evt: string]: CustomEvent<any>;
@@ -9,7 +9,7 @@
9
9
 
10
10
  /**
11
11
  * CSS class name on the button.
12
- * @type {String}
12
+ * @type {string}
13
13
  */
14
14
  let className = '';
15
15
 
@@ -18,7 +18,7 @@
18
18
  /** @type {('horizontal'|'vertical')} */
19
19
  export let orientation = 'horizontal';
20
20
 
21
- /** @type {(HTMLElement|undefined)} */
21
+ /** @type {HTMLElement?} */
22
22
  export let element = undefined;
23
23
  </script>
24
24
 
@@ -23,7 +23,7 @@ import { SvelteComponentTyped } from "svelte";
23
23
  declare const __propDef: {
24
24
  props: {
25
25
  class?: string;
26
- element?: (HTMLElement | undefined);
26
+ element?: HTMLElement | null;
27
27
  orientation?: ('horizontal' | 'vertical');
28
28
  };
29
29
  events: {
@@ -10,7 +10,7 @@
10
10
 
11
11
  /**
12
12
  * CSS class name on the button.
13
- * @type {String}
13
+ * @type {string}
14
14
  */
15
15
  let className = '';
16
16
 
@@ -22,7 +22,7 @@
22
22
 
23
23
  const dispatch = createEventDispatcher();
24
24
 
25
- /** @type {(HTMLElement|undefined)} */
25
+ /** @type {HTMLElement?} */
26
26
  export let element = undefined;
27
27
 
28
28
  $: {
@@ -27,7 +27,7 @@ import { SvelteComponentTyped } from "svelte";
27
27
  declare const __propDef: {
28
28
  props: {
29
29
  class?: string;
30
- element?: (HTMLElement | undefined);
30
+ element?: HTMLElement | null;
31
31
  disabled?: boolean;
32
32
  value?: string;
33
33
  ariaLabel?: string;
@@ -7,7 +7,7 @@
7
7
 
8
8
  /**
9
9
  * CSS class name on the button.
10
- * @type {String}
10
+ * @type {string}
11
11
  */
12
12
  let className = '';
13
13
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  /**
19
19
  * Selected option’s value.
20
- * @type {(String|undefined)}
20
+ * @type {string?}
21
21
  */
22
22
  export let value = undefined;
23
23
  </script>
@@ -24,7 +24,7 @@ declare const __propDef: {
24
24
  [x: string]: any;
25
25
  label?: string;
26
26
  class?: string;
27
- value?: (string | undefined);
27
+ value?: string | null;
28
28
  };
29
29
  events: {
30
30
  change: CustomEvent<any>;
@@ -10,13 +10,13 @@
10
10
 
11
11
  /**
12
12
  * CSS class name on the button.
13
- * @type {String}
13
+ * @type {string}
14
14
  */
15
15
  let className = '';
16
16
 
17
17
  export { className as class };
18
18
 
19
- /** @type {(HTMLElement|undefined)} */
19
+ /** @type {HTMLElement?} */
20
20
  export let element = undefined;
21
21
 
22
22
  /** @type {('horizontal'|'vertical')} */
@@ -39,7 +39,7 @@ declare const __propDef: {
39
39
  props: {
40
40
  [x: string]: any;
41
41
  class?: string;
42
- element?: (HTMLElement | undefined);
42
+ element?: HTMLElement | null;
43
43
  name?: string;
44
44
  orientation?: ('horizontal' | 'vertical');
45
45
  };
@@ -10,16 +10,15 @@
10
10
 
11
11
  /**
12
12
  * CSS class name on the button.
13
- * @type {String}
13
+ * @type {string}
14
14
  */
15
- // eslint-disable-next-line padding-line-between-statements
16
15
  let className = '';
17
16
 
18
17
  export { className as class };
19
18
 
20
19
  /**
21
20
  * Reference to the button element.
22
- * @type {(HTMLButtonElement|undefined)}
21
+ * @type {HTMLButtonElement?}
23
22
  */
24
23
  export let element = undefined;
25
24
 
@@ -31,7 +30,7 @@
31
30
 
32
31
  /**
33
32
  * The `role` attribute on the button element.
34
- * @type {String}
33
+ * @type {string}
35
34
  */
36
35
  export let role = 'button';
37
36
 
@@ -43,25 +42,25 @@
43
42
 
44
43
  /**
45
44
  * Whether the button is hidden.
46
- * @type {Boolean}
45
+ * @type {boolean}
47
46
  */
48
47
  export let hidden = false;
49
48
 
50
49
  /**
51
50
  * Whether the button is disabled.
52
- * @type {Boolean}
51
+ * @type {boolean}
53
52
  */
54
53
  export let disabled = false;
55
54
 
56
55
  /**
57
56
  * The `aria-pressed` attribute on the button element.
58
- * @type {(Boolean|String|undefined)}
57
+ * @type {(boolean | 'false' | 'mixed' | 'true' | undefined)}
59
58
  */
60
59
  export let pressed = undefined;
61
60
 
62
61
  /**
63
62
  * Text label displayed on the button.
64
- * @type {String}
63
+ * @type {string}
65
64
  */
66
65
  export let label = '';
67
66
 
@@ -78,8 +77,8 @@
78
77
  <button
79
78
  {type}
80
79
  {role}
81
- hidden={hidden ? 'hidden' : undefined}
82
- disabled={disabled ? 'disabled' : undefined}
80
+ hidden={hidden ? true : undefined}
81
+ disabled={disabled ? true : undefined}
83
82
  class="sui button {size} {className}"
84
83
  aria-hidden={hidden ? true : undefined}
85
84
  aria-disabled={disabled ? true : undefined}
@@ -15,8 +15,8 @@ export default class Button extends SvelteComponentTyped<{
15
15
  size?: "small" | "medium" | "large";
16
16
  hidden?: boolean;
17
17
  disabled?: boolean;
18
- pressed?: string | boolean;
19
- popupPosition?: any;
18
+ pressed?: boolean | "true" | "false" | "mixed";
19
+ popupPosition?: PopupPosition;
20
20
  }, {
21
21
  mouseenter: MouseEvent;
22
22
  mouseleave: MouseEvent;
@@ -58,14 +58,14 @@ export default class Button extends SvelteComponentTyped<{
58
58
  set disabled(arg: boolean);
59
59
  get disabled(): boolean;
60
60
  /**accessor*/
61
- set pressed(arg: string | boolean);
62
- get pressed(): string | boolean;
61
+ set pressed(arg: boolean | "true" | "false" | "mixed");
62
+ get pressed(): boolean | "true" | "false" | "mixed";
63
63
  /**accessor*/
64
64
  set label(arg: string);
65
65
  get label(): string;
66
66
  /**accessor*/
67
- set popupPosition(arg: any);
68
- get popupPosition(): any;
67
+ set popupPosition(arg: PopupPosition);
68
+ get popupPosition(): PopupPosition;
69
69
  }
70
70
  export type ButtonProps = typeof __propDef.props;
71
71
  export type ButtonEvents = typeof __propDef.events;
@@ -76,14 +76,14 @@ declare const __propDef: {
76
76
  [x: string]: any;
77
77
  label?: string;
78
78
  class?: string;
79
- element?: (HTMLButtonElement | undefined);
79
+ element?: HTMLButtonElement | null;
80
80
  type?: ('button' | 'submit' | 'reset');
81
81
  role?: string;
82
82
  size?: ('small' | 'medium' | 'large');
83
83
  hidden?: boolean;
84
84
  disabled?: boolean;
85
- pressed?: (boolean | string | undefined);
86
- popupPosition?: any;
85
+ pressed?: (boolean | 'false' | 'mixed' | 'true' | undefined);
86
+ popupPosition?: PopupPosition;
87
87
  };
88
88
  events: {
89
89
  mouseenter: MouseEvent;
@@ -11,25 +11,25 @@
11
11
 
12
12
  /**
13
13
  * CSS class name on the button.
14
- * @type {String}
14
+ * @type {string}
15
15
  */
16
16
  let className = '';
17
17
 
18
18
  export { className as class };
19
19
 
20
- /** @type {String} */
20
+ /** @type {string} */
21
21
  export let name = '';
22
22
 
23
- /** @type {(String|undefined)} */
23
+ /** @type {string?} */
24
24
  export let value = undefined;
25
25
 
26
- /** @type {(Boolean|String|undefined)} */
26
+ /** @type {(boolean | string | undefined)} */
27
27
  export let checked = false;
28
28
 
29
- /** @type {Boolean} */
29
+ /** @type {boolean} */
30
30
  export let indeterminate = false;
31
31
 
32
- /** @type {Boolean} */
32
+ /** @type {boolean} */
33
33
  export let disabled = false;
34
34
 
35
35
  const dispatch = createEventDispatcher();
@@ -49,7 +49,7 @@
49
49
  class:indeterminate
50
50
  class:disabled
51
51
  on:click|preventDefault|stopPropagation={(event) => {
52
- if (!event.target.matches('button')) {
52
+ if (!(/** @type {HTMLElement} */ (event.target).matches('button'))) {
53
53
  button.element.click();
54
54
  }
55
55
  }}
@@ -29,7 +29,7 @@ declare const __propDef: {
29
29
  class?: string;
30
30
  disabled?: boolean;
31
31
  name?: string;
32
- value?: (string | undefined);
32
+ value?: string | null;
33
33
  checked?: (boolean | string | undefined);
34
34
  indeterminate?: boolean;
35
35
  };
@@ -12,7 +12,7 @@
12
12
 
13
13
  /**
14
14
  * CSS class name on the button.
15
- * @type {String}
15
+ * @type {string}
16
16
  */
17
17
  let className = '';
18
18
 
@@ -24,7 +24,7 @@
24
24
 
25
25
  /**
26
26
  * Width of the dialog.
27
- * @type {('small'|'medium'|'large')}
27
+ * @type {('small' | 'medium' | 'large' | 'x-large')}
28
28
  */
29
29
  export let size = 'medium';
30
30
 
@@ -54,6 +54,9 @@
54
54
  let showDialog = false;
55
55
  let showContent = false;
56
56
 
57
+ /**
58
+ *
59
+ */
57
60
  const openDialog = async () => {
58
61
  (document.querySelector('.sui.app-shell') || document.body).appendChild(dialog);
59
62
  showContent = true;
@@ -69,6 +72,9 @@
69
72
  });
70
73
  };
71
74
 
75
+ /**
76
+ *
77
+ */
72
78
  const closeDialog = async () => {
73
79
  showDialog = false;
74
80
 
@@ -91,6 +97,9 @@
91
97
  dialog?.remove();
92
98
  };
93
99
 
100
+ /**
101
+ *
102
+ */
94
103
  const toggleDialog = () => {
95
104
  if (dialog) {
96
105
  if (open) {
@@ -102,6 +111,7 @@
102
111
  };
103
112
 
104
113
  // Call the function only when the `open` prop is changed
114
+ // @ts-ignore
105
115
  $: toggleDialog(open);
106
116
 
107
117
  onMount(() => {
@@ -121,7 +131,7 @@
121
131
  class="sui dialog {className} {size}"
122
132
  class:open={showDialog}
123
133
  on:click={({ target }) => {
124
- if (closeOnBackdropClick && target?.matches('dialog')) {
134
+ if (closeOnBackdropClick && /** @type {HTMLElement?} */ (target)?.matches('dialog')) {
125
135
  dialog.returnValue = 'cancel';
126
136
  open = false;
127
137
  }
@@ -9,7 +9,7 @@ export default class Dialog extends SvelteComponentTyped<{
9
9
  title?: string;
10
10
  open?: boolean;
11
11
  class?: string;
12
- size?: "small" | "medium" | "large";
12
+ size?: "small" | "medium" | "large" | "x-large";
13
13
  modal?: boolean;
14
14
  showCancel?: boolean;
15
15
  showOk?: boolean;
@@ -43,7 +43,7 @@ declare const __propDef: {
43
43
  title?: string;
44
44
  open?: boolean;
45
45
  class?: string;
46
- size?: ('small' | 'medium' | 'large');
46
+ size?: ('small' | 'medium' | 'large' | 'x-large');
47
47
  modal?: boolean;
48
48
  showCancel?: boolean;
49
49
  showOk?: boolean;
@@ -12,7 +12,7 @@
12
12
 
13
13
  /**
14
14
  * CSS class name on the button.
15
- * @type {String}
15
+ * @type {string}
16
16
  */
17
17
  let className = '';
18
18
 
@@ -61,6 +61,9 @@
61
61
 
62
62
  $: orientation = position === 'right' || position === 'left' ? 'vertical' : 'horizontal';
63
63
 
64
+ /**
65
+ *
66
+ */
64
67
  const openDialog = async () => {
65
68
  (document.querySelector('.sui.app-shell') || document.body).appendChild(dialog);
66
69
  showContent = true;
@@ -71,6 +74,9 @@
71
74
  });
72
75
  };
73
76
 
77
+ /**
78
+ *
79
+ */
74
80
  const closeDialog = async () => {
75
81
  showDialog = false;
76
82
 
@@ -93,6 +99,9 @@
93
99
  dialog?.remove();
94
100
  };
95
101
 
102
+ /**
103
+ *
104
+ */
96
105
  const toggleDialog = () => {
97
106
  if (dialog) {
98
107
  if (open) {
@@ -104,6 +113,7 @@
104
113
  };
105
114
 
106
115
  // Call the function only when the `open` prop is changed
116
+ // @ts-ignore
107
117
  $: toggleDialog(open);
108
118
 
109
119
  onMount(() => {
@@ -123,7 +133,7 @@
123
133
  class="sui dialog {className} {size} {position} {orientation}"
124
134
  class:open={showDialog}
125
135
  on:click={({ target }) => {
126
- if (closeOnBackdropClick && target?.matches('dialog')) {
136
+ if (closeOnBackdropClick && /** @type {HTMLElement?} */ (target)?.matches('dialog')) {
127
137
  dialog.returnValue = 'cancel';
128
138
  open = false;
129
139
  }
@@ -1,9 +1,8 @@
1
1
  <script>
2
2
  /**
3
3
  * CSS class name on the button.
4
- * @type {String}
4
+ * @type {string}
5
5
  */
6
- // eslint-disable-next-line padding-line-between-statements
7
6
  let className = '';
8
7
 
9
8
  export { className as class };
@@ -3,7 +3,7 @@
3
3
 
4
4
  /**
5
5
  * CSS class name on the button.
6
- * @type {String}
6
+ * @type {string}
7
7
  */
8
8
  let className = '';
9
9