vant 3.3.0 → 3.3.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/es/address-edit/AddressEdit.js +1 -2
- package/es/calendar/Calendar.js +8 -14
- package/es/calendar/CalendarMonth.js +11 -10
- package/es/calendar/types.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/locale/lang/pt-BR.d.ts +73 -0
- package/es/locale/lang/pt-BR.js +72 -0
- package/es/swipe/Swipe.js +8 -2
- package/es/swipe/index.css +1 -1
- package/es/swipe/index.less +2 -0
- package/es/tab/Tab.js +1 -1
- package/es/tabbar-item/TabbarItem.js +5 -3
- package/es/uploader/Uploader.js +13 -2
- package/lib/address-edit/AddressEdit.js +1 -2
- package/lib/calendar/Calendar.js +8 -14
- package/lib/calendar/CalendarMonth.js +11 -10
- package/lib/calendar/types.d.ts +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/lang/pt-BR.d.ts +73 -0
- package/lib/locale/lang/pt-BR.js +77 -0
- package/lib/swipe/Swipe.js +8 -2
- package/lib/swipe/index.css +1 -1
- package/lib/swipe/index.less +2 -0
- package/lib/tab/Tab.js +1 -1
- package/lib/tabbar-item/TabbarItem.js +5 -3
- package/lib/uploader/Uploader.js +12 -1
- package/lib/vant.cjs.js +14417 -0
- package/lib/vant.cjs.min.js +1 -0
- package/lib/vant.es.js +174 -1243
- package/lib/vant.es.min.js +174 -1243
- package/lib/vant.js +39 -27
- package/lib/vant.min.js +1 -1
- package/package.json +23 -8
- package/vetur/attributes.json +28 -28
- package/vetur/tags.json +11 -11
- package/vetur/web-types.json +120 -120
package/lib/vant.es.min.js
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
import {
|
1
|
+
import { useWindowSize, useRect, useChildren, useParent, onMountedOrActivated, getScrollParent, useEventListener, CUSTOM_FIELD_INJECTION_KEY, useCustomFieldValue, useToggle, raf, useScrollParent, usePageVisibility, doubleRaf, cancelRaf, useCountDown, useClickAway, inBrowser as inBrowser$1 } from "@vant/use";
|
2
|
+
import { unref, ref, reactive, defineComponent, createVNode, getCurrentInstance, computed, provide, inject, onDeactivated, onBeforeUnmount, watch, Transition, withDirectives, vShow, onMounted, onActivated, Teleport, Fragment, mergeProps, nextTick, createTextVNode, createApp, onUnmounted, onBeforeUpdate, resolveDirective, h, onUpdated, watchEffect } from "vue";
|
3
|
+
import { createPopper, offsetModifier } from "@vant/popperjs";
|
2
4
|
function noop() {
|
3
5
|
}
|
4
6
|
var extend = Object.assign;
|
5
|
-
var inBrowser
|
7
|
+
var inBrowser = typeof window !== "undefined";
|
6
8
|
function get(object, path) {
|
7
9
|
var keys = path.split(".");
|
8
10
|
var result = object;
|
@@ -46,358 +48,6 @@ var makeStringProp = (defaultVal) => ({
|
|
46
48
|
type: String,
|
47
49
|
default: defaultVal
|
48
50
|
});
|
49
|
-
const inBrowser = typeof window !== "undefined";
|
50
|
-
function raf(fn2) {
|
51
|
-
return inBrowser ? requestAnimationFrame(fn2) : -1;
|
52
|
-
}
|
53
|
-
function cancelRaf(id) {
|
54
|
-
if (inBrowser) {
|
55
|
-
cancelAnimationFrame(id);
|
56
|
-
}
|
57
|
-
}
|
58
|
-
function doubleRaf(fn2) {
|
59
|
-
raf(() => raf(fn2));
|
60
|
-
}
|
61
|
-
const isWindow = (val) => val === window;
|
62
|
-
const makeDOMRect = (width2, height2) => ({
|
63
|
-
top: 0,
|
64
|
-
left: 0,
|
65
|
-
right: width2,
|
66
|
-
bottom: height2,
|
67
|
-
width: width2,
|
68
|
-
height: height2
|
69
|
-
});
|
70
|
-
const useRect = (elementOrRef) => {
|
71
|
-
const element = unref(elementOrRef);
|
72
|
-
if (isWindow(element)) {
|
73
|
-
const width2 = element.innerWidth;
|
74
|
-
const height2 = element.innerHeight;
|
75
|
-
return makeDOMRect(width2, height2);
|
76
|
-
}
|
77
|
-
if (element == null ? void 0 : element.getBoundingClientRect) {
|
78
|
-
return element.getBoundingClientRect();
|
79
|
-
}
|
80
|
-
return makeDOMRect(0, 0);
|
81
|
-
};
|
82
|
-
function useToggle(defaultValue = false) {
|
83
|
-
const state = ref(defaultValue);
|
84
|
-
const toggle = (value = !state.value) => {
|
85
|
-
state.value = value;
|
86
|
-
};
|
87
|
-
return [state, toggle];
|
88
|
-
}
|
89
|
-
function useParent(key) {
|
90
|
-
const parent = inject(key, null);
|
91
|
-
if (parent) {
|
92
|
-
const instance2 = getCurrentInstance();
|
93
|
-
const { link, unlink, internalChildren } = parent;
|
94
|
-
link(instance2);
|
95
|
-
onUnmounted(() => unlink(instance2));
|
96
|
-
const index2 = computed(() => internalChildren.indexOf(instance2));
|
97
|
-
return {
|
98
|
-
parent,
|
99
|
-
index: index2
|
100
|
-
};
|
101
|
-
}
|
102
|
-
return {
|
103
|
-
parent: null,
|
104
|
-
index: ref(-1)
|
105
|
-
};
|
106
|
-
}
|
107
|
-
function flattenVNodes(children) {
|
108
|
-
const result = [];
|
109
|
-
const traverse = (children2) => {
|
110
|
-
if (Array.isArray(children2)) {
|
111
|
-
children2.forEach((child) => {
|
112
|
-
var _a;
|
113
|
-
if (isVNode(child)) {
|
114
|
-
result.push(child);
|
115
|
-
if ((_a = child.component) == null ? void 0 : _a.subTree) {
|
116
|
-
traverse(child.component.subTree.children);
|
117
|
-
}
|
118
|
-
if (child.children) {
|
119
|
-
traverse(child.children);
|
120
|
-
}
|
121
|
-
}
|
122
|
-
});
|
123
|
-
}
|
124
|
-
};
|
125
|
-
traverse(children);
|
126
|
-
return result;
|
127
|
-
}
|
128
|
-
function sortChildren(parent, publicChildren, internalChildren) {
|
129
|
-
const vnodes = flattenVNodes(parent.subTree.children);
|
130
|
-
internalChildren.sort((a, b) => vnodes.indexOf(a.vnode) - vnodes.indexOf(b.vnode));
|
131
|
-
const orderedPublicChildren = internalChildren.map((item) => item.proxy);
|
132
|
-
publicChildren.sort((a, b) => {
|
133
|
-
const indexA = orderedPublicChildren.indexOf(a);
|
134
|
-
const indexB = orderedPublicChildren.indexOf(b);
|
135
|
-
return indexA - indexB;
|
136
|
-
});
|
137
|
-
}
|
138
|
-
function useChildren(key) {
|
139
|
-
const publicChildren = reactive([]);
|
140
|
-
const internalChildren = reactive([]);
|
141
|
-
const parent = getCurrentInstance();
|
142
|
-
const linkChildren = (value) => {
|
143
|
-
const link = (child) => {
|
144
|
-
if (child.proxy) {
|
145
|
-
internalChildren.push(child);
|
146
|
-
publicChildren.push(child.proxy);
|
147
|
-
sortChildren(parent, publicChildren, internalChildren);
|
148
|
-
}
|
149
|
-
};
|
150
|
-
const unlink = (child) => {
|
151
|
-
const index2 = internalChildren.indexOf(child);
|
152
|
-
publicChildren.splice(index2, 1);
|
153
|
-
internalChildren.splice(index2, 1);
|
154
|
-
};
|
155
|
-
provide(key, Object.assign({
|
156
|
-
link,
|
157
|
-
unlink,
|
158
|
-
children: publicChildren,
|
159
|
-
internalChildren
|
160
|
-
}, value));
|
161
|
-
};
|
162
|
-
return {
|
163
|
-
children: publicChildren,
|
164
|
-
linkChildren
|
165
|
-
};
|
166
|
-
}
|
167
|
-
const SECOND = 1e3;
|
168
|
-
const MINUTE = 60 * SECOND;
|
169
|
-
const HOUR = 60 * MINUTE;
|
170
|
-
const DAY = 24 * HOUR;
|
171
|
-
function parseTime(time) {
|
172
|
-
const days = Math.floor(time / DAY);
|
173
|
-
const hours = Math.floor(time % DAY / HOUR);
|
174
|
-
const minutes = Math.floor(time % HOUR / MINUTE);
|
175
|
-
const seconds = Math.floor(time % MINUTE / SECOND);
|
176
|
-
const milliseconds = Math.floor(time % SECOND);
|
177
|
-
return {
|
178
|
-
total: time,
|
179
|
-
days,
|
180
|
-
hours,
|
181
|
-
minutes,
|
182
|
-
seconds,
|
183
|
-
milliseconds
|
184
|
-
};
|
185
|
-
}
|
186
|
-
function isSameSecond(time1, time2) {
|
187
|
-
return Math.floor(time1 / 1e3) === Math.floor(time2 / 1e3);
|
188
|
-
}
|
189
|
-
function useCountDown(options) {
|
190
|
-
let rafId;
|
191
|
-
let endTime;
|
192
|
-
let counting;
|
193
|
-
let deactivated;
|
194
|
-
const remain = ref(options.time);
|
195
|
-
const current2 = computed(() => parseTime(remain.value));
|
196
|
-
const pause = () => {
|
197
|
-
counting = false;
|
198
|
-
cancelRaf(rafId);
|
199
|
-
};
|
200
|
-
const getCurrentRemain = () => Math.max(endTime - Date.now(), 0);
|
201
|
-
const setRemain = (value) => {
|
202
|
-
var _a, _b;
|
203
|
-
remain.value = value;
|
204
|
-
(_a = options.onChange) == null ? void 0 : _a.call(options, current2.value);
|
205
|
-
if (value === 0) {
|
206
|
-
pause();
|
207
|
-
(_b = options.onFinish) == null ? void 0 : _b.call(options);
|
208
|
-
}
|
209
|
-
};
|
210
|
-
const microTick = () => {
|
211
|
-
rafId = raf(() => {
|
212
|
-
if (counting) {
|
213
|
-
setRemain(getCurrentRemain());
|
214
|
-
if (remain.value > 0) {
|
215
|
-
microTick();
|
216
|
-
}
|
217
|
-
}
|
218
|
-
});
|
219
|
-
};
|
220
|
-
const macroTick = () => {
|
221
|
-
rafId = raf(() => {
|
222
|
-
if (counting) {
|
223
|
-
const remainRemain = getCurrentRemain();
|
224
|
-
if (!isSameSecond(remainRemain, remain.value) || remainRemain === 0) {
|
225
|
-
setRemain(remainRemain);
|
226
|
-
}
|
227
|
-
if (remain.value > 0) {
|
228
|
-
macroTick();
|
229
|
-
}
|
230
|
-
}
|
231
|
-
});
|
232
|
-
};
|
233
|
-
const tick = () => {
|
234
|
-
if (!inBrowser) {
|
235
|
-
return;
|
236
|
-
}
|
237
|
-
if (options.millisecond) {
|
238
|
-
microTick();
|
239
|
-
} else {
|
240
|
-
macroTick();
|
241
|
-
}
|
242
|
-
};
|
243
|
-
const start2 = () => {
|
244
|
-
if (!counting) {
|
245
|
-
endTime = Date.now() + remain.value;
|
246
|
-
counting = true;
|
247
|
-
tick();
|
248
|
-
}
|
249
|
-
};
|
250
|
-
const reset = (totalTime = options.time) => {
|
251
|
-
pause();
|
252
|
-
remain.value = totalTime;
|
253
|
-
};
|
254
|
-
onBeforeUnmount(pause);
|
255
|
-
onActivated(() => {
|
256
|
-
if (deactivated) {
|
257
|
-
counting = true;
|
258
|
-
deactivated = false;
|
259
|
-
tick();
|
260
|
-
}
|
261
|
-
});
|
262
|
-
onDeactivated(() => {
|
263
|
-
if (counting) {
|
264
|
-
pause();
|
265
|
-
deactivated = true;
|
266
|
-
}
|
267
|
-
});
|
268
|
-
return {
|
269
|
-
start: start2,
|
270
|
-
pause,
|
271
|
-
reset,
|
272
|
-
current: current2
|
273
|
-
};
|
274
|
-
}
|
275
|
-
function onMountedOrActivated(hook) {
|
276
|
-
let mounted;
|
277
|
-
onMounted(() => {
|
278
|
-
hook();
|
279
|
-
nextTick(() => {
|
280
|
-
mounted = true;
|
281
|
-
});
|
282
|
-
});
|
283
|
-
onActivated(() => {
|
284
|
-
if (mounted) {
|
285
|
-
hook();
|
286
|
-
}
|
287
|
-
});
|
288
|
-
}
|
289
|
-
function useEventListener(type, listener, options = {}) {
|
290
|
-
if (!inBrowser) {
|
291
|
-
return;
|
292
|
-
}
|
293
|
-
const { target = window, passive: passive2 = false, capture = false } = options;
|
294
|
-
let attached;
|
295
|
-
const add = (target2) => {
|
296
|
-
const element = unref(target2);
|
297
|
-
if (element && !attached) {
|
298
|
-
element.addEventListener(type, listener, { capture, passive: passive2 });
|
299
|
-
attached = true;
|
300
|
-
}
|
301
|
-
};
|
302
|
-
const remove2 = (target2) => {
|
303
|
-
const element = unref(target2);
|
304
|
-
if (element && attached) {
|
305
|
-
element.removeEventListener(type, listener, capture);
|
306
|
-
attached = false;
|
307
|
-
}
|
308
|
-
};
|
309
|
-
onUnmounted(() => remove2(target));
|
310
|
-
onDeactivated(() => remove2(target));
|
311
|
-
onMountedOrActivated(() => add(target));
|
312
|
-
if (isRef(target)) {
|
313
|
-
watch(target, (val, oldVal) => {
|
314
|
-
remove2(oldVal);
|
315
|
-
add(val);
|
316
|
-
});
|
317
|
-
}
|
318
|
-
}
|
319
|
-
function useClickAway(target, listener, options = {}) {
|
320
|
-
if (!inBrowser) {
|
321
|
-
return;
|
322
|
-
}
|
323
|
-
const { eventName = "click" } = options;
|
324
|
-
const onClick = (event) => {
|
325
|
-
const element = unref(target);
|
326
|
-
if (element && !element.contains(event.target)) {
|
327
|
-
listener(event);
|
328
|
-
}
|
329
|
-
};
|
330
|
-
useEventListener(eventName, onClick, { target: document });
|
331
|
-
}
|
332
|
-
let width;
|
333
|
-
let height;
|
334
|
-
function useWindowSize() {
|
335
|
-
if (!width) {
|
336
|
-
width = ref(0);
|
337
|
-
height = ref(0);
|
338
|
-
if (inBrowser) {
|
339
|
-
const update = () => {
|
340
|
-
width.value = window.innerWidth;
|
341
|
-
height.value = window.innerHeight;
|
342
|
-
};
|
343
|
-
update();
|
344
|
-
window.addEventListener("resize", update, { passive: true });
|
345
|
-
window.addEventListener("orientationchange", update, { passive: true });
|
346
|
-
}
|
347
|
-
}
|
348
|
-
return { width, height };
|
349
|
-
}
|
350
|
-
const overflowScrollReg = /scroll|auto/i;
|
351
|
-
const defaultRoot = inBrowser ? window : void 0;
|
352
|
-
function isElement$1(node) {
|
353
|
-
const ELEMENT_NODE_TYPE = 1;
|
354
|
-
return node.tagName !== "HTML" && node.tagName !== "BODY" && node.nodeType === ELEMENT_NODE_TYPE;
|
355
|
-
}
|
356
|
-
function getScrollParent$1(el, root = defaultRoot) {
|
357
|
-
let node = el;
|
358
|
-
while (node && node !== root && isElement$1(node)) {
|
359
|
-
const { overflowY } = window.getComputedStyle(node);
|
360
|
-
if (overflowScrollReg.test(overflowY)) {
|
361
|
-
return node;
|
362
|
-
}
|
363
|
-
node = node.parentNode;
|
364
|
-
}
|
365
|
-
return root;
|
366
|
-
}
|
367
|
-
function useScrollParent(el, root = defaultRoot) {
|
368
|
-
const scrollParent = ref();
|
369
|
-
onMounted(() => {
|
370
|
-
if (el.value) {
|
371
|
-
scrollParent.value = getScrollParent$1(el.value, root);
|
372
|
-
}
|
373
|
-
});
|
374
|
-
return scrollParent;
|
375
|
-
}
|
376
|
-
let visibility;
|
377
|
-
function usePageVisibility() {
|
378
|
-
if (!visibility) {
|
379
|
-
visibility = ref("visible");
|
380
|
-
if (inBrowser) {
|
381
|
-
const update = () => {
|
382
|
-
visibility.value = document.hidden ? "hidden" : "visible";
|
383
|
-
};
|
384
|
-
update();
|
385
|
-
window.addEventListener("visibilitychange", update);
|
386
|
-
}
|
387
|
-
}
|
388
|
-
return visibility;
|
389
|
-
}
|
390
|
-
const CUSTOM_FIELD_INJECTION_KEY = Symbol("van-field");
|
391
|
-
function useCustomFieldValue(customValue) {
|
392
|
-
const field = inject(CUSTOM_FIELD_INJECTION_KEY, null);
|
393
|
-
if (field && !field.customValue.value) {
|
394
|
-
field.customValue.value = customValue;
|
395
|
-
watch(customValue, () => {
|
396
|
-
field.resetValidation();
|
397
|
-
field.validateWithTrigger("onChange");
|
398
|
-
});
|
399
|
-
}
|
400
|
-
}
|
401
51
|
var isDef = (val) => val !== void 0 && val !== null;
|
402
52
|
var isFunction = (val) => typeof val === "function";
|
403
53
|
var isObject = (val) => val !== null && typeof val === "object";
|
@@ -408,10 +58,10 @@ function isMobile(value) {
|
|
408
58
|
return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
|
409
59
|
}
|
410
60
|
var isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
|
411
|
-
var isIOS$1 = () => inBrowser
|
61
|
+
var isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
412
62
|
function getScrollTop(el) {
|
413
|
-
var
|
414
|
-
return Math.max(
|
63
|
+
var top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
|
64
|
+
return Math.max(top, 0);
|
415
65
|
}
|
416
66
|
function setScrollTop(el, value) {
|
417
67
|
if ("scrollTop" in el) {
|
@@ -510,7 +160,7 @@ function unitToPx(value) {
|
|
510
160
|
if (typeof value === "number") {
|
511
161
|
return value;
|
512
162
|
}
|
513
|
-
if (inBrowser
|
163
|
+
if (inBrowser) {
|
514
164
|
if (value.includes("rem")) {
|
515
165
|
return convertRem(value);
|
516
166
|
}
|
@@ -1158,7 +808,7 @@ var _Button = defineComponent({
|
|
1158
808
|
type,
|
1159
809
|
size,
|
1160
810
|
block,
|
1161
|
-
round
|
811
|
+
round,
|
1162
812
|
plain,
|
1163
813
|
square,
|
1164
814
|
loading,
|
@@ -1170,7 +820,7 @@ var _Button = defineComponent({
|
|
1170
820
|
var classes = [bem$1l([type, size, {
|
1171
821
|
plain,
|
1172
822
|
block,
|
1173
|
-
round
|
823
|
+
round,
|
1174
824
|
square,
|
1175
825
|
loading,
|
1176
826
|
disabled,
|
@@ -1355,7 +1005,7 @@ function useTouch() {
|
|
1355
1005
|
offsetY.value = 0;
|
1356
1006
|
direction.value = "";
|
1357
1007
|
};
|
1358
|
-
var
|
1008
|
+
var start = (event) => {
|
1359
1009
|
reset();
|
1360
1010
|
startX.value = event.touches[0].clientX;
|
1361
1011
|
startY.value = event.touches[0].clientY;
|
@@ -1372,7 +1022,7 @@ function useTouch() {
|
|
1372
1022
|
};
|
1373
1023
|
return {
|
1374
1024
|
move,
|
1375
|
-
start
|
1025
|
+
start,
|
1376
1026
|
reset,
|
1377
1027
|
startX,
|
1378
1028
|
startY,
|
@@ -1392,7 +1042,7 @@ function useLockScroll(rootRef, shouldLock) {
|
|
1392
1042
|
var onTouchMove = (event) => {
|
1393
1043
|
touch.move(event);
|
1394
1044
|
var direction = touch.deltaY.value > 0 ? "10" : "01";
|
1395
|
-
var el = getScrollParent
|
1045
|
+
var el = getScrollParent(event.target, rootRef.value);
|
1396
1046
|
var {
|
1397
1047
|
scrollHeight,
|
1398
1048
|
offsetHeight,
|
@@ -1599,7 +1249,7 @@ var _Popup = defineComponent({
|
|
1599
1249
|
var onClosed = () => emit("closed");
|
1600
1250
|
var renderPopup = lazyRender(() => {
|
1601
1251
|
var {
|
1602
|
-
round
|
1252
|
+
round,
|
1603
1253
|
position,
|
1604
1254
|
safeAreaInsetBottom
|
1605
1255
|
} = props;
|
@@ -1607,7 +1257,7 @@ var _Popup = defineComponent({
|
|
1607
1257
|
"ref": popupRef,
|
1608
1258
|
"style": style.value,
|
1609
1259
|
"class": [bem$1h({
|
1610
|
-
round
|
1260
|
+
round,
|
1611
1261
|
[position]: position
|
1612
1262
|
}), {
|
1613
1263
|
"van-safe-area-bottom": safeAreaInsetBottom
|
@@ -1866,7 +1516,7 @@ var Column = defineComponent({
|
|
1866
1516
|
};
|
1867
1517
|
var setIndex = (index2, emitChange) => {
|
1868
1518
|
index2 = adjustIndex(index2) || 0;
|
1869
|
-
var
|
1519
|
+
var offset = -index2 * props.itemHeight;
|
1870
1520
|
var trigger = () => {
|
1871
1521
|
if (index2 !== state.index) {
|
1872
1522
|
state.index = index2;
|
@@ -1875,12 +1525,12 @@ var Column = defineComponent({
|
|
1875
1525
|
}
|
1876
1526
|
}
|
1877
1527
|
};
|
1878
|
-
if (moving &&
|
1528
|
+
if (moving && offset !== state.offset) {
|
1879
1529
|
transitionEndTrigger = trigger;
|
1880
1530
|
} else {
|
1881
1531
|
trigger();
|
1882
1532
|
}
|
1883
|
-
state.offset =
|
1533
|
+
state.offset = offset;
|
1884
1534
|
};
|
1885
1535
|
var setOptions = (options) => {
|
1886
1536
|
if (JSON.stringify(options) !== JSON.stringify(state.options)) {
|
@@ -1902,7 +1552,7 @@ var Column = defineComponent({
|
|
1902
1552
|
}
|
1903
1553
|
return option;
|
1904
1554
|
};
|
1905
|
-
var getIndexByOffset = (
|
1555
|
+
var getIndexByOffset = (offset) => clamp(Math.round(-offset / props.itemHeight), 0, count() - 1);
|
1906
1556
|
var momentum = (distance, duration) => {
|
1907
1557
|
var speed = Math.abs(distance / duration);
|
1908
1558
|
distance = state.offset + speed / 3e-3 * (distance < 0 ? -1 : 1);
|
@@ -2868,21 +2518,21 @@ function endComposing(_ref2) {
|
|
2868
2518
|
function resizeTextarea(input, autosize) {
|
2869
2519
|
var scrollTop = getRootScrollTop();
|
2870
2520
|
input.style.height = "auto";
|
2871
|
-
var
|
2521
|
+
var height = input.scrollHeight;
|
2872
2522
|
if (isObject(autosize)) {
|
2873
2523
|
var {
|
2874
2524
|
maxHeight,
|
2875
2525
|
minHeight
|
2876
2526
|
} = autosize;
|
2877
2527
|
if (maxHeight !== void 0) {
|
2878
|
-
|
2528
|
+
height = Math.min(height, maxHeight);
|
2879
2529
|
}
|
2880
2530
|
if (minHeight !== void 0) {
|
2881
|
-
|
2531
|
+
height = Math.max(height, minHeight);
|
2882
2532
|
}
|
2883
2533
|
}
|
2884
|
-
if (
|
2885
|
-
input.style.height =
|
2534
|
+
if (height) {
|
2535
|
+
input.style.height = height + "px";
|
2886
2536
|
setRootScrollTop(scrollTop);
|
2887
2537
|
}
|
2888
2538
|
}
|
@@ -3588,7 +3238,7 @@ function Toast(options) {
|
|
3588
3238
|
if (options === void 0) {
|
3589
3239
|
options = {};
|
3590
3240
|
}
|
3591
|
-
if (!inBrowser
|
3241
|
+
if (!inBrowser) {
|
3592
3242
|
return {};
|
3593
3243
|
}
|
3594
3244
|
var toast = getInstance();
|
@@ -4057,8 +3707,7 @@ var _AddressEdit = defineComponent({
|
|
4057
3707
|
"text": props.saveButtonText || t$h("save"),
|
4058
3708
|
"class": bem$16("button"),
|
4059
3709
|
"loading": props.isSaving,
|
4060
|
-
"nativeType": "submit"
|
4061
|
-
"onClick": onSave
|
3710
|
+
"nativeType": "submit"
|
4062
3711
|
}, null), props.showDelete && createVNode(Button, {
|
4063
3712
|
"block": true,
|
4064
3713
|
"round": true,
|
@@ -4168,14 +3817,14 @@ var _Tag = defineComponent({
|
|
4168
3817
|
type,
|
4169
3818
|
mark,
|
4170
3819
|
plain,
|
4171
|
-
round
|
3820
|
+
round,
|
4172
3821
|
size,
|
4173
3822
|
closeable
|
4174
3823
|
} = props;
|
4175
3824
|
var classes = {
|
4176
3825
|
mark,
|
4177
3826
|
plain,
|
4178
|
-
round
|
3827
|
+
round
|
4179
3828
|
};
|
4180
3829
|
if (size) {
|
4181
3830
|
classes[size] = size;
|
@@ -4515,9 +4164,9 @@ function compareDay(day1, day2) {
|
|
4515
4164
|
}
|
4516
4165
|
var cloneDate = (date) => new Date(date);
|
4517
4166
|
var cloneDates = (dates) => Array.isArray(dates) ? dates.map(cloneDate) : cloneDate(dates);
|
4518
|
-
function getDayByOffset(date,
|
4167
|
+
function getDayByOffset(date, offset) {
|
4519
4168
|
var cloned = cloneDate(date);
|
4520
|
-
cloned.setDate(cloned.getDate() +
|
4169
|
+
cloned.setDate(cloned.getDate() + offset);
|
4521
4170
|
return cloned;
|
4522
4171
|
}
|
4523
4172
|
var getPrevDay = (date) => getDayByOffset(date, -1);
|
@@ -4574,11 +4223,11 @@ function getTrueValue(value) {
|
|
4574
4223
|
}
|
4575
4224
|
var getMonthEndDay = (year, month) => 32 - new Date(year, month - 1, 32).getDate();
|
4576
4225
|
var useHeight = (element) => {
|
4577
|
-
var
|
4226
|
+
var height = ref();
|
4578
4227
|
onMounted(() => nextTick(() => {
|
4579
|
-
|
4228
|
+
height.value = useRect(element).height;
|
4580
4229
|
}));
|
4581
|
-
return
|
4230
|
+
return height;
|
4582
4231
|
};
|
4583
4232
|
var [name$13] = createNamespace("calendar-day");
|
4584
4233
|
var CalendarDay = defineComponent({
|
@@ -4601,7 +4250,7 @@ var CalendarDay = defineComponent({
|
|
4601
4250
|
item,
|
4602
4251
|
index: index2,
|
4603
4252
|
color,
|
4604
|
-
offset
|
4253
|
+
offset,
|
4605
4254
|
rowHeight
|
4606
4255
|
} = props;
|
4607
4256
|
var style2 = {
|
@@ -4612,7 +4261,7 @@ var CalendarDay = defineComponent({
|
|
4612
4261
|
return style2;
|
4613
4262
|
}
|
4614
4263
|
if (index2 === 0) {
|
4615
|
-
style2.marginLeft = 100 *
|
4264
|
+
style2.marginLeft = 100 * offset / 7 + "%";
|
4616
4265
|
}
|
4617
4266
|
if (color) {
|
4618
4267
|
switch (item.type) {
|
@@ -4728,10 +4377,10 @@ var CalendarMonth = defineComponent({
|
|
4728
4377
|
var [visible, setVisible] = useToggle();
|
4729
4378
|
var daysRef = ref();
|
4730
4379
|
var monthRef = ref();
|
4731
|
-
var
|
4380
|
+
var height = useHeight(monthRef);
|
4732
4381
|
var title = computed(() => formatMonthTitle(props.date));
|
4733
4382
|
var rowHeight = computed(() => addUnit(props.rowHeight));
|
4734
|
-
var
|
4383
|
+
var offset = computed(() => {
|
4735
4384
|
var realDay = props.date.getDay();
|
4736
4385
|
if (props.firstDayOfWeek) {
|
4737
4386
|
return (realDay + 7 - props.firstDayOfWeek) % 7;
|
@@ -4741,13 +4390,6 @@ var CalendarMonth = defineComponent({
|
|
4741
4390
|
var totalDay = computed(() => getMonthEndDay(props.date.getFullYear(), props.date.getMonth() + 1));
|
4742
4391
|
var shouldRender = computed(() => visible.value || !props.lazyRender);
|
4743
4392
|
var getTitle = () => title.value;
|
4744
|
-
var scrollIntoView = (body) => {
|
4745
|
-
var el = props.showSubtitle ? daysRef.value : monthRef.value;
|
4746
|
-
if (el) {
|
4747
|
-
var scrollTop = useRect(el).top - useRect(body).top + body.scrollTop;
|
4748
|
-
setScrollTop(body, scrollTop);
|
4749
|
-
}
|
4750
|
-
};
|
4751
4393
|
var getMultipleDayType = (day) => {
|
4752
4394
|
var isSelected = (date) => props.currentDate.some((item) => compareDay(item, date) === 0);
|
4753
4395
|
if (isSelected(day)) {
|
@@ -4842,7 +4484,7 @@ var CalendarMonth = defineComponent({
|
|
4842
4484
|
}
|
4843
4485
|
};
|
4844
4486
|
var placeholders = computed(() => {
|
4845
|
-
var count = Math.ceil((totalDay.value +
|
4487
|
+
var count = Math.ceil((totalDay.value + offset.value) / 7);
|
4846
4488
|
return Array(count).fill({
|
4847
4489
|
type: "placeholder"
|
4848
4490
|
});
|
@@ -4868,11 +4510,20 @@ var CalendarMonth = defineComponent({
|
|
4868
4510
|
return days2;
|
4869
4511
|
});
|
4870
4512
|
var disabledDays = computed(() => days.value.filter((day) => day.type === "disabled"));
|
4513
|
+
var scrollToDate = (body, targetDate) => {
|
4514
|
+
if (daysRef.value) {
|
4515
|
+
var daysRect = useRect(daysRef.value);
|
4516
|
+
var totalRows = placeholders.value.length;
|
4517
|
+
var currentRow = Math.ceil((targetDate.getDate() + offset.value) / 7);
|
4518
|
+
var rowOffset = (currentRow - 1) * daysRect.height / totalRows;
|
4519
|
+
setScrollTop(body, daysRect.top + rowOffset + body.scrollTop - useRect(body).top);
|
4520
|
+
}
|
4521
|
+
};
|
4871
4522
|
var renderDay = (item, index2) => createVNode(CalendarDay, {
|
4872
4523
|
"item": item,
|
4873
4524
|
"index": index2,
|
4874
4525
|
"color": props.color,
|
4875
|
-
"offset":
|
4526
|
+
"offset": offset.value,
|
4876
4527
|
"rowHeight": rowHeight.value,
|
4877
4528
|
"onClick": (item2) => emit("click", item2)
|
4878
4529
|
}, pick(slots, ["top-info", "bottom-info"]));
|
@@ -4883,9 +4534,9 @@ var CalendarMonth = defineComponent({
|
|
4883
4534
|
}, [renderMark(), (shouldRender.value ? days : placeholders).value.map(renderDay)]);
|
4884
4535
|
useExpose({
|
4885
4536
|
getTitle,
|
4886
|
-
getHeight: () =>
|
4537
|
+
getHeight: () => height.value,
|
4887
4538
|
setVisible,
|
4888
|
-
|
4539
|
+
scrollToDate,
|
4889
4540
|
disabledDays
|
4890
4541
|
});
|
4891
4542
|
return () => createVNode("div", {
|
@@ -5033,9 +4684,9 @@ var _Calendar = defineComponent({
|
|
5033
4684
|
if (!Array.isArray(defaultDate)) {
|
5034
4685
|
defaultDate = [];
|
5035
4686
|
}
|
5036
|
-
var
|
5037
|
-
var
|
5038
|
-
return [
|
4687
|
+
var start = limitDateRange(defaultDate[0] || now, minDate, getPrevDay(maxDate));
|
4688
|
+
var end = limitDateRange(defaultDate[1] || now, getNextDay(minDate));
|
4689
|
+
return [start, end];
|
5039
4690
|
}
|
5040
4691
|
if (type === "multiple") {
|
5041
4692
|
if (Array.isArray(defaultDate)) {
|
@@ -5076,19 +4727,19 @@ var _Calendar = defineComponent({
|
|
5076
4727
|
return !currentDate.value;
|
5077
4728
|
});
|
5078
4729
|
var onScroll = () => {
|
5079
|
-
var
|
5080
|
-
var
|
4730
|
+
var top = getScrollTop(bodyRef.value);
|
4731
|
+
var bottom = top + bodyHeight;
|
5081
4732
|
var heights = months.value.map((item, index2) => monthRefs.value[index2].getHeight());
|
5082
4733
|
var heightSum = heights.reduce((a, b) => a + b, 0);
|
5083
|
-
if (
|
4734
|
+
if (bottom > heightSum && top > 0) {
|
5084
4735
|
return;
|
5085
4736
|
}
|
5086
|
-
var
|
4737
|
+
var height = 0;
|
5087
4738
|
var currentMonth;
|
5088
4739
|
var visibleRange = [-1, -1];
|
5089
4740
|
for (var i = 0; i < months.value.length; i++) {
|
5090
4741
|
var month = monthRefs.value[i];
|
5091
|
-
var visible =
|
4742
|
+
var visible = height <= bottom && height + heights[i] >= top;
|
5092
4743
|
if (visible) {
|
5093
4744
|
visibleRange[1] = i;
|
5094
4745
|
if (!currentMonth) {
|
@@ -5103,7 +4754,7 @@ var _Calendar = defineComponent({
|
|
5103
4754
|
});
|
5104
4755
|
}
|
5105
4756
|
}
|
5106
|
-
|
4757
|
+
height += heights[i];
|
5107
4758
|
}
|
5108
4759
|
months.value.forEach((month2, index2) => {
|
5109
4760
|
var visible2 = index2 >= visibleRange[0] - 1 && index2 <= visibleRange[1] + 1;
|
@@ -5118,7 +4769,7 @@ var _Calendar = defineComponent({
|
|
5118
4769
|
months.value.some((month, index2) => {
|
5119
4770
|
if (compareMonth(month, targetDate) === 0) {
|
5120
4771
|
if (bodyRef.value) {
|
5121
|
-
monthRefs.value[index2].
|
4772
|
+
monthRefs.value[index2].scrollToDate(bodyRef.value, targetDate);
|
5122
4773
|
}
|
5123
4774
|
return true;
|
5124
4775
|
}
|
@@ -5127,7 +4778,7 @@ var _Calendar = defineComponent({
|
|
5127
4778
|
onScroll();
|
5128
4779
|
});
|
5129
4780
|
};
|
5130
|
-
var
|
4781
|
+
var scrollToCurrentDate = () => {
|
5131
4782
|
if (props.poppable && !props.show) {
|
5132
4783
|
return;
|
5133
4784
|
}
|
@@ -5144,7 +4795,7 @@ var _Calendar = defineComponent({
|
|
5144
4795
|
}
|
5145
4796
|
raf(() => {
|
5146
4797
|
bodyHeight = Math.floor(useRect(bodyRef).height);
|
5147
|
-
|
4798
|
+
scrollToCurrentDate();
|
5148
4799
|
});
|
5149
4800
|
};
|
5150
4801
|
var reset = function(date) {
|
@@ -5152,7 +4803,7 @@ var _Calendar = defineComponent({
|
|
5152
4803
|
date = getInitialDate();
|
5153
4804
|
}
|
5154
4805
|
currentDate.value = date;
|
5155
|
-
|
4806
|
+
scrollToCurrentDate();
|
5156
4807
|
};
|
5157
4808
|
var checkRange = (date) => {
|
5158
4809
|
var {
|
@@ -5181,11 +4832,7 @@ var _Calendar = defineComponent({
|
|
5181
4832
|
if (complete && props.type === "range") {
|
5182
4833
|
var valid = checkRange(date);
|
5183
4834
|
if (!valid) {
|
5184
|
-
|
5185
|
-
setCurrentDate([date[0], getDayByOffset(date[0], +props.maxRange - 1)]);
|
5186
|
-
} else {
|
5187
|
-
setCurrentDate(date);
|
5188
|
-
}
|
4835
|
+
setCurrentDate([date[0], getDayByOffset(date[0], +props.maxRange - 1)]);
|
5189
4836
|
return;
|
5190
4837
|
}
|
5191
4838
|
}
|
@@ -5318,7 +4965,7 @@ var _Calendar = defineComponent({
|
|
5318
4965
|
value = null;
|
5319
4966
|
}
|
5320
4967
|
currentDate.value = value;
|
5321
|
-
|
4968
|
+
scrollToCurrentDate();
|
5322
4969
|
});
|
5323
4970
|
useExpose({
|
5324
4971
|
reset,
|
@@ -5463,7 +5110,7 @@ var _Image = defineComponent({
|
|
5463
5110
|
onError();
|
5464
5111
|
}
|
5465
5112
|
};
|
5466
|
-
if ($Lazyload && inBrowser
|
5113
|
+
if ($Lazyload && inBrowser) {
|
5467
5114
|
$Lazyload.$on("loaded", onLazyLoaded);
|
5468
5115
|
$Lazyload.$on("error", onLazyLoadError);
|
5469
5116
|
onBeforeUnmount(() => {
|
@@ -5632,7 +5279,7 @@ function scrollTopTo(scroller, to, duration, callback) {
|
|
5632
5279
|
animate();
|
5633
5280
|
}
|
5634
5281
|
function useVisibilityChange(target, onChange) {
|
5635
|
-
if (!inBrowser
|
5282
|
+
if (!inBrowser || !window.IntersectionObserver) {
|
5636
5283
|
return;
|
5637
5284
|
}
|
5638
5285
|
var observer = new IntersectionObserver((entries) => {
|
@@ -5679,17 +5326,17 @@ var _Sticky = defineComponent({
|
|
5679
5326
|
height: 0,
|
5680
5327
|
transform: 0
|
5681
5328
|
});
|
5682
|
-
var
|
5329
|
+
var offset = computed(() => unitToPx(props.position === "top" ? props.offsetTop : props.offsetBottom));
|
5683
5330
|
var rootStyle = computed(() => {
|
5684
5331
|
var {
|
5685
5332
|
fixed,
|
5686
|
-
height
|
5687
|
-
width
|
5333
|
+
height,
|
5334
|
+
width
|
5688
5335
|
} = state;
|
5689
5336
|
if (fixed) {
|
5690
5337
|
return {
|
5691
|
-
width:
|
5692
|
-
height:
|
5338
|
+
width: width + "px",
|
5339
|
+
height: height + "px"
|
5693
5340
|
};
|
5694
5341
|
}
|
5695
5342
|
});
|
@@ -5700,7 +5347,7 @@ var _Sticky = defineComponent({
|
|
5700
5347
|
var style = extend(getZIndexStyle(props.zIndex), {
|
5701
5348
|
width: state.width + "px",
|
5702
5349
|
height: state.height + "px",
|
5703
|
-
[props.position]:
|
5350
|
+
[props.position]: offset.value + "px"
|
5704
5351
|
});
|
5705
5352
|
if (state.transform) {
|
5706
5353
|
style.transform = "translate3d(0, " + state.transform + "px, 0)";
|
@@ -5726,11 +5373,11 @@ var _Sticky = defineComponent({
|
|
5726
5373
|
if (position === "top") {
|
5727
5374
|
if (container) {
|
5728
5375
|
var containerRect = useRect(container);
|
5729
|
-
var difference = containerRect.bottom -
|
5730
|
-
state.fixed =
|
5376
|
+
var difference = containerRect.bottom - offset.value - state.height;
|
5377
|
+
state.fixed = offset.value > rootRect.top && containerRect.bottom > 0;
|
5731
5378
|
state.transform = difference < 0 ? difference : 0;
|
5732
5379
|
} else {
|
5733
|
-
state.fixed =
|
5380
|
+
state.fixed = offset.value > rootRect.top;
|
5734
5381
|
}
|
5735
5382
|
} else {
|
5736
5383
|
var {
|
@@ -5738,11 +5385,11 @@ var _Sticky = defineComponent({
|
|
5738
5385
|
} = document.documentElement;
|
5739
5386
|
if (container) {
|
5740
5387
|
var _containerRect = useRect(container);
|
5741
|
-
var _difference = clientHeight - _containerRect.top -
|
5742
|
-
state.fixed = clientHeight -
|
5388
|
+
var _difference = clientHeight - _containerRect.top - offset.value - state.height;
|
5389
|
+
state.fixed = clientHeight - offset.value < rootRect.bottom && clientHeight > _containerRect.top;
|
5743
5390
|
state.transform = _difference < 0 ? -_difference : 0;
|
5744
5391
|
} else {
|
5745
|
-
state.fixed = clientHeight -
|
5392
|
+
state.fixed = clientHeight - offset.value < rootRect.bottom;
|
5746
5393
|
}
|
5747
5394
|
}
|
5748
5395
|
emitScroll(scrollTop);
|
@@ -5924,15 +5571,15 @@ var _Swipe = defineComponent({
|
|
5924
5571
|
}
|
5925
5572
|
return active;
|
5926
5573
|
};
|
5927
|
-
var getTargetOffset = function(targetActive,
|
5928
|
-
if (
|
5929
|
-
|
5574
|
+
var getTargetOffset = function(targetActive, offset) {
|
5575
|
+
if (offset === void 0) {
|
5576
|
+
offset = 0;
|
5930
5577
|
}
|
5931
5578
|
var currentPosition = targetActive * size.value;
|
5932
5579
|
if (!props.loop) {
|
5933
5580
|
currentPosition = Math.min(currentPosition, -minOffset.value);
|
5934
5581
|
}
|
5935
|
-
var targetOffset =
|
5582
|
+
var targetOffset = offset - currentPosition;
|
5936
5583
|
if (!props.loop) {
|
5937
5584
|
targetOffset = clamp(targetOffset, minOffset.value, 0);
|
5938
5585
|
}
|
@@ -5941,7 +5588,7 @@ var _Swipe = defineComponent({
|
|
5941
5588
|
var move = (_ref2) => {
|
5942
5589
|
var {
|
5943
5590
|
pace = 0,
|
5944
|
-
offset
|
5591
|
+
offset = 0,
|
5945
5592
|
emitChange
|
5946
5593
|
} = _ref2;
|
5947
5594
|
if (count.value <= 1) {
|
@@ -5951,7 +5598,7 @@ var _Swipe = defineComponent({
|
|
5951
5598
|
active
|
5952
5599
|
} = state;
|
5953
5600
|
var targetActive = getTargetActive(pace);
|
5954
|
-
var targetOffset = getTargetOffset(targetActive,
|
5601
|
+
var targetOffset = getTargetOffset(targetActive, offset);
|
5955
5602
|
if (props.loop) {
|
5956
5603
|
if (children[0] && targetOffset !== minOffset.value) {
|
5957
5604
|
var outRightBound = targetOffset < minOffset.value;
|
@@ -6054,8 +5701,11 @@ var _Swipe = defineComponent({
|
|
6054
5701
|
var onTouchMove = (event) => {
|
6055
5702
|
if (props.touchable && state.swiping) {
|
6056
5703
|
touch.move(event);
|
6057
|
-
|
5704
|
+
var shouldPrevent = isCorrectDirection.value || touch.offsetY.value > touch.offsetX.value === props.vertical;
|
5705
|
+
if (shouldPrevent) {
|
6058
5706
|
preventDefault(event, props.stopPropagation);
|
5707
|
+
}
|
5708
|
+
if (isCorrectDirection.value) {
|
6059
5709
|
move({
|
6060
5710
|
offset: delta.value
|
6061
5711
|
});
|
@@ -6070,10 +5720,10 @@ var _Swipe = defineComponent({
|
|
6070
5720
|
var speed = delta.value / duration;
|
6071
5721
|
var shouldSwipe = Math.abs(speed) > 0.25 || Math.abs(delta.value) > size.value / 2;
|
6072
5722
|
if (shouldSwipe && isCorrectDirection.value) {
|
6073
|
-
var
|
5723
|
+
var offset = props.vertical ? touch.offsetY.value : touch.offsetX.value;
|
6074
5724
|
var pace = 0;
|
6075
5725
|
if (props.loop) {
|
6076
|
-
pace =
|
5726
|
+
pace = offset > 0 ? delta.value > 0 ? -1 : 1 : 0;
|
6077
5727
|
} else {
|
6078
5728
|
pace = -Math[delta.value > 0 ? "ceil" : "floor"](delta.value / size.value);
|
6079
5729
|
}
|
@@ -6338,19 +5988,19 @@ var _Tabs = defineComponent({
|
|
6338
5988
|
lineWidth,
|
6339
5989
|
lineHeight
|
6340
5990
|
} = props;
|
6341
|
-
var
|
5991
|
+
var left = title.offsetLeft + title.offsetWidth / 2;
|
6342
5992
|
var lineStyle = {
|
6343
5993
|
width: addUnit(lineWidth),
|
6344
5994
|
backgroundColor: props.color,
|
6345
|
-
transform: "translateX(" +
|
5995
|
+
transform: "translateX(" + left + "px) translateX(-50%)"
|
6346
5996
|
};
|
6347
5997
|
if (shouldAnimate) {
|
6348
5998
|
lineStyle.transitionDuration = props.duration + "s";
|
6349
5999
|
}
|
6350
6000
|
if (isDef(lineHeight)) {
|
6351
|
-
var
|
6352
|
-
lineStyle.height =
|
6353
|
-
lineStyle.borderRadius =
|
6001
|
+
var height = addUnit(lineHeight);
|
6002
|
+
lineStyle.height = height;
|
6003
|
+
lineStyle.borderRadius = height;
|
6354
6004
|
}
|
6355
6005
|
state.lineStyle = lineStyle;
|
6356
6006
|
});
|
@@ -6439,9 +6089,9 @@ var _Tabs = defineComponent({
|
|
6439
6089
|
var getCurrentIndexOnScroll = () => {
|
6440
6090
|
for (var index2 = 0; index2 < children.length; index2++) {
|
6441
6091
|
var {
|
6442
|
-
top
|
6092
|
+
top
|
6443
6093
|
} = useRect(children[index2].$el);
|
6444
|
-
if (
|
6094
|
+
if (top > scrollOffset.value) {
|
6445
6095
|
return index2 === 0 ? 0 : index2 - 1;
|
6446
6096
|
}
|
6447
6097
|
}
|
@@ -6624,8 +6274,8 @@ var _SwipeItem = defineComponent({
|
|
6624
6274
|
rendered = index2.value === active || index2.value === prevActive || index2.value === nextActive;
|
6625
6275
|
return rendered;
|
6626
6276
|
});
|
6627
|
-
var setOffset = (
|
6628
|
-
state.offset =
|
6277
|
+
var setOffset = (offset) => {
|
6278
|
+
state.offset = offset;
|
6629
6279
|
};
|
6630
6280
|
onMounted(() => {
|
6631
6281
|
nextTick(() => {
|
@@ -6709,7 +6359,7 @@ var _Tab = defineComponent({
|
|
6709
6359
|
return createVNode(SwipeItem, {
|
6710
6360
|
"id": id,
|
6711
6361
|
"role": "tabpanel",
|
6712
|
-
"class": bem$T("
|
6362
|
+
"class": bem$T("panel-wrapper", {
|
6713
6363
|
inactive: !active.value
|
6714
6364
|
}),
|
6715
6365
|
"tabindex": active.value ? 0 : -1,
|
@@ -7214,13 +6864,13 @@ var _Circle = defineComponent({
|
|
7214
6864
|
currentRate,
|
7215
6865
|
strokeLinecap
|
7216
6866
|
} = props;
|
7217
|
-
var
|
6867
|
+
var offset = PERIMETER * currentRate / 100;
|
7218
6868
|
var color = isObject(props.color) ? "url(#" + id + ")" : props.color;
|
7219
6869
|
var style = {
|
7220
6870
|
stroke: color,
|
7221
6871
|
strokeWidth: +strokeWidth + 1 + "px",
|
7222
6872
|
strokeLinecap,
|
7223
|
-
strokeDasharray:
|
6873
|
+
strokeDasharray: offset + "px " + PERIMETER + "px"
|
7224
6874
|
};
|
7225
6875
|
return createVNode("path", {
|
7226
6876
|
"d": path.value,
|
@@ -7329,11 +6979,11 @@ var _Row = defineComponent({
|
|
7329
6979
|
right: averagePadding
|
7330
6980
|
});
|
7331
6981
|
} else {
|
7332
|
-
var
|
7333
|
-
var
|
6982
|
+
var left = gutter - spaces2[item - 1].right;
|
6983
|
+
var right = averagePadding - left;
|
7334
6984
|
spaces2.push({
|
7335
|
-
left
|
7336
|
-
right
|
6985
|
+
left,
|
6986
|
+
right
|
7337
6987
|
});
|
7338
6988
|
}
|
7339
6989
|
});
|
@@ -7388,12 +7038,12 @@ var _Col = defineComponent({
|
|
7388
7038
|
} = parent;
|
7389
7039
|
if (spaces && spaces.value && spaces.value[index2.value]) {
|
7390
7040
|
var {
|
7391
|
-
left
|
7392
|
-
right
|
7041
|
+
left,
|
7042
|
+
right
|
7393
7043
|
} = spaces.value[index2.value];
|
7394
7044
|
return {
|
7395
|
-
paddingLeft:
|
7396
|
-
paddingRight:
|
7045
|
+
paddingLeft: left ? left + "px" : null,
|
7046
|
+
paddingRight: right ? right + "px" : null
|
7397
7047
|
};
|
7398
7048
|
}
|
7399
7049
|
});
|
@@ -7401,13 +7051,13 @@ var _Col = defineComponent({
|
|
7401
7051
|
var {
|
7402
7052
|
tag,
|
7403
7053
|
span,
|
7404
|
-
offset
|
7054
|
+
offset
|
7405
7055
|
} = props;
|
7406
7056
|
return createVNode(tag, {
|
7407
7057
|
"style": style.value,
|
7408
7058
|
"class": bem$M({
|
7409
7059
|
[span]: span,
|
7410
|
-
["offset-" +
|
7060
|
+
["offset-" + offset]: offset
|
7411
7061
|
})
|
7412
7062
|
}, {
|
7413
7063
|
default: () => [slots.default == null ? void 0 : slots.default()]
|
@@ -7878,7 +7528,7 @@ var _CountDown = defineComponent({
|
|
7878
7528
|
slots
|
7879
7529
|
} = _ref;
|
7880
7530
|
var {
|
7881
|
-
start
|
7531
|
+
start,
|
7882
7532
|
pause,
|
7883
7533
|
reset,
|
7884
7534
|
current: current2
|
@@ -7892,14 +7542,14 @@ var _CountDown = defineComponent({
|
|
7892
7542
|
var resetTime = () => {
|
7893
7543
|
reset(+props.time);
|
7894
7544
|
if (props.autoStart) {
|
7895
|
-
|
7545
|
+
start();
|
7896
7546
|
}
|
7897
7547
|
};
|
7898
7548
|
watch(() => props.time, resetTime, {
|
7899
7549
|
immediate: true
|
7900
7550
|
});
|
7901
7551
|
useExpose({
|
7902
|
-
start
|
7552
|
+
start,
|
7903
7553
|
pause,
|
7904
7554
|
reset: resetTime
|
7905
7555
|
});
|
@@ -8757,7 +8407,7 @@ var VanDialog = defineComponent({
|
|
8757
8407
|
};
|
8758
8408
|
return () => {
|
8759
8409
|
var {
|
8760
|
-
width
|
8410
|
+
width,
|
8761
8411
|
title,
|
8762
8412
|
theme,
|
8763
8413
|
message,
|
@@ -8767,7 +8417,7 @@ var VanDialog = defineComponent({
|
|
8767
8417
|
"role": "dialog",
|
8768
8418
|
"class": [bem$B([theme]), className],
|
8769
8419
|
"style": {
|
8770
|
-
width: addUnit(
|
8420
|
+
width: addUnit(width)
|
8771
8421
|
},
|
8772
8422
|
"aria-labelledby": title || message,
|
8773
8423
|
"onUpdate:show": updateShow
|
@@ -8795,7 +8445,7 @@ function initInstance$2() {
|
|
8795
8445
|
} = mountComponent(Wrapper));
|
8796
8446
|
}
|
8797
8447
|
function Dialog(options) {
|
8798
|
-
if (!inBrowser
|
8448
|
+
if (!inBrowser) {
|
8799
8449
|
return Promise.resolve();
|
8800
8450
|
}
|
8801
8451
|
return new Promise((resolve, reject) => {
|
@@ -8900,7 +8550,7 @@ var _DropdownMenu = defineComponent({
|
|
8900
8550
|
var id = useId();
|
8901
8551
|
var root = ref();
|
8902
8552
|
var barRef = ref();
|
8903
|
-
var
|
8553
|
+
var offset = ref(0);
|
8904
8554
|
var {
|
8905
8555
|
children,
|
8906
8556
|
linkChildren
|
@@ -8925,9 +8575,9 @@ var _DropdownMenu = defineComponent({
|
|
8925
8575
|
if (barRef.value) {
|
8926
8576
|
var rect = useRect(barRef);
|
8927
8577
|
if (props.direction === "down") {
|
8928
|
-
|
8578
|
+
offset.value = rect.bottom;
|
8929
8579
|
} else {
|
8930
|
-
|
8580
|
+
offset.value = windowHeight.value - rect.top;
|
8931
8581
|
}
|
8932
8582
|
}
|
8933
8583
|
};
|
@@ -8985,7 +8635,7 @@ var _DropdownMenu = defineComponent({
|
|
8985
8635
|
linkChildren({
|
8986
8636
|
id,
|
8987
8637
|
props,
|
8988
|
-
offset
|
8638
|
+
offset
|
8989
8639
|
});
|
8990
8640
|
useClickAway(root, onClickAway);
|
8991
8641
|
useEventListener("scroll", onScroll, {
|
@@ -9114,7 +8764,7 @@ var _DropdownItem = defineComponent({
|
|
9114
8764
|
};
|
9115
8765
|
var renderContent = () => {
|
9116
8766
|
var {
|
9117
|
-
offset
|
8767
|
+
offset
|
9118
8768
|
} = parent;
|
9119
8769
|
var {
|
9120
8770
|
zIndex,
|
@@ -9125,9 +8775,9 @@ var _DropdownItem = defineComponent({
|
|
9125
8775
|
} = parent.props;
|
9126
8776
|
var style = getZIndexStyle(zIndex);
|
9127
8777
|
if (direction === "down") {
|
9128
|
-
style.top =
|
8778
|
+
style.top = offset.value + "px";
|
9129
8779
|
} else {
|
9130
|
-
style.bottom =
|
8780
|
+
style.bottom = offset.value + "px";
|
9131
8781
|
}
|
9132
8782
|
return withDirectives(createVNode("div", {
|
9133
8783
|
"style": style,
|
@@ -9175,9 +8825,9 @@ var _DropdownItem = defineComponent({
|
|
9175
8825
|
var DropdownItem = withInstall(_DropdownItem);
|
9176
8826
|
var DropdownMenu = withInstall(_DropdownMenu);
|
9177
8827
|
var prefix = "van-empty-network-";
|
9178
|
-
var renderStop = (color,
|
8828
|
+
var renderStop = (color, offset, opacity) => createVNode("stop", {
|
9179
8829
|
"stop-color": color,
|
9180
|
-
"offset":
|
8830
|
+
"offset": offset + "%",
|
9181
8831
|
"stop-opacity": opacity
|
9182
8832
|
}, null);
|
9183
8833
|
var Network = createVNode("svg", {
|
@@ -9908,7 +9558,7 @@ var ImagePreview = function(options, startPosition) {
|
|
9908
9558
|
if (startPosition === void 0) {
|
9909
9559
|
startPosition = 0;
|
9910
9560
|
}
|
9911
|
-
if (!inBrowser
|
9561
|
+
if (!inBrowser) {
|
9912
9562
|
return;
|
9913
9563
|
}
|
9914
9564
|
if (!instance$1) {
|
@@ -10188,7 +9838,7 @@ var _IndexAnchor = defineComponent({
|
|
10188
9838
|
});
|
10189
9839
|
var IndexAnchor = withInstall(_IndexAnchor);
|
10190
9840
|
var IndexBar = withInstall(_IndexBar);
|
10191
|
-
var hasIntersectionObserver = inBrowser && "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype;
|
9841
|
+
var hasIntersectionObserver = inBrowser$1 && "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype;
|
10192
9842
|
var modeType = {
|
10193
9843
|
event: "event",
|
10194
9844
|
observer: "observer"
|
@@ -10259,10 +9909,10 @@ var getDPR = function(scale) {
|
|
10259
9909
|
if (scale === void 0) {
|
10260
9910
|
scale = 1;
|
10261
9911
|
}
|
10262
|
-
return inBrowser ? window.devicePixelRatio || scale : scale;
|
9912
|
+
return inBrowser$1 ? window.devicePixelRatio || scale : scale;
|
10263
9913
|
};
|
10264
9914
|
function supportWebp() {
|
10265
|
-
if (!inBrowser)
|
9915
|
+
if (!inBrowser$1)
|
10266
9916
|
return false;
|
10267
9917
|
var support = true;
|
10268
9918
|
try {
|
@@ -10571,7 +10221,7 @@ function Lazy() {
|
|
10571
10221
|
}
|
10572
10222
|
addLazyBox(vm) {
|
10573
10223
|
this.listeners.push(vm);
|
10574
|
-
if (inBrowser) {
|
10224
|
+
if (inBrowser$1) {
|
10575
10225
|
this.addListenerTarget(window);
|
10576
10226
|
this.observer && this.observer.observe(vm.el);
|
10577
10227
|
if (vm.$el && vm.$el.parentNode) {
|
@@ -10598,7 +10248,7 @@ function Lazy() {
|
|
10598
10248
|
$parent = $parent ? $parent.$el || $parent : document.getElementById(container);
|
10599
10249
|
}
|
10600
10250
|
if (!$parent) {
|
10601
|
-
$parent = getScrollParent
|
10251
|
+
$parent = getScrollParent(el);
|
10602
10252
|
}
|
10603
10253
|
var newListener = new ReactiveListener({
|
10604
10254
|
bindType: binding.arg,
|
@@ -10613,7 +10263,7 @@ function Lazy() {
|
|
10613
10263
|
imageCache: this.imageCache
|
10614
10264
|
});
|
10615
10265
|
this.listeners.push(newListener);
|
10616
|
-
if (inBrowser) {
|
10266
|
+
if (inBrowser$1) {
|
10617
10267
|
this.addListenerTarget(window);
|
10618
10268
|
this.addListenerTarget($parent);
|
10619
10269
|
}
|
@@ -10718,8 +10368,8 @@ function Lazy() {
|
|
10718
10368
|
}
|
10719
10369
|
});
|
10720
10370
|
}
|
10721
|
-
initListen(el,
|
10722
|
-
this.options.ListenEvents.forEach((evt) => (
|
10371
|
+
initListen(el, start) {
|
10372
|
+
this.options.ListenEvents.forEach((evt) => (start ? on : off)(el, evt, this.lazyLoadHandler));
|
10723
10373
|
}
|
10724
10374
|
initEvent() {
|
10725
10375
|
var _this = this;
|
@@ -10888,7 +10538,7 @@ var LazyComponent = (lazy) => ({
|
|
10888
10538
|
methods: {
|
10889
10539
|
checkInView() {
|
10890
10540
|
var rect = useRect(this.$el);
|
10891
|
-
return inBrowser && rect.top < window.innerHeight * lazy.options.preLoad && rect.bottom > 0 && rect.left < window.innerWidth * lazy.options.preLoad && rect.right > 0;
|
10541
|
+
return inBrowser$1 && rect.top < window.innerHeight * lazy.options.preLoad && rect.bottom > 0 && rect.left < window.innerWidth * lazy.options.preLoad && rect.right > 0;
|
10892
10542
|
},
|
10893
10543
|
load() {
|
10894
10544
|
this.show = true;
|
@@ -11142,7 +10792,7 @@ var _List = defineComponent({
|
|
11142
10792
|
return;
|
11143
10793
|
}
|
11144
10794
|
var {
|
11145
|
-
offset
|
10795
|
+
offset,
|
11146
10796
|
direction
|
11147
10797
|
} = props;
|
11148
10798
|
var scrollParentRect = useRect(scrollParent);
|
@@ -11152,9 +10802,9 @@ var _List = defineComponent({
|
|
11152
10802
|
var isReachEdge = false;
|
11153
10803
|
var placeholderRect = useRect(placeholder);
|
11154
10804
|
if (direction === "up") {
|
11155
|
-
isReachEdge = scrollParentRect.top - placeholderRect.top <=
|
10805
|
+
isReachEdge = scrollParentRect.top - placeholderRect.top <= offset;
|
11156
10806
|
} else {
|
11157
|
-
isReachEdge = placeholderRect.bottom - scrollParentRect.bottom <=
|
10807
|
+
isReachEdge = placeholderRect.bottom - scrollParentRect.bottom <= offset;
|
11158
10808
|
}
|
11159
10809
|
if (isReachEdge) {
|
11160
10810
|
loading.value = true;
|
@@ -11240,11 +10890,11 @@ var _List = defineComponent({
|
|
11240
10890
|
});
|
11241
10891
|
var List = withInstall(_List);
|
11242
10892
|
function usePlaceholder(contentRef, bem2) {
|
11243
|
-
var
|
10893
|
+
var height = useHeight(contentRef);
|
11244
10894
|
return (renderContent) => createVNode("div", {
|
11245
10895
|
"class": bem2("placeholder"),
|
11246
10896
|
"style": {
|
11247
|
-
height:
|
10897
|
+
height: height.value ? height.value + "px" : void 0
|
11248
10898
|
}
|
11249
10899
|
}, [renderContent()]);
|
11250
10900
|
}
|
@@ -11546,7 +11196,7 @@ function initInstance() {
|
|
11546
11196
|
}));
|
11547
11197
|
}
|
11548
11198
|
function Notify(options) {
|
11549
|
-
if (!inBrowser
|
11199
|
+
if (!inBrowser) {
|
11550
11200
|
return;
|
11551
11201
|
}
|
11552
11202
|
if (!instance) {
|
@@ -12104,737 +11754,6 @@ var _PasswordInput = defineComponent({
|
|
12104
11754
|
}
|
12105
11755
|
});
|
12106
11756
|
var PasswordInput = withInstall(_PasswordInput);
|
12107
|
-
function getBoundingClientRect(element, includeScale) {
|
12108
|
-
var rect = element.getBoundingClientRect();
|
12109
|
-
var scaleX = 1;
|
12110
|
-
var scaleY = 1;
|
12111
|
-
return {
|
12112
|
-
width: rect.width / scaleX,
|
12113
|
-
height: rect.height / scaleY,
|
12114
|
-
top: rect.top / scaleY,
|
12115
|
-
right: rect.right / scaleX,
|
12116
|
-
bottom: rect.bottom / scaleY,
|
12117
|
-
left: rect.left / scaleX,
|
12118
|
-
x: rect.left / scaleX,
|
12119
|
-
y: rect.top / scaleY
|
12120
|
-
};
|
12121
|
-
}
|
12122
|
-
function getWindow(node) {
|
12123
|
-
if (node == null) {
|
12124
|
-
return window;
|
12125
|
-
}
|
12126
|
-
if (node.toString() !== "[object Window]") {
|
12127
|
-
var ownerDocument = node.ownerDocument;
|
12128
|
-
return ownerDocument ? ownerDocument.defaultView || window : window;
|
12129
|
-
}
|
12130
|
-
return node;
|
12131
|
-
}
|
12132
|
-
function getWindowScroll(node) {
|
12133
|
-
var win = getWindow(node);
|
12134
|
-
var scrollLeft = win.pageXOffset;
|
12135
|
-
var scrollTop = win.pageYOffset;
|
12136
|
-
return {
|
12137
|
-
scrollLeft,
|
12138
|
-
scrollTop
|
12139
|
-
};
|
12140
|
-
}
|
12141
|
-
function isElement(node) {
|
12142
|
-
var OwnElement = getWindow(node).Element;
|
12143
|
-
return node instanceof OwnElement || node instanceof Element;
|
12144
|
-
}
|
12145
|
-
function isHTMLElement(node) {
|
12146
|
-
var OwnElement = getWindow(node).HTMLElement;
|
12147
|
-
return node instanceof OwnElement || node instanceof HTMLElement;
|
12148
|
-
}
|
12149
|
-
function isShadowRoot(node) {
|
12150
|
-
if (typeof ShadowRoot === "undefined") {
|
12151
|
-
return false;
|
12152
|
-
}
|
12153
|
-
var OwnElement = getWindow(node).ShadowRoot;
|
12154
|
-
return node instanceof OwnElement || node instanceof ShadowRoot;
|
12155
|
-
}
|
12156
|
-
function getHTMLElementScroll(element) {
|
12157
|
-
return {
|
12158
|
-
scrollLeft: element.scrollLeft,
|
12159
|
-
scrollTop: element.scrollTop
|
12160
|
-
};
|
12161
|
-
}
|
12162
|
-
function getNodeScroll(node) {
|
12163
|
-
if (node === getWindow(node) || !isHTMLElement(node)) {
|
12164
|
-
return getWindowScroll(node);
|
12165
|
-
} else {
|
12166
|
-
return getHTMLElementScroll(node);
|
12167
|
-
}
|
12168
|
-
}
|
12169
|
-
function getNodeName(element) {
|
12170
|
-
return element ? (element.nodeName || "").toLowerCase() : null;
|
12171
|
-
}
|
12172
|
-
function getDocumentElement(element) {
|
12173
|
-
return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
|
12174
|
-
}
|
12175
|
-
function getWindowScrollBarX(element) {
|
12176
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
12177
|
-
}
|
12178
|
-
function getComputedStyle(element) {
|
12179
|
-
return getWindow(element).getComputedStyle(element);
|
12180
|
-
}
|
12181
|
-
function isScrollParent(element) {
|
12182
|
-
var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
12183
|
-
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
12184
|
-
}
|
12185
|
-
function isElementScaled(element) {
|
12186
|
-
var rect = element.getBoundingClientRect();
|
12187
|
-
var scaleX = rect.width / element.offsetWidth || 1;
|
12188
|
-
var scaleY = rect.height / element.offsetHeight || 1;
|
12189
|
-
return scaleX !== 1 || scaleY !== 1;
|
12190
|
-
}
|
12191
|
-
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
12192
|
-
if (isFixed === void 0) {
|
12193
|
-
isFixed = false;
|
12194
|
-
}
|
12195
|
-
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
12196
|
-
isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
12197
|
-
var documentElement = getDocumentElement(offsetParent);
|
12198
|
-
var rect = getBoundingClientRect(elementOrVirtualElement);
|
12199
|
-
var scroll = {
|
12200
|
-
scrollLeft: 0,
|
12201
|
-
scrollTop: 0
|
12202
|
-
};
|
12203
|
-
var offsets = {
|
12204
|
-
x: 0,
|
12205
|
-
y: 0
|
12206
|
-
};
|
12207
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
12208
|
-
if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
|
12209
|
-
scroll = getNodeScroll(offsetParent);
|
12210
|
-
}
|
12211
|
-
if (isHTMLElement(offsetParent)) {
|
12212
|
-
offsets = getBoundingClientRect(offsetParent);
|
12213
|
-
offsets.x += offsetParent.clientLeft;
|
12214
|
-
offsets.y += offsetParent.clientTop;
|
12215
|
-
} else if (documentElement) {
|
12216
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
12217
|
-
}
|
12218
|
-
}
|
12219
|
-
return {
|
12220
|
-
x: rect.left + scroll.scrollLeft - offsets.x,
|
12221
|
-
y: rect.top + scroll.scrollTop - offsets.y,
|
12222
|
-
width: rect.width,
|
12223
|
-
height: rect.height
|
12224
|
-
};
|
12225
|
-
}
|
12226
|
-
function getLayoutRect(element) {
|
12227
|
-
var clientRect = getBoundingClientRect(element);
|
12228
|
-
var width2 = element.offsetWidth;
|
12229
|
-
var height2 = element.offsetHeight;
|
12230
|
-
if (Math.abs(clientRect.width - width2) <= 1) {
|
12231
|
-
width2 = clientRect.width;
|
12232
|
-
}
|
12233
|
-
if (Math.abs(clientRect.height - height2) <= 1) {
|
12234
|
-
height2 = clientRect.height;
|
12235
|
-
}
|
12236
|
-
return {
|
12237
|
-
x: element.offsetLeft,
|
12238
|
-
y: element.offsetTop,
|
12239
|
-
width: width2,
|
12240
|
-
height: height2
|
12241
|
-
};
|
12242
|
-
}
|
12243
|
-
function getParentNode(element) {
|
12244
|
-
if (getNodeName(element) === "html") {
|
12245
|
-
return element;
|
12246
|
-
}
|
12247
|
-
return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
|
12248
|
-
}
|
12249
|
-
function getScrollParent(node) {
|
12250
|
-
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
12251
|
-
return node.ownerDocument.body;
|
12252
|
-
}
|
12253
|
-
if (isHTMLElement(node) && isScrollParent(node)) {
|
12254
|
-
return node;
|
12255
|
-
}
|
12256
|
-
return getScrollParent(getParentNode(node));
|
12257
|
-
}
|
12258
|
-
function listScrollParents(element, list) {
|
12259
|
-
var _element$ownerDocumen;
|
12260
|
-
if (list === void 0) {
|
12261
|
-
list = [];
|
12262
|
-
}
|
12263
|
-
var scrollParent = getScrollParent(element);
|
12264
|
-
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
12265
|
-
var win = getWindow(scrollParent);
|
12266
|
-
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
12267
|
-
var updatedList = list.concat(target);
|
12268
|
-
return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
|
12269
|
-
}
|
12270
|
-
function isTableElement(element) {
|
12271
|
-
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
12272
|
-
}
|
12273
|
-
function getTrueOffsetParent(element) {
|
12274
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
12275
|
-
return null;
|
12276
|
-
}
|
12277
|
-
return element.offsetParent;
|
12278
|
-
}
|
12279
|
-
function getContainingBlock(element) {
|
12280
|
-
var isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1;
|
12281
|
-
var isIE = navigator.userAgent.indexOf("Trident") !== -1;
|
12282
|
-
if (isIE && isHTMLElement(element)) {
|
12283
|
-
var elementCss = getComputedStyle(element);
|
12284
|
-
if (elementCss.position === "fixed") {
|
12285
|
-
return null;
|
12286
|
-
}
|
12287
|
-
}
|
12288
|
-
var currentNode = getParentNode(element);
|
12289
|
-
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
12290
|
-
var css = getComputedStyle(currentNode);
|
12291
|
-
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
|
12292
|
-
return currentNode;
|
12293
|
-
} else {
|
12294
|
-
currentNode = currentNode.parentNode;
|
12295
|
-
}
|
12296
|
-
}
|
12297
|
-
return null;
|
12298
|
-
}
|
12299
|
-
function getOffsetParent(element) {
|
12300
|
-
var window2 = getWindow(element);
|
12301
|
-
var offsetParent = getTrueOffsetParent(element);
|
12302
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
12303
|
-
offsetParent = getTrueOffsetParent(offsetParent);
|
12304
|
-
}
|
12305
|
-
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
|
12306
|
-
return window2;
|
12307
|
-
}
|
12308
|
-
return offsetParent || getContainingBlock(element) || window2;
|
12309
|
-
}
|
12310
|
-
var top = "top";
|
12311
|
-
var bottom = "bottom";
|
12312
|
-
var right = "right";
|
12313
|
-
var left = "left";
|
12314
|
-
var auto = "auto";
|
12315
|
-
var basePlacements = [top, bottom, right, left];
|
12316
|
-
var start = "start";
|
12317
|
-
var end = "end";
|
12318
|
-
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
|
12319
|
-
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
12320
|
-
}, []);
|
12321
|
-
var beforeRead = "beforeRead";
|
12322
|
-
var read = "read";
|
12323
|
-
var afterRead = "afterRead";
|
12324
|
-
var beforeMain = "beforeMain";
|
12325
|
-
var main = "main";
|
12326
|
-
var afterMain = "afterMain";
|
12327
|
-
var beforeWrite = "beforeWrite";
|
12328
|
-
var write = "write";
|
12329
|
-
var afterWrite = "afterWrite";
|
12330
|
-
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
12331
|
-
function order(modifiers) {
|
12332
|
-
var map = new Map();
|
12333
|
-
var visited = new Set();
|
12334
|
-
var result = [];
|
12335
|
-
modifiers.forEach(function(modifier) {
|
12336
|
-
map.set(modifier.name, modifier);
|
12337
|
-
});
|
12338
|
-
function sort(modifier) {
|
12339
|
-
visited.add(modifier.name);
|
12340
|
-
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
12341
|
-
requires.forEach(function(dep) {
|
12342
|
-
if (!visited.has(dep)) {
|
12343
|
-
var depModifier = map.get(dep);
|
12344
|
-
if (depModifier) {
|
12345
|
-
sort(depModifier);
|
12346
|
-
}
|
12347
|
-
}
|
12348
|
-
});
|
12349
|
-
result.push(modifier);
|
12350
|
-
}
|
12351
|
-
modifiers.forEach(function(modifier) {
|
12352
|
-
if (!visited.has(modifier.name)) {
|
12353
|
-
sort(modifier);
|
12354
|
-
}
|
12355
|
-
});
|
12356
|
-
return result;
|
12357
|
-
}
|
12358
|
-
function orderModifiers(modifiers) {
|
12359
|
-
var orderedModifiers = order(modifiers);
|
12360
|
-
return modifierPhases.reduce(function(acc, phase) {
|
12361
|
-
return acc.concat(orderedModifiers.filter(function(modifier) {
|
12362
|
-
return modifier.phase === phase;
|
12363
|
-
}));
|
12364
|
-
}, []);
|
12365
|
-
}
|
12366
|
-
function debounce(fn2) {
|
12367
|
-
var pending;
|
12368
|
-
return function() {
|
12369
|
-
if (!pending) {
|
12370
|
-
pending = new Promise(function(resolve) {
|
12371
|
-
Promise.resolve().then(function() {
|
12372
|
-
pending = void 0;
|
12373
|
-
resolve(fn2());
|
12374
|
-
});
|
12375
|
-
});
|
12376
|
-
}
|
12377
|
-
return pending;
|
12378
|
-
};
|
12379
|
-
}
|
12380
|
-
function getBasePlacement(placement) {
|
12381
|
-
return placement.split("-")[0];
|
12382
|
-
}
|
12383
|
-
function mergeByName(modifiers) {
|
12384
|
-
var merged = modifiers.reduce(function(merged2, current2) {
|
12385
|
-
var existing = merged2[current2.name];
|
12386
|
-
merged2[current2.name] = existing ? Object.assign({}, existing, current2, {
|
12387
|
-
options: Object.assign({}, existing.options, current2.options),
|
12388
|
-
data: Object.assign({}, existing.data, current2.data)
|
12389
|
-
}) : current2;
|
12390
|
-
return merged2;
|
12391
|
-
}, {});
|
12392
|
-
return Object.keys(merged).map(function(key) {
|
12393
|
-
return merged[key];
|
12394
|
-
});
|
12395
|
-
}
|
12396
|
-
var round = Math.round;
|
12397
|
-
function getVariation(placement) {
|
12398
|
-
return placement.split("-")[1];
|
12399
|
-
}
|
12400
|
-
function getMainAxisFromPlacement(placement) {
|
12401
|
-
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
12402
|
-
}
|
12403
|
-
function computeOffsets(_ref) {
|
12404
|
-
var reference = _ref.reference, element = _ref.element, placement = _ref.placement;
|
12405
|
-
var basePlacement = placement ? getBasePlacement(placement) : null;
|
12406
|
-
var variation = placement ? getVariation(placement) : null;
|
12407
|
-
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
12408
|
-
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
12409
|
-
var offsets;
|
12410
|
-
switch (basePlacement) {
|
12411
|
-
case top:
|
12412
|
-
offsets = {
|
12413
|
-
x: commonX,
|
12414
|
-
y: reference.y - element.height
|
12415
|
-
};
|
12416
|
-
break;
|
12417
|
-
case bottom:
|
12418
|
-
offsets = {
|
12419
|
-
x: commonX,
|
12420
|
-
y: reference.y + reference.height
|
12421
|
-
};
|
12422
|
-
break;
|
12423
|
-
case right:
|
12424
|
-
offsets = {
|
12425
|
-
x: reference.x + reference.width,
|
12426
|
-
y: commonY
|
12427
|
-
};
|
12428
|
-
break;
|
12429
|
-
case left:
|
12430
|
-
offsets = {
|
12431
|
-
x: reference.x - element.width,
|
12432
|
-
y: commonY
|
12433
|
-
};
|
12434
|
-
break;
|
12435
|
-
default:
|
12436
|
-
offsets = {
|
12437
|
-
x: reference.x,
|
12438
|
-
y: reference.y
|
12439
|
-
};
|
12440
|
-
}
|
12441
|
-
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
12442
|
-
if (mainAxis != null) {
|
12443
|
-
var len = mainAxis === "y" ? "height" : "width";
|
12444
|
-
switch (variation) {
|
12445
|
-
case start:
|
12446
|
-
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
12447
|
-
break;
|
12448
|
-
case end:
|
12449
|
-
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
12450
|
-
break;
|
12451
|
-
}
|
12452
|
-
}
|
12453
|
-
return offsets;
|
12454
|
-
}
|
12455
|
-
var DEFAULT_OPTIONS = {
|
12456
|
-
placement: "bottom",
|
12457
|
-
modifiers: [],
|
12458
|
-
strategy: "absolute"
|
12459
|
-
};
|
12460
|
-
function areValidElements() {
|
12461
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
12462
|
-
args[_key] = arguments[_key];
|
12463
|
-
}
|
12464
|
-
return !args.some(function(element) {
|
12465
|
-
return !(element && typeof element.getBoundingClientRect === "function");
|
12466
|
-
});
|
12467
|
-
}
|
12468
|
-
function popperGenerator(generatorOptions) {
|
12469
|
-
if (generatorOptions === void 0) {
|
12470
|
-
generatorOptions = {};
|
12471
|
-
}
|
12472
|
-
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions2 = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
12473
|
-
return function createPopper2(reference, popper, options) {
|
12474
|
-
if (options === void 0) {
|
12475
|
-
options = defaultOptions2;
|
12476
|
-
}
|
12477
|
-
var state = {
|
12478
|
-
placement: "bottom",
|
12479
|
-
orderedModifiers: [],
|
12480
|
-
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions2),
|
12481
|
-
modifiersData: {},
|
12482
|
-
elements: {
|
12483
|
-
reference,
|
12484
|
-
popper
|
12485
|
-
},
|
12486
|
-
attributes: {},
|
12487
|
-
styles: {}
|
12488
|
-
};
|
12489
|
-
var effectCleanupFns = [];
|
12490
|
-
var isDestroyed = false;
|
12491
|
-
var instance2 = {
|
12492
|
-
state,
|
12493
|
-
setOptions: function setOptions(setOptionsAction) {
|
12494
|
-
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
|
12495
|
-
cleanupModifierEffects();
|
12496
|
-
state.options = Object.assign({}, defaultOptions2, state.options, options2);
|
12497
|
-
state.scrollParents = {
|
12498
|
-
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
12499
|
-
popper: listScrollParents(popper)
|
12500
|
-
};
|
12501
|
-
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
|
12502
|
-
state.orderedModifiers = orderedModifiers.filter(function(m) {
|
12503
|
-
return m.enabled;
|
12504
|
-
});
|
12505
|
-
runModifierEffects();
|
12506
|
-
return instance2.update();
|
12507
|
-
},
|
12508
|
-
forceUpdate: function forceUpdate() {
|
12509
|
-
if (isDestroyed) {
|
12510
|
-
return;
|
12511
|
-
}
|
12512
|
-
var _state$elements = state.elements, reference2 = _state$elements.reference, popper2 = _state$elements.popper;
|
12513
|
-
if (!areValidElements(reference2, popper2)) {
|
12514
|
-
return;
|
12515
|
-
}
|
12516
|
-
state.rects = {
|
12517
|
-
reference: getCompositeRect(reference2, getOffsetParent(popper2), state.options.strategy === "fixed"),
|
12518
|
-
popper: getLayoutRect(popper2)
|
12519
|
-
};
|
12520
|
-
state.reset = false;
|
12521
|
-
state.placement = state.options.placement;
|
12522
|
-
state.orderedModifiers.forEach(function(modifier) {
|
12523
|
-
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
12524
|
-
});
|
12525
|
-
for (var index2 = 0; index2 < state.orderedModifiers.length; index2++) {
|
12526
|
-
if (state.reset === true) {
|
12527
|
-
state.reset = false;
|
12528
|
-
index2 = -1;
|
12529
|
-
continue;
|
12530
|
-
}
|
12531
|
-
var _state$orderedModifie = state.orderedModifiers[index2], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name2 = _state$orderedModifie.name;
|
12532
|
-
if (typeof fn2 === "function") {
|
12533
|
-
state = fn2({
|
12534
|
-
state,
|
12535
|
-
options: _options,
|
12536
|
-
name: name2,
|
12537
|
-
instance: instance2
|
12538
|
-
}) || state;
|
12539
|
-
}
|
12540
|
-
}
|
12541
|
-
},
|
12542
|
-
update: debounce(function() {
|
12543
|
-
return new Promise(function(resolve) {
|
12544
|
-
instance2.forceUpdate();
|
12545
|
-
resolve(state);
|
12546
|
-
});
|
12547
|
-
}),
|
12548
|
-
destroy: function destroy() {
|
12549
|
-
cleanupModifierEffects();
|
12550
|
-
isDestroyed = true;
|
12551
|
-
}
|
12552
|
-
};
|
12553
|
-
if (!areValidElements(reference, popper)) {
|
12554
|
-
return instance2;
|
12555
|
-
}
|
12556
|
-
instance2.setOptions(options).then(function(state2) {
|
12557
|
-
if (!isDestroyed && options.onFirstUpdate) {
|
12558
|
-
options.onFirstUpdate(state2);
|
12559
|
-
}
|
12560
|
-
});
|
12561
|
-
function runModifierEffects() {
|
12562
|
-
state.orderedModifiers.forEach(function(_ref3) {
|
12563
|
-
var name2 = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect2 = _ref3.effect;
|
12564
|
-
if (typeof effect2 === "function") {
|
12565
|
-
var cleanupFn = effect2({
|
12566
|
-
state,
|
12567
|
-
name: name2,
|
12568
|
-
instance: instance2,
|
12569
|
-
options: options2
|
12570
|
-
});
|
12571
|
-
var noopFn = function noopFn2() {
|
12572
|
-
};
|
12573
|
-
effectCleanupFns.push(cleanupFn || noopFn);
|
12574
|
-
}
|
12575
|
-
});
|
12576
|
-
}
|
12577
|
-
function cleanupModifierEffects() {
|
12578
|
-
effectCleanupFns.forEach(function(fn2) {
|
12579
|
-
return fn2();
|
12580
|
-
});
|
12581
|
-
effectCleanupFns = [];
|
12582
|
-
}
|
12583
|
-
return instance2;
|
12584
|
-
};
|
12585
|
-
}
|
12586
|
-
var passive = {
|
12587
|
-
passive: true
|
12588
|
-
};
|
12589
|
-
function effect$1(_ref) {
|
12590
|
-
var state = _ref.state, instance2 = _ref.instance, options = _ref.options;
|
12591
|
-
var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
|
12592
|
-
var window2 = getWindow(state.elements.popper);
|
12593
|
-
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
12594
|
-
if (scroll) {
|
12595
|
-
scrollParents.forEach(function(scrollParent) {
|
12596
|
-
scrollParent.addEventListener("scroll", instance2.update, passive);
|
12597
|
-
});
|
12598
|
-
}
|
12599
|
-
if (resize) {
|
12600
|
-
window2.addEventListener("resize", instance2.update, passive);
|
12601
|
-
}
|
12602
|
-
return function() {
|
12603
|
-
if (scroll) {
|
12604
|
-
scrollParents.forEach(function(scrollParent) {
|
12605
|
-
scrollParent.removeEventListener("scroll", instance2.update, passive);
|
12606
|
-
});
|
12607
|
-
}
|
12608
|
-
if (resize) {
|
12609
|
-
window2.removeEventListener("resize", instance2.update, passive);
|
12610
|
-
}
|
12611
|
-
};
|
12612
|
-
}
|
12613
|
-
var eventListeners = {
|
12614
|
-
name: "eventListeners",
|
12615
|
-
enabled: true,
|
12616
|
-
phase: "write",
|
12617
|
-
fn: function fn() {
|
12618
|
-
},
|
12619
|
-
effect: effect$1,
|
12620
|
-
data: {}
|
12621
|
-
};
|
12622
|
-
function popperOffsets(_ref) {
|
12623
|
-
var state = _ref.state, name2 = _ref.name;
|
12624
|
-
state.modifiersData[name2] = computeOffsets({
|
12625
|
-
reference: state.rects.reference,
|
12626
|
-
element: state.rects.popper,
|
12627
|
-
strategy: "absolute",
|
12628
|
-
placement: state.placement
|
12629
|
-
});
|
12630
|
-
}
|
12631
|
-
var popperOffsets$1 = {
|
12632
|
-
name: "popperOffsets",
|
12633
|
-
enabled: true,
|
12634
|
-
phase: "read",
|
12635
|
-
fn: popperOffsets,
|
12636
|
-
data: {}
|
12637
|
-
};
|
12638
|
-
var unsetSides = {
|
12639
|
-
top: "auto",
|
12640
|
-
right: "auto",
|
12641
|
-
bottom: "auto",
|
12642
|
-
left: "auto"
|
12643
|
-
};
|
12644
|
-
function roundOffsetsByDPR(_ref) {
|
12645
|
-
var x = _ref.x, y = _ref.y;
|
12646
|
-
var win = window;
|
12647
|
-
var dpr = win.devicePixelRatio || 1;
|
12648
|
-
return {
|
12649
|
-
x: round(round(x * dpr) / dpr) || 0,
|
12650
|
-
y: round(round(y * dpr) / dpr) || 0
|
12651
|
-
};
|
12652
|
-
}
|
12653
|
-
function mapToStyles(_ref2) {
|
12654
|
-
var _Object$assign2;
|
12655
|
-
var popper = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets;
|
12656
|
-
var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === "function" ? roundOffsets(offsets) : offsets, _ref3$x = _ref3.x, x = _ref3$x === void 0 ? 0 : _ref3$x, _ref3$y = _ref3.y, y = _ref3$y === void 0 ? 0 : _ref3$y;
|
12657
|
-
var hasX = offsets.hasOwnProperty("x");
|
12658
|
-
var hasY = offsets.hasOwnProperty("y");
|
12659
|
-
var sideX = left;
|
12660
|
-
var sideY = top;
|
12661
|
-
var win = window;
|
12662
|
-
if (adaptive) {
|
12663
|
-
var offsetParent = getOffsetParent(popper);
|
12664
|
-
var heightProp = "clientHeight";
|
12665
|
-
var widthProp = "clientWidth";
|
12666
|
-
if (offsetParent === getWindow(popper)) {
|
12667
|
-
offsetParent = getDocumentElement(popper);
|
12668
|
-
if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
|
12669
|
-
heightProp = "scrollHeight";
|
12670
|
-
widthProp = "scrollWidth";
|
12671
|
-
}
|
12672
|
-
}
|
12673
|
-
offsetParent = offsetParent;
|
12674
|
-
if (placement === top || (placement === left || placement === right) && variation === end) {
|
12675
|
-
sideY = bottom;
|
12676
|
-
y -= offsetParent[heightProp] - popperRect.height;
|
12677
|
-
y *= gpuAcceleration ? 1 : -1;
|
12678
|
-
}
|
12679
|
-
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
12680
|
-
sideX = right;
|
12681
|
-
x -= offsetParent[widthProp] - popperRect.width;
|
12682
|
-
x *= gpuAcceleration ? 1 : -1;
|
12683
|
-
}
|
12684
|
-
}
|
12685
|
-
var commonStyles = Object.assign({
|
12686
|
-
position
|
12687
|
-
}, adaptive && unsetSides);
|
12688
|
-
if (gpuAcceleration) {
|
12689
|
-
var _Object$assign;
|
12690
|
-
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
12691
|
-
}
|
12692
|
-
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
12693
|
-
}
|
12694
|
-
function computeStyles(_ref4) {
|
12695
|
-
var state = _ref4.state, options = _ref4.options;
|
12696
|
-
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
12697
|
-
var commonStyles = {
|
12698
|
-
placement: getBasePlacement(state.placement),
|
12699
|
-
variation: getVariation(state.placement),
|
12700
|
-
popper: state.elements.popper,
|
12701
|
-
popperRect: state.rects.popper,
|
12702
|
-
gpuAcceleration
|
12703
|
-
};
|
12704
|
-
if (state.modifiersData.popperOffsets != null) {
|
12705
|
-
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
12706
|
-
offsets: state.modifiersData.popperOffsets,
|
12707
|
-
position: state.options.strategy,
|
12708
|
-
adaptive,
|
12709
|
-
roundOffsets
|
12710
|
-
})));
|
12711
|
-
}
|
12712
|
-
if (state.modifiersData.arrow != null) {
|
12713
|
-
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
12714
|
-
offsets: state.modifiersData.arrow,
|
12715
|
-
position: "absolute",
|
12716
|
-
adaptive: false,
|
12717
|
-
roundOffsets
|
12718
|
-
})));
|
12719
|
-
}
|
12720
|
-
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
12721
|
-
"data-popper-placement": state.placement
|
12722
|
-
});
|
12723
|
-
}
|
12724
|
-
var computeStyles$1 = {
|
12725
|
-
name: "computeStyles",
|
12726
|
-
enabled: true,
|
12727
|
-
phase: "beforeWrite",
|
12728
|
-
fn: computeStyles,
|
12729
|
-
data: {}
|
12730
|
-
};
|
12731
|
-
function applyStyles(_ref) {
|
12732
|
-
var state = _ref.state;
|
12733
|
-
Object.keys(state.elements).forEach(function(name2) {
|
12734
|
-
var style = state.styles[name2] || {};
|
12735
|
-
var attributes = state.attributes[name2] || {};
|
12736
|
-
var element = state.elements[name2];
|
12737
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
12738
|
-
return;
|
12739
|
-
}
|
12740
|
-
Object.assign(element.style, style);
|
12741
|
-
Object.keys(attributes).forEach(function(name3) {
|
12742
|
-
var value = attributes[name3];
|
12743
|
-
if (value === false) {
|
12744
|
-
element.removeAttribute(name3);
|
12745
|
-
} else {
|
12746
|
-
element.setAttribute(name3, value === true ? "" : value);
|
12747
|
-
}
|
12748
|
-
});
|
12749
|
-
});
|
12750
|
-
}
|
12751
|
-
function effect(_ref2) {
|
12752
|
-
var state = _ref2.state;
|
12753
|
-
var initialStyles = {
|
12754
|
-
popper: {
|
12755
|
-
position: state.options.strategy,
|
12756
|
-
left: "0",
|
12757
|
-
top: "0",
|
12758
|
-
margin: "0"
|
12759
|
-
},
|
12760
|
-
arrow: {
|
12761
|
-
position: "absolute"
|
12762
|
-
},
|
12763
|
-
reference: {}
|
12764
|
-
};
|
12765
|
-
Object.assign(state.elements.popper.style, initialStyles.popper);
|
12766
|
-
state.styles = initialStyles;
|
12767
|
-
if (state.elements.arrow) {
|
12768
|
-
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
12769
|
-
}
|
12770
|
-
return function() {
|
12771
|
-
Object.keys(state.elements).forEach(function(name2) {
|
12772
|
-
var element = state.elements[name2];
|
12773
|
-
var attributes = state.attributes[name2] || {};
|
12774
|
-
var styleProperties = Object.keys(state.styles.hasOwnProperty(name2) ? state.styles[name2] : initialStyles[name2]);
|
12775
|
-
var style = styleProperties.reduce(function(style2, property) {
|
12776
|
-
style2[property] = "";
|
12777
|
-
return style2;
|
12778
|
-
}, {});
|
12779
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
12780
|
-
return;
|
12781
|
-
}
|
12782
|
-
Object.assign(element.style, style);
|
12783
|
-
Object.keys(attributes).forEach(function(attribute) {
|
12784
|
-
element.removeAttribute(attribute);
|
12785
|
-
});
|
12786
|
-
});
|
12787
|
-
};
|
12788
|
-
}
|
12789
|
-
var applyStyles$1 = {
|
12790
|
-
name: "applyStyles",
|
12791
|
-
enabled: true,
|
12792
|
-
phase: "write",
|
12793
|
-
fn: applyStyles,
|
12794
|
-
effect,
|
12795
|
-
requires: ["computeStyles"]
|
12796
|
-
};
|
12797
|
-
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];
|
12798
|
-
var createPopper = /* @__PURE__ */ popperGenerator({
|
12799
|
-
defaultModifiers
|
12800
|
-
});
|
12801
|
-
function distanceAndSkiddingToXY(placement, rects, offset2) {
|
12802
|
-
var basePlacement = getBasePlacement(placement);
|
12803
|
-
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
12804
|
-
var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
|
12805
|
-
placement
|
12806
|
-
})) : offset2, skidding = _ref[0], distance = _ref[1];
|
12807
|
-
skidding = skidding || 0;
|
12808
|
-
distance = (distance || 0) * invertDistance;
|
12809
|
-
return [left, right].indexOf(basePlacement) >= 0 ? {
|
12810
|
-
x: distance,
|
12811
|
-
y: skidding
|
12812
|
-
} : {
|
12813
|
-
x: skidding,
|
12814
|
-
y: distance
|
12815
|
-
};
|
12816
|
-
}
|
12817
|
-
function offset(_ref2) {
|
12818
|
-
var state = _ref2.state, options = _ref2.options, name2 = _ref2.name;
|
12819
|
-
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
12820
|
-
var data = placements.reduce(function(acc, placement) {
|
12821
|
-
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
12822
|
-
return acc;
|
12823
|
-
}, {});
|
12824
|
-
var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
|
12825
|
-
if (state.modifiersData.popperOffsets != null) {
|
12826
|
-
state.modifiersData.popperOffsets.x += x;
|
12827
|
-
state.modifiersData.popperOffsets.y += y;
|
12828
|
-
}
|
12829
|
-
state.modifiersData[name2] = data;
|
12830
|
-
}
|
12831
|
-
var offset$1 = {
|
12832
|
-
name: "offset",
|
12833
|
-
enabled: true,
|
12834
|
-
phase: "main",
|
12835
|
-
requires: ["popperOffsets"],
|
12836
|
-
fn: offset
|
12837
|
-
};
|
12838
11757
|
var [name$i, bem$i] = createNamespace("popover");
|
12839
11758
|
var popupProps = ["show", "overlay", "duration", "teleport", "overlayStyle", "overlayClass", "closeOnClickOverlay"];
|
12840
11759
|
var popoverProps = {
|
@@ -12884,7 +11803,7 @@ var _Popover = defineComponent({
|
|
12884
11803
|
adaptive: false,
|
12885
11804
|
gpuAcceleration: false
|
12886
11805
|
}
|
12887
|
-
}, extend({},
|
11806
|
+
}, extend({}, offsetModifier, {
|
12888
11807
|
options: {
|
12889
11808
|
offset: props.offset
|
12890
11809
|
}
|
@@ -13890,11 +12809,11 @@ var _Slider = defineComponent({
|
|
13890
12809
|
var isSameValue = (newValue, oldValue) => JSON.stringify(newValue) === JSON.stringify(oldValue);
|
13891
12810
|
var handleRangeValue = (value) => {
|
13892
12811
|
var _value$, _value$2;
|
13893
|
-
var
|
13894
|
-
var
|
13895
|
-
return
|
12812
|
+
var left = (_value$ = value[0]) != null ? _value$ : Number(props.min);
|
12813
|
+
var right = (_value$2 = value[1]) != null ? _value$2 : Number(props.max);
|
12814
|
+
return left > right ? [right, left] : [left, right];
|
13896
12815
|
};
|
13897
|
-
var updateValue = (value,
|
12816
|
+
var updateValue = (value, end) => {
|
13898
12817
|
if (isRange(value)) {
|
13899
12818
|
value = handleRangeValue(value).map(format2);
|
13900
12819
|
} else {
|
@@ -13903,7 +12822,7 @@ var _Slider = defineComponent({
|
|
13903
12822
|
if (!isSameValue(value, props.modelValue)) {
|
13904
12823
|
emit("update:modelValue", value);
|
13905
12824
|
}
|
13906
|
-
if (
|
12825
|
+
if (end && !isSameValue(value, startValue)) {
|
13907
12826
|
emit("change", value);
|
13908
12827
|
}
|
13909
12828
|
};
|
@@ -13934,12 +12853,12 @@ var _Slider = defineComponent({
|
|
13934
12853
|
var total = vertical ? rect.height : rect.width;
|
13935
12854
|
var value = Number(min) + getDelta() / total * scope.value;
|
13936
12855
|
if (isRange(modelValue)) {
|
13937
|
-
var [
|
13938
|
-
var middle = (
|
12856
|
+
var [left, right] = modelValue;
|
12857
|
+
var middle = (left + right) / 2;
|
13939
12858
|
if (value <= middle) {
|
13940
|
-
updateValue([value,
|
12859
|
+
updateValue([value, right], true);
|
13941
12860
|
} else {
|
13942
|
-
updateValue([
|
12861
|
+
updateValue([left, value], true);
|
13943
12862
|
}
|
13944
12863
|
} else {
|
13945
12864
|
updateValue(value, true);
|
@@ -14591,11 +13510,11 @@ var _SwipeCell = defineComponent({
|
|
14591
13510
|
}
|
14592
13511
|
};
|
14593
13512
|
var toggle = (side) => {
|
14594
|
-
var
|
13513
|
+
var offset = Math.abs(state.offset);
|
14595
13514
|
var THRESHOLD = 0.15;
|
14596
13515
|
var threshold = opened ? 1 - THRESHOLD : THRESHOLD;
|
14597
|
-
var
|
14598
|
-
if (
|
13516
|
+
var width = side === "left" ? leftWidth.value : rightWidth.value;
|
13517
|
+
if (width && offset > width * threshold) {
|
14599
13518
|
open(side);
|
14600
13519
|
} else {
|
14601
13520
|
close(side);
|
@@ -14811,9 +13730,11 @@ var _TabbarItem = defineComponent({
|
|
14811
13730
|
var config = isObject(to) ? to : {
|
14812
13731
|
path: to
|
14813
13732
|
};
|
14814
|
-
|
14815
|
-
|
14816
|
-
|
13733
|
+
return !!$route.matched.find((val) => {
|
13734
|
+
var pathMatched = "path" in config && config.path === val.path;
|
13735
|
+
var nameMatched = "name" in config && config.name === val.name;
|
13736
|
+
return pathMatched || nameMatched;
|
13737
|
+
});
|
14817
13738
|
}
|
14818
13739
|
return ((_props$name = props.name) != null ? _props$name : index2.value) === modelValue;
|
14819
13740
|
});
|
@@ -15180,6 +14101,7 @@ var _Uploader = defineComponent({
|
|
15180
14101
|
slots
|
15181
14102
|
} = _ref;
|
15182
14103
|
var inputRef = ref();
|
14104
|
+
var urls = [];
|
15183
14105
|
var getDetail = function(index2) {
|
15184
14106
|
if (index2 === void 0) {
|
15185
14107
|
index2 = props.modelValue.length;
|
@@ -15286,7 +14208,13 @@ var _Uploader = defineComponent({
|
|
15286
14208
|
var previewImage = (item) => {
|
15287
14209
|
if (props.previewFullImage) {
|
15288
14210
|
var imageFiles = props.modelValue.filter(isImageFile);
|
15289
|
-
var images = imageFiles.map((item2) =>
|
14211
|
+
var images = imageFiles.map((item2) => {
|
14212
|
+
if (item2.file && !item2.url) {
|
14213
|
+
item2.url = URL.createObjectURL(item2.file);
|
14214
|
+
urls.push(item2.url);
|
14215
|
+
}
|
14216
|
+
return item2.url;
|
14217
|
+
}).filter(Boolean);
|
15290
14218
|
imagePreview = ImagePreview(extend({
|
15291
14219
|
images,
|
15292
14220
|
startPosition: imageFiles.indexOf(item),
|
@@ -15362,6 +14290,9 @@ var _Uploader = defineComponent({
|
|
15362
14290
|
inputRef.value.click();
|
15363
14291
|
}
|
15364
14292
|
};
|
14293
|
+
onBeforeUnmount(() => {
|
14294
|
+
urls.forEach((url) => URL.revokeObjectURL(url));
|
14295
|
+
});
|
15365
14296
|
useExpose({
|
15366
14297
|
chooseFile,
|
15367
14298
|
closeImagePreview
|
@@ -15377,7 +14308,7 @@ var _Uploader = defineComponent({
|
|
15377
14308
|
}
|
15378
14309
|
});
|
15379
14310
|
var Uploader = withInstall(_Uploader);
|
15380
|
-
var version = "3.3.
|
14311
|
+
var version = "3.3.3";
|
15381
14312
|
function install(app) {
|
15382
14313
|
var components = [ActionBar, ActionBarButton, ActionBarIcon, ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ConfigProvider, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, Grid, GridItem, Icon, Image$1, ImagePreview, IndexAnchor, IndexBar, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader];
|
15383
14314
|
components.forEach((item) => {
|