@iswangh/element-plus-kit-form 0.1.3 → 0.2.0

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 (47) hide show
  1. package/README.md +151 -18
  2. package/dist/FormAction.vue.d.ts +30 -4
  3. package/dist/FormAction.vue.d.ts.map +1 -1
  4. package/dist/FormItem.vue.d.ts +4 -18
  5. package/dist/FormItem.vue.d.ts.map +1 -1
  6. package/dist/composables/index.d.ts +2 -0
  7. package/dist/composables/index.d.ts.map +1 -1
  8. package/dist/composables/useAutoExpandOnHover.d.ts +15 -0
  9. package/dist/composables/useAutoExpandOnHover.d.ts.map +1 -0
  10. package/dist/composables/useChangeEventState.d.ts +5 -27
  11. package/dist/composables/useChangeEventState.d.ts.map +1 -1
  12. package/dist/composables/useClearState.d.ts +17 -0
  13. package/dist/composables/useClearState.d.ts.map +1 -0
  14. package/dist/config/action.d.ts +34 -0
  15. package/dist/config/action.d.ts.map +1 -0
  16. package/dist/config/comp.d.ts +48 -0
  17. package/dist/config/comp.d.ts.map +1 -0
  18. package/dist/config/form.d.ts +6 -0
  19. package/dist/config/form.d.ts.map +1 -0
  20. package/dist/config/index.d.ts +4 -65
  21. package/dist/config/index.d.ts.map +1 -1
  22. package/dist/config/scroll.d.ts +7 -0
  23. package/dist/config/scroll.d.ts.map +1 -0
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1197 -382
  27. package/dist/style.css +1 -1
  28. package/dist/types/action.d.ts +58 -11
  29. package/dist/types/common.d.ts +5 -4
  30. package/dist/types/comp.d.ts +93 -0
  31. package/dist/types/el.d.ts +8 -8
  32. package/dist/types/form-item.d.ts +31 -92
  33. package/dist/types/index.d.ts +3 -0
  34. package/dist/types/index.d.ts.map +1 -1
  35. package/dist/types/layout.d.ts +6 -0
  36. package/dist/types/options.d.ts +15 -31
  37. package/dist/types/scope.d.ts +34 -0
  38. package/dist/utils/action.d.ts +10 -0
  39. package/dist/utils/action.d.ts.map +1 -0
  40. package/dist/utils/index.d.ts +2 -0
  41. package/dist/utils/index.d.ts.map +1 -1
  42. package/dist/utils/lodash.d.ts +6 -0
  43. package/dist/utils/lodash.d.ts.map +1 -0
  44. package/dist/utils/options.d.ts.map +1 -1
  45. package/dist/utils/value.d.ts +13 -5
  46. package/dist/utils/value.d.ts.map +1 -1
  47. package/package.json +5 -6
