@fileverse-dev/fortune-react 1.1.78 → 1.1.79
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.
|
@@ -149,8 +149,10 @@ var ContextMenu = function ContextMenu() {
|
|
|
149
149
|
toolbar = _b.toolbar,
|
|
150
150
|
splitText = _b.splitText;
|
|
151
151
|
var addRowColRightAvobe = function addRowColRightAvobe(type, direction) {
|
|
152
|
-
var _a, _b, _c;
|
|
153
|
-
var
|
|
152
|
+
var _a, _b, _c, _d, _e, _f;
|
|
153
|
+
var positionCol = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c[0];
|
|
154
|
+
var positionRow = (_f = (_e = (_d = context.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.row) === null || _f === void 0 ? void 0 : _f[0];
|
|
155
|
+
var position = type === "row" ? positionRow : positionCol;
|
|
154
156
|
if (position == null) return;
|
|
155
157
|
var count = 1;
|
|
156
158
|
if (count < 1) return;
|
|
@@ -392,30 +394,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
392
394
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
393
395
|
key: "add-col-".concat(dir),
|
|
394
396
|
onClick: function onClick() {
|
|
395
|
-
|
|
396
|
-
var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c[0];
|
|
397
|
-
if (position == null) return;
|
|
398
|
-
var count = 1;
|
|
399
|
-
if (count < 1) return;
|
|
400
|
-
var direction = dir === "left" ? "lefttop" : "rightbottom";
|
|
401
|
-
var insertRowColOp = {
|
|
402
|
-
type: "column",
|
|
403
|
-
index: position,
|
|
404
|
-
count: count,
|
|
405
|
-
direction: direction,
|
|
406
|
-
id: context.currentSheetId
|
|
407
|
-
};
|
|
408
|
-
setContext(function (draftCtx) {
|
|
409
|
-
try {
|
|
410
|
-
insertRowCol(draftCtx, insertRowColOp);
|
|
411
|
-
draftCtx.contextMenu = {};
|
|
412
|
-
} catch (err) {
|
|
413
|
-
if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
|
|
414
|
-
draftCtx.contextMenu = {};
|
|
415
|
-
}
|
|
416
|
-
}, {
|
|
417
|
-
insertRowColOp: insertRowColOp
|
|
418
|
-
});
|
|
397
|
+
addRowColRightAvobe("column", "lefttop");
|
|
419
398
|
}
|
|
420
399
|
}, /*#__PURE__*/React.createElement("div", {
|
|
421
400
|
className: "context-item"
|
|
@@ -457,30 +436,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
457
436
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
458
437
|
key: "add-row-".concat(dir),
|
|
459
438
|
onClick: function onClick() {
|
|
460
|
-
|
|
461
|
-
var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.row) === null || _c === void 0 ? void 0 : _c[0];
|
|
462
|
-
if (position == null) return;
|
|
463
|
-
var count = 1;
|
|
464
|
-
if (count < 1) return;
|
|
465
|
-
var direction = "lefttop";
|
|
466
|
-
var insertRowColOp = {
|
|
467
|
-
type: "row",
|
|
468
|
-
index: position,
|
|
469
|
-
count: count,
|
|
470
|
-
direction: direction,
|
|
471
|
-
id: context.currentSheetId
|
|
472
|
-
};
|
|
473
|
-
setContext(function (draftCtx) {
|
|
474
|
-
try {
|
|
475
|
-
insertRowCol(draftCtx, insertRowColOp);
|
|
476
|
-
draftCtx.contextMenu = {};
|
|
477
|
-
} catch (err) {
|
|
478
|
-
if (err.message === "maxExceeded") showAlert(rightclick.rowOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnRowReadOnly, "ok");
|
|
479
|
-
draftCtx.contextMenu = {};
|
|
480
|
-
}
|
|
481
|
-
}, {
|
|
482
|
-
insertRowColOp: insertRowColOp
|
|
483
|
-
});
|
|
439
|
+
addRowColRightAvobe("row", "lefttop");
|
|
484
440
|
}
|
|
485
441
|
}, /*#__PURE__*/React.createElement("div", {
|
|
486
442
|
className: "context-item"
|
|
@@ -158,8 +158,10 @@ var ContextMenu = function ContextMenu() {
|
|
|
158
158
|
toolbar = _b.toolbar,
|
|
159
159
|
splitText = _b.splitText;
|
|
160
160
|
var addRowColRightAvobe = function addRowColRightAvobe(type, direction) {
|
|
161
|
-
var _a, _b, _c;
|
|
162
|
-
var
|
|
161
|
+
var _a, _b, _c, _d, _e, _f;
|
|
162
|
+
var positionCol = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c[0];
|
|
163
|
+
var positionRow = (_f = (_e = (_d = context.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.row) === null || _f === void 0 ? void 0 : _f[0];
|
|
164
|
+
var position = type === "row" ? positionRow : positionCol;
|
|
163
165
|
if (position == null) return;
|
|
164
166
|
var count = 1;
|
|
165
167
|
if (count < 1) return;
|
|
@@ -401,30 +403,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
401
403
|
return /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
402
404
|
key: "add-col-".concat(dir),
|
|
403
405
|
onClick: function onClick() {
|
|
404
|
-
|
|
405
|
-
var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c[0];
|
|
406
|
-
if (position == null) return;
|
|
407
|
-
var count = 1;
|
|
408
|
-
if (count < 1) return;
|
|
409
|
-
var direction = dir === "left" ? "lefttop" : "rightbottom";
|
|
410
|
-
var insertRowColOp = {
|
|
411
|
-
type: "column",
|
|
412
|
-
index: position,
|
|
413
|
-
count: count,
|
|
414
|
-
direction: direction,
|
|
415
|
-
id: context.currentSheetId
|
|
416
|
-
};
|
|
417
|
-
setContext(function (draftCtx) {
|
|
418
|
-
try {
|
|
419
|
-
(0, _fortuneCore.insertRowCol)(draftCtx, insertRowColOp);
|
|
420
|
-
draftCtx.contextMenu = {};
|
|
421
|
-
} catch (err) {
|
|
422
|
-
if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
|
|
423
|
-
draftCtx.contextMenu = {};
|
|
424
|
-
}
|
|
425
|
-
}, {
|
|
426
|
-
insertRowColOp: insertRowColOp
|
|
427
|
-
});
|
|
406
|
+
addRowColRightAvobe("column", "lefttop");
|
|
428
407
|
}
|
|
429
408
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
430
409
|
className: "context-item"
|
|
@@ -466,30 +445,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
466
445
|
return /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
467
446
|
key: "add-row-".concat(dir),
|
|
468
447
|
onClick: function onClick() {
|
|
469
|
-
|
|
470
|
-
var position = (_c = (_b = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.row) === null || _c === void 0 ? void 0 : _c[0];
|
|
471
|
-
if (position == null) return;
|
|
472
|
-
var count = 1;
|
|
473
|
-
if (count < 1) return;
|
|
474
|
-
var direction = "lefttop";
|
|
475
|
-
var insertRowColOp = {
|
|
476
|
-
type: "row",
|
|
477
|
-
index: position,
|
|
478
|
-
count: count,
|
|
479
|
-
direction: direction,
|
|
480
|
-
id: context.currentSheetId
|
|
481
|
-
};
|
|
482
|
-
setContext(function (draftCtx) {
|
|
483
|
-
try {
|
|
484
|
-
(0, _fortuneCore.insertRowCol)(draftCtx, insertRowColOp);
|
|
485
|
-
draftCtx.contextMenu = {};
|
|
486
|
-
} catch (err) {
|
|
487
|
-
if (err.message === "maxExceeded") showAlert(rightclick.rowOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnRowReadOnly, "ok");
|
|
488
|
-
draftCtx.contextMenu = {};
|
|
489
|
-
}
|
|
490
|
-
}, {
|
|
491
|
-
insertRowColOp: insertRowColOp
|
|
492
|
-
});
|
|
448
|
+
addRowColRightAvobe("row", "lefttop");
|
|
493
449
|
}
|
|
494
450
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
495
451
|
className: "context-item"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.79",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tsc": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@fileverse-dev/fortune-core": "1.1.
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.1.79",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-21",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|