@nutui/nutui-react 1.4.1 → 1.4.2-beta.0
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 +7 -0
- package/README.md +4 -4
- package/dist/esm/Address.js +23 -21
- package/dist/esm/Cascader.js +234 -244
- package/dist/esm/Input.js +12 -24
- package/dist/esm/PullToRefresh.js +75 -81
- package/dist/esm/render-f8746530.js +10 -12
- package/dist/esm/types/src/packages/input/input.d.ts +0 -8
- package/dist/locales/base.js +2 -2
- package/dist/locales/en-US.js +2 -2
- package/dist/locales/id-ID.js +2 -2
- package/dist/locales/zh-CN.js +2 -2
- package/dist/locales/zh-TW.js +2 -2
- package/dist/locales/zh-UG.js +2 -2
- package/dist/nutui.react.es.js +12 -23
- package/dist/nutui.react.umd.js +12 -23
- package/dist/packages/input/input.scss +12 -12
- package/dist/style.css +1 -1
- package/dist/style.es.js +2 -2
- package/dist/types/index.d.ts +0 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
|
|
43
43
|
## Features
|
|
44
44
|
|
|
45
|
-
* 🚀
|
|
46
|
-
* 📖 Based on JD APP
|
|
45
|
+
* 🚀 70+ High Quality Components
|
|
46
|
+
* 📖 Based on JD APP 11.0 Visual Specifications
|
|
47
47
|
* 🍭 Support Tree Shaking
|
|
48
48
|
* 📖 Extensive Documentation and Demos
|
|
49
49
|
* 💪 Written in TypeScript
|
|
50
50
|
* 💪 Support SSR (Experimental)
|
|
51
51
|
* 🍭 Support Custom Themes
|
|
52
|
-
* 🍭
|
|
52
|
+
* 🍭 90%+ Unit Test Coverage
|
|
53
53
|
* 📖 Provide Sketch Design Resources
|
|
54
54
|
|
|
55
55
|
|
|
@@ -148,4 +148,4 @@ NutUI follows [Angular Style Commit Message Conventions](https://gist.github.com
|
|
|
148
148
|
|
|
149
149
|
## Open Source License
|
|
150
150
|
|
|
151
|
-
This project is based on **MIT** protocol
|
|
151
|
+
This project is based on **MIT** protocol
|
package/dist/esm/Address.js
CHANGED
|
@@ -279,32 +279,34 @@ var CustomRender = function CustomRender(props) {
|
|
|
279
279
|
if (modelValue.length > 0) {
|
|
280
280
|
var tagIndex = 0;
|
|
281
281
|
var selectedRegionC = selectedRegion && Object.assign(selectedRegion);
|
|
282
|
-
|
|
282
|
+
var _loop = function _loop() {
|
|
283
283
|
if (regionList[tabName[index]].length === 0) {
|
|
284
284
|
tagIndex = index - 1;
|
|
285
285
|
setTabIndex(index - 1);
|
|
286
|
-
break;
|
|
286
|
+
return "break";
|
|
287
287
|
} else {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
setSelectedRegion(selectedRegionC);
|
|
306
|
-
})();
|
|
288
|
+
var val = modelValue[index];
|
|
289
|
+
var arr = regionList[tabName[index]];
|
|
290
|
+
if (privateType === 'custom') {
|
|
291
|
+
selectedRegionC[[tabName[index]]] = arr.filter(function (item) {
|
|
292
|
+
return item.id === val;
|
|
293
|
+
})[0];
|
|
294
|
+
} else if (privateType === 'custom2') {
|
|
295
|
+
var sumArr = [];
|
|
296
|
+
arr.forEach(function (item) {
|
|
297
|
+
sumArr.push.apply(sumArr, _toConsumableArray(item.list));
|
|
298
|
+
});
|
|
299
|
+
selectedRegionC[[tabName[index]]] = sumArr.filter(function (item) {
|
|
300
|
+
return item.id === val;
|
|
301
|
+
})[0];
|
|
302
|
+
}
|
|
303
|
+
tagIndex = index;
|
|
304
|
+
setSelectedRegion(selectedRegionC);
|
|
307
305
|
}
|
|
306
|
+
};
|
|
307
|
+
for (var index = 0; index < modelValue.length; index++) {
|
|
308
|
+
var _ret = _loop();
|
|
309
|
+
if (_ret === "break") break;
|
|
308
310
|
}
|
|
309
311
|
setTabIndex(tagIndex);
|
|
310
312
|
lineAnimation(tagIndex);
|
package/dist/esm/Cascader.js
CHANGED
|
@@ -321,44 +321,42 @@ var InternalCascader = function InternalCascader(props) {
|
|
|
321
321
|
var initData = /*#__PURE__*/function () {
|
|
322
322
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
323
323
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
324
|
-
while (1) {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
if (!(isLazy() && !state.tree.nodes.length)) {
|
|
340
|
-
_context.next = 6;
|
|
341
|
-
break;
|
|
342
|
-
}
|
|
324
|
+
while (1) switch (_context.prev = _context.next) {
|
|
325
|
+
case 0:
|
|
326
|
+
// 初始化开始处理数据
|
|
327
|
+
state.lazyLoadMap.clear();
|
|
328
|
+
if (convertConfig && Object.keys(convertConfig).length > 0) {
|
|
329
|
+
state.optionsData = convertListToOptions(options, convertConfig);
|
|
330
|
+
} else {
|
|
331
|
+
state.optionsData = options;
|
|
332
|
+
}
|
|
333
|
+
state.tree = new Tree(state.optionsData, {
|
|
334
|
+
value: state.configs.valueKey,
|
|
335
|
+
text: state.configs.textKey,
|
|
336
|
+
children: state.configs.childrenKey
|
|
337
|
+
});
|
|
338
|
+
if (!(isLazy() && !state.tree.nodes.length)) {
|
|
343
339
|
_context.next = 6;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
_context.next = 6;
|
|
343
|
+
return invokeLazyLoad({
|
|
344
|
+
root: true,
|
|
345
|
+
loading: true,
|
|
346
|
+
text: '',
|
|
347
|
+
value: ''
|
|
348
|
+
});
|
|
349
|
+
case 6:
|
|
350
|
+
state.panes = [{
|
|
351
|
+
nodes: state.tree.nodes,
|
|
352
|
+
selectedNode: null,
|
|
353
|
+
paneKey: 'c1'
|
|
354
|
+
}];
|
|
355
|
+
syncValue();
|
|
356
|
+
setOptiosData(state.panes);
|
|
357
|
+
case 9:
|
|
358
|
+
case "end":
|
|
359
|
+
return _context.stop();
|
|
362
360
|
}
|
|
363
361
|
}, _callee);
|
|
364
362
|
}));
|
|
@@ -371,92 +369,88 @@ var InternalCascader = function InternalCascader(props) {
|
|
|
371
369
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
372
370
|
var currentValue, needToSync, parent, last, pathNodes;
|
|
373
371
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
374
|
-
while (1) {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
var
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
if (node) {
|
|
427
|
-
needToSync.push(value);
|
|
428
|
-
}
|
|
429
|
-
return _context2.abrupt("return", Promise.resolve(node));
|
|
430
|
-
case 8:
|
|
431
|
-
case "end":
|
|
432
|
-
return _context2.stop();
|
|
372
|
+
while (1) 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];
|
|
397
|
+
});
|
|
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) switch (_context2.prev = _context2.next) {
|
|
411
|
+
case 0:
|
|
412
|
+
_context2.next = 2;
|
|
413
|
+
return p;
|
|
414
|
+
case 2:
|
|
415
|
+
parent = _context2.sent;
|
|
416
|
+
_context2.next = 5;
|
|
417
|
+
return invokeLazyLoad(parent);
|
|
418
|
+
case 5:
|
|
419
|
+
node = parent === null || parent === void 0 ? void 0 : (_parent$children = parent.children) === null || _parent$children === void 0 ? void 0 : _parent$children.find(function (item) {
|
|
420
|
+
return item.value === value;
|
|
421
|
+
});
|
|
422
|
+
if (node) {
|
|
423
|
+
needToSync.push(value);
|
|
433
424
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
425
|
+
return _context2.abrupt("return", Promise.resolve(node));
|
|
426
|
+
case 8:
|
|
427
|
+
case "end":
|
|
428
|
+
return _context2.stop();
|
|
429
|
+
}
|
|
430
|
+
}, _callee2);
|
|
431
|
+
}));
|
|
432
|
+
return function (_x, _x2) {
|
|
433
|
+
return _ref3.apply(this, arguments);
|
|
434
|
+
};
|
|
435
|
+
}(), Promise.resolve(parent));
|
|
436
|
+
case 15:
|
|
437
|
+
last = _context3.sent;
|
|
438
|
+
_context3.next = 18;
|
|
439
|
+
return invokeLazyLoad(last);
|
|
440
|
+
case 18:
|
|
441
|
+
state.initLoading = false;
|
|
442
|
+
case 19:
|
|
443
|
+
if (needToSync.length && currentValue === value) {
|
|
444
|
+
pathNodes = state.tree.getPathNodesByValue(needToSync);
|
|
445
|
+
pathNodes.forEach(function (node, index) {
|
|
446
|
+
state.tabsCursor = index;
|
|
447
|
+
// 当有默认值时,不触发 chooseItem 里的 emit 事件
|
|
448
|
+
_chooseItem(node, true);
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
case 20:
|
|
452
|
+
case "end":
|
|
453
|
+
return _context3.stop();
|
|
460
454
|
}
|
|
461
455
|
}, _callee3);
|
|
462
456
|
}));
|
|
@@ -468,55 +462,53 @@ var InternalCascader = function InternalCascader(props) {
|
|
|
468
462
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(node) {
|
|
469
463
|
var parent, lazyLoadPromise, nodes;
|
|
470
464
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
471
|
-
while (1) {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
465
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
466
|
+
case 0:
|
|
467
|
+
if (node) {
|
|
468
|
+
_context4.next = 2;
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
return _context4.abrupt("return");
|
|
472
|
+
case 2:
|
|
473
|
+
if (state.configs.lazyLoad) {
|
|
474
|
+
_context4.next = 5;
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
node.leaf = true;
|
|
478
|
+
return _context4.abrupt("return");
|
|
479
|
+
case 5:
|
|
480
|
+
if (!(state.tree.isLeaf(node, isLazy()) || state.tree.hasChildren(node, isLazy()))) {
|
|
481
|
+
_context4.next = 7;
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
return _context4.abrupt("return");
|
|
485
|
+
case 7:
|
|
486
|
+
node.loading = true;
|
|
487
|
+
parent = node.root ? null : node;
|
|
488
|
+
lazyLoadPromise = state.lazyLoadMap.get(node);
|
|
489
|
+
if (!lazyLoadPromise) {
|
|
490
|
+
lazyLoadPromise = new Promise(function (resolve) {
|
|
491
|
+
var _state$configs$lazyLo, _state$configs;
|
|
492
|
+
// 外部必须resolve
|
|
493
|
+
(_state$configs$lazyLo = (_state$configs = state.configs).lazyLoad) === null || _state$configs$lazyLo === void 0 ? void 0 : _state$configs$lazyLo.call(_state$configs, node, resolve);
|
|
494
|
+
});
|
|
495
|
+
state.lazyLoadMap.set(node, lazyLoadPromise);
|
|
496
|
+
}
|
|
497
|
+
_context4.next = 13;
|
|
498
|
+
return lazyLoadPromise;
|
|
499
|
+
case 13:
|
|
500
|
+
nodes = _context4.sent;
|
|
501
|
+
if (Array.isArray(nodes) && nodes.length > 0) {
|
|
502
|
+
state.tree.updateChildren(nodes, parent);
|
|
503
|
+
} else {
|
|
504
|
+
// 如果加载完成后没有提供子节点,作为叶子节点处理
|
|
484
505
|
node.leaf = true;
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
return _context4.abrupt("return");
|
|
492
|
-
case 7:
|
|
493
|
-
node.loading = true;
|
|
494
|
-
parent = node.root ? null : node;
|
|
495
|
-
lazyLoadPromise = state.lazyLoadMap.get(node);
|
|
496
|
-
if (!lazyLoadPromise) {
|
|
497
|
-
lazyLoadPromise = new Promise(function (resolve) {
|
|
498
|
-
var _state$configs$lazyLo, _state$configs;
|
|
499
|
-
// 外部必须resolve
|
|
500
|
-
(_state$configs$lazyLo = (_state$configs = state.configs).lazyLoad) === null || _state$configs$lazyLo === void 0 ? void 0 : _state$configs$lazyLo.call(_state$configs, node, resolve);
|
|
501
|
-
});
|
|
502
|
-
state.lazyLoadMap.set(node, lazyLoadPromise);
|
|
503
|
-
}
|
|
504
|
-
_context4.next = 13;
|
|
505
|
-
return lazyLoadPromise;
|
|
506
|
-
case 13:
|
|
507
|
-
nodes = _context4.sent;
|
|
508
|
-
if (Array.isArray(nodes) && nodes.length > 0) {
|
|
509
|
-
state.tree.updateChildren(nodes, parent);
|
|
510
|
-
} else {
|
|
511
|
-
// 如果加载完成后没有提供子节点,作为叶子节点处理
|
|
512
|
-
node.leaf = true;
|
|
513
|
-
}
|
|
514
|
-
node.loading = false;
|
|
515
|
-
state.lazyLoadMap["delete"](node);
|
|
516
|
-
case 17:
|
|
517
|
-
case "end":
|
|
518
|
-
return _context4.stop();
|
|
519
|
-
}
|
|
506
|
+
}
|
|
507
|
+
node.loading = false;
|
|
508
|
+
state.lazyLoadMap["delete"](node);
|
|
509
|
+
case 17:
|
|
510
|
+
case "end":
|
|
511
|
+
return _context4.stop();
|
|
520
512
|
}
|
|
521
513
|
}, _callee4);
|
|
522
514
|
}));
|
|
@@ -536,81 +528,79 @@ var InternalCascader = function InternalCascader(props) {
|
|
|
536
528
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(node, type) {
|
|
537
529
|
var pathNodes, optionParams, level, _pathNodes, _optionParams;
|
|
538
530
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
539
|
-
while (1) {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
return item.selectedNode;
|
|
558
|
-
});
|
|
559
|
-
optionParams = pathNodes.map(function (item) {
|
|
560
|
-
return item.value;
|
|
561
|
-
});
|
|
562
|
-
onChange(optionParams, pathNodes);
|
|
563
|
-
onPathChange(optionParams, pathNodes);
|
|
564
|
-
}
|
|
565
|
-
setOptiosData(state.panes);
|
|
566
|
-
close();
|
|
567
|
-
return _context5.abrupt("return");
|
|
568
|
-
case 10:
|
|
569
|
-
if (!state.tree.hasChildren(node, isLazy())) {
|
|
570
|
-
_context5.next = 20;
|
|
571
|
-
break;
|
|
572
|
-
}
|
|
573
|
-
level = node.level + 1;
|
|
574
|
-
state.panes[state.tabsCursor].selectedNode = node;
|
|
575
|
-
state.panes = state.panes.slice(0, level);
|
|
576
|
-
state.tabsCursor = level;
|
|
577
|
-
state.panes.push({
|
|
578
|
-
nodes: node.children || [],
|
|
579
|
-
selectedNode: null,
|
|
580
|
-
paneKey: "c".concat(state.tabsCursor + 1)
|
|
531
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
532
|
+
case 0:
|
|
533
|
+
if (!(!type && node.disabled || !state.panes[state.tabsCursor])) {
|
|
534
|
+
_context5.next = 2;
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
return _context5.abrupt("return");
|
|
538
|
+
case 2:
|
|
539
|
+
if (!state.tree.isLeaf(node, isLazy())) {
|
|
540
|
+
_context5.next = 10;
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
node.leaf = true;
|
|
544
|
+
state.panes[state.tabsCursor].selectedNode = node;
|
|
545
|
+
state.panes = state.panes.slice(0, node.level + 1);
|
|
546
|
+
if (!type) {
|
|
547
|
+
pathNodes = state.panes.map(function (item) {
|
|
548
|
+
return item.selectedNode;
|
|
581
549
|
});
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
550
|
+
optionParams = pathNodes.map(function (item) {
|
|
551
|
+
return item.value;
|
|
552
|
+
});
|
|
553
|
+
onChange(optionParams, pathNodes);
|
|
554
|
+
onPathChange(optionParams, pathNodes);
|
|
555
|
+
}
|
|
556
|
+
setOptiosData(state.panes);
|
|
557
|
+
close();
|
|
558
|
+
return _context5.abrupt("return");
|
|
559
|
+
case 10:
|
|
560
|
+
if (!state.tree.hasChildren(node, isLazy())) {
|
|
561
|
+
_context5.next = 20;
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
level = node.level + 1;
|
|
565
|
+
state.panes[state.tabsCursor].selectedNode = node;
|
|
566
|
+
state.panes = state.panes.slice(0, level);
|
|
567
|
+
state.tabsCursor = level;
|
|
568
|
+
state.panes.push({
|
|
569
|
+
nodes: node.children || [],
|
|
570
|
+
selectedNode: null,
|
|
571
|
+
paneKey: "c".concat(state.tabsCursor + 1)
|
|
572
|
+
});
|
|
573
|
+
setTabvalue("c".concat(state.tabsCursor + 1));
|
|
574
|
+
setOptiosData(state.panes);
|
|
575
|
+
if (!type) {
|
|
576
|
+
_pathNodes = state.panes.map(function (item) {
|
|
577
|
+
return item.selectedNode;
|
|
578
|
+
});
|
|
579
|
+
_optionParams = _pathNodes.map(function (item) {
|
|
580
|
+
return item === null || item === void 0 ? void 0 : item.value;
|
|
581
|
+
});
|
|
582
|
+
onPathChange(_optionParams, _pathNodes);
|
|
583
|
+
}
|
|
584
|
+
return _context5.abrupt("return");
|
|
585
|
+
case 20:
|
|
586
|
+
state.currentProcessNode = node;
|
|
587
|
+
if (!node.loading) {
|
|
588
|
+
_context5.next = 23;
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
return _context5.abrupt("return");
|
|
592
|
+
case 23:
|
|
593
|
+
_context5.next = 25;
|
|
594
|
+
return invokeLazyLoad(node);
|
|
595
|
+
case 25:
|
|
596
|
+
if (state.currentProcessNode === node) {
|
|
597
|
+
state.panes[state.tabsCursor].selectedNode = node;
|
|
598
|
+
_chooseItem(node, type);
|
|
599
|
+
}
|
|
600
|
+
setOptiosData(state.panes);
|
|
601
|
+
case 27:
|
|
602
|
+
case "end":
|
|
603
|
+
return _context5.stop();
|
|
614
604
|
}
|
|
615
605
|
}, _callee5);
|
|
616
606
|
}));
|