vft 0.0.507 → 0.0.509

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 (160) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/carousel/use-carousel.js +1 -1
  3. package/es/components/cascader/cascader.vue2.js +203 -202
  4. package/es/components/cascader-panel/menu.vue2.js +50 -49
  5. package/es/components/clamp-toggle/clamp-toggle.vue2.js +21 -17
  6. package/es/components/color-picker/color-picker.vue2.js +134 -133
  7. package/es/components/config-provider/config-provider.vue.d.ts +2 -0
  8. package/es/components/config-provider/config-provider.vue2.js +5 -4
  9. package/es/components/config-provider/constants.d.ts +1 -0
  10. package/es/components/config-provider/constants.js +3 -2
  11. package/es/components/config-provider/hooks/use-global-config.js +33 -30
  12. package/es/components/config-provider/index.d.ts +9 -0
  13. package/es/components/config-provider/index.js +6 -5
  14. package/es/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
  15. package/es/components/date-picker/composables/use-basic-date-table.js +124 -123
  16. package/es/components/date-picker/composables/use-month-range-header.js +15 -14
  17. package/es/components/date-picker/composables/use-panel-date-range.js +24 -23
  18. package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +39 -38
  19. package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +39 -38
  20. package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +179 -178
  21. package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +225 -224
  22. package/es/components/date-time-select/date-time-select.vue2.js +39 -36
  23. package/es/components/dropdown/dropdown.vue2.js +68 -67
  24. package/es/components/empty/empty.vue2.js +39 -38
  25. package/es/components/full-screen/full-screen.vue2.js +18 -17
  26. package/es/components/image/image.vue2.js +60 -59
  27. package/es/components/image-viewer/image-viewer.vue2.js +45 -44
  28. package/es/components/index.js +161 -160
  29. package/es/components/input/input.vue2.js +4 -4
  30. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  31. package/es/components/md-container/md-container.vue2.js +75 -74
  32. package/es/components/md-container/toc.js +37 -36
  33. package/es/components/modal/modal-footer-action.vue2.js +25 -24
  34. package/es/components/multiple-tabs/multiple-tabs.vue2.js +16 -15
  35. package/es/components/multiple-tabs/use/use-tab-dropdown.js +54 -53
  36. package/es/components/pagination/components/jumper.vue2.js +29 -28
  37. package/es/components/pagination/components/sizes.vue2.js +21 -20
  38. package/es/components/pagination/components/total.vue2.js +11 -10
  39. package/es/components/popconfirm/popconfirm.vue2.js +40 -39
  40. package/es/components/search/search.vue2.js +79 -77
  41. package/es/components/select/useSelect.js +232 -231
  42. package/es/components/super-form/super-form-action.vue2.js +41 -40
  43. package/es/components/super-form/super-form-item.vue2.js +206 -203
  44. package/es/components/super-form/use/helper.d.ts +1 -1
  45. package/es/components/super-form/use/helper.js +62 -62
  46. package/es/components/table/field.js +130 -110
  47. package/es/components/table/table.vue2.js +152 -150
  48. package/es/components/table/use/use-columns.js +29 -26
  49. package/es/components/table/use/use-data-source.js +87 -86
  50. package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +66 -65
  51. package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +134 -133
  52. package/es/components/transfer/transfer-panel.vue2.js +57 -56
  53. package/es/components/transfer/transfer.vue2.js +70 -69
  54. package/es/components/tree/tree.vue2.js +60 -59
  55. package/es/components/upload/index.d.ts +3 -3
  56. package/es/components/upload/upload-content.vue.d.ts +2 -2
  57. package/es/components/upload/upload-content.vue2.js +78 -75
  58. package/es/components/upload/upload-list.vue2.js +46 -45
  59. package/es/components/upload/upload.vue.d.ts +2 -2
  60. package/es/components/upload/upload.vue2.js +87 -85
  61. package/es/components/upload/utils.js +29 -29
  62. package/es/constants/date.d.ts +1 -1
  63. package/es/constants/date.js +9 -1
  64. package/es/hooks/use-z-index/index.js +3 -3
  65. package/es/index.d.ts +1 -0
  66. package/es/index.js +5 -1
  67. package/es/locale/index.d.js +1 -0
  68. package/es/locale/index.d.ts +26 -0
  69. package/es/locale/index.js +10 -0
  70. package/es/locale/lang/en.d.ts +183 -0
  71. package/es/locale/lang/en.js +241 -0
  72. package/es/locale/lang/zh-cn.d.ts +183 -0
  73. package/es/locale/lang/zh-cn.js +241 -0
  74. package/es/locale/lang/zh-tw.d.ts +183 -0
  75. package/es/locale/lang/zh-tw.js +241 -0
  76. package/es/locale/use-locale.d.ts +17 -0
  77. package/es/locale/use-locale.js +56 -0
  78. package/es/package.json.d.ts +1 -1
  79. package/es/package.json.js +1 -1
  80. package/es/utils/vue/vnode.js +1 -1
  81. package/lib/components/cascader/cascader.vue2.cjs +1 -1
  82. package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
  83. package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
  84. package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
  85. package/lib/components/config-provider/config-provider.vue.d.ts +2 -0
  86. package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
  87. package/lib/components/config-provider/constants.cjs +1 -1
  88. package/lib/components/config-provider/constants.d.ts +1 -0
  89. package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
  90. package/lib/components/config-provider/index.cjs +1 -1
  91. package/lib/components/config-provider/index.d.ts +9 -0
  92. package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
  93. package/lib/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
  94. package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
  95. package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
  96. package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
  97. package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
  98. package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
  99. package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
  100. package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
  101. package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
  102. package/lib/components/empty/empty.vue2.cjs +1 -1
  103. package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
  104. package/lib/components/image/image.vue2.cjs +1 -1
  105. package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
  106. package/lib/components/index.cjs +1 -1
  107. package/lib/components/input/input.vue2.cjs +1 -1
  108. package/lib/components/md-container/md-container.vue2.cjs +1 -1
  109. package/lib/components/md-container/toc.cjs +1 -1
  110. package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
  111. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  112. package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
  113. package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
  114. package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
  115. package/lib/components/pagination/components/total.vue2.cjs +1 -1
  116. package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
  117. package/lib/components/search/search.vue2.cjs +1 -1
  118. package/lib/components/select/useSelect.cjs +1 -1
  119. package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
  120. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  121. package/lib/components/super-form/use/helper.cjs +1 -1
  122. package/lib/components/super-form/use/helper.d.ts +1 -1
  123. package/lib/components/table/field.cjs +1 -1
  124. package/lib/components/table/table.vue2.cjs +1 -1
  125. package/lib/components/table/use/use-columns.cjs +1 -1
  126. package/lib/components/table/use/use-data-source.cjs +1 -1
  127. package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
  128. package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
  129. package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
  130. package/lib/components/transfer/transfer.vue2.cjs +1 -1
  131. package/lib/components/tree/tree.vue2.cjs +1 -1
  132. package/lib/components/upload/index.d.ts +3 -3
  133. package/lib/components/upload/upload-content.vue.d.ts +2 -2
  134. package/lib/components/upload/upload-content.vue2.cjs +1 -1
  135. package/lib/components/upload/upload-list.vue2.cjs +1 -1
  136. package/lib/components/upload/upload.vue.d.ts +2 -2
  137. package/lib/components/upload/upload.vue2.cjs +1 -1
  138. package/lib/components/upload/utils.cjs +1 -1
  139. package/lib/constants/date.cjs +1 -1
  140. package/lib/constants/date.d.ts +1 -1
  141. package/lib/index.cjs +1 -1
  142. package/lib/index.d.ts +1 -0
  143. package/lib/locale/index.cjs +1 -0
  144. package/lib/locale/index.d.cjs +1 -0
  145. package/lib/locale/index.d.ts +26 -0
  146. package/lib/locale/lang/en.cjs +1 -0
  147. package/lib/locale/lang/en.d.ts +183 -0
  148. package/lib/locale/lang/zh-cn.cjs +1 -0
  149. package/lib/locale/lang/zh-cn.d.ts +183 -0
  150. package/lib/locale/lang/zh-tw.cjs +1 -0
  151. package/lib/locale/lang/zh-tw.d.ts +183 -0
  152. package/lib/locale/use-locale.cjs +1 -0
  153. package/lib/locale/use-locale.d.ts +17 -0
  154. package/lib/package.json.cjs +1 -1
  155. package/lib/package.json.d.ts +1 -1
  156. package/package.json +3 -3
  157. package/theme-style/index.css +1 -1
  158. package/theme-style/src/super-form.scss +0 -1
  159. package/theme-style/vft-super-form.css +1 -1
  160. package/web-types.json +1 -1
