ty-element 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +23 -0
  2. package/dist/components/animate-container/index.d.ts +9 -0
  3. package/dist/components/animate-container/type.d.ts +67 -0
  4. package/dist/components/button/count/index.d.ts +3 -0
  5. package/dist/components/button/count/type.d.ts +16 -0
  6. package/dist/components/button/glow/index.d.ts +9 -0
  7. package/dist/components/button/glow/type.d.ts +21 -0
  8. package/dist/components/button/ripple/index.d.ts +9 -0
  9. package/dist/components/button/ripple/type.d.ts +30 -0
  10. package/dist/components/button/streamer/index.d.ts +3 -0
  11. package/dist/components/button/streamer/type.d.ts +11 -0
  12. package/dist/components/carousel/index.d.ts +10 -0
  13. package/dist/components/carousel/type.d.ts +18 -0
  14. package/dist/components/globe/entity-collection.d.ts +22 -0
  15. package/dist/components/globe/entity.d.ts +12 -0
  16. package/dist/components/globe/globe.d.ts +106 -0
  17. package/dist/components/globe/index.d.ts +3 -0
  18. package/dist/components/globe/sat-util.d.ts +26 -0
  19. package/dist/components/globe/satellite.d.ts +107 -0
  20. package/dist/components/globe/type.d.ts +71 -0
  21. package/dist/components/globe/wide-line/geometry.d.ts +22 -0
  22. package/dist/components/globe/wide-line/index.d.ts +7 -0
  23. package/dist/components/globe/wide-line/material.d.ts +22 -0
  24. package/dist/components/globe/wide-line/type.d.ts +10 -0
  25. package/dist/components/loading/progress/index.d.ts +8 -0
  26. package/dist/components/loading/progress/type.d.ts +80 -0
  27. package/dist/components/loading/tick/index.d.ts +8 -0
  28. package/dist/components/loading/tick/type.d.ts +36 -0
  29. package/dist/components/loading/water-progress/index.d.ts +8 -0
  30. package/dist/components/loading/water-progress/type.d.ts +31 -0
  31. package/dist/components/map/compare-map/index.d.ts +38 -0
  32. package/dist/components/map/compare-map/type.d.ts +52 -0
  33. package/dist/components/map/data-selector-map/index.d.ts +30 -0
  34. package/dist/components/map/data-selector-map/type.d.ts +99 -0
  35. package/dist/components/map/gis-map/index.d.ts +9 -0
  36. package/dist/components/map/gis-map/type.d.ts +132 -0
  37. package/dist/components/map/gis-maplibre/crepuscule/index.d.ts +49 -0
  38. package/dist/components/map/gis-maplibre/custom-layers/atmosphere-layer/index.d.ts +5 -0
  39. package/dist/components/map/gis-maplibre/custom-layers/atmosphere-layer/type.d.ts +20 -0
  40. package/dist/components/map/gis-maplibre/custom-layers/index.d.ts +40 -0
  41. package/dist/components/map/gis-maplibre/custom-layers/satellite-layer/clock.d.ts +17 -0
  42. package/dist/components/map/gis-maplibre/custom-layers/satellite-layer/index.d.ts +135 -0
  43. package/dist/components/map/gis-maplibre/custom-layers/satellite-layer/source.d.ts +65 -0
  44. package/dist/components/map/gis-maplibre/custom-layers/satellite-layer/type.d.ts +75 -0
  45. package/dist/components/map/gis-maplibre/custom-layers/star-layer/index.d.ts +6 -0
  46. package/dist/components/map/gis-maplibre/custom-layers/star-layer/type.d.ts +14 -0
  47. package/dist/components/map/gis-maplibre/custom-layers/sync-camera.d.ts +2 -0
  48. package/dist/components/map/gis-maplibre/custom-layers/type.d.ts +7 -0
  49. package/dist/components/map/gis-maplibre/index.d.ts +8 -0
  50. package/dist/components/map/gis-maplibre/type.d.ts +236 -0
  51. package/dist/components/map/gis-marker/index.d.ts +12 -0
  52. package/dist/components/map/gis-marker/type.d.ts +36 -0
  53. package/dist/components/map/multi-map/index.d.ts +8 -0
  54. package/dist/components/map/multi-map/syncMaps.d.ts +3 -0
  55. package/dist/components/map/multi-map/type.d.ts +2 -0
  56. package/dist/components/map/stac-data-map/index.d.ts +46 -0
  57. package/dist/components/map/stac-data-map/type.d.ts +78 -0
  58. package/dist/components/radar/index.d.ts +3 -0
  59. package/dist/components/radar/radar-instance.d.ts +34 -0
  60. package/dist/components/radar/type.d.ts +58 -0
  61. package/dist/components/ripple-container/index.d.ts +8 -0
  62. package/dist/components/ripple-container/type.d.ts +23 -0
  63. package/dist/components/table/index.d.ts +3 -0
  64. package/dist/components/table/type.d.ts +114 -0
  65. package/dist/components/third-part/delete-button/index.d.ts +8 -0
  66. package/dist/components/third-part/delete-button/type.d.ts +28 -0
  67. package/dist/components/third-part/dragger-upload/index.d.ts +8 -0
  68. package/dist/components/third-part/dragger-upload/type.d.ts +8 -0
  69. package/dist/components/third-part/key-value/index.d.ts +8 -0
  70. package/dist/components/third-part/key-value/type.d.ts +47 -0
  71. package/dist/components/third-part/slider-input/index.d.ts +8 -0
  72. package/dist/components/third-part/slider-input/type.d.ts +40 -0
  73. package/dist/components/timeline/index.d.ts +8 -0
  74. package/dist/components/timeline/type.d.ts +105 -0
  75. package/dist/constants/index.d.ts +39 -0
  76. package/dist/draco/README.md +32 -0
  77. package/dist/draco/draco_decoder.js +34 -0
  78. package/dist/draco/draco_decoder.wasm +0 -0
  79. package/dist/draco/draco_encoder.js +33 -0
  80. package/dist/draco/draco_wasm_wrapper.js +117 -0
  81. package/dist/draco/gltf/draco_decoder.js +33 -0
  82. package/dist/draco/gltf/draco_decoder.wasm +0 -0
  83. package/dist/draco/gltf/draco_encoder.js +33 -0
  84. package/dist/draco/gltf/draco_wasm_wrapper.js +116 -0
  85. package/dist/earth.jpg +0 -0
  86. package/dist/index.d.ts +88 -0
  87. package/dist/index.js +33146 -0
  88. package/dist/shaders/program/index.d.ts +30 -0
  89. package/dist/shaders/shader.d.ts +16 -0
  90. package/dist/style.css +7 -0
  91. package/dist/types/geometry.d.ts +39 -0
  92. package/dist/types/stac.d.ts +69 -0
  93. package/dist/types/utils.d.ts +2 -0
  94. package/dist/utils/css/index.d.ts +8 -0
  95. package/dist/utils/io/index.d.ts +4 -0
  96. package/dist/utils/object/index.d.ts +6 -0
  97. package/dist/utils/random/index.d.ts +13 -0
  98. package/dist/utils/sat/index.d.ts +11 -0
  99. package/dist/utils/sat/type.d.ts +22 -0
  100. package/dist/utils/tle/index.d.ts +49 -0
  101. package/dist/utils/tle/type.d.ts +36 -0
  102. package/dist/utils/unit/index.d.ts +6 -0
  103. package/package.json +105 -0
