@fileverse-dev/fortune-react 1.0.2-mod-13 → 1.0.2-mod-15
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/components/Workbook/api.d.ts +1 -0
- package/dist/components/Workbook/index.d.ts +1 -0
- package/dist/index.css +16 -3
- package/dist/index.esm.css +16 -3
- package/dist/index.esm.js +177 -119
- package/dist/index.js +176 -118
- package/dist/index.umd.css +16 -3
- package/dist/index.umd.js +315 -837
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +2 -2
- package/package.json +2 -2
|
@@ -6,6 +6,7 @@ export declare function generateAPIs(context: Context, setContext: (recipe: (ctx
|
|
|
6
6
|
type?: keyof Cell;
|
|
7
7
|
}) => any;
|
|
8
8
|
onboardingActiveCell: (functionName: string) => void;
|
|
9
|
+
initializeComment: (row: number, column: number) => void;
|
|
9
10
|
setCellValue: (row: number, column: number, value: any, options?: api.CommonOptions & {
|
|
10
11
|
type?: keyof Cell;
|
|
11
12
|
}) => void;
|
|
@@ -13,6 +13,7 @@ declare const Workbook: React.ForwardRefExoticComponent<Settings & AdditionalPro
|
|
|
13
13
|
type?: "v" | "m" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "rt" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
|
|
14
14
|
}) => any;
|
|
15
15
|
onboardingActiveCell: (functionName: string) => void;
|
|
16
|
+
initializeComment: (row: number, column: number) => void;
|
|
16
17
|
setCellValue: (row: number, column: number, value: any, options?: import("@fileverse-dev/fortune-core/dist/api").CommonOptions & {
|
|
17
18
|
type?: "v" | "m" | "mc" | "f" | "ct" | "qp" | "spl" | "bg" | "lo" | "rt" | "ps" | "hl" | keyof import("@fileverse-dev/fortune-core").CellStyle | undefined;
|
|
18
19
|
}) => void;
|
package/dist/index.css
CHANGED
|
@@ -2980,8 +2980,8 @@ label {
|
|
|
2980
2980
|
box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.15);
|
|
2981
2981
|
transition: opacity 0.218s;
|
|
2982
2982
|
background: #fff;
|
|
2983
|
-
border: 1px solid #
|
|
2984
|
-
border: 1px solid
|
|
2983
|
+
border: 1px solid #E8EBEC;
|
|
2984
|
+
border: 1px solid #E8EBEC;
|
|
2985
2985
|
cursor: default;
|
|
2986
2986
|
font-size: 13px;
|
|
2987
2987
|
margin: 0;
|
|
@@ -2993,8 +2993,21 @@ label {
|
|
|
2993
2993
|
-webkit-user-select: none;
|
|
2994
2994
|
-moz-user-select: none;
|
|
2995
2995
|
user-select: none;
|
|
2996
|
+
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
2997
|
+
font-size: 14px;
|
|
2998
|
+
max-width: 250px;
|
|
2999
|
+
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1), 0px 1px 3px rgba(0, 0, 0, 0.08);
|
|
3000
|
+
color: #363B3F;
|
|
3001
|
+
line-height: 20px;
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
.context-item {
|
|
3005
|
+
display: flex;
|
|
3006
|
+
align-items: center;
|
|
3007
|
+
height: 20px;
|
|
2996
3008
|
}
|
|
2997
3009
|
|
|
3010
|
+
|
|
2998
3011
|
.fortune-context-menu input.luckysheet-mousedown-cancel {
|
|
2999
3012
|
width: 35px;
|
|
3000
3013
|
text-align: center;
|
|
@@ -3039,7 +3052,7 @@ label {
|
|
|
3039
3052
|
cursor: pointer;
|
|
3040
3053
|
list-style: none;
|
|
3041
3054
|
margin: 0;
|
|
3042
|
-
padding: 6px
|
|
3055
|
+
padding: 6px 10px 6px 10px !important;
|
|
3043
3056
|
white-space: nowrap;
|
|
3044
3057
|
-webkit-user-select: none;
|
|
3045
3058
|
-moz-user-select: none;
|
package/dist/index.esm.css
CHANGED
|
@@ -2980,8 +2980,8 @@ label {
|
|
|
2980
2980
|
box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.15);
|
|
2981
2981
|
transition: opacity 0.218s;
|
|
2982
2982
|
background: #fff;
|
|
2983
|
-
border: 1px solid #
|
|
2984
|
-
border: 1px solid
|
|
2983
|
+
border: 1px solid #E8EBEC;
|
|
2984
|
+
border: 1px solid #E8EBEC;
|
|
2985
2985
|
cursor: default;
|
|
2986
2986
|
font-size: 13px;
|
|
2987
2987
|
margin: 0;
|
|
@@ -2993,8 +2993,21 @@ label {
|
|
|
2993
2993
|
-webkit-user-select: none;
|
|
2994
2994
|
-moz-user-select: none;
|
|
2995
2995
|
user-select: none;
|
|
2996
|
+
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
2997
|
+
font-size: 14px;
|
|
2998
|
+
max-width: 250px;
|
|
2999
|
+
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1), 0px 1px 3px rgba(0, 0, 0, 0.08);
|
|
3000
|
+
color: #363B3F;
|
|
3001
|
+
line-height: 20px;
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
.context-item {
|
|
3005
|
+
display: flex;
|
|
3006
|
+
align-items: center;
|
|
3007
|
+
height: 20px;
|
|
2996
3008
|
}
|
|
2997
3009
|
|
|
3010
|
+
|
|
2998
3011
|
.fortune-context-menu input.luckysheet-mousedown-cancel {
|
|
2999
3012
|
width: 35px;
|
|
3000
3013
|
text-align: center;
|
|
@@ -3039,7 +3052,7 @@ label {
|
|
|
3039
3052
|
cursor: pointer;
|
|
3040
3053
|
list-style: none;
|
|
3041
3054
|
margin: 0;
|
|
3042
|
-
padding: 6px
|
|
3055
|
+
padding: 6px 10px 6px 10px !important;
|
|
3043
3056
|
white-space: nowrap;
|
|
3044
3057
|
-webkit-user-select: none;
|
|
3045
3058
|
-moz-user-select: none;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart,
|
|
1
|
+
import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, setCaretPosition, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, handleTextColor, handleTextBackground, getInlineStringNoStyle, rangeHightlightselected, updateCell, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, indexToColumnChar, sortSelection, handleCopy, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, jfrefreshgrid, handleLink, handlePasteByClick, deleteSheet, opToPatch, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, calcSelectionInfo, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePaste, groupValuesRefresh } from '@fileverse-dev/fortune-core';
|
|
2
2
|
import React, { useContext, useRef, useState, useMemo, useCallback, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
|
|
3
3
|
import produce, { applyPatches, enablePatches, produceWithPatches } from 'immer';
|
|
4
4
|
import _ from 'lodash';
|
|
@@ -2362,7 +2362,8 @@ var NotationBoxes = function NotationBoxes() {
|
|
|
2362
2362
|
var _useContext = useContext(WorkbookContext),
|
|
2363
2363
|
context = _useContext.context,
|
|
2364
2364
|
setContext = _useContext.setContext,
|
|
2365
|
-
refs = _useContext.refs
|
|
2365
|
+
refs = _useContext.refs,
|
|
2366
|
+
settings = _useContext.settings;
|
|
2366
2367
|
var flowdata = getFlowdata(context);
|
|
2367
2368
|
useEffect(function () {
|
|
2368
2369
|
if (flowdata) {
|
|
@@ -2390,8 +2391,8 @@ var NotationBoxes = function NotationBoxes() {
|
|
|
2390
2391
|
}, _.concat((_context$commentBoxes = context.commentBoxes) === null || _context$commentBoxes === void 0 ? void 0 : _context$commentBoxes.filter(function (v) {
|
|
2391
2392
|
var _context$editingComme;
|
|
2392
2393
|
return (v === null || v === void 0 ? void 0 : v.rc) !== ((_context$editingComme = context.editingCommentBox) === null || _context$editingComme === void 0 ? void 0 : _context$editingComme.rc);
|
|
2393
|
-
}), [context.editingCommentBox, context.hoveredCommentBox]).map(function (commentBox) {
|
|
2394
|
-
var _context$editingComme2;
|
|
2394
|
+
}), [context.editingCommentBox, context.hoveredCommentBox]).map(function (commentBox, index) {
|
|
2395
|
+
var _context$editingComme2, _settings$getCommentC;
|
|
2395
2396
|
if (!commentBox) return null;
|
|
2396
2397
|
var r = commentBox.r,
|
|
2397
2398
|
c = commentBox.c,
|
|
@@ -2406,7 +2407,7 @@ var NotationBoxes = function NotationBoxes() {
|
|
|
2406
2407
|
var isEditing = ((_context$editingComme2 = context.editingCommentBox) === null || _context$editingComme2 === void 0 ? void 0 : _context$editingComme2.rc) === rc;
|
|
2407
2408
|
var commentId = "comment-box-".concat(rc);
|
|
2408
2409
|
return /*#__PURE__*/React.createElement("div", {
|
|
2409
|
-
key: rc
|
|
2410
|
+
key: rc + index
|
|
2410
2411
|
}, /*#__PURE__*/React.createElement("canvas", {
|
|
2411
2412
|
id: "arrowCanvas-".concat(rc),
|
|
2412
2413
|
className: "arrowCanvas",
|
|
@@ -2450,72 +2451,12 @@ var NotationBoxes = function NotationBoxes() {
|
|
|
2450
2451
|
e.stopPropagation();
|
|
2451
2452
|
}
|
|
2452
2453
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2453
|
-
className: "luckysheet-postil-dialog-move"
|
|
2454
|
-
}, ["t", "r", "b", "l"].map(function (v) {
|
|
2455
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
2456
|
-
key: v,
|
|
2457
|
-
className: "luckysheet-postil-dialog-move-item luckysheet-postil-dialog-move-item-".concat(v),
|
|
2458
|
-
"data-type": v
|
|
2459
|
-
});
|
|
2460
|
-
})), isEditing && (/*#__PURE__*/React.createElement("div", {
|
|
2461
|
-
className: "luckysheet-postil-dialog-resize"
|
|
2462
|
-
}, ["lt", "mt", "lm", "rm", "rt", "lb", "mb", "rb"].map(function (v) {
|
|
2463
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
2464
|
-
key: v,
|
|
2465
|
-
className: "luckysheet-postil-dialog-resize-item luckysheet-postil-dialog-resize-item-".concat(v),
|
|
2466
|
-
"data-type": v,
|
|
2467
|
-
onMouseDown: function onMouseDown(e) {
|
|
2468
|
-
var nativeEvent = e.nativeEvent;
|
|
2469
|
-
onCommentBoxResizeStart(context, refs.globalCache, nativeEvent, {
|
|
2470
|
-
r: r,
|
|
2471
|
-
c: c,
|
|
2472
|
-
rc: rc
|
|
2473
|
-
}, commentId, v);
|
|
2474
|
-
e.stopPropagation();
|
|
2475
|
-
}
|
|
2476
|
-
});
|
|
2477
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
2478
2454
|
style: {
|
|
2479
2455
|
width: "100%",
|
|
2480
2456
|
height: "100%",
|
|
2481
2457
|
overflow: "hidden"
|
|
2482
2458
|
}
|
|
2483
|
-
},
|
|
2484
|
-
id: "comment-editor-".concat(rc),
|
|
2485
|
-
autoFocus: autoFocus,
|
|
2486
|
-
style: {
|
|
2487
|
-
width: "100%",
|
|
2488
|
-
height: "100%",
|
|
2489
|
-
lineHeight: "20px",
|
|
2490
|
-
boxSizing: "border-box",
|
|
2491
|
-
textAlign: "center",
|
|
2492
|
-
wordBreak: "break-all",
|
|
2493
|
-
outline: "none"
|
|
2494
|
-
},
|
|
2495
|
-
allowEdit: context.allowEdit,
|
|
2496
|
-
spellCheck: false,
|
|
2497
|
-
"data-r": r,
|
|
2498
|
-
"data-c": c,
|
|
2499
|
-
onKeyDown: function onKeyDown(e) {
|
|
2500
|
-
return e.stopPropagation();
|
|
2501
|
-
},
|
|
2502
|
-
onFocus: function onFocus(e) {
|
|
2503
|
-
if (context.allowEdit === false) return;
|
|
2504
|
-
refs.globalCache.editingCommentBoxEle = e.target;
|
|
2505
|
-
},
|
|
2506
|
-
onMouseDown: function onMouseDown(e) {
|
|
2507
|
-
setContext(function (draftContext) {
|
|
2508
|
-
if (flowdata) {
|
|
2509
|
-
setEditingComment(draftContext, flowdata, r, c);
|
|
2510
|
-
}
|
|
2511
|
-
});
|
|
2512
|
-
e.stopPropagation();
|
|
2513
|
-
},
|
|
2514
|
-
onDoubleClick: function onDoubleClick(e) {
|
|
2515
|
-
e.stopPropagation();
|
|
2516
|
-
},
|
|
2517
|
-
initialContent: value
|
|
2518
|
-
}))));
|
|
2459
|
+
}, (_settings$getCommentC = settings.getCommentCellUI) === null || _settings$getCommentC === void 0 ? void 0 : _settings$getCommentC.call(settings, r, c))));
|
|
2519
2460
|
}));
|
|
2520
2461
|
};
|
|
2521
2462
|
|
|
@@ -7607,6 +7548,27 @@ var ContextMenu = function ContextMenu() {
|
|
|
7607
7548
|
key: "divider-".concat(i)
|
|
7608
7549
|
});
|
|
7609
7550
|
}
|
|
7551
|
+
if (name === "comment") {
|
|
7552
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
7553
|
+
key: name,
|
|
7554
|
+
onClick: function onClick() {
|
|
7555
|
+
setContext(function (draftCtx) {
|
|
7556
|
+
newComment(draftCtx, refs.globalCache, selection === null || selection === void 0 ? void 0 : selection.row_focus, selection === null || selection === void 0 ? void 0 : selection.column_focus);
|
|
7557
|
+
draftCtx.contextMenu = {};
|
|
7558
|
+
});
|
|
7559
|
+
}
|
|
7560
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7561
|
+
className: "context-item"
|
|
7562
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7563
|
+
name: "comment-flv",
|
|
7564
|
+
width: 18,
|
|
7565
|
+
height: 18,
|
|
7566
|
+
style: {
|
|
7567
|
+
marginTop: "4px",
|
|
7568
|
+
marginRight: "4px"
|
|
7569
|
+
}
|
|
7570
|
+
}), /*#__PURE__*/React.createElement("p", null, "Comment")));
|
|
7571
|
+
}
|
|
7610
7572
|
if (name === "copy") {
|
|
7611
7573
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
7612
7574
|
key: name,
|
|
@@ -7622,7 +7584,16 @@ var ContextMenu = function ContextMenu() {
|
|
|
7622
7584
|
draftCtx.contextMenu = {};
|
|
7623
7585
|
});
|
|
7624
7586
|
}
|
|
7625
|
-
},
|
|
7587
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7588
|
+
className: "context-item"
|
|
7589
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7590
|
+
name: "copy-flv",
|
|
7591
|
+
width: 22,
|
|
7592
|
+
height: 22,
|
|
7593
|
+
style: {
|
|
7594
|
+
marginTop: "4px"
|
|
7595
|
+
}
|
|
7596
|
+
}), /*#__PURE__*/React.createElement("p", null, rightclick.copy)));
|
|
7626
7597
|
}
|
|
7627
7598
|
if (name === "paste" && regeneratorRuntime) {
|
|
7628
7599
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
@@ -7652,7 +7623,16 @@ var ContextMenu = function ContextMenu() {
|
|
|
7652
7623
|
}
|
|
7653
7624
|
return onClick;
|
|
7654
7625
|
}()
|
|
7655
|
-
},
|
|
7626
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7627
|
+
className: "context-item"
|
|
7628
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7629
|
+
name: "paste-flv",
|
|
7630
|
+
width: 16,
|
|
7631
|
+
height: 16,
|
|
7632
|
+
style: {
|
|
7633
|
+
marginRight: "8px"
|
|
7634
|
+
}
|
|
7635
|
+
}), /*#__PURE__*/React.createElement("p", null, rightclick.paste)));
|
|
7656
7636
|
}
|
|
7657
7637
|
if (name === "insert-column") {
|
|
7658
7638
|
return (selection === null || selection === void 0 ? void 0 : selection.row_select) ? null : ["left", "right"].map(function (dir) {
|
|
@@ -7660,13 +7640,10 @@ var ContextMenu = function ContextMenu() {
|
|
|
7660
7640
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
7661
7641
|
key: "add-col-".concat(dir),
|
|
7662
7642
|
onClick: function onClick(e) {
|
|
7663
|
-
var _context$luckysheet_s2, _context$luckysheet_s3, _context$luckysheet_s4
|
|
7643
|
+
var _context$luckysheet_s2, _context$luckysheet_s3, _context$luckysheet_s4;
|
|
7664
7644
|
var position = (_context$luckysheet_s2 = context.luckysheet_select_save) === null || _context$luckysheet_s2 === void 0 ? void 0 : (_context$luckysheet_s3 = _context$luckysheet_s2[0]) === null || _context$luckysheet_s3 === void 0 ? void 0 : (_context$luckysheet_s4 = _context$luckysheet_s3.column) === null || _context$luckysheet_s4 === void 0 ? void 0 : _context$luckysheet_s4[0];
|
|
7665
7645
|
if (position == null) return;
|
|
7666
|
-
var
|
|
7667
|
-
if (countStr == null) return;
|
|
7668
|
-
var count = parseInt(countStr, 10);
|
|
7669
|
-
if (count < 1) return;
|
|
7646
|
+
var count = 1;
|
|
7670
7647
|
var direction = dir === "left" ? "lefttop" : "rightbottom";
|
|
7671
7648
|
var insertRowColOp = {
|
|
7672
7649
|
type: "column",
|
|
@@ -7687,23 +7664,20 @@ var ContextMenu = function ContextMenu() {
|
|
|
7687
7664
|
insertRowColOp: insertRowColOp
|
|
7688
7665
|
});
|
|
7689
7666
|
}
|
|
7690
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
7667
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7668
|
+
name: "insert-flv",
|
|
7669
|
+
width: 18,
|
|
7670
|
+
height: 18,
|
|
7671
|
+
style: {
|
|
7672
|
+
marginRight: "8px",
|
|
7673
|
+
position: "relative",
|
|
7674
|
+
top: "3px"
|
|
7675
|
+
}
|
|
7676
|
+
}), _.startsWith((_context$lang = context.lang) !== null && _context$lang !== void 0 ? _context$lang : "", "zh") && (/*#__PURE__*/React.createElement(React.Fragment, null, rightclick.to, /*#__PURE__*/React.createElement("span", {
|
|
7691
7677
|
className: "luckysheet-cols-rows-shift-".concat(dir)
|
|
7692
|
-
}, rightclick[dir]))), "".concat(rightclick.insert, " "), /*#__PURE__*/React.createElement("
|
|
7693
|
-
onClick: function onClick(e) {
|
|
7694
|
-
return e.stopPropagation();
|
|
7695
|
-
},
|
|
7696
|
-
onKeyDown: function onKeyDown(e) {
|
|
7697
|
-
return e.stopPropagation();
|
|
7698
|
-
},
|
|
7699
|
-
tabIndex: 0,
|
|
7700
|
-
type: "text",
|
|
7701
|
-
className: "luckysheet-mousedown-cancel",
|
|
7702
|
-
placeholder: rightclick.number,
|
|
7703
|
-
defaultValue: "1"
|
|
7704
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
7678
|
+
}, rightclick[dir]))), "".concat(rightclick.insert, " "), "1", /*#__PURE__*/React.createElement("span", {
|
|
7705
7679
|
className: "luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel"
|
|
7706
|
-
}, "".concat(rightclick.column, " ")), !_.startsWith((_context$lang2 = context.lang) !== null && _context$lang2 !== void 0 ? _context$lang2 : "", "zh") && (/*#__PURE__*/React.createElement("span", {
|
|
7680
|
+
}, " ".concat(rightclick.column, " ")), !_.startsWith((_context$lang2 = context.lang) !== null && _context$lang2 !== void 0 ? _context$lang2 : "", "zh") && (/*#__PURE__*/React.createElement("span", {
|
|
7707
7681
|
className: "luckysheet-cols-rows-shift-".concat(dir)
|
|
7708
7682
|
}, rightclick[dir]))));
|
|
7709
7683
|
});
|
|
@@ -7714,13 +7688,10 @@ var ContextMenu = function ContextMenu() {
|
|
|
7714
7688
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
7715
7689
|
key: "add-row-".concat(dir),
|
|
7716
7690
|
onClick: function onClick(e, container) {
|
|
7717
|
-
var _context$luckysheet_s5, _context$luckysheet_s6, _context$luckysheet_s7
|
|
7691
|
+
var _context$luckysheet_s5, _context$luckysheet_s6, _context$luckysheet_s7;
|
|
7718
7692
|
var position = (_context$luckysheet_s5 = context.luckysheet_select_save) === null || _context$luckysheet_s5 === void 0 ? void 0 : (_context$luckysheet_s6 = _context$luckysheet_s5[0]) === null || _context$luckysheet_s6 === void 0 ? void 0 : (_context$luckysheet_s7 = _context$luckysheet_s6.row) === null || _context$luckysheet_s7 === void 0 ? void 0 : _context$luckysheet_s7[0];
|
|
7719
7693
|
if (position == null) return;
|
|
7720
|
-
var
|
|
7721
|
-
if (countStr == null) return;
|
|
7722
|
-
var count = parseInt(countStr, 10);
|
|
7723
|
-
if (count < 1) return;
|
|
7694
|
+
var count = 1;
|
|
7724
7695
|
var direction = dir === "top" ? "lefttop" : "rightbottom";
|
|
7725
7696
|
var insertRowColOp = {
|
|
7726
7697
|
type: "row",
|
|
@@ -7741,23 +7712,20 @@ var ContextMenu = function ContextMenu() {
|
|
|
7741
7712
|
insertRowColOp: insertRowColOp
|
|
7742
7713
|
});
|
|
7743
7714
|
}
|
|
7744
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
7715
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7716
|
+
name: "insert-flv",
|
|
7717
|
+
width: 18,
|
|
7718
|
+
height: 18,
|
|
7719
|
+
style: {
|
|
7720
|
+
marginRight: "8px",
|
|
7721
|
+
position: "relative",
|
|
7722
|
+
top: "3px"
|
|
7723
|
+
}
|
|
7724
|
+
}), _.startsWith((_context$lang3 = context.lang) !== null && _context$lang3 !== void 0 ? _context$lang3 : "", "zh") && (/*#__PURE__*/React.createElement(React.Fragment, null, rightclick.to, /*#__PURE__*/React.createElement("span", {
|
|
7745
7725
|
className: "luckysheet-cols-rows-shift-".concat(dir)
|
|
7746
|
-
}, rightclick[dir]))), "".concat(rightclick.insert, " "), /*#__PURE__*/React.createElement("
|
|
7747
|
-
onClick: function onClick(e) {
|
|
7748
|
-
return e.stopPropagation();
|
|
7749
|
-
},
|
|
7750
|
-
onKeyDown: function onKeyDown(e) {
|
|
7751
|
-
return e.stopPropagation();
|
|
7752
|
-
},
|
|
7753
|
-
tabIndex: 0,
|
|
7754
|
-
type: "text",
|
|
7755
|
-
className: "luckysheet-mousedown-cancel",
|
|
7756
|
-
placeholder: rightclick.number,
|
|
7757
|
-
defaultValue: "1"
|
|
7758
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
7726
|
+
}, rightclick[dir]))), "".concat(rightclick.insert, " "), "1", /*#__PURE__*/React.createElement("span", {
|
|
7759
7727
|
className: "luckysheet-cols-rows-shift-word luckysheet-mousedown-cancel"
|
|
7760
|
-
}, "".concat(rightclick.row, " ")), !_.startsWith((_context$lang4 = context.lang) !== null && _context$lang4 !== void 0 ? _context$lang4 : "", "zh") && (/*#__PURE__*/React.createElement("span", {
|
|
7728
|
+
}, " ".concat(rightclick.row, " ")), !_.startsWith((_context$lang4 = context.lang) !== null && _context$lang4 !== void 0 ? _context$lang4 : "", "zh") && (/*#__PURE__*/React.createElement("span", {
|
|
7761
7729
|
className: "luckysheet-cols-rows-shift-".concat(dir)
|
|
7762
7730
|
}, rightclick[dir]))));
|
|
7763
7731
|
});
|
|
@@ -7900,8 +7868,8 @@ var ContextMenu = function ContextMenu() {
|
|
|
7900
7868
|
})) ? (/*#__PURE__*/React.createElement(Menu, {
|
|
7901
7869
|
key: "set-row-height",
|
|
7902
7870
|
onClick: function onClick(e, container) {
|
|
7903
|
-
var _container$
|
|
7904
|
-
var targetRowHeight = (_container$
|
|
7871
|
+
var _container$querySelec;
|
|
7872
|
+
var targetRowHeight = (_container$querySelec = container.querySelector("input")) === null || _container$querySelec === void 0 ? void 0 : _container$querySelec.value;
|
|
7905
7873
|
setContext(function (draftCtx) {
|
|
7906
7874
|
if (_.isUndefined(targetRowHeight) || targetRowHeight === "" || parseInt(targetRowHeight, 10) <= 0 || parseInt(targetRowHeight, 10) > 545) {
|
|
7907
7875
|
showAlert(info.tipRowHeightLimit, "ok");
|
|
@@ -7949,8 +7917,8 @@ var ContextMenu = function ContextMenu() {
|
|
|
7949
7917
|
})) ? (/*#__PURE__*/React.createElement(Menu, {
|
|
7950
7918
|
key: "set-column-width",
|
|
7951
7919
|
onClick: function onClick(e, container) {
|
|
7952
|
-
var _container$
|
|
7953
|
-
var targetColWidth = (_container$
|
|
7920
|
+
var _container$querySelec2;
|
|
7921
|
+
var targetColWidth = (_container$querySelec2 = container.querySelector("input")) === null || _container$querySelec2 === void 0 ? void 0 : _container$querySelec2.value;
|
|
7954
7922
|
setContext(function (draftCtx) {
|
|
7955
7923
|
if (_.isUndefined(targetColWidth) || targetColWidth === "" || parseInt(targetColWidth, 10) <= 0 || parseInt(targetColWidth, 10) > 2038) {
|
|
7956
7924
|
showAlert(info.tipColumnWidthLimit, "ok");
|
|
@@ -8010,7 +7978,16 @@ var ContextMenu = function ContextMenu() {
|
|
|
8010
7978
|
jfrefreshgrid(draftCtx, null, undefined);
|
|
8011
7979
|
});
|
|
8012
7980
|
}
|
|
8013
|
-
},
|
|
7981
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7982
|
+
className: "context-item"
|
|
7983
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
7984
|
+
name: "clear-flv",
|
|
7985
|
+
width: 18,
|
|
7986
|
+
height: 18,
|
|
7987
|
+
style: {
|
|
7988
|
+
marginRight: "8px"
|
|
7989
|
+
}
|
|
7990
|
+
}), /*#__PURE__*/React.createElement("p", null, rightclick.clearContent)));
|
|
8014
7991
|
}
|
|
8015
7992
|
if (name === "orderAZ") {
|
|
8016
7993
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
@@ -9625,13 +9602,89 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9625
9602
|
d: "M163.396608 289.168384c-40.577024 0-66.526208 54.183936-35.44064 85.25824L477.217792 723.704832c20.031488 20.031488 49.82272 20.031488 69.853184 0l349.274112-349.278208c30.30528-30.294016 6.677504-85.25824-34.927616-85.25824L163.396608 289.168384z",
|
|
9626
9603
|
"p-id": "2683"
|
|
9627
9604
|
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9605
|
+
id: "headDownArrow",
|
|
9606
|
+
viewBox: "0 0 14 14"
|
|
9607
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
9608
|
+
width: "14",
|
|
9609
|
+
height: "14",
|
|
9610
|
+
rx: "4",
|
|
9611
|
+
fill: "black",
|
|
9612
|
+
"fill-opacity": "0.1"
|
|
9613
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
9614
|
+
d: "M6.64653 8.97978L3.7703 6.10355C3.45532 5.78857 3.6784 5.25 4.12385 5.25H9.87631C10.3218 5.25 10.5448 5.78857 10.2299 6.10355L7.35363 8.97978C7.15837 9.17504 6.84179 9.17504 6.64653 8.97978Z",
|
|
9615
|
+
fill: "#363B3F"
|
|
9634
9616
|
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9617
|
+
id: "copy-flv",
|
|
9618
|
+
viewBox: "0 0 24 24"
|
|
9619
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
9620
|
+
width: "24",
|
|
9621
|
+
viewBox: "0 0 24 24",
|
|
9622
|
+
fill: "none",
|
|
9623
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9624
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
9625
|
+
"clip-path": "url(#clip0_1714_87221)"
|
|
9626
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
9627
|
+
d: "M2.25 3C2.25 2.58921 2.58921 2.25 3 2.25H10.5C10.9108 2.25 11.25 2.58921 11.25 3C11.25 3.41421 11.5858 3.75 12 3.75C12.4142 3.75 12.75 3.41421 12.75 3C12.75 1.76079 11.7392 0.75 10.5 0.75H3C1.76079 0.75 0.75 1.76079 0.75 3V10.5C0.75 11.7392 1.76079 12.75 3 12.75C3.41421 12.75 3.75 12.4142 3.75 12C3.75 11.5858 3.41421 11.25 3 11.25C2.58921 11.25 2.25 10.9108 2.25 10.5V3Z",
|
|
9628
|
+
fill: "#363B3F"
|
|
9629
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
9630
|
+
"fill-rule": "evenodd",
|
|
9631
|
+
"clip-rule": "evenodd",
|
|
9632
|
+
d: "M7.5 5.25C6.25736 5.25 5.25 6.25736 5.25 7.5V15C5.25 16.2426 6.25736 17.25 7.5 17.25H15C16.2426 17.25 17.25 16.2426 17.25 15V7.5C17.25 6.25736 16.2426 5.25 15 5.25H7.5ZM6.75 7.5C6.75 7.08579 7.08579 6.75 7.5 6.75H15C15.4142 6.75 15.75 7.08579 15.75 7.5V15C15.75 15.4142 15.4142 15.75 15 15.75H7.5C7.08579 15.75 6.75 15.4142 6.75 15V7.5Z",
|
|
9633
|
+
fill: "#363B3F"
|
|
9634
|
+
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
9635
|
+
id: "clip0_1714_87221"
|
|
9636
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
9637
|
+
width: "24",
|
|
9638
|
+
height: "24",
|
|
9639
|
+
fill: "white"
|
|
9640
|
+
}))))), /*#__PURE__*/React.createElement("symbol", {
|
|
9641
|
+
id: "paste-flv",
|
|
9642
|
+
viewBox: "0 0 24 24"
|
|
9643
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
9644
|
+
viewBox: "0 0 18 18",
|
|
9645
|
+
fill: "none",
|
|
9646
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9647
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
9648
|
+
"fill-rule": "evenodd",
|
|
9649
|
+
"clip-rule": "evenodd",
|
|
9650
|
+
d: "M6.75 0.75C5.92157 0.75 5.25 1.42157 5.25 2.25H4.5C3.90326 2.25 3.33097 2.48705 2.90901 2.90901C2.48705 3.33097 2.25 3.90326 2.25 4.5V15C2.25 15.5967 2.48705 16.169 2.90901 16.591C3.33097 17.0129 3.90326 17.25 4.5 17.25H13.5C14.0967 17.25 14.669 17.0129 15.091 16.591C15.5129 16.169 15.75 15.5967 15.75 15V4.5C15.75 3.90326 15.5129 3.33097 15.091 2.90901C14.669 2.48705 14.0967 2.25 13.5 2.25H12.75C12.75 1.42157 12.0784 0.75 11.25 0.75H6.75ZM12.75 3.75C12.75 4.57843 12.0784 5.25 11.25 5.25H6.75C5.92157 5.25 5.25 4.57843 5.25 3.75H4.5C4.30109 3.75 4.11032 3.82902 3.96967 3.96967C3.82902 4.11032 3.75 4.30109 3.75 4.5V15C3.75 15.1989 3.82902 15.3897 3.96967 15.5303C4.11032 15.671 4.30109 15.75 4.5 15.75H13.5C13.6989 15.75 13.8897 15.671 14.0303 15.5303C14.171 15.3897 14.25 15.1989 14.25 15V4.5C14.25 4.30109 14.171 4.11032 14.0303 3.96967C13.8897 3.82902 13.6989 3.75 13.5 3.75H12.75ZM6.75 3.75H11.25V2.25H6.75V3.75Z",
|
|
9651
|
+
fill: "#363B3F"
|
|
9652
|
+
}))), /*#__PURE__*/React.createElement("symbol", {
|
|
9653
|
+
id: "insert-flv",
|
|
9654
|
+
viewBox: "0 0 24 24"
|
|
9655
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
9656
|
+
viewBox: "0 0 18 18",
|
|
9657
|
+
fill: "none",
|
|
9658
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9659
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
9660
|
+
d: "M9.75 3.75C9.75 3.33579 9.41421 3 9 3C8.58579 3 8.25 3.33579 8.25 3.75V8.25H3.75C3.33579 8.25 3 8.58579 3 9C3 9.41421 3.33579 9.75 3.75 9.75H8.25V14.25C8.25 14.6642 8.58579 15 9 15C9.41421 15 9.75 14.6642 9.75 14.25V9.75H14.25C14.6642 9.75 15 9.41421 15 9C15 8.58579 14.6642 8.25 14.25 8.25H9.75V3.75Z",
|
|
9661
|
+
fill: "#363B3F"
|
|
9662
|
+
}))), /*#__PURE__*/React.createElement("symbol", {
|
|
9663
|
+
id: "clear-flv",
|
|
9664
|
+
viewBox: "0 0 24 24"
|
|
9665
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
9666
|
+
viewBox: "0 0 18 18",
|
|
9667
|
+
fill: "none",
|
|
9668
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9669
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
9670
|
+
d: "M8.69336 2.24495C9.7149 1.2235 11.3274 1.1765 12.3164 2.25764L16.5039 6.44514C17.525 7.46664 17.572 9.07929 16.4912 10.0682L11.5586 14.9998H16.498C16.9122 14.9998 17.2479 15.3357 17.248 15.7498C17.248 16.164 16.9123 16.4998 16.498 16.4998H5.24804L5.17187 16.4959C5.11573 16.4902 5.06253 16.4752 5.01074 16.4578C4.99425 16.4523 4.97708 16.4489 4.96093 16.4422C4.93739 16.4324 4.91581 16.4191 4.89355 16.4071C4.83108 16.3733 4.77055 16.3329 4.71777 16.2801L1.49316 13.0555C0.47162 12.034 0.424681 10.4205 1.50586 9.43147L8.69336 2.24495ZM2.55371 10.5057C2.54459 10.5148 2.53497 10.5234 2.52539 10.5321C2.12282 10.8944 2.08021 11.5214 2.55371 11.9949L5.55859 14.9998H9.4375L3.74804 9.31037L2.55371 10.5057ZM11.2158 3.27717C10.8535 2.87463 10.2274 2.83209 9.7539 3.30549L4.80859 8.24983L10.498 13.9393L15.4434 8.99495C15.4526 8.98568 15.4619 8.97637 15.4717 8.9676C15.8741 8.60538 15.9164 7.97912 15.4434 7.50569L11.2432 3.30549C11.2339 3.29628 11.2245 3.28686 11.2158 3.27717Z",
|
|
9671
|
+
fill: "#363B3F"
|
|
9672
|
+
}))), /*#__PURE__*/React.createElement("symbol", {
|
|
9673
|
+
id: "comment-flv",
|
|
9674
|
+
viewBox: "0 0 24 24"
|
|
9675
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
9676
|
+
viewBox: "0 0 18 18",
|
|
9677
|
+
fill: "none",
|
|
9678
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9679
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
9680
|
+
d: "M9 4.5C9.41421 4.5 9.75 4.83579 9.75 5.25V6.75H11.25C11.6642 6.75 12 7.08579 12 7.5C12 7.91421 11.6642 8.25 11.25 8.25H9.75V9.75C9.75 10.1642 9.41421 10.5 9 10.5C8.58579 10.5 8.25 10.1642 8.25 9.75V8.25H6.75C6.33579 8.25 6 7.91421 6 7.5C6 7.08579 6.33579 6.75 6.75 6.75H8.25V5.25C8.25 4.83579 8.58579 4.5 9 4.5Z",
|
|
9681
|
+
fill: "#363B3F"
|
|
9682
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
9683
|
+
"fill-rule": "evenodd",
|
|
9684
|
+
"clip-rule": "evenodd",
|
|
9685
|
+
d: "M3.75 1.5C3.15326 1.5 2.58097 1.73705 2.15901 2.15901C1.73705 2.58097 1.5 3.15326 1.5 3.75V15.75C1.5 16.0533 1.68273 16.3268 1.96299 16.4429C2.24324 16.559 2.56583 16.4948 2.78033 16.2803L5.56066 13.5H14.25C14.8467 13.5 15.419 13.2629 15.841 12.841C16.2629 12.419 16.5 11.8467 16.5 11.25V3.75C16.5 3.15326 16.2629 2.58097 15.841 2.15901C15.419 1.73705 14.8467 1.5 14.25 1.5H3.75ZM3.21967 3.21967C3.36032 3.07902 3.55109 3 3.75 3H14.25C14.4489 3 14.6397 3.07902 14.7803 3.21967C14.921 3.36032 15 3.55109 15 3.75V11.25C15 11.4489 14.921 11.6397 14.7803 11.7803C14.6397 11.921 14.4489 12 14.25 12H5.25C5.05109 12 4.86032 12.079 4.71967 12.2197L3 13.9393V3.75C3 3.55109 3.07902 3.36032 3.21967 3.21967Z",
|
|
9686
|
+
fill: "#363B3F"
|
|
9687
|
+
}))), /*#__PURE__*/React.createElement("symbol", {
|
|
9635
9688
|
viewBox: "0 0 1024 1024",
|
|
9636
9689
|
id: "tab"
|
|
9637
9690
|
}, /*#__PURE__*/React.createElement("path", {
|
|
@@ -10038,6 +10091,11 @@ function generateAPIs(context, setContext, handleUndo, handleRedo, settings, cel
|
|
|
10038
10091
|
}
|
|
10039
10092
|
});
|
|
10040
10093
|
},
|
|
10094
|
+
initializeComment: function initializeComment(row, column) {
|
|
10095
|
+
setContext(function (ctx) {
|
|
10096
|
+
newComment(ctx, undefined, row, column);
|
|
10097
|
+
});
|
|
10098
|
+
},
|
|
10041
10099
|
setCellValue: function setCellValue(row, column, value) {
|
|
10042
10100
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
10043
10101
|
return setContext(function (draftCtx) {
|