@zjpcy/simple-design 1.2.10 → 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/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/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/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/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/index.css +1 -1
- package/dist/es/index.js +1 -1
- 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/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/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 +8 -0
- package/dist/variables.css +39 -0
- package/package.json +2 -1
- package/dist/types/components/Popconfirm/styles.d.ts +0 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** Tooltip 配置 */
|
|
3
|
+
export interface TreeNodeTooltip {
|
|
4
|
+
/** Tooltip 内容 */
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
/** 位置 */
|
|
7
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
8
|
+
/** 触发方式 */
|
|
9
|
+
trigger?: 'hover' | 'click';
|
|
10
|
+
/** 延迟显示时间(毫秒) */
|
|
11
|
+
delay?: number;
|
|
12
|
+
/** 自定义背景色 */
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
/** 自定义样式 */
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
/** 自定义类名 */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TreeNode {
|
|
20
|
+
/** 节点唯一标识 */
|
|
21
|
+
key: string | number;
|
|
22
|
+
/** 节点标题 */
|
|
23
|
+
title: React.ReactNode;
|
|
24
|
+
/** 节点图标 */
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
/** 子节点 */
|
|
27
|
+
children?: TreeNode[];
|
|
28
|
+
/** 是否禁用 */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** 是否禁用复选框 */
|
|
31
|
+
disableCheckbox?: boolean;
|
|
32
|
+
/** 是否选中 */
|
|
33
|
+
checked?: boolean;
|
|
34
|
+
/** 是否半选 */
|
|
35
|
+
halfChecked?: boolean;
|
|
36
|
+
/** 是否展开 */
|
|
37
|
+
expanded?: boolean;
|
|
38
|
+
/** 是否叶子节点 */
|
|
39
|
+
isLeaf?: boolean;
|
|
40
|
+
/** 加载中 */
|
|
41
|
+
loading?: boolean;
|
|
42
|
+
/** 节点类名 */
|
|
43
|
+
className?: string;
|
|
44
|
+
/** 节点样式 */
|
|
45
|
+
style?: React.CSSProperties;
|
|
46
|
+
/** 自定义渲染 */
|
|
47
|
+
render?: (node: TreeNode) => React.ReactNode;
|
|
48
|
+
/** 节点拖拽相关 */
|
|
49
|
+
draggable?: boolean;
|
|
50
|
+
/** Tooltip 配置,默认不启用 */
|
|
51
|
+
tooltip?: TreeNodeTooltip | boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface TreeProps {
|
|
54
|
+
/** 树数据 */
|
|
55
|
+
treeData?: TreeNode[];
|
|
56
|
+
/** 默认展开的键 */
|
|
57
|
+
defaultExpandedKeys?: (string | number)[];
|
|
58
|
+
/** 展开的键(受控) */
|
|
59
|
+
expandedKeys?: (string | number)[];
|
|
60
|
+
/** 展开/收起回调 */
|
|
61
|
+
onExpand?: (expandedKeys: (string | number)[], { expanded, node, nativeEvent }: {
|
|
62
|
+
expanded: boolean;
|
|
63
|
+
node: TreeNode;
|
|
64
|
+
nativeEvent: MouseEvent;
|
|
65
|
+
}) => void;
|
|
66
|
+
/** 默认选中的键 */
|
|
67
|
+
defaultSelectedKeys?: (string | number)[];
|
|
68
|
+
/** 选中的键(受控) */
|
|
69
|
+
selectedKeys?: (string | number)[];
|
|
70
|
+
/** 选中回调 */
|
|
71
|
+
onSelect?: (selectedKeys: (string | number)[], { selected, node, nativeEvent }: {
|
|
72
|
+
selected: boolean;
|
|
73
|
+
node: TreeNode;
|
|
74
|
+
nativeEvent: MouseEvent;
|
|
75
|
+
}) => void;
|
|
76
|
+
/** 默认勾选的键 */
|
|
77
|
+
defaultCheckedKeys?: (string | number)[];
|
|
78
|
+
/** 勾选的键(受控) */
|
|
79
|
+
checkedKeys?: (string | number)[];
|
|
80
|
+
/** 勾选回调 */
|
|
81
|
+
onCheck?: (checkedKeys: (string | number)[], { checked, node, nativeEvent }: {
|
|
82
|
+
checked: boolean;
|
|
83
|
+
node: TreeNode;
|
|
84
|
+
nativeEvent: MouseEvent;
|
|
85
|
+
}) => void;
|
|
86
|
+
/** 是否显示复选框 */
|
|
87
|
+
checkable?: boolean;
|
|
88
|
+
/** 是否父子关联 */
|
|
89
|
+
checkStrictly?: boolean;
|
|
90
|
+
/** 是否支持多选 */
|
|
91
|
+
multiple?: boolean;
|
|
92
|
+
/** 是否支持搜索 */
|
|
93
|
+
showSearch?: boolean;
|
|
94
|
+
/** 搜索匹配高亮 */
|
|
95
|
+
filterOption?: (search: string, node: TreeNode) => boolean;
|
|
96
|
+
/** 自定义搜索匹配渲染 */
|
|
97
|
+
renderSearch?: (search: string, node: TreeNode) => React.ReactNode;
|
|
98
|
+
/** 是否显示连接线 */
|
|
99
|
+
showLine?: boolean;
|
|
100
|
+
/** 是否显示缩进标识 */
|
|
101
|
+
showIndent?: boolean;
|
|
102
|
+
/** 是否显示图标 */
|
|
103
|
+
showIcon?: boolean;
|
|
104
|
+
/** 是否异步加载数据 */
|
|
105
|
+
loadData?: (node: TreeNode) => Promise<void>;
|
|
106
|
+
/** 动画时长(毫秒) */
|
|
107
|
+
motionDuration?: number;
|
|
108
|
+
/** 是否支持拖拽 */
|
|
109
|
+
draggable?: boolean;
|
|
110
|
+
/** 拖拽开始回调 */
|
|
111
|
+
onDragStart?: (params: {
|
|
112
|
+
event: MouseEvent;
|
|
113
|
+
node: TreeNode;
|
|
114
|
+
}) => void;
|
|
115
|
+
/** 拖拽进入回调 */
|
|
116
|
+
onDragEnter?: (params: {
|
|
117
|
+
event: MouseEvent;
|
|
118
|
+
node: TreeNode;
|
|
119
|
+
}) => void;
|
|
120
|
+
/** 拖拽放置回调 */
|
|
121
|
+
onDrop?: (params: {
|
|
122
|
+
event: MouseEvent;
|
|
123
|
+
node: TreeNode;
|
|
124
|
+
dragNode: TreeNode;
|
|
125
|
+
dragPosition: 'before' | 'after' | 'inside';
|
|
126
|
+
}) => void;
|
|
127
|
+
/** 拖拽结束回调 */
|
|
128
|
+
onDragEnd?: (params: {
|
|
129
|
+
event: MouseEvent;
|
|
130
|
+
node: TreeNode;
|
|
131
|
+
}) => void;
|
|
132
|
+
/** 是否支持动态添加节点 */
|
|
133
|
+
addable?: boolean;
|
|
134
|
+
/** 是否支持删除节点 */
|
|
135
|
+
removable?: boolean;
|
|
136
|
+
/** 是否支持编辑节点 */
|
|
137
|
+
editable?: boolean;
|
|
138
|
+
/** 操作按钮显示模式:'inline' 行内显示 | 'dropdown' 下拉菜单 */
|
|
139
|
+
actionDisplayMode?: 'inline' | 'dropdown';
|
|
140
|
+
/** 添加节点回调 - 返回新节点的初始数据 */
|
|
141
|
+
onAddNode?: (parentNode: TreeNode) => TreeNode | TreeNode[] | void;
|
|
142
|
+
/** 删除节点回调 - 返回 false 可阻止删除 */
|
|
143
|
+
onRemoveNode?: (node: TreeNode) => boolean | void;
|
|
144
|
+
/** 编辑节点回调 - 返回编辑后的标题 */
|
|
145
|
+
onEditNode?: (node: TreeNode, newTitle: string) => string | void;
|
|
146
|
+
/** 自定义节点渲染 */
|
|
147
|
+
renderNode?: (node: TreeNode) => React.ReactNode;
|
|
148
|
+
/** 节点前渲染 */
|
|
149
|
+
prefixCls?: string;
|
|
150
|
+
/** 类名 */
|
|
151
|
+
className?: string;
|
|
152
|
+
/** 样式 */
|
|
153
|
+
style?: React.CSSProperties;
|
|
154
|
+
/** 是否禁用 */
|
|
155
|
+
disabled?: boolean;
|
|
156
|
+
/** 是否自动展开父节点 */
|
|
157
|
+
autoExpandParent?: boolean;
|
|
158
|
+
/** 默认展开所有 */
|
|
159
|
+
defaultExpandAll?: boolean;
|
|
160
|
+
/** 展开动画 */
|
|
161
|
+
motion?: React.CSSProperties | ((node: TreeNode, isExpanded: boolean) => React.CSSProperties);
|
|
162
|
+
/** 全局 Tooltip 配置,默认关闭 */
|
|
163
|
+
tooltip?: TreeNodeTooltip | boolean;
|
|
164
|
+
}
|
|
165
|
+
export interface TreeNodeProps {
|
|
166
|
+
/** 节点数据 */
|
|
167
|
+
node: TreeNode;
|
|
168
|
+
/** 层级深度 */
|
|
169
|
+
level: number;
|
|
170
|
+
/** 是否展开 */
|
|
171
|
+
expanded: boolean;
|
|
172
|
+
/** 是否选中 */
|
|
173
|
+
selected: boolean;
|
|
174
|
+
/** 是否勾选 */
|
|
175
|
+
checked: boolean;
|
|
176
|
+
/** 是否半选 */
|
|
177
|
+
halfChecked: boolean;
|
|
178
|
+
/** 是否加载中 */
|
|
179
|
+
loading: boolean;
|
|
180
|
+
/** 是否叶子节点 */
|
|
181
|
+
isLeaf: boolean;
|
|
182
|
+
/** 父节点是否展开 */
|
|
183
|
+
parentExpanded: boolean;
|
|
184
|
+
/** 树组件属性 */
|
|
185
|
+
treeProps: TreeProps;
|
|
186
|
+
/** 展开节点 */
|
|
187
|
+
onExpand: (node: TreeNode, e: React.MouseEvent) => void;
|
|
188
|
+
/** 选择节点 */
|
|
189
|
+
onSelect: (node: TreeNode, e: React.MouseEvent) => void;
|
|
190
|
+
/** 勾选节点 */
|
|
191
|
+
onCheck: (node: TreeNode, e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
192
|
+
}
|
|
193
|
+
export interface TreeState {
|
|
194
|
+
/** 展开的键集合 */
|
|
195
|
+
expandedKeys: (string | number)[];
|
|
196
|
+
/** 选中的键集合 */
|
|
197
|
+
selectedKeys: (string | number)[];
|
|
198
|
+
/** 勾选的键集合 */
|
|
199
|
+
checkedKeys: (string | number)[];
|
|
200
|
+
/** 加载中的键集合 */
|
|
201
|
+
loadingKeys: (string | number)[];
|
|
202
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Button } from './Button';
|
|
2
|
+
export { default as Carousel } from './Carousel';
|
|
2
3
|
export { default as Cascader } from './Cascader';
|
|
3
4
|
export { default as TreeSelect } from './TreeSelect';
|
|
4
5
|
export { default as ColorPicker } from './ColorPicker';
|
|
@@ -12,6 +13,7 @@ export { default as Marquee } from './Marquee';
|
|
|
12
13
|
export { default as Message, MessageProvider, useMessage, message } from './Message';
|
|
13
14
|
export { default as Modal } from './Modal';
|
|
14
15
|
export { default as Notice } from './Notice/Notice';
|
|
16
|
+
export type { NoticeProps, NoticeType } from './Notice/Notice';
|
|
15
17
|
export { default as Notification } from './Notification/Notification';
|
|
16
18
|
export { default as Radio } from './Radio';
|
|
17
19
|
export { default as Select } from './Select';
|
|
@@ -47,3 +49,9 @@ export { default as Popconfirm } from './Popconfirm';
|
|
|
47
49
|
export type { PopconfirmProps, PopconfirmPlacement } from './Popconfirm';
|
|
48
50
|
export { default as Progress } from './Progress';
|
|
49
51
|
export type { ProgressProps, ProgressType, ProgressStatus } from './Progress';
|
|
52
|
+
export { default as TimePicker } from './TimePicker';
|
|
53
|
+
export type { TimePickerProps } from './TimePicker';
|
|
54
|
+
export { default as DatePicker } from './DatePicker';
|
|
55
|
+
export type { DatePickerProps, DateRangePickerProps } from './DatePicker';
|
|
56
|
+
export { default as Tree } from './Tree';
|
|
57
|
+
export type { TreeProps, TreeNode, TreeRef } from './Tree';
|
package/dist/variables.css
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* 主色调 - 主要用于强调和突出显示 */
|
|
4
4
|
--idp-primary-color: #1890ff; /* 主色调基础色 - 用于按钮、链接等主要交互元素 */
|
|
5
5
|
--idp-primary-hover-color: #40a9ff; /* 主色调悬停色 - 用于鼠标悬停状态 */
|
|
6
|
+
--idp-primary-light-color: rgba(24, 100, 240, 0.1); /* 主色调浅色 - 用于多选选中背景等 */
|
|
6
7
|
|
|
7
8
|
/* 辅助色 - 用于不同状态和场景 */
|
|
8
9
|
--idp-success-color: #52c41a; /* 成功色 - 用于成功状态、确认操作等 */
|
|
@@ -152,4 +153,42 @@
|
|
|
152
153
|
--idp-modal-container-bg: var(--idp-bg-color-white); /* 模态框容器背景色 */
|
|
153
154
|
--idp-modal-header-bg: var(--idp-bg-color); /* 模态框头部背景色 */
|
|
154
155
|
--idp-modal-footer-bg: var(--idp-bg-color); /* 模态框底部背景色 */
|
|
156
|
+
|
|
157
|
+
/* Progress 组件 - 进度条相关样式变量 */
|
|
158
|
+
--idp-progress-default-bg: var(--idp-primary-color); /* 进度条默认背景色 */
|
|
159
|
+
--idp-progress-default-bg-gradient: var(--idp-primary-hover-color); /* 进度条默认渐变色 */
|
|
160
|
+
--idp-progress-success-bg: var(--idp-success-color); /* 进度条成功背景色 */
|
|
161
|
+
--idp-progress-success-bg-gradient: #73d13d; /* 进度条成功渐变色 */
|
|
162
|
+
--idp-progress-exception-bg: var(--idp-error-color); /* 进度条异常背景色 */
|
|
163
|
+
--idp-progress-exception-bg-gradient: #ff7875; /* 进度条异常渐变色 */
|
|
164
|
+
--idp-progress-trail-bg: linear-gradient(135deg, var(--idp-bg-color-light) 0%, var(--idp-bg-color) 100%); /* 进度条轨道背景 */
|
|
165
|
+
--idp-progress-text-color: var(--idp-text-color); /* 进度条文字颜色 */
|
|
166
|
+
--idp-progress-shadow: 0 2px 8px rgba(24, 144, 255, 0.25); /* 进度条默认阴影 */
|
|
167
|
+
--idp-progress-shadow-success: 0 2px 8px rgba(82, 196, 26, 0.35); /* 进度条成功阴影 */
|
|
168
|
+
--idp-progress-shadow-exception: 0 2px 8px rgba(245, 34, 45, 0.35); /* 进度条异常阴影 */
|
|
169
|
+
|
|
170
|
+
/* Slider 组件 - 滑块相关样式变量 */
|
|
171
|
+
--idp-slider-track-height: 6px; /* 滑块轨道高度 */
|
|
172
|
+
--idp-slider-track-bg: linear-gradient(135deg, var(--idp-bg-color-light) 0%, var(--idp-border-color) 100%); /* 滑块轨道背景 */
|
|
173
|
+
--idp-slider-track-filled-bg: linear-gradient(135deg, var(--idp-primary-color) 0%, var(--idp-primary-hover-color) 100%); /* 滑块已填充轨道背景 */
|
|
174
|
+
--idp-slider-track-border-radius: var(--idp-border-radius-sm); /* 滑块轨道圆角 */
|
|
175
|
+
|
|
176
|
+
--idp-slider-handle-size: 18px; /* 滑块手柄大小 */
|
|
177
|
+
--idp-slider-handle-bg: var(--idp-bg-color-white); /* 滑块手柄背景 */
|
|
178
|
+
--idp-slider-handle-border: 2px solid var(--idp-primary-color); /* 滑块手柄边框 */
|
|
179
|
+
--idp-slider-handle-shadow: var(--idp-shadow-sm); /* 滑块手柄阴影 */
|
|
180
|
+
--idp-slider-handle-shadow-hover: var(--idp-shadow-md); /* 滑块手柄悬停阴影 */
|
|
181
|
+
--idp-slider-handle-shadow-active: 0 2px 8px rgba(24, 144, 255, 0.4); /* 滑块手柄激活阴影 */
|
|
182
|
+
|
|
183
|
+
--idp-slider-disabled-track-bg: linear-gradient(135deg, var(--idp-bg-color) 0%, var(--idp-border-color-light) 100%); /* 滑块禁用轨道背景 */
|
|
184
|
+
--idp-slider-disabled-filled-bg: linear-gradient(135deg, var(--idp-text-color-light) 0%, #d9d9d9 100%); /* 滑块禁用已填充背景 */
|
|
185
|
+
--idp-slider-disabled-handle-border: var(--idp-text-color-light); /* 滑块禁用手柄边框 */
|
|
186
|
+
|
|
187
|
+
--idp-slider-mark-color: var(--idp-text-color-tertiary); /* 滑块标记文字颜色 */
|
|
188
|
+
--idp-slider-mark-line-bg: var(--idp-border-color); /* 滑块标记线颜色 */
|
|
189
|
+
--idp-slider-value-color: var(--idp-text-color); /* 滑块值显示颜色 */
|
|
190
|
+
|
|
191
|
+
--idp-slider-tooltip-bg: rgba(0, 0, 0, 0.75); /* 滑块工具提示背景 */
|
|
192
|
+
--idp-slider-tooltip-color: var(--idp-bg-color-white); /* 滑块工具提示文字颜色 */
|
|
193
|
+
--idp-slider-tooltip-shadow: var(--idp-shadow-md); /* 滑块工具提示阴影 */
|
|
155
194
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zjpcy/simple-design",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"description": "IDP Studio Design System - React Component Library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"@dnd-kit/sortable": "^10.0.0",
|
|
81
81
|
"@dnd-kit/utilities": "^3.2.2",
|
|
82
82
|
"classnames": "^2.3.0",
|
|
83
|
+
"lunar-typescript": "^1.8.6",
|
|
83
84
|
"prismjs": "^1.30.0",
|
|
84
85
|
"react-color": "^2.19.3",
|
|
85
86
|
"react-syntax-highlighter": "^16.1.0",
|
|
File without changes
|