@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.
Files changed (30) hide show
  1. package/dist/components/tt-form/src/config.js +44 -42
  2. package/dist/components/tt-form/src/form-render/FormField.vue2.js +67 -70
  3. package/dist/components/tt-form/src/form-render/FormFieldContact.d.ts +9 -0
  4. package/dist/components/tt-form/src/form-render/FormFieldContact.js +28 -25
  5. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +3 -0
  6. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +20 -18
  7. package/dist/components/tt-form/src/form-render/array-register/props.d.ts +4 -0
  8. package/dist/components/tt-form/src/form-render/array-register/props.js +1 -0
  9. package/dist/components/tt-form/src/form-render/array-register/types.d.ts +4 -0
  10. package/dist/components/tt-form/src/form-render/dependencies.d.ts +5 -0
  11. package/dist/components/tt-form/src/form-render/dependencies.js +77 -39
  12. package/dist/components/tt-form/src/group-form/GroupForm.vue.d.ts +15 -7
  13. package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +120 -104
  14. package/dist/components/tt-form/src/group-form/GroupSection.vue.d.ts +1 -0
  15. package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +68 -64
  16. package/dist/components/tt-form/src/group-form/LazyFormField.vue.d.ts +1 -0
  17. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +131 -101
  18. package/dist/components/tt-form/src/group-form/groupFormApi.d.ts +110 -46
  19. package/dist/components/tt-form/src/group-form/groupFormApi.js +465 -314
  20. package/dist/components/tt-form/src/group-form/lazyContext.d.ts +15 -13
  21. package/dist/components/tt-form/src/group-form/lazyContext.js +42 -26
  22. package/dist/components/tt-form/src/group-form/types.d.ts +13 -3
  23. package/dist/components/tt-form/src/group-form/useGroupForm.js +47 -50
  24. package/dist/components/tt-form/src/hooks/useFieldArray.js +101 -93
  25. package/dist/components/tt-form/src/hooks/useSelectCollapse.js +47 -47
  26. package/dist/components/tt-form/src/types.d.ts +3 -5
  27. package/dist/components/tt-modal-form/index.vue.js +12 -11
  28. package/dist/components/tt-table/src/TableForm.vue.js +3 -2
  29. package/dist/style.css +1 -1
  30. package/package.json +3 -3
@@ -1,10 +1,10 @@
1
- import { defineComponent as te, useSlots as re, provide as C, computed as s, useTemplateRef as ne, ref as le, createElementBlock as k, openBlock as T, Fragment as L, createBlock as V, createCommentVNode as ae, createElementVNode as K, mergeProps as A, unref as y, withModifiers as se, normalizeClass as ie, normalizeStyle as ce, renderList as D, createSlots as ue, withCtx as me, renderSlot as pe, h as fe, nextTick as ve } from "vue";
2
- import { TtNavAnchor as de } from "../../../tt-nav-anchor/index.js";
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 ge } from "../../../../packages/hooks/src/useDesign.js";
4
+ import { useDesign as Te } from "../../../../packages/hooks/src/useDesign.js";
5
5
  import "axios";
6
6
  import "element-plus";
7
- import { isFunction as he } from "../../../../packages/utils/src/is.js";
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 Ce, COMPONENT_BIND_EVENT_MAP as Te, COMPONENT_MAP as ye } from "../config.js";
19
- import { provideFormRenderProps as Ee } from "../form-render/context.js";
20
- import { useForwardPriorityValues as _e } from "../hooks/useForwardPriorityValues.js";
21
- import { useFormInitial as we, provideFormProps as Re, provideComponentRefMap as Se } from "../useFormContext.js";
22
- import Ae from "./GroupSection.vue2.js";
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 { VIRTUAL_ERROR_CACHE_KEY as Fe, RENDER_SCHEDULER_KEY as Be, createRenderScheduler as Me, GROUP_VISIBILITY_CALLBACK_KEY as be, HIDDEN_GROUP_KEYS_KEY as Oe } from "./lazyContext.js";
25
- import { getSchemaKey as He, isGroupSchema as Ne } from "./utils.js";
26
- import { getFormRootWrapperClass as Ie } from "../form-render/rootWrapperClass.js";
27
- const Pe = 5, Ge = 500, co = /* @__PURE__ */ te({
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: x }) {
54
- var G;
55
- const { prefixCls: F } = ge("group-form"), v = Y, d = re(), i = v.formApi;
56
- C(Fe, i.errorCacheMap);
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
- }), C(Oe, i.hiddenGroupKeys);
61
- const { collapseStates: B } = i, p = v.formApi.useStore(), r = _e(v, p), M = /* @__PURE__ */ new Map(), U = s(
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: p.value.schema
63
+ schema: f.value.schema
65
64
  })
