@chlp-tech/rpa-ui 0.0.16 → 0.0.17-beta-1

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.
@@ -24,11 +24,14 @@ import MediaAccountPreview from "../MediaAccountPreview";
24
24
  import { SearchOutlined } from "@ant-design/icons";
25
25
  import classNames from "classnames";
26
26
  import styles from "./index.module.less";
27
+ import { useTranslation } from 'react-i18next';
27
28
  var AccountSelect = function AccountSelect(props) {
28
29
  var _props$placeholder = props.placeholder,
29
30
  placeholder = _props$placeholder === void 0 ? '请选择账号' : _props$placeholder,
30
31
  _props$multiple = props.multiple,
31
32
  multiple = _props$multiple === void 0 ? false : _props$multiple;
33
+ var _useTranslation = useTranslation(),
34
+ t = _useTranslation.t;
32
35
  var _React$useState = React.useState(false),
33
36
  _React$useState2 = _slicedToArray(_React$useState, 2),
34
37
  open = _React$useState2[0],
@@ -189,7 +192,7 @@ var AccountSelect = function AccountSelect(props) {
189
192
  color: '#9EA7B5'
190
193
  }
191
194
  }),
192
- placeholder: "\u641C\u7D22\u6210\u5458\u6216\u8D26\u53F7\u540D",
195
+ placeholder: props.searchPlaceholder,
193
196
  onChange: onSearchChange
194
197
  }), /*#__PURE__*/React.createElement("div", {
195
198
  className: styles.scrollBox
@@ -199,7 +202,9 @@ var AccountSelect = function AccountSelect(props) {
199
202
  var getTipsText = function getTipsText() {
200
203
  switch (item.disabledState) {
201
204
  case 1:
202
- return '请勿选择语言不统一的账号';
205
+ return t('请勿选择语言不统一的账号', {
206
+ ns: 'common'
207
+ });
203
208
  case 2:
204
209
  return '账号Token失效,请重新授权该账号,恢复账号绑定状态';
205
210
  case 3:
@@ -39,6 +39,7 @@ export interface IAccountSelectProps {
39
39
  * @param values
40
40
  */
41
41
  renderSelectStatus?: (values: (string | number)[]) => ReactElement;
42
+ searchPlaceholder?: string;
42
43
  }
43
44
  export interface IAccountOptionModel {
44
45
  /**
@@ -4,6 +4,11 @@ interface LinkedFilterProps {
4
4
  multipleIcon: React.ReactNode;
5
5
  config: ConfigItem[];
6
6
  isShow?: string[];
7
+ moreFilterText?: string;
8
+ moreModalConfig?: {
9
+ cancelNode?: string | React.ReactNode;
10
+ confirmNode?: string | React.ReactNode;
11
+ };
7
12
  }
8
13
  interface ConfigItem {
9
14
  key: string;
@@ -13,13 +13,13 @@ import { Form, Input, Select, Button, Modal, Badge, DatePicker, Space } from "an
13
13
  import styles from "./index.module.less";
14
14
  var Option = Select.Option;
15
15
  var RangePicker = DatePicker.RangePicker;
16
- var LinkedFilter = function LinkedFilter(_ref) {
17
- var _config$find;
18
- var _onChange = _ref.onChange,
19
- config = _ref.config,
20
- multipleIcon = _ref.multipleIcon,
21
- _ref$isShow = _ref.isShow,
22
- isShow = _ref$isShow === void 0 ? [] : _ref$isShow;
16
+ var LinkedFilter = function LinkedFilter(props) {
17
+ var _config$find, _props$moreModalConfi, _props$moreModalConfi2;
18
+ var _onChange = props.onChange,
19
+ config = props.config,
20
+ multipleIcon = props.multipleIcon,
21
+ _props$isShow = props.isShow,
22
+ isShow = _props$isShow === void 0 ? [] : _props$isShow;
23
23
  var initialSelectValue = ((_config$find = config.find(function (item) {
24
24
  return !isShow.includes(item.key);
25
25
  })) === null || _config$find === void 0 ? void 0 : _config$find.key) || null;
@@ -43,7 +43,7 @@ var LinkedFilter = function LinkedFilter(_ref) {
43
43
  multilineForm = _Form$useForm4[0];
44
44
  useEffect(function () {
45
45
  config.forEach( /*#__PURE__*/function () {
46
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(item) {
46
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(item) {
47
47
  var _response;
48
48
  return _regeneratorRuntime().wrap(function _callee$(_context) {
49
49
  while (1) switch (_context.prev = _context.next) {
@@ -64,12 +64,12 @@ var LinkedFilter = function LinkedFilter(_ref) {
64
64
  }, _callee);
65
65
  }));
66
66
  return function (_x) {
67
- return _ref2.apply(this, arguments);
67
+ return _ref.apply(this, arguments);
68
68
  };
69
69
  }());
70
70
  }, [config]);
71
71
  var handleSingleSelectChange = /*#__PURE__*/function () {
72
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
72
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
73
73
  var values;
74
74
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
75
75
  while (1) switch (_context2.prev = _context2.next) {
@@ -88,11 +88,11 @@ var LinkedFilter = function LinkedFilter(_ref) {
88
88
  }, _callee2);
89
89
  }));
90
90
  return function handleSingleSelectChange() {
91
- return _ref3.apply(this, arguments);
91
+ return _ref2.apply(this, arguments);
92
92
  };
93
93
  }();
94
94
  var handleModalOk = /*#__PURE__*/function () {
95
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
95
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
96
96
  var values;
97
97
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
98
98
  while (1) switch (_context3.prev = _context3.next) {
@@ -112,7 +112,7 @@ var LinkedFilter = function LinkedFilter(_ref) {
112
112
  }, _callee3);
113
113
  }));
