@chaoswise/business 0.0.5 → 0.0.7

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.
Files changed (40) hide show
  1. package/lib/AggregateSearch/CLSPL/CLQLLexer.js +80 -0
  2. package/lib/AggregateSearch/CLSPL/CLQLParser.js +2797 -0
  3. package/lib/AggregateSearch/CLSPL/CLQLParserListener.js +349 -0
  4. package/lib/AggregateSearch/CLSPL/CLQLParserVisitor.js +253 -0
  5. package/lib/AggregateSearch/CLSPL/SPLStagy.js +189 -0
  6. package/lib/AggregateSearch/CLSPL/index.js +176 -0
  7. package/lib/AggregateSearch/CLSPL/makeTokenizeFn.js +18 -0
  8. package/lib/AggregateSearch/CLSPL/token.js +7 -0
  9. package/lib/AggregateSearch/components/DropDown/assets/combined.svg +22 -0
  10. package/lib/AggregateSearch/components/DropDown/assets/copy.svg +22 -0
  11. package/lib/AggregateSearch/components/DropDown/assets/delete.svg +24 -0
  12. package/lib/AggregateSearch/components/DropDown/assets/home.svg +20 -0
  13. package/lib/AggregateSearch/components/DropDown/assets/key.svg +21 -0
  14. package/lib/AggregateSearch/components/DropDown/assets/star.svg +22 -0
  15. package/lib/AggregateSearch/components/DropDown/assets/time-circle.svg +20 -0
  16. package/lib/AggregateSearch/components/DropDown/assets/value.svg +23 -0
  17. package/lib/AggregateSearch/components/DropDown/index.js +556 -0
  18. package/lib/AggregateSearch/components/DropDown/index.less +102 -0
  19. package/lib/AggregateSearch/components/SwitchBtn/assets/tag-icon.svg +17 -0
  20. package/lib/AggregateSearch/components/SwitchBtn/assets/text-icon.svg +18 -0
  21. package/lib/AggregateSearch/components/SwitchBtn/index.js +24 -0
  22. package/lib/AggregateSearch/components/SwitchBtn/index.less +15 -0
  23. package/lib/AggregateSearch/hooks/useDropDown.js +399 -0
  24. package/lib/AggregateSearch/index.js +350 -0
  25. package/lib/AggregateSearch/index.less +123 -0
  26. package/lib/AggregateSearch/utils/index.js +362 -0
  27. package/lib/PropertyControlViewer/assets/doSelect.less +1 -1
  28. package/lib/PropertyControlViewer/assets/index.less +3 -3
  29. package/lib/PropertyControlViewer/components/DoCiUnitBitmap.js +1 -1
  30. package/lib/PropertyControlViewer/components/DoDefaultPlaceholder.js +1 -1
  31. package/lib/PropertyControlViewer/components/DoUser.js +22 -4
  32. package/lib/PropertyControlViewer/components/TagShowMoreList/index.js +1 -1
  33. package/lib/PropertyControlViewer/config/utils.js +8 -6
  34. package/lib/PropertyControlViewer/index.js +77 -76
  35. package/lib/PropertyControlViewer/index.less +30 -0
  36. package/lib/index.js +2 -1
  37. package/lib/locale/en_US.js +9 -0
  38. package/lib/locale/index.js +12 -0
  39. package/lib/locale/zh_CN.js +9 -0
  40. package/package.json +5 -3
