@marianmeres/stuic 1.23.0 → 1.24.0
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.
- package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte +27 -14
- package/dist/components/AlertConfirmPrompt/alert-confirm-prompt.d.ts +1 -0
- package/dist/components/Button/Button.svelte +1 -1
- package/dist/components/Input/Field.svelte +6 -6
- package/dist/components/Input/Field.svelte.d.ts +1 -1
- package/dist/components/Input/FieldSelect.svelte +8 -1
- package/dist/components/Input/FieldSelect.svelte.d.ts +2 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AlertConfirmPromptType,
|
|
4
4
|
Button,
|
|
5
|
+
FieldSelect,
|
|
5
6
|
createAlertConfirmPromptStore,
|
|
6
7
|
focusTrap
|
|
7
8
|
} from "../../index.js";
|
|
@@ -27,14 +28,14 @@ export class AlertConfirmPromptConfig {
|
|
|
27
28
|
`.trim(),
|
|
28
29
|
icon: `
|
|
29
30
|
size-12 sm:size-10
|
|
30
|
-
mt-1 mb-4 sm:my-0
|
|
31
|
+
mt-1 mb-4 sm:my-0 sm:mr-5
|
|
31
32
|
mx-auto
|
|
32
33
|
flex flex-shrink-0 items-center justify-center
|
|
33
34
|
rounded-full
|
|
34
35
|
bg-neutral-100 text-black/50
|
|
35
36
|
`.trim(),
|
|
36
37
|
contentBlock: `
|
|
37
|
-
mt-3 sm:
|
|
38
|
+
mt-3 sm:mt-0 sm:flex-1
|
|
38
39
|
`.trim(),
|
|
39
40
|
title: `
|
|
40
41
|
text-center sm:text-left
|
|
@@ -275,8 +276,6 @@ $:
|
|
|
275
276
|
} else {
|
|
276
277
|
iconFn = false;
|
|
277
278
|
}
|
|
278
|
-
$:
|
|
279
|
-
clog(dialog);
|
|
280
279
|
</script>
|
|
281
280
|
|
|
282
281
|
<dialog
|
|
@@ -336,15 +335,29 @@ $:
|
|
|
336
335
|
data-acp-variant={dialog?.variant}
|
|
337
336
|
data-acp-is-pending={isPending}
|
|
338
337
|
>
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
338
|
+
{#if dialog?.promptFieldProps?.options?.length}
|
|
339
|
+
<FieldSelect
|
|
340
|
+
class={_inputFieldClass}
|
|
341
|
+
bind:value
|
|
342
|
+
data-acp-type={dialog?.type}
|
|
343
|
+
data-acp-variant={dialog?.variant}
|
|
344
|
+
data-acp-is-pending={isPending}
|
|
345
|
+
on:input_mounted={({ detail }) => detail.focus()}
|
|
346
|
+
size="sm"
|
|
347
|
+
{...dialog.promptFieldProps}
|
|
348
|
+
/>
|
|
349
|
+
{:else}
|
|
350
|
+
<Field
|
|
351
|
+
class={_inputFieldClass}
|
|
352
|
+
bind:value
|
|
353
|
+
data-acp-type={dialog?.type}
|
|
354
|
+
data-acp-variant={dialog?.variant}
|
|
355
|
+
data-acp-is-pending={isPending}
|
|
356
|
+
on:input_mounted={({ detail }) => detail.focus()}
|
|
357
|
+
size="sm"
|
|
358
|
+
{...dialog?.promptFieldProps || {}}
|
|
359
|
+
/>
|
|
360
|
+
{/if}
|
|
348
361
|
</div>
|
|
349
362
|
{/if}
|
|
350
363
|
</div>
|
|
@@ -461,5 +474,5 @@ $:
|
|
|
461
474
|
}
|
|
462
475
|
}
|
|
463
476
|
.rotating-cw {
|
|
464
|
-
animation: rotating-cw 0.
|
|
477
|
+
animation: rotating-cw 0.5s linear infinite;
|
|
465
478
|
}</style>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { slide } from "svelte/transition";
|
|
2
3
|
import { twMerge } from "tailwind-merge";
|
|
3
4
|
import {
|
|
4
5
|
autogrow,
|
|
@@ -6,7 +7,6 @@ import {
|
|
|
6
7
|
trim,
|
|
7
8
|
validate as validateAction
|
|
8
9
|
} from "../../index.js";
|
|
9
|
-
import { createEventDispatcher } from "svelte";
|
|
10
10
|
const dispatch = createEventDispatcher();
|
|
11
11
|
const setType = (el, t) => el.type = t;
|
|
12
12
|
const inputSizePreset = {
|
|
@@ -23,7 +23,7 @@ let _class = "";
|
|
|
23
23
|
export { _class as class };
|
|
24
24
|
export let labelClass = "";
|
|
25
25
|
export let wrapClass = "";
|
|
26
|
-
export let
|
|
26
|
+
export let inputClass = "";
|
|
27
27
|
export let invalidClass = "border-primary";
|
|
28
28
|
export let size = "md";
|
|
29
29
|
export let id = getId();
|
|
@@ -56,7 +56,7 @@ $:
|
|
|
56
56
|
if (_inputEl)
|
|
57
57
|
dispatch("input_mounted", _inputEl);
|
|
58
58
|
$:
|
|
59
|
-
|
|
59
|
+
_inputClass = twMerge(`
|
|
60
60
|
form-input
|
|
61
61
|
rounded-md border-0 w-full flex-1
|
|
62
62
|
bg-transparent
|
|
@@ -110,7 +110,7 @@ $:
|
|
|
110
110
|
bind:value
|
|
111
111
|
bind:this={_inputEl}
|
|
112
112
|
{id}
|
|
113
|
-
class={twMerge(`${
|
|
113
|
+
class={twMerge(`${_inputClass} min-h-16 ${inputClass}`)}
|
|
114
114
|
class:cursor-not-allowed={disabled}
|
|
115
115
|
{name}
|
|
116
116
|
{disabled}
|
|
@@ -130,7 +130,7 @@ $:
|
|
|
130
130
|
bind:this={_inputEl}
|
|
131
131
|
use:setType={type}
|
|
132
132
|
{id}
|
|
133
|
-
class={inputClass}
|
|
133
|
+
class={twMerge(`${_inputClass} ${inputClass}`)}
|
|
134
134
|
class:cursor-not-allowed={disabled}
|
|
135
135
|
{name}
|
|
136
136
|
{placeholder}
|
|
@@ -6,7 +6,7 @@ declare const __propDef: {
|
|
|
6
6
|
class?: string | undefined;
|
|
7
7
|
labelClass?: string | undefined;
|
|
8
8
|
wrapClass?: string | undefined;
|
|
9
|
-
|
|
9
|
+
inputClass?: string | undefined;
|
|
10
10
|
invalidClass?: string | undefined;
|
|
11
11
|
size?: "sm" | "md" | "lg" | undefined;
|
|
12
12
|
id?: string | undefined;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { slide } from "svelte/transition";
|
|
2
3
|
import { twMerge } from "tailwind-merge";
|
|
3
4
|
import {
|
|
4
5
|
getId,
|
|
5
6
|
validate as validateAction
|
|
6
7
|
} from "../../index.js";
|
|
8
|
+
const dispatch = createEventDispatcher();
|
|
7
9
|
const inputSizePreset = {
|
|
8
10
|
sm: "text-sm placeholder:text-sm",
|
|
9
11
|
md: "text-base placeholder:text-base",
|
|
@@ -44,6 +46,10 @@ $:
|
|
|
44
46
|
}
|
|
45
47
|
return v;
|
|
46
48
|
});
|
|
49
|
+
let _inputEl;
|
|
50
|
+
$:
|
|
51
|
+
if (_inputEl)
|
|
52
|
+
dispatch("input_mounted", _inputEl);
|
|
47
53
|
$:
|
|
48
54
|
inputClass = twMerge(`
|
|
49
55
|
rounded-md border-0 block w-full flex-1
|
|
@@ -87,6 +93,7 @@ $:
|
|
|
87
93
|
<select
|
|
88
94
|
class={inputClass}
|
|
89
95
|
bind:value
|
|
96
|
+
bind:this={_inputEl}
|
|
90
97
|
{disabled}
|
|
91
98
|
{required}
|
|
92
99
|
{tabindex}
|