@chaoswise/ui 2.7.11 → 2.8.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 (219) hide show
  1. package/lib/AlgorithmChart/common/chart.option.js +14 -11
  2. package/lib/AlgorithmChart/index.js +29 -26
  3. package/lib/Antd4/comment/index.js +1 -1
  4. package/lib/Antd4Form/FormItem.js +1 -1
  5. package/lib/BasicLayout/Nav.js +3 -5
  6. package/lib/BasicLayout/index.js +9 -10
  7. package/lib/CWCascader/rc-cascader/OptionList/Column.js +17 -18
  8. package/lib/CWMessage/MessageContent/TabList/index.js +19 -17
  9. package/lib/CWMessage/MessageContent/index.js +86 -73
  10. package/lib/CWMessage/index.js +62 -50
  11. package/lib/CWMessage/service/index.js +14 -14
  12. package/lib/CWMessage/utils/index.js +18 -11
  13. package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +16 -10
  14. package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +4 -6
  15. package/lib/CWRangePicker/DropdownMenu/index.js +20 -13
  16. package/lib/CWRangePicker/Refresh/index.js +4 -7
  17. package/lib/CWRangePicker/TimeSpan/index.js +6 -9
  18. package/lib/CWRangePicker/index.js +39 -32
  19. package/lib/CWRangePicker/utils/index.js +45 -114
  20. package/lib/CWSelect/index.js +7 -10
  21. package/lib/CWTable/CWTable.js +23 -23
  22. package/lib/CWTable/EditLine.js +5 -8
  23. package/lib/CWTable/Filter.js +5 -8
  24. package/lib/CWTable/index.js +3 -0
  25. package/lib/CWTree/index.js +4 -7
  26. package/lib/CWUpload/upload/Dragger.js +4 -7
  27. package/lib/CWUpload/upload/UploadList.js +12 -15
  28. package/lib/CardSelect/index.js +16 -14
  29. package/lib/CitySelect/index.js +3 -1
  30. package/lib/ColorPicker/index.js +4 -7
  31. package/lib/ConfigProvider/ConfigProvider.js +143 -48
  32. package/lib/ConfigProvider/Switch.js +10 -2
  33. package/lib/ConfigProvider/context.js +8 -0
  34. package/lib/ConfigProvider/useLocale.js +1 -1
  35. package/lib/DatePicker/useLocale.js +17 -10
  36. package/lib/DateRangePicker/RangeDateTimePicker.js +3 -3
  37. package/lib/DateRangePicker/components/ExtraQuickFooter.js +5 -8
  38. package/lib/DateRangePicker/index.js +6 -5
  39. package/lib/DropdownDatePicker/DropdownMenu/MoreTimeList/index.js +4 -6
  40. package/lib/DropdownDatePicker/DropdownMenu/index.js +4 -7
  41. package/lib/DropdownDatePicker/index.js +12 -13
  42. package/lib/DropdownDatePicker/utils/index.js +5 -93
  43. package/lib/EchartsBar/index.js +1 -1
  44. package/lib/Empty/index.js +3 -6
  45. package/lib/ErrorBoundary/ErrorPage.js +8 -9
  46. package/lib/Exception/index.js +9 -12
  47. package/lib/FilterDropDown/index.js +3 -6
  48. package/lib/Flow/tools/index.js +4 -1
  49. package/lib/Header/Document/index.js +3 -8
  50. package/lib/Header/LocaleSwitcher.js +2 -0
  51. package/lib/Header/UserSetting/index.js +27 -45
  52. package/lib/IconSelect/components/CustomImg/index.js +8 -11
  53. package/lib/IconSelect/components/SearchIcon/index.js +9 -9
  54. package/lib/IconSelect/index.js +4 -7
  55. package/lib/ImagePreview/index.js +3 -1
  56. package/lib/Joyride/List.js +9 -8
  57. package/lib/Joyride/index.js +22 -25
  58. package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +38 -39
  59. package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +22 -23
  60. package/lib/Pagination/index.js +14 -14
  61. package/lib/PolymerizationSearch/DropdownMenu.js +4 -2
  62. package/lib/PolymerizationSearch/index.js +7 -7
  63. package/lib/Progress/index.js +3 -6
  64. package/lib/QuickTransfer/DragList.js +3 -6
  65. package/lib/QuickTransfer/index.js +19 -22
  66. package/lib/RangePicker/components/ExtraTimeFooter.js +4 -7
  67. package/lib/SearchBar/OutSearch.js +9 -2
  68. package/lib/SearchBar/index.js +13 -16
  69. package/lib/SimpleCard/index.js +3 -1
  70. package/lib/SingleSpa/index.js +30 -26
  71. package/lib/ThemeProvider/Switcher.js +3 -1
  72. package/lib/TimeRangeSlider/Refresh/index.js +4 -7
  73. package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useMouse.js +3 -3
  74. package/lib/TimeRangeSlider/TimeSpan/index.js +6 -9
  75. package/lib/TimeRangeSlider/index.js +28 -24
  76. package/lib/TimeRangeSlider/utils/index.js +20 -100
  77. package/lib/TimeZoneSelect/index.js +21 -22
  78. package/lib/TreeSelect111/index.js +3 -6
  79. package/lib/Upload-back/index.js +27 -25
  80. package/lib/VerticalLayout/index.js +3 -1
  81. package/lib/WangEditor/extraLanguage.js +19 -0
  82. package/lib/WangEditor/index.js +19 -13
  83. package/lib/WangEditor/messages.js +49 -0
  84. package/lib/WangEditor/wangEditor.js +47 -20
  85. package/lib/index.js +1 -0
  86. package/lib/locales/en_US.json +1 -0
  87. package/lib/locales/index.js +2 -0
  88. package/lib/locales/ja_JP.json +1 -0
  89. package/lib/locales/load.js +48 -0
  90. package/lib/locales/messages/antd.js +404 -0
  91. package/lib/locales/messages/editor.js +42 -0
  92. package/lib/locales/messages/timeRanges.js +36 -0
  93. package/lib/locales/messages/timeTypes.js +11 -0
  94. package/lib/locales/runtime.js +127 -0
  95. package/lib/locales/zh_CN.json +1 -0
  96. package/lib/locales/zh_HK.json +1 -0
  97. package/lib/locales/zh_TW.json +1 -0
  98. package/lib/useIntl/index.js +9 -0
  99. package/lib/useLocale/index.js +16 -13
  100. package/lib/utils/index.js +4 -1
  101. package/package.json +14 -3
  102. package/lib/BasicLayout/locale/en_US.js +0 -4
  103. package/lib/BasicLayout/locale/index.js +0 -13
  104. package/lib/BasicLayout/locale/ja_JP.js +0 -4
  105. package/lib/BasicLayout/locale/zh_CN.js +0 -4
  106. package/lib/BasicLayout/locale/zh_TW.js +0 -4
  107. package/lib/CWMessage/locale/en_US.js +0 -8
  108. package/lib/CWMessage/locale/index.js +0 -13
  109. package/lib/CWMessage/locale/ja_JP.js +0 -8
  110. package/lib/CWMessage/locale/zh_CN.js +0 -8
  111. package/lib/CWMessage/locale/zh_TW.js +0 -8
  112. package/lib/CWRangePicker/locale/en_US.js +0 -29
  113. package/lib/CWRangePicker/locale/index.js +0 -13
  114. package/lib/CWRangePicker/locale/ja_JP.js +0 -29
  115. package/lib/CWRangePicker/locale/zh_CN.js +0 -29
  116. package/lib/CWRangePicker/locale/zh_TW.js +0 -29
  117. package/lib/CWSelect/locale/en_US.js +0 -4
  118. package/lib/CWSelect/locale/index.js +0 -13
  119. package/lib/CWSelect/locale/ja_JP.js +0 -4
  120. package/lib/CWSelect/locale/zh_CN.js +0 -4
  121. package/lib/CWSelect/locale/zh_TW.js +0 -4
  122. package/lib/CWTable/locale/en_US.js +0 -6
  123. package/lib/CWTable/locale/index.js +0 -13
  124. package/lib/CWTable/locale/ja_JP.js +0 -6
  125. package/lib/CWTable/locale/zh_CN.js +0 -6
  126. package/lib/CWTable/locale/zh_TW.js +0 -6
  127. package/lib/CWTree/locale/en_US.js +0 -3
  128. package/lib/CWTree/locale/index.js +0 -13
  129. package/lib/CWTree/locale/ja_JP.js +0 -3
  130. package/lib/CWTree/locale/zh_CN.js +0 -3
  131. package/lib/CWTree/locale/zh_TW.js +0 -3
  132. package/lib/CWUpload/locale/en_US.js +0 -6
  133. package/lib/CWUpload/locale/index.js +0 -13
  134. package/lib/CWUpload/locale/ja_JP.js +0 -6
  135. package/lib/CWUpload/locale/zh_CN.js +0 -6
  136. package/lib/CWUpload/locale/zh_TW.js +0 -6
  137. package/lib/Card/index.less +0 -10
  138. package/lib/ColorPicker/locale/en_US.js +0 -4
  139. package/lib/ColorPicker/locale/index.js +0 -13
  140. package/lib/ColorPicker/locale/ja_JP.js +0 -4
  141. package/lib/ColorPicker/locale/zh_CN.js +0 -4
  142. package/lib/ColorPicker/locale/zh_TW.js +0 -4
  143. package/lib/DateRangePicker/locale/en_US.js +0 -5
  144. package/lib/DateRangePicker/locale/index.js +0 -13
  145. package/lib/DateRangePicker/locale/ja_JP.js +0 -5
  146. package/lib/DateRangePicker/locale/zh_CN.js +0 -5
  147. package/lib/DateRangePicker/locale/zh_TW.js +0 -5
  148. package/lib/DropdownDatePicker/locale/en_US.js +0 -21
  149. package/lib/DropdownDatePicker/locale/index.js +0 -13
  150. package/lib/DropdownDatePicker/locale/ja_JP.js +0 -21
  151. package/lib/DropdownDatePicker/locale/zh_CN.js +0 -21
  152. package/lib/DropdownDatePicker/locale/zh_TW.js +0 -21
  153. package/lib/Empty/locale/en_US.js +0 -3
  154. package/lib/Empty/locale/index.js +0 -13
  155. package/lib/Empty/locale/ja_JP.js +0 -3
  156. package/lib/Empty/locale/zh_CN.js +0 -3
  157. package/lib/Empty/locale/zh_TW.js +0 -3
  158. package/lib/ErrorBoundary/index.less +0 -15
  159. package/lib/ErrorBoundary/locale/en_US.js +0 -5
  160. package/lib/ErrorBoundary/locale/index.js +0 -13
  161. package/lib/ErrorBoundary/locale/ja_JP.js +0 -5
  162. package/lib/ErrorBoundary/locale/zh_CN.js +0 -5
  163. package/lib/ErrorBoundary/locale/zh_TW.js +0 -5
  164. package/lib/Exception/locale/en_US.js +0 -9
  165. package/lib/Exception/locale/index.js +0 -13
  166. package/lib/Exception/locale/ja_JP.js +0 -9
  167. package/lib/Exception/locale/zh_CN.js +0 -9
  168. package/lib/Exception/locale/zh_TW.js +0 -9
  169. package/lib/FilterDropDown/locale/en_US.js +0 -3
  170. package/lib/FilterDropDown/locale/index.js +0 -13
  171. package/lib/FilterDropDown/locale/ja_JP.js +0 -3
  172. package/lib/FilterDropDown/locale/zh_CN.js +0 -3
  173. package/lib/FilterDropDown/locale/zh_TW.js +0 -3
  174. package/lib/IconSelect/locale/en_US.js +0 -11
  175. package/lib/IconSelect/locale/index.js +0 -13
  176. package/lib/IconSelect/locale/ja_JP.js +0 -11
  177. package/lib/IconSelect/locale/zh_CN.js +0 -11
  178. package/lib/IconSelect/locale/zh_TW.js +0 -11
  179. package/lib/Joyride/locale/en_US.js +0 -25
  180. package/lib/Joyride/locale/index.js +0 -13
  181. package/lib/Joyride/locale/ja_JP.js +0 -25
  182. package/lib/Joyride/locale/zh_CN.js +0 -25
  183. package/lib/Joyride/locale/zh_TW.js +0 -25
  184. package/lib/Pagination/locale/en_US.js +0 -8
  185. package/lib/Pagination/locale/index.js +0 -13
  186. package/lib/Pagination/locale/ja_JP.js +0 -8
  187. package/lib/Pagination/locale/zh_CN.js +0 -8
  188. package/lib/Pagination/locale/zh_TW.js +0 -8
  189. package/lib/Progress/locale/en_US.js +0 -3
  190. package/lib/Progress/locale/index.js +0 -13
  191. package/lib/Progress/locale/ja_JP.js +0 -3
  192. package/lib/Progress/locale/zh_CN.js +0 -3
  193. package/lib/Progress/locale/zh_TW.js +0 -3
  194. package/lib/QuickTransfer/locale/en_US.js +0 -8
  195. package/lib/QuickTransfer/locale/index.js +0 -13
  196. package/lib/QuickTransfer/locale/ja_JP.js +0 -8
  197. package/lib/QuickTransfer/locale/zh_CN.js +0 -8
  198. package/lib/QuickTransfer/locale/zh_TW.js +0 -8
  199. package/lib/RangePicker/locale/en_US.js +0 -5
  200. package/lib/RangePicker/locale/index.js +0 -13
  201. package/lib/RangePicker/locale/ja_JP.js +0 -5
  202. package/lib/RangePicker/locale/zh_CN.js +0 -5
  203. package/lib/RangePicker/locale/zh_TW.js +0 -5
  204. package/lib/SearchBar/locale/en_US.js +0 -6
  205. package/lib/SearchBar/locale/index.js +0 -13
  206. package/lib/SearchBar/locale/ja_JP.js +0 -6
  207. package/lib/SearchBar/locale/zh_CN.js +0 -6
  208. package/lib/SearchBar/locale/zh_TW.js +0 -6
  209. package/lib/TimeRangeSlider/locale/en_US.js +0 -31
  210. package/lib/TimeRangeSlider/locale/index.js +0 -13
  211. package/lib/TimeRangeSlider/locale/ja_JP.js +0 -31
  212. package/lib/TimeRangeSlider/locale/zh_CN.js +0 -31
  213. package/lib/TimeRangeSlider/locale/zh_TW.js +0 -31
  214. package/lib/TreeSelect111/locale/en_US.js +0 -3
  215. package/lib/TreeSelect111/locale/index.js +0 -13
  216. package/lib/TreeSelect111/locale/ja_JP.js +0 -3
  217. package/lib/TreeSelect111/locale/zh_CN.js +0 -3
  218. package/lib/TreeSelect111/locale/zh_TW.js +0 -3
  219. package/lib/WangEditor/locale/index.js +0 -93
