@fileverse-dev/fortune-react 1.0.2-mod-36 → 1.0.2-mod-38
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/Toolbar/index.d.ts +0 -1
- package/dist/index.css +15 -31
- package/dist/index.esm.css +15 -31
- package/dist/index.esm.js +424 -334
- package/dist/index.js +423 -333
- package/dist/index.umd.css +15 -31
- package/dist/index.umd.js +5401 -7262
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +9 -9
- package/package.json +2 -2
- package/dist/utils/datepickerStyles.d.ts +0 -2
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, goToLink, replaceHtml, removeHyperlink, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, getRangetxt, setConditionRules, mergeBorder,
|
|
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, goToLink, replaceHtml, removeHyperlink, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, getRangetxt, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, 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, getFreezeState, toggleFreeze, jfrefreshgrid, handleCopy, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, sortSelection, handleLink, handlePasteByClick, deleteSheet, opToPatch, setCaretPosition, 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';
|
|
@@ -172,7 +172,7 @@ function _regenerator() {
|
|
|
172
172
|
i = p[t],
|
|
173
173
|
d = G.p,
|
|
174
174
|
l = i[2];
|
|
175
|
-
r > 3 ? (o = l === n) && (
|
|
175
|
+
r > 3 ? (o = l === n) && (c = i[4] || 3, u = i[5] === e ? i[3] : i[5], i[4] = 3, i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
176
176
|
}
|
|
177
177
|
if (o || r > 1) return a;
|
|
178
178
|
throw y = !0, n;
|
|
@@ -784,12 +784,37 @@ var ContentEditable = function ContentEditable(_ref) {
|
|
|
784
784
|
};
|
|
785
785
|
|
|
786
786
|
var FormulaSearch = function FormulaSearch(props) {
|
|
787
|
+
var _context$luckysheet_s;
|
|
787
788
|
var _useContext = useContext(WorkbookContext),
|
|
788
789
|
context = _useContext.context;
|
|
790
|
+
var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
|
|
791
|
+
var hintRef = useRef(null);
|
|
792
|
+
var _useState = useState(0),
|
|
793
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
794
|
+
top = _useState2[0],
|
|
795
|
+
setTop = _useState2[1];
|
|
796
|
+
var calcuatePopUpPlacement = function calcuatePopUpPlacement() {
|
|
797
|
+
var _hintRef$current;
|
|
798
|
+
if (!(firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.top) || !firstSelection.height_move || !hintRef.current) return;
|
|
799
|
+
var hintHeight = hintRef.current.offsetHeight;
|
|
800
|
+
var inputBottom = firstSelection.top + firstSelection.height_move;
|
|
801
|
+
var availableBelow = window.innerHeight - inputBottom;
|
|
802
|
+
var hintAbove = hintHeight > availableBelow;
|
|
803
|
+
var selectionHeight = (firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0;
|
|
804
|
+
var divOffset = ((_hintRef$current = hintRef.current) === null || _hintRef$current === void 0 ? void 0 : _hintRef$current.offsetHeight) || 0;
|
|
805
|
+
setTop(hintAbove ? selectionHeight - (divOffset + 70) : selectionHeight + 4);
|
|
806
|
+
};
|
|
807
|
+
useEffect(function () {
|
|
808
|
+
calcuatePopUpPlacement();
|
|
809
|
+
});
|
|
789
810
|
if (_.isEmpty(context.functionCandidates)) return null;
|
|
790
811
|
return /*#__PURE__*/React.createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
812
|
+
ref: hintRef,
|
|
791
813
|
id: "luckysheet-formula-search-c",
|
|
792
|
-
className: "luckysheet-formula-search-c"
|
|
814
|
+
className: "luckysheet-formula-search-c",
|
|
815
|
+
style: {
|
|
816
|
+
top: top
|
|
817
|
+
}
|
|
793
818
|
}), context.functionCandidates.map(function (v, index) {
|
|
794
819
|
return /*#__PURE__*/React.createElement("div", {
|
|
795
820
|
key: v.n,
|
|
@@ -839,8 +864,10 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
839
864
|
};
|
|
840
865
|
|
|
841
866
|
var FormulaHint = function FormulaHint(props) {
|
|
867
|
+
var _context$luckysheet_s;
|
|
842
868
|
var _useContext = useContext(WorkbookContext),
|
|
843
869
|
context = _useContext.context;
|
|
870
|
+
var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
|
|
844
871
|
var _locale = locale(context),
|
|
845
872
|
formulaMore = _locale.formulaMore;
|
|
846
873
|
var fn = context.formulaCache.functionlistMap[context.functionHint];
|
|
@@ -856,7 +883,7 @@ var FormulaHint = function FormulaHint(props) {
|
|
|
856
883
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
857
884
|
isKeyAdded = _useState6[0],
|
|
858
885
|
setApiKeyAdded = _useState6[1];
|
|
859
|
-
var _useState7 = useState(
|
|
886
|
+
var _useState7 = useState(true),
|
|
860
887
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
861
888
|
showFunctionBody = _useState8[0],
|
|
862
889
|
setShouldShowFunctionBody = _useState8[1];
|
|
@@ -870,11 +897,66 @@ var FormulaHint = function FormulaHint(props) {
|
|
|
870
897
|
var apiKeyPlaceholder = {
|
|
871
898
|
ETHERSCAN_API_KEY: "Etherscan API key"
|
|
872
899
|
};
|
|
900
|
+
var hintRef = useRef(null);
|
|
901
|
+
var _useState9 = useState(0),
|
|
902
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
903
|
+
top = _useState0[0],
|
|
904
|
+
setTop = _useState0[1];
|
|
905
|
+
var calcuatePopUpPlacement = function calcuatePopUpPlacement() {
|
|
906
|
+
var _hintRef$current;
|
|
907
|
+
if (!(firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.top) || !firstSelection.height_move || !hintRef.current) return;
|
|
908
|
+
var hintHeight = 422;
|
|
909
|
+
var inputBottom = firstSelection.top + firstSelection.height_move;
|
|
910
|
+
var availableBelow = window.innerHeight - inputBottom;
|
|
911
|
+
var hintAbove = hintHeight > availableBelow;
|
|
912
|
+
var selectionHeight = (firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0;
|
|
913
|
+
var divOffset = ((_hintRef$current = hintRef.current) === null || _hintRef$current === void 0 ? void 0 : _hintRef$current.offsetHeight) || 0;
|
|
914
|
+
setTop(hintAbove ? selectionHeight - (divOffset + 70) : selectionHeight + 4);
|
|
915
|
+
};
|
|
916
|
+
useEffect(function () {
|
|
917
|
+
calcuatePopUpPlacement();
|
|
918
|
+
});
|
|
919
|
+
useEffect(function () {
|
|
920
|
+
var el = document.getElementById("function-details");
|
|
921
|
+
var handleWheel;
|
|
922
|
+
if (el) {
|
|
923
|
+
var scrollLockTimeout = null;
|
|
924
|
+
var cache = {
|
|
925
|
+
verticalScrollLock: false,
|
|
926
|
+
horizontalScrollLock: false
|
|
927
|
+
};
|
|
928
|
+
handleWheel = function handleWheel(e) {
|
|
929
|
+
e.preventDefault();
|
|
930
|
+
var step = 40;
|
|
931
|
+
var ratio = 1;
|
|
932
|
+
if (e.deltaY !== 0 && !cache.verticalScrollLock) {
|
|
933
|
+
cache.horizontalScrollLock = true;
|
|
934
|
+
el.scrollTop += (e.deltaY > 0 ? 1 : -1) * step * ratio;
|
|
935
|
+
} else if (e.deltaX !== 0 && !cache.horizontalScrollLock) {
|
|
936
|
+
cache.verticalScrollLock = true;
|
|
937
|
+
el.scrollLeft += (e.deltaX > 0 ? 1 : -1) * step * ratio;
|
|
938
|
+
}
|
|
939
|
+
clearTimeout(scrollLockTimeout);
|
|
940
|
+
scrollLockTimeout = setTimeout(function () {
|
|
941
|
+
cache.verticalScrollLock = false;
|
|
942
|
+
cache.horizontalScrollLock = false;
|
|
943
|
+
}, 50);
|
|
944
|
+
};
|
|
945
|
+
el.addEventListener("wheel", handleWheel, {
|
|
946
|
+
passive: false
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
return function () {
|
|
950
|
+
if (el && handleWheel) el.removeEventListener("wheel", handleWheel);
|
|
951
|
+
};
|
|
952
|
+
}, []);
|
|
873
953
|
if (!fn) return null;
|
|
874
954
|
return /*#__PURE__*/React.createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
955
|
+
ref: hintRef,
|
|
875
956
|
id: "luckysheet-formula-help-c",
|
|
876
957
|
className: "luckysheet-formula-help-c",
|
|
877
958
|
style: {
|
|
959
|
+
top: top,
|
|
878
960
|
borderWidth: "1px",
|
|
879
961
|
borderColor: (fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR) ? fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR : "#F8F9FA",
|
|
880
962
|
backgroundColor: "".concat(fn.BRAND_COLOR ? fn.BRAND_COLOR : "#F8F9FA"),
|
|
@@ -965,8 +1047,11 @@ var FormulaHint = function FormulaHint(props) {
|
|
|
965
1047
|
height: 16
|
|
966
1048
|
})))), showFunctionBody && (/*#__PURE__*/React.createElement("div", {
|
|
967
1049
|
className: "luckysheet-formula-help-content",
|
|
1050
|
+
id: "function-details",
|
|
968
1051
|
style: {
|
|
969
|
-
backgroundColor: "".concat(fn.BRAND_COLOR ? fn.BRAND_COLOR : "#F8F9FA")
|
|
1052
|
+
backgroundColor: "".concat(fn.BRAND_COLOR ? fn.BRAND_COLOR : "#F8F9FA"),
|
|
1053
|
+
maxHeight: "318px",
|
|
1054
|
+
overflowY: "scroll"
|
|
970
1055
|
}
|
|
971
1056
|
}, fn.API_KEY && (/*#__PURE__*/React.createElement("div", {
|
|
972
1057
|
style: {
|
|
@@ -1103,8 +1188,12 @@ var FormulaHint = function FormulaHint(props) {
|
|
|
1103
1188
|
borderBottomRightRadius: "10px"
|
|
1104
1189
|
},
|
|
1105
1190
|
className: "w-full"
|
|
1106
|
-
}, /*#__PURE__*/React.createElement("
|
|
1107
|
-
|
|
1191
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1192
|
+
onClick: function onClick() {
|
|
1193
|
+
var _document$getElementB;
|
|
1194
|
+
(_document$getElementB = document.getElementById("function-button")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.click();
|
|
1195
|
+
},
|
|
1196
|
+
className: "color-text-link cursor-pointer text-helper-text-sm"
|
|
1108
1197
|
}, "Learn More")));
|
|
1109
1198
|
};
|
|
1110
1199
|
|
|
@@ -1203,6 +1292,38 @@ var InputBox = function InputBox() {
|
|
|
1203
1292
|
var getActiveFormula = useCallback(function () {
|
|
1204
1293
|
return document.querySelector(".luckysheet-formula-search-item-active");
|
|
1205
1294
|
}, []);
|
|
1295
|
+
var insertSelectedFormula = useCallback(function (formulaName) {
|
|
1296
|
+
var _getrangeseleciton;
|
|
1297
|
+
var textEditor = document.getElementById("luckysheet-rich-text-editor");
|
|
1298
|
+
if (!textEditor) return;
|
|
1299
|
+
var searchTxt = ((_getrangeseleciton = getrangeseleciton()) === null || _getrangeseleciton === void 0 ? void 0 : _getrangeseleciton.textContent) || "";
|
|
1300
|
+
var deleteCount = searchTxt.length;
|
|
1301
|
+
textEditor.focus();
|
|
1302
|
+
var selection = window.getSelection();
|
|
1303
|
+
if (!selection || selection.rangeCount === 0) return;
|
|
1304
|
+
var range = selection.getRangeAt(0);
|
|
1305
|
+
if (deleteCount !== 0 && range) {
|
|
1306
|
+
var startOffset = Math.max(range.startOffset - deleteCount, 0);
|
|
1307
|
+
var endOffset = range.startOffset;
|
|
1308
|
+
range.setStart(range.startContainer, startOffset);
|
|
1309
|
+
range.setEnd(range.startContainer, endOffset);
|
|
1310
|
+
range.deleteContents();
|
|
1311
|
+
}
|
|
1312
|
+
var funcNode = new DOMParser().parseFromString("<span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span>"), "text/html").body.firstChild;
|
|
1313
|
+
var parNode = new DOMParser().parseFromString("<span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>", "text/html").body.firstChild;
|
|
1314
|
+
if (range === null || range === void 0 ? void 0 : range.startContainer.parentNode) {
|
|
1315
|
+
range.setStart(range.startContainer.parentNode, 1);
|
|
1316
|
+
}
|
|
1317
|
+
if (parNode) range.insertNode(parNode);
|
|
1318
|
+
if (funcNode) range.insertNode(funcNode);
|
|
1319
|
+
range.collapse();
|
|
1320
|
+
selection.removeAllRanges();
|
|
1321
|
+
selection.addRange(range);
|
|
1322
|
+
setContext(function (draftCtx) {
|
|
1323
|
+
draftCtx.functionCandidates = [];
|
|
1324
|
+
draftCtx.functionHint = formulaName;
|
|
1325
|
+
});
|
|
1326
|
+
}, [setContext]);
|
|
1206
1327
|
var clearSearchItemActiveClass = useCallback(function () {
|
|
1207
1328
|
var activeFormula = getActiveFormula();
|
|
1208
1329
|
if (activeFormula) {
|
|
@@ -1210,89 +1331,24 @@ var InputBox = function InputBox() {
|
|
|
1210
1331
|
}
|
|
1211
1332
|
}, [getActiveFormula]);
|
|
1212
1333
|
var selectActiveFormula = useCallback(function (e) {
|
|
1213
|
-
var
|
|
1214
|
-
var
|
|
1215
|
-
if (
|
|
1216
|
-
|
|
1217
|
-
var textEditor = document.getElementById("luckysheet-rich-text-editor");
|
|
1218
|
-
if (textEditor) {
|
|
1219
|
-
var _getrangeseleciton;
|
|
1220
|
-
var searchTxt = ((_getrangeseleciton = getrangeseleciton()) === null || _getrangeseleciton === void 0 ? void 0 : _getrangeseleciton.textContent) || "";
|
|
1221
|
-
var deleteCount = searchTxt.length;
|
|
1222
|
-
textEditor.focus();
|
|
1223
|
-
var selection = window.getSelection();
|
|
1224
|
-
if ((selection === null || selection === void 0 ? void 0 : selection.rangeCount) === 0) return;
|
|
1225
|
-
var range = selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0);
|
|
1226
|
-
if (deleteCount !== 0 && range) {
|
|
1227
|
-
var startOffset = Math.max(range.startOffset - deleteCount, 0);
|
|
1228
|
-
var endOffset = range.startOffset;
|
|
1229
|
-
range.setStart(range.startContainer, startOffset);
|
|
1230
|
-
range.setEnd(range.startContainer, endOffset);
|
|
1231
|
-
range.deleteContents();
|
|
1232
|
-
}
|
|
1233
|
-
var functionStr = "<span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span>");
|
|
1234
|
-
var lParStr = "<span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>";
|
|
1235
|
-
var functionNode = new DOMParser().parseFromString(functionStr, "text/html").body.childNodes[0];
|
|
1236
|
-
var lParNode = new DOMParser().parseFromString(lParStr, "text/html").body.childNodes[0];
|
|
1237
|
-
if (range === null || range === void 0 ? void 0 : range.startContainer.parentNode) {
|
|
1238
|
-
range === null || range === void 0 ? void 0 : range.setStart(range.startContainer.parentNode, 1);
|
|
1239
|
-
}
|
|
1240
|
-
range === null || range === void 0 ? void 0 : range.insertNode(lParNode);
|
|
1241
|
-
range === null || range === void 0 ? void 0 : range.insertNode(functionNode);
|
|
1242
|
-
range === null || range === void 0 ? void 0 : range.collapse();
|
|
1243
|
-
selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
|
|
1244
|
-
if (range) selection === null || selection === void 0 ? void 0 : selection.addRange(range);
|
|
1245
|
-
setContext(function (draftCtx) {
|
|
1246
|
-
draftCtx.functionCandidates = [];
|
|
1247
|
-
draftCtx.functionHint = formulaName;
|
|
1248
|
-
});
|
|
1249
|
-
}
|
|
1334
|
+
var _getActiveFormula, _getActiveFormula$que;
|
|
1335
|
+
var formulaName = (_getActiveFormula = getActiveFormula()) === null || _getActiveFormula === void 0 ? void 0 : (_getActiveFormula$que = _getActiveFormula.querySelector(".luckysheet-formula-search-func")) === null || _getActiveFormula$que === void 0 ? void 0 : _getActiveFormula$que.textContent;
|
|
1336
|
+
if (formulaName) {
|
|
1337
|
+
insertSelectedFormula(formulaName);
|
|
1250
1338
|
e.preventDefault();
|
|
1251
1339
|
e.stopPropagation();
|
|
1252
1340
|
}
|
|
1253
|
-
}, [getActiveFormula,
|
|
1341
|
+
}, [getActiveFormula, insertSelectedFormula]);
|
|
1254
1342
|
var selectActiveFormulaOnClick = useCallback(function (e) {
|
|
1255
|
-
var
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
if (textEditor) {
|
|
1261
|
-
var _getrangeseleciton2;
|
|
1262
|
-
var searchTxt = ((_getrangeseleciton2 = getrangeseleciton()) === null || _getrangeseleciton2 === void 0 ? void 0 : _getrangeseleciton2.textContent) || "";
|
|
1263
|
-
var deleteCount = searchTxt.length;
|
|
1264
|
-
textEditor.focus();
|
|
1265
|
-
var selection = window.getSelection();
|
|
1266
|
-
if ((selection === null || selection === void 0 ? void 0 : selection.rangeCount) === 0) return;
|
|
1267
|
-
var range = selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0);
|
|
1268
|
-
if (deleteCount !== 0 && range) {
|
|
1269
|
-
var startOffset = Math.max(range.startOffset - deleteCount, 0);
|
|
1270
|
-
var endOffset = range.startOffset;
|
|
1271
|
-
range.setStart(range.startContainer, startOffset);
|
|
1272
|
-
range.setEnd(range.startContainer, endOffset);
|
|
1273
|
-
range.deleteContents();
|
|
1274
|
-
}
|
|
1275
|
-
var functionStr = "<span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span>");
|
|
1276
|
-
var lParStr = "<span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>";
|
|
1277
|
-
var functionNode = new DOMParser().parseFromString(functionStr, "text/html").body.childNodes[0];
|
|
1278
|
-
var lParNode = new DOMParser().parseFromString(lParStr, "text/html").body.childNodes[0];
|
|
1279
|
-
if (range === null || range === void 0 ? void 0 : range.startContainer.parentNode) {
|
|
1280
|
-
range === null || range === void 0 ? void 0 : range.setStart(range.startContainer.parentNode, 1);
|
|
1281
|
-
}
|
|
1282
|
-
range === null || range === void 0 ? void 0 : range.insertNode(lParNode);
|
|
1283
|
-
range === null || range === void 0 ? void 0 : range.insertNode(functionNode);
|
|
1284
|
-
range === null || range === void 0 ? void 0 : range.collapse();
|
|
1285
|
-
selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
|
|
1286
|
-
if (range) selection === null || selection === void 0 ? void 0 : selection.addRange(range);
|
|
1287
|
-
setContext(function (draftCtx) {
|
|
1288
|
-
draftCtx.functionCandidates = [];
|
|
1289
|
-
draftCtx.functionHint = formulaName;
|
|
1290
|
-
});
|
|
1291
|
-
}
|
|
1343
|
+
var _getActiveFormula2, _getActiveFormula2$qu;
|
|
1344
|
+
preText.current = inputRef.current.innerText;
|
|
1345
|
+
var formulaName = (_getActiveFormula2 = getActiveFormula()) === null || _getActiveFormula2 === void 0 ? void 0 : (_getActiveFormula2$qu = _getActiveFormula2.querySelector(".luckysheet-formula-search-func")) === null || _getActiveFormula2$qu === void 0 ? void 0 : _getActiveFormula2$qu.textContent;
|
|
1346
|
+
if (formulaName) {
|
|
1347
|
+
insertSelectedFormula(formulaName);
|
|
1292
1348
|
e.preventDefault();
|
|
1293
1349
|
e.stopPropagation();
|
|
1294
1350
|
}
|
|
1295
|
-
}, [getActiveFormula,
|
|
1351
|
+
}, [getActiveFormula, insertSelectedFormula]);
|
|
1296
1352
|
var onKeyDown = useCallback(function (e) {
|
|
1297
1353
|
lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
|
|
1298
1354
|
preText.current = inputRef.current.innerText;
|
|
@@ -1409,10 +1465,7 @@ var InputBox = function InputBox() {
|
|
|
1409
1465
|
onKeyDown: onKeyDown,
|
|
1410
1466
|
onPaste: onPaste,
|
|
1411
1467
|
allowEdit: edit ? !isHidenRC : edit
|
|
1412
|
-
})),
|
|
1413
|
-
style: {
|
|
1414
|
-
top: ((firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0) + 4
|
|
1415
|
-
},
|
|
1468
|
+
})), (context.functionCandidates.length > 0 || context.functionHint) && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormulaSearch, {
|
|
1416
1469
|
onMouseOver: function onMouseOver(e) {
|
|
1417
1470
|
if (document.getElementById("luckysheet-formula-search-c")) {
|
|
1418
1471
|
var hoveredItem = e.target.closest(".luckysheet-formula-search-item");
|
|
@@ -1422,14 +1475,10 @@ var InputBox = function InputBox() {
|
|
|
1422
1475
|
}
|
|
1423
1476
|
e.preventDefault();
|
|
1424
1477
|
},
|
|
1425
|
-
|
|
1478
|
+
onMouseDown: function onMouseDown(e) {
|
|
1426
1479
|
selectActiveFormulaOnClick(e);
|
|
1427
1480
|
}
|
|
1428
|
-
}), /*#__PURE__*/React.createElement(FormulaHint,
|
|
1429
|
-
style: {
|
|
1430
|
-
top: ((firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0) + 4
|
|
1431
|
-
}
|
|
1432
|
-
}))));
|
|
1481
|
+
}), /*#__PURE__*/React.createElement(FormulaHint, null))));
|
|
1433
1482
|
};
|
|
1434
1483
|
|
|
1435
1484
|
var ScrollBar = function ScrollBar(_ref) {
|
|
@@ -2559,18 +2608,8 @@ function useDialog() {
|
|
|
2559
2608
|
};
|
|
2560
2609
|
}
|
|
2561
2610
|
|
|
2562
|
-
var datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: #1a202c;\n background-color: #fff;\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #4299e1;\n box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);\n }\n";
|
|
2563
|
-
var injectDatepickerStyles = function injectDatepickerStyles() {
|
|
2564
|
-
if (typeof document !== "undefined") {
|
|
2565
|
-
var styleSheet = document.createElement("style");
|
|
2566
|
-
styleSheet.textContent = datepickerStyles;
|
|
2567
|
-
document.head.appendChild(styleSheet);
|
|
2568
|
-
}
|
|
2569
|
-
};
|
|
2570
|
-
|
|
2571
|
-
injectDatepickerStyles();
|
|
2572
2611
|
var DataVerification = function DataVerification() {
|
|
2573
|
-
var _context$dataVerifica, _context$dataVerifica2, _context$dataVerifica3, _context$dataVerifica4, _context$dataVerifica5, _context$dataVerifica6, _context$dataVerifica7, _context$dataVerifica8, _context$dataVerifica9, _context$dataVerifica0, _context$dataVerifica1, _context$dataVerifica10, _context$dataVerifica11;
|
|
2612
|
+
var _context$dataVerifica, _context$dataVerifica2, _context$dataVerifica3, _context$dataVerifica4, _context$dataVerifica5, _context$dataVerifica6, _context$dataVerifica7, _context$dataVerifica8, _context$dataVerifica9, _context$dataVerifica0, _context$dataVerifica1, _context$dataVerifica10, _context$dataVerifica11, _context$dataVerifica12, _context$dataVerifica13, _context$dataVerifica14, _context$dataVerifica15, _context$dataVerifica16, _context$dataVerifica17, _context$dataVerifica18, _context$dataVerifica19, _context$dataVerifica20, _context$dataVerifica21, _context$dataVerifica22, _context$dataVerifica23;
|
|
2574
2613
|
var _useContext = useContext(WorkbookContext),
|
|
2575
2614
|
context = _useContext.context,
|
|
2576
2615
|
setContext = _useContext.setContext;
|
|
@@ -2579,11 +2618,15 @@ var DataVerification = function DataVerification() {
|
|
|
2579
2618
|
hideDialog = _useDialog.hideDialog;
|
|
2580
2619
|
var _locale = locale(context),
|
|
2581
2620
|
dataVerification = _locale.dataVerification,
|
|
2621
|
+
toolbar = _locale.toolbar,
|
|
2582
2622
|
button = _locale.button,
|
|
2583
2623
|
generalDialog = _locale.generalDialog;
|
|
2584
|
-
var _useState = useState(["between", "notBetween", "equal", "notEqualTo", "
|
|
2624
|
+
var _useState = useState(["between", "notBetween", "equal", "notEqualTo", "moreThanThe", "lessThan", "greaterOrEqualTo", "lessThanOrEqualTo"]),
|
|
2585
2625
|
_useState2 = _slicedToArray(_useState, 1),
|
|
2586
|
-
|
|
2626
|
+
numberCondition = _useState2[0];
|
|
2627
|
+
var _useState3 = useState(["between", "notBetween", "equal", "notEqualTo", "earlierThan", "noEarlierThan", "laterThan", "noLaterThan"]),
|
|
2628
|
+
_useState4 = _slicedToArray(_useState3, 1),
|
|
2629
|
+
dateCondition = _useState4[0];
|
|
2587
2630
|
var dataSelectRange = useCallback(function (type, value) {
|
|
2588
2631
|
hideDialog();
|
|
2589
2632
|
setContext(function (ctx) {
|
|
@@ -2718,36 +2761,48 @@ var DataVerification = function DataVerification() {
|
|
|
2718
2761
|
return /*#__PURE__*/React.createElement("div", {
|
|
2719
2762
|
id: "fortune-data-verification"
|
|
2720
2763
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2721
|
-
className: "
|
|
2764
|
+
className: "title"
|
|
2765
|
+
}, toolbar.dataVerification), /*#__PURE__*/React.createElement("div", {
|
|
2766
|
+
className: "box"
|
|
2722
2767
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2723
|
-
className: "
|
|
2768
|
+
className: "box-item",
|
|
2769
|
+
style: {
|
|
2770
|
+
borderTop: "1px solid #E1E4E8"
|
|
2771
|
+
}
|
|
2724
2772
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2725
|
-
className: "
|
|
2726
|
-
}, dataVerification.cellRange), /*#__PURE__*/React.createElement(
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
"aria-hidden": "true",
|
|
2732
|
-
readOnly: true,
|
|
2773
|
+
className: "box-item-title"
|
|
2774
|
+
}, dataVerification.cellRange), /*#__PURE__*/React.createElement("div", {
|
|
2775
|
+
className: "data-verification-range"
|
|
2776
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
2777
|
+
className: "formulaInputFocus",
|
|
2778
|
+
spellCheck: "false",
|
|
2733
2779
|
value: (_context$dataVerifica = context.dataVerification.dataRegulation) === null || _context$dataVerifica === void 0 ? void 0 : _context$dataVerifica.rangeTxt,
|
|
2734
2780
|
onChange: function onChange(e) {
|
|
2735
2781
|
var value = e.target.value;
|
|
2736
2782
|
setContext(function (ctx) {
|
|
2737
2783
|
ctx.dataVerification.dataRegulation.rangeTxt = value;
|
|
2738
2784
|
});
|
|
2739
|
-
}
|
|
2785
|
+
}
|
|
2786
|
+
}), /*#__PURE__*/React.createElement("i", {
|
|
2787
|
+
className: "icon",
|
|
2788
|
+
"aria-hidden": "true",
|
|
2740
2789
|
onClick: function onClick() {
|
|
2741
2790
|
hideDialog();
|
|
2742
2791
|
dataSelectRange("rangeTxt", context.dataVerification.dataRegulation.value1);
|
|
2743
|
-
}
|
|
2744
|
-
|
|
2745
|
-
|
|
2792
|
+
},
|
|
2793
|
+
tabIndex: 0
|
|
2794
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
2795
|
+
name: "tab",
|
|
2796
|
+
width: 18
|
|
2797
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
2798
|
+
className: "box-item"
|
|
2746
2799
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2747
|
-
className: "
|
|
2748
|
-
}, dataVerification.verificationCondition), /*#__PURE__*/React.createElement(
|
|
2800
|
+
className: "box-item-title"
|
|
2801
|
+
}, dataVerification.verificationCondition), /*#__PURE__*/React.createElement("select", {
|
|
2802
|
+
className: "data-verification-type-select",
|
|
2749
2803
|
value: context.dataVerification.dataRegulation.type,
|
|
2750
|
-
|
|
2804
|
+
onChange: function onChange(e) {
|
|
2805
|
+
var value = e.target.value;
|
|
2751
2806
|
setContext(function (ctx) {
|
|
2752
2807
|
ctx.dataVerification.dataRegulation.type = value;
|
|
2753
2808
|
if (value === "dropdown" || value === "checkbox") {
|
|
@@ -2763,14 +2818,18 @@ var DataVerification = function DataVerification() {
|
|
|
2763
2818
|
ctx.dataVerification.dataRegulation.value2 = "";
|
|
2764
2819
|
});
|
|
2765
2820
|
}
|
|
2766
|
-
},
|
|
2767
|
-
return /*#__PURE__*/React.createElement(
|
|
2821
|
+
}, ["dropdown", "checkbox", "number", "number_integer", "number_decimal", "text_content", "text_length", "date", "validity"].map(function (v) {
|
|
2822
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
2768
2823
|
value: v,
|
|
2769
2824
|
key: v
|
|
2770
2825
|
}, dataVerification[v]);
|
|
2771
|
-
}))
|
|
2772
|
-
className: "
|
|
2773
|
-
}, /*#__PURE__*/React.createElement(
|
|
2826
|
+
})), ((_context$dataVerifica2 = context.dataVerification) === null || _context$dataVerifica2 === void 0 ? void 0 : (_context$dataVerifica3 = _context$dataVerifica2.dataRegulation) === null || _context$dataVerifica3 === void 0 ? void 0 : _context$dataVerifica3.type) === "dropdown" && (/*#__PURE__*/React.createElement("div", {
|
|
2827
|
+
className: "show-box-item"
|
|
2828
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2829
|
+
className: "data-verification-range"
|
|
2830
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
2831
|
+
className: "formulaInputFocus",
|
|
2832
|
+
spellCheck: "false",
|
|
2774
2833
|
value: context.dataVerification.dataRegulation.value1,
|
|
2775
2834
|
placeholder: dataVerification.placeholder1,
|
|
2776
2835
|
onChange: function onChange(e) {
|
|
@@ -2779,28 +2838,39 @@ var DataVerification = function DataVerification() {
|
|
|
2779
2838
|
ctx.dataVerification.dataRegulation.value1 = value;
|
|
2780
2839
|
});
|
|
2781
2840
|
}
|
|
2782
|
-
}), /*#__PURE__*/React.createElement("
|
|
2783
|
-
className: "
|
|
2784
|
-
|
|
2785
|
-
|
|
2841
|
+
}), /*#__PURE__*/React.createElement("i", {
|
|
2842
|
+
className: "icon",
|
|
2843
|
+
"aria-hidden": "true",
|
|
2844
|
+
onClick: function onClick() {
|
|
2845
|
+
return dataSelectRange("dropDown", context.dataVerification.dataRegulation.value1);
|
|
2846
|
+
},
|
|
2847
|
+
tabIndex: 0
|
|
2848
|
+
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
2849
|
+
name: "tab",
|
|
2850
|
+
width: 18
|
|
2851
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
2852
|
+
className: "check"
|
|
2853
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
2854
|
+
type: "checkbox",
|
|
2786
2855
|
checked: context.dataVerification.dataRegulation.type2 === "true",
|
|
2787
|
-
|
|
2856
|
+
id: "mul",
|
|
2857
|
+
onChange: function onChange(e) {
|
|
2788
2858
|
var checked = e.target.checked;
|
|
2789
2859
|
setContext(function (ctx) {
|
|
2790
2860
|
ctx.dataVerification.dataRegulation.type2 = "".concat(checked);
|
|
2791
2861
|
});
|
|
2792
2862
|
}
|
|
2793
|
-
}), /*#__PURE__*/React.createElement("
|
|
2794
|
-
|
|
2863
|
+
}), /*#__PURE__*/React.createElement("label", {
|
|
2864
|
+
htmlFor: "mul"
|
|
2795
2865
|
}, dataVerification.allowMultiSelect)))), ((_context$dataVerifica4 = context.dataVerification) === null || _context$dataVerifica4 === void 0 ? void 0 : (_context$dataVerifica5 = _context$dataVerifica4.dataRegulation) === null || _context$dataVerifica5 === void 0 ? void 0 : _context$dataVerifica5.type) === "checkbox" && (/*#__PURE__*/React.createElement("div", {
|
|
2796
|
-
className: "
|
|
2866
|
+
className: "show-box-item"
|
|
2797
2867
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2798
|
-
className: "
|
|
2799
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
value: (_context$dataVerifica6 = context.dataVerification) === null || _context$dataVerifica6 === void 0 ? void 0 : (_context$dataVerifica7 = _context$dataVerifica6.dataRegulation) === null || _context$dataVerifica7 === void 0 ? void 0 : _context$dataVerifica7.value1,
|
|
2868
|
+
className: "check-box"
|
|
2869
|
+
}, /*#__PURE__*/React.createElement("span", null, dataVerification.selected, " \u2014\u2014 "), /*#__PURE__*/React.createElement("input", {
|
|
2870
|
+
type: "text",
|
|
2871
|
+
className: "data-verification-value1",
|
|
2803
2872
|
placeholder: dataVerification.placeholder2,
|
|
2873
|
+
value: (_context$dataVerifica6 = context.dataVerification) === null || _context$dataVerifica6 === void 0 ? void 0 : (_context$dataVerifica7 = _context$dataVerifica6.dataRegulation) === null || _context$dataVerifica7 === void 0 ? void 0 : _context$dataVerifica7.value1,
|
|
2804
2874
|
onChange: function onChange(e) {
|
|
2805
2875
|
var value = e.target.value;
|
|
2806
2876
|
setContext(function (ctx) {
|
|
@@ -2808,41 +2878,41 @@ var DataVerification = function DataVerification() {
|
|
|
2808
2878
|
});
|
|
2809
2879
|
}
|
|
2810
2880
|
})), /*#__PURE__*/React.createElement("div", {
|
|
2811
|
-
className: "
|
|
2812
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
value: (_context$dataVerifica8 = context.dataVerification) === null || _context$dataVerifica8 === void 0 ? void 0 : (_context$dataVerifica9 = _context$dataVerifica8.dataRegulation) === null || _context$dataVerifica9 === void 0 ? void 0 : _context$dataVerifica9.value2,
|
|
2881
|
+
className: "check-box"
|
|
2882
|
+
}, /*#__PURE__*/React.createElement("span", null, dataVerification.notSelected, " \u2014\u2014 "), /*#__PURE__*/React.createElement("input", {
|
|
2883
|
+
type: "text",
|
|
2884
|
+
className: "data-verification-value2",
|
|
2816
2885
|
placeholder: dataVerification.placeholder2,
|
|
2886
|
+
value: (_context$dataVerifica8 = context.dataVerification) === null || _context$dataVerifica8 === void 0 ? void 0 : (_context$dataVerifica9 = _context$dataVerifica8.dataRegulation) === null || _context$dataVerifica9 === void 0 ? void 0 : _context$dataVerifica9.value2,
|
|
2817
2887
|
onChange: function onChange(e) {
|
|
2818
2888
|
var value = e.target.value;
|
|
2819
2889
|
setContext(function (ctx) {
|
|
2820
2890
|
ctx.dataVerification.dataRegulation.value2 = value;
|
|
2821
2891
|
});
|
|
2822
2892
|
}
|
|
2823
|
-
})))), ((_context$dataVerifica0 = context.dataVerification) === null || _context$dataVerifica0 === void 0 ? void 0 : (_context$dataVerifica1 = _context$dataVerifica0.dataRegulation) === null || _context$dataVerifica1 === void 0 ? void 0 : _context$dataVerifica1.type) === "
|
|
2824
|
-
className: "
|
|
2825
|
-
}, /*#__PURE__*/React.createElement(
|
|
2893
|
+
})))), (((_context$dataVerifica0 = context.dataVerification) === null || _context$dataVerifica0 === void 0 ? void 0 : (_context$dataVerifica1 = _context$dataVerifica0.dataRegulation) === null || _context$dataVerifica1 === void 0 ? void 0 : _context$dataVerifica1.type) === "number" || ((_context$dataVerifica10 = context.dataVerification) === null || _context$dataVerifica10 === void 0 ? void 0 : (_context$dataVerifica11 = _context$dataVerifica10.dataRegulation) === null || _context$dataVerifica11 === void 0 ? void 0 : _context$dataVerifica11.type) === "number_integer" || ((_context$dataVerifica12 = context.dataVerification) === null || _context$dataVerifica12 === void 0 ? void 0 : (_context$dataVerifica13 = _context$dataVerifica12.dataRegulation) === null || _context$dataVerifica13 === void 0 ? void 0 : _context$dataVerifica13.type) === "number_decimal" || ((_context$dataVerifica14 = context.dataVerification) === null || _context$dataVerifica14 === void 0 ? void 0 : (_context$dataVerifica15 = _context$dataVerifica14.dataRegulation) === null || _context$dataVerifica15 === void 0 ? void 0 : _context$dataVerifica15.type) === "text_length") && (/*#__PURE__*/React.createElement("div", {
|
|
2894
|
+
className: "show-box-item"
|
|
2895
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
2896
|
+
className: "data-verification-type-select",
|
|
2826
2897
|
value: context.dataVerification.dataRegulation.type2,
|
|
2827
|
-
|
|
2898
|
+
onChange: function onChange(e) {
|
|
2899
|
+
var value = e.target.value;
|
|
2828
2900
|
setContext(function (ctx) {
|
|
2829
2901
|
ctx.dataVerification.dataRegulation.type2 = value;
|
|
2830
2902
|
ctx.dataVerification.dataRegulation.value1 = "";
|
|
2831
2903
|
ctx.dataVerification.dataRegulation.value2 = "";
|
|
2832
2904
|
});
|
|
2833
2905
|
}
|
|
2834
|
-
},
|
|
2835
|
-
return /*#__PURE__*/React.createElement(
|
|
2906
|
+
}, numberCondition.map(function (v) {
|
|
2907
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
2836
2908
|
value: v,
|
|
2837
2909
|
key: v
|
|
2838
2910
|
}, dataVerification[v]);
|
|
2839
|
-
}))
|
|
2840
|
-
className: "
|
|
2841
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
2842
|
-
className: "datepicker-toggle"
|
|
2911
|
+
})), context.dataVerification.dataRegulation.type2 === "between" || context.dataVerification.dataRegulation.type2 === "notBetween" ? (/*#__PURE__*/React.createElement("div", {
|
|
2912
|
+
className: "input-box"
|
|
2843
2913
|
}, /*#__PURE__*/React.createElement("input", {
|
|
2844
|
-
type: "
|
|
2845
|
-
|
|
2914
|
+
type: "number",
|
|
2915
|
+
placeholder: "1",
|
|
2846
2916
|
value: context.dataVerification.dataRegulation.value1,
|
|
2847
2917
|
onChange: function onChange(e) {
|
|
2848
2918
|
var value = e.target.value;
|
|
@@ -2850,13 +2920,97 @@ var DataVerification = function DataVerification() {
|
|
|
2850
2920
|
ctx.dataVerification.dataRegulation.value1 = value;
|
|
2851
2921
|
});
|
|
2852
2922
|
}
|
|
2853
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2923
|
+
}), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("input", {
|
|
2924
|
+
type: "number",
|
|
2925
|
+
placeholder: "100",
|
|
2926
|
+
value: context.dataVerification.dataRegulation.value2,
|
|
2927
|
+
onChange: function onChange(e) {
|
|
2928
|
+
var value = e.target.value;
|
|
2929
|
+
setContext(function (ctx) {
|
|
2930
|
+
ctx.dataVerification.dataRegulation.value2 = value;
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
}))) : (/*#__PURE__*/React.createElement("div", {
|
|
2934
|
+
className: "input-box"
|
|
2935
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
2936
|
+
type: "number",
|
|
2937
|
+
style: {
|
|
2938
|
+
width: "100%"
|
|
2939
|
+
},
|
|
2940
|
+
placeholder: dataVerification.placeholder3,
|
|
2941
|
+
value: context.dataVerification.dataRegulation.value1,
|
|
2942
|
+
onChange: function onChange(e) {
|
|
2943
|
+
var value = e.target.value;
|
|
2944
|
+
setContext(function (ctx) {
|
|
2945
|
+
ctx.dataVerification.dataRegulation.value1 = value;
|
|
2946
|
+
});
|
|
2947
|
+
}
|
|
2948
|
+
}))))), ((_context$dataVerifica16 = context.dataVerification) === null || _context$dataVerifica16 === void 0 ? void 0 : (_context$dataVerifica17 = _context$dataVerifica16.dataRegulation) === null || _context$dataVerifica17 === void 0 ? void 0 : _context$dataVerifica17.type) === "text_content" && (/*#__PURE__*/React.createElement("div", {
|
|
2949
|
+
className: "show-box-item"
|
|
2950
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
2951
|
+
className: "data-verification-type-select",
|
|
2952
|
+
value: context.dataVerification.dataRegulation.type2,
|
|
2953
|
+
onChange: function onChange(e) {
|
|
2954
|
+
var value = e.target.value;
|
|
2955
|
+
setContext(function (ctx) {
|
|
2956
|
+
ctx.dataVerification.dataRegulation.type2 = value;
|
|
2957
|
+
ctx.dataVerification.dataRegulation.value1 = "";
|
|
2958
|
+
ctx.dataVerification.dataRegulation.value2 = "";
|
|
2959
|
+
});
|
|
2960
|
+
}
|
|
2961
|
+
}, ["include", "exclude", "equal"].map(function (v) {
|
|
2962
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
2963
|
+
value: v,
|
|
2964
|
+
key: v
|
|
2965
|
+
}, dataVerification[v]);
|
|
2966
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
2967
|
+
className: "input-box"
|
|
2968
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
2969
|
+
type: "text",
|
|
2970
|
+
style: {
|
|
2971
|
+
width: "100%"
|
|
2972
|
+
},
|
|
2973
|
+
placeholder: dataVerification.placeholder4,
|
|
2974
|
+
value: context.dataVerification.dataRegulation.value1,
|
|
2975
|
+
onChange: function onChange(e) {
|
|
2976
|
+
var value = e.target.value;
|
|
2977
|
+
setContext(function (ctx) {
|
|
2978
|
+
ctx.dataVerification.dataRegulation.value1 = value;
|
|
2979
|
+
});
|
|
2980
|
+
}
|
|
2981
|
+
})))), ((_context$dataVerifica18 = context.dataVerification) === null || _context$dataVerifica18 === void 0 ? void 0 : (_context$dataVerifica19 = _context$dataVerifica18.dataRegulation) === null || _context$dataVerifica19 === void 0 ? void 0 : _context$dataVerifica19.type) === "date" && (/*#__PURE__*/React.createElement("div", {
|
|
2982
|
+
className: "show-box-item"
|
|
2983
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
2984
|
+
className: "data-verification-type-select",
|
|
2985
|
+
value: context.dataVerification.dataRegulation.type2,
|
|
2986
|
+
onChange: function onChange(e) {
|
|
2987
|
+
var value = e.target.value;
|
|
2988
|
+
setContext(function (ctx) {
|
|
2989
|
+
ctx.dataVerification.dataRegulation.type2 = value;
|
|
2990
|
+
ctx.dataVerification.dataRegulation.value1 = "";
|
|
2991
|
+
ctx.dataVerification.dataRegulation.value2 = "";
|
|
2992
|
+
});
|
|
2993
|
+
}
|
|
2994
|
+
}, dateCondition.map(function (v) {
|
|
2995
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
2996
|
+
value: v,
|
|
2997
|
+
key: v
|
|
2998
|
+
}, dataVerification[v]);
|
|
2999
|
+
})), context.dataVerification.dataRegulation.type2 === "between" || context.dataVerification.dataRegulation.type2 === "notBetween" ? (/*#__PURE__*/React.createElement("div", {
|
|
3000
|
+
className: "input-box"
|
|
2857
3001
|
}, /*#__PURE__*/React.createElement("input", {
|
|
2858
3002
|
type: "date",
|
|
2859
|
-
|
|
3003
|
+
placeholder: "1",
|
|
3004
|
+
value: context.dataVerification.dataRegulation.value1,
|
|
3005
|
+
onChange: function onChange(e) {
|
|
3006
|
+
var value = e.target.value;
|
|
3007
|
+
setContext(function (ctx) {
|
|
3008
|
+
ctx.dataVerification.dataRegulation.value1 = value;
|
|
3009
|
+
});
|
|
3010
|
+
}
|
|
3011
|
+
}), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("input", {
|
|
3012
|
+
type: "date",
|
|
3013
|
+
placeholder: "100",
|
|
2860
3014
|
value: context.dataVerification.dataRegulation.value2,
|
|
2861
3015
|
onChange: function onChange(e) {
|
|
2862
3016
|
var value = e.target.value;
|
|
@@ -2864,15 +3018,13 @@ var DataVerification = function DataVerification() {
|
|
|
2864
3018
|
ctx.dataVerification.dataRegulation.value2 = value;
|
|
2865
3019
|
});
|
|
2866
3020
|
}
|
|
2867
|
-
})
|
|
2868
|
-
className: "
|
|
2869
|
-
})))) : (/*#__PURE__*/React.createElement("div", {
|
|
2870
|
-
className: "mt-4"
|
|
2871
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
2872
|
-
className: "datepicker-toggle"
|
|
3021
|
+
}))) : (/*#__PURE__*/React.createElement("div", {
|
|
3022
|
+
className: "input-box"
|
|
2873
3023
|
}, /*#__PURE__*/React.createElement("input", {
|
|
2874
3024
|
type: "date",
|
|
2875
|
-
|
|
3025
|
+
style: {
|
|
3026
|
+
width: "100%"
|
|
3027
|
+
},
|
|
2876
3028
|
placeholder: dataVerification.placeholder3,
|
|
2877
3029
|
value: context.dataVerification.dataRegulation.value1,
|
|
2878
3030
|
onChange: function onChange(e) {
|
|
@@ -2881,35 +3033,57 @@ var DataVerification = function DataVerification() {
|
|
|
2881
3033
|
ctx.dataVerification.dataRegulation.value1 = value;
|
|
2882
3034
|
});
|
|
2883
3035
|
}
|
|
2884
|
-
}), /*#__PURE__*/React.createElement("
|
|
2885
|
-
className: "
|
|
2886
|
-
}
|
|
2887
|
-
className: "
|
|
2888
|
-
|
|
2889
|
-
|
|
3036
|
+
}))))), ((_context$dataVerifica20 = context.dataVerification) === null || _context$dataVerifica20 === void 0 ? void 0 : (_context$dataVerifica21 = _context$dataVerifica20.dataRegulation) === null || _context$dataVerifica21 === void 0 ? void 0 : _context$dataVerifica21.type) === "validity" && (/*#__PURE__*/React.createElement("div", {
|
|
3037
|
+
className: "show-box-item"
|
|
3038
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
3039
|
+
className: "data-verification-type-select",
|
|
3040
|
+
value: context.dataVerification.dataRegulation.type2,
|
|
3041
|
+
onChange: function onChange(e) {
|
|
3042
|
+
var value = e.target.value;
|
|
3043
|
+
setContext(function (ctx) {
|
|
3044
|
+
ctx.dataVerification.dataRegulation.type2 = value;
|
|
3045
|
+
ctx.dataVerification.dataRegulation.value1 = "";
|
|
3046
|
+
ctx.dataVerification.dataRegulation.value2 = "";
|
|
3047
|
+
});
|
|
3048
|
+
}
|
|
3049
|
+
}, ["identificationNumber", "phoneNumber"].map(function (v) {
|
|
3050
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
3051
|
+
value: v,
|
|
3052
|
+
key: v
|
|
3053
|
+
}, dataVerification[v]);
|
|
3054
|
+
}))))), /*#__PURE__*/React.createElement("div", {
|
|
3055
|
+
className: "box-item"
|
|
2890
3056
|
}, ["prohibitInput", "hintShow"].map(function (v) {
|
|
2891
3057
|
return /*#__PURE__*/React.createElement("div", {
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
}, /*#__PURE__*/React.createElement(
|
|
2895
|
-
|
|
3058
|
+
className: "check",
|
|
3059
|
+
key: "div".concat(v)
|
|
3060
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
3061
|
+
type: "checkbox",
|
|
3062
|
+
id: v,
|
|
3063
|
+
key: "input".concat(v),
|
|
2896
3064
|
checked: context.dataVerification.dataRegulation[v],
|
|
2897
|
-
|
|
2898
|
-
var checked = e.target.checked;
|
|
3065
|
+
onChange: function onChange() {
|
|
2899
3066
|
setContext(function (ctx) {
|
|
2900
3067
|
var _ctx$dataVerification5;
|
|
2901
3068
|
var dataRegulation = (_ctx$dataVerification5 = ctx.dataVerification) === null || _ctx$dataVerification5 === void 0 ? void 0 : _ctx$dataVerification5.dataRegulation;
|
|
2902
3069
|
if (v === "prohibitInput") {
|
|
2903
|
-
dataRegulation.prohibitInput =
|
|
3070
|
+
dataRegulation.prohibitInput = !dataRegulation.prohibitInput;
|
|
2904
3071
|
} else if (v === "hintShow") {
|
|
2905
|
-
dataRegulation.hintShow =
|
|
3072
|
+
dataRegulation.hintShow = !dataRegulation.hintShow;
|
|
2906
3073
|
}
|
|
2907
3074
|
});
|
|
2908
3075
|
}
|
|
2909
|
-
}), /*#__PURE__*/React.createElement("
|
|
2910
|
-
|
|
3076
|
+
}), /*#__PURE__*/React.createElement("label", {
|
|
3077
|
+
htmlFor: v,
|
|
3078
|
+
key: "label".concat(v)
|
|
2911
3079
|
}, dataVerification[v]));
|
|
2912
|
-
}), ((_context$
|
|
3080
|
+
}), ((_context$dataVerifica22 = context.dataVerification) === null || _context$dataVerifica22 === void 0 ? void 0 : (_context$dataVerifica23 = _context$dataVerifica22.dataRegulation) === null || _context$dataVerifica23 === void 0 ? void 0 : _context$dataVerifica23.hintShow) && (/*#__PURE__*/React.createElement("div", {
|
|
3081
|
+
className: "input-box"
|
|
3082
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
3083
|
+
type: "text",
|
|
3084
|
+
style: {
|
|
3085
|
+
width: "100%"
|
|
3086
|
+
},
|
|
2913
3087
|
placeholder: dataVerification.placeholder5,
|
|
2914
3088
|
value: context.dataVerification.dataRegulation.hintValue,
|
|
2915
3089
|
onChange: function onChange(e) {
|
|
@@ -2918,37 +3092,25 @@ var DataVerification = function DataVerification() {
|
|
|
2918
3092
|
ctx.dataVerification.dataRegulation.hintValue = value;
|
|
2919
3093
|
});
|
|
2920
3094
|
}
|
|
2921
|
-
}))))), /*#__PURE__*/React.createElement(
|
|
2922
|
-
className: "
|
|
2923
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
2924
|
-
className: "flex gap-2 justify-between items-center"
|
|
2925
|
-
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
2926
|
-
variant: "secondary",
|
|
2927
|
-
style: {
|
|
2928
|
-
minWidth: "80px"
|
|
2929
|
-
},
|
|
3095
|
+
}))))), /*#__PURE__*/React.createElement("div", {
|
|
3096
|
+
className: "button-basic button-primary",
|
|
2930
3097
|
onClick: function onClick() {
|
|
2931
|
-
btn("
|
|
2932
|
-
}
|
|
2933
|
-
}, button.cancel), /*#__PURE__*/React.createElement("div", {
|
|
2934
|
-
className: "flex gap-2"
|
|
2935
|
-
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
2936
|
-
variant: "secondary",
|
|
2937
|
-
style: {
|
|
2938
|
-
minWidth: "80px"
|
|
3098
|
+
btn("confirm");
|
|
2939
3099
|
},
|
|
3100
|
+
tabIndex: 0
|
|
3101
|
+
}, button.confirm), /*#__PURE__*/React.createElement("div", {
|
|
3102
|
+
className: "button-basic button-close",
|
|
2940
3103
|
onClick: function onClick() {
|
|
2941
3104
|
btn("delete");
|
|
2942
|
-
}
|
|
2943
|
-
}, dataVerification.deleteVerification), /*#__PURE__*/React.createElement(Button$1, {
|
|
2944
|
-
variant: "default",
|
|
2945
|
-
style: {
|
|
2946
|
-
minWidth: "80px"
|
|
2947
3105
|
},
|
|
3106
|
+
tabIndex: 0
|
|
3107
|
+
}, dataVerification.deleteVerification), /*#__PURE__*/React.createElement("div", {
|
|
3108
|
+
className: "button-basic button-close",
|
|
2948
3109
|
onClick: function onClick() {
|
|
2949
|
-
btn("
|
|
2950
|
-
}
|
|
2951
|
-
|
|
3110
|
+
btn("close");
|
|
3111
|
+
},
|
|
3112
|
+
tabIndex: 0
|
|
3113
|
+
}, button.cancel));
|
|
2952
3114
|
};
|
|
2953
3115
|
|
|
2954
3116
|
function getDisplayedRangeTxt(context) {
|
|
@@ -2960,7 +3122,12 @@ function getDisplayedRangeTxt(context) {
|
|
|
2960
3122
|
return (_context$rangeDialog$ = (_context$rangeDialog = context.rangeDialog) === null || _context$rangeDialog === void 0 ? void 0 : _context$rangeDialog.rangeTxt) !== null && _context$rangeDialog$ !== void 0 ? _context$rangeDialog$ : "";
|
|
2961
3123
|
}
|
|
2962
3124
|
|
|
2963
|
-
|
|
3125
|
+
var datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: #1a202c;\n background-color: #fff;\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #4299e1;\n box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);\n }\n";
|
|
3126
|
+
if (typeof document !== "undefined") {
|
|
3127
|
+
var styleSheet = document.createElement("style");
|
|
3128
|
+
styleSheet.textContent = datepickerStyles;
|
|
3129
|
+
document.head.appendChild(styleSheet);
|
|
3130
|
+
}
|
|
2964
3131
|
var ConditionRules = function ConditionRules(_ref) {
|
|
2965
3132
|
var type = _ref.type;
|
|
2966
3133
|
var _useContext = useContext(WorkbookContext),
|
|
@@ -3281,8 +3448,7 @@ var RangeDialog = function RangeDialog() {
|
|
|
3281
3448
|
showDialog = _useDialog.showDialog;
|
|
3282
3449
|
var _locale = locale(context),
|
|
3283
3450
|
dataVerification = _locale.dataVerification,
|
|
3284
|
-
button = _locale.button
|
|
3285
|
-
toolbar = _locale.toolbar;
|
|
3451
|
+
button = _locale.button;
|
|
3286
3452
|
var _useState = useState(getDisplayedRangeTxt(context)),
|
|
3287
3453
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3288
3454
|
rangeTxt2 = _useState2[0],
|
|
@@ -3307,7 +3473,7 @@ var RangeDialog = function RangeDialog() {
|
|
|
3307
3473
|
}), undefined, locale(context).conditionformat["conditionformat_".concat(rulesType)]);
|
|
3308
3474
|
return;
|
|
3309
3475
|
}
|
|
3310
|
-
showDialog(/*#__PURE__*/React.createElement(DataVerification, null)
|
|
3476
|
+
showDialog(/*#__PURE__*/React.createElement(DataVerification, null));
|
|
3311
3477
|
}, [setContext, showDialog, context]);
|
|
3312
3478
|
useEffect(function () {
|
|
3313
3479
|
setRangeTxt2(getDisplayedRangeTxt(context));
|
|
@@ -3496,7 +3662,7 @@ var DropDownList = function DropDownList() {
|
|
|
3496
3662
|
arr.splice(index, 1);
|
|
3497
3663
|
}
|
|
3498
3664
|
setSelected(arr);
|
|
3499
|
-
|
|
3665
|
+
setDropcownValue(ctx, v, arr);
|
|
3500
3666
|
});
|
|
3501
3667
|
},
|
|
3502
3668
|
tabIndex: 0
|
|
@@ -3966,9 +4132,8 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3966
4132
|
display: "none"
|
|
3967
4133
|
}
|
|
3968
4134
|
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
3969
|
-
name: "
|
|
3970
|
-
width: 16
|
|
3971
|
-
height: 16
|
|
4135
|
+
name: "combo-arrow",
|
|
4136
|
+
width: 16
|
|
3972
4137
|
})), context.dataVerificationDropDownList && /*#__PURE__*/React.createElement(DropDownList, null), /*#__PURE__*/React.createElement("div", {
|
|
3973
4138
|
id: "luckysheet-dataVerification-showHintBox",
|
|
3974
4139
|
className: "luckysheet-mousedown-cancel",
|
|
@@ -4202,6 +4367,9 @@ var Sheet = function Sheet(_ref) {
|
|
|
4202
4367
|
}
|
|
4203
4368
|
}, [context, refs.canvas, refs.globalCache.freezen, setContext, sheet.id]);
|
|
4204
4369
|
var onWheel = useCallback(function (e) {
|
|
4370
|
+
var el = document.getElementById("function-details");
|
|
4371
|
+
var isMouseOver = el === null || el === void 0 ? void 0 : el.matches(":hover");
|
|
4372
|
+
if (el && isMouseOver) return;
|
|
4205
4373
|
setContext(function (draftCtx) {
|
|
4206
4374
|
handleGlobalWheel(draftCtx, e, refs.globalCache, refs.scrollbarX.current, refs.scrollbarY.current);
|
|
4207
4375
|
});
|
|
@@ -4287,9 +4455,6 @@ var Combo = function Combo(_ref) {
|
|
|
4287
4455
|
setPopupPosition = _useState4[1];
|
|
4288
4456
|
var popupRef = useRef(null);
|
|
4289
4457
|
var buttonRef = useRef(null);
|
|
4290
|
-
var isLucideIcon = useMemo(function () {
|
|
4291
|
-
return (iconId === null || iconId === void 0 ? void 0 : iconId.startsWith("align-")) || ["text-overflow", "text-wrap", "text-clip"].includes(iconId);
|
|
4292
|
-
}, [iconId]);
|
|
4293
4458
|
useOutsideClick(popupRef, function () {
|
|
4294
4459
|
setOpen(false);
|
|
4295
4460
|
});
|
|
@@ -4317,7 +4482,7 @@ var Combo = function Combo(_ref) {
|
|
|
4317
4482
|
}, /*#__PURE__*/React.createElement("div", {
|
|
4318
4483
|
ref: buttonRef,
|
|
4319
4484
|
className: "fortune-toolbar-combo"
|
|
4320
|
-
},
|
|
4485
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4321
4486
|
className: "fortune-toolbar-combo-button",
|
|
4322
4487
|
onClick: function onClick(e) {
|
|
4323
4488
|
if (_onClick) {
|
|
@@ -4336,13 +4501,7 @@ var Combo = function Combo(_ref) {
|
|
|
4336
4501
|
name: iconId
|
|
4337
4502
|
})) : (/*#__PURE__*/React.createElement("span", {
|
|
4338
4503
|
className: "fortune-toolbar-combo-text"
|
|
4339
|
-
}, text !== undefined ? text : "")))
|
|
4340
|
-
icon: getIcon(iconId),
|
|
4341
|
-
variant: "ghost",
|
|
4342
|
-
onClick: function onClick() {
|
|
4343
|
-
return setOpen(!open);
|
|
4344
|
-
}
|
|
4345
|
-
})), showArrow && (/*#__PURE__*/React.createElement("div", {
|
|
4504
|
+
}, text !== undefined ? text : ""))), showArrow && (/*#__PURE__*/React.createElement("div", {
|
|
4346
4505
|
className: "fortune-toolbar-combo-arrow",
|
|
4347
4506
|
onClick: function onClick() {
|
|
4348
4507
|
return setOpen(!open);
|
|
@@ -5247,30 +5406,6 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
5247
5406
|
}, button.cancel)));
|
|
5248
5407
|
};
|
|
5249
5408
|
|
|
5250
|
-
var getIcon = function getIcon(title) {
|
|
5251
|
-
switch (title) {
|
|
5252
|
-
case "align-left":
|
|
5253
|
-
return "AlignLeft";
|
|
5254
|
-
case "align-center":
|
|
5255
|
-
return "AlignCenter";
|
|
5256
|
-
case "align-right":
|
|
5257
|
-
return "AlignRight";
|
|
5258
|
-
case "align-top":
|
|
5259
|
-
return "ArrowUpFromLine";
|
|
5260
|
-
case "align-middle":
|
|
5261
|
-
return "AlignVerticalMiddle";
|
|
5262
|
-
case "align-bottom":
|
|
5263
|
-
return "ArrowDownFromLine";
|
|
5264
|
-
case "text-overflow":
|
|
5265
|
-
return "TextOverflow";
|
|
5266
|
-
case "text-wrap":
|
|
5267
|
-
return "WrapText";
|
|
5268
|
-
case "text-clip":
|
|
5269
|
-
return "TextClip";
|
|
5270
|
-
default:
|
|
5271
|
-
return "";
|
|
5272
|
-
}
|
|
5273
|
-
};
|
|
5274
5409
|
var Toolbar = function Toolbar(_ref) {
|
|
5275
5410
|
var _context$luckysheet_s, _flowdata$row, _settings$customToolb;
|
|
5276
5411
|
var setMoreItems = _ref.setMoreItems,
|
|
@@ -5607,38 +5742,27 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5607
5742
|
tooltip: toolbar.horizontalAlign,
|
|
5608
5743
|
showArrow: false
|
|
5609
5744
|
}, function (setOpen) {
|
|
5610
|
-
return /*#__PURE__*/React.createElement(Select, {
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
flexDirection: "row",
|
|
5615
|
-
alignItems: "center",
|
|
5616
|
-
justifyContent: "center",
|
|
5617
|
-
gap: 4
|
|
5618
|
-
}
|
|
5619
|
-
}, items.map(function (_ref3) {
|
|
5620
|
-
var _$find2;
|
|
5621
|
-
var title = _ref3.title;
|
|
5622
|
-
return /*#__PURE__*/React.createElement(IconButton, {
|
|
5745
|
+
return /*#__PURE__*/React.createElement(Select, null, items.map(function (_ref3) {
|
|
5746
|
+
var text = _ref3.text,
|
|
5747
|
+
title = _ref3.title;
|
|
5748
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
5623
5749
|
key: title,
|
|
5624
|
-
isActive: ((_$find2 = _.find(items, function (item) {
|
|
5625
|
-
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
|
|
5626
|
-
})) === null || _$find2 === void 0 ? void 0 : _$find2.title) === title,
|
|
5627
|
-
icon: getIcon(title),
|
|
5628
|
-
variant: "ghost",
|
|
5629
5750
|
onClick: function onClick() {
|
|
5630
5751
|
setContext(function (ctx) {
|
|
5631
5752
|
handleHorizontalAlign(ctx, refs.cellInput.current, title.replace("align-", ""));
|
|
5632
5753
|
});
|
|
5633
5754
|
setOpen(false);
|
|
5634
|
-
}
|
|
5635
|
-
|
|
5636
|
-
|
|
5755
|
+
}
|
|
5756
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5757
|
+
className: "fortune-toolbar-menu-line"
|
|
5758
|
+
}, text, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
5759
|
+
name: title
|
|
5760
|
+
})));
|
|
5637
5761
|
}));
|
|
5638
5762
|
});
|
|
5639
5763
|
}
|
|
5640
5764
|
if (name === "vertical-align") {
|
|
5641
|
-
var _$
|
|
5765
|
+
var _$find2;
|
|
5642
5766
|
var _items = [{
|
|
5643
5767
|
title: "align-top",
|
|
5644
5768
|
text: align.top,
|
|
@@ -5653,40 +5777,29 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5653
5777
|
value: 2
|
|
5654
5778
|
}];
|
|
5655
5779
|
return /*#__PURE__*/React.createElement(Combo, {
|
|
5656
|
-
iconId: ((_$
|
|
5780
|
+
iconId: ((_$find2 = _.find(_items, function (item) {
|
|
5657
5781
|
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
5658
|
-
})) === null || _$
|
|
5782
|
+
})) === null || _$find2 === void 0 ? void 0 : _$find2.title) || "align-top",
|
|
5659
5783
|
key: name,
|
|
5660
5784
|
tooltip: toolbar.verticalAlign,
|
|
5661
5785
|
showArrow: false
|
|
5662
5786
|
}, function (setOpen) {
|
|
5663
|
-
return /*#__PURE__*/React.createElement(Select, {
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
flexDirection: "row",
|
|
5668
|
-
alignItems: "center",
|
|
5669
|
-
justifyContent: "center",
|
|
5670
|
-
gap: 4
|
|
5671
|
-
}
|
|
5672
|
-
}, _items.map(function (_ref4) {
|
|
5673
|
-
var _$find4;
|
|
5674
|
-
var title = _ref4.title;
|
|
5675
|
-
return /*#__PURE__*/React.createElement(IconButton, {
|
|
5787
|
+
return /*#__PURE__*/React.createElement(Select, null, _items.map(function (_ref4) {
|
|
5788
|
+
var text = _ref4.text,
|
|
5789
|
+
title = _ref4.title;
|
|
5790
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
5676
5791
|
key: title,
|
|
5677
|
-
isActive: ((_$find4 = _.find(_items, function (item) {
|
|
5678
|
-
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
5679
|
-
})) === null || _$find4 === void 0 ? void 0 : _$find4.title) === title,
|
|
5680
|
-
icon: getIcon(title),
|
|
5681
|
-
variant: "ghost",
|
|
5682
5792
|
onClick: function onClick() {
|
|
5683
5793
|
setContext(function (ctx) {
|
|
5684
5794
|
handleVerticalAlign(ctx, refs.cellInput.current, title.replace("align-", ""));
|
|
5685
5795
|
});
|
|
5686
5796
|
setOpen(false);
|
|
5687
|
-
}
|
|
5688
|
-
|
|
5689
|
-
|
|
5797
|
+
}
|
|
5798
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5799
|
+
className: "fortune-toolbar-menu-line"
|
|
5800
|
+
}, text, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
5801
|
+
name: title
|
|
5802
|
+
})));
|
|
5690
5803
|
}));
|
|
5691
5804
|
});
|
|
5692
5805
|
}
|
|
@@ -5761,7 +5874,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5761
5874
|
key: name,
|
|
5762
5875
|
onClick: function onClick() {
|
|
5763
5876
|
if (context.allowEdit === false) return;
|
|
5764
|
-
showDialog(/*#__PURE__*/React.createElement(DataVerification, null)
|
|
5877
|
+
showDialog(/*#__PURE__*/React.createElement(DataVerification, null));
|
|
5765
5878
|
}
|
|
5766
5879
|
});
|
|
5767
5880
|
}
|
|
@@ -6235,23 +6348,12 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6235
6348
|
tooltip: toolbar.textWrap,
|
|
6236
6349
|
showArrow: false
|
|
6237
6350
|
}, function (setOpen) {
|
|
6238
|
-
return /*#__PURE__*/React.createElement(Select, {
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
display: "flex",
|
|
6242
|
-
flexDirection: "row",
|
|
6243
|
-
alignItems: "center",
|
|
6244
|
-
justifyContent: "center",
|
|
6245
|
-
gap: 4
|
|
6246
|
-
}
|
|
6247
|
-
}, _items6.map(function (_ref1) {
|
|
6248
|
-
var iconId = _ref1.iconId,
|
|
6351
|
+
return /*#__PURE__*/React.createElement(Select, null, _items6.map(function (_ref1) {
|
|
6352
|
+
var text = _ref1.text,
|
|
6353
|
+
iconId = _ref1.iconId,
|
|
6249
6354
|
value = _ref1.value;
|
|
6250
|
-
return /*#__PURE__*/React.createElement(
|
|
6355
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
6251
6356
|
key: value,
|
|
6252
|
-
isActive: _curr.value === value,
|
|
6253
|
-
icon: getIcon(iconId),
|
|
6254
|
-
variant: "ghost",
|
|
6255
6357
|
onClick: function onClick() {
|
|
6256
6358
|
setContext(function (ctx) {
|
|
6257
6359
|
var d = getFlowdata(ctx);
|
|
@@ -6259,9 +6361,12 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6259
6361
|
updateFormat(ctx, refs.cellInput.current, d, "tb", value);
|
|
6260
6362
|
});
|
|
6261
6363
|
setOpen(false);
|
|
6262
|
-
}
|
|
6263
|
-
|
|
6264
|
-
|
|
6364
|
+
}
|
|
6365
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
6366
|
+
className: "fortune-toolbar-menu-line"
|
|
6367
|
+
}, text, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
6368
|
+
name: iconId
|
|
6369
|
+
})));
|
|
6265
6370
|
}));
|
|
6266
6371
|
});
|
|
6267
6372
|
}
|
|
@@ -9598,21 +9703,6 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9598
9703
|
"clip-rule": "evenodd",
|
|
9599
9704
|
d: "M12.75 2.25C13.1642 2.25 13.5 2.58579 13.5 3V15C13.5 15.4142 13.1642 15.75 12.75 15.75C12.3358 15.75 12 15.4142 12 15V3C12 2.58579 12.3358 2.25 12.75 2.25Z",
|
|
9600
9705
|
fill: "#363B3F"
|
|
9601
|
-
})), /*#__PURE__*/React.createElement("symbol", {
|
|
9602
|
-
id: "caret-down-fill",
|
|
9603
|
-
width: "14",
|
|
9604
|
-
height: "14",
|
|
9605
|
-
viewBox: "0 0 14 14",
|
|
9606
|
-
fill: "none"
|
|
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.64775 8.97978L3.77152 6.10355C3.45654 5.78857 3.67962 5.25 4.12507 5.25H9.87753C10.323 5.25 10.5461 5.78857 10.2311 6.10355L7.35486 8.97978C7.15959 9.17504 6.84301 9.17504 6.64775 8.97978Z",
|
|
9615
|
-
fill: "#363B3F"
|
|
9616
9706
|
}))));
|
|
9617
9707
|
};
|
|
9618
9708
|
|