@chaoswise/business 0.0.18 → 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.
Files changed (82) hide show
  1. package/config/babel/index.js +2 -29
  2. package/config/swc.js +5 -0
  3. package/lib/AggregateSearch/CLSPL/SPLStagy.js +17 -7
  4. package/lib/AggregateSearch/CLSPL/index.js +2 -1
  5. package/lib/AggregateSearch/components/CloseAllIcon/index.js +1 -1
  6. package/lib/AggregateSearch/components/DropDown/config.js +54 -0
  7. package/lib/AggregateSearch/components/DropDown/index.js +33 -67
  8. package/lib/AggregateSearch/components/SwitchBtn/index.js +9 -7
  9. package/lib/AggregateSearch/index.js +17 -5
  10. package/lib/AggregateSearch/index.less +1 -1
  11. package/lib/PropertyControlViewer/components/DoAppIcon/CustomIcon/index.js +1 -1
  12. package/lib/PropertyControlViewer/components/DoCiUnitBitmap.js +1 -1
  13. package/lib/PropertyControlViewer/components/DoCommon.js +1 -1
  14. package/lib/PropertyControlViewer/components/DoQuote/components/QuoteView.js +3 -3
  15. package/lib/PropertyControlViewer/components/DoSelect.js +1 -1
  16. package/lib/PropertyControlViewer/components/DoUser.js +15 -19
  17. package/lib/PropertyControlViewer/components/TagShowMoreList/index.js +2 -2
  18. package/lib/PropertyControlViewer/config/utils.js +58 -59
  19. package/lib/PropertyControlViewer/index.js +7 -6
  20. package/lib/Watermark/index.js +35 -16
  21. package/lib/locales/en_US.json +1 -0
  22. package/lib/locales/index.js +42 -0
  23. package/lib/locales/intl.js +75 -0
  24. package/lib/locales/withLocale.js +37 -0
  25. package/lib/locales/zh_CN.json +1 -0
  26. package/lib/locales/zh_TW.json +1 -0
  27. package/package.json +12 -7
  28. package/config/babel/antdComs.js +0 -51
  29. package/config/babel/formily.js +0 -22
  30. package/config/city/citys.js +0 -1964
  31. package/config/theme/CWTheme.js +0 -427
  32. package/config/theme/chart.dark.js +0 -394
  33. package/config/theme/chart.light.js +0 -3
  34. package/config/theme/common.less +0 -161
  35. package/config/theme/dark.js +0 -784
  36. package/config/theme/dark.less +0 -80
  37. package/config/theme/default.js +0 -717
  38. package/config/theme/default.less +0 -144
  39. package/config/theme/style/color/bezierEasing.less +0 -110
  40. package/config/theme/style/color/colorPalette.less +0 -85
  41. package/config/theme/style/color/colors.less +0 -162
  42. package/config/theme/style/color/tinyColor.less +0 -1184
  43. package/config/theme/style/compact.less +0 -4
  44. package/config/theme/style/components.less +0 -65
  45. package/config/theme/style/core/base.less +0 -10
  46. package/config/theme/style/core/global.less +0 -491
  47. package/config/theme/style/core/iconfont.less +0 -22
  48. package/config/theme/style/core/index.less +0 -5
  49. package/config/theme/style/core/motion/fade.less +0 -34
  50. package/config/theme/style/core/motion/move.less +0 -129
  51. package/config/theme/style/core/motion/other.less +0 -51
  52. package/config/theme/style/core/motion/slide.less +0 -129
  53. package/config/theme/style/core/motion/zoom.less +0 -179
  54. package/config/theme/style/core/motion.less +0 -22
  55. package/config/theme/style/css.js +0 -3
  56. package/config/theme/style/dark.less +0 -4
  57. package/config/theme/style/default.css +0 -1784
  58. package/config/theme/style/default.less +0 -4
  59. package/config/theme/style/index-pure.less +0 -2
  60. package/config/theme/style/index.css +0 -1784
  61. package/config/theme/style/index.d.ts +0 -1
  62. package/config/theme/style/index.js +0 -3
  63. package/config/theme/style/index.less +0 -3
  64. package/config/theme/style/mixins/box.less +0 -7
  65. package/config/theme/style/mixins/clearfix.less +0 -16
  66. package/config/theme/style/mixins/compatibility.less +0 -13
  67. package/config/theme/style/mixins/customize.less +0 -181
  68. package/config/theme/style/mixins/iconfont.less +0 -28
  69. package/config/theme/style/mixins/index.less +0 -14
  70. package/config/theme/style/mixins/modal-mask.less +0 -30
  71. package/config/theme/style/mixins/motion.less +0 -33
  72. package/config/theme/style/mixins/operation-unit.less +0 -16
  73. package/config/theme/style/mixins/reset.less +0 -11
  74. package/config/theme/style/mixins/rounded-arrow.less +0 -44
  75. package/config/theme/style/mixins/size.less +0 -10
  76. package/config/theme/style/mixins/typography.less +0 -58
  77. package/config/theme/style/themes/compact.less +0 -295
  78. package/config/theme/style/themes/dark.less +0 -457
  79. package/config/theme/style/themes/default.less +0 -1080
  80. package/config/theme/style/themes/index.less +0 -7
  81. package/config/theme/style/themes/variable.less +0 -1135
  82. package/config/theme/style/variable.less +0 -4