@@ -2,11 +2,9 @@ import "@chaoswise/ui/lib/Button/index.less";
2
2
  import _Button from "@chaoswise/ui/lib/Button";
3
3
  import "@chaoswise/ui/lib/Tooltip/index.less";
4
4
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
5
- import _useLocale2 from "@chaoswise/ui/lib/useLocale";
5
+ import useIntl from '../../useIntl';
6
6
  import React from "react";
7
7
  import classnames from "classnames";
8
- import langConfig from '../locale';
9
- import { formatMessage } from "../../utils";
10
8
  export default function ExtraFooter(_ref) {
11
9
  var firstFewArr = _ref.firstFewArr,
12
10
  moreArr = _ref.moreArr,
@@ -27,8 +25,7 @@ export default function ExtraFooter(_ref) {
27
25
  quickOverlayStyle = _ref.quickOverlayStyle,
28
26
  quickMoreItemClassName = _ref.quickMoreItemClassName,
29
27
  quickMoreItemStyle = _ref.quickMoreItemStyle;
30
- var _useLocale = _useLocale2(langConfig),
31
- localeObj = _useLocale.langObj;
28
+ var intl = useIntl();
32
29
  //渲染快速选择每一项
33
30
  var renderItem = function renderItem(data) {
34
31
  return /*#__PURE__*/React.createElement(React.Fragment, null, data.map(function (item) {
@@ -69,17 +66,17 @@ export default function ExtraFooter(_ref) {
69
66
  }, /*#__PURE__*/React.createElement("span", {
70
67
  className: classnames("cw-presetRange-more", quickMoreItemClassName),
71
68
  style: quickMoreItemStyle
72
- }, formatMessage(localeObj["more"]))))) : null, showOperation ? /*#__PURE__*/React.createElement("div", {
69
+ }, intl.get("a30db643-5238-42bc-bc5e-98a9d0c7df51").d("更多"))))) : null, showOperation ? /*#__PURE__*/React.createElement("div", {
73
70
  className: "cw-rangePicker-operation"
74
71
  }, /*#__PURE__*/React.createElement(_Button, {
75
72
  className: "cw-operation-cancel",
76
73
  onClick: onCancel,
77
74
  size: "small"
78
- }, formatMessage(localeObj["cancel"])), /*#__PURE__*/React.createElement(_Button, {
75
+ }, intl.get("04a57125-d7d3-4559-9e88-cf91124095a4").d("取消")), /*#__PURE__*/React.createElement(_Button, {
79
76
  type: "primary",
80
77
  className: "cw-operation-confirm",
81
78
  size: "small",
82
79
  disabled: disabledConfirm,
83
80
  onClick: disabledConfirm ? function () {} : onOk
84
- }, formatMessage(localeObj["confirm"]))) : null);
81
+ }, intl.get("4253417c-d699-4eed-8c75-34d2a8b18a68").d("确定"))) : null);
85
82
  }
