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,14 +1,14 @@
1
- import { defineComponent as T, computed as o, ref as A, watch as O, openBlock as d, createElementBlock as c, mergeProps as Q, unref as M, toDisplayString as f, createCommentVNode as N, createElementVNode as w, createVNode as u, withCtx as y, Fragment as j, renderList as U, createBlock as D, normalizeClass as q, createTextVNode as B, withModifiers as G } from "vue";
2
- import { useHysRootAttrs as K } from "../../config.js";
3
- import { ChevronsLeft as W, ChevronLeft as X, ChevronRight as Y, ChevronsRight as Z } from "lucide-vue-next";
4
- import _ from "../HysSelect/HysSelect.vue.js";
5
- import ee from "../HysNumberInput/HysNumberInput.vue.js";
6
- import z from "../HysButton/HysButton.vue.js";
7
- const ae = ["aria-busy"], te = {
1
+ import { defineComponent as O, computed as s, ref as I, watch as P, openBlock as v, createElementBlock as c, mergeProps as Q, unref as C, toDisplayString as g, createCommentVNode as w, createElementVNode as B, createVNode as o, withCtx as S, Fragment as F, renderList as U, createBlock as q, normalizeClass as G, createTextVNode as V, withModifiers as K } from "vue";
2
+ import { useHysRootAttrs as W } from "../../config.js";
3
+ import { ChevronsLeft as X, ChevronLeft as Y, ChevronRight as Z, ChevronsRight as _ } from "lucide-vue-next";
4
+ import ee from "../HysSelect/HysSelect.vue.js";
5
+ import ae from "../HysNumberInput/HysNumberInput.vue.js";
6
+ import M from "../HysButton/HysButton.vue.js";
7
+ const te = ["aria-busy"], le = {
8
8
  key: 0,
9
9
  class: "hys-ui-pf-pagination-total",
10
10
  "aria-live": "polite"
11
- }, le = { class: "hys-ui-pf-pagination-actions" }, ie = { class: "hys-ui-pf-pagination-controls" }, ne = {
11
+ }, ie = { class: "hys-ui-pf-pagination-actions" }, ne = { class: "hys-ui-pf-pagination-controls" }, ue = {
12
12
  key: 1,
13
13
  class: "hys-ui-pf-pagination-gap",
14
14
  "aria-hidden": "true"
@@ -18,10 +18,10 @@ const ae = ["aria-busy"], te = {
18
18
  }, oe = {
19
19
  key: 2,
20
20
  class: "hys-ui-pf-pagination-mobile-indicator"
21
- }, ue = {
21
+ }, re = {
22
22
  key: 0,
23
23
  class: "hys-ui-pf-pagination-size"
24
- }, fe = /* @__PURE__ */ T({
24
+ }, ge = /* @__PURE__ */ O({
25
25
  __name: "HysPagination",
26
26
  props: {
27
27
  page: {},
@@ -38,126 +38,125 @@ const ae = ["aria-busy"], te = {
38
38
  labels: {}
39
39
  },
40
40
  emits: ["change", "update:page", "pageSizeChange", "update:pageSize"],
41
- setup(p, { emit: P }) {
42
- const F = K(), s = p, k = P, b = o(() => Number.isFinite(s.pageSize) && s.pageSize > 0 ? Math.floor(s.pageSize) : 10), S = o(() => Number.isFinite(s.total) ? Math.max(0, Math.floor(s.total)) : 0), v = o(() => Math.max(1, Math.ceil(S.value / b.value))), t = o(() => Math.min(v.value, Math.max(1, Number.isFinite(s.page) ? Math.floor(s.page) : 1))), r = o(() => s.disabled || s.loading), H = o(() => S.value === 0 ? 0 : (t.value - 1) * b.value + 1), I = o(() => Math.min(S.value, t.value * b.value)), n = o(() => ({ total: "共 {total} 条({start}–{end})", perPage: "每页条数", jump: "跳转到", page: "页", first: "首页", previous: "上一页", next: "下一页", last: "末页", ...s.labels })), $ = o(() => n.value.total.replace("{total}", String(S.value)).replace("{start}", String(H.value)).replace("{end}", String(I.value))), E = o(() => [...new Set([...s.pageSizeOptions ?? [10, 20, 50, 100], b.value].filter((l) => Number.isInteger(l) && l > 0))].sort((l, e) => l - e)), J = o(() => {
43
- const l = v.value, e = Math.max(0, Math.min(5, Math.floor(s.siblingCount))), a = /* @__PURE__ */ new Set([1, l]);
44
- for (let i = Math.max(1, t.value - e); i <= Math.min(l, t.value + e); i++) a.add(i);
45
- if (t.value <= e + 3) for (let i = 1; i <= Math.min(l, 2 * e + 3); i++) a.add(i);
46
- if (t.value >= l - e - 2) for (let i = Math.max(1, l - (2 * e + 2)); i <= l; i++) a.add(i);
47
- const x = [...a].sort((i, h) => i - h), C = [];
48
- return x.forEach((i, h) => {
49
- h && i - x[h - 1] > 1 && (i - x[h - 1] === 2 ? C.push(i - 1) : C.push(h === 1 ? "left-gap" : "right-gap")), C.push(i);
50
- }), C;
51
- }), m = A(t.value), V = o(() => Number.isInteger(m.value) && m.value > 0 && m.value !== t.value);
52
- O(t, () => {
53
- m.value = t.value;
54
- });
55
- function g(l) {
41
+ setup(d, { emit: H }) {
42
+ const $ = W(), u = d, b = H, h = s(() => Number.isFinite(u.pageSize) && u.pageSize > 0 ? Math.floor(u.pageSize) : 10), k = s(() => Number.isFinite(u.total) ? Math.max(0, Math.floor(u.total)) : 0), p = s(() => Math.max(1, Math.ceil(k.value / h.value))), a = s(() => Math.min(p.value, Math.max(1, Number.isFinite(u.page) ? Math.floor(u.page) : 1))), r = s(() => u.disabled || u.loading), E = s(() => k.value === 0 ? 0 : (a.value - 1) * h.value + 1), J = s(() => Math.min(k.value, a.value * h.value)), n = s(() => ({ total: "共 {total} 条({start}–{end})", perPage: "每页条数", jump: "跳转到", page: "页", first: "首页", previous: "上一页", next: "下一页", last: "末页", ...u.labels })), L = s(() => n.value.total.replace("{total}", String(k.value)).replace("{start}", String(E.value)).replace("{end}", String(J.value))), R = s(() => [...new Set([...u.pageSizeOptions ?? [10, 20, 50, 100], h.value].filter((l) => Number.isInteger(l) && l > 0))].sort((l, e) => l - e)), T = s(() => {
43
+ const l = p.value, e = Math.max(0, Math.min(5, Math.floor(u.siblingCount))), t = /* @__PURE__ */ new Set([1, l]);
44
+ for (let i = Math.max(1, a.value - e); i <= Math.min(l, a.value + e); i++) t.add(i);
45
+ if (a.value <= e + 3) for (let i = 1; i <= Math.min(l, 2 * e + 3); i++) t.add(i);
46
+ if (a.value >= l - e - 2) for (let i = Math.max(1, l - (2 * e + 2)); i <= l; i++) t.add(i);
47
+ const f = [...t].sort((i, z) => i - z), N = [];
48
+ return f.forEach((i, z) => {
49
+ z && i - f[z - 1] > 1 && (i - f[z - 1] === 2 ? N.push(i - 1) : N.push(z === 1 ? "left-gap" : "right-gap")), N.push(i);
50
+ }), N;
51
+ }), x = I(a.value), m = I(a.value), j = s(() => m.value !== null && Number.isInteger(m.value) && m.value > 0 && m.value !== a.value);
52
+ P(a, () => {
53
+ x.value = a.value, m.value = a.value;
54
+ }), P(x, (l) => m.value = l);
55
+ function y(l) {
56
56
  if (r.value || !Number.isFinite(l)) return;
57
- const e = Math.min(v.value, Math.max(1, Math.floor(l)));
58
- e !== t.value && (k("update:page", e), k("change", e));
57
+ const e = Math.min(p.value, Math.max(1, Math.floor(l)));
58
+ e !== a.value && (b("update:page", e), b("change", e));
59
59
  }
60
- function L(l) {
60
+ function A(l) {
61
61
  if (r.value) return;
62
62
  const e = Number(l);
63
- if (!Number.isInteger(e) || e < 1 || e === b.value) return;
64
- k("update:pageSize", e), k("pageSizeChange", e);
65
- const a = Math.max(1, Math.ceil(S.value / e));
66
- t.value > a && g(a);
63
+ if (!Number.isInteger(e) || e < 1 || e === h.value) return;
64
+ const t = a.value, f = Math.max(1, Math.ceil(k.value / e));
65
+ b("update:pageSize", e), t > f && (b("update:page", f), b("change", f)), b("pageSizeChange", e);
67
66
  }
68
- function R() {
67
+ function D() {
69
68
  const l = Number(m.value);
70
- V.value && Number.isInteger(l) && g(l), m.value = t.value;
69
+ j.value && Number.isInteger(l) && y(l), x.value = a.value, m.value = a.value;
71
70
  }
72
- return (l, e) => (d(), c("nav", Q(M(F), {
73
- class: ["hys-ui-pf-pagination", { "pf-pagination--compact": p.compact }],
71
+ return (l, e) => (v(), c("nav", Q(C($), {
72
+ class: ["hys-ui-pf-pagination", { "hys-ui-pf-pagination-compact": d.compact }],
74
73
  "aria-label": "分页导航",
75
- "aria-busy": p.loading
74
+ "aria-busy": d.loading
76
75
  }), [
77
- p.showTotal ? (d(), c("span", te, f($.value), 1)) : N("", !0),
78
- w("div", le, [
79
- w("div", ie, [
80
- u(z, {
76
+ d.showTotal ? (v(), c("span", le, g(L.value), 1)) : w("", !0),
77
+ B("div", ie, [
78
+ B("div", ne, [
79
+ o(M, {
81
80
  variant: "secondary",
82
81
  size: "sm",
83
82
  type: "button",
84
- disabled: r.value || t.value === 1,
83
+ disabled: r.value || a.value === 1,
85
84
  "aria-label": n.value.first,
86
85
  title: n.value.first,
87
- onClick: e[0] || (e[0] = (a) => g(1))
86
+ onClick: e[0] || (e[0] = (t) => y(1))
88
87
  }, {
89
- default: y(() => [
90
- u(M(W), {
88
+ default: S(() => [
89
+ o(C(X), {
91
90
  size: 16,
92
91
  "aria-hidden": "true"
93
92
  })
94
93
  ]),
95
94
  _: 1
96
95
  }, 8, ["disabled", "aria-label", "title"]),
97
- u(z, {
96
+ o(M, {
98
97
  variant: "secondary",
99
98
  size: "sm",
100
99
  type: "button",
101
- disabled: r.value || t.value === 1,
100
+ disabled: r.value || a.value === 1,
102
101
  "aria-label": n.value.previous,
103
102
  title: n.value.previous,
104
- onClick: e[1] || (e[1] = (a) => g(t.value - 1))
103
+ onClick: e[1] || (e[1] = (t) => y(a.value - 1))
105
104
  }, {
106
- default: y(() => [
107
- u(M(X), {
105
+ default: S(() => [
106
+ o(C(Y), {
108
107
  size: 16,
109
108
  "aria-hidden": "true"
110
109
  })
111
110
  ]),
112
111
  _: 1
113
112
  }, 8, ["disabled", "aria-label", "title"]),
114
- p.compact ? (d(), c("span", se, f(t.value) + " / " + f(v.value), 1)) : (d(!0), c(j, { key: 0 }, U(J.value, (a) => (d(), c(j, { key: a }, [
115
- typeof a == "number" ? (d(), D(z, {
113
+ d.compact ? (v(), c("span", se, g(a.value) + " / " + g(p.value), 1)) : (v(!0), c(F, { key: 0 }, U(T.value, (t) => (v(), c(F, { key: t }, [
114
+ typeof t == "number" ? (v(), q(M, {
116
115
  key: 0,
117
116
  variant: "secondary",
118
117
  size: "sm",
119
- class: q(["hys-ui-pf-pagination-page", { "hys-ui-is-current": a === t.value }]),
118
+ class: G(["hys-ui-pf-pagination-page", { "hys-ui-is-current": t === a.value }]),
120
119
  type: "button",
121
120
  disabled: r.value,
122
- "aria-label": "第 " + a + " 页",
123
- "aria-current": a === t.value ? "page" : void 0,
124
- onClick: (x) => g(a)
121
+ "aria-label": "第 " + t + " 页",
122
+ "aria-current": t === a.value ? "page" : void 0,
123
+ onClick: (f) => y(t)
125
124
  }, {
126
- default: y(() => [
127
- B(f(a), 1)
125
+ default: S(() => [
126
+ V(g(t), 1)
128
127
  ]),
129
128
  _: 2
130
- }, 1032, ["disabled", "aria-label", "aria-current", "class", "onClick"])) : (d(), c("span", ne, "…"))
129
+ }, 1032, ["disabled", "aria-label", "aria-current", "class", "onClick"])) : (v(), c("span", ue, "…"))
131
130
  ], 64))), 128)),
132
- p.compact ? N("", !0) : (d(), c("span", oe, f(t.value) + " / " + f(v.value), 1)),
133
- u(z, {
131
+ d.compact ? w("", !0) : (v(), c("span", oe, g(a.value) + " / " + g(p.value), 1)),
132
+ o(M, {
134
133
  variant: "secondary",
135
134
  size: "sm",
136
135
  type: "button",
137
- disabled: r.value || t.value === v.value,
136
+ disabled: r.value || a.value === p.value,
138
137
  "aria-label": n.value.next,
139
138
  title: n.value.next,
140
- onClick: e[2] || (e[2] = (a) => g(t.value + 1))
139
+ onClick: e[2] || (e[2] = (t) => y(a.value + 1))
141
140
  }, {
142
- default: y(() => [
143
- u(M(Y), {
141
+ default: S(() => [
142
+ o(C(Z), {
144
143
  size: 16,
145
144
  "aria-hidden": "true"
146
145
  })
147
146
  ]),
148
147
  _: 1
149
148
  }, 8, ["disabled", "aria-label", "title"]),
150
- u(z, {
149
+ o(M, {
151
150
  variant: "secondary",
152
151
  size: "sm",
153
152
  type: "button",
154
- disabled: r.value || t.value === v.value,
153
+ disabled: r.value || a.value === p.value,
155
154
  "aria-label": n.value.last,
156
155
  title: n.value.last,
157
- onClick: e[3] || (e[3] = (a) => g(v.value))
156
+ onClick: e[3] || (e[3] = (t) => y(p.value))
158
157
  }, {
159
- default: y(() => [
160
- u(M(Z), {
158
+ default: S(() => [
159
+ o(C(_), {
161
160
  size: 16,
162
161
  "aria-hidden": "true"
163
162
  })
@@ -165,49 +164,50 @@ const ae = ["aria-busy"], te = {
165
164
  _: 1
166
165
  }, 8, ["disabled", "aria-label", "title"])
167
166
  ]),
168
- p.showSizeChanger ? (d(), c("label", ue, [
169
- B(f(n.value.perPage) + " ", 1),
170
- u(_, {
171
- "model-value": String(b.value),
172
- options: E.value.map((a) => ({ label: String(a), value: String(a) })),
167
+ d.showSizeChanger ? (v(), c("label", re, [
168
+ V(g(n.value.perPage) + " ", 1),
169
+ o(ee, {
170
+ "model-value": String(h.value),
171
+ options: R.value.map((t) => ({ label: String(t), value: String(t) })),
173
172
  disabled: r.value,
174
173
  "aria-label": n.value.perPage,
175
- "onUpdate:modelValue": L
174
+ "onUpdate:modelValue": A
176
175
  }, null, 8, ["model-value", "options", "disabled", "aria-label"])
177
- ])) : N("", !0),
178
- p.showQuickJumper && !p.compact ? (d(), c("form", {
176
+ ])) : w("", !0),
177
+ d.showQuickJumper && !d.compact ? (v(), c("form", {
179
178
  key: 1,
180
179
  class: "hys-ui-pf-pagination-jump",
181
- onSubmit: G(R, ["prevent"])
180
+ onSubmit: K(D, ["prevent"])
182
181
  }, [
183
- w("span", null, f(n.value.jump), 1),
184
- u(ee, {
185
- modelValue: m.value,
186
- "onUpdate:modelValue": e[4] || (e[4] = (a) => m.value = a),
182
+ B("span", null, g(n.value.jump), 1),
183
+ o(ae, {
184
+ modelValue: x.value,
185
+ "onUpdate:modelValue": e[4] || (e[4] = (t) => x.value = t),
186
+ onInput: e[5] || (e[5] = (t) => m.value = t),
187
187
  class: "hys-ui-pf-pagination-jump-input",
188
188
  min: 1,
189
- max: v.value,
189
+ max: p.value,
190
190
  "show-controls": !1,
191
191
  "select-on-focus": "",
192
192
  disabled: r.value,
193
193
  "aria-label": n.value.jump
194
194
  }, null, 8, ["modelValue", "max", "disabled", "aria-label"]),
195
- u(z, {
195
+ o(M, {
196
196
  variant: "secondary",
197
197
  size: "sm",
198
198
  type: "submit",
199
- disabled: r.value || !V.value
199
+ disabled: r.value || !j.value
200
200
  }, {
201
- default: y(() => [...e[5] || (e[5] = [
202
- B("确定", -1)
201
+ default: S(() => [...e[6] || (e[6] = [
202
+ V("确定", -1)
203
203
  ])]),
204
204
  _: 1
205
205
  }, 8, ["disabled"])
206
- ], 32)) : N("", !0)
206
+ ], 32)) : w("", !0)
207
207
  ])
208
- ], 16, ae));
208
+ ], 16, te));
209
209
  }
210
210
  });
211
211
  export {
212
- fe as default
212
+ ge as default
213
213
  };
@@ -1,43 +1,7 @@
1
- import { defineComponent as p, openBlock as t, createElementBlock as l, mergeProps as f, unref as b, createElementVNode as n, Fragment as s, renderList as a, toDisplayString as i } from "vue";
2
- import { useHysRootAttrs as V } from "../../config.js";
3
- const x = { class: "hys-ui-ent-matrix" }, C = ["aria-label", "checked", "onChange"], E = /* @__PURE__ */ p({
4
- __name: "HysPermissionMatrix",
5
- props: {
6
- roles: {},
7
- resources: {},
8
- modelValue: {}
9
- },
10
- emits: ["update:modelValue"],
11
- setup(o, { emit: m }) {
12
- const d = V(), h = o, y = m;
13
- function k(c, r) {
14
- y("update:modelValue", { ...h.modelValue, [c]: r.target.checked });
15
- }
16
- return (c, r) => (t(), l("div", f(b(d), { class: "hys-ui-ent-table-scroll" }), [
17
- n("table", x, [
18
- n("thead", null, [
19
- n("tr", null, [
20
- r[0] || (r[0] = n("th", null, "资源 / 角色", -1)),
21
- (t(!0), l(s, null, a(o.roles, (e) => (t(), l("th", { key: e }, i(e), 1))), 128))
22
- ])
23
- ]),
24
- n("tbody", null, [
25
- (t(!0), l(s, null, a(o.resources, (e) => (t(), l("tr", { key: e }, [
26
- n("th", null, i(e), 1),
27
- (t(!0), l(s, null, a(o.roles, (u) => (t(), l("td", { key: u }, [
28
- n("input", {
29
- type: "checkbox",
30
- "aria-label": e + " - " + u,
31
- checked: !!o.modelValue[e + ":" + u],
32
- onChange: (g) => k(e + ":" + u, g)
33
- }, null, 40, C)
34
- ]))), 128))
35
- ]))), 128))
36
- ])
37
- ])
38
- ], 16));
39
- }
40
- });
1
+ import o from "./HysPermissionMatrix2.vue.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-30413028"]]);
41
5
  export {
42
- E as default
6
+ m as default
43
7
  };
@@ -1,4 +1,102 @@
1
- import f from "./HysPermissionMatrix.vue.js";
1
+ import { defineComponent as A, openBlock as a, createElementBlock as o, mergeProps as B, unref as S, createElementVNode as r, createBlock as c, Fragment as s, createTextVNode as g, renderList as f, toDisplayString as v, createVNode as w } from "vue";
2
+ import b from "../HysCheckbox/HysCheckbox.vue.js";
3
+ import { useHysRootAttrs as H } from "../../config.js";
4
+ const N = { class: "hys-ui-ent-matrix" }, R = /* @__PURE__ */ A({
5
+ __name: "HysPermissionMatrix",
6
+ props: {
7
+ roles: {},
8
+ resources: {},
9
+ modelValue: {},
10
+ disabled: { type: Boolean },
11
+ readonly: { type: Boolean },
12
+ showSelectAll: { type: Boolean, default: !0 }
13
+ },
14
+ emits: ["update:modelValue", "change"],
15
+ setup(l, { emit: x }) {
16
+ const u = l, k = x, V = H();
17
+ function i(t, d) {
18
+ return (t ? [t] : u.resources).flatMap((e) => (d ? [d] : u.roles).map((n) => e + ":" + n));
19
+ }
20
+ function m(t) {
21
+ return t.length > 0 && t.every((d) => u.modelValue[d]);
22
+ }
23
+ function h(t) {
24
+ return !m(t) && t.some((d) => u.modelValue[d]);
25
+ }
26
+ function y(t, d) {
27
+ if (u.disabled || u.readonly) return;
28
+ const e = { ...u.modelValue };
29
+ for (const n of t) e[n] = d;
30
+ k("update:modelValue", e), k("change", e);
31
+ }
32
+ return (t, d) => (a(), o("div", B(S(V), { class: "hys-ui-ent-table-scroll" }), [
33
+ r("table", N, [
34
+ r("thead", null, [
35
+ r("tr", null, [
36
+ r("th", null, [
37
+ l.showSelectAll ? (a(), c(b, {
38
+ key: 0,
39
+ class: "hys-ui-matrix-group",
40
+ "model-value": m(i()),
41
+ indeterminate: h(i()),
42
+ disabled: l.disabled || !l.roles.length || !l.resources.length,
43
+ readonly: l.readonly,
44
+ "aria-label": "全选所有权限",
45
+ label: "资源 / 角色",
46
+ onChange: d[0] || (d[0] = (e) => y(i(), e))
47
+ }, null, 8, ["model-value", "indeterminate", "disabled", "readonly"])) : (a(), o(s, { key: 1 }, [
48
+ g("资源 / 角色")
49
+ ], 64))
50
+ ]),
51
+ (a(!0), o(s, null, f(l.roles, (e) => (a(), o("th", { key: e }, [
52
+ l.showSelectAll ? (a(), c(b, {
53
+ key: 0,
54
+ class: "hys-ui-matrix-group",
55
+ "model-value": m(i(void 0, e)),
56
+ indeterminate: h(i(void 0, e)),
57
+ disabled: l.disabled || !l.resources.length,
58
+ readonly: l.readonly,
59
+ "aria-label": "全选角色 " + e,
60
+ label: e,
61
+ onChange: (n) => y(i(void 0, e), n)
62
+ }, null, 8, ["model-value", "indeterminate", "disabled", "readonly", "aria-label", "label", "onChange"])) : (a(), o(s, { key: 1 }, [
63
+ g(v(e), 1)
64
+ ], 64))
65
+ ]))), 128))
66
+ ])
67
+ ]),
68
+ r("tbody", null, [
69
+ (a(!0), o(s, null, f(l.resources, (e) => (a(), o("tr", { key: e }, [
70
+ r("th", null, [
71
+ l.showSelectAll ? (a(), c(b, {
72
+ key: 0,
73
+ class: "hys-ui-matrix-group",
74
+ "model-value": m(i(e)),
75
+ indeterminate: h(i(e)),
76
+ disabled: l.disabled || !l.roles.length,
77
+ readonly: l.readonly,
78
+ "aria-label": "全选资源 " + e,
79
+ label: e,
80
+ onChange: (n) => y(i(e), n)
81
+ }, null, 8, ["model-value", "indeterminate", "disabled", "readonly", "aria-label", "label", "onChange"])) : (a(), o(s, { key: 1 }, [
82
+ g(v(e), 1)
83
+ ], 64))
84
+ ]),
85
+ (a(!0), o(s, null, f(l.roles, (n) => (a(), o("td", { key: n }, [
86
+ w(b, {
87
+ "aria-label": e + " - " + n,
88
+ "model-value": !!l.modelValue[e + ":" + n],
89
+ disabled: l.disabled,
90
+ readonly: l.readonly,
91
+ onChange: (C) => y([e + ":" + n], C)
92
+ }, null, 8, ["aria-label", "model-value", "disabled", "readonly", "onChange"])
93
+ ]))), 128))
94
+ ]))), 128))
95
+ ])
96
+ ])
97
+ ], 16));
98
+ }
99
+ });
2
100
  export {
3
- f as default
101
+ R as default
4
102
  };
@@ -1,42 +1,7 @@
1
- import { defineComponent as u, useId as s, openBlock as t, createElementBlock as l, mergeProps as c, unref as o, Fragment as m, renderList as v, createElementVNode as b, createTextVNode as h, toDisplayString as p } from "vue";
2
- import { useHysRootAttrs as y } from "../../config.js";
3
- const g = ["aria-label"], f = ["name", "value", "checked", "disabled", "onChange"], L = /* @__PURE__ */ u({
4
- __name: "HysRadioGroup",
5
- props: {
6
- modelValue: {},
7
- options: {},
8
- name: {},
9
- disabled: { type: Boolean },
10
- vertical: { type: Boolean },
11
- ariaLabel: {}
12
- },
13
- emits: ["update:modelValue", "change"],
14
- setup(a, { emit: i }) {
15
- const r = y(), d = s(), n = i;
16
- return (V, k) => (t(), l("div", c(o(r), {
17
- class: "hys-ui-ex-radio",
18
- role: "radiogroup",
19
- "aria-label": a.ariaLabel || "单选组",
20
- style: { flexDirection: a.vertical ? "column" : void 0 }
21
- }), [
22
- (t(!0), l(m, null, v(a.options, (e) => (t(), l("label", {
23
- key: e.value
24
- }, [
25
- b("input", {
26
- type: "radio",
27
- name: a.name || o(d),
28
- value: e.value,
29
- checked: a.modelValue === e.value,
30
- disabled: a.disabled || e.disabled,
31
- onChange: (x) => {
32
- n("update:modelValue", e.value), n("change", e.value);
33
- }
34
- }, null, 40, f),
35
- h(" " + p(e.label), 1)
36
- ]))), 128))
37
- ], 16, g));
38
- }
39
- });
1
+ import o from "./HysRadioGroup2.vue.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-281378b2"]]);
40
5
  export {
41
- L as default
6
+ m as default
42
7
  };
@@ -1,4 +1,82 @@
1
- import f from "./HysRadioGroup.vue.js";
1
+ import { defineComponent as q, useId as V, ref as A, openBlock as u, createElementBlock as t, mergeProps as B, unref as y, Fragment as w, renderList as x, normalizeClass as C, createElementVNode as s, renderSlot as D, createTextVNode as E, toDisplayString as S } from "vue";
2
+ import { useHysRootAttrs as L } from "../../config.js";
3
+ const R = ["aria-label", "aria-disabled", "aria-readonly", "aria-required"], z = ["name", "value", "checked", "disabled", "required", "onChange"], F = /* @__PURE__ */ q({
4
+ __name: "HysRadioGroup",
5
+ props: {
6
+ modelValue: {},
7
+ options: {},
8
+ name: {},
9
+ disabled: { type: Boolean },
10
+ readonly: { type: Boolean },
11
+ required: { type: Boolean },
12
+ vertical: { type: Boolean },
13
+ size: { default: "md" },
14
+ ariaLabel: {}
15
+ },
16
+ emits: ["update:modelValue", "change", "focus", "blur"],
17
+ setup(e, { expose: m, emit: b }) {
18
+ const i = e, o = b, f = L(), v = V(), n = A();
19
+ function h(r) {
20
+ var a;
21
+ if (i.disabled || i.readonly || r.disabled) {
22
+ (a = n.value) == null || a.querySelectorAll("input").forEach((d, k) => {
23
+ var c;
24
+ return d.checked = ((c = i.options[k]) == null ? void 0 : c.value) === i.modelValue;
25
+ });
26
+ return;
27
+ }
28
+ const l = r.value !== i.modelValue;
29
+ o("update:modelValue", r.value), l && o("change", r.value);
30
+ }
31
+ function g(r) {
32
+ i.readonly && [" ", "Enter", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(r.key) && r.preventDefault();
33
+ }
34
+ return m({ focus: () => {
35
+ var l, a, d;
36
+ (d = ((l = n.value) == null ? void 0 : l.querySelector("input:checked:not(:disabled)")) || ((a = n.value) == null ? void 0 : a.querySelector("input:not(:disabled)"))) == null || d.focus();
37
+ } }), (r, l) => (u(), t("div", B({
38
+ ref_key: "root",
39
+ ref: n
40
+ }, y(f), {
41
+ class: ["hys-ui-ex-radio", ["hys-ui-radio-" + e.size, { "hys-ui-radio-disabled": e.disabled, "hys-ui-radio-readonly": e.readonly }]],
42
+ role: "radiogroup",
43
+ "aria-label": e.ariaLabel || "单选组",
44
+ "aria-disabled": e.disabled || void 0,
45
+ "aria-readonly": e.readonly || void 0,
46
+ "aria-required": e.required || void 0,
47
+ style: { flexDirection: e.vertical ? "column" : void 0 },
48
+ onKeydown: g
49
+ }), [
50
+ (u(!0), t(w, null, x(e.options, (a) => (u(), t("label", {
51
+ key: a.value,
52
+ class: C(["hys-ui-radio-option", { "hys-ui-radio-option-disabled": !e.disabled && a.disabled }])
53
+ }, [
54
+ s("input", {
55
+ class: "hys-ui-radio-native",
56
+ type: "radio",
57
+ name: e.name || y(v),
58
+ value: a.value,
59
+ checked: e.modelValue === a.value,
60
+ disabled: e.disabled || a.disabled,
61
+ required: e.required,
62
+ onClick: l[0] || (l[0] = (d) => e.readonly && d.preventDefault()),
63
+ onChange: (d) => h(a),
64
+ onFocus: l[1] || (l[1] = (d) => o("focus", d)),
65
+ onBlur: l[2] || (l[2] = (d) => o("blur", d))
66
+ }, null, 40, z),
67
+ l[3] || (l[3] = s("span", {
68
+ class: "hys-ui-radio-box",
69
+ "aria-hidden": "true"
70
+ }, null, -1)),
71
+ s("span", null, [
72
+ D(r.$slots, "label", { option: a }, () => [
73
+ E(S(a.label), 1)
74
+ ], !0)
75
+ ])
76
+ ], 2))), 128))
77
+ ], 16, R));
78
+ }
79
+ });
2
80
  export {
3
- f as default
81
+ F as default
4
82
  };