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
@@ -2,12 +2,12 @@ import { defineComponent as Mt, ref as v, watch as K, computed as b, nextTick as
2
2
  import { useHysRootAttrs as Rt } from "../../config.js";
3
3
  import { Settings2 as Lt, ChevronUp as Et, ChevronDown as Ae, Search as Bt, ChevronRight as We } from "lucide-vue-next";
4
4
  import { useMotion as Tt } from "../../motion/useMotion.js";
5
- import $t from "../HysSortableList/HysSortableList.vue.js";
5
+ import Ut from "../HysSortableList/HysSortableList.vue.js";
6
6
  import Ie from "../HysSelect/HysSelect.vue.js";
7
7
  import ze from "../HysInput/HysInput.vue.js";
8
8
  import Re from "../HysCheckbox/HysCheckbox.vue.js";
9
9
  import M from "../HysButton/HysButton.vue.js";
10
- import Ut from "../HysPagination/HysPagination.vue.js";
10
+ import $t from "../HysPagination/HysPagination.vue.js";
11
11
  const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-search" }, Nt = {
12
12
  key: 0,
13
13
  class: "hys-ui-pf-grid-group-label"
@@ -178,7 +178,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
178
178
  function it(t, l) {
179
179
  !o.editable || !l.editable || (Q.value = { id: Z(t, 0), key: l.key }, ge.value = oe(t, l.key));
180
180
  }
181
- function $e(t, l) {
181
+ function Ue(t, l) {
182
182
  Q.value && (V("cellEdit", { row: t, rowKey: Q.value.id, column: l.key, value: ge.value }), Q.value = null);
183
183
  }
184
184
  function ut() {
@@ -196,7 +196,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
196
196
  if (!e.length) return "—";
197
197
  const a = t.summary === "sum" ? e.reduce((n, d) => n + d, 0) : t.summary === "avg" ? e.reduce((n, d) => n + d, 0) / e.length : t.summary === "min" ? Math.min(...e) : Math.max(...e);
198
198
  return new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 2 }).format(a);
199
- }, we = b(() => be.value.map((t, l) => Z(t, l))), Ue = b(() => we.value.length > 0 && we.value.every((t) => h.value.includes(t))), ft = b(() => we.value.some((t) => h.value.includes(t)));
199
+ }, we = b(() => be.value.map((t, l) => Z(t, l))), $e = b(() => we.value.length > 0 && we.value.every((t) => h.value.includes(t))), ft = b(() => we.value.some((t) => h.value.includes(t)));
200
200
  function yt(t, l) {
201
201
  h.value = l ? [.../* @__PURE__ */ new Set([...h.value, t])] : h.value.filter((e) => e !== t), V("selectionChange", h.value);
202
202
  }
@@ -240,7 +240,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
240
240
  l.resizable !== !1 && (t.preventDefault(), t.stopPropagation(), T = { key: l.key, start: t.clientX, width: p.value[l.key] || l.width || 160, min: l.minWidth || 80, max: l.maxWidth || 800 }, document.body.style.cursor = "col-resize", window.addEventListener("pointermove", Ne), window.addEventListener("pointerup", Ce));
241
241
  }
242
242
  const { effectiveMotion: xe } = Tt(), se = v(null), W = v(null);
243
- let $ = 0, re = null, Ve = 0;
243
+ let U = 0, re = null, Ve = 0;
244
244
  const ye = /* @__PURE__ */ new Set();
245
245
  function ie() {
246
246
  Ve++;
@@ -251,7 +251,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
251
251
  t === "off" && ie();
252
252
  });
253
253
  function _() {
254
- cancelAnimationFrame($), $ = 0, re = null, se.value = null, W.value = null;
254
+ cancelAnimationFrame(U), U = 0, re = null, se.value = null, W.value = null;
255
255
  }
