deepsea-components 1.0.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 +23 -0
- package/dist/esm/index.d.ts +251 -0
- package/dist/esm/index.js +654 -0
- package/dist/esm/index.js.map +1 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# deepsea-components
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.org/package/deepsea-components)
|
|
4
|
+
[](https://npmjs.org/package/deepsea-components)
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
$ yarn install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
$ npm run dev
|
|
14
|
+
$ npm run build
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
TODO
|
|
20
|
+
|
|
21
|
+
## LICENSE
|
|
22
|
+
|
|
23
|
+
MIT
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import React, { ButtonHTMLAttributes, CSSProperties, FC, HTMLAttributes, InputHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
|
|
3
|
+
export interface InputFileDataTypes {
|
|
4
|
+
base64: string;
|
|
5
|
+
text: string;
|
|
6
|
+
arrayBuffer: ArrayBuffer;
|
|
7
|
+
binary: string;
|
|
8
|
+
file: File;
|
|
9
|
+
}
|
|
10
|
+
export type InputFileDataType = keyof InputFileDataTypes;
|
|
11
|
+
export interface InputFileData<T> {
|
|
12
|
+
result: T;
|
|
13
|
+
file: File;
|
|
14
|
+
}
|
|
15
|
+
export type InputFileProps = ({
|
|
16
|
+
multiple?: false;
|
|
17
|
+
type: "base64" | "text" | "binary";
|
|
18
|
+
onChange?: (data: InputFileData<string>) => void;
|
|
19
|
+
} | {
|
|
20
|
+
multiple?: false;
|
|
21
|
+
type: "arrayBuffer";
|
|
22
|
+
onChange?: (data: InputFileData<ArrayBuffer>) => void;
|
|
23
|
+
} | {
|
|
24
|
+
multiple?: false;
|
|
25
|
+
type?: "file";
|
|
26
|
+
onChange?: (data: InputFileData<File>) => void;
|
|
27
|
+
} | {
|
|
28
|
+
multiple: true;
|
|
29
|
+
type: "base64" | "text" | "binary";
|
|
30
|
+
onChange?: (data: InputFileData<string>[]) => void;
|
|
31
|
+
} | {
|
|
32
|
+
multiple: true;
|
|
33
|
+
type: "arrayBuffer";
|
|
34
|
+
onChange?: (data: InputFileData<ArrayBuffer>[]) => void;
|
|
35
|
+
} | {
|
|
36
|
+
multiple: true;
|
|
37
|
+
type?: "file";
|
|
38
|
+
onChange?: (data: InputFileData<File>[]) => void;
|
|
39
|
+
}) & Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "multiple" | "type">;
|
|
40
|
+
export declare function getFileData<T extends InputFileDataType>(file: File, type: T): Promise<InputFileDataTypes[T]>;
|
|
41
|
+
/** 专用与读取文件的组件 */
|
|
42
|
+
export declare const InputFile: React.ForwardRefExoticComponent<InputFileProps & React.RefAttributes<HTMLInputElement>>;
|
|
43
|
+
export interface ImportExcelProps extends Omit<InputFileProps, "multiple" | "onChange" | "accept" | "type"> {
|
|
44
|
+
onChange?: (data: Record<string, string>[]) => void;
|
|
45
|
+
}
|
|
46
|
+
/** 专门用于读取 excel 的组件 */
|
|
47
|
+
export declare const ImportExcel: React.ForwardRefExoticComponent<ImportExcelProps & React.RefAttributes<HTMLInputElement>>;
|
|
48
|
+
/** 手动导出 excel */
|
|
49
|
+
export declare function exportExcel(data: Record<string, string>[], name: string): void;
|
|
50
|
+
export interface ExportExcelProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
51
|
+
data: Record<string, string>[];
|
|
52
|
+
fileName: string;
|
|
53
|
+
}
|
|
54
|
+
/** 导出 excel 的 button 组件 */
|
|
55
|
+
export declare const ExportExcel: React.ForwardRefExoticComponent<ExportExcelProps & React.RefAttributes<HTMLButtonElement>>;
|
|
56
|
+
export interface TransitionBoxProps extends HTMLAttributes<HTMLDivElement> {
|
|
57
|
+
containerClassName?: string;
|
|
58
|
+
containerStyle?: CSSProperties;
|
|
59
|
+
vertical?: boolean;
|
|
60
|
+
horizontal?: boolean;
|
|
61
|
+
time?: number;
|
|
62
|
+
}
|
|
63
|
+
/** 尺寸渐变的组件 */
|
|
64
|
+
export declare const TransitionBox: FC<TransitionBoxProps>;
|
|
65
|
+
export interface SeaRadarTarget {
|
|
66
|
+
/** 半径 */
|
|
67
|
+
radius: number;
|
|
68
|
+
/** 弧度 */
|
|
69
|
+
angle: number;
|
|
70
|
+
/** 元素 */
|
|
71
|
+
element: ReactNode;
|
|
72
|
+
}
|
|
73
|
+
export interface SeaRadarProps {
|
|
74
|
+
/** 最小圆的半径 */
|
|
75
|
+
unitRadius?: number;
|
|
76
|
+
/** 一共的全数 */
|
|
77
|
+
circleCount?: number;
|
|
78
|
+
/** 角度分成多少份 */
|
|
79
|
+
directionCount?: number;
|
|
80
|
+
/** 圈的宽度 */
|
|
81
|
+
circleWidth?: number;
|
|
82
|
+
/** 圈的颜色 */
|
|
83
|
+
circleColor: string;
|
|
84
|
+
/** 角度的宽度 */
|
|
85
|
+
directionWidth?: number;
|
|
86
|
+
/** 角度颜色 */
|
|
87
|
+
directionColor: string;
|
|
88
|
+
/** 背景色 */
|
|
89
|
+
backgroundColor: string;
|
|
90
|
+
/** 扫描的颜色 */
|
|
91
|
+
scanColor: string;
|
|
92
|
+
/** 扫描的弧度 */
|
|
93
|
+
scanAngle?: number;
|
|
94
|
+
/** 扫描一周的时间,单位秒 */
|
|
95
|
+
period?: number;
|
|
96
|
+
/** 目标列表 */
|
|
97
|
+
targets?: SeaRadarTarget[];
|
|
98
|
+
/** 展示圈 */
|
|
99
|
+
showCircle?: boolean;
|
|
100
|
+
/** 展示方位 */
|
|
101
|
+
showDirection?: boolean;
|
|
102
|
+
/** 展示刻度线 */
|
|
103
|
+
showGraduationLine?: boolean;
|
|
104
|
+
/** 展示刻度文字 */
|
|
105
|
+
showGraduationText?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/** 雷达组件 */
|
|
108
|
+
export declare const SeaRadar: FC<SeaRadarProps>;
|
|
109
|
+
export interface RingProps extends HTMLAttributes<HTMLDivElement> {
|
|
110
|
+
outerWidth: number;
|
|
111
|
+
innerWidth: number;
|
|
112
|
+
}
|
|
113
|
+
/** 忘了什么组件 */
|
|
114
|
+
export declare const Ring: FC<RingProps>;
|
|
115
|
+
export interface FlowSizeData {
|
|
116
|
+
/** 容器宽度 */
|
|
117
|
+
width: number;
|
|
118
|
+
/** 容器高度 */
|
|
119
|
+
height: number;
|
|
120
|
+
/** 元素宽度 */
|
|
121
|
+
itemWidth: number;
|
|
122
|
+
/** 元素高度 */
|
|
123
|
+
itemHeight: number;
|
|
124
|
+
/** 列间距 */
|
|
125
|
+
columnGap: number;
|
|
126
|
+
/** 列数 */
|
|
127
|
+
columnCount: number;
|
|
128
|
+
/** 行间距 */
|
|
129
|
+
rowGap: number;
|
|
130
|
+
/** 行数 */
|
|
131
|
+
rowCount: number;
|
|
132
|
+
/** 元素格数 */
|
|
133
|
+
itemCount: number;
|
|
134
|
+
/** 最大行数 */
|
|
135
|
+
maxRows: number | null;
|
|
136
|
+
/** 是否有元素被隐藏 */
|
|
137
|
+
overflow: boolean;
|
|
138
|
+
}
|
|
139
|
+
export interface FlowProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
140
|
+
/** 元素宽度 */
|
|
141
|
+
itemWidth: number;
|
|
142
|
+
/** 元素高度 */
|
|
143
|
+
itemHeight: number;
|
|
144
|
+
/** 列间距 */
|
|
145
|
+
columnGap?: number | null | (number | null)[];
|
|
146
|
+
/** 行间距 */
|
|
147
|
+
rowGap?: number;
|
|
148
|
+
/** 最大行数 */
|
|
149
|
+
maxRows?: number | null;
|
|
150
|
+
/** 源数据 */
|
|
151
|
+
data: T[];
|
|
152
|
+
/** 渲染 */
|
|
153
|
+
render: (item: T, index: number, hidden: boolean) => ReactNode;
|
|
154
|
+
/** key释放器,默认为 index */
|
|
155
|
+
keyExactor?: (item: T, index: number) => string | number;
|
|
156
|
+
/** 容器类名 */
|
|
157
|
+
containerClassName?: string;
|
|
158
|
+
/** 容器样式 */
|
|
159
|
+
containerStyle?: CSSProperties;
|
|
160
|
+
/** 节流时间,单位毫秒,默认200ms,传入 null 不节流 */
|
|
161
|
+
throttle?: number | null;
|
|
162
|
+
/** 动画时间,单位毫秒,默认400ms,传入 null 不展示动画 */
|
|
163
|
+
transitionDuration?: number | null;
|
|
164
|
+
/** 变化的回调函数 */
|
|
165
|
+
onSizeChange?: (sizeData: FlowSizeData) => void;
|
|
166
|
+
}
|
|
167
|
+
export declare function getGapRange(gap?: undefined | number | null | (number | null)[]): [number, number | null];
|
|
168
|
+
export declare function getGapCountAndSize(width: number, itemWidth: number, minGap: number, maxGap: number | null): [number, number];
|
|
169
|
+
/** 自适应浮动组件 */
|
|
170
|
+
export declare function Flow<T>(props: FlowProps<T>): React.JSX.Element;
|
|
171
|
+
export interface TrapeziumProps extends HTMLAttributes<HTMLDivElement> {
|
|
172
|
+
top: number;
|
|
173
|
+
bottom: number;
|
|
174
|
+
height: number;
|
|
175
|
+
borderRadius: number;
|
|
176
|
+
}
|
|
177
|
+
/** 梯形组件 */
|
|
178
|
+
export declare const Trapezium: React.ForwardRefExoticComponent<TrapeziumProps & React.RefAttributes<HTMLDivElement>>;
|
|
179
|
+
export interface LoopSwiperProps<T> {
|
|
180
|
+
/** 源数据 */
|
|
181
|
+
data: T[];
|
|
182
|
+
/** 渲染函数 */
|
|
183
|
+
render: (item: T, index: number, array: T[]) => ReactNode;
|
|
184
|
+
/** 每个元素的key */
|
|
185
|
+
keyExactor?: (item: T, index: number, array: T[]) => string;
|
|
186
|
+
/** 水平方向是宽度,垂直方向是高度 */
|
|
187
|
+
size: number;
|
|
188
|
+
/** 元素之间间隔 */
|
|
189
|
+
gap?: number;
|
|
190
|
+
/** 起始位置 */
|
|
191
|
+
start?: number;
|
|
192
|
+
/** 速度,水平方向正数为向左,水平方向负数为向右,垂直方向正数为向上,水平方向负数为向下 */
|
|
193
|
+
speed: number;
|
|
194
|
+
/** 是否暂停播放 */
|
|
195
|
+
paused?: boolean;
|
|
196
|
+
/** 容器的类名 */
|
|
197
|
+
className?: string;
|
|
198
|
+
/** x 水平方向,y 垂直方向 */
|
|
199
|
+
direction?: "x" | "y";
|
|
200
|
+
}
|
|
201
|
+
export interface LoopSwiperItem {
|
|
202
|
+
key: string;
|
|
203
|
+
dom: HTMLDivElement | null;
|
|
204
|
+
offset: number;
|
|
205
|
+
}
|
|
206
|
+
/** 循环播放组件 */
|
|
207
|
+
export declare function LoopSwiper<T>(props: LoopSwiperProps<T>): React.JSX.Element;
|
|
208
|
+
export interface SectionRingProps extends HTMLAttributes<HTMLDivElement> {
|
|
209
|
+
outerRadius: number;
|
|
210
|
+
innerRadius: number;
|
|
211
|
+
count: number;
|
|
212
|
+
angel: number;
|
|
213
|
+
}
|
|
214
|
+
export declare const SectionRing: FC<SectionRingProps>;
|
|
215
|
+
export interface TransitionNumProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
216
|
+
/** 当前数字 */
|
|
217
|
+
children: number;
|
|
218
|
+
/** 变换周期,单位帧 */
|
|
219
|
+
period: number;
|
|
220
|
+
/** 数字转换为字符串的方法 */
|
|
221
|
+
numToStr?: (num: number) => string;
|
|
222
|
+
}
|
|
223
|
+
export interface TransitionNumIns {
|
|
224
|
+
get(): number;
|
|
225
|
+
}
|
|
226
|
+
/** 渐变数字组件 */
|
|
227
|
+
export declare const TransitionNum: React.ForwardRefExoticComponent<TransitionNumProps & React.RefAttributes<TransitionNumIns>>;
|
|
228
|
+
export interface CircleTextProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
229
|
+
/** 每一个方块的宽度 */
|
|
230
|
+
width: number;
|
|
231
|
+
/** 每一个方块的高度 */
|
|
232
|
+
height: number;
|
|
233
|
+
/** 圆弧的半径,不包含方块的高度 */
|
|
234
|
+
radius: number;
|
|
235
|
+
/** 开始旋转的弧度,逆时针增加,0 为 x 轴方向 */
|
|
236
|
+
startAngel?: number;
|
|
237
|
+
/** 每一个方块之间间隔的弧度 */
|
|
238
|
+
gapAngel?: number;
|
|
239
|
+
/** 文字对齐的方式,默认居中 */
|
|
240
|
+
align?: "left" | "center" | "right";
|
|
241
|
+
/** 文字朝向圆心还是外侧,默认外侧 */
|
|
242
|
+
direction?: "inner" | "outer";
|
|
243
|
+
/** 是否反转文字顺序 */
|
|
244
|
+
reverse?: boolean;
|
|
245
|
+
/** 分割文字的方法 */
|
|
246
|
+
separator?: string | RegExp | ((text: string) => string[]);
|
|
247
|
+
/** 显示的文字 */
|
|
248
|
+
children: string;
|
|
249
|
+
}
|
|
250
|
+
/** 环形文字 */
|
|
251
|
+
export declare const CircleText: FC<CircleTextProps>;
|
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import { drawArc, setFrameInterval } from "deepsea-tools";
|
|
3
|
+
import React, { Fragment, forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
4
|
+
import { read, utils, writeFile } from "xlsx";
|
|
5
|
+
export async function getFileData(file, type) {
|
|
6
|
+
const fileReader = new FileReader();
|
|
7
|
+
switch (type) {
|
|
8
|
+
case "arrayBuffer":
|
|
9
|
+
fileReader.readAsArrayBuffer(file);
|
|
10
|
+
break;
|
|
11
|
+
case "binary":
|
|
12
|
+
fileReader.readAsBinaryString(file);
|
|
13
|
+
break;
|
|
14
|
+
case "base64":
|
|
15
|
+
fileReader.readAsDataURL(file);
|
|
16
|
+
break;
|
|
17
|
+
case "text":
|
|
18
|
+
fileReader.readAsText(file);
|
|
19
|
+
break;
|
|
20
|
+
default:
|
|
21
|
+
return file;
|
|
22
|
+
}
|
|
23
|
+
return new Promise(resolve => {
|
|
24
|
+
fileReader.addEventListener("load", () => {
|
|
25
|
+
resolve(fileReader.result);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** 专用与读取文件的组件 */
|
|
31
|
+
export const InputFile = /*#__PURE__*/forwardRef((props, ref) => {
|
|
32
|
+
const {
|
|
33
|
+
multiple = false,
|
|
34
|
+
type = "file",
|
|
35
|
+
onChange,
|
|
36
|
+
disabled: inputDisabled,
|
|
37
|
+
...otherProps
|
|
38
|
+
} = props;
|
|
39
|
+
const [disabled, setDisabled] = useState(false);
|
|
40
|
+
async function onInputChange(e) {
|
|
41
|
+
const input = e.target;
|
|
42
|
+
const {
|
|
43
|
+
files
|
|
44
|
+
} = input;
|
|
45
|
+
if (!files || files.length === 0) return;
|
|
46
|
+
setDisabled(true);
|
|
47
|
+
try {
|
|
48
|
+
if (multiple) {
|
|
49
|
+
const result = [];
|
|
50
|
+
for (const file of files) {
|
|
51
|
+
result.push({
|
|
52
|
+
result: await getFileData(file, type),
|
|
53
|
+
file
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
onChange?.(result);
|
|
57
|
+
} else {
|
|
58
|
+
onChange?.({
|
|
59
|
+
result: await getFileData(files[0], type),
|
|
60
|
+
file: files[0]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
setDisabled(false);
|
|
64
|
+
input.value = "";
|
|
65
|
+
} catch (error) {
|
|
66
|
+
setDisabled(false);
|
|
67
|
+
input.value = "";
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return /*#__PURE__*/React.createElement("input", _extends({
|
|
72
|
+
disabled: disabled && inputDisabled,
|
|
73
|
+
ref: ref,
|
|
74
|
+
type: "file",
|
|
75
|
+
multiple: multiple,
|
|
76
|
+
onChange: onInputChange
|
|
77
|
+
}, otherProps));
|
|
78
|
+
});
|
|
79
|
+
/** 专门用于读取 excel 的组件 */
|
|
80
|
+
export const ImportExcel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
81
|
+
const {
|
|
82
|
+
onChange,
|
|
83
|
+
...otherProps
|
|
84
|
+
} = props;
|
|
85
|
+
function onInputChange(data) {
|
|
86
|
+
const wb = read(data.result);
|
|
87
|
+
const result = utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
|
|
88
|
+
if (typeof result === "object") {
|
|
89
|
+
const $ = result.map(it => {
|
|
90
|
+
const _ = {};
|
|
91
|
+
Object.keys(it).filter(key => key !== "__rowNum__").forEach(key => _[key] = String(it[key]));
|
|
92
|
+
return _;
|
|
93
|
+
});
|
|
94
|
+
onChange?.($);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return /*#__PURE__*/React.createElement(InputFile, _extends({
|
|
98
|
+
ref: ref,
|
|
99
|
+
accept: ".xlsx",
|
|
100
|
+
type: "arrayBuffer",
|
|
101
|
+
onChange: onInputChange
|
|
102
|
+
}, otherProps));
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
/** 手动导出 excel */
|
|
106
|
+
export function exportExcel(data, name) {
|
|
107
|
+
const workSheet = utils.json_to_sheet(data);
|
|
108
|
+
const workBook = utils.book_new();
|
|
109
|
+
utils.book_append_sheet(workBook, workSheet);
|
|
110
|
+
writeFile(workBook, `${name}${name.endsWith(".xlsx") ? "" : ".xlsx"}`);
|
|
111
|
+
}
|
|
112
|
+
/** 导出 excel 的 button 组件 */
|
|
113
|
+
export const ExportExcel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
114
|
+
const {
|
|
115
|
+
data,
|
|
116
|
+
fileName,
|
|
117
|
+
onClick,
|
|
118
|
+
...otherProps
|
|
119
|
+
} = props;
|
|
120
|
+
function onButtonClick(e) {
|
|
121
|
+
exportExcel(data, fileName);
|
|
122
|
+
onClick?.(e);
|
|
123
|
+
}
|
|
124
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
125
|
+
ref: ref,
|
|
126
|
+
onClick: onButtonClick
|
|
127
|
+
}, otherProps));
|
|
128
|
+
});
|
|
129
|
+
/** 尺寸渐变的组件 */
|
|
130
|
+
export const TransitionBox = props => {
|
|
131
|
+
const {
|
|
132
|
+
className,
|
|
133
|
+
style,
|
|
134
|
+
containerClassName,
|
|
135
|
+
containerStyle,
|
|
136
|
+
children,
|
|
137
|
+
vertical = true,
|
|
138
|
+
horizontal = true,
|
|
139
|
+
time = 3000,
|
|
140
|
+
...otherProps
|
|
141
|
+
} = props;
|
|
142
|
+
const box = useRef(null);
|
|
143
|
+
const [width, setWidth] = useState(0);
|
|
144
|
+
const [height, setHeight] = useState(0);
|
|
145
|
+
const [count, setCount] = useState(0);
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
const observer = new ResizeObserver(entries => {
|
|
148
|
+
const {
|
|
149
|
+
width: currentWidth,
|
|
150
|
+
height: currentHeight
|
|
151
|
+
} = entries[0].contentRect;
|
|
152
|
+
setWidth(currentWidth);
|
|
153
|
+
setHeight(currentHeight);
|
|
154
|
+
});
|
|
155
|
+
observer.observe(box.current);
|
|
156
|
+
return () => {
|
|
157
|
+
observer.disconnect();
|
|
158
|
+
};
|
|
159
|
+
}, []);
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
setCount(count => Math.min(count + 1, 3));
|
|
162
|
+
}, [width, height]);
|
|
163
|
+
const outerStyle = {
|
|
164
|
+
transitionProperty: count === 3 ? [horizontal && "width", vertical && "height"].filter(Boolean).join(", ") : undefined,
|
|
165
|
+
transitionDuration: count === 3 ? `${time}ms` : undefined,
|
|
166
|
+
width,
|
|
167
|
+
height,
|
|
168
|
+
overflow: "hidden",
|
|
169
|
+
position: "relative",
|
|
170
|
+
...style
|
|
171
|
+
};
|
|
172
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
173
|
+
className: className,
|
|
174
|
+
style: outerStyle
|
|
175
|
+
}, otherProps), /*#__PURE__*/React.createElement("div", {
|
|
176
|
+
className: containerClassName,
|
|
177
|
+
style: {
|
|
178
|
+
position: "absolute",
|
|
179
|
+
...containerStyle
|
|
180
|
+
},
|
|
181
|
+
ref: box
|
|
182
|
+
}, children));
|
|
183
|
+
};
|
|
184
|
+
/** 雷达组件 */
|
|
185
|
+
export const SeaRadar = props => {
|
|
186
|
+
const {
|
|
187
|
+
unitRadius = 50,
|
|
188
|
+
circleCount = 4,
|
|
189
|
+
circleWidth = 1,
|
|
190
|
+
circleColor,
|
|
191
|
+
directionCount = 36,
|
|
192
|
+
directionWidth = 1,
|
|
193
|
+
directionColor,
|
|
194
|
+
backgroundColor,
|
|
195
|
+
scanColor,
|
|
196
|
+
scanAngle = Math.PI / 6,
|
|
197
|
+
period = 8,
|
|
198
|
+
targets,
|
|
199
|
+
showGraduationLine,
|
|
200
|
+
showGraduationText,
|
|
201
|
+
showCircle,
|
|
202
|
+
showDirection
|
|
203
|
+
} = props;
|
|
204
|
+
const style = {
|
|
205
|
+
"--unit-radius": `${unitRadius}px`,
|
|
206
|
+
"--circle-count": circleCount,
|
|
207
|
+
"--circle-width": `${circleWidth}px`,
|
|
208
|
+
"--circle-color": circleColor,
|
|
209
|
+
"--direction-count": directionCount,
|
|
210
|
+
"--direction-width": `${directionWidth}px`,
|
|
211
|
+
"--direction-color": directionColor,
|
|
212
|
+
"--background-color": backgroundColor,
|
|
213
|
+
"--scan-color": scanColor,
|
|
214
|
+
"--period": `${period}s`
|
|
215
|
+
};
|
|
216
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
217
|
+
className: "sea-radar-wrapper",
|
|
218
|
+
style: style
|
|
219
|
+
}, Array(180).fill(0).map((_, index) => /*#__PURE__*/React.createElement("div", {
|
|
220
|
+
className: "sea-radar-little-graduation",
|
|
221
|
+
style: {
|
|
222
|
+
transform: `rotateZ(${2 * index}deg)`,
|
|
223
|
+
display: showGraduationLine ? "block" : "none"
|
|
224
|
+
}
|
|
225
|
+
})), Array(36).fill(0).map((_, index) => /*#__PURE__*/React.createElement("div", {
|
|
226
|
+
className: "sea-radar-graduation",
|
|
227
|
+
style: {
|
|
228
|
+
transform: `rotateZ(${10 * index}deg)`,
|
|
229
|
+
display: showGraduationLine ? "block" : "none"
|
|
230
|
+
}
|
|
231
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
232
|
+
className: "sea-radar-graduation-text",
|
|
233
|
+
style: {
|
|
234
|
+
display: showGraduationText ? "block" : "none"
|
|
235
|
+
}
|
|
236
|
+
}, String(index * 10).padStart(3, "0")))), /*#__PURE__*/React.createElement("div", {
|
|
237
|
+
className: "sea-radar"
|
|
238
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
239
|
+
className: "sea-radar-scan",
|
|
240
|
+
style: {
|
|
241
|
+
height: `${unitRadius * circleCount * Math.tan(scanAngle)}px`,
|
|
242
|
+
clipPath: `polygon(0 0, 0 100%, 100% 100%)`
|
|
243
|
+
}
|
|
244
|
+
}), showCircle && Array(circleCount).fill(0).map((_, index) => /*#__PURE__*/React.createElement("div", {
|
|
245
|
+
className: "sea-radar-circle",
|
|
246
|
+
style: {
|
|
247
|
+
width: `${unitRadius * 2 * (index + 1)}px`,
|
|
248
|
+
height: `${unitRadius * 2 * (index + 1)}px`
|
|
249
|
+
}
|
|
250
|
+
})), showDirection && Array(directionCount).fill(0).map((_, index) => /*#__PURE__*/React.createElement("div", {
|
|
251
|
+
className: "sea-radar-direction",
|
|
252
|
+
style: {
|
|
253
|
+
transform: `rotateZ(${360 / directionCount * index}deg)`
|
|
254
|
+
}
|
|
255
|
+
})), targets?.map(it => /*#__PURE__*/React.createElement("div", {
|
|
256
|
+
className: "sea-radar-target",
|
|
257
|
+
style: {
|
|
258
|
+
left: `${unitRadius * circleCount + it.radius * Math.cos(it.angle)}px`,
|
|
259
|
+
bottom: `${unitRadius * circleCount + it.radius * Math.sin(it.angle)}px`
|
|
260
|
+
}
|
|
261
|
+
}, it.element))));
|
|
262
|
+
};
|
|
263
|
+
/** 忘了什么组件 */
|
|
264
|
+
export const Ring = props => {
|
|
265
|
+
const {
|
|
266
|
+
outerWidth,
|
|
267
|
+
innerWidth,
|
|
268
|
+
style,
|
|
269
|
+
...leftProps
|
|
270
|
+
} = props;
|
|
271
|
+
const outerRadius = outerWidth / 2;
|
|
272
|
+
const innerRadius = innerWidth / 2;
|
|
273
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
274
|
+
style: {
|
|
275
|
+
...style,
|
|
276
|
+
width: `${outerWidth}px`,
|
|
277
|
+
height: `${outerWidth}px`,
|
|
278
|
+
clipPath: `path("M0,${outerRadius} a${outerRadius},${outerRadius},0,1,0,${outerWidth},0 a${outerRadius},${outerRadius},0,1,0,-${outerWidth},0 l${outerRadius - innerRadius},0 a${innerRadius},${innerRadius},0,0,1,${innerRadius * 2},0 a${innerRadius},${innerRadius},0,0,1,-${innerRadius * 2},0 Z")`
|
|
279
|
+
}
|
|
280
|
+
}, leftProps));
|
|
281
|
+
};
|
|
282
|
+
export function getGapRange(gap) {
|
|
283
|
+
if (typeof gap === "number") return [gap, gap];
|
|
284
|
+
if (Array.isArray(gap)) return [gap[0] || 0, gap[1]];
|
|
285
|
+
return [0, null];
|
|
286
|
+
}
|
|
287
|
+
export function getGapCountAndSize(width, itemWidth, minGap, maxGap) {
|
|
288
|
+
const count = Math.floor((width + minGap) / (itemWidth + minGap)) || 1;
|
|
289
|
+
if (count === 1) return [count, 0];
|
|
290
|
+
const averageGap = (width - itemWidth * count) / (count - 1);
|
|
291
|
+
if (averageGap < minGap) return [count, minGap];
|
|
292
|
+
if (maxGap !== null && averageGap > maxGap) return [count, maxGap];
|
|
293
|
+
return [count, averageGap];
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/** 自适应浮动组件 */
|
|
297
|
+
export function Flow(props) {
|
|
298
|
+
const {
|
|
299
|
+
itemWidth,
|
|
300
|
+
itemHeight,
|
|
301
|
+
columnGap,
|
|
302
|
+
rowGap = 0,
|
|
303
|
+
maxRows,
|
|
304
|
+
data,
|
|
305
|
+
render,
|
|
306
|
+
keyExactor,
|
|
307
|
+
className,
|
|
308
|
+
style,
|
|
309
|
+
containerClassName,
|
|
310
|
+
containerStyle,
|
|
311
|
+
throttle,
|
|
312
|
+
transitionDuration,
|
|
313
|
+
onSizeChange,
|
|
314
|
+
...otherProps
|
|
315
|
+
} = props;
|
|
316
|
+
const [minColumnGap, maxColumnGap] = getGapRange(columnGap);
|
|
317
|
+
const [width, setWidth] = useState(0);
|
|
318
|
+
const [columnCount, setColumnCount] = useState(1);
|
|
319
|
+
const [columnGapSize, setColumnGapSize] = useState(minColumnGap);
|
|
320
|
+
const [showItems, setShowItems] = useState(false);
|
|
321
|
+
const ele = useRef(null);
|
|
322
|
+
const contentRows = Math.ceil(data.length / columnCount);
|
|
323
|
+
const contentShownRows = typeof maxRows === "number" ? Math.min(contentRows, maxRows) : contentRows;
|
|
324
|
+
const height = contentShownRows > 0 ? contentShownRows * (itemHeight + rowGap) - rowGap : 0;
|
|
325
|
+
function getPosition(index) {
|
|
326
|
+
const y = Math.floor(index / columnCount);
|
|
327
|
+
const x = index - y * columnCount;
|
|
328
|
+
return {
|
|
329
|
+
left: x * (itemWidth + columnGapSize),
|
|
330
|
+
top: y * (itemHeight + rowGap)
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function getHidden(index) {
|
|
334
|
+
if (typeof maxRows !== "number") return false;
|
|
335
|
+
return index >= maxRows * columnCount;
|
|
336
|
+
}
|
|
337
|
+
useEffect(() => {
|
|
338
|
+
let timeout;
|
|
339
|
+
const observer = new ResizeObserver(entries => {
|
|
340
|
+
clearTimeout(timeout);
|
|
341
|
+
function task() {
|
|
342
|
+
const {
|
|
343
|
+
inlineSize: width
|
|
344
|
+
} = entries[0].borderBoxSize[0];
|
|
345
|
+
const [newColumnCount, newColumnGapSize] = getGapCountAndSize(width, itemWidth, minColumnGap, maxColumnGap);
|
|
346
|
+
setShowItems(true);
|
|
347
|
+
setWidth(width);
|
|
348
|
+
setColumnCount(newColumnCount);
|
|
349
|
+
setColumnGapSize(newColumnGapSize);
|
|
350
|
+
}
|
|
351
|
+
if (throttle === null) {
|
|
352
|
+
task();
|
|
353
|
+
} else {
|
|
354
|
+
timeout = window.setTimeout(task, throttle || 200);
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
observer.observe(ele.current);
|
|
358
|
+
return () => {
|
|
359
|
+
observer.disconnect();
|
|
360
|
+
};
|
|
361
|
+
}, [itemWidth, throttle, columnGap]);
|
|
362
|
+
useEffect(() => {
|
|
363
|
+
onSizeChange?.({
|
|
364
|
+
width,
|
|
365
|
+
height,
|
|
366
|
+
itemWidth,
|
|
367
|
+
itemHeight,
|
|
368
|
+
columnGap: columnGapSize,
|
|
369
|
+
columnCount,
|
|
370
|
+
rowGap,
|
|
371
|
+
rowCount: contentShownRows,
|
|
372
|
+
overflow: data.length > contentShownRows * columnCount,
|
|
373
|
+
itemCount: data.length,
|
|
374
|
+
maxRows: maxRows ?? null
|
|
375
|
+
});
|
|
376
|
+
}, [width, height, columnGapSize, columnCount, rowGap, contentShownRows, data.length, itemWidth, itemHeight, maxRows]);
|
|
377
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
378
|
+
ref: ele,
|
|
379
|
+
className: className,
|
|
380
|
+
style: {
|
|
381
|
+
position: "relative",
|
|
382
|
+
boxSizing: "border-box",
|
|
383
|
+
height,
|
|
384
|
+
...style
|
|
385
|
+
}
|
|
386
|
+
}, otherProps), showItems && data.map((it, idx) => /*#__PURE__*/React.createElement("div", {
|
|
387
|
+
key: keyExactor?.(it, idx) || idx,
|
|
388
|
+
className: containerClassName,
|
|
389
|
+
style: {
|
|
390
|
+
position: "absolute",
|
|
391
|
+
width: itemWidth,
|
|
392
|
+
height: itemHeight,
|
|
393
|
+
transition: transitionDuration !== null ? `all ${transitionDuration ?? 400}ms` : undefined,
|
|
394
|
+
...getPosition(idx)
|
|
395
|
+
}
|
|
396
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
397
|
+
style: {
|
|
398
|
+
width: itemWidth,
|
|
399
|
+
height: itemHeight,
|
|
400
|
+
display: maxRows && idx >= maxRows * columnCount ? "none" : "block",
|
|
401
|
+
...containerStyle
|
|
402
|
+
}
|
|
403
|
+
}, render(it, idx, getHidden(idx))))));
|
|
404
|
+
}
|
|
405
|
+
/** 梯形组件 */
|
|
406
|
+
export const Trapezium = /*#__PURE__*/forwardRef((props, ref) => {
|
|
407
|
+
const {
|
|
408
|
+
top,
|
|
409
|
+
bottom,
|
|
410
|
+
height,
|
|
411
|
+
borderRadius,
|
|
412
|
+
style,
|
|
413
|
+
...other
|
|
414
|
+
} = props;
|
|
415
|
+
const diff = (bottom - top) / 2;
|
|
416
|
+
const a = Math.atan(height / diff) / 2;
|
|
417
|
+
const b = borderRadius / Math.tan(a);
|
|
418
|
+
const c = b * Math.cos(a * 2);
|
|
419
|
+
const d = b * Math.sin(a * 2);
|
|
420
|
+
const e = Math.PI / 2 - a;
|
|
421
|
+
const f = borderRadius / Math.tan(e);
|
|
422
|
+
const g = f * Math.cos(a * 2);
|
|
423
|
+
const h = f * Math.sin(a * 2);
|
|
424
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
425
|
+
ref: ref,
|
|
426
|
+
style: {
|
|
427
|
+
width: bottom,
|
|
428
|
+
height,
|
|
429
|
+
clipPath: `path("M ${diff + f} ${0} A ${borderRadius} ${borderRadius} 0 0 0 ${diff - g} ${h} L ${c} ${height - d} A ${borderRadius} ${borderRadius} 0 0 0 ${b} ${height} L ${bottom - b} ${height} A ${borderRadius} ${borderRadius} 0 0 0 ${bottom - c} ${height - d} L ${top + diff + g} ${h} A ${borderRadius} ${borderRadius} 0 0 0 ${top + diff - f} ${0} Z")`,
|
|
430
|
+
...style
|
|
431
|
+
}
|
|
432
|
+
}, other));
|
|
433
|
+
});
|
|
434
|
+
/** 循环播放组件 */
|
|
435
|
+
export function LoopSwiper(props) {
|
|
436
|
+
const {
|
|
437
|
+
data,
|
|
438
|
+
render,
|
|
439
|
+
keyExactor,
|
|
440
|
+
size,
|
|
441
|
+
gap = 0,
|
|
442
|
+
start = 0,
|
|
443
|
+
speed,
|
|
444
|
+
paused = false,
|
|
445
|
+
className = "",
|
|
446
|
+
direction = "x"
|
|
447
|
+
} = props;
|
|
448
|
+
if (!(size > 0 && (speed > 0 || speed < 0))) {
|
|
449
|
+
throw new RangeError("size 必须是正数,speed 必须非0");
|
|
450
|
+
}
|
|
451
|
+
const keys = data.map((it, idx, arr) => keyExactor ? keyExactor(it, idx, arr) : String(idx));
|
|
452
|
+
const cache = useRef({
|
|
453
|
+
size,
|
|
454
|
+
gap,
|
|
455
|
+
speed,
|
|
456
|
+
keys,
|
|
457
|
+
paused,
|
|
458
|
+
className,
|
|
459
|
+
direction
|
|
460
|
+
});
|
|
461
|
+
cache.current = {
|
|
462
|
+
size,
|
|
463
|
+
gap,
|
|
464
|
+
speed,
|
|
465
|
+
keys,
|
|
466
|
+
paused,
|
|
467
|
+
className,
|
|
468
|
+
direction
|
|
469
|
+
};
|
|
470
|
+
const eles = useRef([]);
|
|
471
|
+
eles.current = keys.map((key, idx) => ({
|
|
472
|
+
key,
|
|
473
|
+
dom: null,
|
|
474
|
+
offset: idx * (size + gap) + start
|
|
475
|
+
}));
|
|
476
|
+
function setStyles() {
|
|
477
|
+
const {
|
|
478
|
+
size,
|
|
479
|
+
speed,
|
|
480
|
+
className,
|
|
481
|
+
direction
|
|
482
|
+
} = cache.current;
|
|
483
|
+
eles.current.forEach(it => {
|
|
484
|
+
it.dom.className = className;
|
|
485
|
+
it.dom.style.setProperty("position", `absolute`);
|
|
486
|
+
it.dom.style.setProperty("width", `${size}px`);
|
|
487
|
+
direction === "x" && speed < 0 ? it.dom.style.setProperty("right", `0`) : it.dom.style.setProperty("left", `0`);
|
|
488
|
+
direction === "y" && speed < 0 ? it.dom.style.setProperty("bottom", `0`) : it.dom.style.setProperty("top", `0`);
|
|
489
|
+
it.dom.style.setProperty("transform", `translate${direction.toUpperCase()}(${it.offset * (speed > 0 ? 1 : -1)}px)`);
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
useEffect(() => {
|
|
493
|
+
setStyles();
|
|
494
|
+
}, []);
|
|
495
|
+
useEffect(() => {
|
|
496
|
+
const stop = setFrameInterval(() => {
|
|
497
|
+
const {
|
|
498
|
+
size,
|
|
499
|
+
gap,
|
|
500
|
+
speed,
|
|
501
|
+
keys,
|
|
502
|
+
paused
|
|
503
|
+
} = cache.current;
|
|
504
|
+
if (paused) return;
|
|
505
|
+
eles.current.length = keys.length;
|
|
506
|
+
let minIndex = 0;
|
|
507
|
+
eles.current.forEach((it, idx) => {
|
|
508
|
+
if (it.offset < eles.current[minIndex].offset) {
|
|
509
|
+
minIndex = idx;
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
const minOffset = eles.current[minIndex].offset;
|
|
513
|
+
eles.current.forEach((it, idx) => {
|
|
514
|
+
let index = idx;
|
|
515
|
+
if (idx < minIndex) index = eles.current.length + idx;
|
|
516
|
+
it.offset = minOffset + (index - minIndex) * (size + gap);
|
|
517
|
+
let newOffset = it.offset - Math.abs(speed);
|
|
518
|
+
if (newOffset + size + gap <= 0) {
|
|
519
|
+
newOffset += eles.current.length * (size + gap);
|
|
520
|
+
}
|
|
521
|
+
it.offset = newOffset;
|
|
522
|
+
});
|
|
523
|
+
setStyles();
|
|
524
|
+
}, 1);
|
|
525
|
+
return stop;
|
|
526
|
+
}, []);
|
|
527
|
+
return /*#__PURE__*/React.createElement(Fragment, null, data.map((it, idx, arr) => /*#__PURE__*/React.createElement("div", {
|
|
528
|
+
key: keys[idx],
|
|
529
|
+
ref: dom => eles.current[idx].dom = dom
|
|
530
|
+
}, render(it, idx, arr))));
|
|
531
|
+
}
|
|
532
|
+
export const SectionRing = props => {
|
|
533
|
+
const {
|
|
534
|
+
outerRadius: o,
|
|
535
|
+
innerRadius: i,
|
|
536
|
+
count: c,
|
|
537
|
+
angel: a,
|
|
538
|
+
style,
|
|
539
|
+
...others
|
|
540
|
+
} = props;
|
|
541
|
+
const s = Math.PI * 2 / c - a;
|
|
542
|
+
function arc(radius, startAngle, endAngle, options = {}) {
|
|
543
|
+
return drawArc(o, o, radius, startAngle, endAngle, options);
|
|
544
|
+
}
|
|
545
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
546
|
+
style: {
|
|
547
|
+
...style,
|
|
548
|
+
width: o * 2,
|
|
549
|
+
height: o * 2,
|
|
550
|
+
clipPath: `path("${Array(c).fill(0).map((it, idx) => `${arc(o, idx * (a + s), idx * (a + s) + a)} ${arc(i, idx * (a + s) + a, idx * (a + s), {
|
|
551
|
+
line: true,
|
|
552
|
+
anticlockwise: true
|
|
553
|
+
})}`).join(" ")} Z")`
|
|
554
|
+
}
|
|
555
|
+
}, others));
|
|
556
|
+
};
|
|
557
|
+
/** 渐变数字组件 */
|
|
558
|
+
export const TransitionNum = /*#__PURE__*/forwardRef((props, ref) => {
|
|
559
|
+
const {
|
|
560
|
+
children: num,
|
|
561
|
+
period,
|
|
562
|
+
numToStr,
|
|
563
|
+
...others
|
|
564
|
+
} = props;
|
|
565
|
+
if (!Number.isInteger(num) || !Number.isInteger(period) || period <= 0) {
|
|
566
|
+
throw new RangeError("目标数字必须是整数,周期必须是正整数");
|
|
567
|
+
}
|
|
568
|
+
const ele = useRef(null);
|
|
569
|
+
const cache = useRef({
|
|
570
|
+
num,
|
|
571
|
+
period,
|
|
572
|
+
numToStr,
|
|
573
|
+
show: num
|
|
574
|
+
});
|
|
575
|
+
cache.current = {
|
|
576
|
+
...cache.current,
|
|
577
|
+
num,
|
|
578
|
+
period,
|
|
579
|
+
numToStr
|
|
580
|
+
};
|
|
581
|
+
useImperativeHandle(ref, () => ({
|
|
582
|
+
get: () => cache.current.show
|
|
583
|
+
}), []);
|
|
584
|
+
useEffect(() => {
|
|
585
|
+
const {
|
|
586
|
+
num,
|
|
587
|
+
period,
|
|
588
|
+
show,
|
|
589
|
+
numToStr
|
|
590
|
+
} = cache.current;
|
|
591
|
+
ele.current.innerText = (numToStr || String)(show);
|
|
592
|
+
if (num === show) return;
|
|
593
|
+
const div = ele.current;
|
|
594
|
+
const speed = (num - show) / period;
|
|
595
|
+
const cancel = setFrameInterval(() => {
|
|
596
|
+
const {
|
|
597
|
+
num,
|
|
598
|
+
numToStr
|
|
599
|
+
} = cache.current;
|
|
600
|
+
cache.current.show += speed;
|
|
601
|
+
if (speed > 0 && cache.current.show > num || speed < 0 && cache.current.show < num) {
|
|
602
|
+
cancel();
|
|
603
|
+
cache.current.show = num;
|
|
604
|
+
}
|
|
605
|
+
div.innerText = (numToStr || String)(speed > 0 ? Math.floor(cache.current.show) : Math.ceil(cache.current.show));
|
|
606
|
+
}, 1);
|
|
607
|
+
return cancel;
|
|
608
|
+
}, [num]);
|
|
609
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
610
|
+
ref: ele
|
|
611
|
+
}, others));
|
|
612
|
+
});
|
|
613
|
+
/** 环形文字 */
|
|
614
|
+
export const CircleText = props => {
|
|
615
|
+
const {
|
|
616
|
+
width,
|
|
617
|
+
height,
|
|
618
|
+
radius,
|
|
619
|
+
startAngel = 0,
|
|
620
|
+
gapAngel = 0,
|
|
621
|
+
align = "center",
|
|
622
|
+
style,
|
|
623
|
+
direction = "outer",
|
|
624
|
+
reverse = false,
|
|
625
|
+
separator,
|
|
626
|
+
children,
|
|
627
|
+
...others
|
|
628
|
+
} = props;
|
|
629
|
+
const unitAngle = Math.atan(width / 2 / radius) * 2;
|
|
630
|
+
const totalAngle = (unitAngle + gapAngel) * children.length - gapAngel;
|
|
631
|
+
const offsetAngle = align === "left" ? 0 : align === "right" ? totalAngle : totalAngle / 2;
|
|
632
|
+
function getTransform(idx) {
|
|
633
|
+
const angle = startAngel - idx * (unitAngle + gapAngel) + offsetAngle - unitAngle / 2;
|
|
634
|
+
const x = (radius + height / 2) * Math.cos(angle) - width / 2;
|
|
635
|
+
const y = (radius + height / 2) * Math.sin(angle) * -1 - height / 2;
|
|
636
|
+
const z = Math.PI / 2 - angle + (direction === "inner" ? Math.PI : 0);
|
|
637
|
+
return `translateX(${x}px) translateY(${y}px) rotateZ(${z / Math.PI * 180}deg)`;
|
|
638
|
+
}
|
|
639
|
+
const words = typeof separator === "function" ? separator(children) : children.split(separator ?? "");
|
|
640
|
+
if (reverse) words.reverse();
|
|
641
|
+
return /*#__PURE__*/React.createElement(Fragment, null, words.map((w, idx) => /*#__PURE__*/React.createElement("span", _extends({
|
|
642
|
+
key: idx,
|
|
643
|
+
style: {
|
|
644
|
+
position: "absolute",
|
|
645
|
+
...style,
|
|
646
|
+
transform: getTransform(idx),
|
|
647
|
+
textAlign: "center",
|
|
648
|
+
width,
|
|
649
|
+
lineHeight: `${height}px`,
|
|
650
|
+
height: height
|
|
651
|
+
}
|
|
652
|
+
}, others), w)));
|
|
653
|
+
};
|
|
654
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["drawArc","setFrameInterval","React","Fragment","forwardRef","useEffect","useImperativeHandle","useRef","useState","read","utils","writeFile","getFileData","file","type","fileReader","FileReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","Promise","resolve","addEventListener","result","InputFile","props","ref","multiple","onChange","disabled","inputDisabled","otherProps","setDisabled","onInputChange","e","input","target","files","length","push","value","error","createElement","_extends","ImportExcel","data","wb","sheet_to_json","Sheets","SheetNames","$","map","it","_","Object","keys","filter","key","forEach","String","accept","exportExcel","name","workSheet","json_to_sheet","workBook","book_new","book_append_sheet","endsWith","ExportExcel","fileName","onClick","onButtonClick","TransitionBox","className","style","containerClassName","containerStyle","children","vertical","horizontal","time","box","width","setWidth","height","setHeight","count","setCount","observer","ResizeObserver","entries","currentWidth","currentHeight","contentRect","observe","current","disconnect","Math","min","outerStyle","transitionProperty","Boolean","join","undefined","transitionDuration","overflow","position","SeaRadar","unitRadius","circleCount","circleWidth","circleColor","directionCount","directionWidth","directionColor","backgroundColor","scanColor","scanAngle","PI","period","targets","showGraduationLine","showGraduationText","showCircle","showDirection","Array","fill","index","transform","display","padStart","tan","clipPath","left","radius","cos","angle","bottom","sin","element","Ring","outerWidth","innerWidth","leftProps","outerRadius","innerRadius","getGapRange","gap","isArray","getGapCountAndSize","itemWidth","minGap","maxGap","floor","averageGap","Flow","itemHeight","columnGap","rowGap","maxRows","render","keyExactor","throttle","onSizeChange","minColumnGap","maxColumnGap","columnCount","setColumnCount","columnGapSize","setColumnGapSize","showItems","setShowItems","ele","contentRows","ceil","contentShownRows","getPosition","y","x","top","getHidden","timeout","clearTimeout","task","inlineSize","borderBoxSize","newColumnCount","newColumnGapSize","window","setTimeout","rowCount","itemCount","boxSizing","idx","transition","Trapezium","borderRadius","other","diff","a","atan","b","c","d","f","g","h","LoopSwiper","size","start","speed","paused","direction","RangeError","arr","cache","eles","dom","offset","setStyles","setProperty","toUpperCase","stop","minIndex","minOffset","newOffset","abs","SectionRing","o","i","angel","others","s","arc","startAngle","endAngle","options","line","anticlockwise","TransitionNum","num","numToStr","Number","isInteger","show","get","innerText","div","cancel","CircleText","startAngel","gapAngel","align","reverse","separator","unitAngle","totalAngle","offsetAngle","getTransform","z","words","split","w","textAlign","lineHeight"],"sources":["../../src/index.tsx"],"sourcesContent":["import { Tree } from \"antd\"\nimport { DrawArcOptions, drawArc, setFrameInterval } from \"deepsea-tools\"\nimport React, { ButtonHTMLAttributes, CSSProperties, ChangeEvent, FC, Fragment, HTMLAttributes, InputHTMLAttributes, MouseEvent as ReactMouseEvent, ReactNode, forwardRef, useEffect, useImperativeHandle, useRef, useState } from \"react\"\nimport { read, utils, writeFile } from \"xlsx\"\n\nexport type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false\n\nexport interface InputFileDataTypes {\n base64: string\n text: string\n arrayBuffer: ArrayBuffer\n binary: string\n file: File\n}\n\nexport type InputFileDataType = keyof InputFileDataTypes\n\nexport interface InputFileData<T> {\n result: T\n file: File\n}\n\nexport type InputFileProps = (\n | {\n multiple?: false\n type: \"base64\" | \"text\" | \"binary\"\n onChange?: (data: InputFileData<string>) => void\n }\n | {\n multiple?: false\n type: \"arrayBuffer\"\n onChange?: (data: InputFileData<ArrayBuffer>) => void\n }\n | {\n multiple?: false\n type?: \"file\"\n onChange?: (data: InputFileData<File>) => void\n }\n | {\n multiple: true\n type: \"base64\" | \"text\" | \"binary\"\n onChange?: (data: InputFileData<string>[]) => void\n }\n | {\n multiple: true\n type: \"arrayBuffer\"\n onChange?: (data: InputFileData<ArrayBuffer>[]) => void\n }\n | {\n multiple: true\n type?: \"file\"\n onChange?: (data: InputFileData<File>[]) => void\n }\n) &\n Omit<InputHTMLAttributes<HTMLInputElement>, \"onChange\" | \"multiple\" | \"type\">\n\nexport async function getFileData<T extends InputFileDataType>(file: File, type: T): Promise<InputFileDataTypes[T]> {\n const fileReader = new FileReader()\n switch (type) {\n case \"arrayBuffer\":\n fileReader.readAsArrayBuffer(file)\n break\n case \"binary\":\n fileReader.readAsBinaryString(file)\n break\n case \"base64\":\n fileReader.readAsDataURL(file)\n break\n case \"text\":\n fileReader.readAsText(file)\n break\n default:\n return file as any\n }\n return new Promise(resolve => {\n fileReader.addEventListener(\"load\", () => {\n resolve(fileReader.result as any)\n })\n })\n}\n\n/** 专用与读取文件的组件 */\nexport const InputFile = forwardRef<HTMLInputElement, InputFileProps>((props, ref) => {\n const { multiple = false, type = \"file\", onChange, disabled: inputDisabled, ...otherProps } = props\n const [disabled, setDisabled] = useState(false)\n\n async function onInputChange(e: ChangeEvent<HTMLInputElement>) {\n const input = e.target\n const { files } = input\n if (!files || files.length === 0) return\n setDisabled(true)\n try {\n if (multiple) {\n const result: any[] = []\n for (const file of files) {\n result.push({\n result: await getFileData(file, type),\n file\n })\n }\n onChange?.(result as any)\n } else {\n onChange?.({\n result: await getFileData(files[0], type),\n file: files[0]\n } as any)\n }\n setDisabled(false)\n input.value = \"\"\n } catch (error) {\n setDisabled(false)\n input.value = \"\"\n throw error\n }\n }\n\n return <input disabled={disabled && inputDisabled} ref={ref} type=\"file\" multiple={multiple} onChange={onInputChange} {...otherProps} />\n})\n\nexport interface ImportExcelProps extends Omit<InputFileProps, \"multiple\" | \"onChange\" | \"accept\" | \"type\"> {\n onChange?: (data: Record<string, string>[]) => void\n}\n\n/** 专门用于读取 excel 的组件 */\nexport const ImportExcel = forwardRef<HTMLInputElement, ImportExcelProps>((props, ref) => {\n const { onChange, ...otherProps } = props\n\n function onInputChange(data: InputFileData<ArrayBuffer>) {\n const wb = read(data.result)\n const result = utils.sheet_to_json<any>(wb.Sheets[wb.SheetNames[0]])\n if (typeof result === \"object\") {\n const $ = result.map(it => {\n const _: Record<string, string> = {}\n Object.keys(it)\n .filter(key => key !== \"__rowNum__\")\n .forEach(key => (_[key] = String(it[key])))\n return _\n })\n onChange?.($)\n }\n }\n\n return <InputFile ref={ref} accept=\".xlsx\" type=\"arrayBuffer\" onChange={onInputChange} {...otherProps} />\n})\n\n/** 手动导出 excel */\nexport function exportExcel(data: Record<string, string>[], name: string) {\n const workSheet = utils.json_to_sheet(data)\n const workBook = utils.book_new()\n utils.book_append_sheet(workBook, workSheet)\n writeFile(workBook, `${name}${name.endsWith(\".xlsx\") ? \"\" : \".xlsx\"}`)\n}\n\nexport interface ExportExcelProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n data: Record<string, string>[]\n fileName: string\n}\n\n/** 导出 excel 的 button 组件 */\nexport const ExportExcel = forwardRef<HTMLButtonElement, ExportExcelProps>((props, ref) => {\n const { data, fileName, onClick, ...otherProps } = props\n\n function onButtonClick(e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) {\n exportExcel(data, fileName)\n onClick?.(e)\n }\n\n return <button ref={ref} onClick={onButtonClick} {...otherProps} />\n})\n\nexport interface TransitionBoxProps extends HTMLAttributes<HTMLDivElement> {\n containerClassName?: string\n containerStyle?: CSSProperties\n vertical?: boolean\n horizontal?: boolean\n time?: number\n}\n\n/** 尺寸渐变的组件 */\nexport const TransitionBox: FC<TransitionBoxProps> = props => {\n const { className, style, containerClassName, containerStyle, children, vertical = true, horizontal = true, time = 3000, ...otherProps } = props\n const box = useRef<HTMLDivElement>(null)\n const [width, setWidth] = useState(0)\n const [height, setHeight] = useState(0)\n const [count, setCount] = useState(0)\n\n useEffect(() => {\n const observer = new ResizeObserver(entries => {\n const { width: currentWidth, height: currentHeight } = entries[0].contentRect\n setWidth(currentWidth)\n setHeight(currentHeight)\n })\n\n observer.observe(box.current!)\n\n return () => {\n observer.disconnect()\n }\n }, [])\n\n useEffect(() => {\n setCount(count => Math.min(count + 1, 3))\n }, [width, height])\n\n const outerStyle: CSSProperties = { transitionProperty: count === 3 ? [horizontal && \"width\", vertical && \"height\"].filter(Boolean).join(\", \") : undefined, transitionDuration: count === 3 ? `${time}ms` : undefined, width, height, overflow: \"hidden\", position: \"relative\", ...style }\n\n return (\n <div className={className} style={outerStyle} {...otherProps}>\n <div className={containerClassName} style={{ position: \"absolute\", ...containerStyle }} ref={box}>\n {children}\n </div>\n </div>\n )\n}\n\nexport interface SeaRadarTarget {\n /** 半径 */\n radius: number\n /** 弧度 */\n angle: number\n /** 元素 */\n element: ReactNode\n}\n\nexport interface SeaRadarProps {\n /** 最小圆的半径 */\n unitRadius?: number\n /** 一共的全数 */\n circleCount?: number\n /** 角度分成多少份 */\n directionCount?: number\n /** 圈的宽度 */\n circleWidth?: number\n /** 圈的颜色 */\n circleColor: string\n /** 角度的宽度 */\n directionWidth?: number\n /** 角度颜色 */\n directionColor: string\n /** 背景色 */\n backgroundColor: string\n /** 扫描的颜色 */\n scanColor: string\n /** 扫描的弧度 */\n scanAngle?: number\n /** 扫描一周的时间,单位秒 */\n period?: number\n /** 目标列表 */\n targets?: SeaRadarTarget[]\n /** 展示圈 */\n showCircle?: boolean\n /** 展示方位 */\n showDirection?: boolean\n /** 展示刻度线 */\n showGraduationLine?: boolean\n /** 展示刻度文字 */\n showGraduationText?: boolean\n}\n\n/** 雷达组件 */\nexport const SeaRadar: FC<SeaRadarProps> = props => {\n const { unitRadius = 50, circleCount = 4, circleWidth = 1, circleColor, directionCount = 36, directionWidth = 1, directionColor, backgroundColor, scanColor, scanAngle = Math.PI / 6, period = 8, targets, showGraduationLine, showGraduationText, showCircle, showDirection } = props\n const style = { \"--unit-radius\": `${unitRadius}px`, \"--circle-count\": circleCount, \"--circle-width\": `${circleWidth}px`, \"--circle-color\": circleColor, \"--direction-count\": directionCount, \"--direction-width\": `${directionWidth}px`, \"--direction-color\": directionColor, \"--background-color\": backgroundColor, \"--scan-color\": scanColor, \"--period\": `${period}s` } as CSSProperties\n return (\n <div className=\"sea-radar-wrapper\" style={style}>\n {Array(180)\n .fill(0)\n .map((_, index) => (\n <div className=\"sea-radar-little-graduation\" style={{ transform: `rotateZ(${2 * index}deg)`, display: showGraduationLine ? \"block\" : \"none\" }}></div>\n ))}\n {Array(36)\n .fill(0)\n .map((_, index) => (\n <div className=\"sea-radar-graduation\" style={{ transform: `rotateZ(${10 * index}deg)`, display: showGraduationLine ? \"block\" : \"none\" }}>\n <span className=\"sea-radar-graduation-text\" style={{ display: showGraduationText ? \"block\" : \"none\" }}>\n {String(index * 10).padStart(3, \"0\")}\n </span>\n </div>\n ))}\n <div className=\"sea-radar\">\n <div className=\"sea-radar-scan\" style={{ height: `${unitRadius * circleCount * Math.tan(scanAngle)}px`, clipPath: `polygon(0 0, 0 100%, 100% 100%)` }}></div>\n {showCircle &&\n Array(circleCount)\n .fill(0)\n .map((_, index) => <div className=\"sea-radar-circle\" style={{ width: `${unitRadius * 2 * (index + 1)}px`, height: `${unitRadius * 2 * (index + 1)}px` }}></div>)}\n {showDirection &&\n Array(directionCount)\n .fill(0)\n .map((_, index) => <div className=\"sea-radar-direction\" style={{ transform: `rotateZ(${(360 / directionCount) * index}deg)` }}></div>)}\n {targets?.map(it => (\n <div className=\"sea-radar-target\" style={{ left: `${unitRadius * circleCount + it.radius * Math.cos(it.angle)}px`, bottom: `${unitRadius * circleCount + it.radius * Math.sin(it.angle)}px` }}>\n {it.element}\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport interface RingProps extends HTMLAttributes<HTMLDivElement> {\n outerWidth: number\n innerWidth: number\n}\n\n/** 忘了什么组件 */\nexport const Ring: FC<RingProps> = props => {\n const { outerWidth, innerWidth, style, ...leftProps } = props\n\n const outerRadius = outerWidth / 2\n\n const innerRadius = innerWidth / 2\n\n return <div style={{ ...style, width: `${outerWidth}px`, height: `${outerWidth}px`, clipPath: `path(\"M0,${outerRadius} a${outerRadius},${outerRadius},0,1,0,${outerWidth},0 a${outerRadius},${outerRadius},0,1,0,-${outerWidth},0 l${outerRadius - innerRadius},0 a${innerRadius},${innerRadius},0,0,1,${innerRadius * 2},0 a${innerRadius},${innerRadius},0,0,1,-${innerRadius * 2},0 Z\")` }} {...leftProps} />\n}\n\nexport interface FlowSizeData {\n /** 容器宽度 */\n width: number\n /** 容器高度 */\n height: number\n /** 元素宽度 */\n itemWidth: number\n /** 元素高度 */\n itemHeight: number\n /** 列间距 */\n columnGap: number\n /** 列数 */\n columnCount: number\n /** 行间距 */\n rowGap: number\n /** 行数 */\n rowCount: number\n /** 元素格数 */\n itemCount: number\n /** 最大行数 */\n maxRows: number | null\n /** 是否有元素被隐藏 */\n overflow: boolean\n}\n\nexport interface FlowProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** 元素宽度 */\n itemWidth: number\n /** 元素高度 */\n itemHeight: number\n /** 列间距 */\n columnGap?: number | null | (number | null)[]\n /** 行间距 */\n rowGap?: number\n /** 最大行数 */\n maxRows?: number | null\n /** 源数据 */\n data: T[]\n /** 渲染 */\n render: (item: T, index: number, hidden: boolean) => ReactNode\n /** key释放器,默认为 index */\n keyExactor?: (item: T, index: number) => string | number\n /** 容器类名 */\n containerClassName?: string\n /** 容器样式 */\n containerStyle?: CSSProperties\n /** 节流时间,单位毫秒,默认200ms,传入 null 不节流 */\n throttle?: number | null\n /** 动画时间,单位毫秒,默认400ms,传入 null 不展示动画 */\n transitionDuration?: number | null\n /** 变化的回调函数 */\n onSizeChange?: (sizeData: FlowSizeData) => void\n}\n\nexport function getGapRange(gap?: undefined | number | null | (number | null)[]): [number, number | null] {\n if (typeof gap === \"number\") return [gap, gap]\n if (Array.isArray(gap)) return [gap[0] || 0, gap[1]]\n return [0, null]\n}\n\nexport function getGapCountAndSize(width: number, itemWidth: number, minGap: number, maxGap: number | null): [number, number] {\n const count = Math.floor((width + minGap) / (itemWidth + minGap)) || 1\n if (count === 1) return [count, 0]\n const averageGap = (width - itemWidth * count) / (count - 1)\n if (averageGap < minGap) return [count, minGap]\n if (maxGap !== null && averageGap > maxGap) return [count, maxGap]\n return [count, averageGap]\n}\n\n/** 自适应浮动组件 */\nexport function Flow<T>(props: FlowProps<T>) {\n const { itemWidth, itemHeight, columnGap, rowGap = 0, maxRows, data, render, keyExactor, className, style, containerClassName, containerStyle, throttle, transitionDuration, onSizeChange, ...otherProps } = props\n const [minColumnGap, maxColumnGap] = getGapRange(columnGap)\n const [width, setWidth] = useState(0)\n const [columnCount, setColumnCount] = useState(1)\n const [columnGapSize, setColumnGapSize] = useState(minColumnGap)\n const [showItems, setShowItems] = useState(false)\n const ele = useRef<HTMLDivElement>(null)\n const contentRows = Math.ceil(data.length / columnCount)\n const contentShownRows = typeof maxRows === \"number\" ? Math.min(contentRows, maxRows) : contentRows\n const height = contentShownRows > 0 ? contentShownRows * (itemHeight + rowGap) - rowGap : 0\n\n interface Position {\n left: number\n top: number\n }\n\n function getPosition(index: number): Position {\n const y = Math.floor(index / columnCount)\n const x = index - y * columnCount\n return {\n left: x * (itemWidth + columnGapSize),\n top: y * (itemHeight + rowGap)\n }\n }\n\n function getHidden(index: number) {\n if (typeof maxRows !== \"number\") return false\n return index >= maxRows * columnCount\n }\n\n useEffect(() => {\n let timeout: number\n const observer = new ResizeObserver(entries => {\n clearTimeout(timeout)\n function task() {\n const { inlineSize: width } = entries[0].borderBoxSize[0]\n const [newColumnCount, newColumnGapSize] = getGapCountAndSize(width, itemWidth, minColumnGap, maxColumnGap)\n setShowItems(true)\n setWidth(width)\n setColumnCount(newColumnCount)\n setColumnGapSize(newColumnGapSize)\n }\n if (throttle === null) {\n task()\n } else {\n timeout = window.setTimeout(task, throttle || 200)\n }\n })\n observer.observe(ele.current!)\n\n return () => {\n observer.disconnect()\n }\n }, [itemWidth, throttle, columnGap])\n\n useEffect(() => {\n onSizeChange?.({ width, height, itemWidth, itemHeight, columnGap: columnGapSize, columnCount, rowGap, rowCount: contentShownRows, overflow: data.length > contentShownRows * columnCount, itemCount: data.length, maxRows: maxRows ?? null })\n }, [width, height, columnGapSize, columnCount, rowGap, contentShownRows, data.length, itemWidth, itemHeight, maxRows])\n\n return (\n <div ref={ele} className={className} style={{ position: \"relative\", boxSizing: \"border-box\", height, ...style }} {...otherProps}>\n {showItems &&\n data.map((it, idx) => (\n <div\n key={keyExactor?.(it, idx) || idx}\n className={containerClassName}\n style={{\n position: \"absolute\",\n width: itemWidth,\n height: itemHeight,\n transition: transitionDuration !== null ? `all ${transitionDuration ?? 400}ms` : undefined,\n ...getPosition(idx)\n }}\n >\n <div style={{ width: itemWidth, height: itemHeight, display: maxRows && idx >= maxRows * columnCount ? \"none\" : \"block\", ...containerStyle }}>{render(it, idx, getHidden(idx))}</div>\n </div>\n ))}\n </div>\n )\n}\n\nexport interface TrapeziumProps extends HTMLAttributes<HTMLDivElement> {\n top: number\n bottom: number\n height: number\n borderRadius: number\n}\n\n/** 梯形组件 */\nexport const Trapezium = forwardRef<HTMLDivElement, TrapeziumProps>((props, ref) => {\n const { top, bottom, height, borderRadius, style, ...other } = props\n\n const diff = (bottom - top) / 2\n\n const a = Math.atan(height / diff) / 2\n\n const b = borderRadius / Math.tan(a)\n\n const c = b * Math.cos(a * 2)\n\n const d = b * Math.sin(a * 2)\n\n const e = Math.PI / 2 - a\n\n const f = borderRadius / Math.tan(e)\n\n const g = f * Math.cos(a * 2)\n\n const h = f * Math.sin(a * 2)\n\n return <div ref={ref} style={{ width: bottom, height, clipPath: `path(\"M ${diff + f} ${0} A ${borderRadius} ${borderRadius} 0 0 0 ${diff - g} ${h} L ${c} ${height - d} A ${borderRadius} ${borderRadius} 0 0 0 ${b} ${height} L ${bottom - b} ${height} A ${borderRadius} ${borderRadius} 0 0 0 ${bottom - c} ${height - d} L ${top + diff + g} ${h} A ${borderRadius} ${borderRadius} 0 0 0 ${top + diff - f} ${0} Z\")`, ...style }} {...other} />\n})\n\nexport interface LoopSwiperProps<T> {\n /** 源数据 */\n data: T[]\n /** 渲染函数 */\n render: (item: T, index: number, array: T[]) => ReactNode\n /** 每个元素的key */\n keyExactor?: (item: T, index: number, array: T[]) => string\n /** 水平方向是宽度,垂直方向是高度 */\n size: number\n /** 元素之间间隔 */\n gap?: number\n /** 起始位置 */\n start?: number\n /** 速度,水平方向正数为向左,水平方向负数为向右,垂直方向正数为向上,水平方向负数为向下 */\n speed: number\n /** 是否暂停播放 */\n paused?: boolean\n /** 容器的类名 */\n className?: string\n /** x 水平方向,y 垂直方向 */\n direction?: \"x\" | \"y\"\n}\n\nexport interface LoopSwiperItem {\n key: string\n dom: HTMLDivElement | null\n offset: number\n}\n\n/** 循环播放组件 */\nexport function LoopSwiper<T>(props: LoopSwiperProps<T>) {\n const { data, render, keyExactor, size, gap = 0, start = 0, speed, paused = false, className = \"\", direction = \"x\" } = props\n if (!(size > 0 && (speed > 0 || speed < 0))) {\n throw new RangeError(\"size 必须是正数,speed 必须非0\")\n }\n const keys = data.map((it, idx, arr) => (keyExactor ? keyExactor(it, idx, arr) : String(idx)))\n const cache = useRef({ size, gap, speed, keys, paused, className, direction })\n cache.current = { size, gap, speed, keys, paused, className, direction }\n const eles = useRef<LoopSwiperItem[]>([])\n eles.current = keys.map((key, idx) => ({ key, dom: null, offset: idx * (size + gap) + start }))\n\n function setStyles() {\n const { size, speed, className, direction } = cache.current\n eles.current.forEach(it => {\n it.dom!.className = className\n it.dom!.style.setProperty(\"position\", `absolute`)\n it.dom!.style.setProperty(\"width\", `${size}px`)\n direction === \"x\" && speed < 0 ? it.dom!.style.setProperty(\"right\", `0`) : it.dom!.style.setProperty(\"left\", `0`)\n direction === \"y\" && speed < 0 ? it.dom!.style.setProperty(\"bottom\", `0`) : it.dom!.style.setProperty(\"top\", `0`)\n it.dom!.style.setProperty(\"transform\", `translate${direction.toUpperCase()}(${it.offset * (speed > 0 ? 1 : -1)}px)`)\n })\n }\n\n useEffect(() => {\n setStyles()\n }, [])\n\n useEffect(() => {\n const stop = setFrameInterval(() => {\n const { size, gap, speed, keys, paused } = cache.current\n if (paused) return\n eles.current.length = keys.length\n let minIndex = 0\n eles.current.forEach((it, idx) => {\n if (it.offset < eles.current[minIndex].offset) {\n minIndex = idx\n }\n })\n const minOffset = eles.current[minIndex].offset\n eles.current.forEach((it, idx) => {\n let index = idx\n if (idx < minIndex) index = eles.current.length + idx\n it.offset = minOffset + (index - minIndex) * (size + gap)\n let newOffset = it.offset - Math.abs(speed)\n if (newOffset + size + gap <= 0) {\n newOffset += eles.current.length * (size + gap)\n }\n it.offset = newOffset\n })\n setStyles()\n }, 1)\n\n return stop\n }, [])\n\n return (\n <Fragment>\n {data.map((it, idx, arr) => (\n <div key={keys[idx]} ref={dom => (eles.current[idx].dom = dom)}>\n {render(it, idx, arr)}\n </div>\n ))}\n </Fragment>\n )\n}\n\nexport interface SectionRingProps extends HTMLAttributes<HTMLDivElement> {\n outerRadius: number\n innerRadius: number\n count: number\n angel: number\n}\n\nexport const SectionRing: FC<SectionRingProps> = props => {\n const { outerRadius: o, innerRadius: i, count: c, angel: a, style, ...others } = props\n\n const s = (Math.PI * 2) / c - a\n\n function arc(radius: number, startAngle: number, endAngle: number, options: DrawArcOptions = {}) {\n return drawArc(o, o, radius, startAngle, endAngle, options)\n }\n\n return (\n <div\n style={{\n ...style,\n width: o * 2,\n height: o * 2,\n clipPath: `path(\"${Array(c)\n .fill(0)\n .map((it, idx) => `${arc(o, idx * (a + s), idx * (a + s) + a)} ${arc(i, idx * (a + s) + a, idx * (a + s), { line: true, anticlockwise: true })}`)\n .join(\" \")} Z\")`\n }}\n {...others}\n />\n )\n}\n\nexport interface TransitionNumProps extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** 当前数字 */\n children: number\n /** 变换周期,单位帧 */\n period: number\n /** 数字转换为字符串的方法 */\n numToStr?: (num: number) => string\n}\n\nexport interface TransitionNumIns {\n get(): number\n}\n\n/** 渐变数字组件 */\nexport const TransitionNum = forwardRef<TransitionNumIns, TransitionNumProps>((props, ref) => {\n const { children: num, period, numToStr, ...others } = props\n if (!Number.isInteger(num) || !Number.isInteger(period) || period <= 0) {\n throw new RangeError(\"目标数字必须是整数,周期必须是正整数\")\n }\n const ele = useRef<HTMLDivElement>(null)\n const cache = useRef({ num, period, numToStr, show: num })\n cache.current = { ...cache.current, num, period, numToStr }\n\n useImperativeHandle(ref, () => ({ get: () => cache.current.show }), [])\n\n useEffect(() => {\n const { num, period, show, numToStr } = cache.current\n ele.current!.innerText = (numToStr || String)(show)\n if (num === show) return\n const div = ele.current!\n const speed = (num - show) / period\n const cancel = setFrameInterval(() => {\n const { num, numToStr } = cache.current\n cache.current.show += speed\n if ((speed > 0 && cache.current.show > num) || (speed < 0 && cache.current.show < num)) {\n cancel()\n cache.current.show = num\n }\n div.innerText = (numToStr || String)(speed > 0 ? Math.floor(cache.current.show) : Math.ceil(cache.current.show))\n }, 1)\n\n return cancel\n }, [num])\n\n return <div ref={ele} {...others} />\n})\n\nexport interface CircleTextProps extends Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> {\n /** 每一个方块的宽度 */\n width: number\n /** 每一个方块的高度 */\n height: number\n /** 圆弧的半径,不包含方块的高度 */\n radius: number\n /** 开始旋转的弧度,逆时针增加,0 为 x 轴方向 */\n startAngel?: number\n /** 每一个方块之间间隔的弧度 */\n gapAngel?: number\n /** 文字对齐的方式,默认居中 */\n align?: \"left\" | \"center\" | \"right\"\n /** 文字朝向圆心还是外侧,默认外侧 */\n direction?: \"inner\" | \"outer\"\n /** 是否反转文字顺序 */\n reverse?: boolean\n /** 分割文字的方法 */\n separator?: string | RegExp | ((text: string) => string[])\n /** 显示的文字 */\n children: string\n}\n\n/** 环形文字 */\nexport const CircleText: FC<CircleTextProps> = props => {\n const { width, height, radius, startAngel = 0, gapAngel = 0, align = \"center\", style, direction = \"outer\", reverse = false, separator, children, ...others } = props\n const unitAngle = Math.atan(width / 2 / radius) * 2\n const totalAngle = (unitAngle + gapAngel) * children.length - gapAngel\n const offsetAngle = align === \"left\" ? 0 : align === \"right\" ? totalAngle : totalAngle / 2\n\n function getTransform(idx: number) {\n const angle = startAngel - idx * (unitAngle + gapAngel) + offsetAngle - unitAngle / 2\n const x = (radius + height / 2) * Math.cos(angle) - width / 2\n const y = (radius + height / 2) * Math.sin(angle) * -1 - height / 2\n const z = Math.PI / 2 - angle + (direction === \"inner\" ? Math.PI : 0)\n return `translateX(${x}px) translateY(${y}px) rotateZ(${(z / Math.PI) * 180}deg)`\n }\n\n const words = typeof separator === \"function\" ? separator(children) : children.split(separator ?? \"\")\n\n if (reverse) words.reverse()\n\n return (\n <Fragment>\n {words.map((w, idx) => (\n <span key={idx} style={{ position: \"absolute\", ...style, transform: getTransform(idx), textAlign: \"center\", width, lineHeight: `${height}px`, height: height }} {...others}>\n {w}\n </span>\n ))}\n </Fragment>\n )\n}\n"],"mappings":";AACA,SAAyBA,OAAO,EAAEC,gBAAgB,QAAQ,eAAe;AACzE,OAAOC,KAAK,IAA0DC,QAAQ,EAAiFC,UAAU,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1O,SAASC,IAAI,EAAEC,KAAK,EAAEC,SAAS,QAAQ,MAAM;AAqD7C,OAAO,eAAeC,WAAWA,CAA8BC,IAAU,EAAEC,IAAO,EAAkC;EAChH,MAAMC,UAAU,GA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,EAAG,GAAEpL,MAAO,IAAG;MAAEA,MAAM,EAAEA;IAAO;EAAE,GAAKmJ,MAAM,GACrK+B,CACC,CACT,CACK,CAAC;AAEnB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "deepsea-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "格数科技自用组件库",
|
|
5
|
+
"module": "dist/esm/index.js",
|
|
6
|
+
"types": "dist/esm/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "father dev",
|
|
9
|
+
"build": "father build",
|
|
10
|
+
"build:deps": "father prebundle",
|
|
11
|
+
"prepublishOnly": "father doctor && npm run build"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/1adybug/deepsea-components"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [],
|
|
18
|
+
"authors": [
|
|
19
|
+
"lurongv@qq.com"
|
|
20
|
+
],
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"compiled"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"antd": "^5.11.0",
|
|
31
|
+
"deepsea-tools": "^1.0.0",
|
|
32
|
+
"react": "^18.2.0",
|
|
33
|
+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/react": "^18.2.37",
|
|
37
|
+
"father": "^4.3.7"
|
|
38
|
+
}
|
|
39
|
+
}
|