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.
Files changed (99) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/README.md +16 -6
  3. package/dist/components/HysAlert/HysAlert.vue.js +14 -14
  4. package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
  5. package/dist/components/HysBadge/HysBadge.vue.js +1 -1
  6. package/dist/components/HysBadge/HysBadge2.vue.js +20 -19
  7. package/dist/components/HysCalendar/HysCalendar.vue.js +48 -40
  8. package/dist/components/HysCard/HysCard.vue.js +2 -2
  9. package/dist/components/HysCard/HysCard2.vue.js +9 -9
  10. package/dist/components/HysCascader/HysCascader.vue.js +88 -76
  11. package/dist/components/HysCheckbox/HysCheckbox.vue.js +5 -39
  12. package/dist/components/HysCheckbox/HysCheckbox2.vue.js +85 -2
  13. package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
  14. package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
  15. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +22 -22
  16. package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
  17. package/dist/components/HysDrawer/HysDrawer2.vue.js +55 -54
  18. package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
  19. package/dist/components/HysFileManager/HysFileManager2.vue.js +85 -2
  20. package/dist/components/HysForm/HysForm.vue.js +2 -2
  21. package/dist/components/HysForm/HysForm2.vue.js +66 -64
  22. package/dist/components/HysFormItem/HysFormItem.vue.js +53 -37
  23. package/dist/components/HysGantt/HysGantt.vue.js +5 -264
  24. package/dist/components/HysGantt/HysGantt2.vue.js +302 -2
  25. package/dist/components/HysInput/HysInput.vue.js +1 -1
  26. package/dist/components/HysInput/HysInput2.vue.js +42 -41
  27. package/dist/components/HysModal/HysModal.vue.js +2 -2
  28. package/dist/components/HysModal/HysModal2.vue.js +35 -35
  29. package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
  30. package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
  31. package/dist/components/HysNumberInput/HysNumberInput2.vue.js +49 -40
  32. package/dist/components/HysOrgTree/HysOrgTree.vue.js +34 -32
  33. package/dist/components/HysPagination/HysPagination.vue.js +2 -2
  34. package/dist/components/HysPagination/HysPagination2.vue.js +91 -91
  35. package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
  36. package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +100 -2
  37. package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +5 -40
  38. package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +80 -2
  39. package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
  40. package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
  41. package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +86 -67
  42. package/dist/components/HysSearch/HysSearch.vue.js +49 -38
  43. package/dist/components/HysSegmented/HysSegmented.vue.js +39 -34
  44. package/dist/components/HysSelect/HysSelect.vue.js +2 -2
  45. package/dist/components/HysSelect/HysSelect2.vue.js +130 -109
  46. package/dist/components/HysSlider/HysSlider.vue.js +2 -2
  47. package/dist/components/HysSlider/HysSlider2.vue.js +40 -40
  48. package/dist/components/HysSplitPane/HysSplitPane.vue.js +48 -42
  49. package/dist/components/HysSteps/HysSteps.vue.js +2 -2
  50. package/dist/components/HysSteps/HysSteps2.vue.js +15 -14
  51. package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
  52. package/dist/components/HysSwitch/HysSwitch2.vue.js +38 -27
  53. package/dist/components/HysTable/HysTable.vue.js +2 -2
  54. package/dist/components/HysTable/HysTable2.vue.js +42 -38
  55. package/dist/components/HysTabs/HysTabs.vue.js +1 -1
  56. package/dist/components/HysTabs/HysTabs2.vue.js +8 -6
  57. package/dist/components/HysTextarea/HysTextarea.vue.js +58 -48
  58. package/dist/components/HysToast/HysToast.vue.js +2 -2
  59. package/dist/components/HysToast/HysToast2.vue.js +121 -38
  60. package/dist/components/HysTour/HysTour.vue.js +47 -42
  61. package/dist/components/HysTransfer/HysTransfer.vue.js +159 -143
  62. package/dist/components/HysTree/HysTree.vue.js +2 -2
  63. package/dist/components/HysTree/HysTree2.vue.js +62 -61
  64. package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +64 -57
  65. package/dist/components/HysUpload/HysUpload.vue.js +2 -2
  66. package/dist/components/HysUpload/HysUpload2.vue.js +95 -77
  67. package/dist/composables/formContext.js +9 -3
  68. package/dist/composables/toastEscape.js +16 -0
  69. package/dist/composables/useDialog.js +16 -16
  70. package/dist/composables/useFloating.js +40 -40
  71. package/dist/composables/useHysToast.js +148 -0
  72. package/dist/config.js +18 -15
  73. package/dist/index.js +10 -7
  74. package/dist/style.css +1 -1
  75. package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +2 -0
  76. package/dist/types/components/HysCard/HysCard.vue.d.ts +5 -1
  77. package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +21 -4
  78. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -0
  79. package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +6 -2
  80. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +6 -0
  81. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -0
  82. package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +3 -1
  83. package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
  84. package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +40 -17
  85. package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
  86. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +7 -1
  87. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
  88. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -0
  89. package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +1 -1
  90. package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +1 -1
  91. package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
  92. package/dist/types/components/HysTour/HysTour.vue.d.ts +3 -1
  93. package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +11 -1
  94. package/dist/types/composables/formContext.d.ts +5 -0
  95. package/dist/types/composables/toastEscape.d.ts +1 -0
  96. package/dist/types/composables/useFloating.d.ts +1 -1
  97. package/dist/types/composables/useHysToast.d.ts +50 -0
  98. package/dist/types/index.d.ts +5 -0
  99. package/package.json +46 -11
