@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
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
.two-column-layout-container {
|
|
2
|
-
position: relative;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
color: inherit;
|
|
6
|
-
|
|
7
|
-
.two-column-aside {
|
|
8
|
-
position: absolute;
|
|
9
|
-
top: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
z-index: 9;
|
|
12
|
-
width: 30%;
|
|
13
|
-
height: 100%;
|
|
14
|
-
transition: width .1s ease-in;
|
|
15
|
-
box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
|
|
16
|
-
|
|
17
|
-
.two-colum-left-wrapper {
|
|
18
|
-
width: 100%;
|
|
19
|
-
height: 100%;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.two-colum-left-content {
|
|
24
|
-
width: 100%;
|
|
25
|
-
height: 100%;
|
|
26
|
-
background-color: var(--gray1);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.left-aside-slider-btn {
|
|
30
|
-
position: absolute;
|
|
31
|
-
top: 50%;
|
|
32
|
-
right: -8px;
|
|
33
|
-
z-index: 9;
|
|
34
|
-
width: 8px;
|
|
35
|
-
height: 20px;
|
|
36
|
-
margin-top: -8px;
|
|
37
|
-
font-size: var(--fs-large);
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
background-color: var(--gray5);
|
|
40
|
-
|
|
41
|
-
&::before,
|
|
42
|
-
&::after {
|
|
43
|
-
position: absolute;
|
|
44
|
-
z-index: 2;
|
|
45
|
-
width: 1px;
|
|
46
|
-
height: 16px;
|
|
47
|
-
background-color: var(--gray1);
|
|
48
|
-
content: '';
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&::before {
|
|
52
|
-
bottom: 2px;
|
|
53
|
-
left: 2px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&::after {
|
|
57
|
-
top: 2px;
|
|
58
|
-
right: 2px;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&.hide-left-aside {
|
|
63
|
-
width: 0;
|
|
64
|
-
|
|
65
|
-
& + .two-column-content {
|
|
66
|
-
padding-left: 0;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.two-column-content {
|
|
72
|
-
width: 100%;
|
|
73
|
-
height: 100%;
|
|
74
|
-
padding-left: 30%;
|
|
75
|
-
overflow: hidden;
|
|
76
|
-
background-color: var(--gray2);
|
|
77
|
-
transition: padding-left .3s ease-in-out;
|
|
78
|
-
box-sizing: border-box;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare function getGridClassName(grid: any): never[];
|
|
2
|
-
export declare function computedGrid(grid: any): {
|
|
3
|
-
xxl: number;
|
|
4
|
-
xl: number;
|
|
5
|
-
lg: number;
|
|
6
|
-
md: number;
|
|
7
|
-
sm: number;
|
|
8
|
-
xs: number;
|
|
9
|
-
};
|
|
10
|
-
export declare function computedCuurentGrid(): "xxl" | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export function getGridClassName(grid) {
|
|
2
|
-
var classNames = [];
|
|
3
|
-
|
|
4
|
-
for (var k in grid) {
|
|
5
|
-
classNames.push("cloudapp-col-".concat(k, "-").concat(grid[k]));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return [].concat('cloudapp-col', classNames);
|
|
9
|
-
}
|
|
10
|
-
export function computedGrid(grid) {
|
|
11
|
-
var contentGrid = {
|
|
12
|
-
xxl: 0,
|
|
13
|
-
xl: 0,
|
|
14
|
-
lg: 0,
|
|
15
|
-
md: 0,
|
|
16
|
-
sm: 0,
|
|
17
|
-
xs: 0
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
if (Array.isArray(grid)) {
|
|
21
|
-
grid.forEach(function (item) {
|
|
22
|
-
for (var k in item) {
|
|
23
|
-
if (contentGrid[k]) {
|
|
24
|
-
contentGrid[k] = contentGrid[k] - item[k];
|
|
25
|
-
} else {
|
|
26
|
-
contentGrid[k] = 24 - item[k];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
} else {
|
|
31
|
-
for (var k in grid) {
|
|
32
|
-
contentGrid[k] = 24 - grid[k];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
for (var _k in contentGrid) {
|
|
37
|
-
if (contentGrid[_k] <= 0) {
|
|
38
|
-
contentGrid[_k] = 24;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return contentGrid;
|
|
43
|
-
}
|
|
44
|
-
export function computedCuurentGrid() {
|
|
45
|
-
var width = document.body.clientWidth;
|
|
46
|
-
|
|
47
|
-
if (width >= 1600) {
|
|
48
|
-
return 'xxl';
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (width >= 1200 && width < 1600) {
|
|
52
|
-
return 'xl';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (width >= 992 && width < 1200) {
|
|
56
|
-
return 'lg';
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (width >= 768 && width < 992) {
|
|
60
|
-
return 'md';
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (width >= 576 && width < 768) {
|
|
64
|
-
return 'sm';
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (width < 576) {
|
|
68
|
-
return 'xs';
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return undefined;
|
|
72
|
-
}
|
package/es/Box/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
export interface ContentBoxProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
contentGrid?: any;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
declare function Box({ className, contentGrid, children }: ContentBoxProps): JSX.Element;
|
|
9
|
-
declare namespace Box {
|
|
10
|
-
var TwoColumnBox: typeof import("./TwoColumnBox").default;
|
|
11
|
-
var InfoBox: typeof import("./InfoBox").default;
|
|
12
|
-
var BetweenBox: typeof import("./BetweenBox").default;
|
|
13
|
-
}
|
|
14
|
-
export default Box;
|
package/es/Box/index.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import "antd/lib/row/style";
|
|
2
|
-
import _Row from "antd/lib/row";
|
|
3
|
-
import "antd/lib/col/style";
|
|
4
|
-
import _Col from "antd/lib/col";
|
|
5
|
-
|
|
6
|
-
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; }
|
|
7
|
-
|
|
8
|
-
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; }
|
|
9
|
-
|
|
10
|
-
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; }
|
|
11
|
-
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import TwoColumnBox from "./TwoColumnBox";
|
|
14
|
-
import InfoBox from "./InfoBox";
|
|
15
|
-
import defaultContentGrid from "./deps/content-grid";
|
|
16
|
-
import BetweenBox from "./BetweenBox";
|
|
17
|
-
import "./index.less";
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
|
|
20
|
-
function Box(_ref) {
|
|
21
|
-
var _ref$className = _ref.className,
|
|
22
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
23
|
-
_ref$contentGrid = _ref.contentGrid,
|
|
24
|
-
contentGrid = _ref$contentGrid === void 0 ? defaultContentGrid : _ref$contentGrid,
|
|
25
|
-
children = _ref.children;
|
|
26
|
-
return /*#__PURE__*/_jsx(_Row, {
|
|
27
|
-
className: "single-column-layout-container ".concat(className),
|
|
28
|
-
children: /*#__PURE__*/_jsx(_Col, _objectSpread(_objectSpread({
|
|
29
|
-
className: "single-column-content"
|
|
30
|
-
}, contentGrid), {}, {
|
|
31
|
-
children: children
|
|
32
|
-
}))
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
Box.TwoColumnBox = TwoColumnBox;
|
|
37
|
-
Box.InfoBox = InfoBox;
|
|
38
|
-
Box.BetweenBox = BetweenBox;
|
|
39
|
-
export default Box;
|
package/es/Box/index.less
DELETED
package/es/Drawer/Demo.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
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
|
-
|
|
6
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
-
|
|
8
|
-
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."); }
|
|
9
|
-
|
|
10
|
-
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); }
|
|
11
|
-
|
|
12
|
-
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; }
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
|
|
18
|
-
import React, { useRef, useState } from 'react';
|
|
19
|
-
import Drawer from "./index";
|
|
20
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
23
|
-
|
|
24
|
-
var App = function App() {
|
|
25
|
-
var drawer = Drawer.useDrawer();
|
|
26
|
-
var ref = useRef();
|
|
27
|
-
|
|
28
|
-
var _useState = useState(false),
|
|
29
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
-
visible = _useState2[0],
|
|
31
|
-
setVisible = _useState2[1];
|
|
32
|
-
|
|
33
|
-
var showDrawer = function showDrawer() {
|
|
34
|
-
setVisible(true);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
var onClose = function onClose() {
|
|
38
|
-
setVisible(false);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return /*#__PURE__*/_jsxs(_ConfigProvider, {
|
|
42
|
-
prefixCls: "cloudapp",
|
|
43
|
-
children: [/*#__PURE__*/_jsxs("div", {
|
|
44
|
-
children: [/*#__PURE__*/_jsx(_Button, {
|
|
45
|
-
type: "primary",
|
|
46
|
-
onClick: showDrawer,
|
|
47
|
-
children: "Open"
|
|
48
|
-
}), /*#__PURE__*/_jsxs(Drawer, {
|
|
49
|
-
title: "Basic Drawer",
|
|
50
|
-
placement: "right",
|
|
51
|
-
onClose: onClose,
|
|
52
|
-
visible: visible,
|
|
53
|
-
onOk: function onOk() {
|
|
54
|
-
alert('确定!');
|
|
55
|
-
onClose();
|
|
56
|
-
},
|
|
57
|
-
children: [/*#__PURE__*/_jsx("p", {
|
|
58
|
-
children: "Some contents..."
|
|
59
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
60
|
-
children: "Some contents..."
|
|
61
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
62
|
-
children: "Some contents..."
|
|
63
|
-
})]
|
|
64
|
-
})]
|
|
65
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
66
|
-
children: /*#__PURE__*/_jsx(_Button, {
|
|
67
|
-
type: "primary",
|
|
68
|
-
onClick: function onClick() {
|
|
69
|
-
return drawer.open({
|
|
70
|
-
content: /*#__PURE__*/_jsxs(_Fragment, {
|
|
71
|
-
children: [/*#__PURE__*/_jsx("p", {
|
|
72
|
-
children: "Some contents..."
|
|
73
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
74
|
-
children: "Some contents..."
|
|
75
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
76
|
-
children: "Some contents..."
|
|
77
|
-
})]
|
|
78
|
-
})
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
children: "useDrawer"
|
|
82
|
-
})
|
|
83
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
84
|
-
children: [/*#__PURE__*/_jsx(_Button, {
|
|
85
|
-
type: "primary",
|
|
86
|
-
onClick: function onClick() {
|
|
87
|
-
var _ref$current;
|
|
88
|
-
|
|
89
|
-
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.open({
|
|
90
|
-
content: /*#__PURE__*/_jsxs(_Fragment, {
|
|
91
|
-
children: [/*#__PURE__*/_jsx("p", {
|
|
92
|
-
children: "Some contents..."
|
|
93
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
94
|
-
children: "Some contents..."
|
|
95
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
96
|
-
children: "Some contents..."
|
|
97
|
-
})]
|
|
98
|
-
})
|
|
99
|
-
});
|
|
100
|
-
},
|
|
101
|
-
children: "RefDrawer"
|
|
102
|
-
}), /*#__PURE__*/_jsx(Drawer.RefDrawer, {
|
|
103
|
-
ref: ref
|
|
104
|
-
})]
|
|
105
|
-
})]
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export default App;
|
package/es/Drawer/Footer.d.ts
DELETED
package/es/Drawer/index.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IDrawerProps } from './interface';
|
|
3
|
-
import './index.less';
|
|
4
|
-
declare function Drawer({ style, getContainer, onClose, className, onOk, cancelText, okText, children, ...props }: IDrawerProps): JSX.Element;
|
|
5
|
-
declare namespace Drawer {
|
|
6
|
-
var defaultProps: {
|
|
7
|
-
getContainer: boolean;
|
|
8
|
-
className: string;
|
|
9
|
-
cancelText: string;
|
|
10
|
-
okText: string;
|
|
11
|
-
};
|
|
12
|
-
var useDrawer: (prefixCls?: string) => {
|
|
13
|
-
open: (options: IUseDrawerHookState) => void;
|
|
14
|
-
close: () => void;
|
|
15
|
-
};
|
|
16
|
-
var RefDrawer: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<IRefDrawerMethodsProps>>;
|
|
17
|
-
}
|
|
18
|
-
export interface IUseDrawerHookState {
|
|
19
|
-
content?: React.ReactNode;
|
|
20
|
-
visible?: boolean;
|
|
21
|
-
title?: React.ReactNode;
|
|
22
|
-
onOk?: () => void;
|
|
23
|
-
width?: number | string;
|
|
24
|
-
className?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface IUseDrawerHookState {
|
|
27
|
-
content?: React.ReactNode;
|
|
28
|
-
visible?: boolean;
|
|
29
|
-
title?: React.ReactNode;
|
|
30
|
-
onOk?: () => void;
|
|
31
|
-
width?: number | string;
|
|
32
|
-
className?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface IRefDrawerMethodsProps {
|
|
35
|
-
open: (options: IUseDrawerHookState) => void;
|
|
36
|
-
close: () => void;
|
|
37
|
-
}
|
|
38
|
-
export default Drawer;
|
package/es/Drawer/index.js
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import "antd/lib/config-provider/style";
|
|
2
|
-
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
|
-
import "antd/lib/drawer/style";
|
|
4
|
-
import _Drawer from "antd/lib/drawer";
|
|
5
|
-
var _excluded = ["style", "getContainer", "onClose", "className", "onOk", "cancelText", "okText", "children"];
|
|
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
|
-
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; }
|
|
20
|
-
|
|
21
|
-
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
|
-
|
|
23
|
-
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; }
|
|
24
|
-
|
|
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, { useContext, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
|
30
|
-
import * as ReactDOMClient from 'react-dom/client';
|
|
31
|
-
import { default as CC, default as ConfigContext } from "../ConfigContext";
|
|
32
|
-
import Footer from "./Footer";
|
|
33
|
-
import "./index.less";
|
|
34
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
35
|
-
|
|
36
|
-
function Drawer(_ref) {
|
|
37
|
-
var style = _ref.style,
|
|
38
|
-
getContainer = _ref.getContainer,
|
|
39
|
-
onClose = _ref.onClose,
|
|
40
|
-
className = _ref.className,
|
|
41
|
-
onOk = _ref.onOk,
|
|
42
|
-
cancelText = _ref.cancelText,
|
|
43
|
-
okText = _ref.okText,
|
|
44
|
-
children = _ref.children,
|
|
45
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
-
|
|
47
|
-
return /*#__PURE__*/_jsx(_Drawer, _objectSpread(_objectSpread({
|
|
48
|
-
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
49
|
-
textAlign: 'left'
|
|
50
|
-
}),
|
|
51
|
-
className: "lm-drawer-container ".concat(className),
|
|
52
|
-
onClose: onClose,
|
|
53
|
-
getContainer: getContainer,
|
|
54
|
-
footer: /*#__PURE__*/_jsx(Footer, {
|
|
55
|
-
onClose: onClose,
|
|
56
|
-
onOk: onOk,
|
|
57
|
-
cancelText: cancelText,
|
|
58
|
-
okText: okText
|
|
59
|
-
})
|
|
60
|
-
}, props), {}, {
|
|
61
|
-
children: children
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
Drawer.defaultProps = {
|
|
66
|
-
getContainer: false,
|
|
67
|
-
className: '',
|
|
68
|
-
cancelText: '取消',
|
|
69
|
-
okText: '确定'
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
function useDrawer() {
|
|
73
|
-
var prefixCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cloudapp';
|
|
74
|
-
var context = useContext(CC.Context);
|
|
75
|
-
var container = useMemo(function () {
|
|
76
|
-
var _context$root;
|
|
77
|
-
|
|
78
|
-
return (_context$root = context === null || context === void 0 ? void 0 : context.root) !== null && _context$root !== void 0 ? _context$root : document.body;
|
|
79
|
-
}, [context === null || context === void 0 ? void 0 : context.root]);
|
|
80
|
-
var div = useMemo(function () {
|
|
81
|
-
return document.createElement('div');
|
|
82
|
-
}, []);
|
|
83
|
-
|
|
84
|
-
var _useState = useState({
|
|
85
|
-
content: null,
|
|
86
|
-
visible: false,
|
|
87
|
-
title: '',
|
|
88
|
-
onOk: undefined,
|
|
89
|
-
width: undefined,
|
|
90
|
-
className: undefined
|
|
91
|
-
}),
|
|
92
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
93
|
-
state = _useState2[0],
|
|
94
|
-
setState = _useState2[1];
|
|
95
|
-
|
|
96
|
-
var root = useMemo(function () {
|
|
97
|
-
return ReactDOMClient.createRoot(div, {
|
|
98
|
-
onRecoverableError: console.error
|
|
99
|
-
});
|
|
100
|
-
}, []);
|
|
101
|
-
|
|
102
|
-
var open = function open(options) {
|
|
103
|
-
setState(function (old) {
|
|
104
|
-
return _objectSpread(_objectSpread(_objectSpread({}, old), options), {}, {
|
|
105
|
-
visible: true
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
var close = function close() {
|
|
111
|
-
setState(function (old) {
|
|
112
|
-
return _objectSpread(_objectSpread({}, old), {}, {
|
|
113
|
-
visible: false
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
useEffect(function () {
|
|
119
|
-
container.appendChild(div);
|
|
120
|
-
return function () {
|
|
121
|
-
setTimeout(function () {
|
|
122
|
-
return root.unmount(), div.remove();
|
|
123
|
-
}, 100);
|
|
124
|
-
};
|
|
125
|
-
}, []);
|
|
126
|
-
useEffect(function () {
|
|
127
|
-
root.render( /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
128
|
-
prefixCls: prefixCls,
|
|
129
|
-
getPopupContainer: function getPopupContainer() {
|
|
130
|
-
return container;
|
|
131
|
-
},
|
|
132
|
-
children: /*#__PURE__*/_jsx(Drawer, {
|
|
133
|
-
visible: state.visible,
|
|
134
|
-
onOk: state.onOk,
|
|
135
|
-
onClose: close,
|
|
136
|
-
destroyOnClose: true,
|
|
137
|
-
title: state.title,
|
|
138
|
-
width: state.width,
|
|
139
|
-
className: state.className,
|
|
140
|
-
getContainer: false,
|
|
141
|
-
children: state.content
|
|
142
|
-
})
|
|
143
|
-
}));
|
|
144
|
-
}, [state.content, state.visible, state.title, state.onOk, state.width, state.className]);
|
|
145
|
-
return {
|
|
146
|
-
open: open,
|
|
147
|
-
close: close
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
var RefDrawer = /*#__PURE__*/React.forwardRef(function RefDrawer(_, ref) {
|
|
152
|
-
var context = useContext(ConfigContext.Context);
|
|
153
|
-
var root = useMemo(function () {
|
|
154
|
-
return (context === null || context === void 0 ? void 0 : context.root) || document.body;
|
|
155
|
-
}, [context === null || context === void 0 ? void 0 : context.root]);
|
|
156
|
-
|
|
157
|
-
var _useState3 = useState({
|
|
158
|
-
content: null,
|
|
159
|
-
visible: false,
|
|
160
|
-
title: '',
|
|
161
|
-
onOk: undefined,
|
|
162
|
-
width: undefined,
|
|
163
|
-
className: undefined
|
|
164
|
-
}),
|
|
165
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
166
|
-
state = _useState4[0],
|
|
167
|
-
setState = _useState4[1];
|
|
168
|
-
|
|
169
|
-
var open = function open(options) {
|
|
170
|
-
setState(function (old) {
|
|
171
|
-
return _objectSpread(_objectSpread(_objectSpread({}, old), options), {}, {
|
|
172
|
-
visible: true
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
var close = function close() {
|
|
178
|
-
setState(function (old) {
|
|
179
|
-
return _objectSpread(_objectSpread({}, old), {}, {
|
|
180
|
-
visible: false
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
useImperativeHandle(ref, function () {
|
|
186
|
-
return {
|
|
187
|
-
open: open,
|
|
188
|
-
close: close
|
|
189
|
-
};
|
|
190
|
-
}, [state]);
|
|
191
|
-
return /*#__PURE__*/_jsx(Drawer, {
|
|
192
|
-
visible: state.visible,
|
|
193
|
-
onOk: state.onOk,
|
|
194
|
-
onClose: close,
|
|
195
|
-
destroyOnClose: true,
|
|
196
|
-
title: state.title,
|
|
197
|
-
width: state.width,
|
|
198
|
-
className: state.className,
|
|
199
|
-
getContainer: function getContainer() {
|
|
200
|
-
return root;
|
|
201
|
-
},
|
|
202
|
-
children: state.content
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
Drawer.useDrawer = useDrawer;
|
|
206
|
-
Drawer.RefDrawer = RefDrawer;
|
|
207
|
-
export default Drawer;
|
package/es/Drawer/index.less
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
.lm-drawer-container.@{ant-prefix}-drawer {
|
|
2
|
-
.@{ant-prefix}-drawer-wrapper-body {
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
height: 100%;
|
|
6
|
-
}
|
|
7
|
-
.@{ant-prefix}-drawer-header {
|
|
8
|
-
position: relative;
|
|
9
|
-
display: flex;
|
|
10
|
-
height: var(--drawer-title-height);
|
|
11
|
-
padding: 0 24px;
|
|
12
|
-
color: inherit;
|
|
13
|
-
background-color: var(--drawer-title-bg);
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
align-items: center;
|
|
16
|
-
border-bottom-color: var(--drawer-divider-color);
|
|
17
|
-
.@{ant-prefix}-drawer-title {
|
|
18
|
-
font-size: var(--fs-large);
|
|
19
|
-
line-height: 2em;
|
|
20
|
-
color: inherit;
|
|
21
|
-
}
|
|
22
|
-
.@{ant-prefix}-drawer-close {
|
|
23
|
-
position: absolute;
|
|
24
|
-
right: 0;
|
|
25
|
-
padding: 0;
|
|
26
|
-
color: inherit;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
.@{ant-prefix}-drawer-body {
|
|
30
|
-
overflow: auto;
|
|
31
|
-
background: var(--drawer-content-bg);
|
|
32
|
-
flex: 1;
|
|
33
|
-
}
|
|
34
|
-
.@{ant-prefix}-drawer-footer {
|
|
35
|
-
height: var(--drawer-footer-height);
|
|
36
|
-
padding: 0 24px;
|
|
37
|
-
overflow: hidden;
|
|
38
|
-
line-height: var(--drawer-footer-height);
|
|
39
|
-
background: var(--drawer-footer-bg);
|
|
40
|
-
border-top-color: var(--drawer-divider-color);
|
|
41
|
-
}
|
|
42
|
-
}
|