UNPKG

@starzhuimeng/formula-editor

Version:

A configurable formula editor with customizable symbols

51 lines 1.89 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ValidationRuleType = exports.EventType = exports.ElementType = void 0; /** * 公式元素类型 */ var ElementType; (function (ElementType) { ElementType["SYMBOL"] = "symbol"; ElementType["NUMBER"] = "number"; ElementType["VARIABLE"] = "variable"; ElementType["FUNCTION"] = "function"; ElementType["BRACKET"] = "bracket"; ElementType["OPERATOR"] = "operator"; ElementType["SUPERSCRIPT"] = "superscript"; ElementType["SUBSCRIPT"] = "subscript"; ElementType["FRACTION"] = "fraction"; ElementType["ROOT"] = "root"; ElementType["INTEGRAL"] = "integral"; })(ElementType || (exports.ElementType = ElementType = {})); /** * 编辑器事件类型 */ var EventType; (function (EventType) { EventType["CHANGE"] = "change"; EventType["FOCUS"] = "focus"; EventType["BLUR"] = "blur"; EventType["SYMBOL_CLICK"] = "symbolClick"; EventType["VALIDATION_ERROR"] = "validationError"; EventType["VALIDATION_SUCCESS"] = "validationSuccess"; })(EventType || (exports.EventType = EventType = {})); /** * 验证规则类型 */ var ValidationRuleType; (function (ValidationRuleType) { /** 括号匹配 */ ValidationRuleType["BRACKETS_MATCH"] = "bracketsMatch"; /** 操作符周围必须有操作数 */ ValidationRuleType["OPERATORS_SURROUNDED"] = "operatorsSurrounded"; /** 表达式不能为空 */ ValidationRuleType["NON_EMPTY"] = "nonEmpty"; /** 表达式必须有等号 */ ValidationRuleType["HAS_EQUALS"] = "hasEquals"; /** 操作数不能连续出现 */ ValidationRuleType["NO_CONSECUTIVE_OPERANDS"] = "noConsecutiveOperands"; /** 自定义规则 */ ValidationRuleType["CUSTOM"] = "custom"; })(ValidationRuleType || (exports.ValidationRuleType = ValidationRuleType = {})); //# sourceMappingURL=index.js.map