@jiovan-labs/ant-buddy-pro 2.0.3 → 2.0.5

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.
Files changed (37) hide show
  1. package/dist/cjs/field/NotifyBadge/index.d.ts +13 -4
  2. package/dist/cjs/field/NotifyBadge/index.js +39 -42
  3. package/dist/cjs/field/NotifyBadge/styles.js +29 -17
  4. package/dist/cjs/field/RemoteField/index.js +21 -17
  5. package/dist/cjs/form/AddonInput/index.js +47 -18
  6. package/dist/cjs/form/AvatarUpload/index.d.ts +2 -2
  7. package/dist/cjs/form/CaptchaInput/index.js +6 -2
  8. package/dist/cjs/form/CollapseForm/index.js +1 -3
  9. package/dist/cjs/form/CronInput/index.js +3 -3
  10. package/dist/cjs/form/DivideSelect/index.js +23 -20
  11. package/dist/cjs/form/LocaleInput/index.js +16 -12
  12. package/dist/cjs/form/LocaleInput/styles.js +19 -10
  13. package/dist/cjs/form/MathInput/index.js +3 -1
  14. package/dist/cjs/form/SegmentRadio/index.js +23 -20
  15. package/dist/cjs/form/TagInput/index.d.ts +1 -1
  16. package/dist/cjs/form/TagInput/index.js +36 -32
  17. package/dist/cjs/layout/MenuTabs/index.js +18 -20
  18. package/dist/cjs/layout/PageFooter/index.js +1 -1
  19. package/dist/esm/field/NotifyBadge/index.d.ts +13 -4
  20. package/dist/esm/field/NotifyBadge/index.js +64 -85
  21. package/dist/esm/field/NotifyBadge/styles.js +24 -18
  22. package/dist/esm/field/RemoteField/index.js +21 -18
  23. package/dist/esm/form/AddonInput/index.js +65 -27
  24. package/dist/esm/form/AvatarUpload/index.d.ts +2 -2
  25. package/dist/esm/form/CaptchaInput/index.js +9 -3
  26. package/dist/esm/form/CollapseForm/index.js +3 -3
  27. package/dist/esm/form/CronInput/index.js +3 -3
  28. package/dist/esm/form/DivideSelect/index.js +24 -22
  29. package/dist/esm/form/LocaleInput/index.js +28 -17
  30. package/dist/esm/form/LocaleInput/styles.js +16 -8
  31. package/dist/esm/form/MathInput/index.js +5 -1
  32. package/dist/esm/form/SegmentRadio/index.js +24 -22
  33. package/dist/esm/form/TagInput/index.d.ts +1 -1
  34. package/dist/esm/form/TagInput/index.js +37 -34
  35. package/dist/esm/layout/MenuTabs/index.js +20 -20
  36. package/dist/esm/layout/PageFooter/index.js +1 -1
  37. package/package.json +2 -2
