@solar-taro/ui-vant 2.5.1 → 2.5.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## 2.5.2 (2026-01-21)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **ui-vant/cascader:** fix bug
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - HyperLife1119
10
+
11
+ ## 2.5.1 (2026-01-12)
12
+
13
+ ### 🚀 Features
14
+
15
+ - **ui-vant/selector:** add clearable option and update clear logic
16
+ - **ui-vant/modal:** add extra slot
17
+ - **ui-vant:** add vBinding directive
18
+
19
+ ### ❤️ Thank You
20
+
21
+ - HyperLife1119
22
+
1
23
  ## 2.5.0 (2025-12-25)
2
24
 
3
25
  This was a version bump only for ui-vant to align it with other projects, there were no code changes.
package/index10.js CHANGED
@@ -1,13 +1,13 @@
1
- import { defineComponent as J, ref as F, computed as m, renderSlot as Q, openBlock as X, createElementBlock as Y, createCommentVNode as Z, mergeProps as _, resolveDirective as x, withDirectives as ee, createElementVNode as le, unref as te, toDisplayString as oe, createTextVNode as re, normalizeClass as ae, withCtx as ne, createSlots as se, createVNode as ie, normalizeStyle as ue, createBlock as de, Fragment as pe, renderList as ce } from "vue";
1
+ import { defineComponent as J, ref as F, computed as m, renderSlot as Q, openBlock as X, createElementBlock as Y, createCommentVNode as Z, mergeProps as _, resolveDirective as x, withDirectives as ee, createElementVNode as le, unref as te, toDisplayString as oe, createTextVNode as se, normalizeClass as ae, withCtx as ne, createSlots as re, createVNode as ie, normalizeStyle as ue, createBlock as de, Fragment as pe, renderList as ce } from "vue";
2
2
  import { useFilterList as fe } from "@solar-taro/core";
3
3
  import { SunLazyRender as ve, SunVirtualScroll as me, SunItem as O } from "@solar-taro/ui-sun";
4
4
  import B from "./index25.js";
