@munet/ui 1.0.0 → 1.0.1
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/components/Button/index.d.ts +7 -0
- package/dist/components/Button/index.js +29 -12
- package/dist/components/DateFormat.d.ts +2 -2
- package/dist/components/DropMenu/DropDown.d.ts +10 -1
- package/dist/components/DropMenu/DropDown.js +52 -44
- package/dist/components/DropMenu/index.d.ts +19 -1
- package/dist/components/DropMenu/index.js +26 -15
- package/dist/components/NumberInput.d.ts +3 -0
- package/dist/components/NumberInput.js +19 -17
- package/dist/components/Popover/index.d.ts +25 -0
- package/dist/components/Popover/index.js +76 -0
- package/dist/components/Progress/index.d.ts +33 -0
- package/dist/components/Progress/index.js +35 -0
- package/dist/components/Range.css +1 -1
- package/dist/components/Range.vue.js +1 -1
- package/dist/components/Range.vue2.js +30 -24
- package/dist/components/Select/index.js +56 -37
- package/dist/components/Select/style.module.css +1 -1
- package/dist/components/Select/style.module.sass.js +5 -7
- package/dist/components/Tabs/index.d.ts +37 -0
- package/dist/components/Tabs/index.js +75 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +66 -59
- package/dist/themes/aquadx/components.module.css +1 -1
- package/dist/themes/aquadx/components.module.scss.js +30 -22
- package/dist/themes/dynamicLight/components.module.css +1 -1
- package/dist/themes/dynamicLight/components.module.scss.js +37 -27
- package/dist/themes/global.module.css +1 -1
- package/package.json +1 -1
|
@@ -4,13 +4,20 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
4
4
|
onContextmenu: PropType<() => any>;
|
|
5
5
|
disabled: BooleanConstructor;
|
|
6
6
|
ing: BooleanConstructor;
|
|
7
|
+
variant: PropType<"primary" | "secondary" | "ghost">;
|
|
8
|
+
danger: BooleanConstructor;
|
|
9
|
+
size: PropType<"small" | "medium">;
|
|
7
10
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
8
11
|
onClick: PropType<() => any>;
|
|
9
12
|
onContextmenu: PropType<() => any>;
|
|
10
13
|
disabled: BooleanConstructor;
|
|
11
14
|
ing: BooleanConstructor;
|
|
15
|
+
variant: PropType<"primary" | "secondary" | "ghost">;
|
|
16
|
+
danger: BooleanConstructor;
|
|
17
|
+
size: PropType<"small" | "medium">;
|
|
12
18
|
}>> & Readonly<{}>, {
|
|
13
19
|
disabled: boolean;
|
|
14
20
|
ing: boolean;
|
|
21
|
+
danger: boolean;
|
|
15
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
23
|
export default _default;
|
|
@@ -1,29 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { theme as
|
|
1
|
+
import { defineComponent as a, createVNode as t } from "vue";
|
|
2
|
+
import { theme as r } from "../../themes/index.js";
|
|
3
3
|
import l from "./LoadingBackground/index.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ a({
|
|
5
5
|
props: {
|
|
6
6
|
onClick: Function,
|
|
7
7
|
onContextmenu: Function,
|
|
8
8
|
disabled: Boolean,
|
|
9
|
-
ing: Boolean
|
|
9
|
+
ing: Boolean,
|
|
10
|
+
variant: String,
|
|
11
|
+
danger: Boolean,
|
|
12
|
+
size: String
|
|
10
13
|
},
|
|
11
14
|
setup(e, {
|
|
12
|
-
emit:
|
|
13
|
-
slots:
|
|
15
|
+
emit: u,
|
|
16
|
+
slots: n
|
|
14
17
|
}) {
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
const i = () => {
|
|
19
|
+
if (e.danger)
|
|
20
|
+
return "text-red-4 hover:bg-red-4/10!";
|
|
21
|
+
switch (e.variant) {
|
|
22
|
+
// case 'primary':
|
|
23
|
+
// return 'bg-[var(--link-color)]! border-[var(--link-color)]! text-white!';
|
|
24
|
+
// case 'secondary':
|
|
25
|
+
// return 'bg-transparent! border-[var(--link-color)]! text-[var(--link-color)]!';
|
|
26
|
+
// case 'ghost':
|
|
27
|
+
// return 'bg-transparent! border-transparent! text-[var(--link-color)]! hover:bg-[var(--link-color)]/12! active:bg-[var(--link-color)]/18!';
|
|
28
|
+
default:
|
|
29
|
+
return "";
|
|
30
|
+
}
|
|
31
|
+
}, o = () => e.size === "small" ? "h-8 text-sm px-2" : e.size === "medium" ? "h-10 text-base px-4" : "";
|
|
32
|
+
return () => t("button", {
|
|
33
|
+
class: ["relative of-hidden", i(), o()],
|
|
17
34
|
disabled: e.disabled || e.ing,
|
|
18
35
|
onClick: e.onClick,
|
|
19
36
|
onContextmenu: e.onContextmenu
|
|
20
|
-
}, [
|
|
37
|
+
}, [t("div", {
|
|
21
38
|
class: "z-2 inline-flex items-center justify-center"
|
|
22
|
-
}, [
|
|
23
|
-
class: ["absolute bottom-0 left-0 right-0 top-25% z-1",
|
|
39
|
+
}, [n.default?.()]), e.ing && t(l, {
|
|
40
|
+
class: ["absolute bottom-0 left-0 right-0 top-25% z-1", r.value.loadingBackground]
|
|
24
41
|
}, null)]);
|
|
25
42
|
}
|
|
26
43
|
});
|
|
27
44
|
export {
|
|
28
|
-
|
|
45
|
+
c as default
|
|
29
46
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
2
|
value: {
|
|
3
|
-
type: (
|
|
3
|
+
type: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
4
4
|
required: true;
|
|
5
5
|
};
|
|
6
6
|
format: {
|
|
@@ -9,7 +9,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
9
9
|
};
|
|
10
10
|
}>, () => string, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
11
|
value: {
|
|
12
|
-
type: (
|
|
12
|
+
type: (StringConstructor | DateConstructor | NumberConstructor)[];
|
|
13
13
|
required: true;
|
|
14
14
|
};
|
|
15
15
|
format: {
|
|
@@ -19,6 +19,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
19
19
|
type: NumberConstructor;
|
|
20
20
|
default: number;
|
|
21
21
|
};
|
|
22
|
+
align: {
|
|
23
|
+
type: PropType<"center" | "left" | "right">;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
22
26
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
27
|
innerClass: (StringConstructor | ArrayConstructor)[];
|
|
24
28
|
innerStyle: PropType<CSSProperties>;
|
|
@@ -39,11 +43,16 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
39
43
|
type: NumberConstructor;
|
|
40
44
|
default: number;
|
|
41
45
|
};
|
|
46
|
+
align: {
|
|
47
|
+
type: PropType<"center" | "left" | "right">;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
42
50
|
}>> & Readonly<{}>, {
|
|
43
51
|
gap: number;
|
|
52
|
+
maxHeight: number;
|
|
44
53
|
buttonIng: boolean;
|
|
45
54
|
buttonText: string;
|
|
46
55
|
autoPosition: boolean;
|
|
47
|
-
|
|
56
|
+
align: "right" | "left" | "center";
|
|
48
57
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
49
58
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { onClickOutside as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as b, ref as l, onBeforeUnmount as x, createVNode as o, Fragment as y, Teleport as h } from "vue";
|
|
2
|
+
import { onClickOutside as S } from "@vueuse/core";
|
|
3
|
+
import B from "../TransitionVertical.vue.js";
|
|
4
|
+
import C from "../Button/index.js";
|
|
5
|
+
const z = /* @__PURE__ */ b({
|
|
6
6
|
props: {
|
|
7
7
|
innerClass: [String, Array],
|
|
8
8
|
innerStyle: [Object, String],
|
|
@@ -22,56 +22,64 @@ const H = /* @__PURE__ */ p({
|
|
|
22
22
|
maxHeight: {
|
|
23
23
|
type: Number,
|
|
24
24
|
default: 200
|
|
25
|
+
},
|
|
26
|
+
align: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "center"
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
|
-
setup(
|
|
28
|
-
emit:
|
|
29
|
-
slots:
|
|
30
|
-
expose:
|
|
31
|
+
setup(t, {
|
|
32
|
+
emit: $,
|
|
33
|
+
slots: s,
|
|
34
|
+
expose: p
|
|
31
35
|
}) {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (!o.autoPosition || !i.value) return;
|
|
36
|
-
const t = i.value.getBoundingClientRect(), c = window.innerHeight - t.bottom, d = t.top;
|
|
37
|
-
c < o.maxHeight && d > c ? r.value = "top" : r.value = "bottom";
|
|
38
|
-
}, u = (t) => {
|
|
39
|
-
const e = typeof t == "boolean" ? t : !n.value;
|
|
40
|
-
e && m(), n.value = e;
|
|
41
|
-
};
|
|
42
|
-
f({
|
|
43
|
-
setShow: (t) => {
|
|
44
|
-
u(t);
|
|
45
|
-
}
|
|
36
|
+
const i = l(!1), a = l(null), d = l(null), g = l("bottom"), c = l({});
|
|
37
|
+
S(a, (e) => i.value = !1, {
|
|
38
|
+
ignore: [d]
|
|
46
39
|
});
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
position: "absolute",
|
|
40
|
+
const m = () => {
|
|
41
|
+
if (!t.autoPosition || !a.value) return;
|
|
42
|
+
const e = a.value.getBoundingClientRect(), r = window.innerHeight, v = r - e.bottom, w = e.top, n = {
|
|
43
|
+
position: "fixed",
|
|
52
44
|
zIndex: 100
|
|
53
45
|
};
|
|
54
|
-
|
|
55
|
-
...t,
|
|
56
|
-
...
|
|
46
|
+
t.align === "right" ? n.right = `${window.innerWidth - e.right}px` : t.align === "left" ? n.left = `${e.left}px` : (n.left = `${e.left + e.width / 2}px`, n.transform = "translateX(-50%)"), v < t.maxHeight && w > v ? (g.value = "top", n.bottom = `${r - e.top + t.gap}px`, n.transformOrigin = "bottom center") : (g.value = "bottom", n.top = `${e.bottom + t.gap}px`, n.transformOrigin = "top center"), c.value = {
|
|
47
|
+
...t.innerStyle || {},
|
|
48
|
+
...n
|
|
57
49
|
};
|
|
58
|
-
})
|
|
59
|
-
|
|
50
|
+
}, f = (e) => {
|
|
51
|
+
const r = typeof e == "boolean" ? e : !i.value;
|
|
52
|
+
r && m(), i.value = r;
|
|
53
|
+
}, u = () => {
|
|
54
|
+
i.value && m();
|
|
55
|
+
};
|
|
56
|
+
return window.addEventListener("resize", u), window.addEventListener("scroll", u, !0), x(() => {
|
|
57
|
+
window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0);
|
|
58
|
+
}), p({
|
|
59
|
+
setShow: (e) => {
|
|
60
|
+
f(e);
|
|
61
|
+
}
|
|
62
|
+
}), () => o(y, null, [o("div", {
|
|
60
63
|
class: "relative",
|
|
61
|
-
ref:
|
|
62
|
-
}, [
|
|
63
|
-
ing:
|
|
64
|
-
onClick: () =>
|
|
64
|
+
ref: a
|
|
65
|
+
}, [s.trigger ? s.trigger(f) : o(C, {
|
|
66
|
+
ing: t.buttonIng,
|
|
67
|
+
onClick: () => f()
|
|
68
|
+
}, {
|
|
69
|
+
default: () => [t.buttonText]
|
|
70
|
+
})]), o(h, {
|
|
71
|
+
to: "body"
|
|
65
72
|
}, {
|
|
66
|
-
default: () => [o
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
default: () => [o(B, null, {
|
|
74
|
+
default: () => [i.value && o("div", {
|
|
75
|
+
ref: d,
|
|
76
|
+
class: t.innerClass,
|
|
77
|
+
style: c.value
|
|
78
|
+
}, [s.default?.()])]
|
|
79
|
+
})]
|
|
72
80
|
})]);
|
|
73
81
|
}
|
|
74
82
|
});
|
|
75
83
|
export {
|
|
76
|
-
|
|
84
|
+
z as default
|
|
77
85
|
};
|
|
@@ -12,6 +12,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
12
12
|
options: {
|
|
13
13
|
type: PropType<{
|
|
14
14
|
label: string;
|
|
15
|
+
desc?: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
disabled?: boolean;
|
|
15
18
|
action: () => any;
|
|
16
19
|
}[]>;
|
|
17
20
|
default: () => never[];
|
|
@@ -20,6 +23,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
20
23
|
type: PropType<string>;
|
|
21
24
|
default: string;
|
|
22
25
|
};
|
|
26
|
+
align: {
|
|
27
|
+
type: PropType<"center" | "left" | "right">;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
23
30
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
31
|
buttonText: {
|
|
25
32
|
type: PropType<string>;
|
|
@@ -33,6 +40,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
33
40
|
options: {
|
|
34
41
|
type: PropType<{
|
|
35
42
|
label: string;
|
|
43
|
+
desc?: string;
|
|
44
|
+
icon?: string;
|
|
45
|
+
disabled?: boolean;
|
|
36
46
|
action: () => any;
|
|
37
47
|
}[]>;
|
|
38
48
|
default: () => never[];
|
|
@@ -41,14 +51,22 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
41
51
|
type: PropType<string>;
|
|
42
52
|
default: string;
|
|
43
53
|
};
|
|
54
|
+
align: {
|
|
55
|
+
type: PropType<"center" | "left" | "right">;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
44
58
|
}>> & Readonly<{}>, {
|
|
45
59
|
width: string;
|
|
46
60
|
innerClass: string;
|
|
47
61
|
options: {
|
|
48
62
|
label: string;
|
|
63
|
+
desc?: string;
|
|
64
|
+
icon?: string;
|
|
65
|
+
disabled?: boolean;
|
|
49
66
|
action: () => any;
|
|
50
67
|
}[];
|
|
51
|
-
buttonText: string;
|
|
52
68
|
row: boolean;
|
|
69
|
+
buttonText: string;
|
|
70
|
+
align: "right" | "left" | "center";
|
|
53
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
54
72
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as s, ref as d, createVNode as l } from "vue";
|
|
2
|
+
import i from "./DropDown.js";
|
|
3
|
+
const c = /* @__PURE__ */ s({
|
|
4
4
|
props: {
|
|
5
5
|
buttonText: {
|
|
6
6
|
type: String,
|
|
@@ -18,31 +18,42 @@ const s = /* @__PURE__ */ a({
|
|
|
18
18
|
innerClass: {
|
|
19
19
|
type: String,
|
|
20
20
|
default: ""
|
|
21
|
+
},
|
|
22
|
+
align: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "center"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
setup(t, {
|
|
24
|
-
slots:
|
|
28
|
+
slots: a
|
|
25
29
|
}) {
|
|
26
|
-
const
|
|
27
|
-
return () =>
|
|
30
|
+
const n = d();
|
|
31
|
+
return () => l(i, {
|
|
28
32
|
buttonText: t.buttonText,
|
|
29
33
|
innerStyle: {
|
|
30
34
|
width: t.width
|
|
31
35
|
},
|
|
32
|
-
ref:
|
|
33
|
-
|
|
36
|
+
ref: n,
|
|
37
|
+
align: t.align,
|
|
38
|
+
innerClass: ["bg-dropMenu rounded-lg p-2 flex gap-2 backdrop-blur-8", !t.row && "flex-col", t.innerClass]
|
|
34
39
|
}, {
|
|
35
|
-
default: () => t.options.map((
|
|
36
|
-
key:
|
|
37
|
-
class: "w-full min-w-max flex items-center
|
|
40
|
+
default: () => t.options.map((e, r) => l("div", {
|
|
41
|
+
key: r,
|
|
42
|
+
class: ["w-full min-w-max flex items-center px-4 py-2 rounded-lg bg-avatarMenuButton transition-colors gap-2", e.disabled && "op-50 cursor-not-allowed"],
|
|
38
43
|
onClick: () => {
|
|
39
|
-
e.value?.setShow(!1),
|
|
44
|
+
e.disabled || (n.value?.setShow(!1), e.action());
|
|
40
45
|
}
|
|
41
|
-
}, [
|
|
42
|
-
|
|
46
|
+
}, [e.icon && l("span", {
|
|
47
|
+
class: [e.icon, "text-lg shrink-0"]
|
|
48
|
+
}, null), l("div", {
|
|
49
|
+
class: "flex flex-col"
|
|
50
|
+
}, [l("span", null, [e.label]), e.desc && l("span", {
|
|
51
|
+
class: "text-xs op-60"
|
|
52
|
+
}, [e.desc])])])),
|
|
53
|
+
trigger: a.trigger
|
|
43
54
|
});
|
|
44
55
|
}
|
|
45
56
|
});
|
|
46
57
|
export {
|
|
47
|
-
|
|
58
|
+
c as default
|
|
48
59
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
1
2
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
3
|
min: {
|
|
3
4
|
type: NumberConstructor;
|
|
@@ -19,6 +20,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
19
20
|
type: NumberConstructor;
|
|
20
21
|
default: number;
|
|
21
22
|
};
|
|
23
|
+
onFocus: PropType<() => void>;
|
|
22
24
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
25
|
min: {
|
|
24
26
|
type: NumberConstructor;
|
|
@@ -40,6 +42,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
40
42
|
type: NumberConstructor;
|
|
41
43
|
default: number;
|
|
42
44
|
};
|
|
45
|
+
onFocus: PropType<() => void>;
|
|
43
46
|
}>> & Readonly<{}>, {
|
|
44
47
|
value: number;
|
|
45
48
|
step: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useVModel as
|
|
1
|
+
import { defineComponent as m, ref as f, computed as s, shallowRef as i, watch as c, createVNode as d } from "vue";
|
|
2
|
+
import { useVModel as p } from "@vueuse/core";
|
|
3
3
|
import v from "./TextInput/index.js";
|
|
4
4
|
import * as y from "lodash-es";
|
|
5
|
-
const
|
|
5
|
+
const F = /* @__PURE__ */ m({
|
|
6
6
|
props: {
|
|
7
7
|
min: {
|
|
8
8
|
type: Number,
|
|
@@ -23,38 +23,40 @@ const h = /* @__PURE__ */ o({
|
|
|
23
23
|
value: {
|
|
24
24
|
type: Number,
|
|
25
25
|
default: 0
|
|
26
|
-
}
|
|
26
|
+
},
|
|
27
|
+
onFocus: Function
|
|
27
28
|
},
|
|
28
29
|
setup(e, {
|
|
29
|
-
emit:
|
|
30
|
+
emit: r
|
|
30
31
|
}) {
|
|
31
|
-
const
|
|
32
|
+
const n = p(e, "value", r), u = f(""), o = s({
|
|
32
33
|
get: () => u.value,
|
|
33
34
|
set: (t) => {
|
|
34
|
-
u.value = t,
|
|
35
|
+
u.value = t, n.value = y.clamp(Number(t), e.min, e.max);
|
|
35
36
|
}
|
|
36
37
|
}), a = () => {
|
|
37
|
-
u.value =
|
|
38
|
-
},
|
|
39
|
-
return
|
|
40
|
-
if (
|
|
38
|
+
u.value = n.value.toFixed(e.decimal);
|
|
39
|
+
}, l = i();
|
|
40
|
+
return c(() => e.value, () => {
|
|
41
|
+
if (l?.value?.focused) {
|
|
41
42
|
console.log("focused, not refresh");
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
45
|
a();
|
|
45
46
|
}, {
|
|
46
47
|
immediate: !0
|
|
47
|
-
}), () =>
|
|
48
|
-
ref:
|
|
49
|
-
value:
|
|
50
|
-
"onUpdate:value": (t) =>
|
|
48
|
+
}), () => d(v, {
|
|
49
|
+
ref: l,
|
|
50
|
+
value: o.value,
|
|
51
|
+
"onUpdate:value": (t) => o.value = t,
|
|
51
52
|
type: "number",
|
|
52
53
|
step: e.step,
|
|
53
54
|
onBlur: a,
|
|
54
|
-
onEnterPressed: a
|
|
55
|
+
onEnterPressed: a,
|
|
56
|
+
onFocus: e.onFocus
|
|
55
57
|
}, null);
|
|
56
58
|
}
|
|
57
59
|
});
|
|
58
60
|
export {
|
|
59
|
-
|
|
61
|
+
F as default
|
|
60
62
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
type TriggerType = 'hover' | 'click';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
trigger: {
|
|
5
|
+
type: PropType<TriggerType>;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
offset: {
|
|
9
|
+
type: NumberConstructor;
|
|
10
|
+
default: number;
|
|
11
|
+
};
|
|
12
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
trigger: {
|
|
14
|
+
type: PropType<TriggerType>;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
offset: {
|
|
18
|
+
type: NumberConstructor;
|
|
19
|
+
default: number;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {
|
|
22
|
+
trigger: TriggerType;
|
|
23
|
+
offset: number;
|
|
24
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineComponent as R, ref as o, computed as y, onBeforeUnmount as B, createVNode as r, Fragment as H, Teleport as z, nextTick as W } from "vue";
|
|
2
|
+
import N from "../TransitionOpacity.js";
|
|
3
|
+
const $ = /* @__PURE__ */ R({
|
|
4
|
+
props: {
|
|
5
|
+
trigger: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: "hover"
|
|
8
|
+
},
|
|
9
|
+
offset: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 8
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(i, {
|
|
15
|
+
slots: g
|
|
16
|
+
}) {
|
|
17
|
+
const t = o(!1), m = o("bottom"), d = o(0), p = o(0), a = o(null), u = o(null), s = o(null), c = y(() => i.trigger === "hover"), l = () => {
|
|
18
|
+
s.value !== null && (window.clearTimeout(s.value), s.value = null);
|
|
19
|
+
}, f = () => {
|
|
20
|
+
if (!a.value || !u.value) return;
|
|
21
|
+
const n = a.value.getBoundingClientRect(), e = u.value.getBoundingClientRect(), b = window.innerHeight, L = window.innerWidth, k = b - n.bottom, C = n.top;
|
|
22
|
+
k < e.height + i.offset && C > k ? (m.value = "top", d.value = Math.max(8, n.top - e.height - i.offset)) : (m.value = "bottom", d.value = Math.min(b - e.height - 8, n.bottom + i.offset));
|
|
23
|
+
const E = n.left + (n.width - e.width) / 2;
|
|
24
|
+
p.value = Math.min(Math.max(8, E), Math.max(8, L - e.width - 8));
|
|
25
|
+
}, w = () => {
|
|
26
|
+
if (l(), t.value) {
|
|
27
|
+
f();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
t.value = !0, W(() => {
|
|
31
|
+
f();
|
|
32
|
+
});
|
|
33
|
+
}, h = () => {
|
|
34
|
+
l(), t.value = !1;
|
|
35
|
+
}, x = () => {
|
|
36
|
+
l(), s.value = window.setTimeout(() => {
|
|
37
|
+
t.value = !1;
|
|
38
|
+
}, 120);
|
|
39
|
+
}, T = () => {
|
|
40
|
+
t.value ? h() : w();
|
|
41
|
+
}, v = () => {
|
|
42
|
+
t.value && f();
|
|
43
|
+
}, M = (n) => {
|
|
44
|
+
if (i.trigger !== "click" || !t.value) return;
|
|
45
|
+
const e = n.target;
|
|
46
|
+
e && (a.value?.contains(e) || u.value?.contains(e) || h());
|
|
47
|
+
};
|
|
48
|
+
return window.addEventListener("resize", v), window.addEventListener("scroll", v, !0), document.addEventListener("click", M, !0), B(() => {
|
|
49
|
+
l(), window.removeEventListener("resize", v), window.removeEventListener("scroll", v, !0), document.removeEventListener("click", M, !0);
|
|
50
|
+
}), () => r(H, null, [r("div", {
|
|
51
|
+
ref: a,
|
|
52
|
+
class: "inline-flex",
|
|
53
|
+
onMouseenter: () => c.value && w(),
|
|
54
|
+
onMouseleave: () => c.value && x(),
|
|
55
|
+
onClick: () => i.trigger === "click" && T()
|
|
56
|
+
}, [g.trigger?.()]), r(z, {
|
|
57
|
+
to: "#app"
|
|
58
|
+
}, {
|
|
59
|
+
default: () => [r(N, null, {
|
|
60
|
+
default: () => [t.value && r("div", {
|
|
61
|
+
ref: u,
|
|
62
|
+
class: "fixed z-80 max-w-90vw rd-2 bg-dropMenu p-2 text-sm backdrop-blur-8",
|
|
63
|
+
style: {
|
|
64
|
+
top: `${d.value}px`,
|
|
65
|
+
left: `${p.value}px`
|
|
66
|
+
},
|
|
67
|
+
onMouseenter: () => c.value && l(),
|
|
68
|
+
onMouseleave: () => c.value && x()
|
|
69
|
+
}, [g.default?.()])]
|
|
70
|
+
})]
|
|
71
|
+
})]);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
$ as default
|
|
76
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const Progress: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
percentage: {
|
|
4
|
+
type: NumberConstructor;
|
|
5
|
+
default: number;
|
|
6
|
+
};
|
|
7
|
+
status: {
|
|
8
|
+
type: PropType<"default" | "success" | "error">;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
showIndicator: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
percentage: {
|
|
17
|
+
type: NumberConstructor;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
status: {
|
|
21
|
+
type: PropType<"default" | "success" | "error">;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
showIndicator: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
}>> & Readonly<{}>, {
|
|
29
|
+
status: "success" | "error" | "default";
|
|
30
|
+
percentage: number;
|
|
31
|
+
showIndicator: boolean;
|
|
32
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
export default Progress;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent as s, computed as r, createVNode as t, createTextVNode as u } from "vue";
|
|
2
|
+
const d = /* @__PURE__ */ s({
|
|
3
|
+
props: {
|
|
4
|
+
percentage: {
|
|
5
|
+
type: Number,
|
|
6
|
+
default: 0
|
|
7
|
+
},
|
|
8
|
+
status: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "default"
|
|
11
|
+
},
|
|
12
|
+
showIndicator: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !1
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(e) {
|
|
18
|
+
const l = r(() => e.status === "success" ? "bg-green-500" : e.status === "error" ? "bg-red-500" : "bg-blue-500"), a = r(() => Math.min(100, Math.max(0, e.percentage)));
|
|
19
|
+
return () => t("div", {
|
|
20
|
+
class: "flex items-center gap-2 w-full"
|
|
21
|
+
}, [t("div", {
|
|
22
|
+
class: "flex-1 h-2 bg-gray-200 rounded-full overflow-hidden"
|
|
23
|
+
}, [t("div", {
|
|
24
|
+
class: [l.value, "h-full rounded-full"],
|
|
25
|
+
style: {
|
|
26
|
+
width: `${a.value}%`
|
|
27
|
+
}
|
|
28
|
+
}, null)]), e.showIndicator && t("span", {
|
|
29
|
+
class: "text-sm text-gray-600 min-w-10 text-right"
|
|
30
|
+
}, [a.value, u("%")])]);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
d as default
|
|
35
|
+
};
|