@@ -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/ui",
2
+ "libraryName": "@chaoswise/business",
9
3
  "camel2DashComponentName": false,
10
4
  "customName": name => {
11
- const antdTarget = ANTD_COMPONENTS.find(item => name === item);
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
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ "@chaoswise/business": {
3
+ "transform": "@chaoswise/business/lib/{{member}}"
4
+ },
5
+ }
@@ -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 = "".concat(this.getTokenErrorDisplay(t1), " \u540E\u9762\uFF0C\u671F\u671B ").concat(this.transExpectByExplain(e.getExpectedTokens().toString(recognizer.literalNames, recognizer.symbolicNames)));
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 = "\u5728 ".concat(this.getTokenErrorDisplay(t), " \u540E\u7F3A\u5931 ").concat(expecting.toString(recognizer.literalNames, recognizer.symbolicNames));
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 = "\u4E0D\u5FC5\u8981\u8F93\u5165 ".concat(tokenName, " \uFF0C\u671F\u671B ").concat(this.transExpectByExplain(expecting.toString(recognizer.literalNames, recognizer.symbolicNames)));
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
  }]);
@@ -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
  });
@@ -1,4 +1,4 @@
1
- import _Icon from "@chaoswise/ui/lib/Antd/Icon";
1
+ import _Icon from "@chaoswise/ui/lib/Icon";
2
2
  import React from "react";
3
3
  import "./index.less";
