@solar-taro/ui-vant 4.3.9 → 4.4.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 +14 -0
- package/cascader-picker/index.vue.d.ts +2 -2
- package/index14.js +1 -1
- package/index15.js +1 -1
- package/index16.js +1 -1
- package/index17.js +1 -1
- package/index18.js +1 -1
- package/index19.js +1 -1
- package/index8.js +48 -50
- package/package.json +1 -1
- package/select-picker/index.vue.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 4.3.10 (2026-11-07)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **ui-vant/selector:** update filter slot to pass keyword context
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- HyperLife1119
|
|
10
|
+
|
|
11
|
+
## 4.3.9 (2026-10-26)
|
|
12
|
+
|
|
13
|
+
This was a version bump only for ui-vant to align it with other projects, there were no code changes.
|
|
14
|
+
|
|
1
15
|
## 4.3.8 (2026-10-25)
|
|
2
16
|
|
|
3
17
|
This was a version bump only for ui-vant to align it with other projects, there were no code changes.
|
|
@@ -15,14 +15,14 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
15
15
|
"update:modelValue": (args_0: any) => any;
|
|
16
16
|
cancel: (args_0: any) => any;
|
|
17
17
|
close: () => any;
|
|
18
|
-
confirm: (args_0: any) => any;
|
|
19
18
|
"update:show": (args_0: boolean) => any;
|
|
19
|
+
confirm: (args_0: any) => any;
|
|
20
20
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
21
|
"onUpdate:modelValue"?: ((args_0: any) => any) | undefined;
|
|
22
22
|
onCancel?: ((args_0: any) => any) | undefined;
|
|
23
23
|
onClose?: (() => any) | undefined;
|
|
24
|
-
onConfirm?: ((args_0: any) => any) | undefined;
|
|
25
24
|
"onUpdate:show"?: ((args_0: boolean) => any) | undefined;
|
|
25
|
+
onConfirm?: ((args_0: any) => any) | undefined;
|
|
26
26
|
}>, {
|
|
27
27
|
options: any[][];
|
|
28
28
|
searchable: boolean;
|
package/index14.js
CHANGED
package/index15.js
CHANGED
package/index16.js
CHANGED
package/index17.js
CHANGED
package/index18.js
CHANGED
package/index19.js
CHANGED
package/index8.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { SUN_ITEM as
|
|
3
|
-
import { defaultRangeExtractor as
|
|
4
|
-
import { createReusableTemplate as
|
|
1
|
+
import { defineComponent as fe, inject as Q, useModel as X, ref as Y, computed as f, effect as Z, Fragment as pe, mergeModels as I, openBlock as ye, createElementBlock as he, renderSlot as ke, createElementVNode as me, normalizeClass as ge, createTextVNode as Se, toDisplayString as be, renderList as xe, createBlock as we, unref as Ve, withCtx as Te, withModifiers as $e, createCommentVNode as Be, createVNode as Le, createSlots as ze, normalizeStyle as Me } from "vue";
|
|
2
|
+
import { SUN_ITEM as Ne, SUN_FIELD as Ce, SunTag as Ee, SunIcon as M, SunLazyRender as qe, SunModal as We, SunSearchbar as Re, SunVirtualList as De, SunListPlaceholder as Fe, SunItemDivider as _, SunItem as ee, SunList as Ue, SunButton as le } from "@solar-taro/ui-sun";
|
|
3
|
+
import { defaultRangeExtractor as Ge } from "./index20.js";
|
|
4
|
+
import { createReusableTemplate as je } from "./index21.js";
|
|
5
5
|
import { isNil as te } from "lodash-es";
|
|
6
|
-
const y =
|
|
6
|
+
const y = ke, g = be, b = Se, S = pe, o = ye, p = he, h = Be, D = xe, a = Ve, u = Te, v = we, Ae = $e, x = Le, F = ge, N = me, C = Me, Pe = ze, He = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "sun-selector-inner"
|
|
9
9
|
}, Je = {
|
|
@@ -12,7 +12,7 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
12
12
|
}, Ke = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "sun-selector-placeholder"
|
|
15
|
-
}, Oe = { class: "sun-selector-option-label" }, Qe = { class: "sun-selector-option-label" }, el = /* @__PURE__ */
|
|
15
|
+
}, Oe = { class: "sun-selector-option-label" }, Qe = { class: "sun-selector-option-label" }, el = /* @__PURE__ */ fe({
|
|
16
16
|
__name: "index",
|
|
17
17
|
props: /* @__PURE__ */ I({
|
|
18
18
|
mode: { default: "single" },
|
|
@@ -38,16 +38,16 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
38
38
|
keywordModifiers: {}
|
|
39
39
|
}),
|
|
40
40
|
emits: /* @__PURE__ */ I(["select", "unselect", "clear", "close", "confirm", "refresh"], ["update:modelValue", "update:keyword"]),
|
|
41
|
-
setup(s, { expose: E, emit:
|
|
42
|
-
const [
|
|
41
|
+
setup(s, { expose: E, emit: ne }) {
|
|
42
|
+
const [oe, U] = je(), w = Q(Ne, void 0), q = Q(Ce, void 0), r = s, k = ne, d = X(s, "modelValue"), $ = Y(!1), ae = f(() => {
|
|
43
43
|
const e = r.optionSize;
|
|
44
44
|
return typeof e == "function" ? e : () => e;
|
|
45
|
-
}), B = f(() => r.options.flatMap((e) =>
|
|
45
|
+
}), B = f(() => r.options.flatMap((e) => ce(e) ? e.options.map((t) => ({
|
|
46
46
|
...t,
|
|
47
47
|
parent: e
|
|
48
48
|
})) : e)), L = X(s, "keyword"), G = f(() => B.value.filter((e) => {
|
|
49
49
|
const t = L.value.toLowerCase();
|
|
50
|
-
return
|
|
50
|
+
return re.value(e, t);
|
|
51
51
|
})), V = f(() => {
|
|
52
52
|
var e;
|
|
53
53
|
if (m.value) {
|
|
@@ -67,8 +67,8 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
67
67
|
});
|
|
68
68
|
}), j = f(
|
|
69
69
|
() => i.value.reduce((e, t, l) => (t.kind === "optionGroup" && e.push(l), e), [])
|
|
70
|
-
),
|
|
71
|
-
function
|
|
70
|
+
), se = f(() => [...j.value].reverse()), A = Y(0), re = f(() => r.filter || ((e, t) => e.label.toLowerCase().includes(t))), P = f(() => V.value.map((e) => e.label).join(r.delimiter)), H = f(() => !ue(d.value) && r.clearable && !r.disabled), m = f(() => r.mode === "single");
|
|
71
|
+
function ue(e) {
|
|
72
72
|
return te(e) ? !0 : m.value ? !1 : e.length < 1;
|
|
73
73
|
}
|
|
74
74
|
function c(e) {
|
|
@@ -80,7 +80,7 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
80
80
|
r.disabled || ($.value = !0);
|
|
81
81
|
}
|
|
82
82
|
function J() {
|
|
83
|
-
$.value = !1,
|
|
83
|
+
$.value = !1, k("close");
|
|
84
84
|
}
|
|
85
85
|
function K() {
|
|
86
86
|
var t;
|
|
@@ -89,21 +89,21 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
89
89
|
(n) => r.compareWith(n.value, l)
|
|
90
90
|
)
|
|
91
91
|
)) || [];
|
|
92
|
-
|
|
92
|
+
k("confirm", e), J();
|
|
93
93
|
}
|
|
94
94
|
function O(e) {
|
|
95
95
|
const t = e.value;
|
|
96
|
-
m.value ? (c(e) ? r.required || (
|
|
96
|
+
m.value ? (c(e) ? r.required || (k("unselect", e), d.value = null) : (k("select", e), d.value = t), setTimeout(J, 100)) : c(e) ? (k("unselect", e), d.value = d.value.filter(
|
|
97
97
|
(l) => !r.compareWith(l, t)
|
|
98
|
-
)) : (
|
|
98
|
+
)) : (k("select", e), d.value = (d.value || []).concat(
|
|
99
99
|
e.value
|
|
100
100
|
));
|
|
101
101
|
}
|
|
102
102
|
function W() {
|
|
103
|
-
|
|
103
|
+
k("clear", d.value), d.value = r.required && !m.value ? [] : null;
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
function
|
|
105
|
+
const ie = (e) => A.value === e, de = (e) => j.value.includes(e);
|
|
106
|
+
function ce(e) {
|
|
107
107
|
return "options" in e;
|
|
108
108
|
}
|
|
109
109
|
return E({
|
|
@@ -131,7 +131,7 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
131
131
|
m.value ? (o(), p(S, { key: 0 }, [
|
|
132
132
|
b(g(P.value), 1)
|
|
133
133
|
], 64)) : (o(), p("view", Je, [
|
|
134
|
-
(o(!0), p(S, null, D(V.value, (l) => (o(), v(a(
|
|
134
|
+
(o(!0), p(S, null, D(V.value, (l) => (o(), v(a(Ee), {
|
|
135
135
|
color: "medium",
|
|
136
136
|
type: "translucent"
|
|
137
137
|
}, {
|
|
@@ -146,32 +146,30 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
146
146
|
key: 2,
|
|
147
147
|
class: "sun-selector-clear-icon",
|
|
148
148
|
name: "close-circle",
|
|
149
|
-
onTap: t[0] || (t[0] =
|
|
150
|
-
})) :
|
|
149
|
+
onTap: t[0] || (t[0] = Ae((l) => W(), ["stop"]))
|
|
150
|
+
})) : h("", !0),
|
|
151
151
|
x(a(M), {
|
|
152
152
|
class: "sun-selector-icon",
|
|
153
153
|
name: "chevron-expand-outline"
|
|
154
154
|
})
|
|
155
155
|
], 34)
|
|
156
156
|
]),
|
|
157
|
-
x(a(
|
|
157
|
+
x(a(qe), { hook: "created" }, {
|
|
158
158
|
default: u(() => [
|
|
159
|
-
x(a(
|
|
159
|
+
x(a(We), {
|
|
160
160
|
show: $.value,
|
|
161
161
|
"onUpdate:show": t[7] || (t[7] = (l) => $.value = l),
|
|
162
162
|
title: s.placeholder,
|
|
163
|
-
"with-actions": !m.value
|
|
164
|
-
onTap: t[8] || (t[8] = ne(() => {
|
|
165
|
-
}, ["stop"]))
|
|
163
|
+
"with-actions": !m.value
|
|
166
164
|
}, Pe({
|
|
167
165
|
actions: u(() => [
|
|
168
166
|
y(e.$slots, "actions", { confirm: K }, () => [
|
|
169
|
-
m.value ?
|
|
167
|
+
m.value ? h("", !0) : (o(), v(a(le), {
|
|
170
168
|
key: 0,
|
|
171
169
|
expand: "block",
|
|
172
170
|
onTap: t[6] || (t[6] = (l) => K())
|
|
173
171
|
}, {
|
|
174
|
-
default: u(() => [...t[
|
|
172
|
+
default: u(() => [...t[9] || (t[9] = [
|
|
175
173
|
b("确定", -1)
|
|
176
174
|
])]),
|
|
177
175
|
_: 1
|
|
@@ -180,34 +178,34 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
180
178
|
]),
|
|
181
179
|
default: u(() => [
|
|
182
180
|
y(e.$slots, "filter", {}, () => [
|
|
183
|
-
s.searchable ? (o(), v(a(
|
|
181
|
+
s.searchable ? (o(), v(a(Re), {
|
|
184
182
|
key: 0,
|
|
185
183
|
modelValue: L.value,
|
|
186
184
|
"onUpdate:modelValue": t[3] || (t[3] = (l) => L.value = l),
|
|
187
185
|
placeholder: "输入关键字搜索"
|
|
188
|
-
}, null, 8, ["modelValue"])) :
|
|
186
|
+
}, null, 8, ["modelValue"])) : h("", !0)
|
|
189
187
|
]),
|
|
190
|
-
x(a(
|
|
188
|
+
x(a(oe), null, {
|
|
191
189
|
default: u(() => [
|
|
192
|
-
s.virtual ? (o(), v(a(
|
|
190
|
+
s.virtual ? (o(), v(a(De), {
|
|
193
191
|
key: 0,
|
|
194
192
|
class: "sun-selector-options",
|
|
195
193
|
options: {
|
|
196
194
|
estimateSize: (l) => {
|
|
197
195
|
const n = i.value[l];
|
|
198
|
-
return n.kind === "optionGroup" ? 28 :
|
|
196
|
+
return n.kind === "optionGroup" ? 28 : ae.value(n.value);
|
|
199
197
|
},
|
|
200
198
|
overscan: 3,
|
|
201
199
|
count: i.value.length,
|
|
202
200
|
rangeExtractor: (l) => {
|
|
203
|
-
const n = new Set(a(
|
|
204
|
-
return T !== void 0 && (n.add(T), A.value = T), [...n].sort((R,
|
|
201
|
+
const n = new Set(a(Ge)(l)), T = se.value.find((R) => l.startIndex >= R);
|
|
202
|
+
return T !== void 0 && (n.add(T), A.value = T), [...n].sort((R, ve) => R - ve);
|
|
205
203
|
}
|
|
206
204
|
},
|
|
207
205
|
refresher: s.refresher,
|
|
208
206
|
refreshing: s.refreshing,
|
|
209
207
|
style: C({ height: s.height }),
|
|
210
|
-
onRefresh: t[4] || (t[4] = (l) =>
|
|
208
|
+
onRefresh: t[4] || (t[4] = (l) => k("refresh"))
|
|
211
209
|
}, {
|
|
212
210
|
default: u(({ virtualItems: l }) => [
|
|
213
211
|
(o(!0), p(S, null, D(l, (n) => (o(), p(S, {
|
|
@@ -217,9 +215,9 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
217
215
|
key: 0,
|
|
218
216
|
class: "sun-selector-option-divider",
|
|
219
217
|
style: C({
|
|
220
|
-
zIndex:
|
|
218
|
+
zIndex: de(n.index) ? 1 : 0,
|
|
221
219
|
...n.style,
|
|
222
|
-
...
|
|
220
|
+
...ie(n.index) ? {
|
|
223
221
|
position: "sticky",
|
|
224
222
|
transform: "unset"
|
|
225
223
|
} : {
|
|
@@ -231,7 +229,7 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
231
229
|
b(g(i.value[n.index].value.label), 1)
|
|
232
230
|
]),
|
|
233
231
|
_: 2
|
|
234
|
-
}, 1032, ["style"])) :
|
|
232
|
+
}, 1032, ["style"])) : h("", !0),
|
|
235
233
|
i.value[n.index].kind === "option" ? (o(), v(a(ee), {
|
|
236
234
|
key: 1,
|
|
237
235
|
class: F(["sun-selector-option", { "sun-selector-option-active": c(i.value[n.index].value) }]),
|
|
@@ -256,7 +254,7 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
256
254
|
key: 0,
|
|
257
255
|
class: "sun-selector-option-icon",
|
|
258
256
|
name: "checkmark"
|
|
259
|
-
})) :
|
|
257
|
+
})) : h("", !0)
|
|
260
258
|
]),
|
|
261
259
|
default: u(() => [
|
|
262
260
|
y(e.$slots, "option", {
|
|
@@ -268,14 +266,14 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
268
266
|
])
|
|
269
267
|
]),
|
|
270
268
|
_: 2
|
|
271
|
-
}, 1032, ["class", "style", "onTap"])) :
|
|
269
|
+
}, 1032, ["class", "style", "onTap"])) : h("", !0)
|
|
272
270
|
], 64))), 128))
|
|
273
271
|
]),
|
|
274
272
|
placeholder: u(() => [
|
|
275
|
-
x(a(
|
|
273
|
+
x(a(Fe), { loading: s.loading }, null, 8, ["loading"])
|
|
276
274
|
]),
|
|
277
275
|
_: 3
|
|
278
|
-
}, 8, ["options", "refresher", "refreshing", "style"])) : (o(), v(a(
|
|
276
|
+
}, 8, ["options", "refresher", "refreshing", "style"])) : (o(), v(a(Ue), {
|
|
279
277
|
key: 1,
|
|
280
278
|
class: "sun-selector-options",
|
|
281
279
|
refresher: s.refresher,
|
|
@@ -283,7 +281,7 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
283
281
|
data: G.value,
|
|
284
282
|
loading: s.loading,
|
|
285
283
|
style: C({ height: s.height }),
|
|
286
|
-
onRefresh: t[5] || (t[5] = (l) =>
|
|
284
|
+
onRefresh: t[5] || (t[5] = (l) => k("refresh"))
|
|
287
285
|
}, {
|
|
288
286
|
default: u(() => [
|
|
289
287
|
N("view", null, [
|
|
@@ -296,7 +294,7 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
296
294
|
b(g(l.value.label), 1)
|
|
297
295
|
]),
|
|
298
296
|
_: 2
|
|
299
|
-
}, 1024)) :
|
|
297
|
+
}, 1024)) : h("", !0),
|
|
300
298
|
l.kind === "option" ? (o(), v(a(ee), {
|
|
301
299
|
key: 1,
|
|
302
300
|
class: F(["sun-selector-option", { "sun-selector-option-active": c(l.value) }]),
|
|
@@ -320,7 +318,7 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
320
318
|
key: 0,
|
|
321
319
|
class: "sun-selector-option-icon",
|
|
322
320
|
name: "checkmark"
|
|
323
|
-
})) :
|
|
321
|
+
})) : h("", !0)
|
|
324
322
|
]),
|
|
325
323
|
default: u(() => [
|
|
326
324
|
y(e.$slots, "option", {
|
|
@@ -332,7 +330,7 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
332
330
|
])
|
|
333
331
|
]),
|
|
334
332
|
_: 2
|
|
335
|
-
}, 1032, ["class", "onTap"])) :
|
|
333
|
+
}, 1032, ["class", "onTap"])) : h("", !0)
|
|
336
334
|
], 64))), 128))
|
|
337
335
|
])
|
|
338
336
|
]),
|
|
@@ -358,8 +356,8 @@ const y = me, g = xe, b = be, S = ye, o = ke, p = he, k = Le, D = we, a = Te, u
|
|
|
358
356
|
onTap: t[2] || (t[2] = (l) => W())
|
|
359
357
|
}, {
|
|
360
358
|
default: u(() => [
|
|
361
|
-
t[
|
|
362
|
-
m.value ?
|
|
359
|
+
t[8] || (t[8] = b(" 清除 ", -1)),
|
|
360
|
+
m.value ? h("", !0) : (o(), p(S, { key: 0 }, [
|
|
363
361
|
b("(" + g(V.value.length) + ")", 1)
|
|
364
362
|
], 64))
|
|
365
363
|
]),
|
package/package.json
CHANGED
|
@@ -16,14 +16,14 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
16
16
|
"update:modelValue": (model: any) => any;
|
|
17
17
|
cancel: (model: any) => any;
|
|
18
18
|
close: () => any;
|
|
19
|
-
confirm: (options: any) => any;
|
|
20
19
|
"update:show": (args_0: boolean) => any;
|
|
20
|
+
confirm: (options: any) => any;
|
|
21
21
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
22
|
"onUpdate:modelValue"?: ((model: any) => any) | undefined;
|
|
23
23
|
onCancel?: ((model: any) => any) | undefined;
|
|
24
24
|
onClose?: (() => any) | undefined;
|
|
25
|
-
onConfirm?: ((options: any) => any) | undefined;
|
|
26
25
|
"onUpdate:show"?: ((args_0: boolean) => any) | undefined;
|
|
26
|
+
onConfirm?: ((options: any) => any) | undefined;
|
|
27
27
|
}>, {
|
|
28
28
|
searchable: boolean;
|
|
29
29
|
labelKey: string;
|