@@ -1,25 +1,26 @@
1
- import { defineComponent as k, openBlock as s, createElementBlock as c, mergeProps as d, unref as n, Fragment as l, renderList as f, normalizeClass as m, createElementVNode as u, createBlock as i, createTextVNode as b, toDisplayString as o, createCommentVNode as g } from "vue";
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 p = ["aria-current"], z = ["disabled", "onClick"], A = { key: 1 }, N = { key: 2 }, D = /* @__PURE__ */ k({
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 h = v(), a = y;
16
- return (V, j) => (s(), c("ol", d(n(h), {
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, f(e.items, (t, r) => (s(), c("li", {
21
+ (s(!0), c(l, null, b(e.items, (t, r) => (s(), c("li", {
21
22
  key: r,
22
- class: m({ "hys-ui-done": r < e.current, "hys-ui-active": r === e.current, "hys-ui-step-error": r === e.current && e.status === "error" }),
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
- b(o(r + 1), 1)
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: (E) => {
42
- a("update:current", r), a("change", r);
41
+ disabled: e.disabled || typeof t == "object" && t.disabled,
42
+ onClick: (H) => {
43
+ o("update:current", r), o("change", r);
43
44
  }
44
- }, o(typeof t == "string" ? t : t.title), 9, z)) : (s(), c("strong", A, o(typeof t == "string" ? t : t.title), 1)),
45
- typeof t == "object" && t.description ? (s(), c("small", N, o(t.description), 1)) : g("", !0)
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, p))), 128))
48
+ ], 10, z))), 128))
48
49
  ], 16));
49
50
  }
50
51
  });
