@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,38 @@
1
+ const f = Symbol("VirtualGroupFormErrorCache");
2
+ function d(c = 4) {
3
+ const e = [];
4
+ let u = !1, n = !1;
5
+ function o() {
6
+ if (u = !1, n) return;
7
+ let l = 0;
8
+ for (; e.length > 0 && l < c; ) {
9
+ const t = e.shift();
10
+ t.cancelled || (t.cb(), l++);
11
+ }
12
+ e.length > 0 && r();
13
+ }
14
+ function r() {
15
+ u || n || (u = !0, requestAnimationFrame(o));
16
+ }
17
+ function i(l) {
18
+ const t = { cb: l, cancelled: !1 };
19
+ return e.push(t), r(), () => {
20
+ t.cancelled = !0;
21
+ };
22
+ }
23
+ function s() {
24
+ n = !0;
25
+ }
26
+ function a() {
27
+ n = !1, e.length > 0 && r();
28
+ }
29
+ return { request: i, pause: s, resume: a };
30
+ }
31
+ const E = Symbol("VirtualRenderScheduler"), h = Symbol("GroupVisibilityCallback"), R = Symbol("HiddenGroupKeys");
32
+ export {
33
+ h as GROUP_VISIBILITY_CALLBACK_KEY,
34
+ R as HIDDEN_GROUP_KEYS_KEY,
35
+ E as RENDER_SCHEDULER_KEY,
36
+ f as VIRTUAL_ERROR_CACHE_KEY,
37
+ d as createRenderScheduler
38
+ };
@@ -0,0 +1,83 @@
1
+ import { defineComponent as y, onMounted as C, watch as a, onBeforeUnmount as _, h as x, isReactive as N } from "vue";
2
+ import { useStore as P } from "@tanstack/vue-store";
3
+ import { GroupFormApi as w } from "./groupFormApi.js";
4
+ import M from "./GroupForm.vue2.js";
5
+ /* empty css */
6
+ import { resolveGroupSchema as u, extractFlatSchemas as D } from "./utils.js";
7
+ function q(e) {
8
+ const m = u(e), {
9
+ groupSchema: H,
10
+ schema: O,
11
+ virtual: i = !0,
12
+ containerHeight: l = "100%",
13
+ rootMargin: f = "400px 0px",
14
+ estimateFieldHeight: h = 52,
15
+ navAnchorProps: F,
16
+ scrollToFirstError: v,
17
+ scrollOffset: S = 0,
18
+ ...d
19
+ } = e, g = {
20
+ title: "导航",
21
+ show: !0,
22
+ ...F
23
+ }, A = D(m), G = {
24
+ ...d,
25
+ schema: A,
26
+ showDefaultActions: !1,
27
+ scrollToFirstError: !1
28
+ }, r = new w(G, {
29
+ groupSchema: m,
30
+ navAnchorProps: g,
31
+ virtual: i,
32
+ scrollToFirstError: v ?? !0,
33
+ containerHeight: l,
34
+ rootMargin: f,
35
+ estimateFieldHeight: h,
36
+ scrollOffset: S
37
+ }), s = r;
38
+ s.useStore = (o) => P(r.store, o);
39
+ const E = y({
40
+ name: "TtGroupForm",
41
+ inheritAttrs: !1,
42
+ setup(o, { attrs: p, slots: T }) {
43
+ r.setState({ ...p });
44
+ const n = [];
45
+ return C(() => {
46
+ r.resetCollapseStatesToDefault(), r.navAnchorProps.show && (r.syncNavErrorCountsFromForm(), n.push(
47
+ a(
48
+ () => {
49
+ var t, c;
50
+ return (c = (t = r.form) == null ? void 0 : t.errors) == null ? void 0 : c.value;
51
+ },
52
+ () => r.syncNavErrorCountsFromForm(),
53
+ { deep: !0, flush: "post" }
54
+ )
55
+ ), r.virtual && n.push(
56
+ a(
57
+ () => r.resetSignal.value,
58
+ () => r.syncNavErrorCountsFromForm()
59
+ )
60
+ ));
61
+ }), _(() => {
62
+ n.splice(0).forEach((t) => t()), r.unmount();
63
+ }), () => x(
64
+ M,
65
+ {
66
+ ...p,
67
+ ref: r.groupFormRef,
68
+ formApi: s
69
+ },
70
+ T
71
+ );
72
+ }
73
+ });
74
+ return N(e) && a(
75
+ () => u(e),
76
+ (o) => {
77
+ o.length && r._applyGroupSchema(o);
78
+ }
79
+ ), [E, s];
80
+ }
81
+ export {
82
+ q as useGroupForm
83
+ };
@@ -0,0 +1,106 @@
1
+ import { set as a, get as c } from "lodash-es";
2
+ function o(r) {
3
+ return "type" in r && r.type === "group";
4
+ }
5
+ function l(r) {
6
+ return "type" in r && r.type === "row";
7
+ }
8
+ function s(r) {
9
+ return "type" in r && r.type === "slot";
10
+ }
11
+ function v(r, e) {
12
+ return o(r) ? `group-${r.key}` : l(r) ? `row-${e}` : s(r) ? `slot-${e}` : r.fieldName || `field-${e}`;
13
+ }
14
+ function E(r) {
15
+ return r.map((e) => e.fieldName).filter((e) => !!e);
16
+ }
17
+ function I(r) {
18
+ const { groupSchema: e, schema: t } = r;
19
+ return process.env.NODE_ENV, e ?? t ?? [];
20
+ }
21
+ function y(r) {
22
+ const e = [];
23
+ for (const t of r)
24
+ o(t) ? e.push(...y(t.children)) : l(t) ? e.push(...t.children) : s(t) || e.push(t);
25
+ return e;
26
+ }
27
+ function N(r, e) {
28
+ for (const t of r)
29
+ o(t) && (t.defaultCollapsed && (e[t.key] = !0), t.children && N(t.children, e));
30
+ }
31
+ function g(r, e) {
32
+ const t = {};
33
+ return a(t, e, !0), r.findIndex((n) => {
34
+ var i;
35
+ return !!("fieldName" in n && c(t, n.fieldName) || s(n) && typeof n.content == "string" && n.content === e || o(n) && n.key === e || l(n) && ((i = n.children) != null && i.some((f) => c(t, f.fieldName))));
36
+ });
37
+ }
38
+ function S(r, e, t) {
39
+ const n = t.before ?? t.after;
40
+ if (!n) return !1;
41
+ const i = {};
42
+ r.children.forEach((d, u) => {
43
+ a(i, d.fieldName, u);
44
+ });
45
+ const f = c(i, n);
46
+ return typeof f != "number" ? !1 : (r.children.splice(t.before ? f : f + 1, 0, ...e), !0);
47
+ }
48
+ function b(r, e, t) {
49
+ var d;
50
+ const n = t.before ?? t.after;
51
+ if (!n) return !1;
52
+ const i = {};
53
+ a(i, n, !0);
54
+ const f = g(r, n);
55
+ if (f !== -1) {
56
+ const u = r[f];
57
+ return l(u) && ((d = u.children) != null && d.some((h) => h.fieldName && c(i, h.fieldName))) ? S(u, e, t) : (r.splice(t.before ? f : f + 1, 0, ...e), !0);
58
+ }
59
+ for (const u of r)
60
+ if (o(u) && b(u.children, e, t))
61
+ return !0;
62
+ return !1;
63
+ }
64
+ function p(r, e, t) {
65
+ return !!("fieldName" in r && c(e, r.fieldName) || s(r) && typeof r.content == "string" && t.has(r.content));
66
+ }
67
+ function F(r, e) {
68
+ const t = [];
69
+ for (const n of r)
70
+ o(n) && e.has(n.key) || (o(n) && (n.children = F(n.children, e)), t.push(n));
71
+ return t;
72
+ }
73
+ function G(r, e) {
74
+ const t = {};
75
+ e.forEach((i) => {
76
+ a(t, i, !0);
77
+ });
78
+ const n = [];
79
+ for (const i of r)
80
+ p(i, t, e) || (o(i) && (i.children = G(i.children, e)), l(i) && (i.children = i.children.filter((f) => !p(f, t, e))), n.push(i));
81
+ return n;
82
+ }
83
+ function k(r) {
84
+ return r.map((e) => o(e) ? { ...e, children: k(e.children) } : l(e) ? { ...e, children: [...e.children] } : e);
85
+ }
86
+ function m(r, e) {
87
+ const t = {};
88
+ for (const n of r)
89
+ o(n) ? t[n.key] = m(n.children, e) : l(n) ? Object.assign(t, m(n.children, e)) : s(n) || (t[n.fieldName] = e[n.fieldName]);
90
+ return t;
91
+ }
92
+ export {
93
+ k as cloneSchemaTree,
94
+ N as collectDefaultCollapseStates,
95
+ y as extractFlatSchemas,
96
+ E as getFieldNames,
97
+ m as getGroupValues,
98
+ v as getSchemaKey,
99
+ b as insertFieldsByPosition,
100
+ o as isGroupSchema,
101
+ l as isRowSchema,
102
+ s as isSlotSchema,
103
+ G as removeFieldsFromGroup,
104
+ F as removeGroupsFromGroup,
105
+ I as resolveGroupSchema
106
+ };
@@ -0,0 +1,22 @@
1
+ import { computed as p, unref as c } from "vue";
2
+ import { injectFormProps as g } from "../useFormContext.js";
3
+ import { normalizeArrayFieldPath as l } from "../utils/array-path.js";
4
+ function d(n, u) {
5
+ const [f] = g(), i = p(() => {
6
+ var r;
7
+ return (r = c(f)) == null ? void 0 : r.formApi;
8
+ }), e = l(n);
9
+ let t;
10
+ function s(r) {
11
+ var o;
12
+ e && r && (t = r, (o = i.value) == null || o.registerArrayField(e, r, u));
13
+ }
14
+ function m() {
15
+ var r;
16
+ e && ((r = i.value) == null || r.unregisterArrayField(e, t), t = void 0);
17
+ }
18
+ return [s, m];
19
+ }
20
+ export {
21
+ d as useArrayRegistry
22
+ };
@@ -0,0 +1,137 @@
1
+ import { inject as K, computed as d, toValue as V, ref as M, watch as O, onBeforeUnmount as R } from "vue";
2
+ import { get as U, set as C, cloneDeep as y } from "lodash-es";
3
+ import { FormContextKey as q } from "vee-validate";
4
+ function J(g) {
5
+ const r = K(q), i = d(() => V(g)), s = M([]);
6
+ let E = 0, f;
7
+ function a() {
8
+ if (!r)
9
+ return [];
10
+ const t = U(r.values, i.value);
11
+ return Array.isArray(t) ? t : [];
12
+ }
13
+ function c(t) {
14
+ r && (C(r.values, i.value, t), f = a());
15
+ }
16
+ function A(t, e) {
17
+ return d({
18
+ get() {
19
+ const n = a(), u = s.value.findIndex((l) => l.key === t);
20
+ return u === -1 ? e : n[u];
21
+ },
22
+ set(n) {
23
+ const u = s.value.findIndex((l) => l.key === t);
24
+ u !== -1 && F(u, n);
25
+ }
26
+ });
27
+ }
28
+ function h() {
29
+ const t = s.value.length;
30
+ for (let e = 0; e < t; e++) {
31
+ const n = s.value[e];
32
+ n.isFirst = e === 0, n.isLast = e === t - 1;
33
+ }
34
+ }
35
+ function o() {
36
+ h(), r == null || r.validate({ mode: "silent" });
37
+ }
38
+ function v(t, e, n) {
39
+ if (n && e != null && n[e])
40
+ return n[e];
41
+ const u = E++;
42
+ return {
43
+ key: u,
44
+ value: A(u, t),
45
+ isFirst: !1,
46
+ isLast: !1
47
+ };
48
+ }
49
+ function p() {
50
+ const t = a(), e = s.value;
51
+ s.value = t.map((n, u) => v(n, u, e)), f = a(), h();
52
+ }
53
+ p(), O([() => a(), () => a().length], ([t]) => {
54
+ const e = t.length !== s.value.length || t !== f;
55
+ f = t, e && p();
56
+ });
57
+ function I(t) {
58
+ if (!r)
59
+ return;
60
+ const e = [...a()];
61
+ if (t < 0 || t >= e.length)
62
+ return;
63
+ const n = `${i.value}[${t}]`;
64
+ r.destroyPath(n), r.unsetInitialValue(n), e.splice(t, 1), c(e), s.value.splice(t, 1), o();
65
+ }
66
+ function j(t) {
67
+ if (!r)
68
+ return;
69
+ const e = y(t), n = [...a(), e];
70
+ r.stageInitialValue(`${i.value}[${n.length - 1}]`, e), c(n), s.value.push(v(e)), o();
71
+ }
72
+ function k(t) {
73
+ if (!r)
74
+ return;
75
+ const e = y(t), n = [e, ...a()];
76
+ r.stageInitialValue(`${i.value}[0]`, e), c(n), s.value.unshift(v(e)), o();
77
+ }
78
+ function w(t, e) {
79
+ if (!r)
80
+ return;
81
+ const n = y(e), u = [...a()];
82
+ t < 0 || t > u.length || (u.splice(t, 0, n), c(u), s.value.splice(t, 0, v(n)), o());
83
+ }
84
+ function L(t) {
85
+ r && (r.stageInitialValue(i.value, t), c(y(t)), p(), o());
86
+ }
87
+ function F(t, e) {
88
+ if (!r)
89
+ return;
90
+ const n = a();
91
+ t < 0 || t >= n.length || (C(r.values, `${i.value}[${t}]`, e), r.validate({ mode: "validated-only" }));
92
+ }
93
+ function b(t, e) {
94
+ if (!r)
95
+ return;
96
+ const n = [...a()];
97
+ if (!(t in n) || !(e in n))
98
+ return;
99
+ const u = n[t];
100
+ n[t] = n[e], n[e] = u;
101
+ const l = [...s.value], m = l[t];
102
+ l[t] = l[e], l[e] = m, c(n), s.value = l, h();
103
+ }
104
+ function D(t, e) {
105
+ if (!r)
106
+ return;
107
+ const n = [...a()];
108
+ if (!(t in n) || !(e in n))
109
+ return;
110
+ const u = n.splice(t, 1)[0];
111
+ n.splice(e, 0, u);
112
+ const l = [...s.value], m = l.splice(t, 1)[0];
113
+ l.splice(e, 0, m), c(n), s.value = l, o();
114
+ }
115
+ const $ = {
116
+ fields: s,
117
+ remove: I,
118
+ push: j,
119
+ prepend: k,
120
+ insert: w,
121
+ replace: L,
122
+ update: F,
123
+ swap: b,
124
+ move: D
125
+ };
126
+ if (r) {
127
+ const t = Object.assign({ path: g, reset: p }, $);
128
+ r.fieldArrays.push(t), R(() => {
129
+ const e = r.fieldArrays.findIndex((n) => V(n.path) === V(g));
130
+ e >= 0 && r.fieldArrays.splice(e, 1);
131
+ });
132
+ }
133
+ return $;
134
+ }
135
+ export {
136
+ J as useFieldArray
137
+ };
@@ -0,0 +1,33 @@
1
+ import { kebabToCamelCase as d, getFirstNonNullOrUndefined as p } from "@dazhicheng/utils";
2
+ import { computed as l, unref as b, getCurrentInstance as O, useSlots as j, useAttrs as C } from "vue";
3
+ function g(o, u, t) {
4
+ const r = O(), e = j(), i = C();
5
+ return l(() => {
6
+ var s, c;
7
+ const f = ((s = r == null ? void 0 : r.vnode) == null ? void 0 : s.props) || {}, n = {};
8
+ for (const [m, v] of Object.entries(f))
9
+ n[d(m)] = v;
10
+ const a = (n == null ? void 0 : n[o]) === void 0 ? void 0 : u[o];
11
+ return p(
12
+ e[o],
13
+ i[o],
14
+ a,
15
+ (c = t == null ? void 0 : t.value) == null ? void 0 : c[o]
16
+ );
17
+ });
18
+ }
19
+ function F(o, u) {
20
+ const t = {};
21
+ return Object.keys(o).forEach((r) => {
22
+ t[r] = g(r, o, u);
23
+ }), l(() => {
24
+ const r = {};
25
+ return Object.keys(o).forEach((e) => {
26
+ r[e] = b(t[e]);
27
+ }), r;
28
+ });
29
+ }
30
+ export {
31
+ F as useForwardPriorityValues,
32
+ g as usePriorityValue
33
+ };
@@ -0,0 +1,81 @@
1
+ import { isString as x, calcWordsWidth as A } from "@dazhicheng/utils";
2
+ import { useResizeObserver as E } from "@vueuse/core";
3
+ import { ref as z, computed as a, toValue as L, watch as F, nextTick as T } from "vue";
4
+ function _(c) {
5
+ const n = z(1), u = ["ElSelect", "ElSelectV2"], i = () => c.value.component, r = () => L(c.value.componentProps), p = () => c.value.selectWrapRef, b = () => c.value.selectRef, f = a(() => {
6
+ const t = i();
7
+ return x(t) && u.includes(t);
8
+ }), m = a(() => {
9
+ var o;
10
+ const t = i(), e = r();
11
+ return t === "TtApiComponent" && u.includes((o = e == null ? void 0 : e.component) == null ? void 0 : o.name);
12
+ }), R = a(() => {
13
+ const t = r();
14
+ if (f.value || m.value) {
15
+ const e = {
16
+ clearable: !0,
17
+ filterable: !0
18
+ };
19
+ return t != null && t.multiple && (e.collapseTagsTooltip = !0, e.collapseTags = !0, e.maxCollapseTags = n.value), e;
20
+ }
21
+ return {};
22
+ });
23
+ function v() {
24
+ var e, o, l, s;
25
+ const t = b();
26
+ if (m.value)
27
+ return (l = (o = (e = t.value) == null ? void 0 : e.getComponentRef) == null ? void 0 : o.call(e)) == null ? void 0 : l.selectedLabel;
28
+ if (f.value)
29
+ return (s = t.value) == null ? void 0 : s.selectedLabel;
30
+ }
31
+ function g() {
32
+ var h;
33
+ if (!((h = r()) != null && h.multiple)) {
34
+ n.value = 1;
35
+ return;
36
+ }
37
+ const t = v();
38
+ if (!Array.isArray(t)) {
39
+ n.value = 1;
40
+ return;
41
+ }
42
+ if (!t.length) {
43
+ n.value = 1;
44
+ return;
45
+ }
46
+ const e = p().value;
47
+ if (!e) {
48
+ n.value = 1;
49
+ return;
50
+ }
51
+ const o = e.querySelector(".el-select__selection");
52
+ if (!o) {
53
+ n.value = 1;
54
+ return;
55
+ }
56
+ const l = window.getComputedStyle(o), s = l.fontFamily, W = l.fontSize, d = o.clientWidth - 48;
57
+ if (d <= 0) {
58
+ n.value = 1;
59
+ return;
60
+ }
61
+ let S = 0, C = 0;
62
+ t.slice(0).forEach((w) => {
63
+ const y = A(w, W, s) + 32 + 4;
64
+ S + y < d && (S += y, C += 1);
65
+ }), n.value = Math.max(1, C);
66
+ }
67
+ return F(
68
+ v,
69
+ async () => {
70
+ await T(), g();
71
+ },
72
+ { flush: "post", deep: !0 }
73
+ ), E(p(), async () => {
74
+ await T(), g();
75
+ }), {
76
+ selectComponentProps: R
77
+ };
78
+ }
79
+ export {
80
+ _ as useSelectCollapseOptions
81
+ };
@@ -0,0 +1,147 @@
1
+ import { defineComponent as P, ref as N, onMounted as S, nextTick as $, watch as k, createBlock as A, openBlock as B, unref as r, mergeProps as x, withKeys as L, createSlots as I, withCtx as m, renderSlot as u, normalizeProps as c, guardReactiveProps as f, createCommentVNode as K, renderList as U } from "vue";
2
+ import { useDesign as z } from "@dazhicheng/hooks";
3
+ import { cloneDeep as q } from "@dazhicheng/utils";
4
+ import { get as M, isEqual as G, set as H } from "lodash-es";
5
+ import { useForwardPriorityValues as W } from "./hooks/useForwardPriorityValues.js";
6
+ import { useDebounceFn as j } from "@vueuse/core";
7
+ import J from "./components/FormActions.vue2.js";
8
+ /* empty css */
9
+ import { DEFAULT_FORM_COMMON_CONFIG as Q, COMPONENT_MAP as X, COMPONENT_BIND_EVENT_MAP as Y } from "./config.js";
10
+ import "./components/Slot.js";
11
+ import "vee-validate";
12
+ import "../../tt-form-item-error-tooltip/index.js";
13
+ import "../../tt-icon/index.js";
14
+ import "element-plus";
15
+ /* empty css */
16
+ import "./form/RenderContent.vue.js";
17
+ import "@vee-validate/zod";
18
+ import { useFormInitial as Z, provideFormProps as ee, provideComponentRefMap as oe } from "./useFormContext.js";
19
+ import "es-toolkit/compat";
20
+ import "../../tt-text/index.js";
21
+ import te from "./form-render/form.vue2.js";
22
+ /* empty css */
23
+ const Me = /* @__PURE__ */ P({
24
+ name: "TtForm",
25
+ __name: "index",
26
+ props: {
27
+ formApi: {},
28
+ actionButtonsReverse: { type: Boolean },
29
+ actionLayout: {},
30
+ actionPosition: {},
31
+ actionWrapperClass: {},
32
+ arrayToStringFields: {},
33
+ fieldMappingTime: {},
34
+ handleCollapsedChange: { type: Function },
35
+ handleReset: { type: Function },
36
+ handleSubmit: { type: Function },
37
+ handleValuesChange: { type: Function },
38
+ resetButtonOptions: {},
39
+ scrollToFirstError: { type: Boolean },
40
+ showDefaultActions: { type: Boolean },
41
+ submitButtonOptions: {},
42
+ submitOnChange: { type: Boolean },
43
+ submitOnEnter: { type: Boolean },
44
+ collapsed: { type: Boolean },
45
+ collapsedRows: {},
46
+ collapseTriggerResize: { type: Boolean },
47
+ commonConfig: {},
48
+ compact: { type: Boolean },
49
+ layout: {},
50
+ schema: {},
51
+ showCollapseButton: { type: Boolean },
52
+ wrapperClass: {}
53
+ },
54
+ setup(O) {
55
+ var g, w, y, F;
56
+ const C = N(), { prefixCls: _ } = z("form-plus"), d = O, o = (w = (g = d.formApi) == null ? void 0 : g.useStore) == null ? void 0 : w.call(g), t = W(d, o), v = /* @__PURE__ */ new Map(), { delegatedSlots: E, form: h } = Z(t);
57
+ ee([t, h]), oe(v), (F = (y = d.formApi) == null ? void 0 : y.mount) == null || F.call(y, h, v);
58
+ const T = (e) => {
59
+ var p, n, a;
60
+ (p = d.formApi) == null || p.setState({ collapsed: e }), (a = (n = t.value).handleCollapsedChange) == null || a.call(n, e);
61
+ };
62
+ function R(e) {
63
+ var p, n;
64
+ !(o != null && o.value.submitOnEnter) || !((p = t.value.formApi) != null && p.isMounted) || e.target instanceof HTMLTextAreaElement || (e.preventDefault(), (n = t.value.formApi) == null || n.validateAndSubmitForm());
65
+ }
66
+ const V = j(async () => {
67
+ var e;
68
+ o != null && o.value.submitOnChange && ((e = t.value.formApi) == null || e.validateAndSubmitForm());
69
+ }, 300), b = {};
70
+ return S(async () => {
71
+ await $(), k(
72
+ () => h.values,
73
+ async (e) => {
74
+ var p, n;
75
+ if (t.value.handleValuesChange) {
76
+ const a = (p = o == null ? void 0 : o.value.schema) == null ? void 0 : p.map((l) => l.fieldName);
77
+ if (a && a.length > 0) {
78
+ const l = [];
79
+ if (a.forEach((i) => {
80
+ const s = M(e, i), D = M(b, i);
81
+ G(s, D) || (l.push(i), H(b, i, s));
82
+ }), l.length > 0) {
83
+ const i = await ((n = t.value.formApi) == null ? void 0 : n.getValues());
84
+ t.value.handleValuesChange(q(i ?? {}), l);
85
+ }
86
+ }
87
+ }
88
+ V();
89
+ },
90
+ { deep: !0 }
91
+ );
92
+ }), (e, p) => {
93
+ var n;
94
+ return B(), A(r(te), x({
95
+ ref_key: "formRef",
96
+ ref: C
97
+ }, r(t), {
98
+ class: r(_),
99
+ collapsed: (n = r(o)) == null ? void 0 : n.collapsed,
100
+ "component-bind-event-map": r(Y),
101
+ "component-map": r(X),
102
+ form: r(h),
103
+ "global-common-config": r(Q),
104
+ onKeydown: L(R, ["enter"])
105
+ }), I({
106
+ default: m((a) => [
107
+ u(e.$slots, "default", c(f(a)), () => {
108
+ var l, i;
109
+ return [
110
+ r(t).showDefaultActions ? (B(), A(J, {
111
+ key: 0,
112
+ "model-value": (l = r(o)) == null ? void 0 : l.collapsed,
113
+ "wrapper-ref": (i = C.value) == null ? void 0 : i.wrapperRef,
114
+ "onUpdate:modelValue": T
115
+ }, {
116
+ "reset-before": m((s) => [
117
+ u(e.$slots, "reset-before", c(f(s)))
118
+ ]),
119
+ "submit-before": m((s) => [
120
+ u(e.$slots, "submit-before", c(f(s)))
121
+ ]),
122
+ "expand-before": m((s) => [
123
+ u(e.$slots, "expand-before", c(f(s)))
124
+ ]),
125
+ "expand-after": m((s) => [
126
+ u(e.$slots, "expand-after", c(f(s)))
127
+ ]),
128
+ _: 3
129
+ }, 8, ["model-value", "wrapper-ref"])) : K("", !0)
130
+ ];
131
+ })
132
+ ]),
133
+ _: 2
134
+ }, [
135
+ U(r(E), (a) => ({
136
+ name: a,
137
+ fn: m((l) => [
138
+ u(e.$slots, a, c(f(l)))
139
+ ])
140
+ }))
141
+ ]), 1040, ["class", "collapsed", "component-bind-event-map", "component-map", "form", "global-common-config"]);
142
+ };
143
+ }
144
+ });
145
+ export {
146
+ Me as default
147
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./index.vue2.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,14 @@
1
+ import { inject as c, provide as s } from "vue";
2
+ function x(t, r) {
3
+ const e = typeof t == "string" && !r ? `${t}Context` : r, i = Symbol(e);
4
+ return [(n) => {
5
+ const o = c(i, n);
6
+ if (o || o === null) return o;
7
+ throw new Error(
8
+ `Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(t) ? `one of the following components: ${t.join(", ")}` : `\`${t}\``}`
9
+ );
10
+ }, (n) => (s(i, n), n)];
11
+ }
12
+ export {
13
+ x as createContext
14
+ };
@@ -0,0 +1,22 @@
1
+ var a = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var l = (t, e, o) => e.has(t) || a("Cannot " + o);
5
+ var r = (t, e, o) => (l(t, e, "read from private field"), o ? o.call(t) : e.get(t)), h = (t, e, o) => e.has(t) ? a("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, o), p = (t, e, o, s) => (l(t, e, "write to private field"), s ? s.call(t, o) : e.set(t, o), o);
6
+ var n;
7
+ class S {
8
+ constructor() {
9
+ h(this, n, {});
10
+ }
11
+ getComponents() {
12
+ return r(this, n);
13
+ }
14
+ setComponents(e) {
15
+ p(this, n, e);
16
+ }
17
+ }
18
+ n = new WeakMap();
19
+ const m = new S();
20
+ export {
21
+ m as globalShareState
22
+ };