windly-ui 1.0.3 → 1.0.5
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 +8 -1
- package/dist/runtime/components/Accordion.vue +6 -2
- package/dist/runtime/components/Alert.d.vue.ts +83 -0
- package/dist/runtime/components/Alert.vue +78 -0
- package/dist/runtime/components/Alert.vue.d.ts +83 -0
- package/dist/runtime/components/Button.d.vue.ts +9 -0
- package/dist/runtime/components/Button.vue +2 -1
- package/dist/runtime/components/Button.vue.d.ts +9 -0
- package/dist/runtime/components/Dialog.d.vue.ts +9 -49
- package/dist/runtime/components/Dialog.vue +18 -85
- package/dist/runtime/components/Dialog.vue.d.ts +9 -49
- package/dist/runtime/components/FileUploader.d.vue.ts +22 -15
- package/dist/runtime/components/FileUploader.vue +286 -130
- package/dist/runtime/components/FileUploader.vue.d.ts +22 -15
- package/dist/runtime/components/Input.d.vue.ts +5 -3
- package/dist/runtime/components/Input.vue +15 -7
- package/dist/runtime/components/Input.vue.d.ts +5 -3
- package/dist/runtime/components/Select.d.vue.ts +25 -17
- package/dist/runtime/components/Select.vue +207 -136
- package/dist/runtime/components/Select.vue.d.ts +25 -17
- package/dist/runtime/components/Table.d.vue.ts +1 -1
- package/dist/runtime/components/Table.vue.d.ts +1 -1
- package/dist/runtime/components/Textarea.d.vue.ts +1 -1
- package/dist/runtime/components/Textarea.vue.d.ts +1 -1
- package/dist/runtime/docs/component.d.vue.ts +28 -0
- package/dist/runtime/docs/component.vue +34 -0
- package/dist/runtime/docs/component.vue.d.ts +28 -0
- package/dist/runtime/docs/index.d.vue.ts +3 -0
- package/dist/runtime/docs/index.vue +2537 -0
- package/dist/runtime/docs/index.vue.d.ts +3 -0
- package/dist/runtime/docs/megaSection.d.vue.ts +39 -0
- package/dist/runtime/docs/megaSection.vue +52 -0
- package/dist/runtime/docs/megaSection.vue.d.ts +39 -0
- package/dist/runtime/docs/section.d.vue.ts +39 -0
- package/dist/runtime/docs/section.vue +52 -0
- package/dist/runtime/docs/section.vue.d.ts +39 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addComponentsDir } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, addComponentsDir, extendPages } from '@nuxt/kit';
|
|
2
2
|
import tailwindColor from '../dist/runtime/tailwind-color.js';
|
|
3
3
|
|
|
4
4
|
const module$1 = defineNuxtModule({
|
|
@@ -9,6 +9,13 @@ const module$1 = defineNuxtModule({
|
|
|
9
9
|
prefix: "UI",
|
|
10
10
|
pathPrefix: false
|
|
11
11
|
});
|
|
12
|
+
extendPages((pages) => {
|
|
13
|
+
pages.push({
|
|
14
|
+
name: "windly-ui-docs",
|
|
15
|
+
path: "/_windly-ui",
|
|
16
|
+
file: resolver.resolve("./runtime/docs/index.vue")
|
|
17
|
+
});
|
|
18
|
+
});
|
|
12
19
|
nuxt.hook("tailwindcss:config", (config) => {
|
|
13
20
|
config.content ??= {};
|
|
14
21
|
if (!Array.isArray(config.content.files)) {
|
|
@@ -59,7 +59,9 @@ const headerEvents = computed(() => {
|
|
|
59
59
|
|
|
60
60
|
<!-- Toggle (left) -->
|
|
61
61
|
<UIButton v-if="toggleSide === 'left'" icon="chevron_right" flat dense class="transition-transform"
|
|
62
|
-
:class="
|
|
62
|
+
:class="{
|
|
63
|
+
'rotate-90': isOpen
|
|
64
|
+
}" />
|
|
63
65
|
|
|
64
66
|
<!-- Header content -->
|
|
65
67
|
<div class="flex-1">
|
|
@@ -75,7 +77,9 @@ const headerEvents = computed(() => {
|
|
|
75
77
|
|
|
76
78
|
<!-- Toggle (right) -->
|
|
77
79
|
<UIButton v-if="toggleSide === 'right'" icon="chevron_right" flat dense class="transition-transform"
|
|
78
|
-
:class="
|
|
80
|
+
:class="{
|
|
81
|
+
'rotate-90': isOpen
|
|
82
|
+
}" />
|
|
79
83
|
</div>
|
|
80
84
|
|
|
81
85
|
<!-- Content -->
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
4
|
+
type __VLS_WithSlots<T, S> = T & (new () => {
|
|
5
|
+
$slots: S;
|
|
6
|
+
});
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
isOpen: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
title: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
message: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
confirmBtnText: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
cancelBtnText: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
showConfirmBtn: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
showCloseIcon: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
|
+
"update:isOpen": (...args: any[]) => void;
|
|
38
|
+
confirm: (...args: any[]) => void;
|
|
39
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
isOpen: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
title: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
message: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
confirmBtnText: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
cancelBtnText: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
showConfirmBtn: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
64
|
+
showCloseIcon: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: boolean;
|
|
67
|
+
};
|
|
68
|
+
}>> & Readonly<{
|
|
69
|
+
"onUpdate:isOpen"?: ((...args: any[]) => any) | undefined;
|
|
70
|
+
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
71
|
+
}>, {
|
|
72
|
+
title: string;
|
|
73
|
+
message: string;
|
|
74
|
+
confirmBtnText: string;
|
|
75
|
+
cancelBtnText: string;
|
|
76
|
+
showConfirmBtn: boolean;
|
|
77
|
+
showCloseIcon: boolean;
|
|
78
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
79
|
+
type __VLS_Slots = {
|
|
80
|
+
title?: ((props: {}) => any) | undefined;
|
|
81
|
+
} & {
|
|
82
|
+
message?: ((props: {}) => any) | undefined;
|
|
83
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useAttrs } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
isOpen: {
|
|
5
|
+
type: Boolean,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
title: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "Modal Title"
|
|
11
|
+
},
|
|
12
|
+
message: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
confirmBtnText: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "Confirm"
|
|
19
|
+
},
|
|
20
|
+
cancelBtnText: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "Cancel"
|
|
23
|
+
},
|
|
24
|
+
showConfirmBtn: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
},
|
|
28
|
+
showCloseIcon: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const dialogAttributes = useAttrs();
|
|
34
|
+
const emit = defineEmits(["update:isOpen", "confirm"]);
|
|
35
|
+
const close = () => emit("update:isOpen", false);
|
|
36
|
+
const handleConfirm = () => {
|
|
37
|
+
emit("confirm");
|
|
38
|
+
close();
|
|
39
|
+
};
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<UIDialog v-bind="dialogAttributes" :isOpen="isOpen" @update:isOpen="(val) => emit('update:isOpen', val)">
|
|
44
|
+
<div class="bg-white rounded-lg shadow-lg w-96 p-6">
|
|
45
|
+
<!-- Header -->
|
|
46
|
+
<div class="flex justify-between items-center mb-4">
|
|
47
|
+
<slot name="title">
|
|
48
|
+
<h3 class="text-lg font-semibold">
|
|
49
|
+
{{ title }}
|
|
50
|
+
</h3>
|
|
51
|
+
</slot>
|
|
52
|
+
|
|
53
|
+
<button v-if="showCloseIcon" @click="close" class="text-gray-500 hover:text-gray-700" aria-label="Close modal">
|
|
54
|
+
<span class="material-icons">close</span>
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<!-- Message -->
|
|
59
|
+
<slot name="message">
|
|
60
|
+
<p class="text-gray-600 mb-6">
|
|
61
|
+
{{ message }}
|
|
62
|
+
</p>
|
|
63
|
+
</slot>
|
|
64
|
+
|
|
65
|
+
<!-- Actions -->
|
|
66
|
+
<div class="flex justify-end">
|
|
67
|
+
<button @click="close" class="mr-2 px-4 py-2 bg-gray-200 text-gray-700 rounded-lg transition hover:bg-gray-300">
|
|
68
|
+
{{ cancelBtnText }}
|
|
69
|
+
</button>
|
|
70
|
+
|
|
71
|
+
<button v-if="showConfirmBtn" @click="handleConfirm"
|
|
72
|
+
class="px-4 py-2 bg-blue-500 text-white rounded-lg transition hover:bg-blue-600">
|
|
73
|
+
{{ confirmBtnText }}
|
|
74
|
+
</button>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</UIDialog>
|
|
78
|
+
</template>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
4
|
+
type __VLS_WithSlots<T, S> = T & (new () => {
|
|
5
|
+
$slots: S;
|
|
6
|
+
});
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
isOpen: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
title: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
message: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
confirmBtnText: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
cancelBtnText: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
showConfirmBtn: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
showCloseIcon: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
|
+
"update:isOpen": (...args: any[]) => void;
|
|
38
|
+
confirm: (...args: any[]) => void;
|
|
39
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
isOpen: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
title: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
message: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
confirmBtnText: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
cancelBtnText: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
showConfirmBtn: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
64
|
+
showCloseIcon: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: boolean;
|
|
67
|
+
};
|
|
68
|
+
}>> & Readonly<{
|
|
69
|
+
"onUpdate:isOpen"?: ((...args: any[]) => any) | undefined;
|
|
70
|
+
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
71
|
+
}>, {
|
|
72
|
+
title: string;
|
|
73
|
+
message: string;
|
|
74
|
+
confirmBtnText: string;
|
|
75
|
+
cancelBtnText: string;
|
|
76
|
+
showConfirmBtn: boolean;
|
|
77
|
+
showCloseIcon: boolean;
|
|
78
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
79
|
+
type __VLS_Slots = {
|
|
80
|
+
title?: ((props: {}) => any) | undefined;
|
|
81
|
+
} & {
|
|
82
|
+
message?: ((props: {}) => any) | undefined;
|
|
83
|
+
};
|
|
@@ -83,6 +83,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
83
83
|
type: StringConstructor;
|
|
84
84
|
default: string;
|
|
85
85
|
};
|
|
86
|
+
class: {
|
|
87
|
+
type: StringConstructor;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
86
90
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
87
91
|
click: (...args: any[]) => void;
|
|
88
92
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -170,11 +174,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
170
174
|
type: StringConstructor;
|
|
171
175
|
default: string;
|
|
172
176
|
};
|
|
177
|
+
class: {
|
|
178
|
+
type: StringConstructor;
|
|
179
|
+
default: string;
|
|
180
|
+
};
|
|
173
181
|
}>> & Readonly<{
|
|
174
182
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
175
183
|
}>, {
|
|
176
184
|
dense: boolean;
|
|
177
185
|
label: string;
|
|
186
|
+
class: string;
|
|
178
187
|
contentClass: string;
|
|
179
188
|
contentStyle: string;
|
|
180
189
|
textColor: string;
|
|
@@ -18,6 +18,7 @@ const props = defineProps({
|
|
|
18
18
|
icon: { type: String, default: null },
|
|
19
19
|
iconColor: { type: String, default: null },
|
|
20
20
|
iconPosition: { type: String, default: "start" },
|
|
21
|
+
class: { type: String, default: "" },
|
|
21
22
|
...uiProps
|
|
22
23
|
});
|
|
23
24
|
const {
|
|
@@ -57,7 +58,7 @@ const paddingClass = {
|
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
60
|
const computedClass = computed(() => {
|
|
60
|
-
let cls =
|
|
61
|
+
let cls = `${props.class} transition-all duration-300 text-nowrap ${roundedClass[rounded.value]} ${sizeClass[size.value]}`;
|
|
61
62
|
if (props.outline)
|
|
62
63
|
cls += ` border bg-white border-${colorClass.value} text-${colorClass.value} hover:bg-${colorClass.value} hover:text-white`;
|
|
63
64
|
if (props.flat)
|
|
@@ -83,6 +83,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
83
83
|
type: StringConstructor;
|
|
84
84
|
default: string;
|
|
85
85
|
};
|
|
86
|
+
class: {
|
|
87
|
+
type: StringConstructor;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
86
90
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
87
91
|
click: (...args: any[]) => void;
|
|
88
92
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -170,11 +174,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
170
174
|
type: StringConstructor;
|
|
171
175
|
default: string;
|
|
172
176
|
};
|
|
177
|
+
class: {
|
|
178
|
+
type: StringConstructor;
|
|
179
|
+
default: string;
|
|
180
|
+
};
|
|
173
181
|
}>> & Readonly<{
|
|
174
182
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
175
183
|
}>, {
|
|
176
184
|
dense: boolean;
|
|
177
185
|
label: string;
|
|
186
|
+
class: string;
|
|
178
187
|
contentClass: string;
|
|
179
188
|
contentStyle: string;
|
|
180
189
|
textColor: string;
|
|
@@ -9,30 +9,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
9
9
|
type: BooleanConstructor;
|
|
10
10
|
required: true;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
width: {
|
|
13
13
|
type: StringConstructor;
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
height: {
|
|
17
17
|
type: StringConstructor;
|
|
18
18
|
default: string;
|
|
19
19
|
};
|
|
20
|
-
confirmBtnText: {
|
|
21
|
-
type: StringConstructor;
|
|
22
|
-
default: string;
|
|
23
|
-
};
|
|
24
|
-
cancelBtnText: {
|
|
25
|
-
type: StringConstructor;
|
|
26
|
-
default: string;
|
|
27
|
-
};
|
|
28
|
-
showConfirmBtn: {
|
|
29
|
-
type: BooleanConstructor;
|
|
30
|
-
default: boolean;
|
|
31
|
-
};
|
|
32
|
-
showCloseIcon: {
|
|
33
|
-
type: BooleanConstructor;
|
|
34
|
-
default: boolean;
|
|
35
|
-
};
|
|
36
20
|
persistent: {
|
|
37
21
|
type: BooleanConstructor;
|
|
38
22
|
default: boolean;
|
|
@@ -40,40 +24,23 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
40
24
|
position: {
|
|
41
25
|
type: StringConstructor;
|
|
42
26
|
default: string;
|
|
43
|
-
validator: (
|
|
27
|
+
validator: (value: unknown) => any;
|
|
44
28
|
};
|
|
45
29
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
46
30
|
"update:isOpen": (...args: any[]) => void;
|
|
47
|
-
confirm: (...args: any[]) => void;
|
|
48
31
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
49
32
|
isOpen: {
|
|
50
33
|
type: BooleanConstructor;
|
|
51
34
|
required: true;
|
|
52
35
|
};
|
|
53
|
-
|
|
36
|
+
width: {
|
|
54
37
|
type: StringConstructor;
|
|
55
38
|
default: string;
|
|
56
39
|
};
|
|
57
|
-
|
|
40
|
+
height: {
|
|
58
41
|
type: StringConstructor;
|
|
59
42
|
default: string;
|
|
60
43
|
};
|
|
61
|
-
confirmBtnText: {
|
|
62
|
-
type: StringConstructor;
|
|
63
|
-
default: string;
|
|
64
|
-
};
|
|
65
|
-
cancelBtnText: {
|
|
66
|
-
type: StringConstructor;
|
|
67
|
-
default: string;
|
|
68
|
-
};
|
|
69
|
-
showConfirmBtn: {
|
|
70
|
-
type: BooleanConstructor;
|
|
71
|
-
default: boolean;
|
|
72
|
-
};
|
|
73
|
-
showCloseIcon: {
|
|
74
|
-
type: BooleanConstructor;
|
|
75
|
-
default: boolean;
|
|
76
|
-
};
|
|
77
44
|
persistent: {
|
|
78
45
|
type: BooleanConstructor;
|
|
79
46
|
default: boolean;
|
|
@@ -81,23 +48,16 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
81
48
|
position: {
|
|
82
49
|
type: StringConstructor;
|
|
83
50
|
default: string;
|
|
84
|
-
validator: (
|
|
51
|
+
validator: (value: unknown) => any;
|
|
85
52
|
};
|
|
86
53
|
}>> & Readonly<{
|
|
87
54
|
"onUpdate:isOpen"?: ((...args: any[]) => any) | undefined;
|
|
88
|
-
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
89
55
|
}>, {
|
|
90
|
-
title: string;
|
|
91
56
|
position: string;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
cancelBtnText: string;
|
|
95
|
-
showConfirmBtn: boolean;
|
|
96
|
-
showCloseIcon: boolean;
|
|
57
|
+
width: string;
|
|
58
|
+
height: string;
|
|
97
59
|
persistent: boolean;
|
|
98
60
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
99
61
|
type __VLS_Slots = {
|
|
100
|
-
|
|
101
|
-
} & {
|
|
102
|
-
message?: ((props: {}) => any) | undefined;
|
|
62
|
+
default?: ((props: {}) => any) | undefined;
|
|
103
63
|
};
|
|
@@ -1,61 +1,3 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition name="fade">
|
|
3
|
-
<div
|
|
4
|
-
v-if="isOpen"
|
|
5
|
-
class="fixed inset-0 z-50 flex bg-black bg-opacity-60"
|
|
6
|
-
role="dialog"
|
|
7
|
-
aria-modal="true"
|
|
8
|
-
@click.self="handleOutsideClick"
|
|
9
|
-
:class="positionClasses"
|
|
10
|
-
>
|
|
11
|
-
<div class="bg-white rounded-lg shadow-lg w-96 p-6">
|
|
12
|
-
<!-- Header -->
|
|
13
|
-
<div class="flex justify-between items-center mb-4">
|
|
14
|
-
<slot name="title">
|
|
15
|
-
<h3 class="text-lg font-semibold">
|
|
16
|
-
{{ title }}
|
|
17
|
-
</h3>
|
|
18
|
-
</slot>
|
|
19
|
-
|
|
20
|
-
<button
|
|
21
|
-
v-if="showCloseIcon"
|
|
22
|
-
@click="close"
|
|
23
|
-
class="text-gray-500 hover:text-gray-700"
|
|
24
|
-
aria-label="Close modal"
|
|
25
|
-
>
|
|
26
|
-
<span class="material-icons">close</span>
|
|
27
|
-
</button>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<!-- Message -->
|
|
31
|
-
<slot name="message">
|
|
32
|
-
<p class="text-gray-600 mb-6">
|
|
33
|
-
{{ message }}
|
|
34
|
-
</p>
|
|
35
|
-
</slot>
|
|
36
|
-
|
|
37
|
-
<!-- Actions -->
|
|
38
|
-
<div class="flex justify-end">
|
|
39
|
-
<button
|
|
40
|
-
@click="close"
|
|
41
|
-
class="mr-2 px-4 py-2 bg-gray-200 text-gray-700 rounded-lg transition hover:bg-gray-300"
|
|
42
|
-
>
|
|
43
|
-
{{ cancelBtnText }}
|
|
44
|
-
</button>
|
|
45
|
-
|
|
46
|
-
<button
|
|
47
|
-
v-if="showConfirmBtn"
|
|
48
|
-
@click="handleConfirm"
|
|
49
|
-
class="px-4 py-2 bg-blue-500 text-white rounded-lg transition hover:bg-blue-600"
|
|
50
|
-
>
|
|
51
|
-
{{ confirmBtnText }}
|
|
52
|
-
</button>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</transition>
|
|
57
|
-
</template>
|
|
58
|
-
|
|
59
1
|
<script setup>
|
|
60
2
|
import { computed, watch, onBeforeUnmount } from "vue";
|
|
61
3
|
import { useRouter } from "vue-router";
|
|
@@ -64,29 +6,13 @@ const props = defineProps({
|
|
|
64
6
|
type: Boolean,
|
|
65
7
|
required: true
|
|
66
8
|
},
|
|
67
|
-
|
|
68
|
-
type: String,
|
|
69
|
-
default: "Modal Title"
|
|
70
|
-
},
|
|
71
|
-
message: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: ""
|
|
74
|
-
},
|
|
75
|
-
confirmBtnText: {
|
|
9
|
+
width: {
|
|
76
10
|
type: String,
|
|
77
|
-
default: "
|
|
11
|
+
default: "400px"
|
|
78
12
|
},
|
|
79
|
-
|
|
13
|
+
height: {
|
|
80
14
|
type: String,
|
|
81
|
-
default: "
|
|
82
|
-
},
|
|
83
|
-
showConfirmBtn: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
default: false
|
|
86
|
-
},
|
|
87
|
-
showCloseIcon: {
|
|
88
|
-
type: Boolean,
|
|
89
|
-
default: false
|
|
15
|
+
default: "auto"
|
|
90
16
|
},
|
|
91
17
|
persistent: {
|
|
92
18
|
type: Boolean,
|
|
@@ -95,16 +21,12 @@ const props = defineProps({
|
|
|
95
21
|
position: {
|
|
96
22
|
type: String,
|
|
97
23
|
default: "center",
|
|
98
|
-
validator: (
|
|
24
|
+
validator: (value) => ["top", "bottom", "left", "right", "center"].includes(value)
|
|
99
25
|
}
|
|
100
26
|
});
|
|
101
|
-
const emit = defineEmits(["update:isOpen"
|
|
27
|
+
const emit = defineEmits(["update:isOpen"]);
|
|
102
28
|
const router = useRouter();
|
|
103
29
|
const close = () => emit("update:isOpen", false);
|
|
104
|
-
const handleConfirm = () => {
|
|
105
|
-
emit("confirm");
|
|
106
|
-
close();
|
|
107
|
-
};
|
|
108
30
|
const handleOutsideClick = () => {
|
|
109
31
|
if (!props.persistent) close();
|
|
110
32
|
};
|
|
@@ -147,6 +69,17 @@ onBeforeUnmount(() => {
|
|
|
147
69
|
});
|
|
148
70
|
</script>
|
|
149
71
|
|
|
72
|
+
<template>
|
|
73
|
+
<transition name="fade">
|
|
74
|
+
<div v-if="isOpen" class="fixed inset-0 z-50 flex bg-black bg-opacity-60" role="dialog" aria-modal="true"
|
|
75
|
+
@click.self="handleOutsideClick" :class="positionClasses">
|
|
76
|
+
<div :style="{ width: width, height: height }">
|
|
77
|
+
<slot />
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</transition>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
150
83
|
<style scoped>
|
|
151
|
-
.fade-enter-active{animation:fadeInScale .3s ease forwards}.fade-leave-active{transition:opacity .3s ease,transform .3s ease}@keyframes fadeInScale{0%{opacity:0
|
|
84
|
+
.fade-enter-active{animation:fadeInScale .3s ease forwards}.fade-leave-active{transition:opacity .3s ease,transform .3s ease}@keyframes fadeInScale{0%{opacity:0}to{opacity:1}}.fade-leave-to{opacity:0}
|
|
152
85
|
</style>
|