@dazhicheng/ui 1.5.223 → 1.5.225
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/components/tt-form/index.d.ts +5 -3
- package/dist/components/tt-form/src/form/RenderContent.vue.js +8 -8
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +122 -122
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +4 -4
- package/dist/components/tt-form/src/form-render/context.d.ts +1 -1
- package/dist/components/tt-form/src/form-render/dependencies.js +56 -56
- package/dist/components/tt-form/src/form-render/form.vue.d.ts +1 -1
- package/dist/components/tt-form/src/formApi.d.ts +1 -1
- package/dist/components/tt-form/src/group-form/GroupForm.vue.d.ts +1 -1
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +35 -35
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +135 -134
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +68 -68
- package/dist/components/tt-form/src/group-form/groupFormApi.js +4 -4
- package/dist/components/tt-form/src/group-form/types.d.ts +25 -24
- package/dist/components/tt-form/src/group-form/useGroupForm.d.ts +2 -6
- package/dist/components/tt-form/src/group-form/utils.d.ts +8 -8
- package/dist/components/tt-form/src/index.vue.d.ts +12 -12
- package/dist/components/tt-form/src/types.d.ts +48 -47
- package/dist/components/tt-form/src/useForm.d.ts +2 -2
- package/dist/components/tt-modal/src/components/ModalHeader.vue.js +1 -1
- package/dist/components/tt-select/src/Select.vue.d.ts +4 -4
- package/dist/components/tt-select/src/components/Table.vue.d.ts +4 -4
- package/dist/components/tt-table/index.d.ts +12 -12
- package/dist/components/tt-table/src/Table.vue.d.ts +4 -4
- package/dist/components/tt-table/src/TableForm.vue.d.ts +162 -58
- package/dist/components/tt-table/src/TableForm.vue.js +126 -113
- package/dist/components/tt-table/src/components/TableColumnModal.vue.d.ts +19 -1
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +103 -94
- package/dist/components/tt-table/src/hooks/useTableForm.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as n, computed as
|
|
1
|
+
import { unref as V, ref as n, computed as N, watch as k } from "vue";
|
|
2
2
|
import "axios";
|
|
3
3
|
import "element-plus";
|
|
4
|
-
import { isFunction as
|
|
4
|
+
import { isFunction as l, isBoolean as E, isString as S } from "../../../../packages/utils/src/is.js";
|
|
5
5
|
import "xe-utils";
|
|
6
6
|
import "dayjs";
|
|
7
7
|
import "dayjs/plugin/utc";
|
|
@@ -12,90 +12,90 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/en
|
|
|
12
12
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
13
13
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
14
14
|
import "lodash-es";
|
|
15
|
-
import { get as
|
|
15
|
+
import { get as A } from "es-toolkit/compat";
|
|
16
16
|
import { useFormValues as B } from "vee-validate";
|
|
17
|
-
import {
|
|
17
|
+
import { injectFormProps as C } from "../useFormContext.js";
|
|
18
18
|
const K = /* @__PURE__ */ new Set(["ElInput", "FormElInput", "ElInputNumber", "ElInputTag", "ElMention"]);
|
|
19
|
-
function
|
|
19
|
+
function tr(r) {
|
|
20
20
|
const e = S(r) ? r : (r == null ? void 0 : r.name) ?? (r == null ? void 0 : r.__name);
|
|
21
21
|
return S(e) && K.has(e) ? "required" : "selectRequired";
|
|
22
22
|
}
|
|
23
23
|
function M(r, e) {
|
|
24
24
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
25
|
-
const
|
|
26
|
-
return r[
|
|
25
|
+
const w = e.slice(1, -1);
|
|
26
|
+
return r[w];
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return A(r, e);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
var
|
|
32
|
-
const e = B(),
|
|
30
|
+
function ir(r) {
|
|
31
|
+
var x;
|
|
32
|
+
const e = B(), [w] = C(), u = V(w).formApi;
|
|
33
33
|
if (!e)
|
|
34
34
|
throw new Error("useDependencies should be used within <TtForm>");
|
|
35
|
-
const
|
|
35
|
+
const o = n(!0), f = n(!1), m = n(!0), g = n(!1), h = n({}), F = n(), _ = N(() => {
|
|
36
36
|
var i;
|
|
37
|
-
return (((i = r()) == null ? void 0 : i.triggerFields) ?? []).map((
|
|
37
|
+
return (((i = r()) == null ? void 0 : i.triggerFields) ?? []).map((d) => M(e.value, d));
|
|
38
38
|
});
|
|
39
39
|
let I = 0;
|
|
40
|
-
return
|
|
40
|
+
return k(
|
|
41
41
|
[_, r],
|
|
42
42
|
async ([b, i]) => {
|
|
43
|
-
var
|
|
44
|
-
if (!i || !((
|
|
43
|
+
var R;
|
|
44
|
+
if (!i || !((R = i == null ? void 0 : i.triggerFields) != null && R.length))
|
|
45
45
|
return;
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const t = !!await c(a,
|
|
49
|
-
if (
|
|
50
|
-
} else if (
|
|
51
|
-
if (
|
|
46
|
+
const d = ++I, s = () => d !== I, { componentProps: y, disabled: v, if: c, required: P, rules: T, show: p, trigger: q } = i, a = e.value;
|
|
47
|
+
if (l(c)) {
|
|
48
|
+
const t = !!await c(a, u);
|
|
49
|
+
if (s() || (o.value = t, !o.value)) return;
|
|
50
|
+
} else if (E(c)) {
|
|
51
|
+
if (o.value = c, !o.value) return;
|
|
52
52
|
} else
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
const t = !!await p(a,
|
|
56
|
-
if (
|
|
53
|
+
o.value = !0;
|
|
54
|
+
if (l(p)) {
|
|
55
|
+
const t = !!await p(a, u);
|
|
56
|
+
if (s()) return;
|
|
57
57
|
m.value = t;
|
|
58
|
-
} else
|
|
59
|
-
if (
|
|
60
|
-
const t = await
|
|
61
|
-
if (
|
|
62
|
-
|
|
58
|
+
} else E(p) ? m.value = p : m.value = !0;
|
|
59
|
+
if (l(y)) {
|
|
60
|
+
const t = await y(a, u);
|
|
61
|
+
if (s()) return;
|
|
62
|
+
h.value = t;
|
|
63
63
|
} else
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
const t = await
|
|
67
|
-
if (
|
|
68
|
-
|
|
64
|
+
h.value = {};
|
|
65
|
+
if (l(T)) {
|
|
66
|
+
const t = await T(a, u);
|
|
67
|
+
if (s()) return;
|
|
68
|
+
F.value = t;
|
|
69
69
|
} else
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
const t = !!await v(a,
|
|
73
|
-
if (
|
|
70
|
+
F.value = void 0;
|
|
71
|
+
if (l(v)) {
|
|
72
|
+
const t = !!await v(a, u);
|
|
73
|
+
if (s()) return;
|
|
74
74
|
f.value = t;
|
|
75
|
-
} else
|
|
76
|
-
if (
|
|
77
|
-
const t = !!await P(a,
|
|
78
|
-
if (
|
|
79
|
-
|
|
75
|
+
} else E(v) ? f.value = v : f.value = !1;
|
|
76
|
+
if (l(P)) {
|
|
77
|
+
const t = !!await P(a, u);
|
|
78
|
+
if (s()) return;
|
|
79
|
+
g.value = t;
|
|
80
80
|
} else
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
if (
|
|
84
|
-
await
|
|
81
|
+
g.value = !1;
|
|
82
|
+
if (l(q)) {
|
|
83
|
+
if (s()) return;
|
|
84
|
+
await q(a, u);
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
|
-
{ deep: !0, immediate: ((
|
|
87
|
+
{ deep: !0, immediate: ((x = r()) == null ? void 0 : x.immediate) ?? !0 }
|
|
88
88
|
), {
|
|
89
|
-
dynamicComponentProps:
|
|
90
|
-
dynamicRules:
|
|
89
|
+
dynamicComponentProps: h,
|
|
90
|
+
dynamicRules: F,
|
|
91
91
|
isDisabled: f,
|
|
92
|
-
isIf:
|
|
93
|
-
isRequired:
|
|
92
|
+
isIf: o,
|
|
93
|
+
isRequired: g,
|
|
94
94
|
isShow: m
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
ir as default,
|
|
99
|
+
tr as resolveRequiredRuleName,
|
|
100
100
|
M as resolveValueByFieldName
|
|
101
101
|
};
|
|
@@ -27,7 +27,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
|
27
27
|
onSubmit?: ((event: any) => any) | undefined;
|
|
28
28
|
}>, {
|
|
29
29
|
collapsedRows: number;
|
|
30
|
-
commonConfig: FormCommonConfig
|
|
30
|
+
commonConfig: FormCommonConfig<Record<string, any>>;
|
|
31
31
|
showCollapseButton: boolean;
|
|
32
32
|
wrapperClass: import('../types').WrapperClassType;
|
|
33
33
|
globalCommonConfig: FormCommonConfig;
|
|
@@ -35,7 +35,7 @@ export declare class FormApi {
|
|
|
35
35
|
*/
|
|
36
36
|
getFocusedField(): string | undefined;
|
|
37
37
|
getLatestSubmissionValues(): Recordable<any>;
|
|
38
|
-
getState(): TtFormProps<
|
|
38
|
+
getState(): TtFormProps<Record<string, any>> | null;
|
|
39
39
|
getValues<T = Recordable<any>>(): Promise<T>;
|
|
40
40
|
isFieldValid(fieldName: string): Promise<boolean>;
|
|
41
41
|
merge(formApi: FormApi): any;
|
|
@@ -32,7 +32,7 @@ declare const __VLS_component: import('vue').DefineComponent<GroupFormSectionPro
|
|
|
32
32
|
whenAllRendered: typeof whenAllRendered;
|
|
33
33
|
navItems: import('vue').ComputedRef<NavAnchorItem[]>;
|
|
34
34
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<GroupFormSectionProps> & Readonly<{}>, {
|
|
35
|
-
commonConfig: import('../types').FormCommonConfig
|
|
35
|
+
commonConfig: import('../types').FormCommonConfig<Record<string, any>>;
|
|
36
36
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
37
37
|
scrollRef: HTMLDivElement;
|
|
38
38
|
}, any>;
|
|
@@ -53,18 +53,18 @@ const Le = 5, Ve = 500, po = /* @__PURE__ */ ae({
|
|
|
53
53
|
},
|
|
54
54
|
setup(Y, { expose: $ }) {
|
|
55
55
|
var k;
|
|
56
|
-
const { prefixCls: A } = Te("group-form"), g = Y, h = se(),
|
|
56
|
+
const { prefixCls: A } = Te("group-form"), g = Y, h = se(), s = g.formApi, c = Oe();
|
|
57
57
|
_(Ne, c), _(He, (e) => {
|
|
58
|
-
e.type === "group" ?
|
|
59
|
-
}), _(Pe,
|
|
60
|
-
const { collapseStates: B } =
|
|
58
|
+
e.type === "group" ? s.setGroupVisible(e.key, e.visible) : s.setFieldsVisible(e.fieldNames, e.visible);
|
|
59
|
+
}), _(Pe, s.hiddenGroupKeys);
|
|
60
|
+
const { collapseStates: B } = s, p = g.formApi.useStore(), r = Re(g, p), M = /* @__PURE__ */ new Map(), U = a(
|
|
61
61
|
() => ({
|
|
62
62
|
...r.value,
|
|
63
|
-
schema:
|
|
63
|
+
schema: p.value.schema
|
|
64
64
|
})
|
|
65
|
-
), { form:
|
|
66
|
-
Be([r,
|
|
67
|
-
const b = a(() =>
|
|
65
|
+
), { form: f } = Ae(U);
|
|
66
|
+
Be([r, f]);
|
|
67
|
+
const b = a(() => p.value.groupSchema ?? []), q = a(() => ({
|
|
68
68
|
collapseStates: B,
|
|
69
69
|
commonConfig: r.value.commonConfig,
|
|
70
70
|
globalCommonConfig: Se,
|
|
@@ -77,15 +77,15 @@ const Le = 5, Ve = 500, po = /* @__PURE__ */ ae({
|
|
|
77
77
|
estimateFieldHeight: r.value.estimateFieldHeight
|
|
78
78
|
}));
|
|
79
79
|
Fe({
|
|
80
|
-
schema:
|
|
80
|
+
schema: p.value.schema,
|
|
81
81
|
commonConfig: r.value.commonConfig,
|
|
82
82
|
componentMap: _e,
|
|
83
83
|
componentBindEventMap: Ee,
|
|
84
|
-
form:
|
|
84
|
+
form: f,
|
|
85
85
|
layout: r.value.layout,
|
|
86
86
|
compact: r.value.compact,
|
|
87
87
|
wrapperClass: r.value.wrapperClass
|
|
88
|
-
}), Me(M), g.formApi.mount(
|
|
88
|
+
}), Me(M), g.formApi.mount(f, M);
|
|
89
89
|
const v = ie("scrollRef"), y = a(() => {
|
|
90
90
|
const e = r.value.containerHeight;
|
|
91
91
|
return e !== "100%" && e !== void 0;
|
|
@@ -98,13 +98,13 @@ const Le = 5, Ve = 500, po = /* @__PURE__ */ ae({
|
|
|
98
98
|
};
|
|
99
99
|
});
|
|
100
100
|
function W(e) {
|
|
101
|
-
|
|
101
|
+
s.toggleCollapse(e);
|
|
102
102
|
}
|
|
103
103
|
function j(e) {
|
|
104
104
|
const o = [];
|
|
105
105
|
for (const t of e)
|
|
106
106
|
if (Ie(t)) {
|
|
107
|
-
const n = t.title, l = ye(n) ? () => n(
|
|
107
|
+
const n = t.title, l = ye(n) ? () => n(f.values, s) : n;
|
|
108
108
|
o.push({ key: t.key, title: l });
|
|
109
109
|
}
|
|
110
110
|
return o;
|
|
@@ -117,8 +117,8 @@ const Le = 5, Ve = 500, po = /* @__PURE__ */ ae({
|
|
|
117
117
|
})
|
|
118
118
|
), N = a(() => ({
|
|
119
119
|
...r.value.navAnchorProps ?? {},
|
|
120
|
-
badgeCounts:
|
|
121
|
-
})), O = a(() => N.value.show ?? !1), S = a(() => O.value ? j(b.value).filter((e) => !
|
|
120
|
+
badgeCounts: s.navErrorCounts
|
|
121
|
+
})), O = a(() => N.value.show ?? !1), S = a(() => O.value ? j(b.value).filter((e) => !s.hiddenGroupKeys.has(e.key)) : []), Q = a(() => {
|
|
122
122
|
const { show: e, ...o } = N.value;
|
|
123
123
|
return { ...o, items: S.value };
|
|
124
124
|
}), E = ce(((k = S.value[0]) == null ? void 0 : k.key) || "");
|
|
@@ -126,7 +126,7 @@ const Le = 5, Ve = 500, po = /* @__PURE__ */ ae({
|
|
|
126
126
|
var o;
|
|
127
127
|
return ((o = h[`nav-description-${e.row.key}`]) == null ? void 0 : o.call(h, {
|
|
128
128
|
row: e.row,
|
|
129
|
-
values:
|
|
129
|
+
values: f.values
|
|
130
130
|
})) ?? [];
|
|
131
131
|
}
|
|
132
132
|
function Z() {
|
|
@@ -163,14 +163,14 @@ const Le = 5, Ve = 500, po = /* @__PURE__ */ ae({
|
|
|
163
163
|
e ? e.scrollTo({ top: n, behavior: t }) : window.scrollTo({ top: n, behavior: t });
|
|
164
164
|
}
|
|
165
165
|
function G(e) {
|
|
166
|
-
const o = v.value, t =
|
|
167
|
-
P(l,
|
|
166
|
+
const o = v.value, t = p.value.scrollOffset ?? 0, n = ee(e) || o, l = n && n.scrollHeight > n.clientHeight ? n : null, i = l ?? document.documentElement, u = H(e, l, t);
|
|
167
|
+
P(l, u, "smooth");
|
|
168
168
|
let d = !1;
|
|
169
|
-
const
|
|
170
|
-
d || (d = !0,
|
|
169
|
+
const m = () => {
|
|
170
|
+
d || (d = !0, i.removeEventListener("scrollend", m), clearTimeout(C), c.resume(), r.value.virtual && te(e, l, t));
|
|
171
171
|
};
|
|
172
|
-
|
|
173
|
-
const C = setTimeout(
|
|
172
|
+
i.addEventListener("scrollend", m, { once: !0 });
|
|
173
|
+
const C = setTimeout(m, 800);
|
|
174
174
|
}
|
|
175
175
|
function I(e) {
|
|
176
176
|
c.pause(), R(() => {
|
|
@@ -194,27 +194,27 @@ const Le = 5, Ve = 500, po = /* @__PURE__ */ ae({
|
|
|
194
194
|
}
|
|
195
195
|
function te(e, o, t) {
|
|
196
196
|
const n = o ?? document.documentElement;
|
|
197
|
-
let l,
|
|
198
|
-
function
|
|
199
|
-
|
|
197
|
+
let l, i;
|
|
198
|
+
function u() {
|
|
199
|
+
m.disconnect(), clearTimeout(l), cancelAnimationFrame(i);
|
|
200
200
|
}
|
|
201
201
|
function d() {
|
|
202
|
-
clearTimeout(l), l = setTimeout(
|
|
202
|
+
clearTimeout(l), l = setTimeout(u, Ve);
|
|
203
203
|
}
|
|
204
|
-
const
|
|
204
|
+
const m = new ResizeObserver(() => {
|
|
205
205
|
if (!e.isConnected) {
|
|
206
|
-
|
|
206
|
+
u();
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
|
-
cancelAnimationFrame(
|
|
209
|
+
cancelAnimationFrame(i), i = requestAnimationFrame(() => {
|
|
210
210
|
const C = H(e, o, t), le = o ? o.scrollTop : window.scrollY;
|
|
211
211
|
Math.abs(C - le) > Le && P(o, C, "instant");
|
|
212
212
|
}), d();
|
|
213
213
|
});
|
|
214
|
-
|
|
214
|
+
m.observe(n), d();
|
|
215
215
|
}
|
|
216
216
|
function re(e) {
|
|
217
|
-
E.value = e, B[e] &&
|
|
217
|
+
E.value = e, B[e] && s.toggleCollapse(e), I(e);
|
|
218
218
|
}
|
|
219
219
|
async function ne() {
|
|
220
220
|
c.resume(), await c.whenAllSettled(), await R(), await new Promise((e) => requestAnimationFrame(() => e()));
|
|
@@ -235,10 +235,10 @@ const Le = 5, Ve = 500, po = /* @__PURE__ */ ae({
|
|
|
235
235
|
key: w(Ge)(t, n),
|
|
236
236
|
schema: t
|
|
237
237
|
}, { ref_for: !0 }, q.value, { onToggleCollapse: W }), ve({ _: 2 }, [
|
|
238
|
-
x(w(h), (l,
|
|
239
|
-
name:
|
|
240
|
-
fn: de((
|
|
241
|
-
ge(e.$slots,
|
|
238
|
+
x(w(h), (l, i) => ({
|
|
239
|
+
name: i,
|
|
240
|
+
fn: de((u) => [
|
|
241
|
+
ge(e.$slots, i, F({ ref_for: !0 }, u || {}))
|
|
242
242
|
])
|
|
243
243
|
}))
|
|
244
244
|
]), 1040, ["schema"]))), 128))
|