@dazhicheng/ui 1.5.199 → 1.5.202

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 (257) 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/RiRefreshLine.svg.js +4 -0
  11. package/dist/assets/svg/action_more.svg.js +4 -0
  12. package/dist/assets/svg/add.svg.js +4 -0
  13. package/dist/assets/svg/addCircleLine.svg.js +4 -0
  14. package/dist/assets/svg/arrowDown.svg.js +4 -0
  15. package/dist/assets/svg/arrowLineDown.svg.js +5 -0
  16. package/dist/assets/svg/arrowSUp.svg.js +4 -0
  17. package/dist/assets/svg/arrowUp.svg.js +4 -0
  18. package/dist/assets/svg/close.svg.js +4 -0
  19. package/dist/assets/svg/columnSet.svg.js +4 -0
  20. package/dist/assets/svg/determinateCircleLine.svg.js +5 -0
  21. package/dist/assets/svg/drag.svg.js +5 -0
  22. package/dist/assets/svg/exportSvg.svg.js +4 -0
  23. package/dist/assets/svg/fileSvg.svg.js +4 -0
  24. package/dist/assets/svg/help.svg.js +4 -0
  25. package/dist/assets/svg/item_error.svg.js +4 -0
  26. package/dist/assets/svg/paixu-jiangxu.svg.js +4 -0
  27. package/dist/assets/svg/paixu-moren.svg.js +4 -0
  28. package/dist/assets/svg/paixu-shengxu.svg.js +4 -0
  29. package/dist/assets/svg/quanping.svg.js +4 -0
  30. package/dist/assets/svg/suoxiao.svg.js +4 -0
  31. package/dist/components/tt-api-component/index.js +7 -0
  32. package/dist/components/tt-api-component/index.vue.js +7 -0
  33. package/dist/components/tt-api-component/index.vue2.js +199 -0
  34. package/dist/components/tt-area/TtArea.vue.js +7 -0
  35. package/dist/components/tt-area/TtArea.vue3.js +36 -0
  36. package/dist/components/tt-button/components/AddButton.vue.js +24 -0
  37. package/dist/components/tt-button/components/AddButton.vue2.js +4 -0
  38. package/dist/components/tt-button/index.js +9 -0
  39. package/dist/components/tt-button/index.vue.js +7 -0
  40. package/dist/components/tt-button/index.vue2.js +68 -0
  41. package/dist/components/tt-checkbox/index.js +7 -0
  42. package/dist/components/tt-checkbox/index.vue.js +77 -0
  43. package/dist/components/tt-checkbox/index.vue2.js +4 -0
  44. package/dist/components/tt-drawer/index.js +14 -0
  45. package/dist/components/tt-drawer/src/RenderDrawer.vue.js +157 -0
  46. package/dist/components/tt-drawer/src/RenderDrawer.vue3.js +5 -0
  47. package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +56 -0
  48. package/dist/components/tt-drawer/src/components/DrawerFooter.vue3.js +5 -0
  49. package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +7 -0
  50. package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +21 -0
  51. package/dist/components/tt-drawer/src/hooks/useDrawerRender.js +124 -0
  52. package/dist/components/tt-drawer/src/hooks/useResizable.js +98 -0
  53. package/dist/components/tt-drawer/src/index.js +17 -0
  54. package/dist/components/tt-drawer/src/props.js +72 -0
  55. package/dist/components/tt-drawer/src/utils/drawer-api.js +191 -0
  56. package/dist/components/tt-empty/index.js +34 -0
  57. package/dist/components/tt-form/index.js +59 -0
  58. package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +38 -0
  59. package/dist/components/tt-form/src/components/ExpandableArrow.vue3.js +5 -0
  60. package/dist/components/tt-form/src/components/FormActions.vue2.js +177 -0
  61. package/dist/components/tt-form/src/components/FormActions.vue3.js +5 -0
  62. package/dist/components/tt-form/src/components/FormElInput.vue.js +80 -0
  63. package/dist/components/tt-form/src/components/FormElInput.vue2.js +4 -0
  64. package/dist/components/tt-form/src/components/Slot.js +28 -0
  65. package/dist/components/tt-form/src/config.js +57 -0
  66. package/dist/components/tt-form/src/form/FormControl.vue.js +16 -0
  67. package/dist/components/tt-form/src/form/FormControl.vue2.js +4 -0
  68. package/dist/components/tt-form/src/form/FormDescription.vue.js +21 -0
  69. package/dist/components/tt-form/src/form/FormDescription.vue2.js +4 -0
  70. package/dist/components/tt-form/src/form/FormItem.vue.js +20 -0
  71. package/dist/components/tt-form/src/form/FormItem.vue2.js +4 -0
  72. package/dist/components/tt-form/src/form/FormLabel.vue.js +19 -0
  73. package/dist/components/tt-form/src/form/FormLabel.vue2.js +4 -0
  74. package/dist/components/tt-form/src/form/FormMessage.vue.js +18 -0
  75. package/dist/components/tt-form/src/form/FormMessage.vue2.js +4 -0
  76. package/dist/components/tt-form/src/form/FormMessageToolTip.vue.js +30 -0
  77. package/dist/components/tt-form/src/form/FormMessageToolTip.vue2.js +4 -0
  78. package/dist/components/tt-form/src/form/RenderContent.vue.js +31 -0
  79. package/dist/components/tt-form/src/form/RenderContent.vue2.js +4 -0
  80. package/dist/components/tt-form/src/form/injectionKeys.js +4 -0
  81. package/dist/components/tt-form/src/form/useFormField.js +24 -0
  82. package/dist/components/tt-form/src/form-render/FormField.vue.js +4 -0
  83. package/dist/components/tt-form/src/form-render/FormField.vue2.js +345 -0
  84. package/dist/components/tt-form/src/form-render/FormFieldContact.js +54 -0
  85. package/dist/components/tt-form/src/form-render/FormLabel.vue.js +4 -0
  86. package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +101 -0
  87. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +195 -0
  88. package/dist/components/tt-form/src/form-render/array-register/props.js +47 -0
  89. package/dist/components/tt-form/src/form-render/array-register/utils.js +12 -0
  90. package/dist/components/tt-form/src/form-render/context.js +15 -0
  91. package/dist/components/tt-form/src/form-render/dependencies.js +51 -0
  92. package/dist/components/tt-form/src/form-render/expandable.js +46 -0
  93. package/dist/components/tt-form/src/form-render/form.vue2.js +196 -0
  94. package/dist/components/tt-form/src/form-render/form.vue3.js +5 -0
  95. package/dist/components/tt-form/src/form-render/helper.js +22 -0
  96. package/dist/components/tt-form/src/form-render/rootWrapperClass.js +10 -0
  97. package/dist/components/tt-form/src/formApi.js +790 -0
  98. package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +223 -0
  99. package/dist/components/tt-form/src/group-form/GroupForm.vue3.js +5 -0
  100. package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +277 -0
  101. package/dist/components/tt-form/src/group-form/GroupSection.vue3.js +5 -0
  102. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +153 -0
  103. package/dist/components/tt-form/src/group-form/LazyFormField.vue3.js +5 -0
  104. package/dist/components/tt-form/src/group-form/groupFormApi.js +700 -0
  105. package/dist/components/tt-form/src/group-form/lazyContext.js +38 -0
  106. package/dist/components/tt-form/src/group-form/useGroupForm.js +83 -0
  107. package/dist/components/tt-form/src/group-form/utils.js +106 -0
  108. package/dist/components/tt-form/src/hooks/useArrayRegistry.js +22 -0
  109. package/dist/components/tt-form/src/hooks/useFieldArray.js +137 -0
  110. package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +33 -0
  111. package/dist/components/tt-form/src/hooks/useSelectCollapse.js +81 -0
  112. package/dist/components/tt-form/src/index.vue2.js +147 -0
  113. package/dist/components/tt-form/src/index.vue3.js +5 -0
  114. package/dist/components/tt-form/src/shared/createContext.js +14 -0
  115. package/dist/components/tt-form/src/shared/global-state.js +22 -0
  116. package/dist/components/tt-form/src/shared/zod-defaults.js +47 -0
  117. package/dist/components/tt-form/src/types/forms.js +6 -0
  118. package/dist/components/tt-form/src/useForm.js +28 -0
  119. package/dist/components/tt-form/src/useFormContext.js +320 -0
  120. package/dist/components/tt-form/src/utils/array-path.js +18 -0
  121. package/dist/components/tt-form-item-error-tooltip/index.js +9 -0
  122. package/dist/components/tt-form-item-error-tooltip/index.vue.js +183 -0
  123. package/dist/components/tt-form-item-error-tooltip/index.vue3.js +5 -0
  124. package/dist/components/tt-icon/components/AddIcon.vue.js +28 -0
  125. package/dist/components/tt-icon/components/AddIcon.vue2.js +4 -0
  126. package/dist/components/tt-icon/components/SubIcon.vue.js +28 -0
  127. package/dist/components/tt-icon/components/SubIcon.vue2.js +4 -0
  128. package/dist/components/tt-icon/index.js +11 -0
  129. package/dist/components/tt-icon/index.vue.js +8 -0
  130. package/dist/components/tt-icon/index.vue2.js +115 -0
  131. package/dist/components/tt-image/index.js +9 -0
  132. package/dist/components/tt-image/src/components/ImageViewer.js +41 -0
  133. package/dist/components/tt-image/tt-image.js +55 -0
  134. package/dist/components/tt-loading/index.js +8 -0
  135. package/dist/components/tt-loading/src/directive.js +51 -0
  136. package/dist/components/tt-loading/src/loading.vue.js +7 -0
  137. package/dist/components/tt-loading/src/loading.vue2.js +75 -0
  138. package/dist/components/tt-loading/src/service.js +79 -0
  139. package/dist/components/tt-log/index.js +7 -0
  140. package/dist/components/tt-log/index.vue.js +31 -0
  141. package/dist/components/tt-log/index.vue2.js +4 -0
  142. package/dist/components/tt-modal/index.js +14 -0
  143. package/dist/components/tt-modal/src/RenderModal.vue.js +310 -0
  144. package/dist/components/tt-modal/src/RenderModal.vue3.js +5 -0
  145. package/dist/components/tt-modal/src/components/ModalFooter.vue.js +7 -0
  146. package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +74 -0
  147. package/dist/components/tt-modal/src/components/ModalHeader.vue.js +7 -0
  148. package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +22 -0
  149. package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +48 -0
  150. package/dist/components/tt-modal/src/components/ModalWrapper.vue2.js +4 -0
  151. package/dist/components/tt-modal/src/hooks/useModalRender.js +131 -0
  152. package/dist/components/tt-modal/src/index.js +17 -0
  153. package/dist/components/tt-modal/src/props.js +75 -0
  154. package/dist/components/tt-modal/src/utils/modal-api.js +200 -0
  155. package/dist/components/tt-modal/src/utils/modal-stack.js +28 -0
  156. package/dist/components/tt-modal-form/hooks/useModalFormSlot.js +22 -0
  157. package/dist/components/tt-modal-form/index.vue.js +201 -0
  158. package/dist/components/tt-modal-form/index.vue2.js +4 -0
  159. package/dist/components/tt-modal-form/useModalForm.js +30 -0
  160. package/dist/components/tt-nav-anchor/index.js +8 -0
  161. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +234 -0
  162. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue3.js +5 -0
  163. package/dist/components/tt-nav-anchor/src/constants.js +4 -0
  164. package/dist/components/tt-panel-select/index.js +7 -0
  165. package/dist/components/tt-panel-select/src/common.js +4 -0
  166. package/dist/components/tt-panel-select/src/components/PanelLeft.vue.js +56 -0
  167. package/dist/components/tt-panel-select/src/components/PanelLeft.vue2.js +4 -0
  168. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +277 -0
  169. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue2.js +4 -0
  170. package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +108 -0
  171. package/dist/components/tt-panel-select/src/components/PanelRight.vue2.js +4 -0
  172. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +184 -0
  173. package/dist/components/tt-panel-select/src/hooks/usePanelSelection.js +91 -0
  174. package/dist/components/tt-panel-select/src/index.vue.js +386 -0
  175. package/dist/components/tt-panel-select/src/index.vue2.js +4 -0
  176. package/dist/components/tt-select/index.js +8 -0
  177. package/dist/components/tt-select/src/Select.vue.js +315 -0
  178. package/dist/components/tt-select/src/Select.vue3.js +5 -0
  179. package/dist/components/tt-select/src/components/SelectTable.vue.js +86 -0
  180. package/dist/components/tt-select/src/components/SelectTable.vue3.js +5 -0
  181. package/dist/components/tt-select/src/components/Table.vue.js +307 -0
  182. package/dist/components/tt-select/src/components/Table.vue3.js +5 -0
  183. package/dist/components/tt-select/src/const.js +19 -0
  184. package/dist/components/tt-select/src/hooks/useDataSource.js +196 -0
  185. package/dist/components/tt-select/src/hooks/useGrid.js +97 -0
  186. package/dist/components/tt-select/src/hooks/useKeyboard.js +63 -0
  187. package/dist/components/tt-select/src/hooks/usePagination.js +45 -0
  188. package/dist/components/tt-select/src/hooks/useSelect.js +100 -0
  189. package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
  190. package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +345 -0
  191. package/dist/components/tt-select/src/props.js +201 -0
  192. package/dist/components/tt-select/src/utils/index.js +16 -0
  193. package/dist/components/tt-table/index.js +63 -0
  194. package/dist/components/tt-table/src/Table.vue.js +623 -0
  195. package/dist/components/tt-table/src/Table.vue3.js +5 -0
  196. package/dist/components/tt-table/src/TableForm.vue.js +356 -0
  197. package/dist/components/tt-table/src/TableForm.vue2.js +4 -0
  198. package/dist/components/tt-table/src/componentMap.js +4 -0
  199. package/dist/components/tt-table/src/components/RowContext.js +24 -0
  200. package/dist/components/tt-table/src/components/TableAction.vue.js +222 -0
  201. package/dist/components/tt-table/src/components/TableAction.vue2.js +4 -0
  202. package/dist/components/tt-table/src/components/TableButtons.js +117 -0
  203. package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +234 -0
  204. package/dist/components/tt-table/src/components/TableColumnModal.vue3.js +5 -0
  205. package/dist/components/tt-table/src/components/TableToobalTools.vue.js +87 -0
  206. package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +4 -0
  207. package/dist/components/tt-table/src/emits.js +15 -0
  208. package/dist/components/tt-table/src/hooks/useCellArea.js +15 -0
  209. package/dist/components/tt-table/src/hooks/useColumns.js +275 -0
  210. package/dist/components/tt-table/src/hooks/useCustomColumns.js +53 -0
  211. package/dist/components/tt-table/src/hooks/useDataSource.js +224 -0
  212. package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +64 -0
  213. package/dist/components/tt-table/src/hooks/usePagination.js +44 -0
  214. package/dist/components/tt-table/src/hooks/useRowSelection.js +84 -0
  215. package/dist/components/tt-table/src/hooks/useTableContext.js +20 -0
  216. package/dist/components/tt-table/src/hooks/useTableEvent.js +197 -0
  217. package/dist/components/tt-table/src/hooks/useTableForm.js +60 -0
  218. package/dist/components/tt-table/src/hooks/useTableRender.js +33 -0
  219. package/dist/components/tt-table/src/hooks/useTableSlot.js +17 -0
  220. package/dist/components/tt-table/src/props.js +482 -0
  221. package/dist/components/tt-table/src/toolProps.js +30 -0
  222. package/dist/components/tt-table/src/utils/context.js +17 -0
  223. package/dist/components/tt-table/src/utils/table-api.js +386 -0
  224. package/dist/components/tt-table/src/utils/table-form-api.js +122 -0
  225. package/dist/components/tt-text/index.js +7 -0
  226. package/dist/components/tt-text/index.vue.js +7 -0
  227. package/dist/components/tt-text/index.vue2.js +73 -0
  228. package/dist/components/tt-upload/index.js +9 -0
  229. package/dist/components/tt-upload/src/TtUpload.vue.js +306 -0
  230. package/dist/components/tt-upload/src/TtUpload.vue2.js +4 -0
  231. package/dist/components/tt-upload/src/typing.js +107 -0
  232. package/dist/directives/auto-tip/index.js +62 -0
  233. package/dist/directives/dialog-resize/index.js +49 -0
  234. package/dist/directives/dialog-resize/use-css-variable.js +44 -0
  235. package/dist/directives/dialog-resize/use-draggable.js +35 -0
  236. package/dist/directives/dialog-resize/use-fullscreen.js +38 -0
  237. package/dist/directives/dialog-resize/use-parse-translate.js +9 -0
  238. package/dist/directives/dialog-resize/use-resizer.js +37 -0
  239. package/dist/directives/disabled-tip/index.js +78 -0
  240. package/dist/directives/index.js +8 -0
  241. package/dist/hooks/useDataPermissionOptions.js +142 -0
  242. package/dist/hooks/useFormSchemasLink.js +261 -0
  243. package/dist/hooks/useFormat.js +44 -0
  244. package/dist/hooks/useLoading.js +22 -0
  245. package/dist/hooks/useScreenshotOss.js +69 -0
  246. package/dist/hooks/useSetup.js +59 -0
  247. package/dist/hooks/useTable.js +13 -0
  248. package/dist/hooks/useTemplateSlot.js +13 -0
  249. package/dist/index.js +142 -60274
  250. package/dist/plugins/default/renderCellContent.js +58 -0
  251. package/dist/plugins/vxeTable/switchStatus.js +91 -0
  252. package/dist/plugins.js +4 -146
  253. package/dist/style.css +1 -1
  254. package/dist/utils/xhr.js +8 -0
  255. package/package.json +5 -3
  256. package/dist/index-NG5FNCLD.js +0 -3430
  257. package/dist/index.modern-4Cf3dcJP.js +0 -3069
