hys-ui 0.1.0 → 0.2.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 (247) hide show
  1. package/CHANGELOG.md +137 -1
  2. package/README.md +18 -6
  3. package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
  4. package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
  5. package/dist/components/HysAlert/HysAlert.vue.js +14 -14
  6. package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
  7. package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
  8. package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
  9. package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
  10. package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
  11. package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
  12. package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
  13. package/dist/components/HysBadge/HysBadge.vue.js +2 -2
  14. package/dist/components/HysBadge/HysBadge2.vue.js +154 -26
  15. package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
  16. package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
  17. package/dist/components/HysButton/HysButton.vue.js +2 -2
  18. package/dist/components/HysButton/HysButton2.vue.js +29 -28
  19. package/dist/components/HysCalendar/HysCalendar.vue.js +5 -84
  20. package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
  21. package/dist/components/HysCard/HysCard.vue.js +1 -1
  22. package/dist/components/HysCard/HysCard2.vue.js +177 -44
  23. package/dist/components/HysCascader/HysCascader.vue.js +5 -182
  24. package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
  25. package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
  26. package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
  27. package/dist/components/HysCheckbox/HysCheckbox.vue.js +5 -39
  28. package/dist/components/HysCheckbox/HysCheckbox2.vue.js +200 -2
  29. package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
  30. package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
  31. package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
  32. package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
  33. package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
  34. package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
  35. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  36. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +397 -390
  37. package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
  38. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
  39. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
  40. package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
  41. package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
  42. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
  43. package/dist/components/HysDivider/HysDivider.vue.js +2 -2
  44. package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
  45. package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
  46. package/dist/components/HysDrawer/HysDrawer2.vue.js +55 -54
  47. package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
  48. package/dist/components/HysFileManager/HysFileManager2.vue.js +86 -2
  49. package/dist/components/HysForm/HysForm.vue.js +3 -3
  50. package/dist/components/HysForm/HysForm2.vue.js +580 -92
  51. package/dist/components/HysFormItem/HysFormItem.vue.js +5 -69
  52. package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
  53. package/dist/components/HysGantt/HysGantt.vue.js +5 -264
  54. package/dist/components/HysGantt/HysGantt2.vue.js +1399 -2
  55. package/dist/components/HysInput/HysInput.vue.js +2 -2
  56. package/dist/components/HysInput/HysInput2.vue.js +468 -120
  57. package/dist/components/HysMention/HysMention.vue.js +2 -2
  58. package/dist/components/HysMention/HysMention2.vue.js +89 -88
  59. package/dist/components/HysModal/HysModal.vue.js +2 -2
  60. package/dist/components/HysModal/HysModal2.vue.js +35 -35
  61. package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
  62. package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
  63. package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -70
  64. package/dist/components/HysOrgTree/HysOrgTree.vue.js +41 -36
  65. package/dist/components/HysPagination/HysPagination.vue.js +2 -2
  66. package/dist/components/HysPagination/HysPagination2.vue.js +93 -91
  67. package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
  68. package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +101 -2
  69. package/dist/components/HysRadio/HysRadio.vue.js +7 -0
  70. package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
  71. package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +5 -40
  72. package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +205 -2
  73. package/dist/components/HysRating/HysRating.vue.js +1 -1
  74. package/dist/components/HysRating/HysRating2.vue.js +288 -68
  75. package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
  76. package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
  77. package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +87 -67
  78. package/dist/components/HysSearch/HysSearch.vue.js +50 -38
  79. package/dist/components/HysSegmented/HysSegmented.vue.js +5 -58
  80. package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
  81. package/dist/components/HysSelect/HysSelect.vue.js +3 -2
  82. package/dist/components/HysSelect/HysSelect2.vue.js +859 -164
  83. package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
  84. package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
  85. package/dist/components/HysSlider/HysSlider.vue.js +2 -2
  86. package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
  87. package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
  88. package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
  89. package/dist/components/HysSplitPane/HysSplitPane.vue.js +48 -42
  90. package/dist/components/HysSteps/HysSteps.vue.js +2 -2
  91. package/dist/components/HysSteps/HysSteps2.vue.js +111 -36
  92. package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
  93. package/dist/components/HysSwitch/HysSwitch2.vue.js +235 -42
  94. package/dist/components/HysTable/HysTable.vue.js +1 -1
  95. package/dist/components/HysTable/HysTable2.vue.js +1471 -82
  96. package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
  97. package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
  98. package/dist/components/HysTabs/HysTabs.vue.js +2 -2
  99. package/dist/components/HysTabs/HysTabs2.vue.js +262 -66
  100. package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
  101. package/dist/components/HysTextarea/HysTextarea.vue.js +137 -66
  102. package/dist/components/HysToast/HysToast.vue.js +2 -2
  103. package/dist/components/HysToast/HysToast2.vue.js +121 -38
  104. package/dist/components/HysTour/HysTour.vue.js +47 -42
  105. package/dist/components/HysTransfer/HysTransfer.vue.js +5 -207
  106. package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
  107. package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
  108. package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
  109. package/dist/components/HysTree/HysTree.vue.js +2 -3
  110. package/dist/components/HysTree/HysTree2.vue.js +641 -301
  111. package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -129
  112. package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
  113. package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
  114. package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
  115. package/dist/components/HysUpload/HysUpload.vue.js +2 -2
  116. package/dist/components/HysUpload/HysUpload2.vue.js +97 -78
  117. package/dist/composables/autocomplete.js +50 -0
  118. package/dist/composables/avatar.js +57 -0
  119. package/dist/composables/calendar.js +96 -0
  120. package/dist/composables/cascader.js +79 -0
  121. package/dist/composables/choice.js +38 -0
  122. package/dist/composables/choiceModel.js +67 -0
  123. package/dist/composables/datePicker.js +227 -0
  124. package/dist/composables/formContext.js +94 -3
  125. package/dist/composables/formLayout.js +57 -0
  126. package/dist/composables/formValidation.js +240 -0
  127. package/dist/composables/ganttConflicts.js +143 -0
  128. package/dist/composables/numberInput.js +91 -0
  129. package/dist/composables/rating.js +16 -0
  130. package/dist/composables/selectOptions.js +54 -0
  131. package/dist/composables/table.js +150 -0
  132. package/dist/composables/textInput.js +34 -0
  133. package/dist/composables/toastEscape.js +16 -0
  134. package/dist/composables/transfer.js +63 -0
  135. package/dist/composables/tree.js +118 -0
  136. package/dist/composables/treeSelect.js +71 -0
  137. package/dist/composables/useCascader.js +438 -0
  138. package/dist/composables/useDatePicker.js +425 -0
  139. package/dist/composables/useDialog.js +16 -16
  140. package/dist/composables/useFloating.js +98 -52
  141. package/dist/composables/useGanttDependencies.js +306 -0
  142. package/dist/composables/useGanttHistory.js +157 -0
  143. package/dist/composables/useGanttLabelResize.js +100 -0
  144. package/dist/composables/useHysToast.js +148 -0
  145. package/dist/composables/useTable.js +474 -0
  146. package/dist/composables/useTextareaSize.js +72 -0
  147. package/dist/composables/useTransfer.js +257 -0
  148. package/dist/composables/useTree.js +439 -0
  149. package/dist/composables/useTreeSelect.js +361 -0
  150. package/dist/config.js +18 -15
  151. package/dist/index.js +149 -136
  152. package/dist/style.css +1 -1
  153. package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
  154. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
  155. package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
  156. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
  157. package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
  158. package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
  159. package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
  160. package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -29
  161. package/dist/types/components/HysCard/HysCard.vue.d.ts +57 -5
  162. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
  163. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
  164. package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +55 -27
  165. package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
  166. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
  167. package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
  168. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
  169. package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
  170. package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
  171. package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
  172. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -0
  173. package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +8 -4
  174. package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
  175. package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
  176. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +88 -4
  177. package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
  178. package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
  179. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -33
  180. package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +4 -1
  181. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
  182. package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
  183. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
  184. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
  185. package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
  186. package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +62 -17
  187. package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
  188. package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
  189. package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
  190. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
  191. package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
  192. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -14
  193. package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
  194. package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
  195. package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
  196. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
  197. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +65 -9
  198. package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
  199. package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
  200. package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
  201. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
  202. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
  203. package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
  204. package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
  205. package/dist/types/components/HysTour/HysTour.vue.d.ts +5 -3
  206. package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -30
  207. package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
  208. package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
  209. package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
  210. package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
  211. package/dist/types/composables/autocomplete.d.ts +106 -0
  212. package/dist/types/composables/avatar.d.ts +70 -0
  213. package/dist/types/composables/calendar.d.ts +66 -0
  214. package/dist/types/composables/cascader.d.ts +192 -0
  215. package/dist/types/composables/choice.d.ts +110 -0
  216. package/dist/types/composables/choiceModel.d.ts +11 -0
  217. package/dist/types/composables/datePicker.d.ts +247 -0
  218. package/dist/types/composables/formContext.d.ts +138 -8
  219. package/dist/types/composables/formLayout.d.ts +11 -0
  220. package/dist/types/composables/formValidation.d.ts +13 -0
  221. package/dist/types/composables/gantt.d.ts +68 -0
  222. package/dist/types/composables/ganttConflicts.d.ts +30 -0
  223. package/dist/types/composables/numberInput.d.ts +45 -0
  224. package/dist/types/composables/rating.d.ts +18 -0
  225. package/dist/types/composables/segmented.d.ts +15 -0
  226. package/dist/types/composables/selectOptions.d.ts +44 -0
  227. package/dist/types/composables/slider.d.ts +21 -0
  228. package/dist/types/composables/table.d.ts +309 -0
  229. package/dist/types/composables/textInput.d.ts +76 -0
  230. package/dist/types/composables/toastEscape.d.ts +1 -0
  231. package/dist/types/composables/transfer.d.ts +180 -0
  232. package/dist/types/composables/tree.d.ts +237 -0
  233. package/dist/types/composables/treeSelect.d.ts +167 -0
  234. package/dist/types/composables/useCascader.d.ts +162 -0
  235. package/dist/types/composables/useDatePicker.d.ts +79 -0
  236. package/dist/types/composables/useFloating.d.ts +8 -5
  237. package/dist/types/composables/useGanttDependencies.d.ts +83 -0
  238. package/dist/types/composables/useGanttHistory.d.ts +42 -0
  239. package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
  240. package/dist/types/composables/useHysToast.d.ts +50 -0
  241. package/dist/types/composables/useTable.d.ts +60 -0
  242. package/dist/types/composables/useTextareaSize.d.ts +3 -0
  243. package/dist/types/composables/useTransfer.d.ts +58 -0
  244. package/dist/types/composables/useTree.d.ts +77 -0
  245. package/dist/types/composables/useTreeSelect.d.ts +117 -0
  246. package/dist/types/index.d.ts +38 -7
  247. package/package.json +47 -11
