@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.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
|
|
@@ -3978,9 +4144,8 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3978
4144
|
display: "none"
|
|
3979
4145
|
}
|
|
3980
4146
|
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
3981
|
-
name: "
|
|
3982
|
-
width: 16
|
|
3983
|
-
height: 16
|
|
4147
|
+
name: "combo-arrow",
|
|
4148
|
+
width: 16
|
|
3984
4149
|
})), context.dataVerificationDropDownList && /*#__PURE__*/React__default['default'].createElement(DropDownList, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3985
4150
|
id: "luckysheet-dataVerification-showHintBox",
|
|
3986
4151
|
className: "luckysheet-mousedown-cancel",
|
|
@@ -4214,6 +4379,9 @@ var Sheet = function Sheet(_ref) {
|
|
|
4214
4379
|
}
|
|
4215
4380
|
}, [context, refs.canvas, refs.globalCache.freezen, setContext, sheet.id]);
|
|
4216
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;
|
|
4217
4385
|
setContext(function (draftCtx) {
|
|
4218
4386
|
fortuneCore.handleGlobalWheel(draftCtx, e, refs.globalCache, refs.scrollbarX.current, refs.scrollbarY.current);
|
|
4219
4387
|
});
|
|
@@ -4299,9 +4467,6 @@ var Combo = function Combo(_ref) {
|
|
|
4299
4467
|
setPopupPosition = _useState4[1];
|
|
4300
4468
|
var popupRef = React.useRef(null);
|
|
4301
4469
|
var buttonRef = React.useRef(null);
|
|
4302
|
-
var isLucideIcon = React.useMemo(function () {
|
|
4303
|
-
return (iconId === null || iconId === void 0 ? void 0 : iconId.startsWith("align-")) || ["text-overflow", "text-wrap", "text-clip"].includes(iconId);
|
|
4304
|
-
}, [iconId]);
|
|
4305
4470
|
useOutsideClick(popupRef, function () {
|
|
4306
4471
|
setOpen(false);
|
|
4307
4472
|
});
|
|
@@ -4329,7 +4494,7 @@ var Combo = function Combo(_ref) {
|
|
|
4329
4494
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4330
4495
|
ref: buttonRef,
|
|
4331
4496
|
className: "fortune-toolbar-combo"
|
|
4332
|
-
},
|
|
4497
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4333
4498
|
className: "fortune-toolbar-combo-button",
|
|
4334
4499
|
onClick: function onClick(e) {
|
|
4335
4500
|
if (_onClick) {
|
|
@@ -4348,13 +4513,7 @@ var Combo = function Combo(_ref) {
|
|
|
4348
4513
|
name: iconId
|
|
4349
4514
|
})) : (/*#__PURE__*/React__default['default'].createElement("span", {
|
|
4350
4515
|
className: "fortune-toolbar-combo-text"
|
|
4351
|
-
}, text !== undefined ? text : "")))
|
|
4352
|
-
icon: getIcon(iconId),
|
|
4353
|
-
variant: "ghost",
|
|
4354
|
-
onClick: function onClick() {
|
|
4355
|
-
return setOpen(!open);
|
|
4356
|
-
}
|
|
4357
|
-
})), showArrow && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
4516
|
+
}, text !== undefined ? text : ""))), showArrow && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
4358
4517
|
className: "fortune-toolbar-combo-arrow",
|
|
4359
4518
|
onClick: function onClick() {
|
|
4360
4519
|
return setOpen(!open);
|
|
@@ -5259,30 +5418,6 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
5259
5418
|
}, button.cancel)));
|
|
5260
5419
|
};
|
|
5261
5420
|
|
|
5262
|
-
var getIcon = function getIcon(title) {
|
|
5263
|
-
switch (title) {
|
|
5264
|
-
case "align-left":
|
|
5265
|
-
return "AlignLeft";
|
|
5266
|
-
case "align-center":
|
|
5267
|
-
return "AlignCenter";
|
|
5268
|
-
case "align-right":
|
|
5269
|
-
return "AlignRight";
|
|
5270
|
-
case "align-top":
|
|
5271
|
-
return "ArrowUpFromLine";
|
|
5272
|
-
case "align-middle":
|
|
5273
|
-
return "AlignVerticalMiddle";
|
|
5274
|
-
case "align-bottom":
|
|
5275
|
-
return "ArrowDownFromLine";
|
|
5276
|
-
case "text-overflow":
|
|
5277
|
-
return "TextOverflow";
|
|
5278
|
-
case "text-wrap":
|
|
5279
|
-
return "WrapText";
|
|
5280
|
-
case "text-clip":
|
|
5281
|
-
return "TextClip";
|
|
5282
|
-
default:
|
|
5283
|
-
return "";
|
|
5284
|
-
}
|
|
5285
|
-
};
|
|
5286
5421
|
var Toolbar = function Toolbar(_ref) {
|
|
5287
5422
|
var _context$luckysheet_s, _flowdata$row, _settings$customToolb;
|
|
5288
5423
|
var setMoreItems = _ref.setMoreItems,
|
|
@@ -5619,38 +5754,27 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5619
5754
|
tooltip: toolbar.horizontalAlign,
|
|
5620
5755
|
showArrow: false
|
|
5621
5756
|
}, function (setOpen) {
|
|
5622
|
-
return /*#__PURE__*/React__default['default'].createElement(Select, {
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
flexDirection: "row",
|
|
5627
|
-
alignItems: "center",
|
|
5628
|
-
justifyContent: "center",
|
|
5629
|
-
gap: 4
|
|
5630
|
-
}
|
|
5631
|
-
}, items.map(function (_ref3) {
|
|
5632
|
-
var _$find2;
|
|
5633
|
-
var title = _ref3.title;
|
|
5634
|
-
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, {
|
|
5635
5761
|
key: title,
|
|
5636
|
-
isActive: ((_$find2 = ___default['default'].find(items, function (item) {
|
|
5637
|
-
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
|
|
5638
|
-
})) === null || _$find2 === void 0 ? void 0 : _$find2.title) === title,
|
|
5639
|
-
icon: getIcon(title),
|
|
5640
|
-
variant: "ghost",
|
|
5641
5762
|
onClick: function onClick() {
|
|
5642
5763
|
setContext(function (ctx) {
|
|
5643
5764
|
fortuneCore.handleHorizontalAlign(ctx, refs.cellInput.current, title.replace("align-", ""));
|
|
5644
5765
|
});
|
|
5645
5766
|
setOpen(false);
|
|
5646
|
-
}
|
|
5647
|
-
|
|
5648
|
-
|
|
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
|
+
})));
|
|
5649
5773
|
}));
|
|
5650
5774
|
});
|
|
5651
5775
|
}
|
|
5652
5776
|
if (name === "vertical-align") {
|
|
5653
|
-
var _$
|
|
5777
|
+
var _$find2;
|
|
5654
5778
|
var _items = [{
|
|
5655
5779
|
title: "align-top",
|
|
5656
5780
|
text: align.top,
|
|
@@ -5665,40 +5789,29 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5665
5789
|
value: 2
|
|
5666
5790
|
}];
|
|
5667
5791
|
return /*#__PURE__*/React__default['default'].createElement(Combo, {
|
|
5668
|
-
iconId: ((_$
|
|
5792
|
+
iconId: ((_$find2 = ___default['default'].find(_items, function (item) {
|
|
5669
5793
|
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
5670
|
-
})) === null || _$
|
|
5794
|
+
})) === null || _$find2 === void 0 ? void 0 : _$find2.title) || "align-top",
|
|
5671
5795
|
key: name,
|
|
5672
5796
|
tooltip: toolbar.verticalAlign,
|
|
5673
5797
|
showArrow: false
|
|
5674
5798
|
}, function (setOpen) {
|
|
5675
|
-
return /*#__PURE__*/React__default['default'].createElement(Select, {
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
flexDirection: "row",
|
|
5680
|
-
alignItems: "center",
|
|
5681
|
-
justifyContent: "center",
|
|
5682
|
-
gap: 4
|
|
5683
|
-
}
|
|
5684
|
-
}, _items.map(function (_ref4) {
|
|
5685
|
-
var _$find4;
|
|
5686
|
-
var title = _ref4.title;
|
|
5687
|
-
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, {
|
|
5688
5803
|
key: title,
|
|
5689
|
-
isActive: ((_$find4 = ___default['default'].find(_items, function (item) {
|
|
5690
|
-
return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
|
|
5691
|
-
})) === null || _$find4 === void 0 ? void 0 : _$find4.title) === title,
|
|
5692
|
-
icon: getIcon(title),
|
|
5693
|
-
variant: "ghost",
|
|
5694
5804
|
onClick: function onClick() {
|
|
5695
5805
|
setContext(function (ctx) {
|
|
5696
5806
|
fortuneCore.handleVerticalAlign(ctx, refs.cellInput.current, title.replace("align-", ""));
|
|
5697
5807
|
});
|
|
5698
5808
|
setOpen(false);
|
|
5699
|
-
}
|
|
5700
|
-
|
|
5701
|
-
|
|
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
|
+
})));
|
|
5702
5815
|
}));
|
|
5703
5816
|
});
|
|
5704
5817
|
}
|
|
@@ -5773,7 +5886,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5773
5886
|
key: name,
|
|
5774
5887
|
onClick: function onClick() {
|
|
5775
5888
|
if (context.allowEdit === false) return;
|
|
5776
|
-
showDialog(/*#__PURE__*/React__default['default'].createElement(DataVerification, null)
|
|
5889
|
+
showDialog(/*#__PURE__*/React__default['default'].createElement(DataVerification, null));
|
|
5777
5890
|
}
|
|
5778
5891
|
});
|
|
5779
5892
|
}
|
|
@@ -6247,23 +6360,12 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6247
6360
|
tooltip: toolbar.textWrap,
|
|
6248
6361
|
showArrow: false
|
|
6249
6362
|
}, function (setOpen) {
|
|
6250
|
-
return /*#__PURE__*/React__default['default'].createElement(Select, {
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
display: "flex",
|
|
6254
|
-
flexDirection: "row",
|
|
6255
|
-
alignItems: "center",
|
|
6256
|
-
justifyContent: "center",
|
|
6257
|
-
gap: 4
|
|
6258
|
-
}
|
|
6259
|
-
}, _items6.map(function (_ref1) {
|
|
6260
|
-
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,
|
|
6261
6366
|
value = _ref1.value;
|
|
6262
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
6367
|
+
return /*#__PURE__*/React__default['default'].createElement(Option, {
|
|
6263
6368
|
key: value,
|
|
6264
|
-
isActive: _curr.value === value,
|
|
6265
|
-
icon: getIcon(iconId),
|
|
6266
|
-
variant: "ghost",
|
|
6267
6369
|
onClick: function onClick() {
|
|
6268
6370
|
setContext(function (ctx) {
|
|
6269
6371
|
var d = fortuneCore.getFlowdata(ctx);
|
|
@@ -6271,9 +6373,12 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6271
6373
|
fortuneCore.updateFormat(ctx, refs.cellInput.current, d, "tb", value);
|
|
6272
6374
|
});
|
|
6273
6375
|
setOpen(false);
|
|
6274
|
-
}
|
|
6275
|
-
|
|
6276
|
-
|
|
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
|
+
})));
|
|
6277
6382
|
}));
|
|
6278
6383
|
});
|
|
6279
6384
|
}
|
|
@@ -9610,21 +9715,6 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9610
9715
|
"clip-rule": "evenodd",
|
|
9611
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",
|
|
9612
9717
|
fill: "#363B3F"
|
|
9613
|
-
})), /*#__PURE__*/React__default['default'].createElement("symbol", {
|
|
9614
|
-
id: "caret-down-fill",
|
|
9615
|
-
width: "14",
|
|
9616
|
-
height: "14",
|
|
9617
|
-
viewBox: "0 0 14 14",
|
|
9618
|
-
fill: "none"
|
|
9619
|
-
}, /*#__PURE__*/React__default['default'].createElement("rect", {
|
|
9620
|
-
width: "14",
|
|
9621
|
-
height: "14",
|
|
9622
|
-
rx: "4",
|
|
9623
|
-
fill: "black",
|
|
9624
|
-
"fill-opacity": "0.1"
|
|
9625
|
-
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9626
|
-
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",
|
|
9627
|
-
fill: "#363B3F"
|
|
9628
9718
|
}))));
|
|
9629
9719
|
};
|
|
9630
9720
|
|