hys-ui 0.2.0 → 0.3.0

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 (201) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +15 -1
  3. package/dist/components/HysAlert/HysAlert.vue.js +5 -54
  4. package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
  5. package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
  6. package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
  7. package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
  8. package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
  9. package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
  10. package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
  11. package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
  12. package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
  13. package/dist/components/HysCascader/HysCascader.vue.js +2 -2
  14. package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
  15. package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
  16. package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
  17. package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
  18. package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
  19. package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
  20. package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
  21. package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
  22. package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
  23. package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
  24. package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
  25. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  26. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1008 -559
  27. package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
  28. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
  29. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
  30. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
  31. package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
  32. package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
  33. package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
  34. package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
  35. package/dist/components/HysFormItem/HysFormItem.vue.js +2 -2
  36. package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
  37. package/dist/components/HysGantt/HysGantt.vue.js +1 -1
  38. package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
  39. package/dist/components/HysMention/HysMention.vue.js +1 -1
  40. package/dist/components/HysMention/HysMention2.vue.js +112 -100
  41. package/dist/components/HysModal/HysModal.vue.js +2 -2
  42. package/dist/components/HysModal/HysModal2.vue.js +490 -85
  43. package/dist/components/HysPopover/HysPopover.vue.js +5 -91
  44. package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
  45. package/dist/components/HysProgress/HysProgress.vue.js +2 -2
  46. package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
  47. package/dist/components/HysSelect/HysSelect.vue.js +2 -2
  48. package/dist/components/HysSelect/HysSelect2.vue.js +730 -594
  49. package/dist/components/HysSlider/HysSlider.vue.js +2 -2
  50. package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
  51. package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
  52. package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
  53. package/dist/components/HysTable/HysTable.vue.js +2 -2
  54. package/dist/components/HysTable/HysTable2.vue.js +389 -368
  55. package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
  56. package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
  57. package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
  58. package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
  59. package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
  60. package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
  61. package/dist/components/HysTour/HysTour.vue.js +46 -42
  62. package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
  63. package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
  64. package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
  65. package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
  66. package/dist/components/HysTree/HysTree.vue.js +2 -2
  67. package/dist/components/HysTree/HysTree2.vue.js +195 -184
  68. package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
  69. package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
  70. package/dist/components/HysUpload/HysUpload.vue.js +2 -2
  71. package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
  72. package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
  73. package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
  74. package/dist/composables/color.js +97 -0
  75. package/dist/composables/dataGrid.js +68 -0
  76. package/dist/composables/drawer.js +17 -0
  77. package/dist/composables/feedback.js +14 -0
  78. package/dist/composables/menu.js +96 -0
  79. package/dist/composables/modal.js +14 -0
  80. package/dist/composables/overlayManager.js +48 -18
  81. package/dist/composables/progress.js +94 -0
  82. package/dist/composables/tagInput.js +16 -0
  83. package/dist/composables/timeline.js +19 -0
  84. package/dist/composables/transfer.js +19 -17
  85. package/dist/composables/upload.js +55 -0
  86. package/dist/composables/uploadRequest.js +58 -0
  87. package/dist/composables/useAlert.js +124 -0
  88. package/dist/composables/useColorPicker.js +402 -0
  89. package/dist/composables/useContextMenu.js +514 -0
  90. package/dist/composables/useDataGridRemote.js +67 -0
  91. package/dist/composables/useDialog.js +86 -43
  92. package/dist/composables/useDrawerPush.js +33 -0
  93. package/dist/composables/useDrawerResize.js +221 -0
  94. package/dist/composables/useFloating.js +110 -76
  95. package/dist/composables/useHysModal.js +185 -0
  96. package/dist/composables/useModal.js +295 -0
  97. package/dist/composables/useModalInteraction.js +394 -0
  98. package/dist/composables/usePopupSurface.js +458 -0
  99. package/dist/composables/useTagInput.js +313 -0
  100. package/dist/composables/useTransferMotion.js +185 -0
  101. package/dist/composables/useUpload.js +472 -0
  102. package/dist/composables/useUploadModel.js +65 -0
  103. package/dist/composables/useUploadRequests.js +266 -0
  104. package/dist/composables/useVirtualTableLayout.js +277 -0
  105. package/dist/composables/virtualTable.js +43 -0
  106. package/dist/index.js +27 -24
  107. package/dist/internal/PopupReference.js +39 -0
  108. package/dist/internal/PopupSurfacePanel.vue.js +7 -0
  109. package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
  110. package/dist/motion/PopupMotion.js +105 -0
  111. package/dist/motion/popup.js +10 -0
  112. package/dist/style.css +1 -1
  113. package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
  114. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
  115. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
  116. package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
  117. package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
  118. package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
  119. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
  120. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
  121. package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
  122. package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
  123. package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
  124. package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
  125. package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
  126. package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
  127. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
  128. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +1 -1
  129. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
  130. package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
  131. package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
  132. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
  133. package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -1
  134. package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
  135. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
  136. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
  137. package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
  138. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +13 -4
  139. package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
  140. package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
  141. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +2 -2
  142. package/dist/types/components/HysTable/HysTable.vue.d.ts +4 -4
  143. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
  144. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
  145. package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
  146. package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
  147. package/dist/types/components/HysTour/HysTour.vue.d.ts +2 -1
  148. package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
  149. package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
  150. package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
  151. package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
  152. package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
  153. package/dist/types/composables/autocomplete.d.ts +3 -0
  154. package/dist/types/composables/avatar.d.ts +3 -0
  155. package/dist/types/composables/cascader.d.ts +3 -0
  156. package/dist/types/composables/color.d.ts +97 -0
  157. package/dist/types/composables/dataGrid.d.ts +100 -0
  158. package/dist/types/composables/datePicker.d.ts +3 -0
  159. package/dist/types/composables/drawer.d.ts +102 -0
  160. package/dist/types/composables/feedback.d.ts +98 -0
  161. package/dist/types/composables/formContext.d.ts +2 -0
  162. package/dist/types/composables/menu.d.ts +183 -0
  163. package/dist/types/composables/modal.d.ts +183 -0
  164. package/dist/types/composables/overlayManager.d.ts +7 -3
  165. package/dist/types/composables/popupSurface.d.ts +83 -0
  166. package/dist/types/composables/progress.d.ts +92 -0
  167. package/dist/types/composables/selectOptions.d.ts +2 -0
  168. package/dist/types/composables/table.d.ts +3 -0
  169. package/dist/types/composables/tagInput.d.ts +96 -0
  170. package/dist/types/composables/timeline.d.ts +82 -0
  171. package/dist/types/composables/transfer.d.ts +7 -0
  172. package/dist/types/composables/tree.d.ts +3 -0
  173. package/dist/types/composables/treeSelect.d.ts +3 -0
  174. package/dist/types/composables/upload.d.ts +202 -0
  175. package/dist/types/composables/uploadRequest.d.ts +3 -0
  176. package/dist/types/composables/useAlert.d.ts +21 -0
  177. package/dist/types/composables/useCascader.d.ts +1 -1
  178. package/dist/types/composables/useColorPicker.d.ts +101 -0
  179. package/dist/types/composables/useContextMenu.d.ts +81 -0
  180. package/dist/types/composables/useDataGridRemote.d.ts +15 -0
  181. package/dist/types/composables/useDialog.d.ts +16 -3
  182. package/dist/types/composables/useDrawerPush.d.ts +6 -0
  183. package/dist/types/composables/useDrawerResize.d.ts +27 -0
  184. package/dist/types/composables/useFloating.d.ts +21 -2
  185. package/dist/types/composables/useHysModal.d.ts +44 -0
  186. package/dist/types/composables/useModal.d.ts +62 -0
  187. package/dist/types/composables/useModalInteraction.d.ts +27 -0
  188. package/dist/types/composables/usePopupSurface.d.ts +3341 -0
  189. package/dist/types/composables/useTagInput.d.ts +66 -0
  190. package/dist/types/composables/useTransferMotion.d.ts +36 -0
  191. package/dist/types/composables/useUpload.d.ts +94 -0
  192. package/dist/types/composables/useUploadModel.d.ts +14 -0
  193. package/dist/types/composables/useUploadRequests.d.ts +38 -0
  194. package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
  195. package/dist/types/composables/virtualTable.d.ts +126 -0
  196. package/dist/types/index.d.ts +17 -2
  197. package/dist/types/internal/PopupReference.d.ts +18 -0
  198. package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
  199. package/dist/types/motion/PopupMotion.d.ts +59 -0
  200. package/dist/types/motion/popup.d.ts +12 -0
  201. package/package.json +1 -1
