nuance-ui 0.1.54 → 0.1.56
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/module.mjs +1 -1
- package/dist/runtime/components/dialog/ui/dialog-close-button.d.vue.ts +2 -2
- package/dist/runtime/components/dialog/ui/dialog-close-button.vue +11 -9
- package/dist/runtime/components/dialog/ui/dialog-close-button.vue.d.ts +2 -2
- package/dist/runtime/components/dialog/ui/dialog-header.d.vue.ts +2 -2
- package/dist/runtime/components/dialog/ui/dialog-header.vue +5 -3
- package/dist/runtime/components/dialog/ui/dialog-header.vue.d.ts +2 -2
- package/dist/runtime/components/dialog/ui/dialog-root.d.vue.ts +2 -2
- package/dist/runtime/components/dialog/ui/dialog-root.vue +22 -26
- package/dist/runtime/components/dialog/ui/dialog-root.vue.d.ts +2 -2
- package/dist/runtime/components/dialog/ui/dialog-title.d.vue.ts +2 -2
- package/dist/runtime/components/dialog/ui/dialog-title.vue +5 -3
- package/dist/runtime/components/dialog/ui/dialog-title.vue.d.ts +2 -2
- package/dist/runtime/components/modals/modals-provider.vue +14 -9
- package/dist/runtime/plugins/modals/plugin.client.d.ts +3 -3
- package/dist/runtime/plugins/modals/plugin.client.js +2 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -71,7 +71,7 @@ const module$1 = defineNuxtModule({
|
|
|
71
71
|
addImportsDir(resolve("./runtime/helpers"));
|
|
72
72
|
}
|
|
73
73
|
addPlugin({
|
|
74
|
-
src: resolve("./runtime/plugins/modals/plugin.client
|
|
74
|
+
src: resolve("./runtime/plugins/modals/plugin.client"),
|
|
75
75
|
mode: "client"
|
|
76
76
|
});
|
|
77
77
|
nuxt.options.css.push(resolve("./runtime/styles/global.css"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ActionIconProps } from '../../action-icon/index.js';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_16: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
|
-
default?: (props: typeof
|
|
4
|
+
default?: (props: typeof __VLS_16) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_base: import("vue").DefineComponent<ActionIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ActionIconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -17,13 +17,15 @@ const close = useDialogState();
|
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<template>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
<ClientOnly>
|
|
21
|
+
<ActionIcon
|
|
22
|
+
:icon
|
|
23
|
+
:variant
|
|
24
|
+
tabindex='0'
|
|
25
|
+
v-bind='props'
|
|
26
|
+
@click='close'
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
</ActionIcon>
|
|
30
|
+
</ClientOnly>
|
|
29
31
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ActionIconProps } from '../../action-icon/index.js';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_16: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
|
-
default?: (props: typeof
|
|
4
|
+
default?: (props: typeof __VLS_16) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_base: import("vue").DefineComponent<ActionIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ActionIconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { BoxProps } from '../../box.vue.js';
|
|
2
2
|
export interface DialogHeaderProps extends BoxProps {
|
|
3
3
|
}
|
|
4
|
-
declare var
|
|
4
|
+
declare var __VLS_14: {};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
|
-
default?: (props: typeof
|
|
6
|
+
default?: (props: typeof __VLS_14) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<DialogHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogHeaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { BoxProps } from '../../box.vue.js';
|
|
2
2
|
export interface DialogHeaderProps extends BoxProps {
|
|
3
3
|
}
|
|
4
|
-
declare var
|
|
4
|
+
declare var __VLS_14: {};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
|
-
default?: (props: typeof
|
|
6
|
+
default?: (props: typeof __VLS_14) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<DialogHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogHeaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -33,9 +33,9 @@ type __VLS_ModelProps = {
|
|
|
33
33
|
'open'?: DialogModel['open'];
|
|
34
34
|
};
|
|
35
35
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
36
|
-
declare var
|
|
36
|
+
declare var __VLS_38: {};
|
|
37
37
|
type __VLS_Slots = {} & {
|
|
38
|
-
default?: (props: typeof
|
|
38
|
+
default?: (props: typeof __VLS_38) => any;
|
|
39
39
|
};
|
|
40
40
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
41
|
close: () => any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { getRadius, getShadow, getSize, getSpacing, rem } from "@nui/utils";
|
|
3
3
|
import { onClickOutside, unrefElement } from "@vueuse/core";
|
|
4
|
-
import { computed,
|
|
4
|
+
import { computed, shallowRef, watch } from "vue";
|
|
5
5
|
import Box from "../../box.vue";
|
|
6
6
|
import NTransition from "../../transition/transition.vue";
|
|
7
7
|
import { useProvideDialogState } from "../lib";
|
|
@@ -55,8 +55,7 @@ const dialogRef = shallowRef(null);
|
|
|
55
55
|
if (closeOnClickOutside) {
|
|
56
56
|
onClickOutside(dialogRef, () => opened.value = false);
|
|
57
57
|
}
|
|
58
|
-
watch(opened, (isOpen) => {
|
|
59
|
-
const dialog = unrefElement(dialogRef);
|
|
58
|
+
watch([opened, () => unrefElement(dialogRef)], ([isOpen, dialog]) => {
|
|
60
59
|
if (!dialog)
|
|
61
60
|
return;
|
|
62
61
|
if (isOpen)
|
|
@@ -64,11 +63,6 @@ watch(opened, (isOpen) => {
|
|
|
64
63
|
else
|
|
65
64
|
dialog.close();
|
|
66
65
|
}, { flush: "post" });
|
|
67
|
-
onMounted(() => {
|
|
68
|
-
if (!opened.value)
|
|
69
|
-
return;
|
|
70
|
-
open(unrefElement(dialogRef));
|
|
71
|
-
});
|
|
72
66
|
const style = computed(() => ({
|
|
73
67
|
"--dialog-size": getSize(size, "dialog-size"),
|
|
74
68
|
"--dialog-radius": radius ? getRadius(radius) : void 0,
|
|
@@ -80,22 +74,24 @@ const style = computed(() => ({
|
|
|
80
74
|
</script>
|
|
81
75
|
|
|
82
76
|
<template>
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
77
|
+
<ClientOnly>
|
|
78
|
+
<Teleport :disabled='!withinPortal' :to='portalTarget'>
|
|
79
|
+
<Box
|
|
80
|
+
is='dialog'
|
|
81
|
+
ref='dialogRef'
|
|
82
|
+
:class='[css.root, rootClass]'
|
|
83
|
+
:mod='[{ "without-overlay": withoutOverlay }, mod]'
|
|
84
|
+
:style
|
|
85
|
+
@click='overlayClick'
|
|
86
|
+
@close='$emit("close")'
|
|
87
|
+
@cancel.prevent='opened = false'
|
|
88
|
+
>
|
|
89
|
+
<NTransition :name='transition'>
|
|
90
|
+
<Box is='section' v-if='opened' :class='css.content' v-bind='$attrs'>
|
|
91
|
+
<slot />
|
|
92
|
+
</Box>
|
|
93
|
+
</NTransition>
|
|
94
|
+
</Box>
|
|
95
|
+
</Teleport>
|
|
96
|
+
</ClientOnly>
|
|
101
97
|
</template>
|
|
@@ -33,9 +33,9 @@ type __VLS_ModelProps = {
|
|
|
33
33
|
'open'?: DialogModel['open'];
|
|
34
34
|
};
|
|
35
35
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
36
|
-
declare var
|
|
36
|
+
declare var __VLS_38: {};
|
|
37
37
|
type __VLS_Slots = {} & {
|
|
38
|
-
default?: (props: typeof
|
|
38
|
+
default?: (props: typeof __VLS_38) => any;
|
|
39
39
|
};
|
|
40
40
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
41
|
close: () => any;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { TitleProps } from '../../title.vue.js';
|
|
2
2
|
export interface DialogTitleProps extends TitleProps {
|
|
3
3
|
}
|
|
4
|
-
declare var
|
|
4
|
+
declare var __VLS_14: {};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
|
-
default?: (props: typeof
|
|
6
|
+
default?: (props: typeof __VLS_14) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<DialogTitleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogTitleProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -20,7 +20,9 @@ const { size = "md", lh = "1", ...props } = defineProps({
|
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
|
|
23
|
+
<ClientOnly>
|
|
24
|
+
<Title :class='css.title' :lh :size v-bind='props'>
|
|
25
|
+
<slot />
|
|
26
|
+
</Title>
|
|
27
|
+
</ClientOnly>
|
|
26
28
|
</template>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { TitleProps } from '../../title.vue.js';
|
|
2
2
|
export interface DialogTitleProps extends TitleProps {
|
|
3
3
|
}
|
|
4
|
-
declare var
|
|
4
|
+
declare var __VLS_14: {};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
|
-
default?: (props: typeof
|
|
6
|
+
default?: (props: typeof __VLS_14) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<DialogTitleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogTitleProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useNuxtApp } from "#app";
|
|
3
|
+
import { ClientOnly } from "#components";
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
const modals = computed(() => useNuxtApp().$modals?.modals ?? []);
|
|
3
6
|
</script>
|
|
4
7
|
|
|
5
8
|
<template>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
<ClientOnly>
|
|
10
|
+
<div id='nui-modals-root'>
|
|
11
|
+
<component
|
|
12
|
+
:is='entry.component'
|
|
13
|
+
v-for='[id, entry] in modals'
|
|
14
|
+
:key='id'
|
|
15
|
+
v-bind='entry.props'
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
</ClientOnly>
|
|
14
19
|
</template>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModalManager } from './modal-manager.js';
|
|
2
|
-
export declare const $modals: ModalManager
|
|
2
|
+
export declare const $modals: import("vue").Raw<ModalManager>;
|
|
3
3
|
declare const _default: import("#app").Plugin<{
|
|
4
|
-
modals: ModalManager
|
|
4
|
+
modals: import("vue").Raw<ModalManager>;
|
|
5
5
|
}> & import("#app").ObjectPlugin<{
|
|
6
|
-
modals: ModalManager
|
|
6
|
+
modals: import("vue").Raw<ModalManager>;
|
|
7
7
|
}>;
|
|
8
8
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from "#imports";
|
|
1
|
+
import { defineNuxtPlugin, markRaw } from "#imports";
|
|
2
2
|
import { ModalManager } from "./modal-manager.js";
|
|
3
|
-
export const $modals = new ModalManager();
|
|
3
|
+
export const $modals = markRaw(new ModalManager());
|
|
4
4
|
export default defineNuxtPlugin(() => {
|
|
5
5
|
return {
|
|
6
6
|
provide: {
|