4
4
  var CloseAllIcon = function CloseAllIcon(_ref) {
@@ -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/Antd/Dropdown";
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/Antd/Spin";
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 "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 "./index.less";
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 !== "undefined";
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: "#FF4D4F"
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
- }, "\u6807\u7B7E\u641C\u7D22"), /*#__PURE__*/React.createElement(_Spin, {
394
+ }, intl.get('4412a02d-d11d-4231-bf91-fd65afd9ea77').d('标签搜索')), /*#__PURE__*/React.createElement(_Spin, {
429
395
  spinning: keyLoading,
430
- tip: "\u52A0\u8F7D\u4E2D...",
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
- }, "\u6682\u65E0\u6570\u636E\uFF0C\u63D0\u4EA4\u641C\u7D22\u540E\u641C\u7D22\u5173\u952E\u5B57"))), valueOptionValueNotEmpty && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
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: "\u52A0\u8F7D\u4E2D...",
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
- }, "\u6682\u65E0\u6570\u636E\uFF0C\u63D0\u4EA4\u641C\u7D22\u540E\u641C\u7D22\u5173\u952E\u5B57"))), matchOption.isShow && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
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
- }, "\u5339\u914D\u65B9\u5F0F"), (matchOption.list || DEFAULT_MATCH_OPTION_LIST).map(function (record, index) {
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
- }, "\u7EC4\u5408\u7B26\u53F7"), (combinedOption.list || DEFAULT_COMBINED_OPTION_LIST).map(function (record, index) {
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
- }, "\u641C\u7D22\u5386\u53F2"), /*#__PURE__*/React.createElement(_Spin, {
486
+ }, intl.get('354fbc6d-1abb-4510-81a9-9aa2efa6f482').d('搜索历史')), /*#__PURE__*/React.createElement(_Spin, {
521
487
  spinning: historyLoading,
522
- tip: "\u52A0\u8F7D\u4E2D...",
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
- }, "\u6682\u65E0\u6570\u636E\uFF0C\u63D0\u4EA4\u641C\u7D22\u540E\u641C\u7D22\u5173\u952E\u5B57")))), /*#__PURE__*/React.createElement("div", {
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, "\u5168\u6587\u68C0\u7D22\uFF1Ahello world"), /*#__PURE__*/React.createElement("span", {
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
- }, "\u5B8C\u5168\u5339\u914D\uFF1A\"hello world\""), /*#__PURE__*/React.createElement("span", {
538
+ }, intl.get('ff777cfe-21b4-4eb0-bf80-ebd92081fdf5').d('完全匹配:"hello world"')), /*#__PURE__*/React.createElement("span", {
573
539
  className: "desc-margin-32"
574
- }, "\u901A\u914D\u7B26\uFF1A*?"), /*#__PURE__*/React.createElement("span", {
540
+ }, intl.get('229e8f35-ce6c-403a-b52e-05346dd8eb0b').d('通配符:*?')), /*#__PURE__*/React.createElement("span", {
575
541
  className: "desc-margin-32"
576
- }, "\u5173\u8054\u641C\u7D22\uFF1Astatus:(error OR warning) AND NOT service:\u201Cservice_a\u201D")), /*#__PURE__*/React.createElement(_Button, {
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
- }, "\u5E2E\u52A9\u6587\u6863")));
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 "react";
3
- import textIcon from "./assets/text-icon.svg";
4
- import tagIcon from "./assets/tag-icon.svg";
5
- import "./index.less";
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 icon = mode === "text" ? textIcon : tagIcon;
10
- var title = mode === "text" ? "切换为手写CQL语法模式" : "切换为筛选模式";
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 === "text" ? "tag" : "text");
14
+ onChange(mode === 'text' ? 'tag' : 'text');
13
15
  };
14
16
  return /*#__PURE__*/React.createElement(_Tooltip, {
15
17
  title: title
@@ -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(true),
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;
@@ -23,7 +23,7 @@
23
23
  position: relative;
24
24
  border: @border-width-base @border-style-base @input-border-color;
25
25
  border-radius: @border-radius-base;
26
-
26
+ width: 100%;
27
27
  // 聚焦样式修改
28
28
  &:focus-within {
29
29
  .active();
@@ -1,4 +1,4 @@
1
- import _Icon from "@chaoswise/ui/lib/Antd/Icon";
1
+ import _Icon from "@chaoswise/ui/lib/Icon";
2
2
  var _excluded = ["type"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -1,4 +1,4 @@
1
- import _Popover from "@chaoswise/ui/lib/Antd/Popover";
1
+ import _Popover from "@chaoswise/ui/lib/Popover";
2
2
  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); }
3
3
  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; }
4
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
@@ -1,6 +1,6 @@
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
2
  import _TooltipText from "@chaoswise/ui/lib/TooltipText";
3
- import _Typography from "@chaoswise/ui/lib/Antd/Typography";
3
+ import _Typography from "@chaoswise/ui/lib/Typography";
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
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
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); }
@@ -1,7 +1,7 @@
1
- import _List from "@chaoswise/ui/lib/Antd/List";
1
+ import _List from "@chaoswise/ui/lib/List";
2
2
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
3
- import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
4
- import _Card from "@chaoswise/ui/lib/Antd/Card";
3
+ import _Avatar from "@chaoswise/ui/lib/Avatar";
4
+ import _Card from "@chaoswise/ui/lib/Card";
5
5
  import React from 'react';
6
6
  import DoAppIcon from '../../DoAppIcon';
7
7
  import '../../../assets/index.less';
@@ -1,4 +1,4 @@
1
- import _Popover from "@chaoswise/ui/lib/Antd/Popover";
1
+ import _Popover from "@chaoswise/ui/lib/Popover";
2
2
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
3
3
  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); }
