@cloud-app-dev/vidc 2.2.0-alpha.5 → 2.2.0-alpha.6
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/es/AppContext/static.js +11 -6
- package/es/CheckGroupFixed/index.js +8 -6
- package/es/FullScreen/index.d.ts +12 -0
- package/es/FullScreen/index.js +1 -1
- package/es/List/GridList/Demo.js +13 -35
- package/es/List/GridList/data.json +710 -0
- package/es/List/GridList/index.d.ts +2 -2
- package/es/List/GridList/index.js +2 -1
- package/es/List/index.d.ts +3 -1
- package/es/List/index.js +4 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +1 -1
- package/es/Picture/index.d.ts +2 -0
- package/es/Picture/index.js +5 -3
- package/es/Picture/interface.d.ts +136 -3
- package/es/Picture/utils.d.ts +0 -2
- package/es/Player/player.d.ts +119 -1
- package/es/Player/style/timeline.css +1 -1
- package/es/utils.d.ts +2 -1
- package/es/utils.js +17 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { GridListItemData } from './interface';
|
|
2
|
+
import { GridListCell, GridListItemData } from './interface';
|
|
3
3
|
import './index.less';
|
|
4
4
|
export interface GridListProps<P> {
|
|
5
5
|
items: P[];
|
|
@@ -7,7 +7,7 @@ export interface GridListProps<P> {
|
|
|
7
7
|
getWindowMargin?: (windowHeight: number) => number;
|
|
8
8
|
getColumnCount: (elementWidth: number, gridGap: number) => number;
|
|
9
9
|
getItemData: (item: P, columnWidth: number) => GridListItemData;
|
|
10
|
-
renderItem: (item: P) => React.ReactNode;
|
|
10
|
+
renderItem: (item: P, cell: GridListCell<P>) => React.ReactNode;
|
|
11
11
|
fixedColumnWidth?: number;
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
@@ -36,10 +36,11 @@ function GridList(props, ref) {
|
|
|
36
36
|
key: cell.key,
|
|
37
37
|
style: {
|
|
38
38
|
height: cell.height,
|
|
39
|
+
width: cell.width,
|
|
39
40
|
gridColumnStart: "".concat(cell.columnNumber),
|
|
40
41
|
gridRowStart: getGridRowStart(cell, renderData)
|
|
41
42
|
}
|
|
42
|
-
}, props.renderItem(cell.item));
|
|
43
|
+
}, props.renderItem(cell.item, cell));
|
|
43
44
|
}))));
|
|
44
45
|
}
|
|
45
46
|
|
package/es/List/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { CheckListProps } from './interface';
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare function List(props: CheckListProps<any>): JSX.Element;
|
|
@@ -13,5 +13,7 @@ declare namespace List {
|
|
|
13
13
|
var DeviceList: typeof import("./DeviceList").default;
|
|
14
14
|
var ListExt: typeof import("./ListExt").default;
|
|
15
15
|
var DynamicDeviceList: typeof import("./DynamicDeviceList").default;
|
|
16
|
+
var GridList: React.ForwardRefExoticComponent<import("./GridList").GridListProps<any> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
var DynamicGridList: typeof import("./DynamicGridList").default;
|
|
16
18
|
}
|
|
17
19
|
export default List;
|
package/es/List/index.js
CHANGED
|
@@ -27,6 +27,8 @@ import CheckExt from './CheckExt';
|
|
|
27
27
|
import DeviceList from './DeviceList';
|
|
28
28
|
import ListExt from './ListExt';
|
|
29
29
|
import DynamicDeviceList from './DynamicDeviceList';
|
|
30
|
+
import GridList from './GridList';
|
|
31
|
+
import DynamicGridList from './DynamicGridList';
|
|
30
32
|
import "./index.css";
|
|
31
33
|
|
|
32
34
|
function List(props) {
|
|
@@ -175,4 +177,6 @@ List.VList = VList;
|
|
|
175
177
|
List.DeviceList = DeviceList;
|
|
176
178
|
List.ListExt = ListExt;
|
|
177
179
|
List.DynamicDeviceList = DynamicDeviceList;
|
|
180
|
+
List.GridList = GridList;
|
|
181
|
+
List.DynamicGridList = DynamicGridList;
|
|
178
182
|
export default List;
|
|
@@ -82,7 +82,7 @@ function RectInfo(_ref) {
|
|
|
82
82
|
return /*#__PURE__*/React.createElement("li", {
|
|
83
83
|
className: "info-item",
|
|
84
84
|
key: index,
|
|
85
|
-
title: v.
|
|
85
|
+
title: v.titleAttr
|
|
86
86
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
87
87
|
type: v.icon
|
|
88
88
|
}), /*#__PURE__*/React.createElement("span", {
|
package/es/Picture/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import './index.less';
|
|
|
4
4
|
declare function Picture({ className, width, height, minHeight, disabledDrag, imagePath, rects, isOpenSelect, disabledDrawMenu, menus, hasTool, fullScreenEle, ...props }: IPictureProps): JSX.Element;
|
|
5
5
|
declare namespace Picture {
|
|
6
6
|
var defaultProps: {
|
|
7
|
+
width: string;
|
|
8
|
+
height: string;
|
|
7
9
|
className: string;
|
|
8
10
|
minHeight: number;
|
|
9
11
|
disabledDrag: boolean;
|
package/es/Picture/index.js
CHANGED
|
@@ -266,8 +266,8 @@ function Picture(_a) {
|
|
|
266
266
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
267
267
|
className: "picture-view-layout ".concat(className),
|
|
268
268
|
style: {
|
|
269
|
-
width: width
|
|
270
|
-
height: height
|
|
269
|
+
width: width,
|
|
270
|
+
height: height,
|
|
271
271
|
minHeight: minHeight
|
|
272
272
|
},
|
|
273
273
|
ref: layoutRef,
|
|
@@ -323,7 +323,7 @@ function Picture(_a) {
|
|
|
323
323
|
setScale: setScale,
|
|
324
324
|
setRotate: setRotate,
|
|
325
325
|
scale: scale,
|
|
326
|
-
containerEle: fullScreenEle
|
|
326
|
+
containerEle: fullScreenEle !== null && fullScreenEle !== void 0 ? fullScreenEle : layoutRef.current,
|
|
327
327
|
resetPicture: resetPicture,
|
|
328
328
|
imgDownload: imgDownload,
|
|
329
329
|
fullScreenChange: loadImageSuccess
|
|
@@ -334,6 +334,8 @@ function Picture(_a) {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
Picture.defaultProps = {
|
|
337
|
+
width: '100%',
|
|
338
|
+
height: '100%',
|
|
337
339
|
className: '',
|
|
338
340
|
minHeight: 300,
|
|
339
341
|
disabledDrag: false,
|
|
@@ -1,37 +1,111 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
export type MenuRectType = {
|
|
4
|
+
/**
|
|
5
|
+
* 路由地址
|
|
6
|
+
*/
|
|
4
7
|
pathname: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 标题
|
|
11
|
+
*/
|
|
5
12
|
title: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 图标
|
|
16
|
+
*/
|
|
6
17
|
icon: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 内部属性,忽略
|
|
21
|
+
*/
|
|
7
22
|
base64?: string;
|
|
8
23
|
};
|
|
24
|
+
export const MenuRectTypeDemo: React.FC<MenuRectType>;
|
|
9
25
|
|
|
10
26
|
export type TagItemType = {
|
|
27
|
+
/**
|
|
28
|
+
* 标签值 code
|
|
29
|
+
*/
|
|
11
30
|
value: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 标签对应文本
|
|
34
|
+
*/
|
|
12
35
|
label: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 标签图标
|
|
39
|
+
*/
|
|
13
40
|
icon: string;
|
|
14
|
-
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
*标签title属性
|
|
44
|
+
*/
|
|
45
|
+
titleAttr?: string;
|
|
15
46
|
};
|
|
47
|
+
export const TagItemTypeDemo: React.FC<TagItemType>;
|
|
16
48
|
|
|
17
49
|
export type ImageType = 'face' | 'body' | 'nonVehicle' | 'vehicle' | 'thing';
|
|
18
50
|
|
|
19
51
|
export type RectType = {
|
|
52
|
+
/**
|
|
53
|
+
* 矩形框坐标 [left,top,width,height]
|
|
54
|
+
*/
|
|
20
55
|
rect: Array<number>;
|
|
56
|
+
/**
|
|
57
|
+
* 'face' | 'body' | 'nonVehicle' | 'vehicle' | 'thing'
|
|
58
|
+
*/
|
|
21
59
|
type: ImageType;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 矩形是否需要扩大,根据类型扩大计算公式
|
|
63
|
+
*/
|
|
22
64
|
needExpand?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 图片id
|
|
68
|
+
*/
|
|
23
69
|
imgId?: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 矩形面积,通过面积控制矩形层级
|
|
73
|
+
*/
|
|
24
74
|
area?: number;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 矩形中对象对应的标签
|
|
78
|
+
*/
|
|
25
79
|
tags?: TagItemType[];
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 小图的地址
|
|
83
|
+
*/
|
|
26
84
|
imgUrl?: string;
|
|
27
|
-
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 是否默认
|
|
88
|
+
*/
|
|
28
89
|
isDefault?: boolean;
|
|
29
|
-
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 重复标记
|
|
93
|
+
*/
|
|
30
94
|
dupId?: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 低质量标记
|
|
98
|
+
*/
|
|
31
99
|
lowQuality?: boolean;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 内部属性,忽略
|
|
103
|
+
*/
|
|
32
104
|
base64?: string;
|
|
33
105
|
};
|
|
34
106
|
|
|
107
|
+
export const RectTypeDemo: React.FC<RectType>;
|
|
108
|
+
|
|
35
109
|
export type PositionType = {
|
|
36
110
|
x: number;
|
|
37
111
|
y: number;
|
|
@@ -50,20 +124,79 @@ export type SizeType = {
|
|
|
50
124
|
};
|
|
51
125
|
|
|
52
126
|
export interface IPictureProps {
|
|
127
|
+
/**
|
|
128
|
+
* 容器类名
|
|
129
|
+
*/
|
|
53
130
|
className?: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* 容器宽度
|
|
134
|
+
*/
|
|
54
135
|
width?: number | string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 容器高度
|
|
139
|
+
*/
|
|
55
140
|
height?: number | string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 容器最小高度
|
|
144
|
+
*/
|
|
56
145
|
minHeight?: number | string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 进展拓展状态
|
|
149
|
+
*/
|
|
57
150
|
disabledDrag?: false;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* 图片地址
|
|
154
|
+
*/
|
|
58
155
|
imagePath: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* 目标框的对象
|
|
159
|
+
*/
|
|
59
160
|
rects?: RectType[];
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* 开启自定义框选
|
|
164
|
+
*/
|
|
60
165
|
isOpenSelect?: false;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* 禁止框选 后的菜单项
|
|
169
|
+
*/
|
|
61
170
|
disabledDrawMenu?: false;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 框选 后的菜单项
|
|
174
|
+
*/
|
|
62
175
|
menus?: MenuRectType[];
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* 图片下载
|
|
179
|
+
*/
|
|
63
180
|
imgDownload?: () => void;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* 点击框事件
|
|
184
|
+
*/
|
|
64
185
|
onClickRect?: (item: RectType) => void;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* 菜单点击事件
|
|
189
|
+
*/
|
|
65
190
|
onMenuClick?: (item: MenuRectType) => void;
|
|
66
191
|
children?: (option: any) => void;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* 显示工具栏
|
|
195
|
+
*/
|
|
67
196
|
hasTool?: boolean;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* 全屏的dom节点
|
|
200
|
+
*/
|
|
68
201
|
fullScreenEle?: Element;
|
|
69
202
|
}
|
package/es/Picture/utils.d.ts
CHANGED
|
@@ -13,9 +13,7 @@ export declare function computedRectScale({ imageSource, domImg, rects }: {
|
|
|
13
13
|
area?: number;
|
|
14
14
|
tags?: import("./interface").TagItemType[];
|
|
15
15
|
imgUrl?: string;
|
|
16
|
-
smId?: string;
|
|
17
16
|
isDefault?: boolean;
|
|
18
|
-
feature?: string;
|
|
19
17
|
dupId?: string;
|
|
20
18
|
lowQuality?: boolean;
|
|
21
19
|
base64?: string;
|
package/es/Player/player.d.ts
CHANGED
|
@@ -10,43 +10,153 @@ export type FlvPlayerConfig = {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export interface ISinglePlayerProps {
|
|
13
|
+
/**
|
|
14
|
+
* 视频播放地址
|
|
15
|
+
*/
|
|
13
16
|
url?: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 容器类名
|
|
20
|
+
*/
|
|
14
21
|
className?: string;
|
|
15
22
|
children?: React.ReactNode;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 同html video muted 静音
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
16
28
|
muted?: boolean;
|
|
17
|
-
|
|
29
|
+
/**
|
|
30
|
+
* 同html video autoplay 自动播放
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
18
33
|
autoPlay?: boolean;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 同html video playsinline 自动播放
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
19
39
|
playsInline?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
*同html video preload 预加载
|
|
42
|
+
*/
|
|
20
43
|
preload?: string;
|
|
44
|
+
/**
|
|
45
|
+
* 视频封面
|
|
46
|
+
*/
|
|
21
47
|
poster?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 同html video loop 循环
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
22
53
|
loop?: boolean;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 视频格式
|
|
57
|
+
* @default 'native'
|
|
58
|
+
*/
|
|
23
59
|
type?: 'flv' | 'hls' | 'native';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 隐藏工具栏
|
|
63
|
+
* @default false
|
|
64
|
+
*/
|
|
24
65
|
hideContrallerBar?: boolean;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 直播模式
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
25
71
|
isLive?: boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 工具栏右外侧拓展
|
|
75
|
+
*/
|
|
26
76
|
rightExtContents?: React.ReactNode;
|
|
77
|
+
/**
|
|
78
|
+
* 工具栏右内侧拓展
|
|
79
|
+
*/
|
|
27
80
|
rightMidExtContents?: React.ReactNode;
|
|
81
|
+
/**
|
|
82
|
+
* 工具栏左外侧拓展
|
|
83
|
+
*/
|
|
28
84
|
leftExtContents?: React.ReactNode;
|
|
85
|
+
/**
|
|
86
|
+
* 工具栏左内侧拓展
|
|
87
|
+
*/
|
|
29
88
|
leftMidExtContents?: React.ReactNode;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 自定义时间轴
|
|
92
|
+
*/
|
|
30
93
|
customTimeLine?: React.ReactNode;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 错误重试次数
|
|
97
|
+
* @default 5
|
|
98
|
+
*/
|
|
31
99
|
errorReloadTimer?: number;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 自定义flv参数配置
|
|
103
|
+
*/
|
|
32
104
|
flvConfig?: FlvPlayerConfig;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* 自定义hls参数配置
|
|
108
|
+
*/
|
|
33
109
|
hlsConfig?: HlsConfig;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 自定义reload函数
|
|
113
|
+
*/
|
|
34
114
|
reload?: () => void;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* 视频可播放时执行钩子
|
|
118
|
+
*/
|
|
35
119
|
onCanPlayerInit?: () => void;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 自定义video事件
|
|
123
|
+
*/
|
|
36
124
|
videoEvents?: CustomEvent[];
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* 自定义播放器的事件
|
|
128
|
+
*/
|
|
37
129
|
playerEvents?: CustomEvent[];
|
|
38
130
|
}
|
|
39
131
|
|
|
40
132
|
type OmitPlayerProps = 'customTimeLine' | 'onCanPlayerInit' | 'isLive' | 'reload' | 'type';
|
|
41
133
|
|
|
42
134
|
export interface IFrontendPlayerProps extends Omit<ISinglePlayerProps, OmitPlayerProps> {
|
|
135
|
+
/**
|
|
136
|
+
* 前端录像开始时间
|
|
137
|
+
*/
|
|
43
138
|
begin?: number;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* 前端录像结束时间
|
|
142
|
+
*/
|
|
44
143
|
end?: number;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 录像时间轴发生变化回调
|
|
147
|
+
*/
|
|
45
148
|
onSeek(time: number): void;
|
|
46
149
|
}
|
|
47
150
|
|
|
48
151
|
export interface ISegmentPlayerProps extends Omit<ISinglePlayerProps, 'url' | 'customTimeLine' | 'onCanPlayerInit'> {
|
|
152
|
+
/**
|
|
153
|
+
* 云录像片段信息
|
|
154
|
+
*/
|
|
49
155
|
segments?: ISegmentType[];
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* 云录像开始时间
|
|
159
|
+
*/
|
|
50
160
|
begin?: number;
|
|
51
161
|
}
|
|
52
162
|
|
|
@@ -83,8 +193,16 @@ export type ExportPlayerType = {
|
|
|
83
193
|
};
|
|
84
194
|
|
|
85
195
|
export interface ISegmentType {
|
|
196
|
+
/**
|
|
197
|
+
* 视频片段地址
|
|
198
|
+
*/
|
|
86
199
|
url?: string;
|
|
200
|
+
/**
|
|
201
|
+
* 视频片段长度 单位s(秒)
|
|
202
|
+
*/
|
|
87
203
|
duration: number;
|
|
88
204
|
}
|
|
89
205
|
|
|
206
|
+
export const ISegmentTypeDemo: React.FC<ISegmentType>;
|
|
207
|
+
|
|
90
208
|
export type CustomEvent = [string, () => void];
|
package/es/utils.d.ts
CHANGED
|
@@ -21,4 +21,5 @@ export declare function getTargetElement<T extends TargetType>(target: BasicTarg
|
|
|
21
21
|
declare const getScrollTop: (el: Document | Element) => number;
|
|
22
22
|
declare const getScrollHeight: (el: Document | Element) => number;
|
|
23
23
|
declare const getClientHeight: (el: Document | Element) => number;
|
|
24
|
-
|
|
24
|
+
declare const getEleScrollHeight: (el: Document | Element) => number;
|
|
25
|
+
export { getScrollTop, getScrollHeight, getClientHeight, getEleScrollHeight };
|
package/es/utils.js
CHANGED
|
@@ -123,4 +123,20 @@ var getClientHeight = function getClientHeight(el) {
|
|
|
123
123
|
return el.clientHeight || Math.max(document.documentElement.clientHeight, document.body.clientHeight);
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
var getEleScrollHeight = function getEleScrollHeight(el) {
|
|
127
|
+
if (el === document || el === document.body) {
|
|
128
|
+
return Math.max(window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
var top = 0;
|
|
132
|
+
var dom = el;
|
|
133
|
+
|
|
134
|
+
while (dom) {
|
|
135
|
+
top += dom.scrollTop;
|
|
136
|
+
dom = dom.parentElement;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return top;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export { getScrollTop, getScrollHeight, getClientHeight, getEleScrollHeight };
|