@dazhicheng/ui 1.5.215 → 1.5.216
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/src/config.js +44 -42
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +67 -70
- package/dist/components/tt-form/src/form-render/FormFieldContact.d.ts +9 -0
- package/dist/components/tt-form/src/form-render/FormFieldContact.js +28 -25
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +3 -0
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +20 -18
- package/dist/components/tt-form/src/form-render/array-register/props.d.ts +4 -0
- package/dist/components/tt-form/src/form-render/array-register/props.js +1 -0
- package/dist/components/tt-form/src/form-render/array-register/types.d.ts +4 -0
- package/dist/components/tt-form/src/form-render/dependencies.d.ts +5 -0
- package/dist/components/tt-form/src/form-render/dependencies.js +77 -39
- package/dist/components/tt-form/src/group-form/GroupForm.vue.d.ts +15 -7
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +120 -104
- package/dist/components/tt-form/src/group-form/GroupSection.vue.d.ts +1 -0
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +68 -64
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.d.ts +1 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +131 -101
- package/dist/components/tt-form/src/group-form/groupFormApi.d.ts +110 -46
- package/dist/components/tt-form/src/group-form/groupFormApi.js +465 -314
- package/dist/components/tt-form/src/group-form/lazyContext.d.ts +15 -13
- package/dist/components/tt-form/src/group-form/lazyContext.js +42 -26
- package/dist/components/tt-form/src/group-form/types.d.ts +13 -3
- package/dist/components/tt-form/src/group-form/useGroupForm.js +47 -50
- package/dist/components/tt-form/src/hooks/useFieldArray.js +101 -93
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +47 -47
- package/dist/components/tt-form/src/types.d.ts +3 -5
- package/dist/components/tt-modal-form/index.vue.js +12 -11
- package/dist/components/tt-table/src/TableForm.vue.js +3 -2
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TtNavAnchor as
|
|
1
|
+
import { defineComponent as ae, useSlots as se, provide as _, computed as a, useTemplateRef as ie, ref as ce, createElementBlock as L, openBlock as T, Fragment as V, createBlock as D, createCommentVNode as ue, createElementVNode as K, mergeProps as F, unref as w, withModifiers as me, normalizeClass as pe, normalizeStyle as fe, renderList as x, createSlots as ve, withCtx as de, renderSlot as ge, h as he, nextTick as R } from "vue";
|
|
2
|
+
import { TtNavAnchor as Ce } from "../../../tt-nav-anchor/index.js";
|
|
3
3
|
import "../../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
4
|
-
import { useDesign as
|
|
4
|
+
import { useDesign as Te } from "../../../../packages/hooks/src/useDesign.js";
|
|
5
5
|
import "axios";
|
|
6
6
|
import "element-plus";
|
|
7
|
-
import { isFunction as
|
|
7
|
+
import { isNumber as we, isFunction as ye } from "../../../../packages/utils/src/is.js";
|
|
8
8
|
import "xe-utils";
|
|
9
9
|
import "dayjs";
|
|
10
10
|
import "dayjs/plugin/utc";
|
|
@@ -15,21 +15,22 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/en
|
|
|
15
15
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
16
16
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
17
17
|
import "lodash-es";
|
|
18
|
-
import { DEFAULT_FORM_COMMON_CONFIG as
|
|
19
|
-
import { provideFormRenderProps as
|
|
20
|
-
import { useForwardPriorityValues as
|
|
21
|
-
import { useFormInitial as
|
|
22
|
-
import
|
|
18
|
+
import { DEFAULT_FORM_COMMON_CONFIG as Se, COMPONENT_BIND_EVENT_MAP as Ee, COMPONENT_MAP as _e } from "../config.js";
|
|
19
|
+
import { provideFormRenderProps as Fe } from "../form-render/context.js";
|
|
20
|
+
import { useForwardPriorityValues as Re } from "../hooks/useForwardPriorityValues.js";
|
|
21
|
+
import { useFormInitial as Ae, provideFormProps as Be, provideComponentRefMap as Me } from "../useFormContext.js";
|
|
22
|
+
import be from "./GroupSection.vue2.js";
|
|
23
23
|
/* empty css */
|
|
24
|
-
import {
|
|
25
|
-
import { getSchemaKey as
|
|
26
|
-
import { getFormRootWrapperClass as
|
|
27
|
-
const
|
|
24
|
+
import { RENDER_SCHEDULER_KEY as Ne, createRenderScheduler as Oe, GROUP_VISIBILITY_CALLBACK_KEY as He, HIDDEN_GROUP_KEYS_KEY as Pe } from "./lazyContext.js";
|
|
25
|
+
import { getSchemaKey as Ge, isGroupSchema as Ie } from "./utils.js";
|
|
26
|
+
import { getFormRootWrapperClass as ke } from "../form-render/rootWrapperClass.js";
|
|
27
|
+
const Le = 5, Ve = 500, po = /* @__PURE__ */ ae({
|
|
28
28
|
name: "TtVirtualGroupForm",
|
|
29
29
|
inheritAttrs: !1,
|
|
30
30
|
__name: "GroupForm",
|
|
31
31
|
props: {
|
|
32
32
|
virtual: { type: Boolean },
|
|
33
|
+
progressive: { type: Boolean },
|
|
33
34
|
scrollToFirstError: { type: Boolean },
|
|
34
35
|
containerHeight: {},
|
|
35
36
|
rootMargin: {},
|
|
@@ -50,102 +51,101 @@ const Pe = 5, Ge = 500, co = /* @__PURE__ */ te({
|
|
|
50
51
|
formApi: {},
|
|
51
52
|
navAnchorProps: {}
|
|
52
53
|
},
|
|
53
|
-
setup(Y, { expose:
|
|
54
|
-
var
|
|
55
|
-
const { prefixCls:
|
|
56
|
-
|
|
57
|
-
const g = Me();
|
|
58
|
-
C(Be, g), C(be, (e) => {
|
|
54
|
+
setup(Y, { expose: $ }) {
|
|
55
|
+
var k;
|
|
56
|
+
const { prefixCls: A } = Te("group-form"), g = Y, h = se(), i = g.formApi, c = Oe();
|
|
57
|
+
_(Ne, c), _(He, (e) => {
|
|
59
58
|
e.type === "group" ? i.setGroupVisible(e.key, e.visible) : i.setFieldsVisible(e.fieldNames, e.visible);
|
|
60
|
-
}),
|
|
61
|
-
const { collapseStates: B } = i,
|
|
59
|
+
}), _(Pe, i.hiddenGroupKeys);
|
|
60
|
+
const { collapseStates: B } = i, f = g.formApi.useStore(), r = Re(g, f), M = /* @__PURE__ */ new Map(), U = a(
|
|
62
61
|
() => ({
|
|
63
62
|
...r.value,
|
|
64
|
-
schema:
|
|
63
|
+
schema: f.value.schema
|
|
65
64
|
})
|
|
66
|
-
), { form: u } =
|
|
67
|
-
|
|
68
|
-
const b =
|
|
65
|
+
), { form: u } = Ae(U);
|
|
66
|
+
Be([r, u]);
|
|
67
|
+
const b = a(() => f.value.groupSchema ?? []), q = a(() => ({
|
|
69
68
|
collapseStates: B,
|
|
70
69
|
commonConfig: r.value.commonConfig,
|
|
71
|
-
globalCommonConfig:
|
|
70
|
+
globalCommonConfig: Se,
|
|
72
71
|
layout: r.value.layout,
|
|
73
72
|
compact: r.value.compact,
|
|
74
73
|
virtual: r.value.virtual,
|
|
75
|
-
|
|
74
|
+
progressive: r.value.progressive,
|
|
75
|
+
scrollElement: v.value,
|
|
76
76
|
rootMargin: r.value.rootMargin,
|
|
77
77
|
estimateFieldHeight: r.value.estimateFieldHeight
|
|
78
78
|
}));
|
|
79
|
-
|
|
80
|
-
schema:
|
|
79
|
+
Fe({
|
|
80
|
+
schema: f.value.schema,
|
|
81
81
|
commonConfig: r.value.commonConfig,
|
|
82
|
-
componentMap:
|
|
83
|
-
componentBindEventMap:
|
|
82
|
+
componentMap: _e,
|
|
83
|
+
componentBindEventMap: Ee,
|
|
84
84
|
form: u,
|
|
85
85
|
layout: r.value.layout,
|
|
86
86
|
compact: r.value.compact,
|
|
87
87
|
wrapperClass: r.value.wrapperClass
|
|
88
|
-
}),
|
|
89
|
-
const
|
|
88
|
+
}), Me(M), g.formApi.mount(u, M);
|
|
89
|
+
const v = ie("scrollRef"), y = a(() => {
|
|
90
90
|
const e = r.value.containerHeight;
|
|
91
91
|
return e !== "100%" && e !== void 0;
|
|
92
|
-
}), z =
|
|
93
|
-
const e = r.value.containerHeight, o =
|
|
92
|
+
}), z = a(() => {
|
|
93
|
+
const e = r.value.containerHeight, o = we(e) ? `${e}px` : e;
|
|
94
94
|
return {
|
|
95
|
-
height:
|
|
96
|
-
maxHeight:
|
|
97
|
-
overflow:
|
|
95
|
+
height: y.value ? void 0 : "100%",
|
|
96
|
+
maxHeight: y.value ? o : void 0,
|
|
97
|
+
overflow: y.value ? "auto" : void 0
|
|
98
98
|
};
|
|
99
99
|
});
|
|
100
|
-
function
|
|
100
|
+
function W(e) {
|
|
101
101
|
i.toggleCollapse(e);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function j(e) {
|
|
104
104
|
const o = [];
|
|
105
105
|
for (const t of e)
|
|
106
|
-
if (
|
|
107
|
-
const n = t.title, l =
|
|
106
|
+
if (Ie(t)) {
|
|
107
|
+
const n = t.title, l = ye(n) ? () => n(u.values, u) : n;
|
|
108
108
|
o.push({ key: t.key, title: l });
|
|
109
109
|
}
|
|
110
110
|
return o;
|
|
111
111
|
}
|
|
112
|
-
const
|
|
113
|
-
() =>
|
|
112
|
+
const J = a(
|
|
113
|
+
() => ke({
|
|
114
114
|
layout: r.value.layout,
|
|
115
115
|
compact: r.value.compact,
|
|
116
116
|
wrapperClass: r.value.wrapperClass
|
|
117
117
|
})
|
|
118
|
-
),
|
|
118
|
+
), N = a(() => ({
|
|
119
119
|
...r.value.navAnchorProps ?? {},
|
|
120
120
|
badgeCounts: i.navErrorCounts
|
|
121
|
-
})),
|
|
122
|
-
const { show: e, ...o } =
|
|
123
|
-
return { ...o, items:
|
|
124
|
-
}),
|
|
125
|
-
function
|
|
121
|
+
})), O = a(() => N.value.show ?? !1), S = a(() => O.value ? j(b.value).filter((e) => !i.hiddenGroupKeys.has(e.key)) : []), Q = a(() => {
|
|
122
|
+
const { show: e, ...o } = N.value;
|
|
123
|
+
return { ...o, items: S.value };
|
|
124
|
+
}), E = ce(((k = S.value[0]) == null ? void 0 : k.key) || "");
|
|
125
|
+
function X(e) {
|
|
126
126
|
var o;
|
|
127
|
-
return ((o =
|
|
127
|
+
return ((o = h[`nav-description-${e.row.key}`]) == null ? void 0 : o.call(h, {
|
|
128
128
|
row: e.row,
|
|
129
129
|
values: u.values
|
|
130
130
|
})) ?? [];
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
134
|
-
|
|
132
|
+
function Z() {
|
|
133
|
+
return he(
|
|
134
|
+
Ce,
|
|
135
135
|
{
|
|
136
|
-
...
|
|
137
|
-
modelValue:
|
|
136
|
+
...Q.value,
|
|
137
|
+
modelValue: E.value,
|
|
138
138
|
"onUpdate:modelValue": (e) => {
|
|
139
|
-
|
|
139
|
+
E.value = e;
|
|
140
140
|
},
|
|
141
|
-
onChange:
|
|
141
|
+
onChange: re
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
|
-
description:
|
|
144
|
+
description: X
|
|
145
145
|
}
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function ee(e) {
|
|
149
149
|
let o = e;
|
|
150
150
|
for (; o && o !== document.documentElement; ) {
|
|
151
151
|
const { overflowY: t } = getComputedStyle(o);
|
|
@@ -155,74 +155,90 @@ const Pe = 5, Ge = 500, co = /* @__PURE__ */ te({
|
|
|
155
155
|
}
|
|
156
156
|
return null;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function H(e, o, t) {
|
|
159
159
|
return o ? e.getBoundingClientRect().top - o.getBoundingClientRect().top + o.scrollTop - t : e.getBoundingClientRect().top + window.scrollY - t;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function P(e, o, t) {
|
|
162
162
|
const n = Math.max(0, o);
|
|
163
163
|
e ? e.scrollTo({ top: n, behavior: t }) : window.scrollTo({ top: n, behavior: t });
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
function G(e) {
|
|
166
|
+
const o = v.value, t = f.value.scrollOffset ?? 0, n = ee(e) || o, l = n && n.scrollHeight > n.clientHeight ? n : null, s = l ?? document.documentElement, m = H(e, l, t);
|
|
167
|
+
P(l, m, "smooth");
|
|
168
|
+
let d = !1;
|
|
169
|
+
const p = () => {
|
|
170
|
+
d || (d = !0, s.removeEventListener("scrollend", p), clearTimeout(C), c.resume(), r.value.virtual && te(e, l, t));
|
|
171
|
+
};
|
|
172
|
+
s.addEventListener("scrollend", p, { once: !0 });
|
|
173
|
+
const C = setTimeout(p, 800);
|
|
174
|
+
}
|
|
175
|
+
function I(e) {
|
|
176
|
+
c.pause(), R(() => {
|
|
177
|
+
const o = v.value, t = o == null ? void 0 : o.querySelector(`[data-group-key="${e}"]`);
|
|
178
|
+
if (!t) {
|
|
179
|
+
c.resume();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
G(t);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
function oe(e) {
|
|
186
|
+
c.pause(), R(() => {
|
|
187
|
+
const o = v.value, t = o == null ? void 0 : o.querySelector(`[data-field-anchor="${e}"]`);
|
|
168
188
|
if (!t) {
|
|
169
|
-
|
|
189
|
+
c.resume();
|
|
170
190
|
return;
|
|
171
191
|
}
|
|
172
|
-
|
|
173
|
-
I(a, h, "smooth");
|
|
174
|
-
let f = !1;
|
|
175
|
-
const m = () => {
|
|
176
|
-
f || (f = !0, c.removeEventListener("scrollend", m), clearTimeout(S), g.resume(), r.value.virtual && ee(t, a, n));
|
|
177
|
-
};
|
|
178
|
-
c.addEventListener("scrollend", m, { once: !0 });
|
|
179
|
-
const S = setTimeout(m, 800);
|
|
192
|
+
G(t);
|
|
180
193
|
});
|
|
181
194
|
}
|
|
182
|
-
function
|
|
195
|
+
function te(e, o, t) {
|
|
183
196
|
const n = o ?? document.documentElement;
|
|
184
|
-
let l,
|
|
185
|
-
function
|
|
186
|
-
|
|
197
|
+
let l, s;
|
|
198
|
+
function m() {
|
|
199
|
+
p.disconnect(), clearTimeout(l), cancelAnimationFrame(s);
|
|
187
200
|
}
|
|
188
|
-
function
|
|
189
|
-
clearTimeout(l), l = setTimeout(
|
|
201
|
+
function d() {
|
|
202
|
+
clearTimeout(l), l = setTimeout(m, Ve);
|
|
190
203
|
}
|
|
191
|
-
const
|
|
204
|
+
const p = new ResizeObserver(() => {
|
|
192
205
|
if (!e.isConnected) {
|
|
193
|
-
|
|
206
|
+
m();
|
|
194
207
|
return;
|
|
195
208
|
}
|
|
196
|
-
cancelAnimationFrame(
|
|
197
|
-
const
|
|
198
|
-
Math.abs(
|
|
199
|
-
}),
|
|
209
|
+
cancelAnimationFrame(s), s = requestAnimationFrame(() => {
|
|
210
|
+
const C = H(e, o, t), le = o ? o.scrollTop : window.scrollY;
|
|
211
|
+
Math.abs(C - le) > Le && P(o, C, "instant");
|
|
212
|
+
}), d();
|
|
200
213
|
});
|
|
201
|
-
|
|
214
|
+
p.observe(n), d();
|
|
202
215
|
}
|
|
203
|
-
function
|
|
204
|
-
|
|
216
|
+
function re(e) {
|
|
217
|
+
E.value = e, B[e] && i.toggleCollapse(e), I(e);
|
|
218
|
+
}
|
|
219
|
+
async function ne() {
|
|
220
|
+
c.resume(), await c.whenAllSettled(), await R(), await new Promise((e) => requestAnimationFrame(() => e()));
|
|
205
221
|
}
|
|
206
|
-
return
|
|
207
|
-
|
|
208
|
-
K("form",
|
|
209
|
-
onSubmit: o[0] || (o[0] =
|
|
222
|
+
return $({ scrollToGroup: I, scrollToField: oe, whenAllRendered: ne, navItems: S }), (e, o) => (T(), L(V, null, [
|
|
223
|
+
O.value ? (T(), D(Z, { key: 0 })) : ue("", !0),
|
|
224
|
+
K("form", F({ class: w(A) }, e.$attrs, {
|
|
225
|
+
onSubmit: o[0] || (o[0] = me(() => {
|
|
210
226
|
}, ["prevent"]))
|
|
211
227
|
}), [
|
|
212
228
|
K("div", {
|
|
213
229
|
ref_key: "scrollRef",
|
|
214
|
-
ref:
|
|
215
|
-
style:
|
|
216
|
-
class:
|
|
230
|
+
ref: v,
|
|
231
|
+
style: fe(z.value),
|
|
232
|
+
class: pe([`${w(A)}-scroll`, J.value])
|
|
217
233
|
}, [
|
|
218
|
-
(T(!0),
|
|
219
|
-
key:
|
|
234
|
+
(T(!0), L(V, null, x(b.value, (t, n) => (T(), D(be, F({
|
|
235
|
+
key: w(Ge)(t, n),
|
|
220
236
|
schema: t
|
|
221
|
-
}, { ref_for: !0 },
|
|
222
|
-
|
|
223
|
-
name:
|
|
224
|
-
fn:
|
|
225
|
-
|
|
237
|
+
}, { ref_for: !0 }, q.value, { onToggleCollapse: W }), ve({ _: 2 }, [
|
|
238
|
+
x(w(h), (l, s) => ({
|
|
239
|
+
name: s,
|
|
240
|
+
fn: de((m) => [
|
|
241
|
+
ge(e.$slots, s, F({ ref_for: !0 }, m || {}))
|
|
226
242
|
])
|
|
227
243
|
}))
|
|
228
244
|
]), 1040, ["schema"]))), 128))
|
|
@@ -232,5 +248,5 @@ const Pe = 5, Ge = 500, co = /* @__PURE__ */ te({
|
|
|
232
248
|
}
|
|
233
249
|
});
|
|
234
250
|
export {
|
|
235
|
-
|
|
251
|
+
po as default
|
|
236
252
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Se, computed as a, inject as ue, watch as be, useSlots as Fe, createElementBlock as h, createCommentVNode as J, openBlock as i, normalizeClass as p, createBlock as w, unref as r, renderSlot as m, normalizeProps as y, mergeProps as f, resolveDynamicComponent as Pe, Fragment as H, renderList as S, createSlots as M, withCtx as k, guardReactiveProps as b, createElementVNode as F, withDirectives as Ie, createVNode as Ee, vShow as Ne } from "vue";
|
|
2
2
|
import Re from "../../../../assets/svg/arrowDown.svg.js";
|
|
3
|
-
import
|
|
4
|
-
import { TtIcon as
|
|
3
|
+
import Ve from "../../../../assets/svg/arrowSUp.svg.js";
|
|
4
|
+
import { TtIcon as Le } from "../../../tt-icon/index.js";
|
|
5
5
|
import "../../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
6
|
-
import { useDesign as
|
|
6
|
+
import { useDesign as Be } from "../../../../packages/hooks/src/useDesign.js";
|
|
7
7
|
import "axios";
|
|
8
8
|
import "element-plus";
|
|
9
9
|
import { isFunction as Q, isString as De } from "../../../../packages/utils/src/is.js";
|
|
10
10
|
import { clnm as c } from "../../../../packages/utils/src/tool.js";
|
|
11
|
-
import { mergeWithArrayOverride as
|
|
11
|
+
import { mergeWithArrayOverride as ie } from "../../../../packages/utils/src/merge.js";
|
|
12
12
|
import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
13
13
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
14
14
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
@@ -16,17 +16,17 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mo
|
|
|
16
16
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
17
17
|
import "lodash-es";
|
|
18
18
|
import { useFormValues as Oe } from "vee-validate";
|
|
19
|
-
import { injectRenderFormProps as
|
|
19
|
+
import { injectRenderFormProps as Ge } from "../form-render/context.js";
|
|
20
20
|
import "../components/Slot.js";
|
|
21
21
|
import "../../../tt-form-item-error-tooltip/index.js";
|
|
22
22
|
import "@vueuse/core";
|
|
23
23
|
/* empty css */
|
|
24
|
-
import
|
|
24
|
+
import Ae from "../form/RenderContent.vue.js";
|
|
25
25
|
import { FieldRenderer as X } from "../form-render/FormFieldContact.js";
|
|
26
26
|
/* empty css */
|
|
27
|
-
import { HIDDEN_GROUP_KEYS_KEY as
|
|
28
|
-
import { isGroupSchema as K, isRowSchema as
|
|
29
|
-
const
|
|
27
|
+
import { HIDDEN_GROUP_KEYS_KEY as He, GROUP_VISIBILITY_CALLBACK_KEY as Me } from "./lazyContext.js";
|
|
28
|
+
import { isGroupSchema as K, isRowSchema as me, isSlotSchema as Z, getFieldNames as Ke, getSchemaKey as Te } from "./utils.js";
|
|
29
|
+
const je = ["data-group-key"], ze = ["data-group-scroll-anchor"], fe = "grid-cols-1", Ue = /* @__PURE__ */ Se({
|
|
30
30
|
__name: "GroupSection",
|
|
31
31
|
props: {
|
|
32
32
|
schema: {},
|
|
@@ -37,49 +37,52 @@ const Te = ["data-group-key"], je = ["data-group-scroll-anchor"], me = "grid-col
|
|
|
37
37
|
compact: { type: Boolean, default: !1 },
|
|
38
38
|
depth: { default: 0 },
|
|
39
39
|
virtual: { type: Boolean, default: !1 },
|
|
40
|
+
progressive: { type: Boolean, default: !1 },
|
|
40
41
|
scrollElement: { default: null },
|
|
41
42
|
rootMargin: { default: "200px 0px" },
|
|
42
43
|
estimateFieldHeight: { default: 52 }
|
|
43
44
|
},
|
|
44
45
|
emits: ["toggleCollapse"],
|
|
45
|
-
setup(
|
|
46
|
-
const { prefixCls: s } =
|
|
46
|
+
setup(pe, { emit: ce }) {
|
|
47
|
+
const { prefixCls: s } = Be("group-section"), N = Oe(), R = Ge().form, o = pe, x = ce, P = a(() => K(o.schema)), V = a(() => me(o.schema)), ee = a(() => Z(o.schema)), l = a(() => P.value ? o.schema : null), $ = a(() => V.value ? o.schema : null), I = a(() => ee.value ? o.schema : null), T = ue(He, void 0), oe = a(() => {
|
|
47
48
|
const u = o.schema.ifShow;
|
|
48
|
-
return u === void 0 || u === !0 ? !0 : Q(u) ? !!u(
|
|
49
|
-
}),
|
|
50
|
-
|
|
49
|
+
return u === void 0 || u === !0 ? !0 : Q(u) ? !!u(N.value, R) : !!u;
|
|
50
|
+
}), ve = a(() => !(!oe.value || P.value && l.value && (T != null && T.has(l.value.key)))), j = ue(Me, void 0), le = a(() => $.value ? Ke($.value.children) : []);
|
|
51
|
+
let re;
|
|
52
|
+
be(
|
|
51
53
|
[oe],
|
|
52
54
|
([e]) => {
|
|
53
|
-
j && (P.value && l.value ? j({ type: "group", key: l.value.key, visible: e }) : V.value && le.value.length && j({ type: "row", fieldNames: le.value, visible: e }));
|
|
55
|
+
j && re !== e && (re = e, P.value && l.value ? j({ type: "group", key: l.value.key, visible: e }) : V.value && le.value.length && j({ type: "row", fieldNames: le.value, visible: e }));
|
|
54
56
|
},
|
|
55
57
|
{ immediate: !0 }
|
|
56
58
|
);
|
|
57
59
|
const E = a(() => {
|
|
58
60
|
if (!l.value) return !1;
|
|
59
61
|
const { collapsible: e } = l.value;
|
|
60
|
-
return Q(e) ? e(
|
|
62
|
+
return Q(e) ? e(N.value, R) : !!e;
|
|
61
63
|
}), z = a(
|
|
62
64
|
() => l.value && E.value ? !!o.collapseStates[l.value.key] : !1
|
|
63
|
-
),
|
|
65
|
+
), te = a(() => l.value ? ie(l.value.commonConfig ?? {}, o.commonConfig, o.globalCommonConfig) : ie(o.commonConfig, o.globalCommonConfig)), de = a(() => ({
|
|
64
66
|
collapseStates: o.collapseStates,
|
|
65
|
-
commonConfig:
|
|
67
|
+
commonConfig: te.value,
|
|
66
68
|
globalCommonConfig: o.globalCommonConfig,
|
|
67
69
|
layout: o.layout,
|
|
68
70
|
compact: o.compact,
|
|
69
71
|
virtual: o.virtual,
|
|
72
|
+
progressive: o.progressive,
|
|
70
73
|
scrollElement: o.scrollElement,
|
|
71
74
|
rootMargin: o.rootMargin,
|
|
72
75
|
estimateFieldHeight: o.estimateFieldHeight
|
|
73
|
-
})),
|
|
76
|
+
})), ge = a(() => l.value ? c("grid gap-x-4", l.value.wrapperClass || fe) : ""), Ce = a(() => $.value ? c("grid gap-x-4 col-span-full", $.value.wrapperClass || fe) : ""), he = a(() => P.value ? c(s, `${s}--group`, {
|
|
74
77
|
[`${s}--nested`]: o.depth > 0
|
|
75
|
-
}) : V.value ? c(s, `${s}--row`,
|
|
78
|
+
}) : V.value ? c(s, `${s}--row`, Ce.value) : c(s, `${s}--transparent`));
|
|
76
79
|
function U(e, u) {
|
|
77
80
|
const {
|
|
78
81
|
colon: v = !1,
|
|
79
82
|
componentProps: _ = {},
|
|
80
|
-
controlClass:
|
|
81
|
-
disabled:
|
|
82
|
-
disabledOnChangeListener:
|
|
83
|
+
controlClass: B = "",
|
|
84
|
+
disabled: D,
|
|
85
|
+
disabledOnChangeListener: O = !0,
|
|
83
86
|
disabledOnInputListener: G = !0,
|
|
84
87
|
emptyStateValue: A = void 0,
|
|
85
88
|
formFieldProps: t = {},
|
|
@@ -87,10 +90,10 @@ const Te = ["data-group-key"], je = ["data-group-scroll-anchor"], me = "grid-col
|
|
|
87
90
|
hideLabel: g = !1,
|
|
88
91
|
hideRequiredMark: n = !1,
|
|
89
92
|
labelClass: C = "",
|
|
90
|
-
labelWidth:
|
|
91
|
-
modelPropName:
|
|
92
|
-
wrapperClass:
|
|
93
|
-
} =
|
|
93
|
+
labelWidth: $e = 70,
|
|
94
|
+
modelPropName: _e = "",
|
|
95
|
+
wrapperClass: ne = ""
|
|
96
|
+
} = te.value;
|
|
94
97
|
let q = e.formItemClass;
|
|
95
98
|
if (Q(e.formItemClass))
|
|
96
99
|
try {
|
|
@@ -98,22 +101,22 @@ const Te = ["data-group-key"], je = ["data-group-scroll-anchor"], me = "grid-col
|
|
|
98
101
|
} catch {
|
|
99
102
|
q = "";
|
|
100
103
|
}
|
|
101
|
-
const
|
|
104
|
+
const we = e.useArraySchema && !e.wrapperClass ? c(ne, u) : e.wrapperClass || ne;
|
|
102
105
|
return {
|
|
103
106
|
colon: v,
|
|
104
|
-
disabled:
|
|
105
|
-
disabledOnChangeListener:
|
|
107
|
+
disabled: D,
|
|
108
|
+
disabledOnChangeListener: O,
|
|
106
109
|
disabledOnInputListener: G,
|
|
107
110
|
emptyStateValue: A,
|
|
108
111
|
hideLabel: g,
|
|
109
112
|
hideRequiredMark: n,
|
|
110
|
-
labelWidth:
|
|
111
|
-
modelPropName:
|
|
113
|
+
labelWidth: $e,
|
|
114
|
+
modelPropName: _e,
|
|
112
115
|
...e,
|
|
113
|
-
wrapperClass:
|
|
116
|
+
wrapperClass: we,
|
|
114
117
|
commonComponentProps: _,
|
|
115
118
|
componentProps: e.componentProps,
|
|
116
|
-
controlClass: c(
|
|
119
|
+
controlClass: c(B, e.controlClass),
|
|
117
120
|
formFieldProps: { ...t, ...e.formFieldProps },
|
|
118
121
|
formItemClass: c("flex-shrink-0", d, q),
|
|
119
122
|
labelClass: c(C, e.labelClass)
|
|
@@ -123,37 +126,38 @@ const Te = ["data-group-key"], je = ["data-group-scroll-anchor"], me = "grid-col
|
|
|
123
126
|
group: l.value,
|
|
124
127
|
collapsed: z.value,
|
|
125
128
|
isCollapsible: E.value,
|
|
126
|
-
values:
|
|
127
|
-
formActions:
|
|
128
|
-
})),
|
|
129
|
+
values: N.value,
|
|
130
|
+
formActions: R
|
|
131
|
+
})), ae = Fe(), ye = a(() => {
|
|
129
132
|
var v;
|
|
130
|
-
const e = (v = l.value) == null ? void 0 : v.key, u = Object.keys(
|
|
133
|
+
const e = (v = l.value) == null ? void 0 : v.key, u = Object.keys(ae);
|
|
131
134
|
return e ? u.filter((_) => !_.startsWith(`${e}-`)) : u;
|
|
132
135
|
});
|
|
133
|
-
function
|
|
136
|
+
function ke() {
|
|
134
137
|
E.value && l.value && x("toggleCollapse", l.value.key);
|
|
135
138
|
}
|
|
136
|
-
const
|
|
137
|
-
values:
|
|
138
|
-
formActions:
|
|
139
|
+
const se = a(() => ({
|
|
140
|
+
values: N.value,
|
|
141
|
+
formActions: R
|
|
139
142
|
})), W = a(() => ({
|
|
140
143
|
virtual: o.virtual,
|
|
144
|
+
progressive: o.progressive,
|
|
141
145
|
scrollElement: o.scrollElement,
|
|
142
146
|
rootMargin: o.rootMargin,
|
|
143
147
|
estimateFieldHeight: o.estimateFieldHeight
|
|
144
|
-
})), Y = a(() => Object.keys(
|
|
148
|
+
})), Y = a(() => Object.keys(ae).filter((e) => e !== "default"));
|
|
145
149
|
return (e, u) => {
|
|
146
|
-
var v, _, D, O,
|
|
147
|
-
return
|
|
150
|
+
var v, _, B, D, O, G, A;
|
|
151
|
+
return ve.value ? (i(), h("div", {
|
|
148
152
|
key: 0,
|
|
149
|
-
class: p(
|
|
153
|
+
class: p(he.value),
|
|
150
154
|
"data-group-key": (v = l.value) == null ? void 0 : v.key
|
|
151
155
|
}, [
|
|
152
156
|
ee.value && I.value ? (i(), h("div", {
|
|
153
157
|
key: 0,
|
|
154
158
|
class: p([`${r(s)}__slot`, I.value.wrapperClass])
|
|
155
159
|
}, [
|
|
156
|
-
r(De)(I.value.content) ? m(e.$slots, I.value.content, y(f({ key: 0 },
|
|
160
|
+
r(De)(I.value.content) ? m(e.$slots, I.value.content, y(f({ key: 0 }, se.value))) : (i(), w(Pe(I.value.content(se.value)), { key: 1 }))
|
|
157
161
|
], 2)) : V.value ? (i(!0), h(H, { key: 1 }, S($.value.children, (t, d) => {
|
|
158
162
|
var g;
|
|
159
163
|
return i(), w(r(X), f({
|
|
@@ -180,21 +184,21 @@ const Te = ["data-group-key"], je = ["data-group-scroll-anchor"], me = "grid-col
|
|
|
180
184
|
{ [`${r(s)}__header--collapsible`]: E.value, [`${r(s)}__header--bar`]: e.depth === 0 }
|
|
181
185
|
]),
|
|
182
186
|
"data-group-scroll-anchor": (_ = l.value) == null ? void 0 : _.key,
|
|
183
|
-
onClick:
|
|
187
|
+
onClick: ke
|
|
184
188
|
}, [
|
|
185
189
|
F("div", {
|
|
186
190
|
class: p(`${r(s)}__header-left`)
|
|
187
191
|
}, [
|
|
188
|
-
m(e.$slots, `${(
|
|
192
|
+
m(e.$slots, `${(B = l.value) == null ? void 0 : B.key}-header-left`, y(b(L.value))),
|
|
189
193
|
F("span", {
|
|
190
194
|
class: p(`${r(s)}__title`)
|
|
191
195
|
}, [
|
|
192
|
-
(
|
|
196
|
+
(D = l.value) != null && D.title ? (i(), w(r(Ae), {
|
|
193
197
|
key: 0,
|
|
194
198
|
content: l.value.title
|
|
195
199
|
}, null, 8, ["content"])) : J("", !0)
|
|
196
200
|
], 2),
|
|
197
|
-
m(e.$slots, `${(
|
|
201
|
+
m(e.$slots, `${(O = l.value) == null ? void 0 : O.key}-title-right`, y(b(L.value)))
|
|
198
202
|
], 2),
|
|
199
203
|
F("div", {
|
|
200
204
|
class: p(`${r(s)}__header-right`)
|
|
@@ -204,35 +208,35 @@ const Te = ["data-group-key"], je = ["data-group-scroll-anchor"], me = "grid-col
|
|
|
204
208
|
key: 0,
|
|
205
209
|
class: p(`${r(s)}__arrow`)
|
|
206
210
|
}, [
|
|
207
|
-
|
|
208
|
-
icon: z.value ? r(Re) : r(
|
|
211
|
+
Ee(r(Le), {
|
|
212
|
+
icon: z.value ? r(Re) : r(Ve),
|
|
209
213
|
size: 12,
|
|
210
214
|
"is-custom-svg": ""
|
|
211
215
|
}, null, 8, ["icon"])
|
|
212
216
|
], 2)) : J("", !0),
|
|
213
217
|
m(e.$slots, `${(A = l.value) == null ? void 0 : A.key}-header-right`, y(b(L.value)))
|
|
214
218
|
], 2)
|
|
215
|
-
], 10,
|
|
216
|
-
|
|
219
|
+
], 10, ze),
|
|
220
|
+
Ie(F("div", {
|
|
217
221
|
class: p(`${r(s)}__body`)
|
|
218
222
|
}, [
|
|
219
223
|
F("div", {
|
|
220
|
-
class: p(
|
|
224
|
+
class: p(ge.value)
|
|
221
225
|
}, [
|
|
222
226
|
(i(!0), h(H, null, S(l.value.children, (t, d) => {
|
|
223
227
|
var g;
|
|
224
228
|
return i(), h(H, {
|
|
225
|
-
key: r(
|
|
229
|
+
key: r(Te)(t, d)
|
|
226
230
|
}, [
|
|
227
|
-
r(K)(t) || r(
|
|
231
|
+
r(K)(t) || r(me)(t) || r(Z)(t) ? (i(), w(Ue, f({
|
|
228
232
|
key: 0,
|
|
229
233
|
schema: t
|
|
230
|
-
}, { ref_for: !0 },
|
|
234
|
+
}, { ref_for: !0 }, de.value, {
|
|
231
235
|
depth: r(K)(t) ? e.depth + 1 : e.depth,
|
|
232
236
|
class: { "col-span-full": r(K)(t) || r(Z)(t) },
|
|
233
237
|
onToggleCollapse: u[0] || (u[0] = (n) => x("toggleCollapse", n))
|
|
234
238
|
}), M({ _: 2 }, [
|
|
235
|
-
S(
|
|
239
|
+
S(ye.value, (n) => ({
|
|
236
240
|
name: n,
|
|
237
241
|
fn: k((C) => [
|
|
238
242
|
m(e.$slots, n, f({ ref_for: !0 }, C))
|
|
@@ -259,7 +263,7 @@ const Te = ["data-group-key"], je = ["data-group-scroll-anchor"], me = "grid-col
|
|
|
259
263
|
}), 128))
|
|
260
264
|
], 2)
|
|
261
265
|
], 2), [
|
|
262
|
-
[
|
|
266
|
+
[Ne, !z.value]
|
|
263
267
|
])
|
|
264
268
|
], 64)) : (i(), w(r(X), f({
|
|
265
269
|
key: 2,
|
|
@@ -278,10 +282,10 @@ const Te = ["data-group-key"], je = ["data-group-scroll-anchor"], me = "grid-col
|
|
|
278
282
|
])
|
|
279
283
|
}))
|
|
280
284
|
]), 1040, ["field-config", "rules"]))
|
|
281
|
-
], 10,
|
|
285
|
+
], 10, je)) : J("", !0);
|
|
282
286
|
};
|
|
283
287
|
}
|
|
284
288
|
});
|
|
285
289
|
export {
|
|
286
|
-
|
|
290
|
+
Ue as default
|
|
287
291
|
};
|