4
4
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@@ -1,10 +1,9 @@
1
1
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
2
- import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
3
- import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
2
+ import _Avatar from "@chaoswise/ui/lib/Avatar";
4
3
  import React, { Fragment } from 'react';
5
4
  import '../assets/index.less';
6
5
  import TagShowMoreList from './TagShowMoreList';
7
- import { getLocale } from "../../locale";
6
+ import { useIntl } from '../../locales';
8
7
  var DoUser = function DoUser(_ref) {
9
8
  var data = _ref.data;
10
9
  var belongComponentType = data.belongComponentType,
@@ -12,30 +11,27 @@ var DoUser = function DoUser(_ref) {
12
11
  tooltipContent = data.tooltipContent,
13
12
  list = data.list,
14
13
  componentType = data.componentType;
15
- var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
16
- _ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
17
- locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
18
- var localeObj = getLocale(locale);
14
+ var intl = useIntl();
19
15
  var userTooltip = {
20
- userName: localeObj.name + ":",
21
- userAlias: localeObj.userName + ":",
22
- department: localeObj.department + ":",
23
- email: localeObj.emil + ":",
24
- mobile: localeObj.mobile + ":"
16
+ userName: intl.get('5b412c79-b099-47cd-8745-21264d9212c4').d('姓名') + ':',
17
+ userAlias: intl.get('43395ce9-35f2-4a6d-9e84-8c277369157b').d('用户名') + ':',
18
+ department: intl.get('3190d9a0-41bf-42b3-adf9-9d22a337f65d').d('部门') + ':',
19
+ email: intl.get('e28ef3cf-569c-49f8-99b3-533e5013cb9d').d('邮箱') + ':',
20
+ mobile: intl.get('905a2fe5-4c8a-467e-813a-963fdb268b10').d('手机') + ':'
25
21
  };
26
22
  var userGroupTooltip = {
27
- groupName: localeObj.groupName + ":",
28
- groupDetails: localeObj.groupDetails + ":"
23
+ groupName: intl.get('bc71d288-1654-454d-8639-5ed225d8d6f6').d('用户组') + ':',
24
+ groupDetails: intl.get('e94234be-e478-4314-bc85-572cc285f5f9').d('描述') + ':'
29
25
  };
30
- tooltipContent = componentType === "USER_GROUP" ? userGroupTooltip : userTooltip;
31
- var gridShare = belongComponentType === "TABLE" ? '100%' : fieldWidth == 'WHOLE_LINE' ? '25%' : '50%';
26
+ tooltipContent = componentType === 'USER_GROUP' ? userGroupTooltip : userTooltip;
27
+ var gridShare = belongComponentType === 'TABLE' ? '100%' : fieldWidth == 'WHOLE_LINE' ? '25%' : '50%';
32
28
  var tooltipContentFuc = function tooltipContentFuc(item) {
33
29
  return Object.keys(tooltipContent).map(function (key) {
34
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, tooltipContent[key], " ", item[key] || "", " "), /*#__PURE__*/React.createElement("br", null));
30
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, tooltipContent[key], " ", item[key] || '', ' '), /*#__PURE__*/React.createElement("br", null));
35
31
  });
36
32
  };
37
- var nameKey = componentType === "USER_GROUP" ? 'groupName' : 'userAlias';
38
- return /*#__PURE__*/React.createElement(Fragment, null, belongComponentType === "TABLE" ? /*#__PURE__*/React.createElement(TagShowMoreList, {
33
+ var nameKey = componentType === 'USER_GROUP' ? 'groupName' : 'userAlias';
34
+ return /*#__PURE__*/React.createElement(Fragment, null, belongComponentType === 'TABLE' ? /*#__PURE__*/React.createElement(TagShowMoreList, {
39
35
  text: list,
40
36
  tagCount: 1,
41
37
  flag: "user",
@@ -1,6 +1,6 @@
1
- import _Popover from "@chaoswise/ui/lib/Antd/Popover";
1
+ import _Popover from "@chaoswise/ui/lib/Popover";
2
2
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
3
- import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
3
+ import _Avatar from "@chaoswise/ui/lib/Avatar";
4
4
  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); }
5
5
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
6
  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."); }