package/dist/index.js CHANGED
@@ -1,426 +1,1142 @@
1
- import { defineComponent as P, createElementBlock as N, openBlock as p, createElementVNode as J, computed as f, withDirectives as Q, createCommentVNode as ae, createBlock as I, unref as V, withCtx as b, Fragment as Z, renderList as B, mergeProps as D, createTextVNode as se, toDisplayString as ie, resolveDynamicComponent as F, vShow as ee, mergeModels as W, useModel as ce, ref as L, watch as G, watchEffect as ue, normalizeProps as te, guardReactiveProps as oe, createSlots as K, renderSlot as me, nextTick as H, useAttrs as fe, useSlots as de, withModifiers as pe, createVNode as q } from "vue";
2
- import { checkCondition as X } from "@iswangh/element-plus-kit-core";
3
- import { ElTreeSelect as ve, ElTransfer as ge, ElTimeSelect as he, ElTimePicker as Ce, ElSwitch as Ee, ElSlider as Ie, ElSelectV2 as ye, ElSelect as Ae, ElRate as be, ElRadioGroup as Se, ElMention as we, ElInputTag as Oe, ElInputNumber as ke, ElInput as De, ElDatePicker as Fe, ElDatePickerPanel as Te, ElColorPicker as Me, ElColorPickerPanel as Ve, ElCheckboxGroup as Pe, ElCascader as xe, ElAutocomplete as _e, ElFormItem as ne, ElButton as Be, ElCol as Ne, ElRow as Ue, ElForm as Re } from "element-plus";
4
- var $e = /* @__PURE__ */ P({
1
+ import { onBeforeUnmount as Lt, nextTick as le, defineComponent as re, createElementBlock as R, openBlock as x, createElementVNode as Be, computed as O, withDirectives as gt, createCommentVNode as ht, createBlock as A, unref as k, withCtx as B, Fragment as fe, renderSlot as zt, renderList as _e, mergeProps as de, normalizeClass as Gt, createVNode as ve, createTextVNode as Ht, toDisplayString as Wt, resolveDynamicComponent as H, vShow as vt, mergeModels as je, useModel as yt, ref as xe, watch as Oe, watchEffect as Kt, normalizeProps as ue, guardReactiveProps as ye, createSlots as Ne, useAttrs as qt, useSlots as Xt, onMounted as Yt, withModifiers as Jt, TransitionGroup as Zt } from "vue";
2
+ import { checkCondition as Le } from "@iswangh/element-plus-kit-core";
3
+ import { ElTreeSelect as Qt, ElTransfer as er, ElTimeSelect as tr, ElTimePicker as rr, ElSwitch as nr, ElSlider as or, ElSelectV2 as ar, ElSelect as ir, ElRate as sr, ElRadioGroup as cr, ElMention as ur, ElInputTag as lr, ElInputNumber as fr, ElInput as pr, ElDatePicker as dr, ElDatePickerPanel as mr, ElColorPicker as gr, ElColorPickerPanel as hr, ElCheckboxGroup as vr, ElCascader as yr, ElAutocomplete as br, ElFormItem as bt, ElButton as Tr, ElIcon as _r, ElCol as jr, ElRow as xr, ElForm as Or } from "element-plus";
4
+ function wr(e, t, r) {
5
+ let n = !1, o = null, i = null;
6
+ function u() {
7
+ o && (clearTimeout(o), o = null), i && (clearTimeout(i), i = null);
8
+ }
9
+ function v() {
10
+ !t.value || n || (o && clearTimeout(o), o = setTimeout(() => {
11
+ !e.value && !n && r(!0);
12
+ }, 500));
13
+ }
14
+ function m() {
15
+ o && (clearTimeout(o), o = null), i && clearTimeout(i), le(() => {
16
+ i = setTimeout(() => {
17
+ n = !1, i = null;
18
+ }, 100);
19
+ });
20
+ }
21
+ function d() {
22
+ t.value && (n = !0, u());
23
+ }
24
+ return Lt(u), {
25
+ onMouseEnter: v,
26
+ onMouseLeave: m,
27
+ recordManualToggle: d
28
+ };
29
+ }
30
+ function Er() {
31
+ let e = !1;
32
+ return {
33
+ /** 是否用户交互 */
34
+ get isUser() {
35
+ return e;
36
+ },
37
+ /** 开始用户交互 */
38
+ start() {
39
+ e = !0;
40
+ },
41
+ /** 结束用户交互(在 nextTick 中调用) */
42
+ end() {
43
+ e = !1;
44
+ }
45
+ };
46
+ }
47
+ function Ir() {
48
+ let e = !1, t = !1;
49
+ return {
50
+ /** 是否正在处理依赖变更 */
51
+ get changing() {
52
+ return e;
53
+ },
54
+ /** 用户是否在 change 事件中设置了值 */
55
+ get hasUserValue() {
56
+ return t;
57
+ },
58
+ /** 开始依赖变更处理 */
59
+ start() {
60
+ e = !0, t = !1;
61
+ },
62
+ /** 结束依赖变更处理 */
63
+ end() {
64
+ e = !1, t = !1;
65
+ },
66
+ /** 标记用户在 change 事件中设置了值 */
67
+ markValue() {
68
+ t = !0;
69
+ }
70
+ };
71
+ }
72
+ var $r = /* @__PURE__ */ re({
73
+ name: "ArrowDown",
74
+ __name: "arrow-down",
75
+ setup(e) {
76
+ return (t, r) => (x(), R("svg", {
77
+ xmlns: "http://www.w3.org/2000/svg",
78
+ viewBox: "0 0 1024 1024"
79
+ }, [
80
+ Be("path", {
81
+ fill: "currentColor",
82
+ d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
83
+ })
84
+ ]));
85
+ }
86
+ }), Ar = $r, Cr = /* @__PURE__ */ re({
5
87
  name: "Refresh",
6
88
  __name: "refresh",
7
89
  setup(e) {
8
- return (n, t) => (p(), N("svg", {
90
+ return (t, r) => (x(), R("svg", {
9
91
  xmlns: "http://www.w3.org/2000/svg",
10
92
  viewBox: "0 0 1024 1024"
11
93
  }, [
12
- J("path", {
94
+ Be("path", {
13
95
  fill: "currentColor",
14
96
  d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
15
97
  })
16
98
  ]));
17
99
  }
18
- }), je = $e, Le = /* @__PURE__ */ P({
100
+ }), Sr = Cr, Pr = /* @__PURE__ */ re({
19
101
  name: "Search",
20
102
  __name: "search",
21
103
  setup(e) {
22
- return (n, t) => (p(), N("svg", {
104
+ return (t, r) => (x(), R("svg", {
23
105
  xmlns: "http://www.w3.org/2000/svg",
24
106
  viewBox: "0 0 1024 1024"
25
107
  }, [
26
- J("path", {
108
+ Be("path", {
27
109
  fill: "currentColor",
28
110
  d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
29
111
  })
30
112
  ]));
31
113
  }
32
- }), ze = Le;
33
- const We = ["comp", "compAttrs", "vIf", "vShow"], Ge = {
34
- custom: "div"
35
- }, Ke = {
36
- autocomplete: _e,
37
- cascader: xe,
38
- checkbox: Pe,
39
- "color-picker-panel": Ve,
40
- "color-picker": Me,
41
- "date-picker-panel": Te,
42
- "date-picker": Fe,
43
- input: De,
44
- "input-number": ke,
45
- "input-tag": Oe,
46
- mention: we,
47
- radio: Se,
48
- rate: be,
49
- select: Ae,
50
- "select-v2": ye,
51
- slider: Ie,
52
- switch: Ee,
53
- "time-picker": Ce,
54
- "time-select": he,
55
- transfer: ge,
56
- "tree-select": ve
57
- }, He = {
58
- ...Ke,
59
- ...Ge
60
- }, qe = {
114
+ }), Mr = Pr;
115
+ const Fr = {
116
+ search: { label: "搜索", icon: Mr, type: "primary" },
117
+ reset: { label: "重置", icon: Sr },
118
+ submit: { label: "确认", type: "primary" },
119
+ cancel: { label: "取消" },
120
+ expand: { type: "text" }
121
+ }, Dr = {
122
+ /**
123
+ * 获取动作默认属性
124
+ */
125
+ getDefaults(e, t) {
126
+ return { ...this.buildActionProps(e), ...t };
127
+ },
128
+ /**
129
+ * 获取动作按钮列表
130
+ */
131
+ getActionButtons(e) {
132
+ return e ? ["search", "reset"] : ["submit", "cancel"];
133
+ },
134
+ /**
135
+ * 构建动作属性
136
+ */
137
+ buildActionProps(e) {
138
+ return {
139
+ buttons: this.getActionButtons(e),
140
+ vIf: e,
141
+ autoExpandOnError: !0,
142
+ vShow: !0
143
+ };
144
+ }
145
+ }, Br = ["compType", "compProps", "vIf", "vShow"], Vr = { custom: "div" }, kr = {
146
+ autocomplete: br,
147
+ cascader: yr,
148
+ checkbox: vr,
149
+ "color-picker-panel": hr,
150
+ "color-picker": gr,
151
+ "date-picker-panel": mr,
152
+ "date-picker": dr,
153
+ input: pr,
154
+ "input-number": fr,
155
+ "input-tag": lr,
156
+ mention: ur,
157
+ radio: cr,
158
+ rate: sr,
159
+ select: ir,
160
+ "select-v2": ar,
161
+ slider: or,
162
+ switch: nr,
163
+ "time-picker": rr,
164
+ "time-select": tr,
165
+ transfer: er,
166
+ "tree-select": Qt
167
+ }, Rr = { ...kr, ...Vr }, ze = {
61
168
  /**
62
169
  * 获取组件默认属性
63
170
  */
64
171
  getDefaults(e) {
65
- const { comp: n, compAttrs: t = {} } = e, s = this.getComponentType(n);
172
+ const { compType: t, compProps: r = {} } = e, n = this.getCompType(t);
66
173
  return {
67
- ...this.buildComponentAttrs(e, s),
68
- ...t
174
+ ...this.buildCompProps(e, n),
175
+ ...r
69
176
  // 用户配置最后合并,优先级最高
70
177
  };
71
178
  },
72
179
  /**
73
180
  * 判断组件类型
74
181
  */
75
- getComponentType(e) {
76
- const n = ["autocomplete", "input", "input-number", "input-tag", "mention"], t = ["cascader", "select", "select-v2", "tree-select"], s = ["date-picker", "time-select", "time-picker"];
77
- return n.includes(e) ? "input" : t.includes(e) ? "select" : s.includes(e) ? "picker" : "other";
182
+ getCompType(e) {
183
+ const t = ["autocomplete", "input", "input-number", "input-tag", "mention"], r = ["cascader", "select", "select-v2", "tree-select"], n = ["date-picker", "time-select", "time-picker"];
184
+ return t.includes(e) ? "input" : r.includes(e) ? "select" : n.includes(e) ? "picker" : "other";
78
185
  },
79
186
  /**
80
187
  * 动态生成 placeholder
81
188
  */
82
- generatePlaceholder(e, n) {
83
- const { label: t, comp: s } = e, l = t ? `${t}` : "";
84
- return n === "input" ? s === "input-number" ? "请输入" : `请输入${l}` : ["select", "picker"].includes(n) ? `请选择${l}` : "";
189
+ generatePlaceholder(e, t) {
190
+ const { label: r, compType: n } = e, o = r ? `${r}` : "";
191
+ return t === "input" ? n === "input-number" ? "请输入" : `请输入${o}` : ["select", "picker"].includes(t) ? `请选择${o}` : "";
85
192
  },
86
193
  /**
87
194
  * 构建组件属性
88
195
  */
89
- buildComponentAttrs(e, n) {
90
- const t = {};
91
- return ["input", "select", "picker"].includes(n) && (t.placeholder = this.generatePlaceholder(e, n), t.clearable = !0), ["select"].includes(n) && (t.filterable = !0), t;
196
+ buildCompProps(e, t) {
197
+ const r = {};
198
+ return ["input", "select", "picker"].includes(t) && (r.placeholder = this.generatePlaceholder(e, t), r.clearable = !0), ["select"].includes(t) && (r.filterable = !0), r;
92
199
  }
93
- }, Xe = {
200
+ }, Tt = {
201
+ behavior: "smooth",
202
+ // 平滑滚动
203
+ block: "center",
204
+ // 垂直居中,让错误项在视窗中间
205
+ inline: "nearest"
206
+ // 水平方向保持最近位置
207
+ }, Ur = {
94
208
  showMessage: !0,
95
209
  scrollToError: !0,
96
- scrollIntoViewOptions: {
97
- behavior: "smooth",
98
- // 平滑滚动
99
- block: "center",
100
- // 垂直居中,让错误项在视窗中间
101
- inline: "nearest"
102
- // 水平方向保持最近位置
103
- }
104
- }, Ye = {
105
- search: { label: "搜索", icon: ze, type: "primary" },
106
- reset: { label: "重置", icon: je },
107
- submit: { label: "确认", type: "primary" },
108
- cancel: { label: "取消" }
109
- }, Je = {
110
- getDefaults(e, n) {
111
- return {
112
- ...this.buildActionAttrs(e),
113
- ...n
114
- };
115
- },
116
- generateActionButtons(e) {
117
- return e ? ["search", "reset"] : ["submit", "cancel"];
118
- },
119
- buildActionAttrs(e) {
120
- return {
121
- buttons: this.generateActionButtons(e),
122
- vIf: e,
123
- vShow: !0
124
- };
125
- }
126
- }, Qe = /* @__PURE__ */ P({
210
+ scrollIntoViewOptions: Tt
211
+ }, Nr = /* @__PURE__ */ re({
127
212
  name: "ElementPlusKitFormItemAction",
128
213
  __name: "FormAction",
129
214
  props: {
130
215
  inline: { type: Boolean, default: !1 },
131
216
  actionSlot: {},
132
- config: { default: () => ({}) }
217
+ config: { default: () => ({}) },
218
+ expanded: { type: Boolean, default: !1 },
219
+ autoExpandOnHover: { type: Boolean },
220
+ onMouseEnter: {},
221
+ onMouseLeave: {}
133
222
  },
134
223
  emits: ["action"],
135
- setup(e) {
136
- const n = e, t = f(() => ({
137
- ...n,
138
- config: { ...Je.getDefaults(n.inline, n.config) }
139
- })), s = f(() => {
140
- const { buttons: d } = t.value.config;
141
- return d.map((m) => {
142
- if (typeof m != "string")
143
- return m;
144
- const v = Ye[m];
145
- return v ? { ...v, eventName: m } : { label: m.toUpperCase(), eventName: m };
224
+ setup(e, { emit: t }) {
225
+ const r = e, n = t, o = O(() => ({
226
+ ...r,
227
+ config: { ...Dr.getDefaults(r.inline, r.config) }
228
+ })), i = O(() => {
229
+ const { buttons: g } = o.value.config;
230
+ return g.map((_) => {
231
+ if (typeof _ != "string")
232
+ return _;
233
+ const f = Fr[_];
234
+ return f ? { ...f, eventName: _ } : { label: _.toUpperCase(), eventName: _ };
146
235
  });
147
- }), l = (d) => {
148
- const { label: m, eventName: v, ...g } = d;
149
- return g;
150
- };
151
- return (d, m) => t.value.config.vIf ? Q((p(), I(V(ne), {
236
+ });
237
+ function u(g) {
238
+ return g.eventName === "expand";
239
+ }
240
+ function v(g) {
241
+ const { label: _, eventName: f, ...w } = g;
242
+ if (u(g)) {
243
+ const j = r.expanded ? "收起" : "展开";
244
+ return {
245
+ ...w,
246
+ title: j,
247
+ "aria-label": j,
248
+ "aria-expanded": r.expanded
249
+ };
250
+ }
251
+ return w;
252
+ }
253
+ function m(g) {
254
+ const _ = g.eventName, f = u(g) ? r.expanded : void 0;
255
+ n("action", { eventName: _, data: f });
256
+ }
257
+ function d(g) {
258
+ u(g) && r.autoExpandOnHover && r.onMouseEnter?.();
259
+ }
260
+ function I(g) {
261
+ u(g) && r.autoExpandOnHover && r.onMouseLeave?.();
262
+ }
263
+ return (g, _) => o.value.config.vIf ? gt((x(), A(k(bt), {
152
264
  key: 0,
153
265
  prop: "action"
154
266
  }, {
155
- default: b(() => [
156
- e.actionSlot ? (p(), I(F(e.actionSlot), {
267
+ default: B(() => [
268
+ e.actionSlot ? (x(), A(H(e.actionSlot), {
157
269
  key: 1,
158
270
  prop: "action"
159
- })) : (p(!0), N(Z, { key: 0 }, B(s.value, (v, g) => (p(), I(V(Be), D({
160
- key: `${v.label}-${g}`
161
- }, { ref_for: !0 }, l(v), {
162
- onClick: (T) => d.$emit("action", { eventName: v.eventName })
163
- }), {
164
- default: b(() => [
165
- se(ie(v.label ?? ""), 1)
166
- ]),
167
- _: 2
168
- }, 1040, ["onClick"]))), 128))
271
+ })) : (x(), R(fe, { key: 0 }, [
272
+ (x(!0), R(fe, null, _e(i.value, (f, w) => (x(), A(k(Tr), de({
273
+ key: `${f.eventName}-${w}`
274
+ }, { ref_for: !0 }, v(f), {
275
+ onMouseenter: (j) => d(f),
276
+ onMouseleave: (j) => I(f),
277
+ onClick: (j) => m(f)
278
+ }), {
279
+ default: B(() => [
280
+ u(f) && e.inline ? (x(), A(k(_r), {
281
+ key: 0,
282
+ class: Gt(["expand-toggle-icon", { "is-expanded": e.expanded }])
283
+ }, {
284
+ default: B(() => [
285
+ ve(k(Ar))
286
+ ]),
287
+ _: 1
288
+ }, 8, ["class"])) : (x(), R(fe, { key: 1 }, [
289
+ Ht(Wt(f.label ?? ""), 1)
290
+ ], 64))
291
+ ]),
292
+ _: 2
293
+ }, 1040, ["onMouseenter", "onMouseleave", "onClick"]))), 128)),
294
+ zt(g.$slots, "default", {}, void 0, !0)
295
+ ], 64))
169
296
  ]),
170
- _: 1
297
+ _: 3
171
298
  }, 512)), [
172
- [ee, t.value.config.vShow]
173
- ]) : ae("", !0);
299
+ [vt, o.value.config.vShow]
300
+ ]) : ht("", !0);
174
301
  }
175
- });
176
- function Ze() {
177
- let e = !1, n = !1, t = null, s = !1;
178
- return {
179
- /** 是否正在清理 */
180
- get isClearing() {
181
- return e;
182
- },
183
- /** 是否用户交互 */
184
- get isUserInteraction() {
185
- return n;
186
- },
187
- /**
188
- * 开始清理操作
189
- * @param value - 清理前的值
190
- */
191
- startClearing(l) {
192
- e = !0, t = l, s = !0;
193
- },
194
- /**
195
- * 结束清理操作(在 nextTick 中调用)
196
- */
197
- endClearing() {
198
- e = !1, t = null, s = !1;
199
- },
200
- /**
201
- * 开始用户交互
202
- */
203
- startUserInteraction() {
204
- n = !0;
205
- },
206
- /**
207
- * 结束用户交互(在 nextTick 中调用)
208
- */
209
- endUserInteraction() {
210
- n = !1;
211
- },
212
- /**
213
- * 判断是否是清理操作
214
- * @param oldValue - 旧值
215
- * @param newValue - 新值
216
- * @param isEmpty - 检查值是否为空的函数
217
- */
218
- isClearingOperation(l, d, m) {
219
- return !!(e || s || !m(l) && m(d) && l === t);
302
+ }), _t = (e, t) => {
303
+ const r = e.__vccOpts || e;
304
+ for (const [n, o] of t)
305
+ r[n] = o;
306
+ return r;
307
+ }, Lr = /* @__PURE__ */ _t(Nr, [["__scopeId", "data-v-3e763e14"]]);
308
+ function zr(e, t) {
309
+ return e ? e.some((r) => typeof r == "string" ? r === t : r.eventName === t) : !1;
310
+ }
311
+ var jt = typeof global == "object" && global && global.Object === Object && global, Gr = typeof self == "object" && self && self.Object === Object && self, M = jt || Gr || Function("return this")(), ee = M.Symbol, xt = Object.prototype, Hr = xt.hasOwnProperty, Wr = xt.toString, ce = ee ? ee.toStringTag : void 0;
312
+ function Kr(e) {
313
+ var t = Hr.call(e, ce), r = e[ce];
314
+ try {
315
+ e[ce] = void 0;
316
+ var n = !0;
317
+ } catch {
318
+ }
319
+ var o = Wr.call(e);
320
+ return n && (t ? e[ce] = r : delete e[ce]), o;
321
+ }
322
+ var qr = Object.prototype, Xr = qr.toString;
323
+ function Yr(e) {
324
+ return Xr.call(e);
325
+ }
326
+ var Jr = "[object Null]", Zr = "[object Undefined]", Ge = ee ? ee.toStringTag : void 0;
327
+ function ne(e) {
328
+ return e == null ? e === void 0 ? Zr : Jr : Ge && Ge in Object(e) ? Kr(e) : Yr(e);
329
+ }
330
+ function oe(e) {
331
+ return e != null && typeof e == "object";
332
+ }
333
+ var Qr = "[object Symbol]";
334
+ function en(e) {
335
+ return typeof e == "symbol" || oe(e) && ne(e) == Qr;
336
+ }
337
+ var we = Array.isArray, tn = /\s/;
338
+ function rn(e) {
339
+ for (var t = e.length; t-- && tn.test(e.charAt(t)); )
340
+ ;
341
+ return t;
342
+ }
343
+ var nn = /^\s+/;
344
+ function on(e) {
345
+ return e && e.slice(0, rn(e) + 1).replace(nn, "");
346
+ }
347
+ function q(e) {
348
+ var t = typeof e;
349
+ return e != null && (t == "object" || t == "function");
350
+ }
351
+ var He = NaN, an = /^[-+]0x[0-9a-f]+$/i, sn = /^0b[01]+$/i, cn = /^0o[0-7]+$/i, un = parseInt;
352
+ function We(e) {
353
+ if (typeof e == "number")
354
+ return e;
355
+ if (en(e))
356
+ return He;
357
+ if (q(e)) {
358
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
359
+ e = q(t) ? t + "" : t;
360
+ }
361
+ if (typeof e != "string")
362
+ return e === 0 ? e : +e;
363
+ e = on(e);
364
+ var r = sn.test(e);
365
+ return r || cn.test(e) ? un(e.slice(2), r ? 2 : 8) : an.test(e) ? He : +e;
366
+ }
367
+ var ln = "[object AsyncFunction]", fn = "[object Function]", pn = "[object GeneratorFunction]", dn = "[object Proxy]";
368
+ function Ot(e) {
369
+ if (!q(e))
370
+ return !1;
371
+ var t = ne(e);
372
+ return t == fn || t == pn || t == ln || t == dn;
373
+ }
374
+ var Ae = M["__core-js_shared__"], Ke = (function() {
375
+ var e = /[^.]+$/.exec(Ae && Ae.keys && Ae.keys.IE_PROTO || "");
376
+ return e ? "Symbol(src)_1." + e : "";
377
+ })();
378
+ function mn(e) {
379
+ return !!Ke && Ke in e;
380
+ }
381
+ var gn = Function.prototype, hn = gn.toString;
382
+ function Y(e) {
383
+ if (e != null) {
384
+ try {
385
+ return hn.call(e);
386
+ } catch {
220
387
  }
388
+ try {
389
+ return e + "";
390
+ } catch {
391
+ }
392
+ }
393
+ return "";
394
+ }
395
+ var vn = /[\\^$.*+?()[\]{}|]/g, yn = /^\[object .+?Constructor\]$/, bn = Function.prototype, Tn = Object.prototype, _n = bn.toString, jn = Tn.hasOwnProperty, xn = RegExp(
396
+ "^" + _n.call(jn).replace(vn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
397
+ );
398
+ function On(e) {
399
+ if (!q(e) || mn(e))
400
+ return !1;
401
+ var t = Ot(e) ? xn : yn;
402
+ return t.test(Y(e));
403
+ }
404
+ function wn(e, t) {
405
+ return e?.[t];
406
+ }
407
+ function J(e, t) {
408
+ var r = wn(e, t);
409
+ return On(r) ? r : void 0;
410
+ }
411
+ var Pe = J(M, "WeakMap"), qe = Object.create, En = /* @__PURE__ */ (function() {
412
+ function e() {
413
+ }
414
+ return function(t) {
415
+ if (!q(t))
416
+ return {};
417
+ if (qe)
418
+ return qe(t);
419
+ e.prototype = t;
420
+ var r = new e();
421
+ return e.prototype = void 0, r;
422
+ };
423
+ })(), Xe = (function() {
424
+ try {
425
+ var e = J(Object, "defineProperty");
426
+ return e({}, "", {}), e;
427
+ } catch {
428
+ }
429
+ })();
430
+ function In(e, t) {
431
+ for (var r = -1, n = e == null ? 0 : e.length; ++r < n && t(e[r], r, e) !== !1; )
432
+ ;
433
+ return e;
434
+ }
435
+ var $n = 9007199254740991, An = /^(?:0|[1-9]\d*)$/;
436
+ function Cn(e, t) {
437
+ var r = typeof e;
438
+ return t = t ?? $n, !!t && (r == "number" || r != "symbol" && An.test(e)) && e > -1 && e % 1 == 0 && e < t;
439
+ }
440
+ function Sn(e, t, r) {
441
+ t == "__proto__" && Xe ? Xe(e, t, {
442
+ configurable: !0,
443
+ enumerable: !0,
444
+ value: r,
445
+ writable: !0
446
+ }) : e[t] = r;
447
+ }
448
+ function wt(e, t) {
449
+ return e === t || e !== e && t !== t;
450
+ }
451
+ var Pn = Object.prototype, Mn = Pn.hasOwnProperty;
452
+ function Fn(e, t, r) {
453
+ var n = e[t];
454
+ (!(Mn.call(e, t) && wt(n, r)) || r === void 0 && !(t in e)) && Sn(e, t, r);
455
+ }
456
+ var Dn = 9007199254740991;
457
+ function Et(e) {
458
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Dn;
459
+ }
460
+ function It(e) {
461
+ return e != null && Et(e.length) && !Ot(e);
462
+ }
463
+ var Bn = Object.prototype;
464
+ function Ve(e) {
465
+ var t = e && e.constructor, r = typeof t == "function" && t.prototype || Bn;
466
+ return e === r;
467
+ }
468
+ function Vn(e, t) {
469
+ for (var r = -1, n = Array(e); ++r < e; )
470
+ n[r] = t(r);
471
+ return n;
472
+ }
473
+ var kn = "[object Arguments]";
474
+ function Ye(e) {
475
+ return oe(e) && ne(e) == kn;
476
+ }
477
+ var $t = Object.prototype, Rn = $t.hasOwnProperty, Un = $t.propertyIsEnumerable, At = Ye(/* @__PURE__ */ (function() {
478
+ return arguments;
479
+ })()) ? Ye : function(e) {
480
+ return oe(e) && Rn.call(e, "callee") && !Un.call(e, "callee");
481
+ };
482
+ function Nn() {
483
+ return !1;
484
+ }
485
+ var Ct = typeof exports == "object" && exports && !exports.nodeType && exports, Je = Ct && typeof module == "object" && module && !module.nodeType && module, Ln = Je && Je.exports === Ct, Ze = Ln ? M.Buffer : void 0, zn = Ze ? Ze.isBuffer : void 0, ke = zn || Nn, Gn = "[object Arguments]", Hn = "[object Array]", Wn = "[object Boolean]", Kn = "[object Date]", qn = "[object Error]", Xn = "[object Function]", Yn = "[object Map]", Jn = "[object Number]", Zn = "[object Object]", Qn = "[object RegExp]", eo = "[object Set]", to = "[object String]", ro = "[object WeakMap]", no = "[object ArrayBuffer]", oo = "[object DataView]", ao = "[object Float32Array]", io = "[object Float64Array]", so = "[object Int8Array]", co = "[object Int16Array]", uo = "[object Int32Array]", lo = "[object Uint8Array]", fo = "[object Uint8ClampedArray]", po = "[object Uint16Array]", mo = "[object Uint32Array]", T = {};
486
+ T[ao] = T[io] = T[so] = T[co] = T[uo] = T[lo] = T[fo] = T[po] = T[mo] = !0;
487
+ T[Gn] = T[Hn] = T[no] = T[Wn] = T[oo] = T[Kn] = T[qn] = T[Xn] = T[Yn] = T[Jn] = T[Zn] = T[Qn] = T[eo] = T[to] = T[ro] = !1;
488
+ function go(e) {
489
+ return oe(e) && Et(e.length) && !!T[ne(e)];
490
+ }
491
+ function Re(e) {
492
+ return function(t) {
493
+ return e(t);
221
494
  };
222
495
  }
223
- function re(e, n) {
496
+ var St = typeof exports == "object" && exports && !exports.nodeType && exports, pe = St && typeof module == "object" && module && !module.nodeType && module, ho = pe && pe.exports === St, Ce = ho && jt.process, te = (function() {
497
+ try {
498
+ var e = pe && pe.require && pe.require("util").types;
499
+ return e || Ce && Ce.binding && Ce.binding("util");
500
+ } catch {
501
+ }
502
+ })(), Qe = te && te.isTypedArray, Pt = Qe ? Re(Qe) : go, vo = Object.prototype, yo = vo.hasOwnProperty;
503
+ function bo(e, t) {
504
+ var r = we(e), n = !r && At(e), o = !r && !n && ke(e), i = !r && !n && !o && Pt(e), u = r || n || o || i, v = u ? Vn(e.length, String) : [], m = v.length;
505
+ for (var d in e)
506
+ yo.call(e, d) && !(u && // Safari 9 has enumerable `arguments.length` in strict mode.
507
+ (d == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
508
+ o && (d == "offset" || d == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
509
+ i && (d == "buffer" || d == "byteLength" || d == "byteOffset") || // Skip index properties.
510
+ Cn(d, m))) && v.push(d);
511
+ return v;
512
+ }
513
+ function Mt(e, t) {
514
+ return function(r) {
515
+ return e(t(r));
516
+ };
517
+ }
518
+ var To = Mt(Object.keys, Object), _o = Object.prototype, jo = _o.hasOwnProperty;
519
+ function Ft(e) {
520
+ if (!Ve(e))
521
+ return To(e);
522
+ var t = [];
523
+ for (var r in Object(e))
524
+ jo.call(e, r) && r != "constructor" && t.push(r);
525
+ return t;
526
+ }
527
+ function xo(e) {
528
+ return It(e) ? bo(e) : Ft(e);
529
+ }
530
+ var me = J(Object, "create");
531
+ function Oo() {
532
+ this.__data__ = me ? me(null) : {}, this.size = 0;
533
+ }
534
+ function wo(e) {
535
+ var t = this.has(e) && delete this.__data__[e];
536
+ return this.size -= t ? 1 : 0, t;
537
+ }
538
+ var Eo = "__lodash_hash_undefined__", Io = Object.prototype, $o = Io.hasOwnProperty;
539
+ function Ao(e) {
540
+ var t = this.__data__;
541
+ if (me) {
542
+ var r = t[e];
543
+ return r === Eo ? void 0 : r;
544
+ }
545
+ return $o.call(t, e) ? t[e] : void 0;
546
+ }
547
+ var Co = Object.prototype, So = Co.hasOwnProperty;
548
+ function Po(e) {
549
+ var t = this.__data__;
550
+ return me ? t[e] !== void 0 : So.call(t, e);
551
+ }
552
+ var Mo = "__lodash_hash_undefined__";
553
+ function Fo(e, t) {
554
+ var r = this.__data__;
555
+ return this.size += this.has(e) ? 0 : 1, r[e] = me && t === void 0 ? Mo : t, this;
556
+ }
557
+ function X(e) {
558
+ var t = -1, r = e == null ? 0 : e.length;
559
+ for (this.clear(); ++t < r; ) {
560
+ var n = e[t];
561
+ this.set(n[0], n[1]);
562
+ }
563
+ }
564
+ X.prototype.clear = Oo;
565
+ X.prototype.delete = wo;
566
+ X.prototype.get = Ao;
567
+ X.prototype.has = Po;
568
+ X.prototype.set = Fo;
569
+ function Do() {
570
+ this.__data__ = [], this.size = 0;
571
+ }
572
+ function Ee(e, t) {
573
+ for (var r = e.length; r--; )
574
+ if (wt(e[r][0], t))
575
+ return r;
576
+ return -1;
577
+ }
578
+ var Bo = Array.prototype, Vo = Bo.splice;
579
+ function ko(e) {
580
+ var t = this.__data__, r = Ee(t, e);
581
+ if (r < 0)
582
+ return !1;
583
+ var n = t.length - 1;
584
+ return r == n ? t.pop() : Vo.call(t, r, 1), --this.size, !0;
585
+ }
586
+ function Ro(e) {
587
+ var t = this.__data__, r = Ee(t, e);
588
+ return r < 0 ? void 0 : t[r][1];
589
+ }
590
+ function Uo(e) {
591
+ return Ee(this.__data__, e) > -1;
592
+ }
593
+ function No(e, t) {
594
+ var r = this.__data__, n = Ee(r, e);
595
+ return n < 0 ? (++this.size, r.push([e, t])) : r[n][1] = t, this;
596
+ }
597
+ function U(e) {
598
+ var t = -1, r = e == null ? 0 : e.length;
599
+ for (this.clear(); ++t < r; ) {
600
+ var n = e[t];
601
+ this.set(n[0], n[1]);
602
+ }
603
+ }
604
+ U.prototype.clear = Do;
605
+ U.prototype.delete = ko;
606
+ U.prototype.get = Ro;
607
+ U.prototype.has = Uo;
608
+ U.prototype.set = No;
609
+ var ge = J(M, "Map");
610
+ function Lo() {
611
+ this.size = 0, this.__data__ = {
612
+ hash: new X(),
613
+ map: new (ge || U)(),
614
+ string: new X()
615
+ };
616
+ }
617
+ function zo(e) {
618
+ var t = typeof e;
619
+ return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
620
+ }
621
+ function Ie(e, t) {
622
+ var r = e.__data__;
623
+ return zo(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
624
+ }
625
+ function Go(e) {
626
+ var t = Ie(this, e).delete(e);
627
+ return this.size -= t ? 1 : 0, t;
628
+ }
629
+ function Ho(e) {
630
+ return Ie(this, e).get(e);
631
+ }
632
+ function Wo(e) {
633
+ return Ie(this, e).has(e);
634
+ }
635
+ function Ko(e, t) {
636
+ var r = Ie(this, e), n = r.size;
637
+ return r.set(e, t), this.size += r.size == n ? 0 : 1, this;
638
+ }
639
+ function ae(e) {
640
+ var t = -1, r = e == null ? 0 : e.length;
641
+ for (this.clear(); ++t < r; ) {
642
+ var n = e[t];
643
+ this.set(n[0], n[1]);
644
+ }
645
+ }
646
+ ae.prototype.clear = Lo;
647
+ ae.prototype.delete = Go;
648
+ ae.prototype.get = Ho;
649
+ ae.prototype.has = Wo;
650
+ ae.prototype.set = Ko;
651
+ function qo(e, t) {
652
+ for (var r = -1, n = t.length, o = e.length; ++r < n; )
653
+ e[o + r] = t[r];
654
+ return e;
655
+ }
656
+ var Xo = Mt(Object.getPrototypeOf, Object);
657
+ function Yo() {
658
+ this.__data__ = new U(), this.size = 0;
659
+ }
660
+ function Jo(e) {
661
+ var t = this.__data__, r = t.delete(e);
662
+ return this.size = t.size, r;
663
+ }
664
+ function Zo(e) {
665
+ return this.__data__.get(e);
666
+ }
667
+ function Qo(e) {
668
+ return this.__data__.has(e);
669
+ }
670
+ var ea = 200;
671
+ function ta(e, t) {
672
+ var r = this.__data__;
673
+ if (r instanceof U) {
674
+ var n = r.__data__;
675
+ if (!ge || n.length < ea - 1)
676
+ return n.push([e, t]), this.size = ++r.size, this;
677
+ r = this.__data__ = new ae(n);
678
+ }
679
+ return r.set(e, t), this.size = r.size, this;
680
+ }
681
+ function ie(e) {
682
+ var t = this.__data__ = new U(e);
683
+ this.size = t.size;
684
+ }
685
+ ie.prototype.clear = Yo;
686
+ ie.prototype.delete = Jo;
687
+ ie.prototype.get = Zo;
688
+ ie.prototype.has = Qo;
689
+ ie.prototype.set = ta;
690
+ var Dt = typeof exports == "object" && exports && !exports.nodeType && exports, et = Dt && typeof module == "object" && module && !module.nodeType && module, ra = et && et.exports === Dt, tt = ra ? M.Buffer : void 0;
691
+ tt && tt.allocUnsafe;
692
+ function na(e, t) {
693
+ return e.slice();
694
+ }
695
+ function oa(e, t) {
696
+ for (var r = -1, n = e == null ? 0 : e.length, o = 0, i = []; ++r < n; ) {
697
+ var u = e[r];
698
+ t(u, r, e) && (i[o++] = u);
699
+ }
700
+ return i;
701
+ }
702
+ function aa() {
703
+ return [];
704
+ }
705
+ var ia = Object.prototype, sa = ia.propertyIsEnumerable, rt = Object.getOwnPropertySymbols, ca = rt ? function(e) {
706
+ return e == null ? [] : (e = Object(e), oa(rt(e), function(t) {
707
+ return sa.call(e, t);
708
+ }));
709
+ } : aa;
710
+ function ua(e, t, r) {
711
+ var n = t(e);
712
+ return we(e) ? n : qo(n, r(e));
713
+ }
714
+ function la(e) {
715
+ return ua(e, xo, ca);
716
+ }
717
+ var Me = J(M, "DataView"), Fe = J(M, "Promise"), De = J(M, "Set"), nt = "[object Map]", fa = "[object Object]", ot = "[object Promise]", at = "[object Set]", it = "[object WeakMap]", st = "[object DataView]", pa = Y(Me), da = Y(ge), ma = Y(Fe), ga = Y(De), ha = Y(Pe), D = ne;
718
+ (Me && D(new Me(new ArrayBuffer(1))) != st || ge && D(new ge()) != nt || Fe && D(Fe.resolve()) != ot || De && D(new De()) != at || Pe && D(new Pe()) != it) && (D = function(e) {
719
+ var t = ne(e), r = t == fa ? e.constructor : void 0, n = r ? Y(r) : "";
720
+ if (n)
721
+ switch (n) {
722
+ case pa:
723
+ return st;
724
+ case da:
725
+ return nt;
726
+ case ma:
727
+ return ot;
728
+ case ga:
729
+ return at;
730
+ case ha:
731
+ return it;
732
+ }
733
+ return t;
734
+ });
735
+ var va = Object.prototype, ya = va.hasOwnProperty;
736
+ function ba(e) {
737
+ var t = e.length, r = new e.constructor(t);
738
+ return t && typeof e[0] == "string" && ya.call(e, "index") && (r.index = e.index, r.input = e.input), r;
739
+ }
740
+ var ct = M.Uint8Array;
741
+ function Ue(e) {
742
+ var t = new e.constructor(e.byteLength);
743
+ return new ct(t).set(new ct(e)), t;
744
+ }
745
+ function Ta(e, t) {
746
+ var r = Ue(e.buffer);
747
+ return new e.constructor(r, e.byteOffset, e.byteLength);
748
+ }
749
+ var _a = /\w*$/;
750
+ function ja(e) {
751
+ var t = new e.constructor(e.source, _a.exec(e));
752
+ return t.lastIndex = e.lastIndex, t;
753
+ }
754
+ var ut = ee ? ee.prototype : void 0, lt = ut ? ut.valueOf : void 0;
755
+ function xa(e) {
756
+ return lt ? Object(lt.call(e)) : {};
757
+ }
758
+ function Oa(e, t) {
759
+ var r = Ue(e.buffer);
760
+ return new e.constructor(r, e.byteOffset, e.length);
761
+ }
762
+ var wa = "[object Boolean]", Ea = "[object Date]", Ia = "[object Map]", $a = "[object Number]", Aa = "[object RegExp]", Ca = "[object Set]", Sa = "[object String]", Pa = "[object Symbol]", Ma = "[object ArrayBuffer]", Fa = "[object DataView]", Da = "[object Float32Array]", Ba = "[object Float64Array]", Va = "[object Int8Array]", ka = "[object Int16Array]", Ra = "[object Int32Array]", Ua = "[object Uint8Array]", Na = "[object Uint8ClampedArray]", La = "[object Uint16Array]", za = "[object Uint32Array]";
763
+ function Ga(e, t, r) {
764
+ var n = e.constructor;
765
+ switch (t) {
766
+ case Ma:
767
+ return Ue(e);
768
+ case wa:
769
+ case Ea:
770
+ return new n(+e);
771
+ case Fa:
772
+ return Ta(e);
773
+ case Da:
774
+ case Ba:
775
+ case Va:
776
+ case ka:
777
+ case Ra:
778
+ case Ua:
779
+ case Na:
780
+ case La:
781
+ case za:
782
+ return Oa(e);
783
+ case Ia:
784
+ return new n();
785
+ case $a:
786
+ case Sa:
787
+ return new n(e);
788
+ case Aa:
789
+ return ja(e);
790
+ case Ca:
791
+ return new n();
792
+ case Pa:
793
+ return xa(e);
794
+ }
795
+ }
796
+ function Ha(e) {
797
+ return typeof e.constructor == "function" && !Ve(e) ? En(Xo(e)) : {};
798
+ }
799
+ var Wa = "[object Map]";
800
+ function Ka(e) {
801
+ return oe(e) && D(e) == Wa;
802
+ }
803
+ var ft = te && te.isMap, qa = ft ? Re(ft) : Ka, Xa = "[object Set]";
804
+ function Ya(e) {
805
+ return oe(e) && D(e) == Xa;
806
+ }
807
+ var pt = te && te.isSet, Ja = pt ? Re(pt) : Ya, Bt = "[object Arguments]", Za = "[object Array]", Qa = "[object Boolean]", ei = "[object Date]", ti = "[object Error]", Vt = "[object Function]", ri = "[object GeneratorFunction]", ni = "[object Map]", oi = "[object Number]", kt = "[object Object]", ai = "[object RegExp]", ii = "[object Set]", si = "[object String]", ci = "[object Symbol]", ui = "[object WeakMap]", li = "[object ArrayBuffer]", fi = "[object DataView]", pi = "[object Float32Array]", di = "[object Float64Array]", mi = "[object Int8Array]", gi = "[object Int16Array]", hi = "[object Int32Array]", vi = "[object Uint8Array]", yi = "[object Uint8ClampedArray]", bi = "[object Uint16Array]", Ti = "[object Uint32Array]", b = {};
808
+ b[Bt] = b[Za] = b[li] = b[fi] = b[Qa] = b[ei] = b[pi] = b[di] = b[mi] = b[gi] = b[hi] = b[ni] = b[oi] = b[kt] = b[ai] = b[ii] = b[si] = b[ci] = b[vi] = b[yi] = b[bi] = b[Ti] = !0;
809
+ b[ti] = b[Vt] = b[ui] = !1;
810
+ function be(e, t, r, n, o, i) {
811
+ var u;
812
+ if (u !== void 0)
813
+ return u;
814
+ if (!q(e))
815
+ return e;
816
+ var v = we(e);
817
+ if (v)
818
+ u = ba(e);
819
+ else {
820
+ var m = D(e), d = m == Vt || m == ri;
821
+ if (ke(e))
822
+ return na(e);
823
+ if (m == kt || m == Bt || d && !o)
824
+ u = d ? {} : Ha(e);
825
+ else {
826
+ if (!b[m])
827
+ return o ? e : {};
828
+ u = Ga(e, m);
829
+ }
830
+ }
831
+ i || (i = new ie());
832
+ var I = i.get(e);
833
+ if (I)
834
+ return I;
835
+ i.set(e, u), Ja(e) ? e.forEach(function(f) {
836
+ u.add(be(f, t, r, f, e, i));
837
+ }) : qa(e) && e.forEach(function(f, w) {
838
+ u.set(w, be(f, t, r, w, e, i));
839
+ });
840
+ var g = la, _ = v ? void 0 : g(e);
841
+ return In(_ || e, function(f, w) {
842
+ _ && (w = f, f = e[w]), Fn(u, w, be(f, t, r, w, e, i));
843
+ }), u;
844
+ }
845
+ var _i = 1, ji = 4;
846
+ function dt(e) {
847
+ return be(e, _i | ji);
848
+ }
849
+ var Se = function() {
850
+ return M.Date.now();
851
+ }, xi = "Expected a function", Oi = Math.max, wi = Math.min;
852
+ function Ei(e, t, r) {
853
+ var n, o, i, u, v, m, d = 0, I = !1, g = !1, _ = !0;
854
+ if (typeof e != "function")
855
+ throw new TypeError(xi);
856
+ t = We(t) || 0, q(r) && (I = !!r.leading, g = "maxWait" in r, i = g ? Oi(We(r.maxWait) || 0, t) : i, _ = "trailing" in r ? !!r.trailing : _);
857
+ function f(y) {
858
+ var $ = n, F = o;
859
+ return n = o = void 0, d = y, u = e.apply(F, $), u;
860
+ }
861
+ function w(y) {
862
+ return d = y, v = setTimeout(P, t), I ? f(y) : u;
863
+ }
864
+ function j(y) {
865
+ var $ = y - m, F = y - d, Z = t - $;
866
+ return g ? wi(Z, i - F) : Z;
867
+ }
868
+ function W(y) {
869
+ var $ = y - m, F = y - d;
870
+ return m === void 0 || $ >= t || $ < 0 || g && F >= i;
871
+ }
872
+ function P() {
873
+ var y = Se();
874
+ if (W(y))
875
+ return K(y);
876
+ v = setTimeout(P, j(y));
877
+ }
878
+ function K(y) {
879
+ return v = void 0, _ && n ? f(y) : (n = o = void 0, u);
880
+ }
881
+ function N() {
882
+ v !== void 0 && clearTimeout(v), d = 0, n = m = o = v = void 0;
883
+ }
884
+ function V() {
885
+ return v === void 0 ? u : K(Se());
886
+ }
887
+ function L() {
888
+ var y = Se(), $ = W(y);
889
+ if (n = arguments, o = this, m = y, $) {
890
+ if (v === void 0)
891
+ return w(m);
892
+ if (g)
893
+ return clearTimeout(v), v = setTimeout(P, t), f(m);
894
+ }
895
+ return v === void 0 && (v = setTimeout(P, t)), u;
896
+ }
897
+ return L.cancel = N, L.flush = V, L;
898
+ }
899
+ var Ii = "[object Map]", $i = "[object Set]", Ai = Object.prototype, Ci = Ai.hasOwnProperty;
900
+ function Te(e) {
901
+ if (e == null)
902
+ return !0;
903
+ if (It(e) && (we(e) || typeof e == "string" || typeof e.splice == "function" || ke(e) || Pt(e) || At(e)))
904
+ return !e.length;
905
+ var t = D(e);
906
+ if (t == Ii || t == $i)
907
+ return !e.size;
908
+ if (Ve(e))
909
+ return !Ft(e).length;
910
+ for (var r in e)
911
+ if (Ci.call(e, r))
912
+ return !1;
913
+ return !0;
914
+ }
915
+ function Rt(e, t) {
224
916
  if (!e || e.length === 0)
225
917
  return [];
226
- const t = Array.from(new Set(e));
227
- return n ? t.filter((s) => s !== n) : t;
918
+ const r = Array.from(new Set(e));
919
+ return t ? r.filter((n) => n !== t) : r;
228
920
  }
229
- function Y(e, n, t) {
230
- const s = re(e, t), l = {};
231
- for (const d of s)
232
- l[d] = n[d];
233
- return l;
921
+ function mt(e, t, r) {
922
+ const n = Rt(e, r);
923
+ return Object.fromEntries(n.map((o) => [o, t[o]]));
234
924
  }
235
- function $(e) {
925
+ function he(e) {
236
926
  return e && typeof e == "object" && typeof e.loader == "function";
237
927
  }
238
- function z(e) {
239
- return e == null || e === "";
928
+ function Ut(e, t) {
929
+ if (e.length === 0)
930
+ return !0;
931
+ const [r, ...n] = e, o = t.find((i) => (typeof i == "object" && i !== null ? i.value : i) === r);
932
+ if (!o)
933
+ return !1;
934
+ if (n.length > 0) {
935
+ const i = typeof o == "object" && o !== null ? o.children : void 0;
936
+ return !Array.isArray(i) || i.length === 0 ? !1 : Ut(n, i);
937
+ }
938
+ return !0;
240
939
  }
241
- function j(e, n) {
242
- return n.length === 0 ? !1 : z(e) ? !0 : n.some((t) => (typeof t == "object" && t !== null ? t.value : t) === e);
940
+ function Si(e) {
941
+ const { modelValue: t, options: r, formItem: n } = e;
942
+ if (r.length === 0)
943
+ return !1;
944
+ if (Te(t))
945
+ return !0;
946
+ if (n.compType === "cascader" && Array.isArray(t))
947
+ return t.length === 0 ? !0 : Ut(t, r);
948
+ const o = r.map((i) => typeof i == "object" && i !== null ? i.value : i);
949
+ return Array.isArray(t) ? t.length === 0 ? !0 : t.every((i) => o.includes(i)) : o.includes(t);
243
950
  }
244
- const et = /* @__PURE__ */ P({
951
+ const Pi = {
952
+ key: 0,
953
+ class: "form-item-slot-wrapper"
954
+ }, Mi = /* @__PURE__ */ re({
245
955
  name: "ElementPlusKitFormItem",
246
956
  __name: "FormItem",
247
- props: /* @__PURE__ */ W({
957
+ props: /* @__PURE__ */ je({
248
958
  formItem: {},
249
959
  index: {},
250
960
  formData: { default: () => ({}) },
251
961
  dynamicCompEvents: {},
252
- formSlots: { default: () => ({ formItemSlots: [], dynamicComponentSlots: /* @__PURE__ */ new Map() }) }
962
+ formSlots: { default: () => ({ formItemSlots: [], dynamicComponentSlots: /* @__PURE__ */ new Map(), customComponentSlots: /* @__PURE__ */ new Map() }) }
253
963
  }, {
254
964
  modelValue: {},
255
965
  modelModifiers: {}
256
966
  }),
257
- emits: /* @__PURE__ */ W(["change"], ["update:modelValue"]),
258
- setup(e, { emit: n }) {
259
- const t = e, s = n, l = ce(e, "modelValue"), d = f(() => {
260
- const o = new Set(We);
261
- return Object.fromEntries(
262
- Object.entries(t.formItem).filter(([i]) => !o.has(i))
263
- );
264
- }), m = f(() => t.formSlots.formItemSlots), v = f(() => He[t.formItem.comp] || "div"), g = f(() => ({ prop: t.formItem.prop, formItem: t.formItem, index: t.index })), T = f(() => Object.fromEntries(
265
- Object.entries(t.dynamicCompEvents).map(([o, i]) => [
266
- o,
267
- (...c) => i(g.value, ...c)
967
+ emits: /* @__PURE__ */ je(["change"], ["update:modelValue"]),
968
+ setup(e, { emit: t }) {
969
+ const r = e, n = t, o = yt(e, "modelValue"), i = O(() => Object.fromEntries(
970
+ Object.entries(r.formItem).filter(([s]) => !Br.includes(s))
971
+ )), u = O(() => r.formSlots.formItemSlots), v = O(() => Rr[r.formItem.compType] || "div"), m = O(() => ({ prop: r.formItem.prop, formItem: r.formItem, index: r.index })), d = O(() => Object.fromEntries(
972
+ Object.entries(r.dynamicCompEvents).map(([s, l]) => [
973
+ s,
974
+ (...h) => l(m.value, ...h)
268
975
  ])
269
- )), S = L([]), w = L(!1), E = Ze();
270
- function O() {
271
- if (!z(l.value)) {
272
- if (E.isClearing)
273
- return;
274
- E.startClearing(l.value), l.value = void 0, s("change", g.value, void 0), H(() => {
275
- E.endClearing();
276
- });
277
- }
278
- }
279
- function x(o) {
280
- E.isClearing || (E.startUserInteraction(), s("change", g.value, o), H(() => {
281
- E.endUserInteraction();
282
- }));
976
+ )), I = xe([]), g = xe(!1), _ = Er(), f = Ir();
977
+ function w(s) {
978
+ _.start(), n("change", m.value, s), le(() => {
979
+ _.end();
980
+ });
283
981
  }
284
- const h = f(() => {
285
- const o = qe.getDefaults(t.formItem), i = t.formItem.compAttrs ?? {}, c = "options" in i;
982
+ const j = O(() => {
983
+ const s = ze.getDefaults(r.formItem), l = r.formItem.compProps ?? {}, h = "options" in l, C = l.options, { options: S, ...z } = l, se = Array.isArray(C), a = typeof C == "function" || he(C);
286
984
  return {
287
- ...o,
288
- ...i,
289
- ...T.value,
290
- ...c && {
291
- options: S.value,
292
- loading: w.value
985
+ ...s,
986
+ ...z,
987
+ ...d.value,
988
+ ...h && {
989
+ // 静态数组直接使用原始数组,动态选项使用 resolvedOptions.value
990
+ options: se ? C : I.value,
991
+ // 只有动态选项才需要 loading 状态
992
+ ...a && { loading: g.value }
293
993
  }
294
994
  };
295
- }), U = (o) => t.formSlots.dynamicComponentSlots.get(o);
296
- async function r(o, i) {
995
+ });
996
+ function W(s) {
997
+ return r.formSlots.dynamicComponentSlots.get(s);
998
+ }
999
+ function P(s) {
1000
+ const l = r.formSlots.customComponentSlots.get(s);
1001
+ return l && l.length > 0 && l[0] ? l[0].slotFn : void 0;
1002
+ }
1003
+ async function K(s, l) {
297
1004
  try {
298
- const c = await o(i);
299
- return Array.isArray(c) ? c : [];
300
- } catch (c) {
301
- return console.error(`[FormItem] 加载字段 "${t.formItem.prop}" 的选项失败:`, c), [];
1005
+ const h = await s(l);
1006
+ return Array.isArray(h) ? h : [];
1007
+ } catch {
1008
+ return [];
302
1009
  }
303
1010
  }
304
- function a() {
305
- const o = t.formItem.compAttrs?.options;
306
- return $(o) ? o : null;
1011
+ function N() {
1012
+ const s = r.formItem.compProps?.options;
1013
+ return he(s) ? s : null;
1014
+ }
1015
+ function V() {
1016
+ if (Te(o.value))
1017
+ return;
1018
+ const s = o.value;
1019
+ le(() => {
1020
+ f.changing && f.hasUserValue || o.value === s && (o.value = void 0);
1021
+ });
1022
+ }
1023
+ function L(s) {
1024
+ const { formItem: l } = r;
1025
+ ze.getCompType(l.compType) !== "input" && (Si({ modelValue: o.value, options: s, formItem: l }) || V());
307
1026
  }
308
- async function u() {
309
- const o = t.formItem.compAttrs?.options;
310
- if (o && !Array.isArray(o)) {
311
- w.value = !0;
1027
+ async function y(s = !1) {
1028
+ const l = r.formItem.compProps?.options;
1029
+ if (!(!l || Array.isArray(l))) {
1030
+ s && (f.start(), V(), await le()), g.value = !0;
312
1031
  try {
313
- if (typeof o == "function") {
314
- const i = await r(o, t.formData ?? {});
315
- S.value = i, j(l.value, i) || O();
316
- } else if ($(o)) {
317
- const { loader: i, deps: c = [] } = o, k = t.formData ?? {}, A = Y(c, k, t.formItem.prop), _ = await r(i, { ...k, ...A });
318
- S.value = _, j(l.value, _) || O();
319
- }
1032
+ let h;
1033
+ if (typeof l == "function")
1034
+ h = await K(l, r.formData ?? {});
1035
+ else if (he(l)) {
1036
+ const { loader: C, deps: S = [] } = l, z = r.formData ?? {}, se = mt(S, z, r.formItem.prop);
1037
+ h = await K(C, { ...z, ...se });
1038
+ } else
1039
+ return;
1040
+ I.value = h, s || L(h);
320
1041
  } finally {
321
- w.value = !1;
1042
+ g.value = !1, s && f.end();
322
1043
  }
323
1044
  }
324
1045
  }
325
- function C(o) {
326
- S.value = o, j(l.value, o) || O();
1046
+ function $() {
1047
+ y();
327
1048
  }
328
- function y() {
329
- u();
330
- }
331
- function M(o) {
332
- const { immediate: i = !1, deps: c = [], loader: k } = o;
333
- if (c.length > 0) {
334
- const A = t.formData ?? {}, _ = Y(c, A, t.formItem.prop);
1049
+ function F(s) {
1050
+ const { immediate: l = !1, deps: h = [], loader: C } = s;
1051
+ if (h.length > 0) {
1052
+ const S = r.formData ?? {}, z = mt(h, S, r.formItem.prop);
335
1053
  try {
336
- k({ ...A, ..._ });
1054
+ C({ ...S, ...z });
337
1055
  } catch {
338
1056
  }
339
- i && u();
1057
+ l && y();
340
1058
  return;
341
1059
  }
342
- i && u();
1060
+ l && y();
343
1061
  }
344
- const R = f(() => {
345
- const o = a();
346
- return o ? re(o.deps ?? [], t.formItem.prop) : [];
347
- }), le = f(() => {
348
- const o = a();
349
- return o ? o.immediate ?? !1 : !1;
1062
+ const Z = O(() => {
1063
+ const s = N();
1064
+ return s ? Rt(s.deps ?? [], r.formItem.prop) : [];
1065
+ }), Q = O(() => {
1066
+ const s = N();
1067
+ return s ? s.immediate ?? !1 : !1;
350
1068
  });
351
- return G(
1069
+ return Oe(
352
1070
  () => {
353
- const o = R.value, i = {};
354
- for (const c of o)
355
- i[c] = t.formData?.[c];
356
- return i;
1071
+ const s = Z.value;
1072
+ return Object.fromEntries(s.map((l) => [l, r.formData?.[l]]));
357
1073
  },
358
1074
  () => {
359
- a() && u();
1075
+ N() && y(!0);
360
1076
  },
361
- { deep: !0, immediate: le.value }
362
- ), ue(() => {
363
- const o = t.formItem.compAttrs?.options;
364
- if (o) {
365
- if (Array.isArray(o)) {
366
- C(o);
367
- return;
368
- }
369
- if (typeof o == "function") {
370
- y();
371
- return;
372
- }
373
- $(o) && M(o);
1077
+ { deep: !0, immediate: Q.value }
1078
+ ), Kt(() => {
1079
+ const s = r.formItem.compProps?.options;
1080
+ if (!(!s || Array.isArray(s))) {
1081
+ if (typeof s == "function")
1082
+ return $();
1083
+ he(s) && F(s);
374
1084
  }
375
- }), G(
376
- () => l.value,
377
- (o, i) => {
378
- E.isClearingOperation(i, o, z) || E.isUserInteraction || o !== i && s("change", g.value, o);
1085
+ }), Oe(
1086
+ () => o.value,
1087
+ (s, l) => {
1088
+ if (!_.isUser) {
1089
+ if (f.changing) {
1090
+ if (Te(s)) {
1091
+ !Te(l) && !f.hasUserValue && n("change", m.value, void 0);
1092
+ return;
1093
+ }
1094
+ f.markValue(), n("change", m.value, s);
1095
+ return;
1096
+ }
1097
+ s !== l && n("change", m.value, s);
1098
+ }
379
1099
  }
380
- ), (o, i) => (p(), I(V(ne), te(oe(d.value)), K({
381
- default: b(() => [
382
- e.formItem.comp !== "custom" ? (p(), I(F(v.value), D({ key: 0 }, h.value, {
383
- modelValue: l.value,
384
- "onUpdate:modelValue": i[0] || (i[0] = (c) => l.value = c),
385
- onChange: x
386
- }), K({ _: 2 }, [
387
- B(U(e.formItem.prop) ?? [], (c, k) => ({
388
- name: c.slotName,
389
- fn: b((A) => [
390
- (p(), I(F(c.slotFn), D({
391
- value: l.value,
392
- form: e.formData,
393
- "form-item": e.formItem
394
- }, A), null, 16, ["value", "form", "form-item"]))
1100
+ ), (s, l) => (x(), A(k(bt), ue(ye(i.value)), Ne({
1101
+ default: B(() => [
1102
+ e.formItem.compType !== "custom" ? (x(), A(H(v.value), de({ key: 0 }, j.value, {
1103
+ modelValue: o.value,
1104
+ "onUpdate:modelValue": l[0] || (l[0] = (h) => o.value = h),
1105
+ onChange: w
1106
+ }), Ne({ _: 2 }, [
1107
+ _e(W(e.formItem.prop) ?? [], (h, C) => ({
1108
+ name: h.slotName,
1109
+ fn: B((S) => [
1110
+ (x(), A(H(h.slotFn), ue(ye({ value: o.value, form: e.formData, formItem: e.formItem, ...S })), null, 16))
395
1111
  ])
396
1112
  }))
397
- ]), 1040, ["modelValue"])) : me(o.$slots, e.formItem.prop, {
398
- key: 1,
399
- value: l.value,
400
- form: e.formData,
401
- formItem: e.formItem
402
- })
1113
+ ]), 1040, ["modelValue"])) : (x(), R(fe, { key: 1 }, [
1114
+ P(e.formItem.prop) ? (x(), A(H(P(e.formItem.prop)), {
1115
+ key: 0,
1116
+ value: o.value,
1117
+ form: e.formData,
1118
+ "form-item": e.formItem
1119
+ }, null, 8, ["value", "form", "form-item"])) : ht("", !0)
1120
+ ], 64))
403
1121
  ]),
404
1122
  _: 2
405
1123
  }, [
406
- B(m.value, (c, k) => ({
407
- name: c.slotName,
408
- fn: b((A) => [
409
- (p(), I(F(c.slotFn), D({
410
- value: l.value,
411
- form: e.formData,
412
- "form-item": e.formItem
413
- }, A), null, 16, ["value", "form", "form-item"]))
1124
+ _e(u.value, (h, C) => ({
1125
+ name: h.slotName,
1126
+ fn: B((S) => [
1127
+ h.slotName === "error" ? (x(), R("span", Pi, [
1128
+ (x(), A(H(h.slotFn), ue(ye({ value: o.value, form: e.formData, formItem: e.formItem, ...S })), null, 16))
1129
+ ])) : (x(), A(H(h.slotFn), ue(de({ key: 1 }, { value: o.value, form: e.formData, formItem: e.formItem, ...S })), null, 16))
414
1130
  ])
415
1131
  }))
416
1132
  ]), 1040));
417
1133
  }
418
- }), rt = /* @__PURE__ */ P({
1134
+ }), Fi = /* @__PURE__ */ re({
419
1135
  name: "WForm",
420
1136
  __name: "Form",
421
- props: {
1137
+ props: /* @__PURE__ */ je({
422
1138
  formItems: {},
423
- rowAttrs: { default: () => ({}) },
1139
+ rowProps: { default: () => ({}) },
424
1140
  actionConfig: { default: () => ({}) },
425
1141
  model: { default: () => ({}) },
426
1142
  rules: {},
@@ -437,99 +1153,198 @@ const et = /* @__PURE__ */ P({
437
1153
  validateOnRuleChange: { type: Boolean },
438
1154
  scrollToError: { type: Boolean },
439
1155
  scrollIntoViewOptions: {}
440
- },
441
- emits: ["validate", "change", "action", "search", "reset", "submit", "cancel"],
442
- setup(e, { expose: n, emit: t }) {
443
- const s = e, l = t, d = fe();
444
- function m(r, a) {
445
- return r.startsWith("on") && typeof a == "function";
1156
+ }, {
1157
+ expanded: { type: Boolean, default: !1 },
1158
+ expandedModifiers: {}
1159
+ }),
1160
+ emits: /* @__PURE__ */ je(["validate", "change", "action", "search", "reset", "submit", "cancel", "expand"], ["update:expanded"]),
1161
+ setup(e, { expose: t, emit: r }) {
1162
+ const n = e, o = r, i = qt();
1163
+ function u(a, c) {
1164
+ return a.startsWith("on") && typeof c == "function";
446
1165
  }
447
- const v = f(() => Object.fromEntries(
448
- Object.entries(d).filter(([r, a]) => m(r, a))
449
- )), g = f(() => {
450
- const { formItems: r, actionConfig: a, rowAttrs: u, ...C } = s, y = Object.fromEntries(
451
- Object.entries(d).filter(([M, R]) => !m(M, R))
1166
+ const v = O(() => Object.fromEntries(
1167
+ Object.entries(i).filter(([a, c]) => u(a, c))
1168
+ )), m = O(() => {
1169
+ const { formItems: a, actionConfig: c, rowProps: p, ...E } = n, G = Object.fromEntries(
1170
+ Object.entries(i).filter(([$e, Nt]) => !u($e, Nt))
452
1171
  );
453
- return { ...C, ...Xe, ...y };
454
- }), T = f(() => {
455
- const { span: r } = s?.rowAttrs ?? {};
456
- return s.formItems.filter((a) => X({ condition: a.vIf, data: s.model, defaultValue: !0 })).map((a) => {
457
- const { colAttrs: u = {} } = a ?? {};
458
- return { ...a, colAttrs: { ...u, span: u.span ?? r } };
1172
+ return { ...E, ...Ur, ...G };
1173
+ }), d = yt(e, "expanded");
1174
+ Oe(
1175
+ d,
1176
+ (a) => {
1177
+ o("expand", a);
1178
+ }
1179
+ );
1180
+ const I = O(() => m.value.inline ? zr(n.actionConfig?.buttons, "expand") : !1), g = O(() => {
1181
+ if (!I.value)
1182
+ return !1;
1183
+ const a = n.actionConfig?.expand;
1184
+ return a ? a.autoExpandOnHover === !0 : !1;
1185
+ }), { onMouseEnter: _, onMouseLeave: f, recordManualToggle: w } = wr(
1186
+ d,
1187
+ g,
1188
+ (a) => {
1189
+ d.value = a;
1190
+ }
1191
+ ), j = xe();
1192
+ function W(a) {
1193
+ const c = a ?? !d.value;
1194
+ d.value = c, w();
1195
+ const p = n.actionConfig?.expand;
1196
+ p?.scrollOnToggle && le(() => {
1197
+ setTimeout(() => j.value?.$el?.scrollIntoView?.(p.scrollIntoViewOptions ?? Tt), 250);
1198
+ });
1199
+ }
1200
+ const P = O(() => {
1201
+ const { span: a } = n.rowProps;
1202
+ return n.formItems.filter((c) => Le({ condition: c.vIf, data: n.model, defaultValue: !0 })).map((c) => {
1203
+ const { colProps: p = {} } = c ?? {};
1204
+ return { ...c, colProps: { ...p, span: p.span ?? a } };
459
1205
  });
460
- }), S = de();
461
- function w(r) {
462
- return Object.keys(S).filter((a) => a.startsWith(r)).map((a) => ({
463
- rawSlotName: a,
464
- slotName: a.replace(r, ""),
465
- slotFn: S[a]
1206
+ }), K = O(() => {
1207
+ const a = P.value.map((c, p) => ({ ...c, _originalIndex: p }));
1208
+ return I.value ? a.filter((c) => !N(c, c._originalIndex)) : a;
1209
+ });
1210
+ function N(a, c) {
1211
+ if (!I.value || d.value)
1212
+ return !1;
1213
+ const p = n.actionConfig?.expand;
1214
+ return p ? !!("exclude" in p && p.exclude.length > 0 && p.exclude.includes(a.prop) || "include" in p && p.include.length > 0 && !p.include.includes(a.prop) || "count" in p && c >= p.count) : !1;
1215
+ }
1216
+ const V = Xt();
1217
+ function L(a) {
1218
+ return Object.keys(V).filter((c) => c.startsWith(a)).map((c) => ({
1219
+ rawSlotName: c,
1220
+ slotName: c.replace(a, ""),
1221
+ slotFn: V[c]
466
1222
  }));
467
1223
  }
468
- const E = f(() => {
469
- const r = w("form-item-"), a = /* @__PURE__ */ new Map();
470
- for (const u of T.value) {
471
- const C = w(`${u.prop}-`);
472
- C.length > 0 && a.set(u.prop, C);
1224
+ const y = O(() => {
1225
+ const a = L("form-item-"), c = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
1226
+ for (const E of P.value) {
1227
+ const G = L(`${E.prop}-`);
1228
+ G.length > 0 && c.set(E.prop, G), E.compType === "custom" && V[E.prop] && p.set(E.prop, [{
1229
+ rawSlotName: E.prop,
1230
+ slotName: E.prop,
1231
+ slotFn: V[E.prop]
1232
+ }]);
1233
+ }
1234
+ return { formItemSlots: a, dynamicComponentSlots: c, customComponentSlots: p };
1235
+ }), $ = O(() => Object.keys(n.rowProps ?? {}).length > 0), F = O(() => ({
1236
+ row: m.value.inline || $.value ? xr : "div",
1237
+ col: $.value ? jr : "div"
1238
+ })), Z = O(() => n.formItems.map((a) => a.prop)), Q = O(() => I.value ? n.actionConfig?.expand ? P.value.filter((c, p) => N(c, p)).map((c) => c.prop) : [] : []), s = xe({});
1239
+ function l() {
1240
+ s.value = Object.fromEntries(
1241
+ Q.value.map((a) => [a, dt(n.model[a])])
1242
+ );
1243
+ }
1244
+ function h() {
1245
+ return Object.fromEntries(
1246
+ Q.value.map((a) => {
1247
+ const c = s.value[a];
1248
+ return [a, c != null ? dt(c) : void 0];
1249
+ })
1250
+ );
1251
+ }
1252
+ function C() {
1253
+ j.value?.clearValidate?.(Q.value);
1254
+ const a = Z.value.filter((c) => !Q.value.includes(c));
1255
+ a.length > 0 && j.value?.resetFields?.(a);
1256
+ }
1257
+ async function S({ eventName: a }) {
1258
+ const c = ["submit", "search"], p = ["cancel", "reset"];
1259
+ if (a === "expand") {
1260
+ W(), o("action", a, d.value);
1261
+ return;
473
1262
  }
474
- return { formItemSlots: r, dynamicComponentSlots: a };
475
- }), O = f(() => Object.keys(s.rowAttrs ?? {}).length > 0), x = f(() => ({
476
- row: g.value.inline || O.value ? Ue : "div",
477
- col: O.value ? Ne : "div"
478
- })), h = L();
479
- async function U({ eventName: r }) {
480
- const a = ["submit", "search"], u = ["cancel", "reset"];
481
- if (![...a, ...u].includes(r))
482
- return l("action", r);
483
- a.includes(r) && await h.value?.validate?.(), u.includes(r) && h.value?.resetFields?.(), l(r), l("action", r);
1263
+ if (c.includes(a) && await j.value?.validate?.(), p.includes(a)) {
1264
+ if (a === "reset") {
1265
+ const E = h();
1266
+ C(), o("reset", E), o("action", a, E);
1267
+ return;
1268
+ }
1269
+ j.value?.resetFields?.();
1270
+ }
1271
+ o(a), o("action", a);
1272
+ }
1273
+ function z(a, c, p) {
1274
+ o("validate", a, c, p);
484
1275
  }
485
- return n({
1276
+ t({
486
1277
  // element-plus form exposes
487
1278
  get fields() {
488
- return h.value?.fields;
1279
+ return j.value?.fields;
489
1280
  },
490
- getField: (r) => h.value?.getField?.(r),
491
- validate: () => h.value?.validate?.(),
492
- validateField: (r) => h.value?.validateField?.(r),
493
- resetFields: (r) => h.value?.resetFields?.(r),
494
- clearValidate: (r) => h.value?.clearValidate?.(r),
495
- scrollToField: (r) => h.value?.scrollToField?.(r)
496
- }), (r, a) => (p(), I(V(Re), D({
1281
+ getField: (a) => j.value?.getField?.(a),
1282
+ validate: () => j.value?.validate?.(),
1283
+ validateField: (a) => j.value?.validateField?.(a),
1284
+ resetFields: (a) => j.value?.resetFields?.(a),
1285
+ clearValidate: (a) => j.value?.clearValidate?.(a),
1286
+ scrollToField: (a) => j.value?.scrollToField?.(a),
1287
+ // 展开/折叠控制方法
1288
+ get expanded() {
1289
+ return d.value;
1290
+ },
1291
+ toggleExpand: W
1292
+ });
1293
+ const se = Ei(l, 100);
1294
+ return Yt(() => l()), Oe(
1295
+ [() => n.formItems, () => n.actionConfig?.expand],
1296
+ se,
1297
+ { deep: !0 }
1298
+ ), (a, c) => (x(), A(k(Or), de({
497
1299
  ref_key: "formRef",
498
- ref: h
499
- }, g.value, {
1300
+ ref: j
1301
+ }, m.value, {
500
1302
  model: e.model,
501
- onValidate: a[1] || (a[1] = (u, C, y) => l("validate", u, C, y)),
502
- onSubmit: a[2] || (a[2] = pe(() => {
1303
+ onValidate: z,
1304
+ onSubmit: c[1] || (c[1] = Jt(() => {
503
1305
  }, ["prevent"]))
504
1306
  }), {
505
- default: b(() => [
506
- (p(), I(F(x.value.row), te(oe(e.rowAttrs)), {
507
- default: b(() => [
508
- (p(!0), N(Z, null, B(T.value, (u, C) => Q((p(), I(F(x.value.col), D({
509
- key: `${u.prop}-${C}`
510
- }, { ref_for: !0 }, u.colAttrs), {
511
- default: b(() => [
512
- q(et, {
513
- modelValue: e.model[u.prop],
514
- "onUpdate:modelValue": (y) => e.model[u.prop] = y,
515
- "form-item": u,
516
- "form-data": e.model,
517
- "dynamic-comp-events": v.value,
518
- "form-slots": E.value,
519
- index: C,
520
- onChange: a[0] || (a[0] = (y, M) => l("change", y, M))
521
- }, null, 8, ["modelValue", "onUpdate:modelValue", "form-item", "form-data", "dynamic-comp-events", "form-slots", "index"])
1307
+ default: B(() => [
1308
+ (x(), A(H(F.value.row), ue(ye(e.rowProps)), {
1309
+ default: B(() => [
1310
+ ve(Zt, {
1311
+ name: "form-item",
1312
+ tag: "div",
1313
+ class: "form-items-transition"
1314
+ }, {
1315
+ default: B(() => [
1316
+ (x(!0), R(fe, null, _e(K.value, (p, E) => gt((x(), A(H(F.value.col), de({
1317
+ key: `${p.prop}-${p._originalIndex ?? E}`
1318
+ }, { ref_for: !0 }, p.colProps), {
1319
+ default: B(() => [
1320
+ ve(Mi, {
1321
+ modelValue: e.model[p.prop],
1322
+ "onUpdate:modelValue": (G) => e.model[p.prop] = G,
1323
+ "form-item": p,
1324
+ "form-data": e.model,
1325
+ "dynamic-comp-events": v.value,
1326
+ "form-slots": y.value,
1327
+ index: p._originalIndex ?? E,
1328
+ onChange: c[0] || (c[0] = (G, $e) => o("change", G, $e))
1329
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "form-item", "form-data", "dynamic-comp-events", "form-slots", "index"])
1330
+ ]),
1331
+ _: 2
1332
+ }, 1040)), [
1333
+ [vt, k(Le)({ condition: p.vShow, data: n.model, defaultValue: !0 })]
1334
+ ])), 128))
522
1335
  ]),
523
- _: 2
524
- }, 1040)), [
525
- [ee, V(X)({ condition: u.vShow, data: s.model, defaultValue: !0 })]
526
- ])), 128)),
527
- q(Qe, {
528
- inline: g.value.inline,
529
- "action-slot": r.$slots.action,
1336
+ _: 1
1337
+ }),
1338
+ ve(Lr, {
1339
+ inline: m.value.inline,
1340
+ "action-slot": a.$slots.action,
530
1341
  config: e.actionConfig,
531
- onAction: U
532
- }, null, 8, ["inline", "action-slot", "config"])
1342
+ expanded: d.value,
1343
+ "auto-expand-on-hover": g.value,
1344
+ "on-mouse-enter": k(_),
1345
+ "on-mouse-leave": k(f),
1346
+ onAction: S
1347
+ }, null, 8, ["inline", "action-slot", "config", "expanded", "auto-expand-on-hover", "on-mouse-enter", "on-mouse-leave"])
533
1348
  ]),
534
1349
  _: 1
535
1350
  }, 16))
@@ -537,8 +1352,8 @@ const et = /* @__PURE__ */ P({
537
1352
  _: 1
538
1353
  }, 16, ["model"]));
539
1354
  }
540
- });
1355
+ }), ki = /* @__PURE__ */ _t(Fi, [["__scopeId", "data-v-0341daa6"]]);
541
1356
  export {
542
- rt as WForm,
543
- rt as default
1357
+ ki as WForm,
1358
+ ki as default
544
1359
  };