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,25 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as h, openBlock as s, createElementBlock as c, mergeProps as k, unref as n, Fragment as l, renderList as b, normalizeClass as f, createElementVNode as u, createBlock as i, createTextVNode as m, toDisplayString as a, createCommentVNode as g } from "vue";
|
|
2
2
|
import { useHysRootAttrs as v } from "../../config.js";
|
|
3
3
|
import { Check as C, CircleAlert as B } from "lucide-vue-next";
|
|
4
|
-
const
|
|
4
|
+
const z = ["aria-current"], A = ["disabled", "onClick"], N = { key: 1 }, V = { key: 2 }, w = /* @__PURE__ */ h({
|
|
5
5
|
__name: "HysSteps",
|
|
6
6
|
props: {
|
|
7
7
|
items: {},
|
|
8
8
|
current: {},
|
|
9
9
|
vertical: { type: Boolean },
|
|
10
10
|
clickable: { type: Boolean },
|
|
11
|
+
disabled: { type: Boolean },
|
|
11
12
|
status: {}
|
|
12
13
|
},
|
|
13
14
|
emits: ["update:current", "change"],
|
|
14
15
|
setup(e, { emit: y }) {
|
|
15
|
-
const
|
|
16
|
-
return (
|
|
16
|
+
const d = v(), o = y;
|
|
17
|
+
return (j, E) => (s(), c("ol", k(n(d), {
|
|
17
18
|
class: ["hys-ui-ex-steps", { "hys-ui-steps-vertical": e.vertical }],
|
|
18
19
|
"aria-label": "流程进度"
|
|
19
20
|
}), [
|
|
20
|
-
(s(!0), c(l, null,
|
|
21
|
+
(s(!0), c(l, null, b(e.items, (t, r) => (s(), c("li", {
|
|
21
22
|
key: r,
|
|
22
|
-
class:
|
|
23
|
+
class: f({ "hys-ui-done": r < e.current, "hys-ui-active": r === e.current && e.status !== "wait", "hys-ui-step-error": r === e.current && e.status === "error" }),
|
|
23
24
|
"aria-current": r === e.current ? "step" : void 0
|
|
24
25
|
}, [
|
|
25
26
|
u("span", null, [
|
|
@@ -30,24 +31,24 @@ const p = ["aria-current"], z = ["disabled", "onClick"], A = { key: 1 }, N = { k
|
|
|
30
31
|
key: 1,
|
|
31
32
|
size: 14
|
|
32
33
|
})) : (s(), c(l, { key: 2 }, [
|
|
33
|
-
|
|
34
|
+
m(a(r + 1), 1)
|
|
34
35
|
], 64))
|
|
35
36
|
]),
|
|
36
37
|
u("div", null, [
|
|
37
38
|
e.clickable ? (s(), c("button", {
|
|
38
39
|
key: 0,
|
|
39
40
|
type: "button",
|
|
40
|
-
disabled: typeof t == "object" && t.disabled,
|
|
41
|
-
onClick: (
|
|
42
|
-
|
|
41
|
+
disabled: e.disabled || typeof t == "object" && t.disabled,
|
|
42
|
+
onClick: (H) => {
|
|
43
|
+
o("update:current", r), o("change", r);
|
|
43
44
|
}
|
|
44
|
-
},
|
|
45
|
-
typeof t == "object" && t.description ? (s(), c("small",
|
|
45
|
+
}, a(typeof t == "string" ? t : t.title), 9, A)) : (s(), c("strong", N, a(typeof t == "string" ? t : t.title), 1)),
|
|
46
|
+
typeof t == "object" && t.description ? (s(), c("small", V, a(t.description), 1)) : g("", !0)
|
|
46
47
|
])
|
|
47
|
-
], 10,
|
|
48
|
+
], 10, z))), 128))
|
|
48
49
|
], 16));
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
+
w as default
|
|
53
54
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysSwitch2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b5383e6b"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { LoaderCircle as
|
|
3
|
-
import { useHysRootAttrs as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as g, ref as x, watch as V, onActivated as k, onDeactivated as C, onBeforeUnmount as T, openBlock as s, createElementBlock as u, mergeProps as w, unref as d, createElementVNode as f, normalizeClass as B, createBlock as A, createCommentVNode as m, toDisplayString as L } from "vue";
|
|
2
|
+
import { LoaderCircle as z } from "lucide-vue-next";
|
|
3
|
+
import { useHysRootAttrs as D } from "../../config.js";
|
|
4
|
+
const E = ["aria-label", "aria-checked", "aria-busy", "disabled"], H = { key: 0 }, F = /* @__PURE__ */ g({
|
|
5
5
|
__name: "HysSwitch",
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: { type: Boolean },
|
|
@@ -13,44 +13,55 @@ const k = ["aria-label", "aria-checked", "aria-busy", "disabled"], C = { key: 0
|
|
|
13
13
|
beforeChange: { type: Function }
|
|
14
14
|
},
|
|
15
15
|
emits: ["update:modelValue", "change", "error"],
|
|
16
|
-
setup(e, { emit:
|
|
17
|
-
const a = e,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
setup(e, { emit: h }) {
|
|
17
|
+
const a = e, c = h, y = D(), t = x(!1);
|
|
18
|
+
let l = 0, i = !0;
|
|
19
|
+
function r() {
|
|
20
|
+
l++, t.value = !1;
|
|
21
|
+
}
|
|
22
|
+
V(() => [a.disabled, a.loading, a.modelValue], r, { flush: "sync" }), k(() => {
|
|
23
|
+
i = !0;
|
|
24
|
+
}), C(() => {
|
|
25
|
+
i = !1, r();
|
|
26
|
+
}), T(() => {
|
|
27
|
+
i = !1, r();
|
|
28
|
+
});
|
|
29
|
+
async function v() {
|
|
30
|
+
if (!i || a.disabled || a.loading || t.value) return;
|
|
31
|
+
const n = ++l, o = !a.modelValue;
|
|
32
|
+
t.value = !0;
|
|
33
|
+
try {
|
|
34
|
+
if (a.beforeChange && await a.beforeChange(o) === !1 || !i || n !== l || a.disabled || a.loading) return;
|
|
35
|
+
c("update:modelValue", o), c("change", o);
|
|
36
|
+
} catch (b) {
|
|
37
|
+
i && n === l && c("error", b);
|
|
38
|
+
} finally {
|
|
39
|
+
n === l && (t.value = !1);
|
|
29
40
|
}
|
|
30
41
|
}
|
|
31
|
-
return (n,
|
|
32
|
-
|
|
42
|
+
return (n, o) => (s(), u("span", w(d(y), { class: "hys-ui-switch-wrap" }), [
|
|
43
|
+
f("button", {
|
|
33
44
|
type: "button",
|
|
34
45
|
role: "switch",
|
|
35
46
|
"aria-label": e.ariaLabel || e.activeText || e.inactiveText || "切换",
|
|
36
47
|
"aria-checked": e.modelValue,
|
|
37
48
|
"aria-busy": e.loading || t.value,
|
|
38
|
-
class:
|
|
49
|
+
class: B(["hys-ui-switch", { "hys-ui-on": e.modelValue }]),
|
|
39
50
|
disabled: e.disabled || e.loading || t.value,
|
|
40
|
-
onClick:
|
|
51
|
+
onClick: v
|
|
41
52
|
}, [
|
|
42
|
-
|
|
43
|
-
e.loading || t.value ? (
|
|
53
|
+
f("span", null, [
|
|
54
|
+
e.loading || t.value ? (s(), A(d(z), {
|
|
44
55
|
key: 0,
|
|
45
56
|
class: "hys-ui-icon-spin",
|
|
46
57
|
size: 12
|
|
47
|
-
})) :
|
|
58
|
+
})) : m("", !0)
|
|
48
59
|
])
|
|
49
|
-
], 10,
|
|
50
|
-
e.activeText || e.inactiveText ? (
|
|
60
|
+
], 10, E),
|
|
61
|
+
e.activeText || e.inactiveText ? (s(), u("span", H, L(e.modelValue ? e.activeText : e.inactiveText), 1)) : m("", !0)
|
|
51
62
|
], 16));
|
|
52
63
|
}
|
|
53
64
|
});
|
|
54
65
|
export {
|
|
55
|
-
|
|
66
|
+
F as default
|
|
56
67
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysTable2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dcb04505"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ChevronDown as E, ChevronUp as H } from "lucide-vue-next";
|
|
1
|
+
import { defineComponent as $, ref as A, computed as D, openBlock as s, createElementBlock as l, mergeProps as T, unref as h, createElementVNode as d, toDisplayString as c, createCommentVNode as C, Fragment as u, renderList as b, normalizeStyle as f, createTextVNode as k, createBlock as x, resolveDynamicComponent as V, normalizeClass as w, renderSlot as g } from "vue";
|
|
2
|
+
import { ChevronsUpDown as p, ChevronDown as E, ChevronUp as H } from "lucide-vue-next";
|
|
3
3
|
import { useHysRootAttrs as K } from "../../config.js";
|
|
4
|
-
const R = ["aria-busy"],
|
|
4
|
+
const R = ["aria-busy"], U = { class: "hys-ui-data-table" }, F = { key: 0 }, L = ["aria-sort"], P = ["onClick"], j = { key: 0 }, q = ["colspan"], G = ["onClick"], I = { key: 0 }, J = ["colspan"], X = /* @__PURE__ */ $({
|
|
5
5
|
__name: "HysTable",
|
|
6
6
|
props: {
|
|
7
7
|
columns: {},
|
|
@@ -16,37 +16,41 @@ const R = ["aria-busy"], p = { class: "hys-ui-data-table" }, F = { key: 0 }, L =
|
|
|
16
16
|
rowClassName: {}
|
|
17
17
|
},
|
|
18
18
|
emits: ["rowClick", "sortChange"],
|
|
19
|
-
setup(t, { emit:
|
|
20
|
-
const v = t, m =
|
|
21
|
-
function
|
|
22
|
-
var
|
|
23
|
-
|
|
19
|
+
setup(t, { emit: z }) {
|
|
20
|
+
const v = t, m = z, B = K(), a = A(null), N = D(() => a.value ? [...v.rows].sort((o, i) => String(o[a.value.key] ?? "").localeCompare(String(i[a.value.key] ?? ""), "zh-CN", { numeric: !0 }) * (a.value.direction === "asc" ? 1 : -1)) : v.rows);
|
|
21
|
+
function S(o) {
|
|
22
|
+
var i;
|
|
23
|
+
o.sortable && (a.value = ((i = a.value) == null ? void 0 : i.key) !== o.key ? { key: o.key, direction: "asc" } : a.value.direction === "asc" ? { key: o.key, direction: "desc" } : null, m("sortChange", a.value));
|
|
24
24
|
}
|
|
25
|
-
return (
|
|
25
|
+
return (o, i) => (s(), l("div", T(h(B), {
|
|
26
26
|
class: ["hys-ui-table-scroll", [{ "hys-ui-table-striped": t.striped, "hys-ui-table-bordered": t.bordered }, "hys-ui-table-" + t.size]],
|
|
27
27
|
"aria-busy": t.loading
|
|
28
28
|
}), [
|
|
29
|
-
d("table",
|
|
30
|
-
t.caption ? (s(),
|
|
29
|
+
d("table", U, [
|
|
30
|
+
t.caption ? (s(), l("caption", F, c(t.caption), 1)) : C("", !0),
|
|
31
31
|
d("thead", null, [
|
|
32
32
|
d("tr", null, [
|
|
33
|
-
(s(!0),
|
|
34
|
-
var r, y;
|
|
35
|
-
return s(),
|
|
33
|
+
(s(!0), l(u, null, b(t.columns, (e) => {
|
|
34
|
+
var r, y, n;
|
|
35
|
+
return s(), l("th", {
|
|
36
36
|
key: e.key,
|
|
37
37
|
scope: "col",
|
|
38
38
|
"aria-sort": e.sortable ? ((r = a.value) == null ? void 0 : r.key) === e.key ? a.value.direction === "asc" ? "ascending" : "descending" : "none" : void 0,
|
|
39
39
|
style: f({ width: typeof e.width == "number" ? e.width + "px" : e.width, textAlign: e.align })
|
|
40
40
|
}, [
|
|
41
|
-
e.sortable ? (s(),
|
|
41
|
+
e.sortable ? (s(), l("button", {
|
|
42
42
|
key: 0,
|
|
43
43
|
type: "button",
|
|
44
44
|
class: "hys-ui-table-sort",
|
|
45
|
-
onClick: (
|
|
45
|
+
onClick: (M) => S(e)
|
|
46
46
|
}, [
|
|
47
47
|
k(c(e.label), 1),
|
|
48
|
-
(s(), x(
|
|
49
|
-
|
|
48
|
+
(s(), x(V(((y = a.value) == null ? void 0 : y.key) !== e.key ? h(p) : a.value.direction === "desc" ? h(E) : h(H)), {
|
|
49
|
+
size: 13,
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
class: w({ "hys-ui-table-sorted": ((n = a.value) == null ? void 0 : n.key) === e.key })
|
|
52
|
+
}, null, 8, ["class"]))
|
|
53
|
+
], 8, P)) : (s(), l(u, { key: 1 }, [
|
|
50
54
|
k(c(e.label), 1)
|
|
51
55
|
], 64))
|
|
52
56
|
], 12, L);
|
|
@@ -54,45 +58,45 @@ const R = ["aria-busy"], p = { class: "hys-ui-data-table" }, F = { key: 0 }, L =
|
|
|
54
58
|
])
|
|
55
59
|
]),
|
|
56
60
|
d("tbody", null, [
|
|
57
|
-
t.loading ? (s(),
|
|
61
|
+
t.loading ? (s(), l("tr", j, [
|
|
58
62
|
d("td", {
|
|
59
63
|
colspan: t.columns.length
|
|
60
64
|
}, [
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
g(o.$slots, "loading", {}, () => [
|
|
66
|
+
i[0] || (i[0] = k("加载中…", -1))
|
|
63
67
|
], !0)
|
|
64
|
-
], 8,
|
|
65
|
-
])) : (s(),
|
|
66
|
-
(s(!0),
|
|
68
|
+
], 8, q)
|
|
69
|
+
])) : (s(), l(u, { key: 1 }, [
|
|
70
|
+
(s(!0), l(u, null, b(N.value, (e, r) => {
|
|
67
71
|
var y;
|
|
68
|
-
return s(),
|
|
72
|
+
return s(), l("tr", {
|
|
69
73
|
key: String(e[t.rowKey] ?? r),
|
|
70
|
-
class:
|
|
71
|
-
onClick: (
|
|
74
|
+
class: w((y = t.rowClassName) == null ? void 0 : y.call(t, e, r)),
|
|
75
|
+
onClick: (n) => m("rowClick", e)
|
|
72
76
|
}, [
|
|
73
|
-
(s(!0),
|
|
74
|
-
key:
|
|
75
|
-
style: f({ textAlign:
|
|
77
|
+
(s(!0), l(u, null, b(t.columns, (n) => (s(), l("td", {
|
|
78
|
+
key: n.key,
|
|
79
|
+
style: f({ textAlign: n.align })
|
|
76
80
|
}, [
|
|
77
|
-
|
|
81
|
+
g(o.$slots, n.key, {
|
|
78
82
|
row: e,
|
|
79
|
-
value: e[
|
|
83
|
+
value: e[n.key],
|
|
80
84
|
index: r
|
|
81
85
|
}, () => [
|
|
82
|
-
k(c(e[
|
|
86
|
+
k(c(e[n.key]), 1)
|
|
83
87
|
], !0)
|
|
84
88
|
], 4))), 128))
|
|
85
|
-
], 10,
|
|
89
|
+
], 10, G);
|
|
86
90
|
}), 128)),
|
|
87
|
-
t.rows.length ? C("", !0) : (s(),
|
|
91
|
+
t.rows.length ? C("", !0) : (s(), l("tr", I, [
|
|
88
92
|
d("td", {
|
|
89
93
|
colspan: t.columns.length,
|
|
90
94
|
class: "hys-ui-empty"
|
|
91
95
|
}, [
|
|
92
|
-
|
|
96
|
+
g(o.$slots, "empty", {}, () => [
|
|
93
97
|
k(c(t.emptyText || "暂无数据"), 1)
|
|
94
98
|
], !0)
|
|
95
|
-
], 8,
|
|
99
|
+
], 8, J)
|
|
96
100
|
]))
|
|
97
101
|
], 64))
|
|
98
102
|
])
|
|
@@ -101,5 +105,5 @@ const R = ["aria-busy"], p = { class: "hys-ui-data-table" }, F = { key: 0 }, L =
|
|
|
101
105
|
}
|
|
102
106
|
});
|
|
103
107
|
export {
|
|
104
|
-
|
|
108
|
+
X as default
|
|
105
109
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysTabs2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7fbe08d4"]]);
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -14,21 +14,23 @@ const S = ["aria-label", "aria-orientation"], T = ["data-tab-value", "aria-selec
|
|
|
14
14
|
},
|
|
15
15
|
emits: ["update:modelValue", "change", "close"],
|
|
16
16
|
setup(l, { emit: V }) {
|
|
17
|
-
const
|
|
17
|
+
const r = l, i = V, b = w(), g = R(), t = x(() => r.items.filter((a) => !r.disabled && !a.disabled));
|
|
18
18
|
function v(a) {
|
|
19
|
-
t.value.some((
|
|
19
|
+
if (!t.value.some((e) => e.value === a)) return;
|
|
20
|
+
const n = a !== r.modelValue;
|
|
21
|
+
i("update:modelValue", a), n && i("change", a);
|
|
20
22
|
}
|
|
21
23
|
function A(a) {
|
|
22
24
|
var y;
|
|
23
|
-
const
|
|
24
|
-
if (![...
|
|
25
|
+
const n = r.vertical ? ["ArrowUp", "ArrowDown"] : ["ArrowLeft", "ArrowRight"];
|
|
26
|
+
if (![...n, "Home", "End"].includes(a.key) || !t.value.length) return;
|
|
25
27
|
a.preventDefault();
|
|
26
|
-
const e = t.value.findIndex((c) => c.value ===
|
|
28
|
+
const e = t.value.findIndex((c) => c.value === r.modelValue), s = a.key === "Home" ? 0 : a.key === "End" ? t.value.length - 1 : e < 0 ? a.key === n[0] ? t.value.length - 1 : 0 : (e + (a.key === n[0] ? -1 : 1) + t.value.length) % t.value.length;
|
|
27
29
|
v(t.value[s].value);
|
|
28
30
|
const o = Array.from(((y = b.value) == null ? void 0 : y.querySelectorAll('[role="tab"]')) || []).find((c) => c.dataset.tabValue === t.value[s].value);
|
|
29
31
|
o == null || o.focus();
|
|
30
32
|
}
|
|
31
|
-
return (a,
|
|
33
|
+
return (a, n) => (u(), d(m, null, [
|
|
32
34
|
f("div", B({
|
|
33
35
|
ref_key: "root",
|
|
34
36
|
ref: b
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useHysRootAttrs as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class: "hys-ui-ex-error",
|
|
6
|
-
role: "alert"
|
|
7
|
-
}, M = { key: 2 }, I = /* @__PURE__ */ B({
|
|
1
|
+
import { defineComponent as H, ref as w, useAttrs as A, inject as E, useId as F, computed as I, watch as R, onMounted as q, openBlock as f, createElementBlock as b, mergeProps as z, unref as a, toDisplayString as h, createCommentVNode as B, createElementVNode as M, nextTick as O } from "vue";
|
|
2
|
+
import { useHysRootAttrs as T } from "../../config.js";
|
|
3
|
+
import { fieldKey as N } from "../../composables/formContext.js";
|
|
4
|
+
const S = { key: 0 }, D = ["value", "rows", "maxlength", "placeholder", "disabled", "readonly", "id", "aria-label", "aria-invalid", "aria-required", "aria-describedby"], K = ["id"], P = { key: 2 }, J = /* @__PURE__ */ H({
|
|
8
5
|
inheritAttrs: !1,
|
|
9
6
|
__name: "HysTextarea",
|
|
10
7
|
props: {
|
|
@@ -21,21 +18,21 @@ const F = { key: 0 }, R = ["value", "rows", "maxlength", "placeholder", "disable
|
|
|
21
18
|
resize: { default: "vertical" }
|
|
22
19
|
},
|
|
23
20
|
emits: ["update:modelValue", "input", "change", "focus", "blur"],
|
|
24
|
-
setup(t, { expose:
|
|
25
|
-
const
|
|
26
|
-
async function
|
|
27
|
-
await
|
|
21
|
+
setup(t, { expose: C, emit: V }) {
|
|
22
|
+
const i = t, d = V, k = T(), n = w(), v = w(!1), s = A(), r = E(N, void 0), g = F(), j = I(() => i.error || (r == null ? void 0 : r.error.value));
|
|
23
|
+
async function y() {
|
|
24
|
+
await O();
|
|
28
25
|
const e = n.value;
|
|
29
|
-
if (!e || !
|
|
30
|
-
const l = typeof
|
|
31
|
-
e.style.height = "auto", e.style.height = Math.min((l.maxRows ?? 1 / 0) *
|
|
26
|
+
if (!e || !i.autosize) return;
|
|
27
|
+
const l = typeof i.autosize == "object" ? i.autosize : {}, u = getComputedStyle(e), m = parseFloat(u.lineHeight) || 21, c = parseFloat(u.paddingTop) + parseFloat(u.paddingBottom) + 2;
|
|
28
|
+
e.style.height = "auto", e.style.height = Math.min((l.maxRows ?? 1 / 0) * m + c, Math.max((l.minRows ?? 1) * m + c, e.scrollHeight + 2)) + "px", e.style.overflowY = e.scrollHeight > e.clientHeight ? "auto" : "hidden";
|
|
32
29
|
}
|
|
33
|
-
function
|
|
34
|
-
if (
|
|
30
|
+
function x(e) {
|
|
31
|
+
if (v.value || i.disabled || i.readonly) return;
|
|
35
32
|
const l = e.target.value;
|
|
36
|
-
|
|
33
|
+
d("update:modelValue", l), d("input", l), y();
|
|
37
34
|
}
|
|
38
|
-
return
|
|
35
|
+
return R(() => [i.modelValue, i.autosize], y, { deep: !0 }), q(y), C({ input: n, focus: () => {
|
|
39
36
|
var e;
|
|
40
37
|
return (e = n.value) == null ? void 0 : e.focus();
|
|
41
38
|
}, blur: () => {
|
|
@@ -44,37 +41,50 @@ const F = { key: 0 }, R = ["value", "rows", "maxlength", "placeholder", "disable
|
|
|
44
41
|
}, select: () => {
|
|
45
42
|
var e;
|
|
46
43
|
return (e = n.value) == null ? void 0 : e.select();
|
|
47
|
-
}, resize:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
44
|
+
}, resize: y }), (e, l) => {
|
|
45
|
+
var u, m, c, p;
|
|
46
|
+
return f(), b("label", z(a(k), {
|
|
47
|
+
class: ["hys-ui-ex-field", a(s).class],
|
|
48
|
+
style: a(s).style
|
|
49
|
+
}), [
|
|
50
|
+
t.label ? (f(), b("span", S, h(t.label), 1)) : B("", !0),
|
|
51
|
+
M("textarea", z({
|
|
52
|
+
ref_key: "input",
|
|
53
|
+
ref: n
|
|
54
|
+
}, Object.fromEntries(Object.entries(a(s)).filter(([o]) => !["class", "style"].includes(o))), {
|
|
55
|
+
class: "hys-ui-ex-control",
|
|
56
|
+
value: t.modelValue,
|
|
57
|
+
rows: t.rows,
|
|
58
|
+
maxlength: t.maxlength,
|
|
59
|
+
placeholder: t.placeholder,
|
|
60
|
+
disabled: t.disabled,
|
|
61
|
+
readonly: t.readonly,
|
|
62
|
+
id: a(s).id || ((u = a(r)) == null ? void 0 : u.id.value),
|
|
63
|
+
"data-hys-ui-field-managed": "",
|
|
64
|
+
"aria-label": a(s)["aria-label"] || t.label || ((m = a(r)) == null ? void 0 : m.label.value),
|
|
65
|
+
"aria-invalid": !!j.value || void 0,
|
|
66
|
+
"aria-required": ((c = a(r)) == null ? void 0 : c.required.value) || void 0,
|
|
67
|
+
"aria-describedby": [t.error ? a(g) : (p = a(r)) == null ? void 0 : p.describedBy.value, a(s)["aria-describedby"]].filter(Boolean).join(" ") || void 0,
|
|
68
|
+
style: { resize: t.autosize ? "none" : i.resize },
|
|
69
|
+
onInput: x,
|
|
70
|
+
onCompositionstart: l[0] || (l[0] = (o) => v.value = !0),
|
|
71
|
+
onCompositionend: l[1] || (l[1] = (o) => {
|
|
72
|
+
v.value = !1, x(o);
|
|
73
|
+
}),
|
|
74
|
+
onChange: l[2] || (l[2] = (o) => d("change", o.target.value)),
|
|
75
|
+
onFocus: l[3] || (l[3] = (o) => d("focus", o)),
|
|
76
|
+
onBlur: l[4] || (l[4] = (o) => d("blur", o))
|
|
77
|
+
}), null, 16, D),
|
|
78
|
+
t.error ? (f(), b("small", {
|
|
79
|
+
key: 1,
|
|
80
|
+
id: a(g),
|
|
81
|
+
class: "hys-ui-ex-error",
|
|
82
|
+
role: "alert"
|
|
83
|
+
}, h(t.error), 9, K)) : t.showCount && t.maxlength ? (f(), b("small", P, h(t.modelValue.length) + " / " + h(t.maxlength), 1)) : B("", !0)
|
|
84
|
+
], 16);
|
|
85
|
+
};
|
|
76
86
|
}
|
|
77
87
|
});
|
|
78
88
|
export {
|
|
79
|
-
|
|
89
|
+
J as default
|
|
80
90
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysToast2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-eaff35fd"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|