@aloudata/aloudata-design 2.13.8 → 2.13.10

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,19 +1,19 @@
1
1
  import classNames from 'classnames';
2
2
  import _ from 'lodash';
3
3
  import React, { useContext } from 'react';
4
+ import Badge from "../../Badge";
4
5
  import { CloseMLine } from "../../Icon";
5
6
  import ScrollArea from "../../ScrollArea";
6
7
  import { LocaleContext, getTranslator } from "../../locale/default";
7
8
  import { getAccount, getId, getPhoto } from "../utils";
9
+ import { isUser } from "../utils/getUsersWithUserId";
8
10
  import NickLabel from "./NickLabel";
9
- import { userDisplayNameIsRepeated } from "./Panel";
10
11
  export default function SelectedMemberTags(props) {
11
12
  var className = props.className,
12
13
  selectedUsers = props.selectedUsers,
13
14
  width = props.width,
14
15
  _props$lockedIds = props.lockedIds,
15
- lockedIds = _props$lockedIds === void 0 ? [] : _props$lockedIds,
16
- userList = props.userList;
16
+ lockedIds = _props$lockedIds === void 0 ? [] : _props$lockedIds;
17
17
  var _useContext = useContext(LocaleContext),
18
18
  locale = _useContext.locale;
19
19
  var t = getTranslator(locale);
@@ -30,7 +30,6 @@ export default function SelectedMemberTags(props) {
30
30
  }
31
31
  }, selectedUsers.map(function (user) {
32
32
  var hasLocked = false;
33
- var isDisplayNameRepeat = false;
34
33
  if (user && user.hasOwnProperty('groupId')) {
35
34
  var index = _.findIndex(lockedIds, {
36
35
  groupId: user.groupId,
@@ -42,7 +41,6 @@ export default function SelectedMemberTags(props) {
42
41
  userId: user.userId,
43
42
  type: user.type
44
43
  });
45
- isDisplayNameRepeat = userDisplayNameIsRepeated(userList, user.nickname);
46
44
  hasLocked = _index !== -1;
47
45
  }
48
46
  return /*#__PURE__*/React.createElement("div", {
@@ -56,10 +54,14 @@ export default function SelectedMemberTags(props) {
56
54
  name: user.name,
57
55
  photo: getPhoto(user),
58
56
  account: getAccount(user),
59
- addonBefore: isDisplayNameRepeat && user.type === 'USER' && /*#__PURE__*/React.createElement("span", {
57
+ addonBefore: user.type === 'USER' && /*#__PURE__*/React.createElement("span", {
60
58
  className: "ald-member-picker-option-id"
61
59
  }, user.userId)
62
- })), !hasLocked && /*#__PURE__*/React.createElement(CloseMLine, {
60
+ })), isUser(user) && user.ban && /*#__PURE__*/React.createElement(Badge, {
61
+ status: "default",
62
+ count: t.MemberPicker.ban,
63
+ className: 'ald-member-picker-ban-badge'
64
+ }), !hasLocked && /*#__PURE__*/React.createElement(CloseMLine, {
63
65
  size: 20,
64
66
  className: 'ald-member-picker-close',
65
67
  color: "#98A2B3",
@@ -4,11 +4,12 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
4
4
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  import classnames from 'classnames';
6
6
  import React, { useContext } from 'react';
7
+ import Badge from "../../Badge";
7
8
  import { EUserType } from "../../ConfigProvider/getUserList";
8
9
  import TextLink from "../../TextLink/index";
9
10
  import { LocaleContext, getTranslator } from "../../locale/default";
10
11
  import { getAccount, getId, getPhoto } from "../utils";
11
- import { isUserGroup } from "../utils/getUsersWithUserId";
12
+ import { isUser, isUserGroup } from "../utils/getUsersWithUserId";
12
13
  import NickLabel from "./NickLabel";
13
14
  export default function SingleOption(params) {
14
15
  var _useContext = useContext(LocaleContext),
@@ -45,6 +46,10 @@ export default function SingleOption(params) {
45
46
  addonBefore: showUserId && user.type === EUserType.USER && /*#__PURE__*/React.createElement("span", {
46
47
  className: 'ald-member-picker-option-id'
47
48
  }, user.userId)
49
+ }), isUser(user) && user.ban && /*#__PURE__*/React.createElement(Badge, {
50
+ status: "default",
51
+ count: t.MemberPicker.ban,
52
+ className: 'ald-member-picker-ban-badge'
48
53
  }))), isUserGroup(user) && hasNextLevel && /*#__PURE__*/React.createElement(TextLink, {
49
54
  className: "ald-member-picker-btn",
50
55
  size: "small",
@@ -7,6 +7,7 @@
7
7
  @import '../../message/style/index.less';
8
8
  @import '../../Spin/style/index.less';
9
9
  @import '../../TextLink/style/index.less';
10
+ @import '../../Badge/style/index.less';
10
11
 
11
12
  @btnWidth: 30px;
12
13
 
@@ -361,3 +362,7 @@
361
362
  .ald-member-selected-member-wrapper {
362
363
  height: calc(100% - 24px);
363
364
  }
365
+
366
+ .ald-member-picker-ban-badge {
367
+ flex: 0 0 auto;
368
+ }
@@ -29,6 +29,7 @@ var Switch = function Switch(_ref) {
29
29
  _useState2 = _slicedToArray(_useState, 2),
30
30
  userChecked = _useState2[0],
31
31
  setUserChecked = _useState2[1];
32
+
32
33
  // ===================== Disabled =====================
33
34
  var disabled = React.useContext(DisabledContext);
34
35
  var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;