@zjpcy/simple-design 1.2.3 → 1.2.11
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/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/Anchor/index.js +1 -1
- package/dist/es/Button/Button.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 -0
- 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 -0
- package/dist/es/Dropdown/index.js +1 -1
- package/dist/es/Form/index.js +1 -1
- package/dist/es/Grid/index.js +1 -0
- package/dist/es/Grid/styles.js +1 -0
- package/dist/es/Hooks/useClickOutside.js +1 -0
- package/dist/es/Input/InputBase.js +1 -1
- package/dist/es/Input/Number.js +1 -1
- package/dist/es/Input/Password.js +1 -0
- package/dist/es/Input/Textarea.js +1 -0
- package/dist/es/Input/index.js +1 -1
- package/dist/es/Label/styles.js +1 -1
- package/dist/es/Layout/LayoutContext.js +1 -0
- package/dist/es/Layout/index.js +1 -0
- package/dist/es/Layout/styles.js +1 -0
- 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 -0
- package/dist/es/Progress/index.js +1 -0
- 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/Switch/styles.js +1 -1
- package/dist/es/Table/SortableRow.js +1 -0
- package/dist/es/Table/index.js +1 -1
- package/dist/es/Tag/index.js +1 -0
- 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/index.css +1 -1
- package/dist/es/index.js +1 -1
- package/dist/types/components/Button/Button.d.ts +3 -2
- 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/Drawer/index.d.ts +6 -0
- package/dist/types/components/Drawer/styles.d.ts +0 -0
- package/dist/types/components/Drawer/types.d.ts +71 -0
- package/dist/types/components/Grid/index.d.ts +14 -0
- package/dist/types/components/Grid/styles.d.ts +22 -0
- package/dist/types/components/Grid/types.d.ts +49 -0
- package/dist/types/components/Input/AutoComplete.d.ts +0 -0
- package/dist/types/components/Input/InputBase.d.ts +4 -0
- package/dist/types/components/Input/Password.d.ts +13 -0
- package/dist/types/components/Input/Textarea.d.ts +51 -0
- package/dist/types/components/Input/index.d.ts +6 -2
- package/dist/types/components/Layout/LayoutContext.d.ts +15 -0
- package/dist/types/components/Layout/index.d.ts +86 -0
- package/dist/types/components/Layout/styles.d.ts +40 -0
- package/dist/types/components/Layout/types.d.ts +112 -0
- package/dist/types/components/Menu/index.d.ts +8 -1
- package/dist/types/components/Menu/styles.d.ts +7 -0
- package/dist/types/components/Menu/types.d.ts +56 -7
- 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/index.d.ts +6 -0
- package/dist/types/components/Popconfirm/types.d.ts +30 -0
- package/dist/types/components/Progress/index.d.ts +6 -0
- package/dist/types/components/Progress/styles.d.ts +0 -0
- package/dist/types/components/Progress/types.d.ts +59 -0
- 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/Table/SortableRow.d.ts +26 -0
- package/dist/types/components/Table/index.d.ts +5 -1
- package/dist/types/components/Tag/index.d.ts +6 -0
- package/dist/types/components/Tag/styles.d.ts +52 -0
- package/dist/types/components/Tag/types.d.ts +46 -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/index.d.ts +20 -2
- package/dist/variables.css +39 -0
- package/package.json +2 -1
- package/dist/es/Navigation/index.js +0 -1
- package/dist/types/components/Navigation/index.d.ts +0 -5
- package/dist/types/components/Navigation/types.d.ts +0 -43
|
@@ -5,14 +5,26 @@ export interface PaginationProps {
|
|
|
5
5
|
pageSize?: number;
|
|
6
6
|
defaultPageSize?: number;
|
|
7
7
|
onChange?: (current: number, pageSize: number) => void;
|
|
8
|
-
pageSizeOptions?: string[];
|
|
8
|
+
pageSizeOptions?: (string | number)[];
|
|
9
9
|
showSizeChanger?: boolean;
|
|
10
10
|
showQuickJumper?: boolean;
|
|
11
11
|
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
|
|
12
12
|
size?: 'default' | 'small';
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
* 简洁模式
|
|
15
|
+
*/
|
|
16
|
+
simple?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 禁用状态
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 只有一页时隐藏
|
|
23
|
+
*/
|
|
24
|
+
hideOnSinglePage?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 分页组件位置对齐方式
|
|
27
|
+
*/
|
|
16
28
|
align?: 'flex-start' | 'center' | 'flex-end';
|
|
17
29
|
/**
|
|
18
30
|
* 自定义CSS类名
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type PopconfirmPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
3
|
+
export type PopconfirmType = 'info' | 'success' | 'warning' | 'error' | 'danger';
|
|
4
|
+
export interface PopconfirmProps {
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
okText?: string;
|
|
8
|
+
cancelText?: string;
|
|
9
|
+
okButtonProps?: {
|
|
10
|
+
variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'link';
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
cancelButtonProps?: {
|
|
15
|
+
variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'link';
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
onConfirm?: () => void | Promise<void>;
|
|
19
|
+
onCancel?: () => void;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
type?: PopconfirmType;
|
|
23
|
+
placement?: PopconfirmPlacement;
|
|
24
|
+
showCancel?: boolean;
|
|
25
|
+
getContainer?: HTMLElement | (() => HTMLElement) | false;
|
|
26
|
+
className?: string;
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
children: React.ReactElement;
|
|
29
|
+
}
|
|
30
|
+
export default PopconfirmProps;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProgressProps, ProgressStatus, ProgressType, ProgressSegment } from './types';
|
|
3
|
+
import './Progress.css';
|
|
4
|
+
declare const Progress: React.FC<ProgressProps>;
|
|
5
|
+
export default Progress;
|
|
6
|
+
export type { ProgressProps, ProgressType, ProgressStatus, ProgressSegment };
|
|
File without changes
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ProgressType = 'line' | 'circle' | 'dashboard';
|
|
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
|
+
}
|
|
19
|
+
export interface ProgressProps {
|
|
20
|
+
/** 百分比 */
|
|
21
|
+
percent?: number;
|
|
22
|
+
/** 类型 */
|
|
23
|
+
type?: ProgressType;
|
|
24
|
+
/** 状态 */
|
|
25
|
+
status?: ProgressStatus;
|
|
26
|
+
/** 是否显示百分比文字 */
|
|
27
|
+
showInfo?: boolean;
|
|
28
|
+
/** 自定义显示文字 */
|
|
29
|
+
format?: (percent?: number, successPercent?: number) => ReactNode;
|
|
30
|
+
/** 进度条颜色,支持纯色字符串或渐变对象 */
|
|
31
|
+
strokeColor?: string | GradientConfig;
|
|
32
|
+
/** 背景颜色 */
|
|
33
|
+
trailColor?: string;
|
|
34
|
+
/** 线条粗细 */
|
|
35
|
+
strokeWidth?: number;
|
|
36
|
+
/** 线条宽度,type=line 时生效 */
|
|
37
|
+
size?: 'small' | 'default' | 'large';
|
|
38
|
+
/** 是否开启动画 */
|
|
39
|
+
transition?: boolean;
|
|
40
|
+
/** 步骤进度条的总步数 */
|
|
41
|
+
steps?: number;
|
|
42
|
+
/** 多段颜色配置,用于展示多个进度段 */
|
|
43
|
+
segments?: ProgressSegment[];
|
|
44
|
+
/** 是否开启仪表盘样式 */
|
|
45
|
+
gapDegree?: number;
|
|
46
|
+
/** 仪表盘缺口位置 */
|
|
47
|
+
gapPosition?: 'top' | 'bottom' | 'left' | 'right';
|
|
48
|
+
/** 前缀图标 */
|
|
49
|
+
icon?: ReactNode;
|
|
50
|
+
/** 前缀文字 */
|
|
51
|
+
prefix?: string;
|
|
52
|
+
/** 后缀文字 */
|
|
53
|
+
suffix?: string;
|
|
54
|
+
/** 自定义内部内容,支持 ReactNode,优先级高于默认的进度显示 */
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
className?: string;
|
|
57
|
+
style?: React.CSSProperties;
|
|
58
|
+
}
|
|
59
|
+
export default ProgressProps;
|
|
@@ -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,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Column } from './index';
|
|
3
|
+
interface SortableRowProps {
|
|
4
|
+
id: string;
|
|
5
|
+
record: any;
|
|
6
|
+
rowIndex: number;
|
|
7
|
+
columns: Column[];
|
|
8
|
+
columnWidths: number[];
|
|
9
|
+
fixedLeftColumns: Column[];
|
|
10
|
+
fixedRightColumns: Column[];
|
|
11
|
+
normalColumns: Column[];
|
|
12
|
+
allColumns: Column[];
|
|
13
|
+
editingCell: {
|
|
14
|
+
rowIndex: number;
|
|
15
|
+
colKey: string;
|
|
16
|
+
} | null;
|
|
17
|
+
editingValue: string;
|
|
18
|
+
handleEdit: (rowIndex: number, colKey: string, value: any) => void;
|
|
19
|
+
handleSave: (record: any, column: Column) => void;
|
|
20
|
+
handleCancel: () => void;
|
|
21
|
+
setEditingValue: (value: string) => void;
|
|
22
|
+
renderTableCell: (column: Column, record: any, rowIndex: number, colIndex: number, colGroup: Column[]) => React.ReactNode;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
declare const SortableRow: React.FC<SortableRowProps>;
|
|
26
|
+
export default SortableRow;
|
|
@@ -44,6 +44,10 @@ interface TableProps {
|
|
|
44
44
|
loadingText?: ReactNode;
|
|
45
45
|
/** 加载延迟时间(毫秒),设置后loading状态会在指定时间后自动取消 */
|
|
46
46
|
loadingDelay?: number;
|
|
47
|
+
/** 是否开启行拖拽功能 */
|
|
48
|
+
draggable?: boolean;
|
|
49
|
+
/** 拖拽结束时的回调函数,返回新的数据顺序 */
|
|
50
|
+
onDragEnd?: (newData: any[]) => void;
|
|
47
51
|
}
|
|
48
|
-
declare const Table: ({ dataSource, columns, bordered, scroll, rowKey, className, pagination, empty, loading, loadingText, loadingDelay }: TableProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
declare const Table: ({ dataSource, columns, bordered, scroll, rowKey, className, pagination, empty, loading, loadingText, loadingDelay, draggable, onDragEnd, }: TableProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
53
|
export default Table;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { TagSize } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 获取标签尺寸对应的样式
|
|
5
|
+
*/
|
|
6
|
+
export declare const getTagSizeStyle: (size: TagSize) => CSSProperties;
|
|
7
|
+
/**
|
|
8
|
+
* 获取标签颜色样式
|
|
9
|
+
*/
|
|
10
|
+
export declare const getTagColorStyle: (backgroundColor?: string, color?: string) => CSSProperties;
|
|
11
|
+
/**
|
|
12
|
+
* 预设标签颜色
|
|
13
|
+
*/
|
|
14
|
+
export declare const presetTagColors: {
|
|
15
|
+
readonly red: {
|
|
16
|
+
readonly backgroundColor: "#fff2f0";
|
|
17
|
+
readonly color: "#ff4d4f";
|
|
18
|
+
};
|
|
19
|
+
readonly orange: {
|
|
20
|
+
readonly backgroundColor: "#fff7e6";
|
|
21
|
+
readonly color: "#fa8c16";
|
|
22
|
+
};
|
|
23
|
+
readonly gold: {
|
|
24
|
+
readonly backgroundColor: "#fffbe6";
|
|
25
|
+
readonly color: "#faad14";
|
|
26
|
+
};
|
|
27
|
+
readonly green: {
|
|
28
|
+
readonly backgroundColor: "#f6ffed";
|
|
29
|
+
readonly color: "#52c41a";
|
|
30
|
+
};
|
|
31
|
+
readonly cyan: {
|
|
32
|
+
readonly backgroundColor: "#e6fffb";
|
|
33
|
+
readonly color: "#13c2c2";
|
|
34
|
+
};
|
|
35
|
+
readonly blue: {
|
|
36
|
+
readonly backgroundColor: "#e6f7ff";
|
|
37
|
+
readonly color: "#1890ff";
|
|
38
|
+
};
|
|
39
|
+
readonly purple: {
|
|
40
|
+
readonly backgroundColor: "#f9f0ff";
|
|
41
|
+
readonly color: "#722ed1";
|
|
42
|
+
};
|
|
43
|
+
readonly pink: {
|
|
44
|
+
readonly backgroundColor: "#fff0f6";
|
|
45
|
+
readonly color: "#eb2f96";
|
|
46
|
+
};
|
|
47
|
+
readonly gray: {
|
|
48
|
+
readonly backgroundColor: "#f5f5f5";
|
|
49
|
+
readonly color: "#666";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export type PresetTagColor = keyof typeof presetTagColors;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TagSize = 'small' | 'medium' | 'large';
|
|
3
|
+
export interface TagProps {
|
|
4
|
+
/**
|
|
5
|
+
* 标签内容
|
|
6
|
+
*/
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* 自定义类名
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 自定义样式
|
|
14
|
+
*/
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
/**
|
|
17
|
+
* 标签尺寸
|
|
18
|
+
* @default 'medium'
|
|
19
|
+
*/
|
|
20
|
+
size?: TagSize;
|
|
21
|
+
/**
|
|
22
|
+
* 自定义背景色
|
|
23
|
+
*/
|
|
24
|
+
backgroundColor?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 自定义字体颜色
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 前缀图标,可以是 Icon 组件的 type 字符串或自定义 React 节点
|
|
31
|
+
*/
|
|
32
|
+
icon?: string | React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* 是否可关闭
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
closable?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 关闭时的回调
|
|
40
|
+
*/
|
|
41
|
+
onClose?: (e: React.MouseEvent) => void;
|
|
42
|
+
/**
|
|
43
|
+
* 点击标签时的回调
|
|
44
|
+
*/
|
|
45
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
46
|
+
}
|
|
@@ -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;
|