@@ -0,0 +1,75 @@
1
+ import { propTypes as e } from "@dazhicheng/hooks";
2
+ import { GlobalConfig as t } from "../../../hooks/useSetup.js";
3
+ const o = {
4
+ /** 测试标识 */
5
+ testId: e.string,
6
+ /** 是否显示 */
7
+ visible: { type: Boolean },
8
+ /** 标题 */
9
+ title: e.string.def(""),
10
+ /** 取消按钮文本 */
11
+ cancelText: { type: String, default: "取消" },
12
+ /** 确定按钮文本 */
13
+ okText: { type: String, default: "确定" },
14
+ /** 最小高度 */
15
+ minHeight: e.number.def(192),
16
+ /** 高度 */
17
+ height: e.number,
18
+ /** 是否滚动到顶 */
19
+ scrollTop: { type: Boolean, default: !0 },
20
+ /** 取消前的函数 */
21
+ closeFunc: Function,
22
+ /** 是否允许拖拽 */
23
+ draggable: { type: Boolean, default: !0 },
24
+ /** 是否允许放大 */
25
+ fullscreen: { type: Boolean, default: !1 },
26
+ /** 是否允许自定义大小 */
27
+ resizer: { type: Boolean, default: !1 }
28
+ }, n = Object.assign({}, o, {
29
+ /** 弹窗的loading */
30
+ loading: { type: Boolean, default: !1 },
31
+ /** 弹窗的loading提示 */
32
+ loadingTip: { type: String },
33
+ /** 是否显示footer */
34
+ showFooter: { type: Boolean, default: !0 },
35
+ /** 是否显示取消按钮 */
36
+ showCancelBtn: { type: Boolean, default: !0 },
37
+ /** 是否显示确定按钮 */
38
+ showOkBtn: { type: Boolean, default: !0 },
39
+ /** 是否显示确定按钮loading */
40
+ confirmLoading: { type: Boolean },
41
+ /** 是否显示取消按钮loading */
42
+ cancelLoading: { type: Boolean },
43
+ /** 宽度 */
44
+ width: [String, Number],
45
+ /** 弹窗距离顶部的距离需要带px单位 */
46
+ top: { type: String },
47
+ /** 弹大小 */
48
+ size: {
49
+ type: String,
50
+ default: "small"
51
+ },
52
+ /** 确定按钮的样式 */
53
+ okButtonProps: {
54
+ type: Object,
55
+ default: {
56
+ type: "primary"
57
+ }
58
+ },
59
+ /** 取消按钮的样式 */
60
+ cancelButtonProps: {
61
+ type: Object,
62
+ default: {}
63
+ },
64
+ /** 是否贴住底部 */
65
+ isBottom: { type: Boolean, default: !1 },
66
+ /** 是否显示modal */
67
+ modal: {
68
+ type: Boolean,
69
+ default: () => t.showMask
70
+ }
71
+ });
72
+ export {
73
+ n as basicProps,
74
+ o as modalProps
75
+ };
@@ -0,0 +1,200 @@
1
+ var v = Object.defineProperty;
2
+ var b = (o, t, e) => t in o ? v(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
+ var i = (o, t, e) => b(o, typeof t != "symbol" ? t + "" : t, e);
4
+ import { mergeWithArrayOverride as u, bindMethods as S, isElement as w, isFunction as n } from "@dazhicheng/utils";
5
+ import { Store as C } from "@tanstack/vue-store";
6
+ import { useDebounceFn as k } from "@vueuse/core";
7
+ import { computed as y } from "vue";
8
+ import { GlobalConfig as D } from "../../../../hooks/useSetup.js";
9
+ class x {
10
+ /** 构造函数,初始化弹窗的API接口和状态 */
11
+ constructor(t = {}) {
12
+ /** 共享数据对象,用于在组件间传递数据 */
13
+ i(this, "sharedData", {
14
+ payload: {}
15
+ });
16
+ /** 状态存储对象,使用Store管理弹窗的各种状态 */
17
+ i(this, "store");
18
+ /** 弹窗的API接口,用于处理外部事件 */
19
+ i(this, "api");
20
+ /** 弹窗的当前状态,使用Partial<ModalRenderState>类型 */
21
+ i(this, "state");
22
+ /** 弹窗的实例方法,用于处理弹窗的各种操作 */
23
+ i(this, "methods");
24
+ /**
25
+ * 确认操作
26
+ */
27
+ i(this, "onOk", k(async () => {
28
+ var t, e;
29
+ try {
30
+ this.changeOkLoading(!0), this.api.onOk && await ((e = (t = this.api).onOk) == null ? void 0 : e.call(t));
31
+ } catch (s) {
32
+ throw new Error(s);
33
+ } finally {
34
+ this.changeOkLoading(!1);
35
+ }
36
+ }, 100));
37
+ /**
38
+ * 获取弹窗的可见状态
39
+ * @returns 弹窗的可见状态
40
+ */
41
+ i(this, "getVisible", y(() => this.state.visible));
42
+ const {
43
+ connectedComponent: e,
44
+ onVisibleChange: s,
45
+ onClose: a,
46
+ onClosed: r,
47
+ onOk: f,
48
+ onReceiveSharedData: m,
49
+ ...g
50
+ } = t, p = {
51
+ visible: !1,
52
+ title: "",
53
+ cancelText: "取消",
54
+ okText: "确定",
55
+ minHeight: 192,
56
+ height: void 0,
57
+ scrollTop: !0,
58
+ closeFunc: void 0,
59
+ draggable: !0,
60
+ fullscreen: !1,
61
+ resizer: !1,
62
+ loading: !1,
63
+ loadingTip: "",
64
+ showFooter: !0,
65
+ showCancelBtn: !0,
66
+ showOkBtn: !0,
67
+ confirmLoading: !1,
68
+ cancelLoading: !1,
69
+ width: void 0,
70
+ top: void 0,
71
+ size: "small",
72
+ okButtonProps: {
73
+ type: "primary"
74
+ },
75
+ cancelButtonProps: {},
76
+ isBottom: !1,
77
+ resizeChange: void 0,
78
+ modal: D.showMask
79
+ };
80
+ this.store = new C(u(g, p), {
81
+ onUpdate: () => {
82
+ var h, c, d;
83
+ const l = this.store.state;
84
+ this.state = l, l.visible !== ((h = this.state) == null ? void 0 : h.visible) && ((d = (c = this.api).onVisibleChange) == null || d.call(c, !!l.visible));
85
+ }
86
+ }), this.state = this.store.state, this.api = { onVisibleChange: s, onClose: a, onClosed: r, onOk: f, onReceiveSharedData: m }, S(this);
87
+ }
88
+ /**
89
+ * 挂载弹窗实例和API接口
90
+ * @param api - 外部传入的API接口
91
+ * @param methods - 外部传入的实例方法
92
+ */
93
+ mount(t, e) {
94
+ this.api = u(t, this.api), this.methods = e;
95
+ }
96
+ /**
97
+ * 关闭弹窗
98
+ */
99
+ async close() {
100
+ var a, r;
101
+ const t = document.querySelector('.viewer-container[aria-modal="true"]');
102
+ if (w(t))
103
+ return;
104
+ const { closeFunc: e } = this.state;
105
+ let s = !0;
106
+ e && n(e) && (s = await e()), this.setState({ visible: !s }), (r = (a = this.api).onClosed) == null || r.call(a);
107
+ }
108
+ /**
109
+ * 取消操作
110
+ */
111
+ onClosed() {
112
+ var t, e;
113
+ this.api.onClose ? (e = (t = this.api).onClose) == null || e.call(t) : this.close();
114
+ }
115
+ /**
116
+ * 获取共享数据
117
+ * @returns 共享数据对象
118
+ */
119
+ getData() {
120
+ var t;
121
+ return ((t = this.sharedData) == null ? void 0 : t.payload) ?? {};
122
+ }
123
+ /**
124
+ * 设置弹窗的状态
125
+ * @param stateOrFn - 状态对象或状态函数
126
+ * @returns 当前实例
127
+ */
128
+ setState(t) {
129
+ return n(t) ? this.store.setState(t) : this.store.setState((e) => ({ ...e, ...t })), this;
130
+ }
131
+ /**
132
+ * 打开弹窗
133
+ * @param visible - 是否可见
134
+ * @param data - 共享数据
135
+ */
136
+ openModal(t = !0, e) {
137
+ this.setState({ visible: t }), this.setData(e);
138
+ }
139
+ /**
140
+ * 设置弹窗的属性
141
+ * @param props - 属性对象
142
+ * @returns 当前实例
143
+ */
144
+ async setModalProps(t) {
145
+ if (this.setState(t), Reflect.has(t, "visible"))
146
+ if (!t.visible && this.state.closeFunc && n(this.state.closeFunc)) {
147
+ let e = !0;
148
+ e = await this.state.closeFunc(), this.setState({ visible: !e });
149
+ } else
150
+ this.setState({ visible: !t.visible });
151
+ }
152
+ /**
153
+ * 设置弹窗的加载状态
154
+ * @param loading - 是否加载中
155
+ * @returns 当前实例
156
+ */
157
+ changeLoading(t = !0) {
158
+ return this.setState({ loading: t });
159
+ }
160
+ /**
161
+ * 设置确认按钮的加载状态
162
+ * @param loading - 是否加载中
163
+ * @returns 当前实例
164
+ */
165
+ changeOkLoading(t = !0) {
166
+ return this.setState({ confirmLoading: t });
167
+ }
168
+ /**
169
+ * 设置共享数据
170
+ * @param payload - 共享数据
171
+ * @returns 当前实例
172
+ */
173
+ setData(t) {
174
+ var e, s;
175
+ return this.sharedData.payload = t, (s = (e = this.api).onReceiveSharedData) == null || s.call(e, t), this;
176
+ }
177
+ /**
178
+ * 关闭弹窗
179
+ */
180
+ closeModal() {
181
+ this.setState({ visible: !1 });
182
+ }
183
+ /**
184
+ * 重置弹窗高度
185
+ */
186
+ redoModalHeight() {
187
+ var t, e;
188
+ (e = (t = this.methods) == null ? void 0 : t.redoModalHeight) == null || e.call(t);
189
+ }
190
+ /**
191
+ * 滚动到底部
192
+ */
193
+ scrollToBottom() {
194
+ var t, e;
195
+ (e = (t = this.methods) == null ? void 0 : t.scrollToBottom) == null || e.call(t);
196
+ }
197
+ }
198
+ export {
199
+ x as ModalApi
200
+ };
@@ -0,0 +1,28 @@
1
+ const n = [];
2
+ let r = !1;
3
+ function u(e) {
4
+ if (!e || !(e instanceof HTMLElement)) return !1;
5
+ const t = e.tagName;
6
+ return !!(t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable || e.closest(
7
+ ".el-select, .el-select-v2, .el-cascader, .el-date-editor, .el-time-picker, .el-color-picker, .el-input, .el-textarea, .el-autocomplete, .el-input-number, .el-mention"
8
+ ));
9
+ }
10
+ function i(e) {
11
+ if (e.key !== "Escape" && e.key !== "Esc" || n.length === 0) return;
12
+ const t = e.target ?? document.activeElement;
13
+ if (u(t))
14
+ return;
15
+ const o = n[n.length - 1];
16
+ o && (e.stopPropagation(), o.close());
17
+ }
18
+ function l(e) {
19
+ c(e.uid), n.push(e), !r && typeof document < "u" && (document.addEventListener("keydown", i), r = !0);
20
+ }
21
+ function c(e) {
22
+ const t = n.findIndex((o) => o.uid === e);
23
+ t !== -1 && n.splice(t, 1), n.length === 0 && r && typeof document < "u" && (document.removeEventListener("keydown", i), r = !1);
24
+ }
25
+ export {
26
+ l as pushModal,
27
+ c as removeModal
28
+ };
@@ -0,0 +1,22 @@
1
+ import { computed as l } from "vue";
2
+ function u(o) {
3
+ const n = l(() => Object.keys(o).map((r) => r.startsWith("modal-") ? r : null).filter(Boolean));
4
+ function e(t) {
5
+ var r;
6
+ return t ? ((r = t == null ? void 0 : t.replace) == null ? void 0 : r.call(t, /modal-/, "")) ?? "" : "";
7
+ }
8
+ const a = l(() => Object.keys(o).map((r) => r.startsWith("form-") ? r : null).filter(Boolean));
9
+ function s(t) {
10
+ var r;
11
+ return t ? ((r = t == null ? void 0 : t.replace) == null ? void 0 : r.call(t, /form-/, "")) ?? "" : "";
12
+ }
13
+ return {
14
+ getFormSlotKeys: a,
15
+ getModalSlotKeys: n,
16
+ replaceModalSlotKey: e,
17
+ replaceFormSlotKey: s
18
+ };
19
+ }
20
+ export {
21
+ u as useModalFormSlot
22
+ };
@@ -0,0 +1,201 @@
1
+ import { defineComponent as G, useSlots as H, ref as K, computed as F, toValue as J, nextTick as y, watch as Q, createBlock as C, openBlock as M, unref as d, createSlots as B, withCtx as A, renderSlot as h, createVNode as W, renderList as P, normalizeProps as S, guardReactiveProps as b, createCommentVNode as X } from "vue";
2
+ import { isFunction as c } from "@dazhicheng/utils";
3
+ import { ElCheckbox as Y, ElMessage as V } from "element-plus";
4
+ import "../tt-select/index.js";
5
+ import "../tt-panel-select/index.js";
6
+ import "../tt-upload/index.js";
7
+ import "../tt-api-component/index.js";
8
+ import "vee-validate";
9
+ import { useForm as Z } from "../tt-form/src/useForm.js";
10
+ import "zod";
11
+ import { get as ee } from "lodash-es";
12
+ import "dayjs";
13
+ import "dayjs/plugin/timezone";
14
+ import "@tanstack/vue-store";
15
+ import "es-toolkit/compat";
16
+ import "../tt-form/src/shared/zod-defaults.js";
17
+ import "../tt-nav-anchor/index.js";
18
+ import "@dazhicheng/hooks";
19
+ import "../tt-icon/index.js";
20
+ import "../tt-form/src/components/Slot.js";
21
+ import "../tt-form-item-error-tooltip/index.js";
22
+ import "@vueuse/core";
23
+ /* empty css */
24
+ import "../tt-form/src/form/RenderContent.vue.js";
25
+ import "../tt-form/src/form-render/FormFieldContact.js";
26
+ /* empty css */
27
+ /* empty css */
28
+ import "../tt-modal/index.js";
29
+ import { useModalFormSlot as oe } from "./hooks/useModalFormSlot.js";
30
+ import { useModalRender as te } from "../tt-modal/src/hooks/useModalRender.js";
31
+ const De = /* @__PURE__ */ G({
32
+ name: "TtModalForm",
33
+ __name: "index",
34
+ props: {
35
+ model: {},
36
+ addApi: {},
37
+ editApi: {},
38
+ infoApi: {},
39
+ infoApiBefore: {},
40
+ infoApiAfter: {},
41
+ saveApiBefore: {},
42
+ infoDataKey: {},
43
+ infoApiIdKey: { default: "id" },
44
+ infoApiParams: { default: () => ({}) },
45
+ apiParams: { default: () => ({}) },
46
+ formProps: { default: () => ({}) },
47
+ isContinuousChecked: { type: Boolean, default: !1 },
48
+ dataField: { default: "" },
49
+ modalProps: {},
50
+ getFormApi: {},
51
+ getModalApi: {},
52
+ checkedOptions: { default: () => ({}) }
53
+ },
54
+ emits: ["submit", "fetch", "getinfo"],
55
+ setup(I, { emit: O }) {
56
+ var k, w;
57
+ const o = I, m = O, D = H(), f = K(), s = K(!1), { getFormSlotKeys: L, getModalSlotKeys: E, replaceFormSlotKey: R, replaceModalSlotKey: _ } = oe(D), x = F(() => E.value.filter(Boolean)), T = F(() => L.value.filter(Boolean)), [$, l] = Z({
58
+ showDefaultActions: !1,
59
+ ...J(o.formProps)
60
+ }), [z, a] = te({
61
+ ...o.modalProps,
62
+ onReceiveSharedData: async (e) => {
63
+ if (!e) {
64
+ f.value = void 0;
65
+ return;
66
+ }
67
+ if (e.schemas && l.setState({ schema: e.schemas }), e != null && e.title && a.setModalProps({ title: e.title }), f.value = e[o.infoApiIdKey], e != null && e[o.infoApiIdKey]) {
68
+ const i = o.infoApi;
69
+ if (!c(i)) {
70
+ v(e);
71
+ return;
72
+ }
73
+ a.changeLoading(!0);
74
+ try {
75
+ const t = {
76
+ ...o.infoApiParams,
77
+ [o.infoApiIdKey]: e[o.infoApiIdKey]
78
+ }, n = c(o.infoApiBefore) ? await o.infoApiBefore(t) : t, r = await i(n), p = o.dataField ? ee(r, o.dataField) : r, u = c(o.infoApiAfter) ? await o.infoApiAfter(p) : p;
79
+ g(u), m("getinfo", u), await y(), await l.resetForm({ values: u });
80
+ } finally {
81
+ a.changeLoading(!1);
82
+ }
83
+ } else
84
+ v(e);
85
+ },
86
+ async onOk() {
87
+ await q();
88
+ }
89
+ });
90
+ function v(e) {
91
+ const i = e[o.infoDataKey || ""] || {};
92
+ g(i), y(() => {
93
+ l.resetForm({ values: i });
94
+ });
95
+ }
96
+ function g(e) {
97
+ const i = Object.keys(o.checkedOptions || {});
98
+ i.length && i.forEach((t) => {
99
+ var u;
100
+ const n = (u = o.checkedOptions) == null ? void 0 : u[t];
101
+ if (!Array.isArray(n) || n.length === 0)
102
+ return;
103
+ const [r, p] = n.length === 1 ? [n[0], n[0]] : n;
104
+ !r || !p || (e[t] = {
105
+ label: e[r],
106
+ value: e[p]
107
+ });
108
+ });
109
+ }
110
+ async function N() {
111
+ const e = await l.getValues(), { apiParams: i } = o;
112
+ let t = {
113
+ ...e,
114
+ ...i
115
+ };
116
+ return t = c(o.saveApiBefore) ? await o.saveApiBefore(t) : t, { reqParams: t, formValue: e };
117
+ }
118
+ async function j(e, i) {
119
+ const { editApi: t } = o;
120
+ !t || !c(t) || (e[o.infoApiIdKey] = f.value, await t(e, i.files), V.success("修改成功"), m("submit", {
121
+ ...e,
122
+ continuousChecked: s.value
123
+ }), a.closeModal());
124
+ }
125
+ async function U(e, i) {
126
+ const { addApi: t } = o;
127
+ !t || !c(t) || (await t(e, i.files), V.success("新增成功"), m("submit", {
128
+ ...e,
129
+ continuousChecked: s.value
130
+ }), (!s.value || !o.isContinuousChecked) && a.closeModal());
131
+ }
132
+ async function q() {
133
+ a.changeOkLoading(!0);
134
+ try {
135
+ const { valid: e } = await l.validate();
136
+ if (!e) return;
137
+ const { reqParams: i, formValue: t } = await N();
138
+ if (!i)
139
+ return;
140
+ const { addApi: n, editApi: r } = o;
141
+ if (!n && !r) {
142
+ m("submit", {
143
+ ...i,
144
+ [o.infoApiIdKey]: f.value,
145
+ continuousChecked: s.value
146
+ });
147
+ return;
148
+ }
149
+ f.value ? await j(i, t) : await U(i, t);
150
+ } finally {
151
+ a.changeOkLoading(!1);
152
+ }
153
+ }
154
+ return (k = o.getFormApi) == null || k.call(o, l), (w = o.getModalApi) == null || w.call(o, a), Q(
155
+ () => {
156
+ var e;
157
+ return (e = a.getVisible) == null ? void 0 : e.value;
158
+ },
159
+ async (e) => {
160
+ if (e) {
161
+ await y();
162
+ const i = await l.getValues();
163
+ m("fetch", i);
164
+ } else
165
+ s.value = !1;
166
+ }
167
+ ), (e, i) => (M(), C(d(z), null, B({
168
+ insertFooter: A(() => [
169
+ o.isContinuousChecked && !f.value ? (M(), C(d(Y), {
170
+ key: 0,
171
+ modelValue: s.value,
172
+ "onUpdate:modelValue": i[0] || (i[0] = (t) => s.value = t),
173
+ label: "连续添加",
174
+ size: "small"
175
+ }, null, 8, ["modelValue"])) : X("", !0)
176
+ ]),
177
+ default: A(() => [
178
+ h(e.$slots, "BasicMsgTop"),
179
+ W(d($), null, B({ _: 2 }, [
180
+ P(T.value, (t) => ({
181
+ name: d(R)(t),
182
+ fn: A((n) => [
183
+ h(e.$slots, t, S(b(n)))
184
+ ])
185
+ }))
186
+ ]), 1024)
187
+ ]),
188
+ _: 2
189
+ }, [
190
+ P(x.value, (t) => ({
191
+ name: d(_)(t),
192
+ fn: A((n) => [
193
+ h(e.$slots, t, S(b(n)))
194
+ ])
195
+ }))
196
+ ]), 1024));
197
+ }
198
+ });
199
+ export {
200
+ De as default
201
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,30 @@
1
+ import { ref as t, defineComponent as p, h as l } from "vue";
2
+ import d from "./index.vue.js";
3
+ function A(e) {
4
+ const r = t(), n = t();
5
+ function m(o) {
6
+ r.value = o;
7
+ }
8
+ function i(o) {
9
+ n.value = o;
10
+ }
11
+ return [p(
12
+ (o, { attrs: a, slots: f }) => () => l(
13
+ d,
14
+ {
15
+ ...e,
16
+ ...a,
17
+ getFormApi: m,
18
+ getModalApi: i
19
+ },
20
+ f
21
+ ),
22
+ {
23
+ name: "TtModalFormRender",
24
+ inheritAttrs: !1
25
+ }
26
+ ), { formApi: r, modalApi: n }];
27
+ }
28
+ export {
29
+ A as useModalForm
30
+ };
@@ -0,0 +1,8 @@
1
+ import { withInstall as t } from "@dazhicheng/utils";
2
+ import o from "./src/TtNavAnchor.vue.js";
3
+ /* empty css */
4
+ const i = t(o);
5
+ export {
6
+ i as TtNavAnchor,
7
+ i as default
8
+ };