@solar-taro/ui-vant 4.5.0 → 4.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
+ ## 4.6.0 (2026-11-23)
2
+
3
+ This was a version bump only for ui-vant to align it with other projects, there were no code changes.
4
+
5
+ ## 4.5.0 (2026-11-17)
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
  ## 4.4.0 (2026-11-12)
2
10
 
3
11
  ### 🩹 Fixes
package/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from './cascader';
2
1
  export * from './cascader-picker';
3
2
  export * from './date-range-picker';
4
3
  export * from './directives';
@@ -6,4 +5,3 @@ export * from './opper-controller';
6
5
  export * from './overlay';
7
6
  export * from './plugin';
8
7
  export * from './select-picker';
9
- export * from './selector';
package/index.js CHANGED
@@ -1,28 +1,24 @@
1
1
  import { SolarVant as o } from "./index2.js";
2
2
  import { default as a } from "./index3.js";
3
3
  import { default as n } from "./index4.js";
4
- import { default as l } from "./index5.js";
5
- import { default as u } from "./index6.js";
6
- import { default as d } from "./index7.js";
7
- import { default as s } from "./index8.js";
8
- import { Notify as c, notify as v, setupOverlay as k } from "./index9.js";
9
- import { vBindFn as P } from "./index10.js";
10
- import { vBinding as g } from "./index11.js";
11
- import { vDatetimePicker as D } from "./index12.js";
12
- import { vReadonly as R } from "./index13.js";
4
+ import { default as m } from "./index5.js";
5
+ import { default as l } from "./index6.js";
6
+ import { Notify as u, notify as d, setupOverlay as c } from "./index7.js";
7
+ import { vBindFn as S } from "./index8.js";
8
+ import { vBinding as k } from "./index9.js";
9
+ import { vDatetimePicker as P } from "./index10.js";
10
+ import { vReadonly as B } from "./index11.js";
13
11
  export {
14
- c as Notify,
12
+ u as Notify,
15
13
  o as SolarVant,
16
- a as SunCascader,
17
- n as SunCascaderPicker,
18
- l as SunDateRangePicker,
19
- u as SunOpperController,
20
- d as SunSelectPicker,
21
- s as SunSelector,
22
- v as notify,
23
- k as setupOverlay,
24
- P as vBindFn,
25
- g as vBinding,
26
- D as vDatetimePicker,
27
- R as vReadonly
14
+ a as SunCascaderPicker,
15
+ n as SunDateRangePicker,
16
+ m as SunOpperController,
17
+ l as SunSelectPicker,
18
+ d as notify,
19
+ c as setupOverlay,
20
+ S as vBindFn,
21
+ k as vBinding,
22
+ P as vDatetimePicker,
23
+ B as vReadonly
28
24
  };
