tango-ui-cw 1.0.10 → 1.2.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 +133 -126
- package/dist/component/CSSFab/index.d.ts +61 -55
- package/dist/component/CSSFab/useTangoStyle.d.ts +1 -1
- package/dist/component/TBanner/index.d.ts +53 -50
- package/dist/component/TButton/index.d.ts +109 -107
- package/dist/component/TCard/index.d.ts +40 -0
- package/dist/component/TColorPicker/index.d.ts +42 -41
- package/dist/component/TDate/index.d.ts +42 -41
- package/dist/component/TDatePicker/index.d.ts +54 -49
- package/dist/component/TDrawer/index.d.ts +59 -58
- package/dist/component/TInput/index.d.ts +111 -81
- package/dist/component/TLayout/index.d.ts +136 -133
- package/dist/component/TLine/index.d.ts +36 -33
- package/dist/component/TMark/index.d.ts +41 -38
- package/dist/component/TModal/index.d.ts +107 -52
- package/dist/component/TNotice/index.d.ts +47 -30
- package/dist/component/TSearch/index.d.ts +56 -42
- package/dist/component/TSpace/index.d.ts +60 -59
- package/dist/component/TTable/index.d.ts +117 -76
- package/dist/component/TTooltip/index.d.ts +34 -31
- package/dist/component/TUpload/index.d.ts +74 -45
- package/dist/component/index.d.ts +167 -146
- package/dist/index.cjs +26 -8
- package/dist/index.d.cts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.js +3334 -2305
- package/dist/providers/NoticeProvider/NoticeProvider.d.ts +43 -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 +383 -353
- package/dist/styles/global.css +383 -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,109 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ButtonHTMLAttributes,
|
|
3
|
-
CSSProperties,
|
|
4
|
-
ElementType,
|
|
5
|
-
ReactNode,
|
|
6
|
-
} from "react";
|
|
7
|
-
import type { SxValue } from "../CSSFab";
|
|
8
|
-
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
export type
|
|
12
|
-
export type
|
|
13
|
-
|
|
14
|
-
| "
|
|
15
|
-
| "
|
|
16
|
-
| "
|
|
17
|
-
| "
|
|
18
|
-
| "
|
|
19
|
-
| "
|
|
20
|
-
| "
|
|
21
|
-
| "
|
|
22
|
-
| "
|
|
23
|
-
| "
|
|
24
|
-
| "
|
|
25
|
-
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
| "
|
|
31
|
-
| "
|
|
32
|
-
| "
|
|
33
|
-
| "
|
|
34
|
-
| "
|
|
35
|
-
| "
|
|
36
|
-
| "
|
|
37
|
-
| "
|
|
38
|
-
| "
|
|
39
|
-
| "
|
|
40
|
-
| "
|
|
41
|
-
| "
|
|
42
|
-
|
|
|
43
|
-
string
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
type
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
export type
|
|
69
|
-
|
|
70
|
-
export
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
export
|
|
1
|
+
import type {
|
|
2
|
+
ButtonHTMLAttributes,
|
|
3
|
+
CSSProperties,
|
|
4
|
+
ElementType,
|
|
5
|
+
ReactNode,
|
|
6
|
+
} from "react";
|
|
7
|
+
import type { SxValue } from "../CSSFab";
|
|
8
|
+
|
|
9
|
+
export type ButtonSlotNames = readonly ["root", "content", "icon", "loading"];
|
|
10
|
+
export type ButtonVariant = "default" | "transparent" | "danger" | "success";
|
|
11
|
+
export type ButtonSize = "small" | "medium" | "large" | "huge";
|
|
12
|
+
export type LoadingMode = boolean | "light" | "dark" | [boolean | "light" | "dark", "light" | "dark"];
|
|
13
|
+
export type ButtonI18nKey =
|
|
14
|
+
| "default"
|
|
15
|
+
| "loading"
|
|
16
|
+
| "submit"
|
|
17
|
+
| "confirm"
|
|
18
|
+
| "cancel"
|
|
19
|
+
| "search"
|
|
20
|
+
| "save"
|
|
21
|
+
| "delete"
|
|
22
|
+
| "back"
|
|
23
|
+
| "next"
|
|
24
|
+
| "prev"
|
|
25
|
+
| "add"
|
|
26
|
+
| (string & {});
|
|
27
|
+
|
|
28
|
+
export type ButtonLocaleText = Partial<
|
|
29
|
+
Record<
|
|
30
|
+
| "default"
|
|
31
|
+
| "loading"
|
|
32
|
+
| "iconAlt"
|
|
33
|
+
| "submit"
|
|
34
|
+
| "confirm"
|
|
35
|
+
| "cancel"
|
|
36
|
+
| "search"
|
|
37
|
+
| "save"
|
|
38
|
+
| "delete"
|
|
39
|
+
| "back"
|
|
40
|
+
| "next"
|
|
41
|
+
| "prev"
|
|
42
|
+
| "add"
|
|
43
|
+
| string,
|
|
44
|
+
string
|
|
45
|
+
>
|
|
46
|
+
>;
|
|
47
|
+
|
|
48
|
+
export interface ButtonProps
|
|
49
|
+
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "style" | "className" | "children"> {
|
|
50
|
+
type?: ButtonVariant;
|
|
51
|
+
size?: ButtonSize;
|
|
52
|
+
sx?: SxValue;
|
|
53
|
+
style?: CSSProperties;
|
|
54
|
+
className?: string;
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
outline?: boolean;
|
|
58
|
+
icon?: ElementType | ReactNode | string;
|
|
59
|
+
iconPosition?: "left" | "right";
|
|
60
|
+
loading?: LoadingMode;
|
|
61
|
+
i18nKey?: ButtonI18nKey;
|
|
62
|
+
localeText?: ButtonLocaleText;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare function Button(props: ButtonProps): JSX.Element;
|
|
66
|
+
|
|
67
|
+
// MaterialButton 类型
|
|
68
|
+
export type MaterialButtonSlotNames = readonly ["root", "content", "icon", "loading"];
|
|
69
|
+
export type MaterialButtonVariant = "default" | "transparent" | "danger" | "success";
|
|
70
|
+
export type MaterialButtonSize = "small" | "medium" | "large" | "huge";
|
|
71
|
+
|
|
72
|
+
export interface MaterialButtonLocaleText {
|
|
73
|
+
default?: string;
|
|
74
|
+
loading?: string;
|
|
75
|
+
iconAlt?: string;
|
|
76
|
+
[key: string]: string | undefined;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface MaterialButtonProps
|
|
80
|
+
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "style" | "className" | "children"> {
|
|
81
|
+
type?: MaterialButtonVariant;
|
|
82
|
+
size?: MaterialButtonSize;
|
|
83
|
+
sx?: SxValue;
|
|
84
|
+
style?: CSSProperties;
|
|
85
|
+
className?: string;
|
|
86
|
+
children?: ReactNode;
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
outline?: boolean;
|
|
89
|
+
icon?: ElementType | ReactNode | string;
|
|
90
|
+
iconPosition?: "left" | "right";
|
|
91
|
+
loading?: LoadingMode;
|
|
92
|
+
i18nKey?: string;
|
|
93
|
+
localeText?: MaterialButtonLocaleText;
|
|
94
|
+
/** 涟漪颜色,默认使用 --material-button-ripple */
|
|
95
|
+
rippleColor?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare function MaterialButton(props: MaterialButtonProps): JSX.Element;
|
|
99
|
+
|
|
100
|
+
// antd 风格:Button.MaterialButton / const { MaterialButton } = Button
|
|
101
|
+
interface ButtonNamespace {
|
|
102
|
+
(props: ButtonProps): JSX.Element;
|
|
103
|
+
MaterialButton: typeof MaterialButton;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
declare const ButtonWithType: ButtonNamespace;
|
|
107
|
+
export { ButtonWithType as Button };
|
|
108
|
+
export { MaterialButton };
|
|
109
|
+
export default Button;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CSSProperties,
|
|
3
|
+
HTMLAttributes,
|
|
4
|
+
ReactNode,
|
|
5
|
+
Ref,
|
|
6
|
+
} from "react";
|
|
7
|
+
|
|
8
|
+
/** Card sx slot 名列表 */
|
|
9
|
+
export type CardSlotNames = readonly ["root", "header", "body"];
|
|
10
|
+
|
|
11
|
+
/** sx 值类型 */
|
|
12
|
+
export type SxValue =
|
|
13
|
+
| string
|
|
14
|
+
| { tw?: string; className?: string; css?: CSSProperties; style?: CSSProperties }
|
|
15
|
+
| Record<string, unknown>;
|
|
16
|
+
|
|
17
|
+
/** Card Props */
|
|
18
|
+
export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "title"> {
|
|
19
|
+
/** 卡片标题 */
|
|
20
|
+
title?: ReactNode;
|
|
21
|
+
/** 卡片标题右侧额外内容(如操作按钮) */
|
|
22
|
+
extra?: ReactNode;
|
|
23
|
+
/** 是否显示边框 */
|
|
24
|
+
bordered?: boolean;
|
|
25
|
+
/** 样式扩展 */
|
|
26
|
+
sx?: SxValue;
|
|
27
|
+
/** 行内样式 */
|
|
28
|
+
style?: CSSProperties;
|
|
29
|
+
/** 额外 CSS 类名 */
|
|
30
|
+
className?: string;
|
|
31
|
+
/** 卡片内容 */
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
/** ref 转发 */
|
|
34
|
+
ref?: Ref<HTMLDivElement>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare const Card: React.ForwardRefExoticComponent<
|
|
38
|
+
CardProps & React.RefAttributes<HTMLDivElement>
|
|
39
|
+
>;
|
|
40
|
+
export default Card;
|
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import type { CSSProperties, InputHTMLAttributes } from "react";
|
|
2
|
-
import type { SxValue } from "../CSSFab";
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
sx
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export
|
|
1
|
+
import type { CSSProperties, InputHTMLAttributes } from "react";
|
|
2
|
+
import type { SxValue } from "../CSSFab";
|
|
3
|
+
|
|
4
|
+
export type ColorPickerSlotNames = readonly ["root", "input", "text"];
|
|
5
|
+
export type ColorPickerSize = "small" | "medium" | "large";
|
|
6
|
+
export type ColorPickerFormat = "hex" | "rgb" | "hsl";
|
|
7
|
+
export type ColorPickerShowText = boolean | ColorPickerFormat;
|
|
8
|
+
export type ColorPickerI18nKey = "hex" | "rgb" | "hsl" | (string & {});
|
|
9
|
+
export type ColorPickerLocaleText = Partial<
|
|
10
|
+
Record<"hex" | "rgb" | "hsl" | string, string>
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
export interface ColorPickerProps
|
|
14
|
+
extends Omit<InputHTMLAttributes<HTMLInputElement>, "style" | "className" | "size" | "type" | "value" | "onChange"> {
|
|
15
|
+
/** 受控颜色值(HEX) */
|
|
16
|
+
value?: string;
|
|
17
|
+
/** 非受控默认颜色值 */
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
/** 颜色变化回调,参数为 HEX 值 */
|
|
20
|
+
onChange?: (hex: string) => void;
|
|
21
|
+
/** 是否禁用 */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** 是否显示颜色文本;传格式字符串仅显示对应格式 */
|
|
24
|
+
showText?: ColorPickerShowText;
|
|
25
|
+
/** 文本输出格式(showText 为 true 时决定主格式) */
|
|
26
|
+
format?: ColorPickerFormat;
|
|
27
|
+
/** 尺寸变体 */
|
|
28
|
+
size?: ColorPickerSize;
|
|
29
|
+
/** Style extension via CSSFab sx */
|
|
30
|
+
sx?: SxValue;
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
className?: string;
|
|
33
|
+
/** i18n key */
|
|
34
|
+
i18nKey?: ColorPickerI18nKey;
|
|
35
|
+
/** 覆盖 locale 文案 */
|
|
36
|
+
localeText?: ColorPickerLocaleText;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare function ColorPicker(props: ColorPickerProps): JSX.Element;
|
|
40
|
+
|
|
41
|
+
export { ColorPicker };
|
|
42
|
+
export default ColorPicker;
|
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import type { CSSProperties, HTMLAttributes } from "react";
|
|
2
|
-
import type { SxValue } from "../CSSFab";
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
| "
|
|
7
|
-
| "
|
|
8
|
-
| "full
|
|
9
|
-
| "
|
|
10
|
-
| "year-week
|
|
11
|
-
| "week-
|
|
12
|
-
| "
|
|
13
|
-
| "no-s
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
sx
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export
|
|
1
|
+
import type { CSSProperties, HTMLAttributes } from "react";
|
|
2
|
+
import type { SxValue } from "../CSSFab";
|
|
3
|
+
|
|
4
|
+
export type DateSlotNames = readonly ["root", "date", "weekday", "time"];
|
|
5
|
+
export type DateType =
|
|
6
|
+
| "default"
|
|
7
|
+
| "line"
|
|
8
|
+
| "full"
|
|
9
|
+
| "full-line"
|
|
10
|
+
| "year-week"
|
|
11
|
+
| "year-week-line"
|
|
12
|
+
| "week-time"
|
|
13
|
+
| "no-s"
|
|
14
|
+
| "no-s-line";
|
|
15
|
+
|
|
16
|
+
export type DateI18nKey = DateType | (string & {});
|
|
17
|
+
|
|
18
|
+
export type DateLocaleText = Partial<{
|
|
19
|
+
weekdayPrefix: string;
|
|
20
|
+
weekdayShortPrefix: string;
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
export interface DateProps
|
|
24
|
+
extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className"> {
|
|
25
|
+
/** 显示格式类型 */
|
|
26
|
+
type?: DateType;
|
|
27
|
+
/** 中文星期简写:true 显示"周X",false 显示"星期X" */
|
|
28
|
+
single?: boolean;
|
|
29
|
+
/** Style extension via CSSFab sx */
|
|
30
|
+
sx?: SxValue;
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
className?: string;
|
|
33
|
+
/** i18n key,可指定 type 作为快捷格式 */
|
|
34
|
+
i18nKey?: DateI18nKey;
|
|
35
|
+
/** 覆盖 locale 文案 */
|
|
36
|
+
localeText?: DateLocaleText;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare function DateDisplay(props: DateProps): JSX.Element;
|
|
40
|
+
|
|
41
|
+
export { DateDisplay };
|
|
42
|
+
export default DateDisplay;
|
|
@@ -1,49 +1,54 @@
|
|
|
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
|
|
7
|
-
|
|
8
|
-
export type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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 DatePickerSlotNames = readonly ["root", "input", "panel", "header", "body", "footer"];
|
|
7
|
+
|
|
8
|
+
export type DatePickerI18nKey = "placeholder" | "placeholderTime" | "timeLabel" | "confirm" | "cancel" | "prevMonth" | "nextMonth" | "hourLabel" | "minuteLabel" | "panelAriaLabel" | (string & {});
|
|
9
|
+
|
|
10
|
+
export type DatePickerLocaleText = Partial<{
|
|
11
|
+
placeholder: string;
|
|
12
|
+
placeholderTime: string;
|
|
13
|
+
timeLabel: string;
|
|
14
|
+
confirm: string;
|
|
15
|
+
cancel: string;
|
|
16
|
+
prevMonth: string;
|
|
17
|
+
nextMonth: string;
|
|
18
|
+
weekDays: string[];
|
|
19
|
+
monthFormat: string;
|
|
20
|
+
hourLabel: string;
|
|
21
|
+
minuteLabel: string;
|
|
22
|
+
panelAriaLabel: string;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
export interface DatePickerProps
|
|
26
|
+
extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className" | "onChange"> {
|
|
27
|
+
/** 受控值(YYYY-MM-DD 或 YYYY-MM-DD HH:mm) */
|
|
28
|
+
value?: string;
|
|
29
|
+
/** 非受控默认值 */
|
|
30
|
+
defaultValue?: string;
|
|
31
|
+
/** 日期变化回调:(formatted, raw) => void */
|
|
32
|
+
onChange?: (formatted: string, raw: string) => void;
|
|
33
|
+
/** 是否禁用 */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/** 是否显示时间选择 */
|
|
36
|
+
time?: boolean;
|
|
37
|
+
/** 尺寸变体 */
|
|
38
|
+
size?: DatePickerSize;
|
|
39
|
+
/** Style extension via CSSFab sx */
|
|
40
|
+
sx?: SxValue;
|
|
41
|
+
style?: CSSProperties;
|
|
42
|
+
className?: string;
|
|
43
|
+
/** i18n key */
|
|
44
|
+
i18nKey?: DatePickerI18nKey;
|
|
45
|
+
/** 覆盖 locale 文案 */
|
|
46
|
+
localeText?: DatePickerLocaleText;
|
|
47
|
+
/** 输入框占位文本,优先级高于 i18n / localeText */
|
|
48
|
+
placeholder?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare function DatePicker(props: DatePickerProps): JSX.Element;
|
|
52
|
+
|
|
53
|
+
export { DatePicker };
|
|
54
|
+
export default DatePicker;
|