hys-ui 0.1.1 → 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 (225) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/README.md +3 -1
  3. package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
  4. package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
  5. package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
  6. package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
  7. package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
  8. package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
  9. package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
  10. package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
  11. package/dist/components/HysBadge/HysBadge.vue.js +2 -2
  12. package/dist/components/HysBadge/HysBadge2.vue.js +154 -27
  13. package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
  14. package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
  15. package/dist/components/HysButton/HysButton.vue.js +2 -2
  16. package/dist/components/HysButton/HysButton2.vue.js +29 -28
  17. package/dist/components/HysCalendar/HysCalendar.vue.js +5 -92
  18. package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
  19. package/dist/components/HysCard/HysCard.vue.js +2 -2
  20. package/dist/components/HysCard/HysCard2.vue.js +175 -42
  21. package/dist/components/HysCascader/HysCascader.vue.js +5 -194
  22. package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
  23. package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
  24. package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
  25. package/dist/components/HysCheckbox/HysCheckbox.vue.js +3 -3
  26. package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
  27. package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
  28. package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
  29. package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
  30. package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
  31. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  32. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +399 -392
  33. package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
  34. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
  35. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
  36. package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
  37. package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
  38. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
  39. package/dist/components/HysDivider/HysDivider.vue.js +2 -2
  40. package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
  41. package/dist/components/HysFileManager/HysFileManager.vue.js +3 -3
  42. package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
  43. package/dist/components/HysForm/HysForm.vue.js +3 -3
  44. package/dist/components/HysForm/HysForm2.vue.js +578 -92
  45. package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
  46. package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
  47. package/dist/components/HysGantt/HysGantt.vue.js +1 -1
  48. package/dist/components/HysGantt/HysGantt2.vue.js +1369 -272
  49. package/dist/components/HysInput/HysInput.vue.js +2 -2
  50. package/dist/components/HysInput/HysInput2.vue.js +467 -120
  51. package/dist/components/HysMention/HysMention.vue.js +2 -2
  52. package/dist/components/HysMention/HysMention2.vue.js +89 -88
  53. package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
  54. package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
  55. package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
  56. package/dist/components/HysPagination/HysPagination.vue.js +1 -1
  57. package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
  58. package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
  59. package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
  60. package/dist/components/HysRadio/HysRadio.vue.js +7 -0
  61. package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
  62. package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +2 -2
  63. package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
  64. package/dist/components/HysRating/HysRating.vue.js +1 -1
  65. package/dist/components/HysRating/HysRating2.vue.js +288 -68
  66. package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
  67. package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
  68. package/dist/components/HysSearch/HysSearch.vue.js +37 -36
  69. package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
  70. package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
  71. package/dist/components/HysSelect/HysSelect.vue.js +3 -2
  72. package/dist/components/HysSelect/HysSelect2.vue.js +859 -185
  73. package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
  74. package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
  75. package/dist/components/HysSlider/HysSlider.vue.js +2 -2
  76. package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
  77. package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
  78. package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
  79. package/dist/components/HysSteps/HysSteps.vue.js +1 -1
  80. package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
  81. package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
  82. package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
  83. package/dist/components/HysTable/HysTable.vue.js +2 -2
  84. package/dist/components/HysTable/HysTable2.vue.js +1473 -88
  85. package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
  86. package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
  87. package/dist/components/HysTabs/HysTabs.vue.js +2 -2
  88. package/dist/components/HysTabs/HysTabs2.vue.js +262 -68
  89. package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
  90. package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
  91. package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
  92. package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
  93. package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
  94. package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
  95. package/dist/components/HysTree/HysTree.vue.js +2 -3
  96. package/dist/components/HysTree/HysTree2.vue.js +641 -302
  97. package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
  98. package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
  99. package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
  100. package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
  101. package/dist/components/HysUpload/HysUpload.vue.js +2 -2
  102. package/dist/components/HysUpload/HysUpload2.vue.js +77 -76
  103. package/dist/composables/autocomplete.js +50 -0
  104. package/dist/composables/avatar.js +57 -0
  105. package/dist/composables/calendar.js +96 -0
  106. package/dist/composables/cascader.js +79 -0
  107. package/dist/composables/choice.js +38 -0
  108. package/dist/composables/choiceModel.js +67 -0
  109. package/dist/composables/datePicker.js +227 -0
  110. package/dist/composables/formContext.js +92 -7
  111. package/dist/composables/formLayout.js +57 -0
  112. package/dist/composables/formValidation.js +240 -0
  113. package/dist/composables/ganttConflicts.js +143 -0
  114. package/dist/composables/numberInput.js +91 -0
  115. package/dist/composables/rating.js +16 -0
  116. package/dist/composables/selectOptions.js +54 -0
  117. package/dist/composables/table.js +150 -0
  118. package/dist/composables/textInput.js +34 -0
  119. package/dist/composables/transfer.js +63 -0
  120. package/dist/composables/tree.js +118 -0
  121. package/dist/composables/treeSelect.js +71 -0
  122. package/dist/composables/useCascader.js +438 -0
  123. package/dist/composables/useDatePicker.js +425 -0
  124. package/dist/composables/useFloating.js +97 -51
  125. package/dist/composables/useGanttDependencies.js +306 -0
  126. package/dist/composables/useGanttHistory.js +157 -0
  127. package/dist/composables/useGanttLabelResize.js +100 -0
  128. package/dist/composables/useTable.js +474 -0
  129. package/dist/composables/useTextareaSize.js +72 -0
  130. package/dist/composables/useTransfer.js +257 -0
  131. package/dist/composables/useTree.js +439 -0
  132. package/dist/composables/useTreeSelect.js +361 -0
  133. package/dist/index.js +149 -139
  134. package/dist/style.css +1 -1
  135. package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
  136. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
  137. package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
  138. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
  139. package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
  140. package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
  141. package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
  142. package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -31
  143. package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
  144. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
  145. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
  146. package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +50 -39
  147. package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
  148. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
  149. package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
  150. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
  151. package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
  152. package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
  153. package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
  154. package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
  155. package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
  156. package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
  157. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +82 -4
  158. package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
  159. package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
  160. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -35
  161. package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
  162. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
  163. package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
  164. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
  165. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
  166. package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
  167. package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +34 -12
  168. package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
  169. package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
  170. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
  171. package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
  172. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -20
  173. package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
  174. package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
  175. package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
  176. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +1 -1
  177. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -9
  178. package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
  179. package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
  180. package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
  181. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
  182. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
  183. package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
  184. package/dist/types/components/HysToast/HysToast.vue.d.ts +3 -3
  185. package/dist/types/components/HysTour/HysTour.vue.d.ts +2 -2
  186. package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
  187. package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
  188. package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
  189. package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
  190. package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
  191. package/dist/types/composables/autocomplete.d.ts +106 -0
  192. package/dist/types/composables/avatar.d.ts +70 -0
  193. package/dist/types/composables/calendar.d.ts +66 -0
  194. package/dist/types/composables/cascader.d.ts +192 -0
  195. package/dist/types/composables/choice.d.ts +110 -0
  196. package/dist/types/composables/choiceModel.d.ts +11 -0
  197. package/dist/types/composables/datePicker.d.ts +247 -0
  198. package/dist/types/composables/formContext.d.ts +133 -8
  199. package/dist/types/composables/formLayout.d.ts +11 -0
  200. package/dist/types/composables/formValidation.d.ts +13 -0
  201. package/dist/types/composables/gantt.d.ts +68 -0
  202. package/dist/types/composables/ganttConflicts.d.ts +30 -0
  203. package/dist/types/composables/numberInput.d.ts +45 -0
  204. package/dist/types/composables/rating.d.ts +18 -0
  205. package/dist/types/composables/segmented.d.ts +15 -0
  206. package/dist/types/composables/selectOptions.d.ts +44 -0
  207. package/dist/types/composables/slider.d.ts +21 -0
  208. package/dist/types/composables/table.d.ts +309 -0
  209. package/dist/types/composables/textInput.d.ts +76 -0
  210. package/dist/types/composables/transfer.d.ts +180 -0
  211. package/dist/types/composables/tree.d.ts +237 -0
  212. package/dist/types/composables/treeSelect.d.ts +167 -0
  213. package/dist/types/composables/useCascader.d.ts +162 -0
  214. package/dist/types/composables/useDatePicker.d.ts +79 -0
  215. package/dist/types/composables/useFloating.d.ts +8 -5
  216. package/dist/types/composables/useGanttDependencies.d.ts +83 -0
  217. package/dist/types/composables/useGanttHistory.d.ts +42 -0
  218. package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
  219. package/dist/types/composables/useTable.d.ts +60 -0
  220. package/dist/types/composables/useTextareaSize.d.ts +3 -0
  221. package/dist/types/composables/useTransfer.d.ts +58 -0
  222. package/dist/types/composables/useTree.d.ts +77 -0
  223. package/dist/types/composables/useTreeSelect.d.ts +117 -0
  224. package/dist/types/index.d.ts +33 -7
  225. package/package.json +2 -1
