nuxt-ui-elements 0.1.21 → 0.1.24
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/module.json +1 -1
- package/dist/runtime/components/DialogAlert.d.vue.ts +3 -5
- package/dist/runtime/components/DialogAlert.vue +2 -4
- package/dist/runtime/components/DialogAlert.vue.d.ts +3 -5
- package/dist/runtime/components/DialogConfirm.d.vue.ts +5 -7
- package/dist/runtime/components/DialogConfirm.vue +3 -5
- package/dist/runtime/components/DialogConfirm.vue.d.ts +5 -7
- package/dist/runtime/composables/useDialog.d.ts +3 -29
- package/dist/runtime/composables/useDialog.js +1 -1
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/index.js +3 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { AppConfig } from "@nuxt/schema";
|
|
2
2
|
import theme from "#build/ui-elements/dialog-alert";
|
|
3
|
-
import type { ComponentConfig } from "../types/
|
|
3
|
+
import type { ComponentConfig } from "../types/index.js";
|
|
4
4
|
type DialogAlert = ComponentConfig<typeof theme, AppConfig, "dialogAlert">;
|
|
5
|
-
interface DialogAlertProps {
|
|
5
|
+
export interface DialogAlertProps {
|
|
6
6
|
title?: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
icon?: string;
|
|
9
9
|
label?: string;
|
|
10
10
|
color?: DialogAlert["variants"]["color"];
|
|
11
11
|
variant?: DialogAlert["variants"]["variant"];
|
|
12
|
-
onDismiss?: (
|
|
12
|
+
onDismiss?: () => void | Promise<void>;
|
|
13
13
|
ui?: DialogAlert["slots"];
|
|
14
14
|
}
|
|
15
15
|
declare const _default: typeof __VLS_export;
|
|
@@ -17,9 +17,7 @@ export default _default;
|
|
|
17
17
|
declare const __VLS_export: import("vue").DefineComponent<DialogAlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
18
|
close: (value?: any) => any;
|
|
19
19
|
"update:open": (value: boolean) => any;
|
|
20
|
-
"after:leave": () => any;
|
|
21
20
|
}, string, import("vue").PublicProps, Readonly<DialogAlertProps> & Readonly<{
|
|
22
21
|
onClose?: ((value?: any) => any) | undefined;
|
|
23
22
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
24
|
-
"onAfter:leave"?: (() => any) | undefined;
|
|
25
23
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -26,7 +26,7 @@ const {
|
|
|
26
26
|
onDismiss: { type: Function, required: false },
|
|
27
27
|
ui: { type: null, required: false }
|
|
28
28
|
});
|
|
29
|
-
const emits = defineEmits(["update:open", "close"
|
|
29
|
+
const emits = defineEmits(["update:open", "close"]);
|
|
30
30
|
const ui = computed(
|
|
31
31
|
() => tv({
|
|
32
32
|
extend: tv(theme)
|
|
@@ -53,9 +53,7 @@ const dismissHandler = () => {
|
|
|
53
53
|
header: ui.header({ class: uiProps?.header }),
|
|
54
54
|
body: ui.body({ class: uiProps?.body }),
|
|
55
55
|
footer: ui.footer({ class: uiProps?.footer })
|
|
56
|
-
}"
|
|
57
|
-
@close="emits('close', $event)"
|
|
58
|
-
@after:leave="emits('after:leave')">
|
|
56
|
+
}">
|
|
59
57
|
<template #header>
|
|
60
58
|
<div class="relative w-full flex flex-col items-center text-center gap-3">
|
|
61
59
|
<UIcon v-if="icon" :name="icon" data-slot="icon" :class="ui.icon({ class: uiProps?.icon })" />
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { AppConfig } from "@nuxt/schema";
|
|
2
2
|
import theme from "#build/ui-elements/dialog-alert";
|
|
3
|
-
import type { ComponentConfig } from "../types/
|
|
3
|
+
import type { ComponentConfig } from "../types/index.js";
|
|
4
4
|
type DialogAlert = ComponentConfig<typeof theme, AppConfig, "dialogAlert">;
|
|
5
|
-
interface DialogAlertProps {
|
|
5
|
+
export interface DialogAlertProps {
|
|
6
6
|
title?: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
icon?: string;
|
|
9
9
|
label?: string;
|
|
10
10
|
color?: DialogAlert["variants"]["color"];
|
|
11
11
|
variant?: DialogAlert["variants"]["variant"];
|
|
12
|
-
onDismiss?: (
|
|
12
|
+
onDismiss?: () => void | Promise<void>;
|
|
13
13
|
ui?: DialogAlert["slots"];
|
|
14
14
|
}
|
|
15
15
|
declare const _default: typeof __VLS_export;
|
|
@@ -17,9 +17,7 @@ export default _default;
|
|
|
17
17
|
declare const __VLS_export: import("vue").DefineComponent<DialogAlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
18
|
close: (value?: any) => any;
|
|
19
19
|
"update:open": (value: boolean) => any;
|
|
20
|
-
"after:leave": () => any;
|
|
21
20
|
}, string, import("vue").PublicProps, Readonly<DialogAlertProps> & Readonly<{
|
|
22
21
|
onClose?: ((value?: any) => any) | undefined;
|
|
23
22
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
24
|
-
"onAfter:leave"?: (() => any) | undefined;
|
|
25
23
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { AppConfig } from "@nuxt/schema";
|
|
2
2
|
import theme from "#build/ui-elements/dialog-confirm";
|
|
3
|
-
import type { ComponentConfig } from "../types/
|
|
3
|
+
import type { ComponentConfig } from "../types/index.js";
|
|
4
4
|
type DialogConfirm = ComponentConfig<typeof theme, AppConfig, "dialogConfirm">;
|
|
5
|
-
interface DialogConfirmProps {
|
|
5
|
+
export interface DialogConfirmProps {
|
|
6
6
|
title?: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
icon?: boolean;
|
|
9
9
|
confirmLabel?: string;
|
|
10
10
|
dismissLabel?: string;
|
|
11
|
-
close?: boolean;
|
|
12
11
|
color?: DialogConfirm["variants"]["color"];
|
|
13
12
|
variant?: DialogConfirm["variants"]["variant"];
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
close?: boolean;
|
|
14
|
+
onConfirm?: () => void | Promise<void>;
|
|
15
|
+
onDismiss?: () => void | Promise<void>;
|
|
16
16
|
ui?: DialogConfirm["slots"];
|
|
17
17
|
}
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
@@ -20,9 +20,7 @@ export default _default;
|
|
|
20
20
|
declare const __VLS_export: import("vue").DefineComponent<DialogConfirmProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
21
|
close: (value?: any) => any;
|
|
22
22
|
"update:open": (value: boolean) => any;
|
|
23
|
-
"after:leave": () => any;
|
|
24
23
|
}, string, import("vue").PublicProps, Readonly<DialogConfirmProps> & Readonly<{
|
|
25
24
|
onClose?: ((value?: any) => any) | undefined;
|
|
26
25
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
27
|
-
"onAfter:leave"?: (() => any) | undefined;
|
|
28
26
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -26,14 +26,14 @@ const {
|
|
|
26
26
|
icon: { type: Boolean, required: false },
|
|
27
27
|
confirmLabel: { type: String, required: false },
|
|
28
28
|
dismissLabel: { type: String, required: false },
|
|
29
|
-
close: { type: Boolean, required: false },
|
|
30
29
|
color: { type: null, required: false },
|
|
31
30
|
variant: { type: null, required: false },
|
|
31
|
+
close: { type: Boolean, required: false },
|
|
32
32
|
onConfirm: { type: Function, required: false },
|
|
33
33
|
onDismiss: { type: Function, required: false },
|
|
34
34
|
ui: { type: null, required: false }
|
|
35
35
|
});
|
|
36
|
-
const emits = defineEmits(["update:open", "close"
|
|
36
|
+
const emits = defineEmits(["update:open", "close"]);
|
|
37
37
|
const isLoading = ref(false);
|
|
38
38
|
const isComplete = ref(false);
|
|
39
39
|
const isError = ref(false);
|
|
@@ -111,9 +111,7 @@ const handleClose = () => {
|
|
|
111
111
|
header: ui.header({ class: uiProps?.header }),
|
|
112
112
|
body: ui.body({ class: uiProps?.body }),
|
|
113
113
|
footer: ui.footer({ class: uiProps?.footer })
|
|
114
|
-
}"
|
|
115
|
-
@close="emits('close', $event)"
|
|
116
|
-
@after:leave="emits('after:leave')">
|
|
114
|
+
}">
|
|
117
115
|
<template #header>
|
|
118
116
|
<div class="relative w-full flex items-start gap-3">
|
|
119
117
|
<UIcon v-if="dialogIcon" :name="dialogIcon" data-slot="icon" :class="ui.icon({ class: uiProps?.icon })" />
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { AppConfig } from "@nuxt/schema";
|
|
2
2
|
import theme from "#build/ui-elements/dialog-confirm";
|
|
3
|
-
import type { ComponentConfig } from "../types/
|
|
3
|
+
import type { ComponentConfig } from "../types/index.js";
|
|
4
4
|
type DialogConfirm = ComponentConfig<typeof theme, AppConfig, "dialogConfirm">;
|
|
5
|
-
interface DialogConfirmProps {
|
|
5
|
+
export interface DialogConfirmProps {
|
|
6
6
|
title?: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
icon?: boolean;
|
|
9
9
|
confirmLabel?: string;
|
|
10
10
|
dismissLabel?: string;
|
|
11
|
-
close?: boolean;
|
|
12
11
|
color?: DialogConfirm["variants"]["color"];
|
|
13
12
|
variant?: DialogConfirm["variants"]["variant"];
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
close?: boolean;
|
|
14
|
+
onConfirm?: () => void | Promise<void>;
|
|
15
|
+
onDismiss?: () => void | Promise<void>;
|
|
16
16
|
ui?: DialogConfirm["slots"];
|
|
17
17
|
}
|
|
18
18
|
declare const _default: typeof __VLS_export;
|
|
@@ -20,9 +20,7 @@ export default _default;
|
|
|
20
20
|
declare const __VLS_export: import("vue").DefineComponent<DialogConfirmProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
21
|
close: (value?: any) => any;
|
|
22
22
|
"update:open": (value: boolean) => any;
|
|
23
|
-
"after:leave": () => any;
|
|
24
23
|
}, string, import("vue").PublicProps, Readonly<DialogConfirmProps> & Readonly<{
|
|
25
24
|
onClose?: ((value?: any) => any) | undefined;
|
|
26
25
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
27
|
-
"onAfter:leave"?: (() => any) | undefined;
|
|
28
26
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
type
|
|
2
|
-
type Color = "primary" | "secondary" | "success" | "info" | "warning" | "error" | (string & {});
|
|
3
|
-
type Variant = "solid" | "outline";
|
|
4
|
-
export interface DialogConfirmOptions {
|
|
5
|
-
title: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
icon?: boolean;
|
|
8
|
-
confirmLabel?: string;
|
|
9
|
-
dismissLabel?: string;
|
|
10
|
-
color?: Color;
|
|
11
|
-
variant?: Variant;
|
|
12
|
-
close?: boolean;
|
|
13
|
-
onConfirm?: CallbackFn;
|
|
14
|
-
onDismiss?: CallbackFn;
|
|
15
|
-
ui?: any;
|
|
16
|
-
}
|
|
17
|
-
export interface DialogAlertOptions {
|
|
18
|
-
title: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
icon?: string;
|
|
21
|
-
label?: string;
|
|
22
|
-
color?: Color;
|
|
23
|
-
variant?: Variant;
|
|
24
|
-
onDismiss?: CallbackFn;
|
|
25
|
-
ui?: any;
|
|
26
|
-
}
|
|
1
|
+
import type { DialogConfirmProps, DialogAlertProps } from "../types/index.js";
|
|
27
2
|
export declare const useDialog: () => {
|
|
28
|
-
confirm: (options:
|
|
29
|
-
alert: (options:
|
|
3
|
+
confirm: (options: DialogConfirmProps) => void;
|
|
4
|
+
alert: (options: DialogAlertProps) => void;
|
|
30
5
|
};
|
|
31
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useOverlay } from "#imports";
|
|
1
2
|
import DialogConfirm from "../components/DialogConfirm.vue";
|
|
2
3
|
import DialogAlert from "../components/DialogAlert.vue";
|
|
3
|
-
import { useOverlay } from "#imports";
|
|
4
4
|
export const useDialog = () => {
|
|
5
5
|
const overlay = useOverlay();
|
|
6
6
|
const confirm = (options) => {
|
package/package.json
CHANGED