@aloudata/aloudata-design 2.8.7 → 2.9.1
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.
- package/dist/App/index.js +7 -1
- package/dist/Badge/index.js +8 -3
- package/dist/Icon/components/DangerFill.d.ts +11 -0
- package/dist/Icon/components/DangerFill.js +35 -0
- package/dist/Icon/index.d.ts +1 -0
- package/dist/Icon/index.js +1 -0
- package/dist/Icon/svg/danger-fill.svg +5 -0
- package/dist/MemberPicker/components/MemberSelection.js +3 -0
- package/dist/MemberPicker/components/MultipleOption.d.ts +1 -0
- package/dist/MemberPicker/components/MultipleOption.js +10 -3
- package/dist/MemberPicker/components/Panel.d.ts +1 -0
- package/dist/MemberPicker/components/Panel.js +8 -1
- package/dist/MemberPicker/components/PanelWrapper.d.ts +1 -0
- package/dist/MemberPicker/components/PanelWrapper.js +1 -0
- package/dist/MemberPicker/components/SelectedMemberTags.d.ts +1 -0
- package/dist/MemberPicker/components/SelectedMemberTags.js +8 -2
- package/dist/MemberPicker/components/SingleOption.d.ts +1 -0
- package/dist/MemberPicker/components/SingleOption.js +8 -2
- package/dist/MemberPicker/interface.d.ts +1 -1
- package/dist/MemberPicker/style/index.less +28 -0
- package/dist/ald.min.css +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/message/index.d.ts +9 -11
- package/dist/message/index.js +63 -119
- package/dist/message/style/index.less +68 -24
- package/dist/notification/index.d.ts +16 -9
- package/dist/notification/index.js +166 -114
- package/dist/notification/style/index.less +46 -65
- package/dist/style/components/toastify.less +855 -0
- package/package.json +2 -1
- package/dist/message/style/color.less +0 -36
- package/dist/notification/demo/footer.d.ts +0 -3
- package/dist/notification/demo/footer.js +0 -44
package/dist/App/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { legacyLogicalPropertiesTransformer, StyleProvider } from '@ant-design/c
|
|
|
6
6
|
import { App, ConfigProvider } from 'antd';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import { ToastContainer } from 'react-toastify';
|
|
9
10
|
var AldApp = function AldApp(_ref) {
|
|
10
11
|
var children = _ref.children,
|
|
11
12
|
className = _ref.className,
|
|
@@ -15,7 +16,12 @@ var AldApp = function AldApp(_ref) {
|
|
|
15
16
|
transformers: [legacyLogicalPropertiesTransformer]
|
|
16
17
|
}, /*#__PURE__*/React.createElement(App, _extends({
|
|
17
18
|
className: classNames('ald-app', className)
|
|
18
|
-
}, restProps), /*#__PURE__*/React.createElement(
|
|
19
|
+
}, restProps), /*#__PURE__*/React.createElement(ToastContainer, {
|
|
20
|
+
containerId: 'message-container',
|
|
21
|
+
limit: 1
|
|
22
|
+
}), /*#__PURE__*/React.createElement(ToastContainer, {
|
|
23
|
+
containerId: 'notification-container'
|
|
24
|
+
}), /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
19
25
|
theme: {
|
|
20
26
|
token: {
|
|
21
27
|
fontSize: 13
|
package/dist/Badge/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["count", "status", "size", "className", "onClick"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
6
|
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); }
|
|
7
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
9
|
import classNames from 'classnames';
|
|
6
10
|
import React from 'react';
|
|
7
11
|
export default function Badge(props) {
|
|
@@ -11,7 +15,8 @@ export default function Badge(props) {
|
|
|
11
15
|
status = _props$status === void 0 ? 'default' : _props$status,
|
|
12
16
|
size = props.size,
|
|
13
17
|
className = props.className,
|
|
14
|
-
onClick = props.onClick
|
|
18
|
+
onClick = props.onClick,
|
|
19
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
15
20
|
var status2ColorMap = {
|
|
16
21
|
success: {
|
|
17
22
|
color: '#15803D',
|
|
@@ -34,12 +39,12 @@ export default function Badge(props) {
|
|
|
34
39
|
backgroundColor: '#FEF08A'
|
|
35
40
|
}
|
|
36
41
|
};
|
|
37
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
|
38
43
|
className: classNames('ald-badge', (_classNames = {}, _defineProperty(_classNames, 'ald-badge-large', size === 'large'), _defineProperty(_classNames, 'ald-badge-clickable', typeof onClick === 'function'), _classNames), className),
|
|
39
44
|
style: {
|
|
40
45
|
color: status2ColorMap[status].color,
|
|
41
46
|
backgroundColor: status2ColorMap[status].backgroundColor
|
|
42
47
|
},
|
|
43
48
|
onClick: onClick
|
|
44
|
-
}, count);
|
|
49
|
+
}), count);
|
|
45
50
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface SVGRProps {
|
|
4
|
+
size?: number | string;
|
|
5
|
+
title?: string;
|
|
6
|
+
titleId?: string;
|
|
7
|
+
desc?: string;
|
|
8
|
+
descId?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const Memo: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement> & SVGRProps, "ref"> & React.RefAttributes<SVGSVGElement>>>;
|
|
11
|
+
export default Memo;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var _excluded = ["title", "titleId", "desc", "descId"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { forwardRef, memo } from 'react';
|
|
7
|
+
var DangerFill = function DangerFill(_ref, ref) {
|
|
8
|
+
var title = _ref.title,
|
|
9
|
+
titleId = _ref.titleId,
|
|
10
|
+
desc = _ref.desc,
|
|
11
|
+
descId = _ref.descId,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
width: props.width || props.size || 16,
|
|
16
|
+
height: props.height || props.size || 16,
|
|
17
|
+
fill: "none",
|
|
18
|
+
viewBox: "0 0 24 24",
|
|
19
|
+
ref: ref,
|
|
20
|
+
"aria-labelledby": titleId,
|
|
21
|
+
"aria-describedby": descId
|
|
22
|
+
}, props), desc ? /*#__PURE__*/React.createElement("desc", {
|
|
23
|
+
id: descId
|
|
24
|
+
}, desc) : null, title ? /*#__PURE__*/React.createElement("title", {
|
|
25
|
+
id: titleId
|
|
26
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
27
|
+
fill: props.color || 'currentColor',
|
|
28
|
+
fillRule: "evenodd",
|
|
29
|
+
d: "M8.03 2.75a.75.75 0 0 0-.53.22l-4.53 5a.75.75 0 0 0-.22.53v7c0 .199.079.39.22.53l4.53 5c.14.141.331.22.53.22h7.94a.75.75 0 0 0 .53-.22l4.53-5a.75.75 0 0 0 .22-.53v-7a.75.75 0 0 0-.22-.53l-4.53-5a.75.75 0 0 0-.53-.22H8.03Zm3.97 10a.75.75 0 0 1-.75-.75V8a.75.75 0 0 1 1.5 0v4a.75.75 0 0 1-.75.75Zm-.995 3.248c0-.548.445-.993.993-.993h.014c.548 0 .993.445.993.993v.014a.993.993 0 0 1-.993.993h-.014a.993.993 0 0 1-.993-.993v-.014Z",
|
|
30
|
+
clipRule: "evenodd"
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
var ForwardRef = /*#__PURE__*/forwardRef(DangerFill);
|
|
34
|
+
var Memo = /*#__PURE__*/memo(ForwardRef);
|
|
35
|
+
export default Memo;
|
package/dist/Icon/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { default as CloseCircleLightLine } from './components/CloseCircleLightLi
|
|
|
21
21
|
export { default as CloseLLine } from './components/CloseLLine';
|
|
22
22
|
export { default as CloseLightLine } from './components/CloseLightLine';
|
|
23
23
|
export { default as CloseMLine } from './components/CloseMLine';
|
|
24
|
+
export { default as DangerFill } from './components/DangerFill';
|
|
24
25
|
export { default as DragLine } from './components/DragLine';
|
|
25
26
|
export { default as Ellipsis } from './components/Ellipsis';
|
|
26
27
|
export { default as EyeOffLine } from './components/EyeOffLine';
|
package/dist/Icon/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export { default as CloseCircleLightLine } from "./components/CloseCircleLightLi
|
|
|
21
21
|
export { default as CloseLLine } from "./components/CloseLLine";
|
|
22
22
|
export { default as CloseLightLine } from "./components/CloseLightLine";
|
|
23
23
|
export { default as CloseMLine } from "./components/CloseMLine";
|
|
24
|
+
export { default as DangerFill } from "./components/DangerFill";
|
|
24
25
|
export { default as DragLine } from "./components/DragLine";
|
|
25
26
|
export { default as Ellipsis } from "./components/Ellipsis";
|
|
26
27
|
export { default as EyeOffLine } from "./components/EyeOffLine";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
3
|
+
d="M8.03033 2.75C7.83142 2.75 7.64065 2.82902 7.5 2.96967L2.96967 7.96967C2.82902 8.11032 2.75 8.30109 2.75 8.5V15.5C2.75 15.6989 2.82902 15.8897 2.96967 16.0303L7.5 21.0303C7.64065 21.171 7.83142 21.25 8.03033 21.25H15.9697C16.1686 21.25 16.3593 21.171 16.5 21.0303L21.0303 16.0303C21.171 15.8897 21.25 15.6989 21.25 15.5V8.5C21.25 8.30109 21.171 8.11032 21.0303 7.96967L16.5 2.96967C16.3593 2.82902 16.1686 2.75 15.9697 2.75H8.03033ZM12 12.75C11.5858 12.75 11.25 12.4142 11.25 12V8C11.25 7.58579 11.5858 7.25 12 7.25C12.4142 7.25 12.75 7.58579 12.75 8V12C12.75 12.4142 12.4142 12.75 12 12.75ZM11.005 15.9984C11.005 15.4498 11.4498 15.005 11.9984 15.005H12.0116C12.5603 15.005 13.005 15.4498 13.005 15.9984V16.0116C13.005 16.5603 12.5603 17.005 12.0116 17.005H11.9984C11.4498 17.005 11.005 16.5603 11.005 16.0116V15.9984Z"
|
|
4
|
+
fill="black" />
|
|
5
|
+
</svg>
|
|
@@ -14,6 +14,7 @@ import ScrollArea from "../../ScrollArea";
|
|
|
14
14
|
import Spin from "../../Spin";
|
|
15
15
|
import { isUser } from "../utils/getUsersWithUserId";
|
|
16
16
|
import MultipleOption from "./MultipleOption";
|
|
17
|
+
import { userDisplayNameIsRepeated } from "./Panel";
|
|
17
18
|
import SingleOption from "./SingleOption";
|
|
18
19
|
export default function MemberSelection(props) {
|
|
19
20
|
var className = props.className,
|
|
@@ -83,6 +84,7 @@ export default function MemberSelection(props) {
|
|
|
83
84
|
user: user,
|
|
84
85
|
disabled: disabled,
|
|
85
86
|
selected: isSelected,
|
|
87
|
+
showUserId: userDisplayNameIsRepeated(userList, user.nickname),
|
|
86
88
|
onChange: function onChange(selected, user) {
|
|
87
89
|
if (isUser(user)) _onChange(selected, user);
|
|
88
90
|
}
|
|
@@ -90,6 +92,7 @@ export default function MemberSelection(props) {
|
|
|
90
92
|
key: user.userId,
|
|
91
93
|
user: user,
|
|
92
94
|
selected: isSelected,
|
|
95
|
+
showUserId: userDisplayNameIsRepeated(userList, user.nickname),
|
|
93
96
|
onChange: function onChange(selected, user) {
|
|
94
97
|
if (isUser(user)) _onChange(selected, user);
|
|
95
98
|
}
|
|
@@ -9,6 +9,7 @@ interface IMultipleOptionProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
onNextLevel?: (userGroup: IUserGroup) => void;
|
|
11
11
|
hasNextLevel?: boolean;
|
|
12
|
+
showUserId?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export default function MultipleList(params: IMultipleOptionProps): React.JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -5,6 +5,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import Checkbox from "../../Checkbox";
|
|
8
|
+
import { EUserType } from "../../ConfigProvider/getUserList";
|
|
8
9
|
import TextLink from "../../TextLink/index";
|
|
9
10
|
import { getAccount, getId, getPhoto } from "../utils";
|
|
10
11
|
import { isUserGroup } from "../utils/getUsersWithUserId";
|
|
@@ -17,7 +18,9 @@ export default function MultipleList(params) {
|
|
|
17
18
|
className = params.className,
|
|
18
19
|
onNextLevel = params.onNextLevel,
|
|
19
20
|
_params$hasNextLevel = params.hasNextLevel,
|
|
20
|
-
hasNextLevel = _params$hasNextLevel === void 0 ? true : _params$hasNextLevel
|
|
21
|
+
hasNextLevel = _params$hasNextLevel === void 0 ? true : _params$hasNextLevel,
|
|
22
|
+
_params$showUserId = params.showUserId,
|
|
23
|
+
showUserId = _params$showUserId === void 0 ? false : _params$showUserId;
|
|
21
24
|
var onClick = function onClick() {
|
|
22
25
|
if (disabled) return;
|
|
23
26
|
onChange === null || onChange === void 0 ? void 0 : onChange(!selected, user);
|
|
@@ -31,13 +34,17 @@ export default function MultipleList(params) {
|
|
|
31
34
|
className: 'ald-member-picker-checkbox',
|
|
32
35
|
checked: selected,
|
|
33
36
|
disabled: disabled
|
|
34
|
-
}), /*#__PURE__*/React.createElement(
|
|
37
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: 'ald-member-picker-option-content'
|
|
39
|
+
}, /*#__PURE__*/React.createElement(NickLabel, {
|
|
35
40
|
type: user.type,
|
|
36
41
|
id: getId(user),
|
|
37
42
|
name: user.name,
|
|
38
43
|
photo: getPhoto(user),
|
|
39
44
|
account: getAccount(user)
|
|
40
|
-
})
|
|
45
|
+
}), showUserId && user.type === EUserType.USER && /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: 'ald-member-picker-option-id'
|
|
47
|
+
}, user.userId))), isUserGroup(user) && hasNextLevel && /*#__PURE__*/React.createElement(TextLink, {
|
|
41
48
|
className: "ald-member-picker-btn",
|
|
42
49
|
size: "small",
|
|
43
50
|
disabled: disabled,
|
|
@@ -14,5 +14,6 @@ interface IPanelProps {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
lockedIds: Array<TUserValue | TUserGroupValue>;
|
|
16
16
|
}
|
|
17
|
+
export declare const userDisplayNameIsRepeated: (userList: TUser, displayName?: string) => boolean;
|
|
17
18
|
export default function Panel(props: IPanelProps): React.JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -13,6 +13,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
13
13
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
14
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
+
import { EUserType } from "../../ConfigProvider/getUserList";
|
|
16
17
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
17
18
|
import Tabs from "../../Tabs";
|
|
18
19
|
import { EMemberPicker } from "../interface";
|
|
@@ -22,6 +23,11 @@ import MemberSelection from "./MemberSelection";
|
|
|
22
23
|
import SelectedMemberTags from "./SelectedMemberTags";
|
|
23
24
|
import SelectorFooter from "./SelectorFooter";
|
|
24
25
|
import UserGroupSelection from "./UserGroupSelection";
|
|
26
|
+
export var userDisplayNameIsRepeated = function userDisplayNameIsRepeated(userList, displayName) {
|
|
27
|
+
return userList.filter(function (user) {
|
|
28
|
+
return user.type === EUserType.USER && user.nickname === displayName;
|
|
29
|
+
}).length > 1;
|
|
30
|
+
};
|
|
25
31
|
export default function Panel(props) {
|
|
26
32
|
var _classNames;
|
|
27
33
|
var type = props.type,
|
|
@@ -140,7 +146,8 @@ export default function Panel(props) {
|
|
|
140
146
|
selectedUsers: selectedUsers,
|
|
141
147
|
width: (panelWidth - 3) / 2,
|
|
142
148
|
onRemove: onRemove,
|
|
143
|
-
lockedIds: lockedIds
|
|
149
|
+
lockedIds: lockedIds,
|
|
150
|
+
userList: dataList
|
|
144
151
|
}), /*#__PURE__*/React.createElement(SelectorFooter, {
|
|
145
152
|
className: 'ald-member-picker-selector-footer',
|
|
146
153
|
onCancel: props.onCancel,
|
|
@@ -10,6 +10,7 @@ interface IProps {
|
|
|
10
10
|
className?: string;
|
|
11
11
|
onCancel?: () => void;
|
|
12
12
|
lockedIds?: Array<TUserValue | TUserGroupValue>;
|
|
13
|
+
showUserId?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare const PanelWrapper: ({ type, value, multiple, dropdownWidth, onChange, onCancel, className, lockedIds, }: IProps) => React.JSX.Element;
|
|
15
16
|
export default PanelWrapper;
|
|
@@ -72,6 +72,7 @@ export var PanelWrapper = function PanelWrapper(_ref) {
|
|
|
72
72
|
cacheTime: 1000 * 60 * 2,
|
|
73
73
|
// 2分钟内不重复请求
|
|
74
74
|
onSuccess: function onSuccess(result) {
|
|
75
|
+
console.log('%c [ result ]-73', 'font-size:13px; background:#c324a4; color:#ff68e8;', 1433223, result);
|
|
75
76
|
setSearchUserList(result);
|
|
76
77
|
},
|
|
77
78
|
onError: function onError(error) {
|
|
@@ -7,6 +7,7 @@ interface ISelectedMemberTagsProps {
|
|
|
7
7
|
onRemove?: (user: IUser | IUserGroup) => void;
|
|
8
8
|
width: number;
|
|
9
9
|
lockedIds: Array<TUserValue | TUserGroupValue>;
|
|
10
|
+
userList: TUser;
|
|
10
11
|
}
|
|
11
12
|
export default function SelectedMemberTags(props: ISelectedMemberTagsProps): React.JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -5,12 +5,14 @@ import { CloseMLine } from "../../Icon";
|
|
|
5
5
|
import ScrollArea from "../../ScrollArea";
|
|
6
6
|
import { getAccount, getId, getPhoto } from "../utils";
|
|
7
7
|
import NickLabel from "./NickLabel";
|
|
8
|
+
import { userDisplayNameIsRepeated } from "./Panel";
|
|
8
9
|
export default function SelectedMemberTags(props) {
|
|
9
10
|
var className = props.className,
|
|
10
11
|
selectedUsers = props.selectedUsers,
|
|
11
12
|
width = props.width,
|
|
12
13
|
_props$lockedIds = props.lockedIds,
|
|
13
|
-
lockedIds = _props$lockedIds === void 0 ? [] : _props$lockedIds
|
|
14
|
+
lockedIds = _props$lockedIds === void 0 ? [] : _props$lockedIds,
|
|
15
|
+
userList = props.userList;
|
|
14
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
15
17
|
className: classNames(className, 'ald-member-picker-selected-member-tags-wrap')
|
|
16
18
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -27,6 +29,7 @@ export default function SelectedMemberTags(props) {
|
|
|
27
29
|
}
|
|
28
30
|
}, selectedUsers.map(function (user) {
|
|
29
31
|
var hasLocked = false;
|
|
32
|
+
var isDisplayNameRepeat = false;
|
|
30
33
|
if (user && user.hasOwnProperty('groupId')) {
|
|
31
34
|
var index = _.findIndex(lockedIds, {
|
|
32
35
|
groupId: user.groupId,
|
|
@@ -38,6 +41,7 @@ export default function SelectedMemberTags(props) {
|
|
|
38
41
|
userId: user.userId,
|
|
39
42
|
type: user.type
|
|
40
43
|
});
|
|
44
|
+
isDisplayNameRepeat = userDisplayNameIsRepeated(userList, user.nickname);
|
|
41
45
|
hasLocked = _index !== -1;
|
|
42
46
|
}
|
|
43
47
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -51,7 +55,9 @@ export default function SelectedMemberTags(props) {
|
|
|
51
55
|
name: user.name,
|
|
52
56
|
photo: getPhoto(user),
|
|
53
57
|
account: getAccount(user)
|
|
54
|
-
})
|
|
58
|
+
}), isDisplayNameRepeat && user.type === 'USER' && /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: "ald-member-picker-option-id"
|
|
60
|
+
}, user.userId)), !hasLocked && /*#__PURE__*/React.createElement(CloseMLine, {
|
|
55
61
|
size: 20,
|
|
56
62
|
className: 'ald-member-picker-close',
|
|
57
63
|
color: "#98A2B3",
|
|
@@ -9,6 +9,7 @@ interface IMultipleOptionProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
onNextLevel?: (userGroup: IUserGroup) => void;
|
|
11
11
|
hasNextLevel?: boolean;
|
|
12
|
+
showUserId?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export default function SingleOption(params: IMultipleOptionProps): React.JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -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
|
-
})
|
|
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 =
|
|
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 {
|