@chaoswise/business 1.1.0 → 2.1.0

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 (82) hide show
  1. package/lib/I18nInput/index.d.ts +31 -0
  2. package/lib/I18nInput/index.js +159 -58
  3. package/lib/index.d.ts +1 -0
  4. package/lib/index.js +0 -4
  5. package/lib/locales/en_US.json +1 -1
  6. package/lib/locales/index.d.ts +7 -0
  7. package/lib/locales/index.js +15 -19
  8. package/lib/locales/intl.d.ts +11 -0
  9. package/lib/locales/intl.js +18 -58
  10. package/lib/locales/ja_JP.json +1 -1
  11. package/lib/locales/normalizeLocale.d.ts +2 -0
  12. package/lib/locales/normalizeLocale.js +27 -0
  13. package/lib/locales/withLocale.d.ts +28 -0
  14. package/lib/locales/withLocale.js +1 -1
  15. package/lib/locales/zh_CN.json +1 -1
  16. package/lib/locales/zh_HK.json +1 -1
  17. package/lib/locales/zh_TW.json +1 -1
  18. package/package.json +8 -6
  19. package/lib/AggregateSearch/CLSPL/CLQLLexer.js +0 -78
  20. package/lib/AggregateSearch/CLSPL/CLQLParser.js +0 -2724
  21. package/lib/AggregateSearch/CLSPL/CLQLParserListener.js +0 -347
  22. package/lib/AggregateSearch/CLSPL/CLQLParserVisitor.js +0 -251
  23. package/lib/AggregateSearch/CLSPL/SPLStagy.js +0 -197
  24. package/lib/AggregateSearch/CLSPL/index.js +0 -196
  25. package/lib/AggregateSearch/CLSPL/makeTokenizeFn.js +0 -18
  26. package/lib/AggregateSearch/CLSPL/token.js +0 -7
  27. package/lib/AggregateSearch/components/CloseAllIcon/index.js +0 -13
  28. package/lib/AggregateSearch/components/CloseAllIcon/index.less +0 -11
  29. package/lib/AggregateSearch/components/DropDown/assets/combined.svg +0 -22
  30. package/lib/AggregateSearch/components/DropDown/assets/copy.svg +0 -22
  31. package/lib/AggregateSearch/components/DropDown/assets/delete.svg +0 -24
  32. package/lib/AggregateSearch/components/DropDown/assets/home.svg +0 -20
  33. package/lib/AggregateSearch/components/DropDown/assets/key.svg +0 -21
  34. package/lib/AggregateSearch/components/DropDown/assets/star.svg +0 -22
  35. package/lib/AggregateSearch/components/DropDown/assets/time-circle.svg +0 -20
  36. package/lib/AggregateSearch/components/DropDown/assets/value.svg +0 -23
  37. package/lib/AggregateSearch/components/DropDown/config.js +0 -54
  38. package/lib/AggregateSearch/components/DropDown/index.js +0 -576
  39. package/lib/AggregateSearch/components/DropDown/index.less +0 -118
  40. package/lib/AggregateSearch/components/SwitchBtn/assets/tag-icon.svg +0 -17
  41. package/lib/AggregateSearch/components/SwitchBtn/assets/text-icon.svg +0 -18
  42. package/lib/AggregateSearch/components/SwitchBtn/index.js +0 -27
  43. package/lib/AggregateSearch/components/SwitchBtn/index.less +0 -31
  44. package/lib/AggregateSearch/hooks/useDropDown.js +0 -428
  45. package/lib/AggregateSearch/index.js +0 -503
  46. package/lib/AggregateSearch/index.less +0 -225
  47. package/lib/AggregateSearch/utils/index.js +0 -391
  48. package/lib/ContentEditableSearch/components/CloseAllIcon/index.js +0 -13
  49. package/lib/ContentEditableSearch/components/CloseAllIcon/index.less +0 -11
  50. package/lib/ContentEditableSearch/index.js +0 -155
  51. package/lib/ContentEditableSearch/index.less +0 -65
  52. package/lib/ContentEditableSearch/utils/index.js +0 -98
  53. package/lib/PropertyControlViewer/assets/doCommon.less +0 -75
  54. package/lib/PropertyControlViewer/assets/doSelect.less +0 -74
  55. package/lib/PropertyControlViewer/assets/index.less +0 -189
  56. package/lib/PropertyControlViewer/components/DoAppIcon/CustomIcon/iconfont.js +0 -1
  57. package/lib/PropertyControlViewer/components/DoAppIcon/CustomIcon/index.js +0 -29
  58. package/lib/PropertyControlViewer/components/DoAppIcon/iconData/IconJson.js +0 -0
  59. package/lib/PropertyControlViewer/components/DoAppIcon/index.js +0 -41
  60. package/lib/PropertyControlViewer/components/DoCiUnitBitmap.js +0 -50
  61. package/lib/PropertyControlViewer/components/DoCommon.js +0 -36
  62. package/lib/PropertyControlViewer/components/DoDefaultPlaceholder.js +0 -9
  63. package/lib/PropertyControlViewer/components/DoImage.js +0 -107
  64. package/lib/PropertyControlViewer/components/DoQuote/components/QuoteView.js +0 -63
  65. package/lib/PropertyControlViewer/components/DoQuote/components/TableQuoteView.js +0 -18
  66. package/lib/PropertyControlViewer/components/DoQuote/index.js +0 -16
  67. package/lib/PropertyControlViewer/components/DoSelect.js +0 -80
  68. package/lib/PropertyControlViewer/components/DoTable.js +0 -44
  69. package/lib/PropertyControlViewer/components/DoUser.js +0 -61
  70. package/lib/PropertyControlViewer/components/TagShowMoreList/index.js +0 -132
  71. package/lib/PropertyControlViewer/components/TagShowMoreList/index.less +0 -106
  72. package/lib/PropertyControlViewer/config/constants.js +0 -84
  73. package/lib/PropertyControlViewer/config/utils.js +0 -353
  74. package/lib/PropertyControlViewer/index.js +0 -195
  75. package/lib/PropertyControlViewer/index.less +0 -107
  76. package/lib/Watermark/index.js +0 -184
  77. package/lib/Watermark/index.less +0 -17
  78. package/lib/demo.js +0 -0
  79. package/lib/locale/en_US.js +0 -9
  80. package/lib/locale/index.js +0 -12
  81. package/lib/locale/zh_CN.js +0 -9
  82. package/lib/locales/localeCode.js +0 -13