@@ -0,0 +1,240 @@
1
+ import P from "async-validator";
2
+ import { toRaw as w, unref as k } from "vue";
3
+ import { formValue as R, formPath as _ } from "./formContext.js";
4
+ const D = P.default ?? P;
5
+ function A(e, t = /* @__PURE__ */ new WeakMap()) {
6
+ const r = w(k(e));
7
+ if (!r || typeof r != "object") return r;
8
+ if (r instanceof Date) return new Date(r);
9
+ if (r instanceof RegExp) return new RegExp(r.source, r.flags);
10
+ if (t.has(r)) return t.get(r);
11
+ if (!Array.isArray(r) && Object.getPrototypeOf(r) !== Object.prototype && Object.getPrototypeOf(r) !== null)
12
+ return r;
13
+ const s = Array.isArray(r) ? [] : {};
14
+ t.set(r, s);
15
+ for (const [o, d] of Object.entries(r))
16
+ Object.defineProperty(s, o, {
17
+ value: A(d, t),
18
+ writable: !0,
19
+ enumerable: !0,
20
+ configurable: !0
21
+ });
22
+ return s;
23
+ }
24
+ function S(e, t, r = /* @__PURE__ */ new WeakMap()) {
25
+ if (e = w(e), t = w(t), Object.is(e, t)) return !0;
26
+ if (e instanceof Date && t instanceof Date)
27
+ return e.getTime() === t.getTime();
28
+ if (e instanceof RegExp && t instanceof RegExp)
29
+ return e.source === t.source && e.flags === t.flags;
30
+ if (!e || !t || typeof e != "object" || typeof t != "object") return !1;
31
+ if (r.get(e) === t) return !0;
32
+ if (r.set(e, t), Array.isArray(e) !== Array.isArray(t) || Object.getPrototypeOf(e) !== Object.getPrototypeOf(t) || !Array.isArray(e) && ![Object.prototype, null].includes(Object.getPrototypeOf(e)))
33
+ return !1;
34
+ const s = Object.keys(e);
35
+ return s.length === Object.keys(t).length && s.every(
36
+ (o) => Object.prototype.hasOwnProperty.call(t, o) && S(
37
+ e[o],
38
+ t[o],
39
+ r
40
+ )
41
+ );
42
+ }
43
+ function V(e) {
44
+ return e instanceof Date ? "date" : Array.isArray(e) ? "array" : e && typeof e == "object" ? "object" : typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : "string";
45
+ }
46
+ function E(e, t, r, s) {
47
+ return e.flatMap((o) => {
48
+ const {
49
+ validator: d,
50
+ asyncValidator: y,
51
+ trigger: h,
52
+ level: f,
53
+ fields: n,
54
+ defaultField: i,
55
+ ...a
56
+ } = o, u = [], m = {
57
+ ...a,
58
+ type: a.type ?? (a.enum ? "enum" : V(t))
59
+ };
60
+ return m.transform = function(l) {
61
+ const c = o.transform ? o.transform(l) : l;
62
+ if (this.type = a.type ?? (a.enum ? "enum" : V(c)), n) {
63
+ const p = {};
64
+ for (const [j, O] of Object.entries(n))
65
+ p[j] = E(
66
+ [O].flat(),
67
+ c == null ? void 0 : c[j],
68
+ r,
69
+ s
70
+ );
71
+ this.fields = p;
72
+ }
73
+ return i && (this.defaultField = E(
74
+ [i].flat(),
75
+ void 0,
76
+ r,
77
+ s
78
+ )), c;
79
+ }, (Object.keys(a).some((l) => l !== "message") || n || i || !d && !y) && u.push(m), d && u.push({
80
+ asyncValidator: async (l, c) => {
81
+ if (s.signal.aborted) return;
82
+ const p = await d(c, r, {
83
+ ...s,
84
+ path: l.fullField ?? s.path
85
+ });
86
+ if (!s.signal.aborted) {
87
+ if (p === !1)
88
+ throw Error(
89
+ typeof o.message == "function" ? o.message(l.fullField) : o.message || "校验未通过"
90
+ );
91
+ if (typeof p == "string") throw Error(p);
92
+ if (p instanceof Error) throw p;
93
+ }
94
+ }
95
+ }), y && u.push({
96
+ asyncValidator: (l, c) => new Promise((p, j) => {
97
+ if (s.signal.aborted) {
98
+ p();
99
+ return;
100
+ }
101
+ let O = !1;
102
+ const b = (g) => {
103
+ O || (O = !0, s.signal.removeEventListener("abort", F), g && !s.signal.aborted ? j(typeof g == "string" ? Error(g) : g) : p());
104
+ }, F = () => b();
105
+ s.signal.addEventListener("abort", F, { once: !0 });
106
+ try {
107
+ const g = y(c, b, r, {
108
+ ...s,
109
+ path: l.fullField ?? s.path
110
+ });
111
+ g && typeof g.then == "function" && g.then(
112
+ () => b(),
113
+ (v) => b(v instanceof Error ? v : String(v))
114
+ );
115
+ } catch (g) {
116
+ b(g instanceof Error ? g : String(g));
117
+ }
118
+ })
119
+ }), u;
120
+ });
121
+ }
122
+ const M = {
123
+ default: "校验未通过",
124
+ required: "此项不能为空",
125
+ enum: "请选择允许的值",
126
+ whitespace: "不能只输入空白字符",
127
+ types: {
128
+ string: "请输入文本",
129
+ number: "请输入数字",
130
+ boolean: "请输入布尔值",
131
+ method: "应为函数",
132
+ regexp: "正则表达式无效",
133
+ integer: "请输入整数",
134
+ float: "请输入有效数值",
135
+ array: "应为数组",
136
+ object: "应为对象",
137
+ date: "日期无效",
138
+ email: "邮箱格式不正确",
139
+ url: "链接格式不正确",
140
+ hex: "颜色格式不正确"
141
+ },
142
+ string: {
143
+ len: (e, t) => "长度应为 " + t + " 个字符",
144
+ min: (e, t) => "长度至少为 " + t + " 个字符",
145
+ max: (e, t) => "长度最多为 " + t + " 个字符",
146
+ range: (e, t, r) => "长度应为 " + t + "–" + r + " 个字符"
147
+ },
148
+ number: {
149
+ len: "数值不符合要求",
150
+ min: "数值过小",
151
+ max: "数值过大",
152
+ range: "超出允许范围"
153
+ },
154
+ array: {
155
+ len: "项目数量不符合要求",
156
+ min: "项目数量过少",
157
+ max: "项目数量过多",
158
+ range: "项目数量超出允许范围"
159
+ },
160
+ pattern: { mismatch: "格式不正确" },
161
+ date: {
162
+ format: "日期格式不正确",
163
+ parse: "日期无法解析",
164
+ invalid: "日期无效"
165
+ }
166
+ };
167
+ function q(e, t, r, s, o, d, y = !0) {
168
+ if (!r.length) return { messages: [], fields: {} };
169
+ const h = (f) => {
170
+ const n = {};
171
+ for (const i of f ?? []) {
172
+ const a = _(i.field ?? e), u = String(i.message ?? "校验失败");
173
+ (n[a] ?? (n[a] = [])).includes(u) || n[a].push(u);
174
+ }
175
+ return { messages: [...new Set(Object.values(n).flat())], fields: n };
176
+ };
177
+ try {
178
+ const f = new D({
179
+ [e]: E(r, t, s, d)
180
+ });
181
+ f.messages(M), o && f.messages(o);
182
+ let n = !1, i = { messages: [], fields: {} }, a;
183
+ const u = new Promise((l) => {
184
+ a = l;
185
+ });
186
+ return f.validate(
187
+ { [e]: A(t) },
188
+ {
189
+ firstFields: y,
190
+ suppressWarning: !0,
191
+ suppressValidatorError: !0
192
+ },
193
+ (l) => {
194
+ i = h(l), n = !0, a(i);
195
+ }
196
+ ).catch(() => {
197
+ }), n ? i : u;
198
+ } catch (f) {
199
+ const n = f == null ? void 0 : f.errors;
200
+ return n ? h(n) : {
201
+ messages: [f instanceof Error ? f.message : "校验失败"],
202
+ fields: {
203
+ [e]: [f instanceof Error ? f.message : "校验失败"]
204
+ }
205
+ };
206
+ }
207
+ }
208
+ function z(e, t, r) {
209
+ var d;
210
+ const s = [t[e] ?? []].flat();
211
+ let o = R(r, e);
212
+ for (const [y, h] of Object.entries(t))
213
+ if (e.startsWith(y + ".")) {
214
+ const f = e.slice(y.length + 1).split(".");
215
+ let n = [h].flat(), i = R(r, y);
216
+ for (const a of f) {
217
+ const u = [];
218
+ for (const m of n) {
219
+ r !== void 0 && m.transform && (i = m.transform(A(i)));
220
+ const l = ((d = m.fields) == null ? void 0 : d[a]) ?? m.defaultField;
221
+ l && u.push(
222
+ ...[l].flat().map((c) => ({
223
+ ...c,
224
+ level: c.level ?? m.level,
225
+ trigger: c.trigger ?? m.trigger
226
+ }))
227
+ );
228
+ }
229
+ i = i && typeof i == "object" ? i[a] : void 0, n = u;
230
+ }
231
+ s.push(...n), n.length && (o = i);
232
+ }
233
+ return { rules: s, value: o };
234
+ }
235
+ export {
236
+ z as nestedFormRules,
237
+ q as runFormRules,
238
+ S as sameFormValue,
239
+ A as snapshotForm
240
+ };
@@ -0,0 +1,143 @@
1
+ function x(i) {
2
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(i)) return null;
3
+ const [n, c, l] = i.split("-").map(Number), o = /* @__PURE__ */ new Date(0);
4
+ return o.setUTCHours(0, 0, 0, 0), o.setUTCFullYear(n, c - 1, l), o.getUTCFullYear() === n && o.getUTCMonth() === c - 1 && o.getUTCDate() === l ? o.getTime() / 864e5 : null;
5
+ }
6
+ const C = (i, n) => JSON.stringify([i, n]), h = (i) => new Date(i * 864e5).toISOString().split("T")[0];
7
+ function $(i, n) {
8
+ if (!(i.s === null || i.e === null || n.s === null || n.e === null || i.e < i.s || n.e < n.s || n.s > i.e))
9
+ return {
10
+ id: JSON.stringify(["dependency-order", i.id, n.id]),
11
+ type: "dependency-order",
12
+ taskId: n.id,
13
+ taskTitle: n.title,
14
+ sourceId: i.id,
15
+ sourceTitle: i.title,
16
+ expectedStart: h(i.e + 1),
17
+ days: i.e - n.s + 1,
18
+ message: `${i.title} 于 ${h(i.e)} 结束,${n.title} 最早应在 ${h(i.e + 1)} 开始;当前提前 ${i.e - n.s + 1} 天`
19
+ };
20
+ }
21
+ function D(i) {
22
+ const n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), o = [], r = [], a = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), y = (e) => (u.has(e) || u.set(e, x(e)), u.get(e));
23
+ for (const e of i) {
24
+ const t = {
25
+ id: e.id,
26
+ title: e.title,
27
+ start: e.start,
28
+ end: e.end,
29
+ dependencies: e.dependencies,
30
+ s: y(e.start),
31
+ e: y(e.end)
32
+ };
33
+ n.set(e.id, t), c.set(e.id, []), l.set(e.id, []), (t.s === null || t.e === null || t.e < t.s) && r.push({
34
+ id: JSON.stringify(["invalid-date", e.id]),
35
+ type: "invalid-date",
36
+ taskId: e.id,
37
+ taskTitle: e.title,
38
+ message: `${e.title} 的日期无效,需使用有效的 YYYY-MM-DD 且结束日期不早于开始日期`
39
+ });
40
+ }
41
+ for (const e of n.values())
42
+ for (const t of new Set(e.dependencies ?? [])) {
43
+ if (!n.get(t)) {
44
+ r.push({
45
+ id: JSON.stringify(["missing-dependency", t, e.id]),
46
+ type: "missing-dependency",
47
+ taskId: e.id,
48
+ taskTitle: e.title,
49
+ sourceId: t,
50
+ message: `${e.title} 引用了不存在的前置任务 ${t}`
51
+ });
52
+ continue;
53
+ }
54
+ c.get(t).push(e.id), l.get(e.id).push(t);
55
+ const d = {
56
+ sourceId: t,
57
+ targetId: e.id,
58
+ id: C(t, e.id)
59
+ };
60
+ o.push(d);
61
+ for (const g of /* @__PURE__ */ new Set([t, e.id])) {
62
+ const I = a.get(g);
63
+ I ? I.push(d) : a.set(g, [d]);
64
+ }
65
+ }
66
+ const f = /* @__PURE__ */ new Set(), k = [];
67
+ for (const e of n.keys()) {
68
+ if (f.has(e)) continue;
69
+ const t = [{ id: e, exit: !1 }];
70
+ for (; t.length; ) {
71
+ const s = t.pop();
72
+ if (s.exit) {
73
+ k.push(s.id);
74
+ continue;
75
+ }
76
+ if (!f.has(s.id)) {
77
+ f.add(s.id), t.push({ id: s.id, exit: !0 });
78
+ for (const d of c.get(s.id))
79
+ f.has(d) || t.push({ id: d, exit: !1 });
80
+ }
81
+ }
82
+ }
83
+ const p = /* @__PURE__ */ new Map(), w = [];
84
+ for (let e = k.length - 1; e >= 0; e--) {
85
+ const t = k[e];
86
+ if (p.has(t)) continue;
87
+ const s = w.length, d = [t];
88
+ let g = 0;
89
+ for (p.set(t, s); d.length; ) {
90
+ const I = d.pop();
91
+ g++;
92
+ for (const S of l.get(I))
93
+ p.has(S) || (p.set(S, s), d.push(S));
94
+ }
95
+ w.push(g);
96
+ }
97
+ const T = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ new Map();
98
+ for (const e of o) {
99
+ const t = n.get(e.sourceId), s = n.get(e.targetId);
100
+ let d;
101
+ p.get(t.id) === p.get(s.id) && (t.id === s.id || w[p.get(t.id)] > 1) ? (T.add(e.id), d = {
102
+ id: JSON.stringify(["dependency-cycle", t.id, s.id]),
103
+ type: "dependency-cycle",
104
+ sourceId: t.id,
105
+ sourceTitle: t.title,
106
+ taskId: s.id,
107
+ taskTitle: s.title,
108
+ message: `${t.title} → ${s.title} 属于循环依赖,需先移除环内关系`
109
+ }) : d = $(t, s), d && (r.push(d), M.set(e.id, d));
110
+ }
111
+ const m = /* @__PURE__ */ new Map();
112
+ for (const e of r)
113
+ for (const t of /* @__PURE__ */ new Set([
114
+ e.taskId,
115
+ ...e.sourceId !== void 0 && n.has(e.sourceId) ? [e.sourceId] : []
116
+ ])) {
117
+ const s = m.get(t);
118
+ s ? s.push(e) : m.set(t, [e]);
119
+ }
120
+ return { conflicts: r, byTask: m, byEdge: M, tasks: n, incident: a, cyclic: T };
121
+ }
122
+ function N(i, n, c, l) {
123
+ const o = i.tasks.get(n);
124
+ if (!o) return [];
125
+ const r = {
126
+ ...o,
127
+ s: c,
128
+ e: l,
129
+ start: h(c),
130
+ end: h(l)
131
+ };
132
+ return (i.incident.get(n) ?? []).flatMap((a) => {
133
+ if (i.cyclic.has(a.id)) return [];
134
+ const u = a.sourceId === n ? r : i.tasks.get(a.sourceId), y = a.targetId === n ? r : i.tasks.get(a.targetId), f = $(u, y);
135
+ return f ? [f] : [];
136
+ });
137
+ }
138
+ export {
139
+ D as analyzeGanttSchedule,
140
+ C as ganttEdgeKey,
141
+ x as parseGanttDay,
142
+ N as previewGanttConflicts
143
+ };
@@ -0,0 +1,91 @@
1
+ const a = (n) => 10n ** BigInt(n);
2
+ function B(n) {
3
+ if (typeof n != "string" && typeof n != "number" || typeof n == "number" && !Number.isFinite(n)) return;
4
+ const i = String(n).trim();
5
+ if (i.length > 2048) return;
6
+ const t = /^([+-]?)(?:(\d+)(?:\.(\d*))?|\.(\d+))(?:e([+-]?\d+))?$/i.exec(
7
+ i
8
+ );
9
+ if (!t) return;
10
+ const r = Number(t[5] ?? 0);
11
+ if (!Number.isInteger(r) || Math.abs(r) > 1e3) return;
12
+ const s = t[3] ?? t[4] ?? "", e = (t[2] ?? "0") + s;
13
+ let c = s.length - r, o = BigInt(e) * (t[1] === "-" ? -1n : 1n);
14
+ if (c < 0 && (o *= a(-c), c = 0), !(c > 1e3)) {
15
+ for (; c > 0 && o % 10n === 0n; )
16
+ o /= 10n, c--;
17
+ return { units: o, scale: c };
18
+ }
19
+ }
20
+ function b(n, i) {
21
+ const t = Math.max(n.scale, i.scale);
22
+ return {
23
+ a: n.units * a(t - n.scale),
24
+ b: i.units * a(t - i.scale),
25
+ scale: t
26
+ };
27
+ }
28
+ function h(n, i) {
29
+ const t = b(n, i);
30
+ return t.a === t.b ? 0 : t.a < t.b ? -1 : 1;
31
+ }
32
+ function D(n, i, t = 1) {
33
+ const r = b(n, i);
34
+ return {
35
+ units: r.a + r.b * BigInt(Math.trunc(t)),
36
+ scale: r.scale
37
+ };
38
+ }
39
+ function w(n, i) {
40
+ const t = Math.max(0, Math.min(100, Math.floor(i)));
41
+ if (n.scale <= t) return n;
42
+ const r = a(n.scale - t), s = n.units < 0n, e = s ? -n.units : n.units;
43
+ return {
44
+ units: (e / r + (e % r * 2n >= r ? 1n : 0n)) * (s ? -1n : 1n),
45
+ scale: t
46
+ };
47
+ }
48
+ function N(n, i) {
49
+ const t = n.units < 0n, r = t ? -n.units : n.units;
50
+ let s = r.toString().padStart(n.scale + 1, "0"), e = n.scale ? s.slice(0, -n.scale) + "." + s.slice(-n.scale) : s;
51
+ if (e.includes(".") && (e = e.replace(/\.?0+$/, "")), i !== void 0 && i > 0) {
52
+ const c = e.split(".");
53
+ e = c[0] + "." + (c[1] ?? "").padEnd(Math.min(100, i), "0");
54
+ }
55
+ return (t && r !== 0n ? "-" : "") + e;
56
+ }
57
+ function M(n, i) {
58
+ const t = n / i;
59
+ return n < 0n && n % i !== 0n ? t - 1n : t;
60
+ }
61
+ function y(n, i) {
62
+ return -M(-n, i);
63
+ }
64
+ function S(n, i) {
65
+ const { step: t, base: r, min: s, max: e } = i;
66
+ if (s && e && h(s, e) > 0) return;
67
+ let c = i.precision === void 0 ? n : w(n, i.precision);
68
+ if (i.strict) {
69
+ const o = Math.max(
70
+ c.scale,
71
+ t.scale,
72
+ r.scale,
73
+ (s == null ? void 0 : s.scale) ?? 0,
74
+ (e == null ? void 0 : e.scale) ?? 0
75
+ ), I = c.units * a(o - c.scale), u = t.units * a(o - t.scale), m = r.units * a(o - r.scale), g = I - m, p = g < 0n, x = p ? -g : g;
76
+ let l = (x / u + (x % u * 2n >= u ? 1n : 0n)) * (p ? -1n : 1n);
77
+ const f = s ? y(s.units * a(o - s.scale) - m, u) : void 0, d = e ? M(e.units * a(o - e.scale) - m, u) : void 0;
78
+ if (f !== void 0 && d !== void 0 && f > d) return;
79
+ f !== void 0 && l < f && (l = f), d !== void 0 && l > d && (l = d), c = { units: m + l * u, scale: o };
80
+ } else
81
+ s && h(c, s) < 0 && (c = s), e && h(c, e) > 0 && (c = e);
82
+ return c;
83
+ }
84
+ export {
85
+ B as decimal,
86
+ D as decimalAdd,
87
+ h as decimalCompare,
88
+ w as decimalRound,
89
+ N as decimalText,
90
+ S as normalizeDecimal
91
+ };
@@ -0,0 +1,16 @@
1
+ function N(e, i, c, m, n) {
2
+ if (Array.isArray(e))
3
+ return e[i <= c ? 0 : i >= m ? 2 : 1] ?? e.at(-1) ?? n;
4
+ if (!e || typeof e != "object") return n;
5
+ const y = Object.entries(e).filter(([t]) => Number.isFinite(Number(t))).sort((t, r) => Number(t[0]) - Number(r[0]));
6
+ let u = n;
7
+ for (const [t, r] of y) {
8
+ const o = r && typeof r == "object" && "value" in r && ("excluded" in r || Object.keys(r).every((f) => f === "value")), b = o ? r.value : r;
9
+ if (u = b, i < Number(t) || i === Number(t) && !(o && r.excluded))
10
+ return b;
11
+ }
12
+ return u;
13
+ }
14
+ export {
15
+ N as ratingLevel
16
+ };
@@ -0,0 +1,54 @@
1
+ import { toRaw as g } from "vue";
2
+ function W(a) {
3
+ let r = 0;
4
+ const s = /* @__PURE__ */ new WeakMap();
5
+ return (e) => {
6
+ if (e && typeof e == "object") {
7
+ const n = g(e), o = a().split(".").reduce(
8
+ (l, i) => l && typeof l == "object" && Object.prototype.hasOwnProperty.call(l, i) ? l[i] : void 0,
9
+ n
10
+ );
11
+ return o != null && typeof o != "object" ? "object:" + typeof o + ":" + String(o) : (s.has(n) || s.set(n, ++r), "reference:" + s.get(n));
12
+ }
13
+ return typeof e + ":" + String(e);
14
+ };
15
+ }
16
+ function z(a, r, s) {
17
+ const e = [], n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new WeakSet();
18
+ let l = 0;
19
+ const i = r.label ?? "label", u = r.value ?? "value", K = r.options ?? "options", v = r.disabled ?? "disabled";
20
+ function p(x, d, O = !1, b = "") {
21
+ x.forEach((t, h) => {
22
+ if (!t || typeof t != "object") return;
23
+ const w = t[K], j = O || !!t[v], f = String(t[i] ?? t[u] ?? "");
24
+ if (Array.isArray(w)) {
25
+ const k = g(t);
26
+ if (o.has(k)) return;
27
+ o.add(k);
28
+ const S = d ? d + " / " + f : f;
29
+ e.push({ key: "group:" + b + h, group: S, index: -1 }), p(w, S, j, b + h + ".");
30
+ return;
31
+ }
32
+ const c = t[u];
33
+ if (c == null || !["string", "number", "boolean", "object"].includes(typeof c))
34
+ return;
35
+ const y = s(c);
36
+ n.has(y) || (n.add(y), e.push({
37
+ key: y,
38
+ option: {
39
+ ...t,
40
+ value: c,
41
+ label: f,
42
+ disabled: j
43
+ },
44
+ group: d,
45
+ index: l++
46
+ }));
47
+ });
48
+ }
49
+ return p(a), e;
50
+ }
51
+ export {
52
+ z as normalizeSelectOptions,
53
+ W as selectKeyFactory
54
+ };
@@ -0,0 +1,150 @@
1
+ const N = (n) => typeof n + ":" + n;
2
+ function g(n, r) {
3
+ const s = typeof r == "string" ? r.split(".") : r;
4
+ let o = n;
5
+ for (const e of s) {
6
+ if (o == null || typeof o != "object") return;
7
+ o = o[e];
8
+ }
9
+ return o;
10
+ }
11
+ const M = (n) => n < 576 ? "xs" : n < 768 ? "sm" : n < 992 ? "md" : n < 1200 ? "lg" : n < 1600 ? "xl" : "xxl";
12
+ function S(n, r, s = !0) {
13
+ const o = /* @__PURE__ */ new Set();
14
+ function e(y, u, i = /* @__PURE__ */ new Set(), p = 0) {
15
+ return p > 32 ? [] : y.flatMap((d) => {
16
+ if (i.has(d) || d.hidden || !s && d.type === "expand" || d.responsive && !d.responsive.includes(r) || o.has(d.key))
17
+ return [];
18
+ o.add(d.key);
19
+ const v = d.fixed === !1 ? void 0 : d.fixed === !0 ? "left" : d.fixed ?? u, b = d.children ? e(
20
+ d.children,
21
+ v,
22
+ /* @__PURE__ */ new Set([...i, d]),
23
+ p + 1
24
+ ) : void 0;
25
+ return b && !b.length ? [] : [{ ...d, fixed: v, children: b }];
26
+ });
27
+ }
28
+ const t = e(n);
29
+ function a(y, u) {
30
+ return y.flatMap((i) => {
31
+ if (i.children) {
32
+ const p = a(i.children, u);
33
+ return p.length ? [{ ...i, children: p, fixed: u }] : [];
34
+ }
35
+ return i.fixed === u ? [i] : [];
36
+ });
37
+ }
38
+ const f = [
39
+ ...a(t, "left"),
40
+ ...a(t),
41
+ ...a(t, "right")
42
+ ];
43
+ function m(y) {
44
+ return y.flatMap((u) => u.children ? m(u.children) : [u]);
45
+ }
46
+ function l(y) {
47
+ return Math.max(
48
+ 1,
49
+ ...y.map((u) => u.children ? 1 + l(u.children) : 1)
50
+ );
51
+ }
52
+ const c = l(f), h = Array.from({ length: c }, () => []);
53
+ function x(y, u) {
54
+ for (const i of y) {
55
+ const p = i.children ? m(i.children) : [i];
56
+ h[u].push({
57
+ column: i,
58
+ key: i.key + ":" + (i.fixed || "center"),
59
+ leaves: p,
60
+ colspan: p.length,
61
+ rowspan: i.children ? 1 : c - u,
62
+ fixed: i.fixed === "left" || i.fixed === "right" ? i.fixed : void 0
63
+ }), i.children && x(i.children, u + 1);
64
+ }
65
+ }
66
+ return x(f, 0), { leaves: m(f), headers: h };
67
+ }
68
+ function F(n, r) {
69
+ const s = new Intl.Collator("zh-CN", {
70
+ numeric: !0,
71
+ sensitivity: "base"
72
+ }), o = n.flatMap((e) => {
73
+ const t = r.find((a) => a.key === e.key);
74
+ return t && t.sortable !== "custom" ? [{ ...e, column: t }] : [];
75
+ });
76
+ return (e, t) => {
77
+ for (const { direction: a, column: f } of o) {
78
+ if (f.sorter) {
79
+ const l = f.sorter(e, t);
80
+ if (Number.isFinite(l) && l !== 0)
81
+ return (a === "asc" ? 1 : -1) * l;
82
+ continue;
83
+ }
84
+ const m = Array.isArray(f.sortBy) ? f.sortBy : [f.sortBy ?? f.dataIndex ?? f.key];
85
+ for (const l of m) {
86
+ const c = typeof l == "function" ? l(e) : g(e, l), h = typeof l == "function" ? l(t) : g(t, l);
87
+ if (c == null || h == null) {
88
+ if (c == null && h == null) continue;
89
+ return c == null ? 1 : -1;
90
+ }
91
+ const x = typeof c == "number" && typeof h == "number" ? Number.isNaN(c) ? Number.isNaN(h) ? 0 : 1 : Number.isNaN(h) ? -1 : c - h : s.compare(String(c), String(h));
92
+ if (Number.isFinite(x) && x !== 0)
93
+ return (a === "asc" ? 1 : -1) * x;
94
+ }
95
+ }
96
+ return 0;
97
+ };
98
+ }
99
+ function w(n, r) {
100
+ var o;
101
+ const s = /* @__PURE__ */ new Map();
102
+ for (const e of r) {
103
+ const t = n[e.key];
104
+ if (!(t != null && t.length) || !e.filters || e.filterMethod) continue;
105
+ const a = new Set(t), f = k(e.filters), m = new Map(f.map((l) => [l.value, l]));
106
+ for (const l of t) {
107
+ const c = (o = m.get(l)) == null ? void 0 : o.children;
108
+ if (c)
109
+ for (const h of k(c))
110
+ a.add(h.value);
111
+ }
112
+ s.set(e.key, a);
113
+ }
114
+ return (e) => r.every((t) => {
115
+ const a = n[t.key];
116
+ return a != null && a.length ? s.has(t.key) ? s.get(t.key).has(
117
+ g(
118
+ e,
119
+ t.dataIndex ?? t.key
120
+ )
121
+ ) : a.some(
122
+ (f) => t.filterMethod ? t.filterMethod(f, e, t) : String(g(e, t.dataIndex ?? t.key) ?? "").toLocaleLowerCase().includes(String(f).toLocaleLowerCase())
123
+ ) : !0;
124
+ });
125
+ }
126
+ function k(n) {
127
+ const r = [], s = /* @__PURE__ */ new Set(), o = [...n].reverse();
128
+ for (; o.length; ) {
129
+ const e = o.pop();
130
+ s.has(e) || (s.add(e), r.push(e), e.children && o.push(...[...e.children].reverse()));
131
+ }
132
+ return r;
133
+ }
134
+ function C(n, r) {
135
+ if (r.summary === "count") return n.length;
136
+ const s = n.map((e) => g(e, r.dataIndex ?? r.key)).filter((e) => typeof e == "number" && Number.isFinite(e));
137
+ if (!s.length) return "—";
138
+ const o = s.reduce((e, t) => e + t, 0);
139
+ return r.summary === "sum" ? +o.toFixed(12) : r.summary === "avg" ? +(o / s.length).toFixed(12) : r.summary === "min" ? s.reduce((e, t) => Math.min(e, t)) : r.summary === "max" ? s.reduce((e, t) => Math.max(e, t)) : "";
140
+ }
141
+ export {
142
+ M as tableBreakpoint,
143
+ S as tableColumns,
144
+ F as tableCompare,
145
+ k as tableFilterOptions,
146
+ w as tableFilterPredicate,
147
+ C as tableSummary,
148
+ N as tableToken,
149
+ g as tableValue
150
+ };