5
- import ye from "./index7.js";
6
- import he from "./index6.js";
7
- const d = Q, a = X, i = Y, f = Z, R = _, be = x, I = ee, V = le, p = te, M = oe, ge = re, P = ae, n = ne, C = se, z = ie, T = ue, N = de, W = pe, ke = ce, Ve = ["label", "value", "placeholder", "required", "disabled"], $e = {
5
+ import he from "./index7.js";
6
+ import ye from "./index6.js";
7
+ const d = Q, a = X, i = Y, v = Z, R = _, be = x, I = ee, V = le, p = te, M = oe, ge = se, P = ae, n = ne, C = re, z = ie, T = ue, N = de, W = pe, ke = ce, Ve = ["label", "value", "placeholder", "required", "disabled"], $e = {
8
8
  key: 1,
9
9
  name: "right-icon"
10
- }, Se = ["label", "value", "placeholder", "use-right-icon-slot", "disabled"], we = {
10
+ }, we = ["label", "value", "placeholder", "use-right-icon-slot", "disabled"], Se = {
11
11
  key: 1,
12
12
  name: "right-icon"
13
13
  }, Ke = ["value"], Be = { class: "sun-selector-option-label" }, De = /* @__PURE__ */ J({
@@ -32,71 +32,71 @@ const d = Q, a = X, i = Y, f = Z, R = _, be = x, I = ee, V = le, p = te, M = oe,
32
32
  virtual: { type: [Boolean, Object] },
33
33
  refresher: { type: Boolean },
34
34
  refreshing: { type: Boolean },
35
- compareWith: { type: Function, default: ($, S) => $ === S }
35
+ compareWith: { type: Function, default: ($, w) => $ === w }
36
36
  },
37
37
  emits: ["update:modelValue", "select", "unselect", "clear", "close", "confirm", "refresh"],
38
- setup($, { expose: S, emit: j }) {
39
- const o = $, u = j, y = F(!1), h = F(!1), A = m(() => o.searcher || ((e, l) => e[o.labelKey].toLowerCase().includes(l))), { keyword: q, filteredList: w } = fe(() => o.options, A.value), K = m(() => {
38
+ setup($, { expose: w, emit: j }) {
39
+ const o = $, u = j, h = F(!1), y = F(!1), A = m(() => o.searcher || ((e, l) => e[o.labelKey].toLowerCase().includes(l))), { keyword: q, filteredList: S } = fe(() => o.options, A.value), K = m(() => {
40
40
  var e;
41
- if (v.value) {
41
+ if (c.value) {
42
42
  const l = B(o.modelValue) ? null : o.options.find(
43
- (r) => o.compareWith(r[o.valueKey], o.modelValue)
43
+ (s) => o.compareWith(s[o.valueKey], o.modelValue)
44
44
  );
45
45
  return (l == null ? void 0 : l[o.labelKey]) || "";
46
46
  }
47
47
  return (e = o.modelValue) == null ? void 0 : e.map(
48
48
  (l) => {
49
- var r;
50
- return ((r = o.options.find((t) => o.compareWith(t[o.valueKey], l))) == null ? void 0 : r[o.labelKey]) || "";
49
+ var s;
50
+ return ((s = o.options.find((t) => o.compareWith(t[o.valueKey], l))) == null ? void 0 : s[o.labelKey]) || "";
51
51
  }
52
52
  ).join(o.delimiter);
53
- }), b = m(() => !G(o.modelValue) && o.clearable), v = m(() => o.mode === "single"), U = m(() => {
54
- var r, t;
53
+ }), b = m(() => !G(o.modelValue) && o.clearable), c = m(() => o.mode === "single"), U = m(() => {
54
+ var s, t;
55
55
  let e, l = 47;
56
- return typeof o.virtual != "boolean" && (r = o.virtual) != null && r.itemSize && (l = (t = o.virtual) == null ? void 0 : t.itemSize), { id: e, itemSize: l };
56
+ return typeof o.virtual != "boolean" && (s = o.virtual) != null && s.itemSize && (l = (t = o.virtual) == null ? void 0 : t.itemSize), { id: e, itemSize: l };
57
57
  });
58
58
  function G(e) {
59
- return B(e) ? !0 : v.value ? !1 : e.length < 1;
59
+ return B(e) ? !0 : c.value ? !1 : e.length < 1;
60
60
  }
61
- function s(e) {
62
- var r;
61
+ function r(e) {
62
+ var s;
63
63
  const l = e[o.valueKey];
64
- return v.value ? B(o.modelValue) ? !1 : o.compareWith(o.modelValue, l) : ((r = o.modelValue) == null ? void 0 : r.some((t) => o.compareWith(t, l))) || !1;
64
+ return c.value ? B(o.modelValue) ? !1 : o.compareWith(o.modelValue, l) : ((s = o.modelValue) == null ? void 0 : s.some((t) => o.compareWith(t, l))) || !1;
65
65
  }
66
66
  function g() {
67
- o.disabled || (y.value = !0, h.value || setTimeout(() => {
68
- h.value = !0;
67
+ o.disabled || (h.value = !0, y.value || setTimeout(() => {
68
+ y.value = !0;
69
69
  }, 300));
70
70
  }
71
71
  function D() {
72
- y.value = !1, u("close");
72
+ h.value = !1, u("close");
73
73
  }
74
74
  function L() {
75
75
  var l;
76
76
  const e = ((l = o.modelValue) == null ? void 0 : l.map(
77
- (r) => o.options.find(
78
- (t) => o.compareWith(t[o.valueKey], r)
77
+ (s) => o.options.find(
78
+ (t) => o.compareWith(t[o.valueKey], s)
79
79
  )
80
80
  )) || [];
81
81
  u("confirm", e), D();
82
82
  }
83
83
  function E(e) {
84
84
  const l = e[o.valueKey];
85
- let r = o.modelValue;
86
- v.value ? (s(e) ? o.required || (u("unselect", e), r = null) : (u("select", e), r = l), D()) : s(e) ? (u("unselect", e), r = o.modelValue.filter(
85
+ let s = o.modelValue;
86
+ c.value ? (r(e) ? o.required || (u("unselect", e), s = null) : (u("select", e), s = l), D()) : r(e) ? (u("unselect", e), s = o.modelValue.filter(
87
87
  (t) => !o.compareWith(t, l)
88
- )) : (u("select", e), r = (o.modelValue || []).concat(
88
+ )) : (u("select", e), s = (o.modelValue || []).concat(
89
89
  e[o.valueKey]
90
- )), u("update:modelValue", r);
90
+ )), u("update:modelValue", s);
91
91
  }
92
92
  function k() {
93
- u("clear", o.modelValue), u("update:modelValue", o.required && !v.value ? [] : null);
93
+ u("clear", o.modelValue), u("update:modelValue", o.required && !c.value ? [] : null);
94
94
  }
95
- return S({
95
+ return w({
96
96
  present: g,
97
97
  clear: k
98
98
  }), (e, l) => {
99
- const r = be("readonly");
99
+ const s = be("readonly");
100
100
  return a(), i(W, null, [
101
101
  d(e.$slots, "default", {
102
102
  present: g,
@@ -117,12 +117,12 @@ const d = Q, a = X, i = Y, f = Z, R = _, be = x, I = ee, V = le, p = te, M = oe,
117
117
  class: "sun-selector-clear-icon",
118
118
  name: "clear",
119
119
  onTap: l[0] || (l[0] = (t) => k())
120
- }, null, 32)) : f("", !0),
120
+ }, null, 32)) : v("", !0),
121
121
  e.$slots.end ? (a(), i("slot-view", $e, [
122
122
  d(e.$slots, "end")
123
- ])) : f("", !0)
123
+ ])) : v("", !0)
124
124
  ], 16, Ve)), [
125
- [r]
125
+ [s]
126
126
  ]) : e.type === "search" ? I((a(), i("van-search", R({ key: 1 }, e.$attrs, {
127
127
  class: "sun-selector",
128
128
  label: e.label,
@@ -140,24 +140,25 @@ const d = Q, a = X, i = Y, f = Z, R = _, be = x, I = ee, V = le, p = te, M = oe,
140
140
  class: "sun-selector-clear-icon",
141
141
  name: "clear",
142
142
  onTap: l[2] || (l[2] = (t) => k())
143
- }, null, 32)) : f("", !0),
144
- e.$slots.end ? (a(), i("slot-view", we, [
143
+ }, null, 32)) : v("", !0),
144
+ e.$slots.end ? (a(), i("slot-view", Se, [
145
145
  d(e.$slots, "end")
146
- ])) : f("", !0)
147
- ], 16, Se)), [
148
- [r]
149
- ]) : f("", !0)
146
+ ])) : v("", !0)
147
+ ], 16, we)), [
148
+ [s]
149
+ ]) : v("", !0)
150
150
  ]),