@@ -0,0 +1,156 @@
1
+ import { defineComponent as J, ref as A, watch as P, onActivated as K, nextTick as Q, onDeactivated as Z, onBeforeUnmount as ee, openBlock as N, createBlock as te, Teleport as ie, createElementBlock as oe, mergeProps as ne, unref as le, renderSlot as se, createCommentVNode as re } from "vue";
2
+ import { useHysRootAttrs as ae } from "../../config.js";
3
+ const ce = ["id"], fe = /* @__PURE__ */ J({
4
+ __name: "SliderTooltip",
5
+ props: {
6
+ id: {},
7
+ anchor: {},
8
+ container: {},
9
+ placement: {},
10
+ position: {}
11
+ },
12
+ setup(q) {
13
+ const i = q, C = ae(), g = A(), p = A(!0), R = A({ position: "fixed", visibility: "hidden" }), X = A(i.placement);
14
+ let h, x, L = [], S = {}, z;
15
+ function B() {
16
+ if (L = [], S = {}, !i.anchor) return;
17
+ for (let n = i.anchor.parentElement; n; n = n.parentElement) {
18
+ const e = getComputedStyle(n), l = /hidden|clip|auto|scroll/.test(e.overflowX || e.overflow), c = /hidden|clip|auto|scroll/.test(e.overflowY || e.overflow);
19
+ (l || c) && L.push({ element: n, x: l, y: c });
20
+ }
21
+ const t = getComputedStyle(i.anchor);
22
+ for (const n of [
23
+ "--hys-ui-text",
24
+ "--hys-ui-surface",
25
+ "--hys-ui-theme-text",
26
+ "--hys-ui-theme-surface"
27
+ ]) {
28
+ const e = t.getPropertyValue(n).trim();
29
+ e && (S[n] = e);
30
+ }
31
+ }
32
+ function Y() {
33
+ h = void 0;
34
+ const t = i.anchor, n = g.value;
35
+ if (!p.value || !(t != null && t.isConnected) || !n) return;
36
+ const e = window.visualViewport, l = (e == null ? void 0 : e.offsetLeft) ?? 0, c = (e == null ? void 0 : e.offsetTop) ?? 0, w = (e == null ? void 0 : e.width) ?? (document.documentElement.clientWidth || window.innerWidth), r = (e == null ? void 0 : e.height) ?? (document.documentElement.clientHeight || window.innerHeight), a = l + w, y = c + r, s = 8, u = 8, o = (t.querySelector(".hys-ui-slider-handle") ?? t).getBoundingClientRect();
37
+ let _ = l, W = c, F = a, H = y;
38
+ for (const { element: v, x: G, y: I } of L) {
39
+ const b = v.getBoundingClientRect();
40
+ G && (_ = Math.max(_, b.left + v.clientLeft), F = Math.min(
41
+ F,
42
+ b.left + v.clientLeft + (v.clientWidth || b.width)
43
+ )), I && (W = Math.max(W, b.top + v.clientTop), H = Math.min(
44
+ H,
45
+ b.top + v.clientTop + (v.clientHeight || b.height)
46
+ ));
47
+ }
48
+ if (!o.width && !o.height || o.right <= _ || o.left >= F || o.bottom <= W || o.top >= H) {
49
+ R.value = { position: "fixed", visibility: "hidden" };
50
+ return;
51
+ }
52
+ n.style.maxWidth = Math.max(1, w - s * 2) + "px";
53
+ const f = z ?? n.getBoundingClientRect(), O = {
54
+ top: o.top - c - u - s,
55
+ bottom: y - o.bottom - u - s,
56
+ left: o.left - l - u - s,
57
+ right: a - o.right - u - s
58
+ }, U = {
59
+ top: "bottom",
60
+ bottom: "top",
61
+ left: "right",
62
+ right: "left"
63
+ };
64
+ let d = i.placement;
65
+ const D = U[d], $ = d === "top" || d === "bottom" ? f.height : f.width;
66
+ O[d] < $ && O[D] > O[d] && (d = D);
67
+ let E = o.left + (o.width - f.width) / 2, M = o.top + (o.height - f.height) / 2;
68
+ d === "top" ? M = o.top - f.height - u : d === "bottom" ? M = o.bottom + u : d === "left" ? E = o.left - f.width - u : E = o.right + u, E = Math.max(l + s, Math.min(E, a - f.width - s)), M = Math.max(c + s, Math.min(M, y - f.height - s)), X.value = d, R.value = {
69
+ ...S,
70
+ position: "fixed",
71
+ left: Math.round(E) + "px",
72
+ top: Math.round(M) + "px",
73
+ maxWidth: Math.max(1, w - s * 2) + "px",
74
+ visibility: "visible"
75
+ };
76
+ }
77
+ function m() {
78
+ p.value && h === void 0 && (h = requestAnimationFrame(Y));
79
+ }
80
+ function T() {
81
+ h !== void 0 && cancelAnimationFrame(h), h = void 0, Y();
82
+ }
83
+ function k() {
84
+ z = void 0, B(), m();
85
+ }
86
+ function V() {
87
+ x == null || x(), x = void 0, h !== void 0 && cancelAnimationFrame(h), h = void 0, z = void 0, L = [];
88
+ }
89
+ function j() {
90
+ var c, w;
91
+ if (V(), !p.value || !i.anchor || !g.value) return;
92
+ B(), window.addEventListener("scroll", m, !0), window.addEventListener("resize", k), (c = window.visualViewport) == null || c.addEventListener("scroll", m), (w = window.visualViewport) == null || w.addEventListener("resize", k);
93
+ const t = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver((r) => {
94
+ var a;
95
+ for (const y of r)
96
+ if (y.target === g.value) {
97
+ const s = (a = y.borderBoxSize) == null ? void 0 : a[0];
98
+ z = s ? { width: s.inlineSize, height: s.blockSize } : void 0;
99
+ }
100
+ T();
101
+ });
102
+ t == null || t.observe(i.anchor), t == null || t.observe(g.value), i.container && (t == null || t.observe(i.container));
103
+ const n = () => {
104
+ var r, a;
105
+ return [
106
+ (r = i.container) == null ? void 0 : r.getAttribute("style"),
107
+ (a = i.container) == null ? void 0 : a.getAttribute("class"),
108
+ C.value["data-hys-theme"]
109
+ ].join("|");
110
+ };
111
+ let e = n();
112
+ const l = typeof MutationObserver > "u" ? void 0 : new MutationObserver(() => {
113
+ const r = n();
114
+ r !== e && (e = r, B(), m());
115
+ });
116
+ i.container && (l == null || l.observe(i.container, {
117
+ attributes: !0,
118
+ attributeFilter: ["style", "class", "data-hys-theme"]
119
+ })), x = () => {
120
+ var r, a;
121
+ window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", k), (r = window.visualViewport) == null || r.removeEventListener("scroll", m), (a = window.visualViewport) == null || a.removeEventListener("resize", k), t == null || t.disconnect(), l == null || l.disconnect();
122
+ }, m();
123
+ }
124
+ return P(
125
+ () => [i.anchor, i.container, g.value, p.value],
126
+ j,
127
+ { flush: "post" }
128
+ ), P(() => [i.position, i.placement], T, { flush: "post" }), P(
129
+ () => C.value["data-hys-theme"],
130
+ () => {
131
+ B(), T();
132
+ },
133
+ { flush: "post" }
134
+ ), K(() => {
135
+ p.value = !0, Q(j);
136
+ }), Z(() => {
137
+ p.value = !1, V();
138
+ }), ee(V), (t, n) => (N(), te(ie, { to: "body" }, [
139
+ p.value ? (N(), oe("span", ne({
140
+ key: 0,
141
+ id: q.id,
142
+ ref_key: "panel",
143
+ ref: g
144
+ }, le(C), {
145
+ class: ["hys-ui-slider-tooltip", "hys-ui-slider-tooltip-" + X.value],
146
+ role: "tooltip",
147
+ style: R.value
148
+ }), [
149
+ se(t.$slots, "default", {}, void 0, !0)
150
+ ], 16, ce)) : re("", !0)
151
+ ]));
152
+ }
153
+ });
154
+ export {
155
+ fe as default
156
+ };
@@ -1,65 +1,71 @@
1
- import { defineComponent as x, ref as E, computed as L, onDeactivated as g, onBeforeUnmount as A, openBlock as b, createElementBlock as M, mergeProps as k, unref as B, createElementVNode as d, renderSlot as v } from "vue";
2
- import { useHysRootAttrs as V } from "../../config.js";
3
- const R = { class: "hys-ui-ent-split-first" }, D = ["tabindex", "aria-orientation", "aria-valuenow", "aria-valuemin", "aria-valuemax"], P = { class: "hys-ui-ent-split-second" }, H = /* @__PURE__ */ x({
1
+ import { defineComponent as g, ref as M, computed as v, watch as z, onDeactivated as B, onBeforeUnmount as P, openBlock as V, createElementBlock as C, mergeProps as D, unref as I, createElementVNode as h, renderSlot as w } from "vue";
2
+ import { useHysRootAttrs as N } from "../../config.js";
3
+ const R = { class: "hys-ui-ent-split-first" }, F = ["tabindex", "aria-disabled", "aria-orientation", "aria-valuenow", "aria-valuemin", "aria-valuemax"], H = { class: "hys-ui-ent-split-second" }, K = /* @__PURE__ */ g({
4
4
  __name: "HysSplitPane",
5
5
  props: {
6
6
  modelValue: { default: 40 },
7
7
  min: { default: 15 },
8
8
  max: { default: 85 },
9
9
  vertical: { type: Boolean, default: !1 },
10
- disabled: { type: Boolean }
10
+ disabled: { type: Boolean },
11
+ step: { default: 2 }
11
12
  },
12
- emits: ["update:modelValue"],
13
- setup(i, { emit: p }) {
14
- const h = V(), t = i, u = p, s = E(), l = L(() => Math.min(t.max, Math.max(t.min, t.modelValue)));
15
- let o = () => {
13
+ emits: ["update:modelValue", "resizeStart", "resizeEnd"],
14
+ setup(l, { emit: E }) {
15
+ const a = l, d = E, x = N(), c = M(), s = v(() => Math.max(0, Math.min(100, Number.isFinite(a.min) ? a.min : 0))), m = v(() => Math.max(s.value, Math.min(100, Number.isFinite(a.max) ? a.max : 100))), p = (e) => Math.max(s.value, Math.min(m.value, Number.isFinite(e) ? e : s.value)), u = v(() => p(a.modelValue));
16
+ let r = () => {
16
17
  };
17
- g(() => o()), A(() => o());
18
- function f(n) {
19
- if (o(), !s.value || t.disabled) return;
20
- const e = n.currentTarget;
21
- e.setPointerCapture(n.pointerId);
22
- const r = s.value.getBoundingClientRect(), c = (m) => {
23
- const w = t.vertical ? (m.clientY - r.top) / r.height * 100 : (m.clientX - r.left) / r.width * 100;
24
- u("update:modelValue", Math.round(Math.max(t.min, Math.min(t.max, w))));
25
- }, a = () => {
26
- e.removeEventListener("pointermove", c), e.removeEventListener("pointerup", a), e.removeEventListener("pointercancel", a), e.removeEventListener("lostpointercapture", a), o = () => {
27
- };
18
+ z(() => [a.disabled, a.vertical, a.min, a.max], () => r()), B(() => r()), P(() => r());
19
+ function L(e) {
20
+ if (r(), !c.value || a.disabled || e.button !== 0) return;
21
+ const t = e.currentTarget, n = c.value.getBoundingClientRect(), f = a.vertical, y = f ? n.height : n.width;
22
+ if (!y) return;
23
+ e.preventDefault(), t.setPointerCapture(e.pointerId), d("resizeStart");
24
+ const b = (o) => {
25
+ if (a.disabled || o.pointerId !== e.pointerId) return;
26
+ const A = (f ? o.clientY - n.top : o.clientX - n.left) / y * 100;
27
+ d("update:modelValue", Math.round(p(A)));
28
+ }, i = () => {
29
+ var o;
30
+ r = () => {
31
+ }, t.removeEventListener("pointermove", b), t.removeEventListener("pointerup", i), t.removeEventListener("pointercancel", i), t.removeEventListener("lostpointercapture", i), (o = t.hasPointerCapture) != null && o.call(t, e.pointerId) && t.releasePointerCapture(e.pointerId), d("resizeEnd", u.value);
28
32
  };
29
- o = a, e.addEventListener("lostpointercapture", a), e.addEventListener("pointermove", c), e.addEventListener("pointerup", a), e.addEventListener("pointercancel", a);
33
+ r = i, t.addEventListener("pointermove", b), t.addEventListener("pointerup", i), t.addEventListener("pointercancel", i), t.addEventListener("lostpointercapture", i);
30
34
  }
31
- function y(n) {
32
- if (t.disabled) return;
33
- const e = n.shiftKey ? 10 : 2;
34
- ["ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown"].includes(n.key) && (n.preventDefault(), u("update:modelValue", Math.max(t.min, Math.min(t.max, l.value + (["ArrowRight", "ArrowDown"].includes(n.key) ? e : -e)))));
35
+ function k(e) {
36
+ if (a.disabled || !["ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown", "Home", "End"].includes(e.key)) return;
37
+ e.preventDefault();
38
+ const t = (Number.isFinite(a.step) && a.step > 0 ? a.step : 2) * (e.shiftKey ? 5 : 1), n = e.key === "Home" ? s.value : e.key === "End" ? m.value : u.value + (["ArrowRight", "ArrowDown"].includes(e.key) ? t : -t);
39
+ d("update:modelValue", p(n));
35
40
  }
36
- return (n, e) => (b(), M("div", k(B(h), {
41
+ return (e, t) => (V(), C("div", D(I(x), {
37
42
  ref_key: "host",
38
- ref: s,
39
- class: ["hys-ui-ent-split", { "hys-ui-vertical": i.vertical }],
40
- style: { "--hys-ui-split": l.value + "%" }
43
+ ref: c,
44
+ class: ["hys-ui-ent-split", { "hys-ui-vertical": l.vertical }],
45
+ style: { "--hys-ui-split": u.value + "%" }
41
46
  }), [
42
- d("div", R, [
43
- v(n.$slots, "first")
47
+ h("div", R, [
48
+ w(e.$slots, "first")
44
49
  ]),
45
- d("div", {
50
+ h("div", {
46
51
  class: "hys-ui-ent-split-handle",
47
52
  role: "separator",
48
- tabindex: i.disabled ? -1 : 0,
53
+ tabindex: l.disabled ? -1 : 0,
49
54
  "aria-label": "调整面板比例",
50
- "aria-orientation": i.vertical ? "horizontal" : "vertical",
51
- "aria-valuenow": l.value,
52
- "aria-valuemin": i.min,
53
- "aria-valuemax": i.max,
54
- onPointerdown: f,
55
- onKeydown: y
56
- }, null, 40, D),
57
- d("div", P, [
58
- v(n.$slots, "second")
55
+ "aria-disabled": l.disabled || void 0,
56
+ "aria-orientation": l.vertical ? "horizontal" : "vertical",
57
+ "aria-valuenow": u.value,
58
+ "aria-valuemin": s.value,
59
+ "aria-valuemax": m.value,
60
+ onPointerdown: L,
61
+ onKeydown: k
62
+ }, null, 40, F),
63
+ h("div", H, [
64
+ w(e.$slots, "second")
59
65
  ])
60
66
  ], 16));
61
67
  }
62
68
  });
63
69
  export {
64
- H as default
70
+ K as default
65
71
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./HysSteps2.vue.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-111d19b5"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-aee36fc0"]]);
5
5
  export {
6
- m as default
6
+ s as default
7
7
  };
@@ -1,53 +1,128 @@
1
- import { defineComponent as k, openBlock as s, createElementBlock as c, mergeProps as d, unref as n, Fragment as l, renderList as f, normalizeClass as m, createElementVNode as u, createBlock as i, createTextVNode as b, toDisplayString as o, createCommentVNode as g } from "vue";
2
- import { useHysRootAttrs as v } from "../../config.js";
3
- import { Check as C, CircleAlert as B } from "lucide-vue-next";
4
- const p = ["aria-current"], z = ["disabled", "onClick"], A = { key: 1 }, N = { key: 2 }, D = /* @__PURE__ */ k({
1
+ import { defineComponent as H, ref as N, computed as f, openBlock as a, createElementBlock as i, mergeProps as S, unref as m, Fragment as A, renderList as M, normalizeClass as P, createElementVNode as B, renderSlot as y, createBlock as $, createTextVNode as h, toDisplayString as p, createCommentVNode as C } from "vue";
2
+ import { Check as R, CircleAlert as V } from "lucide-vue-next";
3
+ import { useHysRootAttrs as F } from "../../config.js";
4
+ const K = ["aria-label"], U = ["aria-current"], q = {
5
+ class: "hys-ui-step-marker",
6
+ "aria-hidden": "true"
7
+ }, I = {
8
+ key: 0,
9
+ class: "hys-ui-step-dot"
10
+ }, O = { class: "hys-ui-step-content" }, T = ["data-step-index", "disabled", "tabindex", "onClick", "onKeydown"], j = { key: 1 }, G = {
11
+ key: 2,
12
+ class: "hys-ui-step-subtitle"
13
+ }, J = {
14
+ key: 3,
15
+ class: "hys-ui-step-description"
16
+ }, Y = /* @__PURE__ */ H({
5
17
  __name: "HysSteps",
6
18
  props: {
7
19
  items: {},
8
- current: {},
20
+ current: { default: 0 },
9
21
  vertical: { type: Boolean },
10
22
  clickable: { type: Boolean },
11
- status: {}
23
+ disabled: { type: Boolean },
24
+ status: { default: "process" },
25
+ size: { default: "md" },
26
+ labelPlacement: { default: "right" },
27
+ progressDot: { type: Boolean },
28
+ simple: { type: Boolean },
29
+ responsive: { type: Boolean, default: !0 },
30
+ ariaLabel: {}
12
31
  },
13
32
  emits: ["update:current", "change"],
14
- setup(e, { emit: y }) {
15
- const h = v(), a = y;
16
- return (V, j) => (s(), c("ol", d(n(h), {
17
- class: ["hys-ui-ex-steps", { "hys-ui-steps-vertical": e.vertical }],
18
- "aria-label": "流程进度"
33
+ setup(s, { emit: D }) {
34
+ const u = s, v = D, L = F(), k = N(), b = f(() => u.items.map((e) => typeof e == "string" ? { title: e } : e)), c = f(() => Number.isFinite(u.current) ? Math.max(-1, Math.min(u.items.length, Math.trunc(u.current))) : 0), o = f(() => b.value.map((e, n) => !u.disabled && !e.disabled ? n : -1).filter((e) => e >= 0));
35
+ function r(e) {
36
+ var n;
37
+ return ((n = b.value[e]) == null ? void 0 : n.status) ?? (e < c.value ? "finish" : e === c.value ? u.status : "wait");
38
+ }
39
+ function g(e) {
40
+ !u.clickable || !o.value.includes(e) || e === c.value || (v("update:current", e), v("change", e));
41
+ }
42
+ function E(e, n) {
43
+ var z, w;
44
+ if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(e.key) || !o.value.length) return;
45
+ e.preventDefault();
46
+ const l = ["ArrowLeft", "ArrowUp"].includes(e.key) ? -1 : 1, t = o.value.indexOf(n), d = e.key === "Home" ? 0 : e.key === "End" ? o.value.length - 1 : (t + l + o.value.length) % o.value.length;
47
+ (w = (z = k.value) == null ? void 0 : z.querySelector('[data-step-index="' + o.value[d] + '"]')) == null || w.focus(), g(o.value[d]);
48
+ }
49
+ return (e, n) => (a(), i("ol", S({
50
+ ref_key: "root",
51
+ ref: k
52
+ }, m(L), {
53
+ class: ["hys-ui-ex-steps", ["hys-ui-steps-size-" + s.size, { "hys-ui-steps-vertical": s.vertical, "hys-ui-steps-bottom": s.labelPlacement === "bottom", "hys-ui-steps-dots": s.progressDot, "hys-ui-steps-simple": s.simple, "hys-ui-steps-responsive": s.responsive }]],
54
+ "aria-label": s.ariaLabel || "流程进度"
19
55
  }), [
20
- (s(!0), c(l, null, f(e.items, (t, r) => (s(), c("li", {
21
- key: r,
22
- class: m({ "hys-ui-done": r < e.current, "hys-ui-active": r === e.current, "hys-ui-step-error": r === e.current && e.status === "error" }),
23
- "aria-current": r === e.current ? "step" : void 0
56
+ (a(!0), i(A, null, M(b.value, (l, t) => (a(), i("li", {
57
+ key: t,
58
+ class: P(["hys-ui-step-" + r(t), { "hys-ui-done": r(t) === "finish", "hys-ui-active": r(t) === "process", "hys-ui-step-disabled": s.disabled || l.disabled }]),
59
+ "aria-current": t === c.value ? "step" : void 0
24
60
  }, [
25
- u("span", null, [
26
- r < e.current || r === e.current && e.status === "finish" ? (s(), i(n(C), {
27
- key: 0,
28
- size: 14
29
- })) : r === e.current && e.status === "error" ? (s(), i(n(B), {
30
- key: 1,
31
- size: 14
32
- })) : (s(), c(l, { key: 2 }, [
33
- b(o(r + 1), 1)
34
- ], 64))
61
+ B("span", q, [
62
+ y(e.$slots, "icon", {
63
+ item: l,
64
+ index: t,
65
+ status: r(t)
66
+ }, () => [
67
+ s.progressDot ? (a(), i("i", I)) : r(t) === "finish" ? (a(), $(m(R), {
68
+ key: 1,
69
+ size: s.size === "sm" ? 12 : 15
70
+ }, null, 8, ["size"])) : r(t) === "error" ? (a(), $(m(V), {
71
+ key: 2,
72
+ size: s.size === "sm" ? 12 : 15
73
+ }, null, 8, ["size"])) : (a(), i(A, { key: 3 }, [
74
+ h(p(t + 1), 1)
75
+ ], 64))
76
+ ], !0)
35
77
  ]),
36
- u("div", null, [
37
- e.clickable ? (s(), c("button", {
78
+ B("div", O, [
79
+ s.clickable ? (a(), i("button", {
38
80
  key: 0,
39
81
  type: "button",
40
- disabled: typeof t == "object" && t.disabled,
41
- onClick: (E) => {
42
- a("update:current", r), a("change", r);
43
- }
44
- }, o(typeof t == "string" ? t : t.title), 9, z)) : (s(), c("strong", A, o(typeof t == "string" ? t : t.title), 1)),
45
- typeof t == "object" && t.description ? (s(), c("small", N, o(t.description), 1)) : g("", !0)
82
+ "data-step-index": t,
83
+ disabled: s.disabled || l.disabled,
84
+ tabindex: (o.value.includes(c.value) ? c.value : o.value[0]) === t ? 0 : -1,
85
+ onClick: (d) => g(t),
86
+ onKeydown: (d) => E(d, t)
87
+ }, [
88
+ y(e.$slots, "title", {
89
+ item: l,
90
+ index: t,
91
+ status: r(t)
92
+ }, () => [
93
+ h(p(l.title), 1)
94
+ ], !0)
95
+ ], 40, T)) : (a(), i("strong", j, [
96
+ y(e.$slots, "title", {
97
+ item: l,
98
+ index: t,
99
+ status: r(t)
100
+ }, () => [
101
+ h(p(l.title), 1)
102
+ ], !0)
103
+ ])),
104
+ l.subtitle || e.$slots.subtitle ? (a(), i("small", G, [
105
+ y(e.$slots, "subtitle", {
106
+ item: l,
107
+ index: t
108
+ }, () => [
109
+ h(p(l.subtitle), 1)
110
+ ], !0)
111
+ ])) : C("", !0),
112
+ !s.simple && (l.description || e.$slots.description) ? (a(), i("div", J, [
113
+ y(e.$slots, "description", {
114
+ item: l,
115
+ index: t,
116
+ status: r(t)
117
+ }, () => [
118
+ h(p(l.description), 1)
119
+ ], !0)
120
+ ])) : C("", !0)
46
121
  ])
47
- ], 10, p))), 128))
48
- ], 16));
122
+ ], 10, U))), 128))
123
+ ], 16, K));
49
124
  }
50
125
  });
51
126
  export {
52
- D as default
127
+ Y as default
53
128
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./HysSwitch2.vue.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-eab5d9ff"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-89733ae0"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };