@solar-taro/ui-vant 2.6.3 → 2.7.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2.6.4 (2026-03-14)
2
+
3
+ This was a version bump only for ui-vant to align it with other projects, there were no code changes.
4
+
5
+ ## 2.6.3 (2026-03-13)
6
+
7
+ This was a version bump only for ui-vant to align it with other projects, there were no code changes.
8
+
1
9
  ## 2.6.2 (2026-03-12)
2
10
 
3
11
  ### 🩹 Fixes
@@ -15,6 +15,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
15
15
  valueKey?: "children" | "parent" | "isLeaf" | keyof T;
16
16
  required?: boolean;
17
17
  disabled?: boolean;
18
+ clearable?: boolean;
18
19
  delimiter?: string;
19
20
  height?: string;
20
21
  }) & Partial<{}>> & import('vue').PublicProps;
package/index10.js CHANGED
@@ -1,10 +1,10 @@
1
- import { defineComponent as J, ref as F, computed as m, renderSlot as Q, openBlock as X, createElementBlock as Y, createCommentVNode as Z, createElementVNode as _, mergeProps as x, resolveDirective as ee, withDirectives as le, unref as te, toDisplayString as oe, createTextVNode as ne, normalizeClass as re, withCtx as se, createSlots as ae, 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, createElementVNode as _, mergeProps as x, resolveDirective as ee, withDirectives as le, unref as te, toDisplayString as oe, createTextVNode as ae, normalizeClass as ne, withCtx as re, createSlots as se, 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
5
  import he from "./index7.js";
6
6
  import ye from "./index6.js";
7
- const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe, ge = ne, P = re, r = se, C = ae, z = ie, T = ue, N = de, q = pe, Ve = ce, ke = ["label", "value", "placeholder", "required", "disabled"], $e = { name: "right-icon" }, we = ["label", "value", "placeholder", "use-right-icon-slot", "disabled"], Se = { name: "right-icon" }, Ke = ["value"], Be = { class: "sun-selector-option-label" }, De = /* @__PURE__ */ J({
7
+ const u = Q, r = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe, ge = ae, P = ne, n = re, C = se, z = ie, T = ue, N = de, W = pe, Ve = ce, ke = ["label", "value", "placeholder", "required", "disabled"], $e = { name: "right-icon" }, we = ["label", "value", "placeholder", "use-right-icon-slot", "disabled"], Se = { name: "right-icon" }, Ke = ["value"], Be = { class: "sun-selector-option-label" }, De = /* @__PURE__ */ J({
8
8
  __name: "index",
9
9
  props: {
10
10
  type: { default: "field" },
@@ -21,6 +21,7 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
21
21
  disabled: { type: Boolean },
22
22
  delimiter: { default: ", " },
23
23
  searchable: { type: Boolean, default: !0 },
24
+ clearable: { type: Boolean, default: !0 },
24
25
  searcher: {},
25
26
  virtual: { type: [Boolean, Object] },
26
27
  refresher: { type: Boolean },
@@ -29,32 +30,32 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
29
30
  },
30
31
  emits: ["update:modelValue", "select", "unselect", "clear", "close", "confirm", "refresh"],
31
32
  setup($, { expose: w, emit: j }) {
32
- const o = $, i = j, y = F(!1), b = F(!1), A = m(() => o.searcher || ((e, l) => e[o.labelKey].toLowerCase().includes(l))), { keyword: W, filteredList: S } = fe(() => o.options, A.value), K = m(() => {
33
+ const o = $, i = j, y = F(!1), b = 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(() => {
33
34
  var e;
34
35
  if (c.value) {
35
36
  const l = B(o.modelValue) ? null : o.options.find(
36
- (n) => o.compareWith(n[o.valueKey], o.modelValue)
37
+ (a) => o.compareWith(a[o.valueKey], o.modelValue)
37
38
  );
38
39
  return (l == null ? void 0 : l[o.labelKey]) || "";
39
40
  }
40
41
  return (e = o.modelValue) == null ? void 0 : e.map(
41
42
  (l) => {
42
- var n;
43
- return ((n = o.options.find((t) => o.compareWith(t[o.valueKey], l))) == null ? void 0 : n[o.labelKey]) || "";
43
+ var a;
44
+ return ((a = o.options.find((t) => o.compareWith(t[o.valueKey], l))) == null ? void 0 : a[o.labelKey]) || "";
44
45
  }
45
46
  ).join(o.delimiter);
46
- }), g = m(() => !G(o.modelValue) && !o.required), c = m(() => o.mode === "single"), U = m(() => {
47
- var n, t;
47
+ }), g = m(() => !G(o.modelValue) && o.clearable), c = m(() => o.mode === "single"), U = m(() => {
48
+ var a, t;
48
49
  let e, l = 47;
49
- return typeof o.virtual != "boolean" && (n = o.virtual) != null && n.itemSize && (l = (t = o.virtual) == null ? void 0 : t.itemSize), { id: e, itemSize: l };
50
+ return typeof o.virtual != "boolean" && (a = o.virtual) != null && a.itemSize && (l = (t = o.virtual) == null ? void 0 : t.itemSize), { id: e, itemSize: l };
50
51
  });
51
52
  function G(e) {
52
53
  return B(e) ? !0 : c.value ? !1 : e.length < 1;
53
54
  }
54
- function a(e) {
55
- var n;
55
+ function s(e) {
56
+ var a;
56
57
  const l = e[o.valueKey];
57
- return c.value ? B(o.modelValue) ? !1 : o.compareWith(o.modelValue, l) : ((n = o.modelValue) == null ? void 0 : n.some((t) => o.compareWith(t, l))) || !1;
58
+ return c.value ? B(o.modelValue) ? !1 : o.compareWith(o.modelValue, l) : ((a = o.modelValue) == null ? void 0 : a.some((t) => o.compareWith(t, l))) || !1;
58
59
  }
59
60
  function V() {
60
61
  o.disabled || (y.value = !0, b.value || setTimeout(() => {
@@ -67,20 +68,20 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
67
68
  function L() {
68
69
  var l;
69
70
  const e = ((l = o.modelValue) == null ? void 0 : l.map(
70
- (n) => o.options.find(
71
- (t) => o.compareWith(t[o.valueKey], n)
71
+ (a) => o.options.find(
72
+ (t) => o.compareWith(t[o.valueKey], a)
72
73
  )
73
74
  )) || [];
74
75
  i("confirm", e), D();
75
76
  }
76
77
  function E(e) {
77
78
  const l = e[o.valueKey];
78
- let n = o.modelValue;
79
- c.value ? (a(e) ? o.required || (i("unselect", e), n = null) : (i("select", e), n = l), D()) : a(e) ? (i("unselect", e), n = o.modelValue.filter(
79
+ let a = o.modelValue;
80
+ c.value ? (s(e) ? o.required || (i("unselect", e), a = null) : (i("select", e), a = l), D()) : s(e) ? (i("unselect", e), a = o.modelValue.filter(
80
81
  (t) => !o.compareWith(t, l)
81
- )) : (i("select", e), n = (o.modelValue || []).concat(
82
+ )) : (i("select", e), a = (o.modelValue || []).concat(
82
83
  e[o.valueKey]
83
- )), i("update:modelValue", n);
84
+ )), i("update:modelValue", a);
84
85
  }
85
86
  function k() {
86
87
  i("clear", o.modelValue), i("update:modelValue", o.required && !c.value ? [] : null);
@@ -89,13 +90,13 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
89
90
  present: V,
90
91
  clear: k
91
92
  }), (e, l) => {
92
- const n = be("readonly");
93
- return s(), d(q, null, [
93
+ const a = be("readonly");
94
+ return r(), d(W, null, [
94
95
  u(e.$slots, "default", {
95
96
  present: V,
96
97
  label: K.value
97
98
  }, () => [
98
- e.type === "field" ? I((s(), d("van-field", R({ key: 0 }, e.$attrs, {
99
+ e.type === "field" ? I((r(), d("van-field", R({ key: 0 }, e.$attrs, {
99
100
  class: "sun-selector",
100
101
  label: e.label,
101
102
  value: K.value,
@@ -105,7 +106,7 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
105
106
  onClickInput: l[1] || (l[1] = (t) => V())
106
107
  }), [
107
108
  v("slot-view", $e, [
108
- g.value ? (s(), d("van-icon", {
109
+ g.value ? (r(), d("van-icon", {
109
110
  key: 0,
110
111
  class: "sun-selector-clear-icon",
111
112
  name: "clear",
@@ -114,8 +115,8 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
114
115
  u(e.$slots, "end")
115
116
  ])
116
117
  ], 16, ke)), [
117
- [n]
118
- ]) : e.type === "search" ? I((s(), d("van-search", R({ key: 1 }, e.$attrs, {
118
+ [a]
119
+ ]) : e.type === "search" ? I((r(), d("van-search", R({ key: 1 }, e.$attrs, {
119
120
  class: "sun-selector",
120
121
  label: e.label,
121
122
  value: K.value,
@@ -127,7 +128,7 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
127
128
  onClickInput: l[3] || (l[3] = (t) => V())
128
129
  }), [
129
130
  v("slot-view", Se, [
130
- g.value ? (s(), d("van-icon", {
131
+ g.value ? (r(), d("van-icon", {
131
132
  key: 0,
132
133
  class: "sun-selector-clear-icon",
133
134
  name: "clear",
@@ -136,20 +137,20 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
136
137
  u(e.$slots, "end")
137
138
  ])
138
139
  ], 16, we)), [
139
- [n]
140
+ [a]
140
141
  ]) : h("", !0)
141
142
  ]),
142
143
  z(p(ve), { hook: "created" }, {
143
- default: r(() => [
144
+ default: n(() => [
144
145
  z(p(he), {
145
146
  show: y.value,
146
147
  "onUpdate:show": l[9] || (l[9] = (t) => y.value = t),
147
148
  title: e.placeholder,
148
149
  "show-buttons": !c.value
149
150
  }, C({
150
- buttons: r(() => [
151
+ buttons: n(() => [
151
152
  u(e.$slots, "buttons", { confirm: L }, () => [
152
- c.value ? h("", !0) : (s(), d("van-button", {
153
+ c.value ? h("", !0) : (r(), d("van-button", {
153
154
  key: 0,
154
155
  type: "primary",
155
156
  round: "true",
@@ -158,19 +159,19 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
158
159
  }, "确定", 32))
159
160
  ])
160
161
  ]),
161
- default: r(() => [
162
+ default: n(() => [
162
163
  u(e.$slots, "filter", { rendered: b.value }, () => [
163
- e.searchable ? (s(), d("van-search", {
164
+ e.searchable ? (r(), d("van-search", {
164
165
  key: 0,
165
166
  shape: "round",
166
167
  "input-align": "center",
167
- value: p(W),
168
+ value: p(q),
168
169
  placeholder: "输入关键字搜索",
169
- onChange: l[5] || (l[5] = (t) => W.value = t.detail.trim())
170
+ onChange: l[5] || (l[5] = (t) => q.value = t.detail.trim())
170
171
  }, null, 40, Ke)) : h("", !0)
171
172
  ]),
172
- e.virtual ? (s(), d(q, { key: 0 }, [
173
- b.value ? (s(), N(p(me), {
173
+ e.virtual ? (r(), d(W, { key: 0 }, [
174
+ b.value ? (r(), N(p(me), {
174
175
  key: 0,
175
176
  class: "sun-selector-options",
176
177
  refresher: e.refresher,
@@ -181,40 +182,40 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
181
182
  style: T({ height: e.height }),
182
183
  onRefresh: l[6] || (l[6] = (t) => i("refresh"))
183
184
  }, {
184
- default: r(({ item: t, index: f }) => [
185
+ default: n(({ item: t, index: f }) => [
185
186
  z(p(O), {
186
- class: P(["sun-selector-option", { "sun-selector-option-active": a(t) }]),
187
+ class: P(["sun-selector-option", { "sun-selector-option-active": s(t) }]),
187
188
  clickable: !0,
188
189
  onTap: (H) => E(t)
189
190
  }, C({
190
- start: r(() => [
191
+ start: n(() => [
191
192
  u(e.$slots, "option-start", {
192
193
  option: t,
193
194
  index: f,
194
- active: a(t)
195
+ active: s(t)
195
196
  })
196
197
  ]),
197
- end: r(() => [
198
+ end: n(() => [
198
199
  u(e.$slots, "option-end", {
199
200
  option: t,
200
201
  index: f,
201
- active: a(t)
202
+ active: s(t)
202
203
  })
203
204
  ]),
204
- default: r(() => [
205
+ default: n(() => [
205
206
  u(e.$slots, "option", {
206
207
  option: t,
207
208
  index: f,
208
- active: a(t)
209
+ active: s(t)
209
210
  }, () => [
210
211
  ge(M(t[e.labelKey]), 1)
211
212
  ])
212
213
  ]),
213
214
  _: 2
214
215
  }, [
215
- a(t) ? {
216
+ s(t) ? {
216
217
  name: "end",
217
- fn: r(() => [
218
+ fn: n(() => [
218
219
  l[10] || (l[10] = v("van-icon", {
219
220
  class: "sun-selector-option-icon",
220
221
  name: "success"
@@ -225,11 +226,11 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
225
226
  ]), 1032, ["class", "onTap"])
226
227
  ]),
227
228
  _: 3
228
- }, 8, ["refresher", "refreshing", "items", "item-size", "item-key", "style"])) : (s(), d("view", {
229
+ }, 8, ["refresher", "refreshing", "items", "item-size", "item-key", "style"])) : (r(), d("view", {
229
230
  key: 1,
230
231
  style: T({ height: e.height })
231
232
  }, null, 4))
232
- ], 64)) : (s(), N(p(ye), {
233
+ ], 64)) : (r(), N(p(ye), {
233
234
  key: 1,
234
235
  class: "sun-selector-options",
235
236
  refresher: e.refresher,
@@ -240,41 +241,41 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
240
241
  style: T({ height: e.height }),
241
242
  onRefresh: l[7] || (l[7] = (t) => i("refresh"))
242
243
  }, {
243
- default: r(() => [
244
- (s(!0), d(q, null, Ve(p(S), (t, f) => (s(), N(p(O), {
244
+ default: n(() => [
245
+ (r(!0), d(W, null, Ve(p(S), (t, f) => (r(), N(p(O), {
245
246
  key: t[e.valueKey],
246
- class: P(["sun-selector-option", { "sun-selector-option-active": a(t) }]),
247
+ class: P(["sun-selector-option", { "sun-selector-option-active": s(t) }]),
247
248
  clickable: !0,
248
249
  onTap: (H) => E(t)
249
250
  }, C({
250
- start: r(() => [
251
+ start: n(() => [
251
252
  u(e.$slots, "option-start", {
252
253
  option: t,
253
254
  index: f,
254
- active: a(t)
255
+ active: s(t)
255
256
  })
256
257
  ]),
257
- end: r(() => [
258
+ end: n(() => [
258
259
  u(e.$slots, "option-end", {
259
260
  option: t,
260
261
  index: f,
261
- active: a(t)
262
+ active: s(t)
262
263
  })
263
264
  ]),
264
- default: r(() => [
265
+ default: n(() => [
265
266
  u(e.$slots, "option", {
266
267
  option: t,
267
268
  index: f,
268
- active: a(t)
269
+ active: s(t)
269
270
  }, () => [
270
271
  v("view", Be, M(t[e.labelKey]), 1)
271
272
  ])
272
273
  ]),
273
274
  _: 2
274
275
  }, [
275
- a(t) ? {
276
+ s(t) ? {
276
277
  name: "end",
277
- fn: r(() => [
278
+ fn: n(() => [
278
279
  l[11] || (l[11] = v("van-icon", {
279
280
  class: "sun-selector-option-icon",
280
281
  slot: "right-icon",
@@ -292,7 +293,7 @@ const u = Q, s = X, d = Y, h = Z, v = _, R = x, be = ee, I = le, p = te, M = oe,
292
293
  }, [
293
294
  g.value ? {
294
295
  name: "extra",
295
- fn: r(() => [
296
+ fn: n(() => [
296
297
  v("view", {
297
298
  class: "sun-selector-clear-btn",
298
299
  onTap: l[4] || (l[4] = (t) => k())
package/index102.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import r from "./index87.js";
2
- import i from "./index118.js";
2
+ import i from "./index123.js";
3
3
  function f(t, a) {
4
4
  var e = i(t, a);
5
5
  return r(e) ? e : void 0;
package/index103.js CHANGED
@@ -1,8 +1,8 @@
1
- import p from "./index119.js";
2
- import a from "./index120.js";
3
- import i from "./index121.js";
4
- import h from "./index122.js";
5
- import s from "./index123.js";
1
+ import p from "./index118.js";
2
+ import a from "./index119.js";
3
+ import i from "./index120.js";
4
+ import h from "./index121.js";
5
+ import s from "./index122.js";
6
6
  function t(e) {
7
7
  var o = -1, l = e == null ? 0 : e.length;
8
8
  for (this.clear(); ++o < l; ) {
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/index118.js CHANGED
@@ -1,6 +1,6 @@
1
- function u(e, n) {
2
- return e == null ? void 0 : e[n];
1
+ function t() {
2
+ this.__data__ = [], this.size = 0;
3
3
  }
4
4
  export {
5
- u as default
5
+ t as default
6
6
  };
package/index119.js CHANGED
@@ -1,6 +1,12 @@
1
- function t() {
2
- this.__data__ = [], this.size = 0;
1
+ import s from "./index131.js";
2
+ var i = Array.prototype, l = i.splice;
3
+ function n(r) {
4
+ var e = this.__data__, a = s(e, r);
5
+ if (a < 0)
6
+ return !1;
7
+ var t = e.length - 1;
8
+ return a == t ? e.pop() : l.call(e, a, 1), --this.size, !0;
3
9
  }
4
10
  export {
5
- t as default
11
+ n as default
6
12
  };
package/index120.js CHANGED
@@ -1,12 +1,8 @@
1
- import s from "./index131.js";
2
- var i = Array.prototype, l = i.splice;
3
- function n(r) {
4
- var e = this.__data__, a = s(e, r);
5
- if (a < 0)
6
- return !1;
7
- var t = e.length - 1;
8
- return a == t ? e.pop() : l.call(e, a, 1), --this.size, !0;
1
+ import d from "./index131.js";
2
+ function i(e) {
3
+ var t = this.__data__, a = d(t, e);
4
+ return a < 0 ? void 0 : t[a][1];
9
5
  }
10
6
  export {
11
- n as default
7
+ i as default
12
8
  };
package/index121.js CHANGED
@@ -1,8 +1,7 @@
1
- import d from "./index131.js";
2
- function i(e) {
3
- var t = this.__data__, a = d(t, e);
4
- return a < 0 ? void 0 : t[a][1];
1
+ import a from "./index131.js";
2
+ function e(t) {
3
+ return a(this.__data__, t) > -1;
5
4
  }
6
5
  export {
7
- i as default
6
+ e as default
8
7
  };
package/index122.js CHANGED
@@ -1,7 +1,8 @@
1
- import a from "./index131.js";
2
- function e(t) {
3
- return a(this.__data__, t) > -1;
1
+ import e from "./index131.js";
2
+ function d(s, i) {
3
+ var t = this.__data__, a = e(t, s);
4
+ return a < 0 ? (++this.size, t.push([s, i])) : t[a][1] = i, this;
4
5
  }
5
6
  export {
6
- e as default
7
+ d as default
7
8
  };
package/index123.js CHANGED
@@ -1,8 +1,6 @@
1
- import e from "./index131.js";
2
- function d(s, i) {
3
- var t = this.__data__, a = e(t, s);
4
- return a < 0 ? (++this.size, t.push([s, i])) : t[a][1] = i, this;
1
+ function u(e, n) {
2
+ return e == null ? void 0 : e[n];
5
3
  }
6
4
  export {
7
- d as default
5
+ u as default
8
6
  };
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 "./index3.js";
1
+ import f from "./index6.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 "./index3.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index19.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index8.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 "./index6.js";
1
+ import f from "./index5.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index22.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/index23.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index5.js";
1
+ import f from "./index8.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index3.js CHANGED
@@ -1,9 +1,9 @@
1
- import { defineComponent as Q, mergeModels as _, useModel as W, computed as n, ref as D, renderSlot as X, openBlock as Y, createElementBlock as Z, createCommentVNode as x, createElementVNode as ee, mergeProps as le, resolveDirective as ae, withDirectives as te, unref as ne, renderList as se, Fragment as oe, toDisplayString as re, createTextVNode as ue, normalizeClass as ie, withCtx as de, createSlots as ce, createBlock as ve, normalizeStyle as me, createVNode as pe } from "vue";
1
+ import { defineComponent as Q, mergeModels as _, useModel as W, computed as n, ref as D, renderSlot as X, openBlock as Y, createElementBlock as Z, createCommentVNode as x, createElementVNode as ee, mergeProps as le, resolveDirective as ae, withDirectives as te, unref as ne, renderList as oe, Fragment as se, toDisplayString as re, createTextVNode as ue, normalizeClass as ie, withCtx as de, createSlots as ce, createBlock as ve, normalizeStyle as me, createVNode as pe } from "vue";
2
2
  import { tree2list as fe } from "@solar-kit/core";
3
- import { SunLazyRender as he, SunItem as q } from "@solar-taro/ui-sun";
3
+ import { SunLazyRender as he, SunItem as z } from "@solar-taro/ui-sun";
4
4
  import { SunModal as ye } from "@solar-taro/ui-vant";
5
- import { linkedRef as z, untracked as be } from "@solar-vue/core";
6
- const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g = se, p = oe, M = re, I = ue, Ke = ie, c = de, Ne = ce, L = ve, F = me, P = pe, Ve = ["label", "value", "placeholder", "required", "disabled"], Ce = { name: "right-icon" }, Se = ["active"], $e = ["name", "title"], Be = ["name"], Me = /* @__PURE__ */ Q({
5
+ import { linkedRef as E, untracked as be } from "@solar-vue/core";
6
+ const q = X, t = Y, o = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g = oe, p = se, M = re, I = ue, Ke = ie, c = de, Ne = ce, L = ve, F = me, P = pe, Ve = ["label", "value", "placeholder", "required", "disabled"], Ce = { name: "right-icon" }, Se = ["active"], Be = ["name", "title"], $e = ["name"], Me = /* @__PURE__ */ Q({
7
7
  __name: "index",
8
8
  props: /* @__PURE__ */ _({
9
9
  label: {},
@@ -13,6 +13,7 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
13
13
  valueKey: { default: "id" },
14
14
  required: { type: Boolean },
15
15
  disabled: { type: Boolean },
16
+ clearable: { type: Boolean, default: !0 },
16
17
  delimiter: { default: "/" },
17
18
  height: { default: "50vh" }
18
19
  }, {
@@ -21,13 +22,13 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
21
22
  }),
22
23
  emits: /* @__PURE__ */ _(["select", "clear", "close"], ["update:modelValue"]),
23
24
  setup(w, { emit: R }) {
24
- const f = R, o = w, r = W(w, "modelValue"), j = n(() => r.value && !o.required), u = D(!1), K = D(0), U = n(() => fe(o.options)), h = n(() => U.value.find((e) => e.parent && !e.children && e[o.valueKey] === r.value)), A = n(() => {
25
+ const f = R, s = w, r = W(w, "modelValue"), j = n(() => r.value && s.clearable), u = D(!1), K = D(0), U = n(() => fe(s.options)), h = n(() => U.value.find((e) => e.parent && !e.children && e[s.valueKey] === r.value)), A = n(() => {
25
26
  const e = [];
26
27
  let l = h.value;
27
28
  for (; l; )
28
29
  e.unshift(l), l = l.parent;
29
30
  return e;
30
- }), v = z(() => h.value), y = n(() => {
31
+ }), v = E(() => h.value), y = n(() => {
31
32
  const e = [];
32
33
  let l = v.value;
33
34
  for (; l; )
@@ -36,17 +37,17 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
36
37
  }), N = n(() => {
37
38
  const e = v.value;
38
39
  return e ? !e.children : !1;
39
- }), V = n(() => A.value.map((e) => e[o.labelKey]).join(` ${o.delimiter} `)), b = z(
40
+ }), V = n(() => A.value.map((e) => e[s.labelKey]).join(` ${s.delimiter} `)), b = E(
40
41
  () => (
41
42
  // 如果有值,则取 currentNodes 的最后索引,否则为 0
42
43
  h.value ? be(() => y.value.length - 1) : 0
43
44
  )
44
- ), C = n(() => o.options.filter((e) => !e.parent)), G = n(() => {
45
+ ), C = n(() => s.options.filter((e) => !e.parent)), G = n(() => {
45
46
  const e = v.value;
46
47
  return e ? e.children : C.value;
47
48
  });
48
49
  function S() {
49
- o.disabled || (u.value = !0, K.value++);
50
+ s.disabled || (u.value = !0, K.value++);
50
51
  }
51
52
  function H() {
52
53
  u.value = !1, f("close");
@@ -54,17 +55,17 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
54
55
  function J() {
55
56
  f("clear", r.value), r.value = null;
56
57
  }
57
- function $(e) {
58
- v.value = e, f("select", e), N.value ? (r.value = e[o.valueKey], u.value = !1) : b.value++;
58
+ function B(e) {
59
+ v.value = e, f("select", e), N.value ? (r.value = e[s.valueKey], u.value = !1) : b.value++;
59
60
  }
60
61
  return (e, l) => {
61
62
  const O = ge("readonly");
62
- return t(), s(p, null, [
63
- E(e.$slots, "default", {
63
+ return t(), o(p, null, [
64
+ q(e.$slots, "default", {
64
65
  present: S,
65
66
  label: V.value
66
67
  }, () => [
67
- we((t(), s("van-field", ke(e.$attrs, {
68
+ we((t(), o("van-field", ke(e.$attrs, {
68
69
  class: "sun-cascader",
69
70
  label: e.label,
70
71
  value: V.value,
@@ -74,13 +75,13 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
74
75
  onClickInput: l[1] || (l[1] = (a) => S())
75
76
  }), [
76
77
  m("slot-view", Ce, [
77
- j.value ? (t(), s("van-icon", {
78
+ j.value ? (t(), o("van-icon", {
78
79
  key: 0,
79
80
  class: "sun-cascader-clear-icon",
80
81
  name: "clear",
81
82
  onTap: l[0] || (l[0] = (a) => J())
82
83
  }, null, 32)) : k("", !0),
83
- E(e.$slots, "end")
84
+ q(e.$slots, "end")
84
85
  ])
85
86
  ], 16, Ve)), [
86
87
  [O]
@@ -97,7 +98,7 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
97
98
  onClose: l[4] || (l[4] = (a) => H())
98
99
  }, {
99
100
  default: c(() => [
100
- K.value ? (t(), s("van-tabs", {
101
+ K.value ? (t(), o("van-tabs", {
101
102
  key: 0,
102
103
  class: "sun-cascader-tabs",
103
104
  active: d(b),
@@ -106,11 +107,11 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
106
107
  animated: "true",
107
108
  onChange: l[2] || (l[2] = (a) => b.value = a.detail.index)
108
109
  }, [
109
- (t(!0), s(p, null, g(y.value, (a, B) => {
110
+ (t(!0), o(p, null, g(y.value, (a, $) => {
110
111
  var T;
111
- return t(), s("van-tab", {
112
+ return t(), o("van-tab", {
112
113
  key: a[e.valueKey],
113
- name: B,
114
+ name: $,
114
115
  class: "sun-cascader-tab",
115
116
  title: a[e.labelKey]
116
117
  }, [
@@ -118,11 +119,11 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
118
119
  class: "sun-cascader-list",
119
120
  style: F({ height: e.height })
120
121
  }, [
121
- (t(!0), s(p, null, g(((T = a.parent) == null ? void 0 : T.children) || C.value, (i) => (t(), L(d(q), {
122
+ (t(!0), o(p, null, g(((T = a.parent) == null ? void 0 : T.children) || C.value, (i) => (t(), L(d(z), {
122
123
  key: i[e.valueKey],
123
124
  class: Ke(["sun-cascader-option", { "sun-cascader-option-active": a[e.valueKey] === i[e.valueKey] }]),
124
125
  clickable: !0,
125
- onTap: (Te) => $(i)
126
+ onTap: (Te) => B(i)
126
127
  }, Ne({
127
128
  default: c(() => [
128
129
  I(M(i[e.labelKey]) + " ", 1)
@@ -141,9 +142,9 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
141
142
  } : void 0
142
143
  ]), 1032, ["class", "onTap"]))), 128))
143
144
  ], 4)
144
- ], 8, $e);
145
+ ], 8, Be);
145
146
  }), 128)),
146
- N.value ? k("", !0) : (t(), s("van-tab", {
147
+ N.value ? k("", !0) : (t(), o("van-tab", {
147
148
  key: 0,
148
149
  name: y.value.length,
149
150
  class: "sun-cascader-tab",
@@ -154,11 +155,11 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
154
155
  class: "sun-cascader-list",
155
156
  style: F({ height: e.height })
156
157
  }, [
157
- (t(!0), s(p, null, g(G.value, (a) => (t(), L(d(q), {
158
+ (t(!0), o(p, null, g(G.value, (a) => (t(), L(d(z), {
158
159
  key: a[e.valueKey],
159
160
  class: "sun-cascader-option",
160
161
  clickable: !0,
161
- onTap: (B) => $(a)
162
+ onTap: ($) => B(a)
162
163
  }, {
163
164
  default: c(() => [
164
165
  I(M(a[e.labelKey]), 1)
@@ -166,7 +167,7 @@ const E = X, t = Y, s = Z, k = x, m = ee, ke = le, ge = ae, we = te, d = ne, g =
166
167
  _: 2
167
168
  }, 1032, ["onTap"]))), 128))
168
169
  ], 4)
169
- ], 8, Be))
170
+ ], 8, $e))
170
171
  ], 40, Se)) : k("", !0)
171
172
  ]),
172
173
  _: 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solar-taro/ui-vant",
3
- "version": "2.6.3",
3
+ "version": "2.7.0",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
@@ -23,6 +23,7 @@ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable
23
23
  /** 多选模式下,分割符 */
24
24
  delimiter?: string;
25
25
  searchable?: boolean;
26
+ clearable?: boolean;
26
27
  searcher?: (option: T, keyword: string) => boolean;
27
28
  virtual?: boolean | {
28
29
  itemSize?: number;