66
- ), { form: u } = we(U);
67
- Re([r, u]);
68
- const b = s(() => p.value.groupSchema ?? []), $ = s(() => ({
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: Ce,
70
+ globalCommonConfig: Se,
72
71
  layout: r.value.layout,
73
72
  compact: r.value.compact,
74
73
  virtual: r.value.virtual,
75
- scrollElement: E.value,
74
+ progressive: r.value.progressive,
75
+ scrollElement: v.value,
76
76
  rootMargin: r.value.rootMargin,
77
77
  estimateFieldHeight: r.value.estimateFieldHeight
78
78
  }));
79
- Ee({
80
- schema: p.value.schema,
79
+ Fe({
80
+ schema: f.value.schema,
81
81
  commonConfig: r.value.commonConfig,
82
- componentMap: ye,
83
- componentBindEventMap: Te,
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
- }), Se(M), v.formApi.mount(u, M);
89
- const E = ne("scrollRef"), _ = s(() => {
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 = s(() => {
93
- const e = r.value.containerHeight, o = typeof e == "number" ? `${e}px` : e;
92
+ }), z = a(() => {
93
+ const e = r.value.containerHeight, o = we(e) ? `${e}px` : e;
94
94
  return {
95
- height: _.value ? void 0 : "100%",
96
- maxHeight: _.value ? o : void 0,
97
- overflow: _.value ? "auto" : void 0
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 q(e) {
100
+ function W(e) {
101
101
  i.toggleCollapse(e);
102
102
  }
103
- function W(e) {
103
+ function j(e) {
104
104
  const o = [];
105
105
  for (const t of e)
106
- if (Ne(t)) {
107
- const n = t.title, l = he(n) ? () => n(u.values, u) : n;
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 j = s(
113
- () => Ie({
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
- ), O = s(() => ({
118
+ ), N = a(() => ({
119
119
  ...r.value.navAnchorProps ?? {},
120
120
  badgeCounts: i.navErrorCounts
121
- })), H = s(() => O.value.show ?? !1), w = s(() => H.value ? W(b.value).filter((e) => !i.hiddenGroupKeys.has(e.key)) : []), J = s(() => {
122
- const { show: e, ...o } = O.value;
123
- return { ...o, items: w.value };
124
- }), R = le(((G = w.value[0]) == null ? void 0 : G.key) || "");
125
- function Q(e) {
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 = d[`nav-description-${e.row.key}`]) == null ? void 0 : o.call(d, {
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 X() {
133
- return fe(
134
- de,
132
+ function Z() {
133
+ return he(
134
+ Ce,
135
135
  {
136
- ...J.value,
137
- modelValue: R.value,
136
+ ...Q.value,
137
+ modelValue: E.value,
138
138
  "onUpdate:modelValue": (e) => {
139
- R.value = e;
139
+ E.value = e;
140
140
  },
141
- onChange: oe
141
+ onChange: re
142
142
  },
143
143
  {
144
- description: Q
144
+ description: X
145
145
  }
146
146
  );
147
147
  }
148
- function Z(e) {
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 N(e, o, t) {
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 I(e, o, t) {
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 P(e) {
166
- g.pause(), ve(() => {
167
- const o = E.value, t = o == null ? void 0 : o.querySelector(`[data-group-key="${e}"]`);
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
- g.resume();
189
+ c.resume();
170
190
  return;
171
191
  }
172
- const n = p.value.scrollOffset ?? 0, l = Z(t) || o, a = l && l.scrollHeight > l.clientHeight ? l : null, c = a ?? document.documentElement, h = N(t, a, n);
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 ee(e, o, t) {
195
+ function te(e, o, t) {
183
196
  const n = o ?? document.documentElement;
184
- let l, a;
185
- function c() {
186
- f.disconnect(), clearTimeout(l), cancelAnimationFrame(a);
197
+ let l, s;
198
+ function m() {
199
+ p.disconnect(), clearTimeout(l), cancelAnimationFrame(s);
187
200
  }
188
- function h() {
189
- clearTimeout(l), l = setTimeout(c, Ge);
201
+ function d() {
202
+ clearTimeout(l), l = setTimeout(m, Ve);
190
203
  }
191
- const f = new ResizeObserver(() => {
204
+ const p = new ResizeObserver(() => {
192
205
  if (!e.isConnected) {
193
- c();
206
+ m();
194
207
  return;
195
208
  }
196
- cancelAnimationFrame(a), a = requestAnimationFrame(() => {
197
- const m = N(e, o, t), S = o ? o.scrollTop : window.scrollY;
198
- Math.abs(m - S) > Pe && I(o, m, "instant");
199
- }), h();
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
- f.observe(n), h();
214
+ p.observe(n), d();
202
215
  }
203
- function oe(e) {
204
- R.value = e, B[e] && i.toggleCollapse(e), P(e);
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 x({ scrollToGroup: P, navItems: w }), (e, o) => (T(), k(L, null, [
207
- H.value ? (T(), V(X, { key: 0 })) : ae("", !0),
208
- K("form", A({ class: y(F) }, e.$attrs, {
209
- onSubmit: o[0] || (o[0] = se(() => {
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: E,
215
- style: ce(z.value),
216
- class: ie([`${y(F)}-scroll`, j.value])
230
+ ref: v,
231
+ style: fe(z.value),
232
+ class: pe([`${w(A)}-scroll`, J.value])
217
233
  }, [
218
- (T(!0), k(L, null, D(b.value, (t, n) => (T(), V(Ae, A({
219
- key: y(He)(t, n),
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 }, $.value, { onToggleCollapse: q }), ue({ _: 2 }, [
222
- D(y(d), (l, a) => ({
223
- name: a,
224
- fn: me((c) => [
225
- pe(e.$slots, a, A({ ref_for: !0 }, c || {}))
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
- co as default
251
+ po as default
236
252
  };
@@ -15,6 +15,7 @@ declare const __VLS_component: import('vue').DefineComponent<GroupSectionProps,
15
15
  compact: boolean;
16
16
  layout: string;
17
17
  virtual: boolean;
18
+ progressive: boolean;
18
19
  rootMargin: string;
19
20
  estimateFieldHeight: number;
20
21
  scrollElement: Element | null;
@@ -1,14 +1,14 @@
1
- import { defineComponent as we, computed as a, inject as ne, watch as Se, useSlots as be, 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 Fe, Fragment as H, renderList as S, createSlots as M, withCtx as k, guardReactiveProps as b, createElementVNode as F, withDirectives as Pe, createVNode as Ie, vShow as Ee } from "vue";
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 Ne from "../../../../assets/svg/arrowSUp.svg.js";
4
- import { TtIcon as Ve } from "../../../tt-icon/index.js";
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 Le } from "../../../../packages/hooks/src/useDesign.js";
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 ue } from "../../../../packages/utils/src/merge.js";
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 Be } from "../form-render/context.js";
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 Ge from "../form/RenderContent.vue.js";
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 Ae, GROUP_VISIBILITY_CALLBACK_KEY as He } from "./lazyContext.js";
28
- import { isGroupSchema as K, isRowSchema as ie, isSlotSchema as Z, getFieldNames as Me, getSchemaKey as Ke } from "./utils.js";
29
- const Te = ["data-group-key"], je = ["data-group-scroll-anchor"], me = "grid-cols-1", ze = /* @__PURE__ */ we({
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(fe, { emit: pe }) {
46
- const { prefixCls: s } = Le("group-section"), R = Oe(), N = Be().form, o = fe, x = pe, P = a(() => K(o.schema)), V = a(() => ie(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 = ne(Ae, void 0), oe = a(() => {
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(R.value, N) : !!u;
49
- }), ce = a(() => !(!oe.value || P.value && l.value && (T != null && T.has(l.value.key)))), j = ne(He, void 0), le = a(() => $.value ? Me($.value.children) : []);
50
- Se(
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(R.value, N) : !!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
- ), re = a(() => l.value ? ue(l.value.commonConfig ?? {}, o.commonConfig, o.globalCommonConfig) : ue(o.commonConfig, o.globalCommonConfig)), ve = a(() => ({
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: re.value,
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
- })), de = a(() => l.value ? c("grid gap-x-4", l.value.wrapperClass || me) : ""), ge = a(() => $.value ? c("grid gap-x-4 col-span-full", $.value.wrapperClass || me) : ""), Ce = a(() => P.value ? c(s, `${s}--group`, {
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`, ge.value) : c(s, `${s}--transparent`));
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: D = "",
81
- disabled: O,
82
- disabledOnChangeListener: B = !0,
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: ke = 70,
91
- modelPropName: $e = "",
92
- wrapperClass: se = ""
93
- } = re.value;
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 _e = e.useArraySchema && !e.wrapperClass ? c(se, u) : e.wrapperClass || se;
104
+ const we = e.useArraySchema && !e.wrapperClass ? c(ne, u) : e.wrapperClass || ne;
102
105
  return {
103
106
  colon: v,
104
- disabled: O,
105
- disabledOnChangeListener: B,
107
+ disabled: D,
108
+ disabledOnChangeListener: O,
106
109
  disabledOnInputListener: G,
107
110
  emptyStateValue: A,
108
111
  hideLabel: g,
109
112
  hideRequiredMark: n,
110
- labelWidth: ke,
111
- modelPropName: $e,
113
+ labelWidth: $e,
114
+ modelPropName: _e,
112
115
  ...e,
113
- wrapperClass: _e,
116
+ wrapperClass: we,
114
117
  commonComponentProps: _,
115
118
  componentProps: e.componentProps,
116
- controlClass: c(D, e.controlClass),
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: R.value,
127
- formActions: N
128
- })), te = be(), he = a(() => {
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(te);
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 ye() {
136
+ function ke() {
134
137
  E.value && l.value && x("toggleCollapse", l.value.key);
135
138
  }
136
- const ae = a(() => ({
137
- values: R.value,
138
- formActions: N
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(te).filter((e) => e !== "default"));
148
+ })), Y = a(() => Object.keys(ae).filter((e) => e !== "default"));
145
149
  return (e, u) => {
146
- var v, _, D, O, B, G, A;
147
- return ce.value ? (i(), h("div", {
150
+ var v, _, B, D, O, G, A;
151
+ return ve.value ? (i(), h("div", {
148
152
  key: 0,
149
- class: p(Ce.value),
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 }, ae.value))) : (i(), w(Fe(I.value.content(ae.value)), { key: 1 }))
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: ye
187
+ onClick: ke
184
188
  }, [
185
189
  F("div", {
186
190
  class: p(`${r(s)}__header-left`)
187
191
  }, [
188
- m(e.$slots, `${(D = l.value) == null ? void 0 : D.key}-header-left`, y(b(L.value))),
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
- (O = l.value) != null && O.title ? (i(), w(r(Ge), {
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, `${(B = l.value) == null ? void 0 : B.key}-title-right`, y(b(L.value)))
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
- Ie(r(Ve), {
208
- icon: z.value ? r(Re) : r(Ne),
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, je),
216
- Pe(F("div", {
219
+ ], 10, ze),
220
+ Ie(F("div", {
217
221
  class: p(`${r(s)}__body`)
218
222
  }, [
219
223
  F("div", {
220
- class: p(de.value)
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(Ke)(t, d)
229
+ key: r(Te)(t, d)
226
230
  }, [
227
- r(K)(t) || r(ie)(t) || r(Z)(t) ? (i(), w(ze, f({
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 }, ve.value, {
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(he.value, (n) => ({
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
- [Ee, !z.value]
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, Te)) : J("", !0);
285
+ ], 10, je)) : J("", !0);
282
286
  };
283
287
  }
284
288
  });
285
289
  export {
286
- ze as default
290
+ Ue as default
287
291
  };