@dazhicheng/ui 1.5.198 → 1.5.201

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 (242) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/api/dataTypeContext.js +17 -0
  3. package/dist/assets/img/empty_images/no_data.png.js +4 -0
  4. package/dist/assets/img/empty_images/search.png.js +4 -0
  5. package/dist/assets/img/image_status/develop.png.js +4 -0
  6. package/dist/assets/img/image_status/loading.gif.js +4 -0
  7. package/dist/assets/img/image_status/loading_fail.png.js +4 -0
  8. package/dist/assets/img/image_status/no_network.png.js +4 -0
  9. package/dist/assets/img/image_status/no_permission.png.js +4 -0
  10. package/dist/assets/svg/action_more.svg.js +4 -0
  11. package/dist/assets/svg/close.svg.js +4 -0
  12. package/dist/assets/svg/item_error.svg.js +4 -0
  13. package/dist/assets/svg/paixu-jiangxu.svg.js +4 -0
  14. package/dist/assets/svg/paixu-moren.svg.js +4 -0
  15. package/dist/assets/svg/paixu-shengxu.svg.js +4 -0
  16. package/dist/assets/svg/quanping.svg.js +4 -0
  17. package/dist/assets/svg/suoxiao.svg.js +4 -0
  18. package/dist/components/tt-api-component/index.js +7 -0
  19. package/dist/components/tt-api-component/index.vue.js +7 -0
  20. package/dist/components/tt-api-component/index.vue2.js +199 -0
  21. package/dist/components/tt-area/TtArea.vue.js +7 -0
  22. package/dist/components/tt-area/TtArea.vue2.js +36 -0
  23. package/dist/components/tt-button/components/AddButton.vue.js +24 -0
  24. package/dist/components/tt-button/components/AddButton.vue2.js +4 -0
  25. package/dist/components/tt-button/index.js +9 -0
  26. package/dist/components/tt-button/index.vue.js +7 -0
  27. package/dist/components/tt-button/index.vue2.js +68 -0
  28. package/dist/components/tt-checkbox/index.js +7 -0
  29. package/dist/components/tt-checkbox/index.vue.js +77 -0
  30. package/dist/components/tt-checkbox/index.vue2.js +4 -0
  31. package/dist/components/tt-drawer/index.js +14 -0
  32. package/dist/components/tt-drawer/src/RenderDrawer.vue.js +156 -0
  33. package/dist/components/tt-drawer/src/RenderDrawer.vue3.js +5 -0
  34. package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +56 -0
  35. package/dist/components/tt-drawer/src/components/DrawerFooter.vue3.js +5 -0
  36. package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +7 -0
  37. package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +21 -0
  38. package/dist/components/tt-drawer/src/hooks/useDrawerRender.js +124 -0
  39. package/dist/components/tt-drawer/src/hooks/useResizable.js +98 -0
  40. package/dist/components/tt-drawer/src/index.js +17 -0
  41. package/dist/components/tt-drawer/src/props.js +72 -0
  42. package/dist/components/tt-drawer/src/utils/drawer-api.js +191 -0
  43. package/dist/components/tt-empty/index.js +34 -0
  44. package/dist/components/tt-form/index.js +65 -0
  45. package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +38 -0
  46. package/dist/components/tt-form/src/components/ExpandableArrow.vue3.js +5 -0
  47. package/dist/components/tt-form/src/components/FormActions.vue2.js +177 -0
  48. package/dist/components/tt-form/src/components/FormActions.vue3.js +5 -0
  49. package/dist/components/tt-form/src/components/FormElInput.vue.js +80 -0
  50. package/dist/components/tt-form/src/components/FormElInput.vue2.js +4 -0
  51. package/dist/components/tt-form/src/components/Slot.js +28 -0
  52. package/dist/components/tt-form/src/config.js +57 -0
  53. package/dist/components/tt-form/src/form/FormControl.vue.js +16 -0
  54. package/dist/components/tt-form/src/form/FormControl.vue2.js +4 -0
  55. package/dist/components/tt-form/src/form/FormDescription.vue.js +21 -0
  56. package/dist/components/tt-form/src/form/FormDescription.vue2.js +4 -0
  57. package/dist/components/tt-form/src/form/FormItem.vue.js +20 -0
  58. package/dist/components/tt-form/src/form/FormItem.vue2.js +4 -0
  59. package/dist/components/tt-form/src/form/FormLabel.vue.js +19 -0
  60. package/dist/components/tt-form/src/form/FormLabel.vue2.js +4 -0
  61. package/dist/components/tt-form/src/form/FormMessage.vue.js +18 -0
  62. package/dist/components/tt-form/src/form/FormMessage.vue2.js +4 -0
  63. package/dist/components/tt-form/src/form/FormMessageToolTip.vue.js +30 -0
  64. package/dist/components/tt-form/src/form/FormMessageToolTip.vue2.js +4 -0
  65. package/dist/components/tt-form/src/form/RenderContent.vue.js +31 -0
  66. package/dist/components/tt-form/src/form/RenderContent.vue2.js +4 -0
  67. package/dist/components/tt-form/src/form/injectionKeys.js +4 -0
  68. package/dist/components/tt-form/src/form/useFormField.js +24 -0
  69. package/dist/components/tt-form/src/form-render/FormField.vue.js +4 -0
  70. package/dist/components/tt-form/src/form-render/FormField.vue2.js +346 -0
  71. package/dist/components/tt-form/src/form-render/FormFieldContact.js +54 -0
  72. package/dist/components/tt-form/src/form-render/FormLabel.vue.js +4 -0
  73. package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +102 -0
  74. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +195 -0
  75. package/dist/components/tt-form/src/form-render/array-register/props.js +47 -0
  76. package/dist/components/tt-form/src/form-render/array-register/utils.js +12 -0
  77. package/dist/components/tt-form/src/form-render/context.js +15 -0
  78. package/dist/components/tt-form/src/form-render/dependencies.js +51 -0
  79. package/dist/components/tt-form/src/form-render/expandable.js +46 -0
  80. package/dist/components/tt-form/src/form-render/form.vue2.js +197 -0
  81. package/dist/components/tt-form/src/form-render/form.vue3.js +5 -0
  82. package/dist/components/tt-form/src/form-render/helper.js +22 -0
  83. package/dist/components/tt-form/src/form-render/rootWrapperClass.js +10 -0
  84. package/dist/components/tt-form/src/formApi.js +790 -0
  85. package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +223 -0
  86. package/dist/components/tt-form/src/group-form/GroupForm.vue3.js +5 -0
  87. package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +278 -0
  88. package/dist/components/tt-form/src/group-form/GroupSection.vue3.js +5 -0
  89. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +153 -0
  90. package/dist/components/tt-form/src/group-form/LazyFormField.vue3.js +5 -0
  91. package/dist/components/tt-form/src/group-form/groupFormApi.js +700 -0
  92. package/dist/components/tt-form/src/group-form/lazyContext.js +38 -0
  93. package/dist/components/tt-form/src/group-form/useGroupForm.js +83 -0
  94. package/dist/components/tt-form/src/group-form/utils.js +106 -0
  95. package/dist/components/tt-form/src/hooks/useArrayRegistry.js +22 -0
  96. package/dist/components/tt-form/src/hooks/useFieldArray.js +137 -0
  97. package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +33 -0
  98. package/dist/components/tt-form/src/hooks/useSelectCollapse.js +81 -0
  99. package/dist/components/tt-form/src/index.vue2.js +149 -0
  100. package/dist/components/tt-form/src/index.vue3.js +5 -0
  101. package/dist/components/tt-form/src/shared/createContext.js +14 -0
  102. package/dist/components/tt-form/src/shared/global-state.js +22 -0
  103. package/dist/components/tt-form/src/shared/zod-defaults.js +47 -0
  104. package/dist/components/tt-form/src/types/forms.js +6 -0
  105. package/dist/components/tt-form/src/useForm.js +28 -0
  106. package/dist/components/tt-form/src/useFormContext.js +320 -0
  107. package/dist/components/tt-form/src/utils/array-path.js +18 -0
  108. package/dist/components/tt-form-item-error-tooltip/index.js +9 -0
  109. package/dist/components/tt-form-item-error-tooltip/index.vue.js +183 -0
  110. package/dist/components/tt-form-item-error-tooltip/index.vue3.js +5 -0
  111. package/dist/components/tt-icon/components/AddIcon.vue.js +28 -0
  112. package/dist/components/tt-icon/components/AddIcon.vue2.js +4 -0
  113. package/dist/components/tt-icon/components/SubIcon.vue.js +28 -0
  114. package/dist/components/tt-icon/components/SubIcon.vue2.js +4 -0
  115. package/dist/components/tt-icon/index.js +11 -0
  116. package/dist/components/tt-icon/index.vue.js +8 -0
  117. package/dist/components/tt-icon/index.vue2.js +115 -0
  118. package/dist/components/tt-image/index.js +9 -0
  119. package/dist/components/tt-image/src/components/ImageViewer.js +41 -0
  120. package/dist/components/tt-image/tt-image.js +55 -0
  121. package/dist/components/tt-loading/index.js +8 -0
  122. package/dist/components/tt-loading/src/directive.js +51 -0
  123. package/dist/components/tt-loading/src/loading.vue.js +7 -0
  124. package/dist/components/tt-loading/src/loading.vue2.js +75 -0
  125. package/dist/components/tt-loading/src/service.js +79 -0
  126. package/dist/components/tt-log/index.js +7 -0
  127. package/dist/components/tt-log/index.vue.js +30 -0
  128. package/dist/components/tt-log/index.vue2.js +4 -0
  129. package/dist/components/tt-modal/index.js +14 -0
  130. package/dist/components/tt-modal/src/RenderModal.vue.js +310 -0
  131. package/dist/components/tt-modal/src/RenderModal.vue3.js +5 -0
  132. package/dist/components/tt-modal/src/components/ModalFooter.vue.js +7 -0
  133. package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +74 -0
  134. package/dist/components/tt-modal/src/components/ModalHeader.vue.js +7 -0
  135. package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +22 -0
  136. package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +48 -0
  137. package/dist/components/tt-modal/src/components/ModalWrapper.vue2.js +4 -0
  138. package/dist/components/tt-modal/src/hooks/useModalRender.js +131 -0
  139. package/dist/components/tt-modal/src/index.js +17 -0
  140. package/dist/components/tt-modal/src/props.js +75 -0
  141. package/dist/components/tt-modal/src/utils/modal-api.js +200 -0
  142. package/dist/components/tt-modal/src/utils/modal-stack.js +28 -0
  143. package/dist/components/tt-modal-form/hooks/useModalFormSlot.js +22 -0
  144. package/dist/components/tt-modal-form/index.vue.js +178 -0
  145. package/dist/components/tt-modal-form/index.vue2.js +4 -0
  146. package/dist/components/tt-modal-form/useModalForm.js +30 -0
  147. package/dist/components/tt-nav-anchor/index.js +8 -0
  148. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +234 -0
  149. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue3.js +5 -0
  150. package/dist/components/tt-nav-anchor/src/constants.js +4 -0
  151. package/dist/components/tt-panel-select/index.js +7 -0
  152. package/dist/components/tt-panel-select/src/common.js +4 -0
  153. package/dist/components/tt-panel-select/src/components/PanelLeft.vue.js +56 -0
  154. package/dist/components/tt-panel-select/src/components/PanelLeft.vue2.js +4 -0
  155. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +277 -0
  156. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue2.js +4 -0
  157. package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +108 -0
  158. package/dist/components/tt-panel-select/src/components/PanelRight.vue2.js +4 -0
  159. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +184 -0
  160. package/dist/components/tt-panel-select/src/hooks/usePanelSelection.js +91 -0
  161. package/dist/components/tt-panel-select/src/index.vue.js +386 -0
  162. package/dist/components/tt-panel-select/src/index.vue2.js +4 -0
  163. package/dist/components/tt-select/index.js +8 -0
  164. package/dist/components/tt-select/src/Select.vue.js +315 -0
  165. package/dist/components/tt-select/src/Select.vue3.js +5 -0
  166. package/dist/components/tt-select/src/components/SelectTable.vue.js +86 -0
  167. package/dist/components/tt-select/src/components/SelectTable.vue3.js +5 -0
  168. package/dist/components/tt-select/src/components/Table.vue.js +307 -0
  169. package/dist/components/tt-select/src/components/Table.vue3.js +5 -0
  170. package/dist/components/tt-select/src/const.js +19 -0
  171. package/dist/components/tt-select/src/hooks/useDataSource.js +196 -0
  172. package/dist/components/tt-select/src/hooks/useGrid.js +97 -0
  173. package/dist/components/tt-select/src/hooks/useKeyboard.js +63 -0
  174. package/dist/components/tt-select/src/hooks/usePagination.js +45 -0
  175. package/dist/components/tt-select/src/hooks/useSelect.js +100 -0
  176. package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
  177. package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +345 -0
  178. package/dist/components/tt-select/src/props.js +201 -0
  179. package/dist/components/tt-select/src/utils/index.js +16 -0
  180. package/dist/components/tt-table/index.js +33 -0
  181. package/dist/components/tt-table/src/Table.vue.js +623 -0
  182. package/dist/components/tt-table/src/Table.vue3.js +5 -0
  183. package/dist/components/tt-table/src/TableForm.vue.js +317 -0
  184. package/dist/components/tt-table/src/TableForm.vue2.js +4 -0
  185. package/dist/components/tt-table/src/componentMap.js +4 -0
  186. package/dist/components/tt-table/src/components/RowContext.js +24 -0
  187. package/dist/components/tt-table/src/components/TableAction.vue.js +222 -0
  188. package/dist/components/tt-table/src/components/TableAction.vue2.js +4 -0
  189. package/dist/components/tt-table/src/components/TableButtons.js +117 -0
  190. package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +233 -0
  191. package/dist/components/tt-table/src/components/TableColumnModal.vue3.js +5 -0
  192. package/dist/components/tt-table/src/components/TableToobalTools.vue.js +87 -0
  193. package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +4 -0
  194. package/dist/components/tt-table/src/emits.js +15 -0
  195. package/dist/components/tt-table/src/hooks/useCellArea.js +15 -0
  196. package/dist/components/tt-table/src/hooks/useColumns.js +275 -0
  197. package/dist/components/tt-table/src/hooks/useCustomColumns.js +53 -0
  198. package/dist/components/tt-table/src/hooks/useDataSource.js +224 -0
  199. package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +64 -0
  200. package/dist/components/tt-table/src/hooks/usePagination.js +44 -0
  201. package/dist/components/tt-table/src/hooks/useRowSelection.js +84 -0
  202. package/dist/components/tt-table/src/hooks/useTableContext.js +20 -0
  203. package/dist/components/tt-table/src/hooks/useTableEvent.js +197 -0
  204. package/dist/components/tt-table/src/hooks/useTableForm.js +60 -0
  205. package/dist/components/tt-table/src/hooks/useTableRender.js +33 -0
  206. package/dist/components/tt-table/src/hooks/useTableSlot.js +17 -0
  207. package/dist/components/tt-table/src/props.js +482 -0
  208. package/dist/components/tt-table/src/toolProps.js +30 -0
  209. package/dist/components/tt-table/src/utils/context.js +17 -0
  210. package/dist/components/tt-table/src/utils/table-api.js +386 -0
  211. package/dist/components/tt-table/src/utils/table-form-api.js +122 -0
  212. package/dist/components/tt-text/index.js +7 -0
  213. package/dist/components/tt-text/index.vue.js +7 -0
  214. package/dist/components/tt-text/index.vue2.js +73 -0
  215. package/dist/components/tt-upload/index.js +9 -0
  216. package/dist/components/tt-upload/src/TtUpload.vue.js +305 -0
  217. package/dist/components/tt-upload/src/TtUpload.vue2.js +4 -0
  218. package/dist/components/tt-upload/src/typing.js +107 -0
  219. package/dist/directives/auto-tip/index.js +62 -0
  220. package/dist/directives/dialog-resize/index.js +49 -0
  221. package/dist/directives/dialog-resize/use-css-variable.js +44 -0
  222. package/dist/directives/dialog-resize/use-draggable.js +35 -0
  223. package/dist/directives/dialog-resize/use-fullscreen.js +38 -0
  224. package/dist/directives/dialog-resize/use-parse-translate.js +9 -0
  225. package/dist/directives/dialog-resize/use-resizer.js +37 -0
  226. package/dist/directives/disabled-tip/index.js +78 -0
  227. package/dist/directives/index.js +8 -0
  228. package/dist/hooks/useDataPermissionOptions.js +142 -0
  229. package/dist/hooks/useFormSchemasLink.js +261 -0
  230. package/dist/hooks/useFormat.js +44 -0
  231. package/dist/hooks/useLoading.js +22 -0
  232. package/dist/hooks/useScreenshotOss.js +69 -0
  233. package/dist/hooks/useSetup.js +59 -0
  234. package/dist/index.js +142 -60274
  235. package/dist/plugins/default/renderCellContent.js +58 -0
  236. package/dist/plugins/vxeTable/switchStatus.js +91 -0
  237. package/dist/plugins.js +4 -146
  238. package/dist/style.css +1 -1
  239. package/dist/utils/xhr.js +8 -0
  240. package/package.json +5 -3
  241. package/dist/index-NG5FNCLD.js +0 -3430
  242. package/dist/index.modern-4Cf3dcJP.js +0 -3069
