aot-ui 0.1.0 → 0.2.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/README.md +26 -20
- package/dist-lib/aot-ui.css +1 -1
- package/dist-lib/aot-ui.js +30265 -19141
- package/dist-lib/index.d.ts +16 -0
- package/dist-lib/modules/affix/components/Affix.d.ts +3 -6
- package/dist-lib/modules/affix/index.d.ts +1 -1
- package/dist-lib/modules/affix/types.d.ts +21 -5
- package/dist-lib/modules/alert/components/Alert.d.ts +1 -1
- package/dist-lib/modules/alert/index.d.ts +1 -1
- package/dist-lib/modules/alert/types.d.ts +39 -2
- package/dist-lib/modules/anchor/components/Anchor.d.ts +3 -2
- package/dist-lib/modules/anchor/index.d.ts +1 -1
- package/dist-lib/modules/anchor/types.d.ts +26 -4
- package/dist-lib/modules/arc-progress/components/ArcProgress.d.ts +5 -0
- package/dist-lib/modules/arc-progress/constants.d.ts +6 -0
- package/dist-lib/modules/arc-progress/index.d.ts +3 -0
- package/dist-lib/modules/arc-progress/types.d.ts +22 -0
- package/dist-lib/modules/autocomplete/components/Autocomplete.d.ts +2 -2
- package/dist-lib/modules/autocomplete/index.d.ts +1 -1
- package/dist-lib/modules/autocomplete/types.d.ts +103 -13
- package/dist-lib/modules/avatar/components/Avatar.d.ts +1 -1
- package/dist-lib/modules/avatar/components/AvatarGroup.d.ts +2 -0
- package/dist-lib/modules/avatar/context.d.ts +3 -0
- package/dist-lib/modules/avatar/index.d.ts +2 -1
- package/dist-lib/modules/avatar/types.d.ts +74 -3
- package/dist-lib/modules/back-top/components/BackTop.d.ts +1 -1
- package/dist-lib/modules/back-top/types.d.ts +22 -3
- package/dist-lib/modules/badge/components/Badge.d.ts +1 -1
- package/dist-lib/modules/badge/index.d.ts +1 -1
- package/dist-lib/modules/badge/types.d.ts +49 -3
- package/dist-lib/modules/border/components/Border.d.ts +5 -0
- package/dist-lib/modules/border/constants.d.ts +4 -0
- package/dist-lib/modules/border/index.d.ts +3 -0
- package/dist-lib/modules/border/types.d.ts +34 -0
- package/dist-lib/modules/breadcrumb/components/Breadcrumb.d.ts +1 -1
- package/dist-lib/modules/breadcrumb/index.d.ts +1 -1
- package/dist-lib/modules/breadcrumb/types.d.ts +30 -2
- package/dist-lib/modules/button/components/Button.d.ts +1 -1
- package/dist-lib/modules/button/components/ButtonGroup.d.ts +5 -0
- package/dist-lib/modules/button/context.d.ts +3 -0
- package/dist-lib/modules/button/index.d.ts +2 -1
- package/dist-lib/modules/button/types.d.ts +68 -6
- package/dist-lib/modules/button-fill/components/ButtonFill.d.ts +6 -0
- package/dist-lib/modules/button-fill/constants.d.ts +2 -0
- package/dist-lib/modules/button-fill/index.d.ts +3 -0
- package/dist-lib/modules/button-fill/types.d.ts +28 -0
- package/dist-lib/modules/card/components/Card.d.ts +1 -1
- package/dist-lib/modules/card/index.d.ts +1 -1
- package/dist-lib/modules/card/types.d.ts +33 -6
- package/dist-lib/modules/carousel/components/Carousel.d.ts +2 -2
- package/dist-lib/modules/carousel/components/CarouselItem.d.ts +6 -0
- package/dist-lib/modules/carousel/index.d.ts +2 -1
- package/dist-lib/modules/carousel/types.d.ts +100 -4
- package/dist-lib/modules/cascader/components/Cascader.d.ts +2 -2
- package/dist-lib/modules/cascader/components/CascaderPanel.d.ts +6 -0
- package/dist-lib/modules/cascader/index.d.ts +2 -1
- package/dist-lib/modules/cascader/pathUtils.d.ts +14 -2
- package/dist-lib/modules/cascader/types.d.ts +186 -17
- package/dist-lib/modules/collapse/components/Collapse.d.ts +2 -2
- package/dist-lib/modules/collapse/components/CollapseItem.d.ts +6 -0
- package/dist-lib/modules/collapse/index.d.ts +2 -1
- package/dist-lib/modules/collapse/types.d.ts +57 -7
- package/dist-lib/modules/color/components/Color.d.ts +5 -0
- package/dist-lib/modules/color/index.d.ts +3 -0
- package/dist-lib/modules/color/palette.d.ts +48 -0
- package/dist-lib/modules/color/types.d.ts +49 -0
- package/dist-lib/modules/color-picker/colorUtils.d.ts +35 -0
- package/dist-lib/modules/color-picker/components/ColorPicker.d.ts +2 -2
- package/dist-lib/modules/color-picker/components/ColorPickerPanel.d.ts +2 -0
- package/dist-lib/modules/color-picker/index.d.ts +2 -1
- package/dist-lib/modules/color-picker/types.d.ts +82 -3
- package/dist-lib/modules/config-provider/components/ConfigProvider.d.ts +11 -2
- package/dist-lib/modules/config-provider/index.d.ts +3 -2
- package/dist-lib/modules/config-provider/locale/enUS.d.ts +2 -0
- package/dist-lib/modules/config-provider/types.d.ts +93 -5
- package/dist-lib/modules/date-picker/components/DatePicker.d.ts +2 -2
- package/dist-lib/modules/date-picker/components/DatePickerPanel.d.ts +2 -0
- package/dist-lib/modules/date-picker/index.d.ts +2 -1
- package/dist-lib/modules/date-picker/types.d.ts +89 -14
- package/dist-lib/modules/date-picker/utils.d.ts +17 -0
- package/dist-lib/modules/datetime-picker/components/DateTimePicker.d.ts +2 -2
- package/dist-lib/modules/datetime-picker/index.d.ts +1 -1
- package/dist-lib/modules/datetime-picker/types.d.ts +81 -7
- package/dist-lib/modules/datetime-picker/utils.d.ts +5 -1
- package/dist-lib/modules/descriptions/components/Descriptions.d.ts +4 -1
- package/dist-lib/modules/descriptions/components/DescriptionsItem.d.ts +6 -0
- package/dist-lib/modules/descriptions/index.d.ts +2 -1
- package/dist-lib/modules/descriptions/types.d.ts +61 -8
- package/dist-lib/modules/divider/components/Divider.d.ts +1 -1
- package/dist-lib/modules/divider/index.d.ts +1 -1
- package/dist-lib/modules/divider/types.d.ts +7 -1
- package/dist-lib/modules/download/components/Download.d.ts +2 -0
- package/dist-lib/modules/download/constants.d.ts +20 -0
- package/dist-lib/modules/download/index.d.ts +3 -0
- package/dist-lib/modules/download/resumeStorage.d.ts +12 -0
- package/dist-lib/modules/download/types.d.ts +67 -0
- package/dist-lib/modules/drawer/components/Drawer.d.ts +1 -3
- package/dist-lib/modules/drawer/index.d.ts +1 -1
- package/dist-lib/modules/drawer/types.d.ts +55 -4
- package/dist-lib/modules/dropdown/components/Dropdown.d.ts +3 -2
- package/dist-lib/modules/dropdown/index.d.ts +1 -1
- package/dist-lib/modules/dropdown/types.d.ts +49 -3
- package/dist-lib/modules/fluid-progress/components/FluidProgress.d.ts +5 -0
- package/dist-lib/modules/fluid-progress/constants.d.ts +3 -0
- package/dist-lib/modules/fluid-progress/index.d.ts +3 -0
- package/dist-lib/modules/fluid-progress/types.d.ts +25 -0
- package/dist-lib/modules/form/components/Form.d.ts +2 -2
- package/dist-lib/modules/form/index.d.ts +2 -2
- package/dist-lib/modules/form/types.d.ts +111 -6
- package/dist-lib/modules/form/useForm.d.ts +18 -2
- package/dist-lib/modules/fox-progress/components/FoxProgress.d.ts +5 -0
- package/dist-lib/modules/fox-progress/constants.d.ts +1 -0
- package/dist-lib/modules/fox-progress/index.d.ts +3 -0
- package/dist-lib/modules/fox-progress/types.d.ts +19 -0
- package/dist-lib/modules/image/components/Image.d.ts +2 -2
- package/dist-lib/modules/image/components/ImageLightbox.d.ts +4 -10
- package/dist-lib/modules/image/components/ImagePreviewGroup.d.ts +1 -1
- package/dist-lib/modules/image/index.d.ts +2 -2
- package/dist-lib/modules/image/types.d.ts +145 -22
- package/dist-lib/modules/input/components/Input.d.ts +2 -2
- package/dist-lib/modules/input/index.d.ts +1 -1
- package/dist-lib/modules/input/types.d.ts +70 -5
- package/dist-lib/modules/input-number/components/InputNumber.d.ts +2 -2
- package/dist-lib/modules/input-number/index.d.ts +1 -1
- package/dist-lib/modules/input-number/types.d.ts +74 -5
- package/dist-lib/modules/input-otp/components/InputOtp.d.ts +2 -0
- package/dist-lib/modules/input-otp/index.d.ts +2 -0
- package/dist-lib/modules/input-otp/types.d.ts +67 -0
- package/dist-lib/modules/input-tag/components/InputTag.d.ts +2 -0
- package/dist-lib/modules/input-tag/index.d.ts +2 -0
- package/dist-lib/modules/input-tag/types.d.ts +114 -0
- package/dist-lib/modules/layout/components/Layout.d.ts +20 -5
- package/dist-lib/modules/layout/components/Row.d.ts +867 -2
- package/dist-lib/modules/layout/index.d.ts +1 -1
- package/dist-lib/modules/layout/types.d.ts +86 -5
- package/dist-lib/modules/link/components/Link.d.ts +1 -1
- package/dist-lib/modules/link/index.d.ts +1 -1
- package/dist-lib/modules/link/types.d.ts +44 -2
- package/dist-lib/modules/liquid-progress/components/LiquidProgress.d.ts +5 -0
- package/dist-lib/modules/liquid-progress/constants.d.ts +2 -0
- package/dist-lib/modules/liquid-progress/index.d.ts +3 -0
- package/dist-lib/modules/liquid-progress/types.d.ts +22 -0
- package/dist-lib/modules/mention/components/Mention.d.ts +2 -2
- package/dist-lib/modules/mention/index.d.ts +1 -1
- package/dist-lib/modules/mention/types.d.ts +105 -5
- package/dist-lib/modules/menu/components/Menu.d.ts +1 -1
- package/dist-lib/modules/menu/types.d.ts +31 -0
- package/dist-lib/modules/message-box/components/MessageBoxView.d.ts +1 -1
- package/dist-lib/modules/message-box/index.d.ts +1 -1
- package/dist-lib/modules/message-box/types.d.ts +40 -2
- package/dist-lib/modules/modal/components/Modal.d.ts +2 -2
- package/dist-lib/modules/modal/index.d.ts +1 -1
- package/dist-lib/modules/modal/types.d.ts +61 -1
- package/dist-lib/modules/notification/components/NotificationProvider.d.ts +1 -1
- package/dist-lib/modules/notification/index.d.ts +1 -1
- package/dist-lib/modules/notification/types.d.ts +31 -1
- package/dist-lib/modules/pagination/components/Pagination.d.ts +4 -1
- package/dist-lib/modules/pagination/index.d.ts +1 -1
- package/dist-lib/modules/pagination/math.d.ts +2 -3
- package/dist-lib/modules/pagination/types.d.ts +76 -16
- package/dist-lib/modules/panel-morph/constants.d.ts +2 -1
- package/dist-lib/modules/photo-upload/components/PhotoUpload.d.ts +1 -1
- package/dist-lib/modules/photo-upload/constants.d.ts +4 -0
- package/dist-lib/modules/photo-upload/index.d.ts +1 -0
- package/dist-lib/modules/photo-upload/types.d.ts +14 -0
- package/dist-lib/modules/popconfirm/components/Popconfirm.d.ts +1 -1
- package/dist-lib/modules/popconfirm/types.d.ts +9 -2
- package/dist-lib/modules/popover/components/Popover.d.ts +1 -1
- package/dist-lib/modules/popover/types.d.ts +12 -2
- package/dist-lib/modules/progress/components/Progress.d.ts +4 -1
- package/dist-lib/modules/progress/index.d.ts +1 -1
- package/dist-lib/modules/progress/types.d.ts +82 -9
- package/dist-lib/modules/radio/components/Radio.d.ts +2 -0
- package/dist-lib/modules/radio/components/RadioButton.d.ts +5 -0
- package/dist-lib/modules/radio/components/RadioGroup.d.ts +1 -1
- package/dist-lib/modules/radio/context.d.ts +3 -0
- package/dist-lib/modules/radio/index.d.ts +3 -1
- package/dist-lib/modules/radio/types.d.ts +100 -5
- package/dist-lib/modules/range-picker/components/RangePicker.d.ts +1 -1
- package/dist-lib/modules/range-picker/index.d.ts +1 -1
- package/dist-lib/modules/range-picker/types.d.ts +29 -2
- package/dist-lib/modules/rate/components/Rate.d.ts +2 -2
- package/dist-lib/modules/rate/index.d.ts +1 -1
- package/dist-lib/modules/rate/types.d.ts +100 -1
- package/dist-lib/modules/result/components/Result.d.ts +4 -1
- package/dist-lib/modules/result/index.d.ts +1 -1
- package/dist-lib/modules/result/types.d.ts +15 -2
- package/dist-lib/modules/scrollbar/components/Scrollbar.d.ts +2 -2
- package/dist-lib/modules/scrollbar/index.d.ts +1 -1
- package/dist-lib/modules/scrollbar/types.d.ts +86 -1
- package/dist-lib/modules/search/components/Search.d.ts +2 -0
- package/dist-lib/modules/search/index.d.ts +2 -0
- package/dist-lib/modules/search/types.d.ts +20 -0
- package/dist-lib/modules/segmented/components/Segmented.d.ts +2 -1
- package/dist-lib/modules/segmented/index.d.ts +1 -1
- package/dist-lib/modules/segmented/types.d.ts +31 -8
- package/dist-lib/modules/select/components/Select.d.ts +2 -2
- package/dist-lib/modules/select/index.d.ts +1 -1
- package/dist-lib/modules/select/types.d.ts +112 -16
- package/dist-lib/modules/skeleton/components/Skeleton.d.ts +4 -1
- package/dist-lib/modules/skeleton/components/SkeletonItem.d.ts +5 -0
- package/dist-lib/modules/skeleton/index.d.ts +2 -1
- package/dist-lib/modules/skeleton/types.d.ts +55 -3
- package/dist-lib/modules/slider/components/Slider.d.ts +2 -0
- package/dist-lib/modules/slider/index.d.ts +3 -2
- package/dist-lib/modules/slider/types.d.ts +102 -0
- package/dist-lib/modules/space/components/Space.d.ts +1 -1
- package/dist-lib/modules/space/index.d.ts +1 -1
- package/dist-lib/modules/space/types.d.ts +47 -4
- package/dist-lib/modules/spin/components/Spin.d.ts +1 -1
- package/dist-lib/modules/spin/components/loadingService.d.ts +44 -0
- package/dist-lib/modules/spin/index.d.ts +2 -0
- package/dist-lib/modules/spin/types.d.ts +26 -1
- package/dist-lib/modules/splash-intro/components/AppSplash.d.ts +25 -0
- package/dist-lib/modules/splash-intro/components/SplashIntro.d.ts +38 -0
- package/dist-lib/modules/splash-intro/components/SplashLogo.d.ts +2 -0
- package/dist-lib/modules/splash-intro/components/SplashStagger.d.ts +14 -0
- package/dist-lib/modules/splash-intro/constants.d.ts +8 -0
- package/dist-lib/modules/splash-intro/context.d.ts +13 -0
- package/dist-lib/modules/splash-intro/index.d.ts +10 -0
- package/dist-lib/modules/splash-intro/types.d.ts +4 -0
- package/dist-lib/modules/splitter/components/Splitter.d.ts +7 -1
- package/dist-lib/modules/splitter/index.d.ts +1 -1
- package/dist-lib/modules/splitter/types.d.ts +75 -9
- package/dist-lib/modules/statistic/components/Countdown.d.ts +3 -0
- package/dist-lib/modules/statistic/components/Statistic.d.ts +3 -2
- package/dist-lib/modules/statistic/index.d.ts +2 -1
- package/dist-lib/modules/statistic/types.d.ts +28 -3
- package/dist-lib/modules/steps/components/Steps.d.ts +1 -1
- package/dist-lib/modules/steps/types.d.ts +17 -0
- package/dist-lib/modules/storybook-welcome/components/StorybookWelcome.d.ts +1 -1
- package/dist-lib/modules/storybook-welcome/types.d.ts +22 -2
- package/dist-lib/modules/switch/components/Switch.d.ts +2 -2
- package/dist-lib/modules/switch/index.d.ts +1 -1
- package/dist-lib/modules/switch/types.d.ts +100 -3
- package/dist-lib/modules/table/components/Table.d.ts +6 -2
- package/dist-lib/modules/table/index.d.ts +1 -1
- package/dist-lib/modules/table/types.d.ts +129 -22
- package/dist-lib/modules/table-v2/components/AutoResizer.d.ts +3 -0
- package/dist-lib/modules/table-v2/components/TableV2.d.ts +6 -0
- package/dist-lib/modules/table-v2/index.d.ts +3 -0
- package/dist-lib/modules/table-v2/types.d.ts +161 -0
- package/dist-lib/modules/tabs/components/Tabs.d.ts +1 -1
- package/dist-lib/modules/tabs/types.d.ts +18 -2
- package/dist-lib/modules/tag/components/CheckTag.d.ts +3 -0
- package/dist-lib/modules/tag/components/Tag.d.ts +2 -1
- package/dist-lib/modules/tag/index.d.ts +2 -1
- package/dist-lib/modules/tag/types.d.ts +32 -3
- package/dist-lib/modules/text/components/Text.d.ts +2 -0
- package/dist-lib/modules/text/index.d.ts +2 -0
- package/dist-lib/modules/text/types.d.ts +37 -0
- package/dist-lib/modules/thread-expand/components/ThreadExpand.d.ts +1 -1
- package/dist-lib/modules/thread-expand/constants.d.ts +28 -0
- package/dist-lib/modules/thread-expand/index.d.ts +1 -1
- package/dist-lib/modules/thread-expand/types.d.ts +14 -0
- package/dist-lib/modules/timeline/components/Timeline.d.ts +2 -1
- package/dist-lib/modules/timeline/index.d.ts +1 -1
- package/dist-lib/modules/timeline/types.d.ts +35 -1
- package/dist-lib/modules/toast/components/ToastProvider.d.ts +1 -1
- package/dist-lib/modules/toast/index.d.ts +1 -1
- package/dist-lib/modules/toast/types.d.ts +39 -1
- package/dist-lib/modules/tooltip/components/Tooltip.d.ts +1 -1
- package/dist-lib/modules/tooltip/index.d.ts +1 -1
- package/dist-lib/modules/tooltip/types.d.ts +15 -3
- package/dist-lib/modules/tour/components/Tour.d.ts +2 -1
- package/dist-lib/modules/tour/index.d.ts +1 -1
- package/dist-lib/modules/tour/types.d.ts +60 -6
- package/dist-lib/modules/transfer/components/Transfer.d.ts +2 -2
- package/dist-lib/modules/transfer/components/TransferVirtualBody.d.ts +10 -0
- package/dist-lib/modules/transfer/index.d.ts +1 -1
- package/dist-lib/modules/transfer/types.d.ts +111 -18
- package/dist-lib/modules/transition/components/CollapseTransition.d.ts +5 -0
- package/dist-lib/modules/transition/components/Transition.d.ts +6 -0
- package/dist-lib/modules/transition/constants.d.ts +9 -0
- package/dist-lib/modules/transition/index.d.ts +5 -0
- package/dist-lib/modules/transition/types.d.ts +59 -0
- package/dist-lib/modules/tree/checkUtils.d.ts +3 -0
- package/dist-lib/modules/tree/components/Tree.d.ts +3 -2
- package/dist-lib/modules/tree/dragUtils.d.ts +5 -2
- package/dist-lib/modules/tree/index.d.ts +1 -1
- package/dist-lib/modules/tree/types.d.ts +93 -51
- package/dist-lib/modules/tree-select/components/TreeSelect.d.ts +2 -2
- package/dist-lib/modules/tree-select/index.d.ts +1 -1
- package/dist-lib/modules/tree-select/types.d.ts +85 -13
- package/dist-lib/modules/tree-select/utils.d.ts +14 -3
- package/dist-lib/modules/tree-v2/components/TreeV2.d.ts +3 -0
- package/dist-lib/modules/tree-v2/index.d.ts +2 -0
- package/dist-lib/modules/tree-v2/types.d.ts +97 -0
- package/dist-lib/modules/tree-v2/utils.d.ts +24 -0
- package/dist-lib/modules/typography/components/Typography.d.ts +9 -4
- package/dist-lib/modules/typography/constants.d.ts +27 -0
- package/dist-lib/modules/typography/index.d.ts +2 -1
- package/dist-lib/modules/typography/types.d.ts +14 -0
- package/dist-lib/modules/upload/ajaxUpload.d.ts +2 -0
- package/dist-lib/modules/upload/chunkUpload.d.ts +6 -0
- package/dist-lib/modules/upload/components/Upload.d.ts +2 -2
- package/dist-lib/modules/upload/index.d.ts +2 -1
- package/dist-lib/modules/upload/resumeStorage.d.ts +16 -0
- package/dist-lib/modules/upload/types.d.ts +160 -24
- package/package.json +80 -73
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Layout } from './components/Layout';
|
|
2
2
|
export { Row, Col } from './components/Row';
|
|
3
|
-
export type { ColProps, LayoutAsideProps, LayoutProps, LayoutSectionProps, RowProps, } from './types';
|
|
3
|
+
export type { ColProps, ColSize, LayoutAsideProps, LayoutFooterProps, LayoutHeaderProps, LayoutProps, LayoutSectionProps, RowAlign, RowJustify, RowProps, } from './types';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
export type LayoutProps = {
|
|
3
3
|
children?: ReactNode;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* 子元素排列方向。
|
|
6
|
+
* 不传时:含 Header / Footer 则为 vertical,否则 horizontal(对齐 Element Container)。
|
|
7
|
+
*/
|
|
5
8
|
direction?: "vertical" | "horizontal";
|
|
6
9
|
className?: string;
|
|
7
10
|
style?: CSSProperties;
|
|
@@ -11,25 +14,103 @@ export type LayoutSectionProps = {
|
|
|
11
14
|
className?: string;
|
|
12
15
|
style?: CSSProperties;
|
|
13
16
|
};
|
|
17
|
+
export type LayoutHeaderProps = LayoutSectionProps & {
|
|
18
|
+
/**
|
|
19
|
+
* 顶栏高度
|
|
20
|
+
* @default "60px"
|
|
21
|
+
*/
|
|
22
|
+
height?: number | string;
|
|
23
|
+
};
|
|
24
|
+
export type LayoutFooterProps = LayoutSectionProps & {
|
|
25
|
+
/**
|
|
26
|
+
* 底栏高度
|
|
27
|
+
* @default "60px"
|
|
28
|
+
*/
|
|
29
|
+
height?: number | string;
|
|
30
|
+
};
|
|
14
31
|
export type LayoutAsideProps = LayoutSectionProps & {
|
|
32
|
+
/**
|
|
33
|
+
* 侧栏宽度
|
|
34
|
+
* @default 300
|
|
35
|
+
*/
|
|
15
36
|
width?: number | string;
|
|
37
|
+
/**
|
|
38
|
+
* 是否可折叠(展示折叠控件时由业务配合 collapsed 使用)
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
16
41
|
collapsible?: boolean;
|
|
42
|
+
/** 是否折叠(受控) */
|
|
17
43
|
collapsed?: boolean;
|
|
18
|
-
|
|
44
|
+
/**
|
|
45
|
+
* 折叠后宽度
|
|
46
|
+
* @default 64
|
|
47
|
+
*/
|
|
48
|
+
collapsedWidth?: number | string;
|
|
49
|
+
/** 折叠状态变化 */
|
|
19
50
|
onCollapse?: (collapsed: boolean) => void;
|
|
20
51
|
};
|
|
52
|
+
export type RowJustify = "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly";
|
|
53
|
+
/** 垂直对齐:兼容 Element top/middle/bottom 与 flex 命名 */
|
|
54
|
+
export type RowAlign = "top" | "middle" | "bottom" | "start" | "center" | "end" | "stretch";
|
|
21
55
|
export type RowProps = {
|
|
22
56
|
children?: ReactNode;
|
|
57
|
+
/** 栅格间隔;可为 [水平, 垂直] */
|
|
23
58
|
gutter?: number | [number, number];
|
|
24
|
-
|
|
25
|
-
|
|
59
|
+
/**
|
|
60
|
+
* flex 垂直对齐
|
|
61
|
+
* @default "top"
|
|
62
|
+
*/
|
|
63
|
+
align?: RowAlign;
|
|
64
|
+
/**
|
|
65
|
+
* flex 水平排列
|
|
66
|
+
* @default "start"
|
|
67
|
+
*/
|
|
68
|
+
justify?: RowJustify;
|
|
69
|
+
/**
|
|
70
|
+
* 是否自动换行
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
26
73
|
wrap?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* 自定义元素标签
|
|
76
|
+
* @default "div"
|
|
77
|
+
*/
|
|
78
|
+
tag?: keyof HTMLElementTagNameMap;
|
|
27
79
|
className?: string;
|
|
80
|
+
style?: CSSProperties;
|
|
81
|
+
};
|
|
82
|
+
/** 响应式断点下的栅格配置(数字等同 span) */
|
|
83
|
+
export type ColSize = number | {
|
|
84
|
+
span?: number;
|
|
85
|
+
offset?: number;
|
|
86
|
+
push?: number;
|
|
87
|
+
pull?: number;
|
|
28
88
|
};
|
|
29
89
|
export type ColProps = {
|
|
30
90
|
children?: ReactNode;
|
|
31
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* 栅格占据列数(0–24;0 时隐藏)
|
|
93
|
+
* @default 24
|
|
94
|
+
*/
|
|
32
95
|
span?: number;
|
|
96
|
+
/** 左侧间隔格数 */
|
|
33
97
|
offset?: number;
|
|
98
|
+
/** 向右移动格数 */
|
|
99
|
+
push?: number;
|
|
100
|
+
/** 向左移动格数 */
|
|
101
|
+
pull?: number;
|
|
102
|
+
/** <768px */
|
|
103
|
+
xs?: ColSize;
|
|
104
|
+
/** ≥768px */
|
|
105
|
+
sm?: ColSize;
|
|
106
|
+
/** ≥992px */
|
|
107
|
+
md?: ColSize;
|
|
108
|
+
/** ≥1200px */
|
|
109
|
+
lg?: ColSize;
|
|
110
|
+
/** ≥1920px */
|
|
111
|
+
xl?: ColSize;
|
|
112
|
+
/** 自定义元素标签 */
|
|
113
|
+
tag?: keyof HTMLElementTagNameMap;
|
|
34
114
|
className?: string;
|
|
115
|
+
style?: CSSProperties;
|
|
35
116
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { LinkProps } from '../types';
|
|
2
|
-
export declare function Link({ children, href, tone, disabled, underline, className, onClick, }: LinkProps): import('react').JSX.Element;
|
|
2
|
+
export declare function Link({ children, href, type, tone, disabled, underline, target, icon, iconPosition, className, "aria-label": ariaLabel, onClick, }: LinkProps): import('react').JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Link } from './components/Link';
|
|
2
|
-
export type { LinkProps, LinkTone } from './types';
|
|
2
|
+
export type { LinkProps, LinkType, LinkTone, LinkUnderline, LinkTarget, LinkIconPosition, } from './types';
|
|
@@ -1,11 +1,53 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
/** 对齐 Element Plus Link type */
|
|
3
|
+
export type LinkType = "default" | "primary" | "success" | "warning" | "danger" | "info";
|
|
4
|
+
/** @deprecated 请优先使用 type;neutral 等价于 default */
|
|
5
|
+
export type LinkTone = LinkType | "neutral";
|
|
6
|
+
export type LinkUnderline = boolean | "always" | "hover" | "never";
|
|
7
|
+
export type LinkIconPosition = "start" | "end";
|
|
8
|
+
export type LinkTarget = "_self" | "_blank" | "_parent" | "_top" | string;
|
|
3
9
|
export type LinkProps = {
|
|
4
10
|
children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* 原生 href。会直接写到 <a> 上,请自行校验 / 净化,避免 javascript: 等危险协议。
|
|
13
|
+
*/
|
|
5
14
|
href?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 类型(对齐 Element type)
|
|
17
|
+
* @default "default"
|
|
18
|
+
*/
|
|
19
|
+
type?: LinkType;
|
|
20
|
+
/**
|
|
21
|
+
* 主题色调;与 type 二选一,type 优先。neutral 映射为 default。
|
|
22
|
+
* @deprecated 优先使用 type
|
|
23
|
+
*/
|
|
6
24
|
tone?: LinkTone;
|
|
25
|
+
/**
|
|
26
|
+
* 是否禁用
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
7
29
|
disabled?: boolean;
|
|
8
|
-
|
|
30
|
+
/**
|
|
31
|
+
* 下划线:always / hover / never;布尔 true→always、false→never(兼容旧用法)
|
|
32
|
+
* @default "hover"
|
|
33
|
+
*/
|
|
34
|
+
underline?: LinkUnderline;
|
|
35
|
+
/**
|
|
36
|
+
* 同原生 target
|
|
37
|
+
* @default "_self"
|
|
38
|
+
*/
|
|
39
|
+
target?: LinkTarget;
|
|
40
|
+
/**
|
|
41
|
+
* 图标节点;默认在文案左侧
|
|
42
|
+
*/
|
|
43
|
+
icon?: ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* 图标位置
|
|
46
|
+
* @default "start"
|
|
47
|
+
*/
|
|
48
|
+
iconPosition?: LinkIconPosition;
|
|
9
49
|
className?: string;
|
|
50
|
+
/** 无障碍名称(图标单独使用时建议传入) */
|
|
51
|
+
"aria-label"?: string;
|
|
10
52
|
onClick?: () => void;
|
|
11
53
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LiquidProgressProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Liquid tank: water level rises with percent; dual SVG waves drift on the surface.
|
|
4
|
+
*/
|
|
5
|
+
export declare function LiquidProgress({ className, percent: percentProp, defaultPercent, size, color, status, showInfo, label, onChange, }: LiquidProgressProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type LiquidProgressStatus = "normal" | "paused" | "exception";
|
|
2
|
+
export type LiquidProgressProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** 0–100 */
|
|
5
|
+
percent?: number;
|
|
6
|
+
/** 非受控初始值 */
|
|
7
|
+
defaultPercent?: number;
|
|
8
|
+
/** 容器尺寸(px) */
|
|
9
|
+
size?: number;
|
|
10
|
+
/** 水面主色(paused / exception 时会被覆盖) */
|
|
11
|
+
color?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 状态:paused 冻结波浪;exception 失败红液面
|
|
14
|
+
* @default normal
|
|
15
|
+
*/
|
|
16
|
+
status?: LiquidProgressStatus;
|
|
17
|
+
/** 是否显示百分比 */
|
|
18
|
+
showInfo?: boolean;
|
|
19
|
+
/** 标签 */
|
|
20
|
+
label?: string;
|
|
21
|
+
onChange?: (percent: number) => void;
|
|
22
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MentionProps } from '../types';
|
|
2
|
-
export declare
|
|
1
|
+
import { MentionHandle, MentionProps } from '../types';
|
|
2
|
+
export declare const Mention: import('react').ForwardRefExoticComponent<MentionProps & import('react').RefAttributes<MentionHandle>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Mention } from './components/Mention';
|
|
2
|
-
export type { MentionOption, MentionProps } from './types';
|
|
2
|
+
export type { MentionHandle, MentionLabelContext, MentionOption, MentionOptionProps, MentionPlacement, MentionProps, } from './types';
|
|
@@ -1,17 +1,117 @@
|
|
|
1
|
+
import { CSSProperties, FocusEvent, ReactNode } from 'react';
|
|
2
|
+
export type MentionPlacement = "top" | "bottom";
|
|
3
|
+
/** options 字段别名,对齐 Element props */
|
|
4
|
+
export type MentionOptionProps = {
|
|
5
|
+
value?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
disabled?: string;
|
|
8
|
+
};
|
|
1
9
|
export type MentionOption = {
|
|
2
10
|
value: string;
|
|
3
11
|
label: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
export type MentionLabelContext = {
|
|
16
|
+
item: MentionOption;
|
|
17
|
+
prefix: string;
|
|
18
|
+
index: number;
|
|
19
|
+
};
|
|
20
|
+
export type MentionHandle = {
|
|
21
|
+
focus: () => void;
|
|
22
|
+
blur: () => void;
|
|
23
|
+
/** 底层 input / textarea */
|
|
24
|
+
input: HTMLInputElement | HTMLTextAreaElement | null;
|
|
25
|
+
dropdownVisible: boolean;
|
|
4
26
|
};
|
|
5
27
|
export type MentionProps = {
|
|
6
28
|
value?: string;
|
|
7
29
|
defaultValue?: string;
|
|
8
|
-
|
|
30
|
+
/**
|
|
31
|
+
* 提及选项列表
|
|
32
|
+
* @default []
|
|
33
|
+
*/
|
|
34
|
+
options?: MentionOption[] | Record<string, unknown>[];
|
|
35
|
+
/**
|
|
36
|
+
* options 字段别名
|
|
37
|
+
* @default { value: "value", label: "label", disabled: "disabled" }
|
|
38
|
+
*/
|
|
39
|
+
optionProps?: MentionOptionProps;
|
|
40
|
+
/**
|
|
41
|
+
* 触发前缀;单字符,或多个单字符
|
|
42
|
+
* @default "@"
|
|
43
|
+
*/
|
|
44
|
+
prefix?: string | string[];
|
|
45
|
+
/**
|
|
46
|
+
* 用于拆分提及的字符(单字符)
|
|
47
|
+
* @default " "
|
|
48
|
+
*/
|
|
49
|
+
split?: string;
|
|
50
|
+
/**
|
|
51
|
+
* 定制筛选;false 时不过滤(全部展示,由外部处理)
|
|
52
|
+
*/
|
|
53
|
+
filterOption?: false | ((pattern: string, option: MentionOption) => boolean);
|
|
54
|
+
/**
|
|
55
|
+
* 弹出位置
|
|
56
|
+
* @default "bottom"
|
|
57
|
+
*/
|
|
58
|
+
placement?: MentionPlacement;
|
|
59
|
+
/**
|
|
60
|
+
* 下拉是否显示箭头
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
showArrow?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* 下拉面板偏移
|
|
66
|
+
* @default 6
|
|
67
|
+
*/
|
|
68
|
+
offset?: number;
|
|
69
|
+
/**
|
|
70
|
+
* 退格时是否整体删除提及
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
whole?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* 自定义整体删除判定;(pattern, text) => boolean
|
|
76
|
+
*/
|
|
77
|
+
checkIsWhole?: (pattern: string, text: string) => boolean;
|
|
78
|
+
/**
|
|
79
|
+
* 下拉加载中
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
loading?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* 输入类型
|
|
85
|
+
* @default "text"
|
|
86
|
+
*/
|
|
87
|
+
type?: "text" | "textarea";
|
|
9
88
|
placeholder?: string;
|
|
10
|
-
prefix?: string;
|
|
11
89
|
disabled?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* FormItem 错误态透传
|
|
92
|
+
*/
|
|
93
|
+
error?: string;
|
|
94
|
+
hideErrorText?: boolean;
|
|
95
|
+
rows?: number;
|
|
12
96
|
className?: string;
|
|
97
|
+
/** 自定义浮层类名(对齐 Element popper-class) */
|
|
98
|
+
popupClassName?: string;
|
|
99
|
+
/** 自定义浮层样式(对齐 Element popper-style) */
|
|
100
|
+
popupStyle?: CSSProperties;
|
|
101
|
+
/** 自定义选项标签 */
|
|
102
|
+
labelRender?: (ctx: MentionLabelContext) => ReactNode;
|
|
103
|
+
/** 自定义 loading 内容 */
|
|
104
|
+
loadingSlot?: ReactNode;
|
|
105
|
+
/** 下拉顶部 */
|
|
106
|
+
header?: ReactNode;
|
|
107
|
+
/** 下拉底部 */
|
|
108
|
+
footer?: ReactNode;
|
|
13
109
|
onChange?: (value: string) => void;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
110
|
+
/** 按下触发字段后查询变化 */
|
|
111
|
+
onSearch?: (pattern: string, prefix: string) => void;
|
|
112
|
+
onSelect?: (option: MentionOption, prefix: string) => void;
|
|
113
|
+
/** whole 删除成功时触发 */
|
|
114
|
+
onWholeRemove?: (pattern: string) => void;
|
|
115
|
+
onFocus?: (e: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
116
|
+
onBlur?: (e: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
17
117
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MenuProps } from '../types';
|
|
2
|
-
export declare function Menu({ items, mode, selectedKeys: selectedKeysProp, defaultSelectedKeys, openKeys: openKeysProp, defaultOpenKeys, collapse, className, onSelect, onOpenChange, }: MenuProps): import('react').JSX.Element;
|
|
2
|
+
export declare function Menu({ items, mode, selectedKeys: selectedKeysProp, defaultSelectedKeys, openKeys: openKeysProp, defaultOpenKeys, collapse, uniqueOpened, ellipsis, ellipsisIcon, router, className, onSelect, onOpenChange, }: MenuProps): import('react').JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { To } from 'react-router-dom';
|
|
2
3
|
export type MenuItem = {
|
|
3
4
|
key: string;
|
|
4
5
|
label: ReactNode;
|
|
@@ -6,6 +7,18 @@ export type MenuItem = {
|
|
|
6
7
|
icon?: ReactNode;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
children?: MenuItem[];
|
|
10
|
+
/**
|
|
11
|
+
* 分组标题项:渲染为 MenuItemGroup,children 为组内项
|
|
12
|
+
* @default item
|
|
13
|
+
*/
|
|
14
|
+
type?: "item" | "group";
|
|
15
|
+
/**
|
|
16
|
+
* 路由地址;router 模式下优先于 key 作为 navigate 目标
|
|
17
|
+
* (同 Element Menu-Item 的 route / vue-router to)
|
|
18
|
+
*/
|
|
19
|
+
route?: To;
|
|
20
|
+
/** 路由跳转时是否 replace(不留历史) */
|
|
21
|
+
replace?: boolean;
|
|
9
22
|
};
|
|
10
23
|
export type MenuProps = {
|
|
11
24
|
items: MenuItem[];
|
|
@@ -19,6 +32,24 @@ export type MenuProps = {
|
|
|
19
32
|
* @default false
|
|
20
33
|
*/
|
|
21
34
|
collapse?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 是否只保持一个子菜单展开(vertical)
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
uniqueOpened?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 水平模式是否省略放不下的项到「更多」
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
ellipsis?: boolean;
|
|
45
|
+
/** 自定义省略入口图标 / 文案 */
|
|
46
|
+
ellipsisIcon?: ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* 启用 react-router 模式:选中项用 route ?? key 作为 path 导航;
|
|
49
|
+
* 需包裹在 Router 内。未受控时会按 location 同步选中项。
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
router?: boolean;
|
|
22
53
|
className?: string;
|
|
23
54
|
onSelect?: (key: string) => void;
|
|
24
55
|
onOpenChange?: (keys: string[]) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MessageBoxOptions, MessageBoxResult } from '../types';
|
|
2
2
|
type MessageBoxViewProps = {
|
|
3
3
|
options: MessageBoxOptions;
|
|
4
|
-
onResolve: (result: MessageBoxResult) => void;
|
|
4
|
+
onResolve: (result: MessageBoxResult, value?: string) => void;
|
|
5
5
|
};
|
|
6
6
|
export declare function MessageBoxView({ options, onResolve }: MessageBoxViewProps): import('react').JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { MessageBox } from './components/messageBoxApi';
|
|
2
2
|
export { MessageBoxView } from './components/MessageBoxView';
|
|
3
|
-
export type { MessageBoxApi, MessageBoxOptions, MessageBoxResult, MessageBoxTone, } from './types';
|
|
3
|
+
export type { MessageBoxApi, MessageBoxOptions, MessageBoxPromptResult, MessageBoxResult, MessageBoxTone, } from './types';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export type MessageBoxTone = "info" | "success" | "warning" | "danger";
|
|
2
|
+
export type MessageBoxTone = "primary" | "info" | "success" | "warning" | "danger";
|
|
3
|
+
export type MessageBoxResult = "confirm" | "cancel" | "close";
|
|
4
|
+
export type MessageBoxBeforeClose = (action: MessageBoxResult, done: () => void) => void;
|
|
3
5
|
export type MessageBoxOptions = {
|
|
4
6
|
title?: ReactNode;
|
|
5
7
|
message?: ReactNode;
|
|
@@ -10,13 +12,49 @@ export type MessageBoxOptions = {
|
|
|
10
12
|
danger?: boolean;
|
|
11
13
|
tone?: MessageBoxTone;
|
|
12
14
|
className?: string;
|
|
15
|
+
/** 内容居中 */
|
|
16
|
+
center?: boolean;
|
|
17
|
+
/** 显示输入框(prompt) */
|
|
18
|
+
showInput?: boolean;
|
|
19
|
+
inputPlaceholder?: string;
|
|
20
|
+
inputValue?: string;
|
|
21
|
+
inputType?: string;
|
|
22
|
+
/** 校验正则;不匹配时阻止确认 */
|
|
23
|
+
inputPattern?: RegExp;
|
|
24
|
+
/** 返回 false / 错误文案时阻止确认 */
|
|
25
|
+
inputValidator?: (value: string) => boolean | string;
|
|
26
|
+
inputErrorMessage?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 关闭前回调;调用 done() 后才真正关闭(对齐 Element beforeClose)
|
|
29
|
+
*/
|
|
30
|
+
beforeClose?: MessageBoxBeforeClose;
|
|
31
|
+
/**
|
|
32
|
+
* 区分取消按钮与关闭(遮罩 / Esc);为 true 时后者返回 close
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
distinguishCancelAndClose?: boolean;
|
|
36
|
+
/** 是否可拖拽 */
|
|
37
|
+
draggable?: boolean;
|
|
38
|
+
/** 拖拽是否允许超出视口 */
|
|
39
|
+
overflow?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 将 string message 作为 HTML 渲染。
|
|
42
|
+
* 警告:勿传入用户输入,以免 XSS。
|
|
43
|
+
*/
|
|
44
|
+
dangerouslyUseHTMLString?: boolean;
|
|
45
|
+
};
|
|
46
|
+
export type MessageBoxPromptResult = {
|
|
47
|
+
action: MessageBoxResult;
|
|
48
|
+
value: string;
|
|
13
49
|
};
|
|
14
|
-
export type MessageBoxResult = "confirm" | "cancel";
|
|
15
50
|
export type MessageBoxApi = {
|
|
16
51
|
confirm: (options?: MessageBoxOptions | string) => Promise<MessageBoxResult>;
|
|
17
52
|
alert: (options?: MessageBoxOptions | string) => Promise<"confirm">;
|
|
53
|
+
primary: (options?: MessageBoxOptions | string) => Promise<"confirm">;
|
|
18
54
|
info: (options?: MessageBoxOptions | string) => Promise<"confirm">;
|
|
19
55
|
success: (options?: MessageBoxOptions | string) => Promise<"confirm">;
|
|
20
56
|
warning: (options?: MessageBoxOptions | string) => Promise<"confirm">;
|
|
21
57
|
danger: (options?: MessageBoxOptions | string) => Promise<MessageBoxResult>;
|
|
58
|
+
/** 带输入框的提示框,对齐 Element prompt */
|
|
59
|
+
prompt: (options?: MessageBoxOptions | string) => Promise<MessageBoxPromptResult>;
|
|
22
60
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModalProps } from '../types';
|
|
1
|
+
import { ModalHandle, ModalProps } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Enter/leave both use WAAPI with the same keyframes (enter = leave reversed → 上浮).
|
|
4
4
|
* Enter only starts after the hidden pose has been painted.
|
|
5
5
|
*/
|
|
6
|
-
export declare
|
|
6
|
+
export declare const Modal: import('react').ForwardRefExoticComponent<ModalProps & import('react').RefAttributes<ModalHandle>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Modal } from './components/Modal';
|
|
2
|
-
export type { ModalProps } from './types';
|
|
2
|
+
export type { ModalHandle, ModalProps } from './types';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
export type ModalBeforeClose = (done: () => void) => void;
|
|
2
3
|
export type ModalProps = {
|
|
3
4
|
open: boolean;
|
|
4
|
-
title?:
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
/** 自定义标题区(覆盖 title 文案,不移除关闭按钮) */
|
|
7
|
+
header?: ReactNode;
|
|
5
8
|
children?: ReactNode;
|
|
6
9
|
/**
|
|
7
10
|
* 自定义底部;传入 null 隐藏默认按钮区
|
|
@@ -13,8 +16,42 @@ export type ModalProps = {
|
|
|
13
16
|
onConfirm?: () => void;
|
|
14
17
|
/** Cancel action — also used for Esc(keyboard 时). */
|
|
15
18
|
onCancel?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* 关闭前回调;调用 done() 后才会真正关闭(对齐 Element before-close)
|
|
21
|
+
*/
|
|
22
|
+
beforeClose?: ModalBeforeClose;
|
|
16
23
|
/** When true, confirm button uses danger styling. */
|
|
17
24
|
danger?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 对话框宽度;number 为 px
|
|
27
|
+
* @default 跟随 CSS --modal-width
|
|
28
|
+
*/
|
|
29
|
+
width?: number | string;
|
|
30
|
+
/**
|
|
31
|
+
* 是否全屏
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
fullscreen?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 是否显示右上角关闭按钮
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
showClose?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 标题与底部是否居中
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
center?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 是否需要遮罩层
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
modal?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* 遮罩可穿透。modal 须为 false。
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
modalPenetrable?: boolean;
|
|
18
55
|
/**
|
|
19
56
|
* 点击遮罩是否关闭(触发 onCancel)
|
|
20
57
|
* @default false
|
|
@@ -30,6 +67,29 @@ export type ModalProps = {
|
|
|
30
67
|
* @default true
|
|
31
68
|
*/
|
|
32
69
|
destroyOnClose?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* 是否水平垂直居中;默认跟随 ConfigProvider.dialog.alignCenter,否则 true
|
|
72
|
+
*/
|
|
73
|
+
alignCenter?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* 是否可拖拽;默认跟随 ConfigProvider.dialog.draggable
|
|
76
|
+
*/
|
|
77
|
+
draggable?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* 拖拽是否允许超出视口;默认跟随 ConfigProvider.dialog.overflow
|
|
80
|
+
*/
|
|
81
|
+
overflow?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* 过渡名称(data-transition);默认跟随 ConfigProvider.dialog.transition
|
|
84
|
+
*/
|
|
85
|
+
transition?: string | Record<string, unknown>;
|
|
33
86
|
className?: string;
|
|
34
87
|
"aria-label"?: string;
|
|
35
88
|
};
|
|
89
|
+
/** Modal imperative handle(ref) */
|
|
90
|
+
export type ModalHandle = {
|
|
91
|
+
/** 重置拖拽位置 */
|
|
92
|
+
resetPosition: () => void;
|
|
93
|
+
/** 触发关闭(走 beforeClose) */
|
|
94
|
+
handleClose: () => void;
|
|
95
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NotificationApi, NotificationProviderProps, NotificationTone } from '../types';
|
|
2
|
-
export declare function NotificationProvider({ children, max, className, }: NotificationProviderProps): import('react').JSX.Element;
|
|
2
|
+
export declare function NotificationProvider({ children, max, position, className, }: NotificationProviderProps): import('react').JSX.Element;
|
|
3
3
|
export declare function useNotification(): NotificationApi;
|
|
4
4
|
/** Soft helper for typed tone usage in demos. */
|
|
5
5
|
export declare function toneLabel(tone: NotificationTone): NotificationTone;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { NotificationProvider, useNotification, } from './components/NotificationProvider';
|
|
2
|
-
export type { NotificationApi, NotificationItem, NotificationProviderProps, NotificationShowOptions, NotificationTone, } from './types';
|
|
2
|
+
export type { NotificationApi, NotificationItem, NotificationPosition, NotificationProviderProps, NotificationShowOptions, NotificationTone, } from './types';
|
|
@@ -1,25 +1,55 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export type NotificationTone = "info" | "success" | "warning" | "danger";
|
|
2
|
+
export type NotificationTone = "primary" | "info" | "success" | "warning" | "danger";
|
|
3
|
+
export type NotificationPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
4
|
+
export type NotificationProgressOptions = {
|
|
5
|
+
/** 进度条颜色;默认跟随 tone */
|
|
6
|
+
color?: string;
|
|
7
|
+
};
|
|
3
8
|
export type NotificationShowOptions = {
|
|
4
9
|
title?: ReactNode;
|
|
5
10
|
description?: ReactNode;
|
|
6
11
|
tone?: NotificationTone;
|
|
12
|
+
/** 毫秒;0 表示不自动关闭 */
|
|
7
13
|
duration?: number;
|
|
14
|
+
/**
|
|
15
|
+
* 是否显示关闭按钮
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
showClose?: boolean;
|
|
19
|
+
position?: NotificationPosition;
|
|
20
|
+
offset?: number;
|
|
21
|
+
/**
|
|
22
|
+
* 显示自动关闭倒计时进度条
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
progress?: boolean | NotificationProgressOptions;
|
|
26
|
+
/**
|
|
27
|
+
* 悬停时暂停计时与进度
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
pauseOnHover?: boolean;
|
|
8
31
|
};
|
|
9
32
|
export type NotificationItem = NotificationShowOptions & {
|
|
10
33
|
id: string;
|
|
11
34
|
};
|
|
12
35
|
export type NotificationApi = {
|
|
13
36
|
open: (options: NotificationShowOptions) => string;
|
|
37
|
+
primary: (title: ReactNode, description?: ReactNode) => string;
|
|
14
38
|
success: (title: ReactNode, description?: ReactNode) => string;
|
|
15
39
|
warning: (title: ReactNode, description?: ReactNode) => string;
|
|
16
40
|
danger: (title: ReactNode, description?: ReactNode) => string;
|
|
17
41
|
info: (title: ReactNode, description?: ReactNode) => string;
|
|
18
42
|
close: (id: string) => void;
|
|
19
43
|
clear: () => void;
|
|
44
|
+
closeAll: () => void;
|
|
20
45
|
};
|
|
21
46
|
export type NotificationProviderProps = {
|
|
22
47
|
children?: ReactNode;
|
|
23
48
|
max?: number;
|
|
49
|
+
/**
|
|
50
|
+
* 默认弹出位置
|
|
51
|
+
* @default top-right
|
|
52
|
+
*/
|
|
53
|
+
position?: NotificationPosition;
|
|
24
54
|
className?: string;
|
|
25
55
|
};
|