@@ -1,197 +0,0 @@
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(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
3
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
4
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
- function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
7
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
- function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
9
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
10
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
12
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
13
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
14
- import antlr4 from 'antlr4';
15
- import intl from '../../locales';
16
- var NoViableAltException = antlr4.error.NoViableAltException;
17
- var InputMismatchException = antlr4.error.InputMismatchException;
18
- var FailedPredicateException = antlr4.error.FailedPredicateException;
19
- var ParseCancellationException = antlr4.error.ParseCancellationException;
20
- var Token = antlr4.Token;
21
- // var Interval = antlr4.error.Interval;
22
- // var { Interval } = require('antlr4/IntervalSet')
23
- var Interval = antlr4.Interval;
24
- var stahy = /*#__PURE__*/function (_antlr4$error$BailErr) {
25
- function stahy(props) {
26
- var _this;
27
- _classCallCheck(this, stahy);
28
- _this = _callSuper(this, stahy, [props]);
29
- _this.errorRecoveryMode = true;
30
- _this.explain = {
31
- UNQUOTA_STRING: intl.get('fbda5bcb-67b0-4b7c-85fd-fb30068f73a0').d('字段名称')
32
- };
33
- _this.expects = new Map([['LEFT_PAR', '('], ['RIGHT_PAR', ')']]);
34
- return _this;
35
- }
36
- _inherits(stahy, _antlr4$error$BailErr);
37
- return _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 = intl.get('d6f72140-92e1-4214-8bcb-d548fa8ed1ce').d('语句不完整,缺少结尾');
89
- } else {
90
- input = tokens.getText(new Interval(e.startToken.tokenIndex, e.offendingToken.tokenIndex));
91
- }
92
- } else {
93
- input = intl.get('4ced2ca1-2a3f-49d9-9907-1b404d5a1586').d('存在 <未知输入>');
94
- }
95
- var msg;
96
- if (e.offendingToken.text) {
97
- msg = intl.get('b2df07f1-b093-4f56-9ec2-af471999634d').d('位置') + 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 = intl.get('8b3465a5-e2ca-4f7c-af17-2cb091ef40fe', {
155
- slot0: this.getTokenErrorDisplay(t1),
156
- slot1: this.transExpectByExplain(e.getExpectedTokens().toString(recognizer.literalNames, recognizer.symbolicNames))
157
- }).d('{slot0} 后面,期望 {slot1}');
158
-
159
- // console.log(msg)
160
- // var msg = "mismatched input " + this.getTokenErrorDisplay(e.offendingToken) +
161
- // " expecting " + e.getExpectedTokens().toString(recognizer.literalNames, recognizer.symbolicNames);
162
- recognizer.notifyErrorListeners(msg, e.offendingToken, e);
163
- }
164
- }, {
165
- key: "reportMissingToken",
166
- value: function reportMissingToken(recognizer) {
167
- if (this.inErrorRecoveryMode(recognizer)) {
168
- return null;
169
- }
170
- this.beginErrorCondition(recognizer);
171
- var t = recognizer.getTokenStream().LT(-1);
172
- var expecting = this.getExpectedTokens(recognizer);
173
- var msg = intl.get('2bf0d704-4106-4359-8488-d0e395f37d34', {
174
- slot0: this.getTokenErrorDisplay(t),
175
- slot1: expecting.toString(recognizer.literalNames, recognizer.symbolicNames)
176
- }).d('在 {slot0} 后缺失 {slot1}');
177
- recognizer.notifyErrorListeners(msg, t, null);
178
- }
179
- }, {
180
- key: "reportUnwantedToken",
181
- value: function reportUnwantedToken(recognizer) {
182
- if (this.inErrorRecoveryMode(recognizer)) {
183
- return;
184
- }
185
- this.beginErrorCondition(recognizer);
186
- var t = recognizer.getCurrentToken();
187
- var tokenName = this.getTokenErrorDisplay(t);
188
- var expecting = this.getExpectedTokens(recognizer);
189
- var msg = intl.get('94f38306-0e2c-4d1c-beff-64d14bd7da20', {
190
- tokenName: tokenName,
191
- slot0: this.transExpectByExplain(expecting.toString(recognizer.literalNames, recognizer.symbolicNames))
192
- }).d('不必要输入 {tokenName} ,期望 {slot0}');
193
- recognizer.notifyErrorListeners(msg, t, null);
194
- }
195
- }]);
196
- }(antlr4.error.BailErrorStrategy);
197
- export default stahy;
@@ -1,196 +0,0 @@
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(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
5
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
6
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
7
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
10
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
11
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
12
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
13
- function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
14
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
- function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
16
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
17
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
19
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
20
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
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: 2023-06-14 16:01:25
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.js';
34
- import intl from '../../locales';
35
- var customErr = /*#__PURE__*/function (_antlr4$error$ErrorLi) {
36
- function customErr(props) {
37
- _classCallCheck(this, customErr);
38
- return _callSuper(this, customErr, [props]);
39
- }
40
- _inherits(customErr, _antlr4$error$ErrorLi);
41
- return _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
- }(antlr4.error.ErrorListener);
52
- var Token = {
53
- STAR: '*',
54
- QUESTION: '?',
55
- WEI: '#'
56
- };
57
- var customVisitor = /*#__PURE__*/function (_visitor) {
58
- function customVisitor(props) {
59
- var _this;
60
- _classCallCheck(this, customVisitor);
61
- _this = _callSuper(this, customVisitor, [props]);
62
- _defineProperty(_this, "resolving", function (callback) {
63
- var input = _this.spl;
64
- if (/^\s*$/.test(input)) {
65
- callback({
66
- type: 'normal',
67
- splitWords: []
68
- });
69
- return;
70
- }
71
- var chars = new antlr4.InputStream(input);
72
- var lexer = new MyGrammarLexer(chars);
73
- var tokens = new antlr4.CommonTokenStream(lexer);
74
- var parser = new MyGrammarParser(tokens);
75
- parser.removeErrorListeners();
76
- try {
77
- // parser.removeParseListeners()
78
- // parser.addParseListener(new stragy())
79
- parser.addErrorListener(new customErr({
80
- callback: callback
81
- }));
82
- parser._errHandler = new stragy();
83
- var tree;
84
- tree = parser.root();
85
- _this.visitRoot(tree);
86
- switch (_this.state) {
87
- case 2:
88
- callback && callback({
89
- type: 'regexp',
90
- splitWords: Array.from(new Set(_this.words)) || []
91
- });
92
- break;
93
- default:
94
- callback({
95
- type: 'normal',
96
- splitWords: Array.from(new Set(_this.words)) || []
97
- });
98
- break;
99
- }
100
- } catch (error) {
101
- var geterror = function geterror() {
102
- try {
103
- return JSON.parse(error.message);
104
- } catch (error) {
105
- return {
106
- msg: error.message,
107
- line: '',
108
- column: ''
109
- };
110
- }
111
- };
112
- var _geterror = geterror(),
113
- msg = _geterror.msg,
114
- line = _geterror.line,
115
- column = _geterror.column;
116
- callback && callback({
117
- type: 'error',
118
- msg: intl.get('3f52c2a1-892d-47fe-b296-49a35ff8c4ee').d('语法错误') + ':' + msg.replace('<EOF>', intl.get('30a2737a-c786-4f9f-bb22-02ca27a557ff').d('结束')).replace('Error:', '') + '',
119
- line: line,
120
- column: column
121
- });
122
- }
123
- });
124
- _this.spl = props.spl;
125
- _this.state = 1;
126
- _this.tokenization = props.tokenization;
127
- _this.words = [];
128
- return _this;
129
- }
130
- _inherits(customVisitor, _visitor);
131
- return _createClass(customVisitor, [{
132
- key: "visitTextRegexExpr",
133
- value: function visitTextRegexExpr(ctx) {
134
- this.state = 2; //正则
135
- return this.visitChildren(ctx);
136
- }
137
- }, {
138
- key: "replaceQuotes",
139
- value: function replaceQuotes(str) {
140
- var regex = /^"(.*)"$/; // 匹配以双引号开头和结尾的字符串
141
- var match = regex.exec(str);
142
- if (match) {
143
- return match[1]; // 返回匹配到的第一个捕获组,即双引号中间的部分
144
- } else {
145
- return str;
146
- }
147
- }
148
- }, {
149
- key: "visitTextSearchExpr",
150
- value: function visitTextSearchExpr(ctx) {
151
- var fuzzy_literal_valueContext = ctx.text_search_expr().fuzzy_literal_value();
152
- if (fuzzy_literal_valueContext.fuzzy_literal() != null) {
153
- var fuzzyText = ctx.getText();
154
- if (fuzzyText.startsWith(Token.STAR)) {
155
- fuzzyText = fuzzyText.substring(1);
156
- } else if (fuzzyText.startsWith(Token.QUESTION)) {
157
- fuzzyText = fuzzyText.substring(1);
158
- }
159
- if (fuzzyText.endsWith(Token.STAR)) {
160
- fuzzyText = fuzzyText.substring(0, fuzzyText.length - 1);
161
- } else if (fuzzyText.endsWith(Token.QUESTION)) {
162
- fuzzyText = fuzzyText.substring(0, fuzzyText.length - 1);
163
- }
164
- this.words.push(fuzzyText);
165
- } else {
166
- var literalValueCtx = fuzzy_literal_valueContext.literal_value();
167
- var text = literalValueCtx.getText();
168
- if (literalValueCtx.string_literal() != null) {
169
- if (literalValueCtx.string_literal().DQUOTA_STRING() != null) {
170
- // 文本
171
- // text = text.substring(1, text.length - 1).replace(/\\\\"/g, '"');
172
- text = this.replaceQuotes(text);
173
- }
174
- }
175
- var tokenSearchLimit = 300; //logCoreContext.getNacosService().getTokenSearchLimit();
176
- var tokenization = this.tokenization;
177
- // 判断是否开启分词
178
- if (tokenization != null && tokenization && text.length <= tokenSearchLimit) {
179
- var splitWords = text.trim().split(new RegExp('[\\s\\\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\_\\=\\+\\[\\{\\]\\}\\|\\;\\:\\\'"\\,\\<\\.\\>\\/\\?]+'));
180
- if (splitWords.length == 0) {
181
- this.words.push('');
182
- } else {
183
- var _this$words;
184
- // 过滤空字符串
185
- var list = splitWords.filter(Boolean);
186
- (_this$words = this.words).push.apply(_this$words, _toConsumableArray(list));
187
- }
188
- } else {
189
- //不分词, 整体高亮
190
- this.words.push(text.replace(/\\/g, ''));
191
- }
192
- }
193
- }
194
- }]);
195
- }(visitor);
196
- export default customVisitor;
@@ -1,18 +0,0 @@
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;
@@ -1,7 +0,0 @@
1
- export var TOKEN_TYPES = {
2
- NONE: 'none',
3
- IDENTIFIER: 'identifier',
4
- NUMBER: 'number',
5
- KEYWORD: 'keyword',
6
- MATCH: 'match'
7
- };
@@ -1,13 +0,0 @@
1
- import _Icon from "@chaoswise/ui/lib/Icon";
2
- import React from "react";
3
- import "./index.less";
4
- var CloseAllIcon = function CloseAllIcon(_ref) {
5
- var onClickCloseAll = _ref.onClickCloseAll;
6
- return /*#__PURE__*/React.createElement(_Icon, {
7
- type: "close-circle",
8
- theme: "filled",
9
- onClick: onClickCloseAll,
10
- className: "close-all-icon"
11
- });
12
- };
13
- export default CloseAllIcon;
@@ -1,11 +0,0 @@
1
- .close-all-icon{
2
- display: block;
3
- position: absolute;
4
- right: 45px;
5
- top: 7px;
6
- color: rgba(0,0,0,0.25);
7
- cursor: pointer;
8
- &:hover{
9
- color: @text-color-secondary;
10
- }
11
- }
@@ -1,22 +0,0 @@
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>
@@ -1,22 +0,0 @@
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>
@@ -1,24 +0,0 @@
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>
@@ -1,20 +0,0 @@
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>
@@ -1,21 +0,0 @@
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>
@@ -1,22 +0,0 @@
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>
@@ -1,20 +0,0 @@
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>
@@ -1,23 +0,0 @@
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>