tango-ui-cw 0.9.9 → 1.0.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.
Files changed (118) hide show
  1. package/README.md +124 -39
  2. package/dist/component/CSSFab/index.d.ts +55 -0
  3. package/dist/component/CSSFab/useTangoStyle.d.ts +1 -0
  4. package/dist/component/TBanner/index.d.ts +50 -0
  5. package/dist/component/TButton/index.d.ts +107 -0
  6. package/dist/component/TColorPicker/index.d.ts +41 -0
  7. package/dist/component/TDate/index.d.ts +41 -0
  8. package/dist/component/TDatePicker/index.d.ts +49 -0
  9. package/dist/component/TDrawer/index.d.ts +58 -0
  10. package/dist/component/TInput/index.d.ts +81 -0
  11. package/dist/component/TLayout/index.d.ts +133 -0
  12. package/dist/component/TLine/index.d.ts +33 -0
  13. package/dist/component/TMark/index.d.ts +38 -0
  14. package/dist/component/TModal/index.d.ts +52 -0
  15. package/dist/component/TNotice/index.d.ts +30 -0
  16. package/dist/component/TSearch/index.d.ts +42 -0
  17. package/dist/component/TSpace/index.d.ts +56 -0
  18. package/dist/component/TTable/index.d.ts +76 -0
  19. package/dist/component/TTooltip/index.d.ts +31 -0
  20. package/dist/component/TUpload/index.d.ts +45 -0
  21. package/dist/component/index.d.ts +147 -0
  22. package/dist/index.cjs +12 -0
  23. package/dist/index.d.cts +18 -0
  24. package/dist/index.d.ts +18 -0
  25. package/dist/index.js +3648 -2
  26. package/dist/providers/NoticeProvider/NoticeProvider.d.ts +19 -0
  27. package/dist/providers/TangoI18nProvider/TangoI18nProvider.d.ts +28 -0
  28. package/dist/providers/ThemeProvider/ThemeProvider.d.ts +22 -0
  29. package/dist/scripts/check-peers.js +82 -0
  30. package/dist/styles/global.css +372 -0
  31. package/dist/styles/theme.css +13 -0
  32. package/package.json +65 -48
  33. package/dist/assets/Upload/delLogo.png.js +0 -1
  34. package/dist/assets/Upload/delLogo.png.mjs +0 -4
  35. package/dist/assets/Upload/fileslogo.png.js +0 -1
  36. package/dist/assets/Upload/fileslogo.png.mjs +0 -4
  37. package/dist/component/CSSFab/useTangoStyle.js +0 -2
  38. package/dist/component/CSSFab/useTangoStyle.mjs +0 -171
  39. package/dist/component/MaterialButton/MaterialButton.module.css.js +0 -1
  40. package/dist/component/MaterialButton/MaterialButton.module.css.mjs +0 -17
  41. package/dist/component/MaterialButton/index.js +0 -2
  42. package/dist/component/MaterialButton/index.mjs +0 -62
  43. package/dist/component/MaterialInput/MaterialInput.module.css.js +0 -1
  44. package/dist/component/MaterialInput/MaterialInput.module.css.mjs +0 -17
  45. package/dist/component/MaterialInput/index.js +0 -2
  46. package/dist/component/MaterialInput/index.mjs +0 -37
  47. package/dist/component/TBanner/TBanner.module.css.js +0 -1
  48. package/dist/component/TBanner/TBanner.module.css.mjs +0 -35
  49. package/dist/component/TBanner/index.js +0 -2
  50. package/dist/component/TBanner/index.mjs +0 -341
  51. package/dist/component/TButton/TButton.module.css.js +0 -1
  52. package/dist/component/TButton/TButton.module.css.mjs +0 -26
  53. package/dist/component/TButton/index.js +0 -2
  54. package/dist/component/TButton/index.mjs +0 -186
  55. package/dist/component/TColorPicker/TColorPicker.module.css.js +0 -1
  56. package/dist/component/TColorPicker/TColorPicker.module.css.mjs +0 -13
  57. package/dist/component/TColorPicker/index.js +0 -2
  58. package/dist/component/TColorPicker/index.mjs +0 -62
  59. package/dist/component/TDate/index.js +0 -2
  60. package/dist/component/TDate/index.mjs +0 -145
  61. package/dist/component/TDatePicker/TDatePicker.module.css.js +0 -1
  62. package/dist/component/TDatePicker/TDatePicker.module.css.mjs +0 -45
  63. package/dist/component/TDatePicker/index.js +0 -2
  64. package/dist/component/TDatePicker/index.mjs +0 -167
  65. package/dist/component/TDrawer/TDrawer.module.css.js +0 -1
  66. package/dist/component/TDrawer/TDrawer.module.css.mjs +0 -49
  67. package/dist/component/TDrawer/index.js +0 -2
  68. package/dist/component/TDrawer/index.mjs +0 -111
  69. package/dist/component/TInput/TInput.module.css.js +0 -1
  70. package/dist/component/TInput/TInput.module.css.mjs +0 -21
  71. package/dist/component/TInput/index.js +0 -2
  72. package/dist/component/TInput/index.mjs +0 -75
  73. package/dist/component/TLayout/index.js +0 -2
  74. package/dist/component/TLayout/index.mjs +0 -53
  75. package/dist/component/TLine/TLine.module.css.js +0 -1
  76. package/dist/component/TLine/TLine.module.css.mjs +0 -19
  77. package/dist/component/TLine/index.js +0 -2
  78. package/dist/component/TLine/index.mjs +0 -35
  79. package/dist/component/TMark/TMark.module.css.js +0 -1
  80. package/dist/component/TMark/TMark.module.css.mjs +0 -7
  81. package/dist/component/TMark/index.js +0 -2
  82. package/dist/component/TMark/index.mjs +0 -52
  83. package/dist/component/TModal/TModal.module.css.js +0 -1
  84. package/dist/component/TModal/TModal.module.css.mjs +0 -33
  85. package/dist/component/TModal/index.js +0 -2
  86. package/dist/component/TModal/index.mjs +0 -110
  87. package/dist/component/TNotice/TNotice.module.css.js +0 -1
  88. package/dist/component/TNotice/TNotice.module.css.mjs +0 -27
  89. package/dist/component/TNotice/index.js +0 -4
  90. package/dist/component/TNotice/index.mjs +0 -40
  91. package/dist/component/TNotice/useNotice.js +0 -2
  92. package/dist/component/TNotice/useNotice.mjs +0 -19
  93. package/dist/component/TSearch/TSearch.module.css.js +0 -1
  94. package/dist/component/TSearch/TSearch.module.css.mjs +0 -21
  95. package/dist/component/TSearch/index.js +0 -2
  96. package/dist/component/TSearch/index.mjs +0 -73
  97. package/dist/component/TSpace/TSpace.module.css.js +0 -1
  98. package/dist/component/TSpace/TSpace.module.css.mjs +0 -23
  99. package/dist/component/TSpace/index.js +0 -2
  100. package/dist/component/TSpace/index.mjs +0 -49
  101. package/dist/component/TTable/TTable.module.css.js +0 -1
  102. package/dist/component/TTable/TTable.module.css.mjs +0 -25
  103. package/dist/component/TTable/index.js +0 -8
  104. package/dist/component/TTable/index.mjs +0 -154
  105. package/dist/component/TTooltip/TTooltip.module.css.js +0 -1
  106. package/dist/component/TTooltip/TTooltip.module.css.mjs +0 -17
  107. package/dist/component/TTooltip/index.js +0 -2
  108. package/dist/component/TTooltip/index.mjs +0 -34
  109. package/dist/component/TUpload/TUpload.module.css.js +0 -1
  110. package/dist/component/TUpload/TUpload.module.css.mjs +0 -15
  111. package/dist/component/TUpload/index.js +0 -2
  112. package/dist/component/TUpload/index.mjs +0 -152
  113. package/dist/index.mjs +0 -50
  114. package/dist/providers/NoticeProvider.js +0 -2
  115. package/dist/providers/NoticeProvider.mjs +0 -117
  116. package/dist/providers/ThemeProvider.js +0 -2
  117. package/dist/providers/ThemeProvider.mjs +0 -21
  118. package/dist/tango-ui-cw.css +0 -1
