@fileverse-dev/fortune-react 1.0.2-mod-37 → 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/components/Workbook/api.d.ts +0 -8
- package/dist/components/Workbook/index.d.ts +0 -8
- package/dist/index.css +15 -188
- package/dist/index.esm.css +15 -188
- package/dist/index.esm.js +433 -685
- package/dist/index.js +432 -684
- package/dist/index.umd.css +15 -188
- package/dist/index.umd.js +5411 -7614
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +9 -9
- package/package.json +2 -2
- package/dist/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +0 -12
- package/dist/components/DunePreview/DunePreview.d.ts +0 -13
- package/dist/components/IFrameBoxs/iFrameBoxs.d.ts +0 -3
- package/dist/utils/datepickerStyles.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -184,7 +184,7 @@ function _regenerator() {
|
|
|
184
184
|
i = p[t],
|
|
185
185
|
d = G.p,
|
|
186
186
|
l = i[2];
|
|
187
|
-
r > 3 ? (o = l === n) && (
|
|
187
|
+
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));
|
|
188
188
|
}
|
|
189
189
|
if (o || r > 1) return a;
|
|
190
190
|
throw y = !0, n;
|
|
@@ -796,12 +796,37 @@ var ContentEditable = function ContentEditable(_ref) {
|
|
|
796
796
|
};
|
|
797
797
|
|
|
798
798
|
var FormulaSearch = function FormulaSearch(props) {
|
|
799
|
+
var _context$luckysheet_s;
|
|
799
800
|
var _useContext = React.useContext(WorkbookContext),
|
|
800
801
|
context = _useContext.context;
|
|
802
|
+
var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
|
|
803
|
+
var hintRef = React.useRef(null);
|
|
804
|
+
var _useState = React.useState(0),
|
|
805
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
806
|
+
top = _useState2[0],
|
|
807
|
+
setTop = _useState2[1];
|
|
808
|
+
var calcuatePopUpPlacement = function calcuatePopUpPlacement() {
|
|
809
|
+
var _hintRef$current;
|
|
810
|
+
if (!(firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.top) || !firstSelection.height_move || !hintRef.current) return;
|
|
811
|
+
var hintHeight = hintRef.current.offsetHeight;
|
|
812
|
+
var inputBottom = firstSelection.top + firstSelection.height_move;
|
|
813
|
+
var availableBelow = window.innerHeight - inputBottom;
|
|
814
|
+
var hintAbove = hintHeight > availableBelow;
|
|
815
|
+
var selectionHeight = (firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0;
|
|
816
|
+
var divOffset = ((_hintRef$current = hintRef.current) === null || _hintRef$current === void 0 ? void 0 : _hintRef$current.offsetHeight) || 0;
|
|
817
|
+
setTop(hintAbove ? selectionHeight - (divOffset + 70) : selectionHeight + 4);
|
|
818
|
+
};
|
|
819
|
+
React.useEffect(function () {
|
|
820
|
+
calcuatePopUpPlacement();
|
|
821
|
+
});
|
|
801
822
|
if (___default['default'].isEmpty(context.functionCandidates)) return null;
|
|
802
823
|
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
824
|
+
ref: hintRef,
|
|
803
825
|
id: "luckysheet-formula-search-c",
|
|
804
|
-
className: "luckysheet-formula-search-c"
|
|
826
|
+
className: "luckysheet-formula-search-c",
|
|
827
|
+
style: {
|
|
828
|
+
top: top
|
|
829
|
+
}
|
|
805
830
|
}), context.functionCandidates.map(function (v, index) {
|
|
806
831
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
807
832
|
key: v.n,
|
|
@@ -851,8 +876,10 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
851
876
|
};
|
|
852
877
|
|
|
853
878
|
var FormulaHint = function FormulaHint(props) {
|
|
879
|
+
var _context$luckysheet_s;
|
|
854
880
|
var _useContext = React.useContext(WorkbookContext),
|
|
855
881
|
context = _useContext.context;
|
|
882
|
+
var firstSelection = (_context$luckysheet_s = context.luckysheet_select_save) === null || _context$luckysheet_s === void 0 ? void 0 : _context$luckysheet_s[0];
|
|
856
883
|
var _locale = fortuneCore.locale(context),
|
|
857
884
|
formulaMore = _locale.formulaMore;
|
|
858
885
|
var fn = context.formulaCache.functionlistMap[context.functionHint];
|
|
@@ -868,7 +895,7 @@ var FormulaHint = function FormulaHint(props) {
|
|
|
868
895
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
869
896
|
isKeyAdded = _useState6[0],
|
|
870
897
|
setApiKeyAdded = _useState6[1];
|
|
871
|
-
var _useState7 = React.useState(
|
|
898
|
+
var _useState7 = React.useState(true),
|
|
872
899
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
873
900
|
showFunctionBody = _useState8[0],
|
|
874
901
|
setShouldShowFunctionBody = _useState8[1];
|
|
@@ -882,11 +909,66 @@ var FormulaHint = function FormulaHint(props) {
|
|
|
882
909
|
var apiKeyPlaceholder = {
|
|
883
910
|
ETHERSCAN_API_KEY: "Etherscan API key"
|
|
884
911
|
};
|
|
912
|
+
var hintRef = React.useRef(null);
|
|
913
|
+
var _useState9 = React.useState(0),
|
|
914
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
915
|
+
top = _useState0[0],
|
|
916
|
+
setTop = _useState0[1];
|
|
917
|
+
var calcuatePopUpPlacement = function calcuatePopUpPlacement() {
|
|
918
|
+
var _hintRef$current;
|
|
919
|
+
if (!(firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.top) || !firstSelection.height_move || !hintRef.current) return;
|
|
920
|
+
var hintHeight = 422;
|
|
921
|
+
var inputBottom = firstSelection.top + firstSelection.height_move;
|
|
922
|
+
var availableBelow = window.innerHeight - inputBottom;
|
|
923
|
+
var hintAbove = hintHeight > availableBelow;
|
|
924
|
+
var selectionHeight = (firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0;
|
|
925
|
+
var divOffset = ((_hintRef$current = hintRef.current) === null || _hintRef$current === void 0 ? void 0 : _hintRef$current.offsetHeight) || 0;
|
|
926
|
+
setTop(hintAbove ? selectionHeight - (divOffset + 70) : selectionHeight + 4);
|
|
927
|
+
};
|
|
928
|
+
React.useEffect(function () {
|
|
929
|
+
calcuatePopUpPlacement();
|
|
930
|
+
});
|
|
931
|
+
React.useEffect(function () {
|
|
932
|
+
var el = document.getElementById("function-details");
|
|
933
|
+
var handleWheel;
|
|
934
|
+
if (el) {
|
|
935
|
+
var scrollLockTimeout = null;
|
|
936
|
+
var cache = {
|
|
937
|
+
verticalScrollLock: false,
|
|
938
|
+
horizontalScrollLock: false
|
|
939
|
+
};
|
|
940
|
+
handleWheel = function handleWheel(e) {
|
|
941
|
+
e.preventDefault();
|
|
942
|
+
var step = 40;
|
|
943
|
+
var ratio = 1;
|
|
944
|
+
if (e.deltaY !== 0 && !cache.verticalScrollLock) {
|
|
945
|
+
cache.horizontalScrollLock = true;
|
|
946
|
+
el.scrollTop += (e.deltaY > 0 ? 1 : -1) * step * ratio;
|
|
947
|
+
} else if (e.deltaX !== 0 && !cache.horizontalScrollLock) {
|
|
948
|
+
cache.verticalScrollLock = true;
|
|
949
|
+
el.scrollLeft += (e.deltaX > 0 ? 1 : -1) * step * ratio;
|
|
950
|
+
}
|
|
951
|
+
clearTimeout(scrollLockTimeout);
|
|
952
|
+
scrollLockTimeout = setTimeout(function () {
|
|
953
|
+
cache.verticalScrollLock = false;
|
|
954
|
+
cache.horizontalScrollLock = false;
|
|
955
|
+
}, 50);
|
|
956
|
+
};
|
|
957
|
+
el.addEventListener("wheel", handleWheel, {
|
|
958
|
+
passive: false
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
return function () {
|
|
962
|
+
if (el && handleWheel) el.removeEventListener("wheel", handleWheel);
|
|
963
|
+
};
|
|
964
|
+
}, []);
|
|
885
965
|
if (!fn) return null;
|
|
886
966
|
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
967
|
+
ref: hintRef,
|
|
887
968
|
id: "luckysheet-formula-help-c",
|
|
888
969
|
className: "luckysheet-formula-help-c",
|
|
889
970
|
style: {
|
|
971
|
+
top: top,
|
|
890
972
|
borderWidth: "1px",
|
|
891
973
|
borderColor: (fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR) ? fn === null || fn === void 0 ? void 0 : fn.BRAND_SECONDARY_COLOR : "#F8F9FA",
|
|
892
974
|
backgroundColor: "".concat(fn.BRAND_COLOR ? fn.BRAND_COLOR : "#F8F9FA"),
|
|
@@ -977,8 +1059,11 @@ var FormulaHint = function FormulaHint(props) {
|
|
|
977
1059
|
height: 16
|
|
978
1060
|
})))), showFunctionBody && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
979
1061
|
className: "luckysheet-formula-help-content",
|
|
1062
|
+
id: "function-details",
|
|
980
1063
|
style: {
|
|
981
|
-
backgroundColor: "".concat(fn.BRAND_COLOR ? fn.BRAND_COLOR : "#F8F9FA")
|
|
1064
|
+
backgroundColor: "".concat(fn.BRAND_COLOR ? fn.BRAND_COLOR : "#F8F9FA"),
|
|
1065
|
+
maxHeight: "318px",
|
|
1066
|
+
overflowY: "scroll"
|
|
982
1067
|
}
|
|
983
1068
|
}, fn.API_KEY && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
984
1069
|
style: {
|
|
@@ -1115,8 +1200,12 @@ var FormulaHint = function FormulaHint(props) {
|
|
|
1115
1200
|
borderBottomRightRadius: "10px"
|
|
1116
1201
|
},
|
|
1117
1202
|
className: "w-full"
|
|
1118
|
-
}, /*#__PURE__*/React__default['default'].createElement("
|
|
1119
|
-
|
|
1203
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
1204
|
+
onClick: function onClick() {
|
|
1205
|
+
var _document$getElementB;
|
|
1206
|
+
(_document$getElementB = document.getElementById("function-button")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.click();
|
|
1207
|
+
},
|
|
1208
|
+
className: "color-text-link cursor-pointer text-helper-text-sm"
|
|
1120
1209
|
}, "Learn More")));
|
|
1121
1210
|
};
|
|
1122
1211
|
|
|
@@ -1215,6 +1304,38 @@ var InputBox = function InputBox() {
|
|
|
1215
1304
|
var getActiveFormula = React.useCallback(function () {
|
|
1216
1305
|
return document.querySelector(".luckysheet-formula-search-item-active");
|
|
1217
1306
|
}, []);
|
|
1307
|
+
var insertSelectedFormula = React.useCallback(function (formulaName) {
|
|
1308
|
+
var _getrangeseleciton;
|
|
1309
|
+
var textEditor = document.getElementById("luckysheet-rich-text-editor");
|
|
1310
|
+
if (!textEditor) return;
|
|
1311
|
+
var searchTxt = ((_getrangeseleciton = fortuneCore.getrangeseleciton()) === null || _getrangeseleciton === void 0 ? void 0 : _getrangeseleciton.textContent) || "";
|
|
1312
|
+
var deleteCount = searchTxt.length;
|
|
1313
|
+
textEditor.focus();
|
|
1314
|
+
var selection = window.getSelection();
|
|
1315
|
+
if (!selection || selection.rangeCount === 0) return;
|
|
1316
|
+
var range = selection.getRangeAt(0);
|
|
1317
|
+
if (deleteCount !== 0 && range) {
|
|
1318
|
+
var startOffset = Math.max(range.startOffset - deleteCount, 0);
|
|
1319
|
+
var endOffset = range.startOffset;
|
|
1320
|
+
range.setStart(range.startContainer, startOffset);
|
|
1321
|
+
range.setEnd(range.startContainer, endOffset);
|
|
1322
|
+
range.deleteContents();
|
|
1323
|
+
}
|
|
1324
|
+
var funcNode = new DOMParser().parseFromString("<span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span>"), "text/html").body.firstChild;
|
|
1325
|
+
var parNode = new DOMParser().parseFromString("<span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>", "text/html").body.firstChild;
|
|
1326
|
+
if (range === null || range === void 0 ? void 0 : range.startContainer.parentNode) {
|
|
1327
|
+
range.setStart(range.startContainer.parentNode, 1);
|
|
1328
|
+
}
|
|
1329
|
+
if (parNode) range.insertNode(parNode);
|
|
1330
|
+
if (funcNode) range.insertNode(funcNode);
|
|
1331
|
+
range.collapse();
|
|
1332
|
+
selection.removeAllRanges();
|
|
1333
|
+
selection.addRange(range);
|
|
1334
|
+
setContext(function (draftCtx) {
|
|
1335
|
+
draftCtx.functionCandidates = [];
|
|
1336
|
+
draftCtx.functionHint = formulaName;
|
|
1337
|
+
});
|
|
1338
|
+
}, [setContext]);
|
|
1218
1339
|
var clearSearchItemActiveClass = React.useCallback(function () {
|
|
1219
1340
|
var activeFormula = getActiveFormula();
|
|
1220
1341
|
if (activeFormula) {
|
|
@@ -1222,89 +1343,24 @@ var InputBox = function InputBox() {
|
|
|
1222
1343
|
}
|
|
1223
1344
|
}, [getActiveFormula]);
|
|
1224
1345
|
var selectActiveFormula = React.useCallback(function (e) {
|
|
1225
|
-
var
|
|
1226
|
-
var
|
|
1227
|
-
if (
|
|
1228
|
-
|
|
1229
|
-
var textEditor = document.getElementById("luckysheet-rich-text-editor");
|
|
1230
|
-
if (textEditor) {
|
|
1231
|
-
var _getrangeseleciton;
|
|
1232
|
-
var searchTxt = ((_getrangeseleciton = fortuneCore.getrangeseleciton()) === null || _getrangeseleciton === void 0 ? void 0 : _getrangeseleciton.textContent) || "";
|
|
1233
|
-
var deleteCount = searchTxt.length;
|
|
1234
|
-
textEditor.focus();
|
|
1235
|
-
var selection = window.getSelection();
|
|
1236
|
-
if ((selection === null || selection === void 0 ? void 0 : selection.rangeCount) === 0) return;
|
|
1237
|
-
var range = selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0);
|
|
1238
|
-
if (deleteCount !== 0 && range) {
|
|
1239
|
-
var startOffset = Math.max(range.startOffset - deleteCount, 0);
|
|
1240
|
-
var endOffset = range.startOffset;
|
|
1241
|
-
range.setStart(range.startContainer, startOffset);
|
|
1242
|
-
range.setEnd(range.startContainer, endOffset);
|
|
1243
|
-
range.deleteContents();
|
|
1244
|
-
}
|
|
1245
|
-
var functionStr = "<span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span>");
|
|
1246
|
-
var lParStr = "<span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>";
|
|
1247
|
-
var functionNode = new DOMParser().parseFromString(functionStr, "text/html").body.childNodes[0];
|
|
1248
|
-
var lParNode = new DOMParser().parseFromString(lParStr, "text/html").body.childNodes[0];
|
|
1249
|
-
if (range === null || range === void 0 ? void 0 : range.startContainer.parentNode) {
|
|
1250
|
-
range === null || range === void 0 ? void 0 : range.setStart(range.startContainer.parentNode, 1);
|
|
1251
|
-
}
|
|
1252
|
-
range === null || range === void 0 ? void 0 : range.insertNode(lParNode);
|
|
1253
|
-
range === null || range === void 0 ? void 0 : range.insertNode(functionNode);
|
|
1254
|
-
range === null || range === void 0 ? void 0 : range.collapse();
|
|
1255
|
-
selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
|
|
1256
|
-
if (range) selection === null || selection === void 0 ? void 0 : selection.addRange(range);
|
|
1257
|
-
setContext(function (draftCtx) {
|
|
1258
|
-
draftCtx.functionCandidates = [];
|
|
1259
|
-
draftCtx.functionHint = formulaName;
|
|
1260
|
-
});
|
|
1261
|
-
}
|
|
1346
|
+
var _getActiveFormula, _getActiveFormula$que;
|
|
1347
|
+
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;
|
|
1348
|
+
if (formulaName) {
|
|
1349
|
+
insertSelectedFormula(formulaName);
|
|
1262
1350
|
e.preventDefault();
|
|
1263
1351
|
e.stopPropagation();
|
|
1264
1352
|
}
|
|
1265
|
-
}, [getActiveFormula,
|
|
1353
|
+
}, [getActiveFormula, insertSelectedFormula]);
|
|
1266
1354
|
var selectActiveFormulaOnClick = React.useCallback(function (e) {
|
|
1267
|
-
var
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
if (textEditor) {
|
|
1273
|
-
var _getrangeseleciton2;
|
|
1274
|
-
var searchTxt = ((_getrangeseleciton2 = fortuneCore.getrangeseleciton()) === null || _getrangeseleciton2 === void 0 ? void 0 : _getrangeseleciton2.textContent) || "";
|
|
1275
|
-
var deleteCount = searchTxt.length;
|
|
1276
|
-
textEditor.focus();
|
|
1277
|
-
var selection = window.getSelection();
|
|
1278
|
-
if ((selection === null || selection === void 0 ? void 0 : selection.rangeCount) === 0) return;
|
|
1279
|
-
var range = selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0);
|
|
1280
|
-
if (deleteCount !== 0 && range) {
|
|
1281
|
-
var startOffset = Math.max(range.startOffset - deleteCount, 0);
|
|
1282
|
-
var endOffset = range.startOffset;
|
|
1283
|
-
range.setStart(range.startContainer, startOffset);
|
|
1284
|
-
range.setEnd(range.startContainer, endOffset);
|
|
1285
|
-
range.deleteContents();
|
|
1286
|
-
}
|
|
1287
|
-
var functionStr = "<span dir=\"auto\" class=\"luckysheet-formula-text-func\">".concat(formulaName, "</span>");
|
|
1288
|
-
var lParStr = "<span dir=\"auto\" class=\"luckysheet-formula-text-lpar\">(</span>";
|
|
1289
|
-
var functionNode = new DOMParser().parseFromString(functionStr, "text/html").body.childNodes[0];
|
|
1290
|
-
var lParNode = new DOMParser().parseFromString(lParStr, "text/html").body.childNodes[0];
|
|
1291
|
-
if (range === null || range === void 0 ? void 0 : range.startContainer.parentNode) {
|
|
1292
|
-
range === null || range === void 0 ? void 0 : range.setStart(range.startContainer.parentNode, 1);
|
|
1293
|
-
}
|
|
1294
|
-
range === null || range === void 0 ? void 0 : range.insertNode(lParNode);
|
|
1295
|
-
range === null || range === void 0 ? void 0 : range.insertNode(functionNode);
|
|
1296
|
-
range === null || range === void 0 ? void 0 : range.collapse();
|
|
1297
|
-
selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
|
|
1298
|
-
if (range) selection === null || selection === void 0 ? void 0 : selection.addRange(range);
|
|
1299
|
-
setContext(function (draftCtx) {
|
|
1300
|
-
draftCtx.functionCandidates = [];
|
|
1301
|
-
draftCtx.functionHint = formulaName;
|
|
1302
|
-
});
|
|
1303
|
-
}
|
|
1355
|
+
var _getActiveFormula2, _getActiveFormula2$qu;
|
|
1356
|
+
preText.current = inputRef.current.innerText;
|
|
1357
|
+
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;
|
|
1358
|
+
if (formulaName) {
|
|
1359
|
+
insertSelectedFormula(formulaName);
|
|
1304
1360
|
e.preventDefault();
|
|
1305
1361
|
e.stopPropagation();
|
|
1306
1362
|
}
|
|
1307
|
-
}, [getActiveFormula,
|
|
1363
|
+
}, [getActiveFormula, insertSelectedFormula]);
|
|
1308
1364
|
var onKeyDown = React.useCallback(function (e) {
|
|
1309
1365
|
lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
|
|
1310
1366
|
preText.current = inputRef.current.innerText;
|
|
@@ -1421,10 +1477,7 @@ var InputBox = function InputBox() {
|
|
|
1421
1477
|
onKeyDown: onKeyDown,
|
|
1422
1478
|
onPaste: onPaste,
|
|
1423
1479
|
allowEdit: edit ? !isHidenRC : edit
|
|
1424
|
-
})),
|
|
1425
|
-
style: {
|
|
1426
|
-
top: ((firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0) + 4
|
|
1427
|
-
},
|
|
1480
|
+
})), (context.functionCandidates.length > 0 || context.functionHint) && (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(FormulaSearch, {
|
|
1428
1481
|
onMouseOver: function onMouseOver(e) {
|
|
1429
1482
|
if (document.getElementById("luckysheet-formula-search-c")) {
|
|
1430
1483
|
var hoveredItem = e.target.closest(".luckysheet-formula-search-item");
|
|
@@ -1434,14 +1487,10 @@ var InputBox = function InputBox() {
|
|
|
1434
1487
|
}
|
|
1435
1488
|
e.preventDefault();
|
|
1436
1489
|
},
|
|
1437
|
-
|
|
1490
|
+
onMouseDown: function onMouseDown(e) {
|
|
1438
1491
|
selectActiveFormulaOnClick(e);
|
|
1439
1492
|
}
|
|
1440
|
-
}), /*#__PURE__*/React__default['default'].createElement(FormulaHint,
|
|
1441
|
-
style: {
|
|
1442
|
-
top: ((firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.height_move) || 0) + 4
|
|
1443
|
-
}
|
|
1444
|
-
}))));
|
|
1493
|
+
}), /*#__PURE__*/React__default['default'].createElement(FormulaHint, null))));
|
|
1445
1494
|
};
|
|
1446
1495
|
|
|
1447
1496
|
var ScrollBar = function ScrollBar(_ref) {
|
|
@@ -2571,18 +2620,8 @@ function useDialog() {
|
|
|
2571
2620
|
};
|
|
2572
2621
|
}
|
|
2573
2622
|
|
|
2574
|
-
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";
|
|
2575
|
-
var injectDatepickerStyles = function injectDatepickerStyles() {
|
|
2576
|
-
if (typeof document !== "undefined") {
|
|
2577
|
-
var styleSheet = document.createElement("style");
|
|
2578
|
-
styleSheet.textContent = datepickerStyles;
|
|
2579
|
-
document.head.appendChild(styleSheet);
|
|
2580
|
-
}
|
|
2581
|
-
};
|
|
2582
|
-
|
|
2583
|
-
injectDatepickerStyles();
|
|
2584
2623
|
var DataVerification = function DataVerification() {
|
|
2585
|
-
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;
|
|
2624
|
+
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;
|
|
2586
2625
|
var _useContext = React.useContext(WorkbookContext),
|
|
2587
2626
|
context = _useContext.context,
|
|
2588
2627
|
setContext = _useContext.setContext;
|
|
@@ -2591,11 +2630,15 @@ var DataVerification = function DataVerification() {
|
|
|
2591
2630
|
hideDialog = _useDialog.hideDialog;
|
|
2592
2631
|
var _locale = fortuneCore.locale(context),
|
|
2593
2632
|
dataVerification = _locale.dataVerification,
|
|
2633
|
+
toolbar = _locale.toolbar,
|
|
2594
2634
|
button = _locale.button,
|
|
2595
2635
|
generalDialog = _locale.generalDialog;
|
|
2596
|
-
var _useState = React.useState(["between", "notBetween", "equal", "notEqualTo", "
|
|
2636
|
+
var _useState = React.useState(["between", "notBetween", "equal", "notEqualTo", "moreThanThe", "lessThan", "greaterOrEqualTo", "lessThanOrEqualTo"]),
|
|
2597
2637
|
_useState2 = _slicedToArray(_useState, 1),
|
|
2598
|
-
|
|
2638
|
+
numberCondition = _useState2[0];
|
|
2639
|
+
var _useState3 = React.useState(["between", "notBetween", "equal", "notEqualTo", "earlierThan", "noEarlierThan", "laterThan", "noLaterThan"]),
|
|
2640
|
+
_useState4 = _slicedToArray(_useState3, 1),
|
|
2641
|
+
dateCondition = _useState4[0];
|
|
2599
2642
|
var dataSelectRange = React.useCallback(function (type, value) {
|
|
2600
2643
|
hideDialog();
|
|
2601
2644
|
setContext(function (ctx) {
|
|
@@ -2730,36 +2773,48 @@ var DataVerification = function DataVerification() {
|
|
|
2730
2773
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2731
2774
|
id: "fortune-data-verification"
|
|
2732
2775
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2733
|
-
className: "
|
|
2776
|
+
className: "title"
|
|
2777
|
+
}, toolbar.dataVerification), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2778
|
+
className: "box"
|
|
2734
2779
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2735
|
-
className: "
|
|
2780
|
+
className: "box-item",
|
|
2781
|
+
style: {
|
|
2782
|
+
borderTop: "1px solid #E1E4E8"
|
|
2783
|
+
}
|
|
2736
2784
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2737
|
-
className: "
|
|
2738
|
-
}, dataVerification.cellRange), /*#__PURE__*/React__default['default'].createElement(
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
"aria-hidden": "true",
|
|
2744
|
-
readOnly: true,
|
|
2785
|
+
className: "box-item-title"
|
|
2786
|
+
}, dataVerification.cellRange), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2787
|
+
className: "data-verification-range"
|
|
2788
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2789
|
+
className: "formulaInputFocus",
|
|
2790
|
+
spellCheck: "false",
|
|
2745
2791
|
value: (_context$dataVerifica = context.dataVerification.dataRegulation) === null || _context$dataVerifica === void 0 ? void 0 : _context$dataVerifica.rangeTxt,
|
|
2746
2792
|
onChange: function onChange(e) {
|
|
2747
2793
|
var value = e.target.value;
|
|
2748
2794
|
setContext(function (ctx) {
|
|
2749
2795
|
ctx.dataVerification.dataRegulation.rangeTxt = value;
|
|
2750
2796
|
});
|
|
2751
|
-
}
|
|
2797
|
+
}
|
|
2798
|
+
}), /*#__PURE__*/React__default['default'].createElement("i", {
|
|
2799
|
+
className: "icon",
|
|
2800
|
+
"aria-hidden": "true",
|
|
2752
2801
|
onClick: function onClick() {
|
|
2753
2802
|
hideDialog();
|
|
2754
2803
|
dataSelectRange("rangeTxt", context.dataVerification.dataRegulation.value1);
|
|
2755
|
-
}
|
|
2756
|
-
|
|
2757
|
-
|
|
2804
|
+
},
|
|
2805
|
+
tabIndex: 0
|
|
2806
|
+
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
2807
|
+
name: "tab",
|
|
2808
|
+
width: 18
|
|
2809
|
+
})))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2810
|
+
className: "box-item"
|
|
2758
2811
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2759
|
-
className: "
|
|
2760
|
-
}, dataVerification.verificationCondition), /*#__PURE__*/React__default['default'].createElement(
|
|
2812
|
+
className: "box-item-title"
|
|
2813
|
+
}, dataVerification.verificationCondition), /*#__PURE__*/React__default['default'].createElement("select", {
|
|
2814
|
+
className: "data-verification-type-select",
|
|
2761
2815
|
value: context.dataVerification.dataRegulation.type,
|
|
2762
|
-
|
|
2816
|
+
onChange: function onChange(e) {
|
|
2817
|
+
var value = e.target.value;
|
|
2763
2818
|
setContext(function (ctx) {
|
|
2764
2819
|
ctx.dataVerification.dataRegulation.type = value;
|
|
2765
2820
|
if (value === "dropdown" || value === "checkbox") {
|
|
@@ -2775,14 +2830,18 @@ var DataVerification = function DataVerification() {
|
|
|
2775
2830
|
ctx.dataVerification.dataRegulation.value2 = "";
|
|
2776
2831
|
});
|
|
2777
2832
|
}
|
|
2778
|
-
},
|
|
2779
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
2833
|
+
}, ["dropdown", "checkbox", "number", "number_integer", "number_decimal", "text_content", "text_length", "date", "validity"].map(function (v) {
|
|
2834
|
+
return /*#__PURE__*/React__default['default'].createElement("option", {
|
|
2780
2835
|
value: v,
|
|
2781
2836
|
key: v
|
|
2782
2837
|
}, dataVerification[v]);
|
|
2783
|
-
}))
|
|
2784
|
-
className: "
|
|
2785
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
2838
|
+
})), ((_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__default['default'].createElement("div", {
|
|
2839
|
+
className: "show-box-item"
|
|
2840
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2841
|
+
className: "data-verification-range"
|
|
2842
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2843
|
+
className: "formulaInputFocus",
|
|
2844
|
+
spellCheck: "false",
|
|
2786
2845
|
value: context.dataVerification.dataRegulation.value1,
|
|
2787
2846
|
placeholder: dataVerification.placeholder1,
|
|
2788
2847
|
onChange: function onChange(e) {
|
|
@@ -2791,28 +2850,39 @@ var DataVerification = function DataVerification() {
|
|
|
2791
2850
|
ctx.dataVerification.dataRegulation.value1 = value;
|
|
2792
2851
|
});
|
|
2793
2852
|
}
|
|
2794
|
-
}), /*#__PURE__*/React__default['default'].createElement("
|
|
2795
|
-
className: "
|
|
2796
|
-
|
|
2797
|
-
|
|
2853
|
+
}), /*#__PURE__*/React__default['default'].createElement("i", {
|
|
2854
|
+
className: "icon",
|
|
2855
|
+
"aria-hidden": "true",
|
|
2856
|
+
onClick: function onClick() {
|
|
2857
|
+
return dataSelectRange("dropDown", context.dataVerification.dataRegulation.value1);
|
|
2858
|
+
},
|
|
2859
|
+
tabIndex: 0
|
|
2860
|
+
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
2861
|
+
name: "tab",
|
|
2862
|
+
width: 18
|
|
2863
|
+
}))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2864
|
+
className: "check"
|
|
2865
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2866
|
+
type: "checkbox",
|
|
2798
2867
|
checked: context.dataVerification.dataRegulation.type2 === "true",
|
|
2799
|
-
|
|
2868
|
+
id: "mul",
|
|
2869
|
+
onChange: function onChange(e) {
|
|
2800
2870
|
var checked = e.target.checked;
|
|
2801
2871
|
setContext(function (ctx) {
|
|
2802
2872
|
ctx.dataVerification.dataRegulation.type2 = "".concat(checked);
|
|
2803
2873
|
});
|
|
2804
2874
|
}
|
|
2805
|
-
}), /*#__PURE__*/React__default['default'].createElement("
|
|
2806
|
-
|
|
2875
|
+
}), /*#__PURE__*/React__default['default'].createElement("label", {
|
|
2876
|
+
htmlFor: "mul"
|
|
2807
2877
|
}, 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__default['default'].createElement("div", {
|
|
2808
|
-
className: "
|
|
2878
|
+
className: "show-box-item"
|
|
2809
2879
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2810
|
-
className: "
|
|
2811
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
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,
|
|
2880
|
+
className: "check-box"
|
|
2881
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", null, dataVerification.selected, " \u2014\u2014 "), /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2882
|
+
type: "text",
|
|
2883
|
+
className: "data-verification-value1",
|
|
2815
2884
|
placeholder: dataVerification.placeholder2,
|
|
2885
|
+
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,
|
|
2816
2886
|
onChange: function onChange(e) {
|
|
2817
2887
|
var value = e.target.value;
|
|
2818
2888
|
setContext(function (ctx) {
|
|
@@ -2820,41 +2890,41 @@ var DataVerification = function DataVerification() {
|
|
|
2820
2890
|
});
|
|
2821
2891
|
}
|
|
2822
2892
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2823
|
-
className: "
|
|
2824
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
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,
|
|
2893
|
+
className: "check-box"
|
|
2894
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", null, dataVerification.notSelected, " \u2014\u2014 "), /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2895
|
+
type: "text",
|
|
2896
|
+
className: "data-verification-value2",
|
|
2828
2897
|
placeholder: dataVerification.placeholder2,
|
|
2898
|
+
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,
|
|
2829
2899
|
onChange: function onChange(e) {
|
|
2830
2900
|
var value = e.target.value;
|
|
2831
2901
|
setContext(function (ctx) {
|
|
2832
2902
|
ctx.dataVerification.dataRegulation.value2 = value;
|
|
2833
2903
|
});
|
|
2834
2904
|
}
|
|
2835
|
-
})))), ((_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) === "
|
|
2836
|
-
className: "
|
|
2837
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
2905
|
+
})))), (((_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__default['default'].createElement("div", {
|
|
2906
|
+
className: "show-box-item"
|
|
2907
|
+
}, /*#__PURE__*/React__default['default'].createElement("select", {
|
|
2908
|
+
className: "data-verification-type-select",
|
|
2838
2909
|
value: context.dataVerification.dataRegulation.type2,
|
|
2839
|
-
|
|
2910
|
+
onChange: function onChange(e) {
|
|
2911
|
+
var value = e.target.value;
|
|
2840
2912
|
setContext(function (ctx) {
|
|
2841
2913
|
ctx.dataVerification.dataRegulation.type2 = value;
|
|
2842
2914
|
ctx.dataVerification.dataRegulation.value1 = "";
|
|
2843
2915
|
ctx.dataVerification.dataRegulation.value2 = "";
|
|
2844
2916
|
});
|
|
2845
2917
|
}
|
|
2846
|
-
},
|
|
2847
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
2918
|
+
}, numberCondition.map(function (v) {
|
|
2919
|
+
return /*#__PURE__*/React__default['default'].createElement("option", {
|
|
2848
2920
|
value: v,
|
|
2849
2921
|
key: v
|
|
2850
2922
|
}, dataVerification[v]);
|
|
2851
|
-
}))
|
|
2852
|
-
className: "
|
|
2853
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2854
|
-
className: "datepicker-toggle"
|
|
2923
|
+
})), context.dataVerification.dataRegulation.type2 === "between" || context.dataVerification.dataRegulation.type2 === "notBetween" ? (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
2924
|
+
className: "input-box"
|
|
2855
2925
|
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2856
|
-
type: "
|
|
2857
|
-
|
|
2926
|
+
type: "number",
|
|
2927
|
+
placeholder: "1",
|
|
2858
2928
|
value: context.dataVerification.dataRegulation.value1,
|
|
2859
2929
|
onChange: function onChange(e) {
|
|
2860
2930
|
var value = e.target.value;
|
|
@@ -2862,13 +2932,97 @@ var DataVerification = function DataVerification() {
|
|
|
2862
2932
|
ctx.dataVerification.dataRegulation.value1 = value;
|
|
2863
2933
|
});
|
|
2864
2934
|
}
|
|
2865
|
-
}), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2935
|
+
}), /*#__PURE__*/React__default['default'].createElement("span", null, "-"), /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2936
|
+
type: "number",
|
|
2937
|
+
placeholder: "100",
|
|
2938
|
+
value: context.dataVerification.dataRegulation.value2,
|
|
2939
|
+
onChange: function onChange(e) {
|
|
2940
|
+
var value = e.target.value;
|
|
2941
|
+
setContext(function (ctx) {
|
|
2942
|
+
ctx.dataVerification.dataRegulation.value2 = value;
|
|
2943
|
+
});
|
|
2944
|
+
}
|
|
2945
|
+
}))) : (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
2946
|
+
className: "input-box"
|
|
2947
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2948
|
+
type: "number",
|
|
2949
|
+
style: {
|
|
2950
|
+
width: "100%"
|
|
2951
|
+
},
|
|
2952
|
+
placeholder: dataVerification.placeholder3,
|
|
2953
|
+
value: context.dataVerification.dataRegulation.value1,
|
|
2954
|
+
onChange: function onChange(e) {
|
|
2955
|
+
var value = e.target.value;
|
|
2956
|
+
setContext(function (ctx) {
|
|
2957
|
+
ctx.dataVerification.dataRegulation.value1 = value;
|
|
2958
|
+
});
|
|
2959
|
+
}
|
|
2960
|
+
}))))), ((_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__default['default'].createElement("div", {
|
|
2961
|
+
className: "show-box-item"
|
|
2962
|
+
}, /*#__PURE__*/React__default['default'].createElement("select", {
|
|
2963
|
+
className: "data-verification-type-select",
|
|
2964
|
+
value: context.dataVerification.dataRegulation.type2,
|
|
2965
|
+
onChange: function onChange(e) {
|
|
2966
|
+
var value = e.target.value;
|
|
2967
|
+
setContext(function (ctx) {
|
|
2968
|
+
ctx.dataVerification.dataRegulation.type2 = value;
|
|
2969
|
+
ctx.dataVerification.dataRegulation.value1 = "";
|
|
2970
|
+
ctx.dataVerification.dataRegulation.value2 = "";
|
|
2971
|
+
});
|
|
2972
|
+
}
|
|
2973
|
+
}, ["include", "exclude", "equal"].map(function (v) {
|
|
2974
|
+
return /*#__PURE__*/React__default['default'].createElement("option", {
|
|
2975
|
+
value: v,
|
|
2976
|
+
key: v
|
|
2977
|
+
}, dataVerification[v]);
|
|
2978
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2979
|
+
className: "input-box"
|
|
2980
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2981
|
+
type: "text",
|
|
2982
|
+
style: {
|
|
2983
|
+
width: "100%"
|
|
2984
|
+
},
|
|
2985
|
+
placeholder: dataVerification.placeholder4,
|
|
2986
|
+
value: context.dataVerification.dataRegulation.value1,
|
|
2987
|
+
onChange: function onChange(e) {
|
|
2988
|
+
var value = e.target.value;
|
|
2989
|
+
setContext(function (ctx) {
|
|
2990
|
+
ctx.dataVerification.dataRegulation.value1 = value;
|
|
2991
|
+
});
|
|
2992
|
+
}
|
|
2993
|
+
})))), ((_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__default['default'].createElement("div", {
|
|
2994
|
+
className: "show-box-item"
|
|
2995
|
+
}, /*#__PURE__*/React__default['default'].createElement("select", {
|
|
2996
|
+
className: "data-verification-type-select",
|
|
2997
|
+
value: context.dataVerification.dataRegulation.type2,
|
|
2998
|
+
onChange: function onChange(e) {
|
|
2999
|
+
var value = e.target.value;
|
|
3000
|
+
setContext(function (ctx) {
|
|
3001
|
+
ctx.dataVerification.dataRegulation.type2 = value;
|
|
3002
|
+
ctx.dataVerification.dataRegulation.value1 = "";
|
|
3003
|
+
ctx.dataVerification.dataRegulation.value2 = "";
|
|
3004
|
+
});
|
|
3005
|
+
}
|
|
3006
|
+
}, dateCondition.map(function (v) {
|
|
3007
|
+
return /*#__PURE__*/React__default['default'].createElement("option", {
|
|
3008
|
+
value: v,
|
|
3009
|
+
key: v
|
|
3010
|
+
}, dataVerification[v]);
|
|
3011
|
+
})), context.dataVerification.dataRegulation.type2 === "between" || context.dataVerification.dataRegulation.type2 === "notBetween" ? (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
3012
|
+
className: "input-box"
|
|
2869
3013
|
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2870
3014
|
type: "date",
|
|
2871
|
-
|
|
3015
|
+
placeholder: "1",
|
|
3016
|
+
value: context.dataVerification.dataRegulation.value1,
|
|
3017
|
+
onChange: function onChange(e) {
|
|
3018
|
+
var value = e.target.value;
|
|
3019
|
+
setContext(function (ctx) {
|
|
3020
|
+
ctx.dataVerification.dataRegulation.value1 = value;
|
|
3021
|
+
});
|
|
3022
|
+
}
|
|
3023
|
+
}), /*#__PURE__*/React__default['default'].createElement("span", null, "-"), /*#__PURE__*/React__default['default'].createElement("input", {
|
|
3024
|
+
type: "date",
|
|
3025
|
+
placeholder: "100",
|
|
2872
3026
|
value: context.dataVerification.dataRegulation.value2,
|
|
2873
3027
|
onChange: function onChange(e) {
|
|
2874
3028
|
var value = e.target.value;
|
|
@@ -2876,15 +3030,13 @@ var DataVerification = function DataVerification() {
|
|
|
2876
3030
|
ctx.dataVerification.dataRegulation.value2 = value;
|
|
2877
3031
|
});
|
|
2878
3032
|
}
|
|
2879
|
-
})
|
|
2880
|
-
className: "
|
|
2881
|
-
})))) : (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
2882
|
-
className: "mt-4"
|
|
2883
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2884
|
-
className: "datepicker-toggle"
|
|
3033
|
+
}))) : (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
3034
|
+
className: "input-box"
|
|
2885
3035
|
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
2886
3036
|
type: "date",
|
|
2887
|
-
|
|
3037
|
+
style: {
|
|
3038
|
+
width: "100%"
|
|
3039
|
+
},
|
|
2888
3040
|
placeholder: dataVerification.placeholder3,
|
|
2889
3041
|
value: context.dataVerification.dataRegulation.value1,
|
|
2890
3042
|
onChange: function onChange(e) {
|
|
@@ -2893,35 +3045,57 @@ var DataVerification = function DataVerification() {
|
|
|
2893
3045
|
ctx.dataVerification.dataRegulation.value1 = value;
|
|
2894
3046
|
});
|
|
2895
3047
|
}
|
|
2896
|
-
}), /*#__PURE__*/React__default['default'].createElement("
|
|
2897
|
-
className: "
|
|
2898
|
-
}
|
|
2899
|
-
className: "
|
|
2900
|
-
|
|
2901
|
-
|
|
3048
|
+
}))))), ((_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__default['default'].createElement("div", {
|
|
3049
|
+
className: "show-box-item"
|
|
3050
|
+
}, /*#__PURE__*/React__default['default'].createElement("select", {
|
|
3051
|
+
className: "data-verification-type-select",
|
|
3052
|
+
value: context.dataVerification.dataRegulation.type2,
|
|
3053
|
+
onChange: function onChange(e) {
|
|
3054
|
+
var value = e.target.value;
|
|
3055
|
+
setContext(function (ctx) {
|
|
3056
|
+
ctx.dataVerification.dataRegulation.type2 = value;
|
|
3057
|
+
ctx.dataVerification.dataRegulation.value1 = "";
|
|
3058
|
+
ctx.dataVerification.dataRegulation.value2 = "";
|
|
3059
|
+
});
|
|
3060
|
+
}
|
|
3061
|
+
}, ["identificationNumber", "phoneNumber"].map(function (v) {
|
|
3062
|
+
return /*#__PURE__*/React__default['default'].createElement("option", {
|
|
3063
|
+
value: v,
|
|
3064
|
+
key: v
|
|
3065
|
+
}, dataVerification[v]);
|
|
3066
|
+
}))))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3067
|
+
className: "box-item"
|
|
2902
3068
|
}, ["prohibitInput", "hintShow"].map(function (v) {
|
|
2903
3069
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
2907
|
-
|
|
3070
|
+
className: "check",
|
|
3071
|
+
key: "div".concat(v)
|
|
3072
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
3073
|
+
type: "checkbox",
|
|
3074
|
+
id: v,
|
|
3075
|
+
key: "input".concat(v),
|
|
2908
3076
|
checked: context.dataVerification.dataRegulation[v],
|
|
2909
|
-
|
|
2910
|
-
var checked = e.target.checked;
|
|
3077
|
+
onChange: function onChange() {
|
|
2911
3078
|
setContext(function (ctx) {
|
|
2912
3079
|
var _ctx$dataVerification5;
|
|
2913
3080
|
var dataRegulation = (_ctx$dataVerification5 = ctx.dataVerification) === null || _ctx$dataVerification5 === void 0 ? void 0 : _ctx$dataVerification5.dataRegulation;
|
|
2914
3081
|
if (v === "prohibitInput") {
|
|
2915
|
-
dataRegulation.prohibitInput =
|
|
3082
|
+
dataRegulation.prohibitInput = !dataRegulation.prohibitInput;
|
|
2916
3083
|
} else if (v === "hintShow") {
|
|
2917
|
-
dataRegulation.hintShow =
|
|
3084
|
+
dataRegulation.hintShow = !dataRegulation.hintShow;
|
|
2918
3085
|
}
|
|
2919
3086
|
});
|
|
2920
3087
|
}
|
|
2921
|
-
}), /*#__PURE__*/React__default['default'].createElement("
|
|
2922
|
-
|
|
3088
|
+
}), /*#__PURE__*/React__default['default'].createElement("label", {
|
|
3089
|
+
htmlFor: v,
|
|
3090
|
+
key: "label".concat(v)
|
|
2923
3091
|
}, dataVerification[v]));
|
|
2924
|
-
}), ((_context$
|
|
3092
|
+
}), ((_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__default['default'].createElement("div", {
|
|
3093
|
+
className: "input-box"
|
|
3094
|
+
}, /*#__PURE__*/React__default['default'].createElement("input", {
|
|
3095
|
+
type: "text",
|
|
3096
|
+
style: {
|
|
3097
|
+
width: "100%"
|
|
3098
|
+
},
|
|
2925
3099
|
placeholder: dataVerification.placeholder5,
|
|
2926
3100
|
value: context.dataVerification.dataRegulation.hintValue,
|
|
2927
3101
|
onChange: function onChange(e) {
|
|
@@ -2930,37 +3104,25 @@ var DataVerification = function DataVerification() {
|
|
|
2930
3104
|
ctx.dataVerification.dataRegulation.hintValue = value;
|
|
2931
3105
|
});
|
|
2932
3106
|
}
|
|
2933
|
-
}))))), /*#__PURE__*/React__default['default'].createElement(
|
|
2934
|
-
className: "
|
|
2935
|
-
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2936
|
-
className: "flex gap-2 justify-between items-center"
|
|
2937
|
-
}, /*#__PURE__*/React__default['default'].createElement(ui.Button, {
|
|
2938
|
-
variant: "secondary",
|
|
2939
|
-
style: {
|
|
2940
|
-
minWidth: "80px"
|
|
2941
|
-
},
|
|
3107
|
+
}))))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3108
|
+
className: "button-basic button-primary",
|
|
2942
3109
|
onClick: function onClick() {
|
|
2943
|
-
btn("
|
|
2944
|
-
}
|
|
2945
|
-
}, button.cancel), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2946
|
-
className: "flex gap-2"
|
|
2947
|
-
}, /*#__PURE__*/React__default['default'].createElement(ui.Button, {
|
|
2948
|
-
variant: "secondary",
|
|
2949
|
-
style: {
|
|
2950
|
-
minWidth: "80px"
|
|
3110
|
+
btn("confirm");
|
|
2951
3111
|
},
|
|
3112
|
+
tabIndex: 0
|
|
3113
|
+
}, button.confirm), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3114
|
+
className: "button-basic button-close",
|
|
2952
3115
|
onClick: function onClick() {
|
|
2953
3116
|
btn("delete");
|
|
2954
|
-
}
|
|
2955
|
-
}, dataVerification.deleteVerification), /*#__PURE__*/React__default['default'].createElement(ui.Button, {
|
|
2956
|
-
variant: "default",
|
|
2957
|
-
style: {
|
|
2958
|
-
minWidth: "80px"
|
|
2959
3117
|
},
|
|
3118
|
+
tabIndex: 0
|
|
3119
|
+
}, dataVerification.deleteVerification), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3120
|
+
className: "button-basic button-close",
|
|
2960
3121
|
onClick: function onClick() {
|
|
2961
|
-
btn("
|
|
2962
|
-
}
|
|
2963
|
-
|
|
3122
|
+
btn("close");
|
|
3123
|
+
},
|
|
3124
|
+
tabIndex: 0
|
|
3125
|
+
}, button.cancel));
|
|
2964
3126
|
};
|
|
2965
3127
|
|
|
2966
3128
|
function getDisplayedRangeTxt(context) {
|
|
@@ -2972,7 +3134,12 @@ function getDisplayedRangeTxt(context) {
|
|
|
2972
3134
|
return (_context$rangeDialog$ = (_context$rangeDialog = context.rangeDialog) === null || _context$rangeDialog === void 0 ? void 0 : _context$rangeDialog.rangeTxt) !== null && _context$rangeDialog$ !== void 0 ? _context$rangeDialog$ : "";
|
|
2973
3135
|
}
|
|
2974
3136
|
|
|
2975
|
-
|
|
3137
|
+
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";
|
|
3138
|
+
if (typeof document !== "undefined") {
|
|
3139
|
+
var styleSheet = document.createElement("style");
|
|
3140
|
+
styleSheet.textContent = datepickerStyles;
|
|
3141
|
+
document.head.appendChild(styleSheet);
|
|
3142
|
+
}
|
|
2976
3143
|
var ConditionRules = function ConditionRules(_ref) {
|
|
2977
3144
|
var type = _ref.type;
|
|
2978
3145
|
var _useContext = React.useContext(WorkbookContext),
|
|
@@ -3293,8 +3460,7 @@ var RangeDialog = function RangeDialog() {
|
|
|
3293
3460
|
showDialog = _useDialog.showDialog;
|
|
3294
3461
|
var _locale = fortuneCore.locale(context),
|
|
3295
3462
|
dataVerification = _locale.dataVerification,
|
|
3296
|
-
button = _locale.button
|
|
3297
|
-
toolbar = _locale.toolbar;
|
|
3463
|
+
button = _locale.button;
|
|
3298
3464
|
var _useState = React.useState(getDisplayedRangeTxt(context)),
|
|
3299
3465
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3300
3466
|
rangeTxt2 = _useState2[0],
|
|
@@ -3319,7 +3485,7 @@ var RangeDialog = function RangeDialog() {
|
|
|
3319
3485
|
}), undefined, fortuneCore.locale(context).conditionformat["conditionformat_".concat(rulesType)]);
|
|
3320
3486
|
return;
|
|
3321
3487
|
}
|
|
3322
|
-
showDialog(/*#__PURE__*/React__default['default'].createElement(DataVerification, null)
|
|
3488
|
+
showDialog(/*#__PURE__*/React__default['default'].createElement(DataVerification, null));
|
|
3323
3489
|
}, [setContext, showDialog, context]);
|
|
3324
3490
|
React.useEffect(function () {
|
|
3325
3491
|
setRangeTxt2(getDisplayedRangeTxt(context));
|
|
@@ -3508,7 +3674,7 @@ var DropDownList = function DropDownList() {
|
|
|
3508
3674
|
arr.splice(index, 1);
|
|
3509
3675
|
}
|
|
3510
3676
|
setSelected(arr);
|
|
3511
|
-
fortuneCore.
|
|
3677
|
+
fortuneCore.setDropcownValue(ctx, v, arr);
|
|
3512
3678
|
});
|
|
3513
3679
|
},
|
|
3514
3680
|
tabIndex: 0
|
|
@@ -3523,118 +3689,6 @@ var DropDownList = function DropDownList() {
|
|
|
3523
3689
|
}));
|
|
3524
3690
|
};
|
|
3525
3691
|
|
|
3526
|
-
var IframeBoxs = function IframeBoxs() {
|
|
3527
|
-
var _context$insertedIfra;
|
|
3528
|
-
var _useContext = React.useContext(WorkbookContext),
|
|
3529
|
-
context = _useContext.context,
|
|
3530
|
-
setContext = _useContext.setContext,
|
|
3531
|
-
refs = _useContext.refs;
|
|
3532
|
-
var containerRef = React.useRef(null);
|
|
3533
|
-
React.useEffect(function () {
|
|
3534
|
-
var handleClickOutside = function handleClickOutside(e) {
|
|
3535
|
-
if (!containerRef.current) return;
|
|
3536
|
-
var iframeBoxes = containerRef.current.querySelectorAll(".luckysheet-modal-dialog-iframe");
|
|
3537
|
-
var clickedInsideSomeIframe = Array.from(iframeBoxes).some(function (el) {
|
|
3538
|
-
return el.contains(e.target);
|
|
3539
|
-
});
|
|
3540
|
-
if (!clickedInsideSomeIframe && context.activeIframe !== undefined) {
|
|
3541
|
-
setContext(function (ctx) {
|
|
3542
|
-
ctx.activeIframe = undefined;
|
|
3543
|
-
});
|
|
3544
|
-
}
|
|
3545
|
-
};
|
|
3546
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
3547
|
-
return function () {
|
|
3548
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
3549
|
-
};
|
|
3550
|
-
}, [context.activeIframe, setContext]);
|
|
3551
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3552
|
-
id: "fortune-iframe-boxes",
|
|
3553
|
-
ref: containerRef
|
|
3554
|
-
}, (_context$insertedIfra = context.insertedIframes) === null || _context$insertedIfra === void 0 ? void 0 : _context$insertedIfra.map(function (frame) {
|
|
3555
|
-
var isActive = frame.id === context.activeIframe;
|
|
3556
|
-
var style = {
|
|
3557
|
-
width: frame.width * context.zoomRatio,
|
|
3558
|
-
height: frame.height * context.zoomRatio,
|
|
3559
|
-
left: frame.left * context.zoomRatio,
|
|
3560
|
-
top: frame.top * context.zoomRatio,
|
|
3561
|
-
position: "absolute",
|
|
3562
|
-
padding: 0,
|
|
3563
|
-
zIndex: isActive ? 300 : 200
|
|
3564
|
-
};
|
|
3565
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3566
|
-
key: frame.id,
|
|
3567
|
-
id: isActive ? "fortune-modal-dialog-activeIframe" : frame.id,
|
|
3568
|
-
className: "luckysheet-modal-dialog luckysheet-modal-dialog-iframe",
|
|
3569
|
-
style: style,
|
|
3570
|
-
onClick: function onClick(e) {
|
|
3571
|
-
if (!isActive) {
|
|
3572
|
-
setContext(function (ctx) {
|
|
3573
|
-
ctx.activeIframe = frame.id;
|
|
3574
|
-
});
|
|
3575
|
-
}
|
|
3576
|
-
e.stopPropagation();
|
|
3577
|
-
},
|
|
3578
|
-
onMouseDown: function onMouseDown(e) {
|
|
3579
|
-
if (isActive) {
|
|
3580
|
-
fortuneCore.onIframeMoveStart(context, refs.globalCache, e.nativeEvent);
|
|
3581
|
-
}
|
|
3582
|
-
e.stopPropagation();
|
|
3583
|
-
}
|
|
3584
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3585
|
-
className: "luckysheet-modal-dialog-content",
|
|
3586
|
-
style: {
|
|
3587
|
-
width: "100%",
|
|
3588
|
-
height: "100%",
|
|
3589
|
-
overflow: "hidden"
|
|
3590
|
-
}
|
|
3591
|
-
}, /*#__PURE__*/React__default['default'].createElement("iframe", {
|
|
3592
|
-
title: "iframe-".concat(frame.id),
|
|
3593
|
-
src: frame.src,
|
|
3594
|
-
style: {
|
|
3595
|
-
width: "100%",
|
|
3596
|
-
height: "100%",
|
|
3597
|
-
border: "none",
|
|
3598
|
-
pointerEvents: "none"
|
|
3599
|
-
}
|
|
3600
|
-
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3601
|
-
className: "luckysheet-modal-dialog-border"
|
|
3602
|
-
}), isActive && (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3603
|
-
className: "luckysheet-modal-dialog-resize"
|
|
3604
|
-
}, ["lt", "mt", "lm", "rm", "rt", "lb", "mb", "rb"].map(function (dir) {
|
|
3605
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3606
|
-
key: dir,
|
|
3607
|
-
className: "luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-".concat(dir),
|
|
3608
|
-
"data-type": dir,
|
|
3609
|
-
style: {
|
|
3610
|
-
zIndex: 300,
|
|
3611
|
-
position: "absolute"
|
|
3612
|
-
},
|
|
3613
|
-
onMouseDown: function onMouseDown(e) {
|
|
3614
|
-
fortuneCore.onIframeResizeStart(context, refs.globalCache, e.nativeEvent, dir);
|
|
3615
|
-
e.stopPropagation();
|
|
3616
|
-
}
|
|
3617
|
-
});
|
|
3618
|
-
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3619
|
-
className: "luckysheet-modal-dialog-controll"
|
|
3620
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
3621
|
-
className: "luckysheet-modal-controll-btn luckysheet-modal-controll-del",
|
|
3622
|
-
role: "button",
|
|
3623
|
-
tabIndex: 0,
|
|
3624
|
-
title: "Delete",
|
|
3625
|
-
onClick: function onClick() {
|
|
3626
|
-
setContext(function (ctx) {
|
|
3627
|
-
var _ctx$insertedIframes;
|
|
3628
|
-
ctx.insertedIframes = ctx === null || ctx === void 0 ? void 0 : (_ctx$insertedIframes = ctx.insertedIframes) === null || _ctx$insertedIframes === void 0 ? void 0 : _ctx$insertedIframes.filter(function (f) {
|
|
3629
|
-
return f.id !== frame.id;
|
|
3630
|
-
});
|
|
3631
|
-
ctx.activeIframe = undefined;
|
|
3632
|
-
});
|
|
3633
|
-
}
|
|
3634
|
-
}, "DELETE")))));
|
|
3635
|
-
}));
|
|
3636
|
-
};
|
|
3637
|
-
|
|
3638
3692
|
var SheetOverlay = function SheetOverlay() {
|
|
3639
3693
|
var _refs$cellArea$curren, _refs$cellArea$curren2, _context$luckysheet_s, _context$luckysheet_s2, _context$luckysheet_s3, _context$luckysheet_s4, _context$luckysheet_s5, _context$luckysheet_s6, _context$presences$le, _context$presences, _context$linkCard, _context$rangeDialog;
|
|
3640
3694
|
var _useContext = React.useContext(WorkbookContext),
|
|
@@ -4077,7 +4131,7 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
4077
4131
|
id: "luckysheet-multipleRange-show"
|
|
4078
4132
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4079
4133
|
id: "luckysheet-dynamicArray-hightShow"
|
|
4080
|
-
}), /*#__PURE__*/React__default['default'].createElement(ImgBoxs, null), /*#__PURE__*/React__default['default'].createElement(
|
|
4134
|
+
}), /*#__PURE__*/React__default['default'].createElement(ImgBoxs, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4081
4135
|
id: "luckysheet-dataVerification-dropdown-btn",
|
|
4082
4136
|
onClick: function onClick() {
|
|
4083
4137
|
setContext(function (ctx) {
|
|
@@ -4090,9 +4144,8 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
4090
4144
|
display: "none"
|
|
4091
4145
|
}
|
|
4092
4146
|
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
4093
|
-
name: "
|
|
4094
|
-
width: 16
|
|
4095
|
-
height: 16
|
|
4147
|
+
name: "combo-arrow",
|
|
4148
|
+
width: 16
|
|
4096
4149
|
})), context.dataVerificationDropDownList && /*#__PURE__*/React__default['default'].createElement(DropDownList, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4097
4150
|
id: "luckysheet-dataVerification-showHintBox",
|
|
4098
4151
|
className: "luckysheet-mousedown-cancel",
|
|
@@ -4326,6 +4379,9 @@ var Sheet = function Sheet(_ref) {
|
|
|
4326
4379
|
}
|
|
4327
4380
|
}, [context, refs.canvas, refs.globalCache.freezen, setContext, sheet.id]);
|
|
4328
4381
|
var onWheel = React.useCallback(function (e) {
|
|
4382
|
+
var el = document.getElementById("function-details");
|
|
4383
|
+
var isMouseOver = el === null || el === void 0 ? void 0 : el.matches(":hover");
|
|
4384
|
+
if (el && isMouseOver) return;
|
|
4329
4385
|
setContext(function (draftCtx) {
|
|
4330
4386
|
fortuneCore.handleGlobalWheel(draftCtx, e, refs.globalCache, refs.scrollbarX.current, refs.scrollbarY.current);
|
|
4331
4387
|
});
|
|
@@ -4411,9 +4467,6 @@ var Combo = function Combo(_ref) {
|
|
|
4411
4467
|
setPopupPosition = _useState4[1];
|
|
4412
4468
|
var popupRef = React.useRef(null);
|
|
4413
4469
|
var buttonRef = React.useRef(null);
|
|
4414
|
-
var isLucideIcon = React.useMemo(function () {
|
|
4415
|
-
return (iconId === null || iconId === void 0 ? void 0 : iconId.startsWith("align-")) || ["text-overflow", "text-wrap", "text-clip"].includes(iconId);
|
|
4416
|
-
}, [iconId]);
|
|
4417
4470
|
useOutsideClick(popupRef, function () {
|
|
4418
4471
|
setOpen(false);
|
|
4419
4472
|
});
|
|
@@ -4441,7 +4494,7 @@ var Combo = function Combo(_ref) {
|
|
|
4441
4494
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4442
4495
|
ref: buttonRef,
|
|
4443
4496
|
className: "fortune-toolbar-combo"
|
|
4444
|
-
},
|
|
4497
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4445
4498
|
className: "fortune-toolbar-combo-button",
|
|
4446
4499
|
onClick: function onClick(e) {
|
|
4447
4500
|
if (_onClick) {
|
|
@@ -4460,13 +4513,7 @@ var Combo = function Combo(_ref) {
|
|
|
4460
4513
|
name: iconId
|
|
4461
4514
|
})) : (/*#__PURE__*/React__default['default'].createElement("span", {
|
|
4462
4515
|
className: "fortune-toolbar-combo-text"
|
|
4463
|
-
}, text !== undefined ? text : "")))
|
|
4464
|
-
icon: getIcon(iconId),
|
|
4465
|
-
variant: "ghost",
|
|
4466
|
-
onClick: function onClick() {
|
|
4467
|
-
return setOpen(!open);
|
|
4468
|
-
}
|
|
4469
|
-
})), showArrow && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
4516
|
+
}, text !== undefined ? text : ""))), showArrow && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
4470
4517
|
className: "fortune-toolbar-combo-arrow",
|
|
4471
4518
|
onClick: function onClick() {
|
|
4472
4519
|
return setOpen(!open);
|
|
@@ -5371,121 +5418,6 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
5371
5418
|
}, button.cancel)));
|
|
5372
5419
|
};
|
|
5373
5420
|
|
|
5374
|
-
var DuneChartsInputModal = function DuneChartsInputModal(_ref) {
|
|
5375
|
-
var isOpen = _ref.isOpen,
|
|
5376
|
-
onClose = _ref.onClose,
|
|
5377
|
-
onSubmit = _ref.onSubmit,
|
|
5378
|
-
icon = _ref.icon,
|
|
5379
|
-
_ref$submitText = _ref.submitText,
|
|
5380
|
-
submitText = _ref$submitText === void 0 ? "Submit" : _ref$submitText,
|
|
5381
|
-
_ref$placeholder = _ref.placeholder,
|
|
5382
|
-
placeholder = _ref$placeholder === void 0 ? "Enter a value..." : _ref$placeholder;
|
|
5383
|
-
var _useState = React.useState(""),
|
|
5384
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
5385
|
-
url = _useState2[0],
|
|
5386
|
-
setUrl = _useState2[1];
|
|
5387
|
-
var _useState3 = React.useState(false),
|
|
5388
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
5389
|
-
showError = _useState4[0],
|
|
5390
|
-
setShowError = _useState4[1];
|
|
5391
|
-
var inputRef = React.useRef(null);
|
|
5392
|
-
React.useEffect(function () {
|
|
5393
|
-
if (isOpen && inputRef.current) {
|
|
5394
|
-
var timer = setTimeout(function () {
|
|
5395
|
-
var _inputRef$current;
|
|
5396
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
5397
|
-
}, 100);
|
|
5398
|
-
return function () {
|
|
5399
|
-
return clearTimeout(timer);
|
|
5400
|
-
};
|
|
5401
|
-
}
|
|
5402
|
-
return undefined;
|
|
5403
|
-
}, [isOpen]);
|
|
5404
|
-
if (!isOpen) return null;
|
|
5405
|
-
var handleSubmit = function handleSubmit() {
|
|
5406
|
-
var trimmed = url.trim();
|
|
5407
|
-
if (trimmed && fortuneCore.sanitizeDuneUrl(trimmed)) {
|
|
5408
|
-
onSubmit(trimmed);
|
|
5409
|
-
setUrl("");
|
|
5410
|
-
setShowError(false);
|
|
5411
|
-
onClose();
|
|
5412
|
-
} else {
|
|
5413
|
-
setShowError(true);
|
|
5414
|
-
}
|
|
5415
|
-
};
|
|
5416
|
-
var handleKeyDown = function handleKeyDown(e) {
|
|
5417
|
-
e.stopPropagation();
|
|
5418
|
-
if (e.key === "Enter") {
|
|
5419
|
-
handleSubmit();
|
|
5420
|
-
}
|
|
5421
|
-
};
|
|
5422
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5423
|
-
className: "custom-overlay",
|
|
5424
|
-
onClick: onClose
|
|
5425
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5426
|
-
className: "input-modal",
|
|
5427
|
-
style: {
|
|
5428
|
-
transformOrigin: "top center"
|
|
5429
|
-
},
|
|
5430
|
-
onClick: function onClick(e) {
|
|
5431
|
-
return e.stopPropagation();
|
|
5432
|
-
},
|
|
5433
|
-
onKeyDown: handleKeyDown
|
|
5434
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5435
|
-
className: "modal-header"
|
|
5436
|
-
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
5437
|
-
name: icon
|
|
5438
|
-
}), /*#__PURE__*/React__default['default'].createElement("input", {
|
|
5439
|
-
ref: inputRef,
|
|
5440
|
-
className: "modal-input",
|
|
5441
|
-
type: "text",
|
|
5442
|
-
placeholder: placeholder,
|
|
5443
|
-
value: url,
|
|
5444
|
-
onChange: function onChange(e) {
|
|
5445
|
-
setUrl(e.target.value);
|
|
5446
|
-
setShowError(false);
|
|
5447
|
-
},
|
|
5448
|
-
onKeyDown: handleKeyDown
|
|
5449
|
-
})), showError && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
5450
|
-
className: "modal-error-message"
|
|
5451
|
-
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
5452
|
-
style: {
|
|
5453
|
-
width: "14px",
|
|
5454
|
-
height: "14px"
|
|
5455
|
-
},
|
|
5456
|
-
name: "circle-alert"
|
|
5457
|
-
}), /*#__PURE__*/React__default['default'].createElement("span", null, "Please make sure the URL is a valid Dune chart link"))), url.length > 0 && !showError && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
5458
|
-
className: "modal-footer"
|
|
5459
|
-
}, /*#__PURE__*/React__default['default'].createElement(ui.Button, {
|
|
5460
|
-
onClick: handleSubmit,
|
|
5461
|
-
className: "modal-button"
|
|
5462
|
-
}, submitText)))));
|
|
5463
|
-
};
|
|
5464
|
-
|
|
5465
|
-
var getIcon = function getIcon(title) {
|
|
5466
|
-
switch (title) {
|
|
5467
|
-
case "align-left":
|
|
5468
|
-
return "AlignLeft";
|
|
5469
|
-
case "align-center":
|
|
5470
|
-
return "AlignCenter";
|
|
5471
|
-
case "align-right":
|
|
5472
|
-
return "AlignRight";
|
|
5473
|
-
case "align-top":
|
|
5474
|
-
return "ArrowUpFromLine";
|
|
5475
|
-
case "align-middle":
|
|
5476
|
-
return "AlignVerticalMiddle";
|
|
5477
|
-
case "align-bottom":
|
|
5478
|
-
return "ArrowDownFromLine";
|
|
5479
|
-
case "text-overflow":
|
|
5480
|
-
return "TextOverflow";
|
|
5481
|
-
case "text-wrap":
|
|
5482
|
-
return "WrapText";
|
|
5483
|
-
case "text-clip":
|
|
5484
|
-
return "TextClip";
|
|
5485
|
-
default:
|
|
5486
|
-
return "";
|
|
5487
|
-
}
|
|
5488
|
-
};
|
|
5489
5421
|
var Toolbar = function Toolbar(_ref) {
|
|
5490
5422
|
var _context$luckysheet_s, _flowdata$row, _settings$customToolb;
|
|
5491
5423
|
var setMoreItems = _ref.setMoreItems,
|
|
@@ -5507,10 +5439,6 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5507
5439
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
5508
5440
|
itemLocations = _useState4[0],
|
|
5509
5441
|
setItemLocations = _useState4[1];
|
|
5510
|
-
var _useState5 = React.useState(false),
|
|
5511
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
5512
|
-
showDuneModal = _useState6[0],
|
|
5513
|
-
setShowDuneModal = _useState6[1];
|
|
5514
5442
|
var _useDialog = useDialog(),
|
|
5515
5443
|
showDialog = _useDialog.showDialog,
|
|
5516
5444
|
hideDialog = _useDialog.hideDialog;
|
|
@@ -5541,12 +5469,12 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5541
5469
|
var sheetWidth = context.luckysheetTableContentHW[0];
|
|
5542
5470
|
var currency = settings.currency;
|
|
5543
5471
|
var defaultFormat = defaultFmt(currency);
|
|
5544
|
-
var
|
|
5472
|
+
var _useState5 = React.useState("#000000"),
|
|
5473
|
+
_useState6 = _slicedToArray(_useState5, 1),
|
|
5474
|
+
customColor = _useState6[0];
|
|
5475
|
+
var _useState7 = React.useState("1"),
|
|
5545
5476
|
_useState8 = _slicedToArray(_useState7, 1),
|
|
5546
|
-
|
|
5547
|
-
var _useState9 = React.useState("1"),
|
|
5548
|
-
_useState0 = _slicedToArray(_useState9, 1),
|
|
5549
|
-
customStyle = _useState0[0];
|
|
5477
|
+
customStyle = _useState8[0];
|
|
5550
5478
|
var showSubMenu = React.useCallback(function (e, className) {
|
|
5551
5479
|
var target = e.target;
|
|
5552
5480
|
var menuItem = target.className === "fortune-toolbar-menu-line" ? target.parentElement : target;
|
|
@@ -5826,38 +5754,27 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5826
5754
|
tooltip: toolbar.horizontalAlign,
|
|
5827
5755
|
showArrow: false
|
|
5828
5756
|
}, function (setOpen) {
|
|
5829
|
-
return /*#__PURE__*/React__default['default'].createElement(Select, {
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
flexDirection: "row",
|
|
5834
|
-
alignItems: "center",
|
|
5835
|
-
justifyContent: "center",
|
|
5836
|
-
gap: 4
|
|
5837
|
-
}
|
|
5838
|
-
}, items.map(function (_ref3) {
|
|
5839
|
-
var _$find2;
|
|
5840
|
-
var title = _ref3.title;
|
|
5841
|
-
return /*#__PURE__*/React__default['default'].createElement(ui.IconButton, {
|
|
5757
|
+
return /*#__PURE__*/React__default['default'].createElement(Select, null, items.map(function (_ref3) {
|
|
5758
|
+
var text = _ref3.text,
|
|
5759
|
+
title = _ref3.title;
|
|
5760
|
+
return /*#__PURE__*/React__default['default'].createElement(Option, {
|
|
5842
5761
|
key: title,
|
|
5843
|
-
isActive: ((_$find2 = ___default['default'].find(items, function (item) {
|
|
5844
|
-
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
|
|
5845
|
-
})) === null || _$find2 === void 0 ? void 0 : _$find2.title) === title,
|
|
5846
|
-
icon: getIcon(title),
|
|
5847
|
-
variant: "ghost",
|
|
5848
5762
|
onClick: function onClick() {
|
|
5849
5763
|
setContext(function (ctx) {
|
|
5850
5764
|
fortuneCore.handleHorizontalAlign(ctx, refs.cellInput.current, title.replace("align-", ""));
|
|
5851
5765
|
});
|
|
5852
5766
|
setOpen(false);
|
|
5853
|
-
}
|
|
5854
|
-
|
|
5855
|
-
|
|
5767
|
+
}
|
|
5768
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5769
|
+
className: "fortune-toolbar-menu-line"
|
|
5770
|
+
}, text, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
5771
|
+
name: title
|
|
5772
|
+
})));
|
|
5856
5773
|
}));
|
|
5857
5774
|
});
|
|
5858
5775
|
}
|
|
5859
5776
|
if (name === "vertical-align") {
|
|
5860
|
-
var _$
|
|
5777
|
+
var _$find2;
|
|
5861
5778
|
var _items = [{
|
|
5862
5779
|
title: "align-top",
|
|
5863
5780
|
text: align.top,
|
|
@@ -5872,40 +5789,29 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5872
5789
|
value: 2
|
|
5873
5790
|
}];
|
|
5874
5791
|
return /*#__PURE__*/React__default['default'].createElement(Combo, {
|
|
5875
|
-
iconId: ((_$
|
|
5792
|
+
iconId: ((_$find2 = ___default['default'].find(_items, function (item) {
|
|
5876
5793
|
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
5877
|
-
})) === null || _$
|
|
5794
|
+
})) === null || _$find2 === void 0 ? void 0 : _$find2.title) || "align-top",
|
|
5878
5795
|
key: name,
|
|
5879
5796
|
tooltip: toolbar.verticalAlign,
|
|
5880
5797
|
showArrow: false
|
|
5881
5798
|
}, function (setOpen) {
|
|
5882
|
-
return /*#__PURE__*/React__default['default'].createElement(Select, {
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
flexDirection: "row",
|
|
5887
|
-
alignItems: "center",
|
|
5888
|
-
justifyContent: "center",
|
|
5889
|
-
gap: 4
|
|
5890
|
-
}
|
|
5891
|
-
}, _items.map(function (_ref4) {
|
|
5892
|
-
var _$find4;
|
|
5893
|
-
var title = _ref4.title;
|
|
5894
|
-
return /*#__PURE__*/React__default['default'].createElement(ui.IconButton, {
|
|
5799
|
+
return /*#__PURE__*/React__default['default'].createElement(Select, null, _items.map(function (_ref4) {
|
|
5800
|
+
var text = _ref4.text,
|
|
5801
|
+
title = _ref4.title;
|
|
5802
|
+
return /*#__PURE__*/React__default['default'].createElement(Option, {
|
|
5895
5803
|
key: title,
|
|
5896
|
-
isActive: ((_$find4 = ___default['default'].find(_items, function (item) {
|
|
5897
|
-
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
5898
|
-
})) === null || _$find4 === void 0 ? void 0 : _$find4.title) === title,
|
|
5899
|
-
icon: getIcon(title),
|
|
5900
|
-
variant: "ghost",
|
|
5901
5804
|
onClick: function onClick() {
|
|
5902
5805
|
setContext(function (ctx) {
|
|
5903
5806
|
fortuneCore.handleVerticalAlign(ctx, refs.cellInput.current, title.replace("align-", ""));
|
|
5904
5807
|
});
|
|
5905
5808
|
setOpen(false);
|
|
5906
|
-
}
|
|
5907
|
-
|
|
5908
|
-
|
|
5809
|
+
}
|
|
5810
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5811
|
+
className: "fortune-toolbar-menu-line"
|
|
5812
|
+
}, text, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
5813
|
+
name: title
|
|
5814
|
+
})));
|
|
5909
5815
|
}));
|
|
5910
5816
|
});
|
|
5911
5817
|
}
|
|
@@ -5980,7 +5886,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5980
5886
|
key: name,
|
|
5981
5887
|
onClick: function onClick() {
|
|
5982
5888
|
if (context.allowEdit === false) return;
|
|
5983
|
-
showDialog(/*#__PURE__*/React__default['default'].createElement(DataVerification, null)
|
|
5889
|
+
showDialog(/*#__PURE__*/React__default['default'].createElement(DataVerification, null));
|
|
5984
5890
|
}
|
|
5985
5891
|
});
|
|
5986
5892
|
}
|
|
@@ -6454,23 +6360,12 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6454
6360
|
tooltip: toolbar.textWrap,
|
|
6455
6361
|
showArrow: false
|
|
6456
6362
|
}, function (setOpen) {
|
|
6457
|
-
return /*#__PURE__*/React__default['default'].createElement(Select, {
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
display: "flex",
|
|
6461
|
-
flexDirection: "row",
|
|
6462
|
-
alignItems: "center",
|
|
6463
|
-
justifyContent: "center",
|
|
6464
|
-
gap: 4
|
|
6465
|
-
}
|
|
6466
|
-
}, _items6.map(function (_ref1) {
|
|
6467
|
-
var iconId = _ref1.iconId,
|
|
6363
|
+
return /*#__PURE__*/React__default['default'].createElement(Select, null, _items6.map(function (_ref1) {
|
|
6364
|
+
var text = _ref1.text,
|
|
6365
|
+
iconId = _ref1.iconId,
|
|
6468
6366
|
value = _ref1.value;
|
|
6469
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
6367
|
+
return /*#__PURE__*/React__default['default'].createElement(Option, {
|
|
6470
6368
|
key: value,
|
|
6471
|
-
isActive: _curr.value === value,
|
|
6472
|
-
icon: getIcon(iconId),
|
|
6473
|
-
variant: "ghost",
|
|
6474
6369
|
onClick: function onClick() {
|
|
6475
6370
|
setContext(function (ctx) {
|
|
6476
6371
|
var d = fortuneCore.getFlowdata(ctx);
|
|
@@ -6478,9 +6373,12 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6478
6373
|
fortuneCore.updateFormat(ctx, refs.cellInput.current, d, "tb", value);
|
|
6479
6374
|
});
|
|
6480
6375
|
setOpen(false);
|
|
6481
|
-
}
|
|
6482
|
-
|
|
6483
|
-
|
|
6376
|
+
}
|
|
6377
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
6378
|
+
className: "fortune-toolbar-menu-line"
|
|
6379
|
+
}, text, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
6380
|
+
name: iconId
|
|
6381
|
+
})));
|
|
6484
6382
|
}));
|
|
6485
6383
|
});
|
|
6486
6384
|
}
|
|
@@ -6631,7 +6529,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6631
6529
|
});
|
|
6632
6530
|
}
|
|
6633
6531
|
});
|
|
6634
|
-
}, [toolbar, cell, setContext, refs.cellInput, refs.fxInput, refs.globalCache, defaultFormat, align, handleUndo, handleRedo, flowdata, formula,
|
|
6532
|
+
}, [toolbar, cell, setContext, refs.cellInput, refs.fxInput, refs.globalCache, defaultFormat, 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, comment, fontarray, hideSubMenu, showSubMenu, refs.canvas, customColor, customStyle, toolbarFormat.moreCurrency]);
|
|
6635
6533
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
6636
6534
|
ref: containerRef,
|
|
6637
6535
|
className: "fortune-toolbar",
|
|
@@ -6686,29 +6584,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6686
6584
|
icon: n.icon,
|
|
6687
6585
|
iconName: n.iconName
|
|
6688
6586
|
}, n.children);
|
|
6689
|
-
})
|
|
6690
|
-
iconId: "dune-logo",
|
|
6691
|
-
tooltip: "Insert Dune Chart",
|
|
6692
|
-
key: "dune-charts",
|
|
6693
|
-
onClick: function onClick() {
|
|
6694
|
-
if (context.allowEdit === false) return;
|
|
6695
|
-
setShowDuneModal(true);
|
|
6696
|
-
}
|
|
6697
|
-
}), showDuneModal && (/*#__PURE__*/React__default['default'].createElement(DuneChartsInputModal, {
|
|
6698
|
-
isOpen: showDuneModal,
|
|
6699
|
-
onSubmit: function onSubmit(url) {
|
|
6700
|
-
setContext(function (draftCtx) {
|
|
6701
|
-
fortuneCore.insertDuneChart(draftCtx, url);
|
|
6702
|
-
});
|
|
6703
|
-
setShowDuneModal(false);
|
|
6704
|
-
},
|
|
6705
|
-
onClose: function onClose() {
|
|
6706
|
-
return setShowDuneModal(false);
|
|
6707
|
-
},
|
|
6708
|
-
icon: "dune-logo",
|
|
6709
|
-
placeholder: "Add Dune chart link to embed",
|
|
6710
|
-
submitText: "Embed Dune chart"
|
|
6711
|
-
})));
|
|
6587
|
+
}));
|
|
6712
6588
|
};
|
|
6713
6589
|
|
|
6714
6590
|
var LocationBox = function LocationBox() {
|
|
@@ -9839,74 +9715,6 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9839
9715
|
"clip-rule": "evenodd",
|
|
9840
9716
|
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",
|
|
9841
9717
|
fill: "#363B3F"
|
|
9842
|
-
})), /*#__PURE__*/React__default['default'].createElement("symbol", {
|
|
9843
|
-
id: "dune-logo",
|
|
9844
|
-
viewBox: "0 0 18 16",
|
|
9845
|
-
fill: "none"
|
|
9846
|
-
}, /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
9847
|
-
width: "18",
|
|
9848
|
-
height: "16",
|
|
9849
|
-
viewBox: "0 0 18 16",
|
|
9850
|
-
fill: "none",
|
|
9851
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
9852
|
-
}, /*#__PURE__*/React__default['default'].createElement("g", {
|
|
9853
|
-
"clip-path": "url(#clip0_80_246690)"
|
|
9854
|
-
}, /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9855
|
-
d: "M7.99485 15.9875C12.4102 15.9875 15.9896 12.4085 15.9896 7.99373C15.9896 3.57891 12.4102 0 7.99485 0C3.57941 0 0 3.57891 0 7.99373C0 12.4085 3.57941 15.9875 7.99485 15.9875Z",
|
|
9856
|
-
fill: "#F4603E"
|
|
9857
|
-
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9858
|
-
d: "M1.39258 12.5028C1.39258 12.5028 6.67562 10.7723 15.9868 7.73633C15.9868 7.73633 16.4968 12.7082 11.3424 15.3015C11.3424 15.3015 8.80068 16.5197 6.01215 15.7383C6.01215 15.7383 3.23545 15.2142 1.39258 12.5028Z",
|
|
9859
|
-
fill: "#1E1870"
|
|
9860
|
-
})), /*#__PURE__*/React__default['default'].createElement("defs", null, /*#__PURE__*/React__default['default'].createElement("clipPath", {
|
|
9861
|
-
id: "clip0_80_246690"
|
|
9862
|
-
}, /*#__PURE__*/React__default['default'].createElement("rect", {
|
|
9863
|
-
width: "16",
|
|
9864
|
-
height: "16",
|
|
9865
|
-
fill: "white"
|
|
9866
|
-
}))))), /*#__PURE__*/React__default['default'].createElement("symbol", {
|
|
9867
|
-
id: "circle-alert",
|
|
9868
|
-
viewBox: "0 0 14 14",
|
|
9869
|
-
fill: "none"
|
|
9870
|
-
}, /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
9871
|
-
width: "14",
|
|
9872
|
-
height: "14",
|
|
9873
|
-
viewBox: "0 0 14 14",
|
|
9874
|
-
fill: "none",
|
|
9875
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
9876
|
-
}, /*#__PURE__*/React__default['default'].createElement("g", {
|
|
9877
|
-
"clip-path": "url(#clip0_138_127604)"
|
|
9878
|
-
}, /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9879
|
-
d: "M6.99967 4.0835C7.32184 4.0835 7.58301 4.34466 7.58301 4.66683V7.00016C7.58301 7.32233 7.32184 7.5835 6.99967 7.5835C6.67751 7.5835 6.41634 7.32233 6.41634 7.00016V4.66683C6.41634 4.34466 6.67751 4.0835 6.99967 4.0835Z",
|
|
9880
|
-
fill: "#FB3449"
|
|
9881
|
-
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9882
|
-
d: "M6.99967 8.75016C6.67751 8.75016 6.41634 9.01133 6.41634 9.3335C6.41634 9.65566 6.67751 9.91683 6.99967 9.91683H7.00551C7.32767 9.91683 7.58884 9.65566 7.58884 9.3335C7.58884 9.01133 7.32767 8.75016 7.00551 8.75016H6.99967Z",
|
|
9883
|
-
fill: "#FB3449"
|
|
9884
|
-
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9885
|
-
"fill-rule": "evenodd",
|
|
9886
|
-
"clip-rule": "evenodd",
|
|
9887
|
-
d: "M0.583008 7.00016C0.583008 3.45634 3.45585 0.583496 6.99967 0.583496C10.5435 0.583496 13.4163 3.45634 13.4163 7.00016C13.4163 10.544 10.5435 13.4168 6.99967 13.4168C3.45585 13.4168 0.583008 10.544 0.583008 7.00016ZM6.99967 1.75016C4.10018 1.75016 1.74967 4.10067 1.74967 7.00016C1.74967 9.89966 4.10018 12.2502 6.99967 12.2502C9.89917 12.2502 12.2497 9.89966 12.2497 7.00016C12.2497 4.10067 9.89917 1.75016 6.99967 1.75016Z",
|
|
9888
|
-
fill: "#FB3449"
|
|
9889
|
-
})), /*#__PURE__*/React__default['default'].createElement("defs", null, /*#__PURE__*/React__default['default'].createElement("clipPath", {
|
|
9890
|
-
id: "clip0_138_127604"
|
|
9891
|
-
}, /*#__PURE__*/React__default['default'].createElement("rect", {
|
|
9892
|
-
width: "14",
|
|
9893
|
-
height: "14",
|
|
9894
|
-
fill: "white"
|
|
9895
|
-
}))))), /*#__PURE__*/React__default['default'].createElement("symbol", {
|
|
9896
|
-
id: "caret-down-fill",
|
|
9897
|
-
width: "14",
|
|
9898
|
-
height: "14",
|
|
9899
|
-
viewBox: "0 0 14 14",
|
|
9900
|
-
fill: "none"
|
|
9901
|
-
}, /*#__PURE__*/React__default['default'].createElement("rect", {
|
|
9902
|
-
width: "14",
|
|
9903
|
-
height: "14",
|
|
9904
|
-
rx: "4",
|
|
9905
|
-
fill: "black",
|
|
9906
|
-
"fill-opacity": "0.1"
|
|
9907
|
-
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9908
|
-
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",
|
|
9909
|
-
fill: "#363B3F"
|
|
9910
9718
|
}))));
|
|
9911
9719
|
};
|
|
9912
9720
|
|
|
@@ -11269,48 +11077,6 @@ var SheetList = function SheetList() {
|
|
|
11269
11077
|
}));
|
|
11270
11078
|
};
|
|
11271
11079
|
|
|
11272
|
-
var DunePreview = function DunePreview(_ref) {
|
|
11273
|
-
var url = _ref.url,
|
|
11274
|
-
position = _ref.position,
|
|
11275
|
-
onKeepAsLink = _ref.onKeepAsLink,
|
|
11276
|
-
onEmbed = _ref.onEmbed;
|
|
11277
|
-
var embedUrl = fortuneCore.sanitizeDuneUrl(url);
|
|
11278
|
-
if (!embedUrl) return null;
|
|
11279
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11280
|
-
className: "fortune-dune-preview",
|
|
11281
|
-
style: {
|
|
11282
|
-
left: position.left,
|
|
11283
|
-
top: position.top
|
|
11284
|
-
},
|
|
11285
|
-
onClick: function onClick(e) {
|
|
11286
|
-
return e.stopPropagation();
|
|
11287
|
-
}
|
|
11288
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11289
|
-
className: "fortune-dune-preview-header"
|
|
11290
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
11291
|
-
className: "fortune-dune-preview-title"
|
|
11292
|
-
}, "Detected Dune chart link")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11293
|
-
className: "fortune-dune-preview-content"
|
|
11294
|
-
}, /*#__PURE__*/React__default['default'].createElement("iframe", {
|
|
11295
|
-
src: embedUrl,
|
|
11296
|
-
title: "Dune Chart Preview",
|
|
11297
|
-
style: {
|
|
11298
|
-
width: "100%",
|
|
11299
|
-
height: "100%",
|
|
11300
|
-
border: "none"
|
|
11301
|
-
}
|
|
11302
|
-
})), /*#__PURE__*/React__default['default'].createElement("p", null, "Do you want to insert Dune chart?"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11303
|
-
className: "fortune-dune-preview-footer"
|
|
11304
|
-
}, /*#__PURE__*/React__default['default'].createElement(ui.Button, {
|
|
11305
|
-
variant: "ghost",
|
|
11306
|
-
onClick: onKeepAsLink,
|
|
11307
|
-
className: "!w-fit px-0"
|
|
11308
|
-
}, "Keep as Link"), /*#__PURE__*/React__default['default'].createElement(ui.Button, {
|
|
11309
|
-
onClick: onEmbed,
|
|
11310
|
-
className: "!w-fit px-0"
|
|
11311
|
-
}, "Embed")));
|
|
11312
|
-
};
|
|
11313
|
-
|
|
11314
11080
|
var _excluded = ["onChange", "onOp", "data"];
|
|
11315
11081
|
produce.enablePatches();
|
|
11316
11082
|
var triggerGroupValuesRefresh = function triggerGroupValuesRefresh(ctx) {
|
|
@@ -11843,25 +11609,7 @@ var Workbook = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
|
|
|
11843
11609
|
style: {
|
|
11844
11610
|
width: "60px"
|
|
11845
11611
|
}
|
|
11846
|
-
}, formula.count, ": ", calInfo.count)), !!calInfo.numberC && !!calInfo.sum && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.sum, ": ", calInfo.sum)), !!calInfo.numberC && !!calInfo.average && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.average, ": ", calInfo.average)), !!calInfo.numberC && !!calInfo.max && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.max, ": ", calInfo.max)), !!calInfo.numberC && !!calInfo.min && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.min, ": ", calInfo.min))))
|
|
11847
|
-
url: context.showDunePreview.url,
|
|
11848
|
-
position: context.showDunePreview.position,
|
|
11849
|
-
onKeepAsLink: function onKeepAsLink() {
|
|
11850
|
-
setContextWithProduce(function (draftCtx) {
|
|
11851
|
-
draftCtx.showDunePreview = undefined;
|
|
11852
|
-
}, {
|
|
11853
|
-
noHistory: true
|
|
11854
|
-
});
|
|
11855
|
-
},
|
|
11856
|
-
onEmbed: function onEmbed() {
|
|
11857
|
-
setContextWithProduce(function (draftCtx) {
|
|
11858
|
-
fortuneCore.insertDuneChart(draftCtx, context.showDunePreview.url);
|
|
11859
|
-
draftCtx.showDunePreview = undefined;
|
|
11860
|
-
}, {
|
|
11861
|
-
noHistory: true
|
|
11862
|
-
});
|
|
11863
|
-
}
|
|
11864
|
-
})))));
|
|
11612
|
+
}, formula.count, ": ", calInfo.count)), !!calInfo.numberC && !!calInfo.sum && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.sum, ": ", calInfo.sum)), !!calInfo.numberC && !!calInfo.average && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.average, ": ", calInfo.average)), !!calInfo.numberC && !!calInfo.max && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.max, ": ", calInfo.max)), !!calInfo.numberC && !!calInfo.min && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.min, ": ", calInfo.min)))))));
|
|
11865
11613
|
});
|
|
11866
11614
|
|
|
11867
11615
|
exports.Workbook = Workbook;
|