@@ -1,5 +1,4 @@
1
- import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
2
- var _excluded = ["picker", "showTime", "disabledTime"];
1
+ var _excluded = ["picker", "showTime", "disabledTime", "locale"];
3
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
3
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
5
4
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
@@ -7,14 +6,16 @@ import React, { useEffect } from 'react';
7
6
  import RangeDateTimePicker from './RangeDateTimePicker.js';
8
7
  import RangeDatePicker from './RangeDatePicker.js';
9
8
  import PropTypes from 'prop-types';
9
+ import usePickerLocale from '../DatePicker/useLocale';
10
10
  function DateRangePicker(_ref) {
11
11
  var picker = _ref.picker,
12
12
  showTime = _ref.showTime,
13
13
  disabledTime = _ref.disabledTime,
14
+ customLocale = _ref.locale,
14
15
  rest = _objectWithoutProperties(_ref, _excluded);
15
- var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
16
- locale = _ConfigProvider$useLo.locale; //拿到当前的locale
17
-
16
+ // Ant Design expects a locale object, not the language-code string.
17
+ var pickerLocale = usePickerLocale();
18
+ var locale = customLocale !== undefined ? customLocale : pickerLocale;
18
19
  if (picker === "time") {}
19
20
  if (picker === "week") {}
20
21
  if (picker === "year") {}
@@ -2,18 +2,16 @@ import _Row from "@chaoswise/ui/lib/Row";
2
2
  import _Col from "@chaoswise/ui/lib/Col";
3
3
  import "@chaoswise/ui/lib/TooltipText/index.less";
4
4
  import _TooltipText from "@chaoswise/ui/lib/TooltipText";
5
- import _useLocale2 from "@chaoswise/ui/lib/useLocale";
5
+ import useIntl from '../../../useIntl';
6
+ import getTimeTypeLabel from '../../../locales/messages/timeTypes';
6
7
  import React from "react";
7
8
  import classnames from "classnames";
8
- import langConfig from '../../locale';
9
- import { formatMessage } from "../../../utils";
10
9
  import "./index.less";
11
10
  var MoreTimeList = function MoreTimeList(props) {
12
11
  var regroupDataSource = props.regroupDataSource,
13
12
  recordDateValue = props.recordDateValue,
14
13
  onClickItem = props.onClickItem;
15
- var _useLocale = _useLocale2(langConfig),
16
- localeObj = _useLocale.langObj;
14
+ var intl = useIntl();
17
15
  // 点击Menu.Item中切换常规模式
18
16
  var onClickMoreItem = function onClickMoreItem(item) {
19
17
  onClickItem(item);
@@ -27,7 +25,7 @@ var MoreTimeList = function MoreTimeList(props) {
27
25
  borderBottom: regroupDataSource.length - 1 !== index ? "1px solid rgba(0,0,0,0.06)" : ""
28
26
  },
29
27
  key: timeTypeItem.type
30
- }, /*#__PURE__*/React.createElement("h3", null, formatMessage(localeObj[timeTypeItem.type])), /*#__PURE__*/React.createElement(_Row, null, timeTypeItem.timeList.map(function (item) {
28
+ }, /*#__PURE__*/React.createElement("h3", null, getTimeTypeLabel(intl, timeTypeItem.type)), /*#__PURE__*/React.createElement(_Row, null, timeTypeItem.timeList.map(function (item) {
31
29
  return /*#__PURE__*/React.createElement(_Col, {
32
30
  key: item.key,
33
31
  span: timeTypeItem.type === "absolute" || timeTypeItem.type == "unixTimestamp" ? 12 : 8,
@@ -1,7 +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 _Dropdown from "@chaoswise/ui/lib/Dropdown";
3
3
  import _Icon from "@chaoswise/ui/lib/Icon";
4
- import _useLocale2 from "@chaoswise/ui/lib/useLocale";
5
4
  var _excluded = ["timeDomain", "number", "unit", "value", "isRecently"];
6
5
  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; }
7
6
  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; }
@@ -10,6 +9,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
10
9
  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); }
11
10
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
12
11
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
12
+ import useIntl from '../../useIntl';
13
13
  import React from "react";
14
14
  import classnames from "classnames";
15
15
  import Calendar2Svg from "../assets/Calendar2";
@@ -17,8 +17,6 @@ import LiveSvg from "../assets/live";
17
17
  import MoreSvg from "../assets/more";
18
18
  import MoreTimeList from "./MoreTimeList";
19
19
  import { funcValueChangeArrayValue, getCorrectValue } from "../utils";
20
- import langConfig from '../locale';
21
- import { formatMessage } from "../../utils";
22
20
  import "./index.less";
23
21
  var DropdownMenu = function DropdownMenu(props) {
24
22
  var dataSource = props.dataSource,
@@ -30,8 +28,7 @@ var DropdownMenu = function DropdownMenu(props) {
30
28
  onChange = props.onChange,
31
29
  menuOption = props.menuOption,
32
30
  setIsFocus = props.setIsFocus;
33
- var _useLocale = _useLocale2(langConfig),
34
- localeObj = _useLocale.langObj;
31
+ var intl = useIntl();
35
32
  var _menuOption$showCalen = menuOption.showCalendar,
36
33
  showCalendar = _menuOption$showCalen === void 0 ? true : _menuOption$showCalen,
37
34
  _menuOption$showDefau = menuOption.showDefaultCount,
@@ -105,7 +102,7 @@ var DropdownMenu = function DropdownMenu(props) {
105
102
  style: {
106
103
  marginLeft: "4px"
107
104
  }
108
- }, formatMessage(localeObj["more"]))), /*#__PURE__*/React.createElement(_Icon, {
105
+ }, intl.get("a30db643-5238-42bc-bc5e-98a9d0c7df51").d("更多"))), /*#__PURE__*/React.createElement(_Icon, {
109
106
  type: "right"
110
107
  }))), showCalendar && /*#__PURE__*/React.createElement("div", {
111
108
  className: classnames("cw-dropdown-date-picker-dropdown-menu-_item"),
@@ -119,6 +116,6 @@ var DropdownMenu = function DropdownMenu(props) {
119
116
  style: {
120
117
  marginLeft: "4px"
121
118
  }
122
- }, formatMessage(localeObj["select-calendar"]))));
119
+ }, intl.get("02fc19b1-7fc7-4859-b2e0-a65ac2039828").d("日历选择"))));
123
120
  };
