@leankylin-sheet/react 7.0.5 → 7.0.7
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/dist/index.esm.js +63 -56
- package/dist/index.js +63 -56
- package/dist/index.umd.js +63 -56
- package/dist/index.umd.min.js +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -2330,32 +2330,12 @@ var LinkEditCard = function LinkEditCard(_ref) {
|
|
|
2330
2330
|
return m;
|
|
2331
2331
|
}, [settings === null || settings === void 0 ? void 0 : settings.customLinkTypes]);
|
|
2332
2332
|
var currentCustomConfig = customLinkTypeMap[linkType];
|
|
2333
|
-
var isCustomTypeValid =
|
|
2334
|
-
if (!currentCustomConfig) return true;
|
|
2335
|
-
if (!currentCustomConfig.onSave) return true;
|
|
2336
|
-
var next = currentCustomConfig.onSave({
|
|
2337
|
-
linkText: linkText,
|
|
2338
|
-
linkAddress: linkAddress,
|
|
2339
|
-
position: {
|
|
2340
|
-
r: r,
|
|
2341
|
-
c: c
|
|
2342
|
-
},
|
|
2343
|
-
origin: function () {
|
|
2344
|
-
var o = getCellHyperlink(context, r, c);
|
|
2345
|
-
return o ? {
|
|
2346
|
-
linkType: o.linkType,
|
|
2347
|
-
linkAddress: o.linkAddress,
|
|
2348
|
-
payload: o.payload
|
|
2349
|
-
} : undefined;
|
|
2350
|
-
}()
|
|
2351
|
-
});
|
|
2352
|
-
return next !== undefined;
|
|
2353
|
-
}, [currentCustomConfig, linkText, linkAddress, r, c, context]);
|
|
2333
|
+
var isCustomTypeValid = true;
|
|
2354
2334
|
var canSubmit = !currentCustomConfig || isCustomTypeValid ? isLinkAddressValid.isValid : false;
|
|
2355
2335
|
var tooltip = function () {
|
|
2356
2336
|
var text;
|
|
2357
2337
|
if (currentCustomConfig) {
|
|
2358
|
-
text =
|
|
2338
|
+
text = "" ;
|
|
2359
2339
|
} else {
|
|
2360
2340
|
text = isLinkAddressValid.tooltip;
|
|
2361
2341
|
}
|
|
@@ -2430,7 +2410,7 @@ var LinkEditCard = function LinkEditCard(_ref) {
|
|
|
2430
2410
|
setLinkType(originType);
|
|
2431
2411
|
var origin = getCellHyperlink(context, r, c);
|
|
2432
2412
|
setCustomPayload((_origin$payload2 = origin === null || origin === void 0 ? void 0 : origin.payload) !== null && _origin$payload2 !== void 0 ? _origin$payload2 : {});
|
|
2433
|
-
}, [rc, originAddress, originText, originType, r, c
|
|
2413
|
+
}, [rc, originAddress, originText, originType, r, c]);
|
|
2434
2414
|
useLayoutEffect(function () {
|
|
2435
2415
|
if (selectingCellRange) {
|
|
2436
2416
|
skipCellRangeSet.current = true;
|
|
@@ -2581,7 +2561,9 @@ var LinkEditCard = function LinkEditCard(_ref) {
|
|
|
2581
2561
|
} else {
|
|
2582
2562
|
setLinkAddress("");
|
|
2583
2563
|
}
|
|
2584
|
-
if (next === "cellrange")
|
|
2564
|
+
if (next === "cellrange") {
|
|
2565
|
+
setRangeModalVisible(true);
|
|
2566
|
+
}
|
|
2585
2567
|
setLinkType(next);
|
|
2586
2568
|
}
|
|
2587
2569
|
}, mergedLinkTypeList.map(function (type) {
|
|
@@ -2659,38 +2641,63 @@ var LinkEditCard = function LinkEditCard(_ref) {
|
|
|
2659
2641
|
}
|
|
2660
2642
|
})), tooltip))), /*#__PURE__*/React.createElement("div", {
|
|
2661
2643
|
className: "modal-footer"
|
|
2662
|
-
}, renderBottomButton(function () {
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2644
|
+
}, renderBottomButton( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2645
|
+
var origin, saved;
|
|
2646
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2647
|
+
while (1) switch (_context.prev = _context.next) {
|
|
2648
|
+
case 0:
|
|
2649
|
+
if (!(!canSubmit && !(currentCustomConfig === null || currentCustomConfig === void 0 ? void 0 : currentCustomConfig.onSave))) {
|
|
2650
|
+
_context.next = 2;
|
|
2651
|
+
break;
|
|
2652
|
+
}
|
|
2653
|
+
return _context.abrupt("return");
|
|
2654
|
+
case 2:
|
|
2655
|
+
_.set(refs.globalCache, "linkCard.mouseEnter", false);
|
|
2656
|
+
if (!(currentCustomConfig === null || currentCustomConfig === void 0 ? void 0 : currentCustomConfig.onSave)) {
|
|
2657
|
+
_context.next = 12;
|
|
2658
|
+
break;
|
|
2659
|
+
}
|
|
2660
|
+
origin = function () {
|
|
2661
|
+
var o = getCellHyperlink(context, r, c);
|
|
2662
|
+
return o ? {
|
|
2663
|
+
linkType: o.linkType,
|
|
2664
|
+
linkAddress: o.linkAddress,
|
|
2665
|
+
payload: o.payload
|
|
2666
|
+
} : undefined;
|
|
2667
|
+
}();
|
|
2668
|
+
_context.next = 7;
|
|
2669
|
+
return currentCustomConfig.onSave({
|
|
2670
|
+
linkText: linkText,
|
|
2671
|
+
linkAddress: linkAddress,
|
|
2672
|
+
position: {
|
|
2673
|
+
r: r,
|
|
2674
|
+
c: c
|
|
2675
|
+
},
|
|
2676
|
+
origin: origin
|
|
2677
|
+
});
|
|
2678
|
+
case 7:
|
|
2679
|
+
saved = _context.sent;
|
|
2680
|
+
if (saved) {
|
|
2681
|
+
_context.next = 10;
|
|
2682
|
+
break;
|
|
2683
|
+
}
|
|
2684
|
+
return _context.abrupt("return");
|
|
2685
|
+
case 10:
|
|
2686
|
+
setContext(function (draftCtx) {
|
|
2687
|
+
var _saved$payload;
|
|
2688
|
+
return saveHyperlink(draftCtx, r, c, linkText || saved.linkAddress, saved.linkType, saved.linkAddress, _objectSpread2(_objectSpread2({}, customPayload), (_saved$payload = saved.payload) !== null && _saved$payload !== void 0 ? _saved$payload : {}));
|
|
2689
|
+
});
|
|
2690
|
+
return _context.abrupt("return");
|
|
2691
|
+
case 12:
|
|
2692
|
+
setContext(function (draftCtx) {
|
|
2693
|
+
return saveHyperlink(draftCtx, r, c, linkText, linkType, linkAddress);
|
|
2694
|
+
});
|
|
2695
|
+
case 13:
|
|
2696
|
+
case "end":
|
|
2697
|
+
return _context.stop();
|
|
2698
|
+
}
|
|
2699
|
+
}, _callee);
|
|
2700
|
+
})), hideLinkCard))));
|
|
2694
2701
|
};
|
|
2695
2702
|
|
|
2696
2703
|
var FilterOptions = function FilterOptions(_ref) {
|
package/dist/index.js
CHANGED
|
@@ -2340,32 +2340,12 @@ var LinkEditCard = function LinkEditCard(_ref) {
|
|
|
2340
2340
|
return m;
|
|
2341
2341
|
}, [settings === null || settings === void 0 ? void 0 : settings.customLinkTypes]);
|
|
2342
2342
|
var currentCustomConfig = customLinkTypeMap[linkType];
|
|
2343
|
-
var isCustomTypeValid =
|
|
2344
|
-
if (!currentCustomConfig) return true;
|
|
2345
|
-
if (!currentCustomConfig.onSave) return true;
|
|
2346
|
-
var next = currentCustomConfig.onSave({
|
|
2347
|
-
linkText: linkText,
|
|
2348
|
-
linkAddress: linkAddress,
|
|
2349
|
-
position: {
|
|
2350
|
-
r: r,
|
|
2351
|
-
c: c
|
|
2352
|
-
},
|
|
2353
|
-
origin: function () {
|
|
2354
|
-
var o = core.getCellHyperlink(context, r, c);
|
|
2355
|
-
return o ? {
|
|
2356
|
-
linkType: o.linkType,
|
|
2357
|
-
linkAddress: o.linkAddress,
|
|
2358
|
-
payload: o.payload
|
|
2359
|
-
} : undefined;
|
|
2360
|
-
}()
|
|
2361
|
-
});
|
|
2362
|
-
return next !== undefined;
|
|
2363
|
-
}, [currentCustomConfig, linkText, linkAddress, r, c, context]);
|
|
2343
|
+
var isCustomTypeValid = true;
|
|
2364
2344
|
var canSubmit = !currentCustomConfig || isCustomTypeValid ? isLinkAddressValid.isValid : false;
|
|
2365
2345
|
var tooltip = function () {
|
|
2366
2346
|
var text;
|
|
2367
2347
|
if (currentCustomConfig) {
|
|
2368
|
-
text =
|
|
2348
|
+
text = "" ;
|
|
2369
2349
|
} else {
|
|
2370
2350
|
text = isLinkAddressValid.tooltip;
|
|
2371
2351
|
}
|
|
@@ -2440,7 +2420,7 @@ var LinkEditCard = function LinkEditCard(_ref) {
|
|
|
2440
2420
|
setLinkType(originType);
|
|
2441
2421
|
var origin = core.getCellHyperlink(context, r, c);
|
|
2442
2422
|
setCustomPayload((_origin$payload2 = origin === null || origin === void 0 ? void 0 : origin.payload) !== null && _origin$payload2 !== void 0 ? _origin$payload2 : {});
|
|
2443
|
-
}, [rc, originAddress, originText, originType, r, c
|
|
2423
|
+
}, [rc, originAddress, originText, originType, r, c]);
|
|
2444
2424
|
React.useLayoutEffect(function () {
|
|
2445
2425
|
if (selectingCellRange) {
|
|
2446
2426
|
skipCellRangeSet.current = true;
|
|
@@ -2591,7 +2571,9 @@ var LinkEditCard = function LinkEditCard(_ref) {
|
|
|
2591
2571
|
} else {
|
|
2592
2572
|
setLinkAddress("");
|
|
2593
2573
|
}
|
|
2594
|
-
if (next === "cellrange")
|
|
2574
|
+
if (next === "cellrange") {
|
|
2575
|
+
setRangeModalVisible(true);
|
|
2576
|
+
}
|
|
2595
2577
|
setLinkType(next);
|
|
2596
2578
|
}
|
|
2597
2579
|
}, mergedLinkTypeList.map(function (type) {
|
|
@@ -2669,38 +2651,63 @@ var LinkEditCard = function LinkEditCard(_ref) {
|
|
|
2669
2651
|
}
|
|
2670
2652
|
})), tooltip))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2671
2653
|
className: "modal-footer"
|
|
2672
|
-
}, renderBottomButton(function () {
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2654
|
+
}, renderBottomButton( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2655
|
+
var origin, saved;
|
|
2656
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2657
|
+
while (1) switch (_context.prev = _context.next) {
|
|
2658
|
+
case 0:
|
|
2659
|
+
if (!(!canSubmit && !(currentCustomConfig === null || currentCustomConfig === void 0 ? void 0 : currentCustomConfig.onSave))) {
|
|
2660
|
+
_context.next = 2;
|
|
2661
|
+
break;
|
|
2662
|
+
}
|
|
2663
|
+
return _context.abrupt("return");
|
|
2664
|
+
case 2:
|
|
2665
|
+
___default['default'].set(refs.globalCache, "linkCard.mouseEnter", false);
|
|
2666
|
+
if (!(currentCustomConfig === null || currentCustomConfig === void 0 ? void 0 : currentCustomConfig.onSave)) {
|
|
2667
|
+
_context.next = 12;
|
|
2668
|
+
break;
|
|
2669
|
+
}
|
|
2670
|
+
origin = function () {
|
|
2671
|
+
var o = core.getCellHyperlink(context, r, c);
|
|
2672
|
+
return o ? {
|
|
2673
|
+
linkType: o.linkType,
|
|
2674
|
+
linkAddress: o.linkAddress,
|
|
2675
|
+
payload: o.payload
|
|
2676
|
+
} : undefined;
|
|
2677
|
+
}();
|
|
2678
|
+
_context.next = 7;
|
|
2679
|
+
return currentCustomConfig.onSave({
|
|
2680
|
+
linkText: linkText,
|
|
2681
|
+
linkAddress: linkAddress,
|
|
2682
|
+
position: {
|
|
2683
|
+
r: r,
|
|
2684
|
+
c: c
|
|
2685
|
+
},
|
|
2686
|
+
origin: origin
|
|
2687
|
+
});
|
|
2688
|
+
case 7:
|
|
2689
|
+
saved = _context.sent;
|
|
2690
|
+
if (saved) {
|
|
2691
|
+
_context.next = 10;
|
|
2692
|
+
break;
|
|
2693
|
+
}
|
|
2694
|
+
return _context.abrupt("return");
|
|
2695
|
+
case 10:
|
|
2696
|
+
setContext(function (draftCtx) {
|
|
2697
|
+
var _saved$payload;
|
|
2698
|
+
return core.saveHyperlink(draftCtx, r, c, linkText || saved.linkAddress, saved.linkType, saved.linkAddress, _objectSpread2(_objectSpread2({}, customPayload), (_saved$payload = saved.payload) !== null && _saved$payload !== void 0 ? _saved$payload : {}));
|
|
2699
|
+
});
|
|
2700
|
+
return _context.abrupt("return");
|
|
2701
|
+
case 12:
|
|
2702
|
+
setContext(function (draftCtx) {
|
|
2703
|
+
return core.saveHyperlink(draftCtx, r, c, linkText, linkType, linkAddress);
|
|
2704
|
+
});
|
|
2705
|
+
case 13:
|
|
2706
|
+
case "end":
|
|
2707
|
+
return _context.stop();
|
|
2708
|
+
}
|
|
2709
|
+
}, _callee);
|
|
2710
|
+
})), hideLinkCard))));
|
|
2704
2711
|
};
|
|
2705
2712
|
|
|
2706
2713
|
var FilterOptions = function FilterOptions(_ref) {
|
package/dist/index.umd.js
CHANGED
|
@@ -21414,32 +21414,12 @@
|
|
|
21414
21414
|
return m;
|
|
21415
21415
|
}, [settings === null || settings === void 0 ? void 0 : settings.customLinkTypes]);
|
|
21416
21416
|
var currentCustomConfig = customLinkTypeMap[linkType];
|
|
21417
|
-
var isCustomTypeValid =
|
|
21418
|
-
if (!currentCustomConfig) return true;
|
|
21419
|
-
if (!currentCustomConfig.onSave) return true;
|
|
21420
|
-
var next = currentCustomConfig.onSave({
|
|
21421
|
-
linkText: linkText,
|
|
21422
|
-
linkAddress: linkAddress,
|
|
21423
|
-
position: {
|
|
21424
|
-
r: r,
|
|
21425
|
-
c: c
|
|
21426
|
-
},
|
|
21427
|
-
origin: function () {
|
|
21428
|
-
var o = core.getCellHyperlink(context, r, c);
|
|
21429
|
-
return o ? {
|
|
21430
|
-
linkType: o.linkType,
|
|
21431
|
-
linkAddress: o.linkAddress,
|
|
21432
|
-
payload: o.payload
|
|
21433
|
-
} : undefined;
|
|
21434
|
-
}()
|
|
21435
|
-
});
|
|
21436
|
-
return next !== undefined;
|
|
21437
|
-
}, [currentCustomConfig, linkText, linkAddress, r, c, context]);
|
|
21417
|
+
var isCustomTypeValid = true;
|
|
21438
21418
|
var canSubmit = !currentCustomConfig || isCustomTypeValid ? isLinkAddressValid.isValid : false;
|
|
21439
21419
|
var tooltip = function () {
|
|
21440
21420
|
var text;
|
|
21441
21421
|
if (currentCustomConfig) {
|
|
21442
|
-
text =
|
|
21422
|
+
text = "" ;
|
|
21443
21423
|
} else {
|
|
21444
21424
|
text = isLinkAddressValid.tooltip;
|
|
21445
21425
|
}
|
|
@@ -21514,7 +21494,7 @@
|
|
|
21514
21494
|
setLinkType(originType);
|
|
21515
21495
|
var origin = core.getCellHyperlink(context, r, c);
|
|
21516
21496
|
setCustomPayload((_origin$payload2 = origin === null || origin === void 0 ? void 0 : origin.payload) !== null && _origin$payload2 !== void 0 ? _origin$payload2 : {});
|
|
21517
|
-
}, [rc, originAddress, originText, originType, r, c
|
|
21497
|
+
}, [rc, originAddress, originText, originType, r, c]);
|
|
21518
21498
|
React.useLayoutEffect(function () {
|
|
21519
21499
|
if (selectingCellRange) {
|
|
21520
21500
|
skipCellRangeSet.current = true;
|
|
@@ -21665,7 +21645,9 @@
|
|
|
21665
21645
|
} else {
|
|
21666
21646
|
setLinkAddress("");
|
|
21667
21647
|
}
|
|
21668
|
-
if (next === "cellrange")
|
|
21648
|
+
if (next === "cellrange") {
|
|
21649
|
+
setRangeModalVisible(true);
|
|
21650
|
+
}
|
|
21669
21651
|
setLinkType(next);
|
|
21670
21652
|
}
|
|
21671
21653
|
}, mergedLinkTypeList.map(function (type) {
|
|
@@ -21743,38 +21725,63 @@
|
|
|
21743
21725
|
}
|
|
21744
21726
|
})), tooltip))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
21745
21727
|
className: "modal-footer"
|
|
21746
|
-
}, renderBottomButton(function () {
|
|
21747
|
-
|
|
21748
|
-
|
|
21749
|
-
|
|
21750
|
-
|
|
21751
|
-
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
|
-
|
|
21777
|
-
|
|
21728
|
+
}, renderBottomButton( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
21729
|
+
var origin, saved;
|
|
21730
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
21731
|
+
while (1) switch (_context.prev = _context.next) {
|
|
21732
|
+
case 0:
|
|
21733
|
+
if (!(!canSubmit && !(currentCustomConfig === null || currentCustomConfig === void 0 ? void 0 : currentCustomConfig.onSave))) {
|
|
21734
|
+
_context.next = 2;
|
|
21735
|
+
break;
|
|
21736
|
+
}
|
|
21737
|
+
return _context.abrupt("return");
|
|
21738
|
+
case 2:
|
|
21739
|
+
lodash.set(refs.globalCache, "linkCard.mouseEnter", false);
|
|
21740
|
+
if (!(currentCustomConfig === null || currentCustomConfig === void 0 ? void 0 : currentCustomConfig.onSave)) {
|
|
21741
|
+
_context.next = 12;
|
|
21742
|
+
break;
|
|
21743
|
+
}
|
|
21744
|
+
origin = function () {
|
|
21745
|
+
var o = core.getCellHyperlink(context, r, c);
|
|
21746
|
+
return o ? {
|
|
21747
|
+
linkType: o.linkType,
|
|
21748
|
+
linkAddress: o.linkAddress,
|
|
21749
|
+
payload: o.payload
|
|
21750
|
+
} : undefined;
|
|
21751
|
+
}();
|
|
21752
|
+
_context.next = 7;
|
|
21753
|
+
return currentCustomConfig.onSave({
|
|
21754
|
+
linkText: linkText,
|
|
21755
|
+
linkAddress: linkAddress,
|
|
21756
|
+
position: {
|
|
21757
|
+
r: r,
|
|
21758
|
+
c: c
|
|
21759
|
+
},
|
|
21760
|
+
origin: origin
|
|
21761
|
+
});
|
|
21762
|
+
case 7:
|
|
21763
|
+
saved = _context.sent;
|
|
21764
|
+
if (saved) {
|
|
21765
|
+
_context.next = 10;
|
|
21766
|
+
break;
|
|
21767
|
+
}
|
|
21768
|
+
return _context.abrupt("return");
|
|
21769
|
+
case 10:
|
|
21770
|
+
setContext(function (draftCtx) {
|
|
21771
|
+
var _saved$payload;
|
|
21772
|
+
return core.saveHyperlink(draftCtx, r, c, linkText || saved.linkAddress, saved.linkType, saved.linkAddress, _objectSpread2(_objectSpread2({}, customPayload), (_saved$payload = saved.payload) !== null && _saved$payload !== void 0 ? _saved$payload : {}));
|
|
21773
|
+
});
|
|
21774
|
+
return _context.abrupt("return");
|
|
21775
|
+
case 12:
|
|
21776
|
+
setContext(function (draftCtx) {
|
|
21777
|
+
return core.saveHyperlink(draftCtx, r, c, linkText, linkType, linkAddress);
|
|
21778
|
+
});
|
|
21779
|
+
case 13:
|
|
21780
|
+
case "end":
|
|
21781
|
+
return _context.stop();
|
|
21782
|
+
}
|
|
21783
|
+
}, _callee);
|
|
21784
|
+
})), hideLinkCard))));
|
|
21778
21785
|
};
|
|
21779
21786
|
|
|
21780
21787
|
var FilterOptions = function FilterOptions(_ref) {
|