@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.
Files changed (166) hide show
  1. package/.umirc.ts +4 -3
  2. package/es/Api/index.js +1 -1
  3. package/es/AppContext/Sync.d.ts +1 -0
  4. package/es/AppContext/interface.d.ts +4 -1
  5. package/es/CheckGroupFixed/index.d.ts +1 -0
  6. package/es/DeviceSelect/TreeType.d.ts +1 -0
  7. package/es/DeviceSelect/demo.d.ts +1 -0
  8. package/es/DeviceSelect/index.d.ts +1 -0
  9. package/es/DeviceSelect/index.js +1 -1
  10. package/es/Drag/DragAndDropItem.js +2 -2
  11. package/es/Drag/DropItem.js +2 -2
  12. package/es/Drawer/Demo.js +24 -3
  13. package/es/Drawer/Footer.d.ts +1 -0
  14. package/es/Drawer/index.d.ts +29 -3
  15. package/es/Drawer/index.js +155 -4
  16. package/es/FrontendPlayer/index.d.ts +2 -0
  17. package/es/FrontendPlayer/index.js +2 -0
  18. package/es/FullScreen/index.d.ts +2 -3
  19. package/es/FullScreen/index.js +14 -41
  20. package/es/InitialConfig/utils.d.ts +5 -5
  21. package/es/InitialConfig/utils.js +19 -19
  22. package/es/Input/index.d.ts +1 -0
  23. package/es/List/CheckExt.d.ts +1 -0
  24. package/es/List/DeviceList/index.js +1 -1
  25. package/es/List/DynamicDeviceList/Demo.d.ts +1 -0
  26. package/es/List/DynamicDeviceList/index.d.ts +1 -0
  27. package/es/List/GridList/index.js +0 -1
  28. package/es/List/VList/index.d.ts +1 -0
  29. package/es/List/index.d.ts +1 -0
  30. package/es/LoaderApp/index.js +26 -22
  31. package/es/LoaderApp/loader.js +2 -6
  32. package/es/LoaderApp/utils.d.ts +1 -0
  33. package/es/LoaderApp/utils.js +37 -0
  34. package/es/Modal/index.d.ts +27 -0
  35. package/es/Modal/index.js +155 -1
  36. package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -0
  37. package/es/Picture/component/DefaultRects/index.d.ts +2 -1
  38. package/es/Picture/component/DrawRect/index.d.ts +3 -4
  39. package/es/Picture/component/MoveContent/index.js +16 -12
  40. package/es/Picture/component/RectMenu/index.d.ts +2 -3
  41. package/es/Picture/component/Tools/index.js +0 -5
  42. package/es/Picture/component/WheelScale/index.d.ts +1 -0
  43. package/es/Picture/component/WheelScale/index.js +3 -3
  44. package/es/Picture/index.d.ts +1 -0
  45. package/es/Picture/index.js +4 -2
  46. package/es/Picture/interface.d.ts +4 -2
  47. package/es/Picture/utils.d.ts +1 -0
  48. package/es/Player/api/index.d.ts +71 -0
  49. package/es/Player/api/index.js +284 -0
  50. package/es/Player/contraller_bar/bar.d.ts +8 -0
  51. package/es/Player/contraller_bar/bar.js +21 -0
  52. package/es/Player/contraller_bar/contraller_event.d.ts +9 -0
  53. package/es/{RefModal/index.js → Player/contraller_bar/contraller_event.js} +39 -54
  54. package/es/Player/contraller_bar/index.d.ts +19 -0
  55. package/es/Player/contraller_bar/index.js +37 -0
  56. package/es/Player/contraller_bar/left_bar.d.ts +15 -0
  57. package/es/Player/contraller_bar/left_bar.js +91 -0
  58. package/es/Player/contraller_bar/right_bar.d.ts +13 -0
  59. package/es/Player/contraller_bar/right_bar.js +55 -0
  60. package/es/Player/contraller_bar/useBarStatus.d.ts +3 -0
  61. package/es/{RefDrawer/index.js → Player/contraller_bar/useBarStatus.js} +27 -46
  62. package/es/Player/demo.d.ts +2 -0
  63. package/es/Player/demo.js +269 -0
  64. package/es/Player/event/browserTabEvent.d.ts +9 -0
  65. package/es/Player/event/browserTabEvent.js +57 -0
  66. package/es/Player/event/errorEvent.d.ts +16 -0
  67. package/es/Player/event/errorEvent.js +120 -0
  68. package/es/Player/event/eventName.d.ts +3 -0
  69. package/es/Player/event/eventName.js +15 -0
  70. package/es/Player/event/index.d.ts +22 -0
  71. package/es/Player/event/index.js +175 -0
  72. package/es/Player/frontend_player.d.ts +15 -0
  73. package/es/Player/frontend_player.js +90 -0
  74. package/es/Player/frontend_timeline.d.ts +14 -0
  75. package/es/Player/frontend_timeline.js +138 -0
  76. package/es/Player/iconfont.d.ts +13 -0
  77. package/es/Player/iconfont.js +18 -0
  78. package/es/Player/index.d.ts +8 -0
  79. package/es/Player/index.js +8 -0
  80. package/es/Player/live_heart.d.ts +6 -0
  81. package/es/Player/live_heart.js +29 -0
  82. package/es/Player/message.d.ts +11 -0
  83. package/es/Player/message.js +150 -0
  84. package/es/Player/player.d.ts +75 -0
  85. package/es/Player/segment_player.d.ts +13 -0
  86. package/es/Player/segment_player.js +191 -0
  87. package/es/Player/segment_timeline.d.ts +16 -0
  88. package/es/Player/segment_timeline.js +154 -0
  89. package/es/Player/single_player.d.ts +5 -0
  90. package/es/Player/single_player.js +185 -0
  91. package/es/Player/style/bar.css +37 -0
  92. package/es/Player/style/iconfont.css +62 -0
  93. package/es/Player/style/index.css +22 -0
  94. package/es/Player/style/message.css +49 -0
  95. package/es/Player/style/slider.css +96 -0
  96. package/es/Player/style/timeline.css +92 -0
  97. package/es/Player/timeline.d.ts +11 -0
  98. package/es/Player/timeline.js +104 -0
  99. package/es/Player/util.d.ts +48 -0
  100. package/es/Player/util.js +172 -0
  101. package/es/Progress/index.d.ts +1 -0
  102. package/es/SegmentPlayer/index.d.ts +2 -0
  103. package/es/SegmentPlayer/index.js +2 -0
  104. package/es/Service/fetch-adapter.d.ts +12 -0
  105. package/es/Service/fetch-adapter.js +184 -0
  106. package/es/Service/http.d.ts +1 -1
  107. package/es/Service/http.js +4 -2
  108. package/es/Service/interface.d.ts +2 -1
  109. package/es/Tree/BaseTree/demo.d.ts +1 -0
  110. package/es/Tree/BaseTree/demo.js +3 -1
  111. package/es/Tree/BaseTree/index.d.ts +2 -2
  112. package/es/Tree/demo.d.ts +1 -0
  113. package/es/Tree/index.js +1 -1
  114. package/es/UserSelect/demo.d.ts +1 -0
  115. package/es/WorkerFlow/Form/Approver.d.ts +1 -0
  116. package/es/WorkerFlow/Form/Condition.d.ts +1 -0
  117. package/es/WorkerFlow/Form/Condition.js +2 -1
  118. package/es/WorkerFlow/Form/EmptyUserSet.d.ts +1 -0
  119. package/es/WorkerFlow/Form/EmptyUserSet.js +2 -1
  120. package/es/WorkerFlow/Form/FormAuth.d.ts +1 -0
  121. package/es/WorkerFlow/Form/GroupList.d.ts +1 -0
  122. package/es/WorkerFlow/Form/GroupSelect.d.ts +1 -0
  123. package/es/WorkerFlow/Form/GroupSelect.js +2 -1
  124. package/es/WorkerFlow/Form/Handle.d.ts +1 -0
  125. package/es/WorkerFlow/Form/LevelGroupSelect.d.ts +1 -0
  126. package/es/WorkerFlow/Form/LevelGroupSelect.js +2 -1
  127. package/es/WorkerFlow/Form/Notifier.d.ts +1 -0
  128. package/es/WorkerFlow/Form/UserAndGroupSelect.d.ts +1 -0
  129. package/es/WorkerFlow/Form/UserAndGroupSelect.js +2 -1
  130. package/es/WorkerFlow/Form/UserSelect.d.ts +1 -0
  131. package/es/WorkerFlow/Form/UserSelect.js +2 -1
  132. package/es/WorkerFlow/Form/UserSet.d.ts +1 -0
  133. package/es/WorkerFlow/Form/UsersHandleType.d.ts +1 -0
  134. package/es/WorkerFlow/Nodes/Add.d.ts +1 -0
  135. package/es/WorkerFlow/Nodes/Add.js +1 -1
  136. package/es/WorkerFlow/Nodes/AddOption.d.ts +1 -0
  137. package/es/WorkerFlow/Nodes/AddOptionList.d.ts +1 -0
  138. package/es/WorkerFlow/Nodes/Approver.d.ts +1 -0
  139. package/es/WorkerFlow/Nodes/Condition.d.ts +1 -0
  140. package/es/WorkerFlow/Nodes/End.d.ts +1 -0
  141. package/es/WorkerFlow/Nodes/Handle.d.ts +1 -0
  142. package/es/WorkerFlow/Nodes/Node.d.ts +1 -0
  143. package/es/WorkerFlow/Nodes/Notifier.d.ts +1 -0
  144. package/es/WorkerFlow/Nodes/Render.d.ts +1 -0
  145. package/es/WorkerFlow/Nodes/Start.d.ts +1 -0
  146. package/es/WorkerFlow/Nodes/TitleElement.d.ts +1 -0
  147. package/es/WorkerFlow/Nodes/TitleElement.js +6 -2
  148. package/es/WorkerFlow/index.js +2 -1
  149. package/es/index.d.ts +5 -8
  150. package/es/index.js +6 -9
  151. package/es/typings.d.ts +1 -0
  152. package/package.json +15 -10
  153. package/tsconfig.json +3 -2
  154. package/typings/global.d.ts +4 -0
  155. package/es/AppRedirect/index.css +0 -0
  156. package/es/AppRedirect/index.d.ts +0 -16
  157. package/es/AppRedirect/index.js +0 -33
  158. package/es/AppRouter/index.d.ts +0 -8
  159. package/es/AppRouter/index.js +0 -17
  160. package/es/RefDrawer/index.d.ts +0 -15
  161. package/es/RefModal/index.d.ts +0 -15
  162. package/es/useDrawer/index.d.ts +0 -14
  163. package/es/useDrawer/index.js +0 -91
  164. package/es/useModal/index.d.ts +0 -14
  165. package/es/useModal/index.js +0 -93
  166. 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