124
121
  export default DropdownMenu;
@@ -8,7 +8,6 @@ import "@chaoswise/ui/lib/RangePicker/index.less";
8
8
  import _RangePicker from "@chaoswise/ui/lib/RangePicker";
9
9
  import "@chaoswise/ui/lib/Tooltip/index.less";
10
10
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
11
- import _useLocale2 from "@chaoswise/ui/lib/useLocale";
12
11
  var _excluded = ["inputPrefixIcon", "className"],
13
12
  _excluded2 = ["value"],
14
13
  _excluded3 = ["value"];
@@ -26,6 +25,8 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
26
25
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
27
26
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
28
27
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
28
+ import useIntl from '../useIntl';
29
+ import useConfigLocale from '../ConfigProvider/useLocale';
29
30
  import React, { forwardRef, useState, useEffect, useMemo, useRef } from "react";
30
31
  import PropTypes from "prop-types";
31
32
  import classnames from "classnames";
@@ -36,8 +37,6 @@ import { isEqual as lodash_isEqual } from "lodash-es";
36
37
  import { regroupDataSourceFn, echoInputValue, isEmptyObject, funcValueChangeArrayValue, getCorrectValue } from "./utils";
37
38
  import moment from "moment";
38
39
  import { v4 as uuidv4 } from 'uuid';