51
52
  export {
52
- D as default
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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-eab5d9ff"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b5383e6b"]]);
5
5
  export {
6
- m as default
6
+ s as default
7
7
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as h, ref as y, openBlock as i, createElementBlock as o, mergeProps as f, unref as c, createElementVNode as r, normalizeClass as b, createBlock as g, createCommentVNode as u, toDisplayString as v } from "vue";
2
- import { LoaderCircle as x } from "lucide-vue-next";
3
- import { useHysRootAttrs as V } from "../../config.js";
4
- const k = ["aria-label", "aria-checked", "aria-busy", "disabled"], C = { key: 0 }, z = /* @__PURE__ */ h({
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: s }) {
17
- const a = e, l = s, d = V(), t = y(!1);
18
- async function m() {
19
- if (!(a.disabled || a.loading || t.value)) {
20
- t.value = !0;
21
- try {
22
- if (a.beforeChange && await a.beforeChange() === !1) return;
23
- l("update:modelValue", !a.modelValue), l("change", !a.modelValue);
24
- } catch (n) {
25
- l("error", n);
26
- } finally {
27
- t.value = !1;
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, T) => (i(), o("span", f(c(d), { class: "hys-ui-switch-wrap" }), [
32
- r("button", {
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: b(["hys-ui-switch", { "hys-ui-on": e.modelValue }]),
49
+ class: B(["hys-ui-switch", { "hys-ui-on": e.modelValue }]),
39
50
  disabled: e.disabled || e.loading || t.value,
40
- onClick: m
51
+ onClick: v
41
52
  }, [
42
- r("span", null, [
43
- e.loading || t.value ? (i(), g(c(x), {
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
- })) : u("", !0)
58
+ })) : m("", !0)
48
59
  ])
49
- ], 10, k),
50
- e.activeText || e.inactiveText ? (i(), o("span", C, v(e.modelValue ? e.activeText : e.inactiveText), 1)) : u("", !0)
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
- z as default
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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-31cf795a"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dcb04505"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as S, ref as $, computed as A, openBlock as s, createElementBlock as o, mergeProps as T, unref as h, createElementVNode as d, toDisplayString as c, createCommentVNode as C, Fragment as u, renderList as g, normalizeStyle as f, createTextVNode as k, createBlock as x, resolveDynamicComponent as D, renderSlot as b, normalizeClass as V } from "vue";
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"], p = { class: "hys-ui-data-table" }, F = { key: 0 }, L = ["aria-sort"], P = ["onClick"], U = { key: 0 }, j = ["colspan"], q = ["onClick"], G = { key: 0 }, I = ["colspan"], Q = /* @__PURE__ */ S({
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: w }) {
20
- const v = t, m = w, z = K(), a = $(null), B = A(() => a.value ? [...v.rows].sort((l, n) => String(l[a.value.key] ?? "").localeCompare(String(n[a.value.key] ?? ""), "zh-CN", { numeric: !0 }) * (a.value.direction === "asc" ? 1 : -1)) : v.rows);
21
- function N(l) {
22
- var n;
23
- l.sortable && (a.value = ((n = a.value) == null ? void 0 : n.key) !== l.key ? { key: l.key, direction: "asc" } : a.value.direction === "asc" ? { key: l.key, direction: "desc" } : null, m("sortChange", a.value));
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 (l, n) => (s(), o("div", T(h(z), {
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", p, [
30
- t.caption ? (s(), o("caption", F, c(t.caption), 1)) : C("", !0),
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), o(u, null, g(t.columns, (e) => {
34
- var r, y;
35
- return s(), o("th", {
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(), o("button", {
41
+ e.sortable ? (s(), l("button", {
42
42
  key: 0,
43
43
  type: "button",
44
44
  class: "hys-ui-table-sort",
45
- onClick: (i) => N(e)
45
+ onClick: (M) => S(e)
46
46
  }, [
47
47
  k(c(e.label), 1),
48
- (s(), x(D(((y = a.value) == null ? void 0 : y.key) === e.key && a.value.direction === "desc" ? h(E) : h(H)), { size: 13 }))
49
- ], 8, P)) : (s(), o(u, { key: 1 }, [
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(), o("tr", U, [
61
+ t.loading ? (s(), l("tr", j, [
58
62
  d("td", {
59
63
  colspan: t.columns.length
60
64
  }, [
61
- b(l.$slots, "loading", {}, () => [
62
- n[0] || (n[0] = k("加载中…", -1))
65
+ g(o.$slots, "loading", {}, () => [
66
+ i[0] || (i[0] = k("加载中…", -1))
63
67
  ], !0)
64
- ], 8, j)
65
- ])) : (s(), o(u, { key: 1 }, [
66
- (s(!0), o(u, null, g(B.value, (e, r) => {
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(), o("tr", {
72
+ return s(), l("tr", {
69
73
  key: String(e[t.rowKey] ?? r),
70
- class: V((y = t.rowClassName) == null ? void 0 : y.call(t, e, r)),
71
- onClick: (i) => m("rowClick", e)
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), o(u, null, g(t.columns, (i) => (s(), o("td", {
74
- key: i.key,
75
- style: f({ textAlign: i.align })
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
- b(l.$slots, i.key, {
81
+ g(o.$slots, n.key, {
78
82
  row: e,
79
- value: e[i.key],
83
+ value: e[n.key],
80
84
  index: r
81
85
  }, () => [
82
- k(c(e[i.key]), 1)
86
+ k(c(e[n.key]), 1)
83
87
  ], !0)
84
88
  ], 4))), 128))
85
- ], 10, q);
89
+ ], 10, G);
86
90
  }), 128)),
87
- t.rows.length ? C("", !0) : (s(), o("tr", G, [
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
- b(l.$slots, "empty", {}, () => [
96
+ g(o.$slots, "empty", {}, () => [
93
97
  k(c(t.emptyText || "暂无数据"), 1)
94
98
  ], !0)
95
- ], 8, I)
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
- Q as default
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-2cd1bf68"]]);
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 n = l, i = V, b = w(), g = R(), t = x(() => n.items.filter((a) => !n.disabled && !a.disabled));
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((r) => r.value === a) && (i("update:modelValue", a), a !== n.modelValue && i("change", a));
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 r = n.vertical ? ["ArrowUp", "ArrowDown"] : ["ArrowLeft", "ArrowRight"];
24
- if (![...r, "Home", "End"].includes(a.key) || !t.value.length) return;
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 === n.modelValue), s = a.key === "Home" ? 0 : a.key === "End" ? t.value.length - 1 : (e + (a.key === r[0] ? -1 : 1) + t.value.length) % t.value.length;
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, r) => (u(), d(m, null, [
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 B, ref as x, useAttrs as C, watch as V, onMounted as k, openBlock as r, createElementBlock as u, mergeProps as v, unref as d, toDisplayString as m, createCommentVNode as b, createElementVNode as H, nextTick as j } from "vue";
2
- import { useHysRootAttrs as A } from "../../config.js";
3
- const F = { key: 0 }, R = ["value", "rows", "maxlength", "placeholder", "disabled", "readonly", "aria-invalid"], E = {
4
- key: 1,
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: p, emit: w }) {
25
- const a = t, s = w, z = A(), n = x(), c = x(!1), y = C();
26
- async function i() {
27
- await j();
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 || !a.autosize) return;
30
- const l = typeof a.autosize == "object" ? a.autosize : {}, o = getComputedStyle(e), h = parseFloat(o.lineHeight) || 21, g = parseFloat(o.paddingTop) + parseFloat(o.paddingBottom) + 2;
31
- e.style.height = "auto", e.style.height = Math.min((l.maxRows ?? 1 / 0) * h + g, Math.max((l.minRows ?? 1) * h + g, e.scrollHeight + 2)) + "px", e.style.overflowY = e.scrollHeight > e.clientHeight ? "auto" : "hidden";
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 f(e) {
34
- if (c.value) return;
30
+ function x(e) {
31
+ if (v.value || i.disabled || i.readonly) return;
35
32
  const l = e.target.value;
36
- s("update:modelValue", l), s("input", l), i();
33
+ d("update:modelValue", l), d("input", l), y();
37
34
  }
38
- return V(() => [a.modelValue, a.autosize], i, { deep: !0 }), k(i), p({ input: n, focus: () => {
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: i }), (e, l) => (r(), u("label", v(d(z), {
48
- class: ["hys-ui-ex-field", d(y).class],
49
- style: d(y).style
50
- }), [
51
- t.label ? (r(), u("span", F, m(t.label), 1)) : b("", !0),
52
- H("textarea", v({
53
- ref_key: "input",
54
- ref: n
55
- }, Object.fromEntries(Object.entries(d(y)).filter(([o]) => !["class", "style"].includes(o))), {
56
- class: "hys-ui-ex-control",
57
- value: t.modelValue,
58
- rows: t.rows,
59
- maxlength: t.maxlength,
60
- placeholder: t.placeholder,
61
- disabled: t.disabled,
62
- readonly: t.readonly,
63
- "aria-invalid": !!t.error,
64
- style: { resize: t.autosize ? "none" : a.resize },
65
- onInput: f,
66
- onCompositionstart: l[0] || (l[0] = (o) => c.value = !0),
67
- onCompositionend: l[1] || (l[1] = (o) => {
68
- c.value = !1, f(o);
69
- }),
70
- onChange: l[2] || (l[2] = (o) => s("change", o.target.value)),
71
- onFocus: l[3] || (l[3] = (o) => s("focus", o)),
72
- onBlur: l[4] || (l[4] = (o) => s("blur", o))
73
- }), null, 16, R),
74
- t.error ? (r(), u("small", E, m(t.error), 1)) : t.showCount && t.maxlength ? (r(), u("small", M, m(t.modelValue.length) + " / " + m(t.maxlength), 1)) : b("", !0)
75
- ], 16));
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
- I as default
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 f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8af7c28b"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-eaff35fd"]]);
5
5
  export {
6
- f as default
6
+ s as default
7
7
  };