@dazhicheng/ui 1.5.198 → 1.5.201

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  2. package/dist/api/dataTypeContext.js +17 -0
  3. package/dist/assets/img/empty_images/no_data.png.js +4 -0
  4. package/dist/assets/img/empty_images/search.png.js +4 -0
  5. package/dist/assets/img/image_status/develop.png.js +4 -0
  6. package/dist/assets/img/image_status/loading.gif.js +4 -0
  7. package/dist/assets/img/image_status/loading_fail.png.js +4 -0
  8. package/dist/assets/img/image_status/no_network.png.js +4 -0
  9. package/dist/assets/img/image_status/no_permission.png.js +4 -0
  10. package/dist/assets/svg/action_more.svg.js +4 -0
  11. package/dist/assets/svg/close.svg.js +4 -0
  12. package/dist/assets/svg/item_error.svg.js +4 -0
  13. package/dist/assets/svg/paixu-jiangxu.svg.js +4 -0
  14. package/dist/assets/svg/paixu-moren.svg.js +4 -0
  15. package/dist/assets/svg/paixu-shengxu.svg.js +4 -0
  16. package/dist/assets/svg/quanping.svg.js +4 -0
  17. package/dist/assets/svg/suoxiao.svg.js +4 -0
  18. package/dist/components/tt-api-component/index.js +7 -0
  19. package/dist/components/tt-api-component/index.vue.js +7 -0
  20. package/dist/components/tt-api-component/index.vue2.js +199 -0
  21. package/dist/components/tt-area/TtArea.vue.js +7 -0
  22. package/dist/components/tt-area/TtArea.vue2.js +36 -0
  23. package/dist/components/tt-button/components/AddButton.vue.js +24 -0
  24. package/dist/components/tt-button/components/AddButton.vue2.js +4 -0
  25. package/dist/components/tt-button/index.js +9 -0
  26. package/dist/components/tt-button/index.vue.js +7 -0
  27. package/dist/components/tt-button/index.vue2.js +68 -0
  28. package/dist/components/tt-checkbox/index.js +7 -0
  29. package/dist/components/tt-checkbox/index.vue.js +77 -0
  30. package/dist/components/tt-checkbox/index.vue2.js +4 -0
  31. package/dist/components/tt-drawer/index.js +14 -0
  32. package/dist/components/tt-drawer/src/RenderDrawer.vue.js +156 -0
  33. package/dist/components/tt-drawer/src/RenderDrawer.vue3.js +5 -0
  34. package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +56 -0
  35. package/dist/components/tt-drawer/src/components/DrawerFooter.vue3.js +5 -0
  36. package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +7 -0
  37. package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +21 -0
  38. package/dist/components/tt-drawer/src/hooks/useDrawerRender.js +124 -0
  39. package/dist/components/tt-drawer/src/hooks/useResizable.js +98 -0
  40. package/dist/components/tt-drawer/src/index.js +17 -0
  41. package/dist/components/tt-drawer/src/props.js +72 -0
  42. package/dist/components/tt-drawer/src/utils/drawer-api.js +191 -0
  43. package/dist/components/tt-empty/index.js +34 -0
  44. package/dist/components/tt-form/index.js +65 -0
  45. package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +38 -0
  46. package/dist/components/tt-form/src/components/ExpandableArrow.vue3.js +5 -0
  47. package/dist/components/tt-form/src/components/FormActions.vue2.js +177 -0
  48. package/dist/components/tt-form/src/components/FormActions.vue3.js +5 -0
  49. package/dist/components/tt-form/src/components/FormElInput.vue.js +80 -0
  50. package/dist/components/tt-form/src/components/FormElInput.vue2.js +4 -0
  51. package/dist/components/tt-form/src/components/Slot.js +28 -0
  52. package/dist/components/tt-form/src/config.js +57 -0
  53. package/dist/components/tt-form/src/form/FormControl.vue.js +16 -0
  54. package/dist/components/tt-form/src/form/FormControl.vue2.js +4 -0
  55. package/dist/components/tt-form/src/form/FormDescription.vue.js +21 -0
  56. package/dist/components/tt-form/src/form/FormDescription.vue2.js +4 -0
  57. package/dist/components/tt-form/src/form/FormItem.vue.js +20 -0
  58. package/dist/components/tt-form/src/form/FormItem.vue2.js +4 -0
  59. package/dist/components/tt-form/src/form/FormLabel.vue.js +19 -0
  60. package/dist/components/tt-form/src/form/FormLabel.vue2.js +4 -0
  61. package/dist/components/tt-form/src/form/FormMessage.vue.js +18 -0
  62. package/dist/components/tt-form/src/form/FormMessage.vue2.js +4 -0
  63. package/dist/components/tt-form/src/form/FormMessageToolTip.vue.js +30 -0
  64. package/dist/components/tt-form/src/form/FormMessageToolTip.vue2.js +4 -0
  65. package/dist/components/tt-form/src/form/RenderContent.vue.js +31 -0
  66. package/dist/components/tt-form/src/form/RenderContent.vue2.js +4 -0
  67. package/dist/components/tt-form/src/form/injectionKeys.js +4 -0
  68. package/dist/components/tt-form/src/form/useFormField.js +24 -0
  69. package/dist/components/tt-form/src/form-render/FormField.vue.js +4 -0
  70. package/dist/components/tt-form/src/form-render/FormField.vue2.js +346 -0
  71. package/dist/components/tt-form/src/form-render/FormFieldContact.js +54 -0
  72. package/dist/components/tt-form/src/form-render/FormLabel.vue.js +4 -0
  73. package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +102 -0
  74. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +195 -0
  75. package/dist/components/tt-form/src/form-render/array-register/props.js +47 -0
  76. package/dist/components/tt-form/src/form-render/array-register/utils.js +12 -0
  77. package/dist/components/tt-form/src/form-render/context.js +15 -0
  78. package/dist/components/tt-form/src/form-render/dependencies.js +51 -0
  79. package/dist/components/tt-form/src/form-render/expandable.js +46 -0
  80. package/dist/components/tt-form/src/form-render/form.vue2.js +197 -0
  81. package/dist/components/tt-form/src/form-render/form.vue3.js +5 -0
  82. package/dist/components/tt-form/src/form-render/helper.js +22 -0
  83. package/dist/components/tt-form/src/form-render/rootWrapperClass.js +10 -0
  84. package/dist/components/tt-form/src/formApi.js +790 -0
  85. package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +223 -0
  86. package/dist/components/tt-form/src/group-form/GroupForm.vue3.js +5 -0
  87. package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +278 -0
  88. package/dist/components/tt-form/src/group-form/GroupSection.vue3.js +5 -0
  89. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +153 -0
  90. package/dist/components/tt-form/src/group-form/LazyFormField.vue3.js +5 -0
  91. package/dist/components/tt-form/src/group-form/groupFormApi.js +700 -0
  92. package/dist/components/tt-form/src/group-form/lazyContext.js +38 -0
  93. package/dist/components/tt-form/src/group-form/useGroupForm.js +83 -0
  94. package/dist/components/tt-form/src/group-form/utils.js +106 -0
  95. package/dist/components/tt-form/src/hooks/useArrayRegistry.js +22 -0
  96. package/dist/components/tt-form/src/hooks/useFieldArray.js +137 -0
  97. package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +33 -0
  98. package/dist/components/tt-form/src/hooks/useSelectCollapse.js +81 -0
  99. package/dist/components/tt-form/src/index.vue2.js +149 -0
  100. package/dist/components/tt-form/src/index.vue3.js +5 -0
  101. package/dist/components/tt-form/src/shared/createContext.js +14 -0
  102. package/dist/components/tt-form/src/shared/global-state.js +22 -0
  103. package/dist/components/tt-form/src/shared/zod-defaults.js +47 -0
  104. package/dist/components/tt-form/src/types/forms.js +6 -0
  105. package/dist/components/tt-form/src/useForm.js +28 -0
  106. package/dist/components/tt-form/src/useFormContext.js +320 -0
  107. package/dist/components/tt-form/src/utils/array-path.js +18 -0
  108. package/dist/components/tt-form-item-error-tooltip/index.js +9 -0
  109. package/dist/components/tt-form-item-error-tooltip/index.vue.js +183 -0
  110. package/dist/components/tt-form-item-error-tooltip/index.vue3.js +5 -0
  111. package/dist/components/tt-icon/components/AddIcon.vue.js +28 -0
  112. package/dist/components/tt-icon/components/AddIcon.vue2.js +4 -0
  113. package/dist/components/tt-icon/components/SubIcon.vue.js +28 -0
  114. package/dist/components/tt-icon/components/SubIcon.vue2.js +4 -0
  115. package/dist/components/tt-icon/index.js +11 -0
  116. package/dist/components/tt-icon/index.vue.js +8 -0
  117. package/dist/components/tt-icon/index.vue2.js +115 -0
  118. package/dist/components/tt-image/index.js +9 -0
  119. package/dist/components/tt-image/src/components/ImageViewer.js +41 -0
  120. package/dist/components/tt-image/tt-image.js +55 -0
  121. package/dist/components/tt-loading/index.js +8 -0
  122. package/dist/components/tt-loading/src/directive.js +51 -0
  123. package/dist/components/tt-loading/src/loading.vue.js +7 -0
  124. package/dist/components/tt-loading/src/loading.vue2.js +75 -0
  125. package/dist/components/tt-loading/src/service.js +79 -0
  126. package/dist/components/tt-log/index.js +7 -0
  127. package/dist/components/tt-log/index.vue.js +30 -0
  128. package/dist/components/tt-log/index.vue2.js +4 -0
  129. package/dist/components/tt-modal/index.js +14 -0
  130. package/dist/components/tt-modal/src/RenderModal.vue.js +310 -0
  131. package/dist/components/tt-modal/src/RenderModal.vue3.js +5 -0
  132. package/dist/components/tt-modal/src/components/ModalFooter.vue.js +7 -0
  133. package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +74 -0
  134. package/dist/components/tt-modal/src/components/ModalHeader.vue.js +7 -0
  135. package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +22 -0
  136. package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +48 -0
  137. package/dist/components/tt-modal/src/components/ModalWrapper.vue2.js +4 -0
  138. package/dist/components/tt-modal/src/hooks/useModalRender.js +131 -0
  139. package/dist/components/tt-modal/src/index.js +17 -0
  140. package/dist/components/tt-modal/src/props.js +75 -0
  141. package/dist/components/tt-modal/src/utils/modal-api.js +200 -0
  142. package/dist/components/tt-modal/src/utils/modal-stack.js +28 -0
  143. package/dist/components/tt-modal-form/hooks/useModalFormSlot.js +22 -0
  144. package/dist/components/tt-modal-form/index.vue.js +178 -0
  145. package/dist/components/tt-modal-form/index.vue2.js +4 -0
  146. package/dist/components/tt-modal-form/useModalForm.js +30 -0
  147. package/dist/components/tt-nav-anchor/index.js +8 -0
  148. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +234 -0
  149. package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue3.js +5 -0
  150. package/dist/components/tt-nav-anchor/src/constants.js +4 -0
  151. package/dist/components/tt-panel-select/index.js +7 -0
  152. package/dist/components/tt-panel-select/src/common.js +4 -0
  153. package/dist/components/tt-panel-select/src/components/PanelLeft.vue.js +56 -0
  154. package/dist/components/tt-panel-select/src/components/PanelLeft.vue2.js +4 -0
  155. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +277 -0
  156. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue2.js +4 -0
  157. package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +108 -0
  158. package/dist/components/tt-panel-select/src/components/PanelRight.vue2.js +4 -0
  159. package/dist/components/tt-panel-select/src/hooks/usePanelData.js +184 -0
  160. package/dist/components/tt-panel-select/src/hooks/usePanelSelection.js +91 -0
  161. package/dist/components/tt-panel-select/src/index.vue.js +386 -0
  162. package/dist/components/tt-panel-select/src/index.vue2.js +4 -0
  163. package/dist/components/tt-select/index.js +8 -0
  164. package/dist/components/tt-select/src/Select.vue.js +315 -0
  165. package/dist/components/tt-select/src/Select.vue3.js +5 -0
  166. package/dist/components/tt-select/src/components/SelectTable.vue.js +86 -0
  167. package/dist/components/tt-select/src/components/SelectTable.vue3.js +5 -0
  168. package/dist/components/tt-select/src/components/Table.vue.js +307 -0
  169. package/dist/components/tt-select/src/components/Table.vue3.js +5 -0
  170. package/dist/components/tt-select/src/const.js +19 -0
  171. package/dist/components/tt-select/src/hooks/useDataSource.js +196 -0
  172. package/dist/components/tt-select/src/hooks/useGrid.js +97 -0
  173. package/dist/components/tt-select/src/hooks/useKeyboard.js +63 -0
  174. package/dist/components/tt-select/src/hooks/usePagination.js +45 -0
  175. package/dist/components/tt-select/src/hooks/useSelect.js +100 -0
  176. package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
  177. package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +345 -0
  178. package/dist/components/tt-select/src/props.js +201 -0
  179. package/dist/components/tt-select/src/utils/index.js +16 -0
  180. package/dist/components/tt-table/index.js +33 -0
  181. package/dist/components/tt-table/src/Table.vue.js +623 -0
  182. package/dist/components/tt-table/src/Table.vue3.js +5 -0
  183. package/dist/components/tt-table/src/TableForm.vue.js +317 -0
  184. package/dist/components/tt-table/src/TableForm.vue2.js +4 -0
  185. package/dist/components/tt-table/src/componentMap.js +4 -0
  186. package/dist/components/tt-table/src/components/RowContext.js +24 -0
  187. package/dist/components/tt-table/src/components/TableAction.vue.js +222 -0
  188. package/dist/components/tt-table/src/components/TableAction.vue2.js +4 -0
  189. package/dist/components/tt-table/src/components/TableButtons.js +117 -0
  190. package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +233 -0
  191. package/dist/components/tt-table/src/components/TableColumnModal.vue3.js +5 -0
  192. package/dist/components/tt-table/src/components/TableToobalTools.vue.js +87 -0
  193. package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +4 -0
  194. package/dist/components/tt-table/src/emits.js +15 -0
  195. package/dist/components/tt-table/src/hooks/useCellArea.js +15 -0
  196. package/dist/components/tt-table/src/hooks/useColumns.js +275 -0
  197. package/dist/components/tt-table/src/hooks/useCustomColumns.js +53 -0
  198. package/dist/components/tt-table/src/hooks/useDataSource.js +224 -0
  199. package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +64 -0
  200. package/dist/components/tt-table/src/hooks/usePagination.js +44 -0
  201. package/dist/components/tt-table/src/hooks/useRowSelection.js +84 -0
  202. package/dist/components/tt-table/src/hooks/useTableContext.js +20 -0
  203. package/dist/components/tt-table/src/hooks/useTableEvent.js +197 -0
  204. package/dist/components/tt-table/src/hooks/useTableForm.js +60 -0
  205. package/dist/components/tt-table/src/hooks/useTableRender.js +33 -0
  206. package/dist/components/tt-table/src/hooks/useTableSlot.js +17 -0
  207. package/dist/components/tt-table/src/props.js +482 -0
  208. package/dist/components/tt-table/src/toolProps.js +30 -0
  209. package/dist/components/tt-table/src/utils/context.js +17 -0
  210. package/dist/components/tt-table/src/utils/table-api.js +386 -0
  211. package/dist/components/tt-table/src/utils/table-form-api.js +122 -0
  212. package/dist/components/tt-text/index.js +7 -0
  213. package/dist/components/tt-text/index.vue.js +7 -0
  214. package/dist/components/tt-text/index.vue2.js +73 -0
  215. package/dist/components/tt-upload/index.js +9 -0
  216. package/dist/components/tt-upload/src/TtUpload.vue.js +305 -0
  217. package/dist/components/tt-upload/src/TtUpload.vue2.js +4 -0
  218. package/dist/components/tt-upload/src/typing.js +107 -0
  219. package/dist/directives/auto-tip/index.js +62 -0
  220. package/dist/directives/dialog-resize/index.js +49 -0
  221. package/dist/directives/dialog-resize/use-css-variable.js +44 -0
  222. package/dist/directives/dialog-resize/use-draggable.js +35 -0
  223. package/dist/directives/dialog-resize/use-fullscreen.js +38 -0
  224. package/dist/directives/dialog-resize/use-parse-translate.js +9 -0
  225. package/dist/directives/dialog-resize/use-resizer.js +37 -0
  226. package/dist/directives/disabled-tip/index.js +78 -0
  227. package/dist/directives/index.js +8 -0
  228. package/dist/hooks/useDataPermissionOptions.js +142 -0
  229. package/dist/hooks/useFormSchemasLink.js +261 -0
  230. package/dist/hooks/useFormat.js +44 -0
  231. package/dist/hooks/useLoading.js +22 -0
  232. package/dist/hooks/useScreenshotOss.js +69 -0
  233. package/dist/hooks/useSetup.js +59 -0
  234. package/dist/index.js +142 -60274
  235. package/dist/plugins/default/renderCellContent.js +58 -0
  236. package/dist/plugins/vxeTable/switchStatus.js +91 -0
  237. package/dist/plugins.js +4 -146
  238. package/dist/style.css +1 -1
  239. package/dist/utils/xhr.js +8 -0
  240. package/package.json +5 -3
  241. package/dist/index-NG5FNCLD.js +0 -3430
  242. package/dist/index.modern-4Cf3dcJP.js +0 -3069
