@cloud-app-dev/vidc 2.1.0-alpha.8 → 2.2.0-alpha.2
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/.umirc.ts +4 -3
- package/es/Api/index.js +1 -1
- package/es/AppContext/Sync.d.ts +1 -0
- package/es/AppContext/interface.d.ts +4 -1
- package/es/CheckGroupFixed/index.d.ts +1 -0
- package/es/DeviceSelect/TreeType.d.ts +1 -0
- package/es/DeviceSelect/demo.d.ts +1 -0
- package/es/DeviceSelect/index.d.ts +1 -0
- package/es/DeviceSelect/index.js +1 -1
- package/es/Drag/DragAndDropItem.js +2 -2
- package/es/Drag/DropItem.js +2 -2
- package/es/Drawer/Demo.js +24 -3
- package/es/Drawer/Footer.d.ts +1 -0
- package/es/Drawer/index.d.ts +29 -3
- package/es/Drawer/index.js +155 -4
- package/es/FrontendPlayer/index.d.ts +2 -0
- package/es/FrontendPlayer/index.js +2 -0
- package/es/FullScreen/index.d.ts +2 -3
- package/es/FullScreen/index.js +14 -41
- package/es/InitialConfig/utils.d.ts +5 -5
- package/es/InitialConfig/utils.js +19 -19
- package/es/Input/index.d.ts +1 -0
- package/es/List/CheckExt.d.ts +1 -0
- package/es/List/DeviceList/index.js +1 -1
- package/es/List/DynamicDeviceList/Demo.d.ts +1 -0
- package/es/List/DynamicDeviceList/index.d.ts +1 -0
- package/es/List/GridList/index.js +0 -1
- package/es/List/VList/index.d.ts +1 -0
- package/es/List/index.d.ts +1 -0
- package/es/LoaderApp/index.js +26 -22
- package/es/LoaderApp/loader.js +2 -6
- package/es/LoaderApp/utils.d.ts +1 -0
- package/es/LoaderApp/utils.js +37 -0
- package/es/Modal/index.d.ts +27 -0
- package/es/Modal/index.js +155 -1
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -0
- package/es/Picture/component/DefaultRects/index.d.ts +2 -1
- package/es/Picture/component/DrawRect/index.d.ts +3 -4
- package/es/Picture/component/MoveContent/index.js +16 -12
- package/es/Picture/component/RectMenu/index.d.ts +2 -3
- package/es/Picture/component/Tools/index.js +0 -5
- package/es/Picture/component/WheelScale/index.d.ts +1 -0
- package/es/Picture/component/WheelScale/index.js +3 -3
- package/es/Picture/index.d.ts +1 -0
- package/es/Picture/index.js +4 -2
- package/es/Picture/interface.d.ts +4 -2
- package/es/Picture/utils.d.ts +1 -0
- package/es/Player/api/index.d.ts +71 -0
- package/es/Player/api/index.js +284 -0
- package/es/Player/contraller_bar/bar.d.ts +8 -0
- package/es/Player/contraller_bar/bar.js +21 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +9 -0
- package/es/{RefModal/index.js → Player/contraller_bar/contraller_event.js} +39 -54
- package/es/Player/contraller_bar/index.d.ts +19 -0
- package/es/Player/contraller_bar/index.js +37 -0
- package/es/Player/contraller_bar/left_bar.d.ts +15 -0
- package/es/Player/contraller_bar/left_bar.js +91 -0
- package/es/Player/contraller_bar/right_bar.d.ts +13 -0
- package/es/Player/contraller_bar/right_bar.js +55 -0
- package/es/Player/contraller_bar/useBarStatus.d.ts +3 -0
- package/es/{RefDrawer/index.js → Player/contraller_bar/useBarStatus.js} +27 -46
- package/es/Player/demo.d.ts +2 -0
- package/es/Player/demo.js +269 -0
- package/es/Player/event/browserTabEvent.d.ts +9 -0
- package/es/Player/event/browserTabEvent.js +57 -0
- package/es/Player/event/errorEvent.d.ts +16 -0
- package/es/Player/event/errorEvent.js +120 -0
- package/es/Player/event/eventName.d.ts +3 -0
- package/es/Player/event/eventName.js +15 -0
- package/es/Player/event/index.d.ts +22 -0
- package/es/Player/event/index.js +175 -0
- package/es/Player/frontend_player.d.ts +15 -0
- package/es/Player/frontend_player.js +90 -0
- package/es/Player/frontend_timeline.d.ts +14 -0
- package/es/Player/frontend_timeline.js +138 -0
- package/es/Player/iconfont.d.ts +13 -0
- package/es/Player/iconfont.js +18 -0
- package/es/Player/index.d.ts +8 -0
- package/es/Player/index.js +8 -0
- package/es/Player/live_heart.d.ts +6 -0
- package/es/Player/live_heart.js +29 -0
- package/es/Player/message.d.ts +11 -0
- package/es/Player/message.js +150 -0
- package/es/Player/player.d.ts +75 -0
- package/es/Player/segment_player.d.ts +13 -0
- package/es/Player/segment_player.js +191 -0
- package/es/Player/segment_timeline.d.ts +16 -0
- package/es/Player/segment_timeline.js +154 -0
- package/es/Player/single_player.d.ts +5 -0
- package/es/Player/single_player.js +185 -0
- package/es/Player/style/bar.css +37 -0
- package/es/Player/style/iconfont.css +62 -0
- package/es/Player/style/index.css +22 -0
- package/es/Player/style/message.css +49 -0
- package/es/Player/style/slider.css +96 -0
- package/es/Player/style/timeline.css +92 -0
- package/es/Player/timeline.d.ts +11 -0
- package/es/Player/timeline.js +104 -0
- package/es/Player/util.d.ts +48 -0
- package/es/Player/util.js +172 -0
- package/es/Progress/index.d.ts +1 -0
- package/es/SegmentPlayer/index.d.ts +2 -0
- package/es/SegmentPlayer/index.js +2 -0
- package/es/Service/fetch-adapter.d.ts +12 -0
- package/es/Service/fetch-adapter.js +184 -0
- package/es/Service/http.d.ts +1 -1
- package/es/Service/http.js +4 -2
- package/es/Service/interface.d.ts +2 -1
- package/es/Tree/BaseTree/demo.d.ts +1 -0
- package/es/Tree/BaseTree/demo.js +3 -1
- package/es/Tree/BaseTree/index.d.ts +2 -2
- package/es/Tree/demo.d.ts +1 -0
- package/es/Tree/index.js +1 -1
- package/es/UserSelect/demo.d.ts +1 -0
- package/es/WorkerFlow/Form/Approver.d.ts +1 -0
- package/es/WorkerFlow/Form/Condition.d.ts +1 -0
- package/es/WorkerFlow/Form/Condition.js +2 -1
- package/es/WorkerFlow/Form/EmptyUserSet.d.ts +1 -0
- package/es/WorkerFlow/Form/EmptyUserSet.js +2 -1
- package/es/WorkerFlow/Form/FormAuth.d.ts +1 -0
- package/es/WorkerFlow/Form/GroupList.d.ts +1 -0
- package/es/WorkerFlow/Form/GroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/GroupSelect.js +2 -1
- package/es/WorkerFlow/Form/Handle.d.ts +1 -0
- package/es/WorkerFlow/Form/LevelGroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/LevelGroupSelect.js +2 -1
- package/es/WorkerFlow/Form/Notifier.d.ts +1 -0
- package/es/WorkerFlow/Form/UserAndGroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +2 -1
- package/es/WorkerFlow/Form/UserSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/UserSelect.js +2 -1
- package/es/WorkerFlow/Form/UserSet.d.ts +1 -0
- package/es/WorkerFlow/Form/UsersHandleType.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Add.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Add.js +1 -1
- package/es/WorkerFlow/Nodes/AddOption.d.ts +1 -0
- package/es/WorkerFlow/Nodes/AddOptionList.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Approver.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Condition.d.ts +1 -0
- package/es/WorkerFlow/Nodes/End.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Handle.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Node.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Notifier.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Render.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Start.d.ts +1 -0
- package/es/WorkerFlow/Nodes/TitleElement.d.ts +1 -0
- package/es/WorkerFlow/Nodes/TitleElement.js +6 -2
- package/es/WorkerFlow/index.js +2 -1
- package/es/index.d.ts +5 -8
- package/es/index.js +6 -9
- package/es/typings.d.ts +1 -0
- package/package.json +15 -10
- package/tsconfig.json +3 -2
- package/typings/global.d.ts +4 -0
- package/es/AppRedirect/index.css +0 -0
- package/es/AppRedirect/index.d.ts +0 -16
- package/es/AppRedirect/index.js +0 -33
- package/es/AppRouter/index.d.ts +0 -8
- package/es/AppRouter/index.js +0 -17
- package/es/RefDrawer/index.d.ts +0 -15
- package/es/RefModal/index.d.ts +0 -15
- package/es/useDrawer/index.d.ts +0 -14
- package/es/useDrawer/index.js +0 -91
- package/es/useModal/index.d.ts +0 -14
- package/es/useModal/index.js +0 -93
- package/typings.d.ts +0 -2
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import Flvjs from 'flv.zv.js';
|
|
2
|
+
import Hls, { HlsConfig } from 'hls.js';
|
|
3
|
+
import type { FlvPlayerConfig } from './player';
|
|
4
|
+
/**
|
|
5
|
+
* 创建HLS对象
|
|
6
|
+
* @param {*} video
|
|
7
|
+
* @param {*} URL
|
|
8
|
+
*/
|
|
9
|
+
export declare function createHlsPlayer(video: HTMLVideoElement, url: string, hlsConfig: HlsConfig): Hls;
|
|
10
|
+
/**
|
|
11
|
+
* 创建FLV对象
|
|
12
|
+
* @param {*} video
|
|
13
|
+
* @param {*} options
|
|
14
|
+
*/
|
|
15
|
+
export declare function createFlvPlayer(video: HTMLVideoElement, url: string, isLive?: boolean, flvConfig?: FlvPlayerConfig): Flvjs.Player;
|
|
16
|
+
export declare const playReload: (video: HTMLVideoElement, flv?: Flvjs.Player, hls?: Hls, url?: string) => void;
|
|
17
|
+
export declare const playUnload: (video: HTMLVideoElement, flv?: Flvjs.Player, hls?: Hls) => void;
|
|
18
|
+
/**
|
|
19
|
+
* 获取播放文件类型
|
|
20
|
+
* @param {*} url
|
|
21
|
+
*/
|
|
22
|
+
export declare function getVideoType(url: string): "flv" | "native" | "m3u8";
|
|
23
|
+
export declare function timeStamp(second: number): string;
|
|
24
|
+
/**
|
|
25
|
+
* 日期格式化
|
|
26
|
+
* @param {*} timetemp
|
|
27
|
+
*/
|
|
28
|
+
export declare function dateFormat(timetemp: number): string;
|
|
29
|
+
/**
|
|
30
|
+
* 全屏
|
|
31
|
+
* @param {*} element
|
|
32
|
+
*/
|
|
33
|
+
export declare function fullscreen(element: HTMLElement): void;
|
|
34
|
+
/**
|
|
35
|
+
* exitFullscreen 退出全屏
|
|
36
|
+
* @param {Objct} element 选择器
|
|
37
|
+
*/
|
|
38
|
+
export declare function exitFullscreen(): void;
|
|
39
|
+
/**
|
|
40
|
+
* 判读是否支持全屏
|
|
41
|
+
*/
|
|
42
|
+
export declare function fullscreenEnabled(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* [isFullscreen 判断浏览器是否全屏]
|
|
45
|
+
* @return [全屏则返回当前调用全屏的元素,不全屏返回false]
|
|
46
|
+
*/
|
|
47
|
+
export declare function isFullscreen(ele: HTMLElement): boolean;
|
|
48
|
+
export declare function getRandom(): string;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import Flvjs from 'flv.zv.js';
|
|
2
|
+
import Hls from 'hls.js';
|
|
3
|
+
/**
|
|
4
|
+
* 创建HLS对象
|
|
5
|
+
* @param {*} video
|
|
6
|
+
* @param {*} URL
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export function createHlsPlayer(video, url, hlsConfig) {
|
|
10
|
+
if (!Hls.isSupported()) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
var player = new Hls(Object.assign({
|
|
15
|
+
liveDurationInfinity: true,
|
|
16
|
+
fragLoadingMaxRetry: 0,
|
|
17
|
+
manifestLoadingMaxRetry: 0,
|
|
18
|
+
levelLoadingMaxRetry: 0,
|
|
19
|
+
enableWorker: true
|
|
20
|
+
}, hlsConfig));
|
|
21
|
+
player.loadSource(url);
|
|
22
|
+
player.attachMedia(video);
|
|
23
|
+
return player;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 创建FLV对象
|
|
27
|
+
* @param {*} video
|
|
28
|
+
* @param {*} options
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
export function createFlvPlayer(video, url, isLive, flvConfig) {
|
|
32
|
+
if (!Flvjs.isSupported()) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var mediaDataSource = Object.assign({
|
|
37
|
+
type: 'flv',
|
|
38
|
+
url: url
|
|
39
|
+
}, flvConfig.mediaDataSource);
|
|
40
|
+
var config = Object.assign({
|
|
41
|
+
enableWorker: true,
|
|
42
|
+
// lazyLoad: false,
|
|
43
|
+
// Indicates how many seconds of data to be kept for lazyLoad.
|
|
44
|
+
// lazyLoadMaxDuration: 0,
|
|
45
|
+
// autoCleanupMaxBackwardDuration: 3,
|
|
46
|
+
// autoCleanupMinBackwardDuration: 2,
|
|
47
|
+
// autoCleanupSourceBuffer: true,
|
|
48
|
+
enableStashBuffer: false,
|
|
49
|
+
stashInitialSize: 128,
|
|
50
|
+
isLive: isLive !== null && isLive !== void 0 ? isLive : true
|
|
51
|
+
}, flvConfig.config);
|
|
52
|
+
var player = Flvjs.createPlayer(mediaDataSource, config);
|
|
53
|
+
player.attachMediaElement(video);
|
|
54
|
+
player.load();
|
|
55
|
+
return player;
|
|
56
|
+
}
|
|
57
|
+
export var playReload = function playReload(video, flv, hls, url) {
|
|
58
|
+
video.pause();
|
|
59
|
+
video.removeAttribute('src');
|
|
60
|
+
|
|
61
|
+
if (flv) {
|
|
62
|
+
flv.unload();
|
|
63
|
+
flv.load();
|
|
64
|
+
flv.play();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (hls) {
|
|
68
|
+
hls.swapAudioCodec();
|
|
69
|
+
hls.recoverMediaError();
|
|
70
|
+
hls.stopLoad();
|
|
71
|
+
hls.startLoad();
|
|
72
|
+
hls.loadSource(url);
|
|
73
|
+
video.play();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (!flv && !hls) {
|
|
77
|
+
video.setAttribute('src', url);
|
|
78
|
+
video.play();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
export var playUnload = function playUnload(video, flv, hls) {
|
|
82
|
+
video.pause();
|
|
83
|
+
|
|
84
|
+
if (flv) {
|
|
85
|
+
flv.unload();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (hls) {
|
|
90
|
+
hls.stopLoad();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
video.removeAttribute('src');
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* 获取播放文件类型
|
|
98
|
+
* @param {*} url
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
export function getVideoType(url) {
|
|
102
|
+
if (!url) {
|
|
103
|
+
return 'native';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return url.indexOf('.flv') > -1 ? 'flv' : url.indexOf('.m3u8') > -1 ? 'm3u8' : 'native';
|
|
107
|
+
}
|
|
108
|
+
export function timeStamp(second) {
|
|
109
|
+
// 转换为式分秒
|
|
110
|
+
var h = Math.round(second / 60 / 60 % 24);
|
|
111
|
+
var m = Math.round(second / 60 % 60);
|
|
112
|
+
var s = Math.round(second % 60);
|
|
113
|
+
|
|
114
|
+
if (h === 0) {
|
|
115
|
+
return "".concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return "".concat(h < 10 ? '0' + h : h, ":").concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 日期格式化
|
|
122
|
+
* @param {*} timetemp
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
export function dateFormat(timetemp) {
|
|
126
|
+
var date = new Date(timetemp);
|
|
127
|
+
var YYYY = date.getFullYear();
|
|
128
|
+
var DD = date.getDate();
|
|
129
|
+
var MM = date.getMonth() + 1;
|
|
130
|
+
var hh = date.getHours();
|
|
131
|
+
var mm = date.getMinutes();
|
|
132
|
+
var ss = date.getSeconds();
|
|
133
|
+
return "".concat(YYYY, ".").concat(MM > 9 ? MM : '0' + MM, ".").concat(DD > 9 ? DD : '0' + DD, " ").concat(hh > 9 ? hh : '0' + hh, ".").concat(mm > 9 ? mm : '0' + mm, ".").concat(ss > 9 ? ss : '0' + ss);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* 全屏
|
|
137
|
+
* @param {*} element
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
export function fullscreen(element) {
|
|
141
|
+
element.requestFullscreen();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* exitFullscreen 退出全屏
|
|
145
|
+
* @param {Objct} element 选择器
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
export function exitFullscreen() {
|
|
149
|
+
document.exitFullscreen();
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* 判读是否支持全屏
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
export function fullscreenEnabled() {
|
|
156
|
+
return document.fullscreenEnabled;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* [isFullscreen 判断浏览器是否全屏]
|
|
160
|
+
* @return [全屏则返回当前调用全屏的元素,不全屏返回false]
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
export function isFullscreen(ele) {
|
|
164
|
+
if (!ele) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return document.fullscreenElement === ele;
|
|
169
|
+
}
|
|
170
|
+
export function getRandom() {
|
|
171
|
+
return Math.random().toString(36).substr(2);
|
|
172
|
+
}
|
package/es/Progress/index.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="typings/global" />
|
|
2
|
+
import { AxiosRequestConfig, AxiosPromise } from 'axios';
|
|
3
|
+
export interface AxiosFetchRequestConfig extends AxiosRequestConfig<BodyInit> {
|
|
4
|
+
mode?: RequestMode;
|
|
5
|
+
body?: BodyInit;
|
|
6
|
+
cache?: RequestCache;
|
|
7
|
+
integrity?: string;
|
|
8
|
+
redirect?: RequestRedirect;
|
|
9
|
+
referrer?: string;
|
|
10
|
+
credentials?: RequestCredentials;
|
|
11
|
+
}
|
|
12
|
+
export default function fetchAdapter(config: AxiosFetchRequestConfig): AxiosPromise;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/// <reference path="../../typings/global.d.ts"/>
|
|
2
|
+
import { __awaiter } from "tslib";
|
|
3
|
+
import { AxiosError } from 'axios';
|
|
4
|
+
import settle from 'axios/lib/core/settle';
|
|
5
|
+
import buildURL from 'axios/lib/helpers/buildURL';
|
|
6
|
+
import buildFullPath from 'axios/lib/core/buildFullPath';
|
|
7
|
+
import CanceledError from 'axios/lib/cancel/CanceledError';
|
|
8
|
+
import { isUndefined } from 'lodash-es';
|
|
9
|
+
export default function fetchAdapter(config) {
|
|
10
|
+
return new Promise(function (resolve, reject) {
|
|
11
|
+
var controller = new AbortController();
|
|
12
|
+
var signal = controller.signal;
|
|
13
|
+
var request = createRequest(config, signal);
|
|
14
|
+
var promises = [getResponse(request, config)];
|
|
15
|
+
|
|
16
|
+
if (config.timeout && config.timeout > 0) {
|
|
17
|
+
promises.push(timeoutHandle(request, controller, config));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (config.cancelToken) {
|
|
21
|
+
// Handle cancellation
|
|
22
|
+
config.cancelToken.promise.then(function onCanceled(cancel) {
|
|
23
|
+
if (!request) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
reject(!cancel ? new CanceledError(null, config, request) : cancel);
|
|
28
|
+
controller.abort();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return Promise.race(promises).then(function (data) {
|
|
33
|
+
return settle(resolve, reject, data);
|
|
34
|
+
}).catch(reject);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function timeoutHandle(request, controller, config) {
|
|
39
|
+
return new Promise(function (resolve) {
|
|
40
|
+
setTimeout(function () {
|
|
41
|
+
var message = config.timeoutErrorMessage ? config.timeoutErrorMessage : 'timeout of ' + config.timeout + 'ms exceeded';
|
|
42
|
+
resolve(createError(message, config, 'ECONNABORTED', request));
|
|
43
|
+
controller.abort();
|
|
44
|
+
}, config.timeout);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getResponse(request, config) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
50
|
+
var stageOne, response;
|
|
51
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
52
|
+
while (1) {
|
|
53
|
+
switch (_context.prev = _context.next) {
|
|
54
|
+
case 0:
|
|
55
|
+
_context.prev = 0;
|
|
56
|
+
_context.next = 3;
|
|
57
|
+
return fetch(request);
|
|
58
|
+
|
|
59
|
+
case 3:
|
|
60
|
+
stageOne = _context.sent;
|
|
61
|
+
_context.next = 9;
|
|
62
|
+
break;
|
|
63
|
+
|
|
64
|
+
case 6:
|
|
65
|
+
_context.prev = 6;
|
|
66
|
+
_context.t0 = _context["catch"](0);
|
|
67
|
+
return _context.abrupt("return", createError('Network Error', config, 'ERR_NETWORK', request));
|
|
68
|
+
|
|
69
|
+
case 9:
|
|
70
|
+
response = {
|
|
71
|
+
ok: stageOne.ok,
|
|
72
|
+
status: stageOne.status,
|
|
73
|
+
statusText: stageOne.statusText,
|
|
74
|
+
headers: new Headers(stageOne.headers),
|
|
75
|
+
config: config,
|
|
76
|
+
request: request
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
if (!(stageOne.status >= 200 && stageOne.status !== 204)) {
|
|
80
|
+
_context.next = 30;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
_context.t1 = config.responseType;
|
|
85
|
+
_context.next = _context.t1 === 'arraybuffer' ? 14 : _context.t1 === 'blob' ? 18 : _context.t1 === 'json' ? 22 : 26;
|
|
86
|
+
break;
|
|
87
|
+
|
|
88
|
+
case 14:
|
|
89
|
+
_context.next = 16;
|
|
90
|
+
return stageOne.arrayBuffer();
|
|
91
|
+
|
|
92
|
+
case 16:
|
|
93
|
+
response.data = _context.sent;
|
|
94
|
+
return _context.abrupt("break", 30);
|
|
95
|
+
|
|
96
|
+
case 18:
|
|
97
|
+
_context.next = 20;
|
|
98
|
+
return stageOne.blob();
|
|
99
|
+
|
|
100
|
+
case 20:
|
|
101
|
+
response.data = _context.sent;
|
|
102
|
+
return _context.abrupt("break", 30);
|
|
103
|
+
|
|
104
|
+
case 22:
|
|
105
|
+
_context.next = 24;
|
|
106
|
+
return stageOne.json();
|
|
107
|
+
|
|
108
|
+
case 24:
|
|
109
|
+
response.data = _context.sent;
|
|
110
|
+
return _context.abrupt("break", 30);
|
|
111
|
+
|
|
112
|
+
case 26:
|
|
113
|
+
_context.next = 28;
|
|
114
|
+
return stageOne.text();
|
|
115
|
+
|
|
116
|
+
case 28:
|
|
117
|
+
response.data = _context.sent;
|
|
118
|
+
return _context.abrupt("break", 30);
|
|
119
|
+
|
|
120
|
+
case 30:
|
|
121
|
+
return _context.abrupt("return", response);
|
|
122
|
+
|
|
123
|
+
case 31:
|
|
124
|
+
case "end":
|
|
125
|
+
return _context.stop();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}, _callee, null, [[0, 6]]);
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function createRequest(config, signal) {
|
|
133
|
+
var headers = new Headers(config.headers);
|
|
134
|
+
|
|
135
|
+
if (config.auth) {
|
|
136
|
+
var username = config.auth.username || '';
|
|
137
|
+
var password = config.auth.password ? decodeURI(encodeURIComponent(config.auth.password)) : '';
|
|
138
|
+
headers.set('Authorization', "Basic ".concat(btoa(username + ':' + password)));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
var method = config.method.toUpperCase();
|
|
142
|
+
var options = {
|
|
143
|
+
headers: headers,
|
|
144
|
+
method: method,
|
|
145
|
+
signal: signal
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
if (method !== 'GET' && method !== 'HEAD') {
|
|
149
|
+
options.body = config.data;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (config.mode) {
|
|
153
|
+
options.mode = config.mode;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (config.cache) {
|
|
157
|
+
options.cache = config.cache;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (config.integrity) {
|
|
161
|
+
options.integrity = config.integrity;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (config.redirect) {
|
|
165
|
+
options.redirect = config.redirect;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (config.referrer) {
|
|
169
|
+
options.referrer = config.referrer;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (!isUndefined(config.withCredentials)) {
|
|
173
|
+
options.credentials = config.withCredentials ? 'include' : 'omit';
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
177
|
+
var url = buildURL(fullPath, config.params, config.paramsSerializer); // Expected browser to throw error if there is any wrong configuration value
|
|
178
|
+
|
|
179
|
+
return new Request(url, options);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function createError(message, config, code, request, response) {
|
|
183
|
+
return new AxiosError(message, AxiosError[code], config, request, response);
|
|
184
|
+
}
|
package/es/Service/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxiosInstance } from '
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
2
|
import type { RsponseType, XHRResponse } from './interface';
|
|
3
3
|
declare function http({ cancelHttp, ...newOptions }: RsponseType): Promise<any>;
|
|
4
4
|
declare const httpMultiPartInstance: AxiosInstance;
|
package/es/Service/http.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import Axios from '
|
|
2
|
+
import Axios from 'axios';
|
|
3
|
+
import fetchAdapter from './fetch-adapter';
|
|
3
4
|
import * as Middleware from './middleware';
|
|
4
5
|
var CancelToken = Axios.CancelToken;
|
|
5
6
|
var config = {
|
|
6
7
|
baseURL: '/',
|
|
7
8
|
timeout: 60 * 1000,
|
|
8
9
|
xhrMode: 'fetch',
|
|
10
|
+
adapter: fetchAdapter,
|
|
9
11
|
headers: {
|
|
10
12
|
Accept: 'application/json; charset=utf-8',
|
|
11
13
|
'Content-Type': 'application/json; charset=utf-8'
|
|
@@ -68,8 +70,8 @@ function http(_a) {
|
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
var httpMultiPartInstance = Axios.create({
|
|
71
|
-
xhrMode: 'fetch',
|
|
72
73
|
timeout: 10 * 60 * 1000,
|
|
74
|
+
adapter: fetchAdapter,
|
|
73
75
|
headers: {
|
|
74
76
|
'Content-Type': 'multipart/form-data'
|
|
75
77
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from '
|
|
1
|
+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
2
|
export type RsponseType = AxiosRequestConfig & { requestId?: string; cancelHttp?: (cancel: Function) => void; loggerIndex?: number };
|
|
3
3
|
|
|
4
4
|
export type XHRResponse = {
|
|
@@ -20,3 +20,4 @@ export type IServiceInterface = {
|
|
|
20
20
|
registerResponseMiddleware(fn: MiddleWareType): void;
|
|
21
21
|
registerResponseErrorMiddleware(fn: MiddleWareType): void;
|
|
22
22
|
};
|
|
23
|
+
|
package/es/Tree/BaseTree/demo.js
CHANGED
|
@@ -55,8 +55,10 @@ function App() {
|
|
|
55
55
|
height: 400
|
|
56
56
|
}
|
|
57
57
|
}, /*#__PURE__*/React.createElement(Tree, {
|
|
58
|
-
key: state.keyword,
|
|
59
58
|
treeData: treeData,
|
|
59
|
+
treeNodeProps: {
|
|
60
|
+
keyword: state.keyword
|
|
61
|
+
},
|
|
60
62
|
virtual: false,
|
|
61
63
|
icon: function icon(node) {
|
|
62
64
|
return /*#__PURE__*/React.createElement(IconFont, {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* tree 基础组件支持各种自定义其他tree可用过它来拓展
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { DataNode, TreeProps } from 'antd/lib/tree';
|
|
5
|
+
import type { DataNode, TreeProps } from 'antd/lib/tree';
|
|
6
6
|
import './index.less';
|
|
7
7
|
export interface ITreeNodeProps {
|
|
8
8
|
prefix?: (node: DataNode) => JSX.Element;
|
|
@@ -12,7 +12,7 @@ export interface ITreeNodeProps {
|
|
|
12
12
|
nameKey?: string;
|
|
13
13
|
RenderTreeTitle?: (node: DataNode) => JSX.Element;
|
|
14
14
|
}
|
|
15
|
-
export interface BaseTreeProps extends TreeProps {
|
|
15
|
+
export interface BaseTreeProps extends Omit<TreeProps, 'icon'> {
|
|
16
16
|
checkable?: boolean;
|
|
17
17
|
className?: string;
|
|
18
18
|
treeData?: DataNode[] | any[];
|
package/es/Tree/demo.d.ts
CHANGED
package/es/Tree/index.js
CHANGED
package/es/UserSelect/demo.d.ts
CHANGED
|
@@ -18,7 +18,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
18
18
|
import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
19
19
|
import Box from '../../Box';
|
|
20
20
|
import IconFont from '../../IconFont';
|
|
21
|
-
import
|
|
21
|
+
import Modal from '../../Modal';
|
|
22
|
+
var RefModal = Modal.RefModal;
|
|
22
23
|
|
|
23
24
|
function ConditionForm(_ref) {
|
|
24
25
|
var form = _ref.form,
|
|
@@ -22,8 +22,9 @@ import React, { useCallback, useMemo, useRef, useState, useEffect } from 'react'
|
|
|
22
22
|
import { replace } from 'lodash';
|
|
23
23
|
import chroma from 'chroma-js';
|
|
24
24
|
import UserSelectModalContent from './UserSelectModalContent';
|
|
25
|
-
import RefModal from '../../RefModal';
|
|
26
25
|
import IconFont from '../../IconFont';
|
|
26
|
+
import Modal from '../../Modal';
|
|
27
|
+
var RefModal = Modal.RefModal;
|
|
27
28
|
|
|
28
29
|
function EmptyUserSet(_ref) {
|
|
29
30
|
var _this = this;
|
|
@@ -24,7 +24,8 @@ import chroma from 'chroma-js';
|
|
|
24
24
|
import GroupSelectModalContent from './GroupSelectModalContent';
|
|
25
25
|
import IconFont from '../../IconFont';
|
|
26
26
|
import { formatRenderGroup } from './utils';
|
|
27
|
-
import
|
|
27
|
+
import Modal from '../../Modal';
|
|
28
|
+
var RefModal = Modal.RefModal;
|
|
28
29
|
|
|
29
30
|
function GroupSelect(_ref) {
|
|
30
31
|
var _this = this;
|
|
@@ -25,8 +25,9 @@ import { replace } from 'lodash';
|
|
|
25
25
|
import chroma from 'chroma-js';
|
|
26
26
|
import GroupSelectModalContent from './GroupSelectModalContent';
|
|
27
27
|
import { formatRenderGroup, ToUpperNumberString } from './utils';
|
|
28
|
-
import RefModal from '../../RefModal';
|
|
29
28
|
import IconFont from '../../IconFont';
|
|
29
|
+
import Modal from '../../Modal';
|
|
30
|
+
var RefModal = Modal.RefModal;
|
|
30
31
|
var levelDict = Array.from(new Array(30)).map(function (_, i) {
|
|
31
32
|
return i + 1;
|
|
32
33
|
});
|
|
@@ -25,9 +25,10 @@ import { replace } from 'lodash';
|
|
|
25
25
|
import chroma from 'chroma-js';
|
|
26
26
|
import UserSelectModalContent from './UserSelectModalContent';
|
|
27
27
|
import GroupSelectModalContent from './GroupSelectModalContent';
|
|
28
|
-
import RefModal from '../../RefModal';
|
|
29
28
|
import { formatRenderGroup } from './utils';
|
|
30
29
|
import IconFont from '../../IconFont';
|
|
30
|
+
import Modal from '../../Modal';
|
|
31
|
+
var RefModal = Modal.RefModal;
|
|
31
32
|
|
|
32
33
|
function UserAndGroupSelect(_ref) {
|
|
33
34
|
var _this = this;
|
|
@@ -22,8 +22,9 @@ import React, { useCallback, useMemo, useRef, useState, useEffect } from 'react'
|
|
|
22
22
|
import { replace } from 'lodash';
|
|
23
23
|
import chroma from 'chroma-js';
|
|
24
24
|
import UserSelectModalContent from './UserSelectModalContent';
|
|
25
|
-
import RefModal from '../../RefModal';
|
|
26
25
|
import IconFont from '../../IconFont';
|
|
26
|
+
import Modal from '../../Modal';
|
|
27
|
+
var RefModal = Modal.RefModal;
|
|
27
28
|
|
|
28
29
|
function UserSelect(_ref) {
|
|
29
30
|
var _this = this;
|