256
256
  function bt(t, l) {
257
257
  if (T || l.reorderable === !1 || !t.dataTransfer) {
@@ -270,12 +270,12 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
270
270
  }
271
271
  function wt(t, l) {
272
272
  if (!De(l)) {
273
- cancelAnimationFrame($), $ = 0, re = null, W.value = null;
273
+ cancelAnimationFrame(U), U = 0, re = null, W.value = null;
274
274
  return;
275
275
  }
276
- t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), re = { element: t.currentTarget, column: l, x: t.clientX }, !$ && ($ = requestAnimationFrame(() => {
276
+ t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), re = { element: t.currentTarget, column: l, x: t.clientX }, !U && (U = requestAnimationFrame(() => {
277
277
  var n;
278
- $ = 0;
278
+ U = 0;
279
279
  const e = re;
280
280
  if (re = null, !e || !De(e.column)) return;
281
281
  const a = Oe(e.column, e.x, e.element);
@@ -283,7 +283,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
283
283
  }));
284
284
  }
285
285
  function Ct(t) {
286
- t.relatedTarget instanceof Element && t.relatedTarget.closest("th[data-column-key]") && t.currentTarget.contains(t.relatedTarget) || (cancelAnimationFrame($), $ = 0, re = null, W.value = null);
286
+ t.relatedTarget instanceof Element && t.relatedTarget.closest("th[data-column-key]") && t.currentTarget.contains(t.relatedTarget) || (cancelAnimationFrame(U), U = 0, re = null, W.value = null);
287
287
  }
288
288
  function Pe() {
289
289
  var t;
@@ -300,15 +300,15 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
300
300
  const e = l.getBoundingClientRect(), a = Math.max(0, e.top), n = Math.min(window.innerHeight, e.bottom), d = Math.max(0, e.left), i = Math.min(window.innerWidth, e.right);
301
301
  if (a >= n || d >= i) return;
302
302
  const y = /* @__PURE__ */ new Map();
303
- for (const [I, U] of Pe()) {
303
+ for (const [I, $] of Pe()) {
304
304
  const S = t.get(I);
305
- S && U.right > d && U.left < i && Math.abs(S.left - U.left) > 0.5 && y.set(I, S.left - U.left);
305
+ S && $.right > d && $.left < i && Math.abs(S.left - $.left) > 0.5 && y.set(I, S.left - $.left);
306
306
  }
307
307
  const f = [];
308
308
  for (const I of Array.from(l.querySelectorAll("thead tr,tbody tr,tfoot tr"))) {
309
- const U = I.getBoundingClientRect();
310
- if (U.top >= n) break;
311
- if (!(U.bottom <= a)) {
309
+ const $ = I.getBoundingClientRect();
310
+ if ($.top >= n) break;
311
+ if (!($.bottom <= a)) {
312
312
  for (const S of Array.from(I.children))
313
313
  if (S instanceof HTMLElement && y.has(S.dataset.columnKey || "") && f.push(S), f.length >= Xe) break;
314
314
  if (f.length >= Xe) break;
@@ -316,7 +316,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
316
316
  }
317
317
  const ee = xe.value === "full" ? 280 : 180;
318
318
  for (const I of f) {
319
- const U = y.get(I.dataset.columnKey), S = I.animate([{ transform: "translateX(" + U + "px)" }, { transform: "translateX(0)" }], { duration: ee, easing: "cubic-bezier(.2,.8,.2,1)" });
319
+ const $ = y.get(I.dataset.columnKey), S = I.animate([{ transform: "translateX(" + $ + "px)" }, { transform: "translateX(0)" }], { duration: ee, easing: "cubic-bezier(.2,.8,.2,1)" });
320
320
  ye.add(S), S.onfinish = () => ye.delete(S), S.oncancel = () => ye.delete(S);
321
321
  }
322
322
  }
@@ -455,7 +455,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
455
455
  }, 8, ["aria-expanded"]),
456
456
  Y.value ? (s(), u("div", jt, [
457
457
  l[19] || (l[19] = g("strong", null, "显示列与排序", -1)),
458
- m($t, {
458
+ m(Ut, {
459
459
  class: "hys-ui-pf-grid-settings-list",
460
460
  "model-value": tt.value,
461
461
  "onUpdate:modelValue": l[7] || (l[7] = (e) => D.value = e.map((a) => a.id))
@@ -518,8 +518,8 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
518
518
  r.selectable ? (s(), u("th", Wt, [
519
519
  m(Re, {
520
520
  "aria-label": "选择当前页全部行",
521
- "model-value": Ue.value,
522
- indeterminate: ft.value && !Ue.value,
521
+ "model-value": $e.value,
522
+ indeterminate: ft.value && !$e.value,
523
523
  "onUpdate:modelValue": vt
524
524
  }, null, 8, ["model-value", "indeterminate"])
525
525
  ])) : k("", !0),
@@ -718,10 +718,10 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
718
718
  onClick: l[11] || (l[11] = A(() => {
719
719
  }, ["stop"])),
720
720
  onKeydown: [
721
- ve(A((f) => $e(e.row, a), ["stop"]), ["enter"]),
721
+ ve(A((f) => Ue(e.row, a), ["stop"]), ["enter"]),
722
722
  l[12] || (l[12] = ve(A((f) => Q.value = null, ["stop"]), ["esc"]))
723
723
  ],
724
- onFocusout: (f) => $e(e.row, a)
724
+ onFocusout: (f) => Ue(e.row, a)
725
725
  }, null, 8, ["modelValue", "aria-label", "onKeydown", "onFocusout"])) : (s(), u(B, { key: 1 }, [
726
726
  r.treeMode && a.key === ((i = L.value[0]) == null ? void 0 : i.key) && e.row.__pfHasChildren ? (s(), ce(M, {
727
727
  key: 0,
@@ -780,7 +780,7 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
780
780
  ], 6)
781
781
  ], 32),
782
782
  g("footer", vl, [
783
- m(Ut, {
783
+ m($t, {
784
784
  page: C.value,
785
785
  total: r.serverMode ? r.totalRows ?? r.rows.length : q.value.length,
786
786
  "page-size": ne.value,
@@ -1,7 +1,7 @@
1
1
  import o from "./HysDrawer2.vue.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-76c29405"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-8ba9617d"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,16 +1,17 @@
1
- import { defineComponent as B, ref as b, toRef as E, watch as O, onDeactivated as $, openBlock as r, createBlock as D, Teleport as S, createVNode as p, Transition as x, withCtx as H, unref as c, withDirectives as M, createElementBlock as f, mergeProps as N, withModifiers as R, createElementVNode as n, normalizeStyle as V, renderSlot as y, toDisplayString as z, createCommentVNode as h, vShow as A } from "vue";
2
- import { useHysRootAttrs as P } from "../../config.js";
3
- import { X as T } from "lucide-vue-next";
4
- import { useDialog as q } from "../../composables/useDialog.js";
5
- const X = ["aria-label", "aria-busy"], j = { class: "hys-ui-dialog-head" }, F = ["disabled"], G = { class: "hys-ui-drawer-body" }, I = {
1
+ import { defineComponent as x, ref as w, computed as E, toRef as O, watch as $, onDeactivated as D, openBlock as n, createBlock as S, Teleport as H, createVNode as b, Transition as M, withCtx as N, unref as h, withDirectives as R, createElementBlock as f, mergeProps as V, withModifiers as z, createElementVNode as d, normalizeStyle as A, renderSlot as y, toDisplayString as P, createCommentVNode as m, vShow as T } from "vue";
2
+ import { useHysRootAttrs as q } from "../../config.js";
3
+ import { X as W } from "lucide-vue-next";
4
+ import { useDialog as X } from "../../composables/useDialog.js";
5
+ const j = ["aria-label", "aria-busy"], F = { class: "hys-ui-dialog-head" }, G = ["disabled"], I = { class: "hys-ui-drawer-body" }, J = {
6
6
  key: 0,
7
7
  class: "hys-ui-dialog-foot"
8
- }, U = /* @__PURE__ */ B({
8
+ }, Y = /* @__PURE__ */ x({
9
9
  __name: "HysDrawer",
10
10
  props: {
11
11
  open: { type: Boolean },
12
12
  title: {},
13
13
  width: { default: "520px" },
14
+ height: {},
14
15
  closeOnMask: { type: Boolean, default: !0 },
15
16
  closeOnEscape: { type: Boolean, default: !0 },
16
17
  showClose: { type: Boolean, default: !0 },
@@ -20,76 +21,76 @@ const X = ["aria-label", "aria-busy"], j = { class: "hys-ui-dialog-head" }, F =
20
21
  beforeClose: {}
21
22
  },
22
23
  emits: ["close", "closeError"],
23
- setup(e, { expose: g, emit: C }) {
24
- const k = P(), a = e, m = C, d = b(), o = b(!1), { active: v } = q(E(a, "open"), d, () => {
25
- a.closeOnEscape && s("escape");
24
+ setup(t, { expose: g, emit: C }) {
25
+ const k = q(), e = t, p = C, u = w(), a = w(!1), B = E(() => ({ ...e.fullscreen ? { width: "100%", height: "100dvh", maxWidth: "100vw", maxHeight: "100dvh" } : e.placement === "top" || e.placement === "bottom" ? { width: "100%", height: e.height || e.width, maxHeight: "100dvh" } : { width: e.width }, "--hys-ui-drawer-enter-x": e.placement === "left" ? "-100%" : e.placement === "right" ? "100%" : "0px", "--hys-ui-drawer-enter-y": e.placement === "top" ? "-100%" : e.placement === "bottom" ? "100%" : "0px" })), { active: r } = X(O(e, "open"), u, () => {
26
+ e.closeOnEscape && i("escape");
26
27
  });
27
- let i = 0;
28
- function w() {
29
- i++, o.value = !1;
28
+ let s = 0;
29
+ function v() {
30
+ s++, a.value = !1;
30
31
  }
31
- O(() => a.open, (t) => {
32
- t || w();
33
- }), $(w);
34
- async function s(t = "button") {
35
- if (o.value || !a.open) return;
36
- const l = ++i;
37
- o.value = !0;
32
+ $(() => e.open, (o) => {
33
+ o || v();
34
+ }), D(v);
35
+ async function i(o = "button") {
36
+ if (a.value || !e.open || !r.value) return;
37
+ const l = ++s;
38
+ a.value = !0;
38
39
  try {
39
- if (a.beforeClose && await a.beforeClose(t) === !1) return;
40
- v.value && l === i && m("close");
41
- } catch (u) {
42
- m("closeError", u);
40
+ if (e.beforeClose && await e.beforeClose(o) === !1) return;
41
+ r.value && l === s && p("close");
42
+ } catch (c) {
43
+ r.value && l === s && p("closeError", c);
43
44
  } finally {
44
- l === i && (o.value = !1);
45
+ l === s && (a.value = !1);
45
46
  }
46
47
  }
47
- return g({ close: s, element: d }), (t, l) => (r(), D(S, { to: "body" }, [
48
- p(x, { name: "hys-ui-drawer-motion" }, {
49
- default: H(() => [
50
- c(v) && (e.open || !e.destroyOnClose) ? M((r(), f("div", N({ key: 0 }, c(k), {
51
- class: ["hys-ui-overlay hys-ui-drawer-overlay", "hys-ui-drawer-" + e.placement],
52
- onPointerdown: l[1] || (l[1] = R((u) => e.closeOnMask && s("mask"), ["self"]))
48
+ return g({ close: i, element: u }), (o, l) => (n(), S(H, { to: "body" }, [
49
+ b(M, { name: "hys-ui-drawer-motion" }, {
50
+ default: N(() => [
51
+ h(r) && (t.open || !t.destroyOnClose) ? R((n(), f("div", V({ key: 0 }, h(k), {
52
+ class: ["hys-ui-overlay hys-ui-drawer-overlay", "hys-ui-drawer-" + t.placement],
53
+ onPointerdown: l[1] || (l[1] = z((c) => t.closeOnMask && i("mask"), ["self"]))
53
54
  }), [
54
- n("aside", {
55
+ d("aside", {
55
56
  ref_key: "dialog",
56
- ref: d,
57
+ ref: u,
57
58
  tabindex: "-1",
58
59
  class: "hys-ui-drawer",
59
60
  role: "dialog",
60
61
  "aria-modal": "true",
61
- "aria-label": e.title,
62
- "aria-busy": o.value,
63
- style: V(e.placement === "top" || e.placement === "bottom" ? { width: "100%", height: e.width, maxHeight: "100dvh" } : { width: e.width })
62
+ "aria-label": t.title,
63
+ "aria-busy": a.value,
64
+ style: A(B.value)
64
65
  }, [
65
- n("header", j, [
66
- y(t.$slots, "header", {}, () => [
67
- n("h3", null, z(e.title), 1)
66
+ d("header", F, [
67
+ y(o.$slots, "header", {}, () => [
68
+ d("h3", null, P(t.title), 1)
68
69
  ], !0),
69
- e.showClose ? (r(), f("button", {
70
+ t.showClose ? (n(), f("button", {
70
71
  key: 0,
71
72
  type: "button",
72
73
  class: "hys-ui-icon-action",
73
74
  "aria-label": "关闭",
74
- disabled: o.value,
75
- onClick: l[0] || (l[0] = (u) => s("button"))
75
+ disabled: a.value,
76
+ onClick: l[0] || (l[0] = (c) => i("button"))
76
77
  }, [
77
- p(c(T), { size: 18 })
78
- ], 8, F)) : h("", !0)
78
+ b(h(W), { size: 18 })
79
+ ], 8, G)) : m("", !0)
79
80
  ]),
80
- n("div", G, [
81
- y(t.$slots, "default", {}, void 0, !0)
81
+ d("div", I, [
82
+ y(o.$slots, "default", {}, void 0, !0)
82
83
  ]),
83
- t.$slots.footer ? (r(), f("footer", I, [
84
- y(t.$slots, "footer", {
85
- close: s,
86
- closing: o.value
84
+ o.$slots.footer ? (n(), f("footer", J, [
85
+ y(o.$slots, "footer", {
86
+ close: i,
87
+ closing: a.value
87
88
  }, void 0, !0)
88
- ])) : h("", !0)
89
- ], 12, X)
89
+ ])) : m("", !0)
90
+ ], 12, j)
90
91
  ], 16)), [
91
- [A, e.open]
92
- ]) : h("", !0)
92
+ [T, t.open]
93
+ ]) : m("", !0)
93
94
  ]),
94
95
  _: 3
95
96
  })
@@ -97,5 +98,5 @@ const X = ["aria-label", "aria-busy"], j = { class: "hys-ui-dialog-head" }, F =
97
98
  }
98
99
  });
99
100
  export {
100
- U as default
101
+ Y as default
101
102
  };
@@ -1,65 +1,7 @@
1
- import { defineComponent as k, useModel as C, ref as D, onUnmounted as V, openBlock as r, createElementBlock as s, mergeProps as b, unref as M, createElementVNode as n, withModifiers as i, normalizeClass as h, createTextVNode as x, Fragment as B, renderList as _, toDisplayString as m, createCommentVNode as w, mergeModels as A } from "vue";
2
- import { useHysRootAttrs as F } from "../../config.js";
3
- const N = { class: "hys-ui-ent-files" }, $ = ["onClick"], z = ["onClick"], E = {
4
- key: 0,
5
- class: "hys-ui-ent-muted"
6
- }, T = /* @__PURE__ */ k({
7
- __name: "HysFileManager",
8
- props: {
9
- modelValue: { default: () => [] },
10
- modelModifiers: {}
11
- },
12
- emits: /* @__PURE__ */ A(["upload", "remove", "download"], ["update:modelValue"]),
13
- setup(p, { emit: f }) {
14
- const v = F(), u = C(p, "modelValue"), a = f, l = D(!1);
15
- function d(t) {
16
- t && (a("upload", Array.from(t)), l.value = !1);
17
- }
18
- function g(t) {
19
- var e;
20
- t.preventDefault(), d(((e = t.dataTransfer) == null ? void 0 : e.files) || null);
21
- }
22
- V(() => l.value = !1);
23
- function y(t) {
24
- return t < 1024 ? t + " B" : (t / 1024).toFixed(1) + " KB";
25
- }
26
- return (t, e) => (r(), s("div", b(M(v), { class: "hys-ui-ent-panel" }), [
27
- n("label", {
28
- class: h(["hys-ui-ent-drop", { "hys-ui-dragging": l.value }]),
29
- onDragenter: e[1] || (e[1] = i((o) => l.value = !0, ["prevent"])),
30
- onDragleave: e[2] || (e[2] = i((o) => l.value = !1, ["prevent"])),
31
- onDragover: e[3] || (e[3] = i(() => {
32
- }, ["prevent"])),
33
- onDrop: g
34
- }, [
35
- n("input", {
36
- type: "file",
37
- multiple: "",
38
- onChange: e[0] || (e[0] = (o) => {
39
- d(o.target.files), o.target.value = "";
40
- })
41
- }, null, 32),
42
- e[4] || (e[4] = x("拖拽文件至此或点击选择(由业务层负责上传)", -1))
43
- ], 34),
44
- n("ul", N, [
45
- (r(!0), s(B, null, _(u.value, (o) => (r(), s("li", {
46
- key: o.id
47
- }, [
48
- n("span", null, m(o.name) + " · " + m(y(o.size)), 1),
49
- n("button", {
50
- type: "button",
51
- onClick: (c) => a("download", o.id)
52
- }, "下载", 8, $),
53
- n("button", {
54
- type: "button",
55
- onClick: (c) => a("remove", o.id)
56
- }, "移除", 8, z)
57
- ]))), 128))
58
- ]),
59
- u.value.length ? w("", !0) : (r(), s("p", E, "暂无附件"))
60
- ], 16));
61
- }
62
- });
1
+ import o from "./HysFileManager2.vue.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fc3b6749"]]);
63
5
  export {
64
- T as default
6
+ f as default
65
7
  };
@@ -1,4 +1,87 @@
1
- import f from "./HysFileManager.vue.js";
1
+ import { defineComponent as x, ref as y, useModel as V, onUnmounted as h, onDeactivated as B, watch as M, openBlock as s, createElementBlock as r, mergeProps as $, unref as A, createElementVNode as i, withModifiers as o, withKeys as g, normalizeClass as F, createTextVNode as K, Fragment as N, renderList as z, toDisplayString as c, createCommentVNode as E, mergeModels as p } from "vue";
2
+ import { useHysRootAttrs as H } from "../../config.js";
3
+ const R = ["aria-disabled", "tabindex"], T = ["disabled"], L = { class: "hys-ui-ent-files" }, P = ["disabled", "onClick"], S = ["disabled", "onClick"], U = {
4
+ key: 0,
5
+ class: "hys-ui-ent-muted"
6
+ }, G = /* @__PURE__ */ x({
7
+ __name: "HysFileManager",
8
+ props: /* @__PURE__ */ p({
9
+ disabled: { type: Boolean }
10
+ }, {
11
+ modelValue: { default: () => [] },
12
+ modelModifiers: {}
13
+ }),
14
+ emits: /* @__PURE__ */ p(["upload", "remove", "download"], ["update:modelValue"]),
15
+ setup(t, { emit: k }) {
16
+ const C = H(), m = t, u = y(), v = V(t, "modelValue"), b = k, d = y(!1);
17
+ function f(n) {
18
+ m.disabled || !n || (b("upload", Array.from(n)), d.value = !1);
19
+ }
20
+ function D(n) {
21
+ var e;
22
+ n.preventDefault(), f(((e = n.dataTransfer) == null ? void 0 : e.files) || null);
23
+ }
24
+ h(() => d.value = !1), B(() => d.value = !1), M(() => m.disabled, () => d.value = !1);
25
+ function w(n) {
26
+ return n < 1024 ? n + " B" : (n / 1024).toFixed(1) + " KB";
27
+ }
28
+ return (n, e) => (s(), r("div", $(A(C), { class: "hys-ui-ent-panel" }), [
29
+ i("label", {
30
+ class: F(["hys-ui-ent-drop", { "hys-ui-dragging": d.value }]),
31
+ role: "button",
32
+ "aria-disabled": t.disabled,
33
+ tabindex: t.disabled ? -1 : 0,
34
+ "aria-label": "选择或拖入文件",
35
+ onKeydown: [
36
+ e[1] || (e[1] = g(o((l) => {
37
+ var a;
38
+ return !t.disabled && ((a = u.value) == null ? void 0 : a.click());
39
+ }, ["prevent"]), ["enter"])),
40
+ e[2] || (e[2] = g(o((l) => {
41
+ var a;
42
+ return !t.disabled && ((a = u.value) == null ? void 0 : a.click());
43
+ }, ["prevent"]), ["space"]))
44
+ ],
45
+ onDragenter: e[3] || (e[3] = o((l) => !t.disabled && (d.value = !0), ["prevent"])),
46
+ onDragleave: e[4] || (e[4] = o((l) => d.value = !1, ["prevent"])),
47
+ onDragover: e[5] || (e[5] = o(() => {
48
+ }, ["prevent"])),
49
+ onDrop: D
50
+ }, [
51
+ i("input", {
52
+ ref_key: "input",
53
+ ref: u,
54
+ type: "file",
55
+ hidden: "",
56
+ disabled: t.disabled,
57
+ multiple: "",
58
+ onChange: e[0] || (e[0] = (l) => {
59
+ f(l.target.files), l.target.value = "";
60
+ })
61
+ }, null, 40, T),
62
+ e[6] || (e[6] = K("拖拽文件至此或点击选择(由业务层负责上传)", -1))
63
+ ], 42, R),
64
+ i("ul", L, [
65
+ (s(!0), r(N, null, z(v.value, (l) => (s(), r("li", {
66
+ key: l.id
67
+ }, [
68
+ i("span", null, c(l.name) + " · " + c(w(l.size)), 1),
69
+ i("button", {
70
+ type: "button",
71
+ disabled: t.disabled,
72
+ onClick: (a) => !t.disabled && b("download", l.id)
73
+ }, "下载", 8, P),
74
+ i("button", {
75
+ type: "button",
76
+ disabled: t.disabled,
77
+ onClick: (a) => !t.disabled && b("remove", l.id)
78
+ }, "移除", 8, S)
79
+ ]))), 128))
80
+ ]),
81
+ v.value.length ? E("", !0) : (s(), r("p", U, "暂无附件"))
82
+ ], 16));
83
+ }
84
+ });
2
85
  export {
3
- f as default
86
+ G as default
4
87
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./HysForm2.vue.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-5aec88fc"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-313cea92"]]);
5
5
  export {
6
- c as default
6
+ p as default
7
7
  };