39
- import langConfig from './locale';
40
- import { formatMessage } from "../utils";
41
40
  import "./index.less";
42
41
  var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
43
42
  var defaultValue = props.defaultValue,
@@ -54,10 +53,10 @@ var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
54
53
  _props$format = props.format,
55
54
  format = _props$format === void 0 ? "YYYY/MM/DD HH:mm:ss" : _props$format,
56
55
  recordDateValueRender = props.recordDateValueRender;
57
- var _useLocale = _useLocale2(langConfig),
58
- localeObj = _useLocale.langObj,
59
- _useLocale$locale = _useLocale.locale,
60
- locale = _useLocale$locale === void 0 ? "zh_CN" : _useLocale$locale;
56
+ var intl = useIntl();
57
+ var _useConfigLocale = useConfigLocale(),
58
+ _useConfigLocale$loca = _useConfigLocale.locale,
59
+ locale = _useConfigLocale$loca === void 0 ? "zh_CN" : _useConfigLocale$loca;
61
60
  var _menuOption$showCalen = menuOption.showCalendar,
62
61
  showCalendar = _menuOption$showCalen === void 0 ? true : _menuOption$showCalen,
63
62
  _menuOption$isRangePi = menuOption.isRangePickerCalendar,
@@ -96,9 +95,9 @@ var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
96
95
  setDateValue = _useState8[1];
97
96
  // 是否切换到日历选择
98
97
  var _useState9 = useState(false),
99
- _useState10 = _slicedToArray(_useState9, 2),
100
- isCalendar = _useState10[0],
101
- setIsCalendar = _useState10[1];
98
+ _useState0 = _slicedToArray(_useState9, 2),
99
+ isCalendar = _useState0[0],
100
+ setIsCalendar = _useState0[1];
102
101
  // 特殊时间选择器外壳容器
103
102
  var calendarRef = useRef(null);
104
103
  // 初始时记录当前时间项
@@ -121,8 +120,8 @@ var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
121
120
  }, [defaultValue, value]);
122
121
  // 输入框回显
123
122
  useEffect(function () {
124
- setInputValue(echoInputValue(recordDateValue, locale, format, recordDateValueRender));
125
- }, [recordDateValue, locale, format, isFocus, recordDateValueRender]);
123
+ setInputValue(echoInputValue(recordDateValue, locale, format, recordDateValueRender, intl));
124
+ }, [recordDateValue, locale, format, isFocus, recordDateValueRender, intl]);
126
125
 
127
126
  // 点击空白处日历切换
