@cloud-app-dev/vidc 3.2.38 → 4.0.0

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 (121) hide show
  1. package/.dumirc.ts +7 -11
  2. package/.fatherrc.ts +0 -1
  3. package/es/CheckGroupFixed/demo.js +2 -3
  4. package/es/CheckGroupFixed/index.js +4 -7
  5. package/es/Config/index.js +10 -9
  6. package/es/Config/interface.d.ts +2 -3
  7. package/es/CustomRenderSelect/index.js +2 -3
  8. package/es/DynamicList/demo.js +3 -4
  9. package/es/DynamicList/index.js +2 -3
  10. package/es/ErrorFallback/index.js +3 -6
  11. package/es/FrontendPlayer/index.d.ts +4 -2
  12. package/es/List/index.d.ts +0 -13
  13. package/es/List/index.js +1 -19
  14. package/es/LoaderScript/utils.d.ts +0 -1
  15. package/es/LoaderScript/utils.js +1 -36
  16. package/es/Map/FindPio/index.js +2 -3
  17. package/es/Map/LevelCenter/demo.js +2 -4
  18. package/es/Map/ResetTools/index.js +4 -5
  19. package/es/Picture/component/Tools/index.js +6 -7
  20. package/es/Picture/demo.js +9 -13
  21. package/es/Picture/index.js +55 -64
  22. package/es/Picture/utils.js +0 -1
  23. package/es/Player/api/index.js +2 -1
  24. package/es/Player/contraller_bar/volume.js +3 -6
  25. package/es/Player/demo.js +28 -58
  26. package/es/Player/frontend_timeline.js +1 -1
  27. package/es/Player/segment_timeline.js +3 -5
  28. package/es/Player/single_player.js +1 -1
  29. package/es/Player/util.d.ts +0 -1
  30. package/es/Player/util.js +2 -40
  31. package/es/PlayerExt/demo.js +12 -20
  32. package/es/Progress/index.js +4 -6
  33. package/es/RefDrawer/Footer.d.ts +9 -0
  34. package/es/{Drawer → RefDrawer}/Footer.js +3 -5
  35. package/es/{Drawer/Demo.d.ts → RefDrawer/demo.d.ts} +0 -0
  36. package/es/RefDrawer/demo.js +35 -0
  37. package/es/RefDrawer/index.d.ts +26 -0
  38. package/es/{Input → RefDrawer}/index.js +54 -58
  39. package/es/{Input → RefModal}/demo.d.ts +0 -0
  40. package/es/RefModal/demo.js +35 -0
  41. package/es/RefModal/index.d.ts +17 -0
  42. package/es/RefModal/index.js +71 -0
  43. package/es/ScreenPlayer/PlayerWithExt.js +1 -1
  44. package/es/ScreenPlayer/RatePick.js +8 -9
  45. package/es/ScreenPlayer/ScreenSelect.js +2 -3
  46. package/es/ScreenPlayer/SegmentTimeLine.js +3 -11
  47. package/es/ScreenPlayer/TimeMode.js +3 -4
  48. package/es/ScreenPlayer/TimeSelect.js +14 -39
  49. package/es/ScreenPlayer/demo.js +2 -3
  50. package/es/ScreenPlayer/demo2.js +8 -28
  51. package/es/ScreenPlayer/useTimeSlider.js +1 -1
  52. package/es/Service/http.js +6 -8
  53. package/es/TableLayout/index.d.ts +0 -3
  54. package/es/TableLayout/index.js +8 -10
  55. package/es/ThemeAntd/demo.js +21 -40
  56. package/es/ThemeAntd/index.js +16 -2
  57. package/es/ThemeAntd/index.less +0 -12
  58. package/es/Timeout/index.js +2 -2
  59. package/es/core.d.ts +0 -149
  60. package/es/index.d.ts +2 -6
  61. package/es/index.js +2 -6
  62. package/es/useDrawROI/index.js +4 -4
  63. package/es/utils.d.ts +1 -12
  64. package/es/utils.js +0 -56
  65. package/package.json +24 -24
  66. package/theme-config.ts +3 -1
  67. package/typings/global.d.ts +4 -4
  68. package/es/Api/index.d.ts +0 -12
  69. package/es/Api/index.js +0 -267
  70. package/es/Box/BetweenBox/index.d.ts +0 -12
  71. package/es/Box/BetweenBox/index.js +0 -31
  72. package/es/Box/BetweenBox/index.less +0 -5
  73. package/es/Box/InfoBox/index.d.ts +0 -12
  74. package/es/Box/InfoBox/index.js +0 -30
  75. package/es/Box/InfoBox/index.less +0 -24
  76. package/es/Box/TwoColumnBox/index.d.ts +0 -10
  77. package/es/Box/TwoColumnBox/index.js +0 -54
  78. package/es/Box/TwoColumnBox/index.less +0 -80
  79. package/es/Box/deps/content-grid.d.ts +0 -9
  80. package/es/Box/deps/content-grid.js +0 -9
  81. package/es/Box/deps/grid-factory.d.ts +0 -10
  82. package/es/Box/deps/grid-factory.js +0 -72
  83. package/es/Box/deps/simple-grid.d.ts +0 -9
  84. package/es/Box/deps/simple-grid.js +0 -8
  85. package/es/Box/index.d.ts +0 -14
  86. package/es/Box/index.js +0 -39
  87. package/es/Box/index.less +0 -10
  88. package/es/Drawer/Demo.js +0 -109
  89. package/es/Drawer/Footer.d.ts +0 -5
  90. package/es/Drawer/index.d.ts +0 -38
  91. package/es/Drawer/index.js +0 -207
  92. package/es/Drawer/index.less +0 -42
  93. package/es/Drawer/interface.d.ts +0 -22
  94. package/es/Input/demo.js +0 -16
  95. package/es/Input/index.d.ts +0 -19
  96. package/es/Input/index.less +0 -12
  97. package/es/Modal/demo.d.ts +0 -3
  98. package/es/Modal/demo.js +0 -106
  99. package/es/Modal/index.d.ts +0 -44
  100. package/es/Modal/index.js +0 -197
  101. package/es/Modal/index.less +0 -44
  102. package/es/Modal/interface.d.ts +0 -23
  103. package/es/Service/fetch-adapter.d.ts +0 -12
  104. package/es/Service/fetch-adapter.js +0 -203
  105. package/es/ThemeAntd/style/button.less +0 -67
  106. package/es/ThemeAntd/style/checkbox.less +0 -72
  107. package/es/ThemeAntd/style/form.less +0 -12
  108. package/es/ThemeAntd/style/input.less +0 -83
  109. package/es/ThemeAntd/style/pagination.less +0 -96
  110. package/es/ThemeAntd/style/picker.less +0 -106
  111. package/es/ThemeAntd/style/popover.less +0 -5
  112. package/es/ThemeAntd/style/radio.less +0 -87
  113. package/es/ThemeAntd/style/scrollbar.less +0 -23
  114. package/es/ThemeAntd/style/select.less +0 -81
  115. package/es/ThemeAntd/style/table.less +0 -57
  116. package/es/ThemeAntd/style/tree.less +0 -18
  117. package/es/Tree/demo.d.ts +0 -3
  118. package/es/Tree/demo.js +0 -32
  119. package/es/Tree/index.d.ts +0 -24
  120. package/es/Tree/index.js +0 -100
  121. package/es/Tree/index.less +0 -60
