@chlp-tech/rpa-ui 0.0.11-beta.1 → 0.0.11-beta.2
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.
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IAccountListProps, IAccountSelectProps } from "./type";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Group: React.FC<IAccountListProps>;
|
|
6
|
-
}
|
|
3
|
+
interface AccountSelectComponent extends React.FC<IAccountSelectProps> {
|
|
4
|
+
Group: React.FC<IAccountListProps>;
|
|
7
5
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
6
|
+
declare const _default: AccountSelectComponent;
|
|
7
|
+
export default _default;
|
|
@@ -15,7 +15,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
15
15
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
16
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; } }
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
import React
|
|
18
|
+
import React from "react";
|
|
19
19
|
import DownIcon from "./imgs/down.svg";
|
|
20
20
|
import UpIcon from "./imgs/up.svg";
|
|
21
21
|
import { Col, Empty, Input, Popover, Row, Tooltip } from "antd";
|
|
@@ -23,9 +23,6 @@ import { TextEllipsis } from "../index";
|
|
|
23
23
|
import { SearchOutlined } from "@ant-design/icons";
|
|
24
24
|
import classNames from "classnames";
|
|
25
25
|
import styles from "./index.module.less";
|
|
26
|
-
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
28
|
-
|
|
29
26
|
var AccountSelect = function AccountSelect(props) {
|
|
30
27
|
var _props$placeholder = props.placeholder,
|
|
31
28
|
placeholder = _props$placeholder === void 0 ? '请选择账号' : _props$placeholder,
|
|
@@ -202,24 +199,14 @@ var AccountSelect = function AccountSelect(props) {
|
|
|
202
199
|
}, renderAccountView());
|
|
203
200
|
};
|
|
204
201
|
var AccountSelectList = function AccountSelectList(props) {
|
|
205
|
-
var
|
|
202
|
+
var _props$accounts;
|
|
203
|
+
var _React$useState7 = React.useState({}),
|
|
206
204
|
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
var _React$useState9 = React.useState({}),
|
|
210
|
-
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
211
|
-
selectValues = _React$useState10[0],
|
|
212
|
-
setSelectValues = _React$useState10[1];
|
|
213
|
-
useEffect(function () {
|
|
214
|
-
setAccounts(props.accounts.map(function (item, index) {
|
|
215
|
-
return _objectSpread({
|
|
216
|
-
key: index
|
|
217
|
-
}, item);
|
|
218
|
-
}));
|
|
219
|
-
}, [props.accounts]);
|
|
205
|
+
selectValues = _React$useState8[0],
|
|
206
|
+
setSelectValues = _React$useState8[1];
|
|
220
207
|
return /*#__PURE__*/React.createElement(Row, {
|
|
221
208
|
gutter: [32, 32]
|
|
222
|
-
}, accounts === null || accounts === void 0 ? void 0 : accounts.map(function (account, index) {
|
|
209
|
+
}, (_props$accounts = props.accounts) === null || _props$accounts === void 0 ? void 0 : _props$accounts.map(function (account, index) {
|
|
223
210
|
return /*#__PURE__*/React.createElement(Col, {
|
|
224
211
|
span: 8,
|
|
225
212
|
key: index
|
|
@@ -234,5 +221,11 @@ var AccountSelectList = function AccountSelectList(props) {
|
|
|
234
221
|
})));
|
|
235
222
|
}));
|
|
236
223
|
};
|
|
224
|
+
|
|
225
|
+
// 类型扩展 - 声明 AccountSelect 包含 Group 属性
|
|
226
|
+
|
|
227
|
+
// 将 AccountSelectList 附加为 AccountSelect 的静态属性
|
|
237
228
|
AccountSelect.Group = AccountSelectList;
|
|
229
|
+
|
|
230
|
+
// 导出带有 Group 属性的 AccountSelect
|
|
238
231
|
export default AccountSelect;
|
|
@@ -70,7 +70,9 @@ export interface IAccountOptionModel {
|
|
|
70
70
|
disabled?: boolean;
|
|
71
71
|
}
|
|
72
72
|
export interface IAccountListProps {
|
|
73
|
-
accounts: IAccountSelectProps
|
|
73
|
+
accounts: (IAccountSelectProps & {
|
|
74
|
+
key: string;
|
|
75
|
+
})[];
|
|
74
76
|
onChange?: (selected: {
|
|
75
77
|
[key: string]: string[];
|
|
76
78
|
}) => void;
|