@aloudata/aloudata-design 2.10.5 → 2.11.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.
- package/dist/DatePicker/index.d.ts +8 -8
- package/dist/DoubleCircleIcon/index.d.ts +1 -1
- package/dist/Dropdown/index.d.ts +2 -1
- package/dist/Dropdown/index.js +5 -2
- package/dist/Form/index.d.ts +1 -1
- package/dist/List/Item.d.ts +31 -0
- package/dist/List/Item.js +75 -0
- package/dist/List/index.d.ts +18 -0
- package/dist/List/index.js +135 -0
- package/dist/List/style/index.d.ts +2 -0
- package/dist/List/style/index.js +2 -0
- package/dist/List/style/index.less +120 -0
- package/dist/MemberPicker/components/MultipleOption.js +5 -4
- package/dist/MemberPicker/components/NickLabel.d.ts +2 -1
- package/dist/MemberPicker/components/NickLabel.js +3 -2
- package/dist/MemberPicker/components/SelectedMemberTags.js +5 -4
- package/dist/MemberPicker/components/SingleOption.js +5 -4
- package/dist/MemberPicker/index.js +5 -1
- package/dist/MemberPicker/style/index.less +2 -6
- package/dist/Radio/components/Group/index.d.ts +1 -1
- package/dist/ScrollArea/index.js +3 -1
- package/dist/Spin/index.d.ts +1 -0
- package/dist/Spin/index.js +4 -3
- package/dist/Tabs/style/index.less +2 -4
- package/dist/ald.min.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.less +1 -0
- package/package.json +1 -1
|
@@ -2,25 +2,25 @@ import { DatePicker as AntdDatePicker, DatePickerProps as AntdDatePickerProps }
|
|
|
2
2
|
import { Dayjs } from 'dayjs';
|
|
3
3
|
export type { RangeValue } from 'rc-picker/lib/interface';
|
|
4
4
|
declare const DatePicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
5
|
-
status?: "" | "
|
|
5
|
+
status?: "" | "warning" | "error" | undefined;
|
|
6
6
|
hashId?: string | undefined;
|
|
7
7
|
popupClassName?: string | undefined;
|
|
8
8
|
rootClassName?: string | undefined;
|
|
9
9
|
}, unknown> & {
|
|
10
10
|
WeekPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
11
|
-
status?: "" | "
|
|
11
|
+
status?: "" | "warning" | "error" | undefined;
|
|
12
12
|
hashId?: string | undefined;
|
|
13
13
|
popupClassName?: string | undefined;
|
|
14
14
|
rootClassName?: string | undefined;
|
|
15
15
|
}, "picker">, unknown>;
|
|
16
16
|
MonthPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
17
|
-
status?: "" | "
|
|
17
|
+
status?: "" | "warning" | "error" | undefined;
|
|
18
18
|
hashId?: string | undefined;
|
|
19
19
|
popupClassName?: string | undefined;
|
|
20
20
|
rootClassName?: string | undefined;
|
|
21
21
|
}, "picker">, unknown>;
|
|
22
22
|
YearPicker: import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<Omit<import("antd/es/date-picker/generatePicker").PickerProps<Dayjs> & {
|
|
23
|
-
status?: "" | "
|
|
23
|
+
status?: "" | "warning" | "error" | undefined;
|
|
24
24
|
hashId?: string | undefined;
|
|
25
25
|
popupClassName?: string | undefined;
|
|
26
26
|
rootClassName?: string | undefined;
|
|
@@ -34,9 +34,9 @@ declare const DatePicker: import("antd/es/date-picker/generatePicker/interface")
|
|
|
34
34
|
size?: import("antd/es/button").ButtonSize;
|
|
35
35
|
placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight" | undefined;
|
|
36
36
|
bordered?: boolean | undefined;
|
|
37
|
-
status?: "" | "
|
|
37
|
+
status?: "" | "warning" | "error" | undefined;
|
|
38
38
|
} & {
|
|
39
|
-
status?: "" | "
|
|
39
|
+
status?: "" | "warning" | "error" | undefined;
|
|
40
40
|
hashId?: string | undefined;
|
|
41
41
|
popupClassName?: string | undefined;
|
|
42
42
|
rootClassName?: string | undefined;
|
|
@@ -46,9 +46,9 @@ declare const DatePicker: import("antd/es/date-picker/generatePicker/interface")
|
|
|
46
46
|
size?: import("antd/es/button").ButtonSize;
|
|
47
47
|
placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight" | undefined;
|
|
48
48
|
bordered?: boolean | undefined;
|
|
49
|
-
status?: "" | "
|
|
49
|
+
status?: "" | "warning" | "error" | undefined;
|
|
50
50
|
} & {
|
|
51
|
-
status?: "" | "
|
|
51
|
+
status?: "" | "warning" | "error" | undefined;
|
|
52
52
|
hashId?: string | undefined;
|
|
53
53
|
popupClassName?: string | undefined;
|
|
54
54
|
rootClassName?: string | undefined;
|
|
@@ -5,6 +5,6 @@ declare const DoubleCircleIcon: (props: {
|
|
|
5
5
|
size?: number | undefined;
|
|
6
6
|
innerColor?: string | undefined;
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
-
type?: "
|
|
8
|
+
type?: "warning" | "error" | "success" | "info" | undefined;
|
|
9
9
|
}) => React.JSX.Element;
|
|
10
10
|
export default DoubleCircleIcon;
|
package/dist/Dropdown/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OffsetOptions } from '@floating-ui/react';
|
|
1
|
+
import { OffsetOptions, UseHoverProps } from '@floating-ui/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { MenuProps } from '../Menu';
|
|
4
4
|
import './style/index.less';
|
|
@@ -67,5 +67,6 @@ export interface IDropdownProps {
|
|
|
67
67
|
* @default false
|
|
68
68
|
*/
|
|
69
69
|
disabled?: boolean;
|
|
70
|
+
delay?: UseHoverProps['delay'];
|
|
70
71
|
}
|
|
71
72
|
export default function Dropdown(props: IDropdownProps): React.JSX.Element;
|
package/dist/Dropdown/index.js
CHANGED
|
@@ -37,7 +37,9 @@ export default function Dropdown(props) {
|
|
|
37
37
|
dropdownRender = props.dropdownRender,
|
|
38
38
|
disabled = props.disabled,
|
|
39
39
|
_props$offset = props.offset,
|
|
40
|
-
offsetProps = _props$offset === void 0 ? 4 : _props$offset
|
|
40
|
+
offsetProps = _props$offset === void 0 ? 4 : _props$offset,
|
|
41
|
+
_props$delay = props.delay,
|
|
42
|
+
delay = _props$delay === void 0 ? 0 : _props$delay;
|
|
41
43
|
var _useState = useState(open || false),
|
|
42
44
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43
45
|
isOpen = _useState2[0],
|
|
@@ -69,7 +71,8 @@ export default function Dropdown(props) {
|
|
|
69
71
|
var click = useClick(context);
|
|
70
72
|
var hover = useHover(context, {
|
|
71
73
|
enabled: trigger === 'hover',
|
|
72
|
-
handleClose: safePolygon({})
|
|
74
|
+
handleClose: safePolygon({}),
|
|
75
|
+
delay: delay
|
|
73
76
|
});
|
|
74
77
|
var dismiss = useDismiss(context);
|
|
75
78
|
var role = useRole(context);
|
package/dist/Form/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ interface IFormItemProps extends FormItemProps {
|
|
|
18
18
|
declare const AldFormItem: {
|
|
19
19
|
(props: IFormItemProps): React.JSX.Element;
|
|
20
20
|
useStatus: () => {
|
|
21
|
-
status?: "" | "
|
|
21
|
+
status?: "" | "warning" | "error" | "success" | "validating" | undefined;
|
|
22
22
|
errors: React.ReactNode[];
|
|
23
23
|
warnings: React.ReactNode[];
|
|
24
24
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { CSSProperties, FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ListItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'prefix'> {
|
|
3
|
+
className?: string;
|
|
4
|
+
classNames?: {
|
|
5
|
+
actions?: string;
|
|
6
|
+
prefix?: string;
|
|
7
|
+
};
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
styles?: {
|
|
11
|
+
actions?: CSSProperties;
|
|
12
|
+
prefix?: CSSProperties;
|
|
13
|
+
};
|
|
14
|
+
actions?: ReactNode[];
|
|
15
|
+
prefix?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export interface ListItemMetaProps {
|
|
18
|
+
avatar?: ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
title?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare const Meta: FC<ListItemMetaProps>;
|
|
26
|
+
declare const InternalItem: React.ForwardRefExoticComponent<ListItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export type ListItemTypeProps = typeof InternalItem & {
|
|
28
|
+
Meta: typeof Meta;
|
|
29
|
+
};
|
|
30
|
+
declare const Item: ListItemTypeProps;
|
|
31
|
+
export default Item;
|
|
@@ -0,0 +1,75 @@
|
|
|
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 = ["className", "avatar", "title", "description"],
|
|
3
|
+
_excluded2 = ["children", "actions", "styles", "className", "prefix", "classNames"];
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
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); }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
import classnames from 'classnames';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
export var Meta = function Meta(_ref) {
|
|
15
|
+
var className = _ref.className,
|
|
16
|
+
avatar = _ref.avatar,
|
|
17
|
+
title = _ref.title,
|
|
18
|
+
description = _ref.description,
|
|
19
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
var prefixCls = 'ald-list';
|
|
21
|
+
var classString = classnames("".concat(prefixCls, "-item-meta"), className);
|
|
22
|
+
var content = /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: "".concat(prefixCls, "-item-meta-content")
|
|
24
|
+
}, title && /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: classnames("".concat(prefixCls, "-item-meta-content-title"), _defineProperty({}, "".concat(prefixCls, "-item-meta-content-title-no-description"), !description))
|
|
26
|
+
}, title), description && /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: "".concat(prefixCls, "-item-meta-content-description"),
|
|
28
|
+
title: typeof description === 'string' ? description : ''
|
|
29
|
+
}, description));
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, others, {
|
|
31
|
+
className: classString
|
|
32
|
+
}), avatar && /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "".concat(prefixCls, "-item-meta-avatar")
|
|
34
|
+
}, avatar), (title || description) && content);
|
|
35
|
+
};
|
|
36
|
+
var InternalItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
37
|
+
var children = props.children,
|
|
38
|
+
actions = props.actions,
|
|
39
|
+
styles = props.styles,
|
|
40
|
+
className = props.className,
|
|
41
|
+
prefix = props.prefix,
|
|
42
|
+
customizeClassNames = props.classNames,
|
|
43
|
+
others = _objectWithoutProperties(props, _excluded2);
|
|
44
|
+
var moduleClass = function moduleClass(moduleName) {
|
|
45
|
+
return classnames(customizeClassNames === null || customizeClassNames === void 0 ? void 0 : customizeClassNames[moduleName]);
|
|
46
|
+
};
|
|
47
|
+
var moduleStyle = function moduleStyle(moduleName) {
|
|
48
|
+
return _objectSpread({}, styles === null || styles === void 0 ? void 0 : styles[moduleName]);
|
|
49
|
+
};
|
|
50
|
+
var prefixCls = 'ald-list';
|
|
51
|
+
var actionsContent = actions && actions.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: classnames("".concat(prefixCls, "-item-action"), moduleClass('actions')),
|
|
53
|
+
key: "actions",
|
|
54
|
+
style: moduleStyle('actions')
|
|
55
|
+
}, actions.map(function (action, i) {
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
key: "".concat(prefixCls, "-item-action-").concat(i)
|
|
58
|
+
}, action, i !== actions.length - 1 && /*#__PURE__*/React.createElement("em", {
|
|
59
|
+
className: "".concat(prefixCls, "-item-action-split")
|
|
60
|
+
}));
|
|
61
|
+
}));
|
|
62
|
+
var prefixContent = prefix && /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: classnames("".concat(prefixCls, "-item-prefix"), moduleClass('prefix')),
|
|
64
|
+
style: moduleStyle('prefix'),
|
|
65
|
+
key: "prefix"
|
|
66
|
+
}, prefix);
|
|
67
|
+
var itemChildren = /*#__PURE__*/React.createElement("div", _extends({}, others, {
|
|
68
|
+
ref: ref,
|
|
69
|
+
className: classnames("".concat(prefixCls, "-item"), className)
|
|
70
|
+
}), [prefixContent, children, actionsContent]);
|
|
71
|
+
return itemChildren;
|
|
72
|
+
});
|
|
73
|
+
var Item = InternalItem;
|
|
74
|
+
Item.Meta = Meta;
|
|
75
|
+
export default Item;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function List<T>(props: ListProps<T>): React.JSX.Element;
|
|
3
|
+
declare namespace List {
|
|
4
|
+
var Item: import("./Item").ListItemTypeProps;
|
|
5
|
+
}
|
|
6
|
+
export default List;
|
|
7
|
+
export interface ListProps<T> {
|
|
8
|
+
size?: 'default' | 'small';
|
|
9
|
+
rowKey?: ((item: T) => React.Key) | keyof T;
|
|
10
|
+
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
dataSource?: T[];
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
dividerGap?: number;
|
|
16
|
+
virtual?: boolean;
|
|
17
|
+
itemHeight?: number | ((item: T) => number);
|
|
18
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
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
|
+
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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
|
+
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import ScrollArea from "../ScrollArea";
|
|
9
|
+
import Spin from "../Spin";
|
|
10
|
+
import Item from "./Item";
|
|
11
|
+
function List(props) {
|
|
12
|
+
var _props$dataSource = props.dataSource,
|
|
13
|
+
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
|
|
14
|
+
renderItem = props.renderItem,
|
|
15
|
+
bordered = props.bordered,
|
|
16
|
+
customizeSize = props.size,
|
|
17
|
+
rowKey = props.rowKey,
|
|
18
|
+
children = props.children,
|
|
19
|
+
className = props.className,
|
|
20
|
+
_props$dividerGap = props.dividerGap,
|
|
21
|
+
dividerGap = _props$dividerGap === void 0 ? 0 : _props$dividerGap,
|
|
22
|
+
_props$loading = props.loading,
|
|
23
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
24
|
+
virtual = props.virtual,
|
|
25
|
+
_props$itemHeight = props.itemHeight,
|
|
26
|
+
itemHeight = _props$itemHeight === void 0 ? 50 : _props$itemHeight;
|
|
27
|
+
var parentRef = React.useRef(null);
|
|
28
|
+
var measureElement = function measureElement(element) {
|
|
29
|
+
return element.offsetHeight;
|
|
30
|
+
};
|
|
31
|
+
var rowVirtualizer = useVirtualizer({
|
|
32
|
+
count: dividerGap === 0 ? dataSource.length : dataSource.length * 2 - 1,
|
|
33
|
+
getScrollElement: function getScrollElement() {
|
|
34
|
+
return parentRef.current;
|
|
35
|
+
},
|
|
36
|
+
estimateSize: function estimateSize(index) {
|
|
37
|
+
if (dividerGap === 0) {
|
|
38
|
+
return typeof itemHeight === 'function' ? itemHeight(dataSource[index]) : itemHeight;
|
|
39
|
+
}
|
|
40
|
+
if (index % 2 === 0) {
|
|
41
|
+
return typeof itemHeight === 'function' ? itemHeight(dataSource[Math.floor(index / 2)]) : itemHeight;
|
|
42
|
+
}
|
|
43
|
+
return 1;
|
|
44
|
+
},
|
|
45
|
+
measureElement: measureElement,
|
|
46
|
+
gap: dividerGap
|
|
47
|
+
});
|
|
48
|
+
function getKey(currentItem, currentIndex) {
|
|
49
|
+
var key;
|
|
50
|
+
if (typeof rowKey === 'function') {
|
|
51
|
+
key = rowKey(currentItem);
|
|
52
|
+
} else if (rowKey) {
|
|
53
|
+
key = currentItem[rowKey];
|
|
54
|
+
} else {
|
|
55
|
+
key = currentItem.key;
|
|
56
|
+
}
|
|
57
|
+
if (!key) {
|
|
58
|
+
key = "list-item-".concat(currentIndex);
|
|
59
|
+
}
|
|
60
|
+
return key;
|
|
61
|
+
}
|
|
62
|
+
var size = customizeSize || 'default';
|
|
63
|
+
var customizeClassNames = classNames('ald-list', _defineProperty({
|
|
64
|
+
'ald-list-bordered': bordered
|
|
65
|
+
}, "ald-list-".concat(size), size), className);
|
|
66
|
+
if (virtual) {
|
|
67
|
+
var renderInnerItem = function renderInnerItem(index) {
|
|
68
|
+
if (!renderItem) return null;
|
|
69
|
+
if (dividerGap === 0) {
|
|
70
|
+
var _item = dataSource[index];
|
|
71
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
72
|
+
key: getKey(_item, index)
|
|
73
|
+
}, renderItem(_item, index));
|
|
74
|
+
} else {
|
|
75
|
+
var isDivider = index % 2 === 1;
|
|
76
|
+
if (isDivider) {
|
|
77
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: "ald-list-divider",
|
|
79
|
+
key: "divider-".concat(index)
|
|
80
|
+
});
|
|
81
|
+
} else {
|
|
82
|
+
var itemIndex = Math.floor(index / 2);
|
|
83
|
+
var _item2 = dataSource[itemIndex];
|
|
84
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
85
|
+
key: getKey(_item2, itemIndex)
|
|
86
|
+
}, renderItem(_item2, itemIndex));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
return /*#__PURE__*/React.createElement(ScrollArea, {
|
|
91
|
+
ref: parentRef,
|
|
92
|
+
asChild: true,
|
|
93
|
+
className: "ald-list-virtual",
|
|
94
|
+
innerClassName: customizeClassNames
|
|
95
|
+
}, /*#__PURE__*/React.createElement(Spin, {
|
|
96
|
+
spinning: loading,
|
|
97
|
+
wrapperClassName: "ald-list-item-wrap",
|
|
98
|
+
style: {
|
|
99
|
+
rowGap: dividerGap,
|
|
100
|
+
height: "".concat(rowVirtualizer.getTotalSize(), "px")
|
|
101
|
+
}
|
|
102
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, rowVirtualizer.getVirtualItems().map(function (virtualItem) {
|
|
103
|
+
var index = virtualItem.index;
|
|
104
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
key: virtualItem.key,
|
|
106
|
+
style: {
|
|
107
|
+
position: 'absolute',
|
|
108
|
+
top: 0,
|
|
109
|
+
left: 0,
|
|
110
|
+
width: '100%',
|
|
111
|
+
height: "".concat(virtualItem.size, "px"),
|
|
112
|
+
transform: "translateY(".concat(virtualItem.start, "px)")
|
|
113
|
+
}
|
|
114
|
+
}, renderInnerItem(index));
|
|
115
|
+
}), children)));
|
|
116
|
+
}
|
|
117
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
ref: parentRef,
|
|
119
|
+
className: customizeClassNames
|
|
120
|
+
}, /*#__PURE__*/React.createElement(Spin, {
|
|
121
|
+
spinning: loading,
|
|
122
|
+
wrapperClassName: "ald-list-item-wrap",
|
|
123
|
+
style: {
|
|
124
|
+
rowGap: dividerGap
|
|
125
|
+
}
|
|
126
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, dataSource.map(function (item, index) {
|
|
127
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
128
|
+
key: getKey(item, index)
|
|
129
|
+
}, renderItem ? renderItem(item, index) : null, index !== dataSource.length - 1 && dividerGap > 0 && /*#__PURE__*/React.createElement("div", {
|
|
130
|
+
className: "ald-list-divider"
|
|
131
|
+
}));
|
|
132
|
+
}), children)));
|
|
133
|
+
}
|
|
134
|
+
List.Item = Item;
|
|
135
|
+
export default List;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
@import '../../style/index.less';
|
|
2
|
+
@import '../../Spin/style/index.less';
|
|
3
|
+
@import '../../ScrollArea/style/index.less';
|
|
4
|
+
|
|
5
|
+
.ald-list-virtual {
|
|
6
|
+
.ald-list {
|
|
7
|
+
height: 100%;
|
|
8
|
+
display: block !important;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ald-list {
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
|
|
15
|
+
&-item {
|
|
16
|
+
display: flex;
|
|
17
|
+
padding: var(--alias-padding-75, 6px) var(--alias-padding-100, 8px);
|
|
18
|
+
align-items: center;
|
|
19
|
+
border-radius: var(--alias-radius-75, 6px);
|
|
20
|
+
gap: var(--alias-spacing-75, 6px);
|
|
21
|
+
|
|
22
|
+
&-prefix {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: flex-start;
|
|
25
|
+
align-self: stretch;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
padding: 2px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-meta {
|
|
31
|
+
flex: 1;
|
|
32
|
+
min-width: 0;
|
|
33
|
+
display: flex;
|
|
34
|
+
gap: var(--alias-spacing-75, 6px);
|
|
35
|
+
align-items: center;
|
|
36
|
+
|
|
37
|
+
&-avatar {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-self: stretch;
|
|
40
|
+
align-items: flex-start;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
flex: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&-content {
|
|
47
|
+
min-width: 0;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: var(--alias-spacing-50, 4px);
|
|
51
|
+
align-items: flex-start;
|
|
52
|
+
justify-content: stretch;
|
|
53
|
+
|
|
54
|
+
&-title {
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
line-height: 20px;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
text-overflow: ellipsis;
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
|
|
63
|
+
&-no-description {
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&-description {
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
font-weight: 400;
|
|
71
|
+
line-height: 16px;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
text-overflow: ellipsis;
|
|
75
|
+
max-width: 100%;
|
|
76
|
+
color: var(--alias-colors-text-subtlest, #9ca3af);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&-action {
|
|
82
|
+
display: flex;
|
|
83
|
+
gap: var(--alias-spacing-100, 8px);
|
|
84
|
+
align-items: center;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&-divider {
|
|
89
|
+
height: 1px;
|
|
90
|
+
background-color: var(--alias-colors-border-subtle, #f3f4f6);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ald-list-item-wrap {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
align-items: stretch;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ald-list-small {
|
|
101
|
+
.ald-list-item {
|
|
102
|
+
gap: var(--alias-spacing-75, 6px);
|
|
103
|
+
|
|
104
|
+
&-meta {
|
|
105
|
+
gap: var(--alias-spacing-75, 6px);
|
|
106
|
+
|
|
107
|
+
&-avatar {
|
|
108
|
+
padding: 2px 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&-content {
|
|
112
|
+
gap: var(--alias-spacing-25, 2px);
|
|
113
|
+
|
|
114
|
+
&-title {
|
|
115
|
+
font-size: 12px;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -41,10 +41,11 @@ export default function MultipleList(params) {
|
|
|
41
41
|
id: getId(user),
|
|
42
42
|
name: user.name,
|
|
43
43
|
photo: getPhoto(user),
|
|
44
|
-
account: getAccount(user)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
account: getAccount(user),
|
|
45
|
+
addonBefore: showUserId && user.type === EUserType.USER && /*#__PURE__*/React.createElement("span", {
|
|
46
|
+
className: 'ald-member-picker-option-id'
|
|
47
|
+
}, user.userId)
|
|
48
|
+
}))), isUserGroup(user) && hasNextLevel && /*#__PURE__*/React.createElement(TextLink, {
|
|
48
49
|
className: "ald-member-picker-btn",
|
|
49
50
|
size: "small",
|
|
50
51
|
disabled: disabled,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { EUserType } from "../../ConfigProvider/getUserList";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
3
|
interface INickLabelProps {
|
|
4
4
|
name?: string;
|
|
5
5
|
id: string;
|
|
6
6
|
photo?: React.ReactNode;
|
|
7
7
|
account?: string;
|
|
8
8
|
type: EUserType;
|
|
9
|
+
addonBefore?: ReactNode;
|
|
9
10
|
}
|
|
10
11
|
declare const _default: React.NamedExoticComponent<INickLabelProps>;
|
|
11
12
|
export default _default;
|
|
@@ -7,7 +7,8 @@ var NickLabel = function NickLabel(_ref) {
|
|
|
7
7
|
name = _ref.name,
|
|
8
8
|
id = _ref.id,
|
|
9
9
|
account = _ref.account,
|
|
10
|
-
type = _ref.type
|
|
10
|
+
type = _ref.type,
|
|
11
|
+
addonBefore = _ref.addonBefore;
|
|
11
12
|
var innerName = name || id;
|
|
12
13
|
var photoSrc = !photo && type === EUserType.USER_GROUP ? /*#__PURE__*/React.createElement(UserGroup, {
|
|
13
14
|
size: 20
|
|
@@ -21,6 +22,6 @@ var NickLabel = function NickLabel(_ref) {
|
|
|
21
22
|
}, innerName), /*#__PURE__*/React.createElement("div", {
|
|
22
23
|
className: "ald-member-picker-nick-label-name",
|
|
23
24
|
title: account ? "".concat(name, "(").concat(account, ")") : "".concat(name)
|
|
24
|
-
}, innerName));
|
|
25
|
+
}, innerName, addonBefore));
|
|
25
26
|
};
|
|
26
27
|
export default /*#__PURE__*/memo(NickLabel);
|
|
@@ -54,10 +54,11 @@ export default function SelectedMemberTags(props) {
|
|
|
54
54
|
id: getId(user),
|
|
55
55
|
name: user.name,
|
|
56
56
|
photo: getPhoto(user),
|
|
57
|
-
account: getAccount(user)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
account: getAccount(user),
|
|
58
|
+
addonBefore: isDisplayNameRepeat && user.type === 'USER' && /*#__PURE__*/React.createElement("span", {
|
|
59
|
+
className: "ald-member-picker-option-id"
|
|
60
|
+
}, user.userId)
|
|
61
|
+
})), !hasLocked && /*#__PURE__*/React.createElement(CloseMLine, {
|
|
61
62
|
size: 20,
|
|
62
63
|
className: 'ald-member-picker-close',
|
|
63
64
|
color: "#98A2B3",
|
|
@@ -35,10 +35,11 @@ export default function SingleOption(params) {
|
|
|
35
35
|
id: getId(user),
|
|
36
36
|
name: user.name,
|
|
37
37
|
photo: getPhoto(user),
|
|
38
|
-
account: getAccount(user)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
account: getAccount(user),
|
|
39
|
+
addonBefore: showUserId && user.type === EUserType.USER && /*#__PURE__*/React.createElement("span", {
|
|
40
|
+
className: 'ald-member-picker-option-id'
|
|
41
|
+
}, user.userId)
|
|
42
|
+
}))), isUserGroup(user) && hasNextLevel && /*#__PURE__*/React.createElement(TextLink, {
|
|
42
43
|
className: "ald-member-picker-btn",
|
|
43
44
|
size: "small",
|
|
44
45
|
disabled: disabled,
|
|
@@ -14,7 +14,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
14
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
15
|
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; }
|
|
16
16
|
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; }
|
|
17
|
-
import { useRequest } from 'ahooks';
|
|
17
|
+
import { usePrevious, useRequest } from 'ahooks';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import _ from 'lodash';
|
|
20
20
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -57,6 +57,7 @@ var Component = function Component(_ref) {
|
|
|
57
57
|
_useState2 = _slicedToArray(_useState, 2),
|
|
58
58
|
selectedUserList = _useState2[0],
|
|
59
59
|
setSelectedUserList = _useState2[1];
|
|
60
|
+
var prevValue = usePrevious(value);
|
|
60
61
|
var _useState3 = useState([]),
|
|
61
62
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
63
|
searchUserList = _useState4[0],
|
|
@@ -131,6 +132,9 @@ var Component = function Component(_ref) {
|
|
|
131
132
|
run();
|
|
132
133
|
}, [dropdownOpen, run, searchString]);
|
|
133
134
|
useEffect(function () {
|
|
135
|
+
if (_.isEqual(value, prevValue)) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
134
138
|
if (Array.isArray(value) && (isUser(value[0]) || isUserGroup(value[0]))) {
|
|
135
139
|
setSelectedUserList(value);
|
|
136
140
|
} else if (isUser(value) || isUserGroup(value)) {
|
|
@@ -205,13 +205,9 @@
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
.ald-member-picker-option-id {
|
|
208
|
-
max-width: 50%;
|
|
209
|
-
white-space: nowrap; /* 防止内容换行,保持内容长度 */
|
|
210
|
-
text-overflow: ellipsis;
|
|
211
|
-
overflow: hidden;
|
|
212
208
|
color: var(--alias-colors-text-subtle, #4b5563);
|
|
213
209
|
font-size: 12px;
|
|
214
|
-
|
|
210
|
+
margin-left: 4px;
|
|
215
211
|
}
|
|
216
212
|
|
|
217
213
|
.ald-member-picker-trigger {
|
|
@@ -281,6 +277,7 @@
|
|
|
281
277
|
}
|
|
282
278
|
|
|
283
279
|
.ald-member-picker-nick-label-name {
|
|
280
|
+
flex: 1;
|
|
284
281
|
color: var(--alias-colors-text-default, #1f2937);
|
|
285
282
|
font-size: 14px;
|
|
286
283
|
font-weight: 400;
|
|
@@ -288,7 +285,6 @@
|
|
|
288
285
|
white-space: nowrap;
|
|
289
286
|
text-overflow: ellipsis;
|
|
290
287
|
overflow: hidden;
|
|
291
|
-
max-width: 130px;
|
|
292
288
|
}
|
|
293
289
|
}
|
|
294
290
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IRadioGroupProps } from '../../interface/radioGroup';
|
|
3
|
-
export declare const RadioGroupContext: React.Context<Omit<IRadioGroupProps, "
|
|
3
|
+
export declare const RadioGroupContext: React.Context<Omit<IRadioGroupProps, "className" | "children">>;
|
|
4
4
|
export default function RadioGroup(props: IRadioGroupProps): React.JSX.Element;
|