@@ -0,0 +1,97 @@
1
+ const m = (t, n = 0, r = 1) => Math.max(n, Math.min(r, t)), M = (t) => t.trim() !== "" && Number.isFinite(Number(t)) ? Number(t) : void 0;
2
+ function v(t, n) {
3
+ const r = t.endsWith("%"), s = M(r ? t.slice(0, -1) : t);
4
+ return s === void 0 ? void 0 : m(s / (r ? 100 : n));
5
+ }
6
+ function x(t) {
7
+ var s;
8
+ const n = t.match(/^([-+]?(?:\d*\.)?\d+)(deg|rad|turn|grad)?$/i);
9
+ return n ? (Number(n[1]) * ({ deg: 1, rad: 180 / Math.PI, turn: 360, grad: 0.9 }[((s = n[2]) == null ? void 0 : s.toLowerCase()) ?? "deg"] ?? 1) % 360 + 360) % 360 : void 0;
10
+ }
11
+ function l(t, n, r, s = 1) {
12
+ const e = Math.max(t, n, r), i = Math.min(t, n, r), o = e - i;
13
+ let a = 0;
14
+ return o && (a = (e === t ? (n - r) / o + (n < r ? 6 : 0) : e === n ? (r - t) / o + 2 : (t - n) / o + 4) * 60), { h: a, s: e ? o / e : 0, v: e, a: m(s) };
15
+ }
16
+ function b(t) {
17
+ const n = m(t.s), r = m(t.v), s = (t.h % 360 + 360) % 360, e = (i) => {
18
+ const o = (i + s / 60) % 6;
19
+ return m(r - r * n * Math.max(0, Math.min(o, 4 - o, 1)));
20
+ };
21
+ return [e(5), e(3), e(1)];
22
+ }
23
+ function y(t) {
24
+ if (typeof t != "string") return;
25
+ const n = t.trim().toLowerCase();
26
+ if (n === "transparent") return { h: 0, s: 0, v: 0, a: 0 };
27
+ const r = {
28
+ red: "#ff0000",
29
+ green: "#008000",
30
+ blue: "#0000ff",
31
+ black: "#000000",
32
+ white: "#ffffff",
33
+ yellow: "#ffff00",
34
+ orange: "#ffa500",
35
+ purple: "#800080",
36
+ rebeccapurple: "#663399",
37
+ gray: "#808080",
38
+ grey: "#808080",
39
+ cyan: "#00ffff",
40
+ magenta: "#ff00ff",
41
+ lime: "#00ff00",
42
+ navy: "#000080",
43
+ teal: "#008080",
44
+ pink: "#ffc0cb"
45
+ };
46
+ if (r[n]) return y(r[n]);
47
+ const s = n.match(/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i);
48
+ if (s) {
49
+ const u = s[1].length <= 4 ? [...s[1]].map((f) => f + f).join("") : s[1];
50
+ return l(
51
+ ...[0, 2, 4].map((f) => parseInt(u.slice(f, f + 2), 16) / 255),
52
+ u.length === 8 ? parseInt(u.slice(6, 8), 16) / 255 : 1
53
+ );
54
+ }
55
+ const e = n.match(/^(rgba?|hsla?|hsva?)\(([^()]*)\)$/);
56
+ if (!e) return;
57
+ const i = e[2].trim().replace(/\s*[,/]\s*/g, " ").split(/\s+/);
58
+ if (i.length < 3 || i.length > 4) return;
59
+ const o = i[3] === void 0 ? 1 : v(i[3], 1);
60
+ if (o === void 0) return;
61
+ if (e[1].startsWith("rgb")) {
62
+ const u = i.slice(0, 3).map((f) => v(f, 255));
63
+ return u.some((f) => f === void 0) ? void 0 : l(...u, o);
64
+ }
65
+ const a = x(i[0]), d = v(i[1], 100), c = v(i[2], 100);
66
+ if (a === void 0 || d === void 0 || c === void 0) return;
67
+ if (e[1].startsWith("hsv")) return { h: a, s: d, v: c, a: o };
68
+ const g = c, p = g + d * Math.min(g, 1 - g);
69
+ return { h: a, s: p ? 2 * (1 - g / p) : 0, v: p, a: o };
70
+ }
71
+ const h = (t, n = 1) => Number(t.toFixed(n));
72
+ function C(t, n = "hex", r = !1) {
73
+ const s = b(t), e = h(m(t.a), 3), i = s.map((c) => Math.round(c * 255)), o = h((t.h % 360 + 360) % 360);
74
+ if (n === "hex")
75
+ return "#" + i.map((c) => c.toString(16).padStart(2, "0")).join("") + (r ? Math.round(e * 255).toString(16).padStart(2, "0") : "");
76
+ if (n === "rgb")
77
+ return (r ? "rgba(" : "rgb(") + i.join(", ") + (r ? ", " + e : "") + ")";
78
+ if (n === "hsv")
79
+ return (r ? "hsva(" : "hsv(") + o + ", " + h(t.s * 100) + "%, " + h(t.v * 100) + "%" + (r ? ", " + e : "") + ")";
80
+ const a = t.v * (1 - t.s / 2), d = a > 0 && a < 1 ? (t.v - a) / Math.min(a, 1 - a) : 0;
81
+ return (r ? "hsla(" : "hsl(") + o + ", " + h(d * 100) + "%, " + h(a * 100) + "%" + (r ? ", " + e : "") + ")";
82
+ }
83
+ const N = (t) => C(t, "rgb", !0);
84
+ function w(t, n) {
85
+ if (!t || !n) return t === n;
86
+ const r = b(t), s = b(n);
87
+ return r.every((e, i) => Math.abs(e - s[i]) <= 1 / 255) && Math.abs(t.a - n.a) <= 4e-3;
88
+ }
89
+ export {
90
+ m as colorClamp,
91
+ N as colorCss,
92
+ l as colorFromRgb,
93
+ b as colorRgb,
94
+ C as formatColor,
95
+ y as parseColor,
96
+ w as sameColor
97
+ };
@@ -0,0 +1,68 @@
1
+ const g = (e) => typeof e == "string" || typeof e == "number" && Number.isFinite(e), u = (e) => typeof e + ":" + e, w = (e, i) => typeof e == "number" && Number.isFinite(e) && e >= 1 ? Math.floor(e) : i;
2
+ function l(e, i) {
3
+ const r = e;
4
+ return Object.hasOwn(r, i) ? r[i] : i.split(".").reduce(
5
+ (d, s) => d && typeof d == "object" && Object.hasOwn(d, s) ? d[s] : void 0,
6
+ r
7
+ );
8
+ }
9
+ function y(e, i) {
10
+ return typeof i.field == "function" ? i.field(e) : l(e, i.field ?? i.key);
11
+ }
12
+ function b(e, i, r) {
13
+ const d = e.map(
14
+ (c, f) => typeof i == "function" ? i(c, f + r) : l(c, i)
15
+ ), s = new Set(d.filter(g)), h = /* @__PURE__ */ new Set();
16
+ return e.map((c, f) => {
17
+ const p = d[f];
18
+ let t = f + r;
19
+ if (g(p) && !h.has(p)) t = p;
20
+ else {
21
+ for (; s.has(t); ) t = "row:" + t;
22
+ s.add(t);
23
+ }
24
+ return h.add(t), { row: c, id: t, index: f + r };
25
+ });
26
+ }
27
+ function k(e, i, r) {
28
+ const d = new Set(e.map(({ id: t }) => t)), s = /* @__PURE__ */ new Map();
29
+ for (const { row: t, id: o } of e) {
30
+ const n = l(t, i);
31
+ g(n) && n !== o && d.has(n) && s.set(o, n);
32
+ }
33
+ const h = /* @__PURE__ */ new Set();
34
+ for (const { id: t } of e) {
35
+ const o = /* @__PURE__ */ new Set();
36
+ let n = t;
37
+ for (; n !== void 0 && !h.has(n); ) {
38
+ if (o.has(n)) {
39
+ s.delete(n);
40
+ break;
41
+ }
42
+ o.add(n), n = s.get(n);
43
+ }
44
+ for (const a of o) h.add(a);
45
+ }
46
+ const c = /* @__PURE__ */ new Map();
47
+ for (const t of e) {
48
+ const o = s.get(t.id), n = c.get(o);
49
+ n ? n.push(t) : c.set(o, [t]);
50
+ }
51
+ const f = (c.get(void 0) ?? []).map((t) => ({ row: t, depth: 0 })).reverse(), p = [];
52
+ for (; f.length; ) {
53
+ const { row: t, depth: o } = f.pop(), n = c.get(t.id);
54
+ if (p.push({ ...t, depth: o, hasChildren: !!(n != null && n.length) }), n && r.has(t.id))
55
+ for (let a = n.length - 1; a >= 0; a--)
56
+ f.push({ row: n[a], depth: o + 1 });
57
+ }
58
+ return p;
59
+ }
60
+ export {
61
+ l as gridField,
62
+ g as gridKey,
63
+ b as gridRows,
64
+ u as gridToken,
65
+ k as gridTree,
66
+ y as gridValue,
67
+ w as positiveInteger
68
+ };
@@ -0,0 +1,17 @@
1
+ const i = {
2
+ xs: 280,
3
+ sm: 360,
4
+ md: 520,
5
+ lg: 736,
6
+ xl: 960,
7
+ full: "100%"
8
+ }, n = (t) => t === "top" || t === "bottom";
9
+ function r(t) {
10
+ const e = t.size ?? "md";
11
+ return (n(t.placement) ? t.height ?? t.width : t.width) ?? (typeof e == "string" && Object.hasOwn(i, e) ? i[e] : e);
12
+ }
13
+ export {
14
+ r as drawerSize,
15
+ i as drawerSizes,
16
+ n as drawerVertical
17
+ };
@@ -0,0 +1,14 @@
1
+ function c(t) {
2
+ if (t)
3
+ try {
4
+ const e = new URL(t, document.baseURI);
5
+ if (["http:", "https:", "blob:"].includes(e.protocol) || /^data:image\//i.test(t))
6
+ return e.href;
7
+ } catch {
8
+ }
9
+ }
10
+ const i = (t, e, n, r) => Number.isFinite(t) ? Math.max(n, Math.min(r, t)) : e;
11
+ export {
12
+ c as feedbackImage,
13
+ i as feedbackNumber
14
+ };
@@ -0,0 +1,96 @@
1
+ import { toRaw as O } from "vue";
2
+ const h = (o) => typeof o + ":" + o;
3
+ function K(o) {
4
+ return [
5
+ ...new Set(
6
+ (o ?? []).filter(
7
+ (t) => typeof t == "string" || typeof t == "number" && Number.isFinite(t)
8
+ )
9
+ )
10
+ ];
11
+ }
12
+ const A = (o, t) => o.length === t.length && o.every((n, d) => n === t[d]);
13
+ function R(o, t) {
14
+ let n = o;
15
+ for (const d of t.split(".")) {
16
+ if (!n || typeof n != "object" || !Object.prototype.hasOwnProperty.call(n, d))
17
+ return;
18
+ n = n[d];
19
+ }
20
+ return n;
21
+ }
22
+ const G = (o, t) => o === "_blank" ? [
23
+ ...new Set(
24
+ (t ?? "").split(/\s+/).filter(Boolean).concat("noopener", "noreferrer")
25
+ )
26
+ ].join(" ") : t;
27
+ function M(o, t = {}) {
28
+ const n = [], d = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new WeakSet();
29
+ let w = 0;
30
+ function b(c, s, j = !1, m = 0) {
31
+ if (m > 32) return [];
32
+ const v = [];
33
+ for (const u of c) {
34
+ if (!u || typeof u != "object" || g.has(u)) continue;
35
+ g.add(u);
36
+ const e = (r) => R(u, t[r] ?? r);
37
+ if (e("hidden")) continue;
38
+ const p = e("value"), l = typeof p == "string" || typeof p == "number" && Number.isFinite(p) ? p : void 0, k = e("type"), i = ["divider", "group", "checkbox", "radio"].includes(
39
+ String(k)
40
+ ) ? k : "item";
41
+ if (i !== "divider" && i !== "group" && (l === void 0 || d.has(h(l))))
42
+ continue;
43
+ i !== "divider" && i !== "group" && d.add(h(l));
44
+ const a = (r) => String(e(r) ?? ""), y = e("icon"), S = e("children"), f = {
45
+ id: l === void 0 || i === "group" || i === "divider" ? "structure-" + ++w : encodeURIComponent(h(l)),
46
+ raw: u,
47
+ key: l,
48
+ label: a("label"),
49
+ type: i,
50
+ disabled: j || !!e("disabled"),
51
+ danger: !!e("danger"),
52
+ icon: y && (typeof y == "object" || typeof y == "function") ? O(y) : void 0,
53
+ description: a("description"),
54
+ shortcut: a("shortcut"),
55
+ href: e("href") == null ? void 0 : a("href"),
56
+ target: e("target") == null ? void 0 : a("target"),
57
+ rel: e("rel") == null ? void 0 : a("rel"),
58
+ radioGroup: e("radioGroup"),
59
+ checked: !!e("checked"),
60
+ closeOnSelect: typeof e("closeOnSelect") == "boolean" ? e("closeOnSelect") : void 0,
61
+ children: [],
62
+ parents: s,
63
+ path: s.map((r) => r.raw).concat(u),
64
+ keys: s.flatMap((r) => r.key === void 0 ? [] : [r.key]).concat(l === void 0 ? [] : [l]),
65
+ level: s.length
66
+ };
67
+ if (v.push(f), n.push(f), Array.isArray(S) && i !== "divider") {
68
+ const r = b(
69
+ S,
70
+ i === "group" ? s : s.concat(f),
71
+ f.disabled,
72
+ m + 1
73
+ );
74
+ i === "group" ? v.push(...r) : f.children = r;
75
+ }
76
+ }
77
+ return v;
78
+ }
79
+ return {
80
+ roots: b(o, []),
81
+ all: n,
82
+ byKey: new Map(
83
+ n.filter(
84
+ (c) => c.key !== void 0 && c.type !== "divider" && c.type !== "group"
85
+ ).map((c) => [h(c.key), c])
86
+ )
87
+ };
88
+ }
89
+ export {
90
+ R as menuField,
91
+ K as menuKeys,
92
+ A as menuKeysEqual,
93
+ M as menuRows,
94
+ G as menuSafeRel,
95
+ h as menuToken
96
+ };
@@ -0,0 +1,14 @@
1
+ const d = {
2
+ xs: 360,
3
+ sm: 440,
4
+ md: 560,
5
+ lg: 720,
6
+ xl: 960,
7
+ "2xl": 1200,
8
+ full: "100%"
9
+ }, i = (t) => t.width ?? d[t.size ?? "md"], m = (t) => typeof t == "number" ? Number.isFinite(t) && t >= 0 ? t + "px" : void 0 : t;
10
+ export {
11
+ m as modalLength,
12
+ i as modalWidth,
13
+ d as modalWidths
14
+ };
@@ -1,25 +1,55 @@
1
- import { ref as c } from "vue";
2
- const e = [], r = c(0);
3
- function f(o, s) {
4
- const l = Symbol(o);
5
- return e.push({ id: l, kind: o, dismiss: s }), r.value = e.length, { id: l, isTop: () => {
6
- var t;
7
- return ((t = e.at(-1)) == null ? void 0 : t.id) === l;
8
- }, unregister: () => {
9
- const t = e.findIndex((u) => u.id === l);
10
- t >= 0 && e.splice(t, 1), r.value = e.length;
11
- } };
1
+ import { computed as f, ref as h } from "vue";
2
+ const v = Symbol(
3
+ "hys-ui-overlay-owner"
4
+ ), t = [], l = h(0);
5
+ function b(o, d, m) {
6
+ const n = Symbol(o);
7
+ t.push({ id: n, kind: o, dismiss: d, base: m }), l.value = t.length;
8
+ const g = f(() => {
9
+ var r;
10
+ l.value;
11
+ let e = -2;
12
+ for (const i of t) {
13
+ const u = (r = i.base) == null ? void 0 : r.call(i);
14
+ if (e = Math.max(
15
+ e + 2,
16
+ Number.isFinite(u) ? Math.max(0, u) : i.kind === "floating" ? 1200 : 100
17
+ ), i.id === n) return e;
18
+ }
19
+ return o === "floating" ? 1200 : 100;
20
+ });
21
+ return {
22
+ id: n,
23
+ zIndex: g,
24
+ isTop: () => {
25
+ var e;
26
+ return ((e = t.at(-1)) == null ? void 0 : e.id) === n;
27
+ },
28
+ unregister: () => {
29
+ const e = t.findIndex((r) => r.id === n);
30
+ e >= 0 && t.splice(e, 1), l.value = t.length;
31
+ }
32
+ };
12
33
  }
13
- let n = 0, i = "";
14
- function y() {
15
- n++ === 0 && (i = document.body.style.overflow, document.body.style.overflow = "hidden");
34
+ let a = 0, c = "", s = "", y = "";
35
+ function w() {
36
+ if (a++ === 0) {
37
+ c = document.body.style.overflow, s = document.body.style.paddingRight, y = document.body.style.getPropertyPriority("padding-right");
38
+ const d = document.documentElement.clientWidth > 0 ? Math.max(0, window.innerWidth - document.documentElement.clientWidth) : 0;
39
+ d && (document.body.style.paddingRight = (parseFloat(getComputedStyle(document.body).paddingRight) || 0) + d + "px"), document.body.style.overflow = "hidden";
40
+ }
16
41
  let o = !1;
17
42
  return () => {
18
- o || (o = !0, --n === 0 && (document.body.style.overflow = i));
43
+ o || (o = !0, --a === 0 && (document.body.style.overflow = c, document.body.style.setProperty(
44
+ "padding-right",
45
+ s,
46
+ y
47
+ )));
19
48
  };
20
49
  }
21
50
  export {
22
- y as lockBodyScroll,
23
- r as overlayCount,
24
- f as registerOverlay
51
+ w as lockBodyScroll,
52
+ l as overlayCount,
53
+ v as overlayOwnerKey,
54
+ b as registerOverlay
25
55
  };
@@ -0,0 +1,94 @@
1
+ const a = (t) => Number.isFinite(t) ? Math.max(0, Math.min(100, t)) : 0, h = (t, o, e, i) => Number.isFinite(t) ? Math.max(e, Math.min(i, t)) : o, u = "var(--hys-ui-primary,var(--hys-ui-theme-primary))", y = (t) => ({
2
+ normal: u,
3
+ active: u,
4
+ success: "var(--hys-ui-success,var(--hys-ui-theme-success,#16a46e))",
5
+ warning: "var(--hys-ui-warning,var(--hys-ui-theme-warning,#d9860c))",
6
+ error: "var(--hys-ui-red,var(--hys-ui-theme-red,#ed4556))"
7
+ })[t] || u, f = (t, o) => typeof t == "string" && t.trim() ? t.trim() : o;
8
+ function m(t) {
9
+ return typeof t == "number" ? Number.isFinite(t) ? (t % 360 + 360) % 360 : 90 : {
10
+ "to top": 0,
11
+ "to top right": 45,
12
+ "to right": 90,
13
+ "to bottom right": 135,
14
+ "to bottom": 180,
15
+ "to bottom left": 225,
16
+ "to left": 270,
17
+ "to top left": 315
18
+ }[t ?? "to right"] ?? 90;
19
+ }
20
+ function p(t, o, e) {
21
+ var i;
22
+ if (typeof t == "function")
23
+ try {
24
+ return { color: f(t(o), e) };
25
+ } catch {
26
+ return { color: e };
27
+ }
28
+ if (Array.isArray(t)) {
29
+ if (t.every((r) => typeof r == "string")) {
30
+ const r = t.filter(
31
+ (n) => n.trim()
32
+ );
33
+ return r.length > 1 ? {
34
+ color: r[0],
35
+ gradient: {
36
+ angle: 90,
37
+ stops: r.map((n, c) => ({
38
+ offset: c / (r.length - 1) * 100,
39
+ color: n
40
+ }))
41
+ }
42
+ } : { color: r[0] || e };
43
+ }
44
+ const s = t.filter(
45
+ (r) => r && Number.isFinite(r.value) && typeof r.color == "string" && r.color.trim()
46
+ ).map((r) => ({ ...r, value: a(r.value) })).sort((r, n) => r.value - n.value);
47
+ return {
48
+ color: ((i = s.find((r) => o <= r.value) ?? s.at(-1)) == null ? void 0 : i.color) || e
49
+ };
50
+ }
51
+ if (t && typeof t == "object") {
52
+ const s = t, r = [
53
+ { offset: 0, color: f(s.from, e) },
54
+ ...(s.stops ?? []).filter(
55
+ (n) => n && Number.isFinite(n.offset) && typeof n.color == "string" && n.color.trim()
56
+ ).map((n) => ({
57
+ offset: a(n.offset),
58
+ color: n.color
59
+ })),
60
+ { offset: 100, color: f(s.to, e) }
61
+ ].sort((n, c) => n.offset - c.offset);
62
+ return {
63
+ color: r[0].color,
64
+ gradient: { stops: r, angle: m(s.direction) }
65
+ };
66
+ }
67
+ return { color: f(t, e) };
68
+ }
69
+ function $(t) {
70
+ return t.gradient ? `linear-gradient(${t.gradient.angle}deg,${t.gradient.stops.map((o) => `${o.color} ${o.offset}%`).join(",")})` : t.color;
71
+ }
72
+ function l(t) {
73
+ const o = t * Math.PI / 180, e = Math.sin(o) * 50, i = -Math.cos(o) * 50;
74
+ return { x1: 50 - e, y1: 50 - i, x2: 50 + e, y2: 50 + i };
75
+ }
76
+ function M(t, o, e) {
77
+ const i = (s) => {
78
+ const r = s * Math.PI / 180;
79
+ return `${+(50 + t * Math.cos(r)).toFixed(5)} ${+(50 + t * Math.sin(r)).toFixed(5)}`;
80
+ };
81
+ return e <= 0 ? "" : e >= 359.99999 ? `M ${i(o)} A ${t} ${t} 0 1 1 ${i(o + 180)} A ${t} ${t} 0 1 1 ${i(o + 360)}` : `M ${i(o)} A ${t} ${t} 0 ${e > 180 ? 1 : 0} 1 ${i(o + e)}`;
82
+ }
83
+ let g = 0;
84
+ const v = () => `hys-ui-progress-${++g}`;
85
+ export {
86
+ M as progressArc,
87
+ $ as progressCssPaint,
88
+ l as progressGradientCoordinates,
89
+ v as progressId,
90
+ h as progressNumber,
91
+ p as progressPaint,
92
+ a as progressPercent,
93
+ y as progressStatusColor
94
+ };
@@ -0,0 +1,16 @@
1
+ function f(t, n) {
2
+ if (!n || typeof n == "string" && !n.length)
3
+ return [t];
4
+ if (n instanceof RegExp)
5
+ return t.split(new RegExp(n.source, n.flags.replace(/[gy]/g, ""))).filter((e) => e !== void 0);
6
+ const g = (typeof n == "string" ? [n] : [...n]).filter(Boolean).sort((e, i) => i.length - e.length);
7
+ return g.length ? t.split(
8
+ new RegExp(
9
+ g.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"),
10
+ "u"
11
+ )
12
+ ) : [t];
13
+ }
14
+ export {
15
+ f as splitTags
16
+ };
@@ -0,0 +1,19 @@
1
+ function n(e, i) {
2
+ return i.split(".").reduce(
3
+ (r, t) => r != null && typeof r == "object" ? r[t] : void 0,
4
+ e
5
+ );
6
+ }
7
+ const s = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "", u = (e) => ({
8
+ primary: "var(--hys-ui-primary,var(--hys-ui-theme-primary))",
9
+ success: "var(--hys-ui-success,#16a46e)",
10
+ warning: "var(--hys-ui-warning,#d9860c)",
11
+ danger: "var(--hys-ui-red,var(--hys-ui-theme-red,#ed4556))",
12
+ info: "var(--hys-ui-info,#3867f5)",
13
+ neutral: "var(--hys-ui-muted,var(--hys-ui-theme-muted))"
14
+ })[e] || "var(--hys-ui-muted,var(--hys-ui-theme-muted))";
15
+ export {
16
+ n as timelineRead,
17
+ s as timelineText,
18
+ u as timelineTone
19
+ };
@@ -1,30 +1,30 @@
1
- const f = (e) => typeof e + ":" + e;
1
+ const d = (e) => typeof e + ":" + e;
2
2
  function l(e, a) {
3
3
  return a.split(".").reduce(
4
- (t, n) => t != null && Object.prototype.hasOwnProperty.call(Object(t), n) ? t[n] : void 0,
4
+ (t, o) => t != null && Object.prototype.hasOwnProperty.call(Object(t), o) ? t[o] : void 0,
5
5
  e
6
6
  );
7
7
  }
8
- function d(e) {
9
- var n, s, c;
8
+ function f(e) {
9
+ var o, s, c;
10
10
  const a = [], t = /* @__PURE__ */ new Map();
11
- for (const o of e.options) {
12
- if (!o || typeof o != "object") continue;
13
- const r = e.rowKey ? e.rowKey(o) : l(o, ((n = e.fieldNames) == null ? void 0 : n.value) ?? "value");
14
- if (typeof r != "string" && (typeof r != "number" || !Number.isFinite(r)) || t.has(r))
11
+ for (const n of e.options) {
12
+ if (!n || typeof n != "object") continue;
13
+ const i = e.rowKey ? e.rowKey(n) : l(n, ((o = e.fieldNames) == null ? void 0 : o.value) ?? "value");
14
+ if (typeof i != "string" && (typeof i != "number" || !Number.isFinite(i)) || t.has(i))
15
15
  continue;
16
- const i = {
17
- key: r,
16
+ const r = {
17
+ key: i,
18
18
  label: String(
19
- l(o, ((s = e.fieldNames) == null ? void 0 : s.label) ?? "label") ?? r
19
+ l(n, ((s = e.fieldNames) == null ? void 0 : s.label) ?? "label") ?? i
20
20
  ),
21
21
  disabled: !!l(
22
- o,
22
+ n,
23
23
  ((c = e.fieldNames) == null ? void 0 : c.disabled) ?? "disabled"
24
24
  ),
25
- option: o
25
+ option: n
26
26
  };
27
- a.push(i), t.set(i.key, i);
27
+ a.push(r), t.set(r.key, r);
28
28
  }
29
29
  return { rows: a, map: t };
30
30
  }
@@ -43,6 +43,8 @@ const u = (e) => ({
43
43
  moveLeft: "移除选中项",
44
44
  dragRight: "拖动到已选择区域",
45
45
  dragLeft: "拖动到待选择区域",
46
+ doubleClickRight: "双击移入已选择区域,也可拖拽移动",
47
+ doubleClickLeft: "双击移回待选择区域,也可拖拽移动",
46
48
  dragCount: "正在拖动 {count} 项",
47
49
  moved: "已{direction} {count} 项",
48
50
  added: "移入",
@@ -53,11 +55,11 @@ const u = (e) => ({
53
55
  lastPage: "末页",
54
56
  perPage: "每页条数",
55
57
  ...e
56
- }), g = (e, a) => e.replace(/\{(\w+)\}/g, (t, n) => String(a[n] ?? t));
58
+ }), g = (e, a) => e.replace(/\{(\w+)\}/g, (t, o) => String(a[o] ?? t));
57
59
  export {
58
60
  g as transferLabel,
59
- d as transferRows,
60
- f as transferToken,
61
+ f as transferRows,
62
+ d as transferToken,
61
63
  l as transferValue,
62
64
  u as transferWords
63
65
  };
@@ -0,0 +1,55 @@
1
+ const r = {
2
+ choose: "选择文件",
3
+ drag: "点击选择或拖入文件",
4
+ checking: "正在检查文件…",
5
+ localHint: "文件通过事件交给业务层上传",
6
+ uploadHint: "支持选择、拖入和上传进度管理",
7
+ files: "文件列表",
8
+ ready: "待上传",
9
+ uploading: "上传中",
10
+ success: "已完成",
11
+ error: "上传失败",
12
+ queued: "等待上传",
13
+ removing: "正在移除",
14
+ submit: "开始上传",
15
+ abort: "取消上传",
16
+ retry: "重试",
17
+ clear: "清空",
18
+ remove: "移除",
19
+ preview: "预览",
20
+ download: "下载",
21
+ empty: "暂无文件"
22
+ }, n = (t) => ["ready", "uploading", "success", "error"].includes(t.status ?? "") ? t.status : t.raw ? "ready" : "success", a = (t) => n(t) === "success" ? 100 : Number.isFinite(t.percentage) ? Math.max(0, Math.min(100, t.percentage)) : 0, o = (t) => {
23
+ var e, s;
24
+ return !!((s = t.type ?? ((e = t.raw) == null ? void 0 : e.type)) != null && s.startsWith("image/")) || /\.(png|jpe?g|gif|webp|avif|bmp|svg)(?:[?#]|$)/i.test(
25
+ t.name || t.url || ""
26
+ );
27
+ };
28
+ function c(t) {
29
+ return !Number.isFinite(t) || t < 0 ? "" : t < 1024 ? t + " B" : t < 1048576 ? (t / 1024).toFixed(1) + " KB" : (t / 1048576).toFixed(1) + " MB";
30
+ }
31
+ function i(t, e = "custom") {
32
+ return t instanceof Error ? Object.assign(new Error(t.message, { cause: t }), t, {
33
+ kind: t.kind ?? e
34
+ }) : Object.assign(new Error(typeof t == "string" ? t : "上传失败"), {
35
+ kind: e
36
+ });
37
+ }
38
+ function u(t, e = !1) {
39
+ if (t)
40
+ try {
41
+ const s = new URL(t, document.baseURI);
42
+ if (["http:", "https:", "blob:"].includes(s.protocol) || e && /^data:image\//i.test(t))
43
+ return s.href;
44
+ } catch {
45
+ }
46
+ }
47
+ export {
48
+ i as uploadFailure,
49
+ o as uploadImage,
50
+ r as uploadLocale,
51
+ a as uploadPercent,
52
+ c as uploadSize,
53
+ n as uploadStatus,
54
+ u as uploadUrl
55
+ };