@fileverse-dev/fortune-react 1.1.77 → 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.
|
@@ -148,6 +148,33 @@ var ContextMenu = function ContextMenu() {
|
|
|
148
148
|
info = _b.info,
|
|
149
149
|
toolbar = _b.toolbar,
|
|
150
150
|
splitText = _b.splitText;
|
|
151
|
+
var addRowColRightAvobe = function addRowColRightAvobe(type, direction) {
|
|
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;
|
|
156
|
+
if (position == null) return;
|
|
157
|
+
var count = 1;
|
|
158
|
+
if (count < 1) return;
|
|
159
|
+
var insertRowColOp = {
|
|
160
|
+
type: type,
|
|
161
|
+
index: position,
|
|
162
|
+
count: count,
|
|
163
|
+
direction: direction,
|
|
164
|
+
id: context.currentSheetId
|
|
165
|
+
};
|
|
166
|
+
setContext(function (draftCtx) {
|
|
167
|
+
try {
|
|
168
|
+
insertRowCol(draftCtx, insertRowColOp);
|
|
169
|
+
draftCtx.contextMenu = {};
|
|
170
|
+
} catch (err) {
|
|
171
|
+
if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
|
|
172
|
+
draftCtx.contextMenu = {};
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
insertRowColOp: insertRowColOp
|
|
176
|
+
});
|
|
177
|
+
};
|
|
151
178
|
var getMenuElement = useCallback(function (name, i) {
|
|
152
179
|
var _a, _b, _c, _d;
|
|
153
180
|
var selection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
|
|
@@ -367,30 +394,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
367
394
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
368
395
|
key: "add-col-".concat(dir),
|
|
369
396
|
onClick: function onClick() {
|
|
370
|
-
|
|
371
|
-
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];
|
|
372
|
-
if (position == null) return;
|
|
373
|
-
var count = 1;
|
|
374
|
-
if (count < 1) return;
|
|
375
|
-
var direction = dir === "left" ? "lefttop" : "rightbottom";
|
|
376
|
-
var insertRowColOp = {
|
|
377
|
-
type: "column",
|
|
378
|
-
index: position,
|
|
379
|
-
count: count,
|
|
380
|
-
direction: direction,
|
|
381
|
-
id: context.currentSheetId
|
|
382
|
-
};
|
|
383
|
-
setContext(function (draftCtx) {
|
|
384
|
-
try {
|
|
385
|
-
insertRowCol(draftCtx, insertRowColOp);
|
|
386
|
-
draftCtx.contextMenu = {};
|
|
387
|
-
} catch (err) {
|
|
388
|
-
if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
|
|
389
|
-
draftCtx.contextMenu = {};
|
|
390
|
-
}
|
|
391
|
-
}, {
|
|
392
|
-
insertRowColOp: insertRowColOp
|
|
393
|
-
});
|
|
397
|
+
addRowColRightAvobe("column", "lefttop");
|
|
394
398
|
}
|
|
395
399
|
}, /*#__PURE__*/React.createElement("div", {
|
|
396
400
|
className: "context-item"
|
|
@@ -404,30 +408,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
404
408
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
405
409
|
key: "add-col-".concat(dir),
|
|
406
410
|
onClick: function onClick() {
|
|
407
|
-
|
|
408
|
-
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];
|
|
409
|
-
if (position == null) return;
|
|
410
|
-
var count = 1;
|
|
411
|
-
if (count < 1) return;
|
|
412
|
-
var direction = "rightbottom";
|
|
413
|
-
var insertRowColOp = {
|
|
414
|
-
type: "column",
|
|
415
|
-
index: position,
|
|
416
|
-
count: count,
|
|
417
|
-
direction: direction,
|
|
418
|
-
id: context.currentSheetId
|
|
419
|
-
};
|
|
420
|
-
setContext(function (draftCtx) {
|
|
421
|
-
try {
|
|
422
|
-
insertRowCol(draftCtx, insertRowColOp);
|
|
423
|
-
draftCtx.contextMenu = {};
|
|
424
|
-
} catch (err) {
|
|
425
|
-
if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
|
|
426
|
-
draftCtx.contextMenu = {};
|
|
427
|
-
}
|
|
428
|
-
}, {
|
|
429
|
-
insertRowColOp: insertRowColOp
|
|
430
|
-
});
|
|
411
|
+
addRowColRightAvobe("column", "rightbottom");
|
|
431
412
|
}
|
|
432
413
|
}, /*#__PURE__*/React.createElement("div", {
|
|
433
414
|
className: "context-item"
|
|
@@ -441,30 +422,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
441
422
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
442
423
|
key: "add-row-".concat(dir),
|
|
443
424
|
onClick: function onClick() {
|
|
444
|
-
|
|
445
|
-
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];
|
|
446
|
-
if (position == null) return;
|
|
447
|
-
var count = 1;
|
|
448
|
-
if (count < 1) return;
|
|
449
|
-
var direction = dir === "top" ? "lefttop" : "rightbottom";
|
|
450
|
-
var insertRowColOp = {
|
|
451
|
-
type: "row",
|
|
452
|
-
index: position,
|
|
453
|
-
count: count,
|
|
454
|
-
direction: direction,
|
|
455
|
-
id: context.currentSheetId
|
|
456
|
-
};
|
|
457
|
-
setContext(function (draftCtx) {
|
|
458
|
-
try {
|
|
459
|
-
insertRowCol(draftCtx, insertRowColOp);
|
|
460
|
-
draftCtx.contextMenu = {};
|
|
461
|
-
} catch (err) {
|
|
462
|
-
if (err.message === "maxExceeded") showAlert(rightclick.rowOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnRowReadOnly, "ok");
|
|
463
|
-
draftCtx.contextMenu = {};
|
|
464
|
-
}
|
|
465
|
-
}, {
|
|
466
|
-
insertRowColOp: insertRowColOp
|
|
467
|
-
});
|
|
425
|
+
addRowColRightAvobe("row", "rightbottom");
|
|
468
426
|
}
|
|
469
427
|
}, /*#__PURE__*/React.createElement("div", {
|
|
470
428
|
className: "context-item"
|
|
@@ -478,30 +436,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
478
436
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
479
437
|
key: "add-row-".concat(dir),
|
|
480
438
|
onClick: function onClick() {
|
|
481
|
-
|
|
482
|
-
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];
|
|
483
|
-
if (position == null) return;
|
|
484
|
-
var count = 1;
|
|
485
|
-
if (count < 1) return;
|
|
486
|
-
var direction = "lefttop";
|
|
487
|
-
var insertRowColOp = {
|
|
488
|
-
type: "row",
|
|
489
|
-
index: position,
|
|
490
|
-
count: count,
|
|
491
|
-
direction: direction,
|
|
492
|
-
id: context.currentSheetId
|
|
493
|
-
};
|
|
494
|
-
setContext(function (draftCtx) {
|
|
495
|
-
try {
|
|
496
|
-
insertRowCol(draftCtx, insertRowColOp);
|
|
497
|
-
draftCtx.contextMenu = {};
|
|
498
|
-
} catch (err) {
|
|
499
|
-
if (err.message === "maxExceeded") showAlert(rightclick.rowOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnRowReadOnly, "ok");
|
|
500
|
-
draftCtx.contextMenu = {};
|
|
501
|
-
}
|
|
502
|
-
}, {
|
|
503
|
-
insertRowColOp: insertRowColOp
|
|
504
|
-
});
|
|
439
|
+
addRowColRightAvobe("row", "lefttop");
|
|
505
440
|
}
|
|
506
441
|
}, /*#__PURE__*/React.createElement("div", {
|
|
507
442
|
className: "context-item"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
.luckysheet-sheet-area {
|
|
2
2
|
width: 100%;
|
|
3
3
|
box-sizing: border-box;
|
|
4
|
-
/* background-color: #fafafc; */
|
|
5
4
|
color: #444;
|
|
6
5
|
height: 36px;
|
|
7
6
|
padding: 0 30px 0 44px;
|
|
@@ -195,7 +194,7 @@
|
|
|
195
194
|
justify-content: center;
|
|
196
195
|
height: 29px;
|
|
197
196
|
width: 29px;
|
|
198
|
-
background-color: var(--color-bg-secondary);
|
|
197
|
+
background-color: hsl(var(--color-bg-secondary)) !important;
|
|
199
198
|
}
|
|
200
199
|
|
|
201
200
|
.fortune-sheettab-button:hover {
|
|
@@ -157,6 +157,33 @@ var ContextMenu = function ContextMenu() {
|
|
|
157
157
|
info = _b.info,
|
|
158
158
|
toolbar = _b.toolbar,
|
|
159
159
|
splitText = _b.splitText;
|
|
160
|
+
var addRowColRightAvobe = function addRowColRightAvobe(type, direction) {
|
|
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;
|
|
165
|
+
if (position == null) return;
|
|
166
|
+
var count = 1;
|
|
167
|
+
if (count < 1) return;
|
|
168
|
+
var insertRowColOp = {
|
|
169
|
+
type: type,
|
|
170
|
+
index: position,
|
|
171
|
+
count: count,
|
|
172
|
+
direction: direction,
|
|
173
|
+
id: context.currentSheetId
|
|
174
|
+
};
|
|
175
|
+
setContext(function (draftCtx) {
|
|
176
|
+
try {
|
|
177
|
+
(0, _fortuneCore.insertRowCol)(draftCtx, insertRowColOp);
|
|
178
|
+
draftCtx.contextMenu = {};
|
|
179
|
+
} catch (err) {
|
|
180
|
+
if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
|
|
181
|
+
draftCtx.contextMenu = {};
|
|
182
|
+
}
|
|
183
|
+
}, {
|
|
184
|
+
insertRowColOp: insertRowColOp
|
|
185
|
+
});
|
|
186
|
+
};
|
|
160
187
|
var getMenuElement = (0, _react.useCallback)(function (name, i) {
|
|
161
188
|
var _a, _b, _c, _d;
|
|
162
189
|
var selection = (_a = context.luckysheet_select_save) === null || _a === void 0 ? void 0 : _a[0];
|
|
@@ -376,30 +403,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
376
403
|
return /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
377
404
|
key: "add-col-".concat(dir),
|
|
378
405
|
onClick: function onClick() {
|
|
379
|
-
|
|
380
|
-
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];
|
|
381
|
-
if (position == null) return;
|
|
382
|
-
var count = 1;
|
|
383
|
-
if (count < 1) return;
|
|
384
|
-
var direction = dir === "left" ? "lefttop" : "rightbottom";
|
|
385
|
-
var insertRowColOp = {
|
|
386
|
-
type: "column",
|
|
387
|
-
index: position,
|
|
388
|
-
count: count,
|
|
389
|
-
direction: direction,
|
|
390
|
-
id: context.currentSheetId
|
|
391
|
-
};
|
|
392
|
-
setContext(function (draftCtx) {
|
|
393
|
-
try {
|
|
394
|
-
(0, _fortuneCore.insertRowCol)(draftCtx, insertRowColOp);
|
|
395
|
-
draftCtx.contextMenu = {};
|
|
396
|
-
} catch (err) {
|
|
397
|
-
if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
|
|
398
|
-
draftCtx.contextMenu = {};
|
|
399
|
-
}
|
|
400
|
-
}, {
|
|
401
|
-
insertRowColOp: insertRowColOp
|
|
402
|
-
});
|
|
406
|
+
addRowColRightAvobe("column", "lefttop");
|
|
403
407
|
}
|
|
404
408
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
405
409
|
className: "context-item"
|
|
@@ -413,30 +417,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
413
417
|
return /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
414
418
|
key: "add-col-".concat(dir),
|
|
415
419
|
onClick: function onClick() {
|
|
416
|
-
|
|
417
|
-
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];
|
|
418
|
-
if (position == null) return;
|
|
419
|
-
var count = 1;
|
|
420
|
-
if (count < 1) return;
|
|
421
|
-
var direction = "rightbottom";
|
|
422
|
-
var insertRowColOp = {
|
|
423
|
-
type: "column",
|
|
424
|
-
index: position,
|
|
425
|
-
count: count,
|
|
426
|
-
direction: direction,
|
|
427
|
-
id: context.currentSheetId
|
|
428
|
-
};
|
|
429
|
-
setContext(function (draftCtx) {
|
|
430
|
-
try {
|
|
431
|
-
(0, _fortuneCore.insertRowCol)(draftCtx, insertRowColOp);
|
|
432
|
-
draftCtx.contextMenu = {};
|
|
433
|
-
} catch (err) {
|
|
434
|
-
if (err.message === "maxExceeded") showAlert(rightclick.columnOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnColumnReadOnly, "ok");
|
|
435
|
-
draftCtx.contextMenu = {};
|
|
436
|
-
}
|
|
437
|
-
}, {
|
|
438
|
-
insertRowColOp: insertRowColOp
|
|
439
|
-
});
|
|
420
|
+
addRowColRightAvobe("column", "rightbottom");
|
|
440
421
|
}
|
|
441
422
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
442
423
|
className: "context-item"
|
|
@@ -450,30 +431,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
450
431
|
return /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
451
432
|
key: "add-row-".concat(dir),
|
|
452
433
|
onClick: function onClick() {
|
|
453
|
-
|
|
454
|
-
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];
|
|
455
|
-
if (position == null) return;
|
|
456
|
-
var count = 1;
|
|
457
|
-
if (count < 1) return;
|
|
458
|
-
var direction = dir === "top" ? "lefttop" : "rightbottom";
|
|
459
|
-
var insertRowColOp = {
|
|
460
|
-
type: "row",
|
|
461
|
-
index: position,
|
|
462
|
-
count: count,
|
|
463
|
-
direction: direction,
|
|
464
|
-
id: context.currentSheetId
|
|
465
|
-
};
|
|
466
|
-
setContext(function (draftCtx) {
|
|
467
|
-
try {
|
|
468
|
-
(0, _fortuneCore.insertRowCol)(draftCtx, insertRowColOp);
|
|
469
|
-
draftCtx.contextMenu = {};
|
|
470
|
-
} catch (err) {
|
|
471
|
-
if (err.message === "maxExceeded") showAlert(rightclick.rowOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnRowReadOnly, "ok");
|
|
472
|
-
draftCtx.contextMenu = {};
|
|
473
|
-
}
|
|
474
|
-
}, {
|
|
475
|
-
insertRowColOp: insertRowColOp
|
|
476
|
-
});
|
|
434
|
+
addRowColRightAvobe("row", "rightbottom");
|
|
477
435
|
}
|
|
478
436
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
479
437
|
className: "context-item"
|
|
@@ -487,30 +445,7 @@ var ContextMenu = function ContextMenu() {
|
|
|
487
445
|
return /*#__PURE__*/_react.default.createElement(_Menu.default, {
|
|
488
446
|
key: "add-row-".concat(dir),
|
|
489
447
|
onClick: function onClick() {
|
|
490
|
-
|
|
491
|
-
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];
|
|
492
|
-
if (position == null) return;
|
|
493
|
-
var count = 1;
|
|
494
|
-
if (count < 1) return;
|
|
495
|
-
var direction = "lefttop";
|
|
496
|
-
var insertRowColOp = {
|
|
497
|
-
type: "row",
|
|
498
|
-
index: position,
|
|
499
|
-
count: count,
|
|
500
|
-
direction: direction,
|
|
501
|
-
id: context.currentSheetId
|
|
502
|
-
};
|
|
503
|
-
setContext(function (draftCtx) {
|
|
504
|
-
try {
|
|
505
|
-
(0, _fortuneCore.insertRowCol)(draftCtx, insertRowColOp);
|
|
506
|
-
draftCtx.contextMenu = {};
|
|
507
|
-
} catch (err) {
|
|
508
|
-
if (err.message === "maxExceeded") showAlert(rightclick.rowOverLimit, "ok");else if (err.message === "readOnly") showAlert(rightclick.cannotInsertOnRowReadOnly, "ok");
|
|
509
|
-
draftCtx.contextMenu = {};
|
|
510
|
-
}
|
|
511
|
-
}, {
|
|
512
|
-
insertRowColOp: insertRowColOp
|
|
513
|
-
});
|
|
448
|
+
addRowColRightAvobe("row", "lefttop");
|
|
514
449
|
}
|
|
515
450
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
516
451
|
className: "context-item"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
.luckysheet-sheet-area {
|
|
2
2
|
width: 100%;
|
|
3
3
|
box-sizing: border-box;
|
|
4
|
-
/* background-color: #fafafc; */
|
|
5
4
|
color: #444;
|
|
6
5
|
height: 36px;
|
|
7
6
|
padding: 0 30px 0 44px;
|
|
@@ -195,7 +194,7 @@
|
|
|
195
194
|
justify-content: center;
|
|
196
195
|
height: 29px;
|
|
197
196
|
width: 29px;
|
|
198
|
-
background-color: var(--color-bg-secondary);
|
|
197
|
+
background-color: hsl(var(--color-bg-secondary)) !important;
|
|
199
198
|
}
|
|
200
199
|
|
|
201
200
|
.fortune-sheettab-button:hover {
|
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",
|