@@ -33,6 +33,16 @@ var buildFieldStyle = (token) => {
33
33
  boxShadow: token.boxShadow,
34
34
  zIndex: token.zIndexPopupBase,
35
35
  [`${token.componentCls}-popup-list`]: {
36
+ [`&${token.componentCls}-popup-list-bordered`]: {
37
+ border: `${(0, import_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
38
+ borderRadius: token.borderRadiusLG
39
+ },
40
+ [`${token.componentCls}-popup-listy-item`]: {
41
+ borderBottom: `${(0, import_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
42
+ [`&:last-of-type`]: {
43
+ borderBottom: "none"
44
+ }
45
+ },
36
46
  [`${token.componentCls}-popup-list-item`]: {
37
47
  [`&:hover`]: {
38
48
  backgroundColor: token.controlItemBgHover
@@ -46,6 +56,10 @@ var buildFieldStyle = (token) => {
46
56
  }
47
57
  }
48
58
  },
59
+ // ProForm.Item 自带 feedback 区域,去掉 Listy item 的下 padding 让 feedback 充当下方留白,保持上下间距对称
60
+ [`&${token.componentCls}-popup-pro-field ${token.componentCls}-popup-listy-item`]: {
61
+ paddingBottom: 0
62
+ },
49
63
  [`&${token.componentCls}-popup-immutable ${token.componentCls}-popup-list ${token.componentCls}-popup-list-item ${token.antCls}-form-item`]: {
50
64
  marginBottom: `0 !important`,
51
65
  [`${token.componentCls}-locale-tag`]: {
@@ -85,18 +99,13 @@ var buildFieldStyle = (token) => {
85
99
  padding: `2px ${token.paddingXS}px`,
86
100
  fontSize: token.fontSizeSM
87
101
  }
88
- },
89
- [`&${token.componentCls}-popup-pro-field:not(${token.componentCls}-popup-immutable)`]: {
90
- [`${token.componentCls}-popup-list ${token.componentCls}-popup-list-item:first-of-type`]: {
91
- paddingTop: token.paddingMD
92
- }
93
- },
94
- [`&:not(${token.componentCls}-popup-pro-field)`]: {
95
- [`${token.componentCls}-popup-list ${token.componentCls}-popup-list-item:first-of-type`]: {
96
- paddingTop: token.paddingXS
97
- }
98
102
  }
99
103
  },
104
+ // 单语言模式下 addon 无可打开的弹层,呈灰色禁用态
105
+ [`${token.componentCls}-entry-addon-disabled`]: {
106
+ color: token.colorTextDisabled,
107
+ cursor: "not-allowed"
108
+ },
100
109
  [`${token.componentCls}-entry-readonly`]: {
101
110
  display: "flex",
102
111
  flexFlow: "row nowrap",
@@ -63,7 +63,9 @@ var MathInput = (props) => {
63
63
  } = props ?? {};
64
64
  const [fieldId] = import_react.default.useState(import_ts_lang_utils.NanoidUtils.getPopularId());
65
65
  const fieldName = !(props == null ? void 0 : props.name) ? void 0 : [...(formListContext == null ? void 0 : formListContext.listName) ?? [], props.name];
66
- const fieldValue = (props == null ? void 0 : props.name) && form ? import_antd.Form.useWatch(fieldName, form) : props == null ? void 0 : props.value;
66
+ const [fallbackForm] = import_antd.Form.useForm();
67
+ const watchedValue = import_antd.Form.useWatch(fieldName ?? "__abp_watch_placeholder__", form ?? fallbackForm);
68
+ const fieldValue = !(props == null ? void 0 : props.name) ? props == null ? void 0 : props.value : watchedValue;
67
69
  const containerRef = import_react.default.useRef(null);
68
70
  const fieldRef = import_react.default.useRef(null);
69
71
  const fieldStyle = (0, import_styles.useFieldStyle)(clazzPrefix);
@@ -54,27 +54,30 @@ var SegmentRadio = (props) => {
54
54
  const enumOptions = import_FieldUtils.FieldUtils.valueEnumToSegmentOptions(props == null ? void 0 : props.valueEnum) ?? [];
55
55
  return [...rawOptions, ...enumOptions];
56
56
  });
57
- if ((props == null ? void 0 : props.request) && (props == null ? void 0 : props.requestOptionPlace) !== false) {
58
- const { run } = (0, import_pro_components.useDebounceFn)(props.request, (props == null ? void 0 : props.debounceTime) ?? 0);
59
- import_react.default.useEffect(() => {
60
- run(props == null ? void 0 : props.params).then((values) => {
61
- if (!values) {
62
- if ((props == null ? void 0 : props.requestOptionPlace) === "override") {
63
- setOptionItems(void 0);
64
- }
65
- return;
66
- }
67
- if ((props == null ? void 0 : props.requestOptionPlace) === void 0 || (props == null ? void 0 : props.requestOptionPlace) === "override") {
68
- setOptionItems(values);
69
- } else if ((props == null ? void 0 : props.requestOptionPlace) === "before") {
70
- setOptionItems([...values, ...optionItems ?? []]);
71
- } else if ((props == null ? void 0 : props.requestOptionPlace) === "after") {
72
- setOptionItems([...optionItems ?? [], ...values]);
57
+ const { run } = (0, import_pro_components.useDebounceFn)((params) => {
58
+ return !(props == null ? void 0 : props.request) ? Promise.resolve(void 0) : props.request(params);
59
+ }, (props == null ? void 0 : props.debounceTime) ?? 0);
60
+ import_react.default.useEffect(() => {
61
+ if (!(props == null ? void 0 : props.request) || (props == null ? void 0 : props.requestOptionPlace) === false) {
62
+ return;
63
+ }
64
+ run(props == null ? void 0 : props.params).then((values) => {
65
+ if (!values) {
66
+ if ((props == null ? void 0 : props.requestOptionPlace) === "override") {
67
+ setOptionItems(void 0);
73
68
  }
74
- }).catch(() => {
75
- });
76
- }, []);
77
- }
69
+ return;
70
+ }
71
+ if ((props == null ? void 0 : props.requestOptionPlace) === void 0 || (props == null ? void 0 : props.requestOptionPlace) === "override") {
72
+ setOptionItems(values);
73
+ } else if ((props == null ? void 0 : props.requestOptionPlace) === "before") {
74
+ setOptionItems([...values, ...optionItems ?? []]);
75
+ } else if ((props == null ? void 0 : props.requestOptionPlace) === "after") {
76
+ setOptionItems([...optionItems ?? [], ...values]);
77
+ }
78
+ }).catch(() => {
79
+ });
80
+ }, []);
78
81
  import_react.default.useEffect(() => {
79
82
  var _a2;
80
83
  (_a2 = props == null ? void 0 : props.onOptionItemsChange) == null ? void 0 : _a2.call(props, optionItems);
@@ -36,7 +36,7 @@ export type TagInputProps = Omit<ProFormFieldItemProps, 'children' | 'fieldRef'
36
36
  locale?: string;
37
37
  localeProps?: IntlLocaleProps;
38
38
  };
39
- export declare const TagInput: React.ForwardRefExoticComponent<Omit<ProFormFieldItemProps, "children" | "disabled" | "fieldProps" | "placeholder" | "readonly" | "fieldRef"> & Omit<ProFormFieldRemoteProps, "request" | "valueEnum"> & {
39
+ export declare const TagInput: React.ForwardRefExoticComponent<Omit<ProFormFieldItemProps, "children" | "fieldProps" | "disabled" | "placeholder" | "readonly" | "fieldRef"> & Omit<ProFormFieldRemoteProps, "request" | "valueEnum"> & {
40
40
  clazzPrefix?: string | undefined;
41
41
  containerClazz?: string | undefined;
42
42
  containerStyle?: React.CSSProperties | undefined;
@@ -90,39 +90,43 @@ var TagInputField = import_react.default.forwardRef((props, ref) => {
90
90
  }
91
91
  }
92
92
  }));
93
- if (props == null ? void 0 : props.compactMargin) {
94
- import_react.default.useLayoutEffect(() => {
95
- var _a2, _b2, _c;
96
- const parentClazz = configContext.getPrefixCls("form-item");
97
- const targetClazz = `${clazzPrefix}-compact-margin`;
98
- (_c = (_b2 = (_a2 = fieldRef.current) == null ? void 0 : _a2.closest(`.${parentClazz}`)) == null ? void 0 : _b2.classList) == null ? void 0 : _c.add(targetClazz);
99
- }, []);
100
- }
101
- if ((props == null ? void 0 : props.request) && (props == null ? void 0 : props.requestOptionPlace) !== false) {
102
- const { run } = (0, import_pro_components.useDebounceFn)(props.request, (props == null ? void 0 : props.debounceTime) ?? 0);
103
- import_react.default.useEffect(() => {
104
- run(props == null ? void 0 : props.params).then((values) => {
105
- if (!values) {
106
- if ((props == null ? void 0 : props.requestOptionPlace) === "override") {
107
- setTagContents(null);
108
- }
109
- return;
110
- }
111
- const result = [...new Set(values == null ? void 0 : values.map((item) => {
112
- return typeof item === "string" || typeof item === "number" ? item : item.content;
113
- }))];
114
- import_ConsoleUtils.ConsoleUtils.warn(result.length === values.length, true, "TagInput", `Field '${props == null ? void 0 : props.name}' prop 'request' must includes unique response`);
115
- if ((props == null ? void 0 : props.requestOptionPlace) === void 0 || (props == null ? void 0 : props.requestOptionPlace) === "override") {
116
- setTagContents(result);
117
- } else if ((props == null ? void 0 : props.requestOptionPlace) === "before") {
118
- setTagContents([...result, ...tagContents ?? []]);
119
- } else if ((props == null ? void 0 : props.requestOptionPlace) === "after") {
120
- setTagContents([...tagContents ?? [], ...result]);
93
+ import_react.default.useLayoutEffect(() => {
94
+ var _a2, _b2, _c;
95
+ if (!(props == null ? void 0 : props.compactMargin)) {
96
+ return;
97
+ }
98
+ const parentClazz = configContext.getPrefixCls("form-item");
99
+ const targetClazz = `${clazzPrefix}-compact-margin`;
100
+ (_c = (_b2 = (_a2 = fieldRef.current) == null ? void 0 : _a2.closest(`.${parentClazz}`)) == null ? void 0 : _b2.classList) == null ? void 0 : _c.add(targetClazz);
101
+ }, []);
102
+ const { run } = (0, import_pro_components.useDebounceFn)((params) => {
103
+ return !(props == null ? void 0 : props.request) ? Promise.resolve(void 0) : props.request(params);
104
+ }, (props == null ? void 0 : props.debounceTime) ?? 0);
105
+ import_react.default.useEffect(() => {
106
+ if (!(props == null ? void 0 : props.request) || (props == null ? void 0 : props.requestOptionPlace) === false) {
107
+ return;
108
+ }
109
+ run(props == null ? void 0 : props.params).then((values) => {
110
+ if (!values) {
111
+ if ((props == null ? void 0 : props.requestOptionPlace) === "override") {
112
+ setTagContents(null);
121
113
  }
122
- }).catch(() => {
123
- });
124
- }, []);
125
- }
114
+ return;
115
+ }
116
+ const result = [...new Set(values == null ? void 0 : values.map((item) => {
117
+ return typeof item === "string" || typeof item === "number" ? item : item.content;
118
+ }))];
119
+ import_ConsoleUtils.ConsoleUtils.warn(result.length === values.length, true, "TagInput", `Field '${props == null ? void 0 : props.name}' prop 'request' must includes unique response`);
120
+ if ((props == null ? void 0 : props.requestOptionPlace) === void 0 || (props == null ? void 0 : props.requestOptionPlace) === "override") {
121
+ setTagContents(result);
122
+ } else if ((props == null ? void 0 : props.requestOptionPlace) === "before") {
123
+ setTagContents([...result, ...tagContents ?? []]);
124
+ } else if ((props == null ? void 0 : props.requestOptionPlace) === "after") {
125
+ setTagContents([...tagContents ?? [], ...result]);
126
+ }
127
+ }).catch(() => {
128
+ });
129
+ }, []);
126
130
  import_react.default.useEffect(() => {
127
131
  setInputName(inputVisible ? fieldId : void 0);
128
132
  }, [inputVisible]);
@@ -58,26 +58,24 @@ var MenuTabs = (props) => {
58
58
  const [activeKey, setActiveKey] = import_react.default.useState((_a = props == null ? void 0 : props.menuProps) == null ? void 0 : _a.defaultActiveKey);
59
59
  const [menuMode, setMenuMode] = import_react.default.useState("inline");
60
60
  const fieldStyle = (0, import_styles.useFieldStyle)(clazzPrefix);
61
- if ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.adjustOnResize) !== false) {
62
- const handleWindowResize = () => {
63
- requestAnimationFrame(() => {
64
- var _a2;
65
- if (!fieldRef.current) {
66
- return;
67
- }
68
- let shouldMode = "inline";
69
- const { offsetWidth } = fieldRef.current;
70
- if (offsetWidth > ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.minOffsetWidth) ?? 400) && ((_a2 = fieldRef.current) == null ? void 0 : _a2.offsetWidth) < ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.maxOffsetWidth) ?? 640)) {
71
- shouldMode = "horizontal";
72
- }
73
- if (offsetWidth > ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.minOffsetWidth) ?? 400) && window.innerWidth < ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.maxWindowWidth) ?? 768)) {
74
- shouldMode = "horizontal";
75
- }
76
- setMenuMode(shouldMode);
77
- });
78
- };
79
- (0, import_ahooks.useEventListener)("resize", handleWindowResize);
80
- }
61
+ const handleWindowResize = () => {
62
+ requestAnimationFrame(() => {
63
+ var _a2;
64
+ if (!fieldRef.current) {
65
+ return;
66
+ }
67
+ let shouldMode = "inline";
68
+ const { offsetWidth } = fieldRef.current;
69
+ if (offsetWidth > ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.minOffsetWidth) ?? 400) && ((_a2 = fieldRef.current) == null ? void 0 : _a2.offsetWidth) < ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.maxOffsetWidth) ?? 640)) {
70
+ shouldMode = "horizontal";
71
+ }
72
+ if (offsetWidth > ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.minOffsetWidth) ?? 400) && window.innerWidth < ((adjustLayoutProps == null ? void 0 : adjustLayoutProps.maxWindowWidth) ?? 768)) {
73
+ shouldMode = "horizontal";
74
+ }
75
+ setMenuMode(shouldMode);
76
+ });
77
+ };
78
+ (0, import_ahooks.useEventListener)("resize", handleWindowResize, { enable: (adjustLayoutProps == null ? void 0 : adjustLayoutProps.adjustOnResize) !== false });
81
79
  const buildTabsDom = () => {
82
80
  var _a2, _b2;
83
81
  if (!((_a2 = props == null ? void 0 : props.menuProps) == null ? void 0 : _a2.items) || !props.menuProps.items.length) {
@@ -44,10 +44,10 @@ var PageFooter = (props) => {
44
44
  copyrightIcon = true,
45
45
  presetStyle = "default"
46
46
  } = props ?? {};
47
+ const fieldStyle = (0, import_styles.useFieldStyle)(clazzPrefix);
47
48
  if ((!(props == null ? void 0 : props.links) || !props.links.length) && !(props == null ? void 0 : props.copyright)) {
48
49
  return null;
49
50
  }
50
- const fieldStyle = (0, import_styles.useFieldStyle)(clazzPrefix);
51
51
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
52
  import_antd.Layout.Footer,
53
53
  {
@@ -1,17 +1,25 @@
1
1
  import React from 'react';
2
- import { type BadgeProps, type DropdownProps, type ListProps, type TabsProps } from 'antd';
3
- import { ListItemMetaProps } from 'antd/es/list/Item';
2
+ import { type BadgeProps, type DropdownProps, type ListyProps, type TabsProps } from 'antd';
4
3
  import { type TabPlacement } from 'antd/es/tabs';
5
4
  import { type Tab as RcTab } from '@rc-component/tabs/es/interface';
6
5
  import { type WithFalse, type ReadonlyTabsType } from "../../type/declaration";
7
6
  export type NotifyPresetStyle = WithFalse<'notice' | 'task'>;
8
7
  export type NotifyTabPosition = Exclude<TabPlacement, 'bottom'>;
9
- export type NotifyDataItem = Omit<ListItemMetaProps, 'children'> & {
8
+ export type NotifyDataItem = {
10
9
  id?: string;
10
+ avatar?: React.ReactNode;
11
+ title?: React.ReactNode;
12
+ description?: React.ReactNode;
11
13
  extra?: React.ReactNode;
12
14
  read?: boolean;
13
15
  timestamp?: string;
14
16
  };
17
+ export type NotifyListProps = Omit<ListyProps<any>, 'itemRender' | 'rowKey'> & {
18
+ dataSource?: any[];
19
+ renderItem?: (item: any, index: number) => React.ReactNode;
20
+ rowKey?: ListyProps<any>['rowKey'];
21
+ footer?: React.ReactNode;
22
+ };
15
23
  export type HyperlinkProps = {
16
24
  clazz?: string;
17
25
  style?: React.CSSProperties;
@@ -20,8 +28,9 @@ export type HyperlinkProps = {
20
28
  rel?: string;
21
29
  };
22
30
  export type MixinTabProps = Omit<RcTab, 'children'> & {
31
+ bordered?: boolean;
23
32
  labelBadgeProps?: Omit<BadgeProps, 'children'>;
24
- listProps?: ListProps<any>;
33
+ listProps?: NotifyListProps;
25
34
  listPlaceholder?: React.ReactNode;
26
35
  showClear?: boolean | (() => boolean);
27
36
  showMore?: boolean | (() => boolean);
@@ -5,10 +5,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import React from 'react';
8
- import { Avatar, Badge, Dropdown, Empty, List, Tabs } from 'antd';
8
+ import { Avatar, Badge, Dropdown, Empty, Listy, Tabs } from 'antd';
9
9
  import { BellOutlined } from '@ant-design/icons';
10
10
  import { useIntl } from '@ant-design/pro-components';
11
- import { If } from '@jiovan-labs/react-condition';
12
11
  import { ArrayUtils, BooleanUtils, ObjectUtils } from '@jiovan-labs/ts-lang-utils';
13
12
  import { omit } from '@rc-component/util';
14
13
  import classnames from 'classnames';
@@ -67,62 +66,39 @@ export var NotifyBadge = function NotifyBadge(props) {
67
66
  }));
68
67
  };
69
68
  var renderPresetList = function renderPresetList(item, index, tab) {
70
- var avatar = !item.avatar ? undefined : /*#__PURE__*/_jsx(_Fragment, {
71
- children: /*#__PURE__*/_jsxs(If, {
72
- condition: typeof item.avatar === 'string',
73
- validation: false,
74
- children: [/*#__PURE__*/_jsx(If.Then, {
75
- children: /*#__PURE__*/_jsx(Avatar, {
76
- className: "".concat(clazzPrefix, "-list-item-avatar"),
77
- src: item.avatar
78
- })
79
- }), /*#__PURE__*/_jsx(If.Else, {
80
- children: /*#__PURE__*/_jsx("span", {
81
- className: "".concat(clazzPrefix, "-list-item-icon"),
82
- children: item.avatar
83
- })
84
- })]
85
- })
69
+ var avatar = !item.avatar ? undefined : typeof item.avatar === 'string' ? /*#__PURE__*/_jsx(Avatar, {
70
+ className: "".concat(clazzPrefix, "-list-item-avatar"),
71
+ src: item.avatar
72
+ }) : /*#__PURE__*/_jsx("span", {
73
+ className: "".concat(clazzPrefix, "-list-item-icon"),
74
+ children: item.avatar
86
75
  });
87
- return /*#__PURE__*/_jsx(List.Item, {
76
+ return /*#__PURE__*/_jsxs("div", {
88
77
  className: classnames("".concat(clazzPrefix, "-list-item"), "".concat(clazzPrefix, "-list-item-").concat(item.read ? 'read' : 'unread')),
89
78
  onClick: function onClick(event) {
90
79
  var _tab$onClick;
91
80
  return (_tab$onClick = tab.onClick) === null || _tab$onClick === void 0 ? void 0 : _tab$onClick.call(tab, event, item.key || item.id || index);
92
81
  },
93
- children: /*#__PURE__*/_jsx(List.Item.Meta, {
82
+ children: [!!avatar && /*#__PURE__*/_jsx("div", {
83
+ className: "".concat(clazzPrefix, "-list-item-avatar-wrapper"),
84
+ children: avatar
85
+ }), /*#__PURE__*/_jsxs("div", {
94
86
  className: "".concat(clazzPrefix, "-list-item-meta"),
95
- avatar: avatar,
96
- title: /*#__PURE__*/_jsxs("div", {
87
+ children: [/*#__PURE__*/_jsxs("div", {
97
88
  className: "".concat(clazzPrefix, "-list-item-title"),
98
- children: [item.title, /*#__PURE__*/_jsx(If, {
99
- condition: item.extra,
100
- validation: false,
101
- children: /*#__PURE__*/_jsx("div", {
102
- className: "".concat(clazzPrefix, "-list-item-extra"),
103
- children: item.extra
104
- })
105
- })]
106
- }),
107
- description: /*#__PURE__*/_jsxs(_Fragment, {
108
- children: [/*#__PURE__*/_jsx(If, {
109
- condition: item.description,
110
- validation: false,
111
- children: /*#__PURE__*/_jsx("div", {
112
- className: "".concat(clazzPrefix, "-list-item-description"),
113
- children: item.description
114
- })
115
- }), /*#__PURE__*/_jsx(If, {
116
- condition: item.timestamp,
117
- validation: false,
118
- children: /*#__PURE__*/_jsx("div", {
119
- className: "".concat(clazzPrefix, "-list-item-timestamp"),
120
- children: item.timestamp
121
- })
89
+ children: [item.title, !!item.extra && /*#__PURE__*/_jsx("div", {
90
+ className: "".concat(clazzPrefix, "-list-item-extra"),
91
+ children: item.extra
122
92
  })]
123
- })
124
- })
125
- }, item.key || item.id || index);
93
+ }), !!item.description && /*#__PURE__*/_jsx("div", {
94
+ className: "".concat(clazzPrefix, "-list-item-description"),
95
+ children: item.description
96
+ }), !!item.timestamp && /*#__PURE__*/_jsx("div", {
97
+ className: "".concat(clazzPrefix, "-list-item-timestamp"),
98
+ children: item.timestamp
99
+ })]
100
+ })]
101
+ });
126
102
  };
127
103
  var renderListFooter = function renderListFooter(tab) {
128
104
  var _tab$listProps3, _props$localeProps, _props$localeProps2;
@@ -134,29 +110,21 @@ export var NotifyBadge = function NotifyBadge(props) {
134
110
  }
135
111
  return /*#__PURE__*/_jsxs(_Fragment, {
136
112
  children: [(_tab$listProps3 = tab.listProps) === null || _tab$listProps3 === void 0 ? void 0 : _tab$listProps3.footer, /*#__PURE__*/_jsxs("div", {
137
- className: "".concat(clazzPrefix, "-builtin-footer"),
138
- children: [/*#__PURE__*/_jsx(If, {
139
- condition: showClear,
140
- validation: false,
141
- children: /*#__PURE__*/_jsx("div", {
142
- className: "".concat(clazzPrefix, "-action-button"),
143
- onClick: function onClick(event) {
144
- var _tab$onClear, _tab$key;
145
- return (_tab$onClear = tab.onClear) === null || _tab$onClear === void 0 ? void 0 : _tab$onClear.call(tab, event, (_tab$key = tab.key) !== null && _tab$key !== void 0 ? _tab$key : tab.presetStyle);
146
- },
147
- children: ObjectUtils.firstNotNil(props === null || props === void 0 || (_props$localeProps = props.localeProps) === null || _props$localeProps === void 0 ? void 0 : _props$localeProps.clear, intlLocales.get([locale, 'clear']), intlLocales.get(['en_US', 'clear']))
148
- })
149
- }), /*#__PURE__*/_jsx(If, {
150
- condition: showMore,
151
- validation: false,
152
- children: /*#__PURE__*/_jsx("div", {
153
- className: "".concat(clazzPrefix, "-action-button"),
154
- onClick: function onClick(event) {
155
- var _tab$onMore, _tab$key2;
156
- return (_tab$onMore = tab.onMore) === null || _tab$onMore === void 0 ? void 0 : _tab$onMore.call(tab, event, (_tab$key2 = tab.key) !== null && _tab$key2 !== void 0 ? _tab$key2 : tab.presetStyle);
157
- },
158
- children: ObjectUtils.firstNotNil(props === null || props === void 0 || (_props$localeProps2 = props.localeProps) === null || _props$localeProps2 === void 0 ? void 0 : _props$localeProps2.more, intlLocales.get([locale, 'more']), intlLocales.get(['en_US', 'more']))
159
- })
113
+ className: classnames("".concat(clazzPrefix, "-builtin-footer"), tab.bordered ? undefined : "".concat(clazzPrefix, "-builtin-footer-bordered")),
114
+ children: [showClear && /*#__PURE__*/_jsx("div", {
115
+ className: "".concat(clazzPrefix, "-action-button"),
116
+ onClick: function onClick(event) {
117
+ var _tab$onClear, _tab$key;
118
+ return (_tab$onClear = tab.onClear) === null || _tab$onClear === void 0 ? void 0 : _tab$onClear.call(tab, event, (_tab$key = tab.key) !== null && _tab$key !== void 0 ? _tab$key : tab.presetStyle);
119
+ },
120
+ children: ObjectUtils.firstNotNil(props === null || props === void 0 || (_props$localeProps = props.localeProps) === null || _props$localeProps === void 0 ? void 0 : _props$localeProps.clear, intlLocales.get([locale, 'clear']), intlLocales.get(['en_US', 'clear']))
121
+ }), showMore && /*#__PURE__*/_jsx("div", {
122
+ className: "".concat(clazzPrefix, "-action-button"),
123
+ onClick: function onClick(event) {
124
+ var _tab$onMore, _tab$key2;
125
+ return (_tab$onMore = tab.onMore) === null || _tab$onMore === void 0 ? void 0 : _tab$onMore.call(tab, event, (_tab$key2 = tab.key) !== null && _tab$key2 !== void 0 ? _tab$key2 : tab.presetStyle);
126
+ },
127
+ children: ObjectUtils.firstNotNil(props === null || props === void 0 || (_props$localeProps2 = props.localeProps) === null || _props$localeProps2 === void 0 ? void 0 : _props$localeProps2.more, intlLocales.get([locale, 'more']), intlLocales.get(['en_US', 'more']))
160
128
  })]
161
129
  })]
162
130
  });
@@ -167,23 +135,34 @@ export var NotifyBadge = function NotifyBadge(props) {
167
135
  return undefined;
168
136
  }
169
137
  return props.tabsProps.items.map(function (tab) {
170
- var _tab$listProps4, _tab$listPlaceholder, _tab$listProps5, _tab$key3;
171
- var empty = !((_tab$listProps4 = tab.listProps) !== null && _tab$listProps4 !== void 0 && _tab$listProps4.dataSource) || Array.isArray(tab.listProps.dataSource) && !tab.listProps.dataSource.length;
138
+ var _tab$listProps$items, _tab$listProps4, _tab$listProps5, _tab$listPlaceholder, _tab$listProps6, _tab$listProps$rowKey, _tab$listProps7, _tab$key3;
139
+ var listItems = (_tab$listProps$items = (_tab$listProps4 = tab.listProps) === null || _tab$listProps4 === void 0 ? void 0 : _tab$listProps4.items) !== null && _tab$listProps$items !== void 0 ? _tab$listProps$items : (_tab$listProps5 = tab.listProps) === null || _tab$listProps5 === void 0 ? void 0 : _tab$listProps5.dataSource;
140
+ var empty = !listItems || Array.isArray(listItems) && !listItems.length;
172
141
  var placeholder = (_tab$listPlaceholder = tab.listPlaceholder) !== null && _tab$listPlaceholder !== void 0 ? _tab$listPlaceholder : /*#__PURE__*/_jsx(Empty, {
173
142
  image: Empty.PRESENTED_IMAGE_SIMPLE
174
143
  });
175
- var content = empty ? placeholder : /*#__PURE__*/_jsx(List, _objectSpread(_objectSpread({
176
- className: classnames("".concat(clazzPrefix, "-tab-list"), (_tab$listProps5 = tab.listProps) === null || _tab$listProps5 === void 0 ? void 0 : _tab$listProps5.className)
177
- }, !(tab !== null && tab !== void 0 && tab.listProps) ? {} : omit(tab.listProps, ['className', 'footer', 'renderItem'])), {}, {
178
- footer: renderListFooter(tab),
179
- renderItem: function renderItem(item, index) {
180
- var _tab$listProps6;
181
- if ((_tab$listProps6 = tab.listProps) !== null && _tab$listProps6 !== void 0 && _tab$listProps6.renderItem) {
182
- return tab.listProps.renderItem(item, index);
144
+ var content = empty ? placeholder : /*#__PURE__*/_jsxs("div", {
145
+ className: "".concat(clazzPrefix, "-tab-list-wrapper"),
146
+ children: [/*#__PURE__*/_jsx(Listy, _objectSpread(_objectSpread({
147
+ className: classnames("".concat(clazzPrefix, "-tab-list"), tab.bordered ? "".concat(clazzPrefix, "-tab-list-bordered") : undefined, (_tab$listProps6 = tab.listProps) === null || _tab$listProps6 === void 0 ? void 0 : _tab$listProps6.className),
148
+ items: listItems,
149
+ rowKey: (_tab$listProps$rowKey = (_tab$listProps7 = tab.listProps) === null || _tab$listProps7 === void 0 ? void 0 : _tab$listProps7.rowKey) !== null && _tab$listProps$rowKey !== void 0 ? _tab$listProps$rowKey : function (item) {
150
+ var _item$key;
151
+ return (_item$key = item === null || item === void 0 ? void 0 : item.key) !== null && _item$key !== void 0 ? _item$key : item === null || item === void 0 ? void 0 : item.id;
152
+ },
153
+ classNames: {
154
+ item: "".concat(clazzPrefix, "-listy-item")
183
155
  }
184
- return tab.presetStyle === 'notice' || tab.presetStyle === 'task' ? renderPresetList(item, index, tab) : undefined;
185
- }
186
- }));
156
+ }, !(tab !== null && tab !== void 0 && tab.listProps) ? {} : omit(tab.listProps, ['className', 'footer', 'renderItem', 'dataSource', 'items', 'rowKey', 'classNames'])), {}, {
157
+ itemRender: function itemRender(item, index) {
158
+ var _tab$listProps8;
159
+ if ((_tab$listProps8 = tab.listProps) !== null && _tab$listProps8 !== void 0 && _tab$listProps8.renderItem) {
160
+ return tab.listProps.renderItem(item, index);
161
+ }
162
+ return tab.presetStyle === 'notice' || tab.presetStyle === 'task' ? renderPresetList(item, index, tab) : undefined;
163
+ }
164
+ })), renderListFooter(tab)]
165
+ });
187
166
  return _objectSpread(_objectSpread({
188
167
  key: (_tab$key3 = tab.key) !== null && _tab$key3 !== void 0 ? _tab$key3 : tab.presetStyle,
189
168
  label: renderTabLabel(tab)
@@ -16,28 +16,36 @@ var buildFieldStyle = function buildFieldStyle(token) {
16
16
  }, "&:hover", {
17
17
  backgroundColor: 'unset !important',
18
18
  cursor: 'unset !important'
19
- })), "".concat(token.componentCls, "-tabs"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(token.antCls, "-tabs-content-top ").concat(token.antCls, "-tabs-tab"), {
19
+ })), "".concat(token.componentCls, "-tabs"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(token.antCls, "-tabs-content-top ").concat(token.antCls, "-tabs-tab"), {
20
20
  paddingTop: 2
21
21
  }), "".concat(token.antCls, "-tabs-content-left ").concat(token.antCls, "-tabs-tabpane"), {
22
22
  paddingLeft: token.paddingXS
23
23
  }), "".concat(token.antCls, "-tabs-content-right ").concat(token.antCls, "-tabs-tabpane"), {
24
24
  paddingRight: token.paddingXS
25
- }), "".concat(token.componentCls, "-tab-list"), _defineProperty(_defineProperty({
25
+ }), "".concat(token.componentCls, "-tab-list-wrapper"), _defineProperty({
26
26
  maxHeight: 400,
27
27
  overflow: 'auto'
28
28
  }, "&::-webkit-scrollbar", {
29
29
  display: 'none'
30
- }), "".concat(token.antCls, "-list-footer"), {
31
- paddingBottom: 0
32
- })), "".concat(token.componentCls, "-list-item"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
33
- borderRadius: token.borderRadius,
30
+ })), "".concat(token.componentCls, "-tab-list"), _defineProperty(_defineProperty({}, "&".concat(token.componentCls, "-tab-list-bordered"), {
31
+ border: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit),
32
+ borderRadius: token.borderRadius
33
+ }), "".concat(token.antCls, "-listy-item:last-child"), {
34
+ borderBottom: 'none'
35
+ })), "".concat(token.componentCls, "-listy-item"), _defineProperty({
34
36
  cursor: 'pointer',
35
- paddingRight: token.paddingXS,
36
- paddingLeft: token.paddingXS,
37
- overflow: 'hidden',
38
37
  transition: 'all 0.3s'
38
+ }, "&:hover", {
39
+ backgroundColor: token.controlItemBgActive
40
+ })), "".concat(token.componentCls, "-list-item"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
41
+ display: 'flex',
42
+ alignItems: 'flex-start',
43
+ gap: token.paddingXS,
44
+ overflow: 'hidden'
39
45
  }, "&&-read", {
40
46
  opacity: 0.4
47
+ }), "&-avatar-wrapper", {
48
+ flex: 'none'
41
49
  }), "&-avatar", {
42
50
  backgroundColor: token.colorBgContainer,
43
51
  marginTop: token.marginXXS
@@ -52,27 +60,25 @@ var buildFieldStyle = function buildFieldStyle(token) {
52
60
  fontSize: token.fontSize - 1
53
61
  }), "&-timestamp", {
54
62
  marginTop: token.marginXXS,
55
- fontSize: token.fontSizeSM
63
+ fontSize: token.fontSizeSM,
64
+ color: token.colorTextTertiary
56
65
  }), "&-extra", {
57
66
  float: 'right',
58
67
  marginTop: -1.5,
59
68
  marginRight: 0,
60
69
  color: token.colorTextSecondary,
61
70
  fontWeight: 'normal'
62
- }), "&:hover", {
63
- backgroundColor: token.controlItemBgActive
64
- }), "&:last-child", {
65
- borderBottom: 'none !important'
66
- })), "".concat(token.componentCls, "-builtin-footer"), _defineProperty({
71
+ })), "".concat(token.componentCls, "-builtin-footer"), _defineProperty(_defineProperty({
67
72
  height: 38,
68
73
  color: token.colorPrimaryText,
69
74
  display: 'flex',
70
75
  alignItems: 'start',
71
76
  textAlign: 'center',
72
- borderTop: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit),
73
- borderRadius: "0 0 ".concat(token.borderRadius, "px ").concat(token.borderRadius, "px"),
74
77
  transition: 'all 0.3s'
75
- }, "".concat(token.componentCls, "-action-button"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
78
+ }, "&".concat(token.componentCls, "-builtin-footer-bordered"), {
79
+ borderTop: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit),
80
+ borderRadius: "0 0 ".concat(token.borderRadius, "px ").concat(token.borderRadius, "px")
81
+ }), "".concat(token.componentCls, "-action-button"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
76
82
  display: 'flex',
77
83
  flex: 1,
78
84
  cursor: 'pointer',