@varlet/ui 1.27.6 → 1.27.7-alpha.1650880107793
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/LICENCE +21 -0
- package/es/counter/counter.css +1 -1
- package/es/counter/counter.less +4 -0
- package/es/pull-refresh/PullRefresh.js +55 -22
- package/es/snackbar/style/index.js +1 -1
- package/es/snackbar/style/less.js +1 -1
- package/es/style.css +1 -1
- package/es/utils/jest.js +5 -2
- package/es/varlet.esm.js +155 -101
- package/highlight/attributes.json +2 -2
- package/highlight/web-types.json +2 -2
- package/lib/counter/counter.css +1 -1
- package/lib/counter/counter.less +4 -0
- package/lib/pull-refresh/PullRefresh.js +55 -22
- package/lib/style.css +1 -1
- package/lib/utils/jest.js +5 -2
- package/package.json +16 -15
- package/umd/varlet.js +4 -4
package/es/varlet.esm.js
CHANGED
|
@@ -134,7 +134,7 @@ function kebabCase(str) {
|
|
|
134
134
|
var ret = str.replace(/([A-Z])/g, " $1").trim();
|
|
135
135
|
return ret.split(" ").join("-").toLowerCase();
|
|
136
136
|
}
|
|
137
|
-
function asyncGeneratorStep$
|
|
137
|
+
function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
|
|
138
138
|
try {
|
|
139
139
|
var info = gen[key](arg);
|
|
140
140
|
var value = info.value;
|
|
@@ -148,16 +148,16 @@ function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
148
148
|
Promise.resolve(value).then(_next, _throw);
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
function _asyncToGenerator$
|
|
151
|
+
function _asyncToGenerator$c(fn) {
|
|
152
152
|
return function() {
|
|
153
153
|
var self = this, args = arguments;
|
|
154
154
|
return new Promise(function(resolve, reject) {
|
|
155
155
|
var gen = fn.apply(self, args);
|
|
156
156
|
function _next(value) {
|
|
157
|
-
asyncGeneratorStep$
|
|
157
|
+
asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "next", value);
|
|
158
158
|
}
|
|
159
159
|
function _throw(err) {
|
|
160
|
-
asyncGeneratorStep$
|
|
160
|
+
asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "throw", err);
|
|
161
161
|
}
|
|
162
162
|
_next(void 0);
|
|
163
163
|
});
|
|
@@ -187,7 +187,7 @@ function inViewport(_x) {
|
|
|
187
187
|
return _inViewport.apply(this, arguments);
|
|
188
188
|
}
|
|
189
189
|
function _inViewport() {
|
|
190
|
-
_inViewport = _asyncToGenerator$
|
|
190
|
+
_inViewport = _asyncToGenerator$c(function* (element) {
|
|
191
191
|
yield doubleRaf();
|
|
192
192
|
var {
|
|
193
193
|
top,
|
|
@@ -335,7 +335,7 @@ function supportTouch() {
|
|
|
335
335
|
return inBrowser2 && "ontouchstart" in window;
|
|
336
336
|
}
|
|
337
337
|
var _excluded = ["collect", "clear"];
|
|
338
|
-
function asyncGeneratorStep$
|
|
338
|
+
function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
|
|
339
339
|
try {
|
|
340
340
|
var info = gen[key](arg);
|
|
341
341
|
var value = info.value;
|
|
@@ -349,16 +349,16 @@ function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
349
349
|
Promise.resolve(value).then(_next, _throw);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
function _asyncToGenerator$
|
|
352
|
+
function _asyncToGenerator$b(fn) {
|
|
353
353
|
return function() {
|
|
354
354
|
var self = this, args = arguments;
|
|
355
355
|
return new Promise(function(resolve, reject) {
|
|
356
356
|
var gen = fn.apply(self, args);
|
|
357
357
|
function _next(value) {
|
|
358
|
-
asyncGeneratorStep$
|
|
358
|
+
asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "next", value);
|
|
359
359
|
}
|
|
360
360
|
function _throw(err) {
|
|
361
|
-
asyncGeneratorStep$
|
|
361
|
+
asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "throw", err);
|
|
362
362
|
}
|
|
363
363
|
_next(void 0);
|
|
364
364
|
});
|
|
@@ -545,7 +545,7 @@ function keyInProvides(key) {
|
|
|
545
545
|
function useValidation() {
|
|
546
546
|
var errorMessage = ref("");
|
|
547
547
|
var validate = /* @__PURE__ */ function() {
|
|
548
|
-
var _ref = _asyncToGenerator$
|
|
548
|
+
var _ref = _asyncToGenerator$b(function* (rules, value, apis) {
|
|
549
549
|
if (!isArray(rules) || !rules.length) {
|
|
550
550
|
return true;
|
|
551
551
|
}
|
|
@@ -566,7 +566,7 @@ function useValidation() {
|
|
|
566
566
|
errorMessage.value = "";
|
|
567
567
|
};
|
|
568
568
|
var validateWithTrigger = /* @__PURE__ */ function() {
|
|
569
|
-
var _ref2 = _asyncToGenerator$
|
|
569
|
+
var _ref2 = _asyncToGenerator$b(function* (validateTrigger, trigger, rules, value, apis) {
|
|
570
570
|
if (validateTrigger.includes(trigger)) {
|
|
571
571
|
(yield validate(rules, value, apis)) && (errorMessage.value = "");
|
|
572
572
|
}
|
|
@@ -1090,7 +1090,7 @@ var props$T = {
|
|
|
1090
1090
|
type: Function
|
|
1091
1091
|
}
|
|
1092
1092
|
};
|
|
1093
|
-
function asyncGeneratorStep$
|
|
1093
|
+
function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1094
1094
|
try {
|
|
1095
1095
|
var info = gen[key](arg);
|
|
1096
1096
|
var value = info.value;
|
|
@@ -1104,16 +1104,16 @@ function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
1104
1104
|
Promise.resolve(value).then(_next, _throw);
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
function _asyncToGenerator$
|
|
1107
|
+
function _asyncToGenerator$a(fn) {
|
|
1108
1108
|
return function() {
|
|
1109
1109
|
var self = this, args = arguments;
|
|
1110
1110
|
return new Promise(function(resolve, reject) {
|
|
1111
1111
|
var gen = fn.apply(self, args);
|
|
1112
1112
|
function _next(value) {
|
|
1113
|
-
asyncGeneratorStep$
|
|
1113
|
+
asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "next", value);
|
|
1114
1114
|
}
|
|
1115
1115
|
function _throw(err) {
|
|
1116
|
-
asyncGeneratorStep$
|
|
1116
|
+
asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1117
1117
|
}
|
|
1118
1118
|
_next(void 0);
|
|
1119
1119
|
});
|
|
@@ -1145,7 +1145,7 @@ var Icon = defineComponent({
|
|
|
1145
1145
|
var nextName = ref("");
|
|
1146
1146
|
var shrinking = ref(false);
|
|
1147
1147
|
var handleNameChange = /* @__PURE__ */ function() {
|
|
1148
|
-
var _ref = _asyncToGenerator$
|
|
1148
|
+
var _ref = _asyncToGenerator$a(function* (newName, oldName) {
|
|
1149
1149
|
var {
|
|
1150
1150
|
transition
|
|
1151
1151
|
} = props2;
|
|
@@ -8670,7 +8670,7 @@ var props$w = {
|
|
|
8670
8670
|
default: false
|
|
8671
8671
|
}
|
|
8672
8672
|
};
|
|
8673
|
-
function asyncGeneratorStep$
|
|
8673
|
+
function asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8674
8674
|
try {
|
|
8675
8675
|
var info = gen[key](arg);
|
|
8676
8676
|
var value = info.value;
|
|
@@ -8684,16 +8684,16 @@ function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
8684
8684
|
Promise.resolve(value).then(_next, _throw);
|
|
8685
8685
|
}
|
|
8686
8686
|
}
|
|
8687
|
-
function _asyncToGenerator$
|
|
8687
|
+
function _asyncToGenerator$9(fn) {
|
|
8688
8688
|
return function() {
|
|
8689
8689
|
var self = this, args = arguments;
|
|
8690
8690
|
return new Promise(function(resolve, reject) {
|
|
8691
8691
|
var gen = fn.apply(self, args);
|
|
8692
8692
|
function _next(value) {
|
|
8693
|
-
asyncGeneratorStep$
|
|
8693
|
+
asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "next", value);
|
|
8694
8694
|
}
|
|
8695
8695
|
function _throw(err) {
|
|
8696
|
-
asyncGeneratorStep$
|
|
8696
|
+
asyncGeneratorStep$9(gen, resolve, reject, _next, _throw, "throw", err);
|
|
8697
8697
|
}
|
|
8698
8698
|
_next(void 0);
|
|
8699
8699
|
});
|
|
@@ -8719,7 +8719,7 @@ var Form = defineComponent({
|
|
|
8719
8719
|
bindFormItems
|
|
8720
8720
|
} = useFormItems();
|
|
8721
8721
|
var validate = /* @__PURE__ */ function() {
|
|
8722
|
-
var _ref = _asyncToGenerator$
|
|
8722
|
+
var _ref = _asyncToGenerator$9(function* () {
|
|
8723
8723
|
var res = yield Promise.all(formItems.map((_ref2) => {
|
|
8724
8724
|
var {
|
|
8725
8725
|
validate: validate2
|
|
@@ -8760,7 +8760,7 @@ var Form = defineComponent({
|
|
|
8760
8760
|
Form.install = function(app) {
|
|
8761
8761
|
app.component(Form.name, Form);
|
|
8762
8762
|
};
|
|
8763
|
-
function asyncGeneratorStep$
|
|
8763
|
+
function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8764
8764
|
try {
|
|
8765
8765
|
var info = gen[key](arg);
|
|
8766
8766
|
var value = info.value;
|
|
@@ -8774,16 +8774,16 @@ function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
8774
8774
|
Promise.resolve(value).then(_next, _throw);
|
|
8775
8775
|
}
|
|
8776
8776
|
}
|
|
8777
|
-
function _asyncToGenerator$
|
|
8777
|
+
function _asyncToGenerator$8(fn) {
|
|
8778
8778
|
return function() {
|
|
8779
8779
|
var self = this, args = arguments;
|
|
8780
8780
|
return new Promise(function(resolve, reject) {
|
|
8781
8781
|
var gen = fn.apply(self, args);
|
|
8782
8782
|
function _next(value) {
|
|
8783
|
-
asyncGeneratorStep$
|
|
8783
|
+
asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "next", value);
|
|
8784
8784
|
}
|
|
8785
8785
|
function _throw(err) {
|
|
8786
|
-
asyncGeneratorStep$
|
|
8786
|
+
asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, "throw", err);
|
|
8787
8787
|
}
|
|
8788
8788
|
_next(void 0);
|
|
8789
8789
|
});
|
|
@@ -8916,7 +8916,7 @@ function check(_x) {
|
|
|
8916
8916
|
return _check.apply(this, arguments);
|
|
8917
8917
|
}
|
|
8918
8918
|
function _check() {
|
|
8919
|
-
_check = _asyncToGenerator$
|
|
8919
|
+
_check = _asyncToGenerator$8(function* (el) {
|
|
8920
8920
|
(yield inViewport(el)) && attemptLoad(el);
|
|
8921
8921
|
});
|
|
8922
8922
|
return _check.apply(this, arguments);
|
|
@@ -8928,7 +8928,7 @@ function add(_x2) {
|
|
|
8928
8928
|
return _add.apply(this, arguments);
|
|
8929
8929
|
}
|
|
8930
8930
|
function _add() {
|
|
8931
|
-
_add = _asyncToGenerator$
|
|
8931
|
+
_add = _asyncToGenerator$8(function* (el) {
|
|
8932
8932
|
!lazyElements.includes(el) && lazyElements.push(el);
|
|
8933
8933
|
getAllParentScroller(el).forEach(bindEvents);
|
|
8934
8934
|
yield check(el);
|
|
@@ -8950,7 +8950,7 @@ function mounted(_x3, _x4) {
|
|
|
8950
8950
|
return _mounted.apply(this, arguments);
|
|
8951
8951
|
}
|
|
8952
8952
|
function _mounted() {
|
|
8953
|
-
_mounted = _asyncToGenerator$
|
|
8953
|
+
_mounted = _asyncToGenerator$8(function* (el, binding) {
|
|
8954
8954
|
createLazy(el, binding);
|
|
8955
8955
|
yield add(el);
|
|
8956
8956
|
});
|
|
@@ -8960,7 +8960,7 @@ function updated(_x5, _x6) {
|
|
|
8960
8960
|
return _updated.apply(this, arguments);
|
|
8961
8961
|
}
|
|
8962
8962
|
function _updated() {
|
|
8963
|
-
_updated = _asyncToGenerator$
|
|
8963
|
+
_updated = _asyncToGenerator$8(function* (el, binding) {
|
|
8964
8964
|
if (!diff(el, binding)) {
|
|
8965
8965
|
lazyElements.includes(el) && (yield check(el));
|
|
8966
8966
|
return;
|
|
@@ -9199,7 +9199,7 @@ var props$u = {
|
|
|
9199
9199
|
type: Function
|
|
9200
9200
|
}
|
|
9201
9201
|
};
|
|
9202
|
-
function asyncGeneratorStep$
|
|
9202
|
+
function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
|
|
9203
9203
|
try {
|
|
9204
9204
|
var info = gen[key](arg);
|
|
9205
9205
|
var value = info.value;
|
|
@@ -9213,16 +9213,16 @@ function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
9213
9213
|
Promise.resolve(value).then(_next, _throw);
|
|
9214
9214
|
}
|
|
9215
9215
|
}
|
|
9216
|
-
function _asyncToGenerator$
|
|
9216
|
+
function _asyncToGenerator$7(fn) {
|
|
9217
9217
|
return function() {
|
|
9218
9218
|
var self = this, args = arguments;
|
|
9219
9219
|
return new Promise(function(resolve, reject) {
|
|
9220
9220
|
var gen = fn.apply(self, args);
|
|
9221
9221
|
function _next(value) {
|
|
9222
|
-
asyncGeneratorStep$
|
|
9222
|
+
asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "next", value);
|
|
9223
9223
|
}
|
|
9224
9224
|
function _throw(err) {
|
|
9225
|
-
asyncGeneratorStep$
|
|
9225
|
+
asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "throw", err);
|
|
9226
9226
|
}
|
|
9227
9227
|
_next(void 0);
|
|
9228
9228
|
});
|
|
@@ -9537,7 +9537,7 @@ var Swipe = defineComponent({
|
|
|
9537
9537
|
vertical
|
|
9538
9538
|
};
|
|
9539
9539
|
bindSwipeItems(swipeProvider);
|
|
9540
|
-
watch(() => length.value, /* @__PURE__ */ _asyncToGenerator$
|
|
9540
|
+
watch(() => length.value, /* @__PURE__ */ _asyncToGenerator$7(function* () {
|
|
9541
9541
|
yield doubleRaf();
|
|
9542
9542
|
initialIndex();
|
|
9543
9543
|
resize();
|
|
@@ -10045,7 +10045,7 @@ var props$s = {
|
|
|
10045
10045
|
type: Function
|
|
10046
10046
|
}
|
|
10047
10047
|
};
|
|
10048
|
-
function asyncGeneratorStep$
|
|
10048
|
+
function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10049
10049
|
try {
|
|
10050
10050
|
var info = gen[key](arg);
|
|
10051
10051
|
var value = info.value;
|
|
@@ -10059,16 +10059,16 @@ function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
10059
10059
|
Promise.resolve(value).then(_next, _throw);
|
|
10060
10060
|
}
|
|
10061
10061
|
}
|
|
10062
|
-
function _asyncToGenerator$
|
|
10062
|
+
function _asyncToGenerator$6(fn) {
|
|
10063
10063
|
return function() {
|
|
10064
10064
|
var self = this, args = arguments;
|
|
10065
10065
|
return new Promise(function(resolve, reject) {
|
|
10066
10066
|
var gen = fn.apply(self, args);
|
|
10067
10067
|
function _next(value) {
|
|
10068
|
-
asyncGeneratorStep$
|
|
10068
|
+
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "next", value);
|
|
10069
10069
|
}
|
|
10070
10070
|
function _throw(err) {
|
|
10071
|
-
asyncGeneratorStep$
|
|
10071
|
+
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "throw", err);
|
|
10072
10072
|
}
|
|
10073
10073
|
_next(void 0);
|
|
10074
10074
|
});
|
|
@@ -10118,7 +10118,7 @@ var Sticky = defineComponent({
|
|
|
10118
10118
|
var enableCSSMode = computed(() => !props2.disabled && props2.cssMode);
|
|
10119
10119
|
var enableFixedMode = computed(() => !props2.disabled && isFixed.value);
|
|
10120
10120
|
var offsetTop = computed(() => toPxNum(props2.offsetTop));
|
|
10121
|
-
var
|
|
10121
|
+
var scroller;
|
|
10122
10122
|
var handleScroll = () => {
|
|
10123
10123
|
var {
|
|
10124
10124
|
onScroll,
|
|
@@ -10129,10 +10129,10 @@ var Sticky = defineComponent({
|
|
|
10129
10129
|
return;
|
|
10130
10130
|
}
|
|
10131
10131
|
var scrollerTop = 0;
|
|
10132
|
-
if (
|
|
10132
|
+
if (scroller !== window) {
|
|
10133
10133
|
var {
|
|
10134
10134
|
top
|
|
10135
|
-
} =
|
|
10135
|
+
} = scroller.getBoundingClientRect();
|
|
10136
10136
|
scrollerTop = top;
|
|
10137
10137
|
}
|
|
10138
10138
|
var wrapper3 = wrapperEl.value;
|
|
@@ -10159,10 +10159,10 @@ var Sticky = defineComponent({
|
|
|
10159
10159
|
}
|
|
10160
10160
|
};
|
|
10161
10161
|
var addScrollListener = /* @__PURE__ */ function() {
|
|
10162
|
-
var _ref = _asyncToGenerator$
|
|
10162
|
+
var _ref = _asyncToGenerator$6(function* () {
|
|
10163
10163
|
yield doubleRaf();
|
|
10164
|
-
|
|
10165
|
-
|
|
10164
|
+
scroller = getParentScroller(stickyEl.value);
|
|
10165
|
+
scroller !== window && scroller.addEventListener("scroll", handleScroll);
|
|
10166
10166
|
window.addEventListener("scroll", handleScroll);
|
|
10167
10167
|
handleScroll();
|
|
10168
10168
|
});
|
|
@@ -10171,7 +10171,7 @@ var Sticky = defineComponent({
|
|
|
10171
10171
|
};
|
|
10172
10172
|
}();
|
|
10173
10173
|
var removeScrollListener = () => {
|
|
10174
|
-
|
|
10174
|
+
scroller !== window && scroller.removeEventListener("scroll", handleScroll);
|
|
10175
10175
|
window.removeEventListener("scroll", handleScroll);
|
|
10176
10176
|
};
|
|
10177
10177
|
watch(() => props2.disabled, handleScroll);
|
|
@@ -10351,7 +10351,7 @@ var props$q = {
|
|
|
10351
10351
|
type: Function
|
|
10352
10352
|
}
|
|
10353
10353
|
};
|
|
10354
|
-
function asyncGeneratorStep$
|
|
10354
|
+
function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10355
10355
|
try {
|
|
10356
10356
|
var info = gen[key](arg);
|
|
10357
10357
|
var value = info.value;
|
|
@@ -10365,16 +10365,16 @@ function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
10365
10365
|
Promise.resolve(value).then(_next, _throw);
|
|
10366
10366
|
}
|
|
10367
10367
|
}
|
|
10368
|
-
function _asyncToGenerator$
|
|
10368
|
+
function _asyncToGenerator$5(fn) {
|
|
10369
10369
|
return function() {
|
|
10370
10370
|
var self = this, args = arguments;
|
|
10371
10371
|
return new Promise(function(resolve, reject) {
|
|
10372
10372
|
var gen = fn.apply(self, args);
|
|
10373
10373
|
function _next(value) {
|
|
10374
|
-
asyncGeneratorStep$
|
|
10374
|
+
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
|
|
10375
10375
|
}
|
|
10376
10376
|
function _throw(err) {
|
|
10377
|
-
asyncGeneratorStep$
|
|
10377
|
+
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
|
|
10378
10378
|
}
|
|
10379
10379
|
_next(void 0);
|
|
10380
10380
|
});
|
|
@@ -10417,7 +10417,7 @@ var IndexBar = defineComponent({
|
|
|
10417
10417
|
bindIndexAnchors
|
|
10418
10418
|
} = useIndexAnchors();
|
|
10419
10419
|
var clickedName = ref("");
|
|
10420
|
-
var
|
|
10420
|
+
var scroller = ref(null);
|
|
10421
10421
|
var barEl = ref(null);
|
|
10422
10422
|
var anchorNameList = ref([]);
|
|
10423
10423
|
var active = ref();
|
|
@@ -10441,8 +10441,8 @@ var IndexBar = defineComponent({
|
|
|
10441
10441
|
call(props2.onChange, anchorName);
|
|
10442
10442
|
};
|
|
10443
10443
|
var handleScroll = () => {
|
|
10444
|
-
var scrollTop = getScrollTop(
|
|
10445
|
-
var scrollHeight =
|
|
10444
|
+
var scrollTop = getScrollTop(scroller.value);
|
|
10445
|
+
var scrollHeight = scroller.value === window ? document.body.scrollHeight : scroller.value.scrollHeight;
|
|
10446
10446
|
var {
|
|
10447
10447
|
offsetTop
|
|
10448
10448
|
} = barEl.value;
|
|
@@ -10460,7 +10460,7 @@ var IndexBar = defineComponent({
|
|
|
10460
10460
|
});
|
|
10461
10461
|
};
|
|
10462
10462
|
var anchorClick = /* @__PURE__ */ function() {
|
|
10463
|
-
var _ref = _asyncToGenerator$
|
|
10463
|
+
var _ref = _asyncToGenerator$5(function* (anchorName, manualCall) {
|
|
10464
10464
|
var {
|
|
10465
10465
|
offsetTop
|
|
10466
10466
|
} = barEl.value;
|
|
@@ -10477,10 +10477,10 @@ var IndexBar = defineComponent({
|
|
|
10477
10477
|
if (!indexAnchor)
|
|
10478
10478
|
return;
|
|
10479
10479
|
var top = indexAnchor.ownTop.value - stickyOffsetTop.value + offsetTop;
|
|
10480
|
-
var left = getScrollLeft(
|
|
10480
|
+
var left = getScrollLeft(scroller.value);
|
|
10481
10481
|
clickedName.value = anchorName;
|
|
10482
10482
|
emitEvent(anchorName);
|
|
10483
|
-
yield scrollTo(
|
|
10483
|
+
yield scrollTo(scroller.value, {
|
|
10484
10484
|
left,
|
|
10485
10485
|
top,
|
|
10486
10486
|
animation: easeInOutCubic,
|
|
@@ -10497,7 +10497,7 @@ var IndexBar = defineComponent({
|
|
|
10497
10497
|
var scrollTo$1 = (index) => {
|
|
10498
10498
|
requestAnimationFrame(() => anchorClick(index, true));
|
|
10499
10499
|
};
|
|
10500
|
-
watch(() => length.value, /* @__PURE__ */ _asyncToGenerator$
|
|
10500
|
+
watch(() => length.value, /* @__PURE__ */ _asyncToGenerator$5(function* () {
|
|
10501
10501
|
yield doubleRaf();
|
|
10502
10502
|
indexAnchors.forEach((_ref4) => {
|
|
10503
10503
|
var {
|
|
@@ -10509,13 +10509,13 @@ var IndexBar = defineComponent({
|
|
|
10509
10509
|
setOwnTop();
|
|
10510
10510
|
});
|
|
10511
10511
|
}));
|
|
10512
|
-
onMounted(/* @__PURE__ */ _asyncToGenerator$
|
|
10512
|
+
onMounted(/* @__PURE__ */ _asyncToGenerator$5(function* () {
|
|
10513
10513
|
yield doubleRaf();
|
|
10514
|
-
|
|
10515
|
-
|
|
10514
|
+
scroller.value = getParentScroller(barEl.value);
|
|
10515
|
+
scroller.value.addEventListener("scroll", handleScroll);
|
|
10516
10516
|
}));
|
|
10517
10517
|
onBeforeUnmount(() => {
|
|
10518
|
-
call(
|
|
10518
|
+
call(scroller.value.removeEventListener, "scroll", handleScroll);
|
|
10519
10519
|
});
|
|
10520
10520
|
return {
|
|
10521
10521
|
n: n$u,
|
|
@@ -10926,7 +10926,7 @@ var props$o = {
|
|
|
10926
10926
|
type: Function
|
|
10927
10927
|
}
|
|
10928
10928
|
};
|
|
10929
|
-
function asyncGeneratorStep$
|
|
10929
|
+
function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10930
10930
|
try {
|
|
10931
10931
|
var info = gen[key](arg);
|
|
10932
10932
|
var value = info.value;
|
|
@@ -10940,16 +10940,16 @@ function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
10940
10940
|
Promise.resolve(value).then(_next, _throw);
|
|
10941
10941
|
}
|
|
10942
10942
|
}
|
|
10943
|
-
function _asyncToGenerator$
|
|
10943
|
+
function _asyncToGenerator$4(fn) {
|
|
10944
10944
|
return function() {
|
|
10945
10945
|
var self = this, args = arguments;
|
|
10946
10946
|
return new Promise(function(resolve, reject) {
|
|
10947
10947
|
var gen = fn.apply(self, args);
|
|
10948
10948
|
function _next(value) {
|
|
10949
|
-
asyncGeneratorStep$
|
|
10949
|
+
asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "next", value);
|
|
10950
10950
|
}
|
|
10951
10951
|
function _throw(err) {
|
|
10952
|
-
asyncGeneratorStep$
|
|
10952
|
+
asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "throw", err);
|
|
10953
10953
|
}
|
|
10954
10954
|
_next(void 0);
|
|
10955
10955
|
});
|
|
@@ -11003,21 +11003,21 @@ var List = defineComponent({
|
|
|
11003
11003
|
setup(props2) {
|
|
11004
11004
|
var listEl = ref(null);
|
|
11005
11005
|
var detectorEl = ref(null);
|
|
11006
|
-
var
|
|
11006
|
+
var scroller;
|
|
11007
11007
|
var load = () => {
|
|
11008
11008
|
call(props2["onUpdate:error"], false);
|
|
11009
11009
|
call(props2["onUpdate:loading"], true);
|
|
11010
11010
|
call(props2.onLoad);
|
|
11011
11011
|
};
|
|
11012
11012
|
var isReachBottom = () => {
|
|
11013
|
-
var containerBottom =
|
|
11013
|
+
var containerBottom = scroller === window ? window.innerHeight : scroller.getBoundingClientRect().bottom;
|
|
11014
11014
|
var {
|
|
11015
11015
|
bottom: detectorBottom
|
|
11016
11016
|
} = detectorEl.value.getBoundingClientRect();
|
|
11017
11017
|
return Math.floor(detectorBottom) - toPxNum(props2.offset) <= containerBottom;
|
|
11018
11018
|
};
|
|
11019
11019
|
var check2 = /* @__PURE__ */ function() {
|
|
11020
|
-
var _ref = _asyncToGenerator$
|
|
11020
|
+
var _ref = _asyncToGenerator$4(function* () {
|
|
11021
11021
|
yield nextTick();
|
|
11022
11022
|
var {
|
|
11023
11023
|
loading: loading2,
|
|
@@ -11033,12 +11033,12 @@ var List = defineComponent({
|
|
|
11033
11033
|
};
|
|
11034
11034
|
}();
|
|
11035
11035
|
onMounted(() => {
|
|
11036
|
-
|
|
11036
|
+
scroller = getParentScroller(listEl.value);
|
|
11037
11037
|
props2.immediateCheck && check2();
|
|
11038
|
-
|
|
11038
|
+
scroller.addEventListener("scroll", check2);
|
|
11039
11039
|
});
|
|
11040
11040
|
onUnmounted(() => {
|
|
11041
|
-
|
|
11041
|
+
scroller.removeEventListener("scroll", check2);
|
|
11042
11042
|
});
|
|
11043
11043
|
return {
|
|
11044
11044
|
pack,
|
|
@@ -11097,7 +11097,7 @@ var props$n = {
|
|
|
11097
11097
|
type: Function
|
|
11098
11098
|
}
|
|
11099
11099
|
};
|
|
11100
|
-
function asyncGeneratorStep$
|
|
11100
|
+
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
11101
11101
|
try {
|
|
11102
11102
|
var info = gen[key](arg);
|
|
11103
11103
|
var value = info.value;
|
|
@@ -11111,16 +11111,16 @@ function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
11111
11111
|
Promise.resolve(value).then(_next, _throw);
|
|
11112
11112
|
}
|
|
11113
11113
|
}
|
|
11114
|
-
function _asyncToGenerator$
|
|
11114
|
+
function _asyncToGenerator$3(fn) {
|
|
11115
11115
|
return function() {
|
|
11116
11116
|
var self = this, args = arguments;
|
|
11117
11117
|
return new Promise(function(resolve, reject) {
|
|
11118
11118
|
var gen = fn.apply(self, args);
|
|
11119
11119
|
function _next(value) {
|
|
11120
|
-
asyncGeneratorStep$
|
|
11120
|
+
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
|
|
11121
11121
|
}
|
|
11122
11122
|
function _throw(err) {
|
|
11123
|
-
asyncGeneratorStep$
|
|
11123
|
+
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
|
|
11124
11124
|
}
|
|
11125
11125
|
_next(void 0);
|
|
11126
11126
|
});
|
|
@@ -11195,7 +11195,7 @@ var Menu = defineComponent({
|
|
|
11195
11195
|
});
|
|
11196
11196
|
watch(() => props2.alignment, resize);
|
|
11197
11197
|
watch(() => props2.show, /* @__PURE__ */ function() {
|
|
11198
|
-
var _ref2 = _asyncToGenerator$
|
|
11198
|
+
var _ref2 = _asyncToGenerator$3(function* (newValue) {
|
|
11199
11199
|
var {
|
|
11200
11200
|
onOpen,
|
|
11201
11201
|
onClose
|
|
@@ -12394,13 +12394,42 @@ var props$i = {
|
|
|
12394
12394
|
type: Function
|
|
12395
12395
|
}
|
|
12396
12396
|
};
|
|
12397
|
+
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
12398
|
+
try {
|
|
12399
|
+
var info = gen[key](arg);
|
|
12400
|
+
var value = info.value;
|
|
12401
|
+
} catch (error) {
|
|
12402
|
+
reject(error);
|
|
12403
|
+
return;
|
|
12404
|
+
}
|
|
12405
|
+
if (info.done) {
|
|
12406
|
+
resolve(value);
|
|
12407
|
+
} else {
|
|
12408
|
+
Promise.resolve(value).then(_next, _throw);
|
|
12409
|
+
}
|
|
12410
|
+
}
|
|
12411
|
+
function _asyncToGenerator$2(fn) {
|
|
12412
|
+
return function() {
|
|
12413
|
+
var self = this, args = arguments;
|
|
12414
|
+
return new Promise(function(resolve, reject) {
|
|
12415
|
+
var gen = fn.apply(self, args);
|
|
12416
|
+
function _next(value) {
|
|
12417
|
+
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
12418
|
+
}
|
|
12419
|
+
function _throw(err) {
|
|
12420
|
+
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
12421
|
+
}
|
|
12422
|
+
_next(void 0);
|
|
12423
|
+
});
|
|
12424
|
+
};
|
|
12425
|
+
}
|
|
12397
12426
|
var {
|
|
12398
12427
|
n: n$m,
|
|
12399
12428
|
classes: classes$h
|
|
12400
12429
|
} = createNamespace("pull-refresh");
|
|
12401
12430
|
var MAX_DISTANCE = 100;
|
|
12402
12431
|
var CONTROL_POSITION = -50;
|
|
12403
|
-
var
|
|
12432
|
+
var ICON_TRANSITION = 150;
|
|
12404
12433
|
function render$k(_ctx, _cache) {
|
|
12405
12434
|
var _component_var_icon = resolveComponent("var-icon");
|
|
12406
12435
|
return openBlock(), createElementBlock("div", {
|
|
@@ -12423,10 +12452,10 @@ function render$k(_ctx, _cache) {
|
|
|
12423
12452
|
style: normalizeStyle(_ctx.controlStyle)
|
|
12424
12453
|
}, [createVNode(_component_var_icon, {
|
|
12425
12454
|
name: _ctx.iconName,
|
|
12426
|
-
transition:
|
|
12427
|
-
class: normalizeClass(_ctx.classes(_ctx.n("icon"), [_ctx.refreshStatus === "loading", _ctx.n("animation")])),
|
|
12455
|
+
transition: _ctx.ICON_TRANSITION,
|
|
12456
|
+
class: normalizeClass(_ctx.classes(_ctx.n("icon"), [_ctx.refreshStatus === "loading" && _ctx.iconHasChanged, _ctx.n("animation")])),
|
|
12428
12457
|
"var-pull-refresh-cover": ""
|
|
12429
|
-
}, null, 8, ["name", "class"])], 6), renderSlot(_ctx.$slots, "default")], 34);
|
|
12458
|
+
}, null, 8, ["name", "transition", "class"])], 6), renderSlot(_ctx.$slots, "default")], 34);
|
|
12430
12459
|
}
|
|
12431
12460
|
var PullRefresh = defineComponent({
|
|
12432
12461
|
render: render$k,
|
|
@@ -12436,12 +12465,15 @@ var PullRefresh = defineComponent({
|
|
|
12436
12465
|
},
|
|
12437
12466
|
props: props$i,
|
|
12438
12467
|
setup(props2) {
|
|
12468
|
+
var scroller;
|
|
12469
|
+
var changing;
|
|
12439
12470
|
var freshNode = ref(null);
|
|
12440
12471
|
var startPosition = ref(0);
|
|
12441
12472
|
var distance = ref(CONTROL_POSITION);
|
|
12442
12473
|
var iconName = ref("arrow-down");
|
|
12443
12474
|
var refreshStatus = ref("default");
|
|
12444
12475
|
var isEnd = ref(false);
|
|
12476
|
+
var iconHasChanged = ref(true);
|
|
12445
12477
|
var isTouchable = computed(() => refreshStatus.value !== "loading" && refreshStatus.value !== "success" && !props2.disabled);
|
|
12446
12478
|
var controlStyle = computed(() => ({
|
|
12447
12479
|
transform: "translate3d(0px, " + distance.value + "px, 0px) translate(-50%, 0)",
|
|
@@ -12450,6 +12482,14 @@ var PullRefresh = defineComponent({
|
|
|
12450
12482
|
color: props2.successColor || props2.color
|
|
12451
12483
|
}));
|
|
12452
12484
|
var isSuccess = computed(() => refreshStatus.value === "success");
|
|
12485
|
+
var changeIcon = () => {
|
|
12486
|
+
return new Promise((resolve) => {
|
|
12487
|
+
window.setTimeout(() => {
|
|
12488
|
+
iconHasChanged.value = true;
|
|
12489
|
+
resolve();
|
|
12490
|
+
}, ICON_TRANSITION);
|
|
12491
|
+
});
|
|
12492
|
+
};
|
|
12453
12493
|
var touchStart = (event) => {
|
|
12454
12494
|
if (!isTouchable.value)
|
|
12455
12495
|
return;
|
|
@@ -12464,27 +12504,39 @@ var PullRefresh = defineComponent({
|
|
|
12464
12504
|
event.cancelable && event.preventDefault();
|
|
12465
12505
|
var moveDistance = (event.touches[0].clientY - startPosition.value) / 2 + CONTROL_POSITION;
|
|
12466
12506
|
distance.value = moveDistance >= MAX_DISTANCE ? MAX_DISTANCE : moveDistance;
|
|
12467
|
-
iconName.value = distance.value >= MAX_DISTANCE * 0.2 ? "refresh" : "arrow-down";
|
|
12468
|
-
};
|
|
12469
|
-
var touchEnd = () => {
|
|
12470
|
-
if (!isTouchable.value)
|
|
12471
|
-
return;
|
|
12472
|
-
isEnd.value = true;
|
|
12473
12507
|
if (distance.value >= MAX_DISTANCE * 0.2) {
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
(_props$onUpdateModel = props2["onUpdate:modelValue"]) == null ? void 0 : _props$onUpdateModel.call(props2, true);
|
|
12478
|
-
props2.onRefresh == null ? void 0 : props2.onRefresh();
|
|
12508
|
+
iconHasChanged.value = false;
|
|
12509
|
+
iconName.value = "refresh";
|
|
12510
|
+
changing = changeIcon();
|
|
12479
12511
|
} else {
|
|
12480
|
-
refreshStatus.value = "loosing";
|
|
12481
12512
|
iconName.value = "arrow-down";
|
|
12482
|
-
distance.value = CONTROL_POSITION;
|
|
12483
|
-
setTimeout(() => {
|
|
12484
|
-
isEnd.value = false;
|
|
12485
|
-
}, toNumber(props2.animationDuration));
|
|
12486
12513
|
}
|
|
12487
12514
|
};
|
|
12515
|
+
var touchEnd = /* @__PURE__ */ function() {
|
|
12516
|
+
var _ref = _asyncToGenerator$2(function* () {
|
|
12517
|
+
if (!isTouchable.value)
|
|
12518
|
+
return;
|
|
12519
|
+
isEnd.value = true;
|
|
12520
|
+
if (distance.value >= MAX_DISTANCE * 0.2) {
|
|
12521
|
+
var _props$onUpdateModel;
|
|
12522
|
+
yield changing;
|
|
12523
|
+
refreshStatus.value = "loading";
|
|
12524
|
+
distance.value = MAX_DISTANCE * 0.3;
|
|
12525
|
+
(_props$onUpdateModel = props2["onUpdate:modelValue"]) == null ? void 0 : _props$onUpdateModel.call(props2, true);
|
|
12526
|
+
props2.onRefresh == null ? void 0 : props2.onRefresh();
|
|
12527
|
+
} else {
|
|
12528
|
+
refreshStatus.value = "loosing";
|
|
12529
|
+
iconName.value = "arrow-down";
|
|
12530
|
+
distance.value = CONTROL_POSITION;
|
|
12531
|
+
setTimeout(() => {
|
|
12532
|
+
isEnd.value = false;
|
|
12533
|
+
}, toNumber(props2.animationDuration));
|
|
12534
|
+
}
|
|
12535
|
+
});
|
|
12536
|
+
return function touchEnd2() {
|
|
12537
|
+
return _ref.apply(this, arguments);
|
|
12538
|
+
};
|
|
12539
|
+
}();
|
|
12488
12540
|
var reset = () => {
|
|
12489
12541
|
setTimeout(() => {
|
|
12490
12542
|
refreshStatus.value = "default";
|
|
@@ -12509,6 +12561,8 @@ var PullRefresh = defineComponent({
|
|
|
12509
12561
|
return {
|
|
12510
12562
|
n: n$m,
|
|
12511
12563
|
classes: classes$h,
|
|
12564
|
+
iconHasChanged,
|
|
12565
|
+
ICON_TRANSITION,
|
|
12512
12566
|
refreshStatus,
|
|
12513
12567
|
freshNode,
|
|
12514
12568
|
touchStart,
|
|
@@ -15715,17 +15769,17 @@ var Tabs = defineComponent({
|
|
|
15715
15769
|
if (!scrollable.value) {
|
|
15716
15770
|
return;
|
|
15717
15771
|
}
|
|
15718
|
-
var
|
|
15772
|
+
var scroller = scrollerEl.value;
|
|
15719
15773
|
var el = element.value;
|
|
15720
15774
|
if (props2.layoutDirection === "horizontal") {
|
|
15721
|
-
var left = el.offsetLeft + el.offsetWidth / 2 -
|
|
15722
|
-
scrollTo(
|
|
15775
|
+
var left = el.offsetLeft + el.offsetWidth / 2 - scroller.offsetWidth / 2;
|
|
15776
|
+
scrollTo(scroller, {
|
|
15723
15777
|
left,
|
|
15724
15778
|
animation: linear
|
|
15725
15779
|
});
|
|
15726
15780
|
} else {
|
|
15727
|
-
var top = el.offsetTop + el.offsetHeight / 2 -
|
|
15728
|
-
scrollTo(
|
|
15781
|
+
var top = el.offsetTop + el.offsetHeight / 2 - scroller.offsetHeight / 2;
|
|
15782
|
+
scrollTo(scroller, {
|
|
15729
15783
|
top,
|
|
15730
15784
|
animation: linear
|
|
15731
15785
|
});
|
|
@@ -17233,9 +17287,9 @@ var skeleton = "";
|
|
|
17233
17287
|
var SkeletonSfc = "";
|
|
17234
17288
|
var slider = "";
|
|
17235
17289
|
var SliderSfc = "";
|
|
17290
|
+
var SnackbarSfc = "";
|
|
17236
17291
|
var snackbar = "";
|
|
17237
17292
|
var coreSfc = "";
|
|
17238
|
-
var SnackbarSfc = "";
|
|
17239
17293
|
var space = "";
|
|
17240
17294
|
var step = "";
|
|
17241
17295
|
var StepSfc = "";
|