@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,199 @@
1
+ import { defineComponent as H, mergeModels as D, useModel as J, useAttrs as Q, useSlots as W, ref as u, computed as g, unref as t, watch as X, createBlock as Y, openBlock as E, resolveDynamicComponent as Z, mergeProps as ee, createSlots as te, renderList as ae, withCtx as P, renderSlot as oe, normalizeProps as le, guardReactiveProps as ne, createElementBlock as ie, createCommentVNode as re, normalizeClass as se, createVNode as $, nextTick as de } from "vue";
2
+ import { ElIcon as ue } from "element-plus";
3
+ import { Loading as fe } from "@element-plus/icons-vue";
4
+ import { useDesign as ce } from "@dazhicheng/hooks";
5
+ import { isEqual as pe, get as h, cloneDeep as L } from "lodash-es";
6
+ import { isFunction as y } from "@dazhicheng/utils";
7
+ import { objectOmit as _ } from "@vueuse/core";
8
+ const Se = /* @__PURE__ */ H({
9
+ name: "ApiComponent",
10
+ inheritAttrs: !1,
11
+ __name: "index",
12
+ props: /* @__PURE__ */ D({
13
+ component: {},
14
+ numberToString: { type: Boolean, default: !1 },
15
+ api: { type: Function, default: void 0 },
16
+ params: { default: () => ({}) },
17
+ resultField: { default: "" },
18
+ labelField: { default: "label" },
19
+ childrenField: { default: "" },
20
+ valueField: { default: "value" },
21
+ disabledField: { default: "disabled" },
22
+ optionsPropName: { default: "options" },
23
+ immediate: { type: Boolean, default: !0 },
24
+ alwaysLoad: { type: Boolean, default: !1 },
25
+ beforeFetch: { type: Function, default: void 0 },
26
+ afterFetch: { type: Function, default: void 0 },
27
+ options: { default: () => [] },
28
+ loadingSlot: { default: "" },
29
+ visibleEvent: { default: "" },
30
+ modelPropName: { default: "modelValue" },
31
+ autoSelect: { type: [String, Function, Boolean], default: !1 }
32
+ }, {
33
+ modelValue: { default: void 0 },
34
+ modelModifiers: {}
35
+ }),
36
+ emits: /* @__PURE__ */ D(["optionsChange", "change"], ["update:modelValue"]),
37
+ setup(w, { expose: z, emit: M }) {
38
+ const { prefixCls: T } = ce("api-component"), a = w, C = M, f = J(w, "modelValue"), j = Q(), q = W(), k = u({}), m = u([]), c = u(!1), b = u(!1), F = u(!1), o = g(() => {
39
+ var O;
40
+ const { labelField: e, valueField: n, disabledField: i, childrenField: l, numberToString: r } = a, s = t(m);
41
+ function S(v) {
42
+ return v.map((d) => {
43
+ const R = h(d, n);
44
+ return {
45
+ ..._(d, [e, n, i, l].filter(Boolean)),
46
+ label: h(d, e),
47
+ value: r ? `${R}` : R,
48
+ disabled: h(d, i),
49
+ ...l && d[l] ? { children: S(d[l]) } : {}
50
+ };
51
+ });
52
+ }
53
+ const N = S(s), G = (O = a.options) != null && O.every((v) => Reflect.has(v, "value") && Reflect.has(v, "label")) ? a.options : S(a.options);
54
+ return N.length > 0 ? N : G;
55
+ }), x = g(() => ({
56
+ [a.modelPropName]: t(f),
57
+ [a.optionsPropName]: t(o),
58
+ [`onUpdate:${a.modelPropName}`]: (e) => {
59
+ f.value = e;
60
+ },
61
+ ..._(j, [`onUpdate:${a.modelPropName}`]),
62
+ ...a.visibleEvent ? {
63
+ [a.visibleEvent]: U
64
+ } : {},
65
+ /**
66
+ * Element Plus 的 ElSelect / ElSelectV2 等:`loading` 插槽仅在 `props.loading === true` 时才会渲染,
67
+ * 需与内部请求态同步,否则插槽内容永远不会显示。
68
+ */
69
+ ...a.loadingSlot ? { loading: t(c) } : {}
70
+ }));
71
+ async function p() {
72
+ const { api: e, beforeFetch: n, afterFetch: i, resultField: l } = a;
73
+ if (!(!e || !y(e))) {
74
+ if (c.value) {
75
+ F.value = !0;
76
+ return;
77
+ }
78
+ m.value = [];
79
+ try {
80
+ c.value = !0;
81
+ let r = t(V);
82
+ n && y(n) && (r = await n(L(r)) || r);
83
+ let s = await e(r);
84
+ if (i && y(i) && (s = await i(s) || s), b.value = !0, Array.isArray(s)) {
85
+ m.value = s, A();
86
+ return;
87
+ }
88
+ l && (m.value = h(s, l) || []), A();
89
+ } catch {
90
+ b.value = !1;
91
+ } finally {
92
+ c.value = !1, F.value && (F.value = !1, await de(), p());
93
+ }
94
+ }
95
+ }
96
+ async function U(e) {
97
+ e && (a.alwaysLoad ? await p() : !a.immediate && !t(b) && await p());
98
+ }
99
+ const V = g(() => ({
100
+ ...a.params,
101
+ ...t(k)
102
+ }));
103
+ X(
104
+ V,
105
+ (e, n) => {
106
+ pe(e, n) || p();
107
+ },
108
+ { deep: !0, immediate: a.immediate }
109
+ );
110
+ function A() {
111
+ if (f.value === void 0 && a.autoSelect && t(o).length > 0) {
112
+ let e;
113
+ if (y(a.autoSelect))
114
+ e = a.autoSelect(t(o));
115
+ else
116
+ switch (a.autoSelect) {
117
+ case "first": {
118
+ e = t(o)[0];
119
+ break;
120
+ }
121
+ case "last": {
122
+ e = t(o)[t(o).length - 1];
123
+ break;
124
+ }
125
+ case "one": {
126
+ t(o).length === 1 && (e = t(o)[0]);
127
+ break;
128
+ }
129
+ }
130
+ e && (f.value = e.value);
131
+ }
132
+ C("optionsChange", t(o));
133
+ }
134
+ function I(e) {
135
+ var n, i;
136
+ C(
137
+ "change",
138
+ e,
139
+ L(t(o)),
140
+ Array.isArray(e) ? (n = t(o)) == null ? void 0 : n.filter((l) => e.some((r) => r === l.value)) : (i = t(o)) == null ? void 0 : i.find((l) => l.value === e)
141
+ );
142
+ }
143
+ const B = u(null), K = g(
144
+ () => Object.keys(q).filter((e) => e !== a.loadingSlot)
145
+ );
146
+ return z({
147
+ /** 获取options数据 */
148
+ getOptions: () => t(o),
149
+ /** 获取当前值 */
150
+ getValue: () => t(f),
151
+ /**
152
+ * 获取被包装组件的实例
153
+ */
154
+ getComponentRef: () => B.value,
155
+ /** 更新Api参数 */
156
+ updateParam(e) {
157
+ k.value = e;
158
+ },
159
+ /** 手动请求数据 */
160
+ reload: p
161
+ }), (e, n) => (E(), Y(Z(e.component), ee({
162
+ ref_key: "componentRef",
163
+ ref: B
164
+ }, x.value, {
165
+ placeholder: e.$attrs.placeholder,
166
+ onChange: I
167
+ }), te({ _: 2 }, [
168
+ ae(K.value, (i) => ({
169
+ name: i,
170
+ fn: P((l) => [
171
+ oe(e.$slots, i, le(ne(l || {})), void 0, !0)
172
+ ])
173
+ })),
174
+ e.loadingSlot ? {
175
+ name: e.loadingSlot,
176
+ fn: P(() => [
177
+ c.value ? (E(), ie("div", {
178
+ key: 0,
179
+ class: se(`${t(T)}__dropdown-loading`)
180
+ }, [
181
+ $(t(ue), {
182
+ class: "is-loading",
183
+ size: 20
184
+ }, {
185
+ default: P(() => [
186
+ $(t(fe))
187
+ ]),
188
+ _: 1
189
+ })
190
+ ], 2)) : re("", !0)
191
+ ]),
192
+ key: "0"
193
+ } : void 0
194
+ ]), 1040, ["placeholder"]));
195
+ }
196
+ });
197
+ export {
198
+ Se as default
199
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./TtArea.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-116cb5cb"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,36 @@
1
+ import { defineComponent as i, ref as l, computed as r, createElementBlock as p, openBlock as m, createElementVNode as e, withDirectives as a, vModelText as u, toDisplayString as v } from "vue";
2
+ import { add as _ } from "@dazhicheng/utils";
3
+ const c = { class: "tt-area" }, f = { class: "num" }, x = { class: "num" }, y = { class: "sum" }, N = { "data-testid": "result" }, D = /* @__PURE__ */ i({
4
+ __name: "TtArea",
5
+ setup(V) {
6
+ const s = l(1), n = l(2), d = r(() => _(+s.value, +n.value));
7
+ return (b, t) => (m(), p("div", c, [
8
+ e("div", f, [
9
+ t[2] || (t[2] = e("span", null, "Number 1", -1)),
10
+ a(e("input", {
11
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => s.value = o),
12
+ "data-testid": "n1",
13
+ type: "text"
14
+ }, null, 512), [
15
+ [u, s.value]
16
+ ])
17
+ ]),
18
+ e("div", x, [
19
+ t[3] || (t[3] = e("span", null, "Number 2", -1)),
20
+ a(e("input", {
21
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => n.value = o),
22
+ "data-testid": "n2",
23
+ type: "text"
24
+ }, null, 512), [
25
+ [u, n.value]
26
+ ])
27
+ ]),
28
+ e("div", y, [
29
+ e("span", N, "sum:" + v(d.value), 1)
30
+ ])
31
+ ]));
32
+ }
33
+ });
34
+ export {
35
+ D as default
36
+ };
@@ -0,0 +1,24 @@
1
+ import { defineComponent as m, useSlots as c, createBlock as i, openBlock as a, resolveDynamicComponent as u, h as e, unref as t } from "vue";
2
+ import { TtIcon as p } from "@dazhicheng-ui/components/tt-icon";
3
+ import f from "../index.vue.js";
4
+ import l from "@dazhicheng-ui/assets/svg/add.svg?raw";
5
+ const T = /* @__PURE__ */ m({
6
+ name: "TtAddButton",
7
+ inheritAttrs: !1,
8
+ __name: "AddButton",
9
+ setup(d) {
10
+ const n = c();
11
+ return (s, _) => (a(), i(u(
12
+ e(f, s.$attrs, () => {
13
+ var o, r;
14
+ return [
15
+ e(t(p), { icon: t(l), isCustomSvg: !0, size: 20, class: "color-inherit! mr-[1px]" }),
16
+ (r = (o = t(n)).default) == null ? void 0 : r.call(o)
17
+ ];
18
+ })
19
+ )));
20
+ }
21
+ });
22
+ export {
23
+ T as default
24
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./AddButton.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,9 @@
1
+ import { withInstall as t } from "@dazhicheng/utils";
2
+ import o from "./index.vue.js";
3
+ import r from "./components/AddButton.vue.js";
4
+ const f = t(o), i = t(r);
5
+ export {
6
+ i as TtAddButton,
7
+ f as TtButton,
8
+ f as default
9
+ };
@@ -0,0 +1,7 @@
1
+ import t from "./index.vue2.js";
2
+ /* empty css */
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-c14bbb20"]]);
5
+ export {
6
+ p as default
7
+ };
@@ -0,0 +1,68 @@
1
+ import { defineComponent as b, useAttrs as g, ref as l, computed as k, withDirectives as v, createBlock as h, openBlock as C, unref as t, mergeProps as _, createSlots as x, renderList as D, withCtx as P, renderSlot as R, normalizeProps as S, guardReactiveProps as T } from "vue";
2
+ import "lodash-es";
3
+ import "@vueuse/core";
4
+ import "../tt-icon/index.js";
5
+ import $ from "../../directives/disabled-tip/index.js";
6
+ import { ElButton as j } from "element-plus";
7
+ import { useDesign as w } from "@dazhicheng/hooks";
8
+ import { isArray as z, isObject as A } from "@dazhicheng/utils";
9
+ const J = /* @__PURE__ */ b({
10
+ name: "TtButton",
11
+ __name: "index",
12
+ props: {
13
+ size: {},
14
+ disabled: { type: Boolean },
15
+ type: {},
16
+ icon: {},
17
+ nativeType: {},
18
+ loading: { type: Boolean },
19
+ loadingIcon: {},
20
+ plain: { type: Boolean },
21
+ text: { type: Boolean },
22
+ link: { type: Boolean },
23
+ bg: { type: Boolean },
24
+ autofocus: { type: Boolean },
25
+ round: { type: Boolean },
26
+ circle: { type: Boolean },
27
+ dashed: { type: Boolean },
28
+ color: {},
29
+ dark: { type: Boolean },
30
+ autoInsertSpace: { type: Boolean },
31
+ tag: {},
32
+ iconFont: {}
33
+ },
34
+ emits: ["click"],
35
+ setup(p, { expose: c, emit: d }) {
36
+ const n = p, u = d, i = g(), r = l(!1), f = k(() => {
37
+ const e = i["disabled-tip"];
38
+ return z(e) && e.length > 0 ? e.some((o) => !!(o != null && o.condition)) : A(e) ? !!e.condition : !!n.disabled;
39
+ }), a = l(null), { prefixCls: m } = w("button");
40
+ async function y(e) {
41
+ u("click", e, (o) => {
42
+ r.value = o || !1;
43
+ });
44
+ }
45
+ return c({
46
+ buttonRef: a
47
+ }), (e, o) => v((C(), h(t(j), _({
48
+ ref_key: "buttonRef",
49
+ ref: a,
50
+ class: [t(m)]
51
+ }, { ...n, ...e.$attrs, disabled: f.value }, {
52
+ loading: r.value || n.loading,
53
+ onClick: y
54
+ }), x({ _: 2 }, [
55
+ D(Object.keys(e.$slots), (s) => ({
56
+ name: s,
57
+ fn: P((B) => [
58
+ R(e.$slots, s, S(T(B || {})), void 0, !0)
59
+ ])
60
+ }))
61
+ ]), 1040, ["class", "loading"])), [
62
+ [t($), t(i)["disabled-tip"]]
63
+ ]);
64
+ }
65
+ });
66
+ export {
67
+ J as default
68
+ };
@@ -0,0 +1,7 @@
1
+ import { withInstall as t } from "@dazhicheng/utils";
2
+ import o from "./index.vue.js";
3
+ const a = t(o);
4
+ export {
5
+ a as TtCheckbox,
6
+ a as default
7
+ };
@@ -0,0 +1,77 @@
1
+ import { defineComponent as v, useAttrs as V, computed as d, ref as u, watch as C, withDirectives as y, createBlock as B, openBlock as k, unref as p, mergeProps as x, createSlots as S, renderList as T, withCtx as j, renderSlot as w, normalizeProps as L, guardReactiveProps as O } from "vue";
2
+ import { isArray as P, isObject as A } from "@dazhicheng/utils";
3
+ import N from "@dazhicheng-ui/directives/disabled-tip";
4
+ import { useFormItem as _, ElCheckbox as z } from "element-plus";
5
+ import { omit as D } from "lodash-es";
6
+ const R = /* @__PURE__ */ v({
7
+ name: "TtCheckbox",
8
+ inheritAttrs: !1,
9
+ __name: "index",
10
+ props: {
11
+ modelValue: { type: [Number, String, Boolean] },
12
+ label: { type: [String, Boolean, Number, Object] },
13
+ value: { type: [String, Boolean, Number, Object] },
14
+ indeterminate: { type: Boolean },
15
+ disabled: { type: Boolean },
16
+ checked: { type: Boolean },
17
+ name: {},
18
+ trueValue: {},
19
+ falseValue: {},
20
+ trueLabel: {},
21
+ falseLabel: {},
22
+ id: {},
23
+ border: { type: Boolean },
24
+ size: {},
25
+ tabindex: {},
26
+ validateEvent: { type: Boolean },
27
+ ariaLabel: {},
28
+ ariaControls: {},
29
+ beforeChange: {},
30
+ disabledTip: {}
31
+ },
32
+ emits: ["update:modelValue", "change"],
33
+ setup(c, { emit: m }) {
34
+ const a = c, i = m, n = V(), b = d(() => {
35
+ if (n.disabled !== void 0)
36
+ return !!n.disabled;
37
+ if (a.disabled)
38
+ return !0;
39
+ const e = a.disabledTip;
40
+ return P(e) && e.length > 0 ? e.some((t) => !!(t != null && t.condition)) : A(e) ? !!e.condition : !1;
41
+ }), f = d(() => ({
42
+ ...a,
43
+ ...D(n, ["onUpdate:modelValue", "onChange", "onInput"]),
44
+ disabled: b.value
45
+ })), l = u(), { formItem: r } = _(), s = u(!1);
46
+ async function h(e) {
47
+ const t = a.modelValue;
48
+ let o = !0;
49
+ a.beforeChange && (o = await a.beforeChange(e, t)), o ? (i("update:modelValue", e), i("change", e, t)) : l.value = t;
50
+ }
51
+ return C(
52
+ () => a.modelValue,
53
+ (e) => {
54
+ l.value = e, s.value && (r == null || r.validate("change").catch((t) => {
55
+ })), s.value = !0;
56
+ },
57
+ { immediate: !0, deep: !0 }
58
+ ), (e, t) => y((k(), B(p(z), x(f.value, {
59
+ modelValue: l.value,
60
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => l.value = o),
61
+ "validate-event": !1,
62
+ onChange: h
63
+ }), S({ _: 2 }, [
64
+ T(Object.keys(e.$slots), (o) => ({
65
+ name: o,
66
+ fn: j((g) => [
67
+ w(e.$slots, o, L(O(g)))
68
+ ])
69
+ }))
70
+ ]), 1040, ["modelValue"])), [
71
+ [p(N), a.disabledTip]
72
+ ]);
73
+ }
74
+ });
75
+ export {
76
+ R as default
77
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,14 @@
1
+ import { withInstall as r } from "@dazhicheng/utils";
2
+ import t from "./src/RenderDrawer.vue.js";
3
+ /* empty css */
4
+ import "vue";
5
+ import "@tanstack/vue-store";
6
+ import "vue-router";
7
+ import "element-plus";
8
+ import "@dazhicheng-ui/hooks/useSetup";
9
+ import "@vueuse/core";
10
+ const l = r(t);
11
+ export {
12
+ l as RenderDrawer,
13
+ l as default
14
+ };
@@ -0,0 +1,156 @@
1
+ import { defineComponent as Y, useAttrs as Z, ref as $, useId as ee, getCurrentInstance as oe, reactive as te, computed as l, unref as o, toValue as r, watch as re, nextTick as se, onMounted as ne, createBlock as B, createCommentVNode as S, openBlock as w, mergeProps as V, createSlots as D, withCtx as i, withDirectives as ie, createVNode as T, createElementBlock as ae, normalizeClass as le, normalizeStyle as ce, renderSlot as c, renderList as ue, normalizeProps as de, guardReactiveProps as me } from "vue";
2
+ import { useDesign as pe, usePriorityValues as fe, getPriorityValues as he } from "@dazhicheng/hooks";
3
+ import { isNumber as ge } from "@dazhicheng/utils";
4
+ import { omit as ke, pick as O } from "lodash-es";
5
+ import { vTtLoading as we } from "@dazhicheng-ui/components/tt-loading";
6
+ import { useStore as be } from "@tanstack/vue-store";
7
+ import { drawerProps as R, ElDrawer as Ce } from "element-plus";
8
+ import ve from "./components/DrawerFooter.vue.js";
9
+ /* empty css */
10
+ import Pe from "./components/DrawerHeader.vue.js";
11
+ import { useDrawerResizable as ye } from "./hooks/useResizable.js";
12
+ import { basicProps as $e } from "./props.js";
13
+ import { DrawerApi as Be } from "./utils/drawer-api.js";
14
+ const Ne = /* @__PURE__ */ Y({
15
+ name: "TtDrawer",
16
+ __name: "RenderDrawer",
17
+ props: {
18
+ ...R,
19
+ ...$e,
20
+ /** drawerApi */
21
+ drawerApi: {
22
+ type: Object,
23
+ default: void 0
24
+ }
25
+ },
26
+ emits: ["visible-change", "register", "update:visible"],
27
+ setup(x, { expose: F, emit: H }) {
28
+ var P;
29
+ const u = x, d = H, m = Z(), p = $(!1), b = ee(), f = $(null), { prefixCls: C } = pe("drawer"), s = oe();
30
+ let t = u.drawerApi;
31
+ t || (t = new Be(u), t.useStore = (e) => be(t.store, e));
32
+ const a = te({
33
+ setDrawerProps: t.setState,
34
+ emitVisible: void 0
35
+ }), z = (P = t.useStore) == null ? void 0 : P.call(t), {
36
+ confirmLoading: A,
37
+ visible: h,
38
+ showFooter: g,
39
+ footerHeight: v,
40
+ cancelButtonProps: L,
41
+ showCancelBtn: _,
42
+ cancelText: N,
43
+ showOkBtn: j,
44
+ okButtonProps: E,
45
+ okText: I,
46
+ title: M,
47
+ loading: U,
48
+ loadingText: q,
49
+ ...G
50
+ } = fe(u, z), J = l(() => {
51
+ const e = he(G), n = ke(m, ["onOk", "onClosed", "onClose", "onVisibleChange", "onReceiveSharedData"]);
52
+ return {
53
+ ...O(e, Object.keys(R)),
54
+ ...n,
55
+ modelValue: o(h),
56
+ class: `${C} ${o(e).class || ""}`,
57
+ modalClass: `${o(e).modalClass || o(e).class}`
58
+ };
59
+ }), K = l(() => ({
60
+ confirmLoading: r(A),
61
+ showFooter: r(g),
62
+ footerHeight: r(v),
63
+ cancelButtonProps: r(L),
64
+ cancelText: r(N),
65
+ showOkBtn: r(j),
66
+ okText: r(I),
67
+ okButtonProps: r(E),
68
+ showCancelBtn: r(_)
69
+ })), Q = l(() => {
70
+ const e = r(v);
71
+ return r(g) && e ? `${ge(e) ? e : Number.parseFloat(e)}px` : "0px";
72
+ }), W = l(() => ({
73
+ height: `calc(100% - ${o(Q)})`
74
+ }));
75
+ re(
76
+ () => h.value,
77
+ (e) => {
78
+ se(() => {
79
+ var n;
80
+ d("update:visible", e), d("visible-change", e), s && ((n = a.emitVisible) == null || n.call(a, e, s == null ? void 0 : s.uid)), e ? p.value = e : (setTimeout(() => {
81
+ p.value = e;
82
+ }, 300), t.changeOkLoading(!1));
83
+ });
84
+ }
85
+ );
86
+ const [X] = ye(b, h, t.setState);
87
+ return s && d("register", a, s == null ? void 0 : s.uid), ne(() => {
88
+ const e = O(m, ["onOk", "onClosed", "onVisibleChange"]);
89
+ t.mount(f.value, {
90
+ ...e,
91
+ // 兼容 BasicDrawer 组件的 onClose 事件
92
+ onClosed: e.onClosed || m.onClose
93
+ });
94
+ }), F({
95
+ drawerRef: f,
96
+ drawerApi: t
97
+ }), (e, n) => p.value ? (w(), B(o(Ce), V({
98
+ key: 0,
99
+ id: o(b),
100
+ ref_key: "drawerRef",
101
+ ref: f
102
+ }, J.value, {
103
+ "destroy-on-close": !0,
104
+ "before-close": o(t).onClosed
105
+ }), D({
106
+ default: i(() => [
107
+ ie((w(), ae("div", {
108
+ style: ce(W.value),
109
+ class: le(`${o(C)}-content`)
110
+ }, [
111
+ c(e.$slots, "default")
112
+ ], 6)), [
113
+ [o(we), {
114
+ visible: o(U),
115
+ text: o(q)
116
+ }]
117
+ ]),
118
+ o(g) || e.$slots.footer ? (w(), B(ve, V({ key: 0 }, K.value, {
119
+ onClose: o(t).onClosed,
120
+ onFooterok: o(t).onOk
121
+ }), D({ _: 2 }, [
122
+ ue(Object.keys(e.$slots), (k) => ({
123
+ name: k,
124
+ fn: i((y) => [
125
+ c(e.$slots, k, de(me(y)))
126
+ ])
127
+ }))
128
+ ]), 1040, ["onClose", "onFooterok"])) : S("", !0),
129
+ T(o(X))
130
+ ]),
131
+ _: 2
132
+ }, [
133
+ e.$slots.header ? {
134
+ name: "header",
135
+ fn: i(() => [
136
+ c(e.$slots, "header")
137
+ ]),
138
+ key: "1"
139
+ } : {
140
+ name: "header",
141
+ fn: i(() => [
142
+ T(Pe, { title: o(M) }, {
143
+ titleToolbar: i(() => [
144
+ c(e.$slots, "titleToolbar")
145
+ ]),
146
+ _: 3
147
+ }, 8, ["title"])
148
+ ]),
149
+ key: "0"
150
+ }
151
+ ]), 1040, ["id", "before-close"])) : S("", !0);
152
+ }
153
+ });
154
+ export {
155
+ Ne as default
156
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./RenderDrawer.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,56 @@
1
+ import { defineComponent as v, inject as I, computed as t, toValue as D, createElementBlock as i, openBlock as o, normalizeStyle as P, normalizeClass as S, unref as n, renderSlot as r, Fragment as V, createBlock as l, createCommentVNode as d, withModifiers as c, withCtx as m, createTextVNode as p, toDisplayString as f, mergeProps as b } from "vue";
2
+ import { useDesign as j } from "@dazhicheng/hooks";
3
+ import { generateTestId as u } from "@dazhicheng/utils";
4
+ import { TtButton as k } from "@dazhicheng-ui/components/tt-button";
5
+ import { footerProps as x } from "../props.js";
6
+ const L = /* @__PURE__ */ v({
7
+ name: "DrawerFooter",
8
+ __name: "DrawerFooter",
9
+ props: x,
10
+ emits: ["close"],
11
+ setup(g, { emit: C }) {
12
+ const s = g, h = C, { prefixCls: w } = j("drawer-footer"), a = I("drawerIdContext", ""), B = t(() => u(a, "btn-confirm")), y = t(() => u(a, "btn-cancel")), F = t(() => ({
13
+ height: `${s.footerHeight}px`,
14
+ padding: "0 12px",
15
+ textAlign: "right"
16
+ })), T = t(() => D(s.okButtonProps) || {});
17
+ function $(e) {
18
+ h("close", e);
19
+ }
20
+ return (e, z) => (o(), i("div", {
21
+ class: S([n(w), "w-full flex items-center justify-end"]),
22
+ style: P(F.value)
23
+ }, [
24
+ e.$slots.footer ? r(e.$slots, "footer", { key: 1 }) : (o(), i(V, { key: 0 }, [
25
+ r(e.$slots, "insertFooter"),
26
+ e.showCancelBtn ? (o(), l(n(k), {
27
+ key: 0,
28
+ "data-testid": y.value,
29
+ onClick: c($, ["stop"])
30
+ }, {
31
+ default: m(() => [
32
+ p(f(e.cancelText), 1)
33
+ ]),
34
+ _: 1
35
+ }, 8, ["data-testid"])) : d("", !0),
36
+ r(e.$slots, "centerFooter"),
37
+ e.showOkBtn ? (o(), l(n(k), b({
38
+ key: 1,
39
+ loading: e.confirmLoading
40
+ }, T.value, {
41
+ "data-testid": B.value,
42
+ onClick: c(e.$attrs.onFooterok, ["stop"])
43
+ }), {
44
+ default: m(() => [
45
+ p(f(e.okText), 1)
46
+ ]),
47
+ _: 1
48
+ }, 16, ["loading", "data-testid", "onClick"])) : d("", !0),
49
+ r(e.$slots, "appendFooter")
50
+ ], 64))
51
+ ], 6));
52
+ }
53
+ });
54
+ export {
55
+ L as default
56
+ };