@@ -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(_Select, {
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(_Select.Option, {
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(_Input, {
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(_Select, {
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(_Select.Option, {
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(_Select, {
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(_Select.Option, {
121
+ children: [/*#__PURE__*/_jsx(Select.Option, {
130
122
  value: 1,
131
123
  children: "\u6D4F\u89C8\u5668\u6A21\u5F0F"
132
- }), /*#__PURE__*/_jsx(_Select.Option, {
124
+ }), /*#__PURE__*/_jsx(Select.Option, {
133
125
  value: 2,
134
126
  children: "\u63D2\u4EF6\u6A21\u5F0F"
135
127
  })]
136
- }), /*#__PURE__*/_jsx(_Button, {
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(_Button, {
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(_ConfigProvider, {
174
+ return /*#__PURE__*/_jsx(ConfigProvider, {
183
175
  prefixCls: "cloudapp",
184
176
  children: /*#__PURE__*/_jsx(Demo, {})
185
177
  });
@@ -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 React, { useState, useEffect, useMemo, useRef } from 'react';
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(null);
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(_Progress, {
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 "antd/lib/button/style";
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(_Button, {
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(_Button, {
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;
@@ -1,9 +1,3 @@
1
- import "antd/lib/input/style";
2
- import _Input from "antd/lib/input";
3
- import _useUpdateEffect from "ahooks/es/useUpdateEffect";
4
- import _useDebounce from "ahooks/es/useDebounce";
5
- var _excluded = ["prefix", "className", "suffix", "allowClear", "defaultValue", "value", "onChange", "onEnter"];
6
-
7
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; }
8
2
 
9
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; }
@@ -22,66 +16,68 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
22
16
 
23
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
18
 
25
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
26
-
27
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
28
-
29
- import React, { useState } from 'react';
30
- import IconFont from "../IconFont";
31
- import "./index.less";
19
+ import { Drawer } from 'antd';
20
+ import React, { useContext, useImperativeHandle, useMemo, useState } from 'react';
21
+ import ConfigContext from "../ConfigContext";
22
+ import Footer from "./Footer";
32
23
  import { jsx as _jsx } from "react/jsx-runtime";
33
-
34
- function Input(_ref) {
35
- var prefix = _ref.prefix,
36
- className = _ref.className,
37
- suffix = _ref.suffix,
38
- allowClear = _ref.allowClear,
39
- defaultValue = _ref.defaultValue,
40
- value = _ref.value,
41
- onChange = _ref.onChange,
42
- onEnter = _ref.onEnter,
43
- props = _objectWithoutProperties(_ref, _excluded);
24
+ var RefDrawer = /*#__PURE__*/React.forwardRef(function RefDrawer(_, ref) {
25
+ var context = useContext(ConfigContext.Context);
26
+ var root = useMemo(function () {
27
+ return (context === null || context === void 0 ? void 0 : context.root) || document.body;
28
+ }, [context === null || context === void 0 ? void 0 : context.root]);
44
29
 
45
30
  var _useState = useState({
46
- value: defaultValue || value,
47
- focus: false
31
+ content: null,
32
+ visible: false,
33
+ title: '',
34
+ onOk: undefined,
35
+ width: undefined,
36
+ className: undefined
48
37
  }),
49
38
  _useState2 = _slicedToArray(_useState, 2),
50
39
  state = _useState2[0],
51
40
  setState = _useState2[1];
52
41
 
53
- var debouncedValue = _useDebounce(state.value, {
54
- wait: 500
55
- });
56
-
57
- _useUpdateEffect(function () {
58
- return onChange === null || onChange === void 0 ? void 0 : onChange(debouncedValue);
59
- }, [debouncedValue]);
42
+ var open = function open(options) {
43
+ setState(function (old) {
44
+ return _objectSpread(_objectSpread(_objectSpread({}, old), options), {}, {
45
+ visible: true
46
+ });
47
+ });
48
+ };
60
49
 
61
- return /*#__PURE__*/_jsx(_Input, _objectSpread(_objectSpread({}, props), {}, {
62
- className: "bc-search-input ".concat(className),
63
- onChange: function onChange(e) {
64
- return setState(function (old) {
65
- return _objectSpread(_objectSpread({}, old), {}, {
66
- value: e.target.value
67
- });
50
+ var close = function close() {
51
+ setState(function (old) {
52
+ return _objectSpread(_objectSpread({}, old), {}, {
53
+ visible: false
68
54
  });
55
+ });
56
+ };
57
+
58
+ useImperativeHandle(ref, function () {
59
+ return {
60
+ open: open,
61
+ close: close
62
+ };
63
+ }, [state]);
64
+ return /*#__PURE__*/_jsx(Drawer, {
65
+ footer: /*#__PURE__*/_jsx(Footer, {
66
+ onClose: close,
67
+ onOk: state.onOk,
68
+ okText: "\u786E\u5B9A",
69
+ cancelText: "\u53D6\u6D88"
70
+ }),
71
+ visible: state.visible,
72
+ onClose: close,
73
+ destroyOnClose: true,
74
+ title: state.title,
75
+ width: state.width,
76
+ className: state.className,
77
+ getContainer: function getContainer() {
78
+ return root;
69
79
  },
70
- allowClear: allowClear,
71
- prefix: prefix,
72
- suffix: suffix,
73
- value: state.value,
74
- onPressEnter: function onPressEnter() {
75
- return onEnter === null || onEnter === void 0 ? void 0 : onEnter(state.value);
76
- }
77
- }));
78
- }
79
-
80
- Input.defaultProps = {
81
- className: '',
82
- prefix: /*#__PURE__*/_jsx(IconFont, {
83
- type: "lm-player_Edit_Search"
84
- }),
85
- allowClear: true
86
- };
87
- export default Input;
80
+ children: state.content
81
+ });
82
+ });
83
+ export default RefDrawer;
File without changes
@@ -0,0 +1,35 @@
1
+ import { Button } from 'antd';
2
+ import React, { useRef } from 'react';
3
+ import RefModal 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: "RefModal"
29
+ }), /*#__PURE__*/_jsx(RefModal, {
30
+ ref: ref
31
+ })]
32
+ });
33
+ };
34
+
35
+ export default App;
@@ -0,0 +1,17 @@
1
+ import { ModalProps } from 'antd';
2
+ import React from 'react';
3
+ export interface IUseModalHookState {
4
+ content?: React.ReactNode;
5
+ visible?: boolean;
6
+ title?: React.ReactNode;
7
+ onOk?: () => void;
8
+ width?: number | string;
9
+ className?: string;
10
+ }
11
+ export interface IRefModalMethodsProps {
12
+ open: (options: IUseModalHookState) => void;
13
+ close: () => void;
14
+ }
15
+ export declare type IModalProps = ModalProps;
16
+ declare const RefModal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<IRefModalMethodsProps>>;
17
+ export default RefModal;
@@ -0,0 +1,71 @@
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; }
2
+
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; }
4
+
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; }
6
+
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+
9
+ 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."); }
10
+
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
+
15
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
16
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ import { Modal } from 'antd';
20
+ import React, { useImperativeHandle, useState } from 'react';
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ var RefModal = /*#__PURE__*/React.forwardRef(function RefModal(props, ref) {
23
+ var _useState = useState({
24
+ content: null,
25
+ visible: false,
26
+ title: '',
27
+ onOk: undefined,
28
+ width: undefined,
29
+ className: undefined
30
+ }),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ state = _useState2[0],
33
+ setState = _useState2[1];
34
+
35
+ var open = function open(options) {
36
+ setState(function (old) {
37
+ return _objectSpread(_objectSpread(_objectSpread({}, old), options), {}, {
38
+ visible: true
39
+ });
40
+ });
41
+ };
42
+
43
+ var close = function close() {
44
+ setState(function (old) {
45
+ return _objectSpread(_objectSpread({}, old), {}, {
46
+ visible: false
47
+ });
48
+ });
49
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
50
+
51
+
52
+ useImperativeHandle(ref, function () {
53
+ return {
54
+ open: open,
55
+ close: close
56
+ };
57
+ }, [state]);
58
+ return /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({}, props), {}, {
59
+ okText: "\u786E\u5B9A",
60
+ cancelText: "\u53D6\u6D88",
61
+ open: state.visible,
62
+ onOk: state.onOk,
63
+ onCancel: close,
64
+ destroyOnClose: true,
65
+ title: state.title,
66
+ width: state.width,
67
+ className: state.className,
68
+ children: state.content
69
+ }));
70
+ });
71
+ export default RefModal;
@@ -27,7 +27,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
27
27
 
28
28
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
29
29
 
30
- import moment from 'moment';
30
+ import moment from 'dayjs';
31
31
  import React, { useEffect, useRef, useState } from 'react';
32
32
  import FrontendPlayer from "../Player/frontend_player";
33
33
  import SegmentPlayer from "../Player/segment_player";
@@ -1,5 +1,4 @@
1
- import "antd/lib/select/style";
2
- import _Select from "antd/lib/select";
1
+ import { Select } from 'antd';
3
2
  import React from 'react';
4
3
  import CustomRenderSelect from "../CustomRenderSelect";
5
4
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -19,25 +18,25 @@ function RatePick(_ref) {
19
18
  },
20
19
  onChange: onChange,
21
20
  placement: "topLeft",
22
- children: [/*#__PURE__*/_jsx(_Select.Option, {
21
+ children: [/*#__PURE__*/_jsx(Select.Option, {
23
22
  value: 8,
24
23
  children: "x8"
25
- }), /*#__PURE__*/_jsx(_Select.Option, {
24
+ }), /*#__PURE__*/_jsx(Select.Option, {
26
25
  value: 6,
27
26
  children: "x6"
28
- }), /*#__PURE__*/_jsx(_Select.Option, {
27
+ }), /*#__PURE__*/_jsx(Select.Option, {
29
28
  value: 4,
30
29
  children: "x4"
31
- }), /*#__PURE__*/_jsx(_Select.Option, {
30
+ }), /*#__PURE__*/_jsx(Select.Option, {
32
31
  value: 2,
33
32
  children: "x2"
34
- }), /*#__PURE__*/_jsx(_Select.Option, {
33
+ }), /*#__PURE__*/_jsx(Select.Option, {
35
34
  value: 1.5,
36
35
  children: "x1.5"
37
- }), /*#__PURE__*/_jsx(_Select.Option, {
36
+ }), /*#__PURE__*/_jsx(Select.Option, {
38
37
  value: 1,
39
38
  children: "x1"
40
- }), /*#__PURE__*/_jsx(_Select.Option, {
39
+ }), /*#__PURE__*/_jsx(Select.Option, {
41
40
  value: 0.5,
42
41
  children: "x0.5"
43
42
  })]
@@ -1,5 +1,4 @@
1
- import "antd/lib/select/style";
2
- import _Select from "antd/lib/select";
1
+ import { Select } from 'antd';
3
2
  import React, { useMemo } from 'react';
4
3
  import CustomRenderSelect from "../CustomRenderSelect";
5
4
  import IconFont from "../Player/iconfont";
@@ -35,7 +34,7 @@ function ScreenSelect(_ref) {
35
34
  },
36
35
  placement: "topLeft",
37
36
  children: ScreenType.map(function (item) {
38
- return /*#__PURE__*/_jsxs(_Select.Option, {
37
+ return /*#__PURE__*/_jsxs(Select.Option, {
39
38
  value: item.name,
40
39
  children: [/*#__PURE__*/_jsx("span", {
41
40
  style: {
@@ -1,5 +1,5 @@
1
1
  import _useThrottleFn2 from "ahooks/es/useThrottleFn";
2
- import moment from 'moment';
2
+ import moment from 'dayjs';
3
3
  import React, { useRef } from 'react';
4
4
  import useTimeSlider from "./useTimeSlider";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -21,16 +21,8 @@ function SegmentTimeLine(_ref) {
21
21
  run = _useThrottleFn.run;
22
22
 
23
23
  useTimeSlider(ref, {
24
- begin: begin !== null && begin !== void 0 ? begin : moment().set({
25
- hours: 0,
26
- minutes: 0,
27
- seconds: 0
28
- }).valueOf() - timeMode / 2 * 3600 * 1000,
29
- currentTime: (_ref2 = currentTime !== null && currentTime !== void 0 ? currentTime : begin) !== null && _ref2 !== void 0 ? _ref2 : moment().set({
30
- hours: 0,
31
- minutes: 0,
32
- seconds: 0
33
- }).valueOf(),
24
+ begin: begin !== null && begin !== void 0 ? begin : moment().set('hours', 0).set('minutes', 0).set('seconds', 0).valueOf() - timeMode / 2 * 3600 * 1000,
25
+ currentTime: (_ref2 = currentTime !== null && currentTime !== void 0 ? currentTime : begin) !== null && _ref2 !== void 0 ? _ref2 : moment().set('hours', 0).set('minutes', 0).set('seconds', 0).valueOf(),
34
26
  onTimeChange: run,
35
27
  segments: segments,
36
28
  hoursPer: timeMode,
@@ -1,5 +1,4 @@
1
- import "antd/lib/select/style";
2
- import _Select from "antd/lib/select";
1
+ import { Select } from 'antd';
3
2
  import React from 'react';
4
3
  import { TimeModeLibs } from "./utils";
5
4
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -8,14 +7,14 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
8
7
  function TimeMode(_ref) {
9
8
  var timeMode = _ref.timeMode,
10
9
  onChange = _ref.onChange;
11
- return /*#__PURE__*/_jsx(_Select, {
10
+ return /*#__PURE__*/_jsx(Select, {
12
11
  value: timeMode,
13
12
  onChange: onChange,
14
13
  className: "time-mode-select",
15
14
  popupClassName: "custom-select-dropdown",
16
15
  placement: "topLeft",
17
16
  children: TimeModeLibs.map(function (item) {
18
- return /*#__PURE__*/_jsxs(_Select.Option, {
17
+ return /*#__PURE__*/_jsxs(Select.Option, {
19
18
  value: item.name,
20
19
  children: [/*#__PURE__*/_jsx("span", {
21
20
  style: {