package/index10.js CHANGED
@@ -1,21 +1,31 @@
1
- import { getCurrentInstance as o, nextTick as a } from "@tarojs/taro";
2
- function c(e, t, n, p) {
3
- e.selectComponent("#" + t).setData({ [n]: p });
4
- }
5
- const r = {
6
- mounted(e, t) {
7
- const { page: n } = o();
8
- a(() => {
9
- a(() => {
10
- c(n, e.id, t.arg, t.value);
1
+ import { getCurrentInstance as s, nextTick as n } from "@tarojs/taro";
2
+ const m = {
3
+ mounted(c) {
4
+ const { page: o } = s();
5
+ n(() => {
6
+ n(() => {
7
+ const r = o.selectComponent(`#${c.id}`);
8
+ r.setData({
9
+ formatter: (e, t) => {
10
+ switch (e) {
11
+ case "year":
12
+ return `${t}年`;
13
+ case "month":
14
+ return `${t}月`;
15
+ case "day":
16
+ return `${t}日`;
17
+ case "hour":
18
+ return `${t}时`;
19
+ case "minute":
20
+ return `${t}分`;
21
+ }
22
+ },
23
+ filter: (e, t) => e === "minute" ? t.filter((i) => +i % 5 === 0) : t
24
+ }), r.updateValue();
11
25
  });
12
26
  });
13
- },
14
- updated(e, t) {
15
- const { page: n } = o();
16
- c(n, e.id, t.arg, t.value);
17
27
  }
18
28
  };
19
29
  export {
20
- r as vBindFn
30
+ m as vDatetimePicker
21
31
  };
package/index11.js CHANGED
@@ -1,6 +1,7 @@
1
- const r = (e, t) => {
2
- e.setAttribute(t.arg, t.value);
1
+ const r = (t, o) => {
2
+ var e;
3
+ t.setAttribute("readonly", (e = o.value) != null ? e : !0);
3
4
  };
4
5
  export {
5
- r as vBinding
6
+ r as vReadonly
6
7
  };
package/index12.js CHANGED
@@ -1,31 +1,4 @@
1
- import { getCurrentInstance as s, nextTick as n } from "@tarojs/taro";
2
- const m = {
3
- mounted(c) {
4
- const { page: o } = s();
5
- n(() => {
6
- n(() => {
7
- const r = o.selectComponent(`#${c.id}`);
8
- r.setData({
9
- formatter: (e, t) => {
10
- switch (e) {
11
- case "year":
12
- return `${t}年`;
13
- case "month":
14
- return `${t}月`;
15
- case "day":
16
- return `${t}日`;
17
- case "hour":
18
- return `${t}时`;
19
- case "minute":
20
- return `${t}分`;
21
- }
22
- },
23
- filter: (e, t) => e === "minute" ? t.filter((i) => +i % 5 === 0) : t
24
- }), r.updateValue();
25
- });
26
- });
27
- }
28
- };
1
+ import f from "./index4.js";
29
2
  export {
30
- m as vDatetimePicker
3
+ f as default
31
4
  };
package/index13.js CHANGED
@@ -1,7 +1,4 @@
1
- const r = (t, o) => {
2
- var e;
3
- t.setAttribute("readonly", (e = o.value) != null ? e : !0);
4
- };
1
+ import f from "./index3.js";
5
2
  export {
6
- r as vReadonly
3
+ f as default
7
4
  };
package/index14.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/index2.js CHANGED
@@ -1,4 +1,4 @@
1
- import { vReadonly as r } from "./index13.js";
1
+ import { vReadonly as r } from "./index11.js";
2
2
  const a = {
3
3
  install(o) {
4
4
  o.directive("readonly", r);
package/index3.js CHANGED
@@ -1,274 +1,128 @@
1
- import { defineComponent as ve, inject as Z, useModel as me, ref as U, useId as fe, computed as o, effect as ee, Fragment as pe, mergeModels as le, renderSlot as he, toDisplayString as ke, openBlock as be, createElementBlock as ye, createCommentVNode as we, unref as xe, withModifiers as Se, createBlock as Te, createVNode as Ve, normalizeClass as ge, createElementVNode as Ce, createTextVNode as $e, withCtx as Be, renderList as Ne, createSlots as ze, normalizeStyle as Le } from "vue";
2
- import { tree2list as Ie } from "@solar-kit/core";
3
- import { SUN_ITEM as Me, SUN_FIELD as _e, SunIcon as g, SunLazyRender as Ee, SunModal as qe, SunSearchbar as Ue, SunItem as D, SunListPlaceholder as De, SunButton as Fe } from "@solar-taro/ui-sun";
4
- import { linkedRef as te, untracked as je } from "@solar-vue/core";
5
- import { nextTick as Pe, getCurrentInstance as Re } from "@tarojs/taro";
6
- const Ae = he, y = ke, a = be, r = ye, w = we, n = xe, ae = Se, f = Te, p = Ve, F = ge, j = Ce, C = $e, i = Be, $ = Ne, h = pe, P = ze, R = Le, Ge = {
7
- key: 0,
8
- class: "sun-cascader-inner"
9
- }, He = {
10
- key: 1,
11
- class: "sun-cascader-placeholder"
12
- }, Je = ["id", "active"], Ke = ["name", "title"], Oe = ["name"], el = /* @__PURE__ */ ve({
1
+ import { defineComponent as x, ref as B, computed as d, watch as E, mergeProps as N, createElementVNode as I, unref as L, openBlock as P, createBlock as $, createCommentVNode as q, createElementBlock as D } from "vue";
2
+ import { SunSearchbar as S } from "@solar-taro/ui-sun";
3
+ import { cloneDeep as v } from "lodash-es";
4
+ const A = N, T = I, U = L, K = P, j = $, z = q, F = D, G = ["show"], H = ["title", "value-key", "columns", "loading"], Q = /* @__PURE__ */ x({
5
+ inheritAttrs: !1,
13
6
  __name: "index",
14
- props: /* @__PURE__ */ le({
15
- placeholder: { default: "请选择" },
16
- options: {},
17
- required: { type: Boolean },
18
- disabled: { type: Boolean },
19
- clearable: { type: Boolean, default: !0 },
20
- delimiter: { default: "/" },
21
- height: { default: "50vh" },
22
- searchable: { type: Boolean, default: !0 }
23
- }, {
7
+ props: {
8
+ show: { type: Boolean },
9
+ labelKey: { default: "fullName" },
10
+ valueKey: { default: "id" },
11
+ pidKey: { default: "pid" },
12
+ searchable: { type: Boolean, default: !0 },
13
+ title: {},
14
+ loading: { type: Boolean },
15
+ options: { default: () => [] },
24
16
  modelValue: {},
25
- modelModifiers: {}
26
- }),
27
- emits: /* @__PURE__ */ le(["select", "clear", "close"], ["update:modelValue"]),
28
- setup(c, { expose: ne, emit: se }) {
29
- const k = Z(Me, void 0), B = Z(_e, void 0), N = se, s = c, v = me(c, "modelValue"), b = U(""), A = fe(), G = o(() => v.value && s.clearable && !s.disabled), x = U(!1), H = U(0), oe = o(() => Ie(s.options)), J = o(() => s.options.flatMap((e) => ie(e))), K = o(() => {
30
- if (!b.value) return J.value;
31
- const e = b.value.toLowerCase();
32
- return J.value.filter((l) => l.label.toLowerCase().includes(e));
33
- }), z = o(() => oe.value.find((e) => e.parent && !e.children && e.value === v.value)), re = o(() => {
34
- const e = [];
35
- let l = z.value;
36
- for (; l; )
37
- e.unshift(l), l = l.parent;
38
- return e;
39
- }), S = te(() => z.value), L = o(() => {
40
- const e = [];
41
- let l = S.value;
42
- for (; l; )
43
- e.unshift(l), l = l.parent;
44
- return e;
45
- }), O = o(() => {
46
- const e = S.value;
47
- return e ? !e.children : !1;
48
- }), I = o(() => re.value.map((e) => e.label).join(` ${s.delimiter} `)), M = te(
49
- () => (
50
- // 如果有值,则取 currentNodes 的最后索引,否则为 0
51
- z.value ? je(() => L.value.length - 1) : 0
52
- )
53
- ), Q = o(() => s.options.filter((e) => !e.parent)), ue = o(() => {
54
- const e = S.value;
55
- return e ? e.children : Q.value;
56
- }), W = o(() => ({ height: `calc(${s.height} - 44px)` }));
57
- function T() {
58
- s.disabled || (x.value = !0, H.value++, setTimeout(() => {
59
- Y();
60
- }, 500));
17
+ required: { type: Boolean }
18
+ },
19
+ emits: ["close", "cancel", "confirm", "update:show", "update:modelValue"],
20
+ setup(i, { emit: h }) {
21
+ const s = h, e = i, a = B(""), c = d(() => {
22
+ const n = v(e.options);
23
+ for (let t = 0; t < n.length - 1; t++) {
24
+ const l = n[t];
25
+ for (let o = 0; o < l.length; o++) {
26
+ const u = l[o];
27
+ u.children = n[t + 1].filter((r) => r[e.pidKey] === u[e.valueKey]);
28
+ }
29
+ }
30
+ return n[0];
31
+ }), f = d(() => v(c.value).map((n) => m(n)).flat()), g = d(() => {
32
+ const n = e.options[e.options.length - 1].find((t) => t[e.valueKey] === e.modelValue);
33
+ return n ? b(n) : y();
34
+ });
35
+ function V() {
36
+ e.required || s("update:modelValue", null), s("cancel", e.modelValue), p();
37
+ }
38
+ function p() {
39
+ s("update:show", !1), s("close");
40
+ }
41
+ function C({ detail: n }) {
42
+ const t = n.value[n.value.length - 1];
43
+ s("update:modelValue", t[e.valueKey]), s("confirm", w(t)), s("update:show", !1);
44
+ }
45
+ function k({ detail: n }) {
46
+ const { picker: t, value: l, index: o } = n;
47
+ !a.value && o < e.options.length - 1 && t.setColumnValues(
48
+ o + 1,
49
+ e.options[o + 1].filter((u) => u[e.pidKey] === l[o][e.valueKey])
50
+ );
61
51
  }
62
- function X() {
63
- x.value = !1, N("close");
52
+ function w(n) {
53
+ const t = [e.options[e.options.length - 1].find((l) => l[e.valueKey] === n[e.valueKey] && l[e.pidKey] === n[e.pidKey])];
54
+ for (let l = e.options.length - 2; l >= 0; l--)
55
+ t.unshift(
56
+ e.options[l].find((o) => {
57
+ var u;
58
+ return o[e.valueKey] === ((u = t[0]) == null ? void 0 : u[e.pidKey]);
59
+ })
60
+ );
61
+ return t;
64
62
  }
65
- function _() {
66
- N("clear", v.value), v.value = null;
63
+ function m(n, t = "") {
64
+ var u;
65
+ let l = [], o = t + n[e.labelKey];
66
+ return (u = n.children) != null && u.length ? n.children.forEach((r) => {
67
+ l = l.concat(m(r, o + " / "));
68
+ }) : (n[e.labelKey] = o, l.push(n)), l;
67
69
  }
68
- function E(e) {
69
- S.value = e, N("select", e), O.value ? (v.value = e.value, setTimeout(X, 100)) : M.value++, Pe(Y);
70
+ function y() {
71
+ var l;
72
+ if (a.value)
73
+ return [{
74
+ values: f.value.filter((o) => o[e.labelKey].toLowerCase().includes(a.value))
75
+ }];
76
+ const n = [];
77
+ let t = c.value;
78
+ for (; t; )
79
+ n.push({ values: t }), t = (l = t[0]) == null ? void 0 : l.children;
80
+ return n;
70
81
  }
71
- function ie(e, l = "") {
82
+ function b(n) {
83
+ if (a.value) {
84
+ const l = f.value.filter((o) => o[e.labelKey].toLowerCase().includes(a.value));
85
+ return [{
86
+ values: l,
87
+ defaultIndex: l.findIndex((o) => o[e.valueKey] === n[e.valueKey])
88
+ }];
89
+ }
72
90
  const t = [];
73
- function u(d, m) {
74
- var q;
75
- const V = m + d.label;
76
- if ((q = d.children) != null && q.length) {
77
- const ce = `${V} ${s.delimiter} `;
78
- for (const de of d.children)
79
- u(de, ce);
80
- return;
81
- }
82
- t.push({ ...d, label: V });
91
+ for (let l = e.options.length - 1; l >= 0; l--) {
92
+ const o = e.options[l].filter((u) => u[e.pidKey] === n[e.pidKey]);
93
+ t[l] = {
94
+ values: o,
95
+ defaultIndex: o.findIndex((u) => u[e.valueKey] === n[e.valueKey])
96
+ }, l > 0 && (n = e.options[l - 1].find((u) => u[e.valueKey] === n[e.pidKey]));
83
97
  }
84
- return u(e, l), t;
98
+ return t;
85
99
  }
86
- function Y() {
87
- var l, t, u;
88
- const { page: e } = Re();
89
- (u = (t = (l = e == null ? void 0 : e.selectComponent) == null ? void 0 : l.call(e, `#${A}`)) == null ? void 0 : t.resize) == null || u.call(t);
90
- }
91
- return ne({
92
- present: T,
93
- clear: _
94
- }), ee(() => {
95
- B && (B.required.value = s.required, B.disabled.value = s.disabled);
96
- }), ee(() => {
97
- k && (k.clickable.value = !s.disabled);
98
- }), k == null || k.onTap(T), (e, l) => (a(), r(h, null, [
99
- Ae(e.$slots, "default", {
100
- present: T,
101
- label: I.value
102
- }, () => [
103
- j("view", {
104
- class: F(["sun-cascader", {
105
- "sun-cascader-required": c.required,
106
- "sun-cascader-disabled": c.disabled
107
- }]),
108
- onTap: l[1] || (l[1] = (t) => T())
109
- }, [
110
- I.value ? (a(), r("view", Ge, y(I.value), 1)) : (a(), r("view", He, y(c.placeholder), 1)),
111
- G.value ? (a(), f(n(g), {
112
- key: 2,
113
- class: "sun-cascader-clear-icon",
114
- name: "close-circle",
115
- onTap: l[0] || (l[0] = ae((t) => _(), ["stop"]))
116
- })) : w("", !0),
117
- p(n(g), {
118
- class: "sun-cascader-icon",
119
- name: "chevron-expand-outline"
120
- })
121
- ], 34)
122
- ]),
123
- p(n(Ee), { hook: "created" }, {
124
- default: i(() => [
125
- p(n(qe), {
126
- show: x.value,
127
- "onUpdate:show": l[5] || (l[5] = (t) => x.value = t),
128
- class: "sun-cascader-modal",
129
- title: c.placeholder,
130
- "with-actions": !1,
131
- onClose: l[6] || (l[6] = (t) => X()),
132
- onTap: l[7] || (l[7] = ae(() => {
133
- }, ["stop"]))
134
- }, P({
135
- default: i(() => [
136
- c.searchable ? (a(), f(n(Ue), {
137
- key: 0,
138
- modelValue: b.value,
139
- "onUpdate:modelValue": l[3] || (l[3] = (t) => b.value = t),
140
- placeholder: "输入关键字搜索"
141
- }, null, 8, ["modelValue"])) : w("", !0),
142
- b.value ? (a(), r("view", {
143
- key: 1,
144
- class: "sun-cascader-options",
145
- style: R({ height: c.height })
146
- }, [
147
- (a(!0), r(h, null, $(K.value, (t, u) => (a(), f(n(D), {
148
- key: u,
149
- class: F(["sun-cascader-option", { "sun-cascader-option-active": t.value === v.value }]),
150
- clickable: !0,
151
- onTap: (d) => E(t)
152
- }, P({
153
- default: i(() => [
154
- C(y(t.label) + " ", 1)
155
- ]),
156
- _: 2
157
- }, [
158
- t.value === v.value ? {
159
- name: "end",
160
- fn: i(() => [
161
- p(n(g), {
162
- class: "sun-cascader-option-icon",
163
- name: "checkmark"
164
- })
165
- ]),
166
- key: "0"
167
- } : void 0
168
- ]), 1032, ["class", "onTap"]))), 128)),
169
- K.value.length ? w("", !0) : (a(), f(n(De), { key: 0 }))
170
- ], 4)) : (a(), r(h, { key: 2 }, [
171
- H.value ? (a(), r("van-tabs", {
172
- key: 0,
173
- id: n(A),
174
- class: "sun-cascader-tabs",
175
- active: n(M),
176
- "line-width": "30px",
177
- "line-height": "4px",
178
- animated: "true",
179
- onChange: l[4] || (l[4] = (t) => M.value = t.detail.index)
180
- }, [
181
- (a(!0), r(h, null, $(L.value, (t, u) => {
182
- var d;
183
- return a(), r("van-tab", {
184
- key: t.value,
185
- name: u,
186
- class: "sun-cascader-tab",
187
- title: t.label
188
- }, [
189
- j("view", {
190
- class: "sun-cascader-options",
191
- style: R(W.value)
192
- }, [
193
- (a(!0), r(h, null, $(((d = t.parent) == null ? void 0 : d.children) || Q.value, (m, V) => (a(), f(n(D), {
194
- key: V,
195
- class: F(["sun-cascader-option", { "sun-cascader-option-active": t.value === m.value }]),
196
- clickable: !0,
197
- onTap: (q) => E(m)
198
- }, P({
199
- default: i(() => [
200
- C(y(m.label) + " ", 1)
201
- ]),
202
- _: 2
203
- }, [
204
- t.value === m.value ? {
205
- name: "end",
206
- fn: i(() => [
207
- p(n(g), {
208
- class: "sun-cascader-option-icon",
209
- name: "checkmark"
210
- })
211
- ]),
212
- key: "0"
213
- } : void 0
214
- ]), 1032, ["class", "onTap"]))), 128))
215
- ], 4)
216
- ], 8, Ke);
217
- }), 128)),
218
- O.value ? w("", !0) : (a(), r("van-tab", {
219
- key: 0,
220
- name: L.value.length,
221
- class: "sun-cascader-tab",
222
- title: "请选择",
223
- "title-style": "color:var(--color-medium-tint);font-weight:normal;font-size:14px"
224
- }, [
225
- j("view", {
226
- class: "sun-cascader-list",
227
- style: R(W.value)
228
- }, [
229
- (a(!0), r(h, null, $(ue.value, (t) => (a(), f(n(D), {
230
- key: t.value,
231
- class: "sun-cascader-option",
232
- clickable: !0,
233
- onTap: (u) => E(t)
234
- }, {
235
- default: i(() => [
236
- C(y(t.label), 1)
237
- ]),
238
- _: 2
239
- }, 1032, ["onTap"]))), 128))
240
- ], 4)
241
- ], 8, Oe))
242
- ], 40, Je)) : w("", !0)
243
- ], 64))
244
- ]),
245
- _: 2
246
- }, [
247
- G.value ? {
248
- name: "extra",
249
- fn: i(() => [
250
- p(n(Fe), {
251
- size: "xsmall",
252
- fill: "clear",
253
- color: "medium",
254
- shape: "round",
255
- onTap: l[2] || (l[2] = (t) => _())
256
- }, {
257
- default: i(() => [...l[8] || (l[8] = [
258
- C("清除", -1)
259
- ])]),
260
- _: 1
261
- })
262
- ]),
263
- key: "0"
264
- } : void 0
265
- ]), 1032, ["show", "title"])
266
- ]),
267
- _: 1
268
- })
269
- ], 64));
100
+ return E(a, y), (n, t) => (K(), F("van-popup", {
101
+ show: i.show,
102
+ position: "bottom",
103
+ round: !0,
104
+ "close-on-click-overlay": !0,
105
+ onClose: t[4] || (t[4] = (l) => p())
106
+ }, [
107
+ T("van-picker", A(n.$attrs, {
108
+ title: i.title,
109
+ "show-toolbar": !0,
110
+ "value-key": i.labelKey,
111
+ columns: g.value,
112
+ loading: i.loading,
113
+ onCancel: t[0] || (t[0] = (l) => V()),
114
+ onConfirm: t[1] || (t[1] = (l) => C(l)),
115
+ onChange: t[2] || (t[2] = (l) => k(l))
116
+ }), null, 16, H),
117
+ i.searchable && i.options.length ? (K(), j(U(S), {
118
+ key: 0,
119
+ modelValue: a.value,
120
+ "onUpdate:modelValue": t[3] || (t[3] = (l) => a.value = l),
121
+ placeholder: "输入关键字搜索"
122
+ }, null, 8, ["modelValue"])) : z("", !0)
123
+ ], 40, G));
270
124
  }
271
125
  });
272
126
  export {
273
- el as default
127
+ Q as default
274
128
  };