@varlet/ui 1.27.4 → 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/README.en-US.md +3 -3
- package/README.md +3 -3
- package/es/context/lock.js +14 -21
- package/es/counter/counter.css +1 -1
- package/es/counter/counter.less +4 -0
- package/es/pagination/Pagination.js +1 -4
- package/es/pagination/pagination.css +1 -1
- package/es/pagination/pagination.less +19 -10
- package/es/picker/Picker.js +13 -5
- package/es/picker/props.js +4 -0
- package/es/popup/Popup.js +1 -1
- package/es/pull-refresh/PullRefresh.js +55 -22
- package/es/snackbar/core.js +1 -1
- package/es/style.css +1 -1
- package/es/utils/jest.js +5 -2
- package/es/varlet.esm.js +186 -125
- package/highlight/attributes.json +8 -4
- package/highlight/tags.json +1 -0
- package/highlight/web-types.json +15 -6
- package/lib/context/lock.js +14 -21
- package/lib/counter/counter.css +1 -1
- package/lib/counter/counter.less +4 -0
- package/lib/pagination/Pagination.js +1 -4
- package/lib/pagination/pagination.css +1 -1
- package/lib/pagination/pagination.less +19 -10
- package/lib/picker/Picker.js +13 -5
- package/lib/picker/props.js +4 -0
- package/lib/popup/Popup.js +1 -1
- package/lib/pull-refresh/PullRefresh.js +55 -22
- package/lib/snackbar/core.js +1 -1
- package/lib/style.css +1 -1
- package/lib/utils/jest.js +5 -2
- package/package.json +6 -6
- package/types/picker.d.ts +2 -0
- 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
|
}
|
|
@@ -874,21 +874,21 @@ function releaseLock(uid) {
|
|
|
874
874
|
delete Context.locks[uid];
|
|
875
875
|
resolveLock();
|
|
876
876
|
}
|
|
877
|
-
function useLock(
|
|
877
|
+
function useLock(source, useSource) {
|
|
878
878
|
var {
|
|
879
879
|
uid
|
|
880
880
|
} = getCurrentInstance();
|
|
881
|
-
if (
|
|
882
|
-
watch(
|
|
881
|
+
if (useSource) {
|
|
882
|
+
watch(useSource, (newValue) => {
|
|
883
883
|
if (newValue === false) {
|
|
884
884
|
releaseLock(uid);
|
|
885
|
-
} else if (newValue === true &&
|
|
885
|
+
} else if (newValue === true && source() === true) {
|
|
886
886
|
addLock(uid);
|
|
887
887
|
}
|
|
888
888
|
});
|
|
889
889
|
}
|
|
890
|
-
watch(
|
|
891
|
-
if (
|
|
890
|
+
watch(source, (newValue) => {
|
|
891
|
+
if (useSource && useSource() === false) {
|
|
892
892
|
return;
|
|
893
893
|
}
|
|
894
894
|
if (newValue === true) {
|
|
@@ -898,34 +898,34 @@ function useLock(props2, state, use2) {
|
|
|
898
898
|
}
|
|
899
899
|
});
|
|
900
900
|
onBeforeMount(() => {
|
|
901
|
-
if (
|
|
901
|
+
if (useSource && useSource() === false) {
|
|
902
902
|
return;
|
|
903
903
|
}
|
|
904
|
-
if (
|
|
904
|
+
if (source() === true) {
|
|
905
905
|
addLock(uid);
|
|
906
906
|
}
|
|
907
907
|
});
|
|
908
908
|
onUnmounted(() => {
|
|
909
|
-
if (
|
|
909
|
+
if (useSource && useSource() === false) {
|
|
910
910
|
return;
|
|
911
911
|
}
|
|
912
|
-
if (
|
|
912
|
+
if (source() === true) {
|
|
913
913
|
releaseLock(uid);
|
|
914
914
|
}
|
|
915
915
|
});
|
|
916
916
|
onActivated(() => {
|
|
917
|
-
if (
|
|
917
|
+
if (useSource && useSource() === false) {
|
|
918
918
|
return;
|
|
919
919
|
}
|
|
920
|
-
if (
|
|
920
|
+
if (source() === true) {
|
|
921
921
|
addLock(uid);
|
|
922
922
|
}
|
|
923
923
|
});
|
|
924
924
|
onDeactivated(() => {
|
|
925
|
-
if (
|
|
925
|
+
if (useSource && useSource() === false) {
|
|
926
926
|
return;
|
|
927
927
|
}
|
|
928
|
-
if (
|
|
928
|
+
if (source() === true) {
|
|
929
929
|
releaseLock(uid);
|
|
930
930
|
}
|
|
931
931
|
});
|
|
@@ -992,7 +992,7 @@ var Popup = defineComponent({
|
|
|
992
992
|
}
|
|
993
993
|
(_props$onUpdateShow = props2["onUpdate:show"]) == null ? void 0 : _props$onUpdateShow.call(props2, false);
|
|
994
994
|
};
|
|
995
|
-
useLock(props2
|
|
995
|
+
useLock(() => props2.show, () => props2.lockScroll);
|
|
996
996
|
watch(() => props2.show, (newValue) => {
|
|
997
997
|
var {
|
|
998
998
|
onOpen,
|
|
@@ -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
|
|
@@ -11493,10 +11493,7 @@ function render$n(_ctx, _cache) {
|
|
|
11493
11493
|
}, 1032, ["class", "onClick"])), [[_directive_ripple]]);
|
|
11494
11494
|
}), 128))]),
|
|
11495
11495
|
default: withCtx(() => [createElementVNode("div", {
|
|
11496
|
-
class: normalizeClass(_ctx.n("size--open")),
|
|
11497
|
-
style: {
|
|
11498
|
-
"display": "flex"
|
|
11499
|
-
},
|
|
11496
|
+
class: normalizeClass(_ctx.classes(_ctx.n("size--open"), [_ctx.current <= 1 || _ctx.disabled, _ctx.n("size--open--disabled")])),
|
|
11500
11497
|
onClick: _cache[5] || (_cache[5] = function() {
|
|
11501
11498
|
return _ctx.showMenu && _ctx.showMenu(...arguments);
|
|
11502
11499
|
})
|
|
@@ -11736,6 +11733,10 @@ var props$k = _extends$2({
|
|
|
11736
11733
|
type: Boolean,
|
|
11737
11734
|
default: false
|
|
11738
11735
|
},
|
|
11736
|
+
cascadeInitialIndexes: {
|
|
11737
|
+
type: Array,
|
|
11738
|
+
default: () => []
|
|
11739
|
+
},
|
|
11739
11740
|
optionHeight: {
|
|
11740
11741
|
type: [Number, String],
|
|
11741
11742
|
default: 44
|
|
@@ -11993,24 +11994,29 @@ var VarPicker = defineComponent({
|
|
|
11993
11994
|
scrollEl: null,
|
|
11994
11995
|
scrolling: false
|
|
11995
11996
|
};
|
|
11996
|
-
scrollTo2(scrollColumn, scrollColumn.index,
|
|
11997
|
+
scrollTo2(scrollColumn, scrollColumn.index, 0, true);
|
|
11997
11998
|
return scrollColumn;
|
|
11998
11999
|
});
|
|
11999
12000
|
};
|
|
12000
12001
|
var normalizeCascadeColumns = (cascadeColumns) => {
|
|
12001
12002
|
var scrollColumns2 = [];
|
|
12002
|
-
createChildren(scrollColumns2, cascadeColumns);
|
|
12003
|
+
createChildren(scrollColumns2, cascadeColumns, true);
|
|
12003
12004
|
return scrollColumns2;
|
|
12004
12005
|
};
|
|
12005
|
-
var createChildren = (scrollColumns2, children)
|
|
12006
|
+
var createChildren = function(scrollColumns2, children, initial) {
|
|
12007
|
+
if (initial === void 0) {
|
|
12008
|
+
initial = false;
|
|
12009
|
+
}
|
|
12006
12010
|
if (isArray(children) && children.length) {
|
|
12011
|
+
var _props$cascadeInitial;
|
|
12012
|
+
var index = initial ? (_props$cascadeInitial = props2.cascadeInitialIndexes[scrollColumns2.length]) != null ? _props$cascadeInitial : 0 : 0;
|
|
12007
12013
|
var scrollColumn = {
|
|
12008
12014
|
id: sid$1++,
|
|
12009
12015
|
prevY: void 0,
|
|
12010
12016
|
momentumPrevY: void 0,
|
|
12011
12017
|
touching: false,
|
|
12012
12018
|
translate: center.value,
|
|
12013
|
-
index
|
|
12019
|
+
index,
|
|
12014
12020
|
duration: 0,
|
|
12015
12021
|
momentumTime: 0,
|
|
12016
12022
|
column: {
|
|
@@ -12021,7 +12027,8 @@ var VarPicker = defineComponent({
|
|
|
12021
12027
|
scrolling: false
|
|
12022
12028
|
};
|
|
12023
12029
|
scrollColumns2.push(scrollColumn);
|
|
12024
|
-
|
|
12030
|
+
scrollTo2(scrollColumn, scrollColumn.index, 0, true);
|
|
12031
|
+
createChildren(scrollColumns2, scrollColumn.columns[scrollColumn.index].children, initial);
|
|
12025
12032
|
}
|
|
12026
12033
|
};
|
|
12027
12034
|
var rebuildChildren = (scrollColumn) => {
|
|
@@ -12387,13 +12394,42 @@ var props$i = {
|
|
|
12387
12394
|
type: Function
|
|
12388
12395
|
}
|
|
12389
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
|
+
}
|
|
12390
12426
|
var {
|
|
12391
12427
|
n: n$m,
|
|
12392
12428
|
classes: classes$h
|
|
12393
12429
|
} = createNamespace("pull-refresh");
|
|
12394
12430
|
var MAX_DISTANCE = 100;
|
|
12395
12431
|
var CONTROL_POSITION = -50;
|
|
12396
|
-
var
|
|
12432
|
+
var ICON_TRANSITION = 150;
|
|
12397
12433
|
function render$k(_ctx, _cache) {
|
|
12398
12434
|
var _component_var_icon = resolveComponent("var-icon");
|
|
12399
12435
|
return openBlock(), createElementBlock("div", {
|
|
@@ -12416,10 +12452,10 @@ function render$k(_ctx, _cache) {
|
|
|
12416
12452
|
style: normalizeStyle(_ctx.controlStyle)
|
|
12417
12453
|
}, [createVNode(_component_var_icon, {
|
|
12418
12454
|
name: _ctx.iconName,
|
|
12419
|
-
transition:
|
|
12420
|
-
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")])),
|
|
12421
12457
|
"var-pull-refresh-cover": ""
|
|
12422
|
-
}, null, 8, ["name", "class"])], 6), renderSlot(_ctx.$slots, "default")], 34);
|
|
12458
|
+
}, null, 8, ["name", "transition", "class"])], 6), renderSlot(_ctx.$slots, "default")], 34);
|
|
12423
12459
|
}
|
|
12424
12460
|
var PullRefresh = defineComponent({
|
|
12425
12461
|
render: render$k,
|
|
@@ -12429,12 +12465,15 @@ var PullRefresh = defineComponent({
|
|
|
12429
12465
|
},
|
|
12430
12466
|
props: props$i,
|
|
12431
12467
|
setup(props2) {
|
|
12468
|
+
var scroller;
|
|
12469
|
+
var changing;
|
|
12432
12470
|
var freshNode = ref(null);
|
|
12433
12471
|
var startPosition = ref(0);
|
|
12434
12472
|
var distance = ref(CONTROL_POSITION);
|
|
12435
12473
|
var iconName = ref("arrow-down");
|
|
12436
12474
|
var refreshStatus = ref("default");
|
|
12437
12475
|
var isEnd = ref(false);
|
|
12476
|
+
var iconHasChanged = ref(true);
|
|
12438
12477
|
var isTouchable = computed(() => refreshStatus.value !== "loading" && refreshStatus.value !== "success" && !props2.disabled);
|
|
12439
12478
|
var controlStyle = computed(() => ({
|
|
12440
12479
|
transform: "translate3d(0px, " + distance.value + "px, 0px) translate(-50%, 0)",
|
|
@@ -12443,6 +12482,14 @@ var PullRefresh = defineComponent({
|
|
|
12443
12482
|
color: props2.successColor || props2.color
|
|
12444
12483
|
}));
|
|
12445
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
|
+
};
|
|
12446
12493
|
var touchStart = (event) => {
|
|
12447
12494
|
if (!isTouchable.value)
|
|
12448
12495
|
return;
|
|
@@ -12457,27 +12504,39 @@ var PullRefresh = defineComponent({
|
|
|
12457
12504
|
event.cancelable && event.preventDefault();
|
|
12458
12505
|
var moveDistance = (event.touches[0].clientY - startPosition.value) / 2 + CONTROL_POSITION;
|
|
12459
12506
|
distance.value = moveDistance >= MAX_DISTANCE ? MAX_DISTANCE : moveDistance;
|
|
12460
|
-
iconName.value = distance.value >= MAX_DISTANCE * 0.2 ? "refresh" : "arrow-down";
|
|
12461
|
-
};
|
|
12462
|
-
var touchEnd = () => {
|
|
12463
|
-
if (!isTouchable.value)
|
|
12464
|
-
return;
|
|
12465
|
-
isEnd.value = true;
|
|
12466
12507
|
if (distance.value >= MAX_DISTANCE * 0.2) {
|
|
12467
|
-
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
(_props$onUpdateModel = props2["onUpdate:modelValue"]) == null ? void 0 : _props$onUpdateModel.call(props2, true);
|
|
12471
|
-
props2.onRefresh == null ? void 0 : props2.onRefresh();
|
|
12508
|
+
iconHasChanged.value = false;
|
|
12509
|
+
iconName.value = "refresh";
|
|
12510
|
+
changing = changeIcon();
|
|
12472
12511
|
} else {
|
|
12473
|
-
refreshStatus.value = "loosing";
|
|
12474
12512
|
iconName.value = "arrow-down";
|
|
12475
|
-
distance.value = CONTROL_POSITION;
|
|
12476
|
-
setTimeout(() => {
|
|
12477
|
-
isEnd.value = false;
|
|
12478
|
-
}, toNumber(props2.animationDuration));
|
|
12479
12513
|
}
|
|
12480
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
|
+
}();
|
|
12481
12540
|
var reset = () => {
|
|
12482
12541
|
setTimeout(() => {
|
|
12483
12542
|
refreshStatus.value = "default";
|
|
@@ -12502,6 +12561,8 @@ var PullRefresh = defineComponent({
|
|
|
12502
12561
|
return {
|
|
12503
12562
|
n: n$m,
|
|
12504
12563
|
classes: classes$h,
|
|
12564
|
+
iconHasChanged,
|
|
12565
|
+
ICON_TRANSITION,
|
|
12505
12566
|
refreshStatus,
|
|
12506
12567
|
freshNode,
|
|
12507
12568
|
touchStart,
|
|
@@ -14350,7 +14411,7 @@ var VarSnackbarCore = defineComponent({
|
|
|
14350
14411
|
var {
|
|
14351
14412
|
zIndex
|
|
14352
14413
|
} = useZIndex(() => props2.show, 1);
|
|
14353
|
-
useLock(props2
|
|
14414
|
+
useLock(() => props2.show, () => props2.lockScroll);
|
|
14354
14415
|
var isForbidClick = computed(() => props2.type === "loading" || props2.forbidClick);
|
|
14355
14416
|
var iconName = computed(() => {
|
|
14356
14417
|
if (!props2.type)
|
|
@@ -15708,17 +15769,17 @@ var Tabs = defineComponent({
|
|
|
15708
15769
|
if (!scrollable.value) {
|
|
15709
15770
|
return;
|
|
15710
15771
|
}
|
|
15711
|
-
var
|
|
15772
|
+
var scroller = scrollerEl.value;
|
|
15712
15773
|
var el = element.value;
|
|
15713
15774
|
if (props2.layoutDirection === "horizontal") {
|
|
15714
|
-
var left = el.offsetLeft + el.offsetWidth / 2 -
|
|
15715
|
-
scrollTo(
|
|
15775
|
+
var left = el.offsetLeft + el.offsetWidth / 2 - scroller.offsetWidth / 2;
|
|
15776
|
+
scrollTo(scroller, {
|
|
15716
15777
|
left,
|
|
15717
15778
|
animation: linear
|
|
15718
15779
|
});
|
|
15719
15780
|
} else {
|
|
15720
|
-
var top = el.offsetTop + el.offsetHeight / 2 -
|
|
15721
|
-
scrollTo(
|
|
15781
|
+
var top = el.offsetTop + el.offsetHeight / 2 - scroller.offsetHeight / 2;
|
|
15782
|
+
scrollTo(scroller, {
|
|
15722
15783
|
top,
|
|
15723
15784
|
animation: linear
|
|
15724
15785
|
});
|