114
114
  return function handleModalOk() {
115
- return _ref4.apply(this, arguments);
115
+ return _ref3.apply(this, arguments);
116
116
  };
117
117
  }();
118
118
  var handleModalCancel = function handleModalCancel() {
@@ -223,13 +223,13 @@ var LinkedFilter = function LinkedFilter(_ref) {
223
223
  }, /*#__PURE__*/React.createElement(Button, {
224
224
  onClick: showMultiSelectModal,
225
225
  icon: multipleIcon
226
- }, "\u66F4\u591A\u7B5B\u9009"))), /*#__PURE__*/React.createElement(Modal, {
227
- title: "\u66F4\u591A\u7B5B\u9009",
226
+ }, props.moreFilterText || '更多筛选'))), /*#__PURE__*/React.createElement(Modal, {
227
+ title: props.moreFilterText || '更多筛选',
228
228
  open: isModalVisible,
229
229
  onOk: handleModalOk,
230
230
  onCancel: handleModalCancel,
231
- cancelText: '取消',
232
- okText: '确定'
231
+ cancelText: ((_props$moreModalConfi = props.moreModalConfig) === null || _props$moreModalConfi === void 0 ? void 0 : _props$moreModalConfi.cancelNode) || '取消',
232
+ okText: ((_props$moreModalConfi2 = props.moreModalConfig) === null || _props$moreModalConfi2 === void 0 ? void 0 : _props$moreModalConfi2.confirmNode) || '确定'
233
233
  }, /*#__PURE__*/React.createElement(Form, {
234
234
  form: multilineForm,
235
235
  labelCol: {
@@ -72,10 +72,13 @@ var VideoPlay = function VideoPlay(_ref) {
72
72
  var handleOverlayClick = function handleOverlayClick() {
73
73
  setIsPreviewVisible(true);
74
74
  };
75
- var handlePlayClick = function handlePlayClick() {
75
+ var handlePlayClick = function handlePlayClick(e) {
76
+ var _e$preventDefault, _e$stopPropagation;
76
77
  if (onPlayClick) {
77
78
  return onPlayClick();
78
79
  }
80
+ e === null || e === void 0 || (_e$preventDefault = e.preventDefault) === null || _e$preventDefault === void 0 || _e$preventDefault.call(e);
81
+ e === null || e === void 0 || (_e$stopPropagation = e.stopPropagation) === null || _e$stopPropagation === void 0 || _e$stopPropagation.call(e);
79
82
  setIsPlaying(true);
80
83
  };
81
84
  var handleClose = function handleClose() {
@@ -7,59 +7,77 @@ import Fail from "./imgs/fail.svg";
7
7
  import Publish from "./imgs/publish.svg";
8
8
  import Pause from "./imgs/pause.svg";
9
9
  import Delete from "./imgs/delete.svg";
10
+ import i18next from "i18next";
10
11
  var statusTag = {
11
12
  0: {
12
13
  bgColor: '#ECEFF4',
13
14
  textColor: '#3F5270',
14
- text: '草稿',
15
+ text: i18next.t('草稿', {
16
+ ns: 'publish'
17
+ }),
15
18
  icon: Process
16
19
  },
17
20
  1: {
18
21
  bgColor: '#FFF5E9',
19
22
  textColor: '#FF8800',
20
- text: '待发布',
23
+ text: "待发布",
24
+ // text: i18next.t('待发布', { ns: 'publish' }),
21
25
  icon: Wait
22
26
  },
23
27
  2: {
24
28
  bgColor: '#E0FFDD',
25
29
  textColor: '#3BC92B',
26
- text: '发布成功',
30
+ text: i18next.t('发布成功', {
31
+ ns: 'publish'
32
+ }),
27
33
  icon: Success
28
34
  },
29
35
  3: {
30
36
  bgColor: '#FEECEC',
31
37
  textColor: '#FA4441',
32
- text: '发布异常',
38
+ text: i18next.t('发布异常', {
39
+ ns: 'publish'
40
+ }),
33
41
  icon: Fail
34
42
  },
35
43
  4: {
36
44
  bgColor: '#E9F1FF',
37
45
  textColor: '#004FD3',
38
- text: '发布中',
46
+ text: i18next.t('发布中', {
47
+ ns: 'publish'
48
+ }),
39
49
  icon: Publish
40
50
  },
41
51
  5: {
42
52
  bgColor: '#E9F1FF',
43
53
  textColor: '#004FD3',
44
- text: '排队中',
54
+ text: i18next.t('排队中', {
55
+ ns: 'publish'
56
+ }),
45
57
  icon: Publish
46
58
  },
47
59
  6: {
48
60
  bgColor: '#ECEFF4',
49
61
  textColor: '#3F5270',
50
- text: '已暂停',
62
+ text: i18next.t('已暂停', {
63
+ ns: 'publish'
64
+ }),
51
65
  icon: Pause
52
66
  },
53
67
  7: {
54
68
  bgColor: '#E9F1FF',
55
69
  textColor: '#004FD3',
56
- text: '审核中',
70
+ text: i18next.t('审核中', {
71
+ ns: 'publish'
72
+ }),
57
73
  icon: Publish
58
74
  },
59
75
  8: {
60
76
  bgColor: '#ECEFF4',
61
77
  textColor: '#3F5270',
62
- text: '已删除',
78
+ text: i18next.t('已删除', {
79
+ ns: 'publish'
80
+ }),
63
81
  icon: Delete
64
82
  }
65
83
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chlp-tech/rpa-ui",
3
- "version": "0.0.16",
3
+ "version": "0.0.17-beta-1",
4
4
  "description": "rpa-ui",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -38,7 +38,9 @@
38
38
  "@ant-design/icons": ">=4.18.0",
39
39
  "antd": ">=5.25.0",
40
40
  "react": ">=16.9.0",
41
- "react-dom": ">=16.9.0"
41
+ "react-dom": ">=16.9.0",
42
+ "i18next": "^23.7.8",
43
+ "react-i18next": "^13.5.0"
42
44
  },
43
45
  "devDependencies": {
44
46
  "@ant-design/icons": "^5.5.2",
@@ -58,7 +60,9 @@
58
60
  "react": "^18.0.0",
59
61
  "react-dom": "^18.0.0",
60
62
  "stylelint": "^14.9.1",
61
- "terser": "^5.33.0"
63
+ "terser": "^5.33.0",
64
+ "i18next": "^23.7.8",
65
+ "react-i18next": "^13.5.0"
62
66
  },
63
67
  "dependencies": {
64
68
  "@webav/av-cliper": "^1.0.11",