151
151
  z(p(ve), { hook: "created" }, {
152
152
  default: n(() => [
153
- z(p(ye), {
154
- show: y.value,
155
- "onUpdate:show": l[9] || (l[9] = (t) => y.value = t),
156
- title: e.placeholder
153
+ z(p(he), {
154
+ show: h.value,
155
+ "onUpdate:show": l[9] || (l[9] = (t) => h.value = t),
156
+ title: e.placeholder,
157
+ "show-buttons": !c.value
157
158
  }, C({
158
159
  buttons: n(() => [
159
160
  d(e.$slots, "buttons", { confirm: L }, () => [
160
- v.value ? f("", !0) : (a(), i("van-button", {
161
+ c.value ? v("", !0) : (a(), i("van-button", {
161
162
  key: 0,
162
163
  type: "primary",
163
164
  round: "true",
@@ -167,7 +168,7 @@ const d = Q, a = X, i = Y, f = Z, R = _, be = x, I = ee, V = le, p = te, M = oe,
167
168
  ])
168
169
  ]),
169
170
  default: n(() => [
170
- d(e.$slots, "filter", { rendered: h.value }, () => [
171
+ d(e.$slots, "filter", { rendered: y.value }, () => [
171
172
  e.searchable ? (a(), i("van-search", {
172
173
  key: 0,
173
174
  shape: "round",
@@ -175,52 +176,52 @@ const d = Q, a = X, i = Y, f = Z, R = _, be = x, I = ee, V = le, p = te, M = oe,
175
176
  value: p(q),
176
177
  placeholder: "输入关键字搜索",
177
178
  onChange: l[5] || (l[5] = (t) => q.value = t.detail.trim())
178
- }, null, 40, Ke)) : f("", !0)
179
+ }, null, 40, Ke)) : v("", !0)
179
180
  ]),
180
181
  e.virtual ? (a(), i(W, { key: 0 }, [
181
- h.value ? (a(), N(p(me), {
182
+ y.value ? (a(), N(p(me), {
182
183
  key: 0,
183
184
  class: "sun-selector-options",
184
185
  refresher: e.refresher,
185
186
  refreshing: e.refreshing,
186
- items: p(w),
187
+ items: p(S),
187
188
  "item-size": U.value.itemSize,
188
189
  "item-key": e.valueKey,
189
190
  style: T({ height: e.height }),
190
191
  onRefresh: l[6] || (l[6] = (t) => u("refresh"))
191
192
  }, {
192
- default: n(({ item: t, index: c }) => [
193
+ default: n(({ item: t, index: f }) => [
193
194
  z(p(O), {
194
- class: P(["sun-selector-option", { "sun-selector-option-active": s(t) }]),
195
+ class: P(["sun-selector-option", { "sun-selector-option-active": r(t) }]),
195
196
  clickable: !0,
196
197
  onTap: (H) => E(t)
197
198
  }, C({
198
199
  start: n(() => [
199
200
  d(e.$slots, "option-start", {
200
201
  option: t,
201
- index: c,
202
- active: s(t)
202
+ index: f,
203
+ active: r(t)
203
204
  })
204
205
  ]),
205
206
  end: n(() => [
206
207
  d(e.$slots, "option-end", {
207
208
  option: t,
208
- index: c,
209
- active: s(t)
209
+ index: f,
210
+ active: r(t)
210
211
  })
211
212
  ]),
212
213
  default: n(() => [
213
214
  d(e.$slots, "option", {
214
215
  option: t,
215
- index: c,
216
- active: s(t)
216
+ index: f,
217
+ active: r(t)
217
218
  }, () => [
218
219
  ge(M(t[e.labelKey]), 1)
219
220
  ])
220
221
  ]),
221
222
  _: 2
222
223
  }, [
223
- s(t) ? {
224
+ r(t) ? {
224
225
  name: "end",
225
226
  fn: n(() => [
226
227
  l[10] || (l[10] = V("van-icon", {
@@ -237,50 +238,50 @@ const d = Q, a = X, i = Y, f = Z, R = _, be = x, I = ee, V = le, p = te, M = oe,
237
238
  key: 1,
238
239
  style: T({ height: e.height })
239
240
  }, null, 4))
240
- ], 64)) : (a(), N(p(he), {
241
+ ], 64)) : (a(), N(p(ye), {
241
242
  key: 1,
242
243
  class: "sun-selector-options",
243
244
  refresher: e.refresher,
244
245
  refreshing: e.refreshing,
245
- data: p(w),
246
+ data: p(S),
246
247
  loading: e.loading,
247
248
  "empty-type": "search",
248
249
  style: T({ height: e.height }),
249
250
  onRefresh: l[7] || (l[7] = (t) => u("refresh"))
250
251
  }, {
251
252
  default: n(() => [
252
- (a(!0), i(W, null, ke(p(w), (t, c) => (a(), N(p(O), {
253
+ (a(!0), i(W, null, ke(p(S), (t, f) => (a(), N(p(O), {
253
254
  key: t[e.valueKey],
254
- class: P(["sun-selector-option", { "sun-selector-option-active": s(t) }]),
255
+ class: P(["sun-selector-option", { "sun-selector-option-active": r(t) }]),
255
256
  clickable: !0,
256
257
  onTap: (H) => E(t)
257
258
  }, C({
258
259
  start: n(() => [
259
260
  d(e.$slots, "option-start", {
260
261
  option: t,
261
- index: c,
262
- active: s(t)
262
+ index: f,
263
+ active: r(t)
263
264
  })
264
265
  ]),
265
266
  end: n(() => [
266
267
  d(e.$slots, "option-end", {
267
268
  option: t,
268
- index: c,
269
- active: s(t)
269
+ index: f,
270
+ active: r(t)
270
271
  })
271
272
  ]),
272
273
  default: n(() => [
273
274
  d(e.$slots, "option", {
274
275
  option: t,
275
- index: c,
276
- active: s(t)
276
+ index: f,
277
+ active: r(t)
277
278
  }, () => [
278
279
  V("view", Be, M(t[e.labelKey]), 1)
279
280
  ])
280
281
  ]),
281
282
  _: 2
282
283
  }, [
283
- s(t) ? {
284
+ r(t) ? {
284
285
  name: "end",
285
286
  fn: n(() => [
286
287
  l[11] || (l[11] = V("van-icon", {
@@ -308,7 +309,7 @@ const d = Q, a = X, i = Y, f = Z, R = _, be = x, I = ee, V = le, p = te, M = oe,
308
309
  ]),
309
310
  key: "0"
310
311
  } : void 0
311
- ]), 1032, ["show", "title"])
312
+ ]), 1032, ["show", "title", "show-buttons"])
312
313
  ]),
313
314
  _: 3
314
315
  })
package/index116.js CHANGED
@@ -1,8 +1,8 @@
1
- import p from "./index126.js";
2
- import a from "./index127.js";
3
- import l from "./index128.js";
4
- import s from "./index129.js";
5
- import m from "./index130.js";
1
+ import p from "./index125.js";
2
+ import a from "./index126.js";
3
+ import l from "./index127.js";
4
+ import s from "./index128.js";
5
+ import m from "./index129.js";
6
6
  function t(o) {
7
7
  var e = -1, h = o == null ? 0 : o.length;
8
8
  for (this.clear(); ++e < h; ) {
package/index117.js CHANGED
@@ -1,4 +1,4 @@
1
- import e from "./index125.js";
1
+ import e from "./index130.js";
2
2
  function n(r, a) {
3
3
  var t = r.__data__;
4
4
  return e(a) ? t[typeof a == "string" ? "string" : "hash"] : t.map;
package/index125.js CHANGED
@@ -1,6 +1,6 @@
1
- function e(t) {
2
- var o = typeof t;
3
- return o == "string" || o == "number" || o == "symbol" || o == "boolean" ? t !== "__proto__" : t === null;
1
+ import t from "./index132.js";
2
+ function e() {
3
+ this.__data__ = t ? t(null) : {}, this.size = 0;
4
4
  }
5
5
  export {
6
6
  e as default
package/index126.js CHANGED
@@ -1,7 +1,7 @@
1
- import t from "./index132.js";
2
- function e() {
3
- this.__data__ = t ? t(null) : {}, this.size = 0;
1
+ function s(t) {
2
+ var e = this.has(t) && delete this.__data__[t];
3
+ return this.size -= e ? 1 : 0, e;
4
4
  }
5
5
  export {
6
- e as default
6
+ s as default
7
7
  };
package/index127.js CHANGED
@@ -1,7 +1,13 @@
1
- function s(t) {
2
- var e = this.has(t) && delete this.__data__[t];
3
- return this.size -= e ? 1 : 0, e;
1
+ import e from "./index132.js";
2
+ var n = "__lodash_hash_undefined__", o = Object.prototype, _ = o.hasOwnProperty;
3
+ function h(a) {
4
+ var r = this.__data__;
5
+ if (e) {
6
+ var t = r[a];
7
+ return t === n ? void 0 : t;
8
+ }
9
+ return _.call(r, a) ? r[a] : void 0;
4
10
  }
5
11
  export {
6
- s as default
12
+ h as default
7
13
  };
package/index128.js CHANGED
@@ -1,13 +1,9 @@
1
- import e from "./index132.js";
2
- var n = "__lodash_hash_undefined__", o = Object.prototype, _ = o.hasOwnProperty;
3
- function h(a) {
4
- var r = this.__data__;
5
- if (e) {
6
- var t = r[a];
7
- return t === n ? void 0 : t;
8
- }
9
- return _.call(r, a) ? r[a] : void 0;
1
+ import r from "./index132.js";
2
+ var e = Object.prototype, o = e.hasOwnProperty;
3
+ function p(t) {
4
+ var a = this.__data__;
5
+ return r ? a[t] !== void 0 : o.call(a, t);
10
6
  }
11
7
  export {
12
- h as default
8
+ p as default
13
9
  };
package/index129.js CHANGED
@@ -1,9 +1,9 @@
1
- import r from "./index132.js";
2
- var e = Object.prototype, o = e.hasOwnProperty;
3
- function p(t) {
4
- var a = this.__data__;
5
- return r ? a[t] !== void 0 : o.call(a, t);
1
+ import e from "./index132.js";
2
+ var h = "__lodash_hash_undefined__";
3
+ function s(t, a) {
4
+ var _ = this.__data__;
5
+ return this.size += this.has(t) ? 0 : 1, _[t] = e && a === void 0 ? h : a, this;
6
6
  }
7
7
  export {
8
- p as default
8
+ s as default
9
9
  };
package/index130.js CHANGED
@@ -1,9 +1,7 @@
1
- import e from "./index132.js";
2
- var h = "__lodash_hash_undefined__";
3
- function s(t, a) {
4
- var _ = this.__data__;
5
- return this.size += this.has(t) ? 0 : 1, _[t] = e && a === void 0 ? h : a, this;
1
+ function e(t) {
2
+ var o = typeof t;
3
+ return o == "string" || o == "number" || o == "symbol" || o == "boolean" ? t !== "__proto__" : t === null;
6
4
  }
7
5
  export {
8
- s as default
6
+ e as default
9
7
  };
package/index16.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index4.js";
1
+ import f from "./index5.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index17.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index3.js";
1
+ import f from "./index4.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index18.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index7.js";
1
+ import f from "./index6.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index19.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index6.js";
1
+ import f from "./index10.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index20.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index5.js";
1
+ import f from "./index3.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index21.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index10.js";
1
+ import f from "./index7.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index26.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import S from "./index60.js";
2
2
  import L from "./index58.js";
3
- import B from "./index55.js";
3
+ import B from "./index54.js";
4
4
  import I from "./index61.js";
5
5
  import O from "./index62.js";
6
6
  import _ from "./index63.js";
package/index3.js CHANGED
@@ -1,16 +1,11 @@
1
- import { defineComponent as J, mergeModels as T, useModel as O, computed as n, ref as D, renderSlot as Q, openBlock as W, createElementBlock as X, createCommentVNode as Y, mergeProps as Z, resolveDirective as x, withDirectives as ee, unref as le, renderList as ae, Fragment as te, toDisplayString as ne, createElementVNode as oe, createTextVNode as se, normalizeClass as re, withCtx as ue, createSlots as ie, createBlock as de, normalizeStyle as ce, createVNode as ve } from "vue";
2
- import { tree2list as me } from "@solar-kit/core";
3
- import { SunLazyRender as pe, SunItem as _ } from "@solar-taro/ui-sun";
4
- import { SunModal as fe } from "@solar-taro/ui-vant";
5
- import { linkedRef as q, untracked as he } from "@solar-vue/core";
6
- const ye = Q, t = W, o = X, b = Y, be = Z, ke = x, ge = ee, d = le, k = ae, m = te, z = ne, g = oe, E = se, we = re, c = ue, Ke = ie, M = de, I = ce, L = ve, Ne = ["label", "value", "placeholder", "required", "disabled"], Ve = ["active"], Ce = ["title"], Se = {
7
- key: 0,
8
- class: "sun-cascader-tab",
9
- title: "请选择",
10
- "title-style": "color:#94a3b8"
11
- }, ze = /* @__PURE__ */ J({
1
+ import { defineComponent as O, mergeModels as D, useModel as Q, computed as n, ref as _, renderSlot as W, openBlock as X, createElementBlock as Y, createCommentVNode as Z, mergeProps as x, resolveDirective as ee, withDirectives as le, unref as ae, renderList as te, Fragment as ne, toDisplayString as oe, createElementVNode as se, createTextVNode as re, normalizeClass as ue, withCtx as ie, createSlots as de, createBlock as ce, normalizeStyle as ve, createVNode as me } from "vue";
2
+ import { tree2list as pe } from "@solar-kit/core";
3
+ import { SunLazyRender as fe, SunItem as q } from "@solar-taro/ui-sun";
4
+ import { SunModal as he } from "@solar-taro/ui-vant";
5
+ import { linkedRef as z, untracked as ye } from "@solar-vue/core";
6
+ const be = W, t = X, o = Y, b = Z, ke = x, ge = ee, we = le, d = ae, k = te, m = ne, E = oe, g = se, M = re, Ke = ue, c = ie, Ne = de, I = ce, L = ve, F = me, Ve = ["label", "value", "placeholder", "required", "disabled"], Ce = ["active"], Se = ["name", "title"], Be = ["name"], Ee = /* @__PURE__ */ O({
12
7
  __name: "index",
13
- props: /* @__PURE__ */ T({
8
+ props: /* @__PURE__ */ D({
14
9
  label: {},
15
10
  placeholder: { default: "请选择" },
16
11
  options: {},
@@ -24,110 +19,111 @@ const ye = Q, t = W, o = X, b = Y, be = Z, ke = x, ge = ee, d = le, k = ae, m =
24
19
  modelValue: {},
25
20
  modelModifiers: {}
26
21
  }),
27
- emits: /* @__PURE__ */ T(["select", "clear", "close"], ["update:modelValue"]),
28
- setup(w, { emit: F }) {
29
- const p = F, s = w, r = O(w, "modelValue"), P = n(() => r.value && !s.required), u = D(!1), K = D(0), R = n(() => me(s.options)), f = n(() => R.value.find((e) => e.parent && !e.children && e[s.valueKey] === r.value)), j = n(() => {
22
+ emits: /* @__PURE__ */ D(["select", "clear", "close"], ["update:modelValue"]),
23
+ setup(w, { emit: P }) {
24
+ const p = P, s = w, r = Q(w, "modelValue"), R = n(() => r.value && !s.required), u = _(!1), K = _(0), j = n(() => pe(s.options)), f = n(() => j.value.find((e) => e.parent && !e.children && e[s.valueKey] === r.value)), U = n(() => {
30
25
  const e = [];
31
26
  let l = f.value;
32
27
  for (; l; )
33
28
  e.unshift(l), l = l.parent;
34
29
  return e;
35
- }), v = q(() => f.value), N = n(() => {
30
+ }), v = z(() => f.value), h = n(() => {
36
31
  const e = [];
37
32
  let l = v.value;
38
33
  for (; l; )
39
34
  e.unshift(l), l = l.parent;
40
35
  return e;
41
- }), V = n(() => {
36
+ }), N = n(() => {
42
37
  const e = v.value;
43
38
  return e ? !e.children : !1;
44
- }), C = n(() => j.value.map((e) => e[s.labelKey]).join(` ${s.delimiter} `)), h = q(
39
+ }), V = n(() => U.value.map((e) => e[s.labelKey]).join(` ${s.delimiter} `)), y = z(
45
40
  () => (
46
41
  // 如果有值,则取 currentNodes 的最后索引,否则为 0
47
- f.value ? he(() => N.value.length - 1) : 0
42
+ f.value ? ye(() => h.value.length - 1) : 0
48
43
  )
49
- ), S = n(() => s.options.filter((e) => !e.parent)), U = n(() => {
44
+ ), C = n(() => s.options.filter((e) => !e.parent)), A = n(() => {
50
45
  const e = v.value;
51
- return e ? e.children : S.value;
46
+ return e ? e.children : C.value;
52
47
  });
53
- function B() {
48
+ function S() {
54
49
  s.disabled || (u.value = !0, K.value++);
55
50
  }
56
- function A() {
51
+ function G() {
57
52
  u.value = !1, p("close");
58
53
  }
59
- function G() {
54
+ function H() {
60
55
  p("clear", r.value), r.value = null;
61
56
  }
62
- function $(e) {
63
- v.value = e, p("select", e), V.value ? (r.value = e[s.valueKey], u.value = !1) : h.value++;
57
+ function B(e) {
58
+ v.value = e, p("select", e), N.value ? (r.value = e[s.valueKey], u.value = !1) : y.value++;
64
59
  }
65
60
  return (e, l) => {
66
- const H = ke("readonly");
61
+ const J = ge("readonly");
67
62
  return t(), o(m, null, [
68
- ye(e.$slots, "default", {
69
- present: B,
70
- label: C.value
63
+ be(e.$slots, "default", {
64
+ present: S,
65
+ label: V.value
71
66
  }, () => [
72
- ge((t(), o("van-field", be(e.$attrs, {
67
+ we((t(), o("van-field", ke(e.$attrs, {
73
68
  class: "sun-cascader",
74
69
  label: e.label,
75
- value: C.value,
70
+ value: V.value,
76
71
  placeholder: e.placeholder,
77
72
  required: e.required,
78
73
  disabled: e.disabled,
79
- onClickInput: l[1] || (l[1] = (a) => B())
74
+ onClickInput: l[1] || (l[1] = (a) => S())
80
75
  }), [
81
- P.value ? (t(), o("van-icon", {
76
+ R.value ? (t(), o("van-icon", {
82
77
  key: 0,
83
78
  slot: "right-icon",
84
79
  class: "sun-cascader-clear-icon",
85
80
  name: "clear",
86
- onTap: l[0] || (l[0] = (a) => G())
81
+ onTap: l[0] || (l[0] = (a) => H())
87
82
  }, null, 32)) : b("", !0)
88
- ], 16, Ne)), [
89
- [H]
83
+ ], 16, Ve)), [
84
+ [J]
90
85
  ])
91
86
  ]),
92
- L(d(pe), { hook: "created" }, {
87
+ F(d(fe), { hook: "created" }, {
93
88
  default: c(() => [
94
- L(d(fe), {
89
+ F(d(he), {
95
90
  show: u.value,
96
91
  "onUpdate:show": l[3] || (l[3] = (a) => u.value = a),
97
92
  class: "sun-cascader-modal",
98
93
  title: e.placeholder,
99
94
  "show-buttons": !1,
100
- onClose: l[4] || (l[4] = (a) => A())
95
+ onClose: l[4] || (l[4] = (a) => G())
101
96
  }, {
102
97
  default: c(() => [
103
98
  K.value ? (t(), o("van-tabs", {
104
99
  key: 0,
105
100
  class: "sun-cascader-tabs",
106
- active: d(h),
101
+ active: d(y),
107
102
  "line-width": "30px",
108
103
  "line-height": "4px",
109
104
  animated: "true",
110
- onChange: l[2] || (l[2] = (a) => h.value = a.detail.index)
105
+ onChange: l[2] || (l[2] = (a) => y.value = a.detail.index)
111
106
  }, [
112
- (t(!0), o(m, null, k(N.value, (a) => {
113
- var y;
107
+ (t(!0), o(m, null, k(h.value, (a, $) => {
108
+ var T;
114
109
  return t(), o("van-tab", {
115
110
  key: a[e.valueKey],
111
+ name: $,
116
112
  class: "sun-cascader-tab",
117
113
  title: a[e.labelKey]
118
114
  }, [
119
115
  g("view", {
120
116
  class: "sun-cascader-list",
121
- style: I({ height: e.height })
117
+ style: L({ height: e.height })
122
118
  }, [
123
- (t(!0), o(m, null, k(((y = a.parent) == null ? void 0 : y.children) || S.value, (i) => (t(), M(d(_), {
119
+ (t(!0), o(m, null, k(((T = a.parent) == null ? void 0 : T.children) || C.value, (i) => (t(), I(d(q), {
124
120
  key: i[e.valueKey],
125
- class: we(["sun-cascader-option", { "sun-cascader-option-active": a[e.valueKey] === i[e.valueKey] }]),
121
+ class: Ke(["sun-cascader-option", { "sun-cascader-option-active": a[e.valueKey] === i[e.valueKey] }]),
126
122
  clickable: !0,
127
- onTap: (Be) => $(i)
128
- }, Ke({
123
+ onTap: ($e) => B(i)
124
+ }, Ne({
129
125
  default: c(() => [
130
- E(z(i[e.labelKey]) + " ", 1)
126
+ M(E(i[e.labelKey]) + " ", 1)
131
127
  ]),
132
128
  _: 2
133
129
  }, [
@@ -143,27 +139,33 @@ const ye = Q, t = W, o = X, b = Y, be = Z, ke = x, ge = ee, d = le, k = ae, m =
143
139
  } : void 0
144
140
  ]), 1032, ["class", "onTap"]))), 128))
145
141
  ], 4)
146
- ], 8, Ce);
142
+ ], 8, Se);
147
143
  }), 128)),
148
- V.value ? b("", !0) : (t(), o("van-tab", Se, [
144
+ N.value ? b("", !0) : (t(), o("van-tab", {
145
+ key: 0,
146
+ name: h.value.length,
147
+ class: "sun-cascader-tab",
148
+ title: "请选择",
149
+ "title-style": "color:#94a3b8"
150
+ }, [
149
151
  g("view", {
150
152
  class: "sun-cascader-list",
151
- style: I({ height: e.height })
153
+ style: L({ height: e.height })
152
154
  }, [
153
- (t(!0), o(m, null, k(U.value, (a) => (t(), M(d(_), {
155
+ (t(!0), o(m, null, k(A.value, (a) => (t(), I(d(q), {
154
156
  key: a[e.valueKey],
155
157
  class: "sun-cascader-option",
156
158
  clickable: !0,
157
- onTap: (y) => $(a)
159
+ onTap: ($) => B(a)
158
160
  }, {
159
161
  default: c(() => [
160
- E(z(a[e.labelKey]), 1)
162
+ M(E(a[e.labelKey]), 1)
161
163
  ]),
162
164
  _: 2
163
165
  }, 1032, ["onTap"]))), 128))
164
166
  ], 4)
165
- ]))
166
- ], 40, Ve)) : b("", !0)
167
+ ], 8, Be))
168
+ ], 40, Ce)) : b("", !0)
167
169
  ]),
168
170
  _: 1
169
171
  }, 8, ["show", "title"])
@@ -175,5 +177,5 @@ const ye = Q, t = W, o = X, b = Y, be = Z, ke = x, ge = ee, d = le, k = ae, m =
175
177
  }
176
178
  });
177
179
  export {
178
- ze as default
180
+ Ee as default
179
181
  };
package/index54.js CHANGED
@@ -1,14 +1,10 @@
1
- import m from "./index55.js";
2
- import t from "./index56.js";
3
- function v(a, f, i, u) {
4
- var d = !i;
5
- i || (i = {});
6
- for (var s = -1, e = f.length; ++s < e; ) {
7
- var n = f[s], r = void 0;
8
- r === void 0 && (r = a[n]), d ? t(i, n, r) : m(i, n, r);
9
- }
10
- return i;
1
+ import t from "./index55.js";
2
+ import i from "./index27.js";
3
+ var s = Object.prototype, p = s.hasOwnProperty;
4
+ function l(r, a, o) {
5
+ var n = r[a];
6
+ (!(p.call(r, a) && i(n, o)) || o === void 0 && !(a in r)) && t(r, a, o);
11
7
  }
12
8
  export {
13
- v as default
9
+ l as default
14
10
  };
package/index55.js CHANGED
@@ -1,10 +1,12 @@
1
- import t from "./index56.js";
2
- import i from "./index27.js";
3
- var s = Object.prototype, p = s.hasOwnProperty;
4
- function l(r, a, o) {
5
- var n = r[a];
6
- (!(p.call(r, a) && i(n, o)) || o === void 0 && !(a in r)) && t(r, a, o);
1
+ import u from "./index59.js";
2
+ function i(r, e, t) {
3
+ e == "__proto__" && u ? u(r, e, {
4
+ configurable: !0,
5
+ enumerable: !0,
6
+ value: t,
7
+ writable: !0
8
+ }) : r[e] = t;
7
9
  }
8
10
  export {
9
- l as default
11
+ i as default
10
12
  };
package/index56.js CHANGED
@@ -1,12 +1,14 @@
1
- import u from "./index59.js";
2
- function i(r, e, t) {
3
- e == "__proto__" && u ? u(r, e, {
4
- configurable: !0,
5
- enumerable: !0,
6
- value: t,
7
- writable: !0
8
- }) : r[e] = t;
1
+ import m from "./index54.js";
2
+ import t from "./index55.js";
3
+ function v(a, f, i, u) {
4
+ var d = !i;
5
+ i || (i = {});
6
+ for (var s = -1, e = f.length; ++s < e; ) {
7
+ var n = f[s], r = void 0;
8
+ r === void 0 && (r = a[n]), d ? t(i, n, r) : m(i, n, r);
9
+ }
10
+ return i;
9
11
  }
10
12
  export {
11
- i as default
13
+ v as default
12
14
  };
package/index61.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index54.js";
1
+ import o from "./index56.js";
2
2
  import e from "./index48.js";
3
3
  function m(r, t) {
4
4
  return r && o(t, e(t), r);
package/index62.js CHANGED
@@ -1,4 +1,4 @@
1
- import t from "./index54.js";
1
+ import t from "./index56.js";
2
2
  import o from "./index51.js";
3
3
  function i(n, r) {
4
4
  return n && t(r, o(r), n);
package/index65.js CHANGED
@@ -1,4 +1,4 @@
1
- import m from "./index54.js";
1
+ import m from "./index56.js";
2
2
  import r from "./index109.js";
3
3
  function f(o, t) {
4
4
  return m(o, r(o), t);
package/index66.js CHANGED
@@ -1,4 +1,4 @@
1
- import m from "./index54.js";
1
+ import m from "./index56.js";
2
2
  import r from "./index101.js";
3
3
  function e(o, t) {
4
4
  return m(o, r(o), t);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solar-taro/ui-vant",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",