@dazhicheng/ui 1.6.17 → 1.6.19

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.
@@ -1,10 +1,10 @@
1
- var C = Object.defineProperty;
2
- var V = (h, f, e) => f in h ? C(h, f, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[f] = e;
3
- var l = (h, f, e) => V(h, typeof f != "symbol" ? f + "" : f, e);
1
+ var V = Object.defineProperty;
2
+ var b = (f, h, e) => h in f ? V(f, h, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[h] = e;
3
+ var l = (f, h, e) => b(f, typeof h != "symbol" ? h + "" : h, e);
4
4
  import "axios";
5
5
  import "element-plus";
6
- import { isString as F, isFunction as v, isBoolean as E } from "../../../../packages/utils/src/is.js";
7
- import { ref as b, reactive as A, computed as T, nextTick as R } from "vue";
6
+ import { isString as F, isFunction as v, isBoolean as R } from "../../../../packages/utils/src/is.js";
7
+ import { ref as T, reactive as A, computed as K, nextTick as E, toRaw as C } from "vue";
8
8
  import "dayjs";
9
9
  import "numeral";
10
10
  import "xe-utils";
@@ -15,24 +15,25 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ae
15
15
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
16
16
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
17
17
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
18
- import { isPlainObject as S, get as N, cloneDeep as K, isEqual as H } from "lodash-es";
19
- import { validate as k } from "vee-validate";
20
- import { toTypedSchema as O } from "@vee-validate/zod";
21
- import { FormApi as x } from "../formApi.js";
22
- import { resolveRequiredRuleName as j, resolveValueByFieldName as P } from "../form-render/dependencies.js";
23
- import { resolveArraySchemasForRuntime as W, resolveSchemaFieldInitialValue as $ } from "../useFormContext.js";
24
- import { normalizeArrayFieldPath as _, childArrayPath as I } from "../utils/array-path.js";
25
- import { extractFlatSchemas as g, collectDefaultCollapseStates as M, getGroupValues as q, cloneSchemaTree as y, insertFieldsByPosition as D, removeFieldsFromGroup as B, removeGroupsFromGroup as L, isGroupSchema as z, isRowSchema as X } from "./utils.js";
26
- function Y(h) {
27
- if (h) {
28
- if (F(h))
29
- return h;
30
- if (v(h.safeParse))
31
- return O(h);
32
- }
18
+ import { isPlainObject as S, get as N, cloneDeep as H, isEqual as k } from "lodash-es";
19
+ import { validate as O } from "vee-validate";
20
+ import { toTypedSchema as x } from "@vee-validate/zod";
21
+ import { FormApi as j } from "../formApi.js";
22
+ import { resolveRequiredRuleName as W, resolveValueByFieldName as P } from "../form-render/dependencies.js";
23
+ import { resolveArraySchemasForRuntime as $, resolveSchemaFieldInitialValue as I } from "../useFormContext.js";
24
+ import { normalizeArrayFieldPath as _, childArrayPath as q } from "../utils/array-path.js";
25
+ import { extractFlatSchemas as g, collectDefaultCollapseStates as M, getGroupValues as D, cloneSchemaTree as y, insertFieldsByPosition as B, removeFieldsFromGroup as L, removeGroupsFromGroup as z, isGroupSchema as X, isRowSchema as Y } from "./utils.js";
26
+ function J(f) {
27
+ if (!f)
28
+ return;
29
+ const h = C(f);
30
+ if (F(h))
31
+ return h;
32
+ if (v(h.safeParse))
33
+ return x(h);
33
34
  }
34
- const J = 20;
35
- class ge extends x {
35
+ const Q = 20;
36
+ class ye extends j {
36
37
  /**
37
38
  * @param {TtFormProps} formProps - 底层表单配置(已展平的 schema、layout 等)
38
39
  * @param {GroupFormApiOptions} groupOptions - 分组场景专属配置
@@ -94,7 +95,7 @@ class ge extends x {
94
95
  /** 本轮回环告警是否已输出,避免刷屏 */
95
96
  l(this, "_navSyncLoopWarned", !1);
96
97
  /** VirtualGroupForm 组件实例引用,由 useGroupForm 的 h() 渲染时赋值 */
97
- l(this, "groupFormRef", b(null));
98
+ l(this, "groupFormRef", T(null));
98
99
  /**
99
100
  * @description 响应式读取 store 状态,由 useGroupForm 在运行时注入实现
100
101
  * @param {Function} [selector] - 可选的状态选择器
@@ -112,7 +113,7 @@ class ge extends x {
112
113
  estimateFieldHeight: c = 52,
113
114
  scrollOffset: p = 0
114
115
  } = t;
115
- this.progressive = i, this.virtual = i ? !1 : r, this._defaultNavAnchorProps = { show: !0, ...o }, this._scrollToFirstError = a, this._containerHeight = n, this._rootMargin = u, this._estimateFieldHeight = c, this._scrollOffset = p, this._initialGroupSchema = s, this._initialFlatSchema = g(s), this.collapseStates = A({}), M(s, this.collapseStates), this.hiddenGroupKeys = A(/* @__PURE__ */ new Set()), this.hiddenFieldNames = A(/* @__PURE__ */ new Set()), this._navErrorCountsRef = T(() => this._computeNavErrorCounts()), this.navErrorCounts = new Proxy({}, {
116
+ this.progressive = i, this.virtual = i ? !1 : r, this._defaultNavAnchorProps = { show: !0, ...o }, this._scrollToFirstError = a, this._containerHeight = n, this._rootMargin = u, this._estimateFieldHeight = c, this._scrollOffset = p, this._initialGroupSchema = s, this._initialFlatSchema = g(s), this.collapseStates = A({}), M(s, this.collapseStates), this.hiddenGroupKeys = A(/* @__PURE__ */ new Set()), this.hiddenFieldNames = A(/* @__PURE__ */ new Set()), this._navErrorCountsRef = K(() => this._computeNavErrorCounts()), this.navErrorCounts = new Proxy({}, {
116
117
  get: (m, d) => {
117
118
  if (F(d))
118
119
  return this._navErrorCountsRef.value[d] ?? 0;
@@ -216,10 +217,10 @@ class ge extends x {
216
217
  async _runFieldValidations(e, t) {
217
218
  const s = await Promise.all(
218
219
  e.map(async (i) => {
219
- const o = Y(i.rules);
220
+ const o = J(i.rules);
220
221
  if (!o)
221
222
  return { name: i.name, error: void 0 };
222
- const { valid: a, errors: n } = await k(i.value, o, {
223
+ const { valid: a, errors: n } = await O(i.value, o, {
223
224
  name: i.name,
224
225
  label: i.label,
225
226
  values: t
@@ -294,7 +295,7 @@ class ge extends x {
294
295
  const t = await super.getValues();
295
296
  if (e) {
296
297
  const s = this.store.state.groupSchema ?? this._initialGroupSchema;
297
- return q(s, t);
298
+ return D(s, t);
298
299
  }
299
300
  return t;
300
301
  }
@@ -358,7 +359,7 @@ class ge extends x {
358
359
  return;
359
360
  }
360
361
  const r = this.getGroupFieldNames(e);
361
- t ? (this.hiddenGroupKeys.delete(e), this._setFieldsHidden(r, !1)) : (this._setFieldsHidden(r, !0), this._clearHiddenFieldValues(r), this.hiddenGroupKeys.add(e)), R(() => {
362
+ t ? (this.hiddenGroupKeys.delete(e), this._setFieldsHidden(r, !1)) : (this._setFieldsHidden(r, !0), this._clearHiddenFieldValues(r), this.hiddenGroupKeys.add(e)), E(() => {
362
363
  this.syncNavErrorCountsFromForm();
363
364
  });
364
365
  }
@@ -368,7 +369,7 @@ class ge extends x {
368
369
  * @param {boolean} visible - 是否可见
369
370
  */
370
371
  setFieldsVisible(e, t) {
371
- t ? this._setFieldsHidden(e, !1) : (this._setFieldsHidden(e, !0), this._clearHiddenFieldValues(e)), R(() => {
372
+ t ? this._setFieldsHidden(e, !1) : (this._setFieldsHidden(e, !0), this._clearHiddenFieldValues(e)), E(() => {
372
373
  this.syncNavErrorCountsFromForm();
373
374
  });
374
375
  }
@@ -425,7 +426,7 @@ class ge extends x {
425
426
  */
426
427
  appendFields(e, t) {
427
428
  const s = this.store.state.groupSchema ?? [], r = y(s);
428
- t && (t.before || t.after) ? D(r, e, t) || r.push(...e) : r.push(...e), this._applyGroupSchema(r), this.seedDefaultsForAppendedFields(g(e));
429
+ t && (t.before || t.after) ? B(r, e, t) || r.push(...e) : r.push(...e), this._applyGroupSchema(r), this.seedDefaultsForAppendedFields(g(e));
429
430
  }
430
431
  /**
431
432
  * @description 按标识从 groupSchema 树中移除节点,无需全量重建 schema。
@@ -436,7 +437,7 @@ class ge extends x {
436
437
  */
437
438
  removeFields(e) {
438
439
  if (!e.length) return;
439
- const t = this.store.state.groupSchema ?? [], s = B(y(t), new Set(e));
440
+ const t = this.store.state.groupSchema ?? [], s = L(y(t), new Set(e));
440
441
  this._applyGroupSchema(s);
441
442
  }
442
443
  /**
@@ -462,7 +463,7 @@ class ge extends x {
462
463
  const t = Array.isArray(e) ? e : [e], s = this._collectGroupKeysWithDescendants(t);
463
464
  if (!s.length)
464
465
  return;
465
- const r = [...new Set(s.flatMap((a) => this.getGroupFieldNames(a, !0)))], i = this.store.state.groupSchema ?? [], o = L(y(i), new Set(s));
466
+ const r = [...new Set(s.flatMap((a) => this.getGroupFieldNames(a, !0)))], i = this.store.state.groupSchema ?? [], o = z(y(i), new Set(s));
466
467
  this._applyGroupSchema(o), r.length && this.onRemovedSchemaFields(r), this._purgeRemovedGroupState(s), this.navAnchorProps.show && this.syncNavErrorCountsFromForm();
467
468
  }
468
469
  /**
@@ -494,7 +495,7 @@ class ge extends x {
494
495
  const e = this.form;
495
496
  if (!(e != null && e.values))
496
497
  return;
497
- if (this._navSyncPassCount >= J) {
498
+ if (this._navSyncPassCount >= Q) {
498
499
  this._navSyncLoopWarned || (this._navSyncLoopWarned = !0);
499
500
  return;
500
501
  }
@@ -563,13 +564,13 @@ class ge extends x {
563
564
  void 0,
564
565
  `${e.fieldName}.dependencies.rules`
565
566
  ));
566
- const i = r || e.rules;
567
+ const i = C(r || e.rules);
567
568
  let o = !1;
568
569
  return s && v(s.required) && (o = !!await this._safeInvoke(
569
570
  () => s.required(t, this),
570
571
  !1,
571
572
  `${e.fieldName}.dependencies.required`
572
- )), i ? F(i) ? i : o ? ((a = i == null ? void 0 : i.unwrap) == null ? void 0 : a.call(i)) ?? i : i : o ? j(e.component) : void 0;
573
+ )), i ? F(i) ? i : o ? ((a = i == null ? void 0 : i.unwrap) == null ? void 0 : a.call(i)) ?? i : i : o ? W(e.component) : void 0;
573
574
  }
574
575
  /**
575
576
  * @description 检查字段的 dependencies 条件,判断字段在当前值下是否应该被校验。
@@ -584,10 +585,10 @@ class ge extends x {
584
585
  const i = e.dependencies;
585
586
  if (!i) return !0;
586
587
  const o = i.if;
587
- if (o != null && (E(o) && !o || v(o) && !await this._safeInvoke(() => o(t, this), !0, `${r}.dependencies.if`)))
588
+ if (o != null && (R(o) && !o || v(o) && !await this._safeInvoke(() => o(t, this), !0, `${r}.dependencies.if`)))
588
589
  return !1;
589
590
  const a = i.show;
590
- return !(a != null && (E(a) && !a || v(a) && !await this._safeInvoke(() => a(t, this), !0, `${r}.dependencies.show`)));
591
+ return !(a != null && (R(a) && !a || v(a) && !await this._safeInvoke(() => a(t, this), !0, `${r}.dependencies.show`)));
591
592
  }
592
593
  /**
593
594
  * @description 收集当前需要校验的全部可见字段(顶层字段 + 数组行递归展开的行内字段)。
@@ -630,7 +631,7 @@ class ge extends x {
630
631
  const m = _(`${o}[${p}]`);
631
632
  let d;
632
633
  try {
633
- d = W({
634
+ d = $({
634
635
  item: e,
635
636
  arrayPath: o,
636
637
  itemPath: m,
@@ -687,13 +688,13 @@ class ge extends x {
687
688
  var s;
688
689
  t || (this._groupFieldMap = {}, this._groupChildrenMap = {}, this._fieldToGroupKey = {}, this._groupParentMap = {}, this._fieldSchemaMap = {}, this._groupKeySet.clear());
689
690
  for (const r of e)
690
- if (z(r)) {
691
+ if (X(r)) {
691
692
  if (this._groupKeySet.has(r.key))
692
693
  throw new Error(
693
694
  `[GroupFormApi] duplicate group key detected: "${r.key}". Group key must be unique in groupSchema tree.`
694
695
  );
695
696
  this._groupKeySet.add(r.key), this._groupFieldMap[r.key] = [], this._groupChildrenMap[r.key] = [], t && (this._groupParentMap[r.key] = t, (s = this._groupChildrenMap)[t] ?? (s[t] = []), this._groupChildrenMap[t].push(r.key)), this._buildGroupFieldMap(r.children, r.key);
696
- } else X(r) ? this._buildGroupFieldMap(r.children, t) : t && "fieldName" in r && r.fieldName ? (this._groupFieldMap[t].push(r.fieldName), this._fieldToGroupKey[r.fieldName] = t, this._fieldSchemaMap[r.fieldName] = r) : "fieldName" in r && r.fieldName && (this._fieldSchemaMap[r.fieldName] = r);
697
+ } else Y(r) ? this._buildGroupFieldMap(r.children, t) : t && "fieldName" in r && r.fieldName ? (this._groupFieldMap[t].push(r.fieldName), this._fieldToGroupKey[r.fieldName] = t, this._fieldSchemaMap[r.fieldName] = r) : "fieldName" in r && r.fieldName && (this._fieldSchemaMap[r.fieldName] = r);
697
698
  }
698
699
  /**
699
700
  * @description 根据错误映射更新导航各分组的错误计数
@@ -795,7 +796,7 @@ class ge extends x {
795
796
  if (e === void 0 && (Array.isArray(t) || S(t)))
796
797
  return this._clearValueKeepStructure(t, t);
797
798
  if (t !== void 0 && !Array.isArray(t) && !S(t))
798
- return K(t);
799
+ return H(t);
799
800
  }
800
801
  /**
801
802
  * @description 清空隐藏字段的值、校验状态和虚拟错误缓存,数组和对象保留结构
@@ -805,8 +806,8 @@ class ge extends x {
805
806
  var t, s, r, i, o, a, n;
806
807
  if (e.length)
807
808
  for (const u of e) {
808
- const c = N((t = this.form) == null ? void 0 : t.values, u), p = this._fieldSchemaMap[u] ? $(this._fieldSchemaMap[u]) : void 0, m = this._clearValueKeepStructure(c, p);
809
- H(c, m) || (r = (s = this.form) == null ? void 0 : s.setFieldValue) == null || r.call(s, u, m, !1), (o = (i = this.form) == null ? void 0 : i.setFieldError) == null || o.call(i, u, void 0), (n = (a = this.form) == null ? void 0 : a.setFieldTouched) == null || n.call(a, u, !1);
809
+ const c = N((t = this.form) == null ? void 0 : t.values, u), p = this._fieldSchemaMap[u] ? I(this._fieldSchemaMap[u]) : void 0, m = this._clearValueKeepStructure(c, p);
810
+ k(c, m) || (r = (s = this.form) == null ? void 0 : s.setFieldValue) == null || r.call(s, u, m, !1), (o = (i = this.form) == null ? void 0 : i.setFieldError) == null || o.call(i, u, void 0), (n = (a = this.form) == null ? void 0 : a.setFieldTouched) == null || n.call(a, u, !1);
810
811
  }
811
812
  }
812
813
  /**
@@ -849,7 +850,7 @@ class ge extends x {
849
850
  * @param childField 子数组字段名
850
851
  */
851
852
  at: (r, i, o) => {
852
- const a = e.at(I(s(r), i, o));
853
+ const a = e.at(q(s(r), i, o));
853
854
  return this._wrapNestedArrayHandle(a, t);
854
855
  }
855
856
  };
@@ -859,5 +860,5 @@ class ge extends x {
859
860
  }
860
861
  }
861
862
  export {
862
- ge as GroupFormApi
863
+ ye as GroupFormApi
863
864
  };
@@ -2,7 +2,7 @@ import o from "./index.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6dba01d4"]]);
5
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d731bb93"]]);
6
6
  export {
7
- _ as default
7
+ a as default
8
8
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./loading.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5d760747"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7e6228e4"]]);
5
5
  export {
6
- a as default
6
+ r as default
7
7
  };
@@ -352,6 +352,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
352
352
  type: import('vue').PropType<Fn>;
353
353
  default: null;
354
354
  };
355
+ tableSearchBefore: {
356
+ type: import('vue').PropType<NonNullable<TtTableFormProps["tableSearchBefore"]>>;
357
+ default: null;
358
+ };
355
359
  toolConfig: {
356
360
  type: import('vue').PropType<import('../../../index').TtTableToolsProps>;
357
361
  default: null;
@@ -575,6 +579,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
575
579
  type: import('vue').PropType<Fn>;
576
580
  default: null;
577
581
  };
582
+ tableSearchBefore: {
583
+ type: import('vue').PropType<NonNullable<TtTableFormProps["tableSearchBefore"]>>;
584
+ default: null;
585
+ };
578
586
  toolConfig: {
579
587
  type: import('vue').PropType<import('../../../index').TtTableToolsProps>;
580
588
  default: null;
@@ -594,6 +602,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
594
602
  handleSearchInfoFn: Fn<any, any>;
595
603
  toolConfig: import('../../../index').TtTableToolsProps;
596
604
  tableRefreshBefore: Fn<any, any>;
605
+ tableSearchBefore: (values: Recordable) => import('../../../index').TtTableSearchBeforeResult | Promise<import('../../../index').TtTableSearchBeforeResult>;
597
606
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
598
607
  columnModalRef: ({
599
608
  $: import('vue').ComponentInternalInstance;