@tendaui/components 1.2.4 → 1.3.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/_util/scroll.ts +9 -0
- package/alert/_example/base.tsx +13 -0
- package/alert/_example/collapse.tsx +15 -0
- package/badge/_example/base.tsx +10 -0
- package/badge/_example/count.tsx +29 -0
- package/badge/_example/custom-color.tsx +32 -0
- package/badge/_example/dot.tsx +26 -0
- package/badge/_example/max-count.tsx +26 -0
- package/badge/_example/offset.tsx +29 -0
- package/badge/_example/shape.tsx +32 -0
- package/badge/_example/show-zero.tsx +23 -0
- package/badge/_example/size.tsx +35 -0
- package/badge/_example/standalone.tsx +14 -0
- package/badge/_example/text-count.tsx +26 -0
- package/badge/_example/with-button.tsx +23 -0
- package/button/_example/block.tsx +18 -0
- package/button/_example/disabled.tsx +22 -0
- package/button/_example/ghost.tsx +21 -0
- package/button/_example/link.tsx +15 -0
- package/button/_example/loading.tsx +19 -0
- package/button/_example/shape.tsx +18 -0
- package/button/_example/size.tsx +18 -0
- package/button/_example/suffix.tsx +16 -0
- package/button/_example/theme.tsx +14 -0
- package/button/_example/variant-base.tsx +24 -0
- package/button/_example/variant-dashed.tsx +24 -0
- package/button/_example/variant-outline.tsx +24 -0
- package/button/_example/variant-text.tsx +24 -0
- package/checkbox/_example/base.tsx +8 -0
- package/checkbox/_example/controlled.tsx +11 -0
- package/checkbox/_example/group-disabled.tsx +13 -0
- package/checkbox/_example/group-with-check-all.tsx +22 -0
- package/checkbox/_example/group-with-max.tsx +17 -0
- package/checkbox/_example/group-with-options.tsx +18 -0
- package/checkbox/_example/group.tsx +17 -0
- package/checkbox/_example/states.tsx +19 -0
- package/color-picker/ColorPicker.tsx +16 -2
- package/color-picker/_example/base.tsx +12 -0
- package/color-picker/_example/borderless.tsx +17 -0
- package/color-picker/_example/clearable.tsx +12 -0
- package/color-picker/_example/disabled.tsx +17 -0
- package/color-picker/_example/formats.tsx +30 -0
- package/color-picker/_example/manual-input.tsx +39 -0
- package/color-picker/_example/recent-colors.tsx +19 -0
- package/color-picker/_example/swatch-colors.tsx +28 -0
- package/color-picker/_example/with-alpha.tsx +21 -0
- package/color-picker/components/panel/format/inputs.tsx +1 -1
- package/color-picker/components/panel/index.tsx +13 -0
- package/color-picker/components/trigger.tsx +64 -13
- package/color-picker/defaultProps.ts +4 -1
- package/color-picker/utils/color-picker/cmyk.ts +5 -5
- package/color-picker/utils/color-picker/draggable.ts +14 -15
- package/color-picker/utils/color-picker/format.ts +21 -26
- package/color-picker/utils/color-picker/gradient.ts +35 -41
- package/color-picker/utils/color-picker/types.ts +4 -4
- package/config-provider/ConfigContext.tsx +1 -0
- package/config-provider/ConfigProvider.tsx +18 -1
- package/config-provider/type.ts +5 -0
- package/dialog/_example/base.tsx +27 -0
- package/dialog/_example/confirm-loading.tsx +32 -0
- package/dialog/_example/custom-buttons.tsx +24 -0
- package/dialog/_example/full-screen.tsx +26 -0
- package/dialog/_example/hide-buttons.tsx +39 -0
- package/dialog/_example/modeless.tsx +25 -0
- package/dialog/_example/placement.tsx +40 -0
- package/dialog/_example/plugin-example.tsx +69 -0
- package/dialog/_example/themes.tsx +41 -0
- package/drawer/Drawer.tsx +17 -9
- package/drawer/_example/custom-header-footer.tsx +29 -0
- package/drawer/_example/default.tsx +20 -0
- package/drawer/_example/events.tsx +53 -0
- package/drawer/_example/no-footer.tsx +20 -0
- package/drawer/_example/no-overlay.tsx +20 -0
- package/drawer/_example/placement.tsx +43 -0
- package/drawer/_example/size-draggable.tsx +26 -0
- package/drawer/_example/size.tsx +40 -0
- package/drawer/defaultProps.ts +1 -1
- package/fireworks/Fireworks.tsx +1 -10
- package/fireworks/index.ts +0 -1
- package/fireworks/type.ts +0 -1
- package/form/_example/complex.tsx +76 -0
- package/form/_example/default.tsx +58 -0
- package/form/_example/disabled.tsx +26 -0
- package/form/_example/form-list.tsx +74 -0
- package/form/_example/inline-layout.tsx +20 -0
- package/form/_example/label-align.tsx +46 -0
- package/form/_example/methods.tsx +66 -0
- package/form/_example/validation.tsx +71 -0
- package/form/hooks/useFormItemStyle.tsx +19 -7
- package/form/index.ts +20 -2
- package/global-config/default-config.ts +28 -28
- package/global-config/locale/ar_KW.ts +176 -187
- package/global-config/locale/en_US.ts +180 -195
- package/global-config/locale/it_IT.ts +174 -197
- package/global-config/locale/ja_JP.ts +178 -193
- package/global-config/locale/ko_KR.ts +178 -193
- package/global-config/locale/ru_RU.ts +189 -200
- package/global-config/locale/zh_CN.ts +179 -193
- package/global-config/locale/zh_TW.ts +178 -192
- package/global-config/mobile/default-config.ts +3 -3
- package/global-config/mobile/locale/ar_KW.ts +76 -77
- package/global-config/mobile/locale/en_US.ts +76 -77
- package/global-config/mobile/locale/it_IT.ts +76 -77
- package/global-config/mobile/locale/ja_JP.ts +64 -65
- package/global-config/mobile/locale/ko_KR.ts +64 -65
- package/global-config/mobile/locale/ru_RU.ts +76 -77
- package/global-config/mobile/locale/zh_CN.ts +64 -65
- package/global-config/mobile/locale/zh_TW.ts +64 -65
- package/global-config/t.ts +12 -12
- package/hooks/useDebounce.ts +27 -0
- package/hooks/useLastest.ts +6 -2
- package/hooks/useResizeObserve.ts +0 -1
- package/index.ts +1 -1
- package/input/Input.tsx +53 -10
- package/input/_example/auto-width.tsx +14 -0
- package/input/_example/borderless.tsx +17 -0
- package/input/_example/clearable.tsx +14 -0
- package/input/_example/default.tsx +10 -0
- package/input/_example/disabled-readonly.tsx +12 -0
- package/input/_example/events.tsx +42 -0
- package/input/_example/group.tsx +14 -0
- package/input/_example/label-suffix.tsx +12 -0
- package/input/_example/max-length.tsx +11 -0
- package/input/_example/password.tsx +14 -0
- package/input/_example/sizes.tsx +12 -0
- package/input/_example/status.tsx +13 -0
- package/input/_example/text-align.tsx +12 -0
- package/input/_example/with-icon.tsx +13 -0
- package/input/type.ts +3 -0
- package/input/useLengthLimit.ts +122 -0
- package/input-number/_example/align.tsx +23 -0
- package/input-number/_example/auto-width.tsx +8 -0
- package/input-number/_example/default.tsx +8 -0
- package/input-number/_example/events.tsx +45 -0
- package/input-number/_example/format.tsx +27 -0
- package/input-number/_example/large-number.tsx +17 -0
- package/input-number/_example/min-max.tsx +14 -0
- package/input-number/_example/sizes.tsx +35 -0
- package/input-number/_example/status.tsx +65 -0
- package/input-number/_example/step-and-decimal.tsx +14 -0
- package/input-number/_example/themes.tsx +21 -0
- package/input-number/_example/with-suffix.tsx +12 -0
- package/ip-input/_example/controlled.tsx +26 -0
- package/ip-input/_example/default.tsx +12 -0
- package/ip-input/_example/full-featured.tsx +32 -0
- package/ip-input/_example/ipv6.tsx +23 -0
- package/ip-input/_example/keyboard-navigation.tsx +19 -0
- package/ip-input/_example/paste-demo.tsx +23 -0
- package/ip-input/_example/states.tsx +21 -0
- package/ip-input/_example/with-cidr.tsx +23 -0
- package/layout/_example/combine-left.tsx +54 -0
- package/layout/_example/combine-right.tsx +54 -0
- package/layout/_example/custom-aside-width.tsx +56 -0
- package/layout/_example/custom-height.tsx +45 -0
- package/layout/_example/double-sidebar.tsx +57 -0
- package/layout/_example/side-navigation-right.tsx +51 -0
- package/layout/_example/side-navigation.tsx +51 -0
- package/layout/_example/top-navigation.tsx +41 -0
- package/list/_example/async-loading.tsx +46 -0
- package/list/_example/default.tsx +23 -0
- package/list/_example/header-footer.tsx +40 -0
- package/list/_example/multiline.tsx +24 -0
- package/list/_example/scroll-loading.tsx +69 -0
- package/list/_example/sizes.tsx +45 -0
- package/list/_example/split.tsx +36 -0
- package/list/_example/stripe.tsx +24 -0
- package/list/_example/virtual-scroll.tsx +51 -0
- package/list/_example/with-image.tsx +26 -0
- package/loading/_example/default.tsx +6 -0
- package/loading/_example/delay.tsx +53 -0
- package/loading/_example/fullscreen.tsx +29 -0
- package/loading/_example/inherit-color.tsx +24 -0
- package/loading/_example/no-overlay.tsx +15 -0
- package/loading/_example/sizes.tsx +25 -0
- package/loading/_example/with-text.tsx +12 -0
- package/loading/_example/wrapper.tsx +30 -0
- package/notification/_example/default.tsx +31 -0
- package/notification/_example/long-content.tsx +37 -0
- package/notification/_example/stacking.tsx +40 -0
- package/notification/_example/types.tsx +78 -0
- package/notification/_example/usage-example.tsx +62 -0
- package/package.json +4 -3
- package/popup/Popup.tsx +17 -5
- package/popup/_example/controlled.tsx +32 -0
- package/popup/_example/custom-content.tsx +64 -0
- package/popup/_example/default.tsx +19 -0
- package/popup/_example/delay.tsx +35 -0
- package/popup/_example/disabled.tsx +17 -0
- package/popup/_example/no-arrow.tsx +17 -0
- package/popup/_example/placements.tsx +61 -0
- package/popup/_example/triggers.tsx +26 -0
- package/radio/_example/allow-uncheck.tsx +19 -0
- package/radio/_example/button-style.tsx +40 -0
- package/radio/_example/controlled.tsx +13 -0
- package/radio/_example/default.tsx +13 -0
- package/radio/_example/group-disabled.tsx +22 -0
- package/radio/_example/group-with-options.tsx +20 -0
- package/radio/_example/group.tsx +19 -0
- package/radio/_example/sizes.tsx +37 -0
- package/radio/_example/states.tsx +20 -0
- package/select/_example/collapsed.tsx +30 -0
- package/select/_example/creatable.tsx +36 -0
- package/select/_example/custom-content.tsx +26 -0
- package/select/_example/default.tsx +29 -0
- package/select/_example/disabled.tsx +20 -0
- package/select/_example/filterable.tsx +27 -0
- package/select/_example/group-options.tsx +44 -0
- package/select/_example/label-suffix.tsx +24 -0
- package/select/_example/loading.tsx +19 -0
- package/select/_example/multiple.tsx +31 -0
- package/select/_example/sizes.tsx +20 -0
- package/select/_example/status.tsx +27 -0
- package/slider/Slider.tsx +13 -5
- package/slider/_example/custom-label.tsx +19 -0
- package/slider/_example/default.tsx +14 -0
- package/slider/_example/disabled.tsx +17 -0
- package/slider/_example/marks.tsx +31 -0
- package/slider/_example/range.tsx +16 -0
- package/slider/_example/step.tsx +14 -0
- package/slider/_example/vertical.tsx +26 -0
- package/slider/_example/with-input-number.tsx +21 -0
- package/slider/type.ts +1 -1
- package/styles/_vars.scss +16 -0
- package/styles/components/button/_index.scss +3 -3
- package/styles/components/dialog/_index.scss +18 -20
- package/styles/components/drawer/_index.scss +4 -3
- package/styles/components/drawer/_var.scss +1 -1
- package/styles/components/form/_index.scss +7 -6
- package/styles/components/input/_mixins.scss +7 -5
- package/styles/components/input-number/_index.scss +13 -12
- package/styles/components/list/_index.scss +5 -5
- package/styles/components/notification/_index.scss +4 -4
- package/styles/components/slider/_index.scss +8 -8
- package/styles/components/switch/_index.scss +98 -15
- package/styles/components/table/_index.scss +37 -29
- package/styles/components/tabs/_index.scss +8 -9
- package/styles/components/tooltip/_index.scss +104 -0
- package/styles/components/tooltip/_vars.scss +23 -0
- package/switch/_example/async-change.tsx +25 -0
- package/switch/_example/before-change.tsx +22 -0
- package/switch/_example/controlled.tsx +14 -0
- package/switch/_example/custom-value.tsx +21 -0
- package/switch/_example/default.tsx +6 -0
- package/switch/_example/disabled.tsx +25 -0
- package/switch/_example/loading.tsx +17 -0
- package/switch/_example/sizes.tsx +21 -0
- package/switch/_example/with-label.tsx +21 -0
- package/tab/TabPanel.tsx +9 -6
- package/tab/_example/addable.tsx +45 -0
- package/tab/_example/card-theme.tsx +22 -0
- package/tab/_example/default.tsx +22 -0
- package/tab/_example/disabled.tsx +38 -0
- package/tab/_example/lazy.tsx +25 -0
- package/tab/_example/placement.tsx +36 -0
- package/tab/_example/removable.tsx +31 -0
- package/tab/_example/sizes.tsx +31 -0
- package/tab/_example/with-action.tsx +26 -0
- package/table/Cell.tsx +3 -6
- package/table/Ellipsis.tsx +73 -0
- package/table/_example/alignment.tsx +46 -0
- package/table/_example/auto-width.tsx +47 -0
- package/table/_example/bordered-stripe-hover.tsx +42 -0
- package/table/_example/bordered.tsx +42 -0
- package/table/_example/cell-click.tsx +52 -0
- package/table/_example/complex.tsx +82 -0
- package/table/_example/custom-cell.tsx +68 -0
- package/table/_example/custom-empty.tsx +37 -0
- package/table/_example/custom-row-class-name.tsx +57 -0
- package/table/_example/default.tsx +42 -0
- package/table/_example/ellipsis.tsx +56 -0
- package/table/_example/empty.tsx +28 -0
- package/table/_example/fixed-width.tsx +48 -0
- package/table/_example/hover.tsx +42 -0
- package/table/_example/row-click.tsx +52 -0
- package/table/_example/sizes.tsx +57 -0
- package/table/_example/stripe.tsx +42 -0
- package/table/_example/vertical-align.tsx +110 -0
- package/table/hooks/useTableClassName.ts +3 -3
- package/table/index.ts +2 -0
- package/table/type.ts +1 -0
- package/tag/Tag.tsx +1 -1
- package/tag/_example/closable.tsx +44 -0
- package/tag/_example/default.tsx +17 -0
- package/tag/_example/disabled.tsx +19 -0
- package/tag/_example/sizes.tsx +18 -0
- package/tag/_example/variants.tsx +37 -0
- package/tag-input/_example/collapsed.tsx +27 -0
- package/tag-input/_example/controlled-uncontrolled.tsx +26 -0
- package/tag-input/_example/default.tsx +15 -0
- package/tag-input/_example/disabled-readonly.tsx +21 -0
- package/tag-input/_example/events.tsx +64 -0
- package/tag-input/_example/excess-display.tsx +27 -0
- package/tag-input/_example/max-tags.tsx +22 -0
- package/tag-input/_example/sizes.tsx +21 -0
- package/tag-input/_example/status.tsx +37 -0
- package/tag-input/_example/with-label.tsx +23 -0
- package/tag-input/hooks/useTagList.tsx +1 -1
- package/tooltip/Tooltip.tsx +76 -0
- package/tooltip/_example/base.tsx +26 -0
- package/tooltip/_example/custom-content.tsx +47 -0
- package/tooltip/_example/placement.tsx +33 -0
- package/tooltip/_example/theme.tsx +34 -0
- package/tooltip/defaultProps.ts +14 -0
- package/tooltip/index.ts +7 -0
- package/tooltip/style/index.js +1 -0
- package/tooltip/type.ts +99 -0
- package/utils/log/index.ts +1 -1
- package/utils/log/log.ts +2 -3
- package/utils/log/types.ts +1 -4
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { List } from "../index";
|
|
3
|
+
|
|
4
|
+
const { ListItem, ListItemMeta } = List;
|
|
5
|
+
|
|
6
|
+
const MultilineList = () => {
|
|
7
|
+
const listData = [
|
|
8
|
+
{ id: 1, title: "列表主标题", content: "这是一段较长的描述文字,用于展示多行文本的效果。" },
|
|
9
|
+
{ id: 2, title: "列表主标题", content: "这是一段较长的描述文字,用于展示多行文本的效果。" },
|
|
10
|
+
{ id: 3, title: "列表主标题", content: "这是一段较长的描述文字,用于展示多行文本的效果。" }
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<List>
|
|
15
|
+
{listData.map((item) => (
|
|
16
|
+
<ListItem key={item.id}>
|
|
17
|
+
<ListItemMeta title={item.title} description={item.content} />
|
|
18
|
+
</ListItem>
|
|
19
|
+
))}
|
|
20
|
+
</List>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default MultilineList;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { List } from "../index";
|
|
3
|
+
|
|
4
|
+
const { ListItem, ListItemMeta } = List;
|
|
5
|
+
|
|
6
|
+
interface ListItemData {
|
|
7
|
+
id: number;
|
|
8
|
+
content: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
title: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const ScrollLoadingList = () => {
|
|
14
|
+
const [listData, setListData] = useState<ListItemData[]>([]);
|
|
15
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
16
|
+
const [pageNum, setPageNum] = useState(1);
|
|
17
|
+
|
|
18
|
+
const dataSource: ListItemData[] = [];
|
|
19
|
+
const total = 100;
|
|
20
|
+
const pageSize = 20;
|
|
21
|
+
|
|
22
|
+
for (let i = 0; i < total; i++) {
|
|
23
|
+
dataSource.push({
|
|
24
|
+
id: i,
|
|
25
|
+
content: "列表内容列表内容列表内容",
|
|
26
|
+
icon: "https://tdesign.gtimg.com/list-icon.png",
|
|
27
|
+
title: `列表标题 ${i + 1}`
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const fetchData = async (pageInfo: { pageNum: number; pageSize: number }) => {
|
|
32
|
+
if (isLoading) return;
|
|
33
|
+
setIsLoading(true);
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
const { pageNum, pageSize } = pageInfo;
|
|
36
|
+
const newDataSource = dataSource.slice((pageNum - 1) * pageSize, pageNum * pageSize);
|
|
37
|
+
setListData((prev) => prev.concat(newDataSource));
|
|
38
|
+
setPageNum(pageNum);
|
|
39
|
+
setIsLoading(false);
|
|
40
|
+
}, 500);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const handleScroll = ({ scrollBottom }: { scrollTop: number; scrollBottom: number }) => {
|
|
44
|
+
if (!scrollBottom && listData.length < total) {
|
|
45
|
+
fetchData({ pageNum: pageNum + 1, pageSize });
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
fetchData({ pageNum, pageSize });
|
|
51
|
+
}, []);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<List
|
|
55
|
+
asyncLoading={isLoading ? "loading" : ""}
|
|
56
|
+
size="small"
|
|
57
|
+
style={{ height: "300px", overflow: "auto" }}
|
|
58
|
+
onScroll={handleScroll}
|
|
59
|
+
>
|
|
60
|
+
{listData.map((item) => (
|
|
61
|
+
<ListItem key={item.id}>
|
|
62
|
+
<ListItemMeta image={item.icon} title={item.title} description={item.content} />
|
|
63
|
+
</ListItem>
|
|
64
|
+
))}
|
|
65
|
+
</List>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default ScrollLoadingList;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { List } from "../index";
|
|
3
|
+
|
|
4
|
+
const { ListItem } = List;
|
|
5
|
+
|
|
6
|
+
const SizesList = () => {
|
|
7
|
+
const listData = [
|
|
8
|
+
{ id: 1, content: "列表内容列表内容列表内容" },
|
|
9
|
+
{ id: 2, content: "列表内容列表内容列表内容" },
|
|
10
|
+
{ id: 3, content: "列表内容列表内容列表内容" }
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "32px" }}>
|
|
15
|
+
<div>
|
|
16
|
+
<h4 style={{ marginBottom: "16px", color: "#666" }}>小尺寸</h4>
|
|
17
|
+
<List size="small">
|
|
18
|
+
{listData.map((item) => (
|
|
19
|
+
<ListItem key={item.id}>{item.content}</ListItem>
|
|
20
|
+
))}
|
|
21
|
+
</List>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div>
|
|
25
|
+
<h4 style={{ marginBottom: "16px", color: "#666" }}>中尺寸(默认)</h4>
|
|
26
|
+
<List size="medium">
|
|
27
|
+
{listData.map((item) => (
|
|
28
|
+
<ListItem key={item.id}>{item.content}</ListItem>
|
|
29
|
+
))}
|
|
30
|
+
</List>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div>
|
|
34
|
+
<h4 style={{ marginBottom: "16px", color: "#666" }}>大尺寸</h4>
|
|
35
|
+
<List size="large">
|
|
36
|
+
{listData.map((item) => (
|
|
37
|
+
<ListItem key={item.id}>{item.content}</ListItem>
|
|
38
|
+
))}
|
|
39
|
+
</List>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default SizesList;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { List } from "../index";
|
|
3
|
+
|
|
4
|
+
const { ListItem } = List;
|
|
5
|
+
|
|
6
|
+
const SplitList = () => {
|
|
7
|
+
const listData = [
|
|
8
|
+
{ id: 1, content: "列表内容列表内容列表内容" },
|
|
9
|
+
{ id: 2, content: "列表内容列表内容列表内容" },
|
|
10
|
+
{ id: 3, content: "列表内容列表内容列表内容" },
|
|
11
|
+
{ id: 4, content: "列表内容列表内容列表内容" }
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div style={{ display: "flex", gap: "32px" }}>
|
|
16
|
+
<div style={{ flex: 1 }}>
|
|
17
|
+
<h4 style={{ marginBottom: "16px", color: "#666" }}>无分割线</h4>
|
|
18
|
+
<List split={false}>
|
|
19
|
+
{listData.map((item) => (
|
|
20
|
+
<ListItem key={item.id}>{item.content}</ListItem>
|
|
21
|
+
))}
|
|
22
|
+
</List>
|
|
23
|
+
</div>
|
|
24
|
+
<div style={{ flex: 1 }}>
|
|
25
|
+
<h4 style={{ marginBottom: "16px", color: "#666" }}>有分割线</h4>
|
|
26
|
+
<List split={true}>
|
|
27
|
+
{listData.map((item) => (
|
|
28
|
+
<ListItem key={item.id}>{item.content}</ListItem>
|
|
29
|
+
))}
|
|
30
|
+
</List>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default SplitList;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { List } from "../index";
|
|
3
|
+
|
|
4
|
+
const { ListItem } = List;
|
|
5
|
+
|
|
6
|
+
const StripeList = () => {
|
|
7
|
+
const listData = [
|
|
8
|
+
{ id: 1, content: "列表内容列表内容列表内容" },
|
|
9
|
+
{ id: 2, content: "列表内容列表内容列表内容" },
|
|
10
|
+
{ id: 3, content: "列表内容列表内容列表内容" },
|
|
11
|
+
{ id: 4, content: "列表内容列表内容列表内容" },
|
|
12
|
+
{ id: 5, content: "列表内容列表内容列表内容" }
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<List stripe={true} split={false}>
|
|
17
|
+
{listData.map((item) => (
|
|
18
|
+
<ListItem key={item.id}>{item.content}</ListItem>
|
|
19
|
+
))}
|
|
20
|
+
</List>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default StripeList;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { List } from "../index";
|
|
3
|
+
|
|
4
|
+
const { ListItem, ListItemMeta } = List;
|
|
5
|
+
|
|
6
|
+
interface ListItemData {
|
|
7
|
+
content: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const VirtualScrollList = () => {
|
|
11
|
+
const [data, setData] = useState<ListItemData[]>([]);
|
|
12
|
+
const listRef = useRef<any>(null);
|
|
13
|
+
|
|
14
|
+
const handleScrollTo = () => {
|
|
15
|
+
listRef.current?.scrollTo({
|
|
16
|
+
index: 30,
|
|
17
|
+
behavior: "smooth"
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const list: ListItemData[] = [];
|
|
23
|
+
for (let i = 0; i < 3000; i++) {
|
|
24
|
+
list.push({ content: `第${i + 1}个列表内容的描述性文字` });
|
|
25
|
+
}
|
|
26
|
+
setTimeout(() => setData(list), 0);
|
|
27
|
+
}, []);
|
|
28
|
+
|
|
29
|
+
const imageUrl = "https://tdesign.gtimg.com/site/avatar.jpg";
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
33
|
+
<List
|
|
34
|
+
ref={listRef}
|
|
35
|
+
style={{ height: "300px" }}
|
|
36
|
+
scroll={{ type: "virtual", rowHeight: 80, bufferSize: 10, threshold: 10 }}
|
|
37
|
+
>
|
|
38
|
+
{data.map((item, index) => (
|
|
39
|
+
<ListItem key={index}>
|
|
40
|
+
<ListItemMeta image={imageUrl} title="列表标题" description={item.content} />
|
|
41
|
+
</ListItem>
|
|
42
|
+
))}
|
|
43
|
+
</List>
|
|
44
|
+
<div>
|
|
45
|
+
<button onClick={handleScrollTo}>滚动到第 30 项</button>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default VirtualScrollList;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { List } from "../index";
|
|
3
|
+
|
|
4
|
+
const { ListItem, ListItemMeta } = List;
|
|
5
|
+
|
|
6
|
+
const WithImageList = () => {
|
|
7
|
+
const avatarUrl = "https://tdesign.gtimg.com/site/avatar.jpg";
|
|
8
|
+
const listData = [
|
|
9
|
+
{ id: 1, title: "列表主内容", content: "列表内容列表内容列表内容" },
|
|
10
|
+
{ id: 2, title: "列表主内容", content: "列表内容列表内容列表内容" },
|
|
11
|
+
{ id: 3, title: "列表主内容", content: "列表内容列表内容列表内容" },
|
|
12
|
+
{ id: 4, title: "列表主内容", content: "列表内容列表内容列表内容" }
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<List>
|
|
17
|
+
{listData.map((item) => (
|
|
18
|
+
<ListItem key={item.id}>
|
|
19
|
+
<ListItemMeta image={avatarUrl} title={item.title} description={item.content} />
|
|
20
|
+
</ListItem>
|
|
21
|
+
))}
|
|
22
|
+
</List>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default WithImageList;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { Loading, Button } from "@tendaui/react";
|
|
3
|
+
|
|
4
|
+
const DelayLoading = () => {
|
|
5
|
+
const [data, setData] = useState("");
|
|
6
|
+
const [loading, setLoading] = useState(false);
|
|
7
|
+
|
|
8
|
+
const loadData = (time?: number) => {
|
|
9
|
+
setLoading(true);
|
|
10
|
+
setData("");
|
|
11
|
+
const timer = setTimeout(() => {
|
|
12
|
+
setLoading(false);
|
|
13
|
+
setData("数据加载完成,短时间的数据加载并未出现 loading");
|
|
14
|
+
clearTimeout(timer);
|
|
15
|
+
}, time || 100);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
loadData();
|
|
21
|
+
}, 0);
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
26
|
+
<div style={{ color: "#666", fontSize: "12px" }}>
|
|
27
|
+
设置 delay=500ms,当加载时间小于 500ms 时不显示 loading,避免闪烁
|
|
28
|
+
</div>
|
|
29
|
+
<Loading loading={loading} delay={500} size="small" showOverlay>
|
|
30
|
+
<div
|
|
31
|
+
style={{
|
|
32
|
+
padding: "20px",
|
|
33
|
+
background: "#f5f5f5",
|
|
34
|
+
borderRadius: "4px",
|
|
35
|
+
minHeight: "60px"
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
{data || "等待加载..."}
|
|
39
|
+
</div>
|
|
40
|
+
</Loading>
|
|
41
|
+
<div style={{ display: "flex", gap: "8px" }}>
|
|
42
|
+
<Button size="small" onClick={() => loadData()}>
|
|
43
|
+
快速加载(无 loading)
|
|
44
|
+
</Button>
|
|
45
|
+
<Button size="small" onClick={() => loadData(1000)}>
|
|
46
|
+
慢速加载(显示 loading)
|
|
47
|
+
</Button>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default DelayLoading;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Loading, Button } from "@tendaui/react";
|
|
3
|
+
|
|
4
|
+
const FullscreenLoading = () => {
|
|
5
|
+
const [loading, setLoading] = useState(false);
|
|
6
|
+
|
|
7
|
+
const showLoading = () => {
|
|
8
|
+
setLoading(true);
|
|
9
|
+
setTimeout(() => {
|
|
10
|
+
setLoading(false);
|
|
11
|
+
}, 2000);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<Loading loading={loading} fullscreen preventScrollThrough={true} text="全屏加载中..." />
|
|
17
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
18
|
+
<div style={{ color: "#666" }}>点击按钮显示全屏加载,2秒后自动关闭</div>
|
|
19
|
+
<div>
|
|
20
|
+
<Button theme="primary" onClick={showLoading}>
|
|
21
|
+
显示全屏加载
|
|
22
|
+
</Button>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default FullscreenLoading;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Loading } from "@tendaui/react";
|
|
3
|
+
const InheritColorExample = () => (
|
|
4
|
+
<div style={{ display: "flex", gap: "24px" }}>
|
|
5
|
+
<div style={{ color: "var(--td-brand-color)" }}>
|
|
6
|
+
<Loading inheritColor />
|
|
7
|
+
<div style={{ marginTop: "8px", fontSize: "12px" }}>继承品牌色</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div style={{ color: "var(--td-success-color)" }}>
|
|
10
|
+
<Loading inheritColor />
|
|
11
|
+
<div style={{ marginTop: "8px", fontSize: "12px" }}>继承成功色</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div style={{ color: "var(--td-warning-color)" }}>
|
|
14
|
+
<Loading inheritColor />
|
|
15
|
+
<div style={{ marginTop: "8px", fontSize: "12px" }}>继承警告色</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div style={{ color: "var(--td-danger-color)" }}>
|
|
18
|
+
<Loading inheritColor />
|
|
19
|
+
<div style={{ marginTop: "8px", fontSize: "12px" }}>继承错误色</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default InheritColorExample;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Loading, Button } from "@tendaui/react";
|
|
3
|
+
|
|
4
|
+
const NoOverlayExample = () => {
|
|
5
|
+
const [loading, setLoading] = useState(false);
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
9
|
+
<Button onClick={() => setLoading(!loading)}>{loading ? "停止加载" : "开始加载(无遮罩)"}</Button>
|
|
10
|
+
<Loading loading={loading} showOverlay={false} text="加载中..." />
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default NoOverlayExample;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Loading } from "../index";
|
|
3
|
+
|
|
4
|
+
const SizesLoading = () => (
|
|
5
|
+
<div style={{ display: "flex", gap: "32px", alignItems: "center" }}>
|
|
6
|
+
<div style={{ textAlign: "center" }}>
|
|
7
|
+
<Loading size="small" />
|
|
8
|
+
<div style={{ marginTop: "8px", color: "#666", fontSize: "12px" }}>small</div>
|
|
9
|
+
</div>
|
|
10
|
+
<div style={{ textAlign: "center" }}>
|
|
11
|
+
<Loading size="medium" />
|
|
12
|
+
<div style={{ marginTop: "8px", color: "#666", fontSize: "12px" }}>medium</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div style={{ textAlign: "center" }}>
|
|
15
|
+
<Loading size="large" />
|
|
16
|
+
<div style={{ marginTop: "8px", color: "#666", fontSize: "12px" }}>large</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div style={{ textAlign: "center" }}>
|
|
19
|
+
<Loading size="40px" />
|
|
20
|
+
<div style={{ marginTop: "8px", color: "#666", fontSize: "12px" }}>40px</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export default SizesLoading;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Loading } from "../index";
|
|
3
|
+
|
|
4
|
+
const WithTextLoading = () => (
|
|
5
|
+
<div style={{ display: "flex", gap: "32px" }}>
|
|
6
|
+
<Loading text="加载中..." />
|
|
7
|
+
<Loading text="数据处理中..." />
|
|
8
|
+
<Loading text="请稍候..." />
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export default WithTextLoading;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Loading, Switch } from "@tendaui/react";
|
|
3
|
+
|
|
4
|
+
const WrapperLoading = () => {
|
|
5
|
+
const [loading, setLoading] = useState(true);
|
|
6
|
+
return (
|
|
7
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
8
|
+
<div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
|
|
9
|
+
<span>加载状态:</span>
|
|
10
|
+
<Switch value={loading} onChange={(val) => setLoading(val as boolean)} />
|
|
11
|
+
</div>
|
|
12
|
+
<Loading loading={loading} showOverlay>
|
|
13
|
+
<div
|
|
14
|
+
style={{
|
|
15
|
+
padding: "40px",
|
|
16
|
+
background: "#f5f5f5",
|
|
17
|
+
borderRadius: "8px",
|
|
18
|
+
textAlign: "center"
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
<h3>内容区域</h3>
|
|
22
|
+
<p>这是被 Loading 包裹的内容</p>
|
|
23
|
+
<p>当 loading 为 true 时会显示遮罩层和加载指示符</p>
|
|
24
|
+
</div>
|
|
25
|
+
</Loading>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default WrapperLoading;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NotificationProvider, useNotification, Button } from "@tendaui/react";
|
|
3
|
+
|
|
4
|
+
const DefaultDemo = () => {
|
|
5
|
+
const NotificationDemo = () => {
|
|
6
|
+
const { success, error, warning, info } = useNotification();
|
|
7
|
+
return (
|
|
8
|
+
<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
|
|
9
|
+
<Button theme="success" onClick={() => success({ title: "成功提示", message: "操作成功完成!" })}>
|
|
10
|
+
成功通知
|
|
11
|
+
</Button>
|
|
12
|
+
<Button theme="danger" onClick={() => error({ title: "错误提示", message: "操作发生错误!" })}>
|
|
13
|
+
错误通知
|
|
14
|
+
</Button>
|
|
15
|
+
<Button theme="warning" onClick={() => warning({ title: "警告提示", message: "请注意这个警告!" })}>
|
|
16
|
+
警告通知
|
|
17
|
+
</Button>
|
|
18
|
+
<Button theme="primary" onClick={() => info({ title: "信息提示", message: "这是一条信息通知" })}>
|
|
19
|
+
信息通知
|
|
20
|
+
</Button>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
return (
|
|
25
|
+
<NotificationProvider>
|
|
26
|
+
<NotificationDemo />
|
|
27
|
+
</NotificationProvider>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default DefaultDemo;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NotificationProvider, useNotification, Button } from "@tendaui/react";
|
|
3
|
+
|
|
4
|
+
const LongContentDemo = () => {
|
|
5
|
+
const LongContentNotificationDemo = () => {
|
|
6
|
+
const { info, success } = useNotification();
|
|
7
|
+
|
|
8
|
+
const showLongTitle = () => {
|
|
9
|
+
success({
|
|
10
|
+
title: "这是一个非常长的标题,用于测试标题过长时的显示效果和换行情况",
|
|
11
|
+
message: "通知内容"
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const showLongMessage = () => {
|
|
16
|
+
info({
|
|
17
|
+
title: "系统通知",
|
|
18
|
+
message:
|
|
19
|
+
"这是一段非常长的通知内容,用于测试内容过长时的显示效果。Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div style={{ display: "flex", gap: "12px" }}>
|
|
25
|
+
<Button onClick={showLongTitle}>长标题通知</Button>
|
|
26
|
+
<Button onClick={showLongMessage}>长内容通知</Button>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
return (
|
|
31
|
+
<NotificationProvider>
|
|
32
|
+
<LongContentNotificationDemo />
|
|
33
|
+
</NotificationProvider>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default LongContentDemo;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { useRef } from "react";
|
|
2
|
+
import { NotificationProvider, useNotification, Button } from "@tendaui/react";
|
|
3
|
+
|
|
4
|
+
const StackingDemo = () => {
|
|
5
|
+
const StackingNotificationDemo = () => {
|
|
6
|
+
const { success, error, warning, info } = useNotification();
|
|
7
|
+
const index = useRef(1);
|
|
8
|
+
|
|
9
|
+
const showMultiple = () => {
|
|
10
|
+
success({ title: "成功", message: `第 ${index.current++} 条通知` });
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
error({ title: "错误", message: `第 ${index.current++} 条通知` });
|
|
13
|
+
}, 200);
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
warning({ title: "警告", message: `第 ${index.current++} 条通知` });
|
|
16
|
+
}, 400);
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
info({ title: "信息", message: `第 ${index.current++} 条通知` });
|
|
19
|
+
}, 600);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
24
|
+
<div style={{ color: "#666", fontSize: "12px" }}>点击按钮快速显示多条通知,观察堆叠效果</div>
|
|
25
|
+
<div>
|
|
26
|
+
<Button theme="primary" onClick={showMultiple}>
|
|
27
|
+
显示多条通知
|
|
28
|
+
</Button>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
return (
|
|
34
|
+
<NotificationProvider>
|
|
35
|
+
<StackingNotificationDemo />
|
|
36
|
+
</NotificationProvider>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default StackingDemo;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NotificationProvider, useNotification, Button } from "@tendaui/react";
|
|
3
|
+
|
|
4
|
+
const TypesDemo = () => {
|
|
5
|
+
const TypesNotificationDemo = () => {
|
|
6
|
+
const { success, error, warning, info } = useNotification();
|
|
7
|
+
return (
|
|
8
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "24px" }}>
|
|
9
|
+
<div>
|
|
10
|
+
<h4 style={{ marginBottom: "12px", color: "#666" }}>成功通知</h4>
|
|
11
|
+
<Button
|
|
12
|
+
theme="success"
|
|
13
|
+
onClick={() =>
|
|
14
|
+
success({
|
|
15
|
+
title: "操作成功",
|
|
16
|
+
message: "您的数据已成功保存到服务器"
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
>
|
|
20
|
+
显示成功通知
|
|
21
|
+
</Button>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div>
|
|
25
|
+
<h4 style={{ marginBottom: "12px", color: "#666" }}>错误通知</h4>
|
|
26
|
+
<Button
|
|
27
|
+
theme="danger"
|
|
28
|
+
onClick={() =>
|
|
29
|
+
error({
|
|
30
|
+
title: "操作失败",
|
|
31
|
+
message: "网络连接失败,请检查网络设置后重试"
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
>
|
|
35
|
+
显示错误通知
|
|
36
|
+
</Button>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div>
|
|
40
|
+
<h4 style={{ marginBottom: "12px", color: "#666" }}>警告通知</h4>
|
|
41
|
+
<Button
|
|
42
|
+
theme="warning"
|
|
43
|
+
onClick={() =>
|
|
44
|
+
warning({
|
|
45
|
+
title: "警告",
|
|
46
|
+
message: "您的账户余额不足,请及时充值"
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
显示警告通知
|
|
51
|
+
</Button>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div>
|
|
55
|
+
<h4 style={{ marginBottom: "12px", color: "#666" }}>信息通知</h4>
|
|
56
|
+
<Button
|
|
57
|
+
theme="primary"
|
|
58
|
+
onClick={() =>
|
|
59
|
+
info({
|
|
60
|
+
title: "系统通知",
|
|
61
|
+
message: "系统将于今晚 22:00 进行维护升级"
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
>
|
|
65
|
+
显示信息通知
|
|
66
|
+
</Button>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
return (
|
|
72
|
+
<NotificationProvider>
|
|
73
|
+
<TypesNotificationDemo />
|
|
74
|
+
</NotificationProvider>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default TypesDemo;
|