@solar-taro/ui-vant 2.5.1 → 2.5.2

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,15 @@
1
+ ## 2.5.1 (2026-01-12)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **ui-vant/selector:** add clearable option and update clear logic
6
+ - **ui-vant/modal:** add extra slot
7
+ - **ui-vant:** add vBinding directive
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - HyperLife1119
12
+
1
13
  ## 2.5.0 (2025-12-25)
2
14
 
3
15
  This was a version bump only for ui-vant to align it with other projects, there were no code changes.
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 "./index6.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 "./index5.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 "./index9.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 "./index7.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 "./index8.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index22.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index8.js";
1
+ import f from "./index3.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index23.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index9.js";
1
+ import f from "./index10.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index26.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import S from "./index60.js";
2
- import L from "./index58.js";
2
+ import L from "./index57.js";
3
3
  import B from "./index55.js";
4
4
  import I from "./index61.js";
5
5
  import O from "./index62.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/index50.js CHANGED
@@ -1,4 +1,4 @@
1
- import a from "./index57.js";
1
+ import a from "./index59.js";
2
2
  import e from "./index80.js";
3
3
  var s = Object.prototype, n = s.hasOwnProperty;
4
4
  function f(r) {
package/index52.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import a from "./index39.js";
2
- import i from "./index57.js";
2
+ import i from "./index59.js";
3
3
  import n from "./index93.js";
4
4
  var e = Object.prototype, p = e.hasOwnProperty;
5
5
  function v(r) {
package/index56.js CHANGED
@@ -1,4 +1,4 @@
1
- import u from "./index59.js";
1
+ import u from "./index58.js";
2
2
  function i(r, e, t) {
3
3
  e == "__proto__" && u ? u(r, e, {
4
4
  configurable: !0,
package/index57.js CHANGED
@@ -1,8 +1,8 @@
1
- var p = Object.prototype;
2
- function e(t) {
3
- var o = t && t.constructor, r = typeof o == "function" && o.prototype || p;
4
- return t === r;
1
+ function f(e, n) {
2
+ for (var l = -1, t = e == null ? 0 : e.length; ++l < t && n(e[l], l, e) !== !1; )
3
+ ;
4
+ return e;
5
5
  }
6
6
  export {
7
- e as default
7
+ f as default
8
8
  };
package/index58.js CHANGED
@@ -1,8 +1,11 @@
1
- function f(e, n) {
2
- for (var l = -1, t = e == null ? 0 : e.length; ++l < t && n(e[l], l, e) !== !1; )
3
- ;
4
- return e;
5
- }
1
+ import r from "./index102.js";
2
+ var o = function() {
3
+ try {
4
+ var e = r(Object, "defineProperty");
5
+ return e({}, "", {}), e;
6
+ } catch {
7
+ }
8
+ }();
6
9
  export {
7
- f as default
10
+ o as default
8
11
  };
package/index59.js CHANGED
@@ -1,11 +1,8 @@
1
- import r from "./index102.js";
2
- var o = function() {
3
- try {
4
- var e = r(Object, "defineProperty");
5
- return e({}, "", {}), e;
6
- } catch {
7
- }
8
- }();
1
+ var p = Object.prototype;
2
+ function e(t) {
3
+ var o = t && t.constructor, r = typeof o == "function" && o.prototype || p;
4
+ return t === r;
5
+ }
9
6
  export {
10
- o as default
7
+ e as default
11
8
  };
package/index72.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import o from "./index74.js";
2
2
  import r from "./index89.js";
3
- import e from "./index57.js";
3
+ import e from "./index59.js";
4
4
  function p(t) {
5
5
  return typeof t.constructor == "function" && !e(t) ? o(r(t)) : {};
6
6
  }
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.2",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",