h5-tdsign-for-vue 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,28 +1,28 @@
1
- import { ref as R, computed as x, defineComponent as L, toRef as w, createElementBlock as _, openBlock as B, createVNode as O, unref as m, mergeProps as T, h as M, createSlots as N, renderList as F, withCtx as I, renderSlot as K, normalizeProps as q, guardReactiveProps as Y, isRef as oe, watch as W, createElementVNode as re, createBlock as $, createCommentVNode as z, nextTick as J, Fragment as Z, resolveDynamicComponent as se, createTextVNode as Q, toDisplayString as X, toRaw as ue } from "vue";
2
- import { Input as A, Icon as D, Popup as G, Picker as ie, DateTimePicker as de, Cascader as ce, TreeSelect as fe, Upload as ee, Message as j, Form as pe, FormItem as me, Button as te, Stepper as ye, CheckboxGroup as ve, RadioGroup as be, Switch as he, Textarea as ge } from "tdesign-mobile-vue";
3
- function ae(s) {
4
- const b = R(!1), n = x(() => {
5
- const p = s.modelValue.value;
6
- if (p == null || p === "")
1
+ import { ref as M, computed as S, defineComponent as F, toRef as z, createElementBlock as $, openBlock as v, createVNode as T, unref as m, mergeProps as w, h as Y, createSlots as K, renderList as j, withCtx as x, renderSlot as A, normalizeProps as D, guardReactiveProps as W, isRef as oe, watch as G, createElementVNode as ne, createBlock as C, createCommentVNode as E, nextTick as ee, Fragment as H, resolveDynamicComponent as N, createTextVNode as J, toDisplayString as Q, toRaw as ie } from "vue";
2
+ import { Input as R, Icon as Z, Popup as X, Picker as ue, DateTimePicker as de, Cascader as ce, TreeSelect as fe, Upload as te, Message as q, Form as pe, FormItem as me, Button as ae, Stepper as ye, CheckboxGroup as be, RadioGroup as ve, Switch as he, Textarea as Be, Navbar as ge, TabBar as xe, TabBarItem as Ve } from "tdesign-mobile-vue";
3
+ function re(a) {
4
+ const g = M(!1), r = S(() => {
5
+ const y = a.modelValue.value;
6
+ if (y == null || y === "")
7
7
  return "";
8
- const v = s.findLabel(s.options.value, p);
9
- return v !== null ? v : s.displayLabel?.value ? s.displayLabel.value : String(p);
8
+ const p = a.findLabel(a.options.value, y);
9
+ return p !== null ? p : a.displayLabel?.value ? a.displayLabel.value : String(y);
10
10
  });
11
11
  return {
12
- visible: b,
13
- displayValue: n,
12
+ visible: g,
13
+ displayValue: r,
14
14
  openPopup: () => {
15
- b.value = !0;
15
+ g.value = !0;
16
16
  },
17
17
  closePopup: () => {
18
- b.value = !1;
18
+ g.value = !1;
19
19
  }
20
20
  };
21
21
  }
22
- const Be = { class: "smart-select" }, xe = {
22
+ const Se = { class: "smart-select" }, ke = {
23
23
  name: "SmartSelect"
24
- }, Ve = /* @__PURE__ */ L({
25
- ...xe,
24
+ }, Pe = /* @__PURE__ */ F({
25
+ ...ke,
26
26
  props: {
27
27
  modelValue: { type: [String, Number, Boolean], default: "" },
28
28
  columns: { type: [Array, Function], default: () => [] },
@@ -87,64 +87,64 @@ const Be = { class: "smart-select" }, xe = {
87
87
  onOpened: {}
88
88
  },
89
89
  emits: ["update:modelValue", "change", "confirm", "cancel"],
90
- setup(s, { emit: b }) {
91
- const n = s, f = b, c = (r, t) => {
90
+ setup(a, { emit: g }) {
91
+ const r = a, c = g, f = (s, t) => {
92
92
  let o = [];
93
- Array.isArray(r) && (r.length > 0 && Array.isArray(r[0]) ? o = r.flat() : o = r);
93
+ Array.isArray(s) && (s.length > 0 && Array.isArray(s[0]) ? o = s.flat() : o = s);
94
94
  const e = o.find((l) => l.value === t);
95
95
  return e ? e.label : null;
96
- }, { visible: p, displayValue: v, openPopup: h, closePopup: P } = ae({
97
- modelValue: w(() => n.modelValue),
98
- options: w(() => n.columns),
99
- findLabel: (r, t) => c(r, t),
100
- displayLabel: w(() => n.displayLabel)
101
- }), C = ["attach", "closeBtn", "closeOnOverlayClick", "destroyOnClose", "duration", "overlayProps", "placement", "preventScrollThrough", "showOverlay", "transitionName", "zIndex"], V = x(() => {
102
- const r = {}, t = n;
103
- return C.forEach((o) => {
104
- t[o] !== void 0 && (r[o] = t[o]);
105
- }), r;
106
- }), k = ["align", "autofocus", "borderless", "clearable", "clearTrigger", "disabled", "label", "layout", "maxcharacter", "maxlength", "name", "placeholder", "prefixIcon", "readonly", "size", "status", "suffix", "suffixIcon", "tips", "type"], S = x(() => {
107
- const r = {}, t = n;
108
- return k.forEach((o) => {
109
- t[o] !== void 0 && (r[o] = t[o]);
110
- }), r;
111
- }), u = (r, t) => {
112
- const o = r[0];
113
- o !== void 0 && typeof o != "object" && f("update:modelValue", o), f("confirm", r, t), P();
114
- }, y = (r) => {
115
- f("cancel", r), P();
116
- }, d = (r, t) => {
117
- f("change", r, t);
96
+ }, { visible: y, displayValue: p, openPopup: h, closePopup: B } = re({
97
+ modelValue: z(() => r.modelValue),
98
+ options: z(() => r.columns),
99
+ findLabel: (s, t) => f(s, t),
100
+ displayLabel: z(() => r.displayLabel)
101
+ }), I = ["attach", "closeBtn", "closeOnOverlayClick", "destroyOnClose", "duration", "overlayProps", "placement", "preventScrollThrough", "showOverlay", "transitionName", "zIndex"], k = S(() => {
102
+ const s = {}, t = r;
103
+ return I.forEach((o) => {
104
+ t[o] !== void 0 && (s[o] = t[o]);
105
+ }), s;
106
+ }), O = ["align", "autofocus", "borderless", "clearable", "clearTrigger", "disabled", "label", "layout", "maxcharacter", "maxlength", "name", "placeholder", "prefixIcon", "readonly", "size", "status", "suffix", "suffixIcon", "tips", "type"], P = S(() => {
107
+ const s = {}, t = r;
108
+ return O.forEach((o) => {
109
+ t[o] !== void 0 && (s[o] = t[o]);
110
+ }), s;
111
+ }), i = (s, t) => {
112
+ const o = s[0];
113
+ o !== void 0 && typeof o != "object" && c("update:modelValue", o), c("confirm", s, t), B();
114
+ }, b = (s) => {
115
+ c("cancel", s), B();
116
+ }, d = (s, t) => {
117
+ c("change", s, t);
118
118
  };
119
- return (r, t) => (B(), _("div", Be, [
120
- O(m(A), T({
121
- value: m(v),
119
+ return (s, t) => (v(), $("div", Se, [
120
+ T(m(R), w({
121
+ value: m(p),
122
122
  onClick: m(h)
123
- }, { ...r.$attrs, ...S.value }, {
123
+ }, { ...s.$attrs, ...P.value }, {
124
124
  readonly: "",
125
- "suffix-icon": () => M(m(D), { name: "chevron-right" })
126
- }), N({ _: 2 }, [
127
- F(r.$slots, (o, e) => ({
125
+ "suffix-icon": () => Y(m(Z), { name: "chevron-right" })
126
+ }), K({ _: 2 }, [
127
+ j(s.$slots, (o, e) => ({
128
128
  name: e,
129
- fn: I((l) => [
130
- K(r.$slots, e, q(Y(l || {})), void 0, !0)
129
+ fn: x((l) => [
130
+ A(s.$slots, e, D(W(l || {})), void 0, !0)
131
131
  ])
132
132
  }))
133
133
  ]), 1040, ["value", "onClick", "suffix-icon"]),
134
- O(m(G), T({
135
- modelValue: m(p),
136
- "onUpdate:modelValue": t[0] || (t[0] = (o) => oe(p) ? p.value = o : null),
134
+ T(m(X), w({
135
+ modelValue: m(y),
136
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => oe(y) ? y.value = o : null),
137
137
  placement: "bottom"
138
- }, V.value), {
139
- default: I(() => [
140
- O(m(ie), {
141
- value: [s.modelValue],
142
- columns: s.columns,
143
- title: s.title,
144
- "cancel-btn": s.cancelBtn,
145
- "confirm-btn": s.confirmBtn,
146
- onConfirm: u,
147
- onCancel: y,
138
+ }, k.value), {
139
+ default: x(() => [
140
+ T(m(ue), {
141
+ value: [a.modelValue],
142
+ columns: a.columns,
143
+ title: a.title,
144
+ "cancel-btn": a.cancelBtn,
145
+ "confirm-btn": a.confirmBtn,
146
+ onConfirm: i,
147
+ onCancel: b,
148
148
  onChange: d
149
149
  }, null, 8, ["value", "columns", "title", "cancel-btn", "confirm-btn"])
150
150
  ]),
@@ -152,15 +152,15 @@ const Be = { class: "smart-select" }, xe = {
152
152
  }, 16, ["modelValue"])
153
153
  ]));
154
154
  }
155
- }), U = (s, b) => {
156
- const n = s.__vccOpts || s;
157
- for (const [f, c] of b)
158
- n[f] = c;
159
- return n;
160
- }, Se = /* @__PURE__ */ U(Ve, [["__scopeId", "data-v-af49dba1"]]), Pe = { class: "smart-time-picker" }, Ce = {
155
+ }), U = (a, g) => {
156
+ const r = a.__vccOpts || a;
157
+ for (const [c, f] of g)
158
+ r[c] = f;
159
+ return r;
160
+ }, Ce = /* @__PURE__ */ U(Pe, [["__scopeId", "data-v-af49dba1"]]), Ie = { class: "smart-time-picker" }, Oe = {
161
161
  name: "SmartTimePicker"
162
- }, ke = /* @__PURE__ */ L({
163
- ...Ce,
162
+ }, Te = /* @__PURE__ */ F({
163
+ ...Oe,
164
164
  props: {
165
165
  modelValue: { default: "" },
166
166
  rules: { default: () => [] },
@@ -226,8 +226,8 @@ const Be = { class: "smart-select" }, xe = {
226
226
  onOpened: {}
227
227
  },
228
228
  emits: ["update:modelValue", "change", "confirm", "cancel", "pick"],
229
- setup(s, { emit: b }) {
230
- const n = s, f = b, c = R(!1), p = [
229
+ setup(a, { emit: g }) {
230
+ const r = a, c = g, f = M(!1), y = [
231
231
  "attach",
232
232
  "closeBtn",
233
233
  "closeOnOverlayClick",
@@ -243,15 +243,15 @@ const Be = { class: "smart-select" }, xe = {
243
243
  "onClosed",
244
244
  "onOpen",
245
245
  "onOpened"
246
- ], v = n, h = x(() => {
247
- const r = {};
248
- return p.forEach((t) => {
249
- v[t] !== void 0 && (r[t] = v[t]);
250
- }), r;
251
- }), P = x(() => {
252
- const { modelValue: r, title: t, inputFormat: o, ...e } = n, l = { ...e };
253
- return p.forEach((i) => {
254
- delete l[i];
246
+ ], p = r, h = S(() => {
247
+ const s = {};
248
+ return y.forEach((t) => {
249
+ p[t] !== void 0 && (s[t] = p[t]);
250
+ }), s;
251
+ }), B = S(() => {
252
+ const { modelValue: s, title: t, inputFormat: o, ...e } = r, l = { ...e };
253
+ return y.forEach((u) => {
254
+ delete l[u];
255
255
  }), [
256
256
  "cancelBtn",
257
257
  "confirmBtn",
@@ -264,48 +264,48 @@ const Be = { class: "smart-select" }, xe = {
264
264
  "start",
265
265
  "steps",
266
266
  "format"
267
- ].forEach((i) => delete l[i]), o && (l.format = o), l;
268
- }), C = x(() => {
269
- const { label: r, placeholder: t, rules: o, required: e, modelValue: l, ...a } = n, i = { ...a };
270
- return p.forEach((g) => {
271
- delete i[g];
272
- }), i;
273
- }), V = x(() => String(n.modelValue || "")), k = () => {
274
- c.value = !0;
275
- }, S = (r) => {
276
- f("update:modelValue", r), f("confirm", r), c.value = !1;
277
- }, u = (r) => {
278
- f("cancel", r), c.value = !1;
279
- }, y = (r) => {
280
- f("change", r);
281
- }, d = (r) => {
282
- f("pick", r);
267
+ ].forEach((u) => delete l[u]), o && (l.format = o), l;
268
+ }), I = S(() => {
269
+ const { label: s, placeholder: t, rules: o, required: e, modelValue: l, ...n } = r, u = { ...n };
270
+ return y.forEach((V) => {
271
+ delete u[V];
272
+ }), u;
273
+ }), k = S(() => String(r.modelValue || "")), O = () => {
274
+ f.value = !0;
275
+ }, P = (s) => {
276
+ c("update:modelValue", s), c("confirm", s), f.value = !1;
277
+ }, i = (s) => {
278
+ c("cancel", s), f.value = !1;
279
+ }, b = (s) => {
280
+ c("change", s);
281
+ }, d = (s) => {
282
+ c("pick", s);
283
283
  };
284
- return (r, t) => (B(), _("div", Pe, [
285
- O(m(A), T({
286
- value: V.value,
287
- onClick: k
288
- }, { ...r.$attrs, ...P.value }, {
284
+ return (s, t) => (v(), $("div", Ie, [
285
+ T(m(R), w({
286
+ value: k.value,
287
+ onClick: O
288
+ }, { ...s.$attrs, ...B.value }, {
289
289
  readonly: "",
290
- "suffix-icon": () => M(m(D), { name: "chevron-right" })
291
- }), N({ _: 2 }, [
292
- F(r.$slots, (o, e) => ({
290
+ "suffix-icon": () => Y(m(Z), { name: "chevron-right" })
291
+ }), K({ _: 2 }, [
292
+ j(s.$slots, (o, e) => ({
293
293
  name: e,
294
- fn: I((l) => [
295
- K(r.$slots, e, q(Y(l || {})), void 0, !0)
294
+ fn: x((l) => [
295
+ A(s.$slots, e, D(W(l || {})), void 0, !0)
296
296
  ])
297
297
  }))
298
298
  ]), 1040, ["value", "suffix-icon"]),
299
- O(m(G), T({
300
- modelValue: c.value,
301
- "onUpdate:modelValue": t[0] || (t[0] = (o) => c.value = o),
299
+ T(m(X), w({
300
+ modelValue: f.value,
301
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => f.value = o),
302
302
  placement: "bottom"
303
303
  }, h.value), {
304
- default: I(() => [
305
- O(m(de), T({ value: s.modelValue }, C.value, {
306
- onConfirm: S,
307
- onCancel: u,
308
- onChange: y,
304
+ default: x(() => [
305
+ T(m(de), w({ value: a.modelValue }, I.value, {
306
+ onConfirm: P,
307
+ onCancel: i,
308
+ onChange: b,
309
309
  onPick: d
310
310
  }), null, 16, ["value"])
311
311
  ]),
@@ -313,10 +313,10 @@ const Be = { class: "smart-select" }, xe = {
313
313
  }, 16, ["modelValue"])
314
314
  ]));
315
315
  }
316
- }), le = /* @__PURE__ */ U(ke, [["__scopeId", "data-v-cf6cd38e"]]), Oe = { class: "smart-cascader" }, Ie = {
316
+ }), le = /* @__PURE__ */ U(Te, [["__scopeId", "data-v-cf6cd38e"]]), $e = { class: "smart-cascader" }, we = {
317
317
  name: "SmartCascader"
318
- }, Te = /* @__PURE__ */ L({
319
- ...Ie,
318
+ }, Ae = /* @__PURE__ */ F({
319
+ ...we,
320
320
  props: {
321
321
  modelValue: { default: "" },
322
322
  placeholder: { default: "请选择" },
@@ -366,73 +366,73 @@ const Be = { class: "smart-select" }, xe = {
366
366
  defaultValue: {}
367
367
  },
368
368
  emits: ["update:modelValue", "change", "pick", "close"],
369
- setup(s, { emit: b }) {
370
- const n = s, f = b, c = (t, o, e = []) => {
369
+ setup(a, { emit: g }) {
370
+ const r = a, c = g, f = (t, o, e = []) => {
371
371
  for (const l of t) {
372
- const a = l.value ?? l.id, i = l.label ?? l.name;
373
- if (a === o)
374
- return [...e, String(i)];
372
+ const n = l.value ?? l.id, u = l.label ?? l.name;
373
+ if (n === o)
374
+ return [...e, String(u)];
375
375
  if (l.children && l.children.length > 0) {
376
- const g = c(l.children, o, [...e, String(i)]);
377
- if (g) return g;
376
+ const V = f(l.children, o, [...e, String(u)]);
377
+ if (V) return V;
378
378
  }
379
379
  }
380
380
  return null;
381
- }, p = (t, o) => {
382
- const e = c(t, o);
381
+ }, y = (t, o) => {
382
+ const e = f(t, o);
383
383
  return e ? e.join(" / ") : null;
384
- }, { visible: v, displayValue: h, openPopup: P, closePopup: C } = ae({
385
- modelValue: w(() => n.modelValue),
386
- options: w(() => n.options || []),
387
- findLabel: p,
388
- displayLabel: w(() => n.displayLabel)
389
- }), V = ["align", "autofocus", "borderless", "clearable", "clearTrigger", "disabled", "label", "layout", "maxcharacter", "maxlength", "name", "placeholder", "prefixIcon", "readonly", "size", "status", "suffix", "suffixIcon", "tips", "type"], k = x(() => {
390
- const t = {}, o = n;
391
- return V.forEach((e) => {
384
+ }, { visible: p, displayValue: h, openPopup: B, closePopup: I } = re({
385
+ modelValue: z(() => r.modelValue),
386
+ options: z(() => r.options || []),
387
+ findLabel: y,
388
+ displayLabel: z(() => r.displayLabel)
389
+ }), k = ["align", "autofocus", "borderless", "clearable", "clearTrigger", "disabled", "label", "layout", "maxcharacter", "maxlength", "name", "placeholder", "prefixIcon", "readonly", "size", "status", "suffix", "suffixIcon", "tips", "type"], O = S(() => {
390
+ const t = {}, o = r;
391
+ return k.forEach((e) => {
392
392
  o[e] !== void 0 && (t[e] = o[e]);
393
393
  }), t;
394
- }), S = ["checkStrictly", "closeBtn", "header", "keys", "load", "middleContent", "options", "overlayProps", "subTitles", "theme", "title"], u = x(() => {
395
- const t = {}, o = n;
396
- return S.forEach((e) => {
394
+ }), P = ["checkStrictly", "closeBtn", "header", "keys", "load", "middleContent", "options", "overlayProps", "subTitles", "theme", "title"], i = S(() => {
395
+ const t = {}, o = r;
396
+ return P.forEach((e) => {
397
397
  o[e] !== void 0 && (t[e] = o[e]);
398
398
  }), t;
399
- }), y = (t, o) => {
400
- f("update:modelValue", t), f("change", t, o), C();
399
+ }), b = (t, o) => {
400
+ c("update:modelValue", t), c("change", t, o), I();
401
401
  }, d = (t) => {
402
- f("pick", t.value, t);
403
- }, r = (t) => {
404
- f("close", t), C();
402
+ c("pick", t.value, t);
403
+ }, s = (t) => {
404
+ c("close", t), I();
405
405
  };
406
- return (t, o) => (B(), _("div", Oe, [
407
- O(m(A), T({
406
+ return (t, o) => (v(), $("div", $e, [
407
+ T(m(R), w({
408
408
  value: m(h),
409
- onClick: m(P)
410
- }, { ...t.$attrs, ...k.value }, {
409
+ onClick: m(B)
410
+ }, { ...t.$attrs, ...O.value }, {
411
411
  readonly: "",
412
- "suffix-icon": () => M(m(D), { name: "chevron-right" })
413
- }), N({ _: 2 }, [
414
- F(t.$slots, (e, l) => ({
412
+ "suffix-icon": () => Y(m(Z), { name: "chevron-right" })
413
+ }), K({ _: 2 }, [
414
+ j(t.$slots, (e, l) => ({
415
415
  name: l,
416
- fn: I((a) => [
417
- K(t.$slots, l, q(Y(a || {})), void 0, !0)
416
+ fn: x((n) => [
417
+ A(t.$slots, l, D(W(n || {})), void 0, !0)
418
418
  ])
419
419
  }))
420
420
  ]), 1040, ["value", "onClick", "suffix-icon"]),
421
- O(m(ce), T({
422
- visible: m(v),
423
- "onUpdate:visible": o[0] || (o[0] = (e) => oe(v) ? v.value = e : null),
424
- value: s.modelValue
425
- }, u.value, {
426
- onChange: y,
421
+ T(m(ce), w({
422
+ visible: m(p),
423
+ "onUpdate:visible": o[0] || (o[0] = (e) => oe(p) ? p.value = e : null),
424
+ value: a.modelValue
425
+ }, i.value, {
426
+ onChange: b,
427
427
  onPick: d,
428
- onClose: r
428
+ onClose: s
429
429
  }), null, 16, ["visible", "value"])
430
430
  ]));
431
431
  }
432
- }), _e = /* @__PURE__ */ U(Te, [["__scopeId", "data-v-f420c3ed"]]), Ee = { class: "smart-tree-select" }, Ae = { class: "tree-select-wrapper" }, we = {
432
+ }), Ee = /* @__PURE__ */ U(Ae, [["__scopeId", "data-v-f420c3ed"]]), Le = { class: "smart-tree-select" }, Re = { class: "tree-select-wrapper" }, Fe = {
433
433
  name: "SmartTreeSelect"
434
- }, $e = /* @__PURE__ */ L({
435
- ...we,
434
+ }, Ue = /* @__PURE__ */ F({
435
+ ...Fe,
436
436
  props: {
437
437
  modelValue: {},
438
438
  options: { default: () => [] },
@@ -491,8 +491,8 @@ const Be = { class: "smart-select" }, xe = {
491
491
  onOpened: {}
492
492
  },
493
493
  emits: ["update:modelValue", "change", "close"],
494
- setup(s, { emit: b }) {
495
- const n = s, f = b, c = R(!1), p = [
494
+ setup(a, { emit: g }) {
495
+ const r = a, c = g, f = M(!1), y = [
496
496
  "attach",
497
497
  "closeBtn",
498
498
  "closeOnOverlayClick",
@@ -508,144 +508,144 @@ const Be = { class: "smart-select" }, xe = {
508
508
  "onClosed",
509
509
  "onOpen",
510
510
  "onOpened"
511
- ], v = [
511
+ ], p = [
512
512
  "customStyle",
513
513
  "filterable",
514
514
  "height",
515
515
  "keys",
516
516
  "multiple",
517
517
  "options"
518
- ], h = n, P = x(() => {
518
+ ], h = r, B = S(() => {
519
519
  const e = {};
520
- return p.forEach((l) => {
520
+ return y.forEach((l) => {
521
521
  h[l] !== void 0 && (e[l] = h[l]);
522
522
  }), e;
523
- }), C = x(() => {
524
- const { modelValue: e, ...l } = n, a = { ...l };
525
- return p.forEach((i) => {
526
- delete a[i];
527
- }), v.forEach((i) => {
528
- delete a[i];
529
- }), delete a.rules, delete a.required, delete a.title, a;
530
- }), V = x(() => {
523
+ }), I = S(() => {
524
+ const { modelValue: e, ...l } = r, n = { ...l };
525
+ return y.forEach((u) => {
526
+ delete n[u];
527
+ }), p.forEach((u) => {
528
+ delete n[u];
529
+ }), delete n.rules, delete n.required, delete n.title, n;
530
+ }), k = S(() => {
531
531
  const e = {};
532
- return v.forEach((l) => {
532
+ return p.forEach((l) => {
533
533
  l !== "options" && h[l] !== void 0 && (e[l] = h[l]);
534
534
  }), h.keys !== void 0 && (e.keys = h.keys), e;
535
- }), k = (e, l) => {
536
- for (const a of e) {
537
- if (a.value === l)
538
- return !a.children || a.children.length === 0;
539
- if (a.children && a.children.length > 0) {
540
- const i = k(a.children, l);
541
- if (i !== !1) return i;
535
+ }), O = (e, l) => {
536
+ for (const n of e) {
537
+ if (n.value === l)
538
+ return !n.children || n.children.length === 0;
539
+ if (n.children && n.children.length > 0) {
540
+ const u = O(n.children, l);
541
+ if (u !== !1) return u;
542
542
  }
543
543
  }
544
544
  return !1;
545
- }, S = (e, l, a = []) => {
546
- for (const i of e) {
547
- if (i.value === l)
548
- return [...a, i.value];
549
- if (i.children && i.children.length > 0) {
550
- const g = S(i.children, l, [...a, i.value]);
551
- if (g) return g;
545
+ }, P = (e, l, n = []) => {
546
+ for (const u of e) {
547
+ if (u.value === l)
548
+ return [...n, u.value];
549
+ if (u.children && u.children.length > 0) {
550
+ const V = P(u.children, l, [...n, u.value]);
551
+ if (V) return V;
552
552
  }
553
553
  }
554
554
  return null;
555
- }, u = R([]), y = (e) => Array.isArray(e) ? e.flatMap((l) => Array.isArray(l) ? l : [l]).filter(
555
+ }, i = M([]), b = (e) => Array.isArray(e) ? e.flatMap((l) => Array.isArray(l) ? l : [l]).filter(
556
556
  (l) => typeof l == "string" || typeof l == "number"
557
557
  ) : e == null || e === "" ? [] : [e];
558
- W(
559
- () => n.modelValue,
558
+ G(
559
+ () => r.modelValue,
560
560
  (e) => {
561
561
  if (Array.isArray(e))
562
- u.value = y(e);
562
+ i.value = b(e);
563
563
  else if (e !== void 0 && e !== "" && e !== null) {
564
- const l = n.options || [], a = S(l, e);
565
- u.value = a || [];
564
+ const l = r.options || [], n = P(l, e);
565
+ i.value = n || [];
566
566
  } else
567
- u.value = [];
567
+ i.value = [];
568
568
  },
569
569
  { immediate: !0 }
570
- ), W(
571
- () => n.options,
570
+ ), G(
571
+ () => r.options,
572
572
  () => {
573
- const e = n.modelValue;
573
+ const e = r.modelValue;
574
574
  if (!Array.isArray(e) && e !== void 0 && e !== "" && e !== null) {
575
- const l = n.options || [], a = S(l, e);
576
- u.value = a || [];
575
+ const l = r.options || [], n = P(l, e);
576
+ i.value = n || [];
577
577
  }
578
578
  },
579
579
  { deep: !0 }
580
580
  );
581
581
  const d = (e, l) => {
582
- for (const a of e) {
583
- if (a.value === l)
584
- return a.label || String(a.value);
585
- if (a.children && a.children.length > 0) {
586
- const i = d(a.children, l);
587
- if (i) return i;
582
+ for (const n of e) {
583
+ if (n.value === l)
584
+ return n.label || String(n.value);
585
+ if (n.children && n.children.length > 0) {
586
+ const u = d(n.children, l);
587
+ if (u) return u;
588
588
  }
589
589
  }
590
590
  return null;
591
- }, r = x(() => {
592
- const e = n.modelValue;
591
+ }, s = S(() => {
592
+ const e = r.modelValue;
593
593
  if (!e && e !== 0)
594
594
  return "";
595
- const l = n.options || [];
595
+ const l = r.options || [];
596
596
  if (Array.isArray(e)) {
597
- const a = e[e.length - 1];
598
- return a !== void 0 ? d(l, a) || String(a) : "";
597
+ const n = e[e.length - 1];
598
+ return n !== void 0 ? d(l, n) || String(n) : "";
599
599
  }
600
600
  return d(l, e) || String(e);
601
601
  }), t = () => {
602
- n.disabled || (c.value = !0);
602
+ r.disabled || (f.value = !0);
603
603
  }, o = (e, l) => {
604
604
  if (Array.isArray(e)) {
605
- const a = y(e), i = a[a.length - 1];
606
- u.value = a;
607
- const g = n.options || [];
608
- k(g, i) && (f("update:modelValue", i), f("change", i, l), n.multiple || (c.value = !1));
605
+ const n = b(e), u = n[n.length - 1];
606
+ i.value = n;
607
+ const V = r.options || [];
608
+ O(V, u) && (c("update:modelValue", u), c("change", u, l), r.multiple || (f.value = !1));
609
609
  } else
610
- u.value = y(e), f("update:modelValue", e), f("change", e, l);
610
+ i.value = b(e), c("update:modelValue", e), c("change", e, l);
611
611
  };
612
- return (e, l) => (B(), _("div", Ee, [
613
- O(m(A), T({
614
- value: r.value,
612
+ return (e, l) => (v(), $("div", Le, [
613
+ T(m(R), w({
614
+ value: s.value,
615
615
  onClick: t
616
- }, { ...e.$attrs, ...C.value }, {
616
+ }, { ...e.$attrs, ...I.value }, {
617
617
  readonly: "",
618
- "suffix-icon": () => M(m(D), { name: "chevron-right" })
619
- }), N({ _: 2 }, [
620
- F(e.$slots, (a, i) => ({
621
- name: i,
622
- fn: I((g) => [
623
- K(e.$slots, i, q(Y(g || {})), void 0, !0)
618
+ "suffix-icon": () => Y(m(Z), { name: "chevron-right" })
619
+ }), K({ _: 2 }, [
620
+ j(e.$slots, (n, u) => ({
621
+ name: u,
622
+ fn: x((V) => [
623
+ A(e.$slots, u, D(W(V || {})), void 0, !0)
624
624
  ])
625
625
  }))
626
626
  ]), 1040, ["value", "suffix-icon"]),
627
- O(m(G), T({
628
- modelValue: c.value,
629
- "onUpdate:modelValue": l[0] || (l[0] = (a) => c.value = a),
627
+ T(m(X), w({
628
+ modelValue: f.value,
629
+ "onUpdate:modelValue": l[0] || (l[0] = (n) => f.value = n),
630
630
  placement: "bottom"
631
- }, P.value), {
632
- default: I(() => [
633
- re("div", Ae, [
634
- c.value ? (B(), $(m(fe), T({
631
+ }, B.value), {
632
+ default: x(() => [
633
+ ne("div", Re, [
634
+ f.value ? (v(), C(m(fe), w({
635
635
  key: 0,
636
- value: u.value,
637
- options: s.options
638
- }, V.value, { onChange: o }), null, 16, ["value", "options"])) : z("", !0)
636
+ value: i.value,
637
+ options: a.options
638
+ }, k.value, { onChange: o }), null, 16, ["value", "options"])) : E("", !0)
639
639
  ])
640
640
  ]),
641
641
  _: 1
642
642
  }, 16, ["modelValue"])
643
643
  ]));
644
644
  }
645
- }), Re = /* @__PURE__ */ U($e, [["__scopeId", "data-v-4d44f50a"]]), Le = { class: "smart-upload" }, Ue = {
645
+ }), ze = /* @__PURE__ */ U(Ue, [["__scopeId", "data-v-4d44f50a"]]), Me = { class: "smart-upload" }, Ke = {
646
646
  name: "SmartUpload"
647
- }, Fe = /* @__PURE__ */ L({
648
- ...Ue,
647
+ }, je = /* @__PURE__ */ F({
648
+ ...Ke,
649
649
  props: {
650
650
  modelValue: { default: "" },
651
651
  valueType: {},
@@ -664,174 +664,174 @@ const Be = { class: "smart-select" }, xe = {
664
664
  formatResponse: {}
665
665
  },
666
666
  emits: ["update:modelValue", "success", "fail", "remove"],
667
- setup(s, { emit: b }) {
668
- const n = s, f = b, c = R([]), p = x(() => Array.isArray(n.accept) ? n.accept.join(",") : n.accept), v = x(() => {
669
- if (n.valueType) return n.valueType;
670
- const t = n.modelValue;
667
+ setup(a, { emit: g }) {
668
+ const r = a, c = g, f = M([]), y = S(() => Array.isArray(r.accept) ? r.accept.join(",") : r.accept), p = S(() => {
669
+ if (r.valueType) return r.valueType;
670
+ const t = r.modelValue;
671
671
  return typeof t == "string" ? "string" : Array.isArray(t) ? t.length === 0 ? "stringArray" : typeof t[0] == "object" && t[0] !== null ? "objectArray" : "stringArray" : "string";
672
- }), h = (t) => /^(https?:|blob:|data:)/i.test(t), P = (t) => {
672
+ }), h = (t) => /^(https?:|blob:|data:)/i.test(t), B = (t) => {
673
673
  if (typeof t == "string") return t;
674
- const o = t[n.urlKey];
674
+ const o = t[r.urlKey];
675
675
  return typeof o == "string" ? o : "";
676
- }, C = (t, o) => {
677
- if (typeof t == "object" && t[n.nameKey]) {
678
- const e = t[n.nameKey];
676
+ }, I = (t, o) => {
677
+ if (typeof t == "object" && t[r.nameKey]) {
678
+ const e = t[r.nameKey];
679
679
  return typeof e == "string" ? e : String(e);
680
680
  }
681
681
  return o.split("/").pop() || "";
682
- }, V = (t) => !n.urlPrefix || !t ? t : t.startsWith(n.urlPrefix) ? t.slice(n.urlPrefix.length) : t, k = (t) => {
682
+ }, k = (t) => !r.urlPrefix || !t ? t : t.startsWith(r.urlPrefix) ? t.slice(r.urlPrefix.length) : t, O = (t) => {
683
683
  if (!t) return [];
684
684
  let o = [];
685
- return typeof t == "string" ? o = t.split(n.separator).filter(Boolean) : o = t.filter(Boolean), o.map((e, l) => {
686
- const a = P(e);
687
- if (!a) return null;
688
- const g = {
689
- url: h(a) ? a : n.urlPrefix + a,
690
- name: C(e, a),
685
+ return typeof t == "string" ? o = t.split(r.separator).filter(Boolean) : o = t.filter(Boolean), o.map((e, l) => {
686
+ const n = B(e);
687
+ if (!n) return null;
688
+ const V = {
689
+ url: h(n) ? n : r.urlPrefix + n,
690
+ name: I(e, n),
691
691
  status: "success",
692
- originalPath: a
692
+ originalPath: n
693
693
  };
694
- return typeof e == "object" && (g.__rawResult__ = e), g;
694
+ return typeof e == "object" && (V.__rawResult__ = e), V;
695
695
  }).filter(Boolean);
696
696
  };
697
- W(
698
- () => n.modelValue,
697
+ G(
698
+ () => r.modelValue,
699
699
  (t) => {
700
- const o = k(t), e = c.value.filter((a) => a.status === "success").map((a) => a.originalPath || a.url), l = o.map((a) => a.originalPath || a.url);
700
+ const o = O(t), e = f.value.filter((n) => n.status === "success").map((n) => n.originalPath || n.url), l = o.map((n) => n.originalPath || n.url);
701
701
  if (JSON.stringify(e) !== JSON.stringify(l)) {
702
- const a = c.value.filter((i) => i.status !== "success");
703
- c.value = [...o, ...a];
702
+ const n = f.value.filter((u) => u.status !== "success");
703
+ f.value = [...o, ...n];
704
704
  }
705
705
  },
706
706
  { immediate: !0 }
707
707
  );
708
- const S = () => {
709
- const t = c.value.filter((e) => e.status === "success");
708
+ const P = () => {
709
+ const t = f.value.filter((e) => e.status === "success");
710
710
  let o;
711
- switch (v.value) {
711
+ switch (p.value) {
712
712
  case "string":
713
- o = t.map((e) => V(e.originalPath || e.url || "")).filter(Boolean).join(n.separator);
713
+ o = t.map((e) => k(e.originalPath || e.url || "")).filter(Boolean).join(r.separator);
714
714
  break;
715
715
  case "objectArray":
716
716
  o = t.map((e) => {
717
717
  if (e.__rawResult__ && typeof e.__rawResult__ == "object") {
718
- const a = e.__rawResult__[n.urlKey];
718
+ const n = e.__rawResult__[r.urlKey];
719
719
  return {
720
720
  ...e.__rawResult__,
721
- [n.urlKey]: V(typeof a == "string" ? a : e.originalPath || e.url || "")
721
+ [r.urlKey]: k(typeof n == "string" ? n : e.originalPath || e.url || "")
722
722
  };
723
723
  }
724
724
  const l = {
725
- [n.urlKey]: V(e.originalPath || e.url || "")
725
+ [r.urlKey]: k(e.originalPath || e.url || "")
726
726
  };
727
- return n.nameKey && (l[n.nameKey] = e.name), l;
727
+ return r.nameKey && (l[r.nameKey] = e.name), l;
728
728
  });
729
729
  break;
730
730
  default:
731
- o = t.map((e) => V(e.originalPath || e.url || "")).filter(Boolean);
731
+ o = t.map((e) => k(e.originalPath || e.url || "")).filter(Boolean);
732
732
  break;
733
733
  }
734
- f("update:modelValue", o);
735
- }, u = (t) => {
734
+ c("update:modelValue", o);
735
+ }, i = (t) => {
736
736
  const { file: o, response: e } = t;
737
737
  if (console.log("[SmartUpload] onSuccess", { file: o, response: e }), o) {
738
738
  let l = "";
739
- if (n.formatResponse)
740
- l = n.formatResponse(e);
739
+ if (r.formatResponse)
740
+ l = r.formatResponse(e);
741
741
  else if (e && typeof e == "object") {
742
- const a = Array.isArray(e) ? e[0] : e;
743
- a && "url" in a && (l = a.url);
742
+ const n = Array.isArray(e) ? e[0] : e;
743
+ n && "url" in n && (l = n.url);
744
744
  }
745
745
  if (console.log("[SmartUpload] uploadResult:", l), l) {
746
- const a = typeof l == "object";
747
- let i = "", g;
748
- if (a) {
749
- const E = l[n.urlKey];
750
- i = typeof E == "string" ? E : "", g = l;
746
+ const n = typeof l == "object";
747
+ let u = "", V;
748
+ if (n) {
749
+ const L = l[r.urlKey];
750
+ u = typeof L == "string" ? L : "", V = l;
751
751
  } else
752
- i = l;
753
- const H = h(i) ? i : n.urlPrefix + i;
754
- J(() => {
755
- const E = c.value.findIndex((ne) => ne.name === o.name);
756
- console.log("[SmartUpload] fileIndex:", E), E >= 0 && (c.value[E] = {
757
- ...c.value[E],
752
+ u = l;
753
+ const _ = h(u) ? u : r.urlPrefix + u;
754
+ ee(() => {
755
+ const L = f.value.findIndex((se) => se.name === o.name);
756
+ console.log("[SmartUpload] fileIndex:", L), L >= 0 && (f.value[L] = {
757
+ ...f.value[L],
758
758
  status: "success",
759
- url: H,
760
- originalPath: i,
759
+ url: _,
760
+ originalPath: u,
761
761
  // 对象数组模式下保存完整返回
762
- __rawResult__: g
763
- }), S();
762
+ __rawResult__: V
763
+ }), P();
764
764
  });
765
765
  }
766
766
  }
767
- f("success", t);
768
- }, y = (t) => {
767
+ c("success", t);
768
+ }, b = (t) => {
769
769
  const { file: o } = t;
770
770
  if (o) {
771
- const e = c.value.findIndex((l) => l.name === o.name);
772
- e >= 0 && c.value.splice(e, 1);
771
+ const e = f.value.findIndex((l) => l.name === o.name);
772
+ e >= 0 && f.value.splice(e, 1);
773
773
  }
774
- j.error("上传失败,请重试"), f("fail", t);
774
+ q.error("上传失败,请重试"), c("fail", t);
775
775
  }, d = (t) => {
776
776
  const { index: o = 0, file: e } = t;
777
- f("remove", e, o), J(() => {
778
- S();
777
+ c("remove", e, o), ee(() => {
778
+ P();
779
779
  });
780
- }, r = (t) => {
780
+ }, s = (t) => {
781
781
  const { type: o, files: e } = t;
782
782
  switch (console.log("[SmartUpload] onValidate", { type: o, files: e }), o) {
783
783
  case "FILTER_FILE_SAME_NAME":
784
- j.info("请勿上传重复的文件");
784
+ q.info("请勿上传重复的文件");
785
785
  break;
786
786
  case "FILE_OVER_SIZE_LIMIT":
787
- j.error(`文件大小超过限制(最大 ${Math.round(n.maxSize / 1024)}MB)`);
787
+ q.error(`文件大小超过限制(最大 ${Math.round(r.maxSize / 1024)}MB)`);
788
788
  break;
789
789
  case "FILES_OVER_LENGTH_LIMIT":
790
- j.info(`最多只能上传 ${n.max} 个文件`);
790
+ q.info(`最多只能上传 ${r.max} 个文件`);
791
791
  break;
792
792
  }
793
793
  };
794
- return (t, o) => (B(), _("div", Le, [
795
- s.mode === "image" ? (B(), $(m(ee), {
794
+ return (t, o) => (v(), $("div", Me, [
795
+ a.mode === "image" ? (v(), C(m(te), {
796
796
  key: 0,
797
- modelValue: c.value,
798
- "onUpdate:modelValue": o[0] || (o[0] = (e) => c.value = e),
799
- action: s.action,
800
- accept: p.value,
801
- max: s.max,
802
- "size-limit": { size: s.maxSize, unit: "KB" },
803
- multiple: s.multiple,
804
- disabled: s.disabled,
805
- "request-method": s.requestMethod,
806
- onSuccess: u,
807
- onFail: y,
797
+ modelValue: f.value,
798
+ "onUpdate:modelValue": o[0] || (o[0] = (e) => f.value = e),
799
+ action: a.action,
800
+ accept: y.value,
801
+ max: a.max,
802
+ "size-limit": { size: a.maxSize, unit: "KB" },
803
+ multiple: a.multiple,
804
+ disabled: a.disabled,
805
+ "request-method": a.requestMethod,
806
+ onSuccess: i,
807
+ onFail: b,
808
808
  onRemove: d,
809
- onValidate: r
810
- }, null, 8, ["modelValue", "action", "accept", "max", "size-limit", "multiple", "disabled", "request-method"])) : (B(), $(m(ee), {
809
+ onValidate: s
810
+ }, null, 8, ["modelValue", "action", "accept", "max", "size-limit", "multiple", "disabled", "request-method"])) : (v(), C(m(te), {
811
811
  key: 1,
812
- modelValue: c.value,
813
- "onUpdate:modelValue": o[1] || (o[1] = (e) => c.value = e),
814
- action: s.action,
815
- accept: p.value,
816
- max: s.max,
817
- "size-limit": { size: s.maxSize, unit: "KB" },
818
- multiple: s.multiple,
819
- disabled: s.disabled,
820
- "request-method": s.requestMethod,
821
- onSuccess: u,
822
- onFail: y,
812
+ modelValue: f.value,
813
+ "onUpdate:modelValue": o[1] || (o[1] = (e) => f.value = e),
814
+ action: a.action,
815
+ accept: y.value,
816
+ max: a.max,
817
+ "size-limit": { size: a.maxSize, unit: "KB" },
818
+ multiple: a.multiple,
819
+ disabled: a.disabled,
820
+ "request-method": a.requestMethod,
821
+ onSuccess: i,
822
+ onFail: b,
823
823
  onRemove: d,
824
- onValidate: r
824
+ onValidate: s
825
825
  }, null, 8, ["modelValue", "action", "accept", "max", "size-limit", "multiple", "disabled", "request-method"]))
826
826
  ]));
827
827
  }
828
- }), Ke = /* @__PURE__ */ U(Fe, [["__scopeId", "data-v-a3054ef0"]]), je = { class: "smart-form" }, ze = {
828
+ }), Ne = /* @__PURE__ */ U(je, [["__scopeId", "data-v-a3054ef0"]]), qe = { class: "smart-form" }, Ye = {
829
829
  key: 0,
830
830
  class: "smart-form-footer"
831
- }, Me = {
831
+ }, De = {
832
832
  name: "SmartForm"
833
- }, Ne = /* @__PURE__ */ L({
834
- ...Me,
833
+ }, We = /* @__PURE__ */ F({
834
+ ...De,
835
835
  props: {
836
836
  modelValue: {},
837
837
  schemas: {},
@@ -845,125 +845,254 @@ const Be = { class: "smart-select" }, xe = {
845
845
  componentMap: {}
846
846
  },
847
847
  emits: ["update:modelValue", "submit", "reset", "validate-failed"],
848
- setup(s, { expose: b, emit: n }) {
849
- const f = s, c = n, p = R(), v = {
850
- input: A,
851
- password: A,
852
- number: A,
853
- textarea: ge,
854
- select: Se,
855
- cascader: _e,
856
- "tree-select": Re,
848
+ setup(a, { expose: g, emit: r }) {
849
+ const c = a, f = r, y = M(), p = {
850
+ input: R,
851
+ password: R,
852
+ number: R,
853
+ textarea: Be,
854
+ select: Ce,
855
+ cascader: Ee,
856
+ "tree-select": ze,
857
857
  date: le,
858
858
  time: le,
859
859
  switch: he,
860
- radio: be,
861
- checkbox: ve,
860
+ radio: ve,
861
+ checkbox: be,
862
862
  stepper: ye,
863
- upload: Ke
864
- }, h = (u) => {
865
- const y = u || "input";
866
- return f.componentMap?.[y] ? f.componentMap[y] : v[y] ?? null;
867
- }, P = (u) => {
868
- const y = [];
869
- return u.required && y.push({ required: !0, message: `${u.label || "该项"}不能为空` }), u.rules && y.push(...u.rules), y;
870
- }, C = (u) => {
871
- const y = f.modelValue;
863
+ upload: Ne
864
+ }, h = (i) => {
865
+ const b = i || "input";
866
+ return c.componentMap?.[b] ? c.componentMap[b] : p[b] ?? null;
867
+ }, B = (i) => {
868
+ const b = [];
869
+ return i.required && b.push({ required: !0, message: `${i.label || "该项"}不能为空` }), i.rules && b.push(...i.rules), b;
870
+ }, I = (i) => {
871
+ const b = c.modelValue;
872
872
  let d = {};
873
- typeof u.props == "function" ? d = u.props(y) : u.props && (d = { ...u.props });
874
- const r = u.type || "input";
875
- if (r === "password" ? Object.assign(d, { type: "password" }) : r === "number" ? Object.assign(d, { type: "number" }) : r === "date" ? Object.assign(d, { mode: "date" }) : r === "time" && Object.assign(d, { mode: ["hour", "minute"] }), ["input", "password", "number", "textarea"].includes(r) && (!(typeof u.props == "object" && u.props !== null && Object.prototype.hasOwnProperty.call(u.props, "borderless")) && d.borderless === void 0 && (d.borderless = !0), d.type === "file" && (console.warn(
876
- `[SmartForm] Detected type="file" on Input component (field: ${u.name}). Please use type: "upload" in your schema instead.`
877
- ), delete d.type)), f.disabled)
873
+ typeof i.props == "function" ? d = i.props(b) : i.props && (d = { ...i.props });
874
+ const s = i.type || "input";
875
+ if (s === "password" ? Object.assign(d, { type: "password" }) : s === "number" ? Object.assign(d, { type: "number" }) : s === "date" ? Object.assign(d, { mode: "date" }) : s === "time" && Object.assign(d, { mode: ["hour", "minute"] }), ["input", "password", "number", "textarea"].includes(s) && (!(typeof i.props == "object" && i.props !== null && Object.prototype.hasOwnProperty.call(i.props, "borderless")) && d.borderless === void 0 && (d.borderless = !0), d.type === "file" && (console.warn(
876
+ `[SmartForm] Detected type="file" on Input component (field: ${i.name}). Please use type: "upload" in your schema instead.`
877
+ ), delete d.type)), c.disabled)
878
878
  Object.assign(d, { disabled: !0 });
879
- else if (u.disabled) {
880
- const t = typeof u.disabled == "function" ? u.disabled(y) : u.disabled;
879
+ else if (i.disabled) {
880
+ const t = typeof i.disabled == "function" ? i.disabled(b) : i.disabled;
881
881
  Object.assign(d, { disabled: t });
882
882
  }
883
883
  return d;
884
- }, V = (u) => u.hidden === void 0 ? !0 : typeof u.hidden == "function" ? !u.hidden(f.modelValue) : !u.hidden, k = (u) => {
885
- u.validateResult === !0 ? c("submit", ue(f.modelValue)) : c("validate-failed", u.validateResult);
886
- }, S = () => {
887
- p.value?.reset(), c("reset");
884
+ }, k = (i) => i.hidden === void 0 ? !0 : typeof i.hidden == "function" ? !i.hidden(c.modelValue) : !i.hidden, O = (i) => {
885
+ i.validateResult === !0 ? f("submit", ie(c.modelValue)) : f("validate-failed", i.validateResult);
886
+ }, P = () => {
887
+ y.value?.reset(), f("reset");
888
888
  };
889
- return b({
890
- validate: () => p.value?.validate(),
891
- reset: () => p.value?.reset(),
892
- clearValidate: () => p.value?.clearValidate()
893
- }), (u, y) => (B(), _("div", je, [
894
- O(m(pe), {
889
+ return g({
890
+ validate: () => y.value?.validate(),
891
+ reset: () => y.value?.reset(),
892
+ clearValidate: () => y.value?.clearValidate()
893
+ }), (i, b) => (v(), $("div", qe, [
894
+ T(m(pe), {
895
895
  ref_key: "formRef",
896
- ref: p,
897
- data: s.modelValue,
898
- "label-width": s.labelWidth,
899
- "label-align": s.labelAlign,
900
- onSubmit: k
896
+ ref: y,
897
+ data: a.modelValue,
898
+ "label-width": a.labelWidth,
899
+ "label-align": a.labelAlign,
900
+ onSubmit: O
901
901
  }, {
902
- default: I(() => [
903
- (B(!0), _(Z, null, F(s.schemas, (d) => (B(), _(Z, {
902
+ default: x(() => [
903
+ (v(!0), $(H, null, j(a.schemas, (d) => (v(), $(H, {
904
904
  key: d.name
905
905
  }, [
906
- V(d) ? (B(), $(m(me), {
906
+ k(d) ? (v(), C(m(me), {
907
907
  key: 0,
908
908
  name: d.name,
909
909
  label: d.label,
910
- rules: P(d),
910
+ rules: B(d),
911
911
  help: d.help
912
912
  }, {
913
- default: I(() => [
914
- d.type === "slot" && d.slot ? K(u.$slots, d.slot, {
913
+ default: x(() => [
914
+ d.type === "slot" && d.slot ? A(i.$slots, d.slot, {
915
915
  key: 0,
916
- model: s.modelValue,
916
+ model: a.modelValue,
917
917
  schema: d
918
- }, void 0, !0) : (B(), $(se(h(d.type)), T({
918
+ }, void 0, !0) : (v(), C(N(h(d.type)), w({
919
919
  key: 1,
920
- modelValue: s.modelValue[d.name],
921
- "onUpdate:modelValue": (r) => s.modelValue[d.name] = r
922
- }, { ref_for: !0 }, C(d)), null, 16, ["modelValue", "onUpdate:modelValue"]))
920
+ modelValue: a.modelValue[d.name],
921
+ "onUpdate:modelValue": (s) => a.modelValue[d.name] = s
922
+ }, { ref_for: !0 }, I(d)), null, 16, ["modelValue", "onUpdate:modelValue"]))
923
923
  ]),
924
924
  _: 2
925
- }, 1032, ["name", "label", "rules", "help"])) : z("", !0)
925
+ }, 1032, ["name", "label", "rules", "help"])) : E("", !0)
926
926
  ], 64))), 128)),
927
- s.showFooter ? (B(), _("div", ze, [
928
- O(m(te), {
927
+ a.showFooter ? (v(), $("div", Ye, [
928
+ T(m(ae), {
929
929
  theme: "primary",
930
930
  type: "submit",
931
931
  block: "",
932
- loading: s.loading,
933
- disabled: s.disabled
932
+ loading: a.loading,
933
+ disabled: a.disabled
934
934
  }, {
935
- default: I(() => [
936
- Q(X(s.submitBtnText), 1)
935
+ default: x(() => [
936
+ J(Q(a.submitBtnText), 1)
937
937
  ]),
938
938
  _: 1
939
939
  }, 8, ["loading", "disabled"]),
940
- s.resetBtnText ? (B(), $(m(te), {
940
+ a.resetBtnText ? (v(), C(m(ae), {
941
941
  key: 0,
942
942
  theme: "default",
943
943
  variant: "outline",
944
944
  block: "",
945
945
  class: "reset-btn",
946
- onClick: S,
947
- disabled: s.disabled || s.loading
946
+ onClick: P,
947
+ disabled: a.disabled || a.loading
948
948
  }, {
949
- default: I(() => [
950
- Q(X(s.resetBtnText), 1)
949
+ default: x(() => [
950
+ J(Q(a.resetBtnText), 1)
951
951
  ]),
952
952
  _: 1
953
- }, 8, ["disabled"])) : z("", !0)
954
- ])) : z("", !0)
953
+ }, 8, ["disabled"])) : E("", !0)
954
+ ])) : E("", !0)
955
955
  ]),
956
956
  _: 3
957
957
  }, 8, ["data", "label-width", "label-align"])
958
958
  ]));
959
959
  }
960
- }), De = /* @__PURE__ */ U(Ne, [["__scopeId", "data-v-88de1754"]]);
960
+ }), _e = /* @__PURE__ */ U(We, [["__scopeId", "data-v-88de1754"]]), Ze = { class: "smart-page" }, Ge = { class: "smart-page__content" }, He = {
961
+ name: "SmartPage"
962
+ }, Je = /* @__PURE__ */ F({
963
+ ...He,
964
+ props: {
965
+ title: {},
966
+ showNavbar: { type: Boolean, default: !0 },
967
+ showBack: { type: Boolean, default: !1 },
968
+ onBack: {},
969
+ showTabBar: { type: Boolean, default: !1 },
970
+ tabs: {},
971
+ navbarAnimation: { type: Boolean, default: !0 },
972
+ navbarCapsule: {},
973
+ navbarFixed: { type: Boolean, default: !0 },
974
+ navbarLeft: {},
975
+ navbarPlaceholder: { type: Boolean, default: !0 },
976
+ navbarRight: {},
977
+ navbarSafeAreaInsetTop: { type: Boolean, default: !0 },
978
+ navbarTitleMaxLength: {},
979
+ navbarVisible: { type: Boolean, default: !0 },
980
+ navbarZIndex: {},
981
+ tabBarValue: {},
982
+ tabBarBordered: { type: Boolean, default: !0 },
983
+ tabBarFixed: { type: Boolean, default: !0 },
984
+ tabBarPlaceholder: { type: Boolean, default: !0 },
985
+ tabBarSafeAreaInsetBottom: { type: Boolean, default: !0 },
986
+ tabBarShape: { default: "round" },
987
+ tabBarSplit: { type: Boolean, default: !0 },
988
+ tabBarTheme: { default: "normal" },
989
+ tabBarZIndex: {}
990
+ },
991
+ emits: ["update:tabBarValue", "tab-change", "back", "right-click"],
992
+ setup(a, { emit: g }) {
993
+ const r = a, c = g, f = () => {
994
+ c("back"), r.onBack ? r.onBack() : window.history.back();
995
+ }, y = (p) => {
996
+ c("update:tabBarValue", p), c("tab-change", p);
997
+ };
998
+ return (p, h) => (v(), $("div", Ze, [
999
+ a.showNavbar ? (v(), C(m(ge), {
1000
+ key: 0,
1001
+ title: a.title,
1002
+ "left-arrow": a.showBack,
1003
+ animation: a.navbarAnimation,
1004
+ fixed: a.navbarFixed,
1005
+ placeholder: a.navbarPlaceholder,
1006
+ "safe-area-inset-top": a.navbarSafeAreaInsetTop,
1007
+ "title-max-length": a.navbarTitleMaxLength,
1008
+ visible: a.navbarVisible,
1009
+ "z-index": a.navbarZIndex,
1010
+ onLeftClick: f,
1011
+ onRightClick: h[0] || (h[0] = (B) => c("right-click"))
1012
+ }, K({ _: 2 }, [
1013
+ p.$slots["navbar-left"] || a.navbarLeft ? {
1014
+ name: "left",
1015
+ fn: x(() => [
1016
+ A(p.$slots, "navbar-left", {}, () => [
1017
+ a.navbarLeft ? (v(), C(N(a.navbarLeft), { key: 0 })) : E("", !0)
1018
+ ], !0)
1019
+ ]),
1020
+ key: "0"
1021
+ } : void 0,
1022
+ p.$slots["navbar-title"] ? {
1023
+ name: "title",
1024
+ fn: x(() => [
1025
+ A(p.$slots, "navbar-title", {}, void 0, !0)
1026
+ ]),
1027
+ key: "1"
1028
+ } : void 0,
1029
+ p.$slots["navbar-right"] || a.navbarRight ? {
1030
+ name: "right",
1031
+ fn: x(() => [
1032
+ A(p.$slots, "navbar-right", {}, () => [
1033
+ a.navbarRight ? (v(), C(N(a.navbarRight), { key: 0 })) : E("", !0)
1034
+ ], !0)
1035
+ ]),
1036
+ key: "2"
1037
+ } : void 0,
1038
+ p.$slots["navbar-capsule"] || a.navbarCapsule ? {
1039
+ name: "capsule",
1040
+ fn: x(() => [
1041
+ A(p.$slots, "navbar-capsule", {}, () => [
1042
+ a.navbarCapsule ? (v(), C(N(a.navbarCapsule), { key: 0 })) : E("", !0)
1043
+ ], !0)
1044
+ ]),
1045
+ key: "3"
1046
+ } : void 0
1047
+ ]), 1032, ["title", "left-arrow", "animation", "fixed", "placeholder", "safe-area-inset-top", "title-max-length", "visible", "z-index"])) : E("", !0),
1048
+ ne("div", Ge, [
1049
+ A(p.$slots, "default", {}, void 0, !0)
1050
+ ]),
1051
+ a.showTabBar && a.tabs?.length ? (v(), C(m(xe), {
1052
+ key: 1,
1053
+ value: a.tabBarValue,
1054
+ bordered: a.tabBarBordered,
1055
+ fixed: a.tabBarFixed,
1056
+ placeholder: a.tabBarPlaceholder,
1057
+ "safe-area-inset-bottom": a.tabBarSafeAreaInsetBottom,
1058
+ shape: a.tabBarShape,
1059
+ split: a.tabBarSplit,
1060
+ theme: a.tabBarTheme,
1061
+ "z-index": a.tabBarZIndex,
1062
+ onChange: y
1063
+ }, {
1064
+ default: x(() => [
1065
+ (v(!0), $(H, null, j(a.tabs, (B) => (v(), C(m(Ve), {
1066
+ key: B.value,
1067
+ value: B.value,
1068
+ "badge-props": B.badgeProps
1069
+ }, K({
1070
+ default: x(() => [
1071
+ J(" " + Q(B.label), 1)
1072
+ ]),
1073
+ _: 2
1074
+ }, [
1075
+ B.icon ? {
1076
+ name: "icon",
1077
+ fn: x(() => [
1078
+ (v(), C(N(B.icon)))
1079
+ ]),
1080
+ key: "0"
1081
+ } : void 0
1082
+ ]), 1032, ["value", "badge-props"]))), 128))
1083
+ ]),
1084
+ _: 1
1085
+ }, 8, ["value", "bordered", "fixed", "placeholder", "safe-area-inset-bottom", "shape", "split", "theme", "z-index"])) : E("", !0)
1086
+ ]));
1087
+ }
1088
+ }), et = /* @__PURE__ */ U(Je, [["__scopeId", "data-v-ba4b4ca0"]]);
961
1089
  export {
962
- _e as SmartCascader,
963
- De as SmartForm,
964
- Se as SmartSelect,
1090
+ Ee as SmartCascader,
1091
+ _e as SmartForm,
1092
+ et as SmartPage,
1093
+ Ce as SmartSelect,
965
1094
  le as SmartTimePicker,
966
- Re as SmartTreeSelect,
967
- Ke as SmartUpload
1095
+ ze as SmartTreeSelect,
1096
+ Ne as SmartUpload
968
1097
  };
969
1098
  //# sourceMappingURL=index.js.map