@cloud-app-dev/vidc 3.2.37 → 3.2.39
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/.dumirc.ts +7 -11
- package/.fatherrc.ts +0 -1
- package/es/CheckGroupFixed/demo.js +2 -3
- package/es/CheckGroupFixed/index.js +4 -7
- package/es/Config/index.js +10 -9
- package/es/Config/interface.d.ts +2 -3
- package/es/CustomRenderSelect/index.js +2 -3
- package/es/DynamicList/demo.js +3 -4
- package/es/DynamicList/index.js +2 -3
- package/es/ErrorFallback/index.js +3 -6
- package/es/FrontendPlayer/index.d.ts +4 -2
- package/es/List/index.d.ts +0 -13
- package/es/List/index.js +1 -19
- package/es/LoaderScript/utils.d.ts +0 -1
- package/es/LoaderScript/utils.js +1 -36
- package/es/Map/FindPio/index.js +2 -3
- package/es/Map/LevelCenter/demo.js +2 -4
- package/es/Map/ResetTools/index.js +4 -5
- package/es/Picture/component/Tools/index.d.ts +1 -2
- package/es/Picture/component/Tools/index.js +7 -14
- package/es/Picture/demo.js +14 -28
- package/es/Picture/index.d.ts +1 -1
- package/es/Picture/index.js +91 -141
- package/es/Picture/index.less +7 -2
- package/es/Picture/utils.d.ts +6 -0
- package/es/Picture/utils.js +57 -2
- package/es/Player/api/index.js +2 -1
- package/es/Player/contraller_bar/volume.js +3 -6
- package/es/Player/demo.js +28 -58
- package/es/Player/frontend_timeline.js +1 -1
- package/es/Player/segment_timeline.js +3 -5
- package/es/Player/single_player.js +1 -1
- package/es/Player/util.d.ts +0 -1
- package/es/Player/util.js +2 -40
- package/es/PlayerExt/demo.js +12 -20
- package/es/Progress/index.js +4 -6
- package/es/RefDrawer/Footer.d.ts +9 -0
- package/es/{Drawer → RefDrawer}/Footer.js +3 -5
- package/es/{Drawer/Demo.d.ts → RefDrawer/demo.d.ts} +0 -0
- package/es/RefDrawer/demo.js +35 -0
- package/es/RefDrawer/index.d.ts +26 -0
- package/es/{Input → RefDrawer}/index.js +54 -58
- package/es/{Input → RefModal}/demo.d.ts +0 -0
- package/es/RefModal/demo.js +35 -0
- package/es/RefModal/index.d.ts +17 -0
- package/es/RefModal/index.js +71 -0
- package/es/ScreenPlayer/PlayerWithExt.js +1 -1
- package/es/ScreenPlayer/RatePick.js +8 -9
- package/es/ScreenPlayer/ScreenSelect.js +2 -3
- package/es/ScreenPlayer/SegmentTimeLine.js +3 -11
- package/es/ScreenPlayer/TimeMode.js +3 -4
- package/es/ScreenPlayer/TimeSelect.js +14 -39
- package/es/ScreenPlayer/demo.js +2 -3
- package/es/ScreenPlayer/demo2.js +8 -28
- package/es/ScreenPlayer/useTimeSlider.js +1 -1
- package/es/Service/http.js +6 -8
- package/es/TableLayout/index.d.ts +0 -3
- package/es/TableLayout/index.js +8 -10
- package/es/ThemeAntd/demo.js +21 -40
- package/es/ThemeAntd/index.js +16 -2
- package/es/ThemeAntd/index.less +0 -12
- package/es/Timeout/index.js +2 -2
- package/es/core.d.ts +0 -149
- package/es/index.d.ts +2 -6
- package/es/index.js +2 -6
- package/es/useDrawROI/index.js +4 -4
- package/es/utils.d.ts +1 -12
- package/es/utils.js +0 -56
- package/package.json +24 -24
- package/theme-config.ts +3 -1
- package/typings/global.d.ts +4 -4
- package/es/Api/index.d.ts +0 -12
- package/es/Api/index.js +0 -267
- package/es/Box/BetweenBox/index.d.ts +0 -12
- package/es/Box/BetweenBox/index.js +0 -31
- package/es/Box/BetweenBox/index.less +0 -5
- package/es/Box/InfoBox/index.d.ts +0 -12
- package/es/Box/InfoBox/index.js +0 -30
- package/es/Box/InfoBox/index.less +0 -24
- package/es/Box/TwoColumnBox/index.d.ts +0 -10
- package/es/Box/TwoColumnBox/index.js +0 -54
- package/es/Box/TwoColumnBox/index.less +0 -80
- package/es/Box/deps/content-grid.d.ts +0 -9
- package/es/Box/deps/content-grid.js +0 -9
- package/es/Box/deps/grid-factory.d.ts +0 -10
- package/es/Box/deps/grid-factory.js +0 -72
- package/es/Box/deps/simple-grid.d.ts +0 -9
- package/es/Box/deps/simple-grid.js +0 -8
- package/es/Box/index.d.ts +0 -14
- package/es/Box/index.js +0 -39
- package/es/Box/index.less +0 -10
- package/es/Drawer/Demo.js +0 -109
- package/es/Drawer/Footer.d.ts +0 -5
- package/es/Drawer/index.d.ts +0 -38
- package/es/Drawer/index.js +0 -207
- package/es/Drawer/index.less +0 -42
- package/es/Drawer/interface.d.ts +0 -22
- package/es/Input/demo.js +0 -16
- package/es/Input/index.d.ts +0 -19
- package/es/Input/index.less +0 -12
- package/es/Modal/demo.d.ts +0 -3
- package/es/Modal/demo.js +0 -106
- package/es/Modal/index.d.ts +0 -44
- package/es/Modal/index.js +0 -197
- package/es/Modal/index.less +0 -44
- package/es/Modal/interface.d.ts +0 -23
- package/es/Picture/dragBound.d.ts +0 -5
- package/es/Picture/dragBound.js +0 -77
- package/es/Service/fetch-adapter.d.ts +0 -12
- package/es/Service/fetch-adapter.js +0 -203
- package/es/ThemeAntd/style/button.less +0 -67
- package/es/ThemeAntd/style/checkbox.less +0 -72
- package/es/ThemeAntd/style/form.less +0 -12
- package/es/ThemeAntd/style/input.less +0 -83
- package/es/ThemeAntd/style/pagination.less +0 -96
- package/es/ThemeAntd/style/picker.less +0 -106
- package/es/ThemeAntd/style/popover.less +0 -5
- package/es/ThemeAntd/style/radio.less +0 -87
- package/es/ThemeAntd/style/scrollbar.less +0 -23
- package/es/ThemeAntd/style/select.less +0 -81
- package/es/ThemeAntd/style/table.less +0 -57
- package/es/ThemeAntd/style/tree.less +0 -18
- package/es/Tree/demo.d.ts +0 -3
- package/es/Tree/demo.js +0 -32
- package/es/Tree/index.d.ts +0 -24
- package/es/Tree/index.js +0 -100
- package/es/Tree/index.less +0 -60
package/es/Player/demo.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import "antd/lib/config-provider/style";
|
|
2
|
-
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
|
-
import "antd/lib/button/style";
|
|
4
|
-
import _Button from "antd/lib/button";
|
|
5
|
-
import "antd/lib/input/style";
|
|
6
|
-
import _Input from "antd/lib/input";
|
|
7
|
-
import "antd/lib/select/style";
|
|
8
|
-
import _Select from "antd/lib/select";
|
|
9
|
-
|
|
10
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
2
|
|
|
12
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -25,11 +16,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
25
16
|
|
|
26
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
18
|
|
|
19
|
+
import { Button, ConfigProvider, Input, Select } from 'antd';
|
|
20
|
+
import moment from 'dayjs';
|
|
28
21
|
import React, { useState } from 'react';
|
|
29
|
-
import Player from "./single_player";
|
|
30
|
-
import SegmentPlayer from "./segment_player";
|
|
31
22
|
import FrontendPlayer from "./frontend_player";
|
|
32
|
-
import
|
|
23
|
+
import SegmentPlayer from "./segment_player";
|
|
24
|
+
import Player from "./single_player";
|
|
33
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
26
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
35
27
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -73,7 +65,7 @@ function Demo1() {
|
|
|
73
65
|
marginBottom: 10,
|
|
74
66
|
display: 'flex'
|
|
75
67
|
},
|
|
76
|
-
children: [/*#__PURE__*/_jsx(
|
|
68
|
+
children: [/*#__PURE__*/_jsx(Select, {
|
|
77
69
|
value: state.type || '',
|
|
78
70
|
onChange: function onChange(val) {
|
|
79
71
|
return setState(function (old) {
|
|
@@ -83,12 +75,12 @@ function Demo1() {
|
|
|
83
75
|
});
|
|
84
76
|
},
|
|
85
77
|
children: options.map(function (v) {
|
|
86
|
-
return /*#__PURE__*/_jsx(
|
|
78
|
+
return /*#__PURE__*/_jsx(Select.Option, {
|
|
87
79
|
value: v.value,
|
|
88
80
|
children: v.label
|
|
89
81
|
}, v.label);
|
|
90
82
|
})
|
|
91
|
-
}), /*#__PURE__*/_jsx(
|
|
83
|
+
}), /*#__PURE__*/_jsx(Input, {
|
|
92
84
|
style: {
|
|
93
85
|
flex: 1,
|
|
94
86
|
height: 32
|
|
@@ -102,7 +94,7 @@ function Demo1() {
|
|
|
102
94
|
});
|
|
103
95
|
});
|
|
104
96
|
}
|
|
105
|
-
}), /*#__PURE__*/_jsx(
|
|
97
|
+
}), /*#__PURE__*/_jsx(Select, {
|
|
106
98
|
value: state.isLive,
|
|
107
99
|
onChange: function onChange(val) {
|
|
108
100
|
return setState(function (old) {
|
|
@@ -112,17 +104,17 @@ function Demo1() {
|
|
|
112
104
|
});
|
|
113
105
|
},
|
|
114
106
|
children: options2.map(function (v) {
|
|
115
|
-
return /*#__PURE__*/_jsx(
|
|
107
|
+
return /*#__PURE__*/_jsx(Select.Option, {
|
|
116
108
|
value: v.value,
|
|
117
109
|
children: v.label
|
|
118
110
|
}, v.label);
|
|
119
111
|
})
|
|
120
|
-
}), /*#__PURE__*/_jsx(
|
|
112
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
121
113
|
style: {
|
|
122
114
|
width: 60,
|
|
123
115
|
height: 32
|
|
124
116
|
},
|
|
125
|
-
onClick: function onClick(
|
|
117
|
+
onClick: function onClick() {
|
|
126
118
|
return setState(function (old) {
|
|
127
119
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
128
120
|
url: state.tempUrl
|
|
@@ -142,11 +134,7 @@ function Demo1() {
|
|
|
142
134
|
});
|
|
143
135
|
}
|
|
144
136
|
|
|
145
|
-
var mm = moment().set(
|
|
146
|
-
hours: 0,
|
|
147
|
-
minutes: 0,
|
|
148
|
-
seconds: 0
|
|
149
|
-
});
|
|
137
|
+
var mm = moment().set('hours', 0).set('minutes', 0).set('seconds', 0);
|
|
150
138
|
var m = mm.clone();
|
|
151
139
|
|
|
152
140
|
function Demo2() {
|
|
@@ -154,39 +142,21 @@ function Demo2() {
|
|
|
154
142
|
isLive: 1,
|
|
155
143
|
segments: [{
|
|
156
144
|
beginTime: m.valueOf(),
|
|
157
|
-
endTime: m.set(
|
|
158
|
-
minutes: 1
|
|
159
|
-
}).valueOf(),
|
|
145
|
+
endTime: m.set('minutes', 1).valueOf(),
|
|
160
146
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
|
|
161
147
|
}, {
|
|
162
|
-
beginTime: m.set(
|
|
163
|
-
|
|
164
|
-
}).valueOf(),
|
|
165
|
-
endTime: m.set({
|
|
166
|
-
minutes: 2
|
|
167
|
-
}).valueOf()
|
|
148
|
+
beginTime: m.set('minutes', 1).valueOf(),
|
|
149
|
+
endTime: m.set('minutes', 2).valueOf()
|
|
168
150
|
}, {
|
|
169
|
-
beginTime: m.set(
|
|
170
|
-
|
|
171
|
-
}).valueOf(),
|
|
172
|
-
endTime: m.set({
|
|
173
|
-
minutes: 3
|
|
174
|
-
}).valueOf(),
|
|
151
|
+
beginTime: m.set('minutes', 2).valueOf(),
|
|
152
|
+
endTime: m.set('minutes', 3).valueOf(),
|
|
175
153
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=1'
|
|
176
154
|
}, {
|
|
177
|
-
beginTime: m.set(
|
|
178
|
-
|
|
179
|
-
}).valueOf(),
|
|
180
|
-
endTime: m.set({
|
|
181
|
-
minutes: 4
|
|
182
|
-
}).valueOf()
|
|
155
|
+
beginTime: m.set('minutes', 3).valueOf(),
|
|
156
|
+
endTime: m.set('minutes', 4).valueOf()
|
|
183
157
|
}, {
|
|
184
|
-
beginTime: m.set(
|
|
185
|
-
|
|
186
|
-
}).valueOf(),
|
|
187
|
-
endTime: m.set({
|
|
188
|
-
minutes: 5
|
|
189
|
-
}).valueOf(),
|
|
158
|
+
beginTime: m.set('minutes', 4).valueOf(),
|
|
159
|
+
endTime: m.set('minutes', 5).valueOf(),
|
|
190
160
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=2'
|
|
191
161
|
}],
|
|
192
162
|
tempUrl: ''
|
|
@@ -207,7 +177,7 @@ function Demo2() {
|
|
|
207
177
|
marginBottom: 10,
|
|
208
178
|
display: 'flex'
|
|
209
179
|
},
|
|
210
|
-
children: [/*#__PURE__*/_jsx(
|
|
180
|
+
children: [/*#__PURE__*/_jsx(Input, {
|
|
211
181
|
style: {
|
|
212
182
|
flex: 1,
|
|
213
183
|
height: 32
|
|
@@ -221,12 +191,12 @@ function Demo2() {
|
|
|
221
191
|
});
|
|
222
192
|
});
|
|
223
193
|
}
|
|
224
|
-
}), /*#__PURE__*/_jsx(
|
|
194
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
225
195
|
style: {
|
|
226
196
|
width: 60,
|
|
227
197
|
height: 32
|
|
228
198
|
},
|
|
229
|
-
onClick: function onClick(
|
|
199
|
+
onClick: function onClick() {
|
|
230
200
|
return setState(function (old) {
|
|
231
201
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
232
202
|
segments: JSON.parse(state.tempUrl)
|
|
@@ -268,7 +238,7 @@ function Demo3() {
|
|
|
268
238
|
marginBottom: 10,
|
|
269
239
|
display: 'flex'
|
|
270
240
|
},
|
|
271
|
-
children: [/*#__PURE__*/_jsx(
|
|
241
|
+
children: [/*#__PURE__*/_jsx(Input, {
|
|
272
242
|
style: {
|
|
273
243
|
flex: 1,
|
|
274
244
|
height: 32
|
|
@@ -282,12 +252,12 @@ function Demo3() {
|
|
|
282
252
|
});
|
|
283
253
|
});
|
|
284
254
|
}
|
|
285
|
-
}), /*#__PURE__*/_jsx(
|
|
255
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
286
256
|
style: {
|
|
287
257
|
width: 60,
|
|
288
258
|
height: 32
|
|
289
259
|
},
|
|
290
|
-
onClick: function onClick(
|
|
260
|
+
onClick: function onClick() {
|
|
291
261
|
return setState(function (old) {
|
|
292
262
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
293
263
|
url: state.tempUrl
|
|
@@ -313,7 +283,7 @@ function Demo3() {
|
|
|
313
283
|
}
|
|
314
284
|
|
|
315
285
|
var App = function App() {
|
|
316
|
-
return /*#__PURE__*/_jsxs(
|
|
286
|
+
return /*#__PURE__*/_jsxs(ConfigProvider, {
|
|
317
287
|
prefixCls: "cloudapp",
|
|
318
288
|
children: [/*#__PURE__*/_jsx(Demo1, {}), /*#__PURE__*/_jsx(Demo2, {}), /*#__PURE__*/_jsx(Demo3, {})]
|
|
319
289
|
});
|
|
@@ -18,7 +18,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
18
18
|
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
20
|
|
|
21
|
-
import moment from '
|
|
21
|
+
import moment from 'dayjs';
|
|
22
22
|
import React, { startTransition, useMemo, useState } from 'react';
|
|
23
23
|
import useBarStatus from "./contraller_bar/useBarStatus";
|
|
24
24
|
import "./style/timeline.less";
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import "antd/lib/tooltip/style";
|
|
2
|
-
import _Tooltip from "antd/lib/tooltip";
|
|
3
|
-
|
|
4
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
2
|
|
|
6
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -19,7 +16,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
19
16
|
|
|
20
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
18
|
|
|
22
|
-
import
|
|
19
|
+
import { Tooltip } from 'antd';
|
|
20
|
+
import moment from 'dayjs';
|
|
23
21
|
import React, { startTransition, useMemo, useState } from 'react';
|
|
24
22
|
import useBarStatus from "./contraller_bar/useBarStatus";
|
|
25
23
|
import "./style/timeline.less";
|
|
@@ -175,7 +173,7 @@ function SegmentTimeLine(_ref2) {
|
|
|
175
173
|
children: /*#__PURE__*/_jsxs("div", {
|
|
176
174
|
className: "segment-line-box",
|
|
177
175
|
children: [segments.map(function (v, i) {
|
|
178
|
-
return /*#__PURE__*/_jsx(
|
|
176
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
179
177
|
title: /*#__PURE__*/_jsx(TipTitle, {
|
|
180
178
|
segments: segments,
|
|
181
179
|
index: i,
|
|
@@ -42,7 +42,7 @@ import { getVideoType, playReload, playUnload } from "./util";
|
|
|
42
42
|
import "./style/index.less";
|
|
43
43
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
44
44
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
45
|
-
var SinglePlayer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
45
|
+
var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref) {
|
|
46
46
|
var _props$reload;
|
|
47
47
|
|
|
48
48
|
var className = _ref.className,
|
package/es/Player/util.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import Flvjs from '@cloud-app-dev/flv.js';
|
|
|
2
2
|
import Hls, { HlsConfig } from 'hls.js';
|
|
3
3
|
import type VideoEventInstance from './event';
|
|
4
4
|
import type { FlvPlayerConfig } from './player';
|
|
5
|
-
export declare function tryCatch(fn: () => void | Promise<any>): Promise<void>;
|
|
6
5
|
/**
|
|
7
6
|
* 创建HLS对象
|
|
8
7
|
* @param {*} video
|
package/es/Player/util.js
CHANGED
|
@@ -1,57 +1,19 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
|
|
3
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4
|
-
|
|
5
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
2
|
|
|
7
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
4
|
|
|
9
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
6
|
|
|
11
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
-
|
|
13
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
14
|
-
|
|
15
7
|
import Flvjs from '@cloud-app-dev/flv.js';
|
|
16
8
|
import Hls from 'hls.js';
|
|
9
|
+
import { tryCatch } from "../utils";
|
|
17
10
|
import Events from "./event/eventName";
|
|
18
|
-
|
|
19
|
-
return _tryCatch.apply(this, arguments);
|
|
20
|
-
}
|
|
11
|
+
|
|
21
12
|
/**
|
|
22
13
|
* 创建HLS对象
|
|
23
14
|
* @param {*} video
|
|
24
15
|
* @param {*} URL
|
|
25
16
|
*/
|
|
26
|
-
|
|
27
|
-
function _tryCatch() {
|
|
28
|
-
_tryCatch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fn) {
|
|
29
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
30
|
-
while (1) {
|
|
31
|
-
switch (_context.prev = _context.next) {
|
|
32
|
-
case 0:
|
|
33
|
-
_context.prev = 0;
|
|
34
|
-
_context.next = 3;
|
|
35
|
-
return fn();
|
|
36
|
-
|
|
37
|
-
case 3:
|
|
38
|
-
_context.next = 7;
|
|
39
|
-
break;
|
|
40
|
-
|
|
41
|
-
case 5:
|
|
42
|
-
_context.prev = 5;
|
|
43
|
-
_context.t0 = _context["catch"](0);
|
|
44
|
-
|
|
45
|
-
case 7:
|
|
46
|
-
case "end":
|
|
47
|
-
return _context.stop();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}, _callee, null, [[0, 5]]);
|
|
51
|
-
}));
|
|
52
|
-
return _tryCatch.apply(this, arguments);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
17
|
export function createHlsPlayer(video, url, isLive, hlsConfig) {
|
|
56
18
|
if (!Hls.isSupported() || !url) {
|
|
57
19
|
return undefined;
|
package/es/PlayerExt/demo.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import "antd/lib/config-provider/style";
|
|
2
|
-
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
|
-
import "antd/lib/button/style";
|
|
4
|
-
import _Button from "antd/lib/button";
|
|
5
|
-
import "antd/lib/input/style";
|
|
6
|
-
import _Input from "antd/lib/input";
|
|
7
|
-
import "antd/lib/select/style";
|
|
8
|
-
import _Select from "antd/lib/select";
|
|
9
|
-
|
|
10
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
2
|
|
|
12
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -26,6 +17,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
26
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
18
|
|
|
28
19
|
import React, { useState } from 'react';
|
|
20
|
+
import { Button, ConfigProvider, Select, Input } from 'antd';
|
|
29
21
|
import Player from "../Player/single_player";
|
|
30
22
|
import ExtModel from "./index";
|
|
31
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -73,7 +65,7 @@ function Demo() {
|
|
|
73
65
|
marginBottom: 10,
|
|
74
66
|
display: 'flex'
|
|
75
67
|
},
|
|
76
|
-
children: [/*#__PURE__*/_jsx(
|
|
68
|
+
children: [/*#__PURE__*/_jsx(Select, {
|
|
77
69
|
value: state.type || '',
|
|
78
70
|
onChange: function onChange(val) {
|
|
79
71
|
return setState(function (old) {
|
|
@@ -83,12 +75,12 @@ function Demo() {
|
|
|
83
75
|
});
|
|
84
76
|
},
|
|
85
77
|
children: options.map(function (v) {
|
|
86
|
-
return /*#__PURE__*/_jsx(
|
|
78
|
+
return /*#__PURE__*/_jsx(Select.Option, {
|
|
87
79
|
value: v.value,
|
|
88
80
|
children: v.label
|
|
89
81
|
}, v.label);
|
|
90
82
|
})
|
|
91
|
-
}), /*#__PURE__*/_jsx(
|
|
83
|
+
}), /*#__PURE__*/_jsx(Input, {
|
|
92
84
|
style: {
|
|
93
85
|
flex: 1,
|
|
94
86
|
height: 32
|
|
@@ -102,7 +94,7 @@ function Demo() {
|
|
|
102
94
|
});
|
|
103
95
|
});
|
|
104
96
|
}
|
|
105
|
-
}), /*#__PURE__*/_jsx(
|
|
97
|
+
}), /*#__PURE__*/_jsx(Select, {
|
|
106
98
|
value: state.isLive,
|
|
107
99
|
onChange: function onChange(val) {
|
|
108
100
|
return setState(function (old) {
|
|
@@ -112,12 +104,12 @@ function Demo() {
|
|
|
112
104
|
});
|
|
113
105
|
},
|
|
114
106
|
children: options2.map(function (v) {
|
|
115
|
-
return /*#__PURE__*/_jsx(
|
|
107
|
+
return /*#__PURE__*/_jsx(Select.Option, {
|
|
116
108
|
value: v.value,
|
|
117
109
|
children: v.label
|
|
118
110
|
}, v.label);
|
|
119
111
|
})
|
|
120
|
-
}), /*#__PURE__*/_jsxs(
|
|
112
|
+
}), /*#__PURE__*/_jsxs(Select, {
|
|
121
113
|
value: state.mode,
|
|
122
114
|
onChange: function onChange(val) {
|
|
123
115
|
return setState(function (old) {
|
|
@@ -126,14 +118,14 @@ function Demo() {
|
|
|
126
118
|
});
|
|
127
119
|
});
|
|
128
120
|
},
|
|
129
|
-
children: [/*#__PURE__*/_jsx(
|
|
121
|
+
children: [/*#__PURE__*/_jsx(Select.Option, {
|
|
130
122
|
value: 1,
|
|
131
123
|
children: "\u6D4F\u89C8\u5668\u6A21\u5F0F"
|
|
132
|
-
}), /*#__PURE__*/_jsx(
|
|
124
|
+
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
133
125
|
value: 2,
|
|
134
126
|
children: "\u63D2\u4EF6\u6A21\u5F0F"
|
|
135
127
|
})]
|
|
136
|
-
}), /*#__PURE__*/_jsx(
|
|
128
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
137
129
|
style: {
|
|
138
130
|
width: 60,
|
|
139
131
|
height: 32
|
|
@@ -146,7 +138,7 @@ function Demo() {
|
|
|
146
138
|
});
|
|
147
139
|
},
|
|
148
140
|
children: "\u5173\u95ED"
|
|
149
|
-
}), /*#__PURE__*/_jsx(
|
|
141
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
150
142
|
style: {
|
|
151
143
|
width: 60,
|
|
152
144
|
height: 32
|
|
@@ -179,7 +171,7 @@ function Demo() {
|
|
|
179
171
|
}
|
|
180
172
|
|
|
181
173
|
var App = function App() {
|
|
182
|
-
return /*#__PURE__*/_jsx(
|
|
174
|
+
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
183
175
|
prefixCls: "cloudapp",
|
|
184
176
|
children: /*#__PURE__*/_jsx(Demo, {})
|
|
185
177
|
});
|
package/es/Progress/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import "antd/lib/progress/style";
|
|
2
|
-
import _Progress from "antd/lib/progress";
|
|
3
|
-
|
|
4
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
2
|
|
|
6
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -13,13 +10,14 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
13
10
|
|
|
14
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
12
|
|
|
16
|
-
import
|
|
13
|
+
import { Progress } from 'antd';
|
|
14
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
17
15
|
import "./index.less";
|
|
18
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
17
|
|
|
20
18
|
function ProgressComponent(_ref) {
|
|
21
19
|
var status = _ref.status;
|
|
22
|
-
var timer = useRef(
|
|
20
|
+
var timer = useRef();
|
|
23
21
|
var currentStatus = useRef('loading');
|
|
24
22
|
|
|
25
23
|
var _useState = useState(0),
|
|
@@ -53,7 +51,7 @@ function ProgressComponent(_ref) {
|
|
|
53
51
|
return clearTimeout(timer.current);
|
|
54
52
|
};
|
|
55
53
|
});
|
|
56
|
-
return /*#__PURE__*/_jsx(
|
|
54
|
+
return /*#__PURE__*/_jsx(Progress, {
|
|
57
55
|
status: status === 'error' ? 'exception' : 'active',
|
|
58
56
|
percent: percent,
|
|
59
57
|
showInfo: false,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IFooterProps {
|
|
3
|
+
onClose?: (e: React.MouseEvent) => void;
|
|
4
|
+
cancelText: string;
|
|
5
|
+
okText: string;
|
|
6
|
+
onOk?: (e: React.MouseEvent) => void;
|
|
7
|
+
}
|
|
8
|
+
declare function Footer({ onClose, cancelText, okText, onOk }: IFooterProps): JSX.Element;
|
|
9
|
+
export default Footer;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _Button from "antd/lib/button";
|
|
1
|
+
import { Button } from 'antd';
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import "./index.less";
|
|
5
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
4
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
5
|
|
|
@@ -14,13 +12,13 @@ function Footer(_ref) {
|
|
|
14
12
|
style: {
|
|
15
13
|
textAlign: 'right'
|
|
16
14
|
},
|
|
17
|
-
children: [/*#__PURE__*/_jsx(
|
|
15
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
18
16
|
onClick: onClose,
|
|
19
17
|
style: {
|
|
20
18
|
marginRight: 8
|
|
21
19
|
},
|
|
22
20
|
children: cancelText
|
|
23
|
-
}), /*#__PURE__*/_jsx(
|
|
21
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
24
22
|
onClick: onOk,
|
|
25
23
|
type: "primary",
|
|
26
24
|
children: okText
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Button } from 'antd';
|
|
2
|
+
import React, { useRef } from 'react';
|
|
3
|
+
import RefDrawer from "./index";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
var App = function App() {
|
|
9
|
+
var ref = useRef(null);
|
|
10
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
11
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
12
|
+
type: "primary",
|
|
13
|
+
onClick: function onClick() {
|
|
14
|
+
var _ref$current;
|
|
15
|
+
|
|
16
|
+
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.open({
|
|
17
|
+
content: /*#__PURE__*/_jsxs(_Fragment, {
|
|
18
|
+
children: [/*#__PURE__*/_jsx("p", {
|
|
19
|
+
children: "Some contents..."
|
|
20
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
21
|
+
children: "Some contents..."
|
|
22
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
23
|
+
children: "Some contents..."
|
|
24
|
+
})]
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
children: "RefDrawer"
|
|
29
|
+
}), /*#__PURE__*/_jsx(RefDrawer, {
|
|
30
|
+
ref: ref
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default App;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DrawerProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface IUseDrawerHookState {
|
|
4
|
+
content?: React.ReactNode;
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
title?: React.ReactNode;
|
|
7
|
+
onOk?: (e: React.MouseEvent) => void;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IRefDrawerMethodsProps {
|
|
12
|
+
open: (options: IUseDrawerHookState) => void;
|
|
13
|
+
close: () => void;
|
|
14
|
+
}
|
|
15
|
+
export interface IDrawerProps extends DrawerProps {
|
|
16
|
+
cancelText?: string;
|
|
17
|
+
onOk?: (e: React.MouseEvent) => void;
|
|
18
|
+
/**
|
|
19
|
+
* @description 确认按钮文本
|
|
20
|
+
* @default 确定
|
|
21
|
+
* @type string
|
|
22
|
+
*/
|
|
23
|
+
okText?: string;
|
|
24
|
+
}
|
|
25
|
+
declare const RefDrawer: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<IRefDrawerMethodsProps>>;
|
|
26
|
+
export default RefDrawer;
|