@dazhicheng/ui 1.5.199 → 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 +3 -1
  241. package/dist/index-NG5FNCLD.js +0 -3430
  242. package/dist/index.modern-4Cf3dcJP.js +0 -3069
@@ -0,0 +1,310 @@
1
+ import { defineComponent as he, ref as x, useAttrs as ke, useSlots as ve, getCurrentInstance as Te, computed as u, unref as o, watch as R, reactive as Ce, provide as ye, nextTick as Be, onMounted as Pe, onUnmounted as $e, withDirectives as Ie, createElementBlock as Oe, openBlock as Me, createVNode as k, mergeProps as j, h as Se, createSlots as y, withCtx as c, normalizeClass as we, renderSlot as p, renderList as B, normalizeProps as P, guardReactiveProps as $, createElementVNode as Fe } from "vue";
2
+ import { TtIcon as Ve } from "@dazhicheng-ui/components/tt-icon";
3
+ import { useDesign as De, usePriorityValues as ze, getPriorityValues as Ae } from "@dazhicheng/hooks";
4
+ import Le from "@dazhicheng-ui/directives/dialog-resize";
5
+ import { generateTestId as I, toKebabCase as _e } from "@dazhicheng/utils";
6
+ import { useStore as xe } from "@tanstack/vue-store";
7
+ import { dialogProps as E, ElDialog as Re } from "element-plus";
8
+ import { omit as H, pick as O } from "lodash-es";
9
+ import je from "./components/ModalFooter.vue.js";
10
+ import Ee from "./components/ModalHeader.vue.js";
11
+ import He from "./components/ModalWrapper.vue.js";
12
+ import { basicProps as We } from "./props.js";
13
+ import { ModalApi as Ne } from "./utils/modal-api.js";
14
+ import { pushModal as qe, removeModal as W } from "./utils/modal-stack.js";
15
+ import Ge from "../../../assets/svg/close.svg.js";
16
+ const Ke = ["aria-tt-id", "data-testid"], Ue = ["data-testid"], uo = /* @__PURE__ */ he({
17
+ name: "TtModal",
18
+ __name: "RenderModal",
19
+ props: {
20
+ ...E,
21
+ ...We,
22
+ /** modalApi */
23
+ modalApi: {
24
+ type: Object,
25
+ default: void 0
26
+ }
27
+ },
28
+ emits: ["visible-change", "register", "update:visible"],
29
+ setup(N, { expose: q, emit: G }) {
30
+ var L;
31
+ const n = N, v = G, f = x(), { prefixCls: K } = De("modal"), d = ke(), U = ve(), t = Te(), M = x(!1);
32
+ let a = n.modalApi;
33
+ if (!a) {
34
+ const e = n.okButtonProps ? {
35
+ ...n.okButtonProps,
36
+ disabledTip: Array.isArray(n.okButtonProps.disabledTip) ? n.okButtonProps.disabledTip : n.okButtonProps.disabledTip ? [n.okButtonProps.disabledTip] : void 0
37
+ } : void 0, s = {
38
+ ...n,
39
+ okButtonProps: e
40
+ };
41
+ a = new Ne(s), a.useStore = (i) => {
42
+ const r = i ?? ((l) => l);
43
+ return xe(a.store, r);
44
+ };
45
+ }
46
+ const g = (L = a.useStore) == null ? void 0 : L.call(a), {
47
+ visible: T,
48
+ title: S,
49
+ width: w,
50
+ size: F,
51
+ fullscreen: J,
52
+ resizer: Q,
53
+ top: X,
54
+ isBottom: V,
55
+ draggable: Y,
56
+ showCancelBtn: Z,
57
+ okText: ee,
58
+ cancelText: oe,
59
+ okButtonProps: b,
60
+ cancelButtonProps: te,
61
+ confirmLoading: se,
62
+ cancelLoading: re,
63
+ showOkBtn: ae,
64
+ loading: D,
65
+ height: ie,
66
+ showFooter: z,
67
+ loadingTip: le,
68
+ ...ne
69
+ } = ze(n, g), de = u(() => {
70
+ const e = {
71
+ mini: "448px",
72
+ small: "592px",
73
+ medium: "876px"
74
+ };
75
+ return o(w) ? o(w) : e[o(F)] ? e[o(F)] : "500px";
76
+ }), ce = u(() => {
77
+ const e = Ae(ne), s = H(d, ["onVisibleChange", "onClose", "onClosed", "onOk", "onReceiveSharedData"]);
78
+ return {
79
+ appendToBody: !0,
80
+ ...O(e, Object.keys(E)),
81
+ ...s,
82
+ modelValue: o(T),
83
+ width: o(de),
84
+ destroyOnClose: !0,
85
+ closeOnClickModal: !1,
86
+ // 禁用 element-plus 原生 ESC 关闭,改由 modal-stack 统一管理:
87
+ // 1. 多弹窗时逐个关闭;2. 表单聚焦时 ESC 不关闭弹窗
88
+ closeOnPressEscape: !1,
89
+ top: o(X) ?? o(V) ? "40px" : "15vh",
90
+ fullscreen: !1,
91
+ draggable: !1,
92
+ modalClass: `${e.modalClass || ""} tt-id-${t == null ? void 0 : t.uid}`
93
+ };
94
+ }), ue = u(() => ({
95
+ showCancelBtn: o(Z),
96
+ okText: o(ee),
97
+ cancelText: o(oe),
98
+ okButtonProps: o(b),
99
+ cancelButtonProps: o(te),
100
+ confirmLoading: o(se),
101
+ cancelLoading: o(re),
102
+ showOkBtn: o(ae)
103
+ })), A = u(() => {
104
+ var l, _;
105
+ const e = (l = o(b)) == null ? void 0 : l.disabled, s = o(D), i = (_ = o(b)) == null ? void 0 : _.disabledTip, r = Array.isArray(i) ? i : i ? [i] : [];
106
+ return e || s ? [!0, r] : [!1, []];
107
+ });
108
+ R(
109
+ () => {
110
+ var e;
111
+ return (e = g.value) == null ? void 0 : e.visible;
112
+ },
113
+ (e) => {
114
+ var s;
115
+ e !== T.value && (v("visible-change", !!e), v("update:visible", !!e)), t && ((s = m.emitVisible) == null || s.call(m, !!e, t == null ? void 0 : t.uid)), t != null && t.uid && (e ? qe({ uid: t.uid, close: () => a.onClosed() }) : W(t.uid)), e || a.changeOkLoading(!1);
116
+ },
117
+ {
118
+ immediate: !1
119
+ }
120
+ ), R(
121
+ () => o(T),
122
+ (e) => {
123
+ var s;
124
+ e !== ((s = g.value) == null ? void 0 : s.visible) && a.setState({ visible: e }), e || a.changeOkLoading(!1);
125
+ },
126
+ {
127
+ immediate: !1
128
+ }
129
+ );
130
+ function pe(e) {
131
+ M.value = e;
132
+ }
133
+ function fe() {
134
+ document.querySelectorAll(".el-select__popper").forEach((s) => {
135
+ s.style.display !== "none" && (s.style.display = "none");
136
+ });
137
+ }
138
+ function C(e) {
139
+ return e.toLowerCase().includes("modal") ? e : `modal-${e}`;
140
+ }
141
+ function me() {
142
+ const e = d["data-testid"] || d.dataTestid || d.testId || d["test-id"];
143
+ return e && typeof e == "string" ? e : void 0;
144
+ }
145
+ const h = u(() => {
146
+ var l;
147
+ const e = (l = g.value) == null ? void 0 : l.testId;
148
+ if (e)
149
+ return C(e);
150
+ const s = n.testId;
151
+ if (s)
152
+ return C(s);
153
+ const i = me();
154
+ if (i)
155
+ return C(i);
156
+ const r = o(S);
157
+ return r && typeof r == "string" && r.trim() ? I("modal", _e(r)) : t != null && t.uid ? `modal-${t.uid}` : "modal";
158
+ }), ge = u(() => I(h.value, "footer")), be = u(() => I(h.value, "body"));
159
+ ye("modalIdContext", h);
160
+ const m = Ce({
161
+ setModalProps: a.setState,
162
+ emitVisible: void 0,
163
+ redoModalHeight: () => {
164
+ Be(() => {
165
+ o(f) && o(f).setModalHeight();
166
+ });
167
+ },
168
+ scrollToBottom: () => {
169
+ var e;
170
+ o(f) && ((e = o(f)) == null || e.onScrollBottom());
171
+ }
172
+ });
173
+ return t && v("register", m, `${t == null ? void 0 : t.uid}`), Pe(() => {
174
+ const e = O(d, ["onVisibleChange", "onClosed", "onOk"]);
175
+ a.mount(
176
+ {
177
+ ...e,
178
+ onClosed: e.onClosed || d.onCancel || d.onClose
179
+ },
180
+ m
181
+ );
182
+ }), $e(() => {
183
+ t != null && t.uid && W(t.uid);
184
+ }), q({
185
+ modalApi: a
186
+ }), (e, s) => {
187
+ var i;
188
+ return Ie((Me(), Oe("div", {
189
+ "aria-tt-id": `tt-id-${(i = o(t)) == null ? void 0 : i.uid}`,
190
+ "data-testid": h.value
191
+ }, [
192
+ k(o(Re), j(ce.value, {
193
+ class: ["tt-ui-modal", o(K)],
194
+ "before-close": o(a).onClosed,
195
+ "close-icon": () => Se(o(Ve), {
196
+ size: 16,
197
+ icon: o(Ge),
198
+ isCustomSvg: !0
199
+ })
200
+ }), y({
201
+ default: c(() => [
202
+ k(He, {
203
+ ref_key: "modalWrapperRef",
204
+ ref: f,
205
+ "is-bottom": o(V),
206
+ height: o(ie),
207
+ loading: o(D),
208
+ "loading-tip": o(le),
209
+ class: we({ "pb-2!": !o(z) }),
210
+ "data-testid": be.value,
211
+ onIsScroll: pe
212
+ }, {
213
+ default: c(() => [
214
+ p(e.$slots, "default")
215
+ ]),
216
+ _: 3
217
+ }, 8, ["is-bottom", "height", "loading", "loading-tip", "class", "data-testid"])
218
+ ]),
219
+ _: 2
220
+ }, [
221
+ e.$slots.header ? {
222
+ name: "header",
223
+ fn: c(() => [
224
+ p(e.$slots, "header")
225
+ ]),
226
+ key: "1"
227
+ } : {
228
+ name: "header",
229
+ fn: c(() => [
230
+ k(Ee, {
231
+ title: o(S),
232
+ onMousedown: fe
233
+ }, y({
234
+ titleToolbar: c(() => [
235
+ p(e.$slots, "titleToolbar")
236
+ ]),
237
+ _: 2
238
+ }, [
239
+ B(Object.keys(e.$slots), (r) => ({
240
+ name: r,
241
+ fn: c((l) => [
242
+ p(e.$slots, r, P($(l || {})))
243
+ ])
244
+ }))
245
+ ]), 1032, ["title"])
246
+ ]),
247
+ key: "0"
248
+ },
249
+ o(U).footer || o(z) ? {
250
+ name: "footer",
251
+ fn: c(() => [
252
+ p(e.$slots, "footer", {}, () => [
253
+ Fe("div", { "data-testid": ge.value }, [
254
+ k(je, j(ue.value, {
255
+ class: "footer",
256
+ style: { borderTop: M.value ? "1px solid var(--tt-modal-footer-border-color)" : "none" },
257
+ "ok-button-props": {
258
+ ...o(b),
259
+ disabledTip: A.value[1],
260
+ disabled: A.value[0]
261
+ },
262
+ onFooterok: o(a).onOk,
263
+ onCancel: o(a).onClosed
264
+ }), y({ _: 2 }, [
265
+ B(Object.keys(
266
+ o(O)(e.$slots, ["beforeFooter", "insertFooter", "centerFooter", "appendFooter"])
267
+ ), (r) => ({
268
+ name: r,
269
+ fn: c((l) => [
270
+ p(e.$slots, r, P($({ ...l || {} })))
271
+ ])
272
+ }))
273
+ ]), 1040, ["style", "ok-button-props", "onFooterok", "onCancel"])
274
+ ], 8, Ue)
275
+ ])
276
+ ]),
277
+ key: "2"
278
+ } : void 0,
279
+ B(Object.keys(
280
+ o(H)(e.$slots, [
281
+ "default",
282
+ "titleToolbar",
283
+ "header",
284
+ "footer",
285
+ "beforeFooter",
286
+ "insertFooter",
287
+ "centerFooter",
288
+ "appendFooter"
289
+ ])
290
+ ), (r) => ({
291
+ name: r,
292
+ fn: c((l) => [
293
+ p(e.$slots, r, P($(l || {})))
294
+ ])
295
+ }))
296
+ ]), 1040, ["class", "before-close", "close-icon"])
297
+ ], 8, Ke)), [
298
+ [o(Le), {
299
+ draggable: o(Y),
300
+ fullscreen: o(J),
301
+ resizer: o(Q),
302
+ resizeChange: o(d).resizeChange
303
+ }]
304
+ ]);
305
+ };
306
+ }
307
+ });
308
+ export {
309
+ uo as default
310
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./RenderModal.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./ModalFooter.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-a36a5c1a"]]);
5
+ export {
6
+ p as default
7
+ };
@@ -0,0 +1,74 @@
1
+ import { defineComponent as h, inject as v, computed as r, unref as t, createElementBlock as b, openBlock as n, createElementVNode as F, createVNode as P, renderSlot as o, withCtx as a, createBlock as s, createCommentVNode as l, mergeProps as d, withModifiers as c, createTextVNode as p, toDisplayString as m } from "vue";
2
+ import { TtButton as u } from "../../../tt-button/index.js";
3
+ import { generateTestId as f } from "@dazhicheng/utils";
4
+ import { ElSpace as w } from "element-plus";
5
+ import { pick as y } from "lodash-es";
6
+ import { basicProps as I } from "../props.js";
7
+ const $ = { class: "flex" }, L = { class: "flex-1" }, D = /* @__PURE__ */ h({
8
+ name: "TtModalFooter",
9
+ __name: "ModalFooter",
10
+ props: y(I, [
11
+ "showCancelBtn",
12
+ "okText",
13
+ "cancelText",
14
+ "okButtonProps",
15
+ "cancelButtonProps",
16
+ "confirmLoading",
17
+ "cancelLoading",
18
+ "showOkBtn"
19
+ ]),
20
+ emits: ["cancel"],
21
+ setup(N, { emit: k }) {
22
+ const B = k, i = v("modalIdContext", ""), T = r(() => f(t(i), "btn-confirm")), g = r(() => f(t(i), "btn-cancel"));
23
+ function C(e) {
24
+ B("cancel", e);
25
+ }
26
+ return (e, V) => (n(), b("div", $, [
27
+ F("div", L, [
28
+ o(e.$slots, "beforeFooter", {}, void 0, !0)
29
+ ]),
30
+ P(t(w), {
31
+ size: 12,
32
+ class: "flex items-center justify-end"
33
+ }, {
34
+ default: a(() => [
35
+ o(e.$slots, "insertFooter", {}, void 0, !0),
36
+ e.showCancelBtn ? (n(), s(t(u), d({
37
+ key: 0,
38
+ loading: e.cancelLoading
39
+ }, e.cancelButtonProps, {
40
+ title: e.cancelText,
41
+ "data-testid": g.value,
42
+ onClick: c(C, ["stop"])
43
+ }), {
44
+ default: a(() => [
45
+ p(m(e.cancelText), 1)
46
+ ]),
47
+ _: 1
48
+ }, 16, ["loading", "title", "data-testid"])) : l("", !0),
49
+ o(e.$slots, "centerFooter", {}, void 0, !0),
50
+ e.showOkBtn ? (n(), s(t(u), d({
51
+ key: 1,
52
+ "disabled-tip": e.okButtonProps.disabledTip,
53
+ type: "primary"
54
+ }, e.okButtonProps, {
55
+ loading: e.confirmLoading,
56
+ title: e.okText,
57
+ "data-testid": T.value,
58
+ onClick: c(e.$attrs.onFooterok, ["stop"])
59
+ }), {
60
+ default: a(() => [
61
+ p(m(e.okText), 1)
62
+ ]),
63
+ _: 1
64
+ }, 16, ["disabled-tip", "loading", "title", "data-testid", "onClick"])) : l("", !0),
65
+ o(e.$slots, "appendFooter", {}, void 0, !0)
66
+ ]),
67
+ _: 3
68
+ })
69
+ ]));
70
+ }
71
+ });
72
+ export {
73
+ D as default
74
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./ModalHeader.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-79fd9031"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as s, createElementBlock as l, openBlock as a, normalizeClass as n, unref as i, createTextVNode as p, renderSlot as t, toDisplayString as d } from "vue";
2
+ import { propTypes as m, useDesign as c } from "@dazhicheng/hooks";
3
+ const v = /* @__PURE__ */ s({
4
+ __name: "ModalHeader",
5
+ props: {
6
+ /** 标题 */
7
+ title: m.string
8
+ },
9
+ setup(o) {
10
+ const { prefixCls: r } = c("modal-header");
11
+ return (e, u) => (a(), l("div", {
12
+ class: n(i(r))
13
+ }, [
14
+ p(d(e.$slots.title ? "" : o.title) + " ", 1),
15
+ t(e.$slots, "titleToolbar", {}, void 0, !0),
16
+ t(e.$slots, "appendHeader", {}, void 0, !0)
17
+ ], 2));
18
+ }
19
+ });
20
+ export {
21
+ v as default
22
+ };
@@ -0,0 +1,48 @@
1
+ import { defineComponent as d, ref as s, computed as g, watch as x, unref as o, onMounted as w, nextTick as v, withDirectives as S, createElementBlock as _, openBlock as k, normalizeClass as y, normalizeStyle as B, renderSlot as C } from "vue";
2
+ import { useDesign as H, useIsScroll as T } from "@dazhicheng/hooks";
3
+ import { vLoading as $ } from "element-plus";
4
+ import { basicProps as b } from "../props.js";
5
+ const E = /* @__PURE__ */ d({
6
+ name: "TtWrapper",
7
+ __name: "ModalWrapper",
8
+ props: b,
9
+ emits: ["is-scroll"],
10
+ setup(n, { expose: i, emit: l }) {
11
+ const t = n, p = l, a = s(window.innerHeight * 0.7), { prefixCls: c } = H("modal-wrapper"), e = s(), m = g(() => ({
12
+ // minHeight: `${props.minHeight}px`,
13
+ maxHeight: t.isBottom ? "calc(100vh - 60px - 44px - 33px)" : `${t.height || a.value}px`,
14
+ height: t.height > 0 ? `${t.height}px !important` : "auto"
15
+ // overflow: 'auto',
16
+ // padding: '12px 16px',
17
+ }));
18
+ function f() {
19
+ o(e) && o(e).scrollTo(0, 1e6);
20
+ }
21
+ const { hasScrollbar: h, update: u } = T();
22
+ return x(
23
+ () => o(h),
24
+ (r) => {
25
+ p("is-scroll", r);
26
+ }
27
+ ), w(() => {
28
+ v(() => {
29
+ u(e);
30
+ });
31
+ }), i({
32
+ onScrollBottom: f,
33
+ elm: e
34
+ }), (r, z) => S((k(), _("div", {
35
+ ref_key: "wrapperRef",
36
+ ref: e,
37
+ style: B(m.value),
38
+ class: y([o(c)])
39
+ }, [
40
+ C(r.$slots, "default")
41
+ ], 6)), [
42
+ [o($), r.loading]
43
+ ]);
44
+ }
45
+ });
46
+ export {
47
+ E as default
48
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ModalWrapper.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,131 @@
1
+ import { useStore as y } from "@tanstack/vue-store";
2
+ import { reactive as x, ref as T, defineComponent as p, provide as _, nextTick as v, h as u, inject as S, onMounted as g, watch as k, render as h } from "vue";
3
+ import { RouterView as E } from "vue-router";
4
+ import O from "../RenderModal.vue.js";
5
+ /* empty css */
6
+ import { ModalApi as b } from "../utils/modal-api.js";
7
+ const P = Symbol("Tt_MODAL_INJECT"), R = {};
8
+ function D(r = {}, a = P) {
9
+ var l;
10
+ const { connectedComponent: d } = r;
11
+ if (d) {
12
+ const t = x({}), o = T(!0);
13
+ return [p(
14
+ (m, { attrs: A, slots: C }) => (_(a, {
15
+ extendApi(w) {
16
+ Object.setPrototypeOf(t, w);
17
+ },
18
+ options: r,
19
+ async reCreateModal() {
20
+ o.value = !1, await v(), o.value = !0;
21
+ }
22
+ }), V(t, {
23
+ ...m,
24
+ ...A,
25
+ ...C
26
+ }), () => u(
27
+ o.value ? d : "div",
28
+ {
29
+ ...m,
30
+ ...A
31
+ },
32
+ C
33
+ )),
34
+ {
35
+ name: "TtModal",
36
+ inheritAttrs: !1
37
+ }
38
+ ), t];
39
+ }
40
+ const n = S(a, {}), e = {
41
+ ...R,
42
+ ...n.options,
43
+ ...r
44
+ };
45
+ e.onVisibleChange = (t) => {
46
+ var o, c, m;
47
+ (o = r.onVisibleChange) == null || o.call(r, t), (m = (c = n.options) == null ? void 0 : c.onVisibleChange) == null || m.call(c, t);
48
+ };
49
+ const s = e.onClosed;
50
+ e.onClosed = () => {
51
+ var t;
52
+ s == null || s(), e.destroyOnClose && ((t = n.reCreateDrawer) == null || t.call(n));
53
+ };
54
+ const f = new b(e), i = f;
55
+ i.useStore = (t) => y(f.store, t);
56
+ const M = p(
57
+ (t, { attrs: o, slots: c }) => () => u(
58
+ O,
59
+ {
60
+ ...t,
61
+ ...o,
62
+ modalApi: i
63
+ },
64
+ c
65
+ ),
66
+ {
67
+ name: "TtModal",
68
+ inheritAttrs: !1
69
+ }
70
+ );
71
+ return (l = n.extendApi) == null || l.call(n, i), [M, i];
72
+ }
73
+ function F(r, a, d) {
74
+ const n = new b(d), e = n;
75
+ e.useStore = (l) => y(n.store, l);
76
+ const s = document.createElement("div");
77
+ document.body.appendChild(s);
78
+ const f = p(
79
+ (l, { slots: t }) => (g(() => {
80
+ d && e.setModalProps(d), e.openModal();
81
+ }), k(
82
+ () => {
83
+ var o;
84
+ return (o = e.getVisible) == null ? void 0 : o.value;
85
+ },
86
+ (o) => {
87
+ o || (h(null, s), s.remove());
88
+ }
89
+ ), () => u(
90
+ O,
91
+ {
92
+ ...l,
93
+ modalApi: e
94
+ },
95
+ t
96
+ )),
97
+ {
98
+ name: "TtModal",
99
+ inheritAttrs: !1
100
+ }
101
+ ), i = u(a, {}), M = u(
102
+ E,
103
+ {},
104
+ () => u(
105
+ f,
106
+ {
107
+ ...d
108
+ },
109
+ {
110
+ default: () => i
111
+ }
112
+ )
113
+ );
114
+ return M.appContext = r._context, h(M, s), e;
115
+ }
116
+ async function V(r, a) {
117
+ var e;
118
+ if (!a || Object.keys(a).length === 0)
119
+ return;
120
+ await v();
121
+ const d = (e = r == null ? void 0 : r.store) == null ? void 0 : e.state;
122
+ if (!d)
123
+ return;
124
+ const n = new Set(Object.keys(d));
125
+ for (const s of Object.keys(a))
126
+ n.has(s) && ["class"].includes(s);
127
+ }
128
+ export {
129
+ F as showTtModal,
130
+ D as useModalRender
131
+ };
@@ -0,0 +1,17 @@
1
+ import { inject as s } from "vue";
2
+ import { showTtModal as M } from "./hooks/useModalRender.js";
3
+ const t = Symbol("SHOW_MODAL");
4
+ function a(o) {
5
+ const r = (n, e) => M(o, n, e);
6
+ o.provide(t, r);
7
+ }
8
+ function i() {
9
+ const o = s(t);
10
+ if (!o)
11
+ throw new Error("[TtModal]: useShowModal() 需要先调用 setupModal(app) 进行注册");
12
+ return o;
13
+ }
14
+ export {
15
+ a as setupModal,
16
+ i as useShowModal
17
+ };