@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 +22 -0
- package/index10.js +71 -70
- package/index116.js +5 -5
- package/index117.js +1 -1
- package/index125.js +3 -3
- package/index126.js +4 -4
- package/index127.js +10 -4
- package/index128.js +6 -10
- package/index129.js +6 -6
- package/index130.js +4 -6
- package/index16.js +1 -1
- package/index17.js +1 -1
- package/index18.js +1 -1
- package/index19.js +1 -1
- package/index20.js +1 -1
- package/index21.js +1 -1
- package/index26.js +1 -1
- package/index3.js +61 -59
- package/index54.js +7 -11
- package/index55.js +9 -7
- package/index56.js +11 -9
- package/index61.js +1 -1
- package/index62.js +1 -1
- package/index65.js +1 -1
- package/index66.js +1 -1
- package/package.json +1 -1
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
|
|
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
|
|
6
|
-
import
|
|
7
|
-
const d = Q, a = X, i = Y,
|
|
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
|
-
},
|
|
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: ($,
|
|
35
|
+
compareWith: { type: Function, default: ($, w) => $ === w }
|
|
36
36
|
},
|
|
37
37
|
emits: ["update:modelValue", "select", "unselect", "clear", "close", "confirm", "refresh"],
|
|
38
|
-
setup($, { expose:
|
|
39
|
-
const o = $, u = j,
|
|
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 (
|
|
41
|
+
if (c.value) {
|
|
42
42
|
const l = B(o.modelValue) ? null : o.options.find(
|
|
43
|
-
(
|
|
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
|
|
50
|
-
return ((
|
|
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),
|
|
54
|
-
var
|
|
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" && (
|
|
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 :
|
|
59
|
+
return B(e) ? !0 : c.value ? !1 : e.length < 1;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
var
|
|
61
|
+
function r(e) {
|
|
62
|
+
var s;
|
|
63
63
|
const l = e[o.valueKey];
|
|
64
|
-
return
|
|
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 || (
|
|
68
|
-
|
|
67
|
+
o.disabled || (h.value = !0, y.value || setTimeout(() => {
|
|
68
|
+
y.value = !0;
|
|
69
69
|
}, 300));
|
|
70
70
|
}
|
|
71
71
|
function D() {
|
|
72
|
-
|
|
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
|
-
(
|
|
78
|
-
(t) => o.compareWith(t[o.valueKey],
|
|
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
|
|
86
|
-
|
|
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),
|
|
88
|
+
)) : (u("select", e), s = (o.modelValue || []).concat(
|
|
89
89
|
e[o.valueKey]
|
|
90
|
-
)), u("update:modelValue",
|
|
90
|
+
)), u("update:modelValue", s);
|
|
91
91
|
}
|
|
92
92
|
function k() {
|
|
93
|
-
u("clear", o.modelValue), u("update:modelValue", o.required && !
|
|
93
|
+
u("clear", o.modelValue), u("update:modelValue", o.required && !c.value ? [] : null);
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return w({
|
|
96
96
|
present: g,
|
|
97
97
|
clear: k
|
|
98
98
|
}), (e, l) => {
|
|
99
|
-
const
|
|
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)) :
|
|
120
|
+
}, null, 32)) : v("", !0),
|
|
121
121
|
e.$slots.end ? (a(), i("slot-view", $e, [
|
|
122
122
|
d(e.$slots, "end")
|
|
123
|
-
])) :
|
|
123
|
+
])) : v("", !0)
|
|
124
124
|
], 16, Ve)), [
|
|
125
|
-
[
|
|
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)) :
|
|
144
|
-
e.$slots.end ? (a(), i("slot-view",
|
|
143
|
+
}, null, 32)) : v("", !0),
|
|
144
|
+
e.$slots.end ? (a(), i("slot-view", Se, [
|
|
145
145
|
d(e.$slots, "end")
|
|
146
|
-
])) :
|
|
147
|
-
], 16,
|
|
148
|
-
[
|
|
149
|
-
]) :
|
|
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(
|
|
154
|
-
show:
|
|
155
|
-
"onUpdate:show": l[9] || (l[9] = (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
|
-
|
|
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:
|
|
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)) :
|
|
179
|
+
}, null, 40, Ke)) : v("", !0)
|
|
179
180
|
]),
|
|
180
181
|
e.virtual ? (a(), i(W, { key: 0 }, [
|
|
181
|
-
|
|
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(
|
|
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:
|
|
193
|
+
default: n(({ item: t, index: f }) => [
|
|
193
194
|
z(p(O), {
|
|
194
|
-
class: P(["sun-selector-option", { "sun-selector-option-active":
|
|
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:
|
|
202
|
-
active:
|
|
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:
|
|
209
|
-
active:
|
|
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:
|
|
216
|
-
active:
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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":
|
|
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:
|
|
262
|
-
active:
|
|
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:
|
|
269
|
-
active:
|
|
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:
|
|
276
|
-
active:
|
|
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
|
-
|
|
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 "./
|
|
2
|
-
import a from "./
|
|
3
|
-
import l from "./
|
|
4
|
-
import s from "./
|
|
5
|
-
import m from "./
|
|
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
package/index125.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
package/index127.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
12
|
+
h as default
|
|
7
13
|
};
|
package/index128.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
var
|
|
5
|
-
|
|
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
|
-
|
|
8
|
+
p as default
|
|
13
9
|
};
|
package/index129.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
var
|
|
5
|
-
return
|
|
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
|
-
|
|
8
|
+
s as default
|
|
9
9
|
};
|
package/index130.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
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
|
-
|
|
6
|
+
e as default
|
|
9
7
|
};
|
package/index16.js
CHANGED
package/index17.js
CHANGED
package/index18.js
CHANGED
package/index19.js
CHANGED
package/index20.js
CHANGED
package/index21.js
CHANGED
package/index26.js
CHANGED
package/index3.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { tree2list as
|
|
3
|
-
import { SunLazyRender as
|
|
4
|
-
import { SunModal as
|
|
5
|
-
import { linkedRef as
|
|
6
|
-
const
|
|
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__ */
|
|
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__ */
|
|
28
|
-
setup(w, { emit:
|
|
29
|
-
const p =
|
|
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 =
|
|
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
|
-
}),
|
|
36
|
+
}), N = n(() => {
|
|
42
37
|
const e = v.value;
|
|
43
38
|
return e ? !e.children : !1;
|
|
44
|
-
}),
|
|
39
|
+
}), V = n(() => U.value.map((e) => e[s.labelKey]).join(` ${s.delimiter} `)), y = z(
|
|
45
40
|
() => (
|
|
46
41
|
// 如果有值,则取 currentNodes 的最后索引,否则为 0
|
|
47
|
-
f.value ?
|
|
42
|
+
f.value ? ye(() => h.value.length - 1) : 0
|
|
48
43
|
)
|
|
49
|
-
),
|
|
44
|
+
), C = n(() => s.options.filter((e) => !e.parent)), A = n(() => {
|
|
50
45
|
const e = v.value;
|
|
51
|
-
return e ? e.children :
|
|
46
|
+
return e ? e.children : C.value;
|
|
52
47
|
});
|
|
53
|
-
function
|
|
48
|
+
function S() {
|
|
54
49
|
s.disabled || (u.value = !0, K.value++);
|
|
55
50
|
}
|
|
56
|
-
function
|
|
51
|
+
function G() {
|
|
57
52
|
u.value = !1, p("close");
|
|
58
53
|
}
|
|
59
|
-
function
|
|
54
|
+
function H() {
|
|
60
55
|
p("clear", r.value), r.value = null;
|
|
61
56
|
}
|
|
62
|
-
function
|
|
63
|
-
v.value = e, p("select", e),
|
|
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
|
|
61
|
+
const J = ge("readonly");
|
|
67
62
|
return t(), o(m, null, [
|
|
68
|
-
|
|
69
|
-
present:
|
|
70
|
-
label:
|
|
63
|
+
be(e.$slots, "default", {
|
|
64
|
+
present: S,
|
|
65
|
+
label: V.value
|
|
71
66
|
}, () => [
|
|
72
|
-
|
|
67
|
+
we((t(), o("van-field", ke(e.$attrs, {
|
|
73
68
|
class: "sun-cascader",
|
|
74
69
|
label: e.label,
|
|
75
|
-
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) =>
|
|
74
|
+
onClickInput: l[1] || (l[1] = (a) => S())
|
|
80
75
|
}), [
|
|
81
|
-
|
|
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) =>
|
|
81
|
+
onTap: l[0] || (l[0] = (a) => H())
|
|
87
82
|
}, null, 32)) : b("", !0)
|
|
88
|
-
], 16,
|
|
89
|
-
[
|
|
83
|
+
], 16, Ve)), [
|
|
84
|
+
[J]
|
|
90
85
|
])
|
|
91
86
|
]),
|
|
92
|
-
|
|
87
|
+
F(d(fe), { hook: "created" }, {
|
|
93
88
|
default: c(() => [
|
|
94
|
-
|
|
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) =>
|
|
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(
|
|
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) =>
|
|
105
|
+
onChange: l[2] || (l[2] = (a) => y.value = a.detail.index)
|
|
111
106
|
}, [
|
|
112
|
-
(t(!0), o(m, null, k(
|
|
113
|
-
var
|
|
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:
|
|
117
|
+
style: L({ height: e.height })
|
|
122
118
|
}, [
|
|
123
|
-
(t(!0), o(m, null, k(((
|
|
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:
|
|
121
|
+
class: Ke(["sun-cascader-option", { "sun-cascader-option-active": a[e.valueKey] === i[e.valueKey] }]),
|
|
126
122
|
clickable: !0,
|
|
127
|
-
onTap: (
|
|
128
|
-
},
|
|
123
|
+
onTap: ($e) => B(i)
|
|
124
|
+
}, Ne({
|
|
129
125
|
default: c(() => [
|
|
130
|
-
E(
|
|
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,
|
|
142
|
+
], 8, Se);
|
|
147
143
|
}), 128)),
|
|
148
|
-
|
|
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:
|
|
153
|
+
style: L({ height: e.height })
|
|
152
154
|
}, [
|
|
153
|
-
(t(!0), o(m, null, k(
|
|
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: (
|
|
159
|
+
onTap: ($) => B(a)
|
|
158
160
|
}, {
|
|
159
161
|
default: c(() => [
|
|
160
|
-
E(
|
|
162
|
+
M(E(a[e.labelKey]), 1)
|
|
161
163
|
]),
|
|
162
164
|
_: 2
|
|
163
165
|
}, 1032, ["onTap"]))), 128))
|
|
164
166
|
], 4)
|
|
165
|
-
]))
|
|
166
|
-
], 40,
|
|
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
|
-
|
|
180
|
+
Ee as default
|
|
179
181
|
};
|
package/index54.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
9
|
+
l as default
|
|
14
10
|
};
|
package/index55.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
11
|
+
i as default
|
|
10
12
|
};
|
package/index56.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
13
|
+
v as default
|
|
12
14
|
};
|
package/index61.js
CHANGED
package/index62.js
CHANGED
package/index65.js
CHANGED
package/index66.js
CHANGED