y200subcontrols 0.1.371 → 0.1.373
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.
|
@@ -16,7 +16,7 @@ export let title = "";
|
|
|
16
16
|
{id}
|
|
17
17
|
{type}
|
|
18
18
|
class=" rounded hover:brightness-95 focus:outline-none focus:ring active:ring
|
|
19
|
-
space-x-1
|
|
19
|
+
space-x-1 cursor-pointer
|
|
20
20
|
{buttonSize === 'sm' ? 'px-2 py-1 text-sm' : ''}
|
|
21
21
|
{buttonSize === 'md' ? 'px-2.5 py-1.5' : ''}
|
|
22
22
|
{buttonSize === 'lg' ? 'font-bold px-3 py-3' : ''}
|
|
@@ -30,14 +30,10 @@ export let title = "";
|
|
|
30
30
|
{buttonStyle === 'amber' ? 'bg-amber-600 text-amber-50 ring-amber-600/20' : ''}
|
|
31
31
|
{buttonStyle === 'cyan' ? 'bg-cyan-600 text-cyan-50 ring-cyan-600/20' : ''}
|
|
32
32
|
{buttonStyle === 'sky' ? 'bg-sky-600 text-sky-50 ring-sky-600/20' : ''}
|
|
33
|
-
{buttonStyle === 'white' ? 'bg-white text-slate-950 ring-white/20' : ''}
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
{buttonStyle === 'white' ? 'bg-white text-slate-950 ring-white/20' : ''}
|
|
36
34
|
data-[loading='false']:disabled:bg-slate-100 data-[loading='false']:disabled:text-slate-300 disabled:ring-0
|
|
37
35
|
data-[loading='false']:disabled:brightness-100
|
|
38
|
-
data-[loading='true']:brightness-100 flex justify-center align-middle content-center
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
data-[loading='true']:brightness-100 flex justify-center align-middle content-center
|
|
41
37
|
{customCss}
|
|
42
38
|
"
|
|
43
39
|
on:click
|
|
@@ -6,6 +6,7 @@ export let allowSubmit = true;
|
|
|
6
6
|
export let busy = false;
|
|
7
7
|
export let dialogSize = "md";
|
|
8
8
|
export let showCloseButton = true;
|
|
9
|
+
export let theme = "teal";
|
|
9
10
|
let dialog;
|
|
10
11
|
let isClickInside = false;
|
|
11
12
|
export function openDialog() {
|
|
@@ -47,9 +48,9 @@ function handeMouseUp(event) {
|
|
|
47
48
|
<dialog
|
|
48
49
|
bind:this={dialog}
|
|
49
50
|
class="p-2 w-full
|
|
50
|
-
{dialogSize === 'sm' ? 'md:w-1/2' : ''}
|
|
51
|
-
{dialogSize === 'md' ? 'md:w-3/4 lg:w-2/3 xl:w-1/2' : ''}
|
|
52
|
-
{dialogSize === 'lg' ? 'md:w-3/4' : ''}
|
|
51
|
+
{dialogSize === 'sm' ? 'md:w-1/2 m-auto' : ''}
|
|
52
|
+
{dialogSize === 'md' ? 'md:w-3/4 lg:w-2/3 xl:w-1/2 m-auto' : ''}
|
|
53
|
+
{dialogSize === 'lg' ? 'md:w-3/4 m-auto' : ''}
|
|
53
54
|
bg-transparent
|
|
54
55
|
|
|
55
56
|
backdrop:bg-black/20 dark:backdrop:bg-white/20
|
|
@@ -67,7 +68,7 @@ function handeMouseUp(event) {
|
|
|
67
68
|
type="button"
|
|
68
69
|
data-close-dialog="true"
|
|
69
70
|
on:click={fireCancelDialog}
|
|
70
|
-
class="text-slate-400 dark:text-slate-200
|
|
71
|
+
class="text-slate-400 dark:text-slate-200 cursor-pointer
|
|
71
72
|
hover:text-red-500 px-2 inset-y-0 transition-colors ease-in-out"
|
|
72
73
|
>
|
|
73
74
|
<svg
|
|
@@ -90,7 +91,7 @@ function handeMouseUp(event) {
|
|
|
90
91
|
</button>
|
|
91
92
|
</div>
|
|
92
93
|
{/if}
|
|
93
|
-
</div>
|
|
94
|
+
</div>
|
|
94
95
|
|
|
95
96
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
96
97
|
<div on:mousedown={handleMouseDown} on:mouseup={handeMouseUp}>
|
|
@@ -99,7 +100,7 @@ function handeMouseUp(event) {
|
|
|
99
100
|
<div slot="buttons" class="grid {allowSubmit ? 'grid-cols-2' : 'grid-cols-1'} gap-2 my-2">
|
|
100
101
|
<slot name="buttons">
|
|
101
102
|
{#if allowSubmit}
|
|
102
|
-
<Button type="submit" isLoading={busy}>
|
|
103
|
+
<Button type="submit" isLoading={busy} buttonStyle={theme}>
|
|
103
104
|
<span>Ok</span>
|
|
104
105
|
</Button>
|
|
105
106
|
{/if}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ColorThemes } from './types.js';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
allowSubmit?: boolean;
|
|
5
6
|
busy?: boolean;
|
|
6
7
|
dialogSize?: "sm" | "md" | "lg";
|
|
7
8
|
showCloseButton?: boolean;
|
|
9
|
+
theme?: ColorThemes;
|
|
8
10
|
openDialog?: () => void;
|
|
9
11
|
dismissDialog?: () => void;
|
|
10
12
|
};
|