@chlp-tech/rpa-ui 0.0.11-beta.2 → 0.0.11-beta.3

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.
@@ -47,7 +47,7 @@ var AccountSelect = function AccountSelect(props) {
47
47
  (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, []);
48
48
  };
49
49
  var renderSelectInfo = function renderSelectInfo() {
50
- var _props$options;
50
+ var _props$options, _info$language, _info$language2, _info$language3;
51
51
  if (selectedKeys.length <= 0) {
52
52
  return null;
53
53
  }
@@ -66,10 +66,11 @@ var AccountSelect = function AccountSelect(props) {
66
66
  showTooltip: false
67
67
  }, info === null || info === void 0 ? void 0 : info.accountName)), /*#__PURE__*/React.createElement("div", {
68
68
  className: styles.languageText
69
- }, /*#__PURE__*/React.createElement(TextEllipsis, {
70
- lines: 1,
71
- showTooltip: false
72
- }, (info === null || info === void 0 ? void 0 : info.remark) || '--')));
69
+ }, /*#__PURE__*/React.createElement(Tooltip, {
70
+ title: info !== null && info !== void 0 && info.language && (info === null || info === void 0 || (_info$language = info.language) === null || _info$language === void 0 ? void 0 : _info$language.length) > 4 ? info.language : ''
71
+ }, /*#__PURE__*/React.createElement("div", {
72
+ className: styles.userBox
73
+ }, info !== null && info !== void 0 && info.language && (info === null || info === void 0 || (_info$language2 = info.language) === null || _info$language2 === void 0 ? void 0 : _info$language2.length) > 4 ? "".concat(info === null || info === void 0 || (_info$language3 = info.language) === null || _info$language3 === void 0 ? void 0 : _info$language3.slice(0, 4), "...") : (info === null || info === void 0 ? void 0 : info.language) || '--'))));
73
74
  };
74
75
  var renderAccountView = function renderAccountView() {
75
76
  return /*#__PURE__*/React.createElement("div", {
@@ -86,7 +87,9 @@ var AccountSelect = function AccountSelect(props) {
86
87
  }, placeholder), selectedKeys.length > 0 && (props.renderSelectStatus ? props.renderSelectStatus(selectedKeys) : renderSelectInfo())), /*#__PURE__*/React.createElement("img", {
87
88
  src: (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.length) > 0 ? UpIcon : DownIcon,
88
89
  alt: "",
89
- onClick: function onClick() {
90
+ onClick: function onClick(e) {
91
+ e.stopPropagation();
92
+ e.preventDefault();
90
93
  if ((selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys.length) > 0) {
91
94
  handleClearAll === null || handleClearAll === void 0 || handleClearAll();
92
95
  }
@@ -208,7 +211,7 @@ var AccountSelectList = function AccountSelectList(props) {
208
211
  gutter: [32, 32]
209
212
  }, (_props$accounts = props.accounts) === null || _props$accounts === void 0 ? void 0 : _props$accounts.map(function (account, index) {
210
213
  return /*#__PURE__*/React.createElement(Col, {
211
- span: 8,
214
+ span: props.colSpan || 8,
212
215
  key: index
213
216
  }, /*#__PURE__*/React.createElement(AccountSelect, _extends({}, account, {
214
217
  onChange: function onChange(values) {
@@ -32,10 +32,14 @@
32
32
  }
33
33
 
34
34
  .languageText {
35
+ width: max-content;
36
+ background: #E9F1FF;
37
+ border-radius: 4px;
38
+ border: 1px solid #004FD3;
39
+ padding: 4px 8px;
40
+
35
41
  font-size: 12px;
36
- color: #9EA7B5;
37
- flex: 1;
38
- max-width: 33%;
42
+ color: #004FD3;
39
43
  }
40
44
  }
41
45
  }
@@ -37,7 +37,7 @@ export interface IAccountSelectProps {
37
37
  * 自定义渲染选择之后的视图
38
38
  * @param values
39
39
  */
40
- renderSelectStatus: (values: (string | number)[]) => ReactElement;
40
+ renderSelectStatus?: (values: (string | number)[]) => ReactElement;
41
41
  }
42
42
  export interface IAccountOptionModel {
43
43
  /**
@@ -69,10 +69,12 @@ export interface IAccountOptionModel {
69
69
  */
70
70
  disabled?: boolean;
71
71
  }
72
+ export interface IAccountGroupAccounts extends IAccountSelectProps {
73
+ key: string;
74
+ }
72
75
  export interface IAccountListProps {
73
- accounts: (IAccountSelectProps & {
74
- key: string;
75
- })[];
76
+ accounts: IAccountGroupAccounts[];
77
+ colSpan?: number;
76
78
  onChange?: (selected: {
77
79
  [key: string]: string[];
78
80
  }) => void;
package/package.json CHANGED
@@ -1,9 +1,23 @@
1
1
  {
2
2
  "name": "@chlp-tech/rpa-ui",
3
- "version": "0.0.11-beta.2",
3
+ "version": "0.0.11-beta.3",
4
4
  "description": "rpa-ui",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "start": "npm run dev",
9
+ "dev": "dumi dev",
10
+ "build": "father build",
11
+ "build:watch": "father dev",
12
+ "docs:build": "dumi build",
13
+ "docs:preview": "dumi preview",
14
+ "prepare": "husky install && dumi setup",
15
+ "doctor": "father doctor",
16
+ "lint": "npm run lint:es && npm run lint:css",
17
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
18
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
19
+ "prepublishOnly": "father doctor && npm run build"
20
+ },
7
21
  "authors": [],
8
22
  "license": "MIT",
9
23
  "files": [
@@ -66,17 +80,5 @@
66
80
  "dayjs": "^1.11.13",
67
81
  "js-md5": "^0.8.3",
68
82
  "styled-components": "^6.1.12"
69
- },
70
- "scripts": {
71
- "start": "npm run dev",
72
- "dev": "dumi dev",
73
- "build": "father build",
74
- "build:watch": "father dev",
75
- "docs:build": "dumi build",
76
- "docs:preview": "dumi preview",
77
- "doctor": "father doctor",
78
- "lint": "npm run lint:es && npm run lint:css",
79
- "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
80
- "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\""
81
83
  }
82
- }
84
+ }