@@ -0,0 +1,46 @@
1
+ import { StacDataMapRef } from './type';
2
+ import { StacObj } from '../../../types/stac';
3
+ /**
4
+ * @description stac地图选择组件
5
+ * @author tiancheng.xia
6
+ * @since 2025-01-07
7
+ */
8
+ declare const StacDataMap: import('react').ForwardRefExoticComponent<{
9
+ dataList: StacObj[];
10
+ hoverEffect?: boolean;
11
+ style?: {
12
+ normal?: {
13
+ color?: string;
14
+ width?: number;
15
+ };
16
+ active?: {
17
+ color?: string;
18
+ width?: number;
19
+ opacity?: number;
20
+ };
21
+ };
22
+ onItemClick?: (e: StacObj) => void;
23
+ } & {
24
+ precision?: number;
25
+ style?: {
26
+ draw?: {
27
+ color?: string;
28
+ opacity?: number;
29
+ outlineWidth?: number;
30
+ pointColor?: string;
31
+ pointRadius?: number;
32
+ };
33
+ measure?: {
34
+ color?: string;
35
+ opacity?: number;
36
+ outlineWidth?: number;
37
+ pointColor?: string;
38
+ pointRadius?: number;
39
+ textClassName?: string;
40
+ };
41
+ };
42
+ scalerDomSize?: number;
43
+ onChange?: (e: import('../data-selector-map/type').DataSelectorMapChangeEvent) => void;
44
+ onScaleChange?: (dis: number) => void;
45
+ } & import('../gis-maplibre/type').GISMaplibreProps & import('react').RefAttributes<StacDataMapRef>>;
46
+ export default StacDataMap;
@@ -0,0 +1,78 @@
1
+ import { default as maplibregl } from 'maplibre-gl';
2
+ import { StacObj } from '../../../types/stac';
3
+ import { DataSelectorMapProps, DataSelectorMapRef } from '../data-selector-map/type';
4
+ export type StacDataMapProps = {
5
+ /**
6
+ * @description stac数据
7
+ */
8
+ dataList: StacObj[];
9
+ /**
10
+ * @description 是否创建hover效果,hover效果关联item的点击事件
11
+ */
12
+ hoverEffect?: boolean;
13
+ /**
14
+ * @description 数据框的样式,默认值见右侧
15
+ */
16
+ style?: {
17
+ normal?: {
18
+ color?: string;
19
+ width?: number;
20
+ };
21
+ active?: {
22
+ color?: string;
23
+ width?: number;
24
+ opacity?: number;
25
+ };
26
+ };
27
+ /**
28
+ * @description 需要hoverEffect为true才生效
29
+ */
30
+ onItemClick?: (e: StacObj) => void;
31
+ } & DataSelectorMapProps;
32
+ export type StacDataMapRef = {
33
+ /**
34
+ * @description 设置stac数据列表
35
+ */
36
+ setStacList: (features: StacObj[]) => void;
37
+ /**
38
+ * @description 选中某个数据
39
+ */
40
+ selectStacObj: (obj: StacObj, coordinates: maplibregl.ImageSourceSpecification["coordinates"], overviewUrl?: string) => void;
41
+ /**
42
+ * @description 取消选中某个数据
43
+ */
44
+ unselectStacObj: (obj: StacObj) => void;
45
+ /**
46
+ * @description 清除地图上所有缩略图
47
+ */
48
+ clearImageList: () => void;
49
+ /**
50
+ * @description 获取某个数据的面积
51
+ * @param data stac数据
52
+ * @param precision 精度
53
+ * @returns 面积,单位是平方米
54
+ */
55
+ getArea: (data: StacObj, precision?: number) => number;
56
+ /**
57
+ * @description 获取总共面积
58
+ * @param precision 精度
59
+ * @param isUnion 是否是合并后的数据,但是合并会有出错的风险
60
+ * @returns 面积,单位是平方米
61
+ */
62
+ getTotalArea: (precision?: number, isUnion?: boolean) => number;
63
+ /**
64
+ *
65
+ * @param precision 精度
66
+ * @returns 面积,单位是平方米
67
+ */
68
+ getIntersectArea: (precision?: number) => number;
69
+ /**
70
+ * @description 获取绘制区域的面积
71
+ * @param precision 精度
72
+ * @returns 面积,单位是平方米
73
+ */
74
+ getAOIArea: (precision?: number) => number;
75
+ } & DataSelectorMapRef;
76
+ export declare const DATA_SOURCE_ID = "sv-cps-stac-data";
77
+ export declare const DATA_LAYER_LINE_ID = "sv-cps-stac-line";
78
+ export declare const DATA_LAYER_FILL_ID = "sv-cps-stac-fill";
@@ -0,0 +1,3 @@
1
+ import { RadarProps } from './type';
2
+ declare const Radar: (props: RadarProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Radar;
@@ -0,0 +1,34 @@
1
+ import { RadarOptions, RadarPoint } from './type';
2
+ declare class RadarInstance {
3
+ canvas: RadarOptions["canvas"];
4
+ interval: RadarOptions["interval"];
5
+ lineColor: RadarOptions["lineColor"];
6
+ count: RadarOptions["count"];
7
+ lineWidth: RadarOptions["lineWidth"];
8
+ padding: RadarOptions["padding"];
9
+ overRadius: RadarOptions["overRadius"];
10
+ hasPoint: RadarOptions["hasPoint"];
11
+ pointColor: RadarOptions["pointColor"];
12
+ pointSize: RadarOptions["pointSize"];
13
+ speed: RadarOptions["speed"];
14
+ scanColor: RadarOptions["scanColor"];
15
+ _hasRunOneCircle: boolean;
16
+ _ctx: CanvasRenderingContext2D;
17
+ _timer: number;
18
+ constructor(options: RadarOptions);
19
+ get singleAxisLength(): number;
20
+ get size(): number;
21
+ get center(): number;
22
+ get endPoints(): Array<{
23
+ x: number;
24
+ y: number;
25
+ }>;
26
+ drawArc(radius: number): void;
27
+ drawPoint(x: number, y: number, radius: number): void;
28
+ drawAxis(endPoint: RadarPoint): void;
29
+ drawBase(): void;
30
+ drawHightlightArc(beginAngel: number, step?: number): void;
31
+ draw(angle?: number): void;
32
+ destroy(): void;
33
+ }
34
+ export default RadarInstance;
@@ -0,0 +1,58 @@
1
+ import { CSSProperties } from 'react';
2
+ export type RadarOptions = {
3
+ /**
4
+ * @description canvas dom
5
+ */
6
+ canvas: HTMLCanvasElement;
7
+ /**
8
+ * @description 间隔长度单位px
9
+ */
10
+ interval?: number;
11
+ /**
12
+ * @description 圆环数量
13
+ */
14
+ count?: number;
15
+ /**
16
+ * @description 线宽
17
+ */
18
+ lineWidth?: number;
19
+ /**
20
+ * @description 线颜色
21
+ */
22
+ lineColor?: CSSProperties["color"];
23
+ /**
24
+ * @description canvas的内边距
25
+ */
26
+ padding?: number;
27
+ /**
28
+ * @description x、y轴超出最大半径部分
29
+ */
30
+ overRadius?: number;
31
+ /**
32
+ * @description 是否需要焦点
33
+ */
34
+ hasPoint?: boolean;
35
+ /**
36
+ * @description 点的颜色
37
+ */
38
+ pointColor?: CSSProperties["color"];
39
+ /**
40
+ * @description 点的尺寸
41
+ */
42
+ pointSize?: number;
43
+ /**
44
+ * @description 转动速度
45
+ */
46
+ speed?: number;
47
+ /**
48
+ * @description 扫描闪烁的颜色
49
+ */
50
+ scanColor?: CSSProperties["color"];
51
+ };
52
+ export type RadarProps = {
53
+ rootClassName?: string;
54
+ } & Omit<RadarOptions, "canvas">;
55
+ export type RadarPoint = {
56
+ x: number;
57
+ y: number;
58
+ };
@@ -0,0 +1,8 @@
1
+ import { RippleContainerProps } from './type';
2
+ /**
3
+ * @description ripple when click
4
+ * @author tiancheng.xia
5
+ * @since 2025-03-04
6
+ */
7
+ declare const RippleContainer: (props: RippleContainerProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default RippleContainer;
@@ -0,0 +1,23 @@
1
+ import { CSSProperties, HTMLAttributes, MouseEventHandler, ReactNode } from 'react';
2
+ export type RippleContainerProps = {
3
+ /**
4
+ * @description 根元素的类名
5
+ */
6
+ rootClassName?: string;
7
+ /**
8
+ * @description 子元素
9
+ */
10
+ children?: ReactNode;
11
+ /**
12
+ * @description 波纹颜色
13
+ */
14
+ rippleColor?: CSSProperties["background"];
15
+ /**
16
+ * @description 是否启用波纹效果
17
+ */
18
+ enable?: boolean;
19
+ /**
20
+ * @description 点击事件
21
+ */
22
+ onClick?: MouseEventHandler<HTMLDivElement>;
23
+ } & Omit<HTMLAttributes<HTMLDivElement>, "onClick" | "children">;
@@ -0,0 +1,3 @@
1
+ import { RefTable } from './type';
2
+ declare const _default: RefTable;
3
+ export default _default;
@@ -0,0 +1,114 @@
1
+ import { CSSProperties, PropsWithChildren, ReactElement, ReactNode, RefAttributes } from 'react';
2
+ import { AnimateContainerProps } from '../animate-container/type';
3
+ export type ColumnProps<T> = {
4
+ /**
5
+ * @description 列名称
6
+ */
7
+ title: ReactNode;
8
+ /**
9
+ * @description 列数据索引
10
+ */
11
+ dataIndex?: keyof T;
12
+ /**
13
+ * @description 列数据索引
14
+ */
15
+ key: string;
16
+ /**
17
+ * @description 列自定义渲染
18
+ */
19
+ render?: (record: T) => ReactNode;
20
+ /**
21
+ * @description 列对齐方式
22
+ */
23
+ align?: "left" | "center" | "right";
24
+ /**
25
+ * @description 列宽
26
+ */
27
+ width?: number | string;
28
+ /**
29
+ * @description 是否省略 注:tooltip使用antd,可以使用antd的tooltip属性
30
+ */
31
+ ellipsis?: boolean;
32
+ /**
33
+ * @description tooltip属性
34
+ */
35
+ tooltipOptions?: (d: T) => string;
36
+ };
37
+ export type LoopScrollOptions = {
38
+ /**
39
+ * @description 滚动播放速度
40
+ */
41
+ speed?: number;
42
+ };
43
+ export type TableProps<T> = {
44
+ /**
45
+ * @description 根节点类名
46
+ */
47
+ rootClassName?: string;
48
+ /**
49
+ * @description 列
50
+ */
51
+ columns: ColumnProps<T>[];
52
+ /**
53
+ * @description 数据
54
+ */
55
+ dataSource: T[];
56
+ /**
57
+ * @description 数据的key
58
+ */
59
+ rowId?: string;
60
+ /**
61
+ * @description 加载的配置
62
+ */
63
+ loadingOptions?: AnimateContainerProps["loadingOptions"];
64
+ /**
65
+ * @description 加载的遮罩层类名
66
+ */
67
+ loadingMaskClassName?: string;
68
+ /**
69
+ * @description 表头是否固定
70
+ */
71
+ fixedHeader?: boolean;
72
+ /**
73
+ * @description 行的类名
74
+ */
75
+ rowClassName?: (record: T, index: number) => string;
76
+ /**
77
+ * @description 表的类名
78
+ */
79
+ tableClassName?: string;
80
+ /**
81
+ * @description 表外层容器的类名
82
+ */
83
+ scrollClassName?: string;
84
+ /**
85
+ * @description 设置表头,表体样式
86
+ */
87
+ styles?: {
88
+ header?: CSSProperties;
89
+ body?: CSSProperties;
90
+ root?: CSSProperties;
91
+ };
92
+ /**
93
+ * @description 是否开启斑马线并配置颜色
94
+ */
95
+ zebra?: {
96
+ color0: CSSProperties["color"];
97
+ color1: CSSProperties["color"];
98
+ };
99
+ /**
100
+ * @description 是否循环播放
101
+ */
102
+ loopScroll?: boolean | LoopScrollOptions;
103
+ /**
104
+ * @description 空数据展示
105
+ */
106
+ empty?: ReactNode;
107
+ };
108
+ export type TableRef = {
109
+ /**
110
+ * @description 滚动到指定数据
111
+ */
112
+ scrollToIndex: (index: number) => void;
113
+ };
114
+ export type RefTable = <T>(props: PropsWithChildren<TableProps<T>> & RefAttributes<TableRef>) => ReactElement;
@@ -0,0 +1,8 @@
1
+ import { DeleteButtonProps } from './type';
2
+ /**
3
+ * @description 确认删除按钮
4
+ * @author tiancheng.xia
5
+ * @since 2025-01-07
6
+ */
7
+ declare const DeleteButton: (props: DeleteButtonProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default DeleteButton;
@@ -0,0 +1,28 @@
1
+ import { ButtonProps, PopconfirmProps } from 'antd';
2
+ import { ReactNode } from 'react';
3
+ export type DeleteButtonProps = {
4
+ /**
5
+ * @description 确认框提示文本
6
+ */
7
+ text?: ReactNode;
8
+ /**
9
+ * @description 按钮子节点
10
+ */
11
+ children?: ReactNode;
12
+ /**
13
+ * @description 确认按钮点击事件
14
+ */
15
+ onOk?: PopconfirmProps["onConfirm"];
16
+ /**
17
+ * @description 取消按钮点击事件
18
+ */
19
+ onCancel?: PopconfirmProps["onCancel"];
20
+ /**
21
+ * @description 确认框配置项与antd Popconfirm组件一致,除去title、onConfirm、onCancel
22
+ */
23
+ popupOptions?: Omit<PopconfirmProps, "title" | "onConfirm" | "onCancel">;
24
+ /**
25
+ * @description 按钮配置项与antd Button组件一致,除去children
26
+ */
27
+ buttonOptions?: Omit<ButtonProps, "children">;
28
+ };
@@ -0,0 +1,8 @@
1
+ import { DraggerUploadProps } from './type';
2
+ /**
3
+ * @description 拖拽上传组件
4
+ * @author tiancheng.xia
5
+ * @since 2025-02-08
6
+ */
7
+ declare const DraggerUpload: (props: DraggerUploadProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default DraggerUpload;
@@ -0,0 +1,8 @@
1
+ import { UploadProps } from 'antd';
2
+ import { ReactNode } from 'react';
3
+ export type DraggerUploadProps = {
4
+ /**
5
+ * @description 上传组件中间文字描述
6
+ */
7
+ descs?: ReactNode;
8
+ } & UploadProps;
@@ -0,0 +1,8 @@
1
+ import { KeyValueProps } from './type';
2
+ /**
3
+ * @description 键值对组件
4
+ * @author tiancheng.xia
5
+ * @since 2025-02-06
6
+ */
7
+ declare const KeyValue: (props: KeyValueProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default KeyValue;
@@ -0,0 +1,47 @@
1
+ import { GetKey } from '../../../types/utils';
2
+ import { TooltipProps } from 'antd';
3
+ import { CSSProperties, ReactNode } from 'react';
4
+ export type KeyValueOptions = {
5
+ /**
6
+ * @description 样式类名
7
+ */
8
+ className?: string;
9
+ /**
10
+ * @description 提示配置,与antd tooltip配置一致
11
+ */
12
+ tooltip?: TooltipProps;
13
+ /**
14
+ * @description 键或值的节点
15
+ */
16
+ node?: ReactNode;
17
+ /**
18
+ * @description 文本对齐方式,当节点不是字符串的时候失效
19
+ */
20
+ algin?: CSSProperties["textAlign"];
21
+ /**
22
+ * @description 容器的宽度
23
+ */
24
+ width?: CSSProperties["width"];
25
+ };
26
+ export declare const DIRECTION: {
27
+ readonly v: "v";
28
+ readonly h: "h";
29
+ };
30
+ export type KeyValueProps = {
31
+ /**
32
+ * @description 根节点样式类名
33
+ */
34
+ rootClassName?: string;
35
+ /**
36
+ * @description 键的配置项
37
+ */
38
+ keyOptions?: KeyValueOptions;
39
+ /**
40
+ * @description 值的配置项
41
+ */
42
+ valueOptions?: KeyValueOptions;
43
+ /**
44
+ * @description 方向 "v" 竖向 "h" 横向
45
+ */
46
+ direction?: GetKey<typeof DIRECTION>;
47
+ };
@@ -0,0 +1,8 @@
1
+ import { SliderInputProps } from './type';
2
+ /**
3
+ * @description 滑块与input组合
4
+ * @author tiancheng.xia
5
+ * @since 2025-03-14
6
+ */
7
+ declare const SliderInput: (props: SliderInputProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default SliderInput;
@@ -0,0 +1,40 @@
1
+ import { InputNumberProps } from 'antd';
2
+ import { SliderSingleProps } from 'antd/es/slider';
3
+ export type SliderInputProps = {
4
+ /**
5
+ * @description 滑块与输入框之间的间距
6
+ */
7
+ gap?: number;
8
+ /**
9
+ * @description 滑块宽度
10
+ */
11
+ sliderWidth?: number;
12
+ /**
13
+ * @description 绑定的值
14
+ */
15
+ value: number;
16
+ /**
17
+ * @description 最小值
18
+ */
19
+ min?: number;
20
+ /**
21
+ * @description 最大值
22
+ */
23
+ max?: number;
24
+ /**
25
+ * @description 步长
26
+ */
27
+ step?: number;
28
+ /**
29
+ * @description 改变事件回调
30
+ */
31
+ onChange: (value: number) => void;
32
+ /**
33
+ * @description 滑块配置,参考 antd slider
34
+ */
35
+ sliderOptions?: Omit<SliderSingleProps, "min" | "max" | "step">;
36
+ /**
37
+ * @description 输入框配置,参考 antd inputNumber
38
+ */
39
+ inputOptions?: Omit<InputNumberProps, "min" | "max" | "step">;
40
+ };
@@ -0,0 +1,8 @@
1
+ import { TimelineProps } from './type';
2
+ /**
3
+ * @description 时间轴组件
4
+ * @author tiancheng.xia
5
+ * @since 2025-04-07
6
+ */
7
+ declare const Timeline: (props: TimelineProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default Timeline;
@@ -0,0 +1,105 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ export type TickStyle = {
3
+ /**
4
+ * @description 短刻度线宽度
5
+ */
6
+ width: number;
7
+ /**
8
+ * @description 短刻度线高度
9
+ */
10
+ height: number;
11
+ /**
12
+ * @description 短刻度线背景色
13
+ */
14
+ color: CSSProperties["color"];
15
+ /**
16
+ * @description 长刻度线宽度
17
+ */
18
+ longWidth: number;
19
+ /**
20
+ * @description 长刻度线高度
21
+ */
22
+ longHeight: number;
23
+ /**
24
+ * @description 长刻度线颜色
25
+ */
26
+ longColor: CSSProperties["color"];
27
+ };
28
+ export type TimelineProps = {
29
+ /**
30
+ * @description 根元素类名
31
+ */
32
+ rootClassName?: string;
33
+ /**
34
+ * @description 根元素样式
35
+ */
36
+ style?: Omit<CSSProperties, "width" | "height">;
37
+ /**
38
+ * @description 根元素宽度
39
+ */
40
+ width: CSSProperties["width"];
41
+ /**
42
+ * @description 根元素高度
43
+ */
44
+ height: CSSProperties["height"];
45
+ /**
46
+ * @description 刻度的样式
47
+ */
48
+ tickStyle?: Partial<TickStyle>;
49
+ /**
50
+ * @description 起始时间
51
+ */
52
+ startTime: Date;
53
+ /**
54
+ * @description 当前时间
55
+ */
56
+ currentTime: Date;
57
+ /**
58
+ * @description 结束时间
59
+ */
60
+ endTime: Date;
61
+ /**
62
+ * @description 一个小时之间的刻度分割,整数并且是60的一个乘数
63
+ */
64
+ interval?: number;
65
+ /**
66
+ * @description 自定义游标
67
+ */
68
+ cursor?: ReactNode;
69
+ /**
70
+ * @description 默认游标的颜色
71
+ */
72
+ defaultCursorColor?: CSSProperties["color"];
73
+ /**
74
+ * @description 一些类名
75
+ */
76
+ classNames?: {
77
+ longTick?: string;
78
+ shortTick?: string;
79
+ label?: string;
80
+ };
81
+ /**
82
+ * @description 自定义刻度线显示文本,只对长刻度线有效
83
+ */
84
+ tickLabelRender?: (date: Date) => ReactNode;
85
+ /**
86
+ * @description 时间轴变化回调函数
87
+ */
88
+ onChange?: (date: Date) => void;
89
+ /**
90
+ * @description 鼠标松开游标回调函数
91
+ */
92
+ onMouseup?: () => void;
93
+ /**
94
+ * @description 游标鼠标上移显示内容
95
+ */
96
+ cursorTitle?: (time: Date) => string;
97
+ /**
98
+ * @description 刻度鼠标上移显示内容
99
+ */
100
+ tickTitle?: (time: Date) => string;
101
+ /**
102
+ * @description 刻度标签鼠标上移显示内容
103
+ */
104
+ labelTitle?: (time: Date) => string;
105
+ };