@@ -0,0 +1,108 @@
1
+ import { defineComponent as O, ref as f, computed as s, watch as z, nextTick as H, createElementBlock as c, openBlock as p, normalizeClass as o, createElementVNode as v, createVNode as r, unref as t, withCtx as h, createTextVNode as b, normalizeStyle as g, Fragment as N, renderList as I, createCommentVNode as A, toDisplayString as P } from "vue";
2
+ import w from "@dazhicheng-ui/assets/svg/close.svg?raw";
3
+ import { TtButton as Y } from "@dazhicheng-ui/components/tt-button";
4
+ import { TtIcon as y } from "@dazhicheng-ui/components/tt-icon";
5
+ import { TtText as D } from "@dazhicheng-ui/components/tt-text";
6
+ import { ElScrollbar as F } from "element-plus";
7
+ const n = 34, $ = 8, U = /* @__PURE__ */ O({
8
+ name: "PanelRight",
9
+ __name: "PanelRight",
10
+ props: {
11
+ prefixCls: {},
12
+ multiple: { type: Boolean },
13
+ selectedOptions: {},
14
+ disabled: { type: Boolean }
15
+ },
16
+ emits: ["clearAll", "remove"],
17
+ setup(_, { emit: k }) {
18
+ const a = _, C = k, u = f(), d = f(0), x = f(340), T = s(() => a.selectedOptions.length * n), R = s(() => Math.max(1, Math.ceil(x.value / n))), m = s(() => Math.max(0, Math.floor(d.value / n) - $)), S = s(
19
+ () => Math.min(a.selectedOptions.length, m.value + R.value + $ * 2)
20
+ ), V = s(() => m.value * n), B = s(() => a.selectedOptions.slice(m.value, S.value));
21
+ function E() {
22
+ var l;
23
+ const e = (l = u.value) == null ? void 0 : l.wrapRef;
24
+ e && (x.value = e.clientHeight, d.value = e.scrollTop);
25
+ }
26
+ function M() {
27
+ var l;
28
+ const e = (l = u.value) == null ? void 0 : l.wrapRef;
29
+ e && (d.value = e.scrollTop);
30
+ }
31
+ return z(
32
+ () => a.selectedOptions.length,
33
+ async () => {
34
+ await H(), E();
35
+ },
36
+ { immediate: !0 }
37
+ ), (e, l) => (p(), c("div", {
38
+ class: o(`${e.prefixCls}__right`)
39
+ }, [
40
+ v("div", {
41
+ class: o(`${e.prefixCls}__selected-actions`)
42
+ }, [
43
+ r(t(Y), {
44
+ disabled: e.disabled,
45
+ class: "w-full",
46
+ plain: "",
47
+ onClick: l[0] || (l[0] = (i) => C("clearAll"))
48
+ }, {
49
+ default: h(() => [
50
+ r(t(y), {
51
+ class: "mr-[4px]",
52
+ size: 14,
53
+ "is-custom-svg": "",
54
+ icon: t(w)
55
+ }, null, 8, ["icon"]),
56
+ l[1] || (l[1] = b(" 取消全选 ", -1))
57
+ ]),
58
+ _: 1
59
+ }, 8, ["disabled"])
60
+ ], 2),
61
+ r(t(F), {
62
+ ref_key: "scrollbarRef",
63
+ ref: u,
64
+ class: o(`${e.prefixCls}__selected-list ${e.prefixCls}__right-scrollbar`),
65
+ height: "340px",
66
+ onScroll: M
67
+ }, {
68
+ default: h(() => [
69
+ v("div", {
70
+ style: g({ height: `${T.value}px` })
71
+ }, [
72
+ v("div", {
73
+ style: g({ transform: `translateY(${V.value}px)` })
74
+ }, [
75
+ (p(!0), c(N, null, I(B.value, (i) => (p(), c("div", {
76
+ key: i.value,
77
+ style: g({ height: `${n}px` }),
78
+ class: o(`${e.prefixCls}__selected-item`)
79
+ }, [
80
+ r(t(D), null, {
81
+ default: h(() => [
82
+ b(P(i.label), 1)
83
+ ]),
84
+ _: 2
85
+ }, 1024),
86
+ e.disabled ? A("", !0) : (p(), c("span", {
87
+ key: 0,
88
+ class: o(`${e.prefixCls}__selected-item-close`)
89
+ }, [
90
+ r(t(y), {
91
+ size: 14,
92
+ "is-custom-svg": "",
93
+ icon: t(w),
94
+ onClick: (G) => C("remove", i.value)
95
+ }, null, 8, ["icon", "onClick"])
96
+ ], 2))
97
+ ], 6))), 128))
98
+ ], 4)
99
+ ], 4)
100
+ ]),
101
+ _: 1
102
+ }, 8, ["class"])
103
+ ], 2));
104
+ }
105
+ });
106
+ export {
107
+ U as default
108
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./PanelRight.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,184 @@
1
+ import { isFunction as w } from "@dazhicheng/utils";
2
+ import { objectOmit as X } from "@vueuse/core";
3
+ import { get as i, cloneDeep as Y } from "lodash-es";
4
+ import { pinyin as Z } from "pinyin-pro";
5
+ import { computed as d, ref as T, unref as ee, nextTick as te } from "vue";
6
+ function oe(a) {
7
+ const A = d(() => {
8
+ const e = a.treeConfig || {};
9
+ return {
10
+ transform: e.transform,
11
+ labelField: e.labelField ?? "label",
12
+ valueField: e.valueField ?? "value",
13
+ disabledField: e.disabledField ?? "disabled",
14
+ childrenField: e.childrenField ?? "children",
15
+ parentField: e.parentField ?? "pid",
16
+ rootParentValue: e.rootParentValue ?? null
17
+ };
18
+ }), p = T(!1), C = T([]), P = T(!1), S = T(!1), M = d(() => w(a.api) ? C.value : a.options || []), N = d(() => K(M.value)), z = d(() => !V() && a.showPinyinMode ? $(G.value) : D(N.value)), O = d(() => j(N.value)), B = d(() => O.value.filter((e) => {
19
+ var t;
20
+ return (t = e.children) == null ? void 0 : t.length;
21
+ })), G = d(() => O.value.filter((e) => e.children === void 0));
22
+ async function L() {
23
+ if (!(!a.api || !w(a.api))) {
24
+ if (p.value) {
25
+ P.value = !0;
26
+ return;
27
+ }
28
+ C.value = [];
29
+ try {
30
+ p.value = !0;
31
+ let e = ee(a.params);
32
+ a.beforeFetch && w(a.beforeFetch) && (e = await a.beforeFetch(Y(e)) || e);
33
+ let t = await a.api(e);
34
+ a.afterFetch && w(a.afterFetch) && (t = await a.afterFetch(t) || t), S.value = !0, C.value = Array.isArray(t) ? t : i(t, a.resultField || "") || [];
35
+ } catch {
36
+ S.value = !1;
37
+ } finally {
38
+ p.value = !1, P.value && (P.value = !1, await te(), L());
39
+ }
40
+ }
41
+ }
42
+ function K(e) {
43
+ const { childrenField: t, transform: r, valueField: n, labelField: l, disabledField: o, parentField: s } = A.value, u = e.some((b) => Array.isArray(i(b, t))), h = e.some((b) => {
44
+ const F = i(b, t);
45
+ return Array.isArray(F) && F.length > 0;
46
+ }), v = u || h ? e : r ? U(e) : e;
47
+ function g(b, F = 0, m) {
48
+ return b.map((c) => {
49
+ const J = i(c, n), x = i(c, t), Q = Array.isArray(x), W = [l, n, o, t].filter(
50
+ (y) => !!y
51
+ ), f = {
52
+ ...X(c, W),
53
+ label: String(i(c, l) ?? ""),
54
+ value: J,
55
+ disabled: !!i(c, o),
56
+ pid: (m == null ? void 0 : m.value) ?? i(c, s),
57
+ level: F,
58
+ path: [],
59
+ raw: c
60
+ };
61
+ if (f.path = m ? [...m.path, f] : [f], Q) {
62
+ const y = x;
63
+ f.children = y.length ? g(y, F + 1, f) : [];
64
+ } else
65
+ f.children = void 0;
66
+ return f;
67
+ });
68
+ }
69
+ return g(v);
70
+ }
71
+ function U(e) {
72
+ const t = /* @__PURE__ */ new Map(), r = [], { childrenField: n, valueField: l, parentField: o, rootParentValue: s } = A.value;
73
+ return e.forEach((u) => {
74
+ const h = i(u, l);
75
+ t.set(h, { ...u });
76
+ }), t.forEach((u) => {
77
+ const h = i(u, o), v = h === s ? void 0 : t.get(h);
78
+ if (v) {
79
+ const g = i(v, n) || [];
80
+ g.push(u), v[n] = g;
81
+ } else
82
+ r.push(u);
83
+ }), r;
84
+ }
85
+ function D(e) {
86
+ return e.filter((t) => {
87
+ var r;
88
+ return (r = t.children) == null ? void 0 : r.length;
89
+ }).map((t) => {
90
+ var r;
91
+ return {
92
+ ...t,
93
+ children: (r = t.children) != null && r.some((n) => {
94
+ var l;
95
+ return (l = n.children) == null ? void 0 : l.length;
96
+ }) ? D(t.children) : void 0
97
+ };
98
+ });
99
+ }
100
+ function $(e) {
101
+ return k(e).map((r) => {
102
+ const n = {
103
+ label: String(r.label),
104
+ value: r.value,
105
+ disabled: !1,
106
+ pid: null,
107
+ level: 0,
108
+ path: [],
109
+ raw: { label: r.label, value: r.value }
110
+ };
111
+ return n.path = [n], n.children = void 0, n;
112
+ });
113
+ }
114
+ function j(e) {
115
+ var n;
116
+ const t = [], r = [...e];
117
+ for (; r.length; ) {
118
+ const l = r.shift();
119
+ l && (t.push(l), (n = l.children) != null && n.length && r.unshift(...l.children));
120
+ }
121
+ return t;
122
+ }
123
+ function E(e, t) {
124
+ const r = t.trim().toLowerCase();
125
+ return r ? e.filter((n) => n.label.toLowerCase().includes(r)) : e;
126
+ }
127
+ function q(e, t) {
128
+ const r = E(e, t);
129
+ return a.showOriginMode ? R(r) : a.showPinyinMode ? k(r) : V() ? I(r) : _(r);
130
+ }
131
+ function V() {
132
+ const { childrenField: e, transform: t } = A.value, r = M.value.some((o) => Array.isArray(i(o, e))), n = M.value.some((o) => {
133
+ const s = i(o, e);
134
+ return Array.isArray(s) && !!s.length;
135
+ });
136
+ return t || !t && (r || n);
137
+ }
138
+ function _(e) {
139
+ const t = /* @__PURE__ */ new Map();
140
+ return e.forEach((r) => {
141
+ const n = r.path.at(-2), l = (n == null ? void 0 : n.value) ?? r.value, o = (n == null ? void 0 : n.label) ?? r.label, s = t.get(l) || { value: l, label: o, options: [] };
142
+ s.options.push(r), t.set(l, s);
143
+ }), Array.from(t.values());
144
+ }
145
+ function I(e) {
146
+ return _(e);
147
+ }
148
+ function R(e) {
149
+ return e.length ? [
150
+ {
151
+ value: "__origin__",
152
+ label: "",
153
+ options: e
154
+ }
155
+ ] : [];
156
+ }
157
+ function k(e) {
158
+ const t = /* @__PURE__ */ new Map();
159
+ return e.forEach((r) => {
160
+ const n = H(r.label), l = t.get(n) || { value: n, label: n.toUpperCase(), options: [] };
161
+ l.options.push(r), t.set(n, l);
162
+ }), Array.from(t.values()).sort((r, n) => String(r.value).localeCompare(String(n.value)));
163
+ }
164
+ function H(e) {
165
+ const t = String(e || "").trim(), r = t.charAt(0).toLowerCase();
166
+ if (/^[a-z]$/.test(r)) return r;
167
+ const l = String(Z(t, { pattern: "initial" })).replace(/\s+/g, "").charAt(0).toLowerCase();
168
+ return /^[a-z]$/.test(l) ? l : "#";
169
+ }
170
+ return {
171
+ loading: p,
172
+ fetchApi: L,
173
+ treeOptions: N,
174
+ navTreeOptions: z,
175
+ navNodes: B,
176
+ leafNodes: G,
177
+ filterNodes: E,
178
+ buildOptionGroups: q,
179
+ isFirstLoaded: S
180
+ };
181
+ }
182
+ export {
183
+ oe as usePanelSelectData
184
+ };
@@ -0,0 +1,91 @@
1
+ import { computed as s, unref as n } from "vue";
2
+ function O(f) {
3
+ const { multiple: u, modelValue: d, selectedValues: o, leafNodes: c, allValue: r } = f, h = s(() => {
4
+ const l = new Set(n(o)), t = n(c).filter((e) => l.has(e.value));
5
+ if (l.has(n(r))) {
6
+ const e = n(r);
7
+ return [
8
+ {
9
+ label: "全部",
10
+ value: e,
11
+ level: 0,
12
+ path: [],
13
+ raw: { label: "全部", value: e }
14
+ },
15
+ ...t
16
+ ];
17
+ }
18
+ return t;
19
+ }), v = s(() => {
20
+ const l = n(c).filter((t) => !t.disabled).map((t) => t.value);
21
+ return l.length > 0 && l.every((t) => n(o).includes(t));
22
+ }), p = s(() => {
23
+ const l = n(c).filter((e) => !e.disabled).map((e) => e.value), t = l.filter((e) => n(o).includes(e)).length;
24
+ return t > 0 && t < l.length;
25
+ });
26
+ function m(l) {
27
+ const t = l.options.filter((e) => !e.disabled).map((e) => e.value);
28
+ return t.length > 0 && t.every((e) => n(o).includes(e));
29
+ }
30
+ function S(l) {
31
+ const t = l.options.filter((a) => !a.disabled).map((a) => a.value), e = t.filter((a) => n(o).includes(a)).length;
32
+ return t.length > 0 && e > 0 && e < t.length;
33
+ }
34
+ function g(l, t) {
35
+ const e = l.options.filter((i) => !i.disabled).map((i) => i.value);
36
+ if (!e.length) return;
37
+ if (!n(u)) {
38
+ d.value = t ? e[0] : void 0;
39
+ return;
40
+ }
41
+ const a = new Set(n(o));
42
+ a.delete(n(r)), e.forEach((i) => t ? a.add(i) : a.delete(i)), o.value = Array.from(a);
43
+ }
44
+ function k(l) {
45
+ if (!n(u)) {
46
+ d.value = l ? n(r) : void 0;
47
+ return;
48
+ }
49
+ o.value = l ? [n(r)] : [];
50
+ }
51
+ function C(l, t) {
52
+ if (!n(u)) {
53
+ d.value = t ? l : void 0;
54
+ return;
55
+ }
56
+ const e = new Set(n(o));
57
+ e.delete(n(r)), t ? e.add(l) : e.delete(l), o.value = Array.from(e);
58
+ }
59
+ function b(l, t) {
60
+ if (!l.length) return;
61
+ if (!n(u)) {
62
+ d.value = t ? l.at(-1) : void 0;
63
+ return;
64
+ }
65
+ const e = new Set(n(o));
66
+ e.delete(n(r)), l.forEach((a) => t ? e.add(a) : e.delete(a)), o.value = Array.from(e);
67
+ }
68
+ function A(l) {
69
+ const t = n(c).filter((a) => !a.disabled).map((a) => a.value), e = new Set(n(o));
70
+ e.delete(n(r)), t.forEach((a) => l ? e.add(a) : e.delete(a)), o.value = Array.from(e);
71
+ }
72
+ function w(l) {
73
+ o.value = n(o).filter((t) => t !== l);
74
+ }
75
+ return {
76
+ selectedOptions: h,
77
+ isAllChecked: v,
78
+ isIndeterminate: p,
79
+ isGroupChecked: m,
80
+ isGroupIndeterminate: S,
81
+ handleGroupCheck: g,
82
+ handleAllOptionCheck: k,
83
+ handleOptionCheck: C,
84
+ handleOptionsCheck: b,
85
+ handleCheckAll: A,
86
+ removeSelected: w
87
+ };
88
+ }
89
+ export {
90
+ O as usePanelSelectSelection
91
+ };