@@ -0,0 +1,133 @@
1
+ import type {
2
+ CSSProperties,
3
+ HTMLAttributes,
4
+ ReactNode,
5
+ Ref,
6
+ } from "react";
7
+
8
+ /** sx 值类型(引用自 CSSFab) */
9
+ export type SxValue =
10
+ | string
11
+ | { tw?: string; className?: string; css?: CSSProperties; style?: CSSProperties }
12
+ | Record<string, unknown>;
13
+
14
+ /** Layout 主容器 Props */
15
+ export interface LayoutProps extends Omit<HTMLAttributes<HTMLElement>, "style"> {
16
+ /** 是否包含侧边栏(不传则自动检测 Sider 子组件) */
17
+ hasSider?: boolean;
18
+ /** 样式扩展 */
19
+ sx?: SxValue;
20
+ /** 行内样式 */
21
+ style?: CSSProperties;
22
+ /** 额外 CSS 类名 */
23
+ className?: string;
24
+ /** 子元素 */
25
+ children?: ReactNode;
26
+ /** ref 转发 */
27
+ ref?: Ref<HTMLElement>;
28
+ }
29
+
30
+ /** Header Props */
31
+ export interface LayoutHeaderProps extends Omit<HTMLAttributes<HTMLElement>, "style"> {
32
+ /** 样式扩展 */
33
+ sx?: SxValue;
34
+ /** 行内样式 */
35
+ style?: CSSProperties;
36
+ /** 额外 CSS 类名 */
37
+ className?: string;
38
+ /** 子元素 */
39
+ children?: ReactNode;
40
+ /** ref 转发 */
41
+ ref?: Ref<HTMLElement>;
42
+ }
43
+
44
+ /** Footer Props */
45
+ export interface LayoutFooterProps extends Omit<HTMLAttributes<HTMLElement>, "style"> {
46
+ /** 样式扩展 */
47
+ sx?: SxValue;
48
+ /** 行内样式 */
49
+ style?: CSSProperties;
50
+ /** 额外 CSS 类名 */
51
+ className?: string;
52
+ /** 子元素 */
53
+ children?: ReactNode;
54
+ /** ref 转发 */
55
+ ref?: Ref<HTMLElement>;
56
+ }
57
+
58
+ /** Sider Props */
59
+ export interface LayoutSiderProps extends Omit<HTMLAttributes<HTMLElement>, "style"> {
60
+ /** 侧边栏宽度,默认取 --layout-sider-width */
61
+ width?: string | number;
62
+ /** 样式扩展 */
63
+ sx?: SxValue;
64
+ /** 行内样式 */
65
+ style?: CSSProperties;
66
+ /** 额外 CSS 类名 */
67
+ className?: string;
68
+ /** 子元素 */
69
+ children?: ReactNode;
70
+ /** ref 转发 */
71
+ ref?: Ref<HTMLElement>;
72
+ }
73
+
74
+ /** Content Props */
75
+ export interface LayoutContentProps extends Omit<HTMLAttributes<HTMLElement>, "style"> {
76
+ /** 样式扩展 */
77
+ sx?: SxValue;
78
+ /** 行内样式 */
79
+ style?: CSSProperties;
80
+ /** 额外 CSS 类名 */
81
+ className?: string;
82
+ /** 子元素 */
83
+ children?: ReactNode;
84
+ /** ref 转发 */
85
+ ref?: Ref<HTMLElement>;
86
+ }
87
+
88
+ /** Toc Props(右侧目录导航) */
89
+ export interface LayoutTocProps extends Omit<HTMLAttributes<HTMLElement>, "style"> {
90
+ /** 目录导航宽度,默认取 --layout-toc-width */
91
+ width?: string | number;
92
+ /** 样式扩展 */
93
+ sx?: SxValue;
94
+ /** 行内样式 */
95
+ style?: CSSProperties;
96
+ /** 额外 CSS 类名 */
97
+ className?: string;
98
+ /** 子元素 */
99
+ children?: ReactNode;
100
+ /** ref 转发 */
101
+ ref?: Ref<HTMLElement>;
102
+ }
103
+
104
+ /** Layout 复合组件类型 */
105
+ interface LayoutComponent
106
+ extends React.ForwardRefExoticComponent<
107
+ LayoutProps & React.RefAttributes<HTMLElement>
108
+ > {
109
+ Header: React.ForwardRefExoticComponent<
110
+ LayoutHeaderProps & React.RefAttributes<HTMLElement>
111
+ >;
112
+ Footer: React.ForwardRefExoticComponent<
113
+ LayoutFooterProps & React.RefAttributes<HTMLElement>
114
+ >;
115
+ Sider: React.ForwardRefExoticComponent<
116
+ LayoutSiderProps & React.RefAttributes<HTMLElement>
117
+ >;
118
+ Content: React.ForwardRefExoticComponent<
119
+ LayoutContentProps & React.RefAttributes<HTMLElement>
120
+ >;
121
+ Toc: React.ForwardRefExoticComponent<
122
+ LayoutTocProps & React.RefAttributes<HTMLElement>
123
+ >;
124
+ }
125
+
126
+ export declare const Header: LayoutComponent["Header"];
127
+ export declare const Footer: LayoutComponent["Footer"];
128
+ export declare const Sider: LayoutComponent["Sider"];
129
+ export declare const Content: LayoutComponent["Content"];
130
+ export declare const Toc: LayoutComponent["Toc"];
131
+
132
+ declare const Layout: LayoutComponent;
133
+ export default Layout;
@@ -0,0 +1,33 @@
1
+ import type {
2
+ CSSProperties,
3
+ HTMLAttributes,
4
+ ReactNode,
5
+ Ref,
6
+ } from "react";
7
+
8
+ /** sx 值类型 */
9
+ export type SxValue =
10
+ | string
11
+ | { tw?: string; className?: string; css?: CSSProperties; style?: CSSProperties }
12
+ | Record<string, unknown>;
13
+
14
+ /** Line Props */
15
+ export interface LineProps extends Omit<HTMLAttributes<HTMLDivElement>, "style"> {
16
+ /** 分隔线间距尺寸 */
17
+ size?: "small" | "medium" | "large" | "huge";
18
+ /** 样式扩展 */
19
+ sx?: SxValue;
20
+ /** 行内样式 */
21
+ style?: CSSProperties;
22
+ /** 额外 CSS 类名 */
23
+ className?: string;
24
+ /** 分隔线中间文本,不传则显示纯线 */
25
+ children?: ReactNode;
26
+ /** ref 转发 */
27
+ ref?: Ref<HTMLDivElement>;
28
+ }
29
+
30
+ declare const Line: React.ForwardRefExoticComponent<
31
+ LineProps & React.RefAttributes<HTMLDivElement>
32
+ >;
33
+ export default Line;
@@ -0,0 +1,38 @@
1
+ import type {
2
+ CSSProperties,
3
+ HTMLAttributes,
4
+ ReactNode,
5
+ Ref,
6
+ } from "react";
7
+
8
+ /** sx 值类型 */
9
+ export type SxValue =
10
+ | string
11
+ | { tw?: string; className?: string; css?: CSSProperties; style?: CSSProperties }
12
+ | Record<string, unknown>;
13
+
14
+ /** Mark 高亮标记颜色预设 */
15
+ export type MarkColor = "default" | "primary" | "success" | "warning" | "danger";
16
+
17
+ /** Mark Props */
18
+ export interface MarkProps extends Omit<HTMLAttributes<HTMLElement>, "style"> {
19
+ /** 高亮颜色预设 */
20
+ color?: MarkColor;
21
+ /** 是否启用美化模式(圆角+内边距) */
22
+ beauty?: boolean;
23
+ /** 样式扩展 */
24
+ sx?: SxValue;
25
+ /** 行内样式 */
26
+ style?: CSSProperties;
27
+ /** 额外 CSS 类名 */
28
+ className?: string;
29
+ /** 标记内容 */
30
+ children?: ReactNode;
31
+ /** ref 转发 */
32
+ ref?: Ref<HTMLElement>;
33
+ }
34
+
35
+ declare const Mark: React.ForwardRefExoticComponent<
36
+ MarkProps & React.RefAttributes<HTMLElement>
37
+ >;
38
+ export default Mark;
@@ -0,0 +1,52 @@
1
+ import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
2
+ import type { SxValue } from "../CSSFab";
3
+
4
+ export type ModalI18nKey = "title" | "okText" | "cancelText" | "closeAriaLabel" | (string & {});
5
+
6
+ export type ModalLocaleText = Partial<{
7
+ title: string;
8
+ okText: string;
9
+ cancelText: string;
10
+ closeAriaLabel: string;
11
+ }>;
12
+
13
+ export type ModalFooterButton = {
14
+ key: string;
15
+ text: string;
16
+ onClick: () => void;
17
+ };
18
+
19
+ export interface ModalProps
20
+ extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "style" | "className"> {
21
+ /** 模态框内容 */
22
+ children?: ReactNode;
23
+ /** 标题,优先级高于 i18n */
24
+ title?: string;
25
+ /** 确定按钮文案,优先级高于 i18n */
26
+ okText?: string;
27
+ /** 取消按钮文案,优先级高于 i18n */
28
+ cancelText?: string;
29
+ /** 是否打开 */
30
+ open?: boolean;
31
+ /** 关闭回调 */
32
+ onClose?: () => void;
33
+ /** 确定回调,若未传则默认调用 onClose */
34
+ onOk?: () => void;
35
+ /** 容器宽度 */
36
+ width?: string | number;
37
+ /** Style extension via CSSFab sx */
38
+ sx?: SxValue;
39
+ style?: CSSProperties;
40
+ className?: string;
41
+ /** 点击遮罩是否关闭 */
42
+ maskClosable?: boolean;
43
+ /** 自定义底部按钮,传入后替代默认的取消/确定 */
44
+ footerButtons?: ModalFooterButton[];
45
+ /** 覆盖 locale 文案 */
46
+ localeText?: ModalLocaleText;
47
+ }
48
+
49
+ declare function Modal(props: ModalProps): JSX.Element;
50
+
51
+ export { Modal };
52
+ export default Modal;
@@ -0,0 +1,30 @@
1
+ import type { CSSProperties, ReactNode } from "react";
2
+ import type { SxValue } from "../CSSFab";
3
+
4
+ export type NoticeType = "success" | "fail" | "caution";
5
+ export type NoticeVariant = "default" | "md";
6
+
7
+ export interface NoticeProps extends React.HTMLAttributes<HTMLDivElement> {
8
+ /** 通知类型 */
9
+ type?: NoticeType;
10
+ /** 图标(default 模式显示,md 模式隐藏) */
11
+ icon?: ReactNode;
12
+ /** 通知内容 */
13
+ message?: ReactNode;
14
+ /** 变体:default 顶部居中,md 左下角 */
15
+ variant?: NoticeVariant;
16
+ /** 自动关闭时间(ms),0 或不传则不自动关闭 */
17
+ duration?: number;
18
+ /** 关闭回调 */
19
+ onClose?: () => void;
20
+ /** 样式扩展 */
21
+ sx?: SxValue;
22
+ style?: CSSProperties;
23
+ className?: string;
24
+ }
25
+
26
+ declare const Notice: React.ForwardRefExoticComponent<
27
+ NoticeProps & React.RefAttributes<HTMLDivElement>
28
+ >;
29
+
30
+ export default Notice;
@@ -0,0 +1,42 @@
1
+ import type { CSSProperties, HTMLAttributes } from "react";
2
+ import type { SxValue } from "../CSSFab";
3
+
4
+ export type SearchSize = "small" | "medium" | "large" | "huge";
5
+
6
+ export type SearchI18nKey = "placeholder" | "btnText" | (string & {});
7
+
8
+ export type SearchLocaleText = Partial<{
9
+ placeholder: string;
10
+ btnText: string;
11
+ }>;
12
+
13
+ export interface SearchProps
14
+ extends Omit<HTMLAttributes<HTMLInputElement>, "style" | "className" | "onSearch" | "placeholder"> {
15
+ /** 尺寸 */
16
+ size?: SearchSize;
17
+ /** Style extension via CSSFab sx */
18
+ sx?: SxValue;
19
+ style?: CSSProperties;
20
+ className?: string;
21
+ /** 搜索回调,参数为输入框当前值 */
22
+ onSearch?: (value: string) => void;
23
+ /** 受控值 */
24
+ value?: string;
25
+ /** 非受控默认值 */
26
+ defaultValue?: string;
27
+ /** 是否禁用 */
28
+ disabled?: boolean;
29
+ /** 占位文案,优先级高于 i18n */
30
+ placeholder?: string;
31
+ /** 搜索按钮文案,优先级高于 i18n */
32
+ btnText?: string;
33
+ /** 搜索按钮图标路径,传入后替代 btnText */
34
+ path?: string;
35
+ /** 覆盖 locale 文案 */
36
+ localeText?: SearchLocaleText;
37
+ }
38
+
39
+ declare function Search(props: SearchProps): JSX.Element;
40
+
41
+ export { Search };
42
+ export default Search;
@@ -0,0 +1,56 @@
1
+ import type {
2
+ CSSProperties,
3
+ HTMLAttributes,
4
+ ReactNode,
5
+ Ref,
6
+ } from "react";
7
+
8
+ /** Space 布局变体 */
9
+ export type SpaceType =
10
+ | "default"
11
+ | "inline"
12
+ | "circle"
13
+ | "triangle"
14
+ | "halfCircle"
15
+ | "fixed"
16
+ | "absolute"
17
+ | "relative";
18
+
19
+ /** sx 单个 slot 值 */
20
+ export interface SxSlotValue {
21
+ tw?: string;
22
+ className?: string;
23
+ css?: CSSProperties;
24
+ style?: CSSProperties;
25
+ }
26
+
27
+ /** sx 字符串 / 对象 / slot */
28
+ export type SxValue =
29
+ | string
30
+ | SxSlotValue
31
+ | Record<string, SxSlotValue | string | undefined>;
32
+
33
+ export interface SpaceProps
34
+ extends Omit<HTMLAttributes<HTMLDivElement>, "style"> {
35
+ /** 布局变体 */
36
+ type?: SpaceType;
37
+ /** 样式扩展 */
38
+ sx?: SxValue;
39
+ /** 行内样式 */
40
+ style?: CSSProperties;
41
+ /** 额外 CSS 类名 */
42
+ className?: string;
43
+ /** 子元素 */
44
+ children?: ReactNode;
45
+ /** ref 转发 */
46
+ ref?: Ref<HTMLDivElement>;
47
+ }
48
+
49
+ /** 默认导出:Space 组件 */
50
+ declare const Space: React.ForwardRefExoticComponent<
51
+ SpaceProps & React.RefAttributes<HTMLDivElement>
52
+ >;
53
+
54
+ export default Space;
55
+
56
+ export type { SpaceType, SxValue, SxSlotValue };
@@ -0,0 +1,76 @@
1
+ import type { CSSProperties, ReactNode } from "react";
2
+ import type { SxValue } from "../CSSFab";
3
+
4
+ /** 列定义 */
5
+ export interface TableColumn<T = Record<string, unknown>> {
6
+ title: string;
7
+ dataIndex: string;
8
+ key?: string | number;
9
+ width?: string | number;
10
+ hide?: boolean;
11
+ render?: (value: unknown, row: T, rowIndex: number) => ReactNode;
12
+ }
13
+
14
+ /** 分页配置 */
15
+ export interface TablePagination {
16
+ /** 翻页栏位置,默认 "bottom" */
17
+ placement?: "top" | "bottom";
18
+ /** 每页条数,默认 10 */
19
+ pageSize?: number;
20
+ /** 每页条数选项,默认 [10, 20, 50, 100] */
21
+ pageSizeOptions?: number[];
22
+ /** 是否显示总数,默认 true */
23
+ showTotal?: boolean;
24
+ /** 是否显示条/页切换,默认 true */
25
+ showSizeChanger?: boolean;
26
+ }
27
+
28
+ /** i18n 覆盖字段 */
29
+ export interface TableLocaleText {
30
+ empty?: string;
31
+ prev?: string;
32
+ next?: string;
33
+ page?: string;
34
+ total?: string;
35
+ perPage?: string;
36
+ [key: string]: string | undefined;
37
+ }
38
+
39
+ export interface TableProps {
40
+ /** 数据源 */
41
+ dataSource?: Record<string, unknown>[];
42
+ /** 列定义 */
43
+ columns?: TableColumn[];
44
+ /** sx 样式扩展 */
45
+ sx?: SxValue;
46
+ /** 行内样式 */
47
+ style?: CSSProperties;
48
+ /** 额外 CSS 类名 */
49
+ className?: string;
50
+ /** 分页配置,不传或 false 不分页 */
51
+ pagination?: TablePagination | false | null;
52
+ /** 隐藏列,支持 dataIndex 数组或单个字符串 */
53
+ hide?: string[] | string;
54
+ /** 行 className,支持函数 (row, rowIndex, rowParity) => string */
55
+ rowClassName?: ((row: Record<string, unknown>, rowIndex: number, rowParity: "even" | "odd") => string) | string;
56
+ /** 行 style,支持函数 (row, rowIndex, rowParity) => CSSProperties */
57
+ rowStyle?: ((row: Record<string, unknown>, rowIndex: number, rowParity: "even" | "odd") => CSSProperties) | CSSProperties;
58
+ /** 单元格 className,支持函数 (row, col, rowIndex, colIndex, rowParity, colParity) => string */
59
+ cellClassName?:
60
+ | ((row: Record<string, unknown>, col: TableColumn, rowIndex: number, colIndex: number, rowParity: "even" | "odd", colParity: "even" | "odd") => string)
61
+ | string;
62
+ /** 单元格 style,支持函数 */
63
+ cellStyle?:
64
+ | ((row: Record<string, unknown>, col: TableColumn, rowIndex: number, colIndex: number, rowParity: "even" | "odd", colParity: "even" | "odd") => CSSProperties)
65
+ | CSSProperties;
66
+ /** 自定义 hover 颜色(覆盖默认主题 hover) */
67
+ hoverColor?: string;
68
+ /** i18n key */
69
+ i18nKey?: string;
70
+ /** 覆盖内置文案 */
71
+ localeText?: TableLocaleText;
72
+ }
73
+
74
+ declare function Table(props: TableProps): JSX.Element;
75
+
76
+ export default Table;
@@ -0,0 +1,31 @@
1
+ import type { CSSProperties, ReactNode } from "react";
2
+ import type { SxValue } from "../CSSFab";
3
+
4
+ export type TooltipPlacement = "top" | "bottom" | "left" | "right";
5
+
6
+ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
7
+ /** 触发元素 */
8
+ children?: ReactNode;
9
+ /** 提示内容 */
10
+ title?: ReactNode;
11
+ /** 弹出方向 */
12
+ placement?: TooltipPlacement;
13
+ /** 受控模式:是否可见 */
14
+ open?: boolean;
15
+ /** 非受控默认是否可见 */
16
+ defaultOpen?: boolean;
17
+ /** 可见状态变化回调 */
18
+ onOpenChange?: (open: boolean) => void;
19
+ /** 是否禁用提示 */
20
+ disabled?: boolean;
21
+ /** 样式扩展 */
22
+ sx?: SxValue;
23
+ style?: CSSProperties;
24
+ className?: string;
25
+ }
26
+
27
+ declare const Tooltip: React.ForwardRefExoticComponent<
28
+ TooltipProps & React.RefAttributes<HTMLDivElement>
29
+ >;
30
+
31
+ export default Tooltip;
@@ -0,0 +1,45 @@
1
+ import type { CSSProperties, ReactNode } from "react";
2
+
3
+ export interface UploadProps {
4
+ /** 样式扩展(字符串/对象/slot) */
5
+ sx?: string | object;
6
+ /** 行内样式 */
7
+ style?: CSSProperties;
8
+ /** 额外 CSS 类名 */
9
+ className?: string;
10
+ /** 允许的文件类型(同 HTML accept 属性) */
11
+ accept?: string;
12
+ /** 是否多选 */
13
+ multiple?: boolean;
14
+ /** 文件变化回调 */
15
+ onChange?: (files: File[]) => void;
16
+ /** 上传前校验,返回 false 阻止,返回 LIST_IGNORE 不展示 */
17
+ beforeUpload?: (file: File, fileList: File[]) => boolean | Promise<boolean | symbol | File | Blob | undefined>;
18
+ /** 受控文件列表 */
19
+ files?: File[];
20
+ /** 是否显示文件列表 */
21
+ showUploadList?: boolean;
22
+ /** 多选时最大文件数 */
23
+ maxCount?: number;
24
+ /** 单文件最大体积(MB) */
25
+ maxSize?: number;
26
+ /** 选择按钮文字 */
27
+ btnText?: string;
28
+ /** 选择按钮样式 */
29
+ btnStyle?: CSSProperties;
30
+ /** 是否显示文件大小 */
31
+ showSize?: boolean;
32
+ /** 是否禁用 */
33
+ disabled?: boolean;
34
+ /** 子元素 */
35
+ children?: ReactNode;
36
+ }
37
+
38
+ /** beforeUpload 返回此值时,文件不展示在列表中 */
39
+ export const LIST_IGNORE: unique symbol;
40
+
41
+ declare const Upload: ((props: UploadProps) => JSX.Element) & {
42
+ LIST_IGNORE: typeof LIST_IGNORE;
43
+ };
44
+
45
+ export default Upload;
@@ -0,0 +1,147 @@
1
+ export {
2
+ Button,
3
+ MaterialButton,
4
+ type MaterialButtonLocaleText,
5
+ type MaterialButtonProps,
6
+ type MaterialButtonSize,
7
+ type MaterialButtonVariant,
8
+ type ButtonI18nKey,
9
+ type ButtonLocaleText,
10
+ type ButtonProps,
11
+ type ButtonSize,
12
+ type ButtonVariant,
13
+ type LoadingMode,
14
+ default as TangoButton,
15
+ } from "./TButton";
16
+
17
+ export {
18
+ Banner,
19
+ type BannerI18nKey,
20
+ type BannerLevel,
21
+ type BannerLocaleText,
22
+ type BannerProps,
23
+ type BannerSize,
24
+ default as TangoBanner,
25
+ } from "./TBanner";
26
+
27
+ export {
28
+ ColorPicker,
29
+ type ColorPickerFormat,
30
+ type ColorPickerI18nKey,
31
+ type ColorPickerLocaleText,
32
+ type ColorPickerProps,
33
+ type ColorPickerShowText,
34
+ type ColorPickerSize,
35
+ default as TangoColorPicker,
36
+ } from "./TColorPicker";
37
+ export {
38
+ DateDisplay,
39
+ type DateI18nKey,
40
+ type DateLocaleText,
41
+ type DateProps,
42
+ type DateType,
43
+ default as TangoDate,
44
+ } from "./TDate";
45
+ export {
46
+ DatePicker,
47
+ type DatePickerI18nKey,
48
+ type DatePickerLocaleText,
49
+ type DatePickerProps,
50
+ type DatePickerSize,
51
+ default as TangoDatePicker,
52
+ } from "./TDatePicker";
53
+ export {
54
+ Drawer,
55
+ type DrawerFooterButton,
56
+ type DrawerI18nKey,
57
+ type DrawerLocaleText,
58
+ type DrawerProps,
59
+ type DrawerType,
60
+ default as TangoDrawer,
61
+ } from "./TDrawer";
62
+ export {
63
+ Input,
64
+ MaterialInput,
65
+ type MaterialInputLocaleText,
66
+ type MaterialInputProps,
67
+ type MaterialInputSize,
68
+ type InputProps,
69
+ type InputSize,
70
+ type InputStatus,
71
+ type InputType,
72
+ default as TangoInput,
73
+ } from "./TInput";
74
+ export {
75
+ default as Layout,
76
+ Header,
77
+ Footer,
78
+ Sider,
79
+ Content,
80
+ Toc,
81
+ type LayoutProps,
82
+ type LayoutHeaderProps,
83
+ type LayoutFooterProps,
84
+ type LayoutSiderProps,
85
+ type LayoutContentProps,
86
+ type LayoutTocProps,
87
+ } from "./TLayout";
88
+ export {
89
+ default as Line,
90
+ type LineProps,
91
+ } from "./TLine";
92
+
93
+ export {
94
+ default as Mark,
95
+ type MarkColor,
96
+ type MarkProps,
97
+ } from "./TMark";
98
+ export {
99
+ Modal,
100
+ type ModalFooterButton,
101
+ type ModalI18nKey,
102
+ type ModalLocaleText,
103
+ type ModalProps,
104
+ default as TangoModal,
105
+ } from "./TModal";
106
+ export {
107
+ default as Notice,
108
+ type NoticeType,
109
+ type NoticeVariant,
110
+ type NoticeProps,
111
+ default as TangoNotice,
112
+ } from "./TNotice";
113
+ export {
114
+ Search,
115
+ type SearchI18nKey,
116
+ type SearchLocaleText,
117
+ type SearchProps,
118
+ type SearchSize,
119
+ default as TangoSearch,
120
+ } from "./TSearch";
121
+ export {
122
+ default as Space,
123
+ type SpaceProps,
124
+ type SpaceType,
125
+ type SxSlotValue,
126
+ type SxValue,
127
+ } from "./TSpace";
128
+ export {
129
+ default as Table,
130
+ type TableColumn,
131
+ type TableLocaleText,
132
+ type TablePagination,
133
+ type TableProps,
134
+ } from "./TTable";
135
+ export {
136
+ default as Tooltip,
137
+ type TooltipPlacement,
138
+ type TooltipProps,
139
+ default as TangoTooltip,
140
+ } from "./TTooltip";
141
+ export {
142
+ default as Upload,
143
+ type UploadProps,
144
+ default as TangoUpload,
145
+ } from "./TUpload";
146
+
147
+ export * from "./CSSFab";