mx-ui-template 0.2.0 → 0.2.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/README.md +10 -1
- package/dist/iconfont.ttf +0 -0
- package/dist/mx-ui-template.css +1 -1
- package/dist/mx-ui-template.js +1240 -66
- package/dist/mx-ui-template.umd.cjs +1 -1
- package/dist/mx-ui-template_utils.js +25 -25
- package/dist/mx-ui-template_utils.umd.cjs +1 -1
- package/package.json +3 -3
package/dist/mx-ui-template.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { NButton as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as x, createBlock as de, openBlock as D, unref as L, normalizeStyle as fe, normalizeClass as U, withCtx as q, renderSlot as V, computed as R, createSlots as at, onUnmounted as ze, onDeactivated as Q, isRef as st, watch as k, onMounted as ee, nextTick as me, onActivated as ve, ref as g, reactive as he, getCurrentInstance as ge, createVNode as m, onBeforeUnmount as Ae, provide as Fe, watchEffect as lt, inject as ct, mergeProps as N, Transition as Ve, Teleport as Le, withDirectives as Ne, vShow as Re, Fragment as it, createApp as ut, createElementBlock as K, createCommentVNode as le, createElementVNode as O, toDisplayString as we } from "vue";
|
|
2
|
+
import { NButton as rt, NInput as dt, NCard as ft } from "naive-ui";
|
|
3
|
+
const mt = /* @__PURE__ */ x({
|
|
4
4
|
__name: "Button",
|
|
5
5
|
props: {
|
|
6
6
|
type: {},
|
|
@@ -16,14 +16,14 @@ const I = /* @__PURE__ */ u({
|
|
|
16
16
|
disabled: { type: Boolean }
|
|
17
17
|
},
|
|
18
18
|
emits: ["click"],
|
|
19
|
-
setup(e, { emit:
|
|
20
|
-
const
|
|
21
|
-
!
|
|
19
|
+
setup(e, { emit: t }) {
|
|
20
|
+
const n = e, o = t, l = (s) => {
|
|
21
|
+
!n.disabled && n.onClick && n.onClick(s), o("click", s);
|
|
22
22
|
};
|
|
23
|
-
return (
|
|
23
|
+
return (s, i) => (D(), de(L(rt), {
|
|
24
24
|
id: e.id,
|
|
25
|
-
class:
|
|
26
|
-
style:
|
|
25
|
+
class: U(e.class),
|
|
26
|
+
style: fe(e.style),
|
|
27
27
|
type: e.type,
|
|
28
28
|
size: e.size,
|
|
29
29
|
circle: e.circle,
|
|
@@ -31,20 +31,20 @@ const I = /* @__PURE__ */ u({
|
|
|
31
31
|
dashed: e.dashed,
|
|
32
32
|
loading: e.loading,
|
|
33
33
|
disabled: e.disabled,
|
|
34
|
-
onClick:
|
|
34
|
+
onClick: l
|
|
35
35
|
}, {
|
|
36
|
-
default:
|
|
37
|
-
|
|
36
|
+
default: q(() => [
|
|
37
|
+
V(s.$slots, "default", {}, void 0, !0)
|
|
38
38
|
]),
|
|
39
39
|
_: 3
|
|
40
40
|
}, 8, ["id", "class", "style", "type", "size", "circle", "ghost", "dashed", "loading", "disabled"]));
|
|
41
41
|
}
|
|
42
|
-
}),
|
|
43
|
-
const
|
|
44
|
-
for (const [o,
|
|
45
|
-
|
|
46
|
-
return
|
|
47
|
-
},
|
|
42
|
+
}), te = (e, t) => {
|
|
43
|
+
const n = e.__vccOpts || e;
|
|
44
|
+
for (const [o, l] of t)
|
|
45
|
+
n[o] = l;
|
|
46
|
+
return n;
|
|
47
|
+
}, vt = /* @__PURE__ */ te(mt, [["__scopeId", "data-v-fdf1cb77"]]), ht = /* @__PURE__ */ x({
|
|
48
48
|
__name: "Input",
|
|
49
49
|
props: {
|
|
50
50
|
modelValue: {},
|
|
@@ -65,29 +65,29 @@ const I = /* @__PURE__ */ u({
|
|
|
65
65
|
disabled: { type: Boolean }
|
|
66
66
|
},
|
|
67
67
|
emits: ["update:modelValue", "input", "blur", "focus"],
|
|
68
|
-
setup(e, { emit:
|
|
69
|
-
const
|
|
68
|
+
setup(e, { emit: t }) {
|
|
69
|
+
const n = e, o = t, l = R({
|
|
70
70
|
get() {
|
|
71
|
-
return
|
|
71
|
+
return n.modelValue?.toString() || "";
|
|
72
72
|
},
|
|
73
|
-
set(
|
|
74
|
-
o("update:modelValue", typeof
|
|
73
|
+
set(c) {
|
|
74
|
+
o("update:modelValue", typeof n.modelValue == "number" && c !== "" ? Number(c) : c);
|
|
75
75
|
}
|
|
76
|
-
}),
|
|
77
|
-
o("update:modelValue",
|
|
78
|
-
},
|
|
79
|
-
o("blur",
|
|
80
|
-
},
|
|
81
|
-
o("focus",
|
|
82
|
-
};
|
|
83
|
-
return (
|
|
76
|
+
}), s = (c) => {
|
|
77
|
+
o("update:modelValue", c);
|
|
78
|
+
}, i = (c) => {
|
|
79
|
+
o("blur", c);
|
|
80
|
+
}, a = (c) => {
|
|
81
|
+
o("focus", c);
|
|
82
|
+
};
|
|
83
|
+
return (c, u) => (D(), de(L(dt), {
|
|
84
84
|
id: e.id,
|
|
85
|
-
class:
|
|
86
|
-
style:
|
|
87
|
-
value:
|
|
85
|
+
class: U(e.class),
|
|
86
|
+
style: fe(e.style),
|
|
87
|
+
value: l.value,
|
|
88
88
|
"onUpdate:value": [
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
u[0] || (u[0] = (v) => l.value = v),
|
|
90
|
+
s
|
|
91
91
|
],
|
|
92
92
|
type: e.type,
|
|
93
93
|
size: e.size,
|
|
@@ -98,11 +98,11 @@ const I = /* @__PURE__ */ u({
|
|
|
98
98
|
"prefix-icon": e.prefixIcon,
|
|
99
99
|
"suffix-icon": e.suffixIcon,
|
|
100
100
|
disabled: e.disabled,
|
|
101
|
-
onBlur:
|
|
102
|
-
onFocus:
|
|
101
|
+
onBlur: i,
|
|
102
|
+
onFocus: a
|
|
103
103
|
}, null, 8, ["id", "class", "style", "value", "type", "size", "placeholder", "readonly", "maxlength", "show-word-limit", "prefix-icon", "suffix-icon", "disabled"]));
|
|
104
104
|
}
|
|
105
|
-
}),
|
|
105
|
+
}), gt = /* @__PURE__ */ te(ht, [["__scopeId", "data-v-be9f5c5c"]]), yt = /* @__PURE__ */ x({
|
|
106
106
|
__name: "Card",
|
|
107
107
|
props: {
|
|
108
108
|
title: {},
|
|
@@ -116,52 +116,1226 @@ const I = /* @__PURE__ */ u({
|
|
|
116
116
|
disabled: { type: Boolean }
|
|
117
117
|
},
|
|
118
118
|
emits: ["close"],
|
|
119
|
-
setup(e, { emit:
|
|
120
|
-
const
|
|
121
|
-
|
|
119
|
+
setup(e, { emit: t }) {
|
|
120
|
+
const n = e, o = t, l = () => {
|
|
121
|
+
n.onClose && n.onClose(), o("close");
|
|
122
122
|
};
|
|
123
|
-
return (
|
|
123
|
+
return (s, i) => (D(), de(L(ft), {
|
|
124
124
|
id: e.id,
|
|
125
|
-
class:
|
|
126
|
-
style:
|
|
125
|
+
class: U(e.class),
|
|
126
|
+
style: fe(e.style),
|
|
127
127
|
title: e.title,
|
|
128
128
|
bordered: e.bordered,
|
|
129
129
|
size: e.size,
|
|
130
130
|
closable: e.closable,
|
|
131
|
-
onClose:
|
|
132
|
-
},
|
|
133
|
-
default:
|
|
134
|
-
|
|
131
|
+
onClose: l
|
|
132
|
+
}, at({
|
|
133
|
+
default: q(() => [
|
|
134
|
+
V(s.$slots, "default", {}, void 0, !0)
|
|
135
135
|
]),
|
|
136
136
|
_: 2
|
|
137
137
|
}, [
|
|
138
|
-
|
|
138
|
+
s.$slots["header-extra"] ? {
|
|
139
139
|
name: "header-extra",
|
|
140
|
-
fn:
|
|
141
|
-
|
|
140
|
+
fn: q(() => [
|
|
141
|
+
V(s.$slots, "header-extra", {}, void 0, !0)
|
|
142
142
|
]),
|
|
143
143
|
key: "0"
|
|
144
144
|
} : void 0
|
|
145
145
|
]), 1032, ["id", "class", "style", "title", "bordered", "size", "closable"]));
|
|
146
146
|
}
|
|
147
|
-
}),
|
|
147
|
+
}), bt = /* @__PURE__ */ te(yt, [["__scopeId", "data-v-fdc12dd9"]]);
|
|
148
|
+
function pt() {
|
|
149
|
+
}
|
|
150
|
+
const I = Object.assign, ye = typeof window < "u", ne = (e) => e !== null && typeof e == "object", P = (e) => e != null, ue = (e) => typeof e == "function", Et = (e) => ne(e) && ue(e.then) && ue(e.catch), je = (e) => typeof e == "number" || /^\d+(\.\d+)?$/.test(e), Ct = () => ye ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : !1;
|
|
151
|
+
function xe(e, t) {
|
|
152
|
+
const n = t.split(".");
|
|
153
|
+
let o = e;
|
|
154
|
+
return n.forEach((l) => {
|
|
155
|
+
var s;
|
|
156
|
+
o = ne(o) && (s = o[l]) != null ? s : "";
|
|
157
|
+
}), o;
|
|
158
|
+
}
|
|
159
|
+
function wt(e, t, n) {
|
|
160
|
+
return t.reduce(
|
|
161
|
+
(o, l) => (o[l] = e[l], o),
|
|
162
|
+
{}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
const J = null, p = [Number, String], z = {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default: !0
|
|
168
|
+
}, xt = (e) => ({
|
|
169
|
+
type: Number,
|
|
170
|
+
default: e
|
|
171
|
+
}), ce = (e) => ({
|
|
172
|
+
type: p,
|
|
173
|
+
default: e
|
|
174
|
+
}), E = (e) => ({
|
|
175
|
+
type: String,
|
|
176
|
+
default: e
|
|
177
|
+
});
|
|
178
|
+
var be = typeof window < "u";
|
|
179
|
+
function He(e) {
|
|
180
|
+
let t;
|
|
181
|
+
ee(() => {
|
|
182
|
+
e(), me(() => {
|
|
183
|
+
t = !0;
|
|
184
|
+
});
|
|
185
|
+
}), ve(() => {
|
|
186
|
+
t && e();
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function pe(e, t, n = {}) {
|
|
190
|
+
if (!be)
|
|
191
|
+
return;
|
|
192
|
+
const { target: o = window, passive: l = !1, capture: s = !1 } = n;
|
|
193
|
+
let i = !1, a;
|
|
194
|
+
const c = (f) => {
|
|
195
|
+
if (i)
|
|
196
|
+
return;
|
|
197
|
+
const d = L(f);
|
|
198
|
+
d && !a && (d.addEventListener(e, t, {
|
|
199
|
+
capture: s,
|
|
200
|
+
passive: l
|
|
201
|
+
}), a = !0);
|
|
202
|
+
}, u = (f) => {
|
|
203
|
+
if (i)
|
|
204
|
+
return;
|
|
205
|
+
const d = L(f);
|
|
206
|
+
d && a && (d.removeEventListener(e, t, s), a = !1);
|
|
207
|
+
};
|
|
208
|
+
ze(() => u(o)), Q(() => u(o)), He(() => c(o));
|
|
209
|
+
let v;
|
|
210
|
+
return st(o) && (v = k(o, (f, d) => {
|
|
211
|
+
u(d), c(f);
|
|
212
|
+
})), () => {
|
|
213
|
+
v?.(), u(o), i = !0;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
var X, ie;
|
|
217
|
+
function Bt() {
|
|
218
|
+
if (!X && (X = g(0), ie = g(0), be)) {
|
|
219
|
+
const e = () => {
|
|
220
|
+
X.value = window.innerWidth, ie.value = window.innerHeight;
|
|
221
|
+
};
|
|
222
|
+
e(), window.addEventListener("resize", e, { passive: !0 }), window.addEventListener("orientationchange", e, { passive: !0 });
|
|
223
|
+
}
|
|
224
|
+
return { width: X, height: ie };
|
|
225
|
+
}
|
|
226
|
+
var St = /scroll|auto|overlay/i, Me = be ? window : void 0;
|
|
227
|
+
function kt(e) {
|
|
228
|
+
return e.tagName !== "HTML" && e.tagName !== "BODY" && e.nodeType === 1;
|
|
229
|
+
}
|
|
230
|
+
function Ye(e, t = Me) {
|
|
231
|
+
let n = e;
|
|
232
|
+
for (; n && n !== t && kt(n); ) {
|
|
233
|
+
const { overflowY: o } = window.getComputedStyle(n);
|
|
234
|
+
if (St.test(o))
|
|
235
|
+
return n;
|
|
236
|
+
n = n.parentNode;
|
|
237
|
+
}
|
|
238
|
+
return t;
|
|
239
|
+
}
|
|
240
|
+
function Ot(e, t = Me) {
|
|
241
|
+
const n = g();
|
|
242
|
+
return ee(() => {
|
|
243
|
+
e.value && (n.value = Ye(e.value, t));
|
|
244
|
+
}), n;
|
|
245
|
+
}
|
|
246
|
+
function It(e) {
|
|
247
|
+
const t = "scrollTop" in e ? e.scrollTop : e.pageYOffset;
|
|
248
|
+
return Math.max(t, 0);
|
|
249
|
+
}
|
|
250
|
+
Ct();
|
|
251
|
+
const Tt = (e) => e.stopPropagation();
|
|
252
|
+
function Ee(e, t) {
|
|
253
|
+
(typeof e.cancelable != "boolean" || e.cancelable) && e.preventDefault(), t && Tt(e);
|
|
254
|
+
}
|
|
255
|
+
Bt();
|
|
256
|
+
function S(e) {
|
|
257
|
+
if (P(e))
|
|
258
|
+
return je(e) ? `${e}px` : String(e);
|
|
259
|
+
}
|
|
260
|
+
function Pt(e) {
|
|
261
|
+
if (P(e)) {
|
|
262
|
+
if (Array.isArray(e))
|
|
263
|
+
return {
|
|
264
|
+
width: S(e[0]),
|
|
265
|
+
height: S(e[1])
|
|
266
|
+
};
|
|
267
|
+
const t = S(e);
|
|
268
|
+
return {
|
|
269
|
+
width: t,
|
|
270
|
+
height: t
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
function $t(e) {
|
|
275
|
+
const t = {};
|
|
276
|
+
return e !== void 0 && (t.zIndex = +e), t;
|
|
277
|
+
}
|
|
278
|
+
const Dt = /-(\w)/g, Ue = (e) => e.replace(Dt, (t, n) => n.toUpperCase()), zt = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, ""), { hasOwnProperty: At } = Object.prototype;
|
|
279
|
+
function Ft(e, t, n) {
|
|
280
|
+
const o = t[n];
|
|
281
|
+
P(o) && (!At.call(e, n) || !ne(o) ? e[n] = o : e[n] = _e(Object(e[n]), o));
|
|
282
|
+
}
|
|
283
|
+
function _e(e, t) {
|
|
284
|
+
return Object.keys(t).forEach((n) => {
|
|
285
|
+
Ft(e, t, n);
|
|
286
|
+
}), e;
|
|
287
|
+
}
|
|
288
|
+
var Vt = {
|
|
289
|
+
name: "姓名",
|
|
290
|
+
tel: "电话",
|
|
291
|
+
save: "保存",
|
|
292
|
+
clear: "清空",
|
|
293
|
+
cancel: "取消",
|
|
294
|
+
confirm: "确认",
|
|
295
|
+
delete: "删除",
|
|
296
|
+
loading: "加载中...",
|
|
297
|
+
noCoupon: "暂无优惠券",
|
|
298
|
+
nameEmpty: "请填写姓名",
|
|
299
|
+
addContact: "添加联系人",
|
|
300
|
+
telInvalid: "请填写正确的电话",
|
|
301
|
+
vanCalendar: {
|
|
302
|
+
end: "结束",
|
|
303
|
+
start: "开始",
|
|
304
|
+
title: "日期选择",
|
|
305
|
+
weekdays: ["日", "一", "二", "三", "四", "五", "六"],
|
|
306
|
+
monthTitle: (e, t) => `${e}年${t}月`,
|
|
307
|
+
rangePrompt: (e) => `最多选择 ${e} 天`
|
|
308
|
+
},
|
|
309
|
+
vanCascader: {
|
|
310
|
+
select: "请选择"
|
|
311
|
+
},
|
|
312
|
+
vanPagination: {
|
|
313
|
+
prev: "上一页",
|
|
314
|
+
next: "下一页"
|
|
315
|
+
},
|
|
316
|
+
vanPullRefresh: {
|
|
317
|
+
pulling: "下拉即可刷新...",
|
|
318
|
+
loosing: "释放即可刷新..."
|
|
319
|
+
},
|
|
320
|
+
vanSubmitBar: {
|
|
321
|
+
label: "合计:"
|
|
322
|
+
},
|
|
323
|
+
vanCoupon: {
|
|
324
|
+
unlimited: "无门槛",
|
|
325
|
+
discount: (e) => `${e}折`,
|
|
326
|
+
condition: (e) => `满${e}元可用`
|
|
327
|
+
},
|
|
328
|
+
vanCouponCell: {
|
|
329
|
+
title: "优惠券",
|
|
330
|
+
count: (e) => `${e}张可用`
|
|
331
|
+
},
|
|
332
|
+
vanCouponList: {
|
|
333
|
+
exchange: "兑换",
|
|
334
|
+
close: "不使用",
|
|
335
|
+
enable: "可用",
|
|
336
|
+
disabled: "不可用",
|
|
337
|
+
placeholder: "输入优惠码"
|
|
338
|
+
},
|
|
339
|
+
vanAddressEdit: {
|
|
340
|
+
area: "地区",
|
|
341
|
+
areaEmpty: "请选择地区",
|
|
342
|
+
addressEmpty: "请填写详细地址",
|
|
343
|
+
addressDetail: "详细地址",
|
|
344
|
+
defaultAddress: "设为默认收货地址"
|
|
345
|
+
},
|
|
346
|
+
vanAddressList: {
|
|
347
|
+
add: "新增地址"
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
const Be = g("zh-CN"), Se = he({
|
|
351
|
+
"zh-CN": Vt
|
|
352
|
+
}), Lt = {
|
|
353
|
+
messages() {
|
|
354
|
+
return Se[Be.value];
|
|
355
|
+
},
|
|
356
|
+
use(e, t) {
|
|
357
|
+
Be.value = e, this.add({ [e]: t });
|
|
358
|
+
},
|
|
359
|
+
add(e = {}) {
|
|
360
|
+
_e(Se, e);
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
var Nt = Lt;
|
|
364
|
+
function Rt(e) {
|
|
365
|
+
const t = Ue(e) + ".";
|
|
366
|
+
return (n, ...o) => {
|
|
367
|
+
const l = Nt.messages(), s = xe(l, t + n) || xe(l, n);
|
|
368
|
+
return ue(s) ? s(...o) : s;
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
function re(e, t) {
|
|
372
|
+
return t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce(
|
|
373
|
+
(n, o) => n + re(e, o),
|
|
374
|
+
""
|
|
375
|
+
) : Object.keys(t).reduce(
|
|
376
|
+
(n, o) => n + (t[o] ? re(e, o) : ""),
|
|
377
|
+
""
|
|
378
|
+
) : "";
|
|
379
|
+
}
|
|
380
|
+
function jt(e) {
|
|
381
|
+
return (t, n) => (t && typeof t != "string" && (n = t, t = ""), t = t ? `${e}__${t}` : e, `${t}${re(t, n)}`);
|
|
382
|
+
}
|
|
383
|
+
function $(e) {
|
|
384
|
+
const t = `van-${e}`;
|
|
385
|
+
return [
|
|
386
|
+
t,
|
|
387
|
+
jt(t),
|
|
388
|
+
Rt(t)
|
|
389
|
+
];
|
|
390
|
+
}
|
|
391
|
+
const Ht = "van-haptics-feedback", ke = 5;
|
|
392
|
+
function Mt(e, {
|
|
393
|
+
args: t = [],
|
|
394
|
+
done: n,
|
|
395
|
+
canceled: o,
|
|
396
|
+
error: l
|
|
397
|
+
}) {
|
|
398
|
+
if (e) {
|
|
399
|
+
const s = e.apply(null, t);
|
|
400
|
+
Et(s) ? s.then((i) => {
|
|
401
|
+
i ? n() : o && o();
|
|
402
|
+
}).catch(l || pt) : s ? n() : o && o();
|
|
403
|
+
} else
|
|
404
|
+
n();
|
|
405
|
+
}
|
|
406
|
+
function A(e) {
|
|
407
|
+
return e.install = (t) => {
|
|
408
|
+
const { name: n } = e;
|
|
409
|
+
n && (t.component(n, e), t.component(Ue(`-${n}`), e));
|
|
410
|
+
}, e;
|
|
411
|
+
}
|
|
412
|
+
const Yt = Symbol();
|
|
413
|
+
function We(e) {
|
|
414
|
+
const t = ge();
|
|
415
|
+
t && I(t.proxy, e);
|
|
416
|
+
}
|
|
417
|
+
const [Ut, Oe] = $("badge"), _t = {
|
|
418
|
+
dot: Boolean,
|
|
419
|
+
max: p,
|
|
420
|
+
tag: E("div"),
|
|
421
|
+
color: String,
|
|
422
|
+
offset: Array,
|
|
423
|
+
content: p,
|
|
424
|
+
showZero: z,
|
|
425
|
+
position: E("top-right")
|
|
426
|
+
};
|
|
427
|
+
var Wt = x({
|
|
428
|
+
name: Ut,
|
|
429
|
+
props: _t,
|
|
430
|
+
setup(e, {
|
|
431
|
+
slots: t
|
|
432
|
+
}) {
|
|
433
|
+
const n = () => {
|
|
434
|
+
if (t.content)
|
|
435
|
+
return !0;
|
|
436
|
+
const {
|
|
437
|
+
content: a,
|
|
438
|
+
showZero: c
|
|
439
|
+
} = e;
|
|
440
|
+
return P(a) && a !== "" && (c || a !== 0 && a !== "0");
|
|
441
|
+
}, o = () => {
|
|
442
|
+
const {
|
|
443
|
+
dot: a,
|
|
444
|
+
max: c,
|
|
445
|
+
content: u
|
|
446
|
+
} = e;
|
|
447
|
+
if (!a && n())
|
|
448
|
+
return t.content ? t.content() : P(c) && je(u) && +u > +c ? `${c}+` : u;
|
|
449
|
+
}, l = (a) => a.startsWith("-") ? a.replace("-", "") : `-${a}`, s = R(() => {
|
|
450
|
+
const a = {
|
|
451
|
+
background: e.color
|
|
452
|
+
};
|
|
453
|
+
if (e.offset) {
|
|
454
|
+
const [c, u] = e.offset, {
|
|
455
|
+
position: v
|
|
456
|
+
} = e, [f, d] = v.split("-");
|
|
457
|
+
t.default ? (typeof u == "number" ? a[f] = S(f === "top" ? u : -u) : a[f] = f === "top" ? S(u) : l(u), typeof c == "number" ? a[d] = S(d === "left" ? c : -c) : a[d] = d === "left" ? S(c) : l(c)) : (a.marginTop = S(u), a.marginLeft = S(c));
|
|
458
|
+
}
|
|
459
|
+
return a;
|
|
460
|
+
}), i = () => {
|
|
461
|
+
if (n() || e.dot)
|
|
462
|
+
return m("div", {
|
|
463
|
+
class: Oe([e.position, {
|
|
464
|
+
dot: e.dot,
|
|
465
|
+
fixed: !!t.default
|
|
466
|
+
}]),
|
|
467
|
+
style: s.value
|
|
468
|
+
}, [o()]);
|
|
469
|
+
};
|
|
470
|
+
return () => {
|
|
471
|
+
if (t.default) {
|
|
472
|
+
const {
|
|
473
|
+
tag: a
|
|
474
|
+
} = e;
|
|
475
|
+
return m(a, {
|
|
476
|
+
class: Oe("wrapper")
|
|
477
|
+
}, {
|
|
478
|
+
default: () => [t.default(), i()]
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
return i();
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
const Kt = A(Wt);
|
|
486
|
+
let Ke = 2e3;
|
|
487
|
+
const Xt = () => ++Ke, Zt = (e) => {
|
|
488
|
+
Ke = e;
|
|
489
|
+
}, [Xe, Gt] = $("config-provider"), Ze = Symbol(Xe), qt = {
|
|
490
|
+
tag: E("div"),
|
|
491
|
+
theme: E("light"),
|
|
492
|
+
zIndex: Number,
|
|
493
|
+
themeVars: Object,
|
|
494
|
+
themeVarsDark: Object,
|
|
495
|
+
themeVarsLight: Object,
|
|
496
|
+
themeVarsScope: E("local"),
|
|
497
|
+
iconPrefix: String
|
|
498
|
+
};
|
|
499
|
+
function Jt(e) {
|
|
500
|
+
return e.replace(/([a-zA-Z])(\d)/g, "$1-$2");
|
|
501
|
+
}
|
|
502
|
+
function Qt(e) {
|
|
503
|
+
const t = {};
|
|
504
|
+
return Object.keys(e).forEach((n) => {
|
|
505
|
+
const o = Jt(zt(n));
|
|
506
|
+
t[`--van-${o}`] = e[n];
|
|
507
|
+
}), t;
|
|
508
|
+
}
|
|
509
|
+
function Z(e = {}, t = {}) {
|
|
510
|
+
Object.keys(e).forEach((n) => {
|
|
511
|
+
e[n] !== t[n] && document.documentElement.style.setProperty(n, e[n]);
|
|
512
|
+
}), Object.keys(t).forEach((n) => {
|
|
513
|
+
e[n] || document.documentElement.style.removeProperty(n);
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
x({
|
|
517
|
+
name: Xe,
|
|
518
|
+
props: qt,
|
|
519
|
+
setup(e, {
|
|
520
|
+
slots: t
|
|
521
|
+
}) {
|
|
522
|
+
const n = R(() => Qt(I({}, e.themeVars, e.theme === "dark" ? e.themeVarsDark : e.themeVarsLight)));
|
|
523
|
+
if (ye) {
|
|
524
|
+
const o = () => {
|
|
525
|
+
document.documentElement.classList.add(`van-theme-${e.theme}`);
|
|
526
|
+
}, l = (s = e.theme) => {
|
|
527
|
+
document.documentElement.classList.remove(`van-theme-${s}`);
|
|
528
|
+
};
|
|
529
|
+
k(() => e.theme, (s, i) => {
|
|
530
|
+
i && l(i), o();
|
|
531
|
+
}, {
|
|
532
|
+
immediate: !0
|
|
533
|
+
}), ve(o), Q(l), Ae(l), k(n, (s, i) => {
|
|
534
|
+
e.themeVarsScope === "global" && Z(s, i);
|
|
535
|
+
}), k(() => e.themeVarsScope, (s, i) => {
|
|
536
|
+
i === "global" && Z({}, n.value), s === "global" && Z(n.value, {});
|
|
537
|
+
}), e.themeVarsScope === "global" && Z(n.value, {});
|
|
538
|
+
}
|
|
539
|
+
return Fe(Ze, e), lt(() => {
|
|
540
|
+
e.zIndex !== void 0 && Zt(e.zIndex);
|
|
541
|
+
}), () => m(e.tag, {
|
|
542
|
+
class: Gt(),
|
|
543
|
+
style: e.themeVarsScope === "local" ? n.value : void 0
|
|
544
|
+
}, {
|
|
545
|
+
default: () => {
|
|
546
|
+
var o;
|
|
547
|
+
return [(o = t.default) == null ? void 0 : o.call(t)];
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
const [en, Ie] = $("icon"), tn = (e) => e?.includes("/"), nn = {
|
|
553
|
+
dot: Boolean,
|
|
554
|
+
tag: E("i"),
|
|
555
|
+
name: String,
|
|
556
|
+
size: p,
|
|
557
|
+
badge: p,
|
|
558
|
+
color: String,
|
|
559
|
+
badgeProps: Object,
|
|
560
|
+
classPrefix: String
|
|
561
|
+
};
|
|
562
|
+
var on = x({
|
|
563
|
+
name: en,
|
|
564
|
+
props: nn,
|
|
565
|
+
setup(e, {
|
|
566
|
+
slots: t
|
|
567
|
+
}) {
|
|
568
|
+
const n = ct(Ze, null), o = R(() => e.classPrefix || n?.iconPrefix || Ie());
|
|
569
|
+
return () => {
|
|
570
|
+
const {
|
|
571
|
+
tag: l,
|
|
572
|
+
dot: s,
|
|
573
|
+
name: i,
|
|
574
|
+
size: a,
|
|
575
|
+
badge: c,
|
|
576
|
+
color: u
|
|
577
|
+
} = e, v = tn(i);
|
|
578
|
+
return m(Kt, N({
|
|
579
|
+
dot: s,
|
|
580
|
+
tag: l,
|
|
581
|
+
class: [o.value, v ? "" : `${o.value}-${i}`],
|
|
582
|
+
style: {
|
|
583
|
+
color: u,
|
|
584
|
+
fontSize: S(a)
|
|
585
|
+
},
|
|
586
|
+
content: c
|
|
587
|
+
}, e.badgeProps), {
|
|
588
|
+
default: () => {
|
|
589
|
+
var f;
|
|
590
|
+
return [(f = t.default) == null ? void 0 : f.call(t), v && m("img", {
|
|
591
|
+
class: Ie("image"),
|
|
592
|
+
src: i
|
|
593
|
+
}, null)];
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
const Ge = A(on), [an, Y] = $("loading"), sn = Array(12).fill(null).map((e, t) => m("i", {
|
|
600
|
+
class: Y("line", String(t + 1))
|
|
601
|
+
}, null)), ln = m("svg", {
|
|
602
|
+
class: Y("circular"),
|
|
603
|
+
viewBox: "25 25 50 50"
|
|
604
|
+
}, [m("circle", {
|
|
605
|
+
cx: "50",
|
|
606
|
+
cy: "50",
|
|
607
|
+
r: "20",
|
|
608
|
+
fill: "none"
|
|
609
|
+
}, null)]), cn = {
|
|
610
|
+
size: p,
|
|
611
|
+
type: E("circular"),
|
|
612
|
+
color: String,
|
|
613
|
+
vertical: Boolean,
|
|
614
|
+
textSize: p,
|
|
615
|
+
textColor: String
|
|
616
|
+
};
|
|
617
|
+
var un = x({
|
|
618
|
+
name: an,
|
|
619
|
+
props: cn,
|
|
620
|
+
setup(e, {
|
|
621
|
+
slots: t
|
|
622
|
+
}) {
|
|
623
|
+
const n = R(() => I({
|
|
624
|
+
color: e.color
|
|
625
|
+
}, Pt(e.size))), o = () => {
|
|
626
|
+
const s = e.type === "spinner" ? sn : ln;
|
|
627
|
+
return m("span", {
|
|
628
|
+
class: Y("spinner", e.type),
|
|
629
|
+
style: n.value
|
|
630
|
+
}, [t.icon ? t.icon() : s]);
|
|
631
|
+
}, l = () => {
|
|
632
|
+
var s;
|
|
633
|
+
if (t.default)
|
|
634
|
+
return m("span", {
|
|
635
|
+
class: Y("text"),
|
|
636
|
+
style: {
|
|
637
|
+
fontSize: S(e.textSize),
|
|
638
|
+
color: (s = e.textColor) != null ? s : e.color
|
|
639
|
+
}
|
|
640
|
+
}, [t.default()]);
|
|
641
|
+
};
|
|
642
|
+
return () => {
|
|
643
|
+
const {
|
|
644
|
+
type: s,
|
|
645
|
+
vertical: i
|
|
646
|
+
} = e;
|
|
647
|
+
return m("div", {
|
|
648
|
+
class: Y([s, {
|
|
649
|
+
vertical: i
|
|
650
|
+
}]),
|
|
651
|
+
"aria-live": "polite",
|
|
652
|
+
"aria-busy": !0
|
|
653
|
+
}, [o(), l()]);
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
const qe = A(un), rn = {
|
|
658
|
+
// whether to show popup
|
|
659
|
+
show: Boolean,
|
|
660
|
+
// z-index
|
|
661
|
+
zIndex: p,
|
|
662
|
+
// whether to show overlay
|
|
663
|
+
overlay: z,
|
|
664
|
+
// transition duration
|
|
665
|
+
duration: p,
|
|
666
|
+
// teleport
|
|
667
|
+
teleport: [String, Object],
|
|
668
|
+
// prevent body scroll
|
|
669
|
+
lockScroll: z,
|
|
670
|
+
// whether to lazy render
|
|
671
|
+
lazyRender: z,
|
|
672
|
+
// callback function before close
|
|
673
|
+
beforeClose: Function,
|
|
674
|
+
// overlay props
|
|
675
|
+
overlayProps: Object,
|
|
676
|
+
// overlay custom style
|
|
677
|
+
overlayStyle: Object,
|
|
678
|
+
// overlay custom class name
|
|
679
|
+
overlayClass: J,
|
|
680
|
+
// Initial rendering animation
|
|
681
|
+
transitionAppear: Boolean,
|
|
682
|
+
// whether to close popup when overlay is clicked
|
|
683
|
+
closeOnClickOverlay: z
|
|
684
|
+
};
|
|
685
|
+
function dn(e, t) {
|
|
686
|
+
return e > t ? "horizontal" : t > e ? "vertical" : "";
|
|
687
|
+
}
|
|
688
|
+
function Je() {
|
|
689
|
+
const e = g(0), t = g(0), n = g(0), o = g(0), l = g(0), s = g(0), i = g(""), a = g(!0), c = () => i.value === "vertical", u = () => i.value === "horizontal", v = () => {
|
|
690
|
+
n.value = 0, o.value = 0, l.value = 0, s.value = 0, i.value = "", a.value = !0;
|
|
691
|
+
};
|
|
692
|
+
return {
|
|
693
|
+
move: (b) => {
|
|
694
|
+
const C = b.touches[0];
|
|
695
|
+
n.value = (C.clientX < 0 ? 0 : C.clientX) - e.value, o.value = C.clientY - t.value, l.value = Math.abs(n.value), s.value = Math.abs(o.value);
|
|
696
|
+
const B = 10;
|
|
697
|
+
(!i.value || l.value < B && s.value < B) && (i.value = dn(l.value, s.value)), a.value && (l.value > ke || s.value > ke) && (a.value = !1);
|
|
698
|
+
},
|
|
699
|
+
start: (b) => {
|
|
700
|
+
v(), e.value = b.touches[0].clientX, t.value = b.touches[0].clientY;
|
|
701
|
+
},
|
|
702
|
+
reset: v,
|
|
703
|
+
startX: e,
|
|
704
|
+
startY: t,
|
|
705
|
+
deltaX: n,
|
|
706
|
+
deltaY: o,
|
|
707
|
+
offsetX: l,
|
|
708
|
+
offsetY: s,
|
|
709
|
+
direction: i,
|
|
710
|
+
isVertical: c,
|
|
711
|
+
isHorizontal: u,
|
|
712
|
+
isTap: a
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
let j = 0;
|
|
716
|
+
const Te = "van-overflow-hidden";
|
|
717
|
+
function fn(e, t) {
|
|
718
|
+
const n = Je(), o = "01", l = "10", s = (v) => {
|
|
719
|
+
n.move(v);
|
|
720
|
+
const f = n.deltaY.value > 0 ? l : o, d = Ye(
|
|
721
|
+
v.target,
|
|
722
|
+
e.value
|
|
723
|
+
), { scrollHeight: b, offsetHeight: C, scrollTop: B } = d;
|
|
724
|
+
let w = "11";
|
|
725
|
+
B === 0 ? w = C >= b ? "00" : "01" : B + C >= b && (w = "10"), w !== "11" && n.isVertical() && !(parseInt(w, 2) & parseInt(f, 2)) && Ee(v, !0);
|
|
726
|
+
}, i = () => {
|
|
727
|
+
document.addEventListener("touchstart", n.start), document.addEventListener("touchmove", s, { passive: !1 }), j || document.body.classList.add(Te), j++;
|
|
728
|
+
}, a = () => {
|
|
729
|
+
j && (document.removeEventListener("touchstart", n.start), document.removeEventListener("touchmove", s), j--, j || document.body.classList.remove(Te));
|
|
730
|
+
}, c = () => t() && i(), u = () => t() && a();
|
|
731
|
+
He(c), Q(u), Ae(u), k(t, (v) => {
|
|
732
|
+
v ? i() : a();
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
function Qe(e) {
|
|
736
|
+
const t = g(!1);
|
|
737
|
+
return k(
|
|
738
|
+
e,
|
|
739
|
+
(n) => {
|
|
740
|
+
n && (t.value = n);
|
|
741
|
+
},
|
|
742
|
+
{ immediate: !0 }
|
|
743
|
+
), (n) => () => t.value ? n() : null;
|
|
744
|
+
}
|
|
745
|
+
const Pe = () => {
|
|
746
|
+
var e;
|
|
747
|
+
const { scopeId: t } = ((e = ge()) == null ? void 0 : e.vnode) || {};
|
|
748
|
+
return t ? { [t]: "" } : null;
|
|
749
|
+
}, [mn, vn] = $("overlay"), hn = {
|
|
750
|
+
show: Boolean,
|
|
751
|
+
zIndex: p,
|
|
752
|
+
duration: p,
|
|
753
|
+
className: J,
|
|
754
|
+
lockScroll: z,
|
|
755
|
+
lazyRender: z,
|
|
756
|
+
customStyle: Object,
|
|
757
|
+
teleport: [String, Object]
|
|
758
|
+
};
|
|
759
|
+
var gn = x({
|
|
760
|
+
name: mn,
|
|
761
|
+
inheritAttrs: !1,
|
|
762
|
+
props: hn,
|
|
763
|
+
setup(e, {
|
|
764
|
+
attrs: t,
|
|
765
|
+
slots: n
|
|
766
|
+
}) {
|
|
767
|
+
const o = g(), l = Qe(() => e.show || !e.lazyRender), s = (a) => {
|
|
768
|
+
e.lockScroll && Ee(a, !0);
|
|
769
|
+
}, i = l(() => {
|
|
770
|
+
var a;
|
|
771
|
+
const c = I($t(e.zIndex), e.customStyle);
|
|
772
|
+
return P(e.duration) && (c.animationDuration = `${e.duration}s`), Ne(m("div", N({
|
|
773
|
+
ref: o,
|
|
774
|
+
style: c,
|
|
775
|
+
class: [vn(), e.className]
|
|
776
|
+
}, t), [(a = n.default) == null ? void 0 : a.call(n)]), [[Re, e.show]]);
|
|
777
|
+
});
|
|
778
|
+
return pe("touchmove", s, {
|
|
779
|
+
target: o
|
|
780
|
+
}), () => {
|
|
781
|
+
const a = m(Ve, {
|
|
782
|
+
name: "van-fade",
|
|
783
|
+
appear: !0
|
|
784
|
+
}, {
|
|
785
|
+
default: i
|
|
786
|
+
});
|
|
787
|
+
return e.teleport ? m(Le, {
|
|
788
|
+
to: e.teleport
|
|
789
|
+
}, {
|
|
790
|
+
default: () => [a]
|
|
791
|
+
}) : a;
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
const yn = A(gn), bn = I({}, rn, {
|
|
796
|
+
round: Boolean,
|
|
797
|
+
position: E("center"),
|
|
798
|
+
closeIcon: E("cross"),
|
|
799
|
+
closeable: Boolean,
|
|
800
|
+
transition: String,
|
|
801
|
+
iconPrefix: String,
|
|
802
|
+
closeOnPopstate: Boolean,
|
|
803
|
+
closeIconPosition: E("top-right"),
|
|
804
|
+
destroyOnClose: Boolean,
|
|
805
|
+
safeAreaInsetTop: Boolean,
|
|
806
|
+
safeAreaInsetBottom: Boolean
|
|
807
|
+
}), [pn, $e] = $("popup");
|
|
808
|
+
var En = x({
|
|
809
|
+
name: pn,
|
|
810
|
+
inheritAttrs: !1,
|
|
811
|
+
props: bn,
|
|
812
|
+
emits: ["open", "close", "opened", "closed", "keydown", "update:show", "clickOverlay", "clickCloseIcon"],
|
|
813
|
+
setup(e, {
|
|
814
|
+
emit: t,
|
|
815
|
+
attrs: n,
|
|
816
|
+
slots: o
|
|
817
|
+
}) {
|
|
818
|
+
let l, s;
|
|
819
|
+
const i = g(), a = g(), c = Qe(() => e.show || !e.lazyRender), u = R(() => {
|
|
820
|
+
const h = {
|
|
821
|
+
zIndex: i.value
|
|
822
|
+
};
|
|
823
|
+
if (P(e.duration)) {
|
|
824
|
+
const T = e.position === "center" ? "animationDuration" : "transitionDuration";
|
|
825
|
+
h[T] = `${e.duration}s`;
|
|
826
|
+
}
|
|
827
|
+
return h;
|
|
828
|
+
}), v = () => {
|
|
829
|
+
l || (l = !0, i.value = e.zIndex !== void 0 ? +e.zIndex : Xt(), t("open"));
|
|
830
|
+
}, f = () => {
|
|
831
|
+
l && Mt(e.beforeClose, {
|
|
832
|
+
done() {
|
|
833
|
+
l = !1, t("close"), t("update:show", !1);
|
|
834
|
+
}
|
|
835
|
+
});
|
|
836
|
+
}, d = (h) => {
|
|
837
|
+
t("clickOverlay", h), e.closeOnClickOverlay && f();
|
|
838
|
+
}, b = () => {
|
|
839
|
+
if (e.overlay) {
|
|
840
|
+
const h = I({
|
|
841
|
+
show: e.show,
|
|
842
|
+
class: e.overlayClass,
|
|
843
|
+
zIndex: i.value,
|
|
844
|
+
duration: e.duration,
|
|
845
|
+
customStyle: e.overlayStyle,
|
|
846
|
+
role: e.closeOnClickOverlay ? "button" : void 0,
|
|
847
|
+
tabindex: e.closeOnClickOverlay ? 0 : void 0
|
|
848
|
+
}, e.overlayProps);
|
|
849
|
+
return m(yn, N(h, Pe(), {
|
|
850
|
+
onClick: d
|
|
851
|
+
}), {
|
|
852
|
+
default: o["overlay-content"]
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
}, C = (h) => {
|
|
856
|
+
t("clickCloseIcon", h), f();
|
|
857
|
+
}, B = () => {
|
|
858
|
+
if (e.closeable)
|
|
859
|
+
return m(Ge, {
|
|
860
|
+
role: "button",
|
|
861
|
+
tabindex: 0,
|
|
862
|
+
name: e.closeIcon,
|
|
863
|
+
class: [$e("close-icon", e.closeIconPosition), Ht],
|
|
864
|
+
classPrefix: e.iconPrefix,
|
|
865
|
+
onClick: C
|
|
866
|
+
}, null);
|
|
867
|
+
};
|
|
868
|
+
let w;
|
|
869
|
+
const oe = () => {
|
|
870
|
+
w && clearTimeout(w), w = setTimeout(() => {
|
|
871
|
+
t("opened");
|
|
872
|
+
});
|
|
873
|
+
}, ae = () => t("closed"), _ = (h) => t("keydown", h), r = c(() => {
|
|
874
|
+
var h;
|
|
875
|
+
const {
|
|
876
|
+
destroyOnClose: T,
|
|
877
|
+
round: se,
|
|
878
|
+
position: W,
|
|
879
|
+
safeAreaInsetTop: nt,
|
|
880
|
+
safeAreaInsetBottom: ot,
|
|
881
|
+
show: Ce
|
|
882
|
+
} = e;
|
|
883
|
+
if (!(!Ce && T))
|
|
884
|
+
return Ne(m("div", N({
|
|
885
|
+
ref: a,
|
|
886
|
+
style: u.value,
|
|
887
|
+
role: "dialog",
|
|
888
|
+
tabindex: 0,
|
|
889
|
+
class: [$e({
|
|
890
|
+
round: se,
|
|
891
|
+
[W]: W
|
|
892
|
+
}), {
|
|
893
|
+
"van-safe-area-top": nt,
|
|
894
|
+
"van-safe-area-bottom": ot
|
|
895
|
+
}],
|
|
896
|
+
onKeydown: _
|
|
897
|
+
}, n, Pe()), [(h = o.default) == null ? void 0 : h.call(o), B()]), [[Re, Ce]]);
|
|
898
|
+
}), y = () => {
|
|
899
|
+
const {
|
|
900
|
+
position: h,
|
|
901
|
+
transition: T,
|
|
902
|
+
transitionAppear: se
|
|
903
|
+
} = e, W = h === "center" ? "van-fade" : `van-popup-slide-${h}`;
|
|
904
|
+
return m(Ve, {
|
|
905
|
+
name: T || W,
|
|
906
|
+
appear: se,
|
|
907
|
+
onAfterEnter: oe,
|
|
908
|
+
onAfterLeave: ae
|
|
909
|
+
}, {
|
|
910
|
+
default: r
|
|
911
|
+
});
|
|
912
|
+
};
|
|
913
|
+
return k(() => e.show, (h) => {
|
|
914
|
+
h && !l && (v(), n.tabindex === 0 && me(() => {
|
|
915
|
+
var T;
|
|
916
|
+
(T = a.value) == null || T.focus();
|
|
917
|
+
})), !h && l && (l = !1, t("close"));
|
|
918
|
+
}), We({
|
|
919
|
+
popupRef: a
|
|
920
|
+
}), fn(a, () => e.show && e.lockScroll), pe("popstate", () => {
|
|
921
|
+
e.closeOnPopstate && (f(), s = !1);
|
|
922
|
+
}), ee(() => {
|
|
923
|
+
e.show && v();
|
|
924
|
+
}), ve(() => {
|
|
925
|
+
s && (t("update:show", !0), s = !1);
|
|
926
|
+
}), Q(() => {
|
|
927
|
+
e.show && e.teleport && (f(), s = !0);
|
|
928
|
+
}), Fe(Yt, () => e.show), () => e.teleport ? m(Le, {
|
|
929
|
+
to: e.teleport
|
|
930
|
+
}, {
|
|
931
|
+
default: () => [b(), y()]
|
|
932
|
+
}) : m(it, null, [b(), y()]);
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
const Cn = A(En);
|
|
936
|
+
let H = 0;
|
|
937
|
+
function wn(e) {
|
|
938
|
+
e ? (H || document.body.classList.add("van-toast--unclickable"), H++) : H && (H--, H || document.body.classList.remove("van-toast--unclickable"));
|
|
939
|
+
}
|
|
940
|
+
const [xn, F] = $("toast"), Bn = ["show", "overlay", "teleport", "transition", "overlayClass", "overlayStyle", "closeOnClickOverlay", "zIndex"], Sn = {
|
|
941
|
+
icon: String,
|
|
942
|
+
show: Boolean,
|
|
943
|
+
type: E("text"),
|
|
944
|
+
overlay: Boolean,
|
|
945
|
+
message: p,
|
|
946
|
+
iconSize: p,
|
|
947
|
+
duration: xt(2e3),
|
|
948
|
+
position: E("middle"),
|
|
949
|
+
teleport: [String, Object],
|
|
950
|
+
wordBreak: String,
|
|
951
|
+
className: J,
|
|
952
|
+
iconPrefix: String,
|
|
953
|
+
transition: E("van-fade"),
|
|
954
|
+
loadingType: String,
|
|
955
|
+
forbidClick: Boolean,
|
|
956
|
+
overlayClass: J,
|
|
957
|
+
overlayStyle: Object,
|
|
958
|
+
closeOnClick: Boolean,
|
|
959
|
+
closeOnClickOverlay: Boolean,
|
|
960
|
+
zIndex: p
|
|
961
|
+
};
|
|
962
|
+
var et = x({
|
|
963
|
+
name: xn,
|
|
964
|
+
props: Sn,
|
|
965
|
+
emits: ["update:show"],
|
|
966
|
+
setup(e, {
|
|
967
|
+
emit: t,
|
|
968
|
+
slots: n
|
|
969
|
+
}) {
|
|
970
|
+
let o, l = !1;
|
|
971
|
+
const s = () => {
|
|
972
|
+
const f = e.show && e.forbidClick;
|
|
973
|
+
l !== f && (l = f, wn(l));
|
|
974
|
+
}, i = (f) => t("update:show", f), a = () => {
|
|
975
|
+
e.closeOnClick && i(!1);
|
|
976
|
+
}, c = () => clearTimeout(o), u = () => {
|
|
977
|
+
const {
|
|
978
|
+
icon: f,
|
|
979
|
+
type: d,
|
|
980
|
+
iconSize: b,
|
|
981
|
+
iconPrefix: C,
|
|
982
|
+
loadingType: B
|
|
983
|
+
} = e;
|
|
984
|
+
if (f || d === "success" || d === "fail")
|
|
985
|
+
return m(Ge, {
|
|
986
|
+
name: f || d,
|
|
987
|
+
size: b,
|
|
988
|
+
class: F("icon"),
|
|
989
|
+
classPrefix: C
|
|
990
|
+
}, null);
|
|
991
|
+
if (d === "loading")
|
|
992
|
+
return m(qe, {
|
|
993
|
+
class: F("loading"),
|
|
994
|
+
size: b,
|
|
995
|
+
type: B
|
|
996
|
+
}, null);
|
|
997
|
+
}, v = () => {
|
|
998
|
+
const {
|
|
999
|
+
type: f,
|
|
1000
|
+
message: d
|
|
1001
|
+
} = e;
|
|
1002
|
+
if (n.message)
|
|
1003
|
+
return m("div", {
|
|
1004
|
+
class: F("text")
|
|
1005
|
+
}, [n.message()]);
|
|
1006
|
+
if (P(d) && d !== "")
|
|
1007
|
+
return f === "html" ? m("div", {
|
|
1008
|
+
key: 0,
|
|
1009
|
+
class: F("text"),
|
|
1010
|
+
innerHTML: String(d)
|
|
1011
|
+
}, null) : m("div", {
|
|
1012
|
+
class: F("text")
|
|
1013
|
+
}, [d]);
|
|
1014
|
+
};
|
|
1015
|
+
return k(() => [e.show, e.forbidClick], s), k(() => [e.show, e.type, e.message, e.duration], () => {
|
|
1016
|
+
c(), e.show && e.duration > 0 && (o = setTimeout(() => {
|
|
1017
|
+
i(!1);
|
|
1018
|
+
}, e.duration));
|
|
1019
|
+
}), ee(s), ze(s), () => m(Cn, N({
|
|
1020
|
+
class: [F([e.position, e.wordBreak === "normal" ? "break-normal" : e.wordBreak, {
|
|
1021
|
+
[e.type]: !e.icon
|
|
1022
|
+
}]), e.className],
|
|
1023
|
+
lockScroll: !1,
|
|
1024
|
+
onClick: a,
|
|
1025
|
+
onClosed: c,
|
|
1026
|
+
"onUpdate:show": i
|
|
1027
|
+
}, wt(e, Bn)), {
|
|
1028
|
+
default: () => [u(), v()]
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
function kn() {
|
|
1033
|
+
const e = he({
|
|
1034
|
+
show: !1
|
|
1035
|
+
}), t = (l) => {
|
|
1036
|
+
e.show = l;
|
|
1037
|
+
}, n = (l) => {
|
|
1038
|
+
I(e, l, { transitionAppear: !0 }), t(!0);
|
|
1039
|
+
}, o = () => t(!1);
|
|
1040
|
+
return We({ open: n, close: o, toggle: t }), {
|
|
1041
|
+
open: n,
|
|
1042
|
+
close: o,
|
|
1043
|
+
state: e,
|
|
1044
|
+
toggle: t
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
function On(e) {
|
|
1048
|
+
const t = ut(e), n = document.createElement("div");
|
|
1049
|
+
return document.body.appendChild(n), {
|
|
1050
|
+
instance: t.mount(n),
|
|
1051
|
+
unmount() {
|
|
1052
|
+
t.unmount(), document.body.removeChild(n);
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
const In = {
|
|
1057
|
+
icon: "",
|
|
1058
|
+
type: "text",
|
|
1059
|
+
message: "",
|
|
1060
|
+
className: "",
|
|
1061
|
+
overlay: !1,
|
|
1062
|
+
onClose: void 0,
|
|
1063
|
+
onOpened: void 0,
|
|
1064
|
+
duration: 2e3,
|
|
1065
|
+
teleport: "body",
|
|
1066
|
+
iconSize: void 0,
|
|
1067
|
+
iconPrefix: void 0,
|
|
1068
|
+
position: "middle",
|
|
1069
|
+
transition: "van-fade",
|
|
1070
|
+
forbidClick: !1,
|
|
1071
|
+
loadingType: void 0,
|
|
1072
|
+
overlayClass: "",
|
|
1073
|
+
overlayStyle: void 0,
|
|
1074
|
+
closeOnClick: !1,
|
|
1075
|
+
closeOnClickOverlay: !1
|
|
1076
|
+
};
|
|
1077
|
+
let G = [], Tn = !1, De = I({}, In);
|
|
1078
|
+
const Pn = /* @__PURE__ */ new Map();
|
|
1079
|
+
function $n(e) {
|
|
1080
|
+
return ne(e) ? e : {
|
|
1081
|
+
message: e
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
function Dn() {
|
|
1085
|
+
const {
|
|
1086
|
+
instance: e
|
|
1087
|
+
} = On({
|
|
1088
|
+
setup() {
|
|
1089
|
+
const t = g(""), {
|
|
1090
|
+
open: n,
|
|
1091
|
+
state: o,
|
|
1092
|
+
close: l,
|
|
1093
|
+
toggle: s
|
|
1094
|
+
} = kn(), i = () => {
|
|
1095
|
+
}, a = () => m(et, N(o, {
|
|
1096
|
+
onClosed: i,
|
|
1097
|
+
"onUpdate:show": s
|
|
1098
|
+
}), null);
|
|
1099
|
+
return k(t, (c) => {
|
|
1100
|
+
o.message = c;
|
|
1101
|
+
}), ge().render = a, {
|
|
1102
|
+
open: n,
|
|
1103
|
+
close: l,
|
|
1104
|
+
message: t
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
});
|
|
1108
|
+
return e;
|
|
1109
|
+
}
|
|
1110
|
+
function zn() {
|
|
1111
|
+
if (!G.length || Tn) {
|
|
1112
|
+
const e = Dn();
|
|
1113
|
+
G.push(e);
|
|
1114
|
+
}
|
|
1115
|
+
return G[G.length - 1];
|
|
1116
|
+
}
|
|
1117
|
+
function An(e = {}) {
|
|
1118
|
+
if (!ye)
|
|
1119
|
+
return {};
|
|
1120
|
+
const t = zn(), n = $n(e);
|
|
1121
|
+
return t.open(I({}, De, Pn.get(n.type || De.type), n)), t;
|
|
1122
|
+
}
|
|
1123
|
+
A(et);
|
|
1124
|
+
const [Fn, M, Vn] = $("pull-refresh"), tt = 50, Ln = ["pulling", "loosing", "success"], Nn = {
|
|
1125
|
+
disabled: Boolean,
|
|
1126
|
+
modelValue: Boolean,
|
|
1127
|
+
headHeight: ce(tt),
|
|
1128
|
+
successText: String,
|
|
1129
|
+
pullingText: String,
|
|
1130
|
+
loosingText: String,
|
|
1131
|
+
loadingText: String,
|
|
1132
|
+
pullDistance: p,
|
|
1133
|
+
successDuration: ce(500),
|
|
1134
|
+
animationDuration: ce(300)
|
|
1135
|
+
};
|
|
1136
|
+
var Rn = x({
|
|
1137
|
+
name: Fn,
|
|
1138
|
+
props: Nn,
|
|
1139
|
+
emits: ["change", "refresh", "update:modelValue"],
|
|
1140
|
+
setup(e, {
|
|
1141
|
+
emit: t,
|
|
1142
|
+
slots: n
|
|
1143
|
+
}) {
|
|
1144
|
+
let o;
|
|
1145
|
+
const l = g(), s = g(), i = Ot(l), a = he({
|
|
1146
|
+
status: "normal",
|
|
1147
|
+
distance: 0,
|
|
1148
|
+
duration: 0
|
|
1149
|
+
}), c = Je(), u = () => {
|
|
1150
|
+
if (e.headHeight !== tt)
|
|
1151
|
+
return {
|
|
1152
|
+
height: `${e.headHeight}px`
|
|
1153
|
+
};
|
|
1154
|
+
}, v = () => a.status !== "loading" && a.status !== "success" && !e.disabled, f = (r) => {
|
|
1155
|
+
const y = +(e.pullDistance || e.headHeight);
|
|
1156
|
+
return r > y && (r < y * 2 ? r = y + (r - y) / 2 : r = y * 1.5 + (r - y * 2) / 4), Math.round(r);
|
|
1157
|
+
}, d = (r, y) => {
|
|
1158
|
+
const h = +(e.pullDistance || e.headHeight);
|
|
1159
|
+
a.distance = r, y ? a.status = "loading" : r === 0 ? a.status = "normal" : r < h ? a.status = "pulling" : a.status = "loosing", t("change", {
|
|
1160
|
+
status: a.status,
|
|
1161
|
+
distance: r
|
|
1162
|
+
});
|
|
1163
|
+
}, b = () => {
|
|
1164
|
+
const {
|
|
1165
|
+
status: r
|
|
1166
|
+
} = a;
|
|
1167
|
+
return r === "normal" ? "" : e[`${r}Text`] || Vn(r);
|
|
1168
|
+
}, C = () => {
|
|
1169
|
+
const {
|
|
1170
|
+
status: r,
|
|
1171
|
+
distance: y
|
|
1172
|
+
} = a;
|
|
1173
|
+
if (n[r])
|
|
1174
|
+
return n[r]({
|
|
1175
|
+
distance: y
|
|
1176
|
+
});
|
|
1177
|
+
const h = [];
|
|
1178
|
+
return Ln.includes(r) && h.push(m("div", {
|
|
1179
|
+
class: M("text")
|
|
1180
|
+
}, [b()])), r === "loading" && h.push(m(qe, {
|
|
1181
|
+
class: M("loading")
|
|
1182
|
+
}, {
|
|
1183
|
+
default: b
|
|
1184
|
+
})), h;
|
|
1185
|
+
}, B = () => {
|
|
1186
|
+
a.status = "success", setTimeout(() => {
|
|
1187
|
+
d(0);
|
|
1188
|
+
}, +e.successDuration);
|
|
1189
|
+
}, w = (r) => {
|
|
1190
|
+
o = It(i.value) === 0, o && (a.duration = 0, c.start(r));
|
|
1191
|
+
}, oe = (r) => {
|
|
1192
|
+
v() && w(r);
|
|
1193
|
+
}, ae = (r) => {
|
|
1194
|
+
if (v()) {
|
|
1195
|
+
o || w(r);
|
|
1196
|
+
const {
|
|
1197
|
+
deltaY: y
|
|
1198
|
+
} = c;
|
|
1199
|
+
c.move(r), o && y.value >= 0 && c.isVertical() && (Ee(r), d(f(y.value)));
|
|
1200
|
+
}
|
|
1201
|
+
}, _ = () => {
|
|
1202
|
+
o && c.deltaY.value && v() && (a.duration = +e.animationDuration, a.status === "loosing" ? (d(+e.headHeight, !0), t("update:modelValue", !0), me(() => t("refresh"))) : d(0));
|
|
1203
|
+
};
|
|
1204
|
+
return k(() => e.modelValue, (r) => {
|
|
1205
|
+
a.duration = +e.animationDuration, r ? d(+e.headHeight, !0) : n.success || e.successText ? B() : d(0, !1);
|
|
1206
|
+
}), pe("touchmove", ae, {
|
|
1207
|
+
target: s
|
|
1208
|
+
}), () => {
|
|
1209
|
+
var r;
|
|
1210
|
+
const y = {
|
|
1211
|
+
transitionDuration: `${a.duration}ms`,
|
|
1212
|
+
transform: a.distance ? `translate3d(0,${a.distance}px, 0)` : ""
|
|
1213
|
+
};
|
|
1214
|
+
return m("div", {
|
|
1215
|
+
ref: l,
|
|
1216
|
+
class: M()
|
|
1217
|
+
}, [m("div", {
|
|
1218
|
+
ref: s,
|
|
1219
|
+
class: M("track"),
|
|
1220
|
+
style: y,
|
|
1221
|
+
onTouchstartPassive: oe,
|
|
1222
|
+
onTouchend: _,
|
|
1223
|
+
onTouchcancel: _
|
|
1224
|
+
}, [m("div", {
|
|
1225
|
+
class: M("head"),
|
|
1226
|
+
style: u()
|
|
1227
|
+
}, [C()]), (r = n.default) == null ? void 0 : r.call(n)])]);
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
});
|
|
1231
|
+
const jn = A(Rn), Hn = {
|
|
1232
|
+
key: 0,
|
|
1233
|
+
class: "mx-app-page-header"
|
|
1234
|
+
}, Mn = {
|
|
1235
|
+
key: 0,
|
|
1236
|
+
class: "mx-app-page-header-left"
|
|
1237
|
+
}, Yn = { class: "mx-app-page-header-center" }, Un = { class: "mx-app-page-title" }, _n = { class: "mx-app-page-header-right" }, Wn = {
|
|
1238
|
+
key: 1,
|
|
1239
|
+
class: "mx-app-page-search"
|
|
1240
|
+
}, Kn = { class: "search-content" }, Xn = /* @__PURE__ */ x({
|
|
1241
|
+
__name: "index",
|
|
1242
|
+
props: {
|
|
1243
|
+
title: { default: "" },
|
|
1244
|
+
showBack: { type: Boolean, default: !0 },
|
|
1245
|
+
showHeader: { type: Boolean, default: !0 },
|
|
1246
|
+
enablePullRefresh: { type: Boolean, default: !1 },
|
|
1247
|
+
refreshing: { type: Boolean, default: !1 },
|
|
1248
|
+
showSearch: { type: Boolean, default: !0 },
|
|
1249
|
+
onRefresh: {},
|
|
1250
|
+
onBack: {},
|
|
1251
|
+
id: {},
|
|
1252
|
+
class: {},
|
|
1253
|
+
style: {},
|
|
1254
|
+
disabled: { type: Boolean }
|
|
1255
|
+
},
|
|
1256
|
+
emits: ["back", "refresh"],
|
|
1257
|
+
setup(e, { emit: t }) {
|
|
1258
|
+
const n = t, o = g(0), l = g(!1), s = () => {
|
|
1259
|
+
setTimeout(() => {
|
|
1260
|
+
An("刷新成功"), l.value = !1, o.value++;
|
|
1261
|
+
}, 1e3);
|
|
1262
|
+
}, i = g(), a = () => {
|
|
1263
|
+
n("back");
|
|
1264
|
+
};
|
|
1265
|
+
return (c, u) => (D(), K("div", {
|
|
1266
|
+
id: "id",
|
|
1267
|
+
class: U([
|
|
1268
|
+
"mx-app-page",
|
|
1269
|
+
{
|
|
1270
|
+
"mx-app-page-with-header": e.showHeader
|
|
1271
|
+
}
|
|
1272
|
+
])
|
|
1273
|
+
}, [
|
|
1274
|
+
e.showHeader ? (D(), K("header", Hn, [
|
|
1275
|
+
e.showBack ? (D(), K("div", Mn, [
|
|
1276
|
+
O("div", {
|
|
1277
|
+
class: "mx-app-page-back",
|
|
1278
|
+
onClick: a
|
|
1279
|
+
}, [...u[1] || (u[1] = [
|
|
1280
|
+
O("i", { class: "iconfont icon-fanhui1 icon" }, null, -1)
|
|
1281
|
+
])])
|
|
1282
|
+
])) : le("", !0),
|
|
1283
|
+
O("div", Yn, [
|
|
1284
|
+
V(c.$slots, "title", {}, () => [
|
|
1285
|
+
O("span", Un, we(e.title), 1)
|
|
1286
|
+
], !0)
|
|
1287
|
+
]),
|
|
1288
|
+
O("div", _n, [
|
|
1289
|
+
V(c.$slots, "header-right", {}, void 0, !0)
|
|
1290
|
+
])
|
|
1291
|
+
])) : le("", !0),
|
|
1292
|
+
e.showSearch ? (D(), K("div", Wn, [
|
|
1293
|
+
O("div", Kn, [
|
|
1294
|
+
V(c.$slots, "search", {}, void 0, !0)
|
|
1295
|
+
]),
|
|
1296
|
+
u[2] || (u[2] = O("i", { class: "iconfont icon-sousuo icon" }, null, -1))
|
|
1297
|
+
])) : le("", !0),
|
|
1298
|
+
O("div", {
|
|
1299
|
+
class: U(["mx-app-page-content-wrapper", {
|
|
1300
|
+
"has-search": e.showSearch,
|
|
1301
|
+
"has-header": e.showHeader
|
|
1302
|
+
}]),
|
|
1303
|
+
ref_key: "contentWrapperRef",
|
|
1304
|
+
ref: i
|
|
1305
|
+
}, [
|
|
1306
|
+
m(L(jn), {
|
|
1307
|
+
modelValue: l.value,
|
|
1308
|
+
"onUpdate:modelValue": u[0] || (u[0] = (v) => l.value = v),
|
|
1309
|
+
onRefresh: s
|
|
1310
|
+
}, {
|
|
1311
|
+
default: q(() => [
|
|
1312
|
+
O("p", null, "刷新次数: " + we(o.value), 1)
|
|
1313
|
+
]),
|
|
1314
|
+
_: 1
|
|
1315
|
+
}, 8, ["modelValue"])
|
|
1316
|
+
], 2)
|
|
1317
|
+
], 2));
|
|
1318
|
+
}
|
|
1319
|
+
}), Zn = /* @__PURE__ */ te(Xn, [["__scopeId", "data-v-b5dbaec1"]]), Qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
148
1320
|
__proto__: null
|
|
149
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
150
|
-
Button:
|
|
151
|
-
Input:
|
|
152
|
-
Card:
|
|
153
|
-
|
|
1321
|
+
}, Symbol.toStringTag, { value: "Module" })), Gn = {
|
|
1322
|
+
Button: vt,
|
|
1323
|
+
Input: gt,
|
|
1324
|
+
Card: bt,
|
|
1325
|
+
AppPage: Zn
|
|
1326
|
+
}, eo = {
|
|
154
1327
|
install: (e) => {
|
|
155
|
-
Object.values(
|
|
156
|
-
e.component(
|
|
1328
|
+
Object.values(Gn).forEach((t) => {
|
|
1329
|
+
e.component(t.name, t);
|
|
157
1330
|
});
|
|
158
1331
|
}
|
|
159
1332
|
};
|
|
160
1333
|
export {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
1334
|
+
Zn as AppPage,
|
|
1335
|
+
vt as Button,
|
|
1336
|
+
bt as Card,
|
|
1337
|
+
gt as Input,
|
|
1338
|
+
Gn as components,
|
|
1339
|
+
eo as default,
|
|
1340
|
+
Qn as types
|
|
167
1341
|
};
|