128
127
  useEffect(function () {
@@ -196,7 +195,7 @@ var DropdownDatePicker = /*#__PURE__*/forwardRef(function (props, ref) {
196
195
  }, [recordDateValue, dateValue]);
197
196
  // 输入框尾缀图标
198
197
  var inputSuffix = !isEqual && /*#__PURE__*/React.createElement(_Tooltip, {
199
- title: formatMessage(localeObj["recover"])
198
+ title: intl.get("8aba20b3-9ee3-48b9-863c-224e6bdb4947").d("恢复默认值")
200
199
  }, /*#__PURE__*/React.createElement(RecoverSvg, {
201
200
  onClick: onRecover,
202
201
  className: classnames("cw-dropdown-date-picker-suffix-recover")
@@ -10,61 +10,27 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
10
10
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
+ import { getFallbackIntl } from '../../locales/runtime';
14
+ import formatRecentTime from '../../locales/messages/timeRanges';
13
15
  import moment from "moment";
14
16
  // 枚举时间单位
15
17
  var ENUM_TimeUnit = {
16
18
  s: {
17
- zh_CN: "秒",
18
- en_US: {
19
- singular: "Second",
20
- plural: "Seconds"
21
- },
22
- zh_TW: "秒",
23
19
  unit: "seconds"
24
20
  },
25
21
  m: {
26
- zh_CN: "分钟",
27
- en_US: {
28
- singular: "Minute",
29
- plural: "Minutes"
30
- },
31
- zh_TW: "分鐘",
32
22
  unit: "minutes"
33
23
  },
34
24
  h: {
35
- zh_CN: "小时",
36
- en_US: {
37
- singular: "Hour",
38
- plural: "Hours"
39
- },
40
- zh_TW: "小時",
41
25
  unit: "hours"
42
26
  },
43
27
  d: {
44
- zh_CN: "天",
45
- en_US: {
46
- singular: "Day",
47
- plural: "Days"
48
- },
49
- zh_TW: "天",
50
28
  unit: "days"
51
29
  },
52
30
  mo: {
53
- zh_CN: "月",
54
- en_US: {
55
- singular: "Month",
56
- plural: "Months"
57
- },
58
- zh_TW: "月",
59
31
  unit: "mo"
60
32
  },
61
33
  y: {
62
- zh_CN: "年",
63
- en_US: {
64
- singular: "Year",
65
- plural: "Years"
66
- },
67
- zh_TW: "年",
68
34
  unit: "years"
69
35
  }
70
36
  };
@@ -151,62 +117,7 @@ export var judgeType = function judgeType(recordDateValue) {
151
117
  }
152
118
  return [isRule, captureUnit, recordUnit];
153
119
  };
154
- export var echoRecentlyTimeTitle = function echoRecentlyTimeTitle(locale, captureUnit) {
155
- // 参数验证
156
- if (!captureUnit || !Array.isArray(captureUnit) || captureUnit.length < 2) {
157
- return '';
158
- }
159
- var _captureUnit3 = _slicedToArray(captureUnit, 2),
160
- count = _captureUnit3[0],
161
- unit = _captureUnit3[1];
162
- var timeUnit = ENUM_TimeUnit[unit];
163
- if (!timeUnit) {
164
- return '';
165
- }
166
- var countNum = parseInt(count, 10);
167
-
168
- // 语言配置映射
169
- var localeConfig = {
170
- zh_CN: {
171
- template: function template(count, unitText) {
172
- return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '个' : '').concat(unitText);
173
- },
174
- getUnitText: function getUnitText() {
175
- return timeUnit.zh_CN;
176
- }
177
- },
178
- zh: {
179
- template: function template(count, unitText) {
180
- return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '个' : '').concat(unitText);
181
- },
182
- getUnitText: function getUnitText() {
183
- return timeUnit.zh_CN;
184
- }
185
- },
186
- zh_TW: {
187
- template: function template(count, unitText) {
188
- return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '個' : '').concat(unitText);
189
- },
190
- getUnitText: function getUnitText() {
191
- return timeUnit.zh_TW;
192
- }
193
- },
194
- "default": {
195
- template: function template(count, unitText) {
196
- return "Past ".concat(count, " ").concat(unitText);
197
- },
198
- getUnitText: function getUnitText() {
199
- var isPlural = countNum !== 1;
200
- return isPlural ? timeUnit.en_US.plural : timeUnit.en_US.singular;
201
- }
202
- }
203
- };
204
-
205
- // 获取当前语言配置,如果不存在则使用默认配置
206
- var config = localeConfig[locale] || localeConfig["default"];
207
- var unitText = config.getUnitText();
208
- return config.template(count, unitText);
209
- };
120
+ export var echoRecentlyTimeTitle = formatRecentTime;
210
121
  export var echoAbsoluteTimeTitle = function echoAbsoluteTimeTitle(value, format) {
211
122
  var hasTimeSpan = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
212
123
  if (value.length === 2) {
@@ -225,6 +136,7 @@ export var echoInputValue = function echoInputValue() {
225
136
  var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "zh_CN";
226
137
  var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "YYYY/MM/DD HH:mm:ss";
227
138
  var recordDateValueRender = arguments.length > 3 ? arguments[3] : undefined;
139
+ var intl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : getFallbackIntl(locale);
228
140
  var values = recordDateValue.value,
229
141
  title = recordDateValue.title;
230
142
  var _judgeType = judgeType(recordDateValue),
@@ -241,7 +153,7 @@ export var echoInputValue = function echoInputValue() {
241
153
  }
242
154
  if (title) return title;
243
155
  if (isRule) {
244
- return echoRecentlyTimeTitle(locale, captureUnit);
156
+ return echoRecentlyTimeTitle(locale, captureUnit, intl);
245
157
  }
246
158
  if (Array.isArray(value) && (_value = value) !== null && _value !== void 0 && _value.length) {
247
159
  return echoAbsoluteTimeTitle(value, format, false);
@@ -122,7 +122,7 @@ var EchartsBar = /*#__PURE__*/forwardRef(function (_ref, ref) {
122
122
  barOption.yAxis.data.push(item);
123
123
  });
124
124
  } else {
125
- console.log("categoryAxis\u53C2\u6570\u9519\u8BEF\uFF0C\u53EF\u9009\u503C\u4E3A'xAxis'\u548C'yAxis'");
125
+ console.log("categoryAxis\u53C2\u6570\u9519\u8BEF\uFF0C\u53EF\u9009\u503C\u4E3A'xAxis'\u548C'yAxis'"); // cw-i18n-disable-line
126
126
  }
127
127
  if (data) {
128
128
  var newSeriesData = data.seriesData && data.seriesData.map(function (item) {
@@ -1,16 +1,14 @@
1
- import _useLocale2 from "@chaoswise/ui/lib/useLocale";
2
1
  import "antd/es/empty/style";
3
2
  import _Empty from "antd/es/empty";
4
3
  var _excluded = ["image", "onlyDescription", "description"];
5
4
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
6
5
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
7
6
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
7
+ import useIntl from '../useIntl';
8
8
  import React, { forwardRef } from "react";
9
9
  import PropTypes from "prop-types";
10
10
  import classnames from "classnames";
11
11
  import { cloneComProps } from "../utils";
12
- import langConfig from './locale';
13
- import { formatMessage } from "../utils";
14
12
  import "./index.less";
15
13
  var CWEmpty = /*#__PURE__*/forwardRef(function (props, ref) {
16
14
  var _props$image = props.image,
@@ -19,14 +17,13 @@ var CWEmpty = /*#__PURE__*/forwardRef(function (props, ref) {
19
17
  onlyDescription = _props$onlyDescriptio === void 0 ? false : _props$onlyDescriptio,
20
18
  description = props.description,
21
19
  rest = _objectWithoutProperties(props, _excluded);
22
- var _useLocale = _useLocale2(langConfig),
23
- localeObj = _useLocale.langObj;
20
+ var intl = useIntl();
24
21
  if (onlyDescription) {
25
22
  return /*#__PURE__*/React.createElement("div", {
26
23
  className: classnames({
27
24
  "cw-empty-only-description": true
28
25
  }, rest.className)
29
- }, /*#__PURE__*/React.createElement("div", null, description ? description : formatMessage(localeObj["nodata"])), props.children && /*#__PURE__*/React.createElement("div", {
26
+ }, /*#__PURE__*/React.createElement("div", null, description !== undefined ? description : intl.get("7a0789ec-45c0-4f18-8803-7b94724ffb55").d("暂无数据")), props.children && /*#__PURE__*/React.createElement("div", {
30
27
  style: {
31
28
  marginTop: "16px"
32
29
  }
@@ -1,13 +1,12 @@
1
- import _useLocale2 from "@chaoswise/ui/lib/useLocale";
1
+ import useIntl from '../useIntl';
2
+ import useConfigLocale from '../ConfigProvider/useLocale';
2
3
  import React from "react";
3
4
  import NoPage from "./assets/images/No-data.png";
4
- import { formatMessage } from "../utils";
5
- import langConfig from "./locale";
6
5
  var ErrorPage = function ErrorPage() {
7
- var _useLocale = _useLocale2(langConfig),
8
- localeObj = _useLocale.langObj,
9
- _useLocale$locale = _useLocale.locale,
10
- locale = _useLocale$locale === void 0 ? "zh_CN" : _useLocale$locale;
6
+ var intl = useIntl();
7
+ var _useConfigLocale = useConfigLocale(),
8
+ _useConfigLocale$loca = _useConfigLocale.locale,
9
+ locale = _useConfigLocale$loca === void 0 ? "zh_CN" : _useConfigLocale$loca;
11
10
  return /*#__PURE__*/React.createElement("div", {
12
11
  className: "errorBox",
13
12
  style: {
@@ -32,13 +31,13 @@ var ErrorPage = function ErrorPage() {
32
31
  style: {
33
32
  display: "flex"
34
33
  }
35
- }, formatMessage(localeObj["thePageIsMissing"]), /*#__PURE__*/React.createElement("a", {
34
+ }, intl.get("6b8ef8a5-43a5-43f0-a46c-91aefbbe844f").d("哎呀,页面走丢了,请"), /*#__PURE__*/React.createElement("a", {
36
35
  onClick: function onClick() {
37
36
  window.location.reload();
38
37
  },
39
38
  style: {
40
39
  margin: locale === "en_US" ? "0 3px" : 0
41
40
  }
42
- }, formatMessage(localeObj["refresh"])), formatMessage(localeObj["retry"])));
41
+ }, intl.get("1d0f3c0c-188f-4f83-bff0-2792dffcdc2d").d("刷新")), intl.get("65b99a13-64cf-48fe-a71d-fa77c800b755").d("重试")));
43
42
  };
44
43
  export default ErrorPage;
@@ -1,9 +1,7 @@
1
- import _useLocale2 from "@chaoswise/ui/lib/useLocale";
1
+ import useIntl from '../useIntl';
2
2
  import React from "react";
3
3
  import classNames from "classnames";
4
4
  import PropTypes from "prop-types";
5
- import langConfig from './locale';
6
- import { formatMessage } from "../utils";
7
5
  import ErrorImg from "./images/error.svg";
8
6
  import "./index.less";
9
7
  /**
@@ -19,28 +17,27 @@ function Exception(_ref) {
19
17
  children = _ref.children,
20
18
  errorTitle = _ref.errorTitle,
21
19
  errorText = _ref.errorText;
22
- var _useLocale = _useLocale2(langConfig),
23
- localeObj = _useLocale.langObj;
20
+ var intl = useIntl();
24
21
  var ExceptionType = {
25
22
  403: {
26
23
  title: "403",
27
- text: formatMessage(localeObj["403"])
24
+ text: intl.get("c137c110-4f42-42fb-93cb-28ca3f4d6891").d("抱歉无权访问此页面/内容")
28
25
  },
29
26
  404: {
30
27
  title: "404",
31
- text: formatMessage(localeObj["404"])
28
+ text: intl.get("54653cf2-ee7e-4091-b778-30d21facc877").d("页面走丢了,平台正在找回页面")
32
29
  },
33
30
  500: {
34
31
  title: "500",
35
- text: formatMessage(localeObj["500"])
32
+ text: intl.get("06acca4b-d39f-4df8-b707-d6a4de229c53").d("服务器无法跟上您的脚步,平台正在紧急抢修")
36
33
  },
37
34
  loadFail: {
38
- title: formatMessage(localeObj["loadFailTitle"]),
39
- text: formatMessage(localeObj["loadFail"])
35
+ title: intl.get("23e5df23-ee8a-43f8-89f4-bc2ded56dbb5").d("加载失败"),
36
+ text: intl.get("841de2d8-4504-478c-87e0-02cacdce5d54").d("出错了,平台正在紧急抢修")
40
37
  },
41
38
  incompatible: {
42
- title: formatMessage(localeObj["incompatibleTitle"]),
43
- text: formatMessage(localeObj["incompatible"])
39
+ title: intl.get("8f5cbd29-b975-44e7-8124-2dc64a6c3182").d("浏览器不兼容"),
40
+ text: intl.get("e1f25f97-3a00-4e98-b73c-069638e57184").d("浏览器版本过低,为避免可能存在的安全隐患,推荐升级一下浏览器")
44
41
  }
45
42
  };
46
43
  var currentException = ExceptionType[type] ? ExceptionType[type] : ExceptionType["500"];
@@ -3,7 +3,6 @@ import _Button from "@chaoswise/ui/lib/Button";
3
3
  import _Row from "@chaoswise/ui/lib/Row";
4
4
  import "@chaoswise/ui/lib/Tooltip/index.less";
5
5
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
6
- import _useLocale2 from "@chaoswise/ui/lib/useLocale";
7
6
  import "@chaoswise/ui/lib/Checkbox/index.less";
8
7
  import _Checkbox from "@chaoswise/ui/lib/Checkbox";
9
8
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
@@ -16,6 +15,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
16
15
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
17
16
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
18
17
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
18
+ import useIntl from '../useIntl';
19
19
  import React, { useState, Fragment, useEffect, useMemo, useRef } from "react";
20
20
  import DragList from "./DragList";
21
21
  import classnames from "classnames";
@@ -24,8 +24,6 @@ import { HTML5Backend } from "react-dnd-html5-backend";
24
24
  import { DndProvider } from "react-dnd";
25
25
  import useConfigContext from "../useConfigContext";
26
26
  import ShowSvgIcon from "./assets/ShowSvgIcon";
27
- import langConfig from "./locale";
28
- import { formatMessage } from "../utils";
29
27
  import "./index.less";
30
28
  var CheckboxGroup = _Checkbox.Group;
31
29
  function FilterDropDown(props) {
@@ -69,8 +67,7 @@ function FilterDropDown(props) {
69
67
  _useState8 = _slicedToArray(_useState7, 2),
70
68
  filterOptions = _useState8[0],
71
69
  setFilterOptions = _useState8[1];
72
- var _useLocale = _useLocale2(langConfig),
73
- localeObj = _useLocale.langObj;
70
+ var intl = useIntl();
74
71
  var _useConfigContext = useConfigContext(),
75
72
  getPrefixCls = _useConfigContext.getPrefixCls;
76
73
  var prefixCls = getPrefixCls();
@@ -203,7 +200,7 @@ function FilterDropDown(props) {
203
200
  className: "cw-dropdown-select-all",
204
201
  indeterminate: _checkedList.length !== filterOptions.length && !!_checkedList.length,
205
202
  checked: _checkedList.length === filterOptions.length
206
- }, formatMessage(localeObj["selectAll"]), "(", _checkedList.length, "/", filterOptions.length, ")"), /*#__PURE__*/React.createElement(CheckboxGroup, {
203
+ }, intl.get("3991a1d0-65a8-45ca-94a4-f89fbd9f8555").d("全选"), "(", _checkedList.length, "/", filterOptions.length, ")"), /*#__PURE__*/React.createElement(CheckboxGroup, {
207
204
  value: _checkedList,
208
205
  onChange: onChange
209
206
  }, /*#__PURE__*/React.createElement(_Row, null, setCheckOptions())));
@@ -4,7 +4,10 @@ export var fittingString = function fittingString(str, maxWidth, fontSize) {
4
4
  var ellipsisLength = G6.Util.getTextSize(ellipsis, fontSize)[0];
5
5
  var currentWidth = 0;
6
6
  var res = str;
7
- var pattern = new RegExp("[\u4E00-\u9FA5]+");
7
+ // Character classification is a regular expression, not display text.
8
+ /* cw-i18n-disable */
9
+ var pattern = new RegExp('[一-龥]+');
10
+ /* cw-i18n-enable */
8
11
  str.split('').forEach(function (letter, i) {
9
12
  if (currentWidth > maxWidth - ellipsisLength) {
10
13
  return;
@@ -1,24 +1,19 @@
1
1
  import "@chaoswise/ui/lib/Tooltip/index.less";
2
2
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
3
- import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
4
3
  import React from 'react';
5
4
  import CommonIcon from '../CommonIcon';
5
+ import useIntl from '../../useIntl';
6
6
  import icon from './icon.svg';
7
7
  function index(_ref) {
8
8
  var option = _ref.option;
9
+ var intl = useIntl();
9
10
  if (!option) {
10
11
  return null;
11
12
  }
12
- var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
13
- locale = _ConfigProvider$useLo.locale;
14
13
  var _option$onClick = option.onClick,
15
14
  onClick = _option$onClick === void 0 ? function () {} : _option$onClick;
16
- var title = {
17
- zh: '在线文档中心',
18
- en: 'Online document center'
19
- };
20
15
  return /*#__PURE__*/React.createElement(_Tooltip, {
21
- title: title[locale],
16
+ title: intl.get("f07e55ee-1a60-4e15-a14f-b9cddc4437b6").d("在线文档中心"),
22
17
  arrowPointAtCenter: true,
23
18
  placement: "bottom"
24
19
  }, /*#__PURE__*/React.createElement("div", {
@@ -20,6 +20,7 @@ function LocaleSwitcher(_ref) {
20
20
  if (data && data.length) {
21
21
  return data;
22
22
  }
23
+ /* cw-i18n-disable */
23
24
  return [{
24
25
  key: 'zh',
25
26
  title: '简体中文'
@@ -27,6 +28,7 @@ function LocaleSwitcher(_ref) {
27
28
  key: 'en',
28
29
  title: '英文'
29
30
  }];
31
+ /* cw-i18n-enable */
30
32
  }, [data]);
31
33
  var onLanguageChange = function onLanguageChange(currentKey, e) {
32
34
  onChange && onChange(currentKey, e);