@@ -0,0 +1,189 @@
1
+ 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); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
8
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
9
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
11
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
12
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
14
+ import antlr4 from 'antlr4';
15
+ var NoViableAltException = antlr4.error.NoViableAltException;
16
+ var InputMismatchException = antlr4.error.InputMismatchException;
17
+ var FailedPredicateException = antlr4.error.FailedPredicateException;
18
+ var ParseCancellationException = antlr4.error.ParseCancellationException;
19
+ var Token = antlr4.Token;
20
+ // var Interval = antlr4.error.Interval;
21
+ // var { Interval } = require('antlr4/IntervalSet')
22
+ var Interval = antlr4.Interval;
23
+ var stahy = /*#__PURE__*/function (_antlr4$error$BailErr) {
24
+ _inherits(stahy, _antlr4$error$BailErr);
25
+ var _super = _createSuper(stahy);
26
+ function stahy(props) {
27
+ var _this;
28
+ _classCallCheck(this, stahy);
29
+ _this = _super.call(this, props);
30
+ _this.errorRecoveryMode = true;
31
+ _this.explain = {
32
+ UNQUOTA_STRING: '字段名称'
33
+ };
34
+ _this.expects = new Map([['LEFT_PAR', '('], ['RIGHT_PAR', ')']]);
35
+ return _this;
36
+ }
37
+ _createClass(stahy, [{
38
+ key: "transExpectByExplain",
39
+ value: function transExpectByExplain(expect) {
40
+ for (var key in this.explain) {
41
+ expect = expect.replace(key, this.explain[key]);
42
+ }
43
+ return expect;
44
+ }
45
+ }, {
46
+ key: "recover",
47
+ value: function recover(recognizer, e) {
48
+ if (this.lastErrorIndex === recognizer.getInputStream().index && this.lastErrorStates !== null && this.lastErrorStates.indexOf(recognizer.state) >= 0) {
49
+ // uh oh, another error at same token index and previously-visited
50
+ // state in ATN; must be a case where LT(1) is in the recovery
51
+ // token set so nothing got consumed. Consume a single token
52
+ // at least to prevent an infinite loop; this is a failsafe.
53
+ recognizer.consume();
54
+ }
55
+ this.lastErrorIndex = recognizer._input.index;
56
+ if (this.lastErrorStates === null) {
57
+ this.lastErrorStates = [];
58
+ }
59
+ this.lastErrorStates.push(recognizer.state);
60
+ var followSet = this.getErrorRecoverySet(recognizer);
61
+ this.consumeUntil(recognizer, followSet);
62
+ }
63
+ }, {
64
+ key: "recoverInline",
65
+ value: function recoverInline(recognizer) {
66
+ // SINGLE TOKEN DELETION
67
+ var matchedSymbol = this.singleTokenDeletion(recognizer);
68
+ if (matchedSymbol !== null) {
69
+ // we have deleted the extra token.
70
+ // now, move past ttype token as if all were ok
71
+ recognizer.consume();
72
+ return matchedSymbol;
73
+ }
74
+ // SINGLE TOKEN INSERTION
75
+ if (this.singleTokenInsertion(recognizer)) {
76
+ return this.getMissingSymbol(recognizer);
77
+ }
78
+ // even that didn't work; must throw the exception
79
+ throw new InputMismatchException(recognizer);
80
+ }
81
+ }, {
82
+ key: "reportNoViableAlternative",
83
+ value: function reportNoViableAlternative(recognizer, e) {
84
+ var tokens = recognizer.getTokenStream();
85
+ var input;
86
+ if (tokens !== null) {
87
+ if (e.startToken.type === Token.EOF) {
88
+ input = '语句不完整,缺少结尾';
89
+ } else {
90
+ input = tokens.getText(new Interval(e.startToken.tokenIndex, e.offendingToken.tokenIndex));
91
+ }
92
+ } else {
93
+ input = '存在 <未知输入>';
94
+ }
95
+ var msg;
96
+ if (e.offendingToken.text) {
97
+ msg = '位置' + e.offendingToken.line + ':' + e.offendingToken.column + ',' + input;
98
+ } else {
99
+ msg = '' + e.offendingToken.text + input;
100
+ }
101
+ // var msg = "no viable alternative at input " + this.escapeWSAndQuote(input);
102
+ recognizer.notifyErrorListeners(msg, e.offendingToken, e);
103
+ }
104
+ }, {
105
+ key: "escapeWSAndQuote",
106
+ value: function escapeWSAndQuote(s) {
107
+ s = s.replace(/\n/g, '\\n');
108
+ s = s.replace(/\r/g, '\\r');
109
+ s = s.replace(/\t/g, '\\t');
110
+ return "'" + s + "'";
111
+ }
112
+ }, {
113
+ key: "beginErrorCondition",
114
+ value: function beginErrorCondition(recognizer) {
115
+ this.errorRecoveryMode = true;
116
+ }
117
+ }, {
118
+ key: "inErrorRecoveryMode",
119
+ value: function inErrorRecoveryMode(recognizer) {
120
+ return this.errorRecoveryMode;
121
+ }
122
+ }, {
123
+ key: "endErrorCondition",
124
+ value: function endErrorCondition(recognizer) {
125
+ this.errorRecoveryMode = false;
126
+ this.lastErrorStates = null;
127
+ this.lastErrorIndex = -1;
128
+ }
129
+ }, {
130
+ key: "reportMatch",
131
+ value: function reportMatch(recognizer) {
132
+ this.endErrorCondition(recognizer);
133
+ }
134
+ }, {
135
+ key: "reportError",
136
+ value: function reportError(recognizer, e) {
137
+ // if we've already reported an error and have not matched a token
138
+ // yet successfully, don't report any errors.
139
+ this.beginErrorCondition(recognizer);
140
+ if (e instanceof NoViableAltException) {
141
+ this.reportNoViableAlternative(recognizer, e);
142
+ } else if (e instanceof InputMismatchException) {
143
+ this.reportInputMismatch(recognizer, e);
144
+ } else if (e instanceof FailedPredicateException) {
145
+ this.reportFailedPredicate(recognizer, e);
146
+ } else {
147
+ recognizer.notifyErrorListeners(e.getOffendingToken(), e.getMessage(), e);
148
+ }
149
+ }
150
+ }, {
151
+ key: "reportInputMismatch",
152
+ value: function reportInputMismatch(recognizer, e) {
153
+ var t1 = recognizer.getInputStream().LT(-1);
154
+ var msg = "".concat(this.getTokenErrorDisplay(t1), " \u540E\u9762\uFF0C\u671F\u671B ").concat(this.transExpectByExplain(e.getExpectedTokens().toString(recognizer.literalNames, recognizer.symbolicNames)));
155
+
156
+ // console.log(msg)
157
+ // var msg = "mismatched input " + this.getTokenErrorDisplay(e.offendingToken) +
158
+ // " expecting " + e.getExpectedTokens().toString(recognizer.literalNames, recognizer.symbolicNames);
159
+ recognizer.notifyErrorListeners(msg, e.offendingToken, e);
160
+ }
161
+ }, {
162
+ key: "reportMissingToken",
163
+ value: function reportMissingToken(recognizer) {
164
+ if (this.inErrorRecoveryMode(recognizer)) {
165
+ return null;
166
+ }
167
+ this.beginErrorCondition(recognizer);
168
+ var t = recognizer.getTokenStream().LT(-1);
169
+ var expecting = this.getExpectedTokens(recognizer);
170
+ var msg = "\u5728 ".concat(this.getTokenErrorDisplay(t), " \u540E\u7F3A\u5931 ").concat(expecting.toString(recognizer.literalNames, recognizer.symbolicNames));
171
+ recognizer.notifyErrorListeners(msg, t, null);
172
+ }
173
+ }, {
174
+ key: "reportUnwantedToken",
175
+ value: function reportUnwantedToken(recognizer) {
176
+ if (this.inErrorRecoveryMode(recognizer)) {
177
+ return;
178
+ }
179
+ this.beginErrorCondition(recognizer);
180
+ var t = recognizer.getCurrentToken();
181
+ var tokenName = this.getTokenErrorDisplay(t);
182
+ var expecting = this.getExpectedTokens(recognizer);
183
+ var msg = "\u4E0D\u5FC5\u8981\u8F93\u5165 ".concat(tokenName, " \uFF0C\u671F\u671B ").concat(this.transExpectByExplain(expecting.toString(recognizer.literalNames, recognizer.symbolicNames)));
184
+ recognizer.notifyErrorListeners(msg, t, null);
185
+ }
186
+ }]);
187
+ return stahy;
188
+ }(antlr4.error.BailErrorStrategy);
189
+ export default stahy;
@@ -0,0 +1,176 @@
1
+ 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); }
2
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
15
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
17
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
18
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
+ /*
22
+ * @Author: rookie.ou rookie.ou@cloudwise.com
23
+ * @Date: 2022-11-21 10:54:41
24
+ * @LastEditors: rookie.ou rookie.ou@cloudwise.com
25
+ * @LastEditTime: 2022-11-30 17:10:04
26
+ * @FilePath: /DOLAWeb/src/components/SPLInput/CLSPL/index.js
27
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
28
+ */
29
+ import antlr4 from 'antlr4';
30
+ import MyGrammarLexer from './CLQLLexer.js';
31
+ import MyGrammarParser from './CLQLParser.js';
32
+ import visitor from './CLQLParserVisitor.js';
33
+ import stragy from './SPLStagy';
34
+ var customErr = /*#__PURE__*/function (_antlr4$error$ErrorLi) {
35
+ _inherits(customErr, _antlr4$error$ErrorLi);
36
+ var _super = _createSuper(customErr);
37
+ function customErr(props) {
38
+ _classCallCheck(this, customErr);
39
+ return _super.call(this, props);
40
+ }
41
+ _createClass(customErr, [{
42
+ key: "syntaxError",
43
+ value: function syntaxError(recognizer, offendingSymbol, line, column, msg, e) {
44
+ throw new Error(JSON.stringify({
45
+ msg: msg,
46
+ line: line,
47
+ column: column
48
+ }));
49
+ }
50
+ }]);
51
+ return customErr;
52
+ }(antlr4.error.ErrorListener);
53
+ var Token = {
54
+ STAR: '*',
55
+ QUESTION: '?',
56
+ WEI: '#'
57
+ };
58
+ var customVisitor = /*#__PURE__*/function (_visitor) {
59
+ _inherits(customVisitor, _visitor);
60
+ var _super2 = _createSuper(customVisitor);
61
+ function customVisitor(props) {
62
+ var _this;
63
+ _classCallCheck(this, customVisitor);
64
+ _this = _super2.call(this, props);
65
+ _defineProperty(_assertThisInitialized(_this), "resolving", function (callback) {
66
+ var input = _this.spl;
67
+ if (/^\s*$/.test(input)) {
68
+ callback({
69
+ type: 'normal',
70
+ splitWords: []
71
+ });
72
+ return;
73
+ }
74
+ var chars = new antlr4.InputStream(input);
75
+ var lexer = new MyGrammarLexer(chars);
76
+ var tokens = new antlr4.CommonTokenStream(lexer);
77
+ var parser = new MyGrammarParser(tokens);
78
+ parser.removeErrorListeners();
79
+ try {
80
+ // parser.removeParseListeners()
81
+ // parser.addParseListener(new stragy())
82
+ parser.addErrorListener(new customErr({
83
+ callback: callback
84
+ }));
85
+ parser._errHandler = new stragy();
86
+ var tree;
87
+ tree = parser.root();
88
+ _this.visitRoot(tree);
89
+ switch (_this.state) {
90
+ case 2:
91
+ callback && callback({
92
+ type: 'regexp',
93
+ splitWords: Array.from(new Set(_this.words)) || []
94
+ });
95
+ break;
96
+ default:
97
+ callback({
98
+ type: 'normal',
99
+ splitWords: Array.from(new Set(_this.words)) || []
100
+ });
101
+ break;
102
+ }
103
+ } catch (error) {
104
+ var _JSON$parse = JSON.parse(error.message),
105
+ msg = _JSON$parse.msg,
106
+ line = _JSON$parse.line,
107
+ column = _JSON$parse.column;
108
+ callback && callback({
109
+ type: 'error',
110
+ msg: '语法错误' + ':' + msg.replace('<EOF>', '结束').replace('Error:', '') + '',
111
+ line: line,
112
+ column: column
113
+ });
114
+ }
115
+ });
116
+ _this.spl = props.spl;
117
+ _this.state = 1;
118
+ _this.tokenization = props.tokenization;
119
+ _this.words = [];
120
+ return _this;
121
+ }
122
+ _createClass(customVisitor, [{
123
+ key: "visitTextRegexExpr",
124
+ value: function visitTextRegexExpr(ctx) {
125
+ this.state = 2; //正则
126
+ return this.visitChildren(ctx);
127
+ }
128
+ }, {
129
+ key: "visitTextSearchExpr",
130
+ value: function visitTextSearchExpr(ctx) {
131
+ var fuzzy_literal_valueContext = ctx.text_search_expr().fuzzy_literal_value();
132
+ if (fuzzy_literal_valueContext.fuzzy_literal() != null) {
133
+ var fuzzyText = ctx.getText();
134
+ if (fuzzyText.startsWith(Token.STAR)) {
135
+ fuzzyText = fuzzyText.substring(1);
136
+ } else if (fuzzyText.startsWith(Token.QUESTION)) {
137
+ fuzzyText = fuzzyText.substring(1);
138
+ }
139
+ if (fuzzyText.endsWith(Token.STAR)) {
140
+ fuzzyText = fuzzyText.substring(0, fuzzyText.length - 1);
141
+ } else if (fuzzyText.endsWith(Token.QUESTION)) {
142
+ fuzzyText = fuzzyText.substring(0, fuzzyText.length - 1);
143
+ }
144
+ this.words.push(fuzzyText);
145
+ } else {
146
+ var literalValueCtx = fuzzy_literal_valueContext.literal_value();
147
+ var text = literalValueCtx.getText();
148
+ if (literalValueCtx.string_literal() != null) {
149
+ if (literalValueCtx.string_literal().DQUOTA_STRING() != null) {
150
+ // 文本
151
+ text = text.substring(1, text.length - 1).replace('\\"', '"');
152
+ }
153
+ }
154
+ var tokenSearchLimit = 300; //logCoreContext.getNacosService().getTokenSearchLimit();
155
+ var tokenization = this.tokenization;
156
+ // 判断是否开启分词
157
+ if (tokenization != null && tokenization && text.length <= tokenSearchLimit) {
158
+ var splitWords = text.trim().split(new RegExp('[\\s\\\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\_\\=\\+\\[\\{\\]\\}\\|\\;\\:\\\'"\\,\\<\\.\\>\\/\\?]+'));
159
+ if (splitWords.length == 0) {
160
+ this.words.push('');
161
+ } else {
162
+ var _this$words;
163
+ // 过滤空字符串
164
+ var list = splitWords.filter(Boolean);
165
+ (_this$words = this.words).push.apply(_this$words, _toConsumableArray(list));
166
+ }
167
+ } else {
168
+ //不分词, 整体高亮
169
+ this.words.push(text);
170
+ }
171
+ }
172
+ }
173
+ }]);
174
+ return customVisitor;
175
+ }(visitor);
176
+ export default customVisitor;
@@ -0,0 +1,18 @@
1
+ import antlr from "antlr4";
2
+ import { TOKEN_TYPES } from "./token";
3
+ var makeTokenizeFn = function makeTokenizeFn(LexerClass, tokenMapping) {
4
+ return function (text) {
5
+ var input = new antlr.InputStream(text);
6
+ var lexer = new LexerClass(input);
7
+ var tokens = lexer.getAllTokens().map(function (_ref) {
8
+ var text = _ref.text,
9
+ type = _ref.type;
10
+ return {
11
+ text: text,
12
+ type: tokenMapping.get(type) || TOKEN_TYPES.NONE
13
+ };
14
+ });
15
+ return tokens;
16
+ };
17
+ };
18
+ export default makeTokenizeFn;
@@ -0,0 +1,7 @@
1
+ export var TOKEN_TYPES = {
2
+ NONE: 'none',
3
+ IDENTIFIER: 'identifier',
4
+ NUMBER: 'number',
5
+ KEYWORD: 'keyword',
6
+ MATCH: 'match'
7
+ };
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>编组 2</title>
4
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="聚合搜索框" transform="translate(-130.000000, -658.000000)">
6
+ <g id="2" transform="translate(120.000000, 356.000000)">
7
+ <g id="下拉菜单" transform="translate(0.000000, 70.000000)">
8
+ <g id="2" transform="translate(0.000000, 32.000000)">
9
+ <g id="3备份-4" transform="translate(0.000000, 192.000000)">
10
+ <g id="编组-2" transform="translate(10.000000, 8.000000)">
11
+ <rect id="矩形" x="0" y="0" width="16" height="16"></rect>
12
+ <circle id="椭圆形" stroke="#9254DE" fill="#FFFFFF" fill-rule="nonzero" cx="8" cy="8" r="6.5"></circle>
13
+ <circle id="椭圆形" fill="#9254DE" cx="8" cy="6" r="1"></circle>
14
+ <circle id="椭圆形备份" fill="#9254DE" cx="8" cy="10" r="1"></circle>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </g>
21
+ </g>
22
+ </svg>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>file-copy</title>
4
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.85">
5
+ <g id="聚合搜索框" transform="translate(-1286.000000, -794.000000)" fill="#000000" fill-rule="nonzero">
6
+ <g id="2" transform="translate(120.000000, 356.000000)">
7
+ <g id="下拉菜单" transform="translate(0.000000, 70.000000)">
8
+ <g id="2" transform="translate(0.000000, 296.000000)">
9
+ <g transform="translate(0.000000, 32.000000)" id="编组">
10
+ <g transform="translate(0.000000, 32.000000)">
11
+ <g transform="translate(1166.000000, 8.000000)" id="file-copy">
12
+ <rect id="矩形" opacity="0" x="0" y="0" width="16" height="16"></rect>
13
+ <path d="M13,1 L4.625,1 C4.55625,1 4.5,1.05625 4.5,1.125 L4.5,2 C4.5,2.06875 4.55625,2.125 4.625,2.125 L12.375,2.125 L12.375,12.875 C12.375,12.94375 12.43125,13 12.5,13 L13.375,13 C13.44375,13 13.5,12.94375 13.5,12.875 L13.5,1.5 C13.5,1.2234375 13.2765625,1 13,1 Z M11,3 L3,3 C2.7234375,3 2.5,3.2234375 2.5,3.5 L2.5,11.7921875 C2.5,11.925 2.553125,12.0515625 2.646875,12.1453125 L5.3546875,14.853125 C5.3890625,14.8875 5.428125,14.915625 5.4703125,14.9390625 L5.4703125,14.96875 L5.5359375,14.96875 C5.590625,14.9890625 5.6484375,15 5.7078125,15 L11,15 C11.2765625,15 11.5,14.7765625 11.5,14.5 L11.5,3.5 C11.5,3.2234375 11.2765625,3 11,3 Z M5.46875,13.378125 L4.1234375,12.03125 L5.46875,12.03125 L5.46875,13.378125 Z M10.375,13.875 L6.46875,13.875 L6.46875,11.65625 C6.46875,11.3109375 6.1890625,11.03125 5.84375,11.03125 L3.625,11.03125 L3.625,4.125 L10.375,4.125 L10.375,13.875 Z" id="形状"></path>
14
+ </g>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </g>
21
+ </g>
22
+ </svg>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="12px" height="14px" viewBox="0 0 12 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>delete</title>
4
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="聚合搜索框" transform="translate(-1312.000000, -795.000000)" fill="#000000">
6
+ <g id="2" transform="translate(120.000000, 356.000000)">
7
+ <g id="下拉菜单" transform="translate(0.000000, 70.000000)">
8
+ <g id="2" transform="translate(0.000000, 296.000000)">
9
+ <g transform="translate(0.000000, 32.000000)" id="编组">
10
+ <g transform="translate(0.000000, 32.000000)">
11
+ <g transform="translate(1166.000000, 8.000000)">
12
+ <g transform="translate(24.000000, 0.000000)" id="delete">
13
+ <rect id="矩形" fill-rule="nonzero" opacity="0" x="0" y="0" width="16" height="16"></rect>
14
+ <path d="M5.625,2.875 L5.5,2.875 C5.56875,2.875 5.625,2.81875 5.625,2.75 L5.625,2.875 L10.375,2.875 L10.375,2.75 C10.375,2.81875 10.43125,2.875 10.5,2.875 L10.375,2.875 L10.375,4 L11.5,4 L11.5,2.75 C11.5,2.1984375 11.0515625,1.75 10.5,1.75 L5.5,1.75 C4.9484375,1.75 4.5,2.1984375 4.5,2.75 L4.5,4 L5.625,4 L5.625,2.875 Z M13.5,4 L2.5,4 C2.2234375,4 2,4.2234375 2,4.5 L2,5 C2,5.06875 2.05625,5.125 2.125,5.125 L3.06875,5.125 L3.4546875,13.296875 C3.4796875,13.8296875 3.9203125,14.25 4.453125,14.25 L11.546875,14.25 C12.08125,14.25 12.5203125,13.83125 12.5453125,13.296875 L12.93125,5.125 L13.875,5.125 C13.94375,5.125 14,5.06875 14,5 L14,4.5 C14,4.2234375 13.7765625,4 13.5,4 Z M11.4265625,13.125 L4.5734375,13.125 L4.1953125,5.125 L11.8046875,5.125 L11.4265625,13.125 Z" fill-opacity="0.85"></path>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </g>
21
+ </g>
22
+ </g>
23
+ </g>
24
+ </svg>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>home</title>
4
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.85">
5
+ <g id="聚合搜索框" transform="translate(-130.000000, -930.000000)" fill="#000000" fill-rule="nonzero">
6
+ <g id="2" transform="translate(120.000000, 356.000000)">
7
+ <g id="下拉菜单" transform="translate(0.000000, 70.000000)">
8
+ <g id="3" transform="translate(0.000000, 464.000000)">
9
+ <g id="2" transform="translate(0.000000, 32.000000)">
10
+ <g id="home" transform="translate(10.000000, 8.000000)">
11
+ <rect id="矩形" opacity="0" x="0" y="0" width="16" height="16"></rect>
12
+ <path d="M14.7890625,7.890625 L8.7515625,1.85625 L8.346875,1.4515625 C8.1546875,1.2609375 7.8453125,1.2609375 7.653125,1.4515625 L1.2109375,7.890625 C1.01875,8.0828125 0.915625,8.3375 0.917170003,8.609375 C0.9234375,9.159375 1.38125,9.5984375 1.93125,9.5984375 L2.5953125,9.5984375 L2.5953125,14.6875 L13.4046875,14.6875 L13.4046875,9.5984375 L14.0828125,9.5984375 C14.35,9.5984375 14.6015625,9.49375 14.790625,9.3046875 C14.9796875,9.115625 15.0828125,8.8640625 15.0828125,8.596875 C15.0828125,8.33125 14.978125,8.0796875 14.7890625,7.890625 Z M8.875,13.5625 L7.125,13.5625 L7.125,10.375 L8.875,10.375 L8.875,13.5625 Z M12.2796875,8.4734375 L12.2796875,13.5625 L9.875,13.5625 L9.875,10 C9.875,9.6546875 9.5953125,9.375 9.25,9.375 L6.75,9.375 C6.4046875,9.375 6.125,9.6546875 6.125,10 L6.125,13.5625 L3.7203125,13.5625 L3.7203125,8.4734375 L2.2203125,8.4734375 L8.0015625,2.696875 L8.3625,3.0578125 L13.78125,8.4734375 L12.2796875,8.4734375 Z" id="形状"></path>
13
+ </g>
14
+ </g>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </svg>
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>编组 2</title>
4
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="聚合搜索框" transform="translate(-130.000000, -1934.000000)">
6
+ <g id="4" transform="translate(120.000000, 1792.000000)">
7
+ <g id="下拉菜单" transform="translate(0.000000, 70.000000)">
8
+ <g id="2" transform="translate(0.000000, 32.000000)">
9
+ <g transform="translate(0.000000, 32.000000)" id="编组-2">
10
+ <g transform="translate(10.000000, 8.000000)">
11
+ <rect id="矩形" x="0" y="0" width="16" height="16"></rect>
12
+ <circle id="椭圆形" stroke="#52C41A" fill="#FFFFFF" fill-rule="nonzero" cx="8" cy="8" r="6.5"></circle>
13
+ <polygon id="k" fill="#52C41A" fill-rule="nonzero" points="6.92 11.5 6.92 9.67 7.74 8.93 9.76 11.5 10.79 11.5 8.29 8.41 10.57 6.33 9.51 6.33 6.92 8.73 6.92 4.22 6.12 4.22 6.12 11.5"></polygon>
14
+ </g>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </g>
21
+ </svg>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>star</title>
4
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.85">
5
+ <g id="聚合搜索框" transform="translate(-130.000000, -994.000000)" fill="#000000" fill-rule="nonzero">
6
+ <g id="2" transform="translate(120.000000, 356.000000)">
7
+ <g id="下拉菜单" transform="translate(0.000000, 70.000000)">
8
+ <g id="3" transform="translate(0.000000, 464.000000)">
9
+ <g id="2" transform="translate(0.000000, 32.000000)">
10
+ <g id="3" transform="translate(0.000000, 64.000000)">
11
+ <g id="star" transform="translate(10.000000, 8.000000)">
12
+ <rect id="矩形" opacity="0" x="0" y="0" width="16" height="16"></rect>
13
+ <path d="M14.1890625,5.5171875 L10.221875,4.940625 L8.4484375,1.3453125 C8.4,1.246875 8.3203125,1.1671875 8.221875,1.11875 C7.975,0.996875 7.675,1.0984375 7.5515625,1.3453125 L5.778125,4.940625 L1.8109375,5.5171875 C1.7015625,5.5328125 1.6015625,5.584375 1.525,5.6625 C1.3328125,5.8609375 1.3359375,6.1765625 1.534375,6.3703125 L4.4046875,9.16875 L3.7265625,13.1203125 C3.7078125,13.228125 3.725,13.340625 3.7765625,13.4375 C3.9046875,13.68125 4.2078125,13.7765625 4.4515625,13.646875 L8,11.78125 L11.5484375,13.646875 C11.6453125,13.6984375 11.7578125,13.715625 11.865625,13.696875 C12.1375,13.65 12.3203125,13.3921875 12.2734375,13.1203125 L11.5953125,9.16875 L14.465625,6.3703125 C14.54375,6.29375 14.5953125,6.19375 14.6109375,6.084375 C14.653125,5.8109375 14.4625,5.5578125 14.1890625,5.5171875 Z M10.3875,8.775 L10.9515625,12.0609375 L8,10.5109375 L5.0484375,12.0625 L5.6125,8.7765625 L3.225,6.4484375 L6.525,5.96875 L8,2.9796875 L9.475,5.96875 L12.775,6.4484375 L10.3875,8.775 Z" id="形状"></path>
14
+ </g>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </g>
21
+ </g>
22
+ </svg>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>time-circle</title>
4
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.85">
5
+ <g id="聚合搜索框" transform="translate(-130.000000, -763.000000)" fill="#000000" fill-rule="nonzero">
6
+ <g id="2" transform="translate(120.000000, 356.000000)">
7
+ <g id="下拉菜单" transform="translate(0.000000, 70.000000)">
8
+ <g id="2" transform="translate(0.000000, 296.000000)">
9
+ <g transform="translate(0.000000, 32.000000)" id="1">
10
+ <g id="time-circle" transform="translate(10.000000, 9.000000)">
11
+ <rect id="矩形" opacity="0" x="0" y="0" width="16" height="16"></rect>
12
+ <path d="M8,1 C4.134375,1 1,4.134375 1,8 C1,11.865625 4.134375,15 8,15 C11.865625,15 15,11.865625 15,8 C15,4.134375 11.865625,1 8,1 Z M8,13.8125 C4.790625,13.8125 2.1875,11.209375 2.1875,8 C2.1875,4.790625 4.790625,2.1875 8,2.1875 C11.209375,2.1875 13.8125,4.790625 13.8125,8 C13.8125,11.209375 11.209375,13.8125 8,13.8125 Z M10.7296875,9.978125 L8.5015625,8.3671875 L8.5015625,4.5 C8.5015625,4.43125 8.4453125,4.375 8.3765625,4.375 L7.625,4.375 C7.55625,4.375 7.5,4.43125 7.5,4.5 L7.5,8.803125 C7.5,8.84375 7.51875,8.88125 7.5515625,8.9046875 L10.1359375,10.7890625 C10.1921875,10.8296875 10.2703125,10.8171875 10.3109375,10.7625 L10.7578125,10.153125 C10.7984375,10.0953125 10.7859375,10.0171875 10.7296875,9.978125 L10.7296875,9.978125 Z" id="形状"></path>
13
+ </g>
14
+ </g>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </svg>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>编组 2</title>
4
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="聚合搜索框" transform="translate(-130.000000, -562.000000)">
6
+ <g id="2" transform="translate(120.000000, 356.000000)">
7
+ <g id="下拉菜单" transform="translate(0.000000, 70.000000)">
8
+ <g id="2" transform="translate(0.000000, 32.000000)">
9
+ <g id="3备份" transform="translate(0.000000, 96.000000)">
10
+ <g id="编组-2" transform="translate(10.000000, 8.000000)">
11
+ <rect id="矩形" x="0" y="0" width="16" height="16"></rect>
12
+ <circle id="椭圆形" stroke="#FAAD14" fill="#FFFFFF" fill-rule="nonzero" cx="8" cy="8" r="6.5"></circle>
13
+ <g id="V" transform="translate(5.245000, 5.274000)" fill="#FAAD14" fill-rule="nonzero">
14
+ <polygon points="0 0 2.376 6.426 3.285 6.426 5.661 0 4.851 0 2.844 5.625 2.817 5.625 0.81 0"></polygon>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </g>
21
+ </g>
22
+ </g>
23
+ </svg>