@chaoswise/business 0.0.17 → 1.0.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.
- package/config/babel/index.js +2 -29
- package/config/swc.js +5 -0
- package/lib/AggregateSearch/CLSPL/CLQLLexer.js +2 -2
- package/lib/AggregateSearch/CLSPL/CLQLParser.js +2 -2
- package/lib/AggregateSearch/CLSPL/CLQLParserListener.js +2 -2
- package/lib/AggregateSearch/CLSPL/CLQLParserVisitor.js +2 -2
- package/lib/AggregateSearch/CLSPL/SPLStagy.js +19 -9
- package/lib/AggregateSearch/CLSPL/index.js +4 -3
- package/lib/AggregateSearch/components/CloseAllIcon/index.js +1 -1
- package/lib/AggregateSearch/components/DropDown/config.js +54 -0
- package/lib/AggregateSearch/components/DropDown/index.js +33 -67
- package/lib/AggregateSearch/components/SwitchBtn/index.js +9 -7
- package/lib/AggregateSearch/hooks/useDropDown.js +2 -2
- package/lib/AggregateSearch/index.js +17 -5
- package/lib/AggregateSearch/index.less +1 -1
- package/lib/AggregateSearch/utils/index.js +3 -4
- package/lib/PropertyControlViewer/components/DoAppIcon/CustomIcon/index.js +1 -2
- package/lib/PropertyControlViewer/components/DoCiUnitBitmap.js +3 -3
- package/lib/PropertyControlViewer/components/DoCommon.js +3 -3
- package/lib/PropertyControlViewer/components/DoImage.js +2 -2
- package/lib/PropertyControlViewer/components/DoQuote/components/QuoteView.js +3 -3
- package/lib/PropertyControlViewer/components/DoSelect.js +3 -3
- package/lib/PropertyControlViewer/components/DoUser.js +15 -19
- package/lib/PropertyControlViewer/components/TagShowMoreList/index.js +4 -4
- package/lib/PropertyControlViewer/config/utils.js +60 -61
- package/lib/PropertyControlViewer/index.js +7 -6
- package/lib/Watermark/index.js +5 -7
- package/lib/locales/en_US.json +1 -0
- package/lib/locales/index.js +42 -0
- package/lib/locales/intl.js +75 -0
- package/lib/locales/withLocale.js +37 -0
- package/lib/locales/zh_CN.json +1 -0
- package/lib/locales/zh_TW.json +1 -0
- package/package.json +12 -7
- package/config/babel/antdComs.js +0 -51
- package/config/babel/formily.js +0 -22
- package/config/city/citys.js +0 -1964
- package/config/theme/CWTheme.js +0 -427
- package/config/theme/chart.dark.js +0 -394
- package/config/theme/chart.light.js +0 -3
- package/config/theme/common.less +0 -161
- package/config/theme/dark.js +0 -784
- package/config/theme/dark.less +0 -80
- package/config/theme/default.js +0 -717
- package/config/theme/default.less +0 -144
- package/config/theme/style/color/bezierEasing.less +0 -110
- package/config/theme/style/color/colorPalette.less +0 -85
- package/config/theme/style/color/colors.less +0 -162
- package/config/theme/style/color/tinyColor.less +0 -1184
- package/config/theme/style/compact.less +0 -4
- package/config/theme/style/components.less +0 -65
- package/config/theme/style/core/base.less +0 -10
- package/config/theme/style/core/global.less +0 -491
- package/config/theme/style/core/iconfont.less +0 -22
- package/config/theme/style/core/index.less +0 -5
- package/config/theme/style/core/motion/fade.less +0 -34
- package/config/theme/style/core/motion/move.less +0 -129
- package/config/theme/style/core/motion/other.less +0 -51
- package/config/theme/style/core/motion/slide.less +0 -129
- package/config/theme/style/core/motion/zoom.less +0 -179
- package/config/theme/style/core/motion.less +0 -22
- package/config/theme/style/css.js +0 -3
- package/config/theme/style/dark.less +0 -4
- package/config/theme/style/default.css +0 -1784
- package/config/theme/style/default.less +0 -4
- package/config/theme/style/index-pure.less +0 -2
- package/config/theme/style/index.css +0 -1784
- package/config/theme/style/index.d.ts +0 -1
- package/config/theme/style/index.js +0 -3
- package/config/theme/style/index.less +0 -3
- package/config/theme/style/mixins/box.less +0 -7
- package/config/theme/style/mixins/clearfix.less +0 -16
- package/config/theme/style/mixins/compatibility.less +0 -13
- package/config/theme/style/mixins/customize.less +0 -181
- package/config/theme/style/mixins/iconfont.less +0 -28
- package/config/theme/style/mixins/index.less +0 -14
- package/config/theme/style/mixins/modal-mask.less +0 -30
- package/config/theme/style/mixins/motion.less +0 -33
- package/config/theme/style/mixins/operation-unit.less +0 -16
- package/config/theme/style/mixins/reset.less +0 -11
- package/config/theme/style/mixins/rounded-arrow.less +0 -44
- package/config/theme/style/mixins/size.less +0 -10
- package/config/theme/style/mixins/typography.less +0 -58
- package/config/theme/style/themes/compact.less +0 -295
- package/config/theme/style/themes/dark.less +0 -457
- package/config/theme/style/themes/default.less +0 -1080
- package/config/theme/style/themes/index.less +0 -7
- package/config/theme/style/themes/variable.less +0 -1135
- package/config/theme/style/variable.less +0 -4
package/config/babel/index.js
CHANGED
|
@@ -1,36 +1,9 @@
|
|
|
1
|
-
const fse = require('fs-extra');
|
|
2
|
-
// 项目的根目录
|
|
3
|
-
const projectPath = process.cwd();
|
|
4
|
-
|
|
5
|
-
const ANTD_COMPONENTS = require('./antdComs');
|
|
6
|
-
|
|
7
1
|
const babelConfig = {
|
|
8
|
-
"libraryName": "@chaoswise/
|
|
2
|
+
"libraryName": "@chaoswise/business",
|
|
9
3
|
"camel2DashComponentName": false,
|
|
10
4
|
"customName": name => {
|
|
11
|
-
|
|
12
|
-
if(antdTarget) {
|
|
13
|
-
return `@chaoswise/ui/lib/Antd/${name}`
|
|
14
|
-
}
|
|
15
|
-
return `@chaoswise/ui/lib/${name}`
|
|
5
|
+
return `@chaoswise/business/lib/${name}`
|
|
16
6
|
},
|
|
17
|
-
// "style": name => {
|
|
18
|
-
// if(name.includes('Antd')) {
|
|
19
|
-
// const fileTargetPath = `${projectPath}/node_modules/${name}.less`;
|
|
20
|
-
// const isExist = fse.pathExistsSync(fileTargetPath);
|
|
21
|
-
// if(!isExist) {
|
|
22
|
-
// return false
|
|
23
|
-
// }
|
|
24
|
-
// return `${name}.less`
|
|
25
|
-
// }
|
|
26
|
-
// // 判断是否有样式文件
|
|
27
|
-
// const fileTargetPath = `${projectPath}/node_modules/${name}/index.less`;
|
|
28
|
-
// const isExist = fse.pathExistsSync(fileTargetPath);
|
|
29
|
-
// if(!isExist) {
|
|
30
|
-
// return false
|
|
31
|
-
// }
|
|
32
|
-
// return `${name}/index.less`
|
|
33
|
-
// }
|
|
34
7
|
}
|
|
35
8
|
|
|
36
9
|
module.exports = babelConfig;
|
package/config/swc.js
ADDED
|
@@ -10,8 +10,8 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
10
10
|
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; } }
|
|
11
11
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
12
|
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; }
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
// Generated from /Users/changle/Documents/code/doop/cql/src/main/resources/antlr/cql/CLQLLexer.g4 by ANTLR 4.9.2
|
|
16
16
|
// jshint ignore: start
|
|
17
17
|
import antlr4 from 'antlr4';
|
|
@@ -12,8 +12,8 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
12
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
13
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
14
|
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; }
|
|
15
|
-
function _toPropertyKey(
|
|
16
|
-
function _toPrimitive(
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
// Generated from /Users/changle/Documents/code/doop/cql/src/main/resources/antlr/cql/CLQLParser.g4 by ANTLR 4.9.2
|
|
18
18
|
// jshint ignore: start
|
|
19
19
|
import antlr4 from 'antlr4';
|
|
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
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
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(
|
|
6
|
-
function _toPrimitive(
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
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
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
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); }; }
|
|
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
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
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(
|
|
6
|
-
function _toPrimitive(
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
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
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
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); }; }
|
|
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
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
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(
|
|
6
|
-
function _toPrimitive(
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
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
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
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); }; }
|
|
@@ -12,6 +12,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
12
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
13
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
14
|
import antlr4 from 'antlr4';
|
|
15
|
+
import intl from '../../locales';
|
|
15
16
|
var NoViableAltException = antlr4.error.NoViableAltException;
|
|
16
17
|
var InputMismatchException = antlr4.error.InputMismatchException;
|
|
17
18
|
var FailedPredicateException = antlr4.error.FailedPredicateException;
|
|
@@ -29,7 +30,7 @@ var stahy = /*#__PURE__*/function (_antlr4$error$BailErr) {
|
|
|
29
30
|
_this = _super.call(this, props);
|
|
30
31
|
_this.errorRecoveryMode = true;
|
|
31
32
|
_this.explain = {
|
|
32
|
-
UNQUOTA_STRING: '字段名称'
|
|
33
|
+
UNQUOTA_STRING: intl.get('fbda5bcb-67b0-4b7c-85fd-fb30068f73a0').d('字段名称')
|
|
33
34
|
};
|
|
34
35
|
_this.expects = new Map([['LEFT_PAR', '('], ['RIGHT_PAR', ')']]);
|
|
35
36
|
return _this;
|
|
@@ -85,16 +86,16 @@ var stahy = /*#__PURE__*/function (_antlr4$error$BailErr) {
|
|
|
85
86
|
var input;
|
|
86
87
|
if (tokens !== null) {
|
|
87
88
|
if (e.startToken.type === Token.EOF) {
|
|
88
|
-
input = '语句不完整,缺少结尾';
|
|
89
|
+
input = intl.get('d6f72140-92e1-4214-8bcb-d548fa8ed1ce').d('语句不完整,缺少结尾');
|
|
89
90
|
} else {
|
|
90
91
|
input = tokens.getText(new Interval(e.startToken.tokenIndex, e.offendingToken.tokenIndex));
|
|
91
92
|
}
|
|
92
93
|
} else {
|
|
93
|
-
input = '存在 <未知输入>';
|
|
94
|
+
input = intl.get('4ced2ca1-2a3f-49d9-9907-1b404d5a1586').d('存在 <未知输入>');
|
|
94
95
|
}
|
|
95
96
|
var msg;
|
|
96
97
|
if (e.offendingToken.text) {
|
|
97
|
-
msg = '位置' + e.offendingToken.line + ':' + e.offendingToken.column + ',' + input;
|
|
98
|
+
msg = intl.get('b2df07f1-b093-4f56-9ec2-af471999634d').d('位置') + e.offendingToken.line + ':' + e.offendingToken.column + ',' + input;
|
|
98
99
|
} else {
|
|
99
100
|
msg = '' + e.offendingToken.text + input;
|
|
100
101
|
}
|
|
@@ -151,7 +152,10 @@ var stahy = /*#__PURE__*/function (_antlr4$error$BailErr) {
|
|
|
151
152
|
key: "reportInputMismatch",
|
|
152
153
|
value: function reportInputMismatch(recognizer, e) {
|
|
153
154
|
var t1 = recognizer.getInputStream().LT(-1);
|
|
154
|
-
var msg =
|
|
155
|
+
var msg = intl.get('8b3465a5-e2ca-4f7c-af17-2cb091ef40fe', {
|
|
156
|
+
slot0: this.getTokenErrorDisplay(t1),
|
|
157
|
+
slot1: this.transExpectByExplain(e.getExpectedTokens().toString(recognizer.literalNames, recognizer.symbolicNames))
|
|
158
|
+
}).d('{slot0} 后面,期望 {slot1}');
|
|
155
159
|
|
|
156
160
|
// console.log(msg)
|
|
157
161
|
// var msg = "mismatched input " + this.getTokenErrorDisplay(e.offendingToken) +
|
|
@@ -167,7 +171,10 @@ var stahy = /*#__PURE__*/function (_antlr4$error$BailErr) {
|
|
|
167
171
|
this.beginErrorCondition(recognizer);
|
|
168
172
|
var t = recognizer.getTokenStream().LT(-1);
|
|
169
173
|
var expecting = this.getExpectedTokens(recognizer);
|
|
170
|
-
var msg =
|
|
174
|
+
var msg = intl.get('2bf0d704-4106-4359-8488-d0e395f37d34', {
|
|
175
|
+
slot0: this.getTokenErrorDisplay(t),
|
|
176
|
+
slot1: expecting.toString(recognizer.literalNames, recognizer.symbolicNames)
|
|
177
|
+
}).d('在 {slot0} 后缺失 {slot1}');
|
|
171
178
|
recognizer.notifyErrorListeners(msg, t, null);
|
|
172
179
|
}
|
|
173
180
|
}, {
|
|
@@ -180,7 +187,10 @@ var stahy = /*#__PURE__*/function (_antlr4$error$BailErr) {
|
|
|
180
187
|
var t = recognizer.getCurrentToken();
|
|
181
188
|
var tokenName = this.getTokenErrorDisplay(t);
|
|
182
189
|
var expecting = this.getExpectedTokens(recognizer);
|
|
183
|
-
var msg =
|
|
190
|
+
var msg = intl.get('94f38306-0e2c-4d1c-beff-64d14bd7da20', {
|
|
191
|
+
tokenName: tokenName,
|
|
192
|
+
slot0: this.transExpectByExplain(expecting.toString(recognizer.literalNames, recognizer.symbolicNames))
|
|
193
|
+
}).d('不必要输入 {tokenName} ,期望 {slot0}');
|
|
184
194
|
recognizer.notifyErrorListeners(msg, t, null);
|
|
185
195
|
}
|
|
186
196
|
}]);
|
|
@@ -9,8 +9,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
9
9
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
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
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(
|
|
13
|
-
function _toPrimitive(
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
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
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
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); }; }
|
|
@@ -31,6 +31,7 @@ import MyGrammarLexer from './CLQLLexer.js';
|
|
|
31
31
|
import MyGrammarParser from './CLQLParser.js';
|
|
32
32
|
import visitor from './CLQLParserVisitor.js';
|
|
33
33
|
import stragy from './SPLStagy';
|
|
34
|
+
import intl from '../../locales';
|
|
34
35
|
var customErr = /*#__PURE__*/function (_antlr4$error$ErrorLi) {
|
|
35
36
|
_inherits(customErr, _antlr4$error$ErrorLi);
|
|
36
37
|
var _super = _createSuper(customErr);
|
|
@@ -107,7 +108,7 @@ var customVisitor = /*#__PURE__*/function (_visitor) {
|
|
|
107
108
|
column = _JSON$parse.column;
|
|
108
109
|
callback && callback({
|
|
109
110
|
type: 'error',
|
|
110
|
-
msg: '语法错误' + ':' + msg.replace('<EOF>', '结束').replace('Error:', '') + '',
|
|
111
|
+
msg: intl.get('3f52c2a1-892d-47fe-b296-49a35ff8c4ee').d('语法错误') + ':' + msg.replace('<EOF>', intl.get('30a2737a-c786-4f9f-bb22-02ca27a557ff').d('结束')).replace('Error:', '') + '',
|
|
111
112
|
line: line,
|
|
112
113
|
column: column
|
|
113
114
|
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import intl from '../../../locales';
|
|
2
|
+
|
|
3
|
+
// 匹配方式
|
|
4
|
+
export var DEFAULT_MATCH_OPTION_LIST = [{
|
|
5
|
+
value: ':',
|
|
6
|
+
get des() {
|
|
7
|
+
return intl.get('df7b8ec5-840a-4fc7-aa8c-806d470ec97c').d('等于');
|
|
8
|
+
}
|
|
9
|
+
}, {
|
|
10
|
+
value: 'NOT:',
|
|
11
|
+
get des() {
|
|
12
|
+
return intl.get('47e5459f-882c-4395-a8f1-d49e89b0a263').d('不等于');
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
// { value: "*", get des() { return "模糊匹配/包含" },
|
|
16
|
+
// { value: "NOT*", get des() { return "反向模糊匹配/不包含" },
|
|
17
|
+
// { value: "~", get des() { return "存在" },
|
|
18
|
+
// { value: "NOT~", get des() { return "不存在" },
|
|
19
|
+
{
|
|
20
|
+
value: '>',
|
|
21
|
+
get des() {
|
|
22
|
+
return intl.get('719234f9-de71-4fc6-ab3f-59287ff20570').d('大于');
|
|
23
|
+
}
|
|
24
|
+
}, {
|
|
25
|
+
value: '>=',
|
|
26
|
+
get des() {
|
|
27
|
+
return intl.get('e633ed68-a12e-4af5-9a7a-d2eb476f4cef').d('大于等于');
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
value: '<',
|
|
31
|
+
get des() {
|
|
32
|
+
return intl.get('7058c2d9-91f3-4fe6-8a38-2c145a627959').d('小于');
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
value: '<=',
|
|
36
|
+
get des() {
|
|
37
|
+
return intl.get('914a6df4-9561-4345-a98c-0559e3f787ff').d('小于等于');
|
|
38
|
+
}
|
|
39
|
+
}];
|
|
40
|
+
|
|
41
|
+
// 组合符号
|
|
42
|
+
export var DEFAULT_COMBINED_OPTION_LIST = [{
|
|
43
|
+
value: '()',
|
|
44
|
+
get des() {
|
|
45
|
+
return intl.get('48b09da1-28bf-497d-a327-0ad6e3ef9af1').d('括号');
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
// { value: '""', get des() { return "双引号" },
|
|
49
|
+
{
|
|
50
|
+
value: '[]',
|
|
51
|
+
get des() {
|
|
52
|
+
return intl.get('bdfe4b04-efd7-4f93-a6ba-3954aca3b0eb').d('数值区间');
|
|
53
|
+
}
|
|
54
|
+
}];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
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
|
-
import _Dropdown from "@chaoswise/ui/lib/
|
|
2
|
+
import _Dropdown from "@chaoswise/ui/lib/Dropdown";
|
|
3
3
|
import _Button from "@chaoswise/ui/lib/Button";
|
|
4
4
|
import _TooltipText from "@chaoswise/ui/lib/TooltipText";
|
|
5
5
|
import _message from "@chaoswise/ui/lib/message";
|
|
6
|
-
import _Spin from "@chaoswise/ui/lib/
|
|
6
|
+
import _Spin from "@chaoswise/ui/lib/Spin";
|
|
7
7
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
8
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -14,18 +14,20 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
14
14
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
15
15
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
16
16
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
17
|
-
import React, { useEffect, useState, useMemo, useRef } from
|
|
18
|
-
import { CopyToClipboard } from
|
|
19
|
-
import ResizeObserver from
|
|
20
|
-
import keyIcon from
|
|
21
|
-
import valueIcon from
|
|
22
|
-
import timeCircleIcon from
|
|
23
|
-
import copyIcon from
|
|
24
|
-
import deleteIcon from
|
|
25
|
-
import combinedIcon from
|
|
26
|
-
import
|
|
17
|
+
import React, { useEffect, useState, useMemo, useRef } from 'react';
|
|
18
|
+
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|
19
|
+
import ResizeObserver from 'resize-observer-polyfill';
|
|
20
|
+
import keyIcon from './assets/key.svg';
|
|
21
|
+
import valueIcon from './assets/value.svg';
|
|
22
|
+
import timeCircleIcon from './assets/time-circle.svg';
|
|
23
|
+
import copyIcon from './assets/copy.svg';
|
|
24
|
+
import deleteIcon from './assets/delete.svg';
|
|
25
|
+
import combinedIcon from './assets/combined.svg';
|
|
26
|
+
import { useIntl } from '../../../locales';
|
|
27
|
+
import { DEFAULT_MATCH_OPTION_LIST, DEFAULT_COMBINED_OPTION_LIST } from './config';
|
|
28
|
+
import './index.less';
|
|
27
29
|
function judgeNotEmpty(val) {
|
|
28
|
-
return val !== null && typeof val !==
|
|
30
|
+
return val !== null && typeof val !== 'undefined';
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
// 搜索高亮
|
|
@@ -34,49 +36,12 @@ function highLight(text, keyword) {
|
|
|
34
36
|
return [/*#__PURE__*/React.createElement("span", {
|
|
35
37
|
key: index,
|
|
36
38
|
style: {
|
|
37
|
-
color:
|
|
39
|
+
color: '#FF4D4F'
|
|
38
40
|
}
|
|
39
41
|
}, keyword), str];
|
|
40
42
|
}).slice(1);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
// 匹配方式
|
|
44
|
-
var DEFAULT_MATCH_OPTION_LIST = [{
|
|
45
|
-
value: ":",
|
|
46
|
-
des: "等于"
|
|
47
|
-
}, {
|
|
48
|
-
value: "NOT:",
|
|
49
|
-
des: "不等于"
|
|
50
|
-
},
|
|
51
|
-
// { value: "*", des: "模糊匹配/包含" },
|
|
52
|
-
// { value: "NOT*", des: "反向模糊匹配/不包含" },
|
|
53
|
-
// { value: "~", des: "存在" },
|
|
54
|
-
// { value: "NOT~", des: "不存在" },
|
|
55
|
-
{
|
|
56
|
-
value: ">",
|
|
57
|
-
des: "大于"
|
|
58
|
-
}, {
|
|
59
|
-
value: ">=",
|
|
60
|
-
des: "大于等于"
|
|
61
|
-
}, {
|
|
62
|
-
value: "<",
|
|
63
|
-
des: "小于"
|
|
64
|
-
}, {
|
|
65
|
-
value: "<=",
|
|
66
|
-
des: "小于等于"
|
|
67
|
-
}];
|
|
68
|
-
|
|
69
|
-
// 组合符号
|
|
70
|
-
var DEFAULT_COMBINED_OPTION_LIST = [{
|
|
71
|
-
value: "()",
|
|
72
|
-
des: "括号"
|
|
73
|
-
},
|
|
74
|
-
// { value: '""', des: "双引号" },
|
|
75
|
-
{
|
|
76
|
-
value: "[]",
|
|
77
|
-
des: "数值区间"
|
|
78
|
-
}];
|
|
79
|
-
|
|
80
45
|
/**
|
|
81
46
|
* 异步加载对应数据
|
|
82
47
|
* 高亮显示对应搜索关键字
|
|
@@ -182,6 +147,7 @@ var DropDown = function DropDown(props) {
|
|
|
182
147
|
onSelect: function onSelect() {}
|
|
183
148
|
} : _props$combinedOption,
|
|
184
149
|
containerWrapperRef = props.containerWrapperRef;
|
|
150
|
+
var intl = useIntl();
|
|
185
151
|
|
|
186
152
|
// 输入值
|
|
187
153
|
var keyOptionValue = keyOption.value;
|
|
@@ -425,9 +391,9 @@ var DropDown = function DropDown(props) {
|
|
|
425
391
|
className: "aggregate-drop-down"
|
|
426
392
|
}, keyOptionValueNotEmpty && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
427
393
|
className: "list-title"
|
|
428
|
-
},
|
|
394
|
+
}, intl.get('4412a02d-d11d-4231-bf91-fd65afd9ea77').d('标签搜索')), /*#__PURE__*/React.createElement(_Spin, {
|
|
429
395
|
spinning: keyLoading,
|
|
430
|
-
tip:
|
|
396
|
+
tip: intl.get('51b43939-ce6a-4a41-9038-832b8ab4a175').d('加载中...'),
|
|
431
397
|
size: "small"
|
|
432
398
|
}, !dropDownKeyListEmpty ? keyList.map(function (record, index) {
|
|
433
399
|
var value = record.value,
|
|
@@ -449,11 +415,11 @@ var DropDown = function DropDown(props) {
|
|
|
449
415
|
}, des));
|
|
450
416
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
451
417
|
className: "empty"
|
|
452
|
-
},
|
|
418
|
+
}, intl.get('1cd159c8-2a4d-4208-a170-55a34b91f671').d('暂无数据,提交搜索后搜索关键字')))), valueOptionValueNotEmpty && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
453
419
|
className: "list-title"
|
|
454
420
|
}, "Value"), /*#__PURE__*/React.createElement(_Spin, {
|
|
455
421
|
spinning: valueLoading,
|
|
456
|
-
tip:
|
|
422
|
+
tip: intl.get('51b43939-ce6a-4a41-9038-832b8ab4a175').d('加载中...'),
|
|
457
423
|
size: "small"
|
|
458
424
|
}, !dropDownValueListEmpty ? valueList.map(function (record, index) {
|
|
459
425
|
var value = record.value,
|
|
@@ -475,9 +441,9 @@ var DropDown = function DropDown(props) {
|
|
|
475
441
|
}, des));
|
|
476
442
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
477
443
|
className: "empty"
|
|
478
|
-
},
|
|
444
|
+
}, intl.get('1cd159c8-2a4d-4208-a170-55a34b91f671').d('暂无数据,提交搜索后搜索关键字')))), matchOption.isShow && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
479
445
|
className: "list-title"
|
|
480
|
-
},
|
|
446
|
+
}, intl.get('f2447d25-e81c-4656-9e4c-f66741dd8a52').d('匹配方式')), (matchOption.list || DEFAULT_MATCH_OPTION_LIST).map(function (record, index) {
|
|
481
447
|
var value = record.value,
|
|
482
448
|
des = record.des;
|
|
483
449
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -497,7 +463,7 @@ var DropDown = function DropDown(props) {
|
|
|
497
463
|
}, des));
|
|
498
464
|
})), combinedOption.isShow && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
499
465
|
className: "list-title"
|
|
500
|
-
},
|
|
466
|
+
}, intl.get('2e8bd2b4-57bf-4778-a254-3b577d0241c5').d('组合符号')), (combinedOption.list || DEFAULT_COMBINED_OPTION_LIST).map(function (record, index) {
|
|
501
467
|
var value = record.value,
|
|
502
468
|
des = record.des;
|
|
503
469
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -517,9 +483,9 @@ var DropDown = function DropDown(props) {
|
|
|
517
483
|
}, des));
|
|
518
484
|
})), historyOptionValueNotEmpty && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
519
485
|
className: "list-title"
|
|
520
|
-
},
|
|
486
|
+
}, intl.get('354fbc6d-1abb-4510-81a9-9aa2efa6f482').d('搜索历史')), /*#__PURE__*/React.createElement(_Spin, {
|
|
521
487
|
spinning: historyLoading,
|
|
522
|
-
tip:
|
|
488
|
+
tip: intl.get('51b43939-ce6a-4a41-9038-832b8ab4a175').d('加载中...'),
|
|
523
489
|
size: "small"
|
|
524
490
|
}, !dropDownListHistoryEmpty ? historyList.map(function (record, index) {
|
|
525
491
|
var id = record.id,
|
|
@@ -545,7 +511,7 @@ var DropDown = function DropDown(props) {
|
|
|
545
511
|
text: value,
|
|
546
512
|
onCopy: function onCopy(text) {
|
|
547
513
|
historyOption === null || historyOption === void 0 || historyOption.onCopy(text);
|
|
548
|
-
_message.success(
|
|
514
|
+
_message.success(intl.get('15444b85-9196-4bb6-97bd-eb5cd4186cb9').d('搜索条件已复制'));
|
|
549
515
|
}
|
|
550
516
|
}, /*#__PURE__*/React.createElement("img", {
|
|
551
517
|
onClick: function onClick(e) {
|
|
@@ -565,18 +531,18 @@ var DropDown = function DropDown(props) {
|
|
|
565
531
|
})));
|
|
566
532
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
567
533
|
className: "empty"
|
|
568
|
-
},
|
|
534
|
+
}, intl.get('1cd159c8-2a4d-4208-a170-55a34b91f671').d('暂无数据,提交搜索后搜索关键字'))))), /*#__PURE__*/React.createElement("div", {
|
|
569
535
|
className: "desc"
|
|
570
|
-
}, /*#__PURE__*/React.createElement(_TooltipText, null, /*#__PURE__*/React.createElement("span", null,
|
|
536
|
+
}, /*#__PURE__*/React.createElement(_TooltipText, null, /*#__PURE__*/React.createElement("span", null, intl.get('be953f09-653f-4715-a3b9-9e0faef199b3').d('全文检索:hello world')), /*#__PURE__*/React.createElement("span", {
|
|
571
537
|
className: "desc-margin-32"
|
|
572
|
-
}, "
|
|
538
|
+
}, intl.get('ff777cfe-21b4-4eb0-bf80-ebd92081fdf5').d('完全匹配:"hello world"')), /*#__PURE__*/React.createElement("span", {
|
|
573
539
|
className: "desc-margin-32"
|
|
574
|
-
},
|
|
540
|
+
}, intl.get('229e8f35-ce6c-403a-b52e-05346dd8eb0b').d('通配符:*?')), /*#__PURE__*/React.createElement("span", {
|
|
575
541
|
className: "desc-margin-32"
|
|
576
|
-
},
|
|
542
|
+
}, intl.get('e7413527-a5ee-4057-b765-3595cd26c09b').d('关联搜索:status:(error OR warning) AND NOT service:“service_a”'))), /*#__PURE__*/React.createElement(_Button, {
|
|
577
543
|
type: "link",
|
|
578
544
|
onClick: onHelpClick
|
|
579
|
-
},
|
|
545
|
+
}, intl.get('3431b29b-5fb7-411f-8a1d-8d7676b03264').d('帮助文档'))));
|
|
580
546
|
return /*#__PURE__*/React.createElement(_Dropdown, {
|
|
581
547
|
overlay: menu,
|
|
582
548
|
visible: visible,
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import _Tooltip from "@chaoswise/ui/lib/Tooltip";
|
|
2
|
-
import React from
|
|
3
|
-
import textIcon from
|
|
4
|
-
import tagIcon from
|
|
5
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import textIcon from './assets/text-icon.svg';
|
|
4
|
+
import tagIcon from './assets/tag-icon.svg';
|
|
5
|
+
import { useIntl } from '../../../locales';
|
|
6
|
+
import './index.less';
|
|
6
7
|
var SwitchBtn = function SwitchBtn(_ref) {
|
|
7
8
|
var mode = _ref.mode,
|
|
8
9
|
onChange = _ref.onChange;
|
|
9
|
-
var
|
|
10
|
-
var
|
|
10
|
+
var intl = useIntl();
|
|
11
|
+
var icon = mode === 'text' ? textIcon : tagIcon;
|
|
12
|
+
var title = mode === 'text' ? intl.get('5faa90fc-6455-499a-a0d5-c7ff9c9867df').d('切换为手写CQL语法模式') : intl.get('1e9cc6b2-f761-4aaa-a216-9f842c6f8fce').d('切换为筛选模式');
|
|
11
13
|
var onClick = function onClick() {
|
|
12
|
-
onChange(mode ===
|
|
14
|
+
onChange(mode === 'text' ? 'tag' : 'text');
|
|
13
15
|
};
|
|
14
16
|
return /*#__PURE__*/React.createElement(_Tooltip, {
|
|
15
17
|
title: title
|
|
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
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; }
|
|
5
|
-
function _toPropertyKey(
|
|
6
|
-
function _toPrimitive(
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
9
|
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); }
|
|
@@ -76,7 +76,10 @@ var AggregateSearch = function AggregateSearch(_ref) {
|
|
|
76
76
|
mode = _ref.mode,
|
|
77
77
|
_ref$defaultMode = _ref.defaultMode,
|
|
78
78
|
defaultMode = _ref$defaultMode === void 0 ? "tag" : _ref$defaultMode,
|
|
79
|
-
placeholder = _ref.placeholder
|
|
79
|
+
placeholder = _ref.placeholder,
|
|
80
|
+
className = _ref.className,
|
|
81
|
+
_ref$style = _ref.style,
|
|
82
|
+
style = _ref$style === void 0 ? {} : _ref$style;
|
|
80
83
|
// 输入模式
|
|
81
84
|
var _useState = useState(defaultMode),
|
|
82
85
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -93,7 +96,7 @@ var AggregateSearch = function AggregateSearch(_ref) {
|
|
|
93
96
|
var container = useRef(null);
|
|
94
97
|
var containerWrapperRef = useRef(null);
|
|
95
98
|
// 是否可编辑,若点击编辑区域外内容则不可编辑 todo:用于修复聚焦bug
|
|
96
|
-
var _useState5 = useState(
|
|
99
|
+
var _useState5 = useState(false),
|
|
97
100
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
98
101
|
contentEditable = _useState6[0],
|
|
99
102
|
setContentEditable = _useState6[1];
|
|
@@ -342,10 +345,11 @@ var AggregateSearch = function AggregateSearch(_ref) {
|
|
|
342
345
|
},
|
|
343
346
|
containerWrapperRef: containerWrapperRef
|
|
344
347
|
}, /*#__PURE__*/React.createElement("div", {
|
|
345
|
-
className: classnames("aggregate-search-wrapper", {
|
|
348
|
+
className: classnames("aggregate-search-wrapper", className, {
|
|
346
349
|
"aggregate-search-text-wrapper": curMode === "text"
|
|
347
350
|
}),
|
|
348
|
-
ref: containerWrapperRef
|
|
351
|
+
ref: containerWrapperRef,
|
|
352
|
+
style: style
|
|
349
353
|
}, /*#__PURE__*/React.createElement("div", {
|
|
350
354
|
spellCheck: false,
|
|
351
355
|
onCompositionEnd: function onCompositionEnd(e) {
|
|
@@ -416,6 +420,14 @@ AggregateSearch.propTypes = {
|
|
|
416
420
|
/**
|
|
417
421
|
* 内容为空提示
|
|
418
422
|
*/
|
|
419
|
-
placeholder: PropTypes.string
|
|
423
|
+
placeholder: PropTypes.string,
|
|
424
|
+
/**
|
|
425
|
+
* 聚合搜索框外层容器的类名
|
|
426
|
+
*/
|
|
427
|
+
className: PropTypes.string,
|
|
428
|
+
/**
|
|
429
|
+
* 用于设置容器外壳的样式
|
|
430
|
+
*/
|
|
431
|
+
style: PropTypes.object
|
|
420
432
|
};
|
|
421
433
|
export default AggregateSearch;
|