@zjpcy/simple-design 1.2.10 → 1.3.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 +2 -2
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/Anchor/index.js +1 -1
- package/dist/es/Carousel/index.js +1 -0
- package/dist/es/Cascader/index.js +1 -1
- package/dist/es/Checkbox/index.js +1 -1
- package/dist/es/DatePicker/RangePicker.js +1 -0
- package/dist/es/DatePicker/index.js +1 -0
- package/dist/es/DatePicker/styles.js +1 -0
- package/dist/es/Drawer/index.js +1 -1
- package/dist/es/Dropdown/index.js +1 -1
- package/dist/es/Form/index.js +1 -1
- package/dist/es/Icon/path.js +1 -1
- package/dist/es/Input/InputBase.js +1 -1
- package/dist/es/Input/Number.js +1 -1
- package/dist/es/Input/Password.js +1 -1
- package/dist/es/Label/styles.js +1 -1
- package/dist/es/Layout/index.js +1 -1
- package/dist/es/Layout/styles.js +1 -1
- package/dist/es/Menu/index.js +1 -1
- package/dist/es/Message/Message.js +1 -1
- package/dist/es/Message/index.js +1 -1
- package/dist/es/Modal/index.js +1 -1
- package/dist/es/Notice/Notice.js +1 -1
- package/dist/es/Pagination/index.js +1 -1
- package/dist/es/Popconfirm/index.js +1 -1
- package/dist/es/Progress/index.js +1 -1
- package/dist/es/Radio/index.js +1 -1
- package/dist/es/Select/index.js +1 -1
- package/dist/es/Select/styles.js +1 -0
- package/dist/es/Slider/index.js +1 -1
- package/dist/es/Spin/index.js +1 -0
- package/dist/es/Splitter/index.js +1 -0
- package/dist/es/Splitter/styles.js +1 -0
- package/dist/es/Switch/styles.js +1 -1
- package/dist/es/Table/index.js +1 -1
- package/dist/es/TimePicker/RangePicker.js +1 -0
- package/dist/es/TimePicker/TimePickerPanel.js +1 -0
- package/dist/es/TimePicker/index.js +1 -0
- package/dist/es/Tooltip/Tooltip.js +1 -1
- package/dist/es/Tree/index.js +1 -0
- package/dist/es/Upload/index.js +1 -0
- package/dist/es/index.css +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/src/i18n/locales/en-US.json.js +1 -1
- package/dist/es/src/i18n/locales/zh-CN.json.js +1 -1
- package/dist/i18n/locales/en-US.json +7 -7
- package/dist/i18n/locales/zh-CN.json +7 -7
- package/dist/types/components/Carousel/index.d.ts +5 -0
- package/dist/types/components/Carousel/styles.d.ts +12 -0
- package/dist/types/components/Carousel/types.d.ts +72 -0
- package/dist/types/components/DatePicker/RangePicker.d.ts +4 -0
- package/dist/types/components/DatePicker/index.d.ts +9 -0
- package/dist/types/components/DatePicker/styles.d.ts +186 -0
- package/dist/types/components/DatePicker/types.d.ts +228 -0
- package/dist/types/components/Input/InputBase.d.ts +2 -0
- package/dist/types/components/Input/Password.d.ts +2 -0
- package/dist/types/components/Menu/types.d.ts +7 -1
- package/dist/types/components/Message/types.d.ts +2 -1
- package/dist/types/components/Modal/types.d.ts +4 -0
- package/dist/types/components/Notice/Notice.d.ts +4 -1
- package/dist/types/components/Pagination/types.d.ts +15 -3
- package/dist/types/components/Popconfirm/types.d.ts +2 -0
- package/dist/types/components/Progress/index.d.ts +2 -2
- package/dist/types/components/Progress/types.d.ts +23 -2
- package/dist/types/components/Select/index.d.ts +25 -6
- package/dist/types/components/Select/styles.d.ts +45 -0
- package/dist/types/components/Select/types.d.ts +120 -27
- package/dist/types/components/Spin/index.d.ts +6 -0
- package/dist/types/components/Spin/types.d.ts +44 -0
- package/dist/types/components/Splitter/index.d.ts +9 -0
- package/dist/types/components/Splitter/styles.d.ts +61 -0
- package/dist/types/components/Splitter/types.d.ts +115 -0
- package/dist/types/components/TimePicker/RangePicker.d.ts +4 -0
- package/dist/types/components/TimePicker/TimePickerPanel.d.ts +4 -0
- package/dist/types/components/TimePicker/index.d.ts +10 -0
- package/dist/types/components/TimePicker/styles.d.ts +33 -0
- package/dist/types/components/TimePicker/types.d.ts +151 -0
- package/dist/types/components/Tree/index.d.ts +12 -0
- package/dist/types/components/Tree/styles.d.ts +54 -0
- package/dist/types/components/Tree/types.d.ts +202 -0
- package/dist/types/components/Upload/index.d.ts +6 -0
- package/dist/types/components/Upload/styles.d.ts +28 -0
- package/dist/types/components/Upload/types.d.ts +90 -0
- package/dist/types/components/index.d.ts +14 -0
- package/dist/variables.css +70 -0
- package/package.json +2 -1
- package/dist/types/components/Popconfirm/styles.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ProgressProps, ProgressStatus, ProgressType } from './types';
|
|
2
|
+
import { ProgressProps, ProgressStatus, ProgressType, ProgressSegment } from './types';
|
|
3
3
|
import './Progress.css';
|
|
4
4
|
declare const Progress: React.FC<ProgressProps>;
|
|
5
5
|
export default Progress;
|
|
6
|
-
export type { ProgressProps, ProgressType, ProgressStatus };
|
|
6
|
+
export type { ProgressProps, ProgressType, ProgressStatus, ProgressSegment };
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type ProgressType = 'line' | 'circle' | 'dashboard';
|
|
3
3
|
export type ProgressStatus = 'success' | 'exception' | 'active' | 'normal';
|
|
4
|
+
/** 渐变色配置 */
|
|
5
|
+
export interface GradientConfig {
|
|
6
|
+
from: string;
|
|
7
|
+
to: string;
|
|
8
|
+
direction?: 'to right' | 'to left' | 'to top' | 'to bottom' | 'to bottom right' | 'to top right' | 'to bottom left' | 'to top left';
|
|
9
|
+
/** 是否启用波浪动画 */
|
|
10
|
+
animated?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** 进度段配置 - 用于多段颜色展示 */
|
|
13
|
+
export interface ProgressSegment {
|
|
14
|
+
/** 该段的颜色 */
|
|
15
|
+
color: string | GradientConfig;
|
|
16
|
+
/** 该段占总的百分比(0-100) */
|
|
17
|
+
percent: number;
|
|
18
|
+
}
|
|
4
19
|
export interface ProgressProps {
|
|
5
20
|
/** 百分比 */
|
|
6
21
|
percent?: number;
|
|
@@ -12,8 +27,8 @@ export interface ProgressProps {
|
|
|
12
27
|
showInfo?: boolean;
|
|
13
28
|
/** 自定义显示文字 */
|
|
14
29
|
format?: (percent?: number, successPercent?: number) => ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
strokeColor?: string;
|
|
30
|
+
/** 进度条颜色,支持纯色字符串或渐变对象 */
|
|
31
|
+
strokeColor?: string | GradientConfig;
|
|
17
32
|
/** 背景颜色 */
|
|
18
33
|
trailColor?: string;
|
|
19
34
|
/** 线条粗细 */
|
|
@@ -22,6 +37,10 @@ export interface ProgressProps {
|
|
|
22
37
|
size?: 'small' | 'default' | 'large';
|
|
23
38
|
/** 是否开启动画 */
|
|
24
39
|
transition?: boolean;
|
|
40
|
+
/** 步骤进度条的总步数 */
|
|
41
|
+
steps?: number;
|
|
42
|
+
/** 多段颜色配置,用于展示多个进度段 */
|
|
43
|
+
segments?: ProgressSegment[];
|
|
25
44
|
/** 是否开启仪表盘样式 */
|
|
26
45
|
gapDegree?: number;
|
|
27
46
|
/** 仪表盘缺口位置 */
|
|
@@ -32,6 +51,8 @@ export interface ProgressProps {
|
|
|
32
51
|
prefix?: string;
|
|
33
52
|
/** 后缀文字 */
|
|
34
53
|
suffix?: string;
|
|
54
|
+
/** 自定义内部内容,支持 ReactNode,优先级高于默认的进度显示 */
|
|
55
|
+
children?: ReactNode;
|
|
35
56
|
className?: string;
|
|
36
57
|
style?: React.CSSProperties;
|
|
37
58
|
}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SelectProps,
|
|
2
|
+
import { SelectProps, SelectOption, TagRenderProps } from './types';
|
|
3
3
|
import './Select.css';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Select 下拉选择组件
|
|
6
|
+
* 用于从一组选项中选择一项或多项
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* // 基础用法
|
|
11
|
+
* <Select
|
|
12
|
+
* options={[
|
|
13
|
+
* { value: '1', label: '选项1' },
|
|
14
|
+
* { value: '2', label: '选项2' }
|
|
15
|
+
* ]}
|
|
16
|
+
* onChange={(value) => console.log(value)}
|
|
17
|
+
* />
|
|
18
|
+
*
|
|
19
|
+
* // 多选模式
|
|
20
|
+
* <Select mode="multiple" options={options} />
|
|
21
|
+
*
|
|
22
|
+
* // 可搜索
|
|
23
|
+
* <Select searchable options={options} />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare const Select: React.FC<SelectProps>;
|
|
8
27
|
export default Select;
|
|
9
|
-
export
|
|
28
|
+
export type { SelectProps, SelectOption, TagRenderProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SelectStyles } from './types';
|
|
2
|
+
export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
|
+
$styles?: SelectStyles["wrapper"];
|
|
4
|
+
}>> & string;
|
|
5
|
+
export declare const LabelWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
|
+
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const Selector: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
8
|
+
$disabled: boolean;
|
|
9
|
+
$loading: boolean;
|
|
10
|
+
$size: "small" | "default" | "large";
|
|
11
|
+
$open: boolean;
|
|
12
|
+
$styles?: SelectStyles["selector"];
|
|
13
|
+
}>> & string;
|
|
14
|
+
export declare const SelectorContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
15
|
+
export declare const Placeholder: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
16
|
+
export declare const SingleValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
17
|
+
export declare const TagsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
18
|
+
export declare const Tag: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
19
|
+
$disabled: boolean;
|
|
20
|
+
$styles?: SelectStyles["tag"];
|
|
21
|
+
}>> & string;
|
|
22
|
+
export declare const TagClose: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
23
|
+
export declare const SearchInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
|
|
24
|
+
export declare const SuffixArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
25
|
+
export declare const ClearButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
26
|
+
export declare const Arrow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
27
|
+
$open: boolean;
|
|
28
|
+
}>> & string;
|
|
29
|
+
export declare const LoadingIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
30
|
+
export declare const Dropdown: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
31
|
+
$open: boolean;
|
|
32
|
+
$styles?: SelectStyles["dropdown"];
|
|
33
|
+
}>> & string;
|
|
34
|
+
export declare const OptionList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
35
|
+
$maxHeight?: number;
|
|
36
|
+
}>> & string;
|
|
37
|
+
export declare const Option: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
38
|
+
$selected: boolean;
|
|
39
|
+
$active: boolean;
|
|
40
|
+
$disabled: boolean;
|
|
41
|
+
$styles?: SelectStyles["option"];
|
|
42
|
+
}>> & string;
|
|
43
|
+
export declare const CheckIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
44
|
+
export declare const Empty: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
45
|
+
export declare const injectGlobalStyles: () => void;
|
|
@@ -1,41 +1,134 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Select 选项数据类型
|
|
4
|
+
*/
|
|
1
5
|
export interface SelectOption {
|
|
2
|
-
|
|
3
|
-
|
|
6
|
+
/** 选项值 */
|
|
7
|
+
value: string | number;
|
|
8
|
+
/** 选项显示文本 */
|
|
9
|
+
label: string | ReactNode;
|
|
10
|
+
/** 是否禁用 */
|
|
4
11
|
disabled?: boolean;
|
|
5
|
-
|
|
12
|
+
/** 自定义样式 */
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
/** 自定义类名 */
|
|
15
|
+
className?: string;
|
|
6
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Select 组件属性接口
|
|
19
|
+
*/
|
|
7
20
|
export interface SelectProps {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
size?: 'large' | 'middle' | 'small';
|
|
14
|
-
style?: React.CSSProperties;
|
|
15
|
-
className?: string;
|
|
21
|
+
/** 当前选中的值(受控模式) */
|
|
22
|
+
value?: string | number | (string | number)[];
|
|
23
|
+
/** 默认选中的值(非受控模式) */
|
|
24
|
+
defaultValue?: string | number | (string | number)[];
|
|
25
|
+
/** 选项列表 */
|
|
16
26
|
options?: SelectOption[];
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
/** 是否禁用 */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** 加载中状态 */
|
|
30
|
+
loading?: boolean;
|
|
31
|
+
/** 是否多选 */
|
|
32
|
+
mode?: 'single' | 'multiple';
|
|
33
|
+
/** 占位符文本 */
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
/** 是否可搜索 */
|
|
36
|
+
searchable?: boolean;
|
|
37
|
+
/** 是否可清除 */
|
|
38
|
+
clearable?: boolean;
|
|
39
|
+
/** 组件尺寸 */
|
|
40
|
+
size?: 'small' | 'default' | 'large';
|
|
41
|
+
/** 组件宽度 */
|
|
42
|
+
width?: string | number;
|
|
43
|
+
/** 自定义样式 */
|
|
44
|
+
styles?: SelectStyles;
|
|
45
|
+
/** 外层容器样式 */
|
|
46
|
+
style?: CSSProperties;
|
|
47
|
+
/** 变化时的回调函数 */
|
|
48
|
+
onChange?: (value: string | number | (string | number)[], option?: SelectOption | SelectOption[]) => void;
|
|
49
|
+
/** 展开/收起时的回调函数 */
|
|
19
50
|
onOpenChange?: (open: boolean) => void;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
51
|
+
/** 搜索时的回调函数 */
|
|
52
|
+
onSearch?: (value: string) => void;
|
|
53
|
+
/** 自定义选项渲染 */
|
|
54
|
+
optionRender?: (option: SelectOption) => ReactNode;
|
|
55
|
+
/** 自定义选中项渲染 */
|
|
56
|
+
tagRender?: (props: TagRenderProps) => ReactNode;
|
|
57
|
+
/** 标签文案,显示在选择框前面 */
|
|
58
|
+
label?: string | ReactNode;
|
|
59
|
+
/** 标签到选择框的距离 */
|
|
26
60
|
labelGap?: string | number;
|
|
27
61
|
/** 标签的CSS类名 */
|
|
28
62
|
labelClassName?: string;
|
|
29
63
|
/** 标签的样式 */
|
|
30
|
-
labelStyle?:
|
|
64
|
+
labelStyle?: CSSProperties;
|
|
65
|
+
/** 自定义类名 */
|
|
66
|
+
className?: string;
|
|
67
|
+
/** 是否显示下拉箭头 */
|
|
68
|
+
showArrow?: boolean;
|
|
69
|
+
/** 下拉菜单的最大高度 */
|
|
70
|
+
maxHeight?: number;
|
|
71
|
+
/** 空状态显示内容 */
|
|
72
|
+
emptyContent?: ReactNode;
|
|
73
|
+
/** 获取弹出层容器 */
|
|
74
|
+
getPopupContainer?: () => HTMLElement;
|
|
31
75
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
76
|
+
/**
|
|
77
|
+
* 标签渲染属性
|
|
78
|
+
*/
|
|
79
|
+
export interface TagRenderProps {
|
|
80
|
+
/** 选项值 */
|
|
81
|
+
value: string | number;
|
|
82
|
+
/** 选项标签 */
|
|
83
|
+
label: string | ReactNode;
|
|
84
|
+
/** 关闭回调 */
|
|
85
|
+
onClose: (e?: React.MouseEvent) => void;
|
|
86
|
+
/** 是否禁用 */
|
|
35
87
|
disabled?: boolean;
|
|
36
|
-
icon?: string;
|
|
37
88
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
89
|
+
/**
|
|
90
|
+
* 样式配置接口
|
|
91
|
+
*/
|
|
92
|
+
export interface SelectStyles {
|
|
93
|
+
/** 外层容器样式 */
|
|
94
|
+
wrapper?: CSSProperties;
|
|
95
|
+
/** 选择器样式 */
|
|
96
|
+
selector?: CSSProperties;
|
|
97
|
+
/** 下拉菜单样式 */
|
|
98
|
+
dropdown?: CSSProperties;
|
|
99
|
+
/** 选项样式 */
|
|
100
|
+
option?: CSSProperties;
|
|
101
|
+
/** 选中标签样式(多选模式) */
|
|
102
|
+
tag?: CSSProperties;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* 尺寸配置接口
|
|
106
|
+
*/
|
|
107
|
+
export interface SelectSizeConfig {
|
|
108
|
+
height: string;
|
|
109
|
+
padding: string;
|
|
110
|
+
fontSize: string;
|
|
111
|
+
tagHeight: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Select 主题配置接口
|
|
115
|
+
*/
|
|
116
|
+
export interface SelectThemeConfig {
|
|
117
|
+
colors: {
|
|
118
|
+
primary: string;
|
|
119
|
+
text: string;
|
|
120
|
+
textSecondary: string;
|
|
121
|
+
textDisabled: string;
|
|
122
|
+
border: string;
|
|
123
|
+
borderHover: string;
|
|
124
|
+
borderFocus: string;
|
|
125
|
+
bg: string;
|
|
126
|
+
bgHover: string;
|
|
127
|
+
bgSelected: string;
|
|
128
|
+
};
|
|
129
|
+
sizes: {
|
|
130
|
+
small: SelectSizeConfig;
|
|
131
|
+
default: SelectSizeConfig;
|
|
132
|
+
large: SelectSizeConfig;
|
|
133
|
+
};
|
|
41
134
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
export type SpinSize = 'small' | 'default' | 'large';
|
|
3
|
+
export interface SpinProps {
|
|
4
|
+
/**
|
|
5
|
+
* 是否为加载状态
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
spinning?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 加载指示符
|
|
11
|
+
*/
|
|
12
|
+
indicator?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* 当作为包裹元素时,可以自定义描述文案
|
|
15
|
+
*/
|
|
16
|
+
tip?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* 组件大小
|
|
19
|
+
* @default 'default'
|
|
20
|
+
*/
|
|
21
|
+
size?: SpinSize;
|
|
22
|
+
/**
|
|
23
|
+
* 延迟显示加载效果的时间(防止闪烁)
|
|
24
|
+
* @default 0
|
|
25
|
+
*/
|
|
26
|
+
delay?: number;
|
|
27
|
+
/**
|
|
28
|
+
* 自定义类名
|
|
29
|
+
*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* 自定义样式
|
|
33
|
+
*/
|
|
34
|
+
style?: CSSProperties;
|
|
35
|
+
/**
|
|
36
|
+
* 包裹的子元素
|
|
37
|
+
*/
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* 是否全屏显示
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
fullscreen?: boolean;
|
|
44
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Splitter 组件样式工具函数
|
|
3
|
+
* 使用 CSS 变量与现代化设计系统保持一致
|
|
4
|
+
*/
|
|
5
|
+
import { CSSProperties } from 'react';
|
|
6
|
+
/**
|
|
7
|
+
* 获取容器样式
|
|
8
|
+
*/
|
|
9
|
+
export declare const getContainerStyle: (layout: "horizontal" | "vertical", customStyle?: CSSProperties) => CSSProperties;
|
|
10
|
+
/**
|
|
11
|
+
* 获取面板样式
|
|
12
|
+
* @param size - 面板尺寸(像素)
|
|
13
|
+
* @param layout - 布局方向
|
|
14
|
+
* @param index - 面板索引
|
|
15
|
+
* @param totalPanels - 面板总数
|
|
16
|
+
*/
|
|
17
|
+
export declare const getPanelStyle: (size: number, layout: "horizontal" | "vertical", index?: number, totalPanels?: number) => CSSProperties;
|
|
18
|
+
/**
|
|
19
|
+
* 获取分割条样式
|
|
20
|
+
* 使用 CSS 变量实现现代化渐变和阴影效果
|
|
21
|
+
* @param layout - 布局方向
|
|
22
|
+
* @param splitterSize - 分割条大小
|
|
23
|
+
* @param disabled - 是否禁用
|
|
24
|
+
* @param index - 分割条索引
|
|
25
|
+
*/
|
|
26
|
+
export declare const getSplitterBarStyle: (layout: "horizontal" | "vertical", splitterSize: number | undefined, disabled: boolean, index?: number) => CSSProperties;
|
|
27
|
+
/**
|
|
28
|
+
* 获取分割线样式
|
|
29
|
+
* 支持自定义颜色和拖拽状态
|
|
30
|
+
* @param layout - 布局方向
|
|
31
|
+
* @param lineColor - 线条颜色
|
|
32
|
+
* @param lineHoverColor - 悬停颜色
|
|
33
|
+
* @param isDragging - 是否正在拖拽
|
|
34
|
+
* @param isActive - 是否激活状态(当前拖拽的分割条)
|
|
35
|
+
*/
|
|
36
|
+
export declare const getSplitterLineStyle: (layout: "horizontal" | "vertical", lineColor: string | undefined, lineHoverColor: string | undefined, isDragging: boolean, isActive?: boolean) => CSSProperties;
|
|
37
|
+
/**
|
|
38
|
+
* 获取拖拽遮罩层样式
|
|
39
|
+
* 用于拖拽时覆盖整个页面防止事件穿透
|
|
40
|
+
*/
|
|
41
|
+
export declare const getDragOverlayStyle: () => CSSProperties;
|
|
42
|
+
/**
|
|
43
|
+
* 解析尺寸配置为数组
|
|
44
|
+
* @param size - 尺寸配置(单值或数组)
|
|
45
|
+
* @param count - 面板数量
|
|
46
|
+
* @param defaultValue - 默认值
|
|
47
|
+
*/
|
|
48
|
+
export declare const parseSizeConfig: (size: number | string | (number | string)[] | undefined, count: number, defaultValue?: number | string) => (number | string)[];
|
|
49
|
+
/**
|
|
50
|
+
* 解析数字配置为数组
|
|
51
|
+
* @param value - 数值配置(单值或数组)
|
|
52
|
+
* @param count - 面板数量
|
|
53
|
+
* @param defaultValue - 默认值
|
|
54
|
+
*/
|
|
55
|
+
export declare const parseNumberConfig: (value: number | number[] | undefined, count: number, defaultValue: number) => number[];
|
|
56
|
+
/**
|
|
57
|
+
* 将尺寸值转换为像素
|
|
58
|
+
* @param size - 尺寸值(数字或百分比字符串)
|
|
59
|
+
* @param availableSpace - 可用空间
|
|
60
|
+
*/
|
|
61
|
+
export declare const parseSizeToPixels: (size: number | string, availableSpace: number) => number;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Splitter 组件类型定义
|
|
3
|
+
* 用于自由切分指定区域,支持水平和垂直分隔,支持多面板
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
/**
|
|
7
|
+
* 单个面板配置
|
|
8
|
+
*/
|
|
9
|
+
export interface SplitterPanel {
|
|
10
|
+
/** 面板内容 */
|
|
11
|
+
content: React.ReactNode;
|
|
12
|
+
/** 面板默认大小(像素或百分比) */
|
|
13
|
+
defaultSize?: number | string;
|
|
14
|
+
/** 面板最小尺寸 */
|
|
15
|
+
minSize?: number;
|
|
16
|
+
/** 面板最大尺寸 */
|
|
17
|
+
maxSize?: number;
|
|
18
|
+
/** 是否禁用该面板相邻的分割条拖拽 */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Splitter 组件 Props
|
|
23
|
+
*/
|
|
24
|
+
export interface SplitterProps {
|
|
25
|
+
/** 布局方向 */
|
|
26
|
+
layout?: 'horizontal' | 'vertical';
|
|
27
|
+
/**
|
|
28
|
+
* 面板数组,支持多面板配置
|
|
29
|
+
* 当提供 panels 时,优先使用 panels,忽略 left/right/top/bottom/children
|
|
30
|
+
*/
|
|
31
|
+
panels?: SplitterPanel[];
|
|
32
|
+
/**
|
|
33
|
+
* 默认大小配置(像素或百分比)
|
|
34
|
+
* 可以是单个值(用于2面板模式)或数组(用于多面板模式)
|
|
35
|
+
* 默认为 '50%' 或 ['33%', '33%', '33%']
|
|
36
|
+
*/
|
|
37
|
+
defaultSize?: number | string | (number | string)[];
|
|
38
|
+
/**
|
|
39
|
+
* 最小尺寸配置
|
|
40
|
+
* 可以是单个值或数组
|
|
41
|
+
*/
|
|
42
|
+
minSize?: number | number[];
|
|
43
|
+
/**
|
|
44
|
+
* 最大尺寸配置
|
|
45
|
+
* 可以是单个值或数组
|
|
46
|
+
*/
|
|
47
|
+
maxSize?: number | number[];
|
|
48
|
+
/** 分割条大小(像素),默认为 10 */
|
|
49
|
+
splitterSize?: number;
|
|
50
|
+
/** 拖拽线颜色 */
|
|
51
|
+
lineColor?: string;
|
|
52
|
+
/** 拖拽线悬停/拖拽时的颜色 */
|
|
53
|
+
lineHoverColor?: string;
|
|
54
|
+
/** 是否禁用所有拖拽 */
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* 拖拽时的回调
|
|
58
|
+
* @param sizes - 所有面板的当前尺寸数组
|
|
59
|
+
* @param index - 正在拖拽的分割条索引
|
|
60
|
+
*/
|
|
61
|
+
onResize?: (sizes: number[], index: number) => void;
|
|
62
|
+
/**
|
|
63
|
+
* 拖拽结束后的回调
|
|
64
|
+
* @param sizes - 所有面板的最终尺寸数组
|
|
65
|
+
*/
|
|
66
|
+
onResizeEnd?: (sizes: number[]) => void;
|
|
67
|
+
/** 自定义类名 */
|
|
68
|
+
className?: string;
|
|
69
|
+
/** 自定义样式 */
|
|
70
|
+
style?: React.CSSProperties;
|
|
71
|
+
/** @deprecated 请使用 panels 或 children */
|
|
72
|
+
left?: React.ReactNode;
|
|
73
|
+
/** @deprecated 请使用 panels 或 children */
|
|
74
|
+
right?: React.ReactNode;
|
|
75
|
+
/** @deprecated 请使用 panels 或 children */
|
|
76
|
+
top?: React.ReactNode;
|
|
77
|
+
/** @deprecated 请使用 panels 或 children */
|
|
78
|
+
bottom?: React.ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* 子元素数组
|
|
81
|
+
* 用于2面板模式时传入 [面板1, 面板2]
|
|
82
|
+
* 用于多面板模式时传入任意数量的面板
|
|
83
|
+
*/
|
|
84
|
+
children?: React.ReactNode[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 单个拖拽状态
|
|
88
|
+
*/
|
|
89
|
+
export interface DragState {
|
|
90
|
+
/** 是否正在拖拽 */
|
|
91
|
+
isDragging: boolean;
|
|
92
|
+
/** 拖拽开始时的鼠标/触摸位置 */
|
|
93
|
+
startPosition: number;
|
|
94
|
+
/** 拖拽开始时的各面板尺寸 */
|
|
95
|
+
startSizes: number[];
|
|
96
|
+
/** 容器尺寸 */
|
|
97
|
+
containerSize: number;
|
|
98
|
+
/** 正在拖拽的分割条索引 */
|
|
99
|
+
splitterIndex: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 面板尺寸信息
|
|
103
|
+
*/
|
|
104
|
+
export interface PanelSizeInfo {
|
|
105
|
+
/** 面板索引 */
|
|
106
|
+
index: number;
|
|
107
|
+
/** 面板当前尺寸 */
|
|
108
|
+
size: number;
|
|
109
|
+
/** 面板最小尺寸 */
|
|
110
|
+
minSize: number;
|
|
111
|
+
/** 面板最大尺寸 */
|
|
112
|
+
maxSize: number;
|
|
113
|
+
/** 默认尺寸 */
|
|
114
|
+
defaultSize: number | string;
|
|
115
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './TimePicker.css';
|
|
3
|
+
import { TimePickerProps } from './types';
|
|
4
|
+
import RangePicker from './RangePicker';
|
|
5
|
+
declare const TimePicker: React.FC<TimePickerProps> & {
|
|
6
|
+
RangePicker: typeof RangePicker;
|
|
7
|
+
};
|
|
8
|
+
export default TimePicker;
|
|
9
|
+
export type { TimePickerProps };
|
|
10
|
+
export { RangePicker };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const TimePickerContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
2
|
+
width?: string | number;
|
|
3
|
+
}>> & string;
|
|
4
|
+
export declare const TimePickerTrigger: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
5
|
+
focused?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}>> & string;
|
|
8
|
+
export declare const TimePickerValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
9
|
+
isPlaceholder?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}>> & string;
|
|
12
|
+
export declare const TimePickerSuffix: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
13
|
+
export declare const TimePickerClear: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
}>> & string;
|
|
16
|
+
export declare const TimePickerIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
17
|
+
open?: boolean;
|
|
18
|
+
}>> & string;
|
|
19
|
+
export declare const TimePickerDropdown: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
20
|
+
top: number;
|
|
21
|
+
left: number;
|
|
22
|
+
minWidth: number;
|
|
23
|
+
}>> & string;
|
|
24
|
+
export declare const TimePickerPanel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
25
|
+
export declare const TimeColumn: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
26
|
+
export declare const TimeColumnHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
27
|
+
export declare const TimeColumnList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
28
|
+
export declare const TimeOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
29
|
+
selected?: boolean;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
}>> & string;
|
|
32
|
+
export declare const TimePickerLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
33
|
+
export declare const TimePickerWithLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|