@@ -1,4 +1,4 @@
1
- import { defineComponent as me, ref as G, computed as H, watch as J, onMounted as Pe, nextTick as O, unref as d, useSlots as ke, createVNode as f, mergeProps as U, withDirectives as Ce, vShow as Se, isVNode as ve, createTextVNode as ie, resolveComponent as X } from "vue";
1
+ import { defineComponent as fe, ref as X, computed as B, watch as Y, onMounted as ke, nextTick as U, unref as d, useSlots as Ce, createVNode as f, mergeProps as z, withDirectives as Se, vShow as ve, isVNode as xe, createTextVNode as ne, resolveComponent as Z } from "vue";
2
2
  import "../alert/index.js";
3
3
  import "../avatar/index.js";
4
4
  import "../avatar-stack/index.js";
@@ -13,24 +13,24 @@ import "../clamp/index.js";
13
13
  import "../client-only/index.js";
14
14
  import "../clamp-toggle/index.js";
15
15
  import "../clamp-tooltip/index.js";
16
- import { VftCol as ne } from "../col/index.js";
16
+ import { VftCol as ae } from "../col/index.js";
17
17
  import "../collapse-transition/index.js";
18
18
  import "../color-picker/index.js";
19
19
  import "../config-provider/index.js";
20
20
  import "../container/index.js";
21
- import { isBoolean as Z, isFunction as k, singleAttrToObj as ae, isNullOrUndefined as xe, isArray as _, cloneDeep as Ae, isNull as Re, upperFirst as we, isString as Me } from "@vft/utils";
21
+ import { isBoolean as _, isFunction as C, singleAttrToObj as se, isNullOrUndefined as Ae, isArray as ee, cloneDeep as Re, isNull as we, upperFirst as Me, isString as Te } from "@vft/utils";
22
22
  import "../context-menu/context-menu.vue2.js";
23
23
  import { VftIcon as le } from "../icon/index.js";
24
24
  import "../date-picker/index.js";
25
25
  import "../date-time-select/index.js";
26
26
  import "../descriptions/index.js";
27
27
  import "../dialog/index.js";
28
- import { VftDivider as Ie } from "../divider/index.js";
28
+ import { VftDivider as De } from "../divider/index.js";
29
29
  import "../drawer/index.js";
30
30
  import "../dropdown/index.js";
31
31
  import "../empty/index.js";
32
32
  import "../footer-layout/index.js";
33
- import { VftFormItem as Te } from "../form/index.js";
33
+ import { VftFormItem as Ie } from "../form/index.js";
34
34
  import "../full-screen/index.js";
35
35
  import "../header-layout/index.js";
36
36
  import "../horizontal-menu/index.js";
@@ -70,7 +70,7 @@ import "../table/index.js";
70
70
  import "../tabs/index.js";
71
71
  import "../tag/index.js";
72
72
  import "../time-picker/index.js";
73
- import { VftTooltip as De } from "../tooltip/index.js";
73
+ import { VftTooltip as qe } from "../tooltip/index.js";
74
74
  import "../tree/index.js";
75
75
  import "../tree-select/index.js";
76
76
  import "../verify-code/index.js";
