@leankylin-sheet/react 7.0.10 → 7.0.12
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/CustomFormat/index.d.ts +5 -0
- package/dist/index.css +57 -10
- package/dist/index.esm.css +57 -10
- package/dist/index.esm.js +77 -116
- package/dist/index.js +76 -115
- package/dist/index.umd.css +57 -10
- package/dist/index.umd.js +76 -115
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +3 -3
package/dist/index.css
CHANGED
|
@@ -3176,28 +3176,75 @@ label {
|
|
|
3176
3176
|
background-color: #fff;
|
|
3177
3177
|
border: 1px solid #ccc;
|
|
3178
3178
|
}
|
|
3179
|
-
|
|
3179
|
+
#leankylin-custom-format {
|
|
3180
|
+
width: 360px;
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
.custom-format-input-row {
|
|
3180
3184
|
display: flex;
|
|
3181
|
-
|
|
3185
|
+
align-items: center;
|
|
3182
3186
|
}
|
|
3183
3187
|
|
|
3184
|
-
.
|
|
3185
|
-
|
|
3188
|
+
.custom-format-label {
|
|
3189
|
+
flex-shrink: 0;
|
|
3186
3190
|
}
|
|
3187
3191
|
|
|
3188
|
-
.
|
|
3189
|
-
|
|
3192
|
+
.custom-format-input {
|
|
3193
|
+
flex: 1;
|
|
3194
|
+
height: 28px;
|
|
3195
|
+
padding: 0 8px;
|
|
3196
|
+
border: 1px solid #d4d4d4;
|
|
3197
|
+
border-radius: 2px;
|
|
3198
|
+
outline: none;
|
|
3190
3199
|
}
|
|
3191
3200
|
|
|
3201
|
+
.custom-format-input:focus {
|
|
3202
|
+
border-color: #1a73e8;
|
|
3203
|
+
}
|
|
3192
3204
|
|
|
3193
|
-
.format-
|
|
3194
|
-
|
|
3195
|
-
|
|
3205
|
+
.custom-format-error {
|
|
3206
|
+
margin-top: 6px;
|
|
3207
|
+
color: #d93025;
|
|
3208
|
+
font-size: 12px;
|
|
3209
|
+
line-height: 16px;
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
.custom-format-list {
|
|
3213
|
+
margin-top: 10px;
|
|
3196
3214
|
border: 1px solid #d4d4d4;
|
|
3197
|
-
|
|
3215
|
+
border-radius: 2px;
|
|
3216
|
+
font-size: 12px;
|
|
3198
3217
|
}
|
|
3199
3218
|
|
|
3219
|
+
.custom-format-list-header {
|
|
3220
|
+
background: #f5f6f7;
|
|
3221
|
+
font-weight: 600;
|
|
3222
|
+
cursor: default;
|
|
3223
|
+
}
|
|
3200
3224
|
|
|
3225
|
+
.custom-format-list-body {
|
|
3226
|
+
height: 180px;
|
|
3227
|
+
overflow-y: auto;
|
|
3228
|
+
}
|
|
3229
|
+
|
|
3230
|
+
.custom-format-list-row {
|
|
3231
|
+
display: flex;
|
|
3232
|
+
justify-content: space-between;
|
|
3233
|
+
padding: 4px 10px;
|
|
3234
|
+
cursor: pointer;
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
.custom-format-list-row > div:last-child {
|
|
3238
|
+
color: #888;
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
.custom-format-list-row:hover {
|
|
3242
|
+
background: #f0f4ff;
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3245
|
+
.custom-format-list-row.on {
|
|
3246
|
+
background: #e3edfd;
|
|
3247
|
+
}
|
|
3201
3248
|
|
|
3202
3249
|
.leankylin-fx-editor {
|
|
3203
3250
|
display: flex;
|
package/dist/index.esm.css
CHANGED
|
@@ -3176,28 +3176,75 @@ label {
|
|
|
3176
3176
|
background-color: #fff;
|
|
3177
3177
|
border: 1px solid #ccc;
|
|
3178
3178
|
}
|
|
3179
|
-
|
|
3179
|
+
#leankylin-custom-format {
|
|
3180
|
+
width: 360px;
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
.custom-format-input-row {
|
|
3180
3184
|
display: flex;
|
|
3181
|
-
|
|
3185
|
+
align-items: center;
|
|
3182
3186
|
}
|
|
3183
3187
|
|
|
3184
|
-
.
|
|
3185
|
-
|
|
3188
|
+
.custom-format-label {
|
|
3189
|
+
flex-shrink: 0;
|
|
3186
3190
|
}
|
|
3187
3191
|
|
|
3188
|
-
.
|
|
3189
|
-
|
|
3192
|
+
.custom-format-input {
|
|
3193
|
+
flex: 1;
|
|
3194
|
+
height: 28px;
|
|
3195
|
+
padding: 0 8px;
|
|
3196
|
+
border: 1px solid #d4d4d4;
|
|
3197
|
+
border-radius: 2px;
|
|
3198
|
+
outline: none;
|
|
3190
3199
|
}
|
|
3191
3200
|
|
|
3201
|
+
.custom-format-input:focus {
|
|
3202
|
+
border-color: #1a73e8;
|
|
3203
|
+
}
|
|
3192
3204
|
|
|
3193
|
-
.format-
|
|
3194
|
-
|
|
3195
|
-
|
|
3205
|
+
.custom-format-error {
|
|
3206
|
+
margin-top: 6px;
|
|
3207
|
+
color: #d93025;
|
|
3208
|
+
font-size: 12px;
|
|
3209
|
+
line-height: 16px;
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
.custom-format-list {
|
|
3213
|
+
margin-top: 10px;
|
|
3196
3214
|
border: 1px solid #d4d4d4;
|
|
3197
|
-
|
|
3215
|
+
border-radius: 2px;
|
|
3216
|
+
font-size: 12px;
|
|
3198
3217
|
}
|
|
3199
3218
|
|
|
3219
|
+
.custom-format-list-header {
|
|
3220
|
+
background: #f5f6f7;
|
|
3221
|
+
font-weight: 600;
|
|
3222
|
+
cursor: default;
|
|
3223
|
+
}
|
|
3200
3224
|
|
|
3225
|
+
.custom-format-list-body {
|
|
3226
|
+
height: 180px;
|
|
3227
|
+
overflow-y: auto;
|
|
3228
|
+
}
|
|
3229
|
+
|
|
3230
|
+
.custom-format-list-row {
|
|
3231
|
+
display: flex;
|
|
3232
|
+
justify-content: space-between;
|
|
3233
|
+
padding: 4px 10px;
|
|
3234
|
+
cursor: pointer;
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
.custom-format-list-row > div:last-child {
|
|
3238
|
+
color: #888;
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
.custom-format-list-row:hover {
|
|
3242
|
+
background: #f0f4ff;
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3245
|
+
.custom-format-list-row.on {
|
|
3246
|
+
background: #e3edfd;
|
|
3247
|
+
}
|
|
3201
3248
|
|
|
3202
3249
|
.leankylin-fx-editor {
|
|
3203
3250
|
display: flex;
|
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, functionHTMLGenerate, locale, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, isShowHidenCR, cancelNormalSelected, moveHighlightCell, updateCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, changeSheet, normalizeSelection, scrollToHighlightCell, chatatABC, getCellHyperlink, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, onCommentBoxResizeStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaMouseMove, handleCellAreaDragOver, handleCellDrop, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, PAINT_MODEL_CURSOR, onCellsMoveStart, createDropCellRange, handleDropCellDoubleClick, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, setCaretPosition, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem,
|
|
1
|
+
import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, functionHTMLGenerate, locale, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, isShowHidenCR, cancelNormalSelected, moveHighlightCell, updateCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, changeSheet, normalizeSelection, scrollToHighlightCell, chatatABC, getCellHyperlink, isLinkValid, getRangetxt, goToLink, replaceHtml, removeHyperlink, onRangeSelectionModalMoveStart, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, onCommentBoxResizeStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaMouseMove, handleCellAreaDragOver, handleCellDrop, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, PAINT_MODEL_CURSOR, onCellsMoveStart, createDropCellRange, handleDropCellDoubleClick, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, setCaretPosition, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, 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, getDataBySelectionNoCopy, getInlineStringNoStyle, rangeHightlightselected, editSheetName, setNextSheet, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, indexToColumnChar, sortSelection, handleCopy, insertRowCol, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, jfrefreshgrid, handleLink, deleteSheet, opToPatch, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, cancelActiveImgItem, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePasteByLeanklin, groupValuesRefresh } from '@leankylin-sheet/core';
|
|
2
2
|
import { useInViewport, useMemoizedFn, useThrottleFn } from 'ahooks';
|
|
3
3
|
import React, { useContext, useRef, useState, useMemo, useCallback, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
|
|
4
4
|
import produce, { applyPatches, enablePatches, produceWithPatches } from 'immer';
|
|
@@ -6493,64 +6493,59 @@ var CustomBorder = function CustomBorder(_ref) {
|
|
|
6493
6493
|
})))));
|
|
6494
6494
|
};
|
|
6495
6495
|
|
|
6496
|
-
var
|
|
6497
|
-
var
|
|
6498
|
-
_onCancel = _ref.onCancel;
|
|
6496
|
+
var CustomFormat = function CustomFormat(_ref) {
|
|
6497
|
+
var _onCancel = _ref.onCancel;
|
|
6499
6498
|
var _useContext = useContext(WorkbookContext),
|
|
6500
6499
|
context = _useContext.context,
|
|
6501
6500
|
setContext = _useContext.setContext,
|
|
6502
6501
|
cellInput = _useContext.refs.cellInput;
|
|
6503
|
-
var _useState = useState(
|
|
6502
|
+
var _useState = useState(function () {
|
|
6503
|
+
var _context$luckysheet_s, _flowdata$row;
|
|
6504
|
+
var flowdata = getFlowdata(context);
|
|
6505
|
+
var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
|
|
6506
|
+
var row = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
|
|
6507
|
+
var col = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
|
|
6508
|
+
var cell = flowdata != null && row != null && col != null ? (_flowdata$row = flowdata[row]) === null || _flowdata$row === void 0 ? void 0 : _flowdata$row[col] : undefined;
|
|
6509
|
+
var ct = cell == null ? undefined : normalizedCellAttr(cell, "ct");
|
|
6510
|
+
return (ct === null || ct === void 0 ? void 0 : ct.fa) != null && ct.fa !== "fmtOtherSelf" ? ct.fa : "#0.00";
|
|
6511
|
+
}),
|
|
6504
6512
|
_useState2 = _slicedToArray(_useState, 2),
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
var _useState3 = useState(0),
|
|
6508
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
6509
|
-
selectedFormatIndex = _useState4[0],
|
|
6510
|
-
setSelectedFormatIndex = _useState4[1];
|
|
6513
|
+
formatStr = _useState2[0],
|
|
6514
|
+
setFormatStr = _useState2[1];
|
|
6511
6515
|
var _locale = locale(context),
|
|
6512
6516
|
button = _locale.button,
|
|
6513
6517
|
format = _locale.format,
|
|
6514
|
-
|
|
6515
|
-
dateFmtList = _locale.dateFmtList;
|
|
6518
|
+
defaultFmt = _locale.defaultFmt;
|
|
6516
6519
|
var _useDialog = useDialog(),
|
|
6517
6520
|
showDialog = _useDialog.showDialog;
|
|
6518
|
-
var
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
}, [toolbarFormatAll, type]);
|
|
6528
|
-
var tips = _.get(format, type);
|
|
6521
|
+
var _useState3 = useState(""),
|
|
6522
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
6523
|
+
errorMsg = _useState4[0],
|
|
6524
|
+
setErrorMsg = _useState4[1];
|
|
6525
|
+
var presetFmtList = useMemo(function () {
|
|
6526
|
+
return defaultFmt.filter(function (v) {
|
|
6527
|
+
return v.value !== "split" && v.value !== "fmtOtherSelf";
|
|
6528
|
+
});
|
|
6529
|
+
}, [defaultFmt]);
|
|
6529
6530
|
var onConfirm = useCallback(function () {
|
|
6530
|
-
|
|
6531
|
+
var fmt = formatStr.trim();
|
|
6532
|
+
if (fmt === "" || fmt === "fmtOtherSelf") {
|
|
6531
6533
|
_onCancel();
|
|
6532
|
-
showDialog(format.
|
|
6534
|
+
showDialog(format.tipCustomFormat, "ok");
|
|
6533
6535
|
return;
|
|
6534
6536
|
}
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
for (var c = selection.column[0]; c <= selection.column[1]; c += 1) {
|
|
6542
|
-
var _ctx$luckysheetfile$i, _ctx$luckysheetfile$i2, _ctx$luckysheetfile$i3, _ctx$luckysheetfile$i4;
|
|
6543
|
-
if (((_ctx$luckysheetfile$i = ctx.luckysheetfile[index].data) === null || _ctx$luckysheetfile$i === void 0 ? void 0 : _ctx$luckysheetfile$i[r][c]) && ((_ctx$luckysheetfile$i2 = ctx.luckysheetfile[index].data) === null || _ctx$luckysheetfile$i2 === void 0 ? void 0 : (_ctx$luckysheetfile$i3 = _ctx$luckysheetfile$i2[r][c]) === null || _ctx$luckysheetfile$i3 === void 0 ? void 0 : (_ctx$luckysheetfile$i4 = _ctx$luckysheetfile$i3.ct) === null || _ctx$luckysheetfile$i4 === void 0 ? void 0 : _ctx$luckysheetfile$i4.t) === "n") {
|
|
6544
|
-
var zero = 0;
|
|
6545
|
-
ctx.luckysheetfile[index].data[r][c].ct.fa = "".concat(selectedFormat).concat(zero.toFixed(decimalPlace));
|
|
6546
|
-
ctx.luckysheetfile[index].data[r][c].m = update("".concat(selectedFormat).concat(zero.toFixed(decimalPlace)), ctx.luckysheetfile[index].data[r][c].v);
|
|
6547
|
-
}
|
|
6548
|
-
}
|
|
6549
|
-
}
|
|
6537
|
+
try {
|
|
6538
|
+
setContext(function (ctx) {
|
|
6539
|
+
var d = getFlowdata(ctx);
|
|
6540
|
+
if (d == null) return;
|
|
6541
|
+
updateFormat(ctx, cellInput.current, d, "ct", fmt);
|
|
6542
|
+
cancelNormalSelected(ctx);
|
|
6550
6543
|
});
|
|
6551
6544
|
_onCancel();
|
|
6552
|
-
})
|
|
6553
|
-
|
|
6545
|
+
} catch (error) {
|
|
6546
|
+
setErrorMsg(format.tipUnsupportedFormat);
|
|
6547
|
+
}
|
|
6548
|
+
}, [_onCancel, cellInput, format.tipCustomFormat, format.tipUnsupportedFormat, formatStr, setContext, showDialog]);
|
|
6554
6549
|
var onCancel = useCallback(function () {
|
|
6555
6550
|
setContext(function (ctx) {
|
|
6556
6551
|
cancelNormalSelected(ctx);
|
|
@@ -6560,50 +6555,48 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
6560
6555
|
});
|
|
6561
6556
|
_onCancel();
|
|
6562
6557
|
}, [_onCancel, cellInput, setContext]);
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
className: "listbox",
|
|
6567
|
-
style: {
|
|
6568
|
-
height: 200
|
|
6558
|
+
var onKeyDown = useCallback(function (e) {
|
|
6559
|
+
if (e.key === "Enter") {
|
|
6560
|
+
onConfirm();
|
|
6569
6561
|
}
|
|
6562
|
+
}, [onConfirm]);
|
|
6563
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6564
|
+
id: "leankylin-custom-format"
|
|
6570
6565
|
}, /*#__PURE__*/React.createElement("div", {
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
},
|
|
6575
|
-
className: "
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
display: "none"
|
|
6580
|
-
}
|
|
6581
|
-
}, format.decimalPlaces, "\uFF1A", /*#__PURE__*/React.createElement("input", {
|
|
6582
|
-
className: "decimal-places-input",
|
|
6583
|
-
id: "decimal-places-input",
|
|
6584
|
-
min: 0,
|
|
6585
|
-
max: 9,
|
|
6586
|
-
defaultValue: 2,
|
|
6587
|
-
type: "number",
|
|
6566
|
+
className: "custom-format-input-row"
|
|
6567
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
6568
|
+
className: "custom-format-label"
|
|
6569
|
+
}, format.customFormat, "\uFF1A"), /*#__PURE__*/React.createElement("input", {
|
|
6570
|
+
className: "custom-format-input",
|
|
6571
|
+
autoFocus: true,
|
|
6572
|
+
placeholder: format.customFormatExample,
|
|
6573
|
+
value: formatStr,
|
|
6588
6574
|
onChange: function onChange(e) {
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
},
|
|
6575
|
+
setFormatStr(e.target.value);
|
|
6576
|
+
setErrorMsg("");
|
|
6577
|
+
},
|
|
6578
|
+
onKeyDown: onKeyDown
|
|
6579
|
+
})), errorMsg !== "" && ( /*#__PURE__*/React.createElement("div", {
|
|
6580
|
+
className: "custom-format-error"
|
|
6581
|
+
}, errorMsg)), /*#__PURE__*/React.createElement("div", {
|
|
6582
|
+
className: "custom-format-list"
|
|
6583
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
6584
|
+
className: "custom-format-list-row custom-format-list-header"
|
|
6585
|
+
}, /*#__PURE__*/React.createElement("div", null, format.customFormatName), /*#__PURE__*/React.createElement("div", null, format.format)), /*#__PURE__*/React.createElement("div", {
|
|
6586
|
+
className: "custom-format-list-body"
|
|
6587
|
+
}, presetFmtList.map(function (v) {
|
|
6594
6588
|
return /*#__PURE__*/React.createElement("div", {
|
|
6595
|
-
className: "
|
|
6596
|
-
key: v.
|
|
6589
|
+
className: "custom-format-list-row".concat(v.value === formatStr ? " on" : ""),
|
|
6590
|
+
key: v.value,
|
|
6591
|
+
title: v.example,
|
|
6597
6592
|
onClick: function onClick() {
|
|
6598
|
-
|
|
6593
|
+
return setFormatStr(v.value);
|
|
6599
6594
|
}
|
|
6600
|
-
}, /*#__PURE__*/React.createElement("div", null, v.
|
|
6595
|
+
}, /*#__PURE__*/React.createElement("div", null, v.text), /*#__PURE__*/React.createElement("div", null, v.value));
|
|
6601
6596
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
6602
6597
|
className: "leankylin-dialog-box-button-container",
|
|
6603
|
-
style:
|
|
6604
|
-
marginTop:
|
|
6605
|
-
} : {
|
|
6606
|
-
marginTop: 30
|
|
6598
|
+
style: {
|
|
6599
|
+
marginTop: 20
|
|
6607
6600
|
}
|
|
6608
6601
|
}, /*#__PURE__*/React.createElement("div", {
|
|
6609
6602
|
className: "leankylin-message-box-button button-primary",
|
|
@@ -6661,7 +6654,6 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6661
6654
|
findAndReplace = _locale.findAndReplace,
|
|
6662
6655
|
comment = _locale.comment,
|
|
6663
6656
|
fontarray = _locale.fontarray;
|
|
6664
|
-
var toolbarFormat = locale(context).format;
|
|
6665
6657
|
var sheetWidth = context.luckysheetTableContentHW[0];
|
|
6666
6658
|
var _useState5 = useState("#000000"),
|
|
6667
6659
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
@@ -6818,44 +6810,13 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6818
6810
|
if (value === "fmtOtherSelf") {
|
|
6819
6811
|
return /*#__PURE__*/React.createElement(Option, {
|
|
6820
6812
|
key: value,
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
onMouseLeave: function onMouseLeave(e) {
|
|
6825
|
-
return hideSubMenu(e, "more-format");
|
|
6826
|
-
}
|
|
6827
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
6828
|
-
className: "leankylin-toolbar-menu-line"
|
|
6829
|
-
}, /*#__PURE__*/React.createElement("div", null, text), /*#__PURE__*/React.createElement(SVGIcon, {
|
|
6830
|
-
name: "rightArrow",
|
|
6831
|
-
width: 14
|
|
6832
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
6833
|
-
className: "more-format toolbar-item-sub-menu leankylin-toolbar-select",
|
|
6834
|
-
style: {
|
|
6835
|
-
display: "none",
|
|
6836
|
-
width: 150,
|
|
6837
|
-
bottom: 10,
|
|
6838
|
-
top: undefined
|
|
6839
|
-
}
|
|
6840
|
-
}, [{
|
|
6841
|
-
text: toolbarFormat.moreCurrency,
|
|
6842
|
-
onclick: function onclick() {
|
|
6843
|
-
showDialog( /*#__PURE__*/React.createElement(FormatSearch, {
|
|
6844
|
-
onCancel: hideDialog,
|
|
6845
|
-
type: "currency"
|
|
6813
|
+
onClick: function onClick() {
|
|
6814
|
+
showDialog( /*#__PURE__*/React.createElement(CustomFormat, {
|
|
6815
|
+
onCancel: hideDialog
|
|
6846
6816
|
}));
|
|
6847
6817
|
setOpen(false);
|
|
6848
6818
|
}
|
|
6849
|
-
}
|
|
6850
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6851
|
-
className: "set-background-item leankylin-toolbar-select-option",
|
|
6852
|
-
key: v.text,
|
|
6853
|
-
onClick: function onClick() {
|
|
6854
|
-
v.onclick();
|
|
6855
|
-
setOpen(false);
|
|
6856
|
-
}
|
|
6857
|
-
}, v.text);
|
|
6858
|
-
})));
|
|
6819
|
+
}, text);
|
|
6859
6820
|
}
|
|
6860
6821
|
return /*#__PURE__*/React.createElement(Option, {
|
|
6861
6822
|
key: value,
|
|
@@ -7720,7 +7681,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
7720
7681
|
});
|
|
7721
7682
|
}
|
|
7722
7683
|
});
|
|
7723
|
-
}, [toolbar, cell, setContext, refs.cellInput, refs.fxInput, refs.globalCache, defaultFmt, align, handleUndo, handleRedo, flowdata, formula, showDialog, hideDialog, merge, border, freezen, screenshot, sort, textWrap, rotation, filter, splitText, findAndReplace, context.luckysheet_select_save, context.defaultFontSize, context.allowEdit, context.luckysheetPaintModelOn, comment, fontarray, hideSubMenu, showSubMenu, refs.canvas, customColor, customStyle
|
|
7684
|
+
}, [toolbar, cell, setContext, refs.cellInput, refs.fxInput, refs.globalCache, defaultFmt, align, handleUndo, handleRedo, flowdata, formula, showDialog, hideDialog, merge, border, freezen, screenshot, sort, textWrap, rotation, filter, splitText, findAndReplace, context.luckysheet_select_save, context.defaultFontSize, context.allowEdit, context.luckysheetPaintModelOn, comment, fontarray, hideSubMenu, showSubMenu, refs.canvas, customColor, customStyle]);
|
|
7724
7685
|
return /*#__PURE__*/React.createElement("div", {
|
|
7725
7686
|
ref: containerRef,
|
|
7726
7687
|
className: "leankylin-toolbar"
|