@cloudparker/moldex.js 0.0.49 → 0.0.50

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.
@@ -28,12 +28,20 @@
28
28
  children?: Snippet;
29
29
  hasRipple?: boolean;
30
30
  rippleColor?: string | 'light' | 'dark';
31
- onClick?: (ev: MouseEvent) => void;
32
31
  url?: string;
33
32
  target?: string;
34
33
  hasOpenInNew?: boolean;
35
34
  openInNewIconClassName?: string;
36
35
  openInNewIcon?: string;
36
+ onClick?: (ev: MouseEvent) => void;
37
+ onDblClick?: (ev: MouseEvent) => void;
38
+ onContextMenu?: (ev: MouseEvent) => void;
39
+ onDrop?: (ev: MouseEvent) => void;
40
+ onDragStart?: (ev: MouseEvent) => void;
41
+ onDragEnd?: (ev: MouseEvent) => void;
42
+ onDragEnter?: (ev: MouseEvent) => void;
43
+ onDragLeave?: (ev: MouseEvent) => void;
44
+ onDragOver?: (ev: MouseEvent) => void;
37
45
  };
38
46
  </script>
39
47
 
@@ -68,7 +76,15 @@
68
76
  target,
69
77
  hasOpenInNew,
70
78
  openInNewIconClassName,
71
- openInNewIcon = mdiOpenInNew
79
+ openInNewIcon = mdiOpenInNew,
80
+ onDblClick,
81
+ onContextMenu,
82
+ onDrop,
83
+ onDragStart,
84
+ onDragEnd,
85
+ onDragEnter,
86
+ onDragLeave,
87
+ onDragOver
72
88
  }: ButtonPropsType = $props();
73
89
 
74
90
  let btnAppearanceClassName = $derived.by(() => {
@@ -142,6 +158,14 @@
142
158
  class="relative w-max flex items-center justify-center gap-2 focus:outline-primary dark:focus:outline-primary rounded {btnSizeClassName} {btnAppearanceClassName} {className}"
143
159
  onclick={onClick}
144
160
  use:handleRipple
161
+ ondblclick={onDblClick}
162
+ oncontextmenu={onContextMenu}
163
+ ondrop={onDrop}
164
+ ondragstart={onDragStart}
165
+ ondragend={onDragEnd}
166
+ ondragenter={onDragEnter}
167
+ ondragleave={onDragLeave}
168
+ ondragover={onDragOver}
145
169
  >
146
170
  {#if children}
147
171
  {@render children()}
@@ -158,9 +182,17 @@
158
182
  {type}
159
183
  {form}
160
184
  class="relative flex items-center justify-center gap-2 focus:outline-primary dark:focus:outline-primary rounded {btnSizeClassName} {btnAppearanceClassName} {className}"
161
- onclick={onClick}
162
185
  {disabled}
163
186
  use:handleRipple
187
+ onclick={onClick}
188
+ ondblclick={onDblClick}
189
+ oncontextmenu={onContextMenu}
190
+ ondrop={onDrop}
191
+ ondragstart={onDragStart}
192
+ ondragend={onDragEnd}
193
+ ondragenter={onDragEnter}
194
+ ondragleave={onDragLeave}
195
+ ondragover={onDragOver}
164
196
  >
165
197
  {#if children}
166
198
  {@render children()}
@@ -19,12 +19,20 @@ export type ButtonPropsType = {
19
19
  children?: Snippet;
20
20
  hasRipple?: boolean;
21
21
  rippleColor?: string | 'light' | 'dark';
22
- onClick?: (ev: MouseEvent) => void;
23
22
  url?: string;
24
23
  target?: string;
25
24
  hasOpenInNew?: boolean;
26
25
  openInNewIconClassName?: string;
27
26
  openInNewIcon?: string;
27
+ onClick?: (ev: MouseEvent) => void;
28
+ onDblClick?: (ev: MouseEvent) => void;
29
+ onContextMenu?: (ev: MouseEvent) => void;
30
+ onDrop?: (ev: MouseEvent) => void;
31
+ onDragStart?: (ev: MouseEvent) => void;
32
+ onDragEnd?: (ev: MouseEvent) => void;
33
+ onDragEnter?: (ev: MouseEvent) => void;
34
+ onDragLeave?: (ev: MouseEvent) => void;
35
+ onDragOver?: (ev: MouseEvent) => void;
28
36
  };
29
37
  import type { Snippet } from 'svelte';
30
38
  import '../../../../../tailwind.css';
@@ -22,6 +22,6 @@
22
22
  });
23
23
  </script>
24
24
 
25
- <div class="p-6 {className}">
25
+ <div class="p-6 text-base-800 dark:text-base-300 {className}">
26
26
  <div>{@html (msg ||'')}</div>
27
27
  </div>
@@ -9,7 +9,7 @@
9
9
  | 'none';
10
10
 
11
11
  export type InputValueType =
12
- any
12
+ | any
13
13
  | string
14
14
  | string[]
15
15
  | number
@@ -254,9 +254,11 @@
254
254
  });
255
255
 
256
256
  $effect(() => {
257
- if (inputRef && autofocus) {
258
- inputRef.focus();
259
- }
257
+ setTimeout(() => {
258
+ if (inputRef && autofocus) {
259
+ inputRef.focus();
260
+ }
261
+ }, 300);
260
262
  });
261
263
  </script>
262
264
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudparker/moldex.js",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "author": "cloudparker.com",
5
5
  "license": "MIT",
6
6
  "keywords": [