@@ -0,0 +1,177 @@
1
+ import { defineComponent as O, useModel as _, useAttrs as E, computed as d, unref as o, ref as L, watch as M, onMounted as W, createElementBlock as C, openBlock as l, normalizeClass as I, createCommentVNode as u, renderSlot as f, createBlock as v, Fragment as x, resolveDynamicComponent as b, mergeProps as g, withCtx as k, createTextVNode as B, toDisplayString as R, toRaw as F, nextTick as H } from "vue";
2
+ import { triggerWindowResize as U, clnm as q, isFunction as G } from "@dazhicheng/utils";
3
+ import V from "@dazhicheng-ui/components/tt-button";
4
+ import { useDesign as J } from "@dazhicheng/hooks";
5
+ import K from "./ExpandableArrow.vue2.js";
6
+ /* empty css */
7
+ import { injectFormProps as Q } from "../useFormContext.js";
8
+ const ne = /* @__PURE__ */ O({
9
+ __name: "FormActions",
10
+ props: {
11
+ modelValue: { default: !1, type: Boolean },
12
+ modelModifiers: {}
13
+ },
14
+ emits: ["update:modelValue"],
15
+ setup(S, { expose: $ }) {
16
+ const [n, j] = Q(), c = _(S, "modelValue"), { prefixCls: A } = J("form-submit-btn"), D = E(), h = d(() => ({
17
+ content: "重置",
18
+ show: !0,
19
+ ...o(n).resetButtonOptions
20
+ })), i = d(() => ({
21
+ content: "查询",
22
+ show: !0,
23
+ ...o(n).submitButtonOptions
24
+ })), m = L(!1), T = d(() => o(n).showCollapseButton && m.value);
25
+ async function w(e) {
26
+ var r;
27
+ e == null || e.preventDefault(), e == null || e.stopPropagation();
28
+ const t = o(n);
29
+ if (!t.formApi)
30
+ return;
31
+ const { valid: a } = await t.formApi.validate();
32
+ if (!a)
33
+ return;
34
+ const s = F(await t.formApi.getValues()) ?? {};
35
+ await ((r = t.handleSubmit) == null ? void 0 : r.call(t, s));
36
+ }
37
+ async function P(e) {
38
+ var s, r;
39
+ e == null || e.preventDefault(), e == null || e.stopPropagation();
40
+ const t = o(n), a = F(await ((s = t.formApi) == null ? void 0 : s.getValues())) ?? {};
41
+ G(t.handleReset) ? await ((r = t.handleReset) == null ? void 0 : r.call(t, a)) : j.resetForm({}, { force: !0 });
42
+ }
43
+ function p() {
44
+ c.value = !0, m.value = !1;
45
+ }
46
+ async function z() {
47
+ if (!o(n).showCollapseButton) {
48
+ p();
49
+ return;
50
+ }
51
+ await H();
52
+ const e = D["wrapper-ref"];
53
+ if (!e) {
54
+ p();
55
+ return;
56
+ }
57
+ const t = Array.from(e.children);
58
+ if (t.length <= 1) {
59
+ p();
60
+ return;
61
+ }
62
+ let a = !1;
63
+ const s = /* @__PURE__ */ new Set();
64
+ if (c.value) {
65
+ for (const r of t)
66
+ if (r.getBoundingClientRect().top === 0) {
67
+ a = !0;
68
+ continue;
69
+ }
70
+ a ? m.value = !0 : p();
71
+ } else {
72
+ for (const r of t) {
73
+ const y = r.getBoundingClientRect();
74
+ y.top !== 0 && s.add(y.top);
75
+ }
76
+ s.size === 1 ? p() : m.value = !0;
77
+ }
78
+ }
79
+ M(
80
+ () => c.value,
81
+ () => {
82
+ o(n).collapseTriggerResize && U();
83
+ }
84
+ );
85
+ const N = d(() => {
86
+ const e = o(n), t = e.actionLayout || "rowEnd", a = e.actionPosition || "right", s = [
87
+ "flex",
88
+ "items-center",
89
+ "gap-3",
90
+ e.compact ? "pb-[8px]" : "pb-(--form-valid-error-nocompact-padding-bottom)",
91
+ e.layout === "vertical" ? "self-end" : "self-center",
92
+ e.layout === "inline" ? "" : "w-full",
93
+ e.actionWrapperClass
94
+ ];
95
+ switch (t) {
96
+ case "newLine": {
97
+ s.push("col-span-full");
98
+ break;
99
+ }
100
+ case "rowEnd": {
101
+ s.push("col-[-2/-1]");
102
+ break;
103
+ }
104
+ }
105
+ switch (a) {
106
+ case "center": {
107
+ s.push("justify-center");
108
+ break;
109
+ }
110
+ case "left": {
111
+ s.push("justify-start");
112
+ break;
113
+ }
114
+ default: {
115
+ s.push("justify-end");
116
+ break;
117
+ }
118
+ }
119
+ return s.join(" ");
120
+ });
121
+ return W(() => {
122
+ setTimeout(() => {
123
+ o(n).showCollapseButton && z();
124
+ }, 200);
125
+ }), $({
126
+ handleReset: P,
127
+ handleSubmit: w
128
+ }), (e, t) => (l(), C("div", {
129
+ class: I(o(q)(N.value))
130
+ }, [
131
+ o(n).actionButtonsReverse ? (l(), C(x, { key: 0 }, [
132
+ f(e.$slots, "submit-before"),
133
+ i.value.show ? (l(), v(b(o(V)), g({ key: 0 }, i.value, {
134
+ class: o(A),
135
+ type: "primary",
136
+ onClick: w
137
+ }), {
138
+ default: k(() => [
139
+ B(R(i.value.content), 1)
140
+ ]),
141
+ _: 1
142
+ }, 16, ["class"])) : u("", !0)
143
+ ], 64)) : u("", !0),
144
+ f(e.$slots, "reset-before"),
145
+ h.value.show ? (l(), v(b(o(V)), g({ key: 1 }, h.value, { onClick: P }), {
146
+ default: k(() => [
147
+ B(R(h.value.content), 1)
148
+ ]),
149
+ _: 1
150
+ }, 16)) : u("", !0),
151
+ o(n).actionButtonsReverse ? u("", !0) : (l(), C(x, { key: 2 }, [
152
+ f(e.$slots, "submit-before"),
153
+ i.value.show ? (l(), v(b(o(V)), g({
154
+ key: 0,
155
+ type: "primary",
156
+ class: o(A)
157
+ }, i.value, { onClick: w }), {
158
+ default: k(() => [
159
+ B(R(i.value.content), 1)
160
+ ]),
161
+ _: 1
162
+ }, 16, ["class"])) : u("", !0)
163
+ ], 64)),
164
+ f(e.$slots, "expand-before"),
165
+ T.value ? (l(), v(K, {
166
+ key: 3,
167
+ "model-value": c.value,
168
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => c.value = a),
169
+ class: "ml-[-0.3em]"
170
+ }, null, 8, ["model-value"])) : u("", !0),
171
+ f(e.$slots, "expand-after")
172
+ ], 2));
173
+ }
174
+ });
175
+ export {
176
+ ne as default
177
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./FormActions.vue2.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,80 @@
1
+ import { defineComponent as g, useAttrs as C, useSlots as h, useTemplateRef as k, computed as s, createBlock as w, openBlock as y, unref as r, mergeProps as P, createSlots as T, renderList as A, withCtx as B, renderSlot as E, normalizeProps as I, guardReactiveProps as V } from "vue";
2
+ import { ElInput as F } from "element-plus";
3
+ const D = /* @__PURE__ */ g({
4
+ inheritAttrs: !1,
5
+ __name: "FormElInput",
6
+ props: {
7
+ form: {}
8
+ },
9
+ setup(L, { expose: a }) {
10
+ const u = C(), l = h(), t = k("inputRef"), i = s(() => {
11
+ var e;
12
+ return (e = t.value) == null ? void 0 : e.input;
13
+ }), c = s(() => {
14
+ var e;
15
+ return (e = t.value) == null ? void 0 : e.textarea;
16
+ }), p = s(() => {
17
+ var e;
18
+ return (e = t.value) == null ? void 0 : e.ref;
19
+ }), f = s(() => {
20
+ var e;
21
+ return (e = t.value) == null ? void 0 : e.textareaStyle;
22
+ }), m = s(() => {
23
+ var e;
24
+ return (e = t.value) == null ? void 0 : e.autosize;
25
+ }), v = s(() => {
26
+ var e;
27
+ return (e = t.value) == null ? void 0 : e.isComposing;
28
+ }), _ = s(() => {
29
+ var e;
30
+ return (e = t.value) == null ? void 0 : e.passwordVisible;
31
+ });
32
+ function x() {
33
+ var e;
34
+ (e = t.value) == null || e.focus();
35
+ }
36
+ function d() {
37
+ var e;
38
+ (e = t.value) == null || e.blur();
39
+ }
40
+ function z() {
41
+ var e;
42
+ (e = t.value) == null || e.select();
43
+ }
44
+ function R(e) {
45
+ var o;
46
+ (o = t.value) == null || o.clear(e);
47
+ }
48
+ function S() {
49
+ var e;
50
+ (e = t.value) == null || e.resizeTextarea();
51
+ }
52
+ return a({
53
+ input: i,
54
+ textarea: c,
55
+ ref: p,
56
+ textareaStyle: f,
57
+ autosize: m,
58
+ isComposing: v,
59
+ passwordVisible: _,
60
+ focus: x,
61
+ blur: d,
62
+ select: z,
63
+ clear: R,
64
+ resizeTextarea: S
65
+ }), (e, o) => (y(), w(r(F), P({
66
+ ref_key: "inputRef",
67
+ ref: t
68
+ }, r(u)), T({ _: 2 }, [
69
+ A(r(l), ($, n) => ({
70
+ name: n,
71
+ fn: B((b) => [
72
+ E(e.$slots, n, I(V(b || {})))
73
+ ])
74
+ }))
75
+ ]), 1040));
76
+ }
77
+ });
78
+ export {
79
+ D as default
80
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./FormElInput.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,28 @@
1
+ import { defineComponent as g, Comment as i, mergeProps as d, cloneVNode as x, Fragment as P } from "vue";
2
+ function l(n) {
3
+ return n ? n.flatMap((r) => r.type === P ? l(r.children) : [r]) : [];
4
+ }
5
+ const y = g({
6
+ name: "PrimitiveSlot",
7
+ inheritAttrs: !1,
8
+ setup(n, { attrs: r, slots: f }) {
9
+ return () => {
10
+ var a, c;
11
+ if (!f.default) return null;
12
+ const p = l(f.default()), o = p.findIndex((s) => s.type !== i);
13
+ if (o === -1) return p;
14
+ const e = p[o];
15
+ (a = e == null ? void 0 : e.props) == null || delete a.ref;
16
+ const u = e != null && e.props ? d(r, e == null ? void 0 : e.props) : r;
17
+ r.class && ((c = e == null ? void 0 : e.props) != null && c.class) && delete e.props.class;
18
+ const t = x(e, u);
19
+ for (const s in u)
20
+ s.startsWith("on") && (t.props || (t.props = {}), t.props[s] = u[s]);
21
+ return p.length === 1 ? t : (p[o] = t, p);
22
+ };
23
+ }
24
+ });
25
+ export {
26
+ y as Slot,
27
+ l as renderSlotFragments
28
+ };
@@ -0,0 +1,57 @@
1
+ import { ElColorPicker as d, ElCascader as f, ElUpload as u, ElTreeSelect as O, ElTimePicker as N, ElSwitch as P, ElSelectV2 as M, ElSelect as b, ElRadioGroup as C, ElRadio as _, ElInputNumber as T, ElDatePicker as k, ElCheckboxGroup as S, ElCheckboxButton as h, ElCheckbox as A } from "element-plus";
2
+ import { TtSelect as L } from "@dazhicheng-ui/components/tt-select";
3
+ import { TtPanelSelect as R } from "@dazhicheng-ui/components/tt-panel-select";
4
+ import { TtUpload as y } from "@dazhicheng-ui/components/tt-upload";
5
+ import { TtApiComponent as D } from "@dazhicheng-ui/components/tt-api-component";
6
+ import { globalShareState as F } from "./shared/global-state.js";
7
+ import { defineRule as I } from "vee-validate";
8
+ import U from "./components/FormElInput.vue.js";
9
+ const p = "modelValue", x = {}, V = {
10
+ TtSelect: L,
11
+ TtUpload: y,
12
+ ElCheckbox: A,
13
+ ElCheckboxButton: h,
14
+ ElCheckboxGroup: S,
15
+ ElDatePicker: k,
16
+ ElInput: U,
17
+ ElInputNumber: T,
18
+ ElRadio: _,
19
+ ElRadioGroup: C,
20
+ ElSelect: b,
21
+ ElSelectV2: M,
22
+ ElSwitch: P,
23
+ ElTimePicker: N,
24
+ ElTreeSelect: O,
25
+ ElUpload: u,
26
+ ElCascader: f,
27
+ ElColorPicker: d,
28
+ TtApiComponent: D,
29
+ TtPanelSelect: R
30
+ }, c = {
31
+ ElUpload: "fileList"
32
+ };
33
+ function H(s) {
34
+ const { config: e, defineRules: l } = s, {
35
+ disabledOnChangeListener: a = !0,
36
+ disabledOnInputListener: i = !0,
37
+ emptyStateValue: E = void 0
38
+ } = e || {};
39
+ if (Object.assign(x, {
40
+ disabledOnChangeListener: a,
41
+ disabledOnInputListener: i,
42
+ emptyStateValue: E
43
+ }), l)
44
+ for (const o of Object.keys(l))
45
+ I(o, l[o]);
46
+ const n = (e == null ? void 0 : e.baseModelPropName) ?? p, r = e == null ? void 0 : e.modelPropNameMap, m = F.getComponents();
47
+ for (const o of Object.keys(m)) {
48
+ const t = o;
49
+ V[t] = m[o], n !== p && (c[t] = n), r && r[t] && (c[t] = r[t]);
50
+ }
51
+ }
52
+ export {
53
+ c as COMPONENT_BIND_EVENT_MAP,
54
+ V as COMPONENT_MAP,
55
+ x as DEFAULT_FORM_COMMON_CONFIG,
56
+ H as setupForm
57
+ };
@@ -0,0 +1,16 @@
1
+ import { defineComponent as o, createBlock as t, openBlock as r, unref as n, withCtx as l, renderSlot as a } from "vue";
2
+ import { Slot as f } from "../components/Slot.js";
3
+ const c = /* @__PURE__ */ o({
4
+ __name: "FormControl",
5
+ setup(m) {
6
+ return (e, p) => (r(), t(n(f), null, {
7
+ default: l(() => [
8
+ a(e.$slots, "default")
9
+ ]),
10
+ _: 3
11
+ }));
12
+ }
13
+ });
14
+ export {
15
+ c as default
16
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./FormControl.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,21 @@
1
+ import { defineComponent as n, createElementBlock as p, openBlock as m, normalizeClass as c, unref as e, renderSlot as i } from "vue";
2
+ import { clnm as l } from "@dazhicheng/utils";
3
+ import { useFormField as a } from "./useFormField.js";
4
+ const d = ["id"], x = /* @__PURE__ */ n({
5
+ __name: "FormDescription",
6
+ props: {
7
+ class: {}
8
+ },
9
+ setup(o) {
10
+ const t = o, { formDescriptionId: r } = a();
11
+ return (s, f) => (m(), p("span", {
12
+ id: e(r),
13
+ class: c(e(l)("text-muted-foreground text-12px h-18px line-height-18px empty:h-0", t.class))
14
+ }, [
15
+ i(s.$slots, "default")
16
+ ], 10, d));
17
+ }
18
+ });
19
+ export {
20
+ x as default
21
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./FormDescription.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,20 @@
1
+ import { defineComponent as t, useId as n, provide as m, createElementBlock as c, openBlock as l, normalizeClass as a, unref as p, renderSlot as i } from "vue";
2
+ import { clnm as d } from "@dazhicheng/utils";
3
+ import { FORM_ITEM_INJECTION_KEY as f } from "./injectionKeys.js";
4
+ const C = /* @__PURE__ */ t({
5
+ __name: "FormItem",
6
+ props: {
7
+ class: {}
8
+ },
9
+ setup(e) {
10
+ const o = e, r = n();
11
+ return m(f, r), (s, _) => (l(), c("div", {
12
+ class: a(p(d)(o.class))
13
+ }, [
14
+ i(s.$slots, "default")
15
+ ], 2));
16
+ }
17
+ });
18
+ export {
19
+ C as default
20
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./FormItem.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,19 @@
1
+ import { defineComponent as s, createElementBlock as l, openBlock as n, normalizeClass as t, unref as a, renderSlot as c } from "vue";
2
+ import { clnm as m } from "@dazhicheng/utils";
3
+ const i = /* @__PURE__ */ s({
4
+ __name: "FormLabel",
5
+ props: {
6
+ class: {}
7
+ },
8
+ setup(e) {
9
+ const o = e;
10
+ return (r, p) => (n(), l("label", {
11
+ class: t(a(m)(o.class))
12
+ }, [
13
+ c(r.$slots, "default")
14
+ ], 2));
15
+ }
16
+ });
17
+ export {
18
+ i as default
19
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./FormLabel.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,18 @@
1
+ import { defineComponent as t, createBlock as s, openBlock as a, unref as e, toValue as m } from "vue";
2
+ import { ErrorMessage as n } from "vee-validate";
3
+ import { useFormField as c } from "./useFormField.js";
4
+ const d = /* @__PURE__ */ t({
5
+ __name: "FormMessage",
6
+ setup(p) {
7
+ const { formMessageId: r, name: o } = c();
8
+ return (i, u) => (a(), s(e(n), {
9
+ id: e(r),
10
+ name: m(e(o)),
11
+ as: "p",
12
+ class: "text-[12px] text-destructive"
13
+ }, null, 8, ["id", "name"]));
14
+ }
15
+ });
16
+ export {
17
+ d as default
18
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./FormMessage.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,30 @@
1
+ import { defineComponent as n, createBlock as f, openBlock as s, unref as e, toValue as o, withCtx as i, createVNode as p } from "vue";
2
+ import l from "@dazhicheng-ui/components/tt-form-item-error-tooltip";
3
+ import { ErrorMessage as d } from "vee-validate";
4
+ import { useFormField as c } from "./useFormField.js";
5
+ const M = /* @__PURE__ */ n({
6
+ __name: "FormMessageToolTip",
7
+ props: {
8
+ refDom: {}
9
+ },
10
+ setup(u) {
11
+ const { formMessageId: m, name: r, error: t } = c();
12
+ return (a, _) => (s(), f(e(d), {
13
+ id: e(m),
14
+ name: o(e(r))
15
+ }, {
16
+ default: i(() => [
17
+ p(e(l), {
18
+ "ref-dom": a.refDom,
19
+ "err-msg": e(t),
20
+ "field-name": o(e(r)),
21
+ placement: "right"
22
+ }, null, 8, ["ref-dom", "err-msg", "field-name"])
23
+ ]),
24
+ _: 1
25
+ }, 8, ["id", "name"]));
26
+ }
27
+ });
28
+ export {
29
+ M as default
30
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./FormMessageToolTip.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,31 @@
1
+ import { isObject as c, isFunction as e } from "@dazhicheng/utils";
2
+ import { defineComponent as m, h as u } from "vue";
3
+ import { useFormValues as f } from "vee-validate";
4
+ import { injectRenderFormProps as s } from "../form-render/context.js";
5
+ const j = m({
6
+ name: "RenderContent",
7
+ inheritAttrs: !1,
8
+ props: {
9
+ /**
10
+ * The content to render.
11
+ */
12
+ content: {
13
+ default: void 0,
14
+ type: [Object, String, Function]
15
+ }
16
+ },
17
+ setup(n, { attrs: t, slots: o }) {
18
+ const r = f(), i = s().form;
19
+ return () => n.content ? (c(n.content) || e(n.content)) && n.content !== null ? e(n.content) ? n.content(r.value, i) : u(n.content, {
20
+ ...t,
21
+ props: {
22
+ ...n,
23
+ ...t
24
+ },
25
+ slots: o
26
+ }) : n.content : null;
27
+ }
28
+ });
29
+ export {
30
+ j as default
31
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./RenderContent.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,4 @@
1
+ const t = Symbol("tthk");
2
+ export {
3
+ t as FORM_ITEM_INJECTION_KEY
4
+ };
@@ -0,0 +1,24 @@
1
+ import { FieldContextKey as d, useIsFieldValid as m, useIsFieldTouched as n, useIsFieldDirty as f, useFieldError as l } from "vee-validate";
2
+ import { inject as r } from "vue";
3
+ import { FORM_ITEM_INJECTION_KEY as u } from "./injectionKeys.js";
4
+ function a() {
5
+ const i = r(d), t = r(u);
6
+ if (!i) throw new Error("useFormField should be used within <FormField>");
7
+ const { name: e } = i, o = t, s = {
8
+ error: l(e),
9
+ isDirty: f(e),
10
+ isTouched: n(e),
11
+ valid: m(e)
12
+ };
13
+ return {
14
+ formDescriptionId: `${o}-form-item-description`,
15
+ formItemId: `${o}-form-item`,
16
+ formMessageId: `${o}-form-item-message`,
17
+ id: o,
18
+ name: e,
19
+ ...s
20
+ };
21
+ }
22
+ export {
23
+ a as useFormField
24
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./FormField.vue2.js";
2
+ export {
3
+ f as default
4
+ };