@@ -100,26 +100,27 @@ import "../md-container/index.js";
100
100
  import "../md-tabs/index.js";
101
101
  import "../md-vue-playground/index.js";
102
102
  import "../infinite-scroll/index.js";
103
- import { FormCompEnum as t, getComponent as se } from "../../utils/form-register.js";
103
+ import { FormCompEnum as t, getComponent as ce } from "../../utils/form-register.js";
104
104
  import "@vueuse/core";
105
105
  import "../config-provider/hooks/use-global-config.js";
106
- import { debounce as qe } from "lodash-es";
107
- import { useNamespace as Ke } from "../../hooks/use-namespace/index.js";
106
+ import { debounce as Ke } from "lodash-es";
107
+ import { useNamespace as Le } from "../../hooks/use-namespace/index.js";
108
108
  import "../../hooks/use-model-toggle/index.js";
109
109
  import "@popperjs/core";
110
110
  import "../../hooks/use-z-index/index.js";
111
111
  import "../message/index.js";
112
112
  import "../progress-i/index.js";
113
113
  import "./index.js";
114
- import { isRangePicker as Fe, isInput as Le, isDatePicker as Ve } from "./component-map.js";
115
- import { createPlaceholderMessage as ce } from "./use/helper.js";
116
- function ee(e) {
117
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ve(e);
114
+ import { isRangePicker as Fe, isInput as Ve, isDatePicker as $e } from "./component-map.js";
115
+ import { createPlaceholderMessage as me } from "./use/helper.js";
116
+ import { useLocale as je } from "../../locale/use-locale.js";
117
+ function te(e) {
118
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !xe(e);
118
119
  }
119
- const je = me({
120
+ const Be = fe({
120
121
  inheritAttrs: !1
121
- }), Wo = /* @__PURE__ */ me({
122
- ...je,
122
+ }), Qo = /* @__PURE__ */ fe({
123
+ ...Be,
123
124
  __name: "super-form-item",
124
125
  props: {
125
126
  schema: {},
@@ -131,7 +132,9 @@ const je = me({
131
132
  formActionType: {}
132
133
  },
133
134
  setup(e) {
134
- const q = Ke("super-form"), F = G(), P = H(() => {
135
+ const {
136
+ t: b
137
+ } = je(), K = Le("super-form"), F = X(), k = B(() => {
135
138
  const {
136
139
  mergeDynamicData: r
137
140
  } = e.formProps;
@@ -147,15 +150,15 @@ const je = me({
147
150
  elRef: F,
148
151
  formActionType: e.formActionType
149
152
  };
150
- }), fe = /* @__PURE__ */ new Set([t.Select, t.Radio, t.Checkbox, t.RadioButton, t.CheckboxButton, t.Cascader, t.AutoComplete]), L = /* @__PURE__ */ new Set([t.Select, t.Radio, t.RadioButton, t.Checkbox, t.CheckboxButton, t.Cascader, t.AutoComplete]), z = /* @__PURE__ */ new Set([t.Tree, t.TreeSelect]), Y = () => e.schema.type && fe.has(e.schema.type) ? {
153
+ }), ue = /* @__PURE__ */ new Set([t.Select, t.Radio, t.Checkbox, t.RadioButton, t.CheckboxButton, t.Cascader, t.AutoComplete]), V = /* @__PURE__ */ new Set([t.Select, t.Radio, t.RadioButton, t.Checkbox, t.CheckboxButton, t.Cascader, t.AutoComplete]), E = /* @__PURE__ */ new Set([t.Tree, t.TreeSelect]), Q = () => e.schema.type && ue.has(e.schema.type) ? {
151
154
  options: []
152
- } : {}, p = G(Y());
153
- async function ue() {
155
+ } : {}, p = X(Q());
156
+ async function de() {
154
157
  const {
155
158
  componentProps: r = {}
156
159
  } = e.schema;
157
- if (k(r)) {
158
- const o = Y();
160
+ if (C(r)) {
161
+ const o = Q();
159
162
  p.value = o;
160
163
  try {
161
164
  const i = r({
@@ -166,38 +169,38 @@ const je = me({
166
169
  ...o,
167
170
  ...n ?? {}
168
171
  };
169
- L.has(e.schema.type) && (!a.options || !Array.isArray(a.options)) && (a.options = []), p.value = a;
172
+ V.has(e.schema.type) && (!a.options || !Array.isArray(a.options)) && (a.options = []), p.value = a;
170
173
  } catch (i) {
171
- console.error("componentProps 执行错误:", i), p.value = Y();
174
+ console.error("componentProps 执行错误:", i), p.value = Q();
172
175
  }
173
176
  } else
174
- p.value = r, L.has(e.schema.type) && (!p.value.options || !Array.isArray(p.value.options)) && (p.value.options = []);
177
+ p.value = r, V.has(e.schema.type) && (!p.value.options || !Array.isArray(p.value.options)) && (p.value.options = []);
175
178
  }
176
- J(() => e.schema.componentProps, (r, o) => (r || o) && ue(), {
179
+ Y(() => e.schema.componentProps, (r, o) => (r || o) && de(), {
177
180
  immediate: !0
178
- }), Pe(() => {
181
+ }), ke(() => {
179
182
  if (e.schema.type === t.Tree) {
180
183
  const r = e.formModel[e.schema.field], o = p.value, i = o?.defaultCheckedKeys, n = o?.includeHalfChecked;
181
- i && Array.isArray(i) && i.length > 0 && (!r || !Array.isArray(r) || r.length === 0) && (n ? O(() => {
184
+ i && Array.isArray(i) && i.length > 0 && (!r || !Array.isArray(r) || r.length === 0) && (n ? U(() => {
182
185
  if (F.value) {
183
186
  const a = F.value;
184
187
  if (a?.getHalfCheckedKeys) {
185
188
  const u = [...a.getHalfCheckedKeys() || [], ...i];
186
189
  e.setFormModel(e.schema.field, u, e.schema);
187
- const C = Symbol.for(`${e.schema.field}_checkedKeys`);
188
- e.formModel[C] = [...i];
190
+ const S = Symbol.for(`${e.schema.field}_checkedKeys`);
191
+ e.formModel[S] = [...i];
189
192
  } else
190
193
  e.setFormModel(e.schema.field, [...i], e.schema);
191
194
  }
192
195
  }) : e.setFormModel(e.schema.field, [...i], e.schema));
193
196
  }
194
197
  });
195
- let A = null;
196
- const N = G(!1), $ = async (r, o) => {
198
+ let R = null;
199
+ const H = X(!1), N = async (r, o) => {
197
200
  try {
198
201
  const i = {
199
202
  ...p.value
200
- }, n = L.has(e.schema.type);
203
+ }, n = V.has(e.schema.type);
201
204
  p.value = {
202
205
  ...i,
203
206
  loading: !0,
@@ -206,7 +209,7 @@ const je = me({
206
209
  options: []
207
210
  } : {}
208
211
  };
209
- const a = await r(d(P)), {
212
+ const a = await r(d(k)), {
210
213
  type: m
211
214
  } = e.schema, u = n ? Array.isArray(a) ? a : [] : a;
212
215
  n ? p.value = {
@@ -214,7 +217,7 @@ const je = me({
214
217
  options: u,
215
218
  requestResult: a,
216
219
  loading: !1
217
- } : z.has(m) ? p.value = {
220
+ } : E.has(m) ? p.value = {
218
221
  ...i,
219
222
  data: Array.isArray(a) ? a : a || [],
220
223
  requestResult: a,
@@ -223,10 +226,10 @@ const je = me({
223
226
  ...i,
224
227
  requestResult: a,
225
228
  loading: !1
226
- }, o && await o(a, d(P));
229
+ }, o && await o(a, d(k));
227
230
  } catch (i) {
228
231
  console.error("fetchRemoteData 执行错误:", i);
229
- const n = L.has(e.schema.type), a = z.has(e.schema.type);
232
+ const n = V.has(e.schema.type), a = E.has(e.schema.type);
230
233
  p.value = {
231
234
  ...p.value,
232
235
  loading: !1,
@@ -240,13 +243,13 @@ const je = me({
240
243
  } : {}
241
244
  };
242
245
  } finally {
243
- await O();
246
+ await U();
244
247
  }
245
- }, te = () => {
248
+ }, oe = () => {
246
249
  const r = p.value?.request;
247
250
  if (r)
248
- if (k(r))
249
- $(r);
251
+ if (C(r))
252
+ N(r);
250
253
  else {
251
254
  const {
252
255
  watchFields: o = [],
@@ -258,40 +261,40 @@ const je = me({
258
261
  if (!a) return;
259
262
  const u = Array.isArray(o) && o.length > 0;
260
263
  if (i?.immediate && !u) {
261
- N.value || (N.value = !0, $(a, m));
264
+ H.value || (H.value = !0, N(a, m));
262
265
  return;
263
266
  }
264
267
  const {
265
- immediate: C,
268
+ immediate: S,
266
269
  ...h
267
- } = i, y = o.map((s) => () => e.formModel[s]), g = n > 0 ? qe(() => {
268
- $(a, m);
270
+ } = i, y = o.map((l) => () => e.formModel[l]), g = n > 0 ? Ke(() => {
271
+ N(a, m);
269
272
  }, n) : () => {
270
- $(a, m);
273
+ N(a, m);
271
274
  };
272
- A = J(y, g, h), i?.immediate && (N.value || (N.value = !0, $(a, m)));
275
+ R = Y(y, g, h), i?.immediate && (H.value || (H.value = !0, N(a, m)));
273
276
  }
274
- }, de = H(() => E());
275
- J(de, (r, o) => {
276
- r.isIfShow && r.isShow && (o == null || !o.isIfShow || !o.isShow) ? O(() => {
277
- A && (A(), A = null), te();
278
- }) : (!r.isIfShow || !r.isShow) && (N.value = !1, A && (A(), A = null));
277
+ }, he = B(() => W());
278
+ Y(he, (r, o) => {
279
+ r.isIfShow && r.isShow && (o == null || !o.isIfShow || !o.isShow) ? U(() => {
280
+ R && (R(), R = null), oe();
281
+ }) : (!r.isIfShow || !r.isShow) && (H.value = !1, R && (R(), R = null));
279
282
  }, {
280
283
  immediate: !0
281
- }), J(() => p.value?.request, () => {
284
+ }), Y(() => p.value?.request, () => {
282
285
  const {
283
286
  isIfShow: r,
284
287
  isShow: o
285
- } = E();
286
- r && o && O(() => {
287
- A && (A(), A = null), te();
288
+ } = W();
289
+ r && o && U(() => {
290
+ R && (R(), R = null), oe();
288
291
  });
289
292
  });
290
- const K = H(() => {
293
+ const L = B(() => {
291
294
  let r = {
292
295
  ...p.value
293
296
  };
294
- if (L.has(e.schema.type) && (!r.options || !Array.isArray(r.options)) && (r.options = []), z.has(e.schema.type) && (!r.data || !Array.isArray(r.data)) && (r.data = []), e.schema.type === t.Tree) {
297
+ if (V.has(e.schema.type) && (!r.options || !Array.isArray(r.options)) && (r.options = []), E.has(e.schema.type) && (!r.data || !Array.isArray(r.data)) && (r.data = []), e.schema.type === t.Tree) {
295
298
  const n = e.formModel[e.schema.field];
296
299
  if (Array.isArray(n) && r.data?.length > 0)
297
300
  if (r.includeHalfChecked) {
@@ -328,47 +331,47 @@ const je = me({
328
331
  }], [t.TimeRangePicker, {
329
332
  type: t.TimePicker,
330
333
  "is-range": !0,
331
- "start-placeholder": "开始时间",
332
- "end-placeholder": "结束时间"
334
+ "start-placeholder": b("startTime"),
335
+ "end-placeholder": b("endTime")
333
336
  }], [t.DateTimeRangePicker, {
334
337
  type: t.DateTimeRangePicker,
335
- "start-placeholder": "开始日期",
336
- "end-placeholder": "结束日期"
338
+ "start-placeholder": b("startDate"),
339
+ "end-placeholder": b("endDate")
337
340
  }], [t.DateRangePicker, {
338
341
  type: t.DateRangePicker,
339
- "start-placeholder": "开始日期",
340
- "end-placeholder": "结束日期"
342
+ "start-placeholder": b("startDate"),
343
+ "end-placeholder": b("endDate")
341
344
  }], [t.MonthRangePicker, {
342
345
  type: t.MonthRangePicker,
343
- "start-placeholder": "开始月份",
344
- "end-placeholder": "结束月份"
346
+ "start-placeholder": b("startMonth"),
347
+ "end-placeholder": b("endMonth")
345
348
  }]]);
346
349
  e.schema.type && o.has(e.schema.type) && (r = Object.assign(o.get(e.schema.type) || {}, r));
347
350
  const i = r;
348
- return e.formProps.inputMaxLength && e.schema.type === t.Input && !i?.maxlength && (i.maxlength = e.formProps.inputMaxLength), L.has(e.schema.type) && (!i.options || !Array.isArray(i.options)) && (i.options = []), z.has(e.schema.type) && (!i.data || !Array.isArray(i.data)) && (i.data = []), i;
349
- }), he = H(() => {
351
+ return e.formProps.inputMaxLength && e.schema.type === t.Input && !i?.maxlength && (i.maxlength = e.formProps.inputMaxLength), V.has(e.schema.type) && (!i.options || !Array.isArray(i.options)) && (i.options = []), E.has(e.schema.type) && (!i.data || !Array.isArray(i.data)) && (i.data = []), i;
352
+ }), pe = B(() => {
350
353
  const {
351
354
  disabled: r
352
355
  } = e.formProps, {
353
356
  dynamicDisabled: o
354
357
  } = e.schema, {
355
358
  disabled: i = !1
356
- } = d(K);
359
+ } = d(L);
357
360
  let n = !!r || i;
358
- return Z(o) && (n = o), k(o) && (n = o(d(P))), n;
361
+ return _(o) && (n = o), C(o) && (n = o(d(k))), n;
359
362
  });
360
- function E() {
363
+ function W() {
361
364
  const {
362
365
  show: r,
363
366
  ifShow: o
364
367
  } = e.schema;
365
368
  let i = !0, n = !0;
366
- return Z(r) && (i = r), Z(o) && (n = o), k(r) && (i = r(d(P))), k(o) && (n = o(d(P))), {
369
+ return _(r) && (i = r), _(o) && (n = o), C(r) && (i = r(d(k))), C(o) && (n = o(d(k))), {
367
370
  isShow: i,
368
371
  isIfShow: n
369
372
  };
370
373
  }
371
- function pe() {
374
+ function ye() {
372
375
  const {
373
376
  rules: r = [],
374
377
  type: o = t.Input,
@@ -377,48 +380,48 @@ const je = me({
377
380
  title: a,
378
381
  dynamicRule: m,
379
382
  required: u,
380
- dynamicRuleAdd: C = !0
381
- } = e.schema, h = k(u) ? u(d(P)) : u, y = e.formModel[e.schema.field];
382
- if (!h && (xe(y) || y === "" || _(y) && !y.length))
383
+ dynamicRuleAdd: S = !0
384
+ } = e.schema, h = C(u) ? u(d(k)) : u, y = e.formModel[e.schema.field];
385
+ if (!h && (Ae(y) || y === "" || ee(y) && !y.length))
383
386
  return [];
384
387
  const g = n || a;
385
- if (k(m) && !C)
386
- return m(d(P));
387
- let s = Ae(_(r) ? r : [r]);
388
+ if (C(m) && !S)
389
+ return m(d(k));
390
+ let l = Re(ee(r) ? r : [r]);
388
391
  const {
389
- rulesMessageJoinLabel: R
390
- } = e.formProps, b = Reflect.has(e.schema, "rulesMessageJoinLabel") ? i : R, w = ce(o, `${b ? g : ""}`);
391
- function M(l, c) {
392
- const x = l.message || w;
393
- return c === void 0 || Re(c) || o === t.CheckboxSingle && !c || Array.isArray(c) && c.length === 0 || typeof c == "string" && c.trim() === "" || typeof c == "object" && Reflect.has(c, "checked") && Reflect.has(c, "halfChecked") && Array.isArray(c.checked) && Array.isArray(c.halfChecked) && c.checked.length === 0 && c.halfChecked.length === 0 ? Promise.reject(x) : Promise.resolve();
392
+ rulesMessageJoinLabel: w
393
+ } = e.formProps, P = Reflect.has(e.schema, "rulesMessageJoinLabel") ? i : w, M = b(me(o, `${P ? g : ""}`));
394
+ function T(s, c) {
395
+ const A = s.message || M;
396
+ return c === void 0 || we(c) || o === t.CheckboxSingle && !c || Array.isArray(c) && c.length === 0 || typeof c == "string" && c.trim() === "" || typeof c == "object" && Reflect.has(c, "checked") && Reflect.has(c, "halfChecked") && Array.isArray(c.checked) && Array.isArray(c.halfChecked) && c.checked.length === 0 && c.halfChecked.length === 0 ? Promise.reject(A) : Promise.resolve();
394
397
  }
395
- const V = [t.Radio, t.Select, t.RadioSingle, t.RadioButton, t.Checkbox, t.CheckboxSingle, t.CheckboxButton, t.AutoComplete, t.Cascader, t.ColorPicker, t.Upload, t.Slider].includes(o);
396
- (!s || s.length === 0 || h) && (s = [{
398
+ const $ = [t.Radio, t.Select, t.RadioSingle, t.RadioButton, t.Checkbox, t.CheckboxSingle, t.CheckboxButton, t.AutoComplete, t.Cascader, t.ColorPicker, t.Upload, t.Slider].includes(o);
399
+ (!l || l.length === 0 || h) && (l = [{
397
400
  required: h,
398
- validator: M,
399
- trigger: V ? "change" : "blur"
400
- }, ...s]);
401
- const W = s.findIndex((l) => Reflect.has(l, "required") && !Reflect.has(l, "validator"));
402
- if (W !== -1) {
403
- const l = s[W], {
401
+ validator: T,
402
+ trigger: $ ? "change" : "blur"
403
+ }, ...l]);
404
+ const J = l.findIndex((s) => Reflect.has(s, "required") && !Reflect.has(s, "validator"));
405
+ if (J !== -1) {
406
+ const s = l[J], {
404
407
  isShow: c
405
- } = E();
406
- c || (l.required = !1), o && (l.message = l.message || w);
408
+ } = W();
409
+ c || (s.required = !1), o && (s.message = s.message || M);
407
410
  }
408
- const v = s.findIndex((l) => l.min), D = s.findIndex((l) => l.max);
409
- function j(l, c, x = "all") {
410
- const S = s[c], B = S.isNumber ? isNaN(l) ? l?.length || 0 : Number(l) : l?.length || 0;
411
- return ["min", "all"].includes(x) && B < S.min ? Promise.reject(`${g}至少为${S.min}位`) : ["max", "all"].includes(x) && B > S.max ? Promise.reject(`${g}最多${S.max}位`) : Promise.resolve();
411
+ const x = l.findIndex((s) => s.min), q = l.findIndex((s) => s.max);
412
+ function j(s, c, A = "all") {
413
+ const v = l[c], O = v.isNumber ? isNaN(s) ? s?.length || 0 : Number(s) : s?.length || 0;
414
+ return ["min", "all"].includes(A) && O < v.min ? Promise.reject(`${g}${b("atLeast")}${v.min}${b("characters")}`) : ["max", "all"].includes(A) && O > v.max ? Promise.reject(`${g}${b("atMost")}${v.max}${b("characters")}`) : Promise.resolve();
412
415
  }
413
- (v !== -1 || D !== -1) && (v !== -1 && D !== -1 && !s[v].validator && !s[v].message ? s[v].validator = (l, c) => j(c, v) : v !== -1 && !s[v].validator && !s[v].message ? s[v].validator = (l, c) => j(c, v, "min") : D !== -1 && !s[D].validator && !s[D].message && (s[D].validator = (l, c) => j(c, D, "max")));
414
- const T = s.findIndex((l) => l.len);
415
- if (T !== -1 && (s[T].validator = (l, c) => c?.length !== s[T].len ? Promise.reject(`${g}必须是${s[T].len}位`) : Promise.resolve()), k(m) && C) {
416
- let l = m(d(P));
417
- l = _(l) ? l : [l], s = s.concat(l);
416
+ (x !== -1 || q !== -1) && (x !== -1 && q !== -1 && !l[x].validator && !l[x].message ? l[x].validator = (s, c) => j(c, x) : x !== -1 && !l[x].validator && !l[x].message ? l[x].validator = (s, c) => j(c, x, "min") : q !== -1 && !l[q].validator && !l[q].message && (l[q].validator = (s, c) => j(c, q, "max")));
417
+ const I = l.findIndex((s) => s.len);
418
+ if (I !== -1 && (l[I].validator = (s, c) => c?.length !== l[I].len ? Promise.reject(`${g}${b("mustBe")}${l[I].len}${b("characters")}`) : Promise.resolve()), C(m) && S) {
419
+ let s = m(d(k));
420
+ s = ee(s) ? s : [s], l = l.concat(s);
418
421
  }
419
- return s;
422
+ return l;
420
423
  }
421
- const ye = () => {
424
+ const ge = () => {
422
425
  const {
423
426
  renderComponentContent: r,
424
427
  type: o = t.Input,
@@ -427,95 +430,95 @@ const je = me({
427
430
  valueField: a,
428
431
  label: m,
429
432
  title: u,
430
- placeholderJoinLabel: C = !0
433
+ placeholderJoinLabel: S = !0
431
434
  } = e.schema;
432
435
  let h = n;
433
- Le(o) ? h = "input" : Ve(o) || o === t.TimePicker || o === t.InputTag || o === t.AutoComplete || o === t.Cascader || o === t.ColorPicker || o === t.Slider || o === t.TreeSelect ? h = "update:modelValue" : o === t.Upload ? h = "update:fileList" : o === t.Tree && (h = "check");
434
- const y = `on${we(h)}`, g = se(o), {
435
- autoSetPlaceHolder: s,
436
- size: R
437
- } = e.formProps, b = {
436
+ Ve(o) ? h = "input" : $e(o) || o === t.TimePicker || o === t.InputTag || o === t.AutoComplete || o === t.Cascader || o === t.ColorPicker || o === t.Slider || o === t.TreeSelect ? h = "update:modelValue" : o === t.Upload ? h = "update:fileList" : o === t.Tree && (h = "check");
437
+ const y = `on${Me(h)}`, g = ce(o), {
438
+ autoSetPlaceHolder: l,
439
+ size: w
440
+ } = e.formProps, P = {
438
441
  clearable: !0,
439
- ...d(K)
442
+ ...d(L)
440
443
  };
441
- if (o !== t.Search && (b.size = d(K)?.size || R, b.disabled = d(he)), !b.disabled && s && !Fe(o) && o) {
442
- const l = m || u;
443
- b.placeholder = d(K)?.placeholder || ce(o, C && Me(l) ? l : "");
444
+ if (o !== t.Search && (P.size = d(L)?.size || w, P.disabled = d(pe)), !P.disabled && l && !Fe(o) && o) {
445
+ const s = m || u;
446
+ P.placeholder = d(L)?.placeholder || b(me(o, S && Te(s) ? s : ""));
444
447
  }
445
- const M = b[y], I = b.onClear, V = {
446
- [y]: (...l) => {
447
- const [c] = l;
448
- let x;
448
+ const T = P[y], D = P.onClear, $ = {
449
+ [y]: (...s) => {
450
+ const [c] = s;
451
+ let A;
449
452
  if (o === t.Tree && h === "check") {
450
- const [, S] = l, B = d(K)?.includeHalfChecked;
451
- if (B ? x = [...S?.halfCheckedKeys || [], ...S?.checkedKeys || []] : x = S?.checkedKeys || [], B) {
452
- const be = Symbol.for(`${i}_checkedKeys`);
453
- e.formModel[be] = S?.checkedKeys || [];
453
+ const [, v] = s, O = d(L)?.includeHalfChecked;
454
+ if (O ? A = [...v?.halfCheckedKeys || [], ...v?.checkedKeys || []] : A = v?.checkedKeys || [], O) {
455
+ const Pe = Symbol.for(`${i}_checkedKeys`);
456
+ e.formModel[Pe] = v?.checkedKeys || [];
454
457
  }
455
458
  } else {
456
- const S = c ? c.target : null;
457
- x = S ? S.value : c;
459
+ const v = c ? c.target : null;
460
+ A = v ? v.value : c;
458
461
  }
459
- e.setFormModel(i, x, e.schema), M && k(M) && O(() => {
460
- M(...l);
462
+ e.setFormModel(i, A, e.schema), T && C(T) && U(() => {
463
+ T(...s);
461
464
  });
462
465
  },
463
466
  // 监听 clear 事件,清除错误信息
464
- onClear: (...l) => {
467
+ onClear: (...s) => {
465
468
  e.updateSchema([{
466
469
  field: i,
467
470
  itemProps: {
468
471
  error: ""
469
472
  }
470
- }]), e.formActionType?.clearValidate?.(i), I && k(I) && I(...l);
473
+ }]), e.formActionType?.clearValidate?.(i), D && C(D) && D(...s);
471
474
  }
472
- }, W = o === t.Tree ? {} : {
475
+ }, J = o === t.Tree ? {} : {
473
476
  [a || "model-value"]: e.formModel[i]
474
477
  }, {
475
- [y]: v,
476
- ...D
477
- } = b, j = {
478
- ...D,
479
- ...V,
480
- ...W
478
+ [y]: x,
479
+ ...q
480
+ } = P, j = {
481
+ ...q,
482
+ ...$,
483
+ ...J
481
484
  };
482
485
  if (!r && o !== t.Upload)
483
- return f(g, U({
486
+ return f(g, z({
484
487
  ref: F
485
488
  }, j), null);
486
- let T;
487
- if (T = k(r) ? {
489
+ let I;
490
+ if (I = C(r) ? {
488
491
  ...r({
489
- ...d(P),
492
+ ...d(k),
490
493
  elRef: F
491
494
  })
492
495
  } : {
493
496
  default: () => r
494
497
  }, o === t.Upload && !r) {
495
498
  const {
496
- drag: l
497
- } = d(K);
498
- T = l ? {
499
- default: () => f(X("vft-icon"), {
499
+ drag: s
500
+ } = d(L);
501
+ I = s ? {
502
+ default: () => f(Z("vft-icon"), {
500
503
  icon: "icon-arrow-upload"
501
504
  }, null)
502
505
  } : {
503
- default: () => f(X("vft-button"), {
506
+ default: () => f(Z("vft-button"), {
504
507
  type: "primary"
505
508
  }, {
506
- default: () => [f(X("vft-icon"), {
509
+ default: () => [f(Z("vft-icon"), {
507
510
  icon: "icon-arrow-upload"
508
511
  }, null)]
509
512
  })
510
513
  };
511
514
  }
512
- return f(g, U({
515
+ return f(g, z({
513
516
  ref: F
514
- }, j), ee(T) ? T : {
515
- default: () => [T]
517
+ }, j), te(I) ? I : {
518
+ default: () => [I]
516
519
  });
517
520
  };
518
- function Q() {
521
+ function G() {
519
522
  const {
520
523
  showLabel: r = !0,
521
524
  label: o,
@@ -524,50 +527,50 @@ const je = me({
524
527
  labelRequired: a,
525
528
  helpIcon: m,
526
529
  helpTooltip: u,
527
- labelSuffix: C
530
+ labelSuffix: S
528
531
  } = e.schema, {
529
532
  labelSuffix: h = ""
530
- } = e.formProps, y = C ?? h, g = o || i, s = g ? f("span", null, [a && f("span", {
533
+ } = e.formProps, y = S ?? h, g = o || i, l = g ? f("span", null, [a && f("span", {
531
534
  class: "label-required"
532
- }, [ie("*")]), f("span", null, [g]), y && f("span", {
533
- class: q.m("label-suffix")
534
- }, [y])]) : null, R = () => {
535
+ }, [ne("*")]), f("span", null, [g]), y && f("span", {
536
+ class: K.m("label-suffix")
537
+ }, [y])]) : null, w = () => {
535
538
  if (!m && !u) return null;
536
- const b = H(() => ae(m, "icon", {
539
+ const P = B(() => se(m, "icon", {
537
540
  size: 20,
538
541
  pointer: !0,
539
542
  icon: "icon-help"
540
543
  }));
541
544
  if (u) {
542
- const w = H(() => ae(u, "content", {
545
+ const M = B(() => se(u, "content", {
543
546
  placement: "right-start"
544
547
  }));
545
- return f(De, U({
548
+ return f(qe, z({
546
549
  className: "box-item"
547
- }, w.value), {
548
- default: () => [f(le, b.value, null)]
550
+ }, M.value), {
551
+ default: () => [f(le, P.value, null)]
549
552
  });
550
553
  }
551
- return f(le, b.value, null);
554
+ return f(le, P.value, null);
552
555
  };
553
- return r && s ? n ? f("div", {
556
+ return r && l ? n ? f("div", {
554
557
  class: "label-content"
555
- }, [f("div", null, [s, ie(" "), f("span", {
558
+ }, [f("div", null, [l, ne(" "), f("span", {
556
559
  class: "sub-label"
557
- }, [n])]), R()]) : f("div", {
560
+ }, [n])]), w()]) : f("div", {
558
561
  class: "label-content"
559
- }, [f("div", null, [s]), R()]) : void 0;
562
+ }, [f("div", null, [l]), w()]) : void 0;
560
563
  }
561
- const oe = ke();
562
- function re(r, o = "default", i) {
564
+ const re = Ce();
565
+ function ie(r, o = "default", i) {
563
566
  if (!r || !Reflect.has(r, o))
564
567
  return null;
565
- if (!k(r[o]))
568
+ if (!C(r[o]))
566
569
  return console.error(`${o} is not a function!`), null;
567
570
  const n = r[o];
568
571
  return n ? n(i) : null;
569
572
  }
570
- function ge() {
573
+ function be() {
571
574
  const {
572
575
  required: r,
573
576
  itemProps: o,
@@ -576,48 +579,48 @@ const je = me({
576
579
  field: a,
577
580
  suffix: m,
578
581
  prefix: u,
579
- prefixParentStyle: C
582
+ prefixParentStyle: S
580
583
  } = e.schema, {
581
584
  autoCleanErrorMessage: h,
582
585
  compFullWidth: y
583
- } = e.formProps, g = () => i ? re(oe, i, d(P)) : n ? n(d(P)) : ye(), s = !!m, R = !!u, b = k(m) ? m(d(P)) : m, w = k(u) ? u(d(P)) : u, M = () => {
586
+ } = e.formProps, g = () => i ? ie(re, i, d(k)) : n ? n(d(k)) : ge(), l = !!m, w = !!u, P = C(m) ? m(d(k)) : m, M = C(u) ? u(d(k)) : u, T = () => {
584
587
  e.updateSchema([{
585
588
  field: a,
586
589
  itemProps: {
587
590
  error: ""
588
591
  }
589
592
  }]);
590
- }, I = k(r) ? r(d(P)) : r, V = () => f(Te, U({
593
+ }, D = C(r) ? r(d(k)) : r, $ = () => f(Ie, z({
591
594
  style: {
592
595
  marginRight: e.formProps.customLayout ? "10px" : 0
593
596
  },
594
597
  prop: a,
595
598
  class: [{
596
- [q.is("suffix")]: s
599
+ [K.is("suffix")]: l
597
600
  }, {
598
- [q.is("comp-full-width")]: y
599
- }, q.e("item")]
601
+ [K.is("comp-full-width")]: y
602
+ }, K.e("item")]
600
603
  }, o, {
601
604
  label: o?.label || o?.title,
602
- "onUpdate:error": h ? M : () => {
605
+ "onUpdate:error": h ? T : () => {
603
606
  },
604
- rules: pe(),
605
- required: I
607
+ rules: ye(),
608
+ required: D
606
609
  }), {
607
610
  default: () => [f("div", {
608
- class: q.e("container")
611
+ class: K.e("container")
609
612
  }, [f("div", {
610
- class: q.e("content")
611
- }, [g(), s && f("span", {
612
- class: q.m("suffix")
613
- }, [b])])])],
614
- label: Q() ? () => Q() : void 0
613
+ class: K.e("content")
614
+ }, [g(), l && f("span", {
615
+ class: K.m("suffix")
616
+ }, [P])])])],
617
+ label: G() ? () => G() : void 0
615
618
  });
616
- return R ? f("div", {
617
- style: C
619
+ return w ? f("div", {
620
+ style: S
618
621
  }, [f("span", {
619
- class: q.m("prefix")
620
- }, [w]), V()]) : V();
622
+ class: K.m("prefix")
623
+ }, [M]), $()]) : $();
621
624
  }
622
625
  return () => {
623
626
  let r;
@@ -629,44 +632,44 @@ const je = me({
629
632
  render: m,
630
633
  quickColSpan: u
631
634
  } = e.schema;
632
- if (!se(a) && !n && !m)
635
+ if (!ce(a) && !n && !m)
633
636
  return null;
634
637
  const {
635
- baseColProps: C = {},
638
+ baseColProps: S = {},
636
639
  quickColSpan: h
637
640
  } = e.formProps, y = h ? {
638
641
  span: Math.ceil(24 / h),
639
- ...C
642
+ ...S
640
643
  } : {
641
- ...C
644
+ ...S
642
645
  }, g = u ? {
643
646
  span: Math.ceil(24 / u),
644
647
  ...o
645
648
  } : {
646
649
  ...o
647
- }, s = {
650
+ }, l = {
648
651
  ...y,
649
652
  ...g
650
653
  }, {
651
- isIfShow: R,
652
- isShow: b
653
- } = E(), w = d(P), M = () => i ? re(oe, i, w) : n ? n(w) : ge();
654
+ isIfShow: w,
655
+ isShow: P
656
+ } = W(), M = d(k), T = () => i ? ie(re, i, M) : n ? n(M) : be();
654
657
  if (a === t.Divider) {
655
- let I;
656
- return f(ne, U({
658
+ let D;
659
+ return f(ae, z({
657
660
  span: 24
658
661
  }, g), {
659
- default: () => [f(Ie, d(K), ee(I = Q()) ? I : {
660
- default: () => [I]
662
+ default: () => [f(De, d(L), te(D = G()) ? D : {
663
+ default: () => [D]
661
664
  })]
662
665
  });
663
666
  }
664
- return R && (e.formProps.customLayout ? M() : Ce(f(ne, s, ee(r = M()) ? r : {
667
+ return w && (e.formProps.customLayout ? T() : Se(f(ae, l, te(r = T()) ? r : {
665
668
  default: () => [r]
666
- }), [[Se, b]]));
669
+ }), [[ve, P]]));
667
670
  };
668
671
  }
669
672
  });
670
673
  export {
671
- Wo as default
674
+ Qo as default
672
675
  };