@aloudata/aloudata-design 2.9.0 → 2.10.0

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.
@@ -4,6 +4,7 @@ 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 from 'react';
7
+ import { EUserType } from "../../ConfigProvider/getUserList";
7
8
  import TextLink from "../../TextLink/index";
8
9
  import { getAccount, getId, getPhoto } from "../utils";
9
10
  import { isUserGroup } from "../utils/getUsersWithUserId";
@@ -16,7 +17,8 @@ export default function SingleOption(params) {
16
17
  className = params.className,
17
18
  onNextLevel = params.onNextLevel,
18
19
  _params$hasNextLevel = params.hasNextLevel,
19
- hasNextLevel = _params$hasNextLevel === void 0 ? true : _params$hasNextLevel;
20
+ hasNextLevel = _params$hasNextLevel === void 0 ? true : _params$hasNextLevel,
21
+ showUserId = params.showUserId;
20
22
  var onClick = function onClick() {
21
23
  if (disabled) return;
22
24
  onChange === null || onChange === void 0 ? void 0 : onChange(!selected, user);
@@ -26,13 +28,17 @@ export default function SingleOption(params) {
26
28
  onClick: onClick
27
29
  }, /*#__PURE__*/React.createElement("div", {
28
30
  className: 'ald-member-picker-label'
31
+ }, /*#__PURE__*/React.createElement("div", {
32
+ className: 'ald-member-picker-option-content'
29
33
  }, /*#__PURE__*/React.createElement(NickLabel, {
30
34
  type: user.type,
31
35
  id: getId(user),
32
36
  name: user.name,
33
37
  photo: getPhoto(user),
34
38
  account: getAccount(user)
35
- })), isUserGroup(user) && hasNextLevel && /*#__PURE__*/React.createElement(TextLink, {
39
+ }), showUserId && user.type === EUserType.USER && /*#__PURE__*/React.createElement("div", {
40
+ className: 'ald-member-picker-option-id'
41
+ }, user.userId))), isUserGroup(user) && hasNextLevel && /*#__PURE__*/React.createElement(TextLink, {
36
42
  className: "ald-member-picker-btn",
37
43
  size: "small",
38
44
  disabled: disabled,
@@ -3,7 +3,7 @@ import { ISelectProps } from '../Select';
3
3
  import { RequiredProperties } from '../_utils/type';
4
4
  export type TUserValue = RequiredProperties<IUser, 'type' | 'userId'>;
5
5
  export type TUserGroupValue = RequiredProperties<IUserGroup, 'type' | 'groupId'>;
6
- export type TMemberPickerValue = TUserValue | TUserGroupValue | Array<TUserValue | TUserGroupValue>;
6
+ export type TMemberPickerValue = TUserGroupValue | Array<TUserValue | TUserGroupValue>;
7
7
  export declare enum EMemberPicker {
8
8
  GROUP = "GROUP",
9
9
  USER = "USER",
@@ -101,6 +101,7 @@
101
101
  gap: 8px;
102
102
 
103
103
  .ald-member-picker-selected-member-tag {
104
+ max-width: 100%;
104
105
  display: flex;
105
106
  justify-content: center;
106
107
  align-items: center;
@@ -115,6 +116,7 @@
115
116
  line-height: 20px; /* 142.857% */
116
117
 
117
118
  .ald-member-picker-close {
119
+ flex: 0 0 20px;
118
120
  border-left: 1px solid
119
121
  var(--alias-colors-border-accent-gray-subtler-default, #e5e7eb);
120
122
  cursor: pointer;
@@ -148,9 +150,22 @@
148
150
  justify-content: space-between;
149
151
 
150
152
  .ald-member-picker-label {
153
+ width: 100%;
151
154
  flex: 1;
152
155
  display: flex;
153
156
  gap: 4px;
157
+
158
+ .ald-member-picker-option-content {
159
+ min-width: 0;
160
+ flex: 1;
161
+ display: flex;
162
+ align-items: center;
163
+ gap: 6px;
164
+
165
+ .ald-member-picker-nick-label {
166
+ flex-grow: 1;
167
+ }
168
+ }
154
169
  }
155
170
 
156
171
  &:hover {
@@ -170,6 +185,7 @@
170
185
  }
171
186
 
172
187
  .ald-member-picker-checkbox {
188
+ flex: 0 0 20px;
173
189
  display: flex;
174
190
  align-items: center;
175
191
  justify-content: center;
@@ -188,6 +204,16 @@
188
204
  }
189
205
  }
190
206
 
207
+ .ald-member-picker-option-id {
208
+ max-width: 50%;
209
+ white-space: nowrap; /* 防止内容换行,保持内容长度 */
210
+ text-overflow: ellipsis;
211
+ overflow: hidden;
212
+ color: var(--alias-colors-text-subtle, #4b5563);
213
+ font-size: 12px;
214
+ line-height: 16px; /* 133.333% */
215
+ }
216
+
191
217
  .ald-member-picker-trigger {
192
218
  display: flex;
193
219
  align-items: center;
@@ -237,6 +263,8 @@
237
263
  padding: 2px 6px;
238
264
  display: flex;
239
265
  align-items: center;
266
+ gap: 6px;
267
+ min-width: 0;
240
268
  }
241
269
 
242
270
  .ald-member-picker-nick-label {
@@ -18,7 +18,8 @@
18
18
  background: var(--alias-colors-bg-skeleton-subtler, #fff);
19
19
  box-shadow: 0 10px 18px -2px #00000014;
20
20
  min-width: @menu-width;
21
- z-index: 999;
21
+ font-size: 14px;
22
+ z-index: 1001;
22
23
  }
23
24
 
24
25
  .ald-menu {