@fileverse-dev/fortune-core 1.1.39 → 1.1.41
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/es/events/keyboard.js +1 -1
- package/es/modules/formula.js +1 -1
- package/es/modules/validation.d.ts +1 -0
- package/es/modules/validation.js +6 -0
- package/lib/events/keyboard.js +1 -1
- package/lib/modules/formula.js +1 -1
- package/lib/modules/validation.d.ts +1 -0
- package/lib/modules/validation.js +7 -0
- package/package.json +1 -1
package/es/events/keyboard.js
CHANGED
|
@@ -355,7 +355,7 @@ export function handleArrowKey(ctx, e) {
|
|
|
355
355
|
var spans = doc.querySelectorAll("span");
|
|
356
356
|
var lastSpan = spans[spans.length - 1];
|
|
357
357
|
var notFunctionInit = !((_b = document.getElementById("luckysheet-rich-text-editor")) === null || _b === void 0 ? void 0 : _b.innerText.includes("("));
|
|
358
|
-
if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText
|
|
358
|
+
if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && /^[a-zA-Z]+$/.test(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) && !_.includes(["="], lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
|
|
359
359
|
return;
|
|
360
360
|
}
|
|
361
361
|
}
|
package/es/modules/formula.js
CHANGED
|
@@ -29,7 +29,7 @@ import { locale } from "../locale";
|
|
|
29
29
|
import { colors } from "./color";
|
|
30
30
|
import { colLocation, mousePosition, rowLocation } from "./location";
|
|
31
31
|
import { cancelFunctionrangeSelected, seletedHighlistByindex, spillSortResult } from ".";
|
|
32
|
-
import { isLetterNumberPattern, removeLastSpan } from "
|
|
32
|
+
import { isLetterNumberPattern, removeLastSpan } from "../utils/index";
|
|
33
33
|
var functionHTMLIndex = 0;
|
|
34
34
|
var rangeIndexes = [];
|
|
35
35
|
var operatorPriority = {
|
|
@@ -11,6 +11,7 @@ export declare const error: {
|
|
|
11
11
|
};
|
|
12
12
|
export declare function valueIsError(value: string): boolean;
|
|
13
13
|
export declare function isRealNull(val: any): boolean;
|
|
14
|
+
export declare function isHexValue(str: string): boolean;
|
|
14
15
|
export declare function isRealNum(val: any): boolean;
|
|
15
16
|
export declare function isdatetime(s: any): boolean;
|
|
16
17
|
export declare function diff(now: any, then: any): number;
|
package/es/modules/validation.js
CHANGED
|
@@ -18,7 +18,13 @@ export function valueIsError(value) {
|
|
|
18
18
|
export function isRealNull(val) {
|
|
19
19
|
return _.isNil(val) || val.toString().replace(/\s/g, "") === "";
|
|
20
20
|
}
|
|
21
|
+
export function isHexValue(str) {
|
|
22
|
+
return /^0x?[a-fA-F0-9]+$/.test(str);
|
|
23
|
+
}
|
|
21
24
|
export function isRealNum(val) {
|
|
25
|
+
if (isHexValue(val.toString())) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
22
28
|
if (_.isNil(val) || val.toString().replace(/\s/g, "") === "") {
|
|
23
29
|
return false;
|
|
24
30
|
}
|
package/lib/events/keyboard.js
CHANGED
|
@@ -365,7 +365,7 @@ function handleArrowKey(ctx, e) {
|
|
|
365
365
|
var spans = doc.querySelectorAll("span");
|
|
366
366
|
var lastSpan = spans[spans.length - 1];
|
|
367
367
|
var notFunctionInit = !((_b = document.getElementById("luckysheet-rich-text-editor")) === null || _b === void 0 ? void 0 : _b.innerText.includes("("));
|
|
368
|
-
if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText
|
|
368
|
+
if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && /^[a-zA-Z]+$/.test(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) && !_lodash.default.includes(["="], lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
371
|
}
|
package/lib/modules/formula.js
CHANGED
|
@@ -38,7 +38,7 @@ var _locale = require("../locale");
|
|
|
38
38
|
var _color = require("./color");
|
|
39
39
|
var _location = require("./location");
|
|
40
40
|
var _2 = require(".");
|
|
41
|
-
var _index = require("
|
|
41
|
+
var _index = require("../utils/index");
|
|
42
42
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
43
43
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
44
44
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
@@ -11,6 +11,7 @@ export declare const error: {
|
|
|
11
11
|
};
|
|
12
12
|
export declare function valueIsError(value: string): boolean;
|
|
13
13
|
export declare function isRealNull(val: any): boolean;
|
|
14
|
+
export declare function isHexValue(str: string): boolean;
|
|
14
15
|
export declare function isRealNum(val: any): boolean;
|
|
15
16
|
export declare function isdatetime(s: any): boolean;
|
|
16
17
|
export declare function diff(now: any, then: any): number;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.diff = diff;
|
|
7
7
|
exports.error = void 0;
|
|
8
8
|
exports.hasPartMC = hasPartMC;
|
|
9
|
+
exports.isHexValue = isHexValue;
|
|
9
10
|
exports.isRealNull = isRealNull;
|
|
10
11
|
exports.isRealNum = isRealNum;
|
|
11
12
|
exports.isdatatype = isdatatype;
|
|
@@ -33,7 +34,13 @@ function valueIsError(value) {
|
|
|
33
34
|
function isRealNull(val) {
|
|
34
35
|
return _lodash.default.isNil(val) || val.toString().replace(/\s/g, "") === "";
|
|
35
36
|
}
|
|
37
|
+
function isHexValue(str) {
|
|
38
|
+
return /^0x?[a-fA-F0-9]+$/.test(str);
|
|
39
|
+
}
|
|
36
40
|
function isRealNum(val) {
|
|
41
|
+
if (isHexValue(val.toString())) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
37
44
|
if (_lodash.default.isNil(val) || val.toString().replace(/\s/g, "") === "") {
|
|
38
45
|
return false;
|
|
39
46
|
}
|