hys-ui 0.1.0 → 0.1.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/CHANGELOG.md +26 -1
- package/README.md +16 -6
- package/dist/components/HysAlert/HysAlert.vue.js +14 -14
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
- package/dist/components/HysBadge/HysBadge.vue.js +1 -1
- package/dist/components/HysBadge/HysBadge2.vue.js +20 -19
- package/dist/components/HysCalendar/HysCalendar.vue.js +48 -40
- package/dist/components/HysCard/HysCard.vue.js +2 -2
- package/dist/components/HysCard/HysCard2.vue.js +9 -9
- package/dist/components/HysCascader/HysCascader.vue.js +88 -76
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +5 -39
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +85 -2
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +22 -22
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +55 -54
- package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
- package/dist/components/HysFileManager/HysFileManager2.vue.js +85 -2
- package/dist/components/HysForm/HysForm.vue.js +2 -2
- package/dist/components/HysForm/HysForm2.vue.js +66 -64
- package/dist/components/HysFormItem/HysFormItem.vue.js +53 -37
- package/dist/components/HysGantt/HysGantt.vue.js +5 -264
- package/dist/components/HysGantt/HysGantt2.vue.js +302 -2
- package/dist/components/HysInput/HysInput.vue.js +1 -1
- package/dist/components/HysInput/HysInput2.vue.js +42 -41
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +35 -35
- package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +49 -40
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +34 -32
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +91 -91
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +100 -2
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +5 -40
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +80 -2
- package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +86 -67
- package/dist/components/HysSearch/HysSearch.vue.js +49 -38
- package/dist/components/HysSegmented/HysSegmented.vue.js +39 -34
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +130 -109
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +40 -40
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +48 -42
- package/dist/components/HysSteps/HysSteps.vue.js +2 -2
- package/dist/components/HysSteps/HysSteps2.vue.js +15 -14
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +38 -27
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +42 -38
- package/dist/components/HysTabs/HysTabs.vue.js +1 -1
- package/dist/components/HysTabs/HysTabs2.vue.js +8 -6
- package/dist/components/HysTextarea/HysTextarea.vue.js +58 -48
- package/dist/components/HysToast/HysToast.vue.js +2 -2
- package/dist/components/HysToast/HysToast2.vue.js +121 -38
- package/dist/components/HysTour/HysTour.vue.js +47 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +159 -143
- package/dist/components/HysTree/HysTree.vue.js +2 -2
- package/dist/components/HysTree/HysTree2.vue.js +62 -61
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +64 -57
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +95 -77
- package/dist/composables/formContext.js +9 -3
- package/dist/composables/toastEscape.js +16 -0
- package/dist/composables/useDialog.js +16 -16
- package/dist/composables/useFloating.js +40 -40
- package/dist/composables/useHysToast.js +148 -0
- package/dist/config.js +18 -15
- package/dist/index.js +10 -7
- package/dist/style.css +1 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +2 -0
- package/dist/types/components/HysCard/HysCard.vue.d.ts +5 -1
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +21 -4
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +6 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +6 -0
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -0
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +3 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +40 -17
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +7 -1
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -0
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +1 -1
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +1 -1
- package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
- package/dist/types/components/HysTour/HysTour.vue.d.ts +3 -1
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +11 -1
- package/dist/types/composables/formContext.d.ts +5 -0
- package/dist/types/composables/toastEscape.d.ts +1 -0
- package/dist/types/composables/useFloating.d.ts +1 -1
- package/dist/types/composables/useHysToast.d.ts +50 -0
- package/dist/types/index.d.ts +5 -0
- package/package.json +46 -11
|
@@ -1,57 +1,140 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as X, useAttrs as j, useSlots as q, ref as d, computed as h, watch as N, onDeactivated as G, onActivated as J, nextTick as K, onBeforeUnmount as Q, openBlock as i, createBlock as H, Teleport as Y, createVNode as O, Transition as Z, withCtx as _, createElementBlock as m, mergeProps as ee, unref as x, renderSlot as A, resolveDynamicComponent as te, normalizeClass as ae, createCommentVNode as v, createElementVNode as oe, createTextVNode as se, toDisplayString as V } from "vue";
|
|
2
|
+
import { LoaderCircle as le, TriangleAlert as ne, Info as ie, CircleAlert as ue, CircleCheck as re, X as fe } from "lucide-vue-next";
|
|
3
|
+
import { useHysRootAttrs as ce } from "../../config.js";
|
|
4
|
+
import { registerToastEscape as de } from "../../composables/toastEscape.js";
|
|
5
|
+
const me = ["role", "aria-live"], ve = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "hys-ui-toast-icon",
|
|
8
|
+
"aria-hidden": "true"
|
|
9
|
+
}, ye = { class: "hys-ui-toast-message" }, pe = ["aria-label"], he = {
|
|
10
|
+
key: 2,
|
|
11
|
+
class: "hys-ui-toast-action"
|
|
12
|
+
}, ke = /* @__PURE__ */ X({
|
|
13
|
+
inheritAttrs: !1,
|
|
5
14
|
__name: "HysToast",
|
|
6
15
|
props: {
|
|
7
|
-
message: {},
|
|
16
|
+
message: { default: "" },
|
|
8
17
|
type: { default: "success" },
|
|
9
|
-
duration: {
|
|
18
|
+
duration: {},
|
|
10
19
|
closable: { type: Boolean, default: !0 },
|
|
11
|
-
position: { default: "
|
|
20
|
+
position: { default: "top-center" },
|
|
21
|
+
offset: { default: 24 },
|
|
22
|
+
zIndex: { default: 2e3 },
|
|
23
|
+
showIcon: { type: Boolean, default: !0 },
|
|
24
|
+
pauseOnHover: { type: Boolean, default: !0 },
|
|
25
|
+
closeOnEscape: { type: Boolean },
|
|
26
|
+
repeat: { default: 1 },
|
|
27
|
+
plain: { type: Boolean },
|
|
28
|
+
teleport: { type: Boolean, default: !0 },
|
|
29
|
+
appendTo: { default: "body" }
|
|
12
30
|
},
|
|
13
|
-
emits: ["close"],
|
|
14
|
-
setup(e, { emit:
|
|
15
|
-
const
|
|
16
|
-
let l;
|
|
17
|
-
function
|
|
18
|
-
clearTimeout(
|
|
31
|
+
emits: ["close", "afterClose"],
|
|
32
|
+
setup(e, { expose: F, emit: S }) {
|
|
33
|
+
const a = e, w = S, E = j(), $ = q(), L = ce(), b = d(), u = d(!0), o = d(!1), C = d(!1), T = d(!1), R = h(() => a.position === "top" ? "top-center" : a.position === "bottom" ? "bottom-center" : a.position), g = h(() => Math.max(0, Number.isFinite(a.duration ?? 3e3) ? a.duration ?? (a.type === "loading" ? 0 : 3e3) : 0)), P = h(() => !!a.message || !!$.default), U = h(() => ({ success: re, error: ue, info: ie, warning: ne, loading: le })[a.type]);
|
|
34
|
+
let y, l, f = 0, z = 0, k = !1, I = !0;
|
|
35
|
+
function D() {
|
|
36
|
+
clearTimeout(y), y = void 0;
|
|
19
37
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
38
|
+
function r() {
|
|
39
|
+
y && (f = Math.max(0, f - (Date.now() - z))), D();
|
|
22
40
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
function c() {
|
|
42
|
+
if (D(), !(!u.value || !o.value || C.value || T.value || g.value <= 0)) {
|
|
43
|
+
if (f <= 0) {
|
|
44
|
+
n();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
z = Date.now(), y = setTimeout(n, f);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function B() {
|
|
51
|
+
f = g.value, c();
|
|
52
|
+
}
|
|
53
|
+
function n() {
|
|
54
|
+
o.value && (r(), o.value = !1, k || (k = !0, w("close")));
|
|
55
|
+
}
|
|
56
|
+
function W() {
|
|
57
|
+
!o.value && u.value && w("afterClose");
|
|
58
|
+
}
|
|
59
|
+
return N(() => [a.message, g.value, a.repeat], (s, t) => {
|
|
60
|
+
s[0] || !t && $.default ? (o.value = !0, k = !1, B()) : !P.value || t != null && t[0] ? n() : o.value && B();
|
|
61
|
+
}, { immediate: !0 }), N(() => o.value && u.value && a.closeOnEscape, (s) => {
|
|
62
|
+
l == null || l(), l = s ? de(n) : void 0;
|
|
63
|
+
}, { immediate: !0 }), G(() => {
|
|
64
|
+
u.value = !1, r();
|
|
65
|
+
}), J(() => {
|
|
66
|
+
u.value = !0, K(() => I && c());
|
|
67
|
+
}), Q(() => {
|
|
68
|
+
I = !1, r(), l == null || l();
|
|
69
|
+
}), F({ close: n, pause: r, resume: c, restart: B, element: b }), (s, t) => (i(), H(Y, {
|
|
70
|
+
to: e.appendTo,
|
|
71
|
+
disabled: !e.teleport
|
|
72
|
+
}, [
|
|
73
|
+
O(Z, {
|
|
74
|
+
name: "hys-ui-toast-motion",
|
|
75
|
+
appear: "",
|
|
76
|
+
onAfterLeave: W
|
|
77
|
+
}, {
|
|
78
|
+
default: _(() => [
|
|
79
|
+
o.value && u.value ? (i(), m("div", ee({
|
|
80
|
+
key: 0,
|
|
81
|
+
ref_key: "element",
|
|
82
|
+
ref: b
|
|
83
|
+
}, { ...x(L), ...x(E) }, {
|
|
84
|
+
class: ["hys-ui-toast", ["hys-ui-toast-" + e.type, "hys-ui-toast-position-" + R.value, { "hys-ui-toast-inline": !e.teleport, "hys-ui-toast-plain": e.plain }]],
|
|
85
|
+
style: { "--hys-ui-toast-offset": Math.max(0, e.offset) + "px", zIndex: e.zIndex },
|
|
32
86
|
role: e.type === "error" ? "alert" : "status",
|
|
33
|
-
|
|
34
|
-
|
|
87
|
+
"aria-live": e.type === "error" ? "assertive" : "polite",
|
|
88
|
+
"aria-atomic": "true",
|
|
89
|
+
onMouseenter: t[0] || (t[0] = (p) => e.pauseOnHover && (C.value = !0, r())),
|
|
90
|
+
onMouseleave: t[1] || (t[1] = (p) => {
|
|
91
|
+
C.value = !1, c();
|
|
92
|
+
}),
|
|
93
|
+
onFocusin: t[2] || (t[2] = (p) => {
|
|
94
|
+
T.value = !0, r();
|
|
95
|
+
}),
|
|
96
|
+
onFocusout: t[3] || (t[3] = (p) => {
|
|
97
|
+
var M;
|
|
98
|
+
return !((M = b.value) != null && M.contains(p.relatedTarget)) && (T.value = !1, c());
|
|
99
|
+
})
|
|
35
100
|
}), [
|
|
36
|
-
|
|
37
|
-
(
|
|
101
|
+
e.showIcon ? (i(), m("span", ve, [
|
|
102
|
+
A(s.$slots, "icon", {}, () => [
|
|
103
|
+
(i(), H(te(U.value), {
|
|
104
|
+
size: 18,
|
|
105
|
+
class: ae({ "hys-ui-toast-spinner": e.type === "loading" })
|
|
106
|
+
}, null, 8, ["class"]))
|
|
107
|
+
], !0)
|
|
108
|
+
])) : v("", !0),
|
|
109
|
+
oe("div", ye, [
|
|
110
|
+
A(s.$slots, "default", {}, () => [
|
|
111
|
+
se(V(e.message), 1)
|
|
112
|
+
], !0)
|
|
38
113
|
]),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
114
|
+
e.repeat > 1 ? (i(), m("span", {
|
|
115
|
+
key: 1,
|
|
116
|
+
class: "hys-ui-toast-repeat",
|
|
117
|
+
"aria-label": "重复 " + e.repeat + " 次"
|
|
118
|
+
}, "×" + V(e.repeat), 9, pe)) : v("", !0),
|
|
119
|
+
s.$slots.action ? (i(), m("span", he, [
|
|
120
|
+
A(s.$slots, "action", { close: n }, void 0, !0)
|
|
121
|
+
])) : v("", !0),
|
|
122
|
+
e.closable ? (i(), m("button", {
|
|
123
|
+
key: 3,
|
|
124
|
+
class: "hys-ui-toast-close",
|
|
42
125
|
type: "button",
|
|
43
126
|
"aria-label": "关闭提示",
|
|
44
|
-
onClick:
|
|
127
|
+
onClick: n
|
|
45
128
|
}, [
|
|
46
|
-
|
|
47
|
-
])) :
|
|
48
|
-
], 16,
|
|
129
|
+
O(x(fe), { size: 14 })
|
|
130
|
+
])) : v("", !0)
|
|
131
|
+
], 16, me)) : v("", !0)
|
|
49
132
|
]),
|
|
50
|
-
_:
|
|
133
|
+
_: 3
|
|
51
134
|
})
|
|
52
|
-
]));
|
|
135
|
+
], 8, ["to", "disabled"]));
|
|
53
136
|
}
|
|
54
137
|
});
|
|
55
138
|
export {
|
|
56
|
-
|
|
139
|
+
ke as default
|
|
57
140
|
};
|
|
@@ -1,74 +1,79 @@
|
|
|
1
|
-
import { defineComponent as C, useModel as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as C, useModel as V, ref as B, watch as f, openBlock as N, createBlock as b, withCtx as s, createElementVNode as x, toDisplayString as i, createVNode as m, createTextVNode as p, mergeModels as M } from "vue";
|
|
2
|
+
import E from "../HysModal/HysModal.vue.js";
|
|
3
|
+
import v from "../HysButton/HysButton.vue.js";
|
|
4
|
+
const T = /* @__PURE__ */ C({
|
|
5
5
|
__name: "HysTour",
|
|
6
|
-
props: /* @__PURE__ */
|
|
6
|
+
props: /* @__PURE__ */ M({
|
|
7
7
|
steps: {},
|
|
8
8
|
current: {},
|
|
9
|
-
closeOnEscape: { type: Boolean }
|
|
9
|
+
closeOnEscape: { type: Boolean, default: !0 }
|
|
10
10
|
}, {
|
|
11
11
|
modelValue: { type: Boolean, default: !1 },
|
|
12
12
|
modelModifiers: {}
|
|
13
13
|
}),
|
|
14
|
-
emits: /* @__PURE__ */
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
14
|
+
emits: /* @__PURE__ */ M(["finish", "close", "change", "update:current"], ["update:modelValue"]),
|
|
15
|
+
setup(l, { emit: y }) {
|
|
16
|
+
const n = l, r = V(l, "modelValue"), u = y, e = B(o(n.current ?? 0));
|
|
17
|
+
function o(t) {
|
|
18
|
+
return Math.max(0, Math.min(Math.max(0, n.steps.length - 1), Number.isFinite(t) ? Math.floor(t) : 0));
|
|
19
|
+
}
|
|
20
|
+
f(() => n.current, (t) => {
|
|
21
|
+
t !== void 0 && (e.value = o(t));
|
|
22
|
+
}), f(r, (t) => {
|
|
23
|
+
t && (e.value = o(n.current ?? 0));
|
|
24
|
+
}), f(() => n.steps.length, () => {
|
|
25
|
+
e.value = o(e.value);
|
|
21
26
|
});
|
|
22
|
-
function
|
|
23
|
-
e.value =
|
|
27
|
+
function h(t) {
|
|
28
|
+
e.value = o(t), u("change", e.value), u("update:current", e.value);
|
|
24
29
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
30
|
+
function c() {
|
|
31
|
+
r.value = !1, u("close");
|
|
27
32
|
}
|
|
28
33
|
function k() {
|
|
29
|
-
e.value >=
|
|
34
|
+
e.value >= n.steps.length - 1 ? (u("finish"), c()) : h(e.value + 1);
|
|
30
35
|
}
|
|
31
|
-
return (
|
|
32
|
-
var
|
|
33
|
-
return
|
|
34
|
-
open:
|
|
35
|
-
title: ((
|
|
36
|
-
"close-on-escape":
|
|
36
|
+
return (t, a) => {
|
|
37
|
+
var g;
|
|
38
|
+
return N(), b(E, {
|
|
39
|
+
open: r.value,
|
|
40
|
+
title: ((g = l.steps[e.value]) == null ? void 0 : g.title) || "引导",
|
|
41
|
+
"close-on-escape": l.closeOnEscape !== !1,
|
|
37
42
|
"close-on-mask": !1,
|
|
38
|
-
onClose:
|
|
43
|
+
onClose: c
|
|
39
44
|
}, {
|
|
40
|
-
footer:
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
footer: s(() => [
|
|
46
|
+
x("span", null, i(l.steps.length ? e.value + 1 : 0) + " / " + i(l.steps.length), 1),
|
|
47
|
+
m(v, {
|
|
43
48
|
variant: "ghost",
|
|
44
|
-
onClick:
|
|
49
|
+
onClick: c
|
|
45
50
|
}, {
|
|
46
|
-
default:
|
|
47
|
-
|
|
51
|
+
default: s(() => [...a[1] || (a[1] = [
|
|
52
|
+
p("跳过", -1)
|
|
48
53
|
])]),
|
|
49
54
|
_: 1
|
|
50
55
|
}),
|
|
51
|
-
|
|
56
|
+
m(v, {
|
|
52
57
|
variant: "secondary",
|
|
53
58
|
disabled: e.value === 0,
|
|
54
|
-
onClick:
|
|
59
|
+
onClick: a[0] || (a[0] = (d) => h(e.value - 1))
|
|
55
60
|
}, {
|
|
56
|
-
default:
|
|
57
|
-
|
|
61
|
+
default: s(() => [...a[2] || (a[2] = [
|
|
62
|
+
p("上一步", -1)
|
|
58
63
|
])]),
|
|
59
64
|
_: 1
|
|
60
65
|
}, 8, ["disabled"]),
|
|
61
|
-
|
|
62
|
-
default:
|
|
63
|
-
|
|
66
|
+
m(v, { onClick: k }, {
|
|
67
|
+
default: s(() => [
|
|
68
|
+
p(i(e.value >= l.steps.length - 1 ? "完成" : "下一步"), 1)
|
|
64
69
|
]),
|
|
65
70
|
_: 1
|
|
66
71
|
})
|
|
67
72
|
]),
|
|
68
|
-
default:
|
|
69
|
-
var
|
|
73
|
+
default: s(() => {
|
|
74
|
+
var d;
|
|
70
75
|
return [
|
|
71
|
-
|
|
76
|
+
x("p", null, i(((d = l.steps[e.value]) == null ? void 0 : d.description) || "暂无引导步骤"), 1)
|
|
72
77
|
];
|
|
73
78
|
}),
|
|
74
79
|
_: 1
|
|
@@ -77,5 +82,5 @@ const O = /* @__PURE__ */ C({
|
|
|
77
82
|
}
|
|
78
83
|
});
|
|
79
84
|
export {
|
|
80
|
-
|
|
85
|
+
T as default
|
|
81
86
|
};
|