@aloudata/aloudata-design 2.17.0 → 2.17.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.
|
@@ -26,6 +26,9 @@ var Avatar = function Avatar(props) {
|
|
|
26
26
|
return AVATAR_SIZE_MAP[size] || 32;
|
|
27
27
|
}, [size]);
|
|
28
28
|
var getChildren = useCallback(function () {
|
|
29
|
+
if (_.isEmpty(children)) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
29
32
|
if (typeof children === 'string') {
|
|
30
33
|
return children[ZERO].toLocaleUpperCase();
|
|
31
34
|
}
|
|
@@ -47,7 +50,7 @@ var Avatar = function Avatar(props) {
|
|
|
47
50
|
if (icon) {
|
|
48
51
|
return icon;
|
|
49
52
|
}
|
|
50
|
-
if (!_.
|
|
53
|
+
if (!_.isEmpty(children)) {
|
|
51
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
52
55
|
style: {
|
|
53
56
|
backgroundColor: bgColor,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import Avatar from "../../Avatar";
|
|
3
3
|
import { EUserType } from "../../ConfigProvider/getUserList";
|
|
4
|
-
import { UserGroup } from "../../Icon";
|
|
5
4
|
var NickLabel = function NickLabel(_ref) {
|
|
6
5
|
var photo = _ref.photo,
|
|
7
6
|
name = _ref.name,
|
|
@@ -10,15 +9,13 @@ var NickLabel = function NickLabel(_ref) {
|
|
|
10
9
|
type = _ref.type,
|
|
11
10
|
addonBefore = _ref.addonBefore;
|
|
12
11
|
var innerName = name || id;
|
|
13
|
-
var photoSrc = !photo && type === EUserType.USER_GROUP ? /*#__PURE__*/React.createElement(UserGroup, {
|
|
14
|
-
size: 20
|
|
15
|
-
}) : photo;
|
|
16
12
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
13
|
className: "ald-member-picker-nick-label"
|
|
18
14
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
19
15
|
key: innerName,
|
|
20
|
-
src:
|
|
21
|
-
size: 20
|
|
16
|
+
src: photo,
|
|
17
|
+
size: 20,
|
|
18
|
+
type: type === EUserType.USER ? 'user' : 'userGroup'
|
|
22
19
|
}, innerName), /*#__PURE__*/React.createElement("div", {
|
|
23
20
|
className: "ald-member-picker-nick-label-name",
|
|
24
21
|
title: account ? "".concat(name, "(").concat(account, ")") : "".concat(name)
|
|
@@ -27,7 +27,6 @@ import React, { useCallback, useContext, useEffect, useMemo, useRef, useState }
|
|
|
27
27
|
import Avatar from "../Avatar";
|
|
28
28
|
import ConfigProvider from "../ConfigProvider";
|
|
29
29
|
import { EUserType } from "../ConfigProvider/getUserList";
|
|
30
|
-
import { UserGroup } from "../Icon";
|
|
31
30
|
import { LocaleContext, getTranslator } from "../locale/default";
|
|
32
31
|
import message from "../message";
|
|
33
32
|
import Panel from "./components/Panel";
|
|
@@ -329,9 +328,10 @@ var Component = function Component(props) {
|
|
|
329
328
|
value: item.groupId,
|
|
330
329
|
tag: /*#__PURE__*/React.createElement("div", {
|
|
331
330
|
className: 'ald-member-picker-tag'
|
|
332
|
-
}, /*#__PURE__*/React.createElement(
|
|
331
|
+
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
332
|
+
type: "userGroup",
|
|
333
333
|
size: 20
|
|
334
|
-
}), item.name || item.groupId)
|
|
334
|
+
}, item.name || item.groupId), item.name || item.groupId)
|
|
335
335
|
};
|
|
336
336
|
return {
|
|
337
337
|
label: item.nickname || item.name || item.userId,
|
|
@@ -340,8 +340,9 @@ var Component = function Component(props) {
|
|
|
340
340
|
className: 'ald-member-picker-tag'
|
|
341
341
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
342
342
|
size: 20,
|
|
343
|
-
src: item.photo
|
|
344
|
-
|
|
343
|
+
src: item.photo,
|
|
344
|
+
type: item.type === EUserType.USER ? 'user' : 'userGroup'
|
|
345
|
+
}, item.nickname || item.name || item.userId))
|
|
345
346
|
};
|
|
346
347
|
}),
|
|
347
348
|
optionLabelProp: multiple ? 'label' : 'tag',
|