@munet/ui 1.0.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/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components/Button/LoadingBackground/index.d.ts +2 -0
- package/dist/components/Button/LoadingBackground/index.js +14 -0
- package/dist/components/Button/LoadingBackground/index.module.css +1 -0
- package/dist/components/Button/LoadingBackground/index.module.sass.js +7 -0
- package/dist/components/Button/index.d.ts +16 -0
- package/dist/components/Button/index.js +29 -0
- package/dist/components/CheckBox/FlagCheckBox.d.ts +35 -0
- package/dist/components/CheckBox/FlagCheckBox.js +41 -0
- package/dist/components/CheckBox/index.d.ts +26 -0
- package/dist/components/CheckBox/index.js +45 -0
- package/dist/components/DateFormat.d.ts +22 -0
- package/dist/components/DateFormat.js +23 -0
- package/dist/components/DropMenu/DropDown.d.ts +49 -0
- package/dist/components/DropMenu/DropDown.js +77 -0
- package/dist/components/DropMenu/index.d.ts +54 -0
- package/dist/components/DropMenu/index.js +48 -0
- package/dist/components/GlobalElementsContainer/ForegroundTask.d.ts +39 -0
- package/dist/components/GlobalElementsContainer/ForegroundTask.js +52 -0
- package/dist/components/GlobalElementsContainer/TaskManager.d.ts +45 -0
- package/dist/components/GlobalElementsContainer/TaskManager.js +90 -0
- package/dist/components/GlobalElementsContainer/TaskManager.module.css +1 -0
- package/dist/components/GlobalElementsContainer/TaskManager.module.sass.js +9 -0
- package/dist/components/GlobalElementsContainer/Toast.d.ts +14 -0
- package/dist/components/GlobalElementsContainer/Toast.js +41 -0
- package/dist/components/GlobalElementsContainer/ToastsDisplay.d.ts +2 -0
- package/dist/components/GlobalElementsContainer/ToastsDisplay.js +24 -0
- package/dist/components/GlobalElementsContainer/TransactionalDialog.d.ts +7 -0
- package/dist/components/GlobalElementsContainer/TransactionalDialog.js +45 -0
- package/dist/components/GlobalElementsContainer/index.d.ts +2 -0
- package/dist/components/GlobalElementsContainer/index.js +18 -0
- package/dist/components/Modal/index.d.ts +60 -0
- package/dist/components/Modal/index.js +124 -0
- package/dist/components/Modal/styles.module.css +1 -0
- package/dist/components/Modal/styles.module.sass.js +24 -0
- package/dist/components/NumberInput.d.ts +50 -0
- package/dist/components/NumberInput.js +60 -0
- package/dist/components/Qrcode.d.ts +18 -0
- package/dist/components/Qrcode.js +30 -0
- package/dist/components/Radio/index.d.ts +17 -0
- package/dist/components/Radio/index.js +34 -0
- package/dist/components/Range.css +1 -0
- package/dist/components/Range.vue.js +7 -0
- package/dist/components/Range.vue2.js +54 -0
- package/dist/components/ScrollText/index.d.ts +6 -0
- package/dist/components/ScrollText/index.js +48 -0
- package/dist/components/ScrollText/styles.module.css +1 -0
- package/dist/components/ScrollText/styles.module.sass.js +11 -0
- package/dist/components/Section/index.d.ts +12 -0
- package/dist/components/Section/index.js +35 -0
- package/dist/components/Select/index.d.ts +42 -0
- package/dist/components/Select/index.js +71 -0
- package/dist/components/Select/style.module.css +1 -0
- package/dist/components/Select/style.module.sass.js +33 -0
- package/dist/components/SubNaviBar/WhateverNaviBar.d.ts +21 -0
- package/dist/components/SubNaviBar/WhateverNaviBar.js +34 -0
- package/dist/components/TextInput/index.d.ts +45 -0
- package/dist/components/TextInput/index.js +106 -0
- package/dist/components/TextInput/style.module.css +1 -0
- package/dist/components/TextInput/style.module.sass.js +17 -0
- package/dist/components/TransitionOpacity.d.ts +15 -0
- package/dist/components/TransitionOpacity.js +26 -0
- package/dist/components/TransitionVertical.vue.js +97 -0
- package/dist/components/TransitionVertical.vue2.js +4 -0
- package/dist/components/WarningBackground/index.d.ts +14 -0
- package/dist/components/WarningBackground/index.js +22 -0
- package/dist/components/WarningBackground/index.module.css +1 -0
- package/dist/components/WarningBackground/index.module.sass.js +9 -0
- package/dist/components/Window/index.d.ts +89 -0
- package/dist/components/Window/index.js +169 -0
- package/dist/components/Window/styles.module.css +1 -0
- package/dist/components/Window/styles.module.sass.js +51 -0
- package/dist/controllers/toastController.d.ts +17 -0
- package/dist/controllers/toastController.js +13 -0
- package/dist/i18n/index.d.ts +26 -0
- package/dist/i18n/index.js +17 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +86 -0
- package/dist/states/modal.d.ts +31 -0
- package/dist/states/modal.js +16 -0
- package/dist/themes/aquadx/components.module.css +1 -0
- package/dist/themes/aquadx/components.module.scss.js +31 -0
- package/dist/themes/aquadx/index.d.ts +6 -0
- package/dist/themes/aquadx/index.js +10 -0
- package/dist/themes/aquadx/vars.d.ts +5 -0
- package/dist/themes/aquadx/vars.js +7 -0
- package/dist/themes/base/composer.d.ts +19 -0
- package/dist/themes/base/composer.js +19 -0
- package/dist/themes/base/types.d.ts +21 -0
- package/dist/themes/dynamicLight/components.module.css +1 -0
- package/dist/themes/dynamicLight/components.module.scss.js +33 -0
- package/dist/themes/dynamicLight/index.d.ts +6 -0
- package/dist/themes/dynamicLight/index.js +10 -0
- package/dist/themes/dynamicLight/vars.d.ts +5 -0
- package/dist/themes/dynamicLight/vars.js +7 -0
- package/dist/themes/global.module.css +1 -0
- package/dist/themes/global.module.sass.js +4 -0
- package/dist/themes/index.d.ts +30 -0
- package/dist/themes/index.js +82 -0
- package/dist/utils/animation.d.ts +1 -0
- package/dist/utils/animation.js +4 -0
- package/package.json +51 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ref as n, defineComponent as c, createVNode as a, Fragment as u, TransitionGroup as d, isVNode as m } from "vue";
|
|
2
|
+
import f from "../Modal/index.js";
|
|
3
|
+
import s from "./TaskManager.module.sass.js";
|
|
4
|
+
import { getUIString as i } from "../../i18n/index.js";
|
|
5
|
+
function p(t) {
|
|
6
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !m(t);
|
|
7
|
+
}
|
|
8
|
+
const o = {
|
|
9
|
+
tasks: n([]),
|
|
10
|
+
showErrorModal: n(!1),
|
|
11
|
+
currentError: n(null),
|
|
12
|
+
async register(t, r) {
|
|
13
|
+
const e = {
|
|
14
|
+
id: Symbol(),
|
|
15
|
+
name: t,
|
|
16
|
+
promise: r,
|
|
17
|
+
startTime: Date.now(),
|
|
18
|
+
status: "pending"
|
|
19
|
+
};
|
|
20
|
+
e.showTimer = window.setTimeout(() => {
|
|
21
|
+
o.tasks.value.push(e);
|
|
22
|
+
}, 1e3);
|
|
23
|
+
try {
|
|
24
|
+
await r, e.showTimer && (clearTimeout(e.showTimer), e.showTimer = void 0), e.status = "success";
|
|
25
|
+
} catch (l) {
|
|
26
|
+
e.showTimer && (clearTimeout(e.showTimer), e.showTimer = void 0), e.status = "error", e.error = l, o.currentError.value = l, console.error(l);
|
|
27
|
+
} finally {
|
|
28
|
+
o.removeTask(e.id);
|
|
29
|
+
}
|
|
30
|
+
return await r;
|
|
31
|
+
},
|
|
32
|
+
removeTask(t) {
|
|
33
|
+
const r = o.tasks.value.findIndex((e) => e.id === t);
|
|
34
|
+
r !== -1 && o.tasks.value.splice(r, 1);
|
|
35
|
+
}
|
|
36
|
+
}, k = /* @__PURE__ */ c({
|
|
37
|
+
setup() {
|
|
38
|
+
return () => {
|
|
39
|
+
let t;
|
|
40
|
+
return a(u, null, [a("div", {
|
|
41
|
+
class: "fixed left-4 bottom-4 z-50"
|
|
42
|
+
}, [a(d, {
|
|
43
|
+
enterActiveClass: s.active,
|
|
44
|
+
leaveActiveClass: s.active,
|
|
45
|
+
enterFromClass: s.from,
|
|
46
|
+
leaveToClass: s.from,
|
|
47
|
+
tag: "div",
|
|
48
|
+
class: "flex flex-col gap-2"
|
|
49
|
+
}, p(t = o.tasks.value.map((r) => a("div", {
|
|
50
|
+
key: r.id,
|
|
51
|
+
class: ["bg-taskManager backdrop-blur-sm rounded-lg p-3", "flex items-center gap-2 min-w-48", "shadow-lg"]
|
|
52
|
+
}, [a("div", {
|
|
53
|
+
class: "animate-spin"
|
|
54
|
+
}, [a("svg", {
|
|
55
|
+
class: "w-5 h-5 c-taskManager-spin",
|
|
56
|
+
viewBox: "0 0 24 24"
|
|
57
|
+
}, [a("circle", {
|
|
58
|
+
class: "opacity-25",
|
|
59
|
+
cx: "12",
|
|
60
|
+
cy: "12",
|
|
61
|
+
r: "10",
|
|
62
|
+
stroke: "currentColor",
|
|
63
|
+
"stroke-width": "4",
|
|
64
|
+
fill: "none"
|
|
65
|
+
}, null), a("path", {
|
|
66
|
+
class: "opacity-75",
|
|
67
|
+
fill: "currentColor",
|
|
68
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
69
|
+
}, null)])]), a("span", {
|
|
70
|
+
class: "c-taskManager-text text-sm"
|
|
71
|
+
}, [typeof r.name == "string" ? r.name : r.name.value])]))) ? t : {
|
|
72
|
+
default: () => [t]
|
|
73
|
+
})]), a(f, {
|
|
74
|
+
title: i("taskFailed"),
|
|
75
|
+
width: "400px",
|
|
76
|
+
show: o.showErrorModal.value,
|
|
77
|
+
"onUpdate:show": (r) => o.showErrorModal.value = r
|
|
78
|
+
}, {
|
|
79
|
+
default: () => o.currentError.value?.message || i("unknownError"),
|
|
80
|
+
actions: () => a("button", {
|
|
81
|
+
onClick: () => o.showErrorModal.value = !1
|
|
82
|
+
}, [i("confirm")])
|
|
83
|
+
})]);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
k as default,
|
|
89
|
+
o as taskManager
|
|
90
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.TaskManager-module_zMB-i{transition:all .3s ease}.TaskManager-module_I0T2k{opacity:0;transform:translate(-30px)}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ToastInternal } from '../../controllers/toastController';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
toast: {
|
|
5
|
+
type: PropType<ToastInternal>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
toast: {
|
|
10
|
+
type: PropType<ToastInternal>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineComponent as p, ref as i, onMounted as g, computed as r, createVNode as s } from "vue";
|
|
2
|
+
import { toasts as u } from "../../controllers/toastController.js";
|
|
3
|
+
import { useNow as b, whenever as f, useTimeout as h } from "@vueuse/core";
|
|
4
|
+
const n = 3e3, y = {
|
|
5
|
+
info: "bg-blue-600",
|
|
6
|
+
success: "bg-green-600",
|
|
7
|
+
warning: "bg-yellow-600",
|
|
8
|
+
error: "bg-red-600"
|
|
9
|
+
}, C = /* @__PURE__ */ p({
|
|
10
|
+
props: {
|
|
11
|
+
toast: {
|
|
12
|
+
type: Object,
|
|
13
|
+
required: !0
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
setup(e, {
|
|
17
|
+
emit: T
|
|
18
|
+
}) {
|
|
19
|
+
const t = b(), o = i(0);
|
|
20
|
+
g(() => o.value = t.value.getTime());
|
|
21
|
+
const m = r(() => n - (t.value.getTime() - o.value)), c = r(() => ({
|
|
22
|
+
width: `${m.value / n * 100}%`
|
|
23
|
+
})), a = i("h-3.5em opacity-100"), l = () => {
|
|
24
|
+
a.value = "h-3em opacity-100", setTimeout(() => a.value = "h-0 m-t-0! opacity-0!", 500), setTimeout(() => u.value = u.value.filter((d) => d.rand !== e.toast.rand), 1e3);
|
|
25
|
+
};
|
|
26
|
+
f(() => t.value.getTime() - o.value >= n - 200, l);
|
|
27
|
+
const v = h(1100);
|
|
28
|
+
return () => s("div", {
|
|
29
|
+
onClick: l,
|
|
30
|
+
class: ["rd-12px relative bg-toast-bar of-hidden transition-all-500 hover:op-70 m-t-4", !v.value && "animate__animated animate__bounceInUp", a.value]
|
|
31
|
+
}, [s("div", {
|
|
32
|
+
class: "relative rd-12px z-1002 h-3em bg-toast p-x-10 flex items-center"
|
|
33
|
+
}, [e.toast.message]), s("div", {
|
|
34
|
+
class: ["absolute z-1001 h-1em bottom-0 left-0", y[e.toast.type]],
|
|
35
|
+
style: c.value
|
|
36
|
+
}, null)]);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
C as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineComponent as a, computed as r, createVNode as t } from "vue";
|
|
2
|
+
import { toasts as l } from "../../controllers/toastController.js";
|
|
3
|
+
import m from "./Toast.js";
|
|
4
|
+
const u = /* @__PURE__ */ a({
|
|
5
|
+
// props: {
|
|
6
|
+
// },
|
|
7
|
+
setup(p, {
|
|
8
|
+
emit: i
|
|
9
|
+
}) {
|
|
10
|
+
const o = r(() => l.value.slice(0, 5));
|
|
11
|
+
return () => t("div", {
|
|
12
|
+
class: "flex flex-col-reverse absolute bottom-18 left-0 right-0 items-center"
|
|
13
|
+
}, [o.value.map((e, s) => t(m, {
|
|
14
|
+
toast: e,
|
|
15
|
+
key: e.rand,
|
|
16
|
+
style: {
|
|
17
|
+
zIndex: 100 + s
|
|
18
|
+
}
|
|
19
|
+
}, null))]);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
u as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function showTransactionalDialog<T>(title: string, message: string, actions?: {
|
|
2
|
+
text: string;
|
|
3
|
+
action: T;
|
|
4
|
+
danger?: boolean;
|
|
5
|
+
}[], warning?: boolean): Promise<T>;
|
|
6
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ref as t, defineComponent as p, createVNode as o } from "vue";
|
|
2
|
+
import w from "../Modal/index.js";
|
|
3
|
+
import { getUIString as d } from "../../i18n/index.js";
|
|
4
|
+
const a = t(!1), n = t(""), s = t(!1), u = t(""), c = t([]);
|
|
5
|
+
let f = () => {
|
|
6
|
+
};
|
|
7
|
+
function b(l, r, e, i = !1) {
|
|
8
|
+
return e = e || [{
|
|
9
|
+
text: d("confirm"),
|
|
10
|
+
action: Symbol()
|
|
11
|
+
}], n.value = l, u.value = r, c.value = e, s.value = i, a.value = !0, new Promise((v) => {
|
|
12
|
+
f = (m) => {
|
|
13
|
+
a.value = !1, v(m);
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const k = /* @__PURE__ */ p({
|
|
18
|
+
// props: {
|
|
19
|
+
// },
|
|
20
|
+
setup(l, {
|
|
21
|
+
emit: r
|
|
22
|
+
}) {
|
|
23
|
+
return () => o(w, {
|
|
24
|
+
title: n.value,
|
|
25
|
+
show: a.value,
|
|
26
|
+
"onUpdate:show": (e) => a.value = e,
|
|
27
|
+
width: "40em",
|
|
28
|
+
esc: !1,
|
|
29
|
+
warn: s.value
|
|
30
|
+
}, {
|
|
31
|
+
default: () => o("div", {
|
|
32
|
+
class: "flex gap-2 flex-col ws-pre-wrap"
|
|
33
|
+
}, [u.value]),
|
|
34
|
+
actions: () => c.value.map((e) => o("button", {
|
|
35
|
+
class: ["w-0 grow", e.danger && "bg-dialogButton-error"],
|
|
36
|
+
key: e.text,
|
|
37
|
+
onClick: () => f(e.action)
|
|
38
|
+
}, [e.text]))
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
k as default,
|
|
44
|
+
b as showTransactionalDialog
|
|
45
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineComponent as o, createVNode as l, Fragment as r } from "vue";
|
|
2
|
+
import n from "./ForegroundTask.js";
|
|
3
|
+
import t from "./TransactionalDialog.js";
|
|
4
|
+
import e from "./ToastsDisplay.js";
|
|
5
|
+
import a from "./TaskManager.js";
|
|
6
|
+
import { theme as m } from "../../themes/index.js";
|
|
7
|
+
const c = /* @__PURE__ */ o({
|
|
8
|
+
// props: {
|
|
9
|
+
// },
|
|
10
|
+
setup() {
|
|
11
|
+
return () => l(r, null, [l(e, null, null), l(a, null, null), l(n, null, null), l(t, null, null), l("div", {
|
|
12
|
+
class: m.value.root
|
|
13
|
+
}, null)]);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
c as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { modalShowing } from '../../states/modal';
|
|
3
|
+
export { modalShowing };
|
|
4
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
title: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
show: BooleanConstructor;
|
|
10
|
+
onUpdateShow: PropType<(v: boolean) => void>;
|
|
11
|
+
esc: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
width: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
warn: BooleanConstructor;
|
|
20
|
+
innerClass: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
actionDelay: {
|
|
25
|
+
type: NumberConstructor;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
title: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
show: BooleanConstructor;
|
|
34
|
+
onUpdateShow: PropType<(v: boolean) => void>;
|
|
35
|
+
esc: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
39
|
+
width: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
warn: BooleanConstructor;
|
|
44
|
+
innerClass: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
actionDelay: {
|
|
49
|
+
type: NumberConstructor;
|
|
50
|
+
default: number;
|
|
51
|
+
};
|
|
52
|
+
}>> & Readonly<{}>, {
|
|
53
|
+
width: string;
|
|
54
|
+
show: boolean;
|
|
55
|
+
warn: boolean;
|
|
56
|
+
esc: boolean;
|
|
57
|
+
innerClass: string;
|
|
58
|
+
actionDelay: number;
|
|
59
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
60
|
+
export default _default;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { defineComponent as y, ref as v, computed as r, watch as f, onBeforeUnmount as w, inject as h, createVNode as e, Teleport as C, Transition as b } from "vue";
|
|
2
|
+
import { useMagicKeys as I, whenever as M } from "@vueuse/core";
|
|
3
|
+
import { registerModal as S, unregisterModal as m, getModalIndex as B, isTopModal as D } from "../../states/modal.js";
|
|
4
|
+
import { modalShowing as K } from "../../states/modal.js";
|
|
5
|
+
import l from "./styles.module.sass.js";
|
|
6
|
+
import T from "../WarningBackground/index.js";
|
|
7
|
+
const N = /* @__PURE__ */ y({
|
|
8
|
+
props: {
|
|
9
|
+
title: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: !0
|
|
12
|
+
},
|
|
13
|
+
show: Boolean,
|
|
14
|
+
onUpdateShow: Function,
|
|
15
|
+
esc: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !0
|
|
18
|
+
},
|
|
19
|
+
width: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "auto"
|
|
22
|
+
},
|
|
23
|
+
warn: Boolean,
|
|
24
|
+
innerClass: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
actionDelay: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 0
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
setup(a, {
|
|
34
|
+
emit: g,
|
|
35
|
+
slots: i,
|
|
36
|
+
expose: j
|
|
37
|
+
}) {
|
|
38
|
+
const t = v(null), n = r({
|
|
39
|
+
get: () => a.show,
|
|
40
|
+
set(o) {
|
|
41
|
+
a.onUpdateShow?.(o), g("update:show", o);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
f(() => n.value, (o) => {
|
|
45
|
+
o && !t.value ? t.value = S() : !o && t.value && (m(t.value), t.value = null);
|
|
46
|
+
}, {
|
|
47
|
+
immediate: !0
|
|
48
|
+
}), w(() => {
|
|
49
|
+
t.value && (m(t.value), t.value = null);
|
|
50
|
+
});
|
|
51
|
+
const u = r(() => t.value ? 58 + B(t.value) * 3 : 58), d = () => {
|
|
52
|
+
n.value && (t.value && !D(t.value) || a.esc && (console.log("esc"), n.value = !1));
|
|
53
|
+
}, {
|
|
54
|
+
escape: x
|
|
55
|
+
} = I();
|
|
56
|
+
M(() => x.value, d);
|
|
57
|
+
const p = h("modalPosition", "absolute left-0 right-0 bottom-0 top-0"), s = v(!1);
|
|
58
|
+
f(() => n.value, (o) => {
|
|
59
|
+
if (!o) {
|
|
60
|
+
s.value = !0;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
s.value = !1, setTimeout(() => {
|
|
64
|
+
s.value = !0;
|
|
65
|
+
}, a.actionDelay + 500);
|
|
66
|
+
}, {
|
|
67
|
+
immediate: !0
|
|
68
|
+
});
|
|
69
|
+
const c = r(() => s.value ? 0 : a.actionDelay);
|
|
70
|
+
return () => e(C, {
|
|
71
|
+
to: "#app"
|
|
72
|
+
}, {
|
|
73
|
+
default: () => [e(b, {
|
|
74
|
+
duration: 500 + c.value,
|
|
75
|
+
enterFromClass: l.src,
|
|
76
|
+
leaveToClass: l.src,
|
|
77
|
+
enterActiveClass: [l.progress, l.in].join(" "),
|
|
78
|
+
leaveActiveClass: [l.progress, l.out].join(" ")
|
|
79
|
+
}, {
|
|
80
|
+
default: () => [n.value && e("div", {
|
|
81
|
+
class: "mnui-modal-root",
|
|
82
|
+
style: {
|
|
83
|
+
"--action-delay": c.value + "ms"
|
|
84
|
+
}
|
|
85
|
+
}, [e("div", {
|
|
86
|
+
class: l.backdrop,
|
|
87
|
+
style: {
|
|
88
|
+
zIndex: u.value
|
|
89
|
+
},
|
|
90
|
+
onClick: d
|
|
91
|
+
}, null), e("div", {
|
|
92
|
+
class: p
|
|
93
|
+
}, [e("div", {
|
|
94
|
+
class: ["absolute left-50% top-50% translate--50%", a.esc && l.modalOut],
|
|
95
|
+
style: {
|
|
96
|
+
zIndex: u.value + 1
|
|
97
|
+
}
|
|
98
|
+
}, [e("div", {
|
|
99
|
+
class: ["bg-modal rd-2xl p-6 flex flex-col max-w-90dvw", l.modal, a.innerClass],
|
|
100
|
+
style: {
|
|
101
|
+
width: a.width,
|
|
102
|
+
zIndex: u.value + 2
|
|
103
|
+
}
|
|
104
|
+
}, [a.warn && (i.warning?.() || e(T, {
|
|
105
|
+
class: "absolute top-0 left-0 right-0 h-12 rd-t-2xl"
|
|
106
|
+
}, null)), e("div", {
|
|
107
|
+
class: "flex flex-col gap-4"
|
|
108
|
+
}, [e("div", {
|
|
109
|
+
class: ["text-1.5em flex items-center justify-center"]
|
|
110
|
+
}, [e("div", {
|
|
111
|
+
class: [l.title]
|
|
112
|
+
}, [a.title])]), e("div", {
|
|
113
|
+
class: [l.content]
|
|
114
|
+
}, [i.default?.()])]), e("div", {
|
|
115
|
+
class: [l.actions, "flex gap-4"]
|
|
116
|
+
}, [i.actions?.()])])])])])]
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
export {
|
|
122
|
+
N as default,
|
|
123
|
+
K as modalShowing
|
|
124
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.styles-module_V6c3K .styles-module_SPoWc{transition:opacity .2s ease-in-out}.styles-module_V6c3K .styles-module_9yJVO,.styles-module_V6c3K .styles-module_z-4El,.styles-module_V6c3K .styles-module_BDqZB{transition:transform .2s ease-in-out,opacity .2s ease-in-out}.styles-module_V6c3K .styles-module_-u-sF{transition:transform .2s ease-in-out,opacity .1s ease-in-out}.styles-module_SPoWc,.styles-module_BDqZB,.styles-module_-u-sF,.styles-module_9yJVO,.styles-module_z-4El{will-change:transform,opacity}.styles-module_EU7pm .styles-module_-u-sF{transition-delay:.1s}.styles-module_EU7pm .styles-module_9yJVO{transition-delay:.2s}.styles-module_EU7pm .styles-module_z-4El{transition-delay:calc(var(--action-delay) + .3s)}.styles-module_p72rf .styles-module_-u-sF{transition-delay:.06s}.styles-module_p72rf .styles-module_9yJVO{transition-delay:.03s}.styles-module_SPoWc{background-color:var(--modal-backdrop-bg);opacity:.9;position:absolute;inset:0}.styles-module_SPoWc:hover~.styles-module_bkaWt{opacity:.9}.styles-module_bkaWt{transition:opacity .2s}.styles-module_BDqZB{opacity:1;transform-origin:center}.styles-module_z-4El{transform:translateY(100%)}.styles-module_z-4El button{flex-grow:1;background-color:var(--modal-button-bg)!important;opacity:1!important}.styles-module_z-4El button:not(:disabled):hover{transform:translateY(-5%)}.styles-module_z-4El button:not(:disabled,.bg-dialogButton-error):hover{background-color:var(--modal-button-hover-bg)!important}.styles-module_z-4El button:not(:disabled,.bg-dialogButton-error):active{background-color:var(--modal-button-active-bg)!important}.styles-module_-u-sF{position:relative;transform:translateY(-.3em)}.styles-module_-u-sF:after{content:"";position:absolute;left:0;right:0;bottom:-.15em;height:.15em;background:var(--modal-title-handle-bg);border-radius:9999px}.styles-module_9am0c .styles-module_SPoWc,.styles-module_9am0c .styles-module_BDqZB,.styles-module_9am0c .styles-module_-u-sF,.styles-module_9am0c .styles-module_9yJVO,.styles-module_9am0c .styles-module_z-4El{opacity:0;transform:scale(1.1)}.styles-module_9am0c .styles-module_-u-sF{transform:translateY(-1em)}.styles-module_9am0c .styles-module_9yJVO{transform:translateY(2em)}.styles-module_9am0c .styles-module_z-4El{transform:translateY(200%)}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const s = "styles-module_V6c3K", t = "styles-module_SPoWc", o = "styles-module_9yJVO", e = "styles-module_z-4El", l = "styles-module_BDqZB", c = "styles-module_-u-sF", d = "styles-module_p72rf", n = "styles-module_bkaWt", m = "styles-module_9am0c", u = {
|
|
2
|
+
progress: s,
|
|
3
|
+
backdrop: t,
|
|
4
|
+
content: o,
|
|
5
|
+
actions: e,
|
|
6
|
+
modal: l,
|
|
7
|
+
title: c,
|
|
8
|
+
in: "styles-module_EU7pm",
|
|
9
|
+
out: d,
|
|
10
|
+
modalOut: n,
|
|
11
|
+
src: m
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
e as actions,
|
|
15
|
+
t as backdrop,
|
|
16
|
+
o as content,
|
|
17
|
+
u as default,
|
|
18
|
+
l as modal,
|
|
19
|
+
n as modalOut,
|
|
20
|
+
d as out,
|
|
21
|
+
s as progress,
|
|
22
|
+
m as src,
|
|
23
|
+
c as title
|
|
24
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
min: {
|
|
3
|
+
type: NumberConstructor;
|
|
4
|
+
default: number;
|
|
5
|
+
};
|
|
6
|
+
max: {
|
|
7
|
+
type: NumberConstructor;
|
|
8
|
+
default: number;
|
|
9
|
+
};
|
|
10
|
+
step: {
|
|
11
|
+
type: NumberConstructor;
|
|
12
|
+
default: number;
|
|
13
|
+
};
|
|
14
|
+
decimal: {
|
|
15
|
+
type: NumberConstructor;
|
|
16
|
+
default: number;
|
|
17
|
+
};
|
|
18
|
+
value: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
default: number;
|
|
21
|
+
};
|
|
22
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
min: {
|
|
24
|
+
type: NumberConstructor;
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
max: {
|
|
28
|
+
type: NumberConstructor;
|
|
29
|
+
default: number;
|
|
30
|
+
};
|
|
31
|
+
step: {
|
|
32
|
+
type: NumberConstructor;
|
|
33
|
+
default: number;
|
|
34
|
+
};
|
|
35
|
+
decimal: {
|
|
36
|
+
type: NumberConstructor;
|
|
37
|
+
default: number;
|
|
38
|
+
};
|
|
39
|
+
value: {
|
|
40
|
+
type: NumberConstructor;
|
|
41
|
+
default: number;
|
|
42
|
+
};
|
|
43
|
+
}>> & Readonly<{}>, {
|
|
44
|
+
value: number;
|
|
45
|
+
step: number;
|
|
46
|
+
min: number;
|
|
47
|
+
max: number;
|
|
48
|
+
decimal: number;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineComponent as o, ref as f, computed as d, shallowRef as i, watch as s, createVNode as p } from "vue";
|
|
2
|
+
import { useVModel as c } from "@vueuse/core";
|
|
3
|
+
import v from "./TextInput/index.js";
|
|
4
|
+
import * as y from "lodash-es";
|
|
5
|
+
const h = /* @__PURE__ */ o({
|
|
6
|
+
props: {
|
|
7
|
+
min: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: -1 / 0
|
|
10
|
+
},
|
|
11
|
+
max: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 1 / 0
|
|
14
|
+
},
|
|
15
|
+
step: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 1
|
|
18
|
+
},
|
|
19
|
+
decimal: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0
|
|
22
|
+
},
|
|
23
|
+
value: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 0
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
setup(e, {
|
|
29
|
+
emit: m
|
|
30
|
+
}) {
|
|
31
|
+
const l = c(e, "value", m), u = f(""), r = d({
|
|
32
|
+
get: () => u.value,
|
|
33
|
+
set: (t) => {
|
|
34
|
+
u.value = t, l.value = y.clamp(Number(t), e.min, e.max);
|
|
35
|
+
}
|
|
36
|
+
}), a = () => {
|
|
37
|
+
u.value = l.value.toFixed(e.decimal);
|
|
38
|
+
}, n = i();
|
|
39
|
+
return s(() => e.value, () => {
|
|
40
|
+
if (n?.value?.focused) {
|
|
41
|
+
console.log("focused, not refresh");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
a();
|
|
45
|
+
}, {
|
|
46
|
+
immediate: !0
|
|
47
|
+
}), () => p(v, {
|
|
48
|
+
ref: n,
|
|
49
|
+
value: r.value,
|
|
50
|
+
"onUpdate:value": (t) => r.value = t,
|
|
51
|
+
type: "number",
|
|
52
|
+
step: e.step,
|
|
53
|
+
onBlur: a,
|
|
54
|
+
onEnterPressed: a
|
|
55
|
+
}, null);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
h as default
|
|
60
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
value: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
color: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
};
|
|
9
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
+
value: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
color: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
};
|
|
17
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent as e, createVNode as o } from "vue";
|
|
2
|
+
import t from "@chenfengyuan/vue-qrcode";
|
|
3
|
+
import { currentThemeVars as l } from "../themes/index.js";
|
|
4
|
+
const c = /* @__PURE__ */ e({
|
|
5
|
+
props: {
|
|
6
|
+
value: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: !0
|
|
9
|
+
},
|
|
10
|
+
color: {
|
|
11
|
+
type: String
|
|
12
|
+
}
|
|
13
|
+
// 可选:自定义颜色
|
|
14
|
+
},
|
|
15
|
+
setup(r) {
|
|
16
|
+
return () => o(t, {
|
|
17
|
+
tag: "svg",
|
|
18
|
+
value: r.value,
|
|
19
|
+
options: {
|
|
20
|
+
color: {
|
|
21
|
+
light: "#00000000",
|
|
22
|
+
dark: r.color || l.value.qrcodeColor
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, null);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
c as default
|
|
30
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
onClick: PropType<() => any>;
|
|
4
|
+
value: (SymbolConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
5
|
+
k: {
|
|
6
|
+
type: (SymbolConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
+
onClick: PropType<() => any>;
|
|
11
|
+
value: (SymbolConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
12
|
+
k: {
|
|
13
|
+
type: (SymbolConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
export default _default;
|