+ }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface IProgressComponentProps {
3
4
  status: 'over' | 'error' | 'loading';
@@ -0,0 +1,2 @@
1
+ import SegmentPlayer from '../Player/segment_player';
2
+ export default SegmentPlayer;
@@ -0,0 +1,2 @@
1
+ import SegmentPlayer from '../Player/segment_player';
2
+ export default SegmentPlayer;
@@ -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
+ }
@@ -1,4 +1,4 @@
1
- import { AxiosInstance } from 'fetch-like-axios';
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;
@@ -1,11 +1,13 @@
1
1
  import { __rest } from "tslib";
2
- import Axios from 'fetch-like-axios';
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 'fetch-like-axios';
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
+
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare function App(): JSX.Element;
2
3
  export default App;
@@ -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
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare function App(): JSX.Element;
2
3
  export default App;
package/es/Tree/index.js CHANGED
@@ -85,7 +85,7 @@ function TreeMode(_a) {
85
85
  focusKey: Date.now()
86
86
  });
87
87
  });
88
- return null;
88
+ return;
89
89
  }
90
90
 
91
91
  switch (mode) {
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare function App(): JSX.Element;
2
3
  export default App;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem, WorkerFlowFormType } from '../interface';
2
3
  interface IApproverFormProps {
3
4
  form: WorkerFlowFormType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ConditionItemType, NodeItem, WorkerFlowFormType } from '../interface';
