@arco-design/mobile-react 2.27.0 → 2.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/_helpers/index.d.ts +1 -0
- package/cjs/_helpers/index.js +10 -0
- package/cjs/index-bar/index.js +7 -9
- package/cjs/index-bar/type.d.ts +3 -3
- package/cjs/load-more/index.js +4 -1
- package/cjs/nav-bar/index.js +2 -2
- package/cjs/show-monitor/index.js +112 -38
- package/cjs/swipe-load/demo/style/css/mobile.css +3 -0
- package/cjs/swipe-load/demo/style/mobile.less +11 -0
- package/cjs/swipe-load/index.js +86 -32
- package/cjs/swipe-load/style/css/index.css +3 -0
- package/cjs/swipe-load/style/index.less +7 -0
- package/cjs/swipe-load/type.d.ts +29 -0
- package/cjs/tabs/index.js +1 -0
- package/dist/index.js +393 -838
- package/dist/index.min.js +5 -5
- package/dist/style.css +3 -0
- package/dist/style.min.css +1 -1
- package/esm/_helpers/index.d.ts +1 -0
- package/esm/_helpers/index.js +7 -0
- package/esm/index-bar/index.js +1 -2
- package/esm/index-bar/type.d.ts +3 -3
- package/esm/load-more/index.js +4 -1
- package/esm/nav-bar/index.js +2 -2
- package/esm/show-monitor/index.js +112 -38
- package/esm/swipe-load/demo/style/css/mobile.css +3 -0
- package/esm/swipe-load/demo/style/mobile.less +11 -0
- package/esm/swipe-load/index.js +85 -32
- package/esm/swipe-load/style/css/index.css +3 -0
- package/esm/swipe-load/style/index.less +7 -0
- package/esm/swipe-load/type.d.ts +29 -0
- package/esm/tabs/index.js +1 -0
- package/package.json +3 -3
- package/umd/_helpers/index.d.ts +1 -0
- package/umd/_helpers/index.js +10 -0
- package/umd/index-bar/index.js +10 -10
- package/umd/index-bar/type.d.ts +3 -3
- package/umd/load-more/index.js +4 -1
- package/umd/nav-bar/index.js +2 -2
- package/umd/show-monitor/index.js +112 -38
- package/umd/swipe-load/demo/style/css/mobile.css +3 -0
- package/umd/swipe-load/demo/style/mobile.less +11 -0
- package/umd/swipe-load/index.js +88 -36
- package/umd/swipe-load/style/css/index.css +3 -0
- package/umd/swipe-load/style/index.less +7 -0
- package/umd/swipe-load/type.d.ts +29 -0
- package/umd/tabs/index.js +1 -0
package/dist/index.js
CHANGED
@@ -110,34 +110,34 @@
|
|
110
110
|
return r;
|
111
111
|
}
|
112
112
|
|
113
|
-
var opt
|
114
|
-
function isArray
|
115
|
-
return opt
|
113
|
+
var opt = Object.prototype.toString;
|
114
|
+
function isArray(obj) {
|
115
|
+
return opt.call(obj) === '[object Array]';
|
116
116
|
}
|
117
|
-
function isObject$
|
118
|
-
return opt
|
117
|
+
function isObject$2(obj) {
|
118
|
+
return opt.call(obj) === '[object Object]';
|
119
119
|
}
|
120
120
|
function isString(obj) {
|
121
|
-
return opt
|
121
|
+
return opt.call(obj) === '[object String]';
|
122
122
|
}
|
123
123
|
function isOneOf(value, validList) {
|
124
124
|
return validList.indexOf(value) !== -1;
|
125
125
|
}
|
126
|
-
function isEmptyValue
|
126
|
+
function isEmptyValue(obj) {
|
127
127
|
return obj === undefined || obj === null || obj === '';
|
128
128
|
}
|
129
|
-
function isFunction
|
129
|
+
function isFunction(obj) {
|
130
130
|
return Object.prototype.toString.call(obj).toLowerCase() === '[object function]';
|
131
131
|
}
|
132
|
-
function isEmptyArray
|
133
|
-
return isArray
|
132
|
+
function isEmptyArray(obj) {
|
133
|
+
return isArray(obj) && !(obj === null || obj === void 0 ? void 0 : obj.length);
|
134
134
|
}
|
135
|
-
var isDeepEqual
|
135
|
+
var isDeepEqual = function isDeepEqual(obj, sub) {
|
136
136
|
if (typeof obj !== 'object' || typeof sub !== 'object' || obj === null || sub === null) {
|
137
137
|
return obj === sub;
|
138
138
|
}
|
139
139
|
|
140
|
-
if (isFunction
|
140
|
+
if (isFunction(obj) && isFunction(sub)) {
|
141
141
|
return obj === sub || obj.toString() === sub.toString();
|
142
142
|
}
|
143
143
|
|
@@ -171,9 +171,9 @@
|
|
171
171
|
|
172
172
|
if (isString(v)) {
|
173
173
|
classNames.push(v);
|
174
|
-
} else if (isArray
|
174
|
+
} else if (isArray(v)) {
|
175
175
|
classNames = classNames.concat(v);
|
176
|
-
} else if (isObject$
|
176
|
+
} else if (isObject$2(v)) {
|
177
177
|
Object.keys(v).forEach(function (k) {
|
178
178
|
if (v[k]) {
|
179
179
|
classNames.push(k);
|
@@ -197,113 +197,113 @@
|
|
197
197
|
* by Gaëtan Renaudeau 2014 - 2015 – MIT License
|
198
198
|
*/
|
199
199
|
// These values are established by empiricism with tests (tradeoff: performance VS precision)
|
200
|
-
var NEWTON_ITERATIONS
|
201
|
-
var NEWTON_MIN_SLOPE
|
202
|
-
var SUBDIVISION_PRECISION
|
203
|
-
var SUBDIVISION_MAX_ITERATIONS
|
204
|
-
var kSplineTableSize
|
205
|
-
var kSampleStepSize
|
206
|
-
var float32ArraySupported
|
207
|
-
|
208
|
-
function A
|
200
|
+
var NEWTON_ITERATIONS = 4;
|
201
|
+
var NEWTON_MIN_SLOPE = 0.001;
|
202
|
+
var SUBDIVISION_PRECISION = 0.0000001;
|
203
|
+
var SUBDIVISION_MAX_ITERATIONS = 10;
|
204
|
+
var kSplineTableSize = 11;
|
205
|
+
var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
|
206
|
+
var float32ArraySupported = typeof Float32Array === 'function';
|
207
|
+
|
208
|
+
function A(aA1, aA2) {
|
209
209
|
return 1.0 - 3.0 * aA2 + 3.0 * aA1;
|
210
210
|
}
|
211
211
|
|
212
|
-
function B
|
212
|
+
function B(aA1, aA2) {
|
213
213
|
return 3.0 * aA2 - 6.0 * aA1;
|
214
214
|
}
|
215
215
|
|
216
|
-
function C
|
216
|
+
function C(aA1) {
|
217
217
|
return 3.0 * aA1;
|
218
218
|
} // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
|
219
219
|
|
220
220
|
|
221
|
-
function calcBezier
|
222
|
-
return ((A
|
221
|
+
function calcBezier(aT, aA1, aA2) {
|
222
|
+
return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
|
223
223
|
} // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
|
224
224
|
|
225
225
|
|
226
|
-
function getSlope
|
227
|
-
return 3.0 * A
|
226
|
+
function getSlope(aT, aA1, aA2) {
|
227
|
+
return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
|
228
228
|
}
|
229
229
|
|
230
|
-
function binarySubdivide
|
230
|
+
function binarySubdivide(aX, aA, aB, mX1, mX2) {
|
231
231
|
var currentX, currentT;
|
232
232
|
var i = 0;
|
233
233
|
|
234
234
|
do {
|
235
235
|
currentT = aA + (aB - aA) / 2.0;
|
236
|
-
currentX = calcBezier
|
236
|
+
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
237
237
|
|
238
238
|
if (currentX > 0.0) {
|
239
239
|
aB = currentT;
|
240
240
|
} else {
|
241
241
|
aA = currentT;
|
242
242
|
}
|
243
|
-
} while (Math.abs(currentX) > SUBDIVISION_PRECISION
|
243
|
+
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
244
244
|
|
245
245
|
return currentT;
|
246
246
|
}
|
247
247
|
|
248
|
-
function newtonRaphsonIterate
|
249
|
-
for (var i = 0; i < NEWTON_ITERATIONS
|
250
|
-
var currentSlope = getSlope
|
248
|
+
function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
|
249
|
+
for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
|
250
|
+
var currentSlope = getSlope(aGuessT, mX1, mX2);
|
251
251
|
|
252
252
|
if (currentSlope === 0.0) {
|
253
253
|
return aGuessT;
|
254
254
|
}
|
255
255
|
|
256
|
-
var currentX = calcBezier
|
256
|
+
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
257
257
|
aGuessT -= currentX / currentSlope;
|
258
258
|
}
|
259
259
|
|
260
260
|
return aGuessT;
|
261
261
|
}
|
262
262
|
|
263
|
-
function LinearEasing
|
263
|
+
function LinearEasing(x) {
|
264
264
|
return x;
|
265
265
|
}
|
266
266
|
|
267
|
-
function bezier
|
267
|
+
function bezier(mX1, mY1, mX2, mY2) {
|
268
268
|
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
|
269
269
|
throw new Error('bezier x values must be in [0, 1] range');
|
270
270
|
}
|
271
271
|
|
272
272
|
if (mX1 === mY1 && mX2 === mY2) {
|
273
|
-
return LinearEasing
|
273
|
+
return LinearEasing;
|
274
274
|
} // Precompute samples table
|
275
275
|
|
276
276
|
|
277
|
-
var sampleValues = float32ArraySupported
|
277
|
+
var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
278
278
|
|
279
|
-
for (var i = 0; i < kSplineTableSize
|
280
|
-
sampleValues[i] = calcBezier
|
279
|
+
for (var i = 0; i < kSplineTableSize; ++i) {
|
280
|
+
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
281
281
|
}
|
282
282
|
|
283
283
|
function getTForX(aX) {
|
284
284
|
var intervalStart = 0.0;
|
285
285
|
var currentSample = 1;
|
286
|
-
var lastSample = kSplineTableSize
|
286
|
+
var lastSample = kSplineTableSize - 1;
|
287
287
|
|
288
288
|
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
289
|
-
intervalStart += kSampleStepSize
|
289
|
+
intervalStart += kSampleStepSize;
|
290
290
|
}
|
291
291
|
|
292
292
|
--currentSample; // Interpolate to provide an initial guess for t
|
293
293
|
|
294
294
|
var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
295
|
-
var guessForT = intervalStart + dist * kSampleStepSize
|
296
|
-
var initialSlope = getSlope
|
295
|
+
var guessForT = intervalStart + dist * kSampleStepSize;
|
296
|
+
var initialSlope = getSlope(guessForT, mX1, mX2);
|
297
297
|
|
298
|
-
if (initialSlope >= NEWTON_MIN_SLOPE
|
299
|
-
return newtonRaphsonIterate
|
298
|
+
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
299
|
+
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
300
300
|
}
|
301
301
|
|
302
302
|
if (initialSlope === 0.0) {
|
303
303
|
return guessForT;
|
304
304
|
}
|
305
305
|
|
306
|
-
return binarySubdivide
|
306
|
+
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
|
307
307
|
}
|
308
308
|
|
309
309
|
return function BezierEasing(x) {
|
@@ -312,7 +312,7 @@
|
|
312
312
|
return x;
|
313
313
|
}
|
314
314
|
|
315
|
-
return calcBezier
|
315
|
+
return calcBezier(getTForX(x), mY1, mY2);
|
316
316
|
};
|
317
317
|
}
|
318
318
|
|
@@ -386,20 +386,20 @@
|
|
386
386
|
|
387
387
|
return false;
|
388
388
|
};
|
389
|
-
function execRAF
|
389
|
+
function execRAF(fn) {
|
390
390
|
try {
|
391
391
|
return requestAnimationFrame(fn);
|
392
392
|
} catch (e) {
|
393
393
|
return setTimeout(fn, 17);
|
394
394
|
}
|
395
395
|
}
|
396
|
-
function scrollWithAnimation
|
396
|
+
function scrollWithAnimation(initTop, target, scrollTo, duration, bezier$1, type) {
|
397
397
|
if (duration === void 0) {
|
398
398
|
duration = 300;
|
399
399
|
}
|
400
400
|
|
401
|
-
if (bezier === void 0) {
|
402
|
-
bezier = [0.34, 0.69, 0.1, 1];
|
401
|
+
if (bezier$1 === void 0) {
|
402
|
+
bezier$1 = [0.34, 0.69, 0.1, 1];
|
403
403
|
}
|
404
404
|
|
405
405
|
if (type === void 0) {
|
@@ -415,13 +415,13 @@
|
|
415
415
|
if (p > 1) {
|
416
416
|
scrollTo(targetTop);
|
417
417
|
} else {
|
418
|
-
var newTop = initTop + (targetTop - initTop) * bezier
|
418
|
+
var newTop = initTop + (targetTop - initTop) * bezier.apply(void 0, bezier$1)(p);
|
419
419
|
scrollTo(newTop);
|
420
|
-
execRAF
|
420
|
+
execRAF(fn);
|
421
421
|
}
|
422
422
|
};
|
423
423
|
|
424
|
-
execRAF
|
424
|
+
execRAF(fn);
|
425
425
|
}
|
426
426
|
/**
|
427
427
|
* 返回节点的 document 对象属性
|
@@ -943,7 +943,7 @@
|
|
943
943
|
}
|
944
944
|
}
|
945
945
|
|
946
|
-
var defaultMessageTemplate$
|
946
|
+
var defaultMessageTemplate$1 = '%s 不是 %s 类型';
|
947
947
|
var localeConfig = {
|
948
948
|
locale: 'zh-CN',
|
949
949
|
LoadMore: {
|
@@ -1003,13 +1003,13 @@
|
|
1003
1003
|
Form: {
|
1004
1004
|
required: '%s 为必填项',
|
1005
1005
|
type: {
|
1006
|
-
email: defaultMessageTemplate$
|
1007
|
-
url: defaultMessageTemplate$
|
1008
|
-
string: defaultMessageTemplate$
|
1009
|
-
number: defaultMessageTemplate$
|
1010
|
-
array: defaultMessageTemplate$
|
1011
|
-
object: defaultMessageTemplate$
|
1012
|
-
boolean: defaultMessageTemplate$
|
1006
|
+
email: defaultMessageTemplate$1,
|
1007
|
+
url: defaultMessageTemplate$1,
|
1008
|
+
string: defaultMessageTemplate$1,
|
1009
|
+
number: defaultMessageTemplate$1,
|
1010
|
+
array: defaultMessageTemplate$1,
|
1011
|
+
object: defaultMessageTemplate$1,
|
1012
|
+
boolean: defaultMessageTemplate$1
|
1013
1013
|
},
|
1014
1014
|
number: {
|
1015
1015
|
min: '`%s` 小于 `%s`',
|
@@ -1158,7 +1158,7 @@
|
|
1158
1158
|
return DateWithUTC;
|
1159
1159
|
}();
|
1160
1160
|
|
1161
|
-
var ValidatorType
|
1161
|
+
var ValidatorType;
|
1162
1162
|
|
1163
1163
|
(function (ValidatorType) {
|
1164
1164
|
ValidatorType["Number"] = "number";
|
@@ -1167,7 +1167,7 @@
|
|
1167
1167
|
ValidatorType["Boolean"] = "boolean";
|
1168
1168
|
ValidatorType["Object"] = "object";
|
1169
1169
|
ValidatorType["Custom"] = "custom";
|
1170
|
-
})(ValidatorType
|
1170
|
+
})(ValidatorType || (ValidatorType = {}));
|
1171
1171
|
|
1172
1172
|
var __assign$1 = undefined && undefined.__assign || function () {
|
1173
1173
|
__assign$1 = Object.assign || function (t) {
|
@@ -1184,17 +1184,17 @@
|
|
1184
1184
|
|
1185
1185
|
return __assign$1.apply(this, arguments);
|
1186
1186
|
};
|
1187
|
-
var defaultMessageTemplate
|
1188
|
-
var messageTemplate
|
1187
|
+
var defaultMessageTemplate = '%s is not a %s type';
|
1188
|
+
var messageTemplate = {
|
1189
1189
|
required: '%s is required',
|
1190
1190
|
type: {
|
1191
|
-
email: defaultMessageTemplate
|
1192
|
-
url: defaultMessageTemplate
|
1193
|
-
string: defaultMessageTemplate
|
1194
|
-
number: defaultMessageTemplate
|
1195
|
-
array: defaultMessageTemplate
|
1196
|
-
object: defaultMessageTemplate
|
1197
|
-
boolean: defaultMessageTemplate
|
1191
|
+
email: defaultMessageTemplate,
|
1192
|
+
url: defaultMessageTemplate,
|
1193
|
+
string: defaultMessageTemplate,
|
1194
|
+
number: defaultMessageTemplate,
|
1195
|
+
array: defaultMessageTemplate,
|
1196
|
+
object: defaultMessageTemplate,
|
1197
|
+
boolean: defaultMessageTemplate
|
1198
1198
|
},
|
1199
1199
|
number: {
|
1200
1200
|
min: '`%s` is not greater than `%s`',
|
@@ -1228,9 +1228,9 @@
|
|
1228
1228
|
equal: '%s is not equal to `%s`'
|
1229
1229
|
}
|
1230
1230
|
};
|
1231
|
-
var getMsgTemplate
|
1231
|
+
var getMsgTemplate = function getMsgTemplate(templates, temName, values) {
|
1232
1232
|
var temNameArr = temName.split('.');
|
1233
|
-
var theTemplate = defaultMessageTemplate
|
1233
|
+
var theTemplate = defaultMessageTemplate;
|
1234
1234
|
|
1235
1235
|
if (temNameArr[0] in templates) {
|
1236
1236
|
var firstTemplate = templates[temNameArr[0]];
|
@@ -1247,14 +1247,14 @@
|
|
1247
1247
|
return cur < values.length ? values[cur++] : curVal;
|
1248
1248
|
});
|
1249
1249
|
};
|
1250
|
-
var mergeMsgTemplate
|
1250
|
+
var mergeMsgTemplate = function mergeMsgTemplate(originMT, newMT) {
|
1251
1251
|
var targetMT = originMT;
|
1252
1252
|
|
1253
1253
|
if (newMT) {
|
1254
1254
|
Object.keys(originMT).forEach(function (key) {
|
1255
1255
|
var originValue = originMT[key];
|
1256
1256
|
var curValue = newMT === null || newMT === void 0 ? void 0 : newMT[key];
|
1257
|
-
targetMT[key] = isObject$
|
1257
|
+
targetMT[key] = isObject$2(originValue) ? __assign$1(__assign$1({}, originValue), curValue) : curValue || originValue;
|
1258
1258
|
});
|
1259
1259
|
}
|
1260
1260
|
|
@@ -1300,7 +1300,7 @@
|
|
1300
1300
|
return t;
|
1301
1301
|
}; // eslint-disable-next-line max-classes-per-file
|
1302
1302
|
|
1303
|
-
var BaseValidator
|
1303
|
+
var BaseValidator =
|
1304
1304
|
/** @class */
|
1305
1305
|
function () {
|
1306
1306
|
function BaseValidator(value, rule, options) {
|
@@ -1311,7 +1311,7 @@
|
|
1311
1311
|
rest = __rest(rule, ["message"]);
|
1312
1312
|
|
1313
1313
|
this.message = message || '';
|
1314
|
-
this.type = rule.type || ValidatorType
|
1314
|
+
this.type = rule.type || ValidatorType.String;
|
1315
1315
|
this.error = {
|
1316
1316
|
value: value,
|
1317
1317
|
message: [],
|
@@ -1320,13 +1320,13 @@
|
|
1320
1320
|
this.field = options.field || '';
|
1321
1321
|
this.rule = rest;
|
1322
1322
|
this.validateRules = [];
|
1323
|
-
this.curValidMsgTemplate = mergeMsgTemplate
|
1323
|
+
this.curValidMsgTemplate = mergeMsgTemplate(messageTemplate, options.validateMessage);
|
1324
1324
|
}
|
1325
1325
|
|
1326
1326
|
BaseValidator.prototype.isRequired = function () {
|
1327
1327
|
// 优先级最高
|
1328
|
-
if (isEmptyValue
|
1329
|
-
this.error.message = [this.message || getMsgTemplate
|
1328
|
+
if (isEmptyValue(this.value) || isEmptyArray(this.value)) {
|
1329
|
+
this.error.message = [this.message || getMsgTemplate(this.curValidMsgTemplate, 'required', [this.field])];
|
1330
1330
|
this.error.errorTypes = ['required'];
|
1331
1331
|
return false;
|
1332
1332
|
}
|
@@ -1350,7 +1350,7 @@
|
|
1350
1350
|
values = _a.values;
|
1351
1351
|
|
1352
1352
|
if (isError) {
|
1353
|
-
var theMessage = this.message || getMsgTemplate
|
1353
|
+
var theMessage = this.message || getMsgTemplate(this.curValidMsgTemplate, errTemplate, values);
|
1354
1354
|
this.error.errorTypes.push(errTemplate);
|
1355
1355
|
(_b = this.error.message) === null || _b === void 0 ? void 0 : _b.push(theMessage);
|
1356
1356
|
return theMessage;
|
@@ -1379,42 +1379,42 @@
|
|
1379
1379
|
}
|
1380
1380
|
|
1381
1381
|
NumberValidator.prototype.min = function (num) {
|
1382
|
-
this.dealError(!isEmptyValue
|
1382
|
+
this.dealError(!isEmptyValue(this.value) && this.value < num, {
|
1383
1383
|
errTemplate: 'number.min',
|
1384
1384
|
values: [this.field, "" + num]
|
1385
1385
|
});
|
1386
1386
|
};
|
1387
1387
|
|
1388
1388
|
NumberValidator.prototype.max = function (num) {
|
1389
|
-
this.dealError(!isEmptyValue
|
1389
|
+
this.dealError(!isEmptyValue(this.value) && this.value > num, {
|
1390
1390
|
errTemplate: 'number.max',
|
1391
1391
|
values: [this.field, "" + num]
|
1392
1392
|
});
|
1393
1393
|
};
|
1394
1394
|
|
1395
1395
|
NumberValidator.prototype.equal = function (num) {
|
1396
|
-
return this.dealError(!isEmptyValue
|
1396
|
+
return this.dealError(!isEmptyValue(this.value) && this.value !== num, {
|
1397
1397
|
errTemplate: 'number.equal',
|
1398
1398
|
values: [this.field, "" + num]
|
1399
1399
|
});
|
1400
1400
|
};
|
1401
1401
|
|
1402
1402
|
NumberValidator.prototype.positive = function () {
|
1403
|
-
return this.dealError(!isEmptyValue
|
1403
|
+
return this.dealError(!isEmptyValue(this.value) && this.value < 0, {
|
1404
1404
|
errTemplate: 'number.positive',
|
1405
1405
|
values: [this.field]
|
1406
1406
|
});
|
1407
1407
|
};
|
1408
1408
|
|
1409
1409
|
NumberValidator.prototype.negative = function () {
|
1410
|
-
return this.dealError(!isEmptyValue
|
1410
|
+
return this.dealError(!isEmptyValue(this.value) && this.value > 0, {
|
1411
1411
|
errTemplate: 'number.negative',
|
1412
1412
|
values: [this.field]
|
1413
1413
|
});
|
1414
1414
|
};
|
1415
1415
|
|
1416
1416
|
return NumberValidator;
|
1417
|
-
}(BaseValidator
|
1417
|
+
}(BaseValidator);
|
1418
1418
|
|
1419
1419
|
var StringValidator =
|
1420
1420
|
/** @class */
|
@@ -1429,21 +1429,21 @@
|
|
1429
1429
|
}
|
1430
1430
|
|
1431
1431
|
StringValidator.prototype.min = function (num) {
|
1432
|
-
return this.dealError(!isEmptyValue
|
1432
|
+
return this.dealError(!isEmptyValue(this.value) && this.value.length < num, {
|
1433
1433
|
errTemplate: 'string.min',
|
1434
1434
|
values: [this.field, "" + num]
|
1435
1435
|
});
|
1436
1436
|
};
|
1437
1437
|
|
1438
1438
|
StringValidator.prototype.max = function (num) {
|
1439
|
-
return this.dealError(!isEmptyValue
|
1439
|
+
return this.dealError(!isEmptyValue(this.value) && this.value.length > num, {
|
1440
1440
|
errTemplate: 'string.max',
|
1441
1441
|
values: [this.field, "" + num]
|
1442
1442
|
});
|
1443
1443
|
};
|
1444
1444
|
|
1445
1445
|
StringValidator.prototype.len = function (num) {
|
1446
|
-
return this.dealError(!isEmptyValue
|
1446
|
+
return this.dealError(!isEmptyValue(this.value) && this.value !== num, {
|
1447
1447
|
errTemplate: 'string.equal',
|
1448
1448
|
values: [this.field, "" + num]
|
1449
1449
|
});
|
@@ -1451,7 +1451,7 @@
|
|
1451
1451
|
|
1452
1452
|
StringValidator.prototype.match = function (regStr) {
|
1453
1453
|
var reg = new RegExp(regStr);
|
1454
|
-
return this.dealError(!isEmptyValue
|
1454
|
+
return this.dealError(!isEmptyValue(this.value) && !reg.test(this.value), {
|
1455
1455
|
errTemplate: 'string.match',
|
1456
1456
|
values: [this.field, regStr]
|
1457
1457
|
});
|
@@ -1459,7 +1459,7 @@
|
|
1459
1459
|
|
1460
1460
|
StringValidator.prototype.uppercase = function (isValue) {
|
1461
1461
|
var isUppercase = (this.value || '').toLocaleUpperCase() === this.value;
|
1462
|
-
return this.dealError(!isEmptyValue
|
1462
|
+
return this.dealError(!isEmptyValue(this.value) && isUppercase !== isValue, {
|
1463
1463
|
errTemplate: 'string.uppercase',
|
1464
1464
|
values: [this.field]
|
1465
1465
|
});
|
@@ -1467,21 +1467,21 @@
|
|
1467
1467
|
|
1468
1468
|
StringValidator.prototype.lowercase = function (isValue) {
|
1469
1469
|
var isLowercase = (this.value || '').toLocaleLowerCase() === this.value;
|
1470
|
-
return this.dealError(!isEmptyValue
|
1470
|
+
return this.dealError(!isEmptyValue(this.value) && isLowercase !== isValue, {
|
1471
1471
|
errTemplate: 'string.lowercase',
|
1472
1472
|
values: [this.field]
|
1473
1473
|
});
|
1474
1474
|
};
|
1475
1475
|
|
1476
1476
|
StringValidator.prototype.whitespace = function () {
|
1477
|
-
return this.dealError(!isEmptyValue
|
1477
|
+
return this.dealError(!isEmptyValue(this.value) && isEmptyValue(this.value.trim()), {
|
1478
1478
|
errTemplate: 'string.whitespace',
|
1479
1479
|
values: [this.field]
|
1480
1480
|
});
|
1481
1481
|
};
|
1482
1482
|
|
1483
1483
|
return StringValidator;
|
1484
|
-
}(BaseValidator
|
1484
|
+
}(BaseValidator);
|
1485
1485
|
|
1486
1486
|
var ArrayValidator =
|
1487
1487
|
/** @class */
|
@@ -1496,21 +1496,21 @@
|
|
1496
1496
|
}
|
1497
1497
|
|
1498
1498
|
ArrayValidator.prototype.min = function (num) {
|
1499
|
-
return this.dealError(!isEmptyValue
|
1499
|
+
return this.dealError(!isEmptyValue(this.value) && this.value.length < num, {
|
1500
1500
|
errTemplate: 'array.min',
|
1501
1501
|
values: [this.field, "" + num]
|
1502
1502
|
});
|
1503
1503
|
};
|
1504
1504
|
|
1505
1505
|
ArrayValidator.prototype.max = function (num) {
|
1506
|
-
return this.dealError(!isEmptyValue
|
1506
|
+
return this.dealError(!isEmptyValue(this.value) && this.value.length > num, {
|
1507
1507
|
errTemplate: 'array.max',
|
1508
1508
|
values: [this.field, "" + num]
|
1509
1509
|
});
|
1510
1510
|
};
|
1511
1511
|
|
1512
1512
|
ArrayValidator.prototype.deepEqual = function (sub) {
|
1513
|
-
return this.dealError(!isDeepEqual
|
1513
|
+
return this.dealError(!isDeepEqual(this.value, sub), {
|
1514
1514
|
errTemplate: 'array.equal',
|
1515
1515
|
values: [this.field, "" + JSON.stringify(sub)]
|
1516
1516
|
});
|
@@ -1528,7 +1528,7 @@
|
|
1528
1528
|
};
|
1529
1529
|
|
1530
1530
|
return ArrayValidator;
|
1531
|
-
}(BaseValidator
|
1531
|
+
}(BaseValidator);
|
1532
1532
|
|
1533
1533
|
var ObjectValidator =
|
1534
1534
|
/** @class */
|
@@ -1543,15 +1543,15 @@
|
|
1543
1543
|
}
|
1544
1544
|
|
1545
1545
|
ObjectValidator.prototype.deepEqual = function (sub) {
|
1546
|
-
return this.dealError(!isDeepEqual
|
1546
|
+
return this.dealError(!isDeepEqual(this.value, sub), {
|
1547
1547
|
errTemplate: 'object.deepEqual',
|
1548
1548
|
values: [this.field, "" + JSON.stringify(sub)]
|
1549
1549
|
});
|
1550
1550
|
};
|
1551
1551
|
|
1552
1552
|
ObjectValidator.prototype.hasKeys = function (keys) {
|
1553
|
-
var allKeys = isEmptyValue
|
1554
|
-
return this.dealError(!isEmptyValue
|
1553
|
+
var allKeys = isEmptyValue(this.value) ? [] : Object.keys(this.value);
|
1554
|
+
return this.dealError(!isEmptyValue(this.value) && keys.some(function (theKey) {
|
1555
1555
|
return !allKeys.includes(theKey);
|
1556
1556
|
}), {
|
1557
1557
|
errTemplate: 'object.hasKeys',
|
@@ -1560,7 +1560,7 @@
|
|
1560
1560
|
};
|
1561
1561
|
|
1562
1562
|
return ObjectValidator;
|
1563
|
-
}(BaseValidator
|
1563
|
+
}(BaseValidator);
|
1564
1564
|
|
1565
1565
|
var CustomValidator =
|
1566
1566
|
/** @class */
|
@@ -1598,7 +1598,7 @@
|
|
1598
1598
|
};
|
1599
1599
|
|
1600
1600
|
return CustomValidator;
|
1601
|
-
}(BaseValidator
|
1601
|
+
}(BaseValidator);
|
1602
1602
|
|
1603
1603
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
1604
1604
|
|
@@ -2923,7 +2923,7 @@
|
|
2923
2923
|
Object.keys(this.rules).forEach(function (key) {
|
2924
2924
|
var spPromiseGroup = [];
|
2925
2925
|
|
2926
|
-
if (isArray
|
2926
|
+
if (isArray(_this.rules[key])) {
|
2927
2927
|
for (var i = 0; i < _this.rules[key].length; i++) {
|
2928
2928
|
var rule = _this.rules[key][i];
|
2929
2929
|
|
@@ -3529,7 +3529,7 @@
|
|
3529
3529
|
|
3530
3530
|
var latestPercentage = React.useRef(percentage);
|
3531
3531
|
React.useEffect(function () {
|
3532
|
-
mountedTransition ? scrollWithAnimation
|
3532
|
+
mountedTransition ? scrollWithAnimation(0, percentage, function (progress) {
|
3533
3533
|
var targetProgress = progress / percentage * latestPercentage.current;
|
3534
3534
|
setCurrentPercentage(Math.floor(targetProgress));
|
3535
3535
|
}, duration, mountedBezier) : setCurrentPercentage(percentage);
|
@@ -3594,7 +3594,7 @@
|
|
3594
3594
|
|
3595
3595
|
var _a;
|
3596
3596
|
|
3597
|
-
function isObject$
|
3597
|
+
function isObject$1(obj) {
|
3598
3598
|
return Object.prototype.toString.call(obj) === '[object Object]';
|
3599
3599
|
}
|
3600
3600
|
|
@@ -3606,7 +3606,7 @@
|
|
3606
3606
|
var updateUsingClientEntryPoint = function updateUsingClientEntryPoint(skipWarning) {
|
3607
3607
|
// https://github.com/facebook/react/blob/17806594cc28284fe195f918e8d77de3516848ec/packages/react-dom/npm/client.js#L10
|
3608
3608
|
// Avoid console warning
|
3609
|
-
if (isObject$
|
3609
|
+
if (isObject$1(CopyReactDOM[__SECRET_INTERNALS__])) {
|
3610
3610
|
CopyReactDOM[__SECRET_INTERNALS__].usingClientEntryPoint = skipWarning;
|
3611
3611
|
}
|
3612
3612
|
};
|
@@ -3662,6 +3662,13 @@
|
|
3662
3662
|
}, {});
|
3663
3663
|
return newStyle;
|
3664
3664
|
}
|
3665
|
+
function setStyleWithVendor(dom, style) {
|
3666
|
+
var vendorStyle = getStyleWithVendor(style);
|
3667
|
+
|
3668
|
+
for (var key in vendorStyle) {
|
3669
|
+
dom.style[key] = vendorStyle[key];
|
3670
|
+
}
|
3671
|
+
}
|
3665
3672
|
/**
|
3666
3673
|
* 计算默认值,仅未定义时使用默认值
|
3667
3674
|
* @desc {en} Calculate the default value, use default value only if undefined
|
@@ -10518,7 +10525,7 @@
|
|
10518
10525
|
* */
|
10519
10526
|
|
10520
10527
|
function isCascadeArray(options) {
|
10521
|
-
return typeof options[0] === 'object' && !isArray
|
10528
|
+
return typeof options[0] === 'object' && !isArray(options[0]);
|
10522
10529
|
}
|
10523
10530
|
/**
|
10524
10531
|
* 格式化传入的数组
|
@@ -12883,7 +12890,7 @@
|
|
12883
12890
|
|
12884
12891
|
var fieldDisabled = disabled || propsDisabled;
|
12885
12892
|
var fieldRules = (rest === null || rest === void 0 ? void 0 : rest.required) ? __spreadArrays$1([{
|
12886
|
-
type: ValidatorType
|
12893
|
+
type: ValidatorType.String,
|
12887
12894
|
required: true
|
12888
12895
|
}], rules || []) : rules;
|
12889
12896
|
var isRequired = isFieldRequired(rules) || (rest === null || rest === void 0 ? void 0 : rest.required);
|
@@ -14897,7 +14904,7 @@
|
|
14897
14904
|
throw new TypeError(FUNC_ERROR_TEXT);
|
14898
14905
|
}
|
14899
14906
|
wait = toNumber(wait) || 0;
|
14900
|
-
if (isObject
|
14907
|
+
if (isObject(options)) {
|
14901
14908
|
leading = !!options.leading;
|
14902
14909
|
maxing = 'maxWait' in options;
|
14903
14910
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
@@ -15054,7 +15061,7 @@
|
|
15054
15061
|
if (typeof func != 'function') {
|
15055
15062
|
throw new TypeError(FUNC_ERROR_TEXT);
|
15056
15063
|
}
|
15057
|
-
if (isObject
|
15064
|
+
if (isObject(options)) {
|
15058
15065
|
leading = 'leading' in options ? !!options.leading : leading;
|
15059
15066
|
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
15060
15067
|
}
|
@@ -15090,7 +15097,7 @@
|
|
15090
15097
|
* _.isObject(null);
|
15091
15098
|
* // => false
|
15092
15099
|
*/
|
15093
|
-
function isObject
|
15100
|
+
function isObject(value) {
|
15094
15101
|
var type = typeof value;
|
15095
15102
|
return !!value && (type == 'object' || type == 'function');
|
15096
15103
|
}
|
@@ -15175,9 +15182,9 @@
|
|
15175
15182
|
if (isSymbol(value)) {
|
15176
15183
|
return NAN;
|
15177
15184
|
}
|
15178
|
-
if (isObject
|
15185
|
+
if (isObject(value)) {
|
15179
15186
|
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
15180
|
-
value = isObject
|
15187
|
+
value = isObject(other) ? (other + '') : other;
|
15181
15188
|
}
|
15182
15189
|
if (typeof value != 'string') {
|
15183
15190
|
return value === 0 ? value : +value;
|
@@ -15205,6 +15212,18 @@
|
|
15205
15212
|
|
15206
15213
|
var listeners = {};
|
15207
15214
|
var onOnceEmittedListeners = {};
|
15215
|
+
/**
|
15216
|
+
* Intersection Observer 同一 root 节点下的监听队列
|
15217
|
+
* @en Intersection Observer Listening queue under the same root node
|
15218
|
+
*/
|
15219
|
+
|
15220
|
+
var ioListeners = [];
|
15221
|
+
/**
|
15222
|
+
* Intersection Observer 监听 visible 状态队列
|
15223
|
+
* @en Intersection Observer listens to the visible status queue
|
15224
|
+
*/
|
15225
|
+
|
15226
|
+
var ioVisibleList = [];
|
15208
15227
|
var throttlingVisibleChange;
|
15209
15228
|
/**
|
15210
15229
|
* 通过滚动事件监测 children 是否进入视口或离开视口。
|
@@ -15252,12 +15271,6 @@
|
|
15252
15271
|
*/
|
15253
15272
|
|
15254
15273
|
var domRefParent = React.useRef(null);
|
15255
|
-
/**
|
15256
|
-
* 当前元素是否在可视区域内
|
15257
|
-
* @en Whether the current element is in the visible area
|
15258
|
-
*/
|
15259
|
-
|
15260
|
-
var isVisible = React.useRef(false);
|
15261
15274
|
/**
|
15262
15275
|
* 保存当前节点信息,类似于 class component 中 this
|
15263
15276
|
* @en Save current node information, similar to this in class component
|
@@ -15304,10 +15317,8 @@
|
|
15304
15317
|
* @en Reset the initial visible state of the element to false, and re-detect the visibility of the element, the priority is lower than 'disabled'(Usually used to re-listen when elements inside ShowMonitor change)
|
15305
15318
|
*/
|
15306
15319
|
flushVisibleStatus: function flushVisibleStatus() {
|
15307
|
-
|
15308
|
-
|
15309
|
-
if (isSupportNativeApi && io.current && domRef.current) {
|
15310
|
-
disabled ? io.current.unobserve(domRef.current) : io.current.observe(domRef.current);
|
15320
|
+
if (isSupportNativeApi) {
|
15321
|
+
disabled ? ioUnobserve() : ioObserve();
|
15311
15322
|
} else if (listener.current) {
|
15312
15323
|
var key = wrapperKey.current;
|
15313
15324
|
|
@@ -15371,7 +15382,7 @@
|
|
15371
15382
|
*/
|
15372
15383
|
|
15373
15384
|
|
15374
|
-
curVisible !== preVisible
|
15385
|
+
curVisible !== preVisible && handleCheckChildrenExist() && onCompVisibleChange(curVisible, node);
|
15375
15386
|
var key = wrapperKey.current;
|
15376
15387
|
/**
|
15377
15388
|
* 监听一次后加入 pendingList 队列,随后被 listeners 过滤掉
|
@@ -15387,8 +15398,7 @@
|
|
15387
15398
|
*/
|
15388
15399
|
|
15389
15400
|
|
15390
|
-
curVisible && !preVisible
|
15391
|
-
preVisible.current = curVisible;
|
15401
|
+
curVisible && !preVisible && compOnce && onOnceEmittedListeners[key].push(component);
|
15392
15402
|
}
|
15393
15403
|
|
15394
15404
|
var checkVisibleHandler = React.useCallback(function () {
|
@@ -15408,22 +15418,98 @@
|
|
15408
15418
|
}
|
15409
15419
|
|
15410
15420
|
function handleObserverStatusChange(entries) {
|
15411
|
-
|
15421
|
+
entries.forEach(function (entry) {
|
15422
|
+
var isIntersecting = entry.isIntersecting,
|
15423
|
+
target = entry.target;
|
15424
|
+
var visibleItem = ioVisibleList.find(function (item) {
|
15425
|
+
return item.node === target;
|
15426
|
+
});
|
15412
15427
|
|
15413
|
-
|
15414
|
-
|
15415
|
-
|
15416
|
-
|
15417
|
-
|
15428
|
+
if (visibleItem) {
|
15429
|
+
var curVisible = visibleItem.isVisible,
|
15430
|
+
onCompVisibleChange = visibleItem.onVisibleChange,
|
15431
|
+
onceEmit = visibleItem.once;
|
15432
|
+
/**
|
15433
|
+
* 当前元素 visible 对比之前发生改变,触发回调函数
|
15434
|
+
* @en Callback when the visible status of current element changes before the comparison
|
15435
|
+
*/
|
15418
15436
|
|
15419
|
-
|
15420
|
-
|
15421
|
-
|
15422
|
-
|
15423
|
-
|
15437
|
+
isIntersecting !== curVisible && handleCheckChildrenExist() && onCompVisibleChange(isIntersecting, target);
|
15438
|
+
/**
|
15439
|
+
* 当前元素状态由不可见变为可见,且只触发一次
|
15440
|
+
* @en The current element is invisible -> visible, and once, triggers the callback
|
15441
|
+
*/
|
15442
|
+
|
15443
|
+
isIntersecting && !curVisible && onceEmit && target && ioUnobserve(target);
|
15444
|
+
visibleItem.isVisible = isIntersecting;
|
15445
|
+
}
|
15446
|
+
});
|
15447
|
+
}
|
15448
|
+
/**
|
15449
|
+
* 获取 io 单例
|
15450
|
+
* @en Get the io singleton
|
15451
|
+
*/
|
15452
|
+
|
15453
|
+
|
15454
|
+
function getIOSingleton(ioOptions) {
|
15455
|
+
var root = ioOptions.root,
|
15456
|
+
rootMargin = ioOptions.rootMargin,
|
15457
|
+
ioThreshold = ioOptions.threshold;
|
15458
|
+
var ioKey = JSON.stringify({
|
15459
|
+
rootMargin: rootMargin,
|
15460
|
+
threshold: ioThreshold
|
15461
|
+
});
|
15462
|
+
|
15463
|
+
var _ioListener = ioListeners.find(function (ioListener) {
|
15464
|
+
return ioListener.root === root && ioListener.key === ioKey;
|
15465
|
+
});
|
15466
|
+
|
15467
|
+
if (!_ioListener) {
|
15468
|
+
ioListeners.push({
|
15469
|
+
root: root,
|
15470
|
+
key: ioKey,
|
15471
|
+
listener: io.current = new IntersectionObserver(handleObserverStatusChange, ioOptions)
|
15472
|
+
});
|
15473
|
+
} else {
|
15474
|
+
io.current = _ioListener.listener;
|
15475
|
+
}
|
15476
|
+
}
|
15477
|
+
|
15478
|
+
function ioObserve() {
|
15479
|
+
if (domRef.current && io.current) {
|
15480
|
+
var curIdx = ioVisibleList.findIndex(function (ioVisibleItem) {
|
15481
|
+
return ioVisibleItem.node === domRef.current;
|
15482
|
+
});
|
15483
|
+
|
15484
|
+
if (curIdx !== -1) {
|
15485
|
+
ioVisibleList[curIdx].isVisible = false;
|
15486
|
+
} else {
|
15487
|
+
ioVisibleList.push({
|
15488
|
+
node: domRef.current,
|
15489
|
+
isVisible: false,
|
15490
|
+
once: once,
|
15491
|
+
onVisibleChange: onVisibleChange
|
15492
|
+
});
|
15493
|
+
}
|
15494
|
+
|
15495
|
+
io.current.observe(domRef.current);
|
15496
|
+
}
|
15497
|
+
}
|
15498
|
+
|
15499
|
+
function ioUnobserve(target) {
|
15500
|
+
var targetNode = target || domRef.current;
|
15501
|
+
|
15502
|
+
if (io.current && targetNode) {
|
15503
|
+
var curIdx = ioVisibleList.findIndex(function (ioVisibleItem) {
|
15504
|
+
return ioVisibleItem.node === targetNode;
|
15505
|
+
});
|
15506
|
+
|
15507
|
+
if (curIdx !== -1) {
|
15508
|
+
ioVisibleList.splice(curIdx, 1);
|
15509
|
+
}
|
15424
15510
|
|
15425
|
-
|
15426
|
-
|
15511
|
+
io.current.unobserve(targetNode);
|
15512
|
+
}
|
15427
15513
|
}
|
15428
15514
|
/**
|
15429
15515
|
* 非首次下disabled变化时,重新监听元素
|
@@ -15433,14 +15519,11 @@
|
|
15433
15519
|
|
15434
15520
|
React.useEffect(function () {
|
15435
15521
|
if (isSupportNativeApi) {
|
15436
|
-
//
|
15522
|
+
// 非首次 render 下
|
15437
15523
|
// @en Not for the first time
|
15438
|
-
|
15439
|
-
// 禁用监听 || 监听
|
15440
|
-
disabled ? io.current.unobserve(domRef.current) : io.current.observe(domRef.current);
|
15441
|
-
}
|
15524
|
+
disabled ? ioUnobserve() : ioObserve();
|
15442
15525
|
} else {
|
15443
|
-
//
|
15526
|
+
// 非首次 render 下
|
15444
15527
|
// @en Not for the first time
|
15445
15528
|
if (wrapperKey.current !== -1 && listener.current && listeners[wrapperKey.current]) {
|
15446
15529
|
// 禁用监听,找到对应listener并删除
|
@@ -15504,12 +15587,12 @@
|
|
15504
15587
|
rootMargin_1 = offset + "px";
|
15505
15588
|
}
|
15506
15589
|
|
15507
|
-
|
15590
|
+
getIOSingleton({
|
15508
15591
|
root: root,
|
15509
15592
|
rootMargin: rootMargin_1,
|
15510
15593
|
threshold: threshold
|
15511
15594
|
});
|
15512
|
-
!disabled &&
|
15595
|
+
!disabled && ioObserve();
|
15513
15596
|
}
|
15514
15597
|
} else {
|
15515
15598
|
// 节流后回调函数
|
@@ -15553,7 +15636,7 @@
|
|
15553
15636
|
|
15554
15637
|
listener.current = {
|
15555
15638
|
node: domRef.current,
|
15556
|
-
isVisible:
|
15639
|
+
isVisible: false,
|
15557
15640
|
overflow: overflow,
|
15558
15641
|
once: once,
|
15559
15642
|
offset: offset,
|
@@ -15569,10 +15652,8 @@
|
|
15569
15652
|
}, []);
|
15570
15653
|
React.useEffect(function () {
|
15571
15654
|
return function () {
|
15572
|
-
var _a;
|
15573
|
-
|
15574
15655
|
if (isSupportNativeApi) {
|
15575
|
-
|
15656
|
+
ioUnobserve();
|
15576
15657
|
} else {
|
15577
15658
|
if (overflow) {
|
15578
15659
|
var parent_3 = domRefParent.current;
|
@@ -17403,7 +17484,7 @@
|
|
17403
17484
|
var index$b = componentWrapper(ImagePicker, 'ImagePicker');
|
17404
17485
|
|
17405
17486
|
/*!
|
17406
|
-
* @arco-design/transformable v1.0.
|
17487
|
+
* @arco-design/transformable v1.0.2
|
17407
17488
|
* (c) 2022 ludan.kibbon
|
17408
17489
|
*/
|
17409
17490
|
function _defineProperty(obj, key, value) {
|
@@ -20598,643 +20679,61 @@
|
|
20598
20679
|
|
20599
20680
|
var index$a = componentWrapper(ImagePreview, methodsGenerator$3(ImagePreviewWithGlobalContext));
|
20600
20681
|
|
20601
|
-
var
|
20602
|
-
|
20603
|
-
|
20604
|
-
|
20605
|
-
|
20606
|
-
|
20607
|
-
}
|
20608
|
-
function isEmptyValue(obj) {
|
20609
|
-
return obj === undefined || obj === null || obj === '';
|
20610
|
-
}
|
20611
|
-
function isFunction(obj) {
|
20612
|
-
return Object.prototype.toString.call(obj).toLowerCase() === '[object function]';
|
20613
|
-
}
|
20614
|
-
function isEmptyArray(obj) {
|
20615
|
-
return isArray(obj) && !(obj === null || obj === void 0 ? void 0 : obj.length);
|
20616
|
-
}
|
20617
|
-
var isDeepEqual = function isDeepEqual(obj, sub) {
|
20618
|
-
if (typeof obj !== 'object' || typeof sub !== 'object' || obj === null || sub === null) {
|
20619
|
-
return obj === sub;
|
20620
|
-
}
|
20621
|
-
|
20622
|
-
if (isFunction(obj) && isFunction(sub)) {
|
20623
|
-
return obj === sub || obj.toString() === sub.toString();
|
20624
|
-
}
|
20625
|
-
|
20626
|
-
if (Object.keys(obj).length !== Object.keys(sub).length) {
|
20627
|
-
return false;
|
20628
|
-
}
|
20629
|
-
|
20630
|
-
for (var key in obj) {
|
20631
|
-
if (!isDeepEqual(obj[key], sub[key])) return false;
|
20632
|
-
}
|
20633
|
-
|
20634
|
-
return true;
|
20635
|
-
};
|
20682
|
+
var IndexBarContext = /*#__PURE__*/React.createContext({
|
20683
|
+
sticky: true,
|
20684
|
+
getScrollContainer: function getScrollContainer() {
|
20685
|
+
return null;
|
20686
|
+
},
|
20687
|
+
updateRef: function updateRef() {}
|
20688
|
+
});
|
20636
20689
|
|
20637
20690
|
/**
|
20638
|
-
*
|
20639
|
-
*
|
20640
|
-
*
|
20691
|
+
* 粘性布局组件,元素相对于窗口或指定容器的吸顶效果。
|
20692
|
+
* @en Sticky layout component, The sticky-to-top effect of the element relative to the window or specified container
|
20693
|
+
* @type 布局
|
20694
|
+
* @type_en Layout
|
20695
|
+
* @name 粘性布局
|
20696
|
+
* @name_en Sticky
|
20641
20697
|
*/
|
20642
|
-
// These values are established by empiricism with tests (tradeoff: performance VS precision)
|
20643
|
-
var NEWTON_ITERATIONS = 4;
|
20644
|
-
var NEWTON_MIN_SLOPE = 0.001;
|
20645
|
-
var SUBDIVISION_PRECISION = 0.0000001;
|
20646
|
-
var SUBDIVISION_MAX_ITERATIONS = 10;
|
20647
|
-
var kSplineTableSize = 11;
|
20648
|
-
var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
|
20649
|
-
var float32ArraySupported = typeof Float32Array === 'function';
|
20650
|
-
|
20651
|
-
function A(aA1, aA2) {
|
20652
|
-
return 1.0 - 3.0 * aA2 + 3.0 * aA1;
|
20653
|
-
}
|
20654
|
-
|
20655
|
-
function B(aA1, aA2) {
|
20656
|
-
return 3.0 * aA2 - 6.0 * aA1;
|
20657
|
-
}
|
20658
20698
|
|
20659
|
-
function
|
20660
|
-
|
20661
|
-
|
20699
|
+
var Sticky = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
20700
|
+
var _a = props.position,
|
20701
|
+
position = _a === void 0 ? 'top' : _a,
|
20702
|
+
_b = props.topOffset,
|
20703
|
+
topOffset = _b === void 0 ? 0 : _b,
|
20704
|
+
_c = props.bottomOffset,
|
20705
|
+
bottomOffset = _c === void 0 ? 0 : _c,
|
20706
|
+
_d = props.followOffset,
|
20707
|
+
followOffset = _d === void 0 ? 0 : _d,
|
20708
|
+
children = props.children,
|
20709
|
+
className = props.className,
|
20710
|
+
style = props.style,
|
20711
|
+
_e = props.zIndex,
|
20712
|
+
zIndex = _e === void 0 ? 100 : _e,
|
20713
|
+
_f = props.portalWhenSticky,
|
20714
|
+
portalWhenSticky = _f === void 0 ? false : _f,
|
20715
|
+
_g = props.stickyStyle,
|
20716
|
+
stickyStyle = _g === void 0 ? 'fixed' : _g,
|
20717
|
+
userSetStickyCssStyle = props.stickyCssStyle,
|
20718
|
+
getPortalContainer = props.getPortalContainer,
|
20719
|
+
getContainer = props.getContainer,
|
20720
|
+
getScrollContainer = props.getScrollContainer,
|
20721
|
+
onStickyStateChange = props.onStickyStateChange,
|
20722
|
+
onTopChange = props.onTopChange;
|
20662
20723
|
|
20724
|
+
var _h = useRefState(false),
|
20725
|
+
isSticky = _h[0],
|
20726
|
+
isStickyRef = _h[1],
|
20727
|
+
setIsSticky = _h[2];
|
20663
20728
|
|
20664
|
-
|
20665
|
-
|
20666
|
-
|
20729
|
+
var _j = useRefState(false),
|
20730
|
+
wasSticky = _j[0],
|
20731
|
+
wasStickyRef = _j[1],
|
20732
|
+
setWasSticky = _j[2];
|
20667
20733
|
|
20668
|
-
|
20669
|
-
|
20670
|
-
|
20671
|
-
}
|
20672
|
-
|
20673
|
-
function binarySubdivide(aX, aA, aB, mX1, mX2) {
|
20674
|
-
var currentX, currentT;
|
20675
|
-
var i = 0;
|
20676
|
-
|
20677
|
-
do {
|
20678
|
-
currentT = aA + (aB - aA) / 2.0;
|
20679
|
-
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
20680
|
-
|
20681
|
-
if (currentX > 0.0) {
|
20682
|
-
aB = currentT;
|
20683
|
-
} else {
|
20684
|
-
aA = currentT;
|
20685
|
-
}
|
20686
|
-
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
20687
|
-
|
20688
|
-
return currentT;
|
20689
|
-
}
|
20690
|
-
|
20691
|
-
function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
|
20692
|
-
for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
|
20693
|
-
var currentSlope = getSlope(aGuessT, mX1, mX2);
|
20694
|
-
|
20695
|
-
if (currentSlope === 0.0) {
|
20696
|
-
return aGuessT;
|
20697
|
-
}
|
20698
|
-
|
20699
|
-
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
20700
|
-
aGuessT -= currentX / currentSlope;
|
20701
|
-
}
|
20702
|
-
|
20703
|
-
return aGuessT;
|
20704
|
-
}
|
20705
|
-
|
20706
|
-
function LinearEasing(x) {
|
20707
|
-
return x;
|
20708
|
-
}
|
20709
|
-
|
20710
|
-
function bezier(mX1, mY1, mX2, mY2) {
|
20711
|
-
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
|
20712
|
-
throw new Error('bezier x values must be in [0, 1] range');
|
20713
|
-
}
|
20714
|
-
|
20715
|
-
if (mX1 === mY1 && mX2 === mY2) {
|
20716
|
-
return LinearEasing;
|
20717
|
-
} // Precompute samples table
|
20718
|
-
|
20719
|
-
|
20720
|
-
var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
20721
|
-
|
20722
|
-
for (var i = 0; i < kSplineTableSize; ++i) {
|
20723
|
-
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
20724
|
-
}
|
20725
|
-
|
20726
|
-
function getTForX(aX) {
|
20727
|
-
var intervalStart = 0.0;
|
20728
|
-
var currentSample = 1;
|
20729
|
-
var lastSample = kSplineTableSize - 1;
|
20730
|
-
|
20731
|
-
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
20732
|
-
intervalStart += kSampleStepSize;
|
20733
|
-
}
|
20734
|
-
|
20735
|
-
--currentSample; // Interpolate to provide an initial guess for t
|
20736
|
-
|
20737
|
-
var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
20738
|
-
var guessForT = intervalStart + dist * kSampleStepSize;
|
20739
|
-
var initialSlope = getSlope(guessForT, mX1, mX2);
|
20740
|
-
|
20741
|
-
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
20742
|
-
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
20743
|
-
}
|
20744
|
-
|
20745
|
-
if (initialSlope === 0.0) {
|
20746
|
-
return guessForT;
|
20747
|
-
}
|
20748
|
-
|
20749
|
-
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
|
20750
|
-
}
|
20751
|
-
|
20752
|
-
return function BezierEasing(x) {
|
20753
|
-
// Because JavaScript number are imprecise, we should guarantee the extremes are right.
|
20754
|
-
if (x === 0 || x === 1) {
|
20755
|
-
return x;
|
20756
|
-
}
|
20757
|
-
|
20758
|
-
return calcBezier(getTForX(x), mY1, mY2);
|
20759
|
-
};
|
20760
|
-
}
|
20761
|
-
|
20762
|
-
function execRAF(fn) {
|
20763
|
-
try {
|
20764
|
-
return requestAnimationFrame(fn);
|
20765
|
-
} catch (e) {
|
20766
|
-
return setTimeout(fn, 17);
|
20767
|
-
}
|
20768
|
-
}
|
20769
|
-
function scrollWithAnimation(initTop, target, scrollTo, duration, bezier$1, type) {
|
20770
|
-
if (duration === void 0) {
|
20771
|
-
duration = 300;
|
20772
|
-
}
|
20773
|
-
|
20774
|
-
if (bezier$1 === void 0) {
|
20775
|
-
bezier$1 = [0.34, 0.69, 0.1, 1];
|
20776
|
-
}
|
20777
|
-
|
20778
|
-
if (type === void 0) {
|
20779
|
-
type = 'to';
|
20780
|
-
}
|
20781
|
-
|
20782
|
-
var targetTop = Math.max(0, type === 'by' ? initTop + target : target);
|
20783
|
-
var start = Date.now();
|
20784
|
-
|
20785
|
-
var fn = function fn() {
|
20786
|
-
var p = (Date.now() - start) / duration;
|
20787
|
-
|
20788
|
-
if (p > 1) {
|
20789
|
-
scrollTo(targetTop);
|
20790
|
-
} else {
|
20791
|
-
var newTop = initTop + (targetTop - initTop) * bezier.apply(void 0, bezier$1)(p);
|
20792
|
-
scrollTo(newTop);
|
20793
|
-
execRAF(fn);
|
20794
|
-
}
|
20795
|
-
};
|
20796
|
-
|
20797
|
-
execRAF(fn);
|
20798
|
-
}
|
20799
|
-
|
20800
|
-
var ValidatorType;
|
20801
|
-
|
20802
|
-
(function (ValidatorType) {
|
20803
|
-
ValidatorType["Number"] = "number";
|
20804
|
-
ValidatorType["String"] = "string";
|
20805
|
-
ValidatorType["Array"] = "array";
|
20806
|
-
ValidatorType["Boolean"] = "boolean";
|
20807
|
-
ValidatorType["Object"] = "object";
|
20808
|
-
ValidatorType["Custom"] = "custom";
|
20809
|
-
})(ValidatorType || (ValidatorType = {}));
|
20810
|
-
|
20811
|
-
var defaultMessageTemplate = '%s is not a %s type';
|
20812
|
-
var messageTemplate = {
|
20813
|
-
required: '%s is required',
|
20814
|
-
type: {
|
20815
|
-
email: defaultMessageTemplate,
|
20816
|
-
url: defaultMessageTemplate,
|
20817
|
-
string: defaultMessageTemplate,
|
20818
|
-
number: defaultMessageTemplate,
|
20819
|
-
array: defaultMessageTemplate,
|
20820
|
-
object: defaultMessageTemplate,
|
20821
|
-
boolean: defaultMessageTemplate
|
20822
|
-
},
|
20823
|
-
number: {
|
20824
|
-
min: '`%s` is not greater than `%s`',
|
20825
|
-
max: '`%s` is not less than `%s`',
|
20826
|
-
equal: '`%s` is not equal to `%s`',
|
20827
|
-
range: '`%s` is not in range `%s ~ %s`',
|
20828
|
-
positive: '`%s` is not a positive number',
|
20829
|
-
negative: '`%s` is not a negative number'
|
20830
|
-
},
|
20831
|
-
string: {
|
20832
|
-
max: '%s cannot be longer than %s characters',
|
20833
|
-
min: '%s must be at least %s characters',
|
20834
|
-
len: '%s must be exactly %s characters',
|
20835
|
-
match: '`%s` does not match the pattern %s',
|
20836
|
-
uppercase: '%s must be all uppercased',
|
20837
|
-
lowercase: '%s must be all lowercased',
|
20838
|
-
whitespace: '%s cannot be string of whitespace'
|
20839
|
-
},
|
20840
|
-
array: {
|
20841
|
-
max: '%s cannot be greater than %s in length',
|
20842
|
-
min: '%s cannot be less than %s in length',
|
20843
|
-
len: '%s must be exactly %s in length',
|
20844
|
-
includes: '%s is not includes %s',
|
20845
|
-
deepEqual: '%s is not deep equal with%s'
|
20846
|
-
},
|
20847
|
-
object: {
|
20848
|
-
deepEqual: '%s is not deep equal with %s',
|
20849
|
-
hasKeys: '%s does not contain required fields %s'
|
20850
|
-
},
|
20851
|
-
boolean: {
|
20852
|
-
equal: '%s is not equal to `%s`'
|
20853
|
-
}
|
20854
|
-
};
|
20855
|
-
var getMsgTemplate = function getMsgTemplate(templates, temName, values) {
|
20856
|
-
var temNameArr = temName.split('.');
|
20857
|
-
var theTemplate = defaultMessageTemplate;
|
20858
|
-
|
20859
|
-
if (temNameArr[0] in templates) {
|
20860
|
-
var firstTemplate = templates[temNameArr[0]];
|
20861
|
-
|
20862
|
-
if (Object.prototype.toString.call(firstTemplate).toLowerCase() === '[object object]' && temNameArr.length > 1 && temNameArr[1] in templates[temNameArr[0]]) {
|
20863
|
-
theTemplate = firstTemplate[temNameArr[1]];
|
20864
|
-
} else {
|
20865
|
-
theTemplate = firstTemplate;
|
20866
|
-
}
|
20867
|
-
}
|
20868
|
-
|
20869
|
-
var cur = 0;
|
20870
|
-
return theTemplate.replace(/%s/g, function (curVal) {
|
20871
|
-
return cur < values.length ? values[cur++] : curVal;
|
20872
|
-
});
|
20873
|
-
};
|
20874
|
-
var mergeMsgTemplate = function mergeMsgTemplate(originMT, newMT) {
|
20875
|
-
var targetMT = originMT;
|
20876
|
-
|
20877
|
-
if (newMT) {
|
20878
|
-
Object.keys(originMT).forEach(function (key) {
|
20879
|
-
var originValue = originMT[key];
|
20880
|
-
var curValue = newMT === null || newMT === void 0 ? void 0 : newMT[key];
|
20881
|
-
targetMT[key] = isObject(originValue) ? __assign$2(__assign$2({}, originValue), curValue) : curValue || originValue;
|
20882
|
-
});
|
20883
|
-
}
|
20884
|
-
|
20885
|
-
return targetMT;
|
20886
|
-
};
|
20887
|
-
|
20888
|
-
var BaseValidator =
|
20889
|
-
/** @class */
|
20890
|
-
function () {
|
20891
|
-
function BaseValidator(value, rule, options) {
|
20892
|
-
this.value = value;
|
20893
|
-
|
20894
|
-
var _a = rule.message,
|
20895
|
-
message = _a === void 0 ? '' : _a,
|
20896
|
-
rest = __rest$1(rule, ["message"]);
|
20897
|
-
|
20898
|
-
this.message = message || '';
|
20899
|
-
this.type = rule.type || ValidatorType.String;
|
20900
|
-
this.error = {
|
20901
|
-
value: value,
|
20902
|
-
message: [],
|
20903
|
-
errorTypes: []
|
20904
|
-
};
|
20905
|
-
this.field = options.field || '';
|
20906
|
-
this.rule = rest;
|
20907
|
-
this.validateRules = [];
|
20908
|
-
this.curValidMsgTemplate = mergeMsgTemplate(messageTemplate, options.validateMessage);
|
20909
|
-
}
|
20910
|
-
|
20911
|
-
BaseValidator.prototype.isRequired = function () {
|
20912
|
-
// 优先级最高
|
20913
|
-
if (isEmptyValue(this.value) || isEmptyArray(this.value)) {
|
20914
|
-
this.error.message = [this.message || getMsgTemplate(this.curValidMsgTemplate, 'required', [this.field])];
|
20915
|
-
this.error.errorTypes = ['required'];
|
20916
|
-
return false;
|
20917
|
-
}
|
20918
|
-
|
20919
|
-
return true;
|
20920
|
-
};
|
20921
|
-
|
20922
|
-
BaseValidator.prototype.addError = function (errorType, message) {
|
20923
|
-
var _a;
|
20924
|
-
|
20925
|
-
if (message) {
|
20926
|
-
this.error.errorTypes.push(errorType);
|
20927
|
-
(_a = this.error.message) === null || _a === void 0 ? void 0 : _a.push(message);
|
20928
|
-
}
|
20929
|
-
};
|
20930
|
-
|
20931
|
-
BaseValidator.prototype.dealError = function (isError, _a) {
|
20932
|
-
var _b;
|
20933
|
-
|
20934
|
-
var errTemplate = _a.errTemplate,
|
20935
|
-
values = _a.values;
|
20936
|
-
|
20937
|
-
if (isError) {
|
20938
|
-
var theMessage = this.message || getMsgTemplate(this.curValidMsgTemplate, errTemplate, values);
|
20939
|
-
this.error.errorTypes.push(errTemplate);
|
20940
|
-
(_b = this.error.message) === null || _b === void 0 ? void 0 : _b.push(theMessage);
|
20941
|
-
return theMessage;
|
20942
|
-
}
|
20943
|
-
|
20944
|
-
return '';
|
20945
|
-
};
|
20946
|
-
|
20947
|
-
BaseValidator.prototype.getErrors = function () {
|
20948
|
-
return this.error;
|
20949
|
-
};
|
20950
|
-
|
20951
|
-
return BaseValidator;
|
20952
|
-
}();
|
20953
|
-
|
20954
|
-
/** @class */
|
20955
|
-
(function (_super) {
|
20956
|
-
__extends$1(NumberValidator, _super);
|
20957
|
-
|
20958
|
-
function NumberValidator(value, rules, options) {
|
20959
|
-
var _this = _super.call(this, value, rules, options) || this;
|
20960
|
-
|
20961
|
-
_this.validateRules = ['min', 'max', 'equal', 'positive', 'negative'];
|
20962
|
-
return _this;
|
20963
|
-
}
|
20964
|
-
|
20965
|
-
NumberValidator.prototype.min = function (num) {
|
20966
|
-
this.dealError(!isEmptyValue(this.value) && this.value < num, {
|
20967
|
-
errTemplate: 'number.min',
|
20968
|
-
values: [this.field, "" + num]
|
20969
|
-
});
|
20970
|
-
};
|
20971
|
-
|
20972
|
-
NumberValidator.prototype.max = function (num) {
|
20973
|
-
this.dealError(!isEmptyValue(this.value) && this.value > num, {
|
20974
|
-
errTemplate: 'number.max',
|
20975
|
-
values: [this.field, "" + num]
|
20976
|
-
});
|
20977
|
-
};
|
20978
|
-
|
20979
|
-
NumberValidator.prototype.equal = function (num) {
|
20980
|
-
return this.dealError(!isEmptyValue(this.value) && this.value !== num, {
|
20981
|
-
errTemplate: 'number.equal',
|
20982
|
-
values: [this.field, "" + num]
|
20983
|
-
});
|
20984
|
-
};
|
20985
|
-
|
20986
|
-
NumberValidator.prototype.positive = function () {
|
20987
|
-
return this.dealError(!isEmptyValue(this.value) && this.value < 0, {
|
20988
|
-
errTemplate: 'number.positive',
|
20989
|
-
values: [this.field]
|
20990
|
-
});
|
20991
|
-
};
|
20992
|
-
|
20993
|
-
NumberValidator.prototype.negative = function () {
|
20994
|
-
return this.dealError(!isEmptyValue(this.value) && this.value > 0, {
|
20995
|
-
errTemplate: 'number.negative',
|
20996
|
-
values: [this.field]
|
20997
|
-
});
|
20998
|
-
};
|
20999
|
-
|
21000
|
-
return NumberValidator;
|
21001
|
-
})(BaseValidator);
|
21002
|
-
|
21003
|
-
/** @class */
|
21004
|
-
(function (_super) {
|
21005
|
-
__extends$1(StringValidator, _super);
|
21006
|
-
|
21007
|
-
function StringValidator(value, rules, options) {
|
21008
|
-
var _this = _super.call(this, value, rules, options) || this;
|
21009
|
-
|
21010
|
-
_this.validateRules = ['min', 'max', 'len', 'match', 'uppercase', 'lowercase', 'whitespace'];
|
21011
|
-
return _this;
|
21012
|
-
}
|
21013
|
-
|
21014
|
-
StringValidator.prototype.min = function (num) {
|
21015
|
-
return this.dealError(!isEmptyValue(this.value) && this.value.length < num, {
|
21016
|
-
errTemplate: 'string.min',
|
21017
|
-
values: [this.field, "" + num]
|
21018
|
-
});
|
21019
|
-
};
|
21020
|
-
|
21021
|
-
StringValidator.prototype.max = function (num) {
|
21022
|
-
return this.dealError(!isEmptyValue(this.value) && this.value.length > num, {
|
21023
|
-
errTemplate: 'string.max',
|
21024
|
-
values: [this.field, "" + num]
|
21025
|
-
});
|
21026
|
-
};
|
21027
|
-
|
21028
|
-
StringValidator.prototype.len = function (num) {
|
21029
|
-
return this.dealError(!isEmptyValue(this.value) && this.value !== num, {
|
21030
|
-
errTemplate: 'string.equal',
|
21031
|
-
values: [this.field, "" + num]
|
21032
|
-
});
|
21033
|
-
};
|
21034
|
-
|
21035
|
-
StringValidator.prototype.match = function (regStr) {
|
21036
|
-
var reg = new RegExp(regStr);
|
21037
|
-
return this.dealError(!isEmptyValue(this.value) && !reg.test(this.value), {
|
21038
|
-
errTemplate: 'string.match',
|
21039
|
-
values: [this.field, regStr]
|
21040
|
-
});
|
21041
|
-
};
|
21042
|
-
|
21043
|
-
StringValidator.prototype.uppercase = function (isValue) {
|
21044
|
-
var isUppercase = (this.value || '').toLocaleUpperCase() === this.value;
|
21045
|
-
return this.dealError(!isEmptyValue(this.value) && isUppercase !== isValue, {
|
21046
|
-
errTemplate: 'string.uppercase',
|
21047
|
-
values: [this.field]
|
21048
|
-
});
|
21049
|
-
};
|
21050
|
-
|
21051
|
-
StringValidator.prototype.lowercase = function (isValue) {
|
21052
|
-
var isLowercase = (this.value || '').toLocaleLowerCase() === this.value;
|
21053
|
-
return this.dealError(!isEmptyValue(this.value) && isLowercase !== isValue, {
|
21054
|
-
errTemplate: 'string.lowercase',
|
21055
|
-
values: [this.field]
|
21056
|
-
});
|
21057
|
-
};
|
21058
|
-
|
21059
|
-
StringValidator.prototype.whitespace = function () {
|
21060
|
-
return this.dealError(!isEmptyValue(this.value) && isEmptyValue(this.value.trim()), {
|
21061
|
-
errTemplate: 'string.whitespace',
|
21062
|
-
values: [this.field]
|
21063
|
-
});
|
21064
|
-
};
|
21065
|
-
|
21066
|
-
return StringValidator;
|
21067
|
-
})(BaseValidator);
|
21068
|
-
|
21069
|
-
/** @class */
|
21070
|
-
(function (_super) {
|
21071
|
-
__extends$1(ArrayValidator, _super);
|
21072
|
-
|
21073
|
-
function ArrayValidator(value, rules, options) {
|
21074
|
-
var _this = _super.call(this, value, rules, options) || this;
|
21075
|
-
|
21076
|
-
_this.validateRules = ['min', 'max', 'deepEqual', 'includes'];
|
21077
|
-
return _this;
|
21078
|
-
}
|
21079
|
-
|
21080
|
-
ArrayValidator.prototype.min = function (num) {
|
21081
|
-
return this.dealError(!isEmptyValue(this.value) && this.value.length < num, {
|
21082
|
-
errTemplate: 'array.min',
|
21083
|
-
values: [this.field, "" + num]
|
21084
|
-
});
|
21085
|
-
};
|
21086
|
-
|
21087
|
-
ArrayValidator.prototype.max = function (num) {
|
21088
|
-
return this.dealError(!isEmptyValue(this.value) && this.value.length > num, {
|
21089
|
-
errTemplate: 'array.max',
|
21090
|
-
values: [this.field, "" + num]
|
21091
|
-
});
|
21092
|
-
};
|
21093
|
-
|
21094
|
-
ArrayValidator.prototype.deepEqual = function (sub) {
|
21095
|
-
return this.dealError(!isDeepEqual(this.value, sub), {
|
21096
|
-
errTemplate: 'array.equal',
|
21097
|
-
values: [this.field, "" + JSON.stringify(sub)]
|
21098
|
-
});
|
21099
|
-
};
|
21100
|
-
|
21101
|
-
ArrayValidator.prototype.includes = function (sub) {
|
21102
|
-
var _this = this;
|
21103
|
-
|
21104
|
-
return this.dealError(sub.some(function (el) {
|
21105
|
-
return !_this.value.includes(el);
|
21106
|
-
}), {
|
21107
|
-
errTemplate: 'array.includes',
|
21108
|
-
values: [this.field, "" + JSON.stringify(sub)]
|
21109
|
-
});
|
21110
|
-
};
|
21111
|
-
|
21112
|
-
return ArrayValidator;
|
21113
|
-
})(BaseValidator);
|
21114
|
-
|
21115
|
-
/** @class */
|
21116
|
-
(function (_super) {
|
21117
|
-
__extends$1(ObjectValidator, _super);
|
21118
|
-
|
21119
|
-
function ObjectValidator(value, rules, options) {
|
21120
|
-
var _this = _super.call(this, value, rules, options) || this;
|
21121
|
-
|
21122
|
-
_this.validateRules = ['deepEqual', 'hasKeys'];
|
21123
|
-
return _this;
|
21124
|
-
}
|
21125
|
-
|
21126
|
-
ObjectValidator.prototype.deepEqual = function (sub) {
|
21127
|
-
return this.dealError(!isDeepEqual(this.value, sub), {
|
21128
|
-
errTemplate: 'object.deepEqual',
|
21129
|
-
values: [this.field, "" + JSON.stringify(sub)]
|
21130
|
-
});
|
21131
|
-
};
|
21132
|
-
|
21133
|
-
ObjectValidator.prototype.hasKeys = function (keys) {
|
21134
|
-
var allKeys = isEmptyValue(this.value) ? [] : Object.keys(this.value);
|
21135
|
-
return this.dealError(!isEmptyValue(this.value) && keys.some(function (theKey) {
|
21136
|
-
return !allKeys.includes(theKey);
|
21137
|
-
}), {
|
21138
|
-
errTemplate: 'object.hasKeys',
|
21139
|
-
values: [this.field, "" + JSON.stringify(keys)]
|
21140
|
-
});
|
21141
|
-
};
|
21142
|
-
|
21143
|
-
return ObjectValidator;
|
21144
|
-
})(BaseValidator);
|
21145
|
-
|
21146
|
-
/** @class */
|
21147
|
-
(function (_super) {
|
21148
|
-
__extends$1(CustomValidator, _super);
|
21149
|
-
|
21150
|
-
function CustomValidator(value, rules, options) {
|
21151
|
-
return _super.call(this, value, rules, options) || this;
|
21152
|
-
}
|
21153
|
-
|
21154
|
-
CustomValidator.prototype.validator = function (validatorTool) {
|
21155
|
-
var _this = this;
|
21156
|
-
|
21157
|
-
if (validatorTool) {
|
21158
|
-
return new Promise(function (resolve) {
|
21159
|
-
var ret = validatorTool(_this.value, function (message) {
|
21160
|
-
if (message === void 0) {
|
21161
|
-
message = '';
|
21162
|
-
}
|
21163
|
-
|
21164
|
-
return _this.addError('custom', message || '');
|
21165
|
-
});
|
21166
|
-
|
21167
|
-
if (ret && (ret === null || ret === void 0 ? void 0 : ret.then)) {
|
21168
|
-
ret.then(function () {
|
21169
|
-
return resolve(_this.getErrors());
|
21170
|
-
});
|
21171
|
-
} else {
|
21172
|
-
resolve(_this.getErrors());
|
21173
|
-
}
|
21174
|
-
});
|
21175
|
-
}
|
21176
|
-
|
21177
|
-
return null;
|
21178
|
-
};
|
21179
|
-
|
21180
|
-
return CustomValidator;
|
21181
|
-
})(BaseValidator);
|
21182
|
-
|
21183
|
-
var IndexBarContext = /*#__PURE__*/React.createContext({
|
21184
|
-
sticky: true,
|
21185
|
-
getScrollContainer: function getScrollContainer() {
|
21186
|
-
return null;
|
21187
|
-
},
|
21188
|
-
updateRef: function updateRef() {}
|
21189
|
-
});
|
21190
|
-
|
21191
|
-
/**
|
21192
|
-
* 粘性布局组件,元素相对于窗口或指定容器的吸顶效果。
|
21193
|
-
* @en Sticky layout component, The sticky-to-top effect of the element relative to the window or specified container
|
21194
|
-
* @type 布局
|
21195
|
-
* @type_en Layout
|
21196
|
-
* @name 粘性布局
|
21197
|
-
* @name_en Sticky
|
21198
|
-
*/
|
21199
|
-
|
21200
|
-
var Sticky = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
21201
|
-
var _a = props.position,
|
21202
|
-
position = _a === void 0 ? 'top' : _a,
|
21203
|
-
_b = props.topOffset,
|
21204
|
-
topOffset = _b === void 0 ? 0 : _b,
|
21205
|
-
_c = props.bottomOffset,
|
21206
|
-
bottomOffset = _c === void 0 ? 0 : _c,
|
21207
|
-
_d = props.followOffset,
|
21208
|
-
followOffset = _d === void 0 ? 0 : _d,
|
21209
|
-
children = props.children,
|
21210
|
-
className = props.className,
|
21211
|
-
style = props.style,
|
21212
|
-
_e = props.zIndex,
|
21213
|
-
zIndex = _e === void 0 ? 100 : _e,
|
21214
|
-
_f = props.portalWhenSticky,
|
21215
|
-
portalWhenSticky = _f === void 0 ? false : _f,
|
21216
|
-
_g = props.stickyStyle,
|
21217
|
-
stickyStyle = _g === void 0 ? 'fixed' : _g,
|
21218
|
-
userSetStickyCssStyle = props.stickyCssStyle,
|
21219
|
-
getPortalContainer = props.getPortalContainer,
|
21220
|
-
getContainer = props.getContainer,
|
21221
|
-
getScrollContainer = props.getScrollContainer,
|
21222
|
-
onStickyStateChange = props.onStickyStateChange,
|
21223
|
-
onTopChange = props.onTopChange;
|
21224
|
-
|
21225
|
-
var _h = useRefState(false),
|
21226
|
-
isSticky = _h[0],
|
21227
|
-
isStickyRef = _h[1],
|
21228
|
-
setIsSticky = _h[2];
|
21229
|
-
|
21230
|
-
var _j = useRefState(false),
|
21231
|
-
wasSticky = _j[0],
|
21232
|
-
wasStickyRef = _j[1],
|
21233
|
-
setWasSticky = _j[2];
|
21234
|
-
|
21235
|
-
var _k = React.useState({}),
|
21236
|
-
stickyStateStyle = _k[0],
|
21237
|
-
setStickyStateStyle = _k[1];
|
20734
|
+
var _k = React.useState({}),
|
20735
|
+
stickyStateStyle = _k[0],
|
20736
|
+
setStickyStateStyle = _k[1];
|
21238
20737
|
|
21239
20738
|
var contentRef = React.useRef(null);
|
21240
20739
|
var placeholderRef = React.useRef(null);
|
@@ -21306,7 +20805,7 @@
|
|
21306
20805
|
return;
|
21307
20806
|
}
|
21308
20807
|
|
21309
|
-
execRAF
|
20808
|
+
execRAF(function () {
|
21310
20809
|
framePendingRef.current = false;
|
21311
20810
|
|
21312
20811
|
if (containerRef.current) {
|
@@ -22132,11 +21631,14 @@
|
|
22132
21631
|
|
22133
21632
|
changeStatus('loading', scene);
|
22134
21633
|
getData === null || getData === void 0 ? void 0 : getData(function (st) {
|
22135
|
-
lastScrollEndRef.current = false;
|
22136
21634
|
changeStatus(st, 'manual');
|
22137
21635
|
});
|
22138
21636
|
}, [blockWhenLoading, changeStatus, getData]);
|
22139
21637
|
React.useEffect(function () {
|
21638
|
+
if (!blockWhenLoading || nowStatus !== 'loading') {
|
21639
|
+
lastScrollEndRef.current = false;
|
21640
|
+
}
|
21641
|
+
|
22140
21642
|
statusRef.current = nowStatus;
|
22141
21643
|
}, [nowStatus]);
|
22142
21644
|
useUpdateEffect(function () {
|
@@ -22393,7 +21895,7 @@
|
|
22393
21895
|
ref: navBarRef,
|
22394
21896
|
className: cls(wrapClass, prefixCls + "-nav-bar", (_b = {}, _b[prefixCls + "-nav-bar-fixed"] = fixed, _b[prefixCls + "-nav-bar-float"] = !placeholder, _b[prefixCls + "-nav-bar-hide"] = scrollToggleHide, _b)),
|
22395
21897
|
style: __assign$2(__assign$2({
|
22396
|
-
paddingTop: fixed && statusBarHeight ? statusBarHeight + "px" : ''
|
21898
|
+
paddingTop: fixed && statusBarHeight ? statusBarHeight + "px" : '0px'
|
22397
21899
|
}, style || {}), relBackground ? {
|
22398
21900
|
background: relBackground
|
22399
21901
|
} : {}),
|
@@ -22402,7 +21904,7 @@
|
|
22402
21904
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
22403
21905
|
className: cls(className, system, prefixCls + "-nav-bar-wrapper", (_c = {}, _c[prefixCls + "-nav-bar-wrapper-fixed"] = fixed, _c[prefixCls + "-nav-bar-wrapper-border"] = hasBottomLine, _c)),
|
22404
21906
|
style: __assign$2({
|
22405
|
-
paddingTop: statusBarHeight ? statusBarHeight + "px" : ''
|
21907
|
+
paddingTop: statusBarHeight ? statusBarHeight + "px" : '0px'
|
22406
21908
|
}, customStyle)
|
22407
21909
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
22408
21910
|
className: prefixCls + "-nav-bar-inner all-border-box"
|
@@ -23375,10 +22877,10 @@
|
|
23375
22877
|
setDirectionState = _k[2];
|
23376
22878
|
|
23377
22879
|
var getOffset = React.useCallback(function (dir) {
|
23378
|
-
return getDefaultValue(isObject$
|
22880
|
+
return getDefaultValue(isObject$2(edgeOffset) ? edgeOffset[dir] : edgeOffset, defaultEdgeOffset[dir]);
|
23379
22881
|
}, [edgeOffset]);
|
23380
22882
|
var getAutoDirection = React.useCallback(function (dir) {
|
23381
|
-
return getDefaultValue(isObject$
|
22883
|
+
return getDefaultValue(isObject$2(useAutoDirection) ? useAutoDirection[dir] : useAutoDirection, defaultAutoDirection);
|
23382
22884
|
}, [useAutoDirection]);
|
23383
22885
|
React.useEffect(function () {
|
23384
22886
|
setDirectionState(direction);
|
@@ -23820,7 +23322,7 @@
|
|
23820
23322
|
var closeTimer = React.useRef(0);
|
23821
23323
|
/** 垂直方向自适应 */
|
23822
23324
|
|
23823
|
-
var autoVerticalDirection = getDefaultValue(isObject$
|
23325
|
+
var autoVerticalDirection = getDefaultValue(isObject$2(useAutoDirection) ? useAutoDirection.vertical : useAutoDirection, defaultAutoDirection);
|
23824
23326
|
|
23825
23327
|
var popoverDisappear = function popoverDisappear() {
|
23826
23328
|
onVisibleChange(false);
|
@@ -26485,31 +25987,49 @@
|
|
26485
25987
|
_k = props.activeText,
|
26486
25988
|
activeText = _k === void 0 ? '' : _k,
|
26487
25989
|
_l = props.initPos,
|
26488
|
-
initPos = _l === void 0 ? 0 : _l
|
26489
|
-
|
26490
|
-
|
25990
|
+
initPos = _l === void 0 ? 0 : _l,
|
25991
|
+
_m = props.bounceWhenBumpBoundary,
|
25992
|
+
bounceWhenBumpBoundary = _m === void 0 ? false : _m,
|
25993
|
+
_o = props.bounceDampRate,
|
25994
|
+
bounceDampRate = _o === void 0 ? 3 : _o,
|
25995
|
+
_p = props.bounceAnimateDuration,
|
25996
|
+
bounceAnimateDuration = _p === void 0 ? 300 : _p,
|
25997
|
+
damping = props.damping,
|
25998
|
+
bounceDistanceProcessor = props.bounceDistanceProcessor,
|
25999
|
+
getScrollContainer = props.getScrollContainer,
|
26000
|
+
getBounceContainer = props.getBounceContainer,
|
26001
|
+
onTouchStart = props.onTouchStart,
|
26002
|
+
onTouchEnd = props.onTouchEnd,
|
26003
|
+
onTouchCancel = props.onTouchCancel,
|
26004
|
+
onTouchMove = props.onTouchMove,
|
26005
|
+
renderLabel = props.renderLabel;
|
26006
|
+
var _q = React.useContext(GlobalContext).locale,
|
26007
|
+
locale = _q === void 0 ? defaultLocale : _q;
|
26491
26008
|
|
26492
|
-
var
|
26493
|
-
disableState =
|
26494
|
-
setDisableState =
|
26009
|
+
var _r = React.useState(disabled),
|
26010
|
+
disableState = _r[0],
|
26011
|
+
setDisableState = _r[1];
|
26495
26012
|
|
26496
|
-
var
|
26497
|
-
labelOffsetState =
|
26498
|
-
setLabelOffsetState =
|
26013
|
+
var _s = React.useState(0),
|
26014
|
+
labelOffsetState = _s[0],
|
26015
|
+
setLabelOffsetState = _s[1];
|
26499
26016
|
|
26500
26017
|
var containerRef = React.useRef(null);
|
26501
26018
|
var loadingRef = React.useRef(null);
|
26502
26019
|
var loadingLabelRef = React.useRef(null);
|
26503
26020
|
var showLoadMoreRef = React.useRef(false);
|
26504
26021
|
var ifToRightRef = React.useRef(false);
|
26022
|
+
var bouncingRef = React.useRef(false);
|
26505
26023
|
var offsetRef = React.useRef(0);
|
26506
26024
|
var domRef = React.useRef(null);
|
26507
26025
|
var wrapperEl = domRef.current;
|
26508
|
-
useAddListener(wrapperEl, 'touchstart',
|
26509
|
-
useAddListener(wrapperEl, 'touchend',
|
26510
|
-
useAddListener(wrapperEl, 'touchcancel',
|
26511
|
-
useAddListener(wrapperEl, 'touchmove',
|
26026
|
+
useAddListener(wrapperEl, 'touchstart', onTouchStart);
|
26027
|
+
useAddListener(wrapperEl, 'touchend', onTouchEnd);
|
26028
|
+
useAddListener(wrapperEl, 'touchcancel', onTouchCancel);
|
26029
|
+
useAddListener(wrapperEl, 'touchmove', onTouchMove);
|
26512
26030
|
React.useEffect(function () {
|
26031
|
+
var _a;
|
26032
|
+
|
26513
26033
|
if (disabled || !containerRef.current || disableState) {
|
26514
26034
|
return;
|
26515
26035
|
}
|
@@ -26524,11 +26044,7 @@
|
|
26524
26044
|
} else if (containerRef.current.childNodes.length === 1) {
|
26525
26045
|
// 传入一个子元素 滑动单个元素
|
26526
26046
|
// @en Pass in a child element swipe the single element
|
26527
|
-
|
26528
|
-
scrollContainer = props.getScrollContainer();
|
26529
|
-
} else {
|
26530
|
-
scrollContainer = containerRef.current.firstChild;
|
26531
|
-
}
|
26047
|
+
scrollContainer = (_a = getScrollContainer === null || getScrollContainer === void 0 ? void 0 : getScrollContainer()) !== null && _a !== void 0 ? _a : containerRef.current.firstChild;
|
26532
26048
|
} else {
|
26533
26049
|
// 传入多个子元素(列表元素为例) 组件控制自行滑动 不推荐
|
26534
26050
|
// @en Pass in multiple sub-elements (list elements as an example) Component control slides by itself which is not recommended
|
@@ -26548,17 +26064,20 @@
|
|
26548
26064
|
|
26549
26065
|
if (!loadingCurrent) {
|
26550
26066
|
return;
|
26551
|
-
}
|
26552
|
-
// @en Initially no labels are displayed
|
26067
|
+
}
|
26553
26068
|
|
26069
|
+
var bounceScrollContainer = (getBounceContainer === null || getBounceContainer === void 0 ? void 0 : getBounceContainer()) || scrollContainer; // 初始不显示标签
|
26070
|
+
// @en Initially no labels are displayed
|
26554
26071
|
|
26555
26072
|
loadingCurrent.style.display = 'none';
|
26556
26073
|
var startX = 0;
|
26557
|
-
var endX = 0;
|
26074
|
+
var endX = 0;
|
26075
|
+
var bounceDistance = 0; // 触摸页面确定X起始坐标
|
26558
26076
|
// @en Determine the X starting coordinate on touchstart
|
26559
26077
|
|
26560
26078
|
var touchstart = function touchstart(e) {
|
26561
|
-
|
26079
|
+
var evt = e.touches[0];
|
26080
|
+
startX = evt.clientX || 0;
|
26562
26081
|
}; // 页面滑动确定X终止坐标,更新手指的X坐标,改变loading中的文字和大小
|
26563
26082
|
// @en Determine the X end coordinate, update the X coordinate of the finger, change the text and size in the loading on touchmove
|
26564
26083
|
|
@@ -26570,12 +26089,30 @@
|
|
26570
26089
|
scrollContainer.scrollLeft = 1;
|
26571
26090
|
}
|
26572
26091
|
|
26573
|
-
endX = e.touches[0].
|
26092
|
+
endX = e.touches[0].clientX || 0;
|
26574
26093
|
var diff = endX - startX;
|
26575
26094
|
offsetRef.current = diff;
|
26576
|
-
var labelDiff = fingerDisToLabelDis(Math.abs(diff),
|
26095
|
+
var labelDiff = fingerDisToLabelDis(Math.abs(diff), damping); // 滑动到最左侧,处理回弹效果
|
26096
|
+
// @en Swipe to the far left to handle the rebound effect
|
26097
|
+
|
26098
|
+
if (diff > 0 && scrollContainer.scrollLeft <= 1 && bounceWhenBumpBoundary) {
|
26099
|
+
e.stopPropagation();
|
26100
|
+
e.cancelBubble && e.preventDefault();
|
26101
|
+
bouncingRef.current = true;
|
26102
|
+
|
26103
|
+
var processor = bounceDistanceProcessor || function (dis) {
|
26104
|
+
return Math.min(dis, bounceScrollContainer.offsetWidth) / bounceDampRate;
|
26105
|
+
};
|
26106
|
+
|
26107
|
+
bounceDistance = processor(diff);
|
26108
|
+
setStyleWithVendor(bounceScrollContainer, {
|
26109
|
+
transition: 'none',
|
26110
|
+
transform: "translateX(" + bounceDistance + "px) translateZ(0)"
|
26111
|
+
});
|
26112
|
+
} // 向左滑动到尽头 '更多'标签加载 根据scrollLeft判断 滚动容器到达边缘触发 非滚动容器不判断
|
26577
26113
|
// @en Swipe left to the end and the 'more' label is loaded. Judging by scrollLeft, the scroll container reaches the edge and the non-scroll container does not judge
|
26578
26114
|
|
26115
|
+
|
26579
26116
|
if (diff < 0 && (scrollContainer.scrollLeft + scrollContainer.clientWidth >= scrollContainer.scrollWidth - 1 || !scrollContainer.scrollLeft) && !ifToRightRef.current) {
|
26580
26117
|
showLoadMoreRef.current = true;
|
26581
26118
|
loadingCurrent.style.display = 'flex';
|
@@ -26601,12 +26138,14 @@
|
|
26601
26138
|
loadingLabelCurrent.innerHTML = labelDiff >= minConfirmOffset ? activeText || locale.SwipeLoad.activeText : normalText || locale.SwipeLoad.normalText;
|
26602
26139
|
}
|
26603
26140
|
|
26604
|
-
loadingCurrent
|
26605
|
-
|
26606
|
-
|
26607
|
-
|
26608
|
-
scrollContainer
|
26609
|
-
|
26141
|
+
setStyleWithVendor(loadingCurrent, {
|
26142
|
+
transition: 'none',
|
26143
|
+
transform: "translateX(-" + labelRightMargin + "px) translateZ(0)"
|
26144
|
+
});
|
26145
|
+
setStyleWithVendor(scrollContainer, {
|
26146
|
+
transition: 'none',
|
26147
|
+
transform: "translateX(-" + listRightMargin + "px) translateZ(0)"
|
26148
|
+
});
|
26610
26149
|
}
|
26611
26150
|
|
26612
26151
|
if (diff > 0 && scrollContainer.scrollLeft + scrollContainer.clientWidth <= scrollContainer.scrollWidth - 1) {
|
@@ -26631,13 +26170,28 @@
|
|
26631
26170
|
var labelDiff = fingerDisToLabelDis(Math.abs(diff));
|
26632
26171
|
|
26633
26172
|
var resumeAnimation = function resumeAnimation() {
|
26634
|
-
|
26635
|
-
|
26636
|
-
|
26637
|
-
|
26638
|
-
|
26639
|
-
|
26640
|
-
|
26173
|
+
if (showLoadMoreRef.current) {
|
26174
|
+
showLoadMoreRef.current = false;
|
26175
|
+
var scrollTransitionCssStyle = "all " + labelAnimationDuration + "ms " + labelAnimationFunction;
|
26176
|
+
var scrollTransformCssStyle = 'translateX(0px) translateZ(0)';
|
26177
|
+
setStyleWithVendor(scrollContainer, {
|
26178
|
+
transition: scrollTransitionCssStyle,
|
26179
|
+
transform: scrollTransformCssStyle
|
26180
|
+
});
|
26181
|
+
setStyleWithVendor(loadingCurrent, {
|
26182
|
+
transition: scrollTransitionCssStyle,
|
26183
|
+
transform: scrollTransformCssStyle
|
26184
|
+
});
|
26185
|
+
}
|
26186
|
+
|
26187
|
+
if (bouncingRef.current) {
|
26188
|
+
bouncingRef.current = false;
|
26189
|
+
setStyleWithVendor(bounceScrollContainer, {
|
26190
|
+
transition: "all " + bounceAnimateDuration + "ms",
|
26191
|
+
transform: 'translateX(0px) translateZ(0)'
|
26192
|
+
});
|
26193
|
+
}
|
26194
|
+
|
26641
26195
|
ifToRightRef.current = false;
|
26642
26196
|
setTimeout(function () {
|
26643
26197
|
loadingCurrent.style.display = 'none';
|
@@ -26667,7 +26221,7 @@
|
|
26667
26221
|
scrollContainer.removeEventListener('touchmove', touchmove);
|
26668
26222
|
scrollContainer.removeEventListener('touchend', touchend);
|
26669
26223
|
};
|
26670
|
-
}, [disabled]);
|
26224
|
+
}, [disabled, getScrollContainer, getBounceContainer, bounceWhenBumpBoundary, bounceDampRate, bounceAnimateDuration]);
|
26671
26225
|
React.useImperativeHandle(ref, function () {
|
26672
26226
|
return {
|
26673
26227
|
dom: domRef.current
|
@@ -26681,14 +26235,14 @@
|
|
26681
26235
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
26682
26236
|
className: cls(prefixCls + "-list-area"),
|
26683
26237
|
ref: containerRef
|
26684
|
-
}, children),
|
26238
|
+
}, children), renderLabel ? /*#__PURE__*/React__default["default"].createElement("div", {
|
26685
26239
|
className: cls(prefixCls + "-custom-loading-area"),
|
26686
26240
|
ref: loadingRef,
|
26687
26241
|
style: {
|
26688
26242
|
position: 'absolute',
|
26689
26243
|
right: initPos + "px"
|
26690
26244
|
}
|
26691
|
-
},
|
26245
|
+
}, renderLabel.length ? renderLabel(labelOffsetState) : renderLabel()) : /*#__PURE__*/React__default["default"].createElement("div", {
|
26692
26246
|
className: cls(prefixCls + "-loading-area"),
|
26693
26247
|
ref: loadingRef,
|
26694
26248
|
style: {
|
@@ -27427,7 +26981,7 @@
|
|
27427
26981
|
}
|
27428
26982
|
|
27429
26983
|
if (needRafScroll) {
|
27430
|
-
scrollWithAnimation
|
26984
|
+
scrollWithAnimation(isVertical ? domRef.current.scrollLeft : domRef.current.scrollTop, position, function (top) {
|
27431
26985
|
if (domRef.current) {
|
27432
26986
|
if (isVertical) {
|
27433
26987
|
domRef.current.scrollLeft = top;
|
@@ -27747,7 +27301,7 @@
|
|
27747
27301
|
clearTimeout(timerRef.current);
|
27748
27302
|
autoScrollingRef.current = true;
|
27749
27303
|
var duration = rightNow ? 0 : transitionDuration || 0;
|
27750
|
-
scrollWithAnimation
|
27304
|
+
scrollWithAnimation(scrollTop, scrollTop + normalizedTopDis, function (top) {
|
27751
27305
|
if (isGlobal) {
|
27752
27306
|
document.documentElement[scrollAttr] = top;
|
27753
27307
|
document.body[scrollAttr] = top;
|
@@ -28083,6 +27637,7 @@
|
|
28083
27637
|
// 利用受控手动更改index时,给cell line加上动画
|
28084
27638
|
// @en Animate the cell line when changeing the index
|
28085
27639
|
setCellTrans(true);
|
27640
|
+
changeFromRef.current = 'manual';
|
28086
27641
|
}, [activeTab]);
|
28087
27642
|
useUpdateEffect(function () {
|
28088
27643
|
onDistanceChange && onDistanceChange(distance, wrapWidth, activeIndex);
|