@solar-taro/ui-vant 3.5.3 → 4.0.1

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/index9.js CHANGED
@@ -1,352 +1,385 @@
1
- import { defineComponent as ee, mergeModels as A, ref as U, computed as m, useModel as le, renderSlot as oe, toDisplayString as te, createTextVNode as ne, Fragment as ae, openBlock as se, createElementBlock as re, createCommentVNode as ie, renderList as ue, unref as de, withCtx as ce, createBlock as pe, createElementVNode as fe, mergeProps as ve, resolveDirective as me, withDirectives as ye, createVNode as he, normalizeClass as be, normalizeStyle as ge, createSlots as ke } from "vue";
2
- import { SunTag as Ve, SunIcon as z, SunLazyRender as $e, SunVirtualList as we, SunItem as G, SunListPlaceholder as Se, SunList as Ke } from "@solar-taro/ui-sun";
3
- import { createReusableTemplate as Te } from "./index22.js";
4
- import { isNil as H } from "lodash-es";
5
- import Be from "./index6.js";
6
- const c = oe, C = te, q = ne, b = ae, s = se, p = re, g = ie, M = ue, u = de, r = ce, y = pe, L = fe, J = ve, ze = me, Q = ye, h = he, X = be, N = ge, O = ke, Ce = ["label", "placeholder", "required", "disabled"], Le = {
1
+ import { defineComponent as pe, inject as Y, useModel as Z, ref as F, computed as p, effect as I, Fragment as ye, mergeModels as _, openBlock as he, createElementBlock as ke, renderSlot as me, createElementVNode as ge, normalizeClass as be, createTextVNode as Se, toDisplayString as we, renderList as xe, createBlock as Te, unref as Ve, withCtx as $e, withModifiers as Be, createCommentVNode as Le, createVNode as Me, createSlots as Ne, normalizeStyle as ze } from "vue";
2
+ import { SUN_ITEM as Ce, SUN_FIELD as Ee, SunTag as qe, SunIcon as E, SunLazyRender as Re, SunSearchbar as We, SunVirtualList as De, SunListPlaceholder as Fe, SunItemDivider as ee, SunItem as le, SunList as Ue, SunButton as Ge } from "@solar-taro/ui-sun";
3
+ import { SunModal as je } from "@solar-taro/ui-vant";
4
+ import { defaultRangeExtractor as Ae } from "./index22.js";
5
+ import { createReusableTemplate as Pe } from "./index23.js";
6
+ import { isNil as te } from "lodash-es";
7
+ const y = me, b = we, S = Se, g = ye, o = he, c = ke, h = Le, U = xe, s = Ve, r = $e, f = Te, ne = Be, w = Me, G = be, B = ge, L = ze, He = Ne, Je = {
7
8
  key: 0,
8
- name: "input",
9
- class: "sun-selector-input"
10
- }, Ne = { name: "right-icon" }, De = ["label", "value", "placeholder", "use-right-icon-slot", "disabled"], We = { name: "right-icon" }, qe = ["value"], Me = { class: "sun-selector-option-label" }, je = /* @__PURE__ */ ee({
9
+ class: "sun-selector-inner"
10
+ }, Ke = {
11
+ key: 1,
12
+ class: "sun-selector-tags"
13
+ }, Oe = {
14
+ key: 1,
15
+ class: "sun-selector-placeholder"
16
+ }, Qe = { class: "sun-selector-option-label" }, Xe = { class: "sun-selector-option-label" }, tl = /* @__PURE__ */ pe({
11
17
  __name: "index",
12
- props: /* @__PURE__ */ A({
13
- type: { default: "field" },
18
+ props: /* @__PURE__ */ _({
14
19
  mode: { default: "single" },
15
- label: {},
16
20
  placeholder: { default: "请选择" },
17
- modelValue: {},
18
21
  options: {},
19
- labelKey: { default: "fullName" },
20
- valueKey: { default: "id" },
21
22
  loading: { type: Boolean },
22
- height: { default: "64vh" },
23
+ height: { default: "65vh" },
23
24
  required: { type: Boolean },
24
25
  disabled: { type: Boolean },
25
26
  delimiter: { default: ", " },
26
27
  searchable: { type: Boolean, default: !0 },
27
28
  clearable: { type: Boolean, default: !0 },
28
- searcher: {},
29
- virtual: { type: [Boolean, Object] },
29
+ filter: {},
30
+ virtual: { type: Boolean },
31
+ optionSize: { type: [Number, Function], default: 44 },
30
32
  refresher: { type: Boolean },
31
33
  refreshing: { type: Boolean },
32
- compareWith: { type: Function, default: (V, D) => V === D }
34
+ compareWith: { type: Function, default: (a, q) => a === q }
33
35
  }, {
36
+ modelValue: {},
37
+ modelModifiers: {},
34
38
  keyword: { default: "" },
35
39
  keywordModifiers: {}
36
40
  }),
37
- emits: /* @__PURE__ */ A(["update:modelValue", "select", "unselect", "clear", "close", "confirm", "refresh"], ["update:keyword"]),
38
- setup(V, { expose: D, emit: Y }) {
39
- const [Z, R] = Te(), o = V, f = Y, $ = U(!1), k = U(!1), I = m(() => o.searcher || ((e, l) => e[o.labelKey].toLowerCase().includes(l))), w = le(V, "keyword"), i = m(() => o.options.filter(
40
- (e) => I.value(e, w.value.toLowerCase())
41
- )), S = m(() => {
41
+ emits: /* @__PURE__ */ _(["select", "unselect", "clear", "close", "confirm", "refresh"], ["update:modelValue", "update:keyword"]),
42
+ setup(a, { expose: q, emit: oe }) {
43
+ const [ae, j] = Pe(), x = Y(Ce, void 0), R = Y(Ee, void 0), u = a, k = oe, d = Z(a, "modelValue"), M = F(!1), se = p(() => {
44
+ const e = u.optionSize;
45
+ return typeof e == "function" ? e : () => e;
46
+ }), N = p(() => u.options.flatMap((e) => ve(e) ? e.options.map((t) => ({
47
+ ...t,
48
+ parent: e
49
+ })) : e)), z = Z(a, "keyword"), A = p(() => N.value.filter((e) => {
50
+ const t = z.value.toLowerCase();
51
+ return re.value(e, t);
52
+ })), T = p(() => {
42
53
  var e;
43
- if (v.value) {
44
- const l = o.options.find(
45
- (n) => o.compareWith(n[o.valueKey], o.modelValue)
54
+ if (m.value) {
55
+ const t = N.value.find(
56
+ (l) => u.compareWith(l.value, d.value)
46
57
  );
47
- return l ? [l] : [];
58
+ return t ? [t] : [];
48
59
  }
49
- return ((e = o.modelValue) != null ? e : []).map(
50
- (l) => o.options.find((n) => o.compareWith(n[o.valueKey], l))
60
+ return ((e = d.value) != null ? e : []).map(
61
+ (t) => N.value.find((l) => u.compareWith(l.value, t))
51
62
  ).filter(Boolean);
52
- }), W = m(() => S.value.map((e) => e[o.labelKey]).join(o.delimiter)), K = m(() => !_(o.modelValue) && o.clearable), v = m(() => o.mode === "single"), E = m(() => {
53
- var l, n;
54
- let e = 47;
55
- return typeof o.virtual != "boolean" && (l = o.virtual) != null && l.itemSize && (e = (n = o.virtual) == null ? void 0 : n.itemSize), { itemSize: e };
56
- });
57
- function _(e) {
58
- return H(e) ? !0 : v.value ? !1 : e.length < 1;
63
+ }), i = p(() => {
64
+ const e = A.value, t = /* @__PURE__ */ new Set();
65
+ return e.flatMap((l) => {
66
+ const n = [];
67
+ return l.parent && !t.has(l.parent) && (t.add(l.parent), n.push({ kind: "optionGroup", value: l.parent })), n.push({ kind: "option", value: l }), n;
68
+ });
69
+ }), P = p(
70
+ () => i.value.reduce((e, t, l) => (t.kind === "optionGroup" && e.push(l), e), [])
71
+ ), ue = p(() => [...P.value].reverse()), H = F(0), V = F(!1), re = p(() => u.filter || ((e, t) => e.label.toLowerCase().includes(t))), J = p(() => T.value.map((e) => e.label).join(u.delimiter)), K = p(() => !ie(d.value) && u.clearable && !u.disabled), m = p(() => u.mode === "single");
72
+ function ie(e) {
73
+ return te(e) ? !0 : m.value ? !1 : e.length < 1;
59
74
  }
60
- function d(e) {
61
- var n;
62
- const l = e[o.valueKey];
63
- return v.value ? H(o.modelValue) ? !1 : o.compareWith(o.modelValue, l) : ((n = o.modelValue) == null ? void 0 : n.some((t) => o.compareWith(t, l))) || !1;
75
+ function v(e) {
76
+ var l;
77
+ const t = e.value;
78
+ return m.value ? te(d.value) ? !1 : u.compareWith(d.value, t) : ((l = d.value) == null ? void 0 : l.some((n) => u.compareWith(n, t))) || !1;
64
79
  }
65
- function T() {
66
- o.disabled || ($.value = !0, k.value || setTimeout(() => {
67
- k.value = !0;
80
+ function C() {
81
+ u.disabled || (M.value = !0, V.value || setTimeout(() => {
82
+ V.value = !0;
68
83
  }, 300));
69
84
  }
70
- function P() {
71
- $.value = !1, f("close");
85
+ function O() {
86
+ M.value = !1, k("close");
72
87
  }
73
- function F() {
74
- var l;
75
- const e = ((l = o.modelValue) == null ? void 0 : l.map(
76
- (n) => o.options.find(
77
- (t) => o.compareWith(t[o.valueKey], n)
88
+ function Q() {
89
+ var t;
90
+ const e = ((t = d.value) == null ? void 0 : t.map(
91
+ (l) => N.value.find(
92
+ (n) => u.compareWith(n.value, l)
78
93
  )
79
94
  )) || [];
80
- f("confirm", e), P();
95
+ k("confirm", e), O();
96
+ }
97
+ function X(e) {
98
+ const t = e.value;
99
+ m.value ? (v(e) ? u.required || (k("unselect", e), d.value = null) : (k("select", e), d.value = t), setTimeout(O, 100)) : v(e) ? (k("unselect", e), d.value = d.value.filter(
100
+ (l) => !u.compareWith(l, t)
101
+ )) : (k("select", e), d.value = (d.value || []).concat(
102
+ e.value
103
+ ));
81
104
  }
82
- function j(e) {
83
- const l = e[o.valueKey];
84
- let n = o.modelValue;
85
- v.value ? (d(e) ? o.required || (f("unselect", e), n = null) : (f("select", e), n = l), P()) : d(e) ? (f("unselect", e), n = o.modelValue.filter(
86
- (t) => !o.compareWith(t, l)
87
- )) : (f("select", e), n = (o.modelValue || []).concat(
88
- e[o.valueKey]
89
- )), f("update:modelValue", n);
105
+ function W() {
106
+ k("clear", d.value), d.value = u.required && !m.value ? [] : null;
90
107
  }
91
- function B() {
92
- f("clear", o.modelValue), f("update:modelValue", o.required && !v.value ? [] : null);
108
+ const de = (e) => H.value === e, ce = (e) => P.value.includes(e);
109
+ function ve(e) {
110
+ return "options" in e;
93
111
  }
94
- return D({
95
- present: T,
96
- clear: B,
97
- keyword: w
98
- }), (e, l) => {
99
- const n = ze("readonly");
100
- return s(), p(b, null, [
101
- c(e.$slots, "default", {
102
- present: T,
103
- label: W.value,
104
- selectedOptions: S.value
105
- }, () => [
106
- e.type === "field" ? Q((s(), p("van-field", J({ key: 0 }, e.$attrs, {
107
- class: "sun-selector",
108
- label: e.label,
109
- placeholder: e.placeholder,
110
- required: e.required,
111
- disabled: e.disabled,
112
- onClickInput: l[1] || (l[1] = (t) => T())
113
- }), [
114
- S.value.length ? (s(), p("slot-view", Le, [
115
- v.value ? (s(), p(b, { key: 0 }, [
116
- q(C(W.value), 1)
117
- ], 64)) : (s(!0), p(b, { key: 1 }, M(S.value, (t) => (s(), y(u(Ve), {
112
+ return q({
113
+ present: C,
114
+ clear: W,
115
+ keyword: z
116
+ }), I(() => {
117
+ R && (R.required.value = u.required, R.disabled.value = u.disabled);
118
+ }), I(() => {
119
+ x && (x.clickable.value = !u.disabled);
120
+ }), x == null || x.onTap(C), (e, t) => (o(), c(g, null, [
121
+ y(e.$slots, "default", {
122
+ present: C,
123
+ label: J.value,
124
+ selectedOptions: T.value
125
+ }, () => [
126
+ B("view", {
127
+ class: G(["sun-selector", {
128
+ "sun-selector-required": a.required,
129
+ "sun-selector-disabled": a.disabled
130
+ }]),
131
+ onTap: t[1] || (t[1] = (l) => C())
132
+ }, [
133
+ T.value.length ? (o(), c("view", Je, [
134
+ m.value ? (o(), c(g, { key: 0 }, [
135
+ S(b(J.value), 1)
136
+ ], 64)) : (o(), c("view", Ke, [
137
+ (o(!0), c(g, null, U(T.value, (l) => (o(), f(s(qe), {
118
138
  color: "medium",
119
139
  type: "translucent"
120
140
  }, {
121
141
  default: r(() => [
122
- q(C(t[e.labelKey]), 1)
142
+ S(b(l.label), 1)
123
143
  ]),
124
144
  _: 2
125
145
  }, 1024))), 256))
126
- ])) : g("", !0),
127
- L("slot-view", Ne, [
128
- K.value ? (s(), y(u(z), {
129
- key: 0,
130
- class: "sun-selector-clear-icon",
131
- name: "close-circle",
132
- onTap: l[0] || (l[0] = (t) => B())
133
- })) : g("", !0),
134
- c(e.$slots, "end")
135
- ])
136
- ], 16, Ce)), [
137
- [n]
138
- ]) : e.type === "search" ? Q((s(), p("van-search", J({ key: 1 }, e.$attrs, {
139
- class: "sun-selector",
140
- label: e.label,
141
- value: W.value,
142
- placeholder: e.placeholder,
143
- "use-right-icon-slot": K.value,
144
- shape: "round",
145
- clearable: !1,
146
- disabled: e.disabled,
147
- onClickInput: l[3] || (l[3] = (t) => T())
148
- }), [
149
- L("slot-view", We, [
150
- K.value ? (s(), y(u(z), {
151
- key: 0,
152
- class: "sun-selector-clear-icon",
153
- name: "close-circle",
154
- onTap: l[2] || (l[2] = (t) => B())
155
- })) : g("", !0),
156
- c(e.$slots, "end")
157
- ])
158
- ], 16, De)), [
159
- [n]
160
- ]) : g("", !0)
161
- ]),
162
- h(u($e), { hook: "created" }, {
163
- default: r(() => [
164
- h(u(Be), {
165
- show: $.value,
166
- "onUpdate:show": l[9] || (l[9] = (t) => $.value = t),
167
- title: e.placeholder,
168
- "show-buttons": !v.value
169
- }, O({
170
- buttons: r(() => [
171
- c(e.$slots, "buttons", { confirm: F }, () => [
172
- v.value ? g("", !0) : (s(), p("van-button", {
173
- key: 0,
174
- type: "primary",
175
- round: "true",
176
- block: "true",
177
- onTap: l[8] || (l[8] = (t) => F())
178
- }, "确定", 32))
179
- ])
146
+ ]))
147
+ ])) : (o(), c("view", Oe, b(a.placeholder), 1)),
148
+ K.value ? (o(), f(s(E), {
149
+ key: 2,
150
+ class: "sun-selector-clear-icon",
151
+ name: "close-circle",
152
+ onTap: t[0] || (t[0] = ne((l) => W(), ["stop"]))
153
+ })) : h("", !0),
154
+ w(s(E), {
155
+ class: "sun-selector-icon",
156
+ name: "chevron-expand-outline"
157
+ })
158
+ ], 34)
159
+ ]),
160
+ w(s(Re), { hook: "created" }, {
161
+ default: r(() => [
162
+ w(s(je), {
163
+ show: M.value,
164
+ "onUpdate:show": t[7] || (t[7] = (l) => M.value = l),
165
+ title: a.placeholder,
166
+ "show-buttons": !m.value,
167
+ onTap: t[8] || (t[8] = ne(() => {
168
+ }, ["stop"]))
169
+ }, He({
170
+ buttons: r(() => [
171
+ y(e.$slots, "buttons", { confirm: Q }, () => [
172
+ m.value ? h("", !0) : (o(), f(s(Ge), {
173
+ key: 0,
174
+ expand: "block",
175
+ onTap: t[6] || (t[6] = (l) => Q())
176
+ }, {
177
+ default: r(() => [...t[10] || (t[10] = [
178
+ S("确定", -1)
179
+ ])]),
180
+ _: 1
181
+ }))
182
+ ])
183
+ ]),
184
+ default: r(() => [
185
+ y(e.$slots, "filter", { rendered: V.value }, () => [
186
+ a.searchable ? (o(), f(s(We), {
187
+ key: 0,
188
+ modelValue: z.value,
189
+ "onUpdate:modelValue": t[3] || (t[3] = (l) => z.value = l),
190
+ placeholder: "输入关键字搜索"
191
+ }, null, 8, ["modelValue"])) : h("", !0)
180
192
  ]),
181
- default: r(() => [
182
- c(e.$slots, "filter", { rendered: k.value }, () => [
183
- e.searchable ? (s(), p("van-search", {
184
- key: 0,
185
- shape: "round",
186
- "input-align": "center",
187
- value: w.value,
188
- placeholder: "输入关键字搜索",
189
- onChange: l[5] || (l[5] = (t) => w.value = t.detail.trim())
190
- }, null, 40, qe)) : g("", !0)
191
- ]),
192
- h(u(Z), null, {
193
- default: r(() => [
194
- e.virtual ? (s(), p(b, { key: 0 }, [
195
- k.value ? (s(), y(u(we), {
196
- key: 0,
197
- class: "sun-selector-options",
198
- options: {
199
- estimateSize: () => E.value.itemSize,
200
- overscan: 3,
201
- count: i.value.length,
202
- getItemKey: (t) => i.value[t][e.valueKey]
193
+ w(s(ae), null, {
194
+ default: r(() => [
195
+ a.virtual ? (o(), c(g, { key: 0 }, [
196
+ V.value ? (o(), f(s(De), {
197
+ key: 0,
198
+ class: "sun-selector-options",
199
+ options: {
200
+ estimateSize: (l) => {
201
+ const n = i.value[l];
202
+ return n.kind === "optionGroup" ? 28 : se.value(n.value);
203
203
  },
204
- refresher: e.refresher,
205
- refreshing: e.refreshing,
206
- items: i.value,
207
- "item-size": E.value.itemSize,
208
- style: N({ height: e.height }),
209
- onRefresh: l[6] || (l[6] = (t) => f("refresh"))
210
- }, {
211
- default: r(({ virtualItems: t }) => [
212
- (s(!0), p(b, null, M(t, (a) => (s(), y(u(G), {
213
- key: i.value[a.index][e.valueKey],
214
- style: N(a.style),
215
- class: X(["sun-selector-option", { "sun-selector-option-active": d(i.value[a.index]) }]),
204
+ overscan: 3,
205
+ count: i.value.length,
206
+ rangeExtractor: (l) => {
207
+ const n = new Set(s(Ae)(l)), $ = ue.value.find((D) => l.startIndex >= D);
208
+ return $ !== void 0 && (n.add($), H.value = $), [...n].sort((D, fe) => D - fe);
209
+ }
210
+ },
211
+ refresher: a.refresher,
212
+ refreshing: a.refreshing,
213
+ style: L({ height: a.height }),
214
+ onRefresh: t[4] || (t[4] = (l) => k("refresh"))
215
+ }, {
216
+ default: r(({ virtualItems: l }) => [
217
+ (o(!0), c(g, null, U(l, (n) => (o(), c(g, {
218
+ key: n.index
219
+ }, [
220
+ i.value[n.index].kind === "optionGroup" ? (o(), f(s(ee), {
221
+ key: 0,
222
+ class: "sun-selector-option-divider",
223
+ style: L({
224
+ zIndex: ce(n.index) ? 1 : 0,
225
+ ...n.style,
226
+ ...de(n.index) ? {
227
+ position: "sticky",
228
+ transform: "unset"
229
+ } : {
230
+ position: "absolute"
231
+ }
232
+ })
233
+ }, {
234
+ default: r(() => [
235
+ S(b(i.value[n.index].value.label), 1)
236
+ ]),
237
+ _: 2
238
+ }, 1032, ["style"])) : h("", !0),
239
+ i.value[n.index].kind === "option" ? (o(), f(s(le), {
240
+ key: 1,
241
+ class: G(["sun-selector-option", { "sun-selector-option-active": v(i.value[n.index].value) }]),
216
242
  clickable: !0,
217
- onTap: (x) => j(i.value[a.index])
218
- }, O({
243
+ style: L(n.style),
244
+ onTap: ($) => X(i.value[n.index].value)
245
+ }, {
219
246
  start: r(() => [
220
- c(e.$slots, "option-start", {
221
- option: i.value[a.index],
222
- index: a.index,
223
- active: d(i.value[a.index])
247
+ y(e.$slots, "option-start", {
248
+ option: i.value[n.index].value,
249
+ index: n.index,
250
+ active: v(i.value[n.index].value)
224
251
  })
225
252
  ]),
226
253
  end: r(() => [
227
- c(e.$slots, "option-end", {
228
- option: i.value[a.index],
229
- index: a.index,
230
- active: d(i.value[a.index])
231
- })
254
+ y(e.$slots, "option-end", {
255
+ option: i.value[n.index].value,
256
+ index: n.index,
257
+ active: v(i.value[n.index].value)
258
+ }),
259
+ v(i.value[n.index].value) ? (o(), f(s(E), {
260
+ key: 0,
261
+ class: "sun-selector-option-icon",
262
+ name: "checkmark"
263
+ })) : h("", !0)
232
264
  ]),
233
265
  default: r(() => [
234
- c(e.$slots, "option", {
235
- option: i.value[a.index],
236
- index: a.index,
237
- active: d(i.value[a.index])
266
+ y(e.$slots, "option", {
267
+ option: i.value[n.index].value,
268
+ index: n.index,
269
+ active: v(i.value[n.index].value)
238
270
  }, () => [
239
- q(C(i.value[a.index][e.labelKey]), 1)
271
+ B("view", Qe, b(i.value[n.index].value.label), 1)
240
272
  ])
241
273
  ]),
242
274
  _: 2
243
- }, [
244
- d(i.value[a.index]) ? {
245
- name: "end",
246
- fn: r(() => [
247
- h(u(z), {
248
- class: "sun-selector-option-icon",
249
- name: "checkmark"
250
- })
251
- ]),
252
- key: "0"
253
- } : void 0
254
- ]), 1032, ["style", "class", "onTap"]))), 128))
255
- ]),
256
- placeholder: r(() => [
257
- h(u(Se), { loading: e.loading }, null, 8, ["loading"])
258
- ]),
259
- _: 3
260
- }, 8, ["options", "refresher", "refreshing", "items", "item-size", "style"])) : (s(), p("view", {
261
- key: 1,
262
- style: N({ height: e.height })
263
- }, null, 4))
264
- ], 64)) : (s(), y(u(Ke), {
275
+ }, 1032, ["class", "style", "onTap"])) : h("", !0)
276
+ ], 64))), 128))
277
+ ]),
278
+ placeholder: r(() => [
279
+ w(s(Fe), { loading: a.loading }, null, 8, ["loading"])
280
+ ]),
281
+ _: 3
282
+ }, 8, ["options", "refresher", "refreshing", "style"])) : (o(), c("view", {
265
283
  key: 1,
266
- class: "sun-selector-options",
267
- refresher: e.refresher,
268
- refreshing: e.refreshing,
269
- data: i.value,
270
- loading: e.loading,
271
- style: N({ height: e.height }),
272
- onRefresh: l[7] || (l[7] = (t) => f("refresh"))
273
- }, {
274
- default: r(() => [
275
- (s(!0), p(b, null, M(i.value, (t, a) => (s(), y(u(G), {
276
- key: t[e.valueKey],
277
- class: X(["sun-selector-option", { "sun-selector-option-active": d(t) }]),
278
- clickable: !0,
279
- onTap: (x) => j(t)
280
- }, O({
281
- start: r(() => [
282
- c(e.$slots, "option-start", {
283
- option: t,
284
- index: a,
285
- active: d(t)
286
- })
287
- ]),
288
- end: r(() => [
289
- c(e.$slots, "option-end", {
290
- option: t,
291
- index: a,
292
- active: d(t)
293
- })
294
- ]),
295
- default: r(() => [
296
- c(e.$slots, "option", {
297
- option: t,
298
- index: a,
299
- active: d(t)
300
- }, () => [
301
- L("view", Me, C(t[e.labelKey]), 1)
302
- ])
303
- ]),
304
- _: 2
305
- }, [
306
- d(t) ? {
307
- name: "end",
308
- fn: r(() => [
309
- h(u(z), {
284
+ style: L({ height: a.height })
285
+ }, null, 4))
286
+ ], 64)) : (o(), f(s(Ue), {
287
+ key: 1,
288
+ class: "sun-selector-options",
289
+ refresher: a.refresher,
290
+ refreshing: a.refreshing,
291
+ data: A.value,
292
+ loading: a.loading,
293
+ style: L({ height: a.height }),
294
+ onRefresh: t[5] || (t[5] = (l) => k("refresh"))
295
+ }, {
296
+ default: r(() => [
297
+ B("view", null, [
298
+ (o(!0), c(g, null, U(i.value, (l, n) => (o(), c(g, { key: n }, [
299
+ l.kind === "optionGroup" ? (o(), f(s(ee), {
300
+ key: 0,
301
+ class: "sun-selector-option-divider"
302
+ }, {
303
+ default: r(() => [
304
+ S(b(l.value.label), 1)
305
+ ]),
306
+ _: 2
307
+ }, 1024)) : h("", !0),
308
+ l.kind === "option" ? (o(), f(s(le), {
309
+ key: 1,
310
+ class: G(["sun-selector-option", { "sun-selector-option-active": v(l.value) }]),
311
+ clickable: !0,
312
+ onTap: ($) => X(l.value)
313
+ }, {
314
+ start: r(() => [
315
+ y(e.$slots, "option-start", {
316
+ option: l.value,
317
+ index: n,
318
+ active: v(l.value)
319
+ })
320
+ ]),
321
+ end: r(() => [
322
+ y(e.$slots, "option-end", {
323
+ option: l.value,
324
+ index: n,
325
+ active: v(l.value)
326
+ }),
327
+ v(l.value) ? (o(), f(s(E), {
328
+ key: 0,
310
329
  class: "sun-selector-option-icon",
311
330
  name: "checkmark"
312
- })
331
+ })) : h("", !0)
313
332
  ]),
314
- key: "0"
315
- } : void 0
316
- ]), 1032, ["class", "onTap"]))), 128))
317
- ]),
318
- _: 3
319
- }, 8, ["refresher", "refreshing", "data", "loading", "style"]))
320
- ]),
321
- _: 3
322
- }),
323
- c(e.$slots, "list", {
324
- rendered: k.value,
325
- ListTemplate: u(R)
326
- }, () => [
327
- h(u(R))
328
- ])
329
- ]),
330
- _: 2
331
- }, [
332
- K.value ? {
333
- name: "extra",
334
- fn: r(() => [
335
- L("view", {
336
- class: "sun-selector-clear-btn",
337
- onTap: l[4] || (l[4] = (t) => B())
338
- }, "清除", 32)
333
+ default: r(() => [
334
+ y(e.$slots, "option", {
335
+ option: l.value,
336
+ index: n,
337
+ active: v(l.value)
338
+ }, () => [
339
+ B("view", Xe, b(l.value.label), 1)
340
+ ])
341
+ ]),
342
+ _: 2
343
+ }, 1032, ["class", "onTap"])) : h("", !0)
344
+ ], 64))), 128))
345
+ ])
346
+ ]),
347
+ _: 3
348
+ }, 8, ["refresher", "refreshing", "data", "loading", "style"]))
339
349
  ]),
340
- key: "0"
341
- } : void 0
342
- ]), 1032, ["show", "title", "show-buttons"])
343
- ]),
344
- _: 3
345
- })
346
- ], 64);
347
- };
350
+ _: 3
351
+ }),
352
+ y(e.$slots, "list", {
353
+ rendered: V.value,
354
+ ListTemplate: s(j)
355
+ }, () => [
356
+ w(s(j))
357
+ ])
358
+ ]),
359
+ _: 2
360
+ }, [
361
+ K.value ? {
362
+ name: "extra",
363
+ fn: r(() => [
364
+ B("view", {
365
+ class: "sun-selector-clear-btn",
366
+ onTap: t[2] || (t[2] = (l) => W())
367
+ }, [
368
+ t[9] || (t[9] = S(" 清除", -1)),
369
+ m.value ? h("", !0) : (o(), c(g, { key: 0 }, [
370
+ S("(" + b(T.value.length) + ")", 1)
371
+ ], 64))
372
+ ], 32)
373
+ ]),
374
+ key: "0"
375
+ } : void 0
376
+ ]), 1032, ["show", "title", "show-buttons"])
377
+ ]),
378
+ _: 3
379
+ })
380
+ ], 64));
348
381
  }
349
382
  });
350
383
  export {
351
- je as default
384
+ tl as default
352
385
  };