@nutui/nutui-react-taro 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/esm/ActionSheet.js +4 -4
- package/dist/esm/Address.js +4 -4
- package/dist/esm/Audio.js +4 -4
- package/dist/esm/Badge.js +2 -2
- package/dist/esm/Barrage.js +2 -2
- package/dist/esm/Calendar.js +5 -5
- package/dist/esm/CalendarItem.js +2 -2
- package/dist/esm/Cascader.js +4 -4
- package/dist/esm/CircleProgress.js +2 -2
- package/dist/esm/DatePicker.js +5 -5
- package/dist/esm/Dialog.js +2 -2
- package/dist/esm/Drag.js +2 -2
- package/dist/esm/FixedNav.js +3 -3
- package/dist/esm/ImagePreview.js +4 -4
- package/dist/esm/InputNumber.js +2 -2
- package/dist/esm/MenuItem.js +3 -3
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/Notify.js +2 -2
- package/dist/esm/NumberKeyboard.js +4 -4
- package/dist/esm/Overlay.js +2 -2
- package/dist/esm/Picker.js +4 -4
- package/dist/esm/Popover.js +3 -3
- package/dist/esm/Popup.js +3 -3
- package/dist/esm/Range.js +3 -3
- package/dist/esm/ShortPassword.js +4 -4
- package/dist/esm/SideNavBar.js +4 -4
- package/dist/esm/Signature.js +2 -2
- package/dist/esm/TimeSelect.js +4 -4
- package/dist/esm/Toast.js +2 -2
- package/dist/esm/WaterMark.js +2 -2
- package/dist/esm/{actionsheet.taro-360d8d34.js → actionsheet.taro-a58d3d12.js} +1 -1
- package/dist/esm/{address.taro-c03b8b16.js → address.taro-1e2aea24.js} +22 -24
- package/dist/esm/{audio.taro-20890c93.js → audio.taro-fddcdfc0.js} +1 -1
- package/dist/esm/{badge.taro-9f72d846.js → badge.taro-fe9171ec.js} +1 -1
- package/dist/esm/{barrage.taro-d86c367a.js → barrage.taro-0e157b5e.js} +25 -23
- package/dist/esm/{calendar.taro-93b14945.js → calendar.taro-72974415.js} +2 -2
- package/dist/esm/{calendaritem.taro-85a8c4fc.js → calendaritem.taro-84e889eb.js} +19 -17
- package/dist/esm/{cascader.taro-459f7d45.js → cascader.taro-d8cb1c3e.js} +245 -235
- package/dist/esm/{circleprogress.taro-3c89a157.js → circleprogress.taro-47db537c.js} +2 -13
- package/dist/esm/{datepicker.taro-7de67b85.js → datepicker.taro-7199f521.js} +1 -1
- package/dist/esm/{dialog.taro-cf9e3087.js → dialog.taro-f54cfbf0.js} +1 -1
- package/dist/esm/{drag.taro-0717c783.js → drag.taro-82b6b27a.js} +4 -8
- package/dist/esm/ellipsis.taro-c0de6ff4.js +84 -76
- package/dist/esm/{fixednav.taro-005765f4.js → fixednav.taro-9e759320.js} +1 -1
- package/dist/esm/{imagepreview.taro-68e776f5.js → imagepreview.taro-3400ea03.js} +1 -1
- package/dist/esm/{inputnumber.taro-0a01f6e1.js → inputnumber.taro-dc39b853.js} +1 -0
- package/dist/esm/{menuitem.taro-2f8e69a4.js → menuitem.taro-216e9f7d.js} +17 -15
- package/dist/esm/{noticebar.taro-43c18dc9.js → noticebar.taro-94002898.js} +35 -33
- package/dist/esm/{notify.taro-d9c48fae.js → notify.taro-308e5892.js} +1 -1
- package/dist/esm/{numberkeyboard.taro-9635ecc9.js → numberkeyboard.taro-5e8f0ddf.js} +1 -1
- package/dist/esm/nutui-react.es.js +30 -30
- package/dist/esm/{overlay.taro-be45fed5.js → overlay.taro-98367bc1.js} +1 -1
- package/dist/esm/{picker.taro-9b7263ca.js → picker.taro-3b5cc054.js} +14 -12
- package/dist/esm/{popover.taro-7e5dff8c.js → popover.taro-46d813e8.js} +18 -16
- package/dist/esm/{popup.taro-33d0bbc8.js → popup.taro-cb777e09.js} +1 -1
- package/dist/esm/pulltorefresh.taro-f26a20dd.js +81 -75
- package/dist/esm/{range.taro-4cbe2469.js → range.taro-c41e9b90.js} +72 -68
- package/dist/esm/{shortpassword.taro-4bd513ae.js → shortpassword.taro-3a3bf412.js} +1 -1
- package/dist/esm/{sidenavbar.taro-3b1f1218.js → sidenavbar.taro-06026f31.js} +1 -1
- package/dist/esm/{signature.taro-504357dc.js → signature.taro-17648cac.js} +79 -39
- package/dist/esm/swipe.taro-83bc248f.js +37 -35
- package/dist/esm/swiper.taro-852f6615.js +28 -26
- package/dist/esm/{timeselect.taro-000060af.js → timeselect.taro-fc7ec6ee.js} +1 -1
- package/dist/esm/{toast.taro-86862dff.js → toast.taro-0804b6b4.js} +1 -1
- package/dist/esm/useClientRect-bf69d7b3.js +12 -10
- package/dist/esm/{watermark.taro-d1f38563.js → watermark.taro-323d1cf3.js} +53 -41
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +160 -111
- package/dist/nutui.react.umd.js +159 -110
- package/dist/packages/drag/drag.scss +1 -0
- package/dist/packages/inputnumber/inputnumber.scss +4 -1
- package/dist/packages/signature/signature.scss +10 -3
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/variables.scss +1 -1
- package/package.json +1 -1
|
@@ -341,22 +341,24 @@ var CalendarItem = function CalendarItem(props) {
|
|
|
341
341
|
requestAniFrame$1( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
342
342
|
var weeksPanelRes, monthsDoms, i;
|
|
343
343
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
344
|
-
while (1)
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
344
|
+
while (1) {
|
|
345
|
+
switch (_context.prev = _context.next) {
|
|
346
|
+
case 0:
|
|
347
|
+
if (!(weeksPanel !== null && weeksPanel !== void 0 && weeksPanel.current && monthsPanel !== null && monthsPanel !== void 0 && monthsPanel.current)) {
|
|
348
|
+
_context.next = 7;
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
_context.next = 3;
|
|
352
|
+
return getRectByTaro(weeksPanel === null || weeksPanel === void 0 ? void 0 : weeksPanel.current);
|
|
353
|
+
case 3:
|
|
354
|
+
weeksPanelRes = _context.sent;
|
|
355
|
+
weeksPanelRes === null || weeksPanelRes === void 0 ? void 0 : weeksPanelRes.bottom;
|
|
356
|
+
monthsDoms = monthsPanel.current.getElementsByClassName('calendar-month');
|
|
357
|
+
for (i = 0; i < monthsDoms.length; i++) {}
|
|
358
|
+
case 7:
|
|
359
|
+
case "end":
|
|
360
|
+
return _context.stop();
|
|
361
|
+
}
|
|
360
362
|
}
|
|
361
363
|
}, _callee);
|
|
362
364
|
})));
|
|
@@ -370,7 +372,7 @@ var CalendarItem = function CalendarItem(props) {
|
|
|
370
372
|
if (type === 'end') {
|
|
371
373
|
monthsPanel.current.style.webkitTransition = "transform ".concat(time, "ms cubic-bezier(0.19, 1, 0.22, 1)");
|
|
372
374
|
clearTimeout(state.timer);
|
|
373
|
-
state.timer = setTimeout(function () {
|
|
375
|
+
state.timer = window.setTimeout(function () {
|
|
374
376
|
loadScroll();
|
|
375
377
|
}, time);
|
|
376
378
|
} else {
|
|
@@ -12,7 +12,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
12
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
13
|
import React__default, { useEffect, useState } from 'react';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
|
-
import { P as Popup } from './popup.taro-
|
|
15
|
+
import { P as Popup } from './popup.taro-cb777e09.js';
|
|
16
16
|
import { T as Tabs } from './tabs.taro-e71875fa.js';
|
|
17
17
|
import { T as TabPane } from './tabpane.taro-91cd6cf4.js';
|
|
18
18
|
import { I as Icon } from './icon.taro-1d0d4fb7.js';
|
|
@@ -318,42 +318,44 @@ var InternalCascader = function InternalCascader(props) {
|
|
|
318
318
|
var initData = /*#__PURE__*/function () {
|
|
319
319
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
320
320
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
321
|
-
while (1)
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
321
|
+
while (1) {
|
|
322
|
+
switch (_context.prev = _context.next) {
|
|
323
|
+
case 0:
|
|
324
|
+
// 初始化开始处理数据
|
|
325
|
+
state.lazyLoadMap.clear();
|
|
326
|
+
if (convertConfig && Object.keys(convertConfig).length > 0) {
|
|
327
|
+
state.optionsData = convertListToOptions(options, convertConfig);
|
|
328
|
+
} else {
|
|
329
|
+
state.optionsData = options;
|
|
330
|
+
}
|
|
331
|
+
state.tree = new Tree(state.optionsData, {
|
|
332
|
+
value: state.configs.valueKey,
|
|
333
|
+
text: state.configs.textKey,
|
|
334
|
+
children: state.configs.childrenKey
|
|
335
|
+
});
|
|
336
|
+
if (!(isLazy() && !state.tree.nodes.length)) {
|
|
337
|
+
_context.next = 6;
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
336
340
|
_context.next = 6;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
case "end":
|
|
356
|
-
return _context.stop();
|
|
341
|
+
return invokeLazyLoad({
|
|
342
|
+
root: true,
|
|
343
|
+
loading: true,
|
|
344
|
+
text: '',
|
|
345
|
+
value: ''
|
|
346
|
+
});
|
|
347
|
+
case 6:
|
|
348
|
+
state.panes = [{
|
|
349
|
+
nodes: state.tree.nodes,
|
|
350
|
+
selectedNode: null,
|
|
351
|
+
paneKey: 'c1'
|
|
352
|
+
}];
|
|
353
|
+
syncValue();
|
|
354
|
+
setOptiosData(state.panes);
|
|
355
|
+
case 9:
|
|
356
|
+
case "end":
|
|
357
|
+
return _context.stop();
|
|
358
|
+
}
|
|
357
359
|
}
|
|
358
360
|
}, _callee);
|
|
359
361
|
}));
|
|
@@ -366,88 +368,92 @@ var InternalCascader = function InternalCascader(props) {
|
|
|
366
368
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
367
369
|
var currentValue, needToSync, parent, last, pathNodes;
|
|
368
370
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
369
|
-
while (1)
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
if (!parent) {
|
|
396
|
-
_context3.next = 19;
|
|
397
|
-
break;
|
|
398
|
-
}
|
|
399
|
-
needToSync = [parent.value];
|
|
400
|
-
state.initLoading = true;
|
|
401
|
-
_context3.next = 15;
|
|
402
|
-
return currentValue.slice(1).reduce( /*#__PURE__*/function () {
|
|
403
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(p, value) {
|
|
404
|
-
var _parent$children;
|
|
405
|
-
var parent, node;
|
|
406
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
407
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
408
|
-
case 0:
|
|
409
|
-
_context2.next = 2;
|
|
410
|
-
return p;
|
|
411
|
-
case 2:
|
|
412
|
-
parent = _context2.sent;
|
|
413
|
-
_context2.next = 5;
|
|
414
|
-
return invokeLazyLoad(parent);
|
|
415
|
-
case 5:
|
|
416
|
-
node = parent === null || parent === void 0 ? void 0 : (_parent$children = parent.children) === null || _parent$children === void 0 ? void 0 : _parent$children.find(function (item) {
|
|
417
|
-
return item.value === value;
|
|
418
|
-
});
|
|
419
|
-
if (node) {
|
|
420
|
-
needToSync.push(value);
|
|
421
|
-
}
|
|
422
|
-
return _context2.abrupt("return", Promise.resolve(node));
|
|
423
|
-
case 8:
|
|
424
|
-
case "end":
|
|
425
|
-
return _context2.stop();
|
|
426
|
-
}
|
|
427
|
-
}, _callee2);
|
|
428
|
-
}));
|
|
429
|
-
return function (_x, _x2) {
|
|
430
|
-
return _ref3.apply(this, arguments);
|
|
431
|
-
};
|
|
432
|
-
}(), Promise.resolve(parent));
|
|
433
|
-
case 15:
|
|
434
|
-
last = _context3.sent;
|
|
435
|
-
_context3.next = 18;
|
|
436
|
-
return invokeLazyLoad(last);
|
|
437
|
-
case 18:
|
|
438
|
-
state.initLoading = false;
|
|
439
|
-
case 19:
|
|
440
|
-
if (needToSync.length && currentValue === value) {
|
|
441
|
-
pathNodes = state.tree.getPathNodesByValue(needToSync);
|
|
442
|
-
pathNodes.forEach(function (node, index) {
|
|
443
|
-
state.tabsCursor = index;
|
|
444
|
-
// 当有默认值时,不触发 chooseItem 里的 emit 事件
|
|
445
|
-
_chooseItem(node, true);
|
|
371
|
+
while (1) {
|
|
372
|
+
switch (_context3.prev = _context3.next) {
|
|
373
|
+
case 0:
|
|
374
|
+
currentValue = state.innerValue;
|
|
375
|
+
if (!(currentValue === undefined || !state.tree.nodes.length)) {
|
|
376
|
+
_context3.next = 3;
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
return _context3.abrupt("return");
|
|
380
|
+
case 3:
|
|
381
|
+
if (!(currentValue.length === 0)) {
|
|
382
|
+
_context3.next = 6;
|
|
383
|
+
break;
|
|
384
|
+
}
|
|
385
|
+
state.tabsCursor = 0;
|
|
386
|
+
// state.panes = [{ nodes: state.tree.nodes, selectedNode: null }];
|
|
387
|
+
return _context3.abrupt("return");
|
|
388
|
+
case 6:
|
|
389
|
+
needToSync = currentValue;
|
|
390
|
+
if (!(isLazy() && Array.isArray(currentValue) && currentValue.length)) {
|
|
391
|
+
_context3.next = 19;
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
needToSync = [];
|
|
395
|
+
parent = state.tree.nodes.find(function (node) {
|
|
396
|
+
return node.value === currentValue[0];
|
|
446
397
|
});
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
398
|
+
if (!parent) {
|
|
399
|
+
_context3.next = 19;
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
needToSync = [parent.value];
|
|
403
|
+
state.initLoading = true;
|
|
404
|
+
_context3.next = 15;
|
|
405
|
+
return currentValue.slice(1).reduce( /*#__PURE__*/function () {
|
|
406
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(p, value) {
|
|
407
|
+
var _parent$children;
|
|
408
|
+
var parent, node;
|
|
409
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
410
|
+
while (1) {
|
|
411
|
+
switch (_context2.prev = _context2.next) {
|
|
412
|
+
case 0:
|
|
413
|
+
_context2.next = 2;
|
|
414
|
+
return p;
|
|
415
|
+
case 2:
|
|
416
|
+
parent = _context2.sent;
|
|
417
|
+
_context2.next = 5;
|
|
418
|
+
return invokeLazyLoad(parent);
|
|
419
|
+
case 5:
|
|
420
|
+
node = parent === null || parent === void 0 ? void 0 : (_parent$children = parent.children) === null || _parent$children === void 0 ? void 0 : _parent$children.find(function (item) {
|
|
421
|
+
return item.value === value;
|
|
422
|
+
});
|
|
423
|
+
if (node) {
|
|
424
|
+
needToSync.push(value);
|
|
425
|
+
}
|
|
426
|
+
return _context2.abrupt("return", Promise.resolve(node));
|
|
427
|
+
case 8:
|
|
428
|
+
case "end":
|
|
429
|
+
return _context2.stop();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}, _callee2);
|
|
433
|
+
}));
|
|
434
|
+
return function (_x, _x2) {
|
|
435
|
+
return _ref3.apply(this, arguments);
|
|
436
|
+
};
|
|
437
|
+
}(), Promise.resolve(parent));
|
|
438
|
+
case 15:
|
|
439
|
+
last = _context3.sent;
|
|
440
|
+
_context3.next = 18;
|
|
441
|
+
return invokeLazyLoad(last);
|
|
442
|
+
case 18:
|
|
443
|
+
state.initLoading = false;
|
|
444
|
+
case 19:
|
|
445
|
+
if (needToSync.length && currentValue === value) {
|
|
446
|
+
pathNodes = state.tree.getPathNodesByValue(needToSync);
|
|
447
|
+
pathNodes.forEach(function (node, index) {
|
|
448
|
+
state.tabsCursor = index;
|
|
449
|
+
// 当有默认值时,不触发 chooseItem 里的 emit 事件
|
|
450
|
+
_chooseItem(node, true);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
case 20:
|
|
454
|
+
case "end":
|
|
455
|
+
return _context3.stop();
|
|
456
|
+
}
|
|
451
457
|
}
|
|
452
458
|
}, _callee3);
|
|
453
459
|
}));
|
|
@@ -459,53 +465,55 @@ var InternalCascader = function InternalCascader(props) {
|
|
|
459
465
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(node) {
|
|
460
466
|
var parent, lazyLoadPromise, nodes;
|
|
461
467
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
462
|
-
while (1)
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
return _context4.abrupt("return");
|
|
476
|
-
case 5:
|
|
477
|
-
if (!(state.tree.isLeaf(node, isLazy()) || state.tree.hasChildren(node, isLazy()))) {
|
|
478
|
-
_context4.next = 7;
|
|
479
|
-
break;
|
|
480
|
-
}
|
|
481
|
-
return _context4.abrupt("return");
|
|
482
|
-
case 7:
|
|
483
|
-
node.loading = true;
|
|
484
|
-
parent = node.root ? null : node;
|
|
485
|
-
lazyLoadPromise = state.lazyLoadMap.get(node);
|
|
486
|
-
if (!lazyLoadPromise) {
|
|
487
|
-
lazyLoadPromise = new Promise(function (resolve) {
|
|
488
|
-
var _state$configs$lazyLo, _state$configs;
|
|
489
|
-
// 外部必须resolve
|
|
490
|
-
(_state$configs$lazyLo = (_state$configs = state.configs).lazyLoad) === null || _state$configs$lazyLo === void 0 ? void 0 : _state$configs$lazyLo.call(_state$configs, node, resolve);
|
|
491
|
-
});
|
|
492
|
-
state.lazyLoadMap.set(node, lazyLoadPromise);
|
|
493
|
-
}
|
|
494
|
-
_context4.next = 13;
|
|
495
|
-
return lazyLoadPromise;
|
|
496
|
-
case 13:
|
|
497
|
-
nodes = _context4.sent;
|
|
498
|
-
if (Array.isArray(nodes) && nodes.length > 0) {
|
|
499
|
-
state.tree.updateChildren(nodes, parent);
|
|
500
|
-
} else {
|
|
501
|
-
// 如果加载完成后没有提供子节点,作为叶子节点处理
|
|
468
|
+
while (1) {
|
|
469
|
+
switch (_context4.prev = _context4.next) {
|
|
470
|
+
case 0:
|
|
471
|
+
if (node) {
|
|
472
|
+
_context4.next = 2;
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
return _context4.abrupt("return");
|
|
476
|
+
case 2:
|
|
477
|
+
if (state.configs.lazyLoad) {
|
|
478
|
+
_context4.next = 5;
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
502
481
|
node.leaf = true;
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
482
|
+
return _context4.abrupt("return");
|
|
483
|
+
case 5:
|
|
484
|
+
if (!(state.tree.isLeaf(node, isLazy()) || state.tree.hasChildren(node, isLazy()))) {
|
|
485
|
+
_context4.next = 7;
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
return _context4.abrupt("return");
|
|
489
|
+
case 7:
|
|
490
|
+
node.loading = true;
|
|
491
|
+
parent = node.root ? null : node;
|
|
492
|
+
lazyLoadPromise = state.lazyLoadMap.get(node);
|
|
493
|
+
if (!lazyLoadPromise) {
|
|
494
|
+
lazyLoadPromise = new Promise(function (resolve) {
|
|
495
|
+
var _state$configs$lazyLo, _state$configs;
|
|
496
|
+
// 外部必须resolve
|
|
497
|
+
(_state$configs$lazyLo = (_state$configs = state.configs).lazyLoad) === null || _state$configs$lazyLo === void 0 ? void 0 : _state$configs$lazyLo.call(_state$configs, node, resolve);
|
|
498
|
+
});
|
|
499
|
+
state.lazyLoadMap.set(node, lazyLoadPromise);
|
|
500
|
+
}
|
|
501
|
+
_context4.next = 13;
|
|
502
|
+
return lazyLoadPromise;
|
|
503
|
+
case 13:
|
|
504
|
+
nodes = _context4.sent;
|
|
505
|
+
if (Array.isArray(nodes) && nodes.length > 0) {
|
|
506
|
+
state.tree.updateChildren(nodes, parent);
|
|
507
|
+
} else {
|
|
508
|
+
// 如果加载完成后没有提供子节点,作为叶子节点处理
|
|
509
|
+
node.leaf = true;
|
|
510
|
+
}
|
|
511
|
+
node.loading = false;
|
|
512
|
+
state.lazyLoadMap["delete"](node);
|
|
513
|
+
case 17:
|
|
514
|
+
case "end":
|
|
515
|
+
return _context4.stop();
|
|
516
|
+
}
|
|
509
517
|
}
|
|
510
518
|
}, _callee4);
|
|
511
519
|
}));
|
|
@@ -525,79 +533,81 @@ var InternalCascader = function InternalCascader(props) {
|
|
|
525
533
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(node, type) {
|
|
526
534
|
var pathNodes, optionParams, level, _pathNodes, _optionParams;
|
|
527
535
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
528
|
-
while (1)
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
state.panes = state.panes.slice(0, node.level + 1);
|
|
543
|
-
if (!type) {
|
|
544
|
-
pathNodes = state.panes.map(function (item) {
|
|
545
|
-
return item.selectedNode;
|
|
546
|
-
});
|
|
547
|
-
optionParams = pathNodes.map(function (item) {
|
|
548
|
-
return item.value;
|
|
549
|
-
});
|
|
550
|
-
onChange(optionParams, pathNodes);
|
|
551
|
-
onPathChange(optionParams, pathNodes);
|
|
552
|
-
}
|
|
553
|
-
setOptiosData(state.panes);
|
|
554
|
-
close();
|
|
555
|
-
return _context5.abrupt("return");
|
|
556
|
-
case 10:
|
|
557
|
-
if (!state.tree.hasChildren(node, isLazy())) {
|
|
558
|
-
_context5.next = 20;
|
|
559
|
-
break;
|
|
560
|
-
}
|
|
561
|
-
level = node.level + 1;
|
|
562
|
-
state.panes[state.tabsCursor].selectedNode = node;
|
|
563
|
-
state.panes = state.panes.slice(0, level);
|
|
564
|
-
state.tabsCursor = level;
|
|
565
|
-
state.panes.push({
|
|
566
|
-
nodes: node.children || [],
|
|
567
|
-
selectedNode: null,
|
|
568
|
-
paneKey: "c".concat(state.tabsCursor + 1)
|
|
569
|
-
});
|
|
570
|
-
setTabvalue("c".concat(state.tabsCursor + 1));
|
|
571
|
-
setOptiosData(state.panes);
|
|
572
|
-
if (!type) {
|
|
573
|
-
_pathNodes = state.panes.map(function (item) {
|
|
574
|
-
return item.selectedNode;
|
|
575
|
-
});
|
|
576
|
-
_optionParams = _pathNodes.map(function (item) {
|
|
577
|
-
return item === null || item === void 0 ? void 0 : item.value;
|
|
578
|
-
});
|
|
579
|
-
onPathChange(_optionParams, _pathNodes);
|
|
580
|
-
}
|
|
581
|
-
return _context5.abrupt("return");
|
|
582
|
-
case 20:
|
|
583
|
-
state.currentProcessNode = node;
|
|
584
|
-
if (!node.loading) {
|
|
585
|
-
_context5.next = 23;
|
|
586
|
-
break;
|
|
587
|
-
}
|
|
588
|
-
return _context5.abrupt("return");
|
|
589
|
-
case 23:
|
|
590
|
-
_context5.next = 25;
|
|
591
|
-
return invokeLazyLoad(node);
|
|
592
|
-
case 25:
|
|
593
|
-
if (state.currentProcessNode === node) {
|
|
536
|
+
while (1) {
|
|
537
|
+
switch (_context5.prev = _context5.next) {
|
|
538
|
+
case 0:
|
|
539
|
+
if (!(!type && node.disabled || !state.panes[state.tabsCursor])) {
|
|
540
|
+
_context5.next = 2;
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
return _context5.abrupt("return");
|
|
544
|
+
case 2:
|
|
545
|
+
if (!state.tree.isLeaf(node, isLazy())) {
|
|
546
|
+
_context5.next = 10;
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
549
|
+
node.leaf = true;
|
|
594
550
|
state.panes[state.tabsCursor].selectedNode = node;
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
551
|
+
state.panes = state.panes.slice(0, node.level + 1);
|
|
552
|
+
if (!type) {
|
|
553
|
+
pathNodes = state.panes.map(function (item) {
|
|
554
|
+
return item.selectedNode;
|
|
555
|
+
});
|
|
556
|
+
optionParams = pathNodes.map(function (item) {
|
|
557
|
+
return item.value;
|
|
558
|
+
});
|
|
559
|
+
onChange(optionParams, pathNodes);
|
|
560
|
+
onPathChange(optionParams, pathNodes);
|
|
561
|
+
}
|
|
562
|
+
setOptiosData(state.panes);
|
|
563
|
+
close();
|
|
564
|
+
return _context5.abrupt("return");
|
|
565
|
+
case 10:
|
|
566
|
+
if (!state.tree.hasChildren(node, isLazy())) {
|
|
567
|
+
_context5.next = 20;
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
level = node.level + 1;
|
|
571
|
+
state.panes[state.tabsCursor].selectedNode = node;
|
|
572
|
+
state.panes = state.panes.slice(0, level);
|
|
573
|
+
state.tabsCursor = level;
|
|
574
|
+
state.panes.push({
|
|
575
|
+
nodes: node.children || [],
|
|
576
|
+
selectedNode: null,
|
|
577
|
+
paneKey: "c".concat(state.tabsCursor + 1)
|
|
578
|
+
});
|
|
579
|
+
setTabvalue("c".concat(state.tabsCursor + 1));
|
|
580
|
+
setOptiosData(state.panes);
|
|
581
|
+
if (!type) {
|
|
582
|
+
_pathNodes = state.panes.map(function (item) {
|
|
583
|
+
return item.selectedNode;
|
|
584
|
+
});
|
|
585
|
+
_optionParams = _pathNodes.map(function (item) {
|
|
586
|
+
return item === null || item === void 0 ? void 0 : item.value;
|
|
587
|
+
});
|
|
588
|
+
onPathChange(_optionParams, _pathNodes);
|
|
589
|
+
}
|
|
590
|
+
return _context5.abrupt("return");
|
|
591
|
+
case 20:
|
|
592
|
+
state.currentProcessNode = node;
|
|
593
|
+
if (!node.loading) {
|
|
594
|
+
_context5.next = 23;
|
|
595
|
+
break;
|
|
596
|
+
}
|
|
597
|
+
return _context5.abrupt("return");
|
|
598
|
+
case 23:
|
|
599
|
+
_context5.next = 25;
|
|
600
|
+
return invokeLazyLoad(node);
|
|
601
|
+
case 25:
|
|
602
|
+
if (state.currentProcessNode === node) {
|
|
603
|
+
state.panes[state.tabsCursor].selectedNode = node;
|
|
604
|
+
_chooseItem(node, type);
|
|
605
|
+
}
|
|
606
|
+
setOptiosData(state.panes);
|
|
607
|
+
case 27:
|
|
608
|
+
case "end":
|
|
609
|
+
return _context5.stop();
|
|
610
|
+
}
|
|
601
611
|
}
|
|
602
612
|
}, _callee5);
|
|
603
613
|
}));
|
|
@@ -39,7 +39,6 @@ var CircleProgress = function CircleProgress(props) {
|
|
|
39
39
|
var b = cn('circleprogress');
|
|
40
40
|
var classes = classNames(className, b(''));
|
|
41
41
|
var refRandomId = Math.random().toString(36).slice(-8);
|
|
42
|
-
var lastTime = 0;
|
|
43
42
|
var styles = _objectSpread({
|
|
44
43
|
height: "".concat(Number(radius) * 2, "px"),
|
|
45
44
|
width: "".concat(Number(radius) * 2, "px")
|
|
@@ -56,24 +55,14 @@ var CircleProgress = function CircleProgress(props) {
|
|
|
56
55
|
var rate = progress * (endRate - startRate) + startRate;
|
|
57
56
|
setOldValue(Math.min(Math.max(+rate, 0), 100));
|
|
58
57
|
if (endRate > startRate ? rate < endRate : rate > endRate) {
|
|
59
|
-
rafId = requestAnimationFrame(animate);
|
|
58
|
+
rafId = window.requestAnimationFrame(animate);
|
|
60
59
|
}
|
|
61
60
|
};
|
|
62
61
|
if (rafId) {
|
|
63
62
|
cancelAnimationFrame(rafId);
|
|
64
63
|
}
|
|
65
|
-
rafId = requestAnimationFrame(animate);
|
|
64
|
+
rafId = window.requestAnimationFrame(animate);
|
|
66
65
|
}, [progress]);
|
|
67
|
-
var requestAnimationFrame = function requestAnimationFrame(callback) {
|
|
68
|
-
var currTime = new Date().getTime();
|
|
69
|
-
var timeToCall = Math.max(0, 16.7 - (currTime - lastTime));
|
|
70
|
-
lastTime = currTime + timeToCall;
|
|
71
|
-
var id = setTimeout(function () {
|
|
72
|
-
callback();
|
|
73
|
-
}, timeToCall);
|
|
74
|
-
lastTime = currTime + timeToCall;
|
|
75
|
-
return id;
|
|
76
|
-
};
|
|
77
66
|
var cancelAnimationFrame = function cancelAnimationFrame(id) {
|
|
78
67
|
clearTimeout(id);
|
|
79
68
|
};
|
|
@@ -6,7 +6,7 @@ var _excluded = ["minDate", "maxDate", "type", "isShowChinese", "minuteStep", "m
|
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
9
|
-
import { P as Picker } from './picker.taro-
|
|
9
|
+
import { P as Picker } from './picker.taro-3b5cc054.js';
|
|
10
10
|
var currentYear = new Date().getFullYear();
|
|
11
11
|
var defaultProps = {
|
|
12
12
|
modelValue: null,
|
|
@@ -170,7 +170,7 @@ var BaseDialog = function BaseDialog(props, ref) {
|
|
|
170
170
|
onClick: function onClick(e) {
|
|
171
171
|
return handleOk(e);
|
|
172
172
|
}
|
|
173
|
-
}, okText));
|
|
173
|
+
}, okText || locale.confirm));
|
|
174
174
|
return footerContent;
|
|
175
175
|
};
|
|
176
176
|
return React__default.createElement(DialogWrapper, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
@@ -5,7 +5,7 @@ var _excluded = ["attract", "direction", "boundary", "children", "className", "s
|
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
8
|
-
import Taro
|
|
8
|
+
import Taro from '@tarojs/taro';
|
|
9
9
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
10
|
var defaultProps = {
|
|
11
11
|
attract: false,
|
|
@@ -61,7 +61,6 @@ var Drag = function Drag(props) {
|
|
|
61
61
|
screenWidth = _Taro$getSystemInfoSy.screenWidth,
|
|
62
62
|
windowHeight = _Taro$getSystemInfoSy.windowHeight;
|
|
63
63
|
Taro.createSelectorQuery().select(".".concat(className)).boundingClientRect(function (rec) {
|
|
64
|
-
// console.log(rec.height, rec.width)
|
|
65
64
|
setBoundaryState({
|
|
66
65
|
top: -rec.top + top,
|
|
67
66
|
left: -rec.left + left,
|
|
@@ -85,7 +84,6 @@ var Drag = function Drag(props) {
|
|
|
85
84
|
};
|
|
86
85
|
};
|
|
87
86
|
var touchMove = function touchMove(e) {
|
|
88
|
-
e.preventDefault();
|
|
89
87
|
if (e.touches.length === 1 && dragRef.current) {
|
|
90
88
|
var touch = e.touches[0];
|
|
91
89
|
var x = touch.clientX - axisCache.current.x;
|
|
@@ -123,11 +121,9 @@ var Drag = function Drag(props) {
|
|
|
123
121
|
}
|
|
124
122
|
};
|
|
125
123
|
useEffect(function () {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}, 200);
|
|
130
|
-
});
|
|
124
|
+
timer.current = window.setTimeout(function () {
|
|
125
|
+
getInfo();
|
|
126
|
+
}, 300);
|
|
131
127
|
return function () {
|
|
132
128
|
clearTimeout(timer.current);
|
|
133
129
|
};
|