@dazhicheng/ui 1.6.59 → 1.6.61
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.
- package/dist/assets/svg/download.svg.js +1 -1
- package/dist/components/tt-area/TtArea.vue.js +1 -1
- package/dist/components/tt-button/index.d.ts +28 -28
- package/dist/components/tt-button/index.vue.d.ts +16 -16
- package/dist/components/tt-custom-export-modal/src/assets/search.svg.js +5 -5
- package/dist/components/tt-custom-export-modal/src/assets/star.svg.js +3 -3
- package/dist/components/tt-custom-export-modal/src/assets/trash.svg.js +7 -7
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.js +1 -1
- package/dist/components/tt-drawer/index.d.ts +109 -109
- package/dist/components/tt-drawer/src/RenderDrawer.vue.d.ts +60 -60
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-empty/index.d.ts +4 -4
- package/dist/components/tt-form/src/components/FormElInput.vue.d.ts +10 -10
- package/dist/components/tt-form/src/group-form/groupFormApi.d.ts +4 -0
- package/dist/components/tt-form/src/group-form/groupFormApi.js +87 -78
- package/dist/components/tt-form/src/group-form/useGroupForm.js +72 -55
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-image/index.d.ts +29 -29
- package/dist/components/tt-image/src/components/ImageViewer.d.ts +20 -20
- package/dist/components/tt-image/tt-image.d.ts +29 -29
- package/dist/components/tt-input-textarea/index.vue.d.ts +40 -40
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-modal/index.d.ts +150 -150
- package/dist/components/tt-modal/src/RenderModal.vue.d.ts +42 -42
- package/dist/components/tt-modal/src/hooks/useModalRender.d.ts +17 -17
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +5 -5
- package/dist/components/tt-panel-select/src/index.vue.d.ts +5 -5
- package/dist/components/tt-upload/index.d.ts +60 -60
- package/dist/components/tt-upload/src/TtUpload.vue.d.ts +37 -37
- package/dist/components/tt-upload/src/typing.d.ts +17 -17
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var l = (
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var T = (m, p, e) => p in m ? M(m, p, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[p] = e;
|
|
3
|
+
var l = (m, p, e) => T(m, typeof p != "symbol" ? p + "" : p, e);
|
|
4
4
|
import "axios";
|
|
5
5
|
import "element-plus";
|
|
6
|
-
import { isString as F, isFunction as v, isBoolean as
|
|
7
|
-
import { ref as
|
|
6
|
+
import { isString as F, isFunction as v, isBoolean as A } from "../../../../packages/utils/src/is.js";
|
|
7
|
+
import { ref as b, reactive as R, computed as k, nextTick as N, toRaw as C } from "vue";
|
|
8
8
|
import "dayjs";
|
|
9
9
|
import "numeral";
|
|
10
10
|
import "xe-utils";
|
|
@@ -15,25 +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
|
|
18
|
+
import { isPlainObject as S, get as E, cloneDeep as K, isEqual as H } from "lodash-es";
|
|
19
19
|
import { validate as O } from "vee-validate";
|
|
20
|
-
import { toTypedSchema as
|
|
21
|
-
import { FormApi as
|
|
22
|
-
import { resolveRequiredRuleName as W, resolveValueByFieldName as
|
|
20
|
+
import { toTypedSchema as j } from "@vee-validate/zod";
|
|
21
|
+
import { FormApi as x } from "../formApi.js";
|
|
22
|
+
import { resolveRequiredRuleName as W, resolveValueByFieldName as V } from "../form-render/dependencies.js";
|
|
23
23
|
import { resolveArraySchemasForRuntime as $, resolveSchemaFieldInitialValue as I } from "../useFormContext.js";
|
|
24
24
|
import { normalizeArrayFieldPath as _, childArrayPath as q } from "../utils/array-path.js";
|
|
25
|
-
import { extractFlatSchemas as g, collectDefaultCollapseStates as
|
|
26
|
-
function J(
|
|
27
|
-
if (!
|
|
25
|
+
import { extractFlatSchemas as g, collectDefaultCollapseStates as P, 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(m) {
|
|
27
|
+
if (!m)
|
|
28
28
|
return;
|
|
29
|
-
const
|
|
30
|
-
if (F(
|
|
31
|
-
return
|
|
32
|
-
if (v(
|
|
33
|
-
return
|
|
29
|
+
const p = C(m);
|
|
30
|
+
if (F(p))
|
|
31
|
+
return p;
|
|
32
|
+
if (v(p.safeParse))
|
|
33
|
+
return j(p);
|
|
34
34
|
}
|
|
35
35
|
const Q = 20;
|
|
36
|
-
class ye extends
|
|
36
|
+
class ye extends x {
|
|
37
37
|
/**
|
|
38
38
|
* @param {TtFormProps} formProps - 底层表单配置(已展平的 schema、layout 等)
|
|
39
39
|
* @param {GroupFormApiOptions} groupOptions - 分组场景专属配置
|
|
@@ -94,8 +94,12 @@ class ye extends j {
|
|
|
94
94
|
l(this, "_navSyncResetScheduled", !1);
|
|
95
95
|
/** 本轮回环告警是否已输出,避免刷屏 */
|
|
96
96
|
l(this, "_navSyncLoopWarned", !1);
|
|
97
|
+
/** 显式校验与导航同步共用版本,重置/卸载后使未完成的校验失效。 */
|
|
98
|
+
l(this, "_validationRunToken", 0);
|
|
99
|
+
/** 上次组件校验产生的错误,仅用于识别规则失效后可清理的旧错误。 */
|
|
100
|
+
l(this, "_lastValidationErrors", {});
|
|
97
101
|
/** VirtualGroupForm 组件实例引用,由 useGroupForm 的 h() 渲染时赋值 */
|
|
98
|
-
l(this, "groupFormRef",
|
|
102
|
+
l(this, "groupFormRef", b(null));
|
|
99
103
|
const {
|
|
100
104
|
groupSchema: s,
|
|
101
105
|
virtual: r = !0,
|
|
@@ -103,26 +107,26 @@ class ye extends j {
|
|
|
103
107
|
navAnchorProps: o,
|
|
104
108
|
scrollToFirstError: a = !0,
|
|
105
109
|
containerHeight: n = "100%",
|
|
106
|
-
rootMargin:
|
|
107
|
-
estimateFieldHeight:
|
|
108
|
-
scrollOffset:
|
|
110
|
+
rootMargin: h = "400px 0px",
|
|
111
|
+
estimateFieldHeight: d = 52,
|
|
112
|
+
scrollOffset: u = 0
|
|
109
113
|
} = t;
|
|
110
|
-
this.progressive = i, this.virtual = i ? !1 : r, this._defaultNavAnchorProps = { show: !0, ...o }, this._scrollToFirstError = a, this._containerHeight = n, this._rootMargin =
|
|
111
|
-
get: (
|
|
112
|
-
if (F(
|
|
113
|
-
return this._navErrorCountsRef.value[
|
|
114
|
+
this.progressive = i, this.virtual = i ? !1 : r, this._defaultNavAnchorProps = { show: !0, ...o }, this._scrollToFirstError = a, this._containerHeight = n, this._rootMargin = h, this._estimateFieldHeight = d, this._scrollOffset = u, this._initialGroupSchema = s, this._initialFlatSchema = g(s), this.collapseStates = R({}), P(s, this.collapseStates), this.hiddenGroupKeys = R(/* @__PURE__ */ new Set()), this.hiddenFieldNames = R(/* @__PURE__ */ new Set()), this._navErrorCountsRef = k(() => this._computeNavErrorCounts()), this.navErrorCounts = new Proxy({}, {
|
|
115
|
+
get: (c, f) => {
|
|
116
|
+
if (F(f))
|
|
117
|
+
return this._navErrorCountsRef.value[f] ?? 0;
|
|
114
118
|
},
|
|
115
|
-
has: (
|
|
119
|
+
has: (c, f) => F(f) ? f in this._navErrorCountsRef.value : !1,
|
|
116
120
|
ownKeys: () => Reflect.ownKeys(this._navErrorCountsRef.value),
|
|
117
|
-
getOwnPropertyDescriptor: (
|
|
118
|
-
if (!F(
|
|
121
|
+
getOwnPropertyDescriptor: (c, f) => {
|
|
122
|
+
if (!F(f)) return;
|
|
119
123
|
const w = this._navErrorCountsRef.value;
|
|
120
|
-
if (
|
|
124
|
+
if (f in w)
|
|
121
125
|
return {
|
|
122
126
|
configurable: !0,
|
|
123
127
|
enumerable: !0,
|
|
124
128
|
writable: !1,
|
|
125
|
-
value: w[
|
|
129
|
+
value: w[f]
|
|
126
130
|
};
|
|
127
131
|
}
|
|
128
132
|
}), this._buildGroupFieldMap(s), this.setState({
|
|
@@ -131,9 +135,9 @@ class ye extends j {
|
|
|
131
135
|
virtual: this.virtual,
|
|
132
136
|
progressive: i,
|
|
133
137
|
containerHeight: n,
|
|
134
|
-
rootMargin:
|
|
135
|
-
estimateFieldHeight:
|
|
136
|
-
scrollOffset:
|
|
138
|
+
rootMargin: h,
|
|
139
|
+
estimateFieldHeight: d,
|
|
140
|
+
scrollOffset: u
|
|
137
141
|
});
|
|
138
142
|
}
|
|
139
143
|
/**
|
|
@@ -186,20 +190,20 @@ class ye extends j {
|
|
|
186
190
|
* await formApi.validate(undefined, false);
|
|
187
191
|
*/
|
|
188
192
|
async validate(e, t) {
|
|
189
|
-
var
|
|
190
|
-
const s = ((
|
|
191
|
-
this._applyFieldErrors(
|
|
192
|
-
const
|
|
193
|
-
for (const
|
|
194
|
-
const
|
|
195
|
-
|
|
193
|
+
var d;
|
|
194
|
+
const s = ++this._validationRunToken, r = ((d = this.form) == null ? void 0 : d.values) ?? {}, i = await this._collectValidationFields(r), o = await this._runFieldValidations(i, r);
|
|
195
|
+
s === this._validationRunToken && (this._applyFieldErrors(i, o), this._hasValidated = !0);
|
|
196
|
+
const a = {};
|
|
197
|
+
for (const u of i) {
|
|
198
|
+
const c = o[u.name];
|
|
199
|
+
a[u.name] = { valid: !c, errors: c ? [c] : [] };
|
|
196
200
|
}
|
|
197
|
-
const
|
|
198
|
-
valid: Object.keys(
|
|
199
|
-
errors:
|
|
200
|
-
results:
|
|
201
|
-
};
|
|
202
|
-
return
|
|
201
|
+
const n = {
|
|
202
|
+
valid: Object.keys(o).length === 0,
|
|
203
|
+
errors: o,
|
|
204
|
+
results: a
|
|
205
|
+
}, h = t ?? this._scrollToFirstError;
|
|
206
|
+
return s === this._validationRunToken && h && !n.valid && this._scrollToFirstErrorField(i, o), n;
|
|
203
207
|
}
|
|
204
208
|
/**
|
|
205
209
|
* @description 对收集到的可见字段逐个用 vee-validate 底层 `validate()` 校验,独立字段并发执行。
|
|
@@ -234,12 +238,15 @@ class ye extends j {
|
|
|
234
238
|
* @param {Record<string, string>} errorMap - 字段名 → 错误信息
|
|
235
239
|
*/
|
|
236
240
|
_applyFieldErrors(e, t) {
|
|
237
|
-
var
|
|
238
|
-
const s = ((
|
|
239
|
-
for (const
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
var i, o, a, n, h, d;
|
|
242
|
+
const s = ((o = (i = this.form) == null ? void 0 : i.errors) == null ? void 0 : o.value) ?? {}, r = new Set(e.map((u) => u.name));
|
|
243
|
+
for (const [u, c] of Object.entries(this._lastValidationErrors))
|
|
244
|
+
!r.has(u) && s[u] === c && ((n = (a = this.form) == null ? void 0 : a.setFieldError) == null || n.call(a, u, void 0));
|
|
245
|
+
for (const u of e) {
|
|
246
|
+
const c = t[u.name];
|
|
247
|
+
s[u.name] !== c && ((d = (h = this.form) == null ? void 0 : h.setFieldError) == null || d.call(h, u.name, c));
|
|
242
248
|
}
|
|
249
|
+
this._lastValidationErrors = { ...t };
|
|
243
250
|
}
|
|
244
251
|
/**
|
|
245
252
|
* @description 清空全部字段错误(含 vee-validate extraErrorsBag 里从未挂载过的残留)。
|
|
@@ -249,6 +256,7 @@ class ye extends j {
|
|
|
249
256
|
*/
|
|
250
257
|
_clearAllFieldErrors() {
|
|
251
258
|
var r, i, o, a;
|
|
259
|
+
this._validationRunToken++, this._lastValidationErrors = {};
|
|
252
260
|
const e = /* @__PURE__ */ new Set(), t = this.store.state.schema ?? this._initialFlatSchema;
|
|
253
261
|
for (const n of t)
|
|
254
262
|
n.fieldName && e.add(_(n.fieldName));
|
|
@@ -353,7 +361,7 @@ class ye extends j {
|
|
|
353
361
|
return;
|
|
354
362
|
}
|
|
355
363
|
const r = this.getGroupFieldNames(e);
|
|
356
|
-
t ? (this.hiddenGroupKeys.delete(e), this._setFieldsHidden(r, !1)) : (this._setFieldsHidden(r, !0), this._clearHiddenFieldValues(r), this.hiddenGroupKeys.add(e)),
|
|
364
|
+
t ? (this.hiddenGroupKeys.delete(e), this._setFieldsHidden(r, !1)) : (this._setFieldsHidden(r, !0), this._clearHiddenFieldValues(r), this.hiddenGroupKeys.add(e)), N(() => {
|
|
357
365
|
this.syncNavErrorCountsFromForm();
|
|
358
366
|
});
|
|
359
367
|
}
|
|
@@ -363,7 +371,7 @@ class ye extends j {
|
|
|
363
371
|
* @param {boolean} visible - 是否可见
|
|
364
372
|
*/
|
|
365
373
|
setFieldsVisible(e, t) {
|
|
366
|
-
t ? this._setFieldsHidden(e, !1) : (this._setFieldsHidden(e, !0), this._clearHiddenFieldValues(e)),
|
|
374
|
+
t ? this._setFieldsHidden(e, !1) : (this._setFieldsHidden(e, !0), this._clearHiddenFieldValues(e)), N(() => {
|
|
367
375
|
this.syncNavErrorCountsFromForm();
|
|
368
376
|
});
|
|
369
377
|
}
|
|
@@ -397,7 +405,7 @@ class ye extends j {
|
|
|
397
405
|
const e = this.store.state.groupSchema ?? this._initialGroupSchema;
|
|
398
406
|
for (const t of Object.keys(this.collapseStates))
|
|
399
407
|
delete this.collapseStates[t];
|
|
400
|
-
|
|
408
|
+
P(e, this.collapseStates);
|
|
401
409
|
}
|
|
402
410
|
/**
|
|
403
411
|
* @description 全量应用分组 schema 树到 store(扁平 schema、groupSchema、分组字段映射、折叠默认值)。
|
|
@@ -489,6 +497,7 @@ class ye extends j {
|
|
|
489
497
|
const e = this.form;
|
|
490
498
|
if (!(e != null && e.values))
|
|
491
499
|
return;
|
|
500
|
+
const t = ++this._validationRunToken;
|
|
492
501
|
if (this._navSyncPassCount >= Q) {
|
|
493
502
|
this._navSyncLoopWarned || (this._navSyncLoopWarned = !0);
|
|
494
503
|
return;
|
|
@@ -496,8 +505,8 @@ class ye extends j {
|
|
|
496
505
|
this._navSyncPassCount++, this._navSyncResetScheduled || (this._navSyncResetScheduled = !0, setTimeout(() => {
|
|
497
506
|
this._navSyncPassCount = 0, this._navSyncResetScheduled = !1, this._navSyncLoopWarned = !1;
|
|
498
507
|
}, 0));
|
|
499
|
-
const
|
|
500
|
-
this._applyFieldErrors(
|
|
508
|
+
const s = e.values, r = await this._collectValidationFields(s), i = await this._runFieldValidations(r, s);
|
|
509
|
+
t === this._validationRunToken && this._applyFieldErrors(r, i);
|
|
501
510
|
}
|
|
502
511
|
// _clearNavErrorCounts 已移除:navErrorCounts 是派生量,resetForm/resetValidate
|
|
503
512
|
// 会让 vee-validate 清空 form.errors,computed 自动重算为全 0,无需主动清。
|
|
@@ -579,10 +588,10 @@ class ye extends j {
|
|
|
579
588
|
const i = e.dependencies;
|
|
580
589
|
if (!i) return !0;
|
|
581
590
|
const o = i.if;
|
|
582
|
-
if (o != null && (
|
|
591
|
+
if (o != null && (A(o) && !o || v(o) && !await this._safeInvoke(() => o(t, this), !0, `${r}.dependencies.if`)))
|
|
583
592
|
return !1;
|
|
584
593
|
const a = i.show;
|
|
585
|
-
return !(a != null && (
|
|
594
|
+
return !(a != null && (A(a) && !a || v(a) && !await this._safeInvoke(() => a(t, this), !0, `${r}.dependencies.show`)));
|
|
586
595
|
}
|
|
587
596
|
/**
|
|
588
597
|
* @description 收集当前需要校验的全部可见字段(顶层字段 + 数组行递归展开的行内字段)。
|
|
@@ -616,21 +625,21 @@ class ye extends j {
|
|
|
616
625
|
name: t,
|
|
617
626
|
label: F(e.label) ? e.label : void 0,
|
|
618
627
|
rules: i,
|
|
619
|
-
value:
|
|
628
|
+
value: V(s, t)
|
|
620
629
|
}), !e.useArraySchema) return r;
|
|
621
|
-
const o = _(t), a =
|
|
630
|
+
const o = _(t), a = V(s, o);
|
|
622
631
|
if (!Array.isArray(a) || a.length === 0) return r;
|
|
623
|
-
const n = t.includes(".") ? t.slice(0, t.lastIndexOf(".")) : void 0,
|
|
624
|
-
a.map(async (
|
|
625
|
-
const
|
|
626
|
-
let
|
|
632
|
+
const n = t.includes(".") ? t.slice(0, t.lastIndexOf(".")) : void 0, h = await Promise.all(
|
|
633
|
+
a.map(async (d, u) => {
|
|
634
|
+
const c = _(`${o}[${u}]`);
|
|
635
|
+
let f;
|
|
627
636
|
try {
|
|
628
|
-
|
|
637
|
+
f = $({
|
|
629
638
|
item: e,
|
|
630
639
|
arrayPath: o,
|
|
631
|
-
itemPath:
|
|
632
|
-
index:
|
|
633
|
-
row:
|
|
640
|
+
itemPath: c,
|
|
641
|
+
index: u,
|
|
642
|
+
row: d ?? {},
|
|
634
643
|
arrayLength: a.length,
|
|
635
644
|
parentItemPath: n,
|
|
636
645
|
form: s,
|
|
@@ -643,18 +652,18 @@ class ye extends j {
|
|
|
643
652
|
return [];
|
|
644
653
|
}
|
|
645
654
|
return (await Promise.all(
|
|
646
|
-
|
|
655
|
+
f.map(
|
|
647
656
|
(G) => this._collectFieldRecursive(
|
|
648
657
|
G,
|
|
649
|
-
_(`${
|
|
658
|
+
_(`${c}.${G.fieldName}`),
|
|
650
659
|
s
|
|
651
660
|
)
|
|
652
661
|
)
|
|
653
662
|
)).flat();
|
|
654
663
|
})
|
|
655
664
|
);
|
|
656
|
-
for (const
|
|
657
|
-
r.push(...
|
|
665
|
+
for (const d of h)
|
|
666
|
+
r.push(...d);
|
|
658
667
|
return r;
|
|
659
668
|
}
|
|
660
669
|
/**
|
|
@@ -783,14 +792,14 @@ class ye extends j {
|
|
|
783
792
|
return Object.fromEntries(
|
|
784
793
|
Object.keys(e).map((r) => [
|
|
785
794
|
r,
|
|
786
|
-
this._clearValueKeepStructure(
|
|
795
|
+
this._clearValueKeepStructure(E(e, r), E(s, r))
|
|
787
796
|
])
|
|
788
797
|
);
|
|
789
798
|
}
|
|
790
799
|
if (e === void 0 && (Array.isArray(t) || S(t)))
|
|
791
800
|
return this._clearValueKeepStructure(t, t);
|
|
792
801
|
if (t !== void 0 && !Array.isArray(t) && !S(t))
|
|
793
|
-
return
|
|
802
|
+
return K(t);
|
|
794
803
|
}
|
|
795
804
|
/**
|
|
796
805
|
* @description 清空隐藏字段的值、校验状态和虚拟错误缓存,数组和对象保留结构
|
|
@@ -799,9 +808,9 @@ class ye extends j {
|
|
|
799
808
|
_clearHiddenFieldValues(e) {
|
|
800
809
|
var t, s, r, i, o, a, n;
|
|
801
810
|
if (e.length)
|
|
802
|
-
for (const
|
|
803
|
-
const
|
|
804
|
-
|
|
811
|
+
for (const h of e) {
|
|
812
|
+
const d = E((t = this.form) == null ? void 0 : t.values, h), u = this._fieldSchemaMap[h] ? I(this._fieldSchemaMap[h]) : void 0, c = this._clearValueKeepStructure(d, u);
|
|
813
|
+
H(d, c) || (r = (s = this.form) == null ? void 0 : s.setFieldValue) == null || r.call(s, h, c, !1), (o = (i = this.form) == null ? void 0 : i.setFieldError) == null || o.call(i, h, void 0), (n = (a = this.form) == null ? void 0 : a.setFieldTouched) == null || n.call(a, h, !1);
|
|
805
814
|
}
|
|
806
815
|
}
|
|
807
816
|
/**
|
|
@@ -1,80 +1,97 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as M, onMounted as P, watch as f, onBeforeUnmount as B, h as D, isReactive as H } from "vue";
|
|
2
|
+
import { useStore as O } from "@tanstack/vue-store";
|
|
3
|
+
import { resolveValueByFieldName as R } from "../form-render/dependencies.js";
|
|
4
|
+
import { GroupFormApi as U } from "./groupFormApi.js";
|
|
5
|
+
import V from "./GroupForm.vue2.js";
|
|
5
6
|
/* empty css */
|
|
6
|
-
import { resolveGroupSchema as
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
groupSchema:
|
|
10
|
-
schema:
|
|
11
|
-
virtual:
|
|
12
|
-
progressive:
|
|
13
|
-
containerHeight:
|
|
14
|
-
rootMargin:
|
|
15
|
-
estimateFieldHeight:
|
|
16
|
-
navAnchorProps:
|
|
17
|
-
scrollToFirstError:
|
|
18
|
-
scrollOffset:
|
|
19
|
-
...
|
|
20
|
-
} =
|
|
7
|
+
import { resolveGroupSchema as h, extractFlatSchemas as W } from "./utils.js";
|
|
8
|
+
function X(t) {
|
|
9
|
+
const m = h(t), {
|
|
10
|
+
groupSchema: b,
|
|
11
|
+
schema: j,
|
|
12
|
+
virtual: v = !0,
|
|
13
|
+
progressive: F = !1,
|
|
14
|
+
containerHeight: d = "100%",
|
|
15
|
+
rootMargin: g = "400px 0px",
|
|
16
|
+
estimateFieldHeight: S = 52,
|
|
17
|
+
navAnchorProps: A,
|
|
18
|
+
scrollToFirstError: G,
|
|
19
|
+
scrollOffset: y = 0,
|
|
20
|
+
...T
|
|
21
|
+
} = t, E = {
|
|
21
22
|
title: "导航",
|
|
22
23
|
show: !0,
|
|
23
|
-
...
|
|
24
|
-
},
|
|
25
|
-
...
|
|
26
|
-
schema:
|
|
24
|
+
...A
|
|
25
|
+
}, _ = W(m), x = {
|
|
26
|
+
...T,
|
|
27
|
+
schema: _,
|
|
27
28
|
showDefaultActions: !1,
|
|
28
29
|
scrollToFirstError: !1
|
|
29
|
-
}, r = new
|
|
30
|
-
groupSchema:
|
|
31
|
-
navAnchorProps:
|
|
32
|
-
virtual:
|
|
33
|
-
progressive:
|
|
34
|
-
scrollToFirstError:
|
|
35
|
-
containerHeight:
|
|
36
|
-
rootMargin:
|
|
37
|
-
estimateFieldHeight:
|
|
38
|
-
scrollOffset:
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
const
|
|
30
|
+
}, r = new U(x, {
|
|
31
|
+
groupSchema: m,
|
|
32
|
+
navAnchorProps: E,
|
|
33
|
+
virtual: v,
|
|
34
|
+
progressive: F,
|
|
35
|
+
scrollToFirstError: G ?? !0,
|
|
36
|
+
containerHeight: d,
|
|
37
|
+
rootMargin: g,
|
|
38
|
+
estimateFieldHeight: S,
|
|
39
|
+
scrollOffset: y
|
|
40
|
+
}), a = r;
|
|
41
|
+
a.useStore = (o) => O(r.store, o);
|
|
42
|
+
const C = M({
|
|
42
43
|
name: "TtGroupForm",
|
|
43
44
|
inheritAttrs: !1,
|
|
44
|
-
setup(o, { attrs: p, slots:
|
|
45
|
+
setup(o, { attrs: p, slots: N }) {
|
|
45
46
|
r.setState({ ...p });
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
r.resetCollapseStatesToDefault(), r.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
const w = r.useStore((e) => e.schema), c = [];
|
|
48
|
+
return P(() => {
|
|
49
|
+
r.resetCollapseStatesToDefault(), !(!r.virtual && !r.progressive) && (r.syncNavErrorCountsFromForm(), c.push(
|
|
50
|
+
f(
|
|
51
|
+
[
|
|
52
|
+
() => {
|
|
53
|
+
var e, s;
|
|
54
|
+
return (s = (e = r.form) == null ? void 0 : e.errors) == null ? void 0 : s.value;
|
|
55
|
+
},
|
|
56
|
+
() => {
|
|
57
|
+
var u, i;
|
|
58
|
+
const e = (u = r.form) == null ? void 0 : u.values;
|
|
59
|
+
if (!e) return [];
|
|
60
|
+
const s = new Set(
|
|
61
|
+
(i = w.value) == null ? void 0 : i.flatMap(
|
|
62
|
+
(n) => {
|
|
63
|
+
var l;
|
|
64
|
+
return "dependencies" in n ? ((l = n.dependencies) == null ? void 0 : l.triggerFields) ?? [] : [];
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
return Array.from(s, (n) => R(e, n));
|
|
69
|
+
}
|
|
70
|
+
],
|
|
54
71
|
() => r.syncNavErrorCountsFromForm(),
|
|
55
72
|
{ deep: !0, flush: "post" }
|
|
56
73
|
)
|
|
57
74
|
));
|
|
58
|
-
}),
|
|
59
|
-
|
|
60
|
-
}), () =>
|
|
61
|
-
|
|
75
|
+
}), B(() => {
|
|
76
|
+
c.splice(0).forEach((e) => e()), r.unmount();
|
|
77
|
+
}), () => D(
|
|
78
|
+
V,
|
|
62
79
|
{
|
|
63
80
|
...p,
|
|
64
81
|
ref: r.groupFormRef,
|
|
65
|
-
formApi:
|
|
82
|
+
formApi: a
|
|
66
83
|
},
|
|
67
|
-
|
|
84
|
+
N
|
|
68
85
|
);
|
|
69
86
|
}
|
|
70
87
|
});
|
|
71
|
-
return
|
|
72
|
-
() =>
|
|
88
|
+
return H(t) && f(
|
|
89
|
+
() => h(t),
|
|
73
90
|
(o) => {
|
|
74
91
|
o.length && r._applyGroupSchema(o);
|
|
75
92
|
}
|
|
76
|
-
), [
|
|
93
|
+
), [C, a];
|
|
77
94
|
}
|
|
78
95
|
export {
|
|
79
|
-
|
|
96
|
+
X as useGroupForm
|
|
80
97
|
};
|
|
@@ -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
|
|
5
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d731bb93"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -10,22 +10,22 @@ export declare const TtImage: import('../../../../utils/src').SFCWithInstall<imp
|
|
|
10
10
|
default: string;
|
|
11
11
|
};
|
|
12
12
|
hideOnClickModal: BooleanConstructor;
|
|
13
|
-
src: import('element-plus/es/utils/
|
|
14
|
-
fit: import('element-plus/es/utils/
|
|
13
|
+
src: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
14
|
+
fit: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, "" | "fill" | "none" | "contain" | "cover" | "scale-down", unknown, "", boolean>;
|
|
15
15
|
loading: {
|
|
16
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/
|
|
16
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<StringConstructor, "lazy" | "eager", unknown>>;
|
|
17
17
|
readonly required: false;
|
|
18
18
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
19
19
|
__epPropKey: true;
|
|
20
20
|
};
|
|
21
21
|
lazy: BooleanConstructor;
|
|
22
22
|
scrollContainer: {
|
|
23
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/
|
|
23
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement | undefined) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement | undefined)) | null)[], unknown, unknown>>;
|
|
24
24
|
readonly required: false;
|
|
25
25
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
26
26
|
__epPropKey: true;
|
|
27
27
|
};
|
|
28
|
-
previewSrcList: import('element-plus/es/utils/
|
|
28
|
+
previewSrcList: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | (((new (...args: any[]) => string[]) | (() => string[])) | null)[], unknown, unknown, () => [], boolean>;
|
|
29
29
|
previewTeleported: BooleanConstructor;
|
|
30
30
|
zIndex: {
|
|
31
31
|
readonly type: import('vue').PropType<number>;
|
|
@@ -33,16 +33,16 @@ export declare const TtImage: import('../../../../utils/src').SFCWithInstall<imp
|
|
|
33
33
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
34
34
|
__epPropKey: true;
|
|
35
35
|
};
|
|
36
|
-
initialIndex: import('element-plus/es/utils/
|
|
37
|
-
infinite: import('element-plus/es/utils/
|
|
38
|
-
closeOnPressEscape: import('element-plus/es/utils/
|
|
39
|
-
zoomRate: import('element-plus/es/utils/
|
|
40
|
-
scale: import('element-plus/es/utils/
|
|
41
|
-
minScale: import('element-plus/es/utils/
|
|
42
|
-
maxScale: import('element-plus/es/utils/
|
|
36
|
+
initialIndex: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
37
|
+
infinite: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
38
|
+
closeOnPressEscape: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
39
|
+
zoomRate: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 1.2, boolean>;
|
|
40
|
+
scale: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
41
|
+
minScale: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 0.2, boolean>;
|
|
42
|
+
maxScale: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
|
|
43
43
|
showProgress: BooleanConstructor;
|
|
44
44
|
crossorigin: {
|
|
45
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/
|
|
45
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => "" | "anonymous" | "use-credentials") | (() => import('element-plus').ImageCrossorigin) | (((new (...args: any[]) => "" | "anonymous" | "use-credentials") | (() => import('element-plus').ImageCrossorigin)) | null)[], unknown, unknown>>;
|
|
46
46
|
readonly required: false;
|
|
47
47
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
48
48
|
__epPropKey: true;
|
|
@@ -60,22 +60,22 @@ export declare const TtImage: import('../../../../utils/src').SFCWithInstall<imp
|
|
|
60
60
|
default: string;
|
|
61
61
|
};
|
|
62
62
|
hideOnClickModal: BooleanConstructor;
|
|
63
|
-
src: import('element-plus/es/utils/
|
|
64
|
-
fit: import('element-plus/es/utils/
|
|
63
|
+
src: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
64
|
+
fit: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<StringConstructor, "" | "fill" | "none" | "contain" | "cover" | "scale-down", unknown, "", boolean>;
|
|
65
65
|
loading: {
|
|
66
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/
|
|
66
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<StringConstructor, "lazy" | "eager", unknown>>;
|
|
67
67
|
readonly required: false;
|
|
68
68
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
69
69
|
__epPropKey: true;
|
|
70
70
|
};
|
|
71
71
|
lazy: BooleanConstructor;
|
|
72
72
|
scrollContainer: {
|
|
73
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/
|
|
73
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement | undefined) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement | undefined)) | null)[], unknown, unknown>>;
|
|
74
74
|
readonly required: false;
|
|
75
75
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
76
76
|
__epPropKey: true;
|
|
77
77
|
};
|
|
78
|
-
previewSrcList: import('element-plus/es/utils/
|
|
78
|
+
previewSrcList: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | (((new (...args: any[]) => string[]) | (() => string[])) | null)[], unknown, unknown, () => [], boolean>;
|
|
79
79
|
previewTeleported: BooleanConstructor;
|
|
80
80
|
zIndex: {
|
|
81
81
|
readonly type: import('vue').PropType<number>;
|
|
@@ -83,16 +83,16 @@ export declare const TtImage: import('../../../../utils/src').SFCWithInstall<imp
|
|
|
83
83
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
84
84
|
__epPropKey: true;
|
|
85
85
|
};
|
|
86
|
-
initialIndex: import('element-plus/es/utils/
|
|
87
|
-
infinite: import('element-plus/es/utils/
|
|
88
|
-
closeOnPressEscape: import('element-plus/es/utils/
|
|
89
|
-
zoomRate: import('element-plus/es/utils/
|
|
90
|
-
scale: import('element-plus/es/utils/
|
|
91
|
-
minScale: import('element-plus/es/utils/
|
|
92
|
-
maxScale: import('element-plus/es/utils/
|
|
86
|
+
initialIndex: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
87
|
+
infinite: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
88
|
+
closeOnPressEscape: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
89
|
+
zoomRate: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 1.2, boolean>;
|
|
90
|
+
scale: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
91
|
+
minScale: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 0.2, boolean>;
|
|
92
|
+
maxScale: import('element-plus/es/utils/vue/props/types.mjs').EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
|
|
93
93
|
showProgress: BooleanConstructor;
|
|
94
94
|
crossorigin: {
|
|
95
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/
|
|
95
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => "" | "anonymous" | "use-credentials") | (() => import('element-plus').ImageCrossorigin) | (((new (...args: any[]) => "" | "anonymous" | "use-credentials") | (() => import('element-plus').ImageCrossorigin)) | null)[], unknown, unknown>>;
|
|
96
96
|
readonly required: false;
|
|
97
97
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
98
98
|
__epPropKey: true;
|
|
@@ -107,13 +107,13 @@ export declare const TtImage: import('../../../../utils/src').SFCWithInstall<imp
|
|
|
107
107
|
src: string;
|
|
108
108
|
status: ImageStatus;
|
|
109
109
|
hideOnClickModal: boolean;
|
|
110
|
-
fit: import('element-plus/es/utils/
|
|
110
|
+
fit: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<StringConstructor, "" | "fill" | "none" | "contain" | "cover" | "scale-down", unknown>;
|
|
111
111
|
lazy: boolean;
|
|
112
112
|
previewSrcList: string[];
|
|
113
113
|
previewTeleported: boolean;
|
|
114
114
|
initialIndex: number;
|
|
115
|
-
infinite: import('element-plus/es/utils/
|
|
116
|
-
closeOnPressEscape: import('element-plus/es/utils/
|
|
115
|
+
infinite: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
116
|
+
closeOnPressEscape: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
117
117
|
zoomRate: number;
|
|
118
118
|
scale: number;
|
|
119
119
|
minScale: number;
|