tango-ui-cw 1.0.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -126
- package/dist/component/CSSFab/index.d.ts +55 -55
- package/dist/component/CSSFab/useTangoStyle.d.ts +1 -1
- package/dist/component/TBanner/index.d.ts +52 -50
- package/dist/component/TButton/index.d.ts +107 -107
- package/dist/component/TColorPicker/index.d.ts +41 -41
- package/dist/component/TDate/index.d.ts +41 -41
- package/dist/component/TDatePicker/index.d.ts +49 -49
- package/dist/component/TDrawer/index.d.ts +58 -58
- package/dist/component/TInput/index.d.ts +81 -81
- package/dist/component/TLayout/index.d.ts +133 -133
- package/dist/component/TLine/index.d.ts +33 -33
- package/dist/component/TMark/index.d.ts +38 -38
- package/dist/component/TModal/index.d.ts +52 -52
- package/dist/component/TNotice/index.d.ts +30 -30
- package/dist/component/TSearch/index.d.ts +42 -42
- package/dist/component/TSpace/index.d.ts +57 -59
- package/dist/component/TTable/index.d.ts +76 -76
- package/dist/component/TTooltip/index.d.ts +31 -31
- package/dist/component/TUpload/index.d.ts +45 -45
- package/dist/component/index.d.ts +146 -146
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.js +1393 -1386
- package/dist/providers/NoticeProvider/NoticeProvider.d.ts +19 -19
- package/dist/providers/TangoI18nProvider/TangoI18nProvider.d.ts +27 -27
- package/dist/providers/ThemeProvider/ThemeProvider.d.ts +21 -21
- package/dist/scripts/check-peers.js +82 -82
- package/dist/styles/base.css +353 -353
- package/dist/styles/global.css +353 -353
- package/dist/styles/style.css +1 -1
- package/dist/styles/theme.css +13 -13
- package/dist/styles/utilities.css +1 -1
- package/package.json +68 -68
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ButtonHTMLAttributes,
|
|
3
|
-
CSSProperties,
|
|
4
|
-
ElementType,
|
|
5
|
-
ReactNode,
|
|
6
|
-
} from "react";
|
|
7
|
-
import type { SxValue } from "../CSSFab";
|
|
8
|
-
|
|
9
|
-
export type ButtonVariant = "default" | "transparent" | "danger" | "success";
|
|
10
|
-
export type ButtonSize = "small" | "medium" | "large" | "huge";
|
|
11
|
-
export type LoadingMode = boolean | "light" | "dark" | [boolean | "light" | "dark", "light" | "dark"];
|
|
12
|
-
export type ButtonI18nKey =
|
|
13
|
-
| "default"
|
|
14
|
-
| "loading"
|
|
15
|
-
| "submit"
|
|
16
|
-
| "confirm"
|
|
17
|
-
| "cancel"
|
|
18
|
-
| "search"
|
|
19
|
-
| "save"
|
|
20
|
-
| "delete"
|
|
21
|
-
| "back"
|
|
22
|
-
| "next"
|
|
23
|
-
| "prev"
|
|
24
|
-
| "add"
|
|
25
|
-
| (string & {});
|
|
26
|
-
|
|
27
|
-
export type ButtonLocaleText = Partial<
|
|
28
|
-
Record<
|
|
29
|
-
| "default"
|
|
30
|
-
| "loading"
|
|
31
|
-
| "iconAlt"
|
|
32
|
-
| "submit"
|
|
33
|
-
| "confirm"
|
|
34
|
-
| "cancel"
|
|
35
|
-
| "search"
|
|
36
|
-
| "save"
|
|
37
|
-
| "delete"
|
|
38
|
-
| "back"
|
|
39
|
-
| "next"
|
|
40
|
-
| "prev"
|
|
41
|
-
| "add"
|
|
42
|
-
| string,
|
|
43
|
-
string
|
|
44
|
-
>
|
|
45
|
-
>;
|
|
46
|
-
|
|
47
|
-
export interface ButtonProps
|
|
48
|
-
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "style" | "className" | "children"> {
|
|
49
|
-
type?: ButtonVariant;
|
|
50
|
-
size?: ButtonSize;
|
|
51
|
-
sx?: SxValue;
|
|
52
|
-
style?: CSSProperties;
|
|
53
|
-
className?: string;
|
|
54
|
-
children?: ReactNode;
|
|
55
|
-
disabled?: boolean;
|
|
56
|
-
outline?: boolean;
|
|
57
|
-
icon?: ElementType | ReactNode | string;
|
|
58
|
-
iconPosition?: "left" | "right";
|
|
59
|
-
loading?: LoadingMode;
|
|
60
|
-
i18nKey?: ButtonI18nKey;
|
|
61
|
-
localeText?: ButtonLocaleText;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
declare function Button(props: ButtonProps): JSX.Element;
|
|
65
|
-
|
|
66
|
-
// MaterialButton 类型
|
|
67
|
-
export type MaterialButtonVariant = "default" | "transparent" | "danger" | "success";
|
|
68
|
-
export type MaterialButtonSize = "small" | "medium" | "large" | "huge";
|
|
69
|
-
|
|
70
|
-
export interface MaterialButtonLocaleText {
|
|
71
|
-
default?: string;
|
|
72
|
-
loading?: string;
|
|
73
|
-
iconAlt?: string;
|
|
74
|
-
[key: string]: string | undefined;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface MaterialButtonProps
|
|
78
|
-
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "style" | "className" | "children"> {
|
|
79
|
-
type?: MaterialButtonVariant;
|
|
80
|
-
size?: MaterialButtonSize;
|
|
81
|
-
sx?: SxValue;
|
|
82
|
-
style?: CSSProperties;
|
|
83
|
-
className?: string;
|
|
84
|
-
children?: ReactNode;
|
|
85
|
-
disabled?: boolean;
|
|
86
|
-
outline?: boolean;
|
|
87
|
-
icon?: ElementType | ReactNode | string;
|
|
88
|
-
iconPosition?: "left" | "right";
|
|
89
|
-
loading?: LoadingMode;
|
|
90
|
-
i18nKey?: string;
|
|
91
|
-
localeText?: MaterialButtonLocaleText;
|
|
92
|
-
/** 涟漪颜色,默认使用 --material-button-ripple */
|
|
93
|
-
rippleColor?: string;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
declare function MaterialButton(props: MaterialButtonProps): JSX.Element;
|
|
97
|
-
|
|
98
|
-
// antd 风格:Button.MaterialButton / const { MaterialButton } = Button
|
|
99
|
-
interface ButtonNamespace {
|
|
100
|
-
(props: ButtonProps): JSX.Element;
|
|
101
|
-
MaterialButton: typeof MaterialButton;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
declare const ButtonWithType: ButtonNamespace;
|
|
105
|
-
export { ButtonWithType as Button };
|
|
106
|
-
export { MaterialButton };
|
|
107
|
-
export default Button;
|
|
1
|
+
import type {
|
|
2
|
+
ButtonHTMLAttributes,
|
|
3
|
+
CSSProperties,
|
|
4
|
+
ElementType,
|
|
5
|
+
ReactNode,
|
|
6
|
+
} from "react";
|
|
7
|
+
import type { SxValue } from "../CSSFab";
|
|
8
|
+
|
|
9
|
+
export type ButtonVariant = "default" | "transparent" | "danger" | "success";
|
|
10
|
+
export type ButtonSize = "small" | "medium" | "large" | "huge";
|
|
11
|
+
export type LoadingMode = boolean | "light" | "dark" | [boolean | "light" | "dark", "light" | "dark"];
|
|
12
|
+
export type ButtonI18nKey =
|
|
13
|
+
| "default"
|
|
14
|
+
| "loading"
|
|
15
|
+
| "submit"
|
|
16
|
+
| "confirm"
|
|
17
|
+
| "cancel"
|
|
18
|
+
| "search"
|
|
19
|
+
| "save"
|
|
20
|
+
| "delete"
|
|
21
|
+
| "back"
|
|
22
|
+
| "next"
|
|
23
|
+
| "prev"
|
|
24
|
+
| "add"
|
|
25
|
+
| (string & {});
|
|
26
|
+
|
|
27
|
+
export type ButtonLocaleText = Partial<
|
|
28
|
+
Record<
|
|
29
|
+
| "default"
|
|
30
|
+
| "loading"
|
|
31
|
+
| "iconAlt"
|
|
32
|
+
| "submit"
|
|
33
|
+
| "confirm"
|
|
34
|
+
| "cancel"
|
|
35
|
+
| "search"
|
|
36
|
+
| "save"
|
|
37
|
+
| "delete"
|
|
38
|
+
| "back"
|
|
39
|
+
| "next"
|
|
40
|
+
| "prev"
|
|
41
|
+
| "add"
|
|
42
|
+
| string,
|
|
43
|
+
string
|
|
44
|
+
>
|
|
45
|
+
>;
|
|
46
|
+
|
|
47
|
+
export interface ButtonProps
|
|
48
|
+
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "style" | "className" | "children"> {
|
|
49
|
+
type?: ButtonVariant;
|
|
50
|
+
size?: ButtonSize;
|
|
51
|
+
sx?: SxValue;
|
|
52
|
+
style?: CSSProperties;
|
|
53
|
+
className?: string;
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
outline?: boolean;
|
|
57
|
+
icon?: ElementType | ReactNode | string;
|
|
58
|
+
iconPosition?: "left" | "right";
|
|
59
|
+
loading?: LoadingMode;
|
|
60
|
+
i18nKey?: ButtonI18nKey;
|
|
61
|
+
localeText?: ButtonLocaleText;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare function Button(props: ButtonProps): JSX.Element;
|
|
65
|
+
|
|
66
|
+
// MaterialButton 类型
|
|
67
|
+
export type MaterialButtonVariant = "default" | "transparent" | "danger" | "success";
|
|
68
|
+
export type MaterialButtonSize = "small" | "medium" | "large" | "huge";
|
|
69
|
+
|
|
70
|
+
export interface MaterialButtonLocaleText {
|
|
71
|
+
default?: string;
|
|
72
|
+
loading?: string;
|
|
73
|
+
iconAlt?: string;
|
|
74
|
+
[key: string]: string | undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface MaterialButtonProps
|
|
78
|
+
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "style" | "className" | "children"> {
|
|
79
|
+
type?: MaterialButtonVariant;
|
|
80
|
+
size?: MaterialButtonSize;
|
|
81
|
+
sx?: SxValue;
|
|
82
|
+
style?: CSSProperties;
|
|
83
|
+
className?: string;
|
|
84
|
+
children?: ReactNode;
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
outline?: boolean;
|
|
87
|
+
icon?: ElementType | ReactNode | string;
|
|
88
|
+
iconPosition?: "left" | "right";
|
|
89
|
+
loading?: LoadingMode;
|
|
90
|
+
i18nKey?: string;
|
|
91
|
+
localeText?: MaterialButtonLocaleText;
|
|
92
|
+
/** 涟漪颜色,默认使用 --material-button-ripple */
|
|
93
|
+
rippleColor?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare function MaterialButton(props: MaterialButtonProps): JSX.Element;
|
|
97
|
+
|
|
98
|
+
// antd 风格:Button.MaterialButton / const { MaterialButton } = Button
|
|
99
|
+
interface ButtonNamespace {
|
|
100
|
+
(props: ButtonProps): JSX.Element;
|
|
101
|
+
MaterialButton: typeof MaterialButton;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
declare const ButtonWithType: ButtonNamespace;
|
|
105
|
+
export { ButtonWithType as Button };
|
|
106
|
+
export { MaterialButton };
|
|
107
|
+
export default Button;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import type { CSSProperties, InputHTMLAttributes } from "react";
|
|
2
|
-
import type { SxValue } from "../CSSFab";
|
|
3
|
-
|
|
4
|
-
export type ColorPickerSize = "small" | "medium" | "large";
|
|
5
|
-
export type ColorPickerFormat = "hex" | "rgb" | "hsl";
|
|
6
|
-
export type ColorPickerShowText = boolean | ColorPickerFormat;
|
|
7
|
-
export type ColorPickerI18nKey = "hex" | "rgb" | "hsl" | (string & {});
|
|
8
|
-
export type ColorPickerLocaleText = Partial<
|
|
9
|
-
Record<"hex" | "rgb" | "hsl" | string, string>
|
|
10
|
-
>;
|
|
11
|
-
|
|
12
|
-
export interface ColorPickerProps
|
|
13
|
-
extends Omit<InputHTMLAttributes<HTMLInputElement>, "style" | "className" | "size" | "type" | "value" | "onChange"> {
|
|
14
|
-
/** 受控颜色值(HEX) */
|
|
15
|
-
value?: string;
|
|
16
|
-
/** 非受控默认颜色值 */
|
|
17
|
-
defaultValue?: string;
|
|
18
|
-
/** 颜色变化回调,参数为 HEX 值 */
|
|
19
|
-
onChange?: (hex: string) => void;
|
|
20
|
-
/** 是否禁用 */
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
/** 是否显示颜色文本;传格式字符串仅显示对应格式 */
|
|
23
|
-
showText?: ColorPickerShowText;
|
|
24
|
-
/** 文本输出格式(showText 为 true 时决定主格式) */
|
|
25
|
-
format?: ColorPickerFormat;
|
|
26
|
-
/** 尺寸变体 */
|
|
27
|
-
size?: ColorPickerSize;
|
|
28
|
-
/** Style extension via CSSFab sx */
|
|
29
|
-
sx?: SxValue;
|
|
30
|
-
style?: CSSProperties;
|
|
31
|
-
className?: string;
|
|
32
|
-
/** i18n key */
|
|
33
|
-
i18nKey?: ColorPickerI18nKey;
|
|
34
|
-
/** 覆盖 locale 文案 */
|
|
35
|
-
localeText?: ColorPickerLocaleText;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
declare function ColorPicker(props: ColorPickerProps): JSX.Element;
|
|
39
|
-
|
|
40
|
-
export { ColorPicker };
|
|
41
|
-
export default ColorPicker;
|
|
1
|
+
import type { CSSProperties, InputHTMLAttributes } from "react";
|
|
2
|
+
import type { SxValue } from "../CSSFab";
|
|
3
|
+
|
|
4
|
+
export type ColorPickerSize = "small" | "medium" | "large";
|
|
5
|
+
export type ColorPickerFormat = "hex" | "rgb" | "hsl";
|
|
6
|
+
export type ColorPickerShowText = boolean | ColorPickerFormat;
|
|
7
|
+
export type ColorPickerI18nKey = "hex" | "rgb" | "hsl" | (string & {});
|
|
8
|
+
export type ColorPickerLocaleText = Partial<
|
|
9
|
+
Record<"hex" | "rgb" | "hsl" | string, string>
|
|
10
|
+
>;
|
|
11
|
+
|
|
12
|
+
export interface ColorPickerProps
|
|
13
|
+
extends Omit<InputHTMLAttributes<HTMLInputElement>, "style" | "className" | "size" | "type" | "value" | "onChange"> {
|
|
14
|
+
/** 受控颜色值(HEX) */
|
|
15
|
+
value?: string;
|
|
16
|
+
/** 非受控默认颜色值 */
|
|
17
|
+
defaultValue?: string;
|
|
18
|
+
/** 颜色变化回调,参数为 HEX 值 */
|
|
19
|
+
onChange?: (hex: string) => void;
|
|
20
|
+
/** 是否禁用 */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** 是否显示颜色文本;传格式字符串仅显示对应格式 */
|
|
23
|
+
showText?: ColorPickerShowText;
|
|
24
|
+
/** 文本输出格式(showText 为 true 时决定主格式) */
|
|
25
|
+
format?: ColorPickerFormat;
|
|
26
|
+
/** 尺寸变体 */
|
|
27
|
+
size?: ColorPickerSize;
|
|
28
|
+
/** Style extension via CSSFab sx */
|
|
29
|
+
sx?: SxValue;
|
|
30
|
+
style?: CSSProperties;
|
|
31
|
+
className?: string;
|
|
32
|
+
/** i18n key */
|
|
33
|
+
i18nKey?: ColorPickerI18nKey;
|
|
34
|
+
/** 覆盖 locale 文案 */
|
|
35
|
+
localeText?: ColorPickerLocaleText;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare function ColorPicker(props: ColorPickerProps): JSX.Element;
|
|
39
|
+
|
|
40
|
+
export { ColorPicker };
|
|
41
|
+
export default ColorPicker;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import type { CSSProperties, HTMLAttributes } from "react";
|
|
2
|
-
import type { SxValue } from "../CSSFab";
|
|
3
|
-
|
|
4
|
-
export type DateType =
|
|
5
|
-
| "default"
|
|
6
|
-
| "line"
|
|
7
|
-
| "full"
|
|
8
|
-
| "full-line"
|
|
9
|
-
| "year-week"
|
|
10
|
-
| "year-week-line"
|
|
11
|
-
| "week-time"
|
|
12
|
-
| "no-s"
|
|
13
|
-
| "no-s-line";
|
|
14
|
-
|
|
15
|
-
export type DateI18nKey = DateType | (string & {});
|
|
16
|
-
|
|
17
|
-
export type DateLocaleText = Partial<{
|
|
18
|
-
weekdayPrefix: string;
|
|
19
|
-
weekdayShortPrefix: string;
|
|
20
|
-
}>;
|
|
21
|
-
|
|
22
|
-
export interface DateProps
|
|
23
|
-
extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className"> {
|
|
24
|
-
/** 显示格式类型 */
|
|
25
|
-
type?: DateType;
|
|
26
|
-
/** 中文星期简写:true 显示"周X",false 显示"星期X" */
|
|
27
|
-
single?: boolean;
|
|
28
|
-
/** Style extension via CSSFab sx */
|
|
29
|
-
sx?: SxValue;
|
|
30
|
-
style?: CSSProperties;
|
|
31
|
-
className?: string;
|
|
32
|
-
/** i18n key,可指定 type 作为快捷格式 */
|
|
33
|
-
i18nKey?: DateI18nKey;
|
|
34
|
-
/** 覆盖 locale 文案 */
|
|
35
|
-
localeText?: DateLocaleText;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
declare function DateDisplay(props: DateProps): JSX.Element;
|
|
39
|
-
|
|
40
|
-
export { DateDisplay };
|
|
41
|
-
export default DateDisplay;
|
|
1
|
+
import type { CSSProperties, HTMLAttributes } from "react";
|
|
2
|
+
import type { SxValue } from "../CSSFab";
|
|
3
|
+
|
|
4
|
+
export type DateType =
|
|
5
|
+
| "default"
|
|
6
|
+
| "line"
|
|
7
|
+
| "full"
|
|
8
|
+
| "full-line"
|
|
9
|
+
| "year-week"
|
|
10
|
+
| "year-week-line"
|
|
11
|
+
| "week-time"
|
|
12
|
+
| "no-s"
|
|
13
|
+
| "no-s-line";
|
|
14
|
+
|
|
15
|
+
export type DateI18nKey = DateType | (string & {});
|
|
16
|
+
|
|
17
|
+
export type DateLocaleText = Partial<{
|
|
18
|
+
weekdayPrefix: string;
|
|
19
|
+
weekdayShortPrefix: string;
|
|
20
|
+
}>;
|
|
21
|
+
|
|
22
|
+
export interface DateProps
|
|
23
|
+
extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className"> {
|
|
24
|
+
/** 显示格式类型 */
|
|
25
|
+
type?: DateType;
|
|
26
|
+
/** 中文星期简写:true 显示"周X",false 显示"星期X" */
|
|
27
|
+
single?: boolean;
|
|
28
|
+
/** Style extension via CSSFab sx */
|
|
29
|
+
sx?: SxValue;
|
|
30
|
+
style?: CSSProperties;
|
|
31
|
+
className?: string;
|
|
32
|
+
/** i18n key,可指定 type 作为快捷格式 */
|
|
33
|
+
i18nKey?: DateI18nKey;
|
|
34
|
+
/** 覆盖 locale 文案 */
|
|
35
|
+
localeText?: DateLocaleText;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare function DateDisplay(props: DateProps): JSX.Element;
|
|
39
|
+
|
|
40
|
+
export { DateDisplay };
|
|
41
|
+
export default DateDisplay;
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import type { CSSProperties, HTMLAttributes } from "react";
|
|
2
|
-
import type { SxValue } from "../CSSFab";
|
|
3
|
-
|
|
4
|
-
export type DatePickerSize = "small" | "medium" | "large";
|
|
5
|
-
|
|
6
|
-
export type DatePickerI18nKey = "placeholder" | "placeholderTime" | "timeLabel" | "confirm" | "cancel" | "prevMonth" | "nextMonth" | (string & {});
|
|
7
|
-
|
|
8
|
-
export type DatePickerLocaleText = Partial<{
|
|
9
|
-
placeholder: string;
|
|
10
|
-
placeholderTime: string;
|
|
11
|
-
timeLabel: string;
|
|
12
|
-
confirm: string;
|
|
13
|
-
cancel: string;
|
|
14
|
-
prevMonth: string;
|
|
15
|
-
nextMonth: string;
|
|
16
|
-
weekDays: string[];
|
|
17
|
-
monthFormat: string;
|
|
18
|
-
}>;
|
|
19
|
-
|
|
20
|
-
export interface DatePickerProps
|
|
21
|
-
extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className" | "onChange"> {
|
|
22
|
-
/** 受控值(YYYY-MM-DD 或 YYYY-MM-DD HH:mm) */
|
|
23
|
-
value?: string;
|
|
24
|
-
/** 非受控默认值 */
|
|
25
|
-
defaultValue?: string;
|
|
26
|
-
/** 日期变化回调:(formatted, raw) => void */
|
|
27
|
-
onChange?: (formatted: string, raw: string) => void;
|
|
28
|
-
/** 是否禁用 */
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
/** 是否显示时间选择 */
|
|
31
|
-
time?: boolean;
|
|
32
|
-
/** 尺寸变体 */
|
|
33
|
-
size?: DatePickerSize;
|
|
34
|
-
/** Style extension via CSSFab sx */
|
|
35
|
-
sx?: SxValue;
|
|
36
|
-
style?: CSSProperties;
|
|
37
|
-
className?: string;
|
|
38
|
-
/** i18n key */
|
|
39
|
-
i18nKey?: DatePickerI18nKey;
|
|
40
|
-
/** 覆盖 locale 文案 */
|
|
41
|
-
localeText?: DatePickerLocaleText;
|
|
42
|
-
/** 输入框占位文本,优先级高于 i18n / localeText */
|
|
43
|
-
placeholder?: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare function DatePicker(props: DatePickerProps): JSX.Element;
|
|
47
|
-
|
|
48
|
-
export { DatePicker };
|
|
49
|
-
export default DatePicker;
|
|
1
|
+
import type { CSSProperties, HTMLAttributes } from "react";
|
|
2
|
+
import type { SxValue } from "../CSSFab";
|
|
3
|
+
|
|
4
|
+
export type DatePickerSize = "small" | "medium" | "large";
|
|
5
|
+
|
|
6
|
+
export type DatePickerI18nKey = "placeholder" | "placeholderTime" | "timeLabel" | "confirm" | "cancel" | "prevMonth" | "nextMonth" | (string & {});
|
|
7
|
+
|
|
8
|
+
export type DatePickerLocaleText = Partial<{
|
|
9
|
+
placeholder: string;
|
|
10
|
+
placeholderTime: string;
|
|
11
|
+
timeLabel: string;
|
|
12
|
+
confirm: string;
|
|
13
|
+
cancel: string;
|
|
14
|
+
prevMonth: string;
|
|
15
|
+
nextMonth: string;
|
|
16
|
+
weekDays: string[];
|
|
17
|
+
monthFormat: string;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
export interface DatePickerProps
|
|
21
|
+
extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className" | "onChange"> {
|
|
22
|
+
/** 受控值(YYYY-MM-DD 或 YYYY-MM-DD HH:mm) */
|
|
23
|
+
value?: string;
|
|
24
|
+
/** 非受控默认值 */
|
|
25
|
+
defaultValue?: string;
|
|
26
|
+
/** 日期变化回调:(formatted, raw) => void */
|
|
27
|
+
onChange?: (formatted: string, raw: string) => void;
|
|
28
|
+
/** 是否禁用 */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** 是否显示时间选择 */
|
|
31
|
+
time?: boolean;
|
|
32
|
+
/** 尺寸变体 */
|
|
33
|
+
size?: DatePickerSize;
|
|
34
|
+
/** Style extension via CSSFab sx */
|
|
35
|
+
sx?: SxValue;
|
|
36
|
+
style?: CSSProperties;
|
|
37
|
+
className?: string;
|
|
38
|
+
/** i18n key */
|
|
39
|
+
i18nKey?: DatePickerI18nKey;
|
|
40
|
+
/** 覆盖 locale 文案 */
|
|
41
|
+
localeText?: DatePickerLocaleText;
|
|
42
|
+
/** 输入框占位文本,优先级高于 i18n / localeText */
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare function DatePicker(props: DatePickerProps): JSX.Element;
|
|
47
|
+
|
|
48
|
+
export { DatePicker };
|
|
49
|
+
export default DatePicker;
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import type { SxValue } from "../CSSFab";
|
|
3
|
-
|
|
4
|
-
export type DrawerType = "top" | "bottom" | "left" | "right";
|
|
5
|
-
|
|
6
|
-
export type DrawerI18nKey = "title" | "okText" | "cancelText" | "closeAriaLabel" | (string & {});
|
|
7
|
-
|
|
8
|
-
export type DrawerLocaleText = Partial<{
|
|
9
|
-
title: string;
|
|
10
|
-
okText: string;
|
|
11
|
-
cancelText: string;
|
|
12
|
-
closeAriaLabel: string;
|
|
13
|
-
}>;
|
|
14
|
-
|
|
15
|
-
export type DrawerFooterButton = {
|
|
16
|
-
key: string;
|
|
17
|
-
text: string;
|
|
18
|
-
onClick: () => void;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export interface DrawerProps
|
|
22
|
-
extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "style" | "className"> {
|
|
23
|
-
/** 抽屉内容 */
|
|
24
|
-
children?: ReactNode;
|
|
25
|
-
/** 标题,优先级高于 i18n */
|
|
26
|
-
title?: string;
|
|
27
|
-
/** 确定按钮文案,优先级高于 i18n */
|
|
28
|
-
okText?: string;
|
|
29
|
-
/** 取消按钮文案,优先级高于 i18n */
|
|
30
|
-
cancelText?: string;
|
|
31
|
-
/** 是否打开 */
|
|
32
|
-
open?: boolean;
|
|
33
|
-
/** 关闭回调 */
|
|
34
|
-
onClose?: () => void;
|
|
35
|
-
/** 确定回调,若未传则默认调用 onClose */
|
|
36
|
-
onOk?: () => void;
|
|
37
|
-
/** 抽屉方向 */
|
|
38
|
-
type?: DrawerType;
|
|
39
|
-
/** 容器宽度(left/right 生效) */
|
|
40
|
-
width?: string | number;
|
|
41
|
-
/** 容器高度(top/bottom 生效) */
|
|
42
|
-
height?: string | number;
|
|
43
|
-
/** Style extension via CSSFab sx */
|
|
44
|
-
sx?: SxValue;
|
|
45
|
-
style?: CSSProperties;
|
|
46
|
-
className?: string;
|
|
47
|
-
/** 点击遮罩是否关闭 */
|
|
48
|
-
maskClosable?: boolean;
|
|
49
|
-
/** 自定义底部按钮,传入后替代默认的取消/确定 */
|
|
50
|
-
footerButtons?: DrawerFooterButton[];
|
|
51
|
-
/** 覆盖 locale 文案 */
|
|
52
|
-
localeText?: DrawerLocaleText;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
declare function Drawer(props: DrawerProps): JSX.Element;
|
|
56
|
-
|
|
57
|
-
export { Drawer };
|
|
58
|
-
export default Drawer;
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import type { SxValue } from "../CSSFab";
|
|
3
|
+
|
|
4
|
+
export type DrawerType = "top" | "bottom" | "left" | "right";
|
|
5
|
+
|
|
6
|
+
export type DrawerI18nKey = "title" | "okText" | "cancelText" | "closeAriaLabel" | (string & {});
|
|
7
|
+
|
|
8
|
+
export type DrawerLocaleText = Partial<{
|
|
9
|
+
title: string;
|
|
10
|
+
okText: string;
|
|
11
|
+
cancelText: string;
|
|
12
|
+
closeAriaLabel: string;
|
|
13
|
+
}>;
|
|
14
|
+
|
|
15
|
+
export type DrawerFooterButton = {
|
|
16
|
+
key: string;
|
|
17
|
+
text: string;
|
|
18
|
+
onClick: () => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export interface DrawerProps
|
|
22
|
+
extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "style" | "className"> {
|
|
23
|
+
/** 抽屉内容 */
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/** 标题,优先级高于 i18n */
|
|
26
|
+
title?: string;
|
|
27
|
+
/** 确定按钮文案,优先级高于 i18n */
|
|
28
|
+
okText?: string;
|
|
29
|
+
/** 取消按钮文案,优先级高于 i18n */
|
|
30
|
+
cancelText?: string;
|
|
31
|
+
/** 是否打开 */
|
|
32
|
+
open?: boolean;
|
|
33
|
+
/** 关闭回调 */
|
|
34
|
+
onClose?: () => void;
|
|
35
|
+
/** 确定回调,若未传则默认调用 onClose */
|
|
36
|
+
onOk?: () => void;
|
|
37
|
+
/** 抽屉方向 */
|
|
38
|
+
type?: DrawerType;
|
|
39
|
+
/** 容器宽度(left/right 生效) */
|
|
40
|
+
width?: string | number;
|
|
41
|
+
/** 容器高度(top/bottom 生效) */
|
|
42
|
+
height?: string | number;
|
|
43
|
+
/** Style extension via CSSFab sx */
|
|
44
|
+
sx?: SxValue;
|
|
45
|
+
style?: CSSProperties;
|
|
46
|
+
className?: string;
|
|
47
|
+
/** 点击遮罩是否关闭 */
|
|
48
|
+
maskClosable?: boolean;
|
|
49
|
+
/** 自定义底部按钮,传入后替代默认的取消/确定 */
|
|
50
|
+
footerButtons?: DrawerFooterButton[];
|
|
51
|
+
/** 覆盖 locale 文案 */
|
|
52
|
+
localeText?: DrawerLocaleText;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare function Drawer(props: DrawerProps): JSX.Element;
|
|
56
|
+
|
|
57
|
+
export { Drawer };
|
|
58
|
+
export default Drawer;
|