2
3
  interface IConditionFormProps {
3
4
  form: WorkerFlowFormType[];
@@ -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 RefModal from '../../RefModal';
21
+ import Modal from '../../Modal';
22
+ var RefModal = Modal.RefModal;
22
23
 
23
24
  function ConditionForm(_ref) {
24
25
  var form = _ref.form,
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface IUserSelectProps {
3
4
  userList: NodeUserType[];
@@ -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;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { WorkerFlowFormType } from '../interface';
2
3
  interface IFormAuthProps {
3
4
  form: WorkerFlowFormType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface IGroupListProps {
3
4
  list: [string, NodeUserType[]][];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface IUserSelectProps {
3
4
  userList: NodeUserType[];
@@ -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 RefModal from '../../RefModal';
27
+ import Modal from '../../Modal';
28
+ var RefModal = Modal.RefModal;
28
29
 
29
30
  function GroupSelect(_ref) {
30
31
  var _this = this;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem, WorkerFlowFormType } from '../interface';
2
3
  interface IHandleFormProps {
3
4
  form: WorkerFlowFormType[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface ILevelGroupSelectProps {
3
4
  userList: NodeUserType[];
@@ -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
  });
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeItem } from '../interface';
2
3
  interface INotifierFormProps {
3
4
  item?: NodeItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface IUserSelectProps {
3
4
  userList: NodeUserType[];
@@ -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;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { NodeUserType } from '../interface';
2
3
  interface IUserSelectProps {
3
4
  userList: NodeUserType[];
@@ -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;