@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,356 @@
1
+ import { defineComponent as Me, useSlots as Ee, ref as Oe, computed as f, toValue as v, getCurrentInstance as Ae, unref as a, onMounted as U, watch as O, onUnmounted as _e, createElementBlock as q, openBlock as G, normalizeClass as B, createCommentVNode as ke, createElementVNode as Re, createVNode as A, renderSlot as g, createSlots as J, renderList as Q, withCtx as M, normalizeProps as X, guardReactiveProps as Y, mergeProps as Z, toHandlers as $e, nextTick as Be } from "vue";
2
+ import "../../tt-button/index.js";
3
+ import "../../tt-checkbox/index.js";
4
+ import "../../tt-empty/index.js";
5
+ import { extractResourceFromApi as Ve, generateTestId as _, kebabToCamelCase as Le, mergeWithArrayOverride as xe, isFunction as Ke } from "@dazhicheng/utils";
6
+ import "element-plus";
7
+ import "../../tt-select/index.js";
8
+ import "../../tt-panel-select/index.js";
9
+ import "../../tt-upload/index.js";
10
+ import "../../tt-api-component/index.js";
11
+ import "vee-validate";
12
+ import { useForm as je } from "../../tt-form/src/useForm.js";
13
+ import "zod";
14
+ import { omit as ze } from "lodash-es";
15
+ import "dayjs";
16
+ import "dayjs/plugin/timezone";
17
+ import { useStore as De } from "@tanstack/vue-store";
18
+ import "es-toolkit/compat";
19
+ import "../../tt-form/src/shared/zod-defaults.js";
20
+ import "../../tt-nav-anchor/index.js";
21
+ import { useDesign as Ne, useDebounceFn as V } from "@dazhicheng/hooks";
22
+ import "../../tt-icon/index.js";
23
+ import "../../tt-form/src/components/Slot.js";
24
+ import "../../tt-form-item-error-tooltip/index.js";
25
+ import "@vueuse/core";
26
+ /* empty css */
27
+ import "../../tt-form/src/form/RenderContent.vue.js";
28
+ import "../../tt-form/src/form-render/FormFieldContact.js";
29
+ /* empty css */
30
+ /* empty css */
31
+ import "../../tt-image/index.js";
32
+ import "../../tt-drawer/index.js";
33
+ import "../../tt-modal/index.js";
34
+ import "../../tt-text/index.js";
35
+ import "../../../directives/disabled-tip/index.js";
36
+ import { GlobalConfig as He } from "../../../hooks/useSetup.js";
37
+ import "../../tt-log/index.js";
38
+ /* empty css */
39
+ /* empty css */
40
+ /* empty css */
41
+ /* empty css */
42
+ /* empty css */
43
+ import "../../tt-loading/index.js";
44
+ import "../index.js";
45
+ import "vue-router";
46
+ import "numeral";
47
+ import We from "xe-utils";
48
+ import Ue from "./components/TableColumnModal.vue2.js";
49
+ /* empty css */
50
+ import { provideFormActionTestIds as qe } from "./utils/context.js";
51
+ import Ge from "./components/TableToobalTools.vue.js";
52
+ import { basicTableEmits as ee } from "./emits.js";
53
+ import Je from "./Table.vue.js";
54
+ /* empty css */
55
+ import { createTableFormContext as Qe } from "./hooks/useTableContext.js";
56
+ import { useTableForm as Xe } from "./hooks/useTableForm.js";
57
+ import { useCustomColumns as Ye } from "./hooks/useCustomColumns.js";
58
+ import { useTableSlot as Ze } from "./hooks/useTableSlot.js";
59
+ import { tableFormProps as et } from "./props.js";
60
+ import { getDefaultState as tt } from "./utils/table-api.js";
61
+ import { TableFormApi as ot } from "./utils/table-form-api.js";
62
+ const st = ["data-testid"], rt = ["data-testid"], co = /* @__PURE__ */ Me({
63
+ name: "TtTableForm",
64
+ __name: "TableForm",
65
+ props: et,
66
+ emits: [
67
+ "register",
68
+ "update:table-data",
69
+ "columns-setting",
70
+ "change-row-height",
71
+ "export",
72
+ "import",
73
+ "set-columns",
74
+ ...ee
75
+ ],
76
+ setup(te, { expose: oe, emit: se }) {
77
+ var N, H, W;
78
+ const p = te, T = se, L = Ee(), { prefixCls: k } = Ne("table-form"), w = Oe();
79
+ let t = p.tableFormApi;
80
+ if (!t) {
81
+ t = new ot(p);
82
+ const e = t;
83
+ e.useStore = (o) => De(t.store, o), t = e;
84
+ }
85
+ const R = (N = t == null ? void 0 : t.useStore) == null ? void 0 : N.call(t), C = f(() => {
86
+ var o;
87
+ if (p.testId) return p.testId;
88
+ const e = (o = v(R)) == null ? void 0 : o.table;
89
+ return e != null && e.api ? Ve(e.api) : "table";
90
+ }), re = f(() => _(C.value, "tableform")), ae = f(() => _(C.value, "search-form-header")), ie = f(() => _(C.value, "search-btn-query")), le = f(() => _(C.value, "search-btn-reset")), ne = f(() => ({
91
+ submit: ie.value,
92
+ reset: le.value
93
+ }));
94
+ qe(ne);
95
+ const x = {}, u = Ae(), S = f(() => v(R)), { getFormSlotKeysFunc: me, getTableSlotKeysFunc: pe, replaceTableSlotKey: ue, replaceFormSlotKey: ce } = Ze(), {
96
+ tableData: de,
97
+ getFormProps: $,
98
+ getTableProps: c,
99
+ getTableToolProps: be,
100
+ handleSearchInfoChange: K
101
+ } = Xe(
102
+ S,
103
+ t.tableApi.reload,
104
+ t.tableApi.getLoading,
105
+ t.tableApi.getPagination,
106
+ T
107
+ ), { run: fe } = V(
108
+ async () => {
109
+ const e = await s.getValues();
110
+ await s.resetForm(e, { force: !0 });
111
+ const o = await s.getValues();
112
+ s.setLatestSubmissionValues(o), (await (s == null ? void 0 : s.validate())).valid && K(o);
113
+ },
114
+ 200,
115
+ { leading: !0 }
116
+ ), { run: ge } = V(
117
+ async (e) => {
118
+ await t.grid.clearFilter(), await K(e);
119
+ },
120
+ 200,
121
+ { leading: !0 }
122
+ ), [he, s] = je({
123
+ ...v($),
124
+ handleSubmit: ge,
125
+ handleReset: fe,
126
+ submitOnEnter: !0,
127
+ submitButtonOptions: {
128
+ content: (H = He.form) == null ? void 0 : H.submitTitle
129
+ },
130
+ showCollapseButton: !0,
131
+ collapsed: !0,
132
+ collapseTriggerResize: !0
133
+ }), { initCustomSetting: Ce, saveColumns: Se } = Ye({
134
+ getTableProps: c,
135
+ tableMethods: t.tableApi,
136
+ getProps: S
137
+ }), j = async () => {
138
+ await Be(), t.tableApi && t.tableApi.redoHeight();
139
+ };
140
+ ee.forEach((e) => {
141
+ const o = We.camelCase(e);
142
+ x[o] = (...r) => T(e, ...r);
143
+ });
144
+ const ve = {
145
+ ...x
146
+ };
147
+ function Te(e) {
148
+ t.setState((o) => o.table ? (o.table.getSyncSlotComponent = p.table.getSyncSlotComponent, xe(
149
+ {
150
+ ...e,
151
+ table: {
152
+ ...tt(),
153
+ ...e.table
154
+ }
155
+ },
156
+ o
157
+ )) : {}), e.table && t.tableApi.setState(e.table), e.form && (s == null || s.setState(e.form));
158
+ }
159
+ const { run: we } = V(
160
+ async (e) => {
161
+ s.isMounted && a(S).useSearchForm ? s.validate().then(async (o) => {
162
+ if (o.valid) {
163
+ const r = await s.getValues();
164
+ await t.tableApi.reload({
165
+ ...e,
166
+ searchInfo: {
167
+ ...e == null ? void 0 : e.searchInfo,
168
+ ...r
169
+ }
170
+ });
171
+ }
172
+ }) : t.tableApi.reload({
173
+ ...e,
174
+ searchInfo: {
175
+ ...e == null ? void 0 : e.searchInfo
176
+ }
177
+ });
178
+ },
179
+ 200,
180
+ { leading: !0 }
181
+ ), E = {
182
+ tableMethods: t.tableApi,
183
+ formMethods: s,
184
+ setTableProps: t.tableApi.setState,
185
+ setFormProps: s.setState,
186
+ setProps: Te,
187
+ reload: we,
188
+ selectedKeys: f(() => v(t.tableApi.selectedKeys))
189
+ };
190
+ async function ye() {
191
+ const { tableRefreshBefore: e } = S.value;
192
+ e && Ke(e) && await e(), E.reload();
193
+ }
194
+ async function Fe(e) {
195
+ var d, m;
196
+ const o = ((m = (d = S.value) == null ? void 0 : d.table) == null ? void 0 : m.columns) || [], r = new Map(o.map((n) => [n.field, n])), l = e.checkedModel.map((n) => r.get(n)).filter(Boolean);
197
+ if (e.isExport) {
198
+ T("export", e.checkedModel, e.modalApi);
199
+ return;
200
+ }
201
+ e.modalApi.setModalProps({
202
+ confirmLoading: !0
203
+ }), c.value.useHttpCache && await Se(JSON.stringify(e.checkedModel)), t.tableApi.setTableColumns(l), e.modalApi.setModalProps({
204
+ confirmLoading: !1
205
+ }), e.modalApi.closeModal(), T("set-columns", l);
206
+ }
207
+ function z(e = !1) {
208
+ var m, n, h, b, y, F, P, I;
209
+ const { notSetColumnField: o, columns: r } = a(c), l = (b = (h = (n = ((m = t.tableApi.getTableInstance()) == null ? void 0 : m.getTableColumn()) || []) == null ? void 0 : n.visibleColumn) == null ? void 0 : h.map((i) => i.field)) == null ? void 0 : b.filter(Boolean), d = ((F = (y = a(r)) == null ? void 0 : y.filter((i) => i.visible === !0 || i.visible === void 0)) == null ? void 0 : F.map((i) => i.field)) || [];
210
+ (P = w.value) == null || P.openModal({
211
+ columns: v(r) || [],
212
+ displayFields: e ? d : l,
213
+ disabledColumnField: o || []
214
+ }), (I = w.value) == null || I.setModalProps({
215
+ title: "列设置"
216
+ });
217
+ }
218
+ function D(e = !1) {
219
+ var m, n, h, b, y, F, P, I;
220
+ const { notSetColumnField: o, columns: r } = a(c), l = (b = (h = (n = ((m = t.tableApi.getTableInstance()) == null ? void 0 : m.getTableColumn()) || []) == null ? void 0 : n.visibleColumn) == null ? void 0 : h.map((i) => i.field)) == null ? void 0 : b.filter(Boolean), d = ((F = (y = a(r)) == null ? void 0 : y.filter((i) => i.visible === !0 || i.visible === void 0)) == null ? void 0 : F.map((i) => i.field)) || [];
221
+ (P = w.value) == null || P.openModal({
222
+ columns: v(r) || [],
223
+ displayFields: e ? d : l,
224
+ disabledColumnField: o || [],
225
+ isExport: !0
226
+ }), (I = w.value) == null || I.setModalProps({
227
+ title: "自定义导出"
228
+ });
229
+ }
230
+ Qe({ formInstance: s }), U(() => {
231
+ u && T("register", E, u == null ? void 0 : u.uid), setTimeout(() => {
232
+ Ce();
233
+ }, 16);
234
+ }), O(
235
+ () => t.tableApi.getLoading.value,
236
+ () => {
237
+ s && s.setState({
238
+ submitButtonOptions: { loading: t.tableApi.getLoading.value }
239
+ });
240
+ },
241
+ { immediate: (W = R.value.table) == null ? void 0 : W.immediate }
242
+ ), O(
243
+ () => $.value,
244
+ (e) => {
245
+ s && (s == null || s.setState(e));
246
+ },
247
+ { deep: !0 }
248
+ ), O(
249
+ () => c.value,
250
+ (e) => {
251
+ var o;
252
+ t != null && t.tableApi && ((o = t == null ? void 0 : t.tableApi) == null || o.setState(e));
253
+ },
254
+ { deep: !0 }
255
+ ), window.addEventListener("resize", j), U(() => {
256
+ t == null || t.mount(E, s), s == null || s.setState($.value);
257
+ });
258
+ function Pe(e) {
259
+ return Object.fromEntries(Object.entries(e).filter(([o]) => !o.startsWith("on")));
260
+ }
261
+ function Ie(e, o) {
262
+ return Object.fromEntries(Object.keys(e).map((r) => [r, o[r]]));
263
+ }
264
+ return O(
265
+ () => ze(p, ["tableFormApi"]),
266
+ () => {
267
+ var m;
268
+ const e = {}, o = ((m = u == null ? void 0 : u.vnode) == null ? void 0 : m.props) || {}, r = new Set(Object.keys(p));
269
+ for (const [n, h] of Object.entries(o)) {
270
+ const b = Le(n);
271
+ r.has(b) && (e[b] = h);
272
+ }
273
+ const l = Pe(e), d = Ie(l, p);
274
+ t.setState(d);
275
+ },
276
+ { deep: !0 }
277
+ ), _e(() => {
278
+ t == null || t.unmount(), window.removeEventListener("resize", j);
279
+ }), oe({ ...E, instance: u }), (e, o) => (G(), q("div", {
280
+ class: B(a(k)),
281
+ "data-testid": re.value
282
+ }, [
283
+ S.value.useSearchForm ? (G(), q("div", {
284
+ key: 0,
285
+ class: B(`${a(k)}-header`),
286
+ "data-testid": ae.value
287
+ }, [
288
+ A(a(he), {
289
+ "test-id": `${C.value}-search-form`
290
+ }, J({ _: 2 }, [
291
+ Q(a(me)(a(L)), (r) => ({
292
+ name: a(ce)(r),
293
+ fn: M((l) => [
294
+ g(e.$slots, r, X(Y(l || {})))
295
+ ])
296
+ }))
297
+ ]), 1032, ["test-id"]),
298
+ g(e.$slots, "header-down")
299
+ ], 10, rt)) : ke("", !0),
300
+ Re("div", {
301
+ class: B({
302
+ [`${a(k)}-wrapper`]: !0,
303
+ "pt-(--tt-base-padding)!": !0,
304
+ "pb-(--tt-base-padding)!": !a(c).showPager
305
+ })
306
+ }, [
307
+ g(e.$slots, "table-top"),
308
+ A(Je, Z(a(c), {
309
+ data: a(de),
310
+ "table-row-id": e.tableRowId,
311
+ "table-id": C.value,
312
+ "form-api": a(s),
313
+ "table-api": a(t).tableApi
314
+ }, $e(ve)), J({ _: 2 }, [
315
+ Q(a(pe)(a(L)), (r) => ({
316
+ name: a(ue)(r),
317
+ fn: M((l) => [
318
+ g(e.$slots, r, X(Y(l || {})))
319
+ ])
320
+ })),
321
+ a(c).showToolbar ? {
322
+ name: "toolbar_tools",
323
+ fn: M(() => [
324
+ A(Ge, Z(a(be), {
325
+ onOnRefresh: ye,
326
+ onOnExport: D,
327
+ onOnColumnsSetting: z
328
+ }), {
329
+ "toolbar-left": M(() => [
330
+ g(e.$slots, "t-toolbar_tools-left")
331
+ ]),
332
+ "toolbar-right": M(() => [
333
+ g(e.$slots, "t-toolbar_tools-right")
334
+ ]),
335
+ _: 3
336
+ }, 16),
337
+ g(e.$slots, "t-toolbar_tools")
338
+ ]),
339
+ key: "0"
340
+ } : void 0
341
+ ]), 1040, ["data", "table-row-id", "table-id", "form-api", "table-api"]),
342
+ g(e.$slots, "table-bottom")
343
+ ], 2),
344
+ A(Ue, {
345
+ ref_key: "tableColumnModalRef",
346
+ ref: w,
347
+ "open-export": D,
348
+ "open-column": z,
349
+ onOnSubmit: Fe
350
+ }, null, 512)
351
+ ], 10, st));
352
+ }
353
+ });
354
+ export {
355
+ co as default
356
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./TableForm.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,4 @@
1
+ const n = /* @__PURE__ */ new Map();
2
+ export {
3
+ n as componentMap
4
+ };
@@ -0,0 +1,24 @@
1
+ import { defineComponent as n, provide as t, computed as p } from "vue";
2
+ const d = Symbol("rowIndex"), u = n({
3
+ name: "RowContext",
4
+ props: {
5
+ /** 当前行索引 */
6
+ rowIndex: {
7
+ type: Number,
8
+ required: !0
9
+ }
10
+ },
11
+ setup(r, { slots: e }) {
12
+ return t(
13
+ d,
14
+ p(() => r.rowIndex)
15
+ ), () => {
16
+ var o;
17
+ return (o = e.default) == null ? void 0 : o.call(e);
18
+ };
19
+ }
20
+ });
21
+ export {
22
+ d as ROW_INDEX_KEY,
23
+ u as RowContext
24
+ };
@@ -0,0 +1,222 @@
1
+ import { defineComponent as q, useAttrs as G, ref as x, inject as _, computed as a, unref as r, toRaw as S, h as J, createElementBlock as s, openBlock as i, normalizeClass as h, createVNode as k, createBlock as c, createCommentVNode as u, withCtx as p, Fragment as f, renderList as A, renderSlot as Q, withDirectives as F, mergeProps as Z, normalizeStyle as W, toDisplayString as E, createElementVNode as ee, withModifiers as te, createSlots as oe, createTextVNode as re } from "vue";
2
+ import { propTypes as v, useDesign as ne } from "@dazhicheng/hooks";
3
+ import { calcWordsWidth as le, isBoolean as ie, isFunction as se, generateTestId as M, toKebabCase as P, isArray as de, isObject as ae } from "@dazhicheng/utils";
4
+ import { TtButton as C } from "../../../tt-button/index.js";
5
+ import { TtIcon as I } from "../../../tt-icon/index.js";
6
+ import R from "../../../../directives/disabled-tip/index.js";
7
+ import { ElDivider as ue, ElSpace as pe, ElPopover as ce } from "element-plus";
8
+ import fe from "../../../../assets/svg/action_more.svg.js";
9
+ import { ROW_INDEX_KEY as me } from "./RowContext.js";
10
+ const ve = { key: 1 }, be = ["onClick"], Be = /* @__PURE__ */ q({
11
+ name: "TtTableAction",
12
+ __name: "TableAction",
13
+ props: {
14
+ /** 操作项 */
15
+ actions: {
16
+ type: Array,
17
+ default: () => []
18
+ },
19
+ /** 当前行索引(从0开始,用于生成唯一 testid) */
20
+ rowIndex: {
21
+ type: Number,
22
+ default: void 0
23
+ },
24
+ /** vxe-table 插槽上下文对象(包含 $rowIndex 等参数) */
25
+ slotContext: {
26
+ type: Object,
27
+ default: void 0
28
+ },
29
+ /** 是否分割线 */
30
+ // divider: propTypes.bool.def(true),
31
+ /** 是否清除冒泡 */
32
+ stopButtonPropagation: v.bool.def(!1),
33
+ /** 显示buttton的个数 默认是2 */
34
+ showBtnNums: v.number.def(3),
35
+ /** 弹出框的宽度 */
36
+ popoverWidth: v.number.def(27),
37
+ /** 是否自动换行 */
38
+ wrap: v.bool.def(!0)
39
+ },
40
+ setup(T) {
41
+ const n = T, b = G(), { prefixCls: B } = ne("table-action"), m = x(!1), D = _(
42
+ "tableIdContext",
43
+ a(() => "")
44
+ ), j = _(me, void 0), z = a(() => {
45
+ if (n.rowIndex !== void 0 && n.rowIndex !== null)
46
+ return n.rowIndex;
47
+ const t = r(j);
48
+ if (t != null)
49
+ return t;
50
+ if (n.slotContext && n.slotContext.$rowIndex !== void 0)
51
+ return n.slotContext.$rowIndex;
52
+ if (b.$rowIndex !== void 0 && b.$rowIndex !== null)
53
+ return b.$rowIndex;
54
+ });
55
+ function y(t) {
56
+ const o = r(D), e = z.value;
57
+ return e != null ? M(o, "action", `row${e}`, P(t)) : M(o, "action", P(t));
58
+ }
59
+ function $(t) {
60
+ const o = t.ifShow;
61
+ let e = !0;
62
+ return ie(o) && (e = o), se(o) && (e = o(t)), e;
63
+ }
64
+ const V = a(() => (S(n.actions) || []).filter((t) => $(t)).slice(0, n.showBtnNums)), g = a(() => (S(n.actions) || []).filter((t) => $(t)).slice(n.showBtnNums)), O = a(() => r(g).length > 0), U = a(() => "left flex items-center"), K = a(() => {
65
+ const t = document.getElementsByTagName("body")[0], o = window.getComputedStyle(t).fontFamily, e = g.value.map((d) => le(d.label, "12px", o) + 22), l = Math.max(...e);
66
+ return l > n.popoverWidth ? l : n.popoverWidth;
67
+ });
68
+ function N(t, o) {
69
+ const e = t;
70
+ return de(e) && e.length > 0 ? e.some((l) => !!(l != null && l.condition)) : ae(e) ? !!e.condition : !!o;
71
+ }
72
+ function H(t) {
73
+ if (!n.stopButtonPropagation) return;
74
+ t.composedPath().find((l) => {
75
+ var d;
76
+ return ((d = l.tagName) == null ? void 0 : d.toUpperCase()) === "BUTTON";
77
+ }) && t.stopPropagation();
78
+ }
79
+ const L = J(ue, {
80
+ direction: "vertical",
81
+ style: { fontSize: "12px", margin: "0 6px" }
82
+ });
83
+ function X(t) {
84
+ m.value = !0, w.value = t.target && t.target.getBoundingClientRect();
85
+ }
86
+ const w = x({
87
+ top: 0,
88
+ left: 0,
89
+ bottom: 0,
90
+ right: 0
91
+ }), Y = x({
92
+ getBoundingClientRect() {
93
+ return w.value;
94
+ }
95
+ });
96
+ return (t, o) => (i(), s("div", {
97
+ class: h([r(B), U.value]),
98
+ onClick: H
99
+ }, [
100
+ k(r(pe), {
101
+ size: 0,
102
+ spacer: r(L),
103
+ wrap: T.wrap
104
+ }, {
105
+ default: p(() => [
106
+ (i(!0), s(f, null, A(V.value, (e, l) => (i(), s(f, {
107
+ key: `${l}-${e.label}`
108
+ }, [
109
+ e.slot ? Q(t.$slots, e.slot, Z({
110
+ key: 0,
111
+ ref_for: !0
112
+ }, e)) : F((i(), c(r(C), {
113
+ key: 1,
114
+ link: "",
115
+ type: e.type || "primary",
116
+ disabled: N(e.disabledTip, e.disabled),
117
+ style: W({ color: e.color, visibility: e.isTextHide ? "hidden" : "visible" }),
118
+ loading: e.loading,
119
+ "data-index": l,
120
+ "data-testid": y(e.label || ""),
121
+ onClick: e.onClick
122
+ }, {
123
+ default: p(() => [
124
+ e.iconFont ? (i(), s(f, { key: 0 }, [
125
+ e.iconFont ? (i(), c(r(I), {
126
+ key: 0,
127
+ "icon-font": e.iconFont,
128
+ class: h({ "mr-1": !!e.label })
129
+ }, null, 8, ["icon-font", "class"])) : u("", !0)
130
+ ], 64)) : u("", !0),
131
+ e.label ? (i(), s("span", ve, E(e.label), 1)) : u("", !0)
132
+ ]),
133
+ _: 2
134
+ }, 1032, ["type", "disabled", "style", "loading", "data-index", "data-testid", "onClick"])), [
135
+ [r(R), e.disabledTip]
136
+ ])
137
+ ], 64))), 128)),
138
+ O.value ? (i(), c(r(C), {
139
+ key: 0,
140
+ link: "",
141
+ type: "primary",
142
+ "data-testid": y("more")
143
+ }, {
144
+ default: p(() => [
145
+ ee("span", {
146
+ onMouseover: te(X, ["stop"]),
147
+ onMouseleave: o[0] || (o[0] = (e) => m.value = !1)
148
+ }, [
149
+ k(r(I), {
150
+ icon: r(fe),
151
+ "is-custom-svg": "",
152
+ size: 14
153
+ }, null, 8, ["icon"])
154
+ ], 32)
155
+ ]),
156
+ _: 1
157
+ }, 8, ["data-testid"])) : u("", !0)
158
+ ]),
159
+ _: 3
160
+ }, 8, ["spacer", "wrap"]),
161
+ w.value.left ? (i(), c(r(ce), {
162
+ key: 0,
163
+ visible: m.value,
164
+ "onUpdate:visible": o[1] || (o[1] = (e) => m.value = e),
165
+ trigger: "hover",
166
+ placement: "bottom",
167
+ width: K.value,
168
+ offset: 8,
169
+ "hide-after": 0,
170
+ "virtual-ref": Y.value,
171
+ "virtual-triggering": "",
172
+ "popper-class": `${r(B)}-popover-class`,
173
+ "popper-style": {
174
+ padding: "6px 0px",
175
+ minWidth: "60px"
176
+ }
177
+ }, {
178
+ default: p(() => [
179
+ (i(!0), s(f, null, A(g.value, (e, l) => (i(), s("div", {
180
+ key: `${l}-${e.label}`,
181
+ onClick: () => {
182
+ var d;
183
+ !e.disabled && ((d = e.onClick) == null || d.call(e));
184
+ }
185
+ }, [
186
+ F((i(), c(r(C), {
187
+ link: "",
188
+ disabled: N(e.disabledTip, e.disabled),
189
+ type: e.type || "primary",
190
+ style: W({ color: e.color }),
191
+ "data-testid": y(e.label || "")
192
+ }, oe({
193
+ default: p(() => [
194
+ e.label ? (i(), s(f, { key: 0 }, [
195
+ re(E(e.label), 1)
196
+ ], 64)) : u("", !0)
197
+ ]),
198
+ _: 2
199
+ }, [
200
+ e.iconFont ? {
201
+ name: "icon",
202
+ fn: p(() => [
203
+ k(r(I), {
204
+ "icon-font": e.iconFont,
205
+ class: h({ "mr-1": !!e.label })
206
+ }, null, 8, ["icon-font", "class"])
207
+ ]),
208
+ key: "0"
209
+ } : void 0
210
+ ]), 1032, ["disabled", "type", "style", "data-testid"])), [
211
+ [r(R), e.disabledTip]
212
+ ])
213
+ ], 8, be))), 128))
214
+ ]),
215
+ _: 1
216
+ }, 8, ["visible", "width", "virtual-ref", "popper-class"])) : u("", !0)
217
+ ], 2));
218
+ }
219
+ });
220
+ export {
221
+ Be as default
222
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./TableAction.vue.js";
2
+ export {
3
+ f as default
4
+ };