first commit
This commit is contained in:
9
frontend/node_modules/rc-dialog/LICENSE.md
generated
vendored
Normal file
9
frontend/node_modules/rc-dialog/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-present yiminghe
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
108
frontend/node_modules/rc-dialog/README.md
generated
vendored
Normal file
108
frontend/node_modules/rc-dialog/README.md
generated
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
# rc-dialog
|
||||
|
||||
react dialog component
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url] [![bundle size][bundlephobia-image]][bundlephobia-url]
|
||||
|
||||
[npm-image]: http://img.shields.io/npm/v/rc-dialog.svg?style=flat-square
|
||||
[npm-url]: http://npmjs.org/package/rc-dialog
|
||||
[github-actions-image]: https://github.com/react-component/dialog/workflows/CI/badge.svg
|
||||
[github-actions-url]: https://github.com/react-component/dialog/actions
|
||||
[circleci-image]: https://img.shields.io/circleci/react-component/dialog/master?style=flat-square
|
||||
[circleci-url]: https://circleci.com/gh/react-component/dialog
|
||||
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/dialog/master.svg?style=flat-square
|
||||
[codecov-url]: https://app.codecov.io/gh/react-component/dialog
|
||||
[download-image]: https://img.shields.io/npm/dm/rc-dialog.svg?style=flat-square
|
||||
[download-url]: https://npmjs.org/package/rc-dialog
|
||||
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-dialog
|
||||
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-dialog
|
||||
|
||||
## Screenshot
|
||||
|
||||
<img src="http://gtms04.alicdn.com/tps/i4/TB1dp5lHXXXXXbmXpXXyVug.FXX-664-480.png" />
|
||||
|
||||
## Example
|
||||
|
||||
http://localhost:8007/examples/
|
||||
|
||||
online example: https://dialog.react-component.vercel.app/
|
||||
|
||||
## Install
|
||||
|
||||
[](https://npmjs.org/package/rc-dialog)
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var Dialog = require('rc-dialog');
|
||||
|
||||
ReactDOM.render(
|
||||
<Dialog title={title} onClose={callback1} visible>
|
||||
<p>first dialog</p>
|
||||
</Dialog>
|
||||
), document.getElementById('t1'));
|
||||
|
||||
// use dialog
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### rc-dialog
|
||||
|
||||
| Name | Type | Default | Description | Version |
|
||||
| ---------------------- | ------------------------------ | --------- | ------------------------------------------------------------------------------- | ------- |
|
||||
| prefixCls | String | rc-dialog | The dialog dom node's prefixCls | |
|
||||
| className | String | | additional className for dialog | |
|
||||
| classNames | { header?: string; body?: string; footer?: string; mask?: string; content?: string; wrapper?: string; } | | pass className to target area | |
|
||||
| styles | { header?: CSSProperties; body?: CSSProperties; footer?: CSSProperties; mask?: CSSProperties; content?: CSSProperties; wrapper?: CSSProperties; } | | pass styles to target area | |
|
||||
| style | Object | {} | Root style for dialog element.Such as width, height | |
|
||||
| zIndex | Number | | | |
|
||||
| visible | Boolean | false | current dialog's visible status | |
|
||||
| animation | String | | part of dialog animation css class name | |
|
||||
| maskAnimation | String | | part of dialog's mask animation css class name | |
|
||||
| transitionName | String | | dialog animation css class name | |
|
||||
| maskTransitionName | String | | mask animation css class name | |
|
||||
| title | String\|React.Element | | Title of the dialog | |
|
||||
| footer | React.Element | | footer of the dialog | |
|
||||
| closable | Boolean \| ({ closeIcon?: React.ReactNode; disabled?: boolean } & React.AriaAttributes | true | whether show close button | |
|
||||
| mask | Boolean | true | whether show mask | |
|
||||
| maskClosable | Boolean | true | whether click mask to close | |
|
||||
| keyboard | Boolean | true | whether support press esc to close | |
|
||||
| mousePosition | {x:number,y:number} | | set pageX and pageY of current mouse(it will cause transform origin to be set). | |
|
||||
| onClose | function() | | called when click close button or mask | |
|
||||
| afterClose | function() | | called when close animation end | |
|
||||
| getContainer | function(): HTMLElement | | to determine where Dialog will be mounted | |
|
||||
| destroyOnClose | Boolean | false | to unmount child compenents on onClose | |
|
||||
| closeIcon | ReactNode | | specific the close icon. | |
|
||||
| forceRender | Boolean | false | Create dialog dom node before dialog first show | |
|
||||
| focusTriggerAfterClose | Boolean | true | focus trigger element when dialog closed | |
|
||||
| modalRender | (node: ReactNode) => ReactNode | | Custom modal content render | 8.3.0 |
|
||||
|
||||
## Development
|
||||
|
||||
```
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Test Case
|
||||
|
||||
```
|
||||
npm test
|
||||
npm run chrome-test
|
||||
```
|
||||
|
||||
## Coverage
|
||||
|
||||
```
|
||||
npm run coverage
|
||||
```
|
||||
|
||||
open coverage/ dir
|
||||
|
||||
|
||||
## License
|
||||
|
||||
rc-dialog is released under the MIT license.
|
||||
177
frontend/node_modules/rc-dialog/assets/bootstrap.css
generated
vendored
Normal file
177
frontend/node_modules/rc-dialog/assets/bootstrap.css
generated
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
.rc-dialog {
|
||||
position: relative;
|
||||
width: auto;
|
||||
margin: 10px;
|
||||
}
|
||||
.rc-dialog-wrap {
|
||||
position: fixed;
|
||||
overflow: auto;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1050;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
outline: 0;
|
||||
}
|
||||
.rc-dialog-content {
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
border: 1px solid #999;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
|
||||
background-clip: padding-box;
|
||||
outline: 0;
|
||||
}
|
||||
.rc-dialog-header {
|
||||
padding: 15px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
.rc-dialog-close {
|
||||
cursor: pointer;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
font-size: 21px;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 12px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
color: #000;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
filter: alpha(opacity=20);
|
||||
opacity: 0.2;
|
||||
text-decoration: none;
|
||||
}
|
||||
.rc-dialog-close-x:after {
|
||||
content: '×';
|
||||
}
|
||||
.rc-dialog-close:hover {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
text-decoration: none;
|
||||
}
|
||||
.rc-dialog-title {
|
||||
margin: 0;
|
||||
line-height: 1.42857143;
|
||||
}
|
||||
.rc-dialog-body {
|
||||
position: relative;
|
||||
padding: 15px;
|
||||
}
|
||||
.rc-dialog-footer {
|
||||
padding: 15px;
|
||||
text-align: right;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
.rc-dialog-footer .btn + .btn {
|
||||
margin-left: 5px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.rc-dialog-footer .btn-group .btn + .btn {
|
||||
margin-left: -1px;
|
||||
}
|
||||
.rc-dialog-footer .btn-block + .btn-block {
|
||||
margin-left: 0;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.rc-dialog {
|
||||
width: 600px;
|
||||
margin: 30px auto;
|
||||
}
|
||||
.rc-dialog-content {
|
||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
.rc-dialog-slide-fade-enter,
|
||||
.rc-dialog-slide-fade-appear {
|
||||
transform: translate(0, -25%);
|
||||
}
|
||||
.rc-dialog-slide-fade-enter,
|
||||
.rc-dialog-slide-fade-appear,
|
||||
.rc-dialog-slide-fade-leave {
|
||||
animation-duration: 0.3s;
|
||||
animation-fill-mode: both;
|
||||
animation-timing-function: ease-out;
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.rc-dialog-slide-fade-enter.rc-dialog-slide-fade-enter-active,
|
||||
.rc-dialog-slide-fade-appear.rc-dialog-slide-fade-appear-active {
|
||||
animation-name: rcDialogSlideFadeIn;
|
||||
animation-play-state: running;
|
||||
}
|
||||
.rc-dialog-slide-fade-leave.rc-dialog-slide-fade-leave-active {
|
||||
animation-name: rcDialogSlideFadeOut;
|
||||
animation-play-state: running;
|
||||
}
|
||||
@keyframes rcDialogSlideFadeIn {
|
||||
0% {
|
||||
transform: translate(0, -25%);
|
||||
}
|
||||
100% {
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
}
|
||||
@keyframes rcDialogSlideFadeOut {
|
||||
0% {
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
100% {
|
||||
transform: translate(0, -25%);
|
||||
}
|
||||
}
|
||||
.rc-dialog-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background-color: #373737;
|
||||
background-color: rgba(55, 55, 55, 0.6);
|
||||
height: 100%;
|
||||
filter: alpha(opacity=50);
|
||||
z-index: 1050;
|
||||
}
|
||||
.rc-dialog-mask-hidden {
|
||||
display: none;
|
||||
}
|
||||
.rc-dialog-fade-enter,
|
||||
.rc-dialog-fade-appear {
|
||||
opacity: 0;
|
||||
animation-duration: 0.3s;
|
||||
animation-fill-mode: both;
|
||||
animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.rc-dialog-fade-leave {
|
||||
animation-duration: 0.3s;
|
||||
animation-fill-mode: both;
|
||||
animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.rc-dialog-fade-enter.rc-dialog-fade-enter-active,
|
||||
.rc-dialog-fade-appear.rc-dialog-fade-appear-active {
|
||||
animation-name: rcDialogFadeIn;
|
||||
animation-play-state: running;
|
||||
}
|
||||
.rc-dialog-fade-leave.rc-dialog-fade-leave-active {
|
||||
animation-name: rcDialogFadeOut;
|
||||
animation-play-state: running;
|
||||
}
|
||||
@keyframes rcDialogFadeIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes rcDialogFadeOut {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
174
frontend/node_modules/rc-dialog/assets/index.css
generated
vendored
Normal file
174
frontend/node_modules/rc-dialog/assets/index.css
generated
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
.rc-dialog {
|
||||
position: relative;
|
||||
width: auto;
|
||||
margin: 10px;
|
||||
}
|
||||
.rc-dialog-wrap {
|
||||
position: fixed;
|
||||
overflow: auto;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1050;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
outline: 0;
|
||||
}
|
||||
.rc-dialog-title {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
line-height: 21px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.rc-dialog-content {
|
||||
position: relative;
|
||||
background-color: #ffffff;
|
||||
border: none;
|
||||
border-radius: 6px 6px;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
.rc-dialog-close {
|
||||
cursor: pointer;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
font-size: 21px;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 12px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
color: #000;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
filter: alpha(opacity=20);
|
||||
opacity: 0.2;
|
||||
text-decoration: none;
|
||||
}
|
||||
.rc-dialog-close:disabled {
|
||||
pointer-events: none;
|
||||
}
|
||||
.rc-dialog-close-x:after {
|
||||
content: '×';
|
||||
}
|
||||
.rc-dialog-close:hover {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
text-decoration: none;
|
||||
}
|
||||
.rc-dialog-header {
|
||||
padding: 13px 20px 14px 20px;
|
||||
border-radius: 5px 5px 0 0;
|
||||
background: #fff;
|
||||
color: #666;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.rc-dialog-body {
|
||||
padding: 20px;
|
||||
}
|
||||
.rc-dialog-footer {
|
||||
border-top: 1px solid #e9e9e9;
|
||||
padding: 10px 20px;
|
||||
text-align: right;
|
||||
border-radius: 0 0 5px 5px;
|
||||
}
|
||||
.rc-dialog-zoom-enter,
|
||||
.rc-dialog-zoom-appear {
|
||||
opacity: 0;
|
||||
animation-duration: 0.3s;
|
||||
animation-fill-mode: both;
|
||||
animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.rc-dialog-zoom-leave {
|
||||
animation-duration: 0.3s;
|
||||
animation-fill-mode: both;
|
||||
animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.rc-dialog-zoom-enter.rc-dialog-zoom-enter-active,
|
||||
.rc-dialog-zoom-appear.rc-dialog-zoom-appear-active {
|
||||
animation-name: rcDialogZoomIn;
|
||||
animation-play-state: running;
|
||||
}
|
||||
.rc-dialog-zoom-leave.rc-dialog-zoom-leave-active {
|
||||
animation-name: rcDialogZoomOut;
|
||||
animation-play-state: running;
|
||||
}
|
||||
@keyframes rcDialogZoomIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: scale(0, 0);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
}
|
||||
@keyframes rcDialogZoomOut {
|
||||
0% {
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: scale(0, 0);
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.rc-dialog {
|
||||
width: 600px;
|
||||
margin: 30px auto;
|
||||
}
|
||||
}
|
||||
.rc-dialog-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background-color: #373737;
|
||||
background-color: rgba(55, 55, 55, 0.6);
|
||||
height: 100%;
|
||||
filter: alpha(opacity=50);
|
||||
z-index: 1050;
|
||||
}
|
||||
.rc-dialog-mask-hidden {
|
||||
display: none;
|
||||
}
|
||||
.rc-dialog-fade-enter,
|
||||
.rc-dialog-fade-appear {
|
||||
opacity: 0;
|
||||
animation-duration: 0.3s;
|
||||
animation-fill-mode: both;
|
||||
animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.rc-dialog-fade-leave {
|
||||
animation-duration: 0.3s;
|
||||
animation-fill-mode: both;
|
||||
animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.rc-dialog-fade-enter.rc-dialog-fade-enter-active,
|
||||
.rc-dialog-fade-appear.rc-dialog-fade-appear-active {
|
||||
animation-name: rcDialogFadeIn;
|
||||
animation-play-state: running;
|
||||
}
|
||||
.rc-dialog-fade-leave.rc-dialog-fade-leave-active {
|
||||
animation-name: rcDialogFadeOut;
|
||||
animation-play-state: running;
|
||||
}
|
||||
@keyframes rcDialogFadeIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes rcDialogFadeOut {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
7
frontend/node_modules/rc-dialog/es/Dialog/Content/MemoChildren.d.ts
generated
vendored
Normal file
7
frontend/node_modules/rc-dialog/es/Dialog/Content/MemoChildren.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as React from 'react';
|
||||
export type MemoChildrenProps = {
|
||||
shouldUpdate: boolean;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
declare const _default: React.MemoExoticComponent<({ children }: MemoChildrenProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>>;
|
||||
export default _default;
|
||||
8
frontend/node_modules/rc-dialog/es/Dialog/Content/MemoChildren.js
generated
vendored
Normal file
8
frontend/node_modules/rc-dialog/es/Dialog/Content/MemoChildren.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import * as React from 'react';
|
||||
export default /*#__PURE__*/React.memo(function (_ref) {
|
||||
var children = _ref.children;
|
||||
return children;
|
||||
}, function (_, _ref2) {
|
||||
var shouldUpdate = _ref2.shouldUpdate;
|
||||
return !shouldUpdate;
|
||||
});
|
||||
15
frontend/node_modules/rc-dialog/es/Dialog/Content/Panel.d.ts
generated
vendored
Normal file
15
frontend/node_modules/rc-dialog/es/Dialog/Content/Panel.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import type { IDialogPropTypes } from '../../IDialogPropTypes';
|
||||
export interface PanelProps extends Omit<IDialogPropTypes, 'getOpenCount'> {
|
||||
prefixCls: string;
|
||||
ariaId?: string;
|
||||
onMouseDown?: React.MouseEventHandler;
|
||||
onMouseUp?: React.MouseEventHandler;
|
||||
holderRef?: React.Ref<HTMLDivElement>;
|
||||
}
|
||||
export type ContentRef = {
|
||||
focus: () => void;
|
||||
changeActive: (next: boolean) => void;
|
||||
};
|
||||
declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<ContentRef>>;
|
||||
export default Panel;
|
||||
148
frontend/node_modules/rc-dialog/es/Dialog/Content/Panel.js
generated
vendored
Normal file
148
frontend/node_modules/rc-dialog/es/Dialog/Content/Panel.js
generated
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
||||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
||||
import classNames from 'classnames';
|
||||
import { useComposeRef } from "rc-util/es/ref";
|
||||
import React, { useMemo, useRef } from 'react';
|
||||
import { RefContext } from "../../context";
|
||||
import MemoChildren from "./MemoChildren";
|
||||
import pickAttrs from "rc-util/es/pickAttrs";
|
||||
var sentinelStyle = {
|
||||
width: 0,
|
||||
height: 0,
|
||||
overflow: 'hidden',
|
||||
outline: 'none'
|
||||
};
|
||||
var entityStyle = {
|
||||
outline: 'none'
|
||||
};
|
||||
var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
||||
var prefixCls = props.prefixCls,
|
||||
className = props.className,
|
||||
style = props.style,
|
||||
title = props.title,
|
||||
ariaId = props.ariaId,
|
||||
footer = props.footer,
|
||||
closable = props.closable,
|
||||
closeIcon = props.closeIcon,
|
||||
onClose = props.onClose,
|
||||
children = props.children,
|
||||
bodyStyle = props.bodyStyle,
|
||||
bodyProps = props.bodyProps,
|
||||
modalRender = props.modalRender,
|
||||
onMouseDown = props.onMouseDown,
|
||||
onMouseUp = props.onMouseUp,
|
||||
holderRef = props.holderRef,
|
||||
visible = props.visible,
|
||||
forceRender = props.forceRender,
|
||||
width = props.width,
|
||||
height = props.height,
|
||||
modalClassNames = props.classNames,
|
||||
modalStyles = props.styles;
|
||||
|
||||
// ================================= Refs =================================
|
||||
var _React$useContext = React.useContext(RefContext),
|
||||
panelRef = _React$useContext.panel;
|
||||
var mergedRef = useComposeRef(holderRef, panelRef);
|
||||
var sentinelStartRef = useRef();
|
||||
var sentinelEndRef = useRef();
|
||||
React.useImperativeHandle(ref, function () {
|
||||
return {
|
||||
focus: function focus() {
|
||||
var _sentinelStartRef$cur;
|
||||
(_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 || _sentinelStartRef$cur.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
},
|
||||
changeActive: function changeActive(next) {
|
||||
var _document = document,
|
||||
activeElement = _document.activeElement;
|
||||
if (next && activeElement === sentinelEndRef.current) {
|
||||
sentinelStartRef.current.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
} else if (!next && activeElement === sentinelStartRef.current) {
|
||||
sentinelEndRef.current.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// ================================ Style =================================
|
||||
var contentStyle = {};
|
||||
if (width !== undefined) {
|
||||
contentStyle.width = width;
|
||||
}
|
||||
if (height !== undefined) {
|
||||
contentStyle.height = height;
|
||||
}
|
||||
// ================================ Render ================================
|
||||
var footerNode = footer ? /*#__PURE__*/React.createElement("div", {
|
||||
className: classNames("".concat(prefixCls, "-footer"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.footer),
|
||||
style: _objectSpread({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.footer)
|
||||
}, footer) : null;
|
||||
var headerNode = title ? /*#__PURE__*/React.createElement("div", {
|
||||
className: classNames("".concat(prefixCls, "-header"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.header),
|
||||
style: _objectSpread({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.header)
|
||||
}, /*#__PURE__*/React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-title"),
|
||||
id: ariaId
|
||||
}, title)) : null;
|
||||
var closableObj = useMemo(function () {
|
||||
if (_typeof(closable) === 'object' && closable !== null) {
|
||||
return closable;
|
||||
}
|
||||
if (closable) {
|
||||
return {
|
||||
closeIcon: closeIcon !== null && closeIcon !== void 0 ? closeIcon : /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-close-x")
|
||||
})
|
||||
};
|
||||
}
|
||||
return {};
|
||||
}, [closable, closeIcon, prefixCls]);
|
||||
var ariaProps = pickAttrs(closableObj, true);
|
||||
var closeBtnIsDisabled = _typeof(closable) === 'object' && closable.disabled;
|
||||
var closerNode = closable ? /*#__PURE__*/React.createElement("button", _extends({
|
||||
type: "button",
|
||||
onClick: onClose,
|
||||
"aria-label": "Close"
|
||||
}, ariaProps, {
|
||||
className: "".concat(prefixCls, "-close"),
|
||||
disabled: closeBtnIsDisabled
|
||||
}), closableObj.closeIcon) : null;
|
||||
var content = /*#__PURE__*/React.createElement("div", {
|
||||
className: classNames("".concat(prefixCls, "-content"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.content),
|
||||
style: modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.content
|
||||
}, closerNode, headerNode, /*#__PURE__*/React.createElement("div", _extends({
|
||||
className: classNames("".concat(prefixCls, "-body"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.body),
|
||||
style: _objectSpread(_objectSpread({}, bodyStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.body)
|
||||
}, bodyProps), children), footerNode);
|
||||
return /*#__PURE__*/React.createElement("div", {
|
||||
key: "dialog-element",
|
||||
role: "dialog",
|
||||
"aria-labelledby": title ? ariaId : null,
|
||||
"aria-modal": "true",
|
||||
ref: mergedRef,
|
||||
style: _objectSpread(_objectSpread({}, style), contentStyle),
|
||||
className: classNames(prefixCls, className),
|
||||
onMouseDown: onMouseDown,
|
||||
onMouseUp: onMouseUp
|
||||
}, /*#__PURE__*/React.createElement("div", {
|
||||
ref: sentinelStartRef,
|
||||
tabIndex: 0,
|
||||
style: entityStyle
|
||||
}, /*#__PURE__*/React.createElement(MemoChildren, {
|
||||
shouldUpdate: visible || forceRender
|
||||
}, modalRender ? modalRender(content) : content)), /*#__PURE__*/React.createElement("div", {
|
||||
tabIndex: 0,
|
||||
ref: sentinelEndRef,
|
||||
style: sentinelStyle
|
||||
}));
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Panel.displayName = 'Panel';
|
||||
}
|
||||
export default Panel;
|
||||
13
frontend/node_modules/rc-dialog/es/Dialog/Content/index.d.ts
generated
vendored
Normal file
13
frontend/node_modules/rc-dialog/es/Dialog/Content/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as React from 'react';
|
||||
import type { PanelProps, ContentRef } from './Panel';
|
||||
export type ContentProps = {
|
||||
motionName: string;
|
||||
ariaId: string;
|
||||
onVisibleChanged: (visible: boolean) => void;
|
||||
} & PanelProps;
|
||||
declare const Content: React.ForwardRefExoticComponent<{
|
||||
motionName: string;
|
||||
ariaId: string;
|
||||
onVisibleChanged: (visible: boolean) => void;
|
||||
} & PanelProps & React.RefAttributes<ContentRef>>;
|
||||
export default Content;
|
||||
63
frontend/node_modules/rc-dialog/es/Dialog/Content/index.js
generated
vendored
Normal file
63
frontend/node_modules/rc-dialog/es/Dialog/Content/index.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
||||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
||||
import * as React from 'react';
|
||||
import { useRef } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import CSSMotion from 'rc-motion';
|
||||
import { offset } from "../../util";
|
||||
import Panel from "./Panel";
|
||||
var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
||||
var prefixCls = props.prefixCls,
|
||||
title = props.title,
|
||||
style = props.style,
|
||||
className = props.className,
|
||||
visible = props.visible,
|
||||
forceRender = props.forceRender,
|
||||
destroyOnClose = props.destroyOnClose,
|
||||
motionName = props.motionName,
|
||||
ariaId = props.ariaId,
|
||||
onVisibleChanged = props.onVisibleChanged,
|
||||
mousePosition = props.mousePosition;
|
||||
var dialogRef = useRef();
|
||||
|
||||
// ============================= Style ==============================
|
||||
var _React$useState = React.useState(),
|
||||
_React$useState2 = _slicedToArray(_React$useState, 2),
|
||||
transformOrigin = _React$useState2[0],
|
||||
setTransformOrigin = _React$useState2[1];
|
||||
var contentStyle = {};
|
||||
if (transformOrigin) {
|
||||
contentStyle.transformOrigin = transformOrigin;
|
||||
}
|
||||
function onPrepare() {
|
||||
var elementOffset = offset(dialogRef.current);
|
||||
setTransformOrigin(mousePosition && (mousePosition.x || mousePosition.y) ? "".concat(mousePosition.x - elementOffset.left, "px ").concat(mousePosition.y - elementOffset.top, "px") : '');
|
||||
}
|
||||
|
||||
// ============================= Render =============================
|
||||
return /*#__PURE__*/React.createElement(CSSMotion, {
|
||||
visible: visible,
|
||||
onVisibleChanged: onVisibleChanged,
|
||||
onAppearPrepare: onPrepare,
|
||||
onEnterPrepare: onPrepare,
|
||||
forceRender: forceRender,
|
||||
motionName: motionName,
|
||||
removeOnLeave: destroyOnClose,
|
||||
ref: dialogRef
|
||||
}, function (_ref, motionRef) {
|
||||
var motionClassName = _ref.className,
|
||||
motionStyle = _ref.style;
|
||||
return /*#__PURE__*/React.createElement(Panel, _extends({}, props, {
|
||||
ref: ref,
|
||||
title: title,
|
||||
ariaId: ariaId,
|
||||
prefixCls: prefixCls,
|
||||
holderRef: motionRef,
|
||||
style: _objectSpread(_objectSpread(_objectSpread({}, motionStyle), style), contentStyle),
|
||||
className: classNames(className, motionClassName)
|
||||
}));
|
||||
});
|
||||
});
|
||||
Content.displayName = 'Content';
|
||||
export default Content;
|
||||
11
frontend/node_modules/rc-dialog/es/Dialog/Mask.d.ts
generated
vendored
Normal file
11
frontend/node_modules/rc-dialog/es/Dialog/Mask.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as React from 'react';
|
||||
export type MaskProps = {
|
||||
prefixCls: string;
|
||||
visible: boolean;
|
||||
motionName?: string;
|
||||
style?: React.CSSProperties;
|
||||
maskProps?: React.HTMLAttributes<HTMLDivElement>;
|
||||
className?: string;
|
||||
};
|
||||
declare const Mask: React.FC<MaskProps>;
|
||||
export default Mask;
|
||||
28
frontend/node_modules/rc-dialog/es/Dialog/Mask.js
generated
vendored
Normal file
28
frontend/node_modules/rc-dialog/es/Dialog/Mask.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import CSSMotion from 'rc-motion';
|
||||
var Mask = function Mask(props) {
|
||||
var prefixCls = props.prefixCls,
|
||||
style = props.style,
|
||||
visible = props.visible,
|
||||
maskProps = props.maskProps,
|
||||
motionName = props.motionName,
|
||||
className = props.className;
|
||||
return /*#__PURE__*/React.createElement(CSSMotion, {
|
||||
key: "mask",
|
||||
visible: visible,
|
||||
motionName: motionName,
|
||||
leavedClassName: "".concat(prefixCls, "-mask-hidden")
|
||||
}, function (_ref, ref) {
|
||||
var motionClassName = _ref.className,
|
||||
motionStyle = _ref.style;
|
||||
return /*#__PURE__*/React.createElement("div", _extends({
|
||||
ref: ref,
|
||||
style: _objectSpread(_objectSpread({}, motionStyle), style),
|
||||
className: classNames("".concat(prefixCls, "-mask"), motionClassName, className)
|
||||
}, maskProps));
|
||||
});
|
||||
};
|
||||
export default Mask;
|
||||
4
frontend/node_modules/rc-dialog/es/Dialog/index.d.ts
generated
vendored
Normal file
4
frontend/node_modules/rc-dialog/es/Dialog/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import type { IDialogPropTypes } from '../IDialogPropTypes';
|
||||
declare const Dialog: React.FC<IDialogPropTypes>;
|
||||
export default Dialog;
|
||||
201
frontend/node_modules/rc-dialog/es/Dialog/index.js
generated
vendored
Normal file
201
frontend/node_modules/rc-dialog/es/Dialog/index.js
generated
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
||||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
||||
import classNames from 'classnames';
|
||||
import contains from "rc-util/es/Dom/contains";
|
||||
import useId from "rc-util/es/hooks/useId";
|
||||
import KeyCode from "rc-util/es/KeyCode";
|
||||
import pickAttrs from "rc-util/es/pickAttrs";
|
||||
import * as React from 'react';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { getMotionName } from "../util";
|
||||
import Content from "./Content";
|
||||
import Mask from "./Mask";
|
||||
import { warning } from "rc-util/es/warning";
|
||||
var Dialog = function Dialog(props) {
|
||||
var _props$prefixCls = props.prefixCls,
|
||||
prefixCls = _props$prefixCls === void 0 ? 'rc-dialog' : _props$prefixCls,
|
||||
zIndex = props.zIndex,
|
||||
_props$visible = props.visible,
|
||||
visible = _props$visible === void 0 ? false : _props$visible,
|
||||
_props$keyboard = props.keyboard,
|
||||
keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
|
||||
_props$focusTriggerAf = props.focusTriggerAfterClose,
|
||||
focusTriggerAfterClose = _props$focusTriggerAf === void 0 ? true : _props$focusTriggerAf,
|
||||
wrapStyle = props.wrapStyle,
|
||||
wrapClassName = props.wrapClassName,
|
||||
wrapProps = props.wrapProps,
|
||||
onClose = props.onClose,
|
||||
afterOpenChange = props.afterOpenChange,
|
||||
afterClose = props.afterClose,
|
||||
transitionName = props.transitionName,
|
||||
animation = props.animation,
|
||||
_props$closable = props.closable,
|
||||
closable = _props$closable === void 0 ? true : _props$closable,
|
||||
_props$mask = props.mask,
|
||||
mask = _props$mask === void 0 ? true : _props$mask,
|
||||
maskTransitionName = props.maskTransitionName,
|
||||
maskAnimation = props.maskAnimation,
|
||||
_props$maskClosable = props.maskClosable,
|
||||
maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
|
||||
maskStyle = props.maskStyle,
|
||||
maskProps = props.maskProps,
|
||||
rootClassName = props.rootClassName,
|
||||
modalClassNames = props.classNames,
|
||||
modalStyles = props.styles;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
['wrapStyle', 'bodyStyle', 'maskStyle'].forEach(function (prop) {
|
||||
// (prop in props) && console.error(`Warning: ${prop} is deprecated, please use styles instead.`)
|
||||
warning(!(prop in props), "".concat(prop, " is deprecated, please use styles instead."));
|
||||
});
|
||||
if ('wrapClassName' in props) {
|
||||
warning(false, "wrapClassName is deprecated, please use classNames instead.");
|
||||
}
|
||||
}
|
||||
var lastOutSideActiveElementRef = useRef();
|
||||
var wrapperRef = useRef();
|
||||
var contentRef = useRef();
|
||||
var _React$useState = React.useState(visible),
|
||||
_React$useState2 = _slicedToArray(_React$useState, 2),
|
||||
animatedVisible = _React$useState2[0],
|
||||
setAnimatedVisible = _React$useState2[1];
|
||||
|
||||
// ========================== Init ==========================
|
||||
var ariaId = useId();
|
||||
function saveLastOutSideActiveElementRef() {
|
||||
if (!contains(wrapperRef.current, document.activeElement)) {
|
||||
lastOutSideActiveElementRef.current = document.activeElement;
|
||||
}
|
||||
}
|
||||
function focusDialogContent() {
|
||||
if (!contains(wrapperRef.current, document.activeElement)) {
|
||||
var _contentRef$current;
|
||||
(_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.focus();
|
||||
}
|
||||
}
|
||||
|
||||
// ========================= Events =========================
|
||||
function onDialogVisibleChanged(newVisible) {
|
||||
// Try to focus
|
||||
if (newVisible) {
|
||||
focusDialogContent();
|
||||
} else {
|
||||
// Clean up scroll bar & focus back
|
||||
setAnimatedVisible(false);
|
||||
if (mask && lastOutSideActiveElementRef.current && focusTriggerAfterClose) {
|
||||
try {
|
||||
lastOutSideActiveElementRef.current.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
} catch (e) {
|
||||
// Do nothing
|
||||
}
|
||||
lastOutSideActiveElementRef.current = null;
|
||||
}
|
||||
|
||||
// Trigger afterClose only when change visible from true to false
|
||||
if (animatedVisible) {
|
||||
afterClose === null || afterClose === void 0 || afterClose();
|
||||
}
|
||||
}
|
||||
afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(newVisible);
|
||||
}
|
||||
function onInternalClose(e) {
|
||||
onClose === null || onClose === void 0 || onClose(e);
|
||||
}
|
||||
|
||||
// >>> Content
|
||||
var contentClickRef = useRef(false);
|
||||
var contentTimeoutRef = useRef();
|
||||
|
||||
// We need record content click incase content popup out of dialog
|
||||
var onContentMouseDown = function onContentMouseDown() {
|
||||
clearTimeout(contentTimeoutRef.current);
|
||||
contentClickRef.current = true;
|
||||
};
|
||||
var onContentMouseUp = function onContentMouseUp() {
|
||||
contentTimeoutRef.current = setTimeout(function () {
|
||||
contentClickRef.current = false;
|
||||
});
|
||||
};
|
||||
|
||||
// >>> Wrapper
|
||||
// Close only when element not on dialog
|
||||
var onWrapperClick = null;
|
||||
if (maskClosable) {
|
||||
onWrapperClick = function onWrapperClick(e) {
|
||||
if (contentClickRef.current) {
|
||||
contentClickRef.current = false;
|
||||
} else if (wrapperRef.current === e.target) {
|
||||
onInternalClose(e);
|
||||
}
|
||||
};
|
||||
}
|
||||
function onWrapperKeyDown(e) {
|
||||
if (keyboard && e.keyCode === KeyCode.ESC) {
|
||||
e.stopPropagation();
|
||||
onInternalClose(e);
|
||||
return;
|
||||
}
|
||||
|
||||
// keep focus inside dialog
|
||||
if (visible && e.keyCode === KeyCode.TAB) {
|
||||
contentRef.current.changeActive(!e.shiftKey);
|
||||
}
|
||||
}
|
||||
|
||||
// ========================= Effect =========================
|
||||
useEffect(function () {
|
||||
if (visible) {
|
||||
setAnimatedVisible(true);
|
||||
saveLastOutSideActiveElementRef();
|
||||
}
|
||||
}, [visible]);
|
||||
|
||||
// Remove direct should also check the scroll bar update
|
||||
useEffect(function () {
|
||||
return function () {
|
||||
clearTimeout(contentTimeoutRef.current);
|
||||
};
|
||||
}, []);
|
||||
var mergedStyle = _objectSpread(_objectSpread(_objectSpread({
|
||||
zIndex: zIndex
|
||||
}, wrapStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.wrapper), {}, {
|
||||
display: !animatedVisible ? 'none' : null
|
||||
});
|
||||
|
||||
// ========================= Render =========================
|
||||
return /*#__PURE__*/React.createElement("div", _extends({
|
||||
className: classNames("".concat(prefixCls, "-root"), rootClassName)
|
||||
}, pickAttrs(props, {
|
||||
data: true
|
||||
})), /*#__PURE__*/React.createElement(Mask, {
|
||||
prefixCls: prefixCls,
|
||||
visible: mask && visible,
|
||||
motionName: getMotionName(prefixCls, maskTransitionName, maskAnimation),
|
||||
style: _objectSpread(_objectSpread({
|
||||
zIndex: zIndex
|
||||
}, maskStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.mask),
|
||||
maskProps: maskProps,
|
||||
className: modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.mask
|
||||
}), /*#__PURE__*/React.createElement("div", _extends({
|
||||
tabIndex: -1,
|
||||
onKeyDown: onWrapperKeyDown,
|
||||
className: classNames("".concat(prefixCls, "-wrap"), wrapClassName, modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.wrapper),
|
||||
ref: wrapperRef,
|
||||
onClick: onWrapperClick,
|
||||
style: mergedStyle
|
||||
}, wrapProps), /*#__PURE__*/React.createElement(Content, _extends({}, props, {
|
||||
onMouseDown: onContentMouseDown,
|
||||
onMouseUp: onContentMouseUp,
|
||||
ref: contentRef,
|
||||
closable: closable,
|
||||
ariaId: ariaId,
|
||||
prefixCls: prefixCls,
|
||||
visible: visible && animatedVisible,
|
||||
onClose: onInternalClose,
|
||||
onVisibleChanged: onDialogVisibleChanged,
|
||||
motionName: getMotionName(prefixCls, transitionName, animation)
|
||||
}))));
|
||||
};
|
||||
export default Dialog;
|
||||
4
frontend/node_modules/rc-dialog/es/DialogWrap.d.ts
generated
vendored
Normal file
4
frontend/node_modules/rc-dialog/es/DialogWrap.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import type { IDialogPropTypes } from './IDialogPropTypes';
|
||||
declare const DialogWrap: React.FC<IDialogPropTypes>;
|
||||
export default DialogWrap;
|
||||
59
frontend/node_modules/rc-dialog/es/DialogWrap.js
generated
vendored
Normal file
59
frontend/node_modules/rc-dialog/es/DialogWrap.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
||||
import Portal from '@rc-component/portal';
|
||||
import * as React from 'react';
|
||||
import { RefContext } from "./context";
|
||||
import Dialog from "./Dialog";
|
||||
// fix issue #10656
|
||||
/*
|
||||
* getContainer remarks
|
||||
* Custom container should not be return, because in the Portal component, it will remove the
|
||||
* return container element here, if the custom container is the only child of it's component,
|
||||
* like issue #10656, It will has a conflict with removeChild method in react-dom.
|
||||
* So here should add a child (div element) to custom container.
|
||||
* */
|
||||
|
||||
var DialogWrap = function DialogWrap(props) {
|
||||
var visible = props.visible,
|
||||
getContainer = props.getContainer,
|
||||
forceRender = props.forceRender,
|
||||
_props$destroyOnClose = props.destroyOnClose,
|
||||
destroyOnClose = _props$destroyOnClose === void 0 ? false : _props$destroyOnClose,
|
||||
_afterClose = props.afterClose,
|
||||
panelRef = props.panelRef;
|
||||
var _React$useState = React.useState(visible),
|
||||
_React$useState2 = _slicedToArray(_React$useState, 2),
|
||||
animatedVisible = _React$useState2[0],
|
||||
setAnimatedVisible = _React$useState2[1];
|
||||
var refContext = React.useMemo(function () {
|
||||
return {
|
||||
panel: panelRef
|
||||
};
|
||||
}, [panelRef]);
|
||||
React.useEffect(function () {
|
||||
if (visible) {
|
||||
setAnimatedVisible(true);
|
||||
}
|
||||
}, [visible]);
|
||||
|
||||
// Destroy on close will remove wrapped div
|
||||
if (!forceRender && destroyOnClose && !animatedVisible) {
|
||||
return null;
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(RefContext.Provider, {
|
||||
value: refContext
|
||||
}, /*#__PURE__*/React.createElement(Portal, {
|
||||
open: visible || forceRender || animatedVisible,
|
||||
autoDestroy: false,
|
||||
getContainer: getContainer,
|
||||
autoLock: visible || animatedVisible
|
||||
}, /*#__PURE__*/React.createElement(Dialog, _extends({}, props, {
|
||||
destroyOnClose: destroyOnClose,
|
||||
afterClose: function afterClose() {
|
||||
_afterClose === null || _afterClose === void 0 || _afterClose();
|
||||
setAnimatedVisible(false);
|
||||
}
|
||||
}))));
|
||||
};
|
||||
DialogWrap.displayName = 'Dialog';
|
||||
export default DialogWrap;
|
||||
65
frontend/node_modules/rc-dialog/es/IDialogPropTypes.d.ts
generated
vendored
Normal file
65
frontend/node_modules/rc-dialog/es/IDialogPropTypes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { GetContainer } from 'rc-util/lib/PortalWrapper';
|
||||
import type { CSSProperties, ReactNode, SyntheticEvent } from 'react';
|
||||
export interface ModalClassNames {
|
||||
header?: string;
|
||||
body?: string;
|
||||
footer?: string;
|
||||
mask?: string;
|
||||
content?: string;
|
||||
wrapper?: string;
|
||||
}
|
||||
export interface ModalStyles {
|
||||
header?: CSSProperties;
|
||||
body?: CSSProperties;
|
||||
footer?: CSSProperties;
|
||||
mask?: CSSProperties;
|
||||
wrapper?: CSSProperties;
|
||||
content?: CSSProperties;
|
||||
}
|
||||
export type IDialogPropTypes = {
|
||||
className?: string;
|
||||
keyboard?: boolean;
|
||||
style?: CSSProperties;
|
||||
mask?: boolean;
|
||||
children?: React.ReactNode;
|
||||
afterClose?: () => any;
|
||||
afterOpenChange?: (open: boolean) => void;
|
||||
onClose?: (e: SyntheticEvent) => any;
|
||||
closable?: boolean | ({
|
||||
closeIcon?: React.ReactNode;
|
||||
disabled?: boolean;
|
||||
} & React.AriaAttributes);
|
||||
maskClosable?: boolean;
|
||||
visible?: boolean;
|
||||
destroyOnClose?: boolean;
|
||||
mousePosition?: {
|
||||
x: number;
|
||||
y: number;
|
||||
} | null;
|
||||
title?: ReactNode;
|
||||
footer?: ReactNode;
|
||||
transitionName?: string;
|
||||
maskTransitionName?: string;
|
||||
animation?: any;
|
||||
maskAnimation?: any;
|
||||
wrapStyle?: Record<string, any>;
|
||||
bodyStyle?: Record<string, any>;
|
||||
maskStyle?: Record<string, any>;
|
||||
prefixCls?: string;
|
||||
wrapClassName?: string;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
zIndex?: number;
|
||||
bodyProps?: any;
|
||||
maskProps?: any;
|
||||
rootClassName?: string;
|
||||
classNames?: ModalClassNames;
|
||||
styles?: ModalStyles;
|
||||
wrapProps?: any;
|
||||
getContainer?: GetContainer | false;
|
||||
closeIcon?: ReactNode;
|
||||
modalRender?: (node: ReactNode) => ReactNode;
|
||||
forceRender?: boolean;
|
||||
focusTriggerAfterClose?: boolean;
|
||||
panelRef?: React.Ref<HTMLDivElement>;
|
||||
};
|
||||
1
frontend/node_modules/rc-dialog/es/IDialogPropTypes.js
generated
vendored
Normal file
1
frontend/node_modules/rc-dialog/es/IDialogPropTypes.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
5
frontend/node_modules/rc-dialog/es/context.d.ts
generated
vendored
Normal file
5
frontend/node_modules/rc-dialog/es/context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as React from 'react';
|
||||
export interface RefContextProps {
|
||||
panel?: React.Ref<HTMLDivElement>;
|
||||
}
|
||||
export declare const RefContext: React.Context<RefContextProps>;
|
||||
2
frontend/node_modules/rc-dialog/es/context.js
generated
vendored
Normal file
2
frontend/node_modules/rc-dialog/es/context.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import * as React from 'react';
|
||||
export var RefContext = /*#__PURE__*/React.createContext({});
|
||||
6
frontend/node_modules/rc-dialog/es/index.d.ts
generated
vendored
Normal file
6
frontend/node_modules/rc-dialog/es/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import DialogWrap from './DialogWrap';
|
||||
import Panel from './Dialog/Content/Panel';
|
||||
import type { IDialogPropTypes as DialogProps } from './IDialogPropTypes';
|
||||
export type { DialogProps };
|
||||
export { Panel };
|
||||
export default DialogWrap;
|
||||
4
frontend/node_modules/rc-dialog/es/index.js
generated
vendored
Normal file
4
frontend/node_modules/rc-dialog/es/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import DialogWrap from "./DialogWrap";
|
||||
import Panel from "./Dialog/Content/Panel";
|
||||
export { Panel };
|
||||
export default DialogWrap;
|
||||
5
frontend/node_modules/rc-dialog/es/util.d.ts
generated
vendored
Normal file
5
frontend/node_modules/rc-dialog/es/util.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export declare function getMotionName(prefixCls: string, transitionName?: string, animationName?: string): string;
|
||||
export declare function offset(el: Element): {
|
||||
left: number;
|
||||
top: number;
|
||||
};
|
||||
34
frontend/node_modules/rc-dialog/es/util.js
generated
vendored
Normal file
34
frontend/node_modules/rc-dialog/es/util.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// =============================== Motion ===============================
|
||||
export function getMotionName(prefixCls, transitionName, animationName) {
|
||||
var motionName = transitionName;
|
||||
if (!motionName && animationName) {
|
||||
motionName = "".concat(prefixCls, "-").concat(animationName);
|
||||
}
|
||||
return motionName;
|
||||
}
|
||||
|
||||
// =============================== Offset ===============================
|
||||
function getScroll(w, top) {
|
||||
var ret = w["page".concat(top ? 'Y' : 'X', "Offset")];
|
||||
var method = "scroll".concat(top ? 'Top' : 'Left');
|
||||
if (typeof ret !== 'number') {
|
||||
var d = w.document;
|
||||
ret = d.documentElement[method];
|
||||
if (typeof ret !== 'number') {
|
||||
ret = d.body[method];
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
export function offset(el) {
|
||||
var rect = el.getBoundingClientRect();
|
||||
var pos = {
|
||||
left: rect.left,
|
||||
top: rect.top
|
||||
};
|
||||
var doc = el.ownerDocument;
|
||||
var w = doc.defaultView || doc.parentWindow;
|
||||
pos.left += getScroll(w);
|
||||
pos.top += getScroll(w, true);
|
||||
return pos;
|
||||
}
|
||||
7
frontend/node_modules/rc-dialog/lib/Dialog/Content/MemoChildren.d.ts
generated
vendored
Normal file
7
frontend/node_modules/rc-dialog/lib/Dialog/Content/MemoChildren.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as React from 'react';
|
||||
export type MemoChildrenProps = {
|
||||
shouldUpdate: boolean;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
declare const _default: React.MemoExoticComponent<({ children }: MemoChildrenProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>>;
|
||||
export default _default;
|
||||
17
frontend/node_modules/rc-dialog/lib/Dialog/Content/MemoChildren.js
generated
vendored
Normal file
17
frontend/node_modules/rc-dialog/lib/Dialog/Content/MemoChildren.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
var _typeof = require("@babel/runtime/helpers/typeof");
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
var _default = exports.default = /*#__PURE__*/React.memo(function (_ref) {
|
||||
var children = _ref.children;
|
||||
return children;
|
||||
}, function (_, _ref2) {
|
||||
var shouldUpdate = _ref2.shouldUpdate;
|
||||
return !shouldUpdate;
|
||||
});
|
||||
15
frontend/node_modules/rc-dialog/lib/Dialog/Content/Panel.d.ts
generated
vendored
Normal file
15
frontend/node_modules/rc-dialog/lib/Dialog/Content/Panel.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import type { IDialogPropTypes } from '../../IDialogPropTypes';
|
||||
export interface PanelProps extends Omit<IDialogPropTypes, 'getOpenCount'> {
|
||||
prefixCls: string;
|
||||
ariaId?: string;
|
||||
onMouseDown?: React.MouseEventHandler;
|
||||
onMouseUp?: React.MouseEventHandler;
|
||||
holderRef?: React.Ref<HTMLDivElement>;
|
||||
}
|
||||
export type ContentRef = {
|
||||
focus: () => void;
|
||||
changeActive: (next: boolean) => void;
|
||||
};
|
||||
declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<ContentRef>>;
|
||||
export default Panel;
|
||||
158
frontend/node_modules/rc-dialog/lib/Dialog/Content/Panel.js
generated
vendored
Normal file
158
frontend/node_modules/rc-dialog/lib/Dialog/Content/Panel.js
generated
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
||||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _ref = require("rc-util/lib/ref");
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
var _context = require("../../context");
|
||||
var _MemoChildren = _interopRequireDefault(require("./MemoChildren"));
|
||||
var _pickAttrs = _interopRequireDefault(require("rc-util/lib/pickAttrs"));
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
var sentinelStyle = {
|
||||
width: 0,
|
||||
height: 0,
|
||||
overflow: 'hidden',
|
||||
outline: 'none'
|
||||
};
|
||||
var entityStyle = {
|
||||
outline: 'none'
|
||||
};
|
||||
var Panel = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
||||
var prefixCls = props.prefixCls,
|
||||
className = props.className,
|
||||
style = props.style,
|
||||
title = props.title,
|
||||
ariaId = props.ariaId,
|
||||
footer = props.footer,
|
||||
closable = props.closable,
|
||||
closeIcon = props.closeIcon,
|
||||
onClose = props.onClose,
|
||||
children = props.children,
|
||||
bodyStyle = props.bodyStyle,
|
||||
bodyProps = props.bodyProps,
|
||||
modalRender = props.modalRender,
|
||||
onMouseDown = props.onMouseDown,
|
||||
onMouseUp = props.onMouseUp,
|
||||
holderRef = props.holderRef,
|
||||
visible = props.visible,
|
||||
forceRender = props.forceRender,
|
||||
width = props.width,
|
||||
height = props.height,
|
||||
modalClassNames = props.classNames,
|
||||
modalStyles = props.styles;
|
||||
|
||||
// ================================= Refs =================================
|
||||
var _React$useContext = _react.default.useContext(_context.RefContext),
|
||||
panelRef = _React$useContext.panel;
|
||||
var mergedRef = (0, _ref.useComposeRef)(holderRef, panelRef);
|
||||
var sentinelStartRef = (0, _react.useRef)();
|
||||
var sentinelEndRef = (0, _react.useRef)();
|
||||
_react.default.useImperativeHandle(ref, function () {
|
||||
return {
|
||||
focus: function focus() {
|
||||
var _sentinelStartRef$cur;
|
||||
(_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 || _sentinelStartRef$cur.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
},
|
||||
changeActive: function changeActive(next) {
|
||||
var _document = document,
|
||||
activeElement = _document.activeElement;
|
||||
if (next && activeElement === sentinelEndRef.current) {
|
||||
sentinelStartRef.current.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
} else if (!next && activeElement === sentinelStartRef.current) {
|
||||
sentinelEndRef.current.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// ================================ Style =================================
|
||||
var contentStyle = {};
|
||||
if (width !== undefined) {
|
||||
contentStyle.width = width;
|
||||
}
|
||||
if (height !== undefined) {
|
||||
contentStyle.height = height;
|
||||
}
|
||||
// ================================ Render ================================
|
||||
var footerNode = footer ? /*#__PURE__*/_react.default.createElement("div", {
|
||||
className: (0, _classnames.default)("".concat(prefixCls, "-footer"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.footer),
|
||||
style: (0, _objectSpread2.default)({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.footer)
|
||||
}, footer) : null;
|
||||
var headerNode = title ? /*#__PURE__*/_react.default.createElement("div", {
|
||||
className: (0, _classnames.default)("".concat(prefixCls, "-header"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.header),
|
||||
style: (0, _objectSpread2.default)({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.header)
|
||||
}, /*#__PURE__*/_react.default.createElement("div", {
|
||||
className: "".concat(prefixCls, "-title"),
|
||||
id: ariaId
|
||||
}, title)) : null;
|
||||
var closableObj = (0, _react.useMemo)(function () {
|
||||
if ((0, _typeof2.default)(closable) === 'object' && closable !== null) {
|
||||
return closable;
|
||||
}
|
||||
if (closable) {
|
||||
return {
|
||||
closeIcon: closeIcon !== null && closeIcon !== void 0 ? closeIcon : /*#__PURE__*/_react.default.createElement("span", {
|
||||
className: "".concat(prefixCls, "-close-x")
|
||||
})
|
||||
};
|
||||
}
|
||||
return {};
|
||||
}, [closable, closeIcon, prefixCls]);
|
||||
var ariaProps = (0, _pickAttrs.default)(closableObj, true);
|
||||
var closeBtnIsDisabled = (0, _typeof2.default)(closable) === 'object' && closable.disabled;
|
||||
var closerNode = closable ? /*#__PURE__*/_react.default.createElement("button", (0, _extends2.default)({
|
||||
type: "button",
|
||||
onClick: onClose,
|
||||
"aria-label": "Close"
|
||||
}, ariaProps, {
|
||||
className: "".concat(prefixCls, "-close"),
|
||||
disabled: closeBtnIsDisabled
|
||||
}), closableObj.closeIcon) : null;
|
||||
var content = /*#__PURE__*/_react.default.createElement("div", {
|
||||
className: (0, _classnames.default)("".concat(prefixCls, "-content"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.content),
|
||||
style: modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.content
|
||||
}, closerNode, headerNode, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
||||
className: (0, _classnames.default)("".concat(prefixCls, "-body"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.body),
|
||||
style: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, bodyStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.body)
|
||||
}, bodyProps), children), footerNode);
|
||||
return /*#__PURE__*/_react.default.createElement("div", {
|
||||
key: "dialog-element",
|
||||
role: "dialog",
|
||||
"aria-labelledby": title ? ariaId : null,
|
||||
"aria-modal": "true",
|
||||
ref: mergedRef,
|
||||
style: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, style), contentStyle),
|
||||
className: (0, _classnames.default)(prefixCls, className),
|
||||
onMouseDown: onMouseDown,
|
||||
onMouseUp: onMouseUp
|
||||
}, /*#__PURE__*/_react.default.createElement("div", {
|
||||
ref: sentinelStartRef,
|
||||
tabIndex: 0,
|
||||
style: entityStyle
|
||||
}, /*#__PURE__*/_react.default.createElement(_MemoChildren.default, {
|
||||
shouldUpdate: visible || forceRender
|
||||
}, modalRender ? modalRender(content) : content)), /*#__PURE__*/_react.default.createElement("div", {
|
||||
tabIndex: 0,
|
||||
ref: sentinelEndRef,
|
||||
style: sentinelStyle
|
||||
}));
|
||||
});
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Panel.displayName = 'Panel';
|
||||
}
|
||||
var _default = exports.default = Panel;
|
||||
13
frontend/node_modules/rc-dialog/lib/Dialog/Content/index.d.ts
generated
vendored
Normal file
13
frontend/node_modules/rc-dialog/lib/Dialog/Content/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as React from 'react';
|
||||
import type { PanelProps, ContentRef } from './Panel';
|
||||
export type ContentProps = {
|
||||
motionName: string;
|
||||
ariaId: string;
|
||||
onVisibleChanged: (visible: boolean) => void;
|
||||
} & PanelProps;
|
||||
declare const Content: React.ForwardRefExoticComponent<{
|
||||
motionName: string;
|
||||
ariaId: string;
|
||||
onVisibleChanged: (visible: boolean) => void;
|
||||
} & PanelProps & React.RefAttributes<ContentRef>>;
|
||||
export default Content;
|
||||
73
frontend/node_modules/rc-dialog/lib/Dialog/Content/index.js
generated
vendored
Normal file
73
frontend/node_modules/rc-dialog/lib/Dialog/Content/index.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
var _typeof = require("@babel/runtime/helpers/typeof");
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
||||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
var React = _react;
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcMotion = _interopRequireDefault(require("rc-motion"));
|
||||
var _util = require("../../util");
|
||||
var _Panel = _interopRequireDefault(require("./Panel"));
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
||||
var prefixCls = props.prefixCls,
|
||||
title = props.title,
|
||||
style = props.style,
|
||||
className = props.className,
|
||||
visible = props.visible,
|
||||
forceRender = props.forceRender,
|
||||
destroyOnClose = props.destroyOnClose,
|
||||
motionName = props.motionName,
|
||||
ariaId = props.ariaId,
|
||||
onVisibleChanged = props.onVisibleChanged,
|
||||
mousePosition = props.mousePosition;
|
||||
var dialogRef = (0, _react.useRef)();
|
||||
|
||||
// ============================= Style ==============================
|
||||
var _React$useState = React.useState(),
|
||||
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
||||
transformOrigin = _React$useState2[0],
|
||||
setTransformOrigin = _React$useState2[1];
|
||||
var contentStyle = {};
|
||||
if (transformOrigin) {
|
||||
contentStyle.transformOrigin = transformOrigin;
|
||||
}
|
||||
function onPrepare() {
|
||||
var elementOffset = (0, _util.offset)(dialogRef.current);
|
||||
setTransformOrigin(mousePosition && (mousePosition.x || mousePosition.y) ? "".concat(mousePosition.x - elementOffset.left, "px ").concat(mousePosition.y - elementOffset.top, "px") : '');
|
||||
}
|
||||
|
||||
// ============================= Render =============================
|
||||
return /*#__PURE__*/React.createElement(_rcMotion.default, {
|
||||
visible: visible,
|
||||
onVisibleChanged: onVisibleChanged,
|
||||
onAppearPrepare: onPrepare,
|
||||
onEnterPrepare: onPrepare,
|
||||
forceRender: forceRender,
|
||||
motionName: motionName,
|
||||
removeOnLeave: destroyOnClose,
|
||||
ref: dialogRef
|
||||
}, function (_ref, motionRef) {
|
||||
var motionClassName = _ref.className,
|
||||
motionStyle = _ref.style;
|
||||
return /*#__PURE__*/React.createElement(_Panel.default, (0, _extends2.default)({}, props, {
|
||||
ref: ref,
|
||||
title: title,
|
||||
ariaId: ariaId,
|
||||
prefixCls: prefixCls,
|
||||
holderRef: motionRef,
|
||||
style: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, motionStyle), style), contentStyle),
|
||||
className: (0, _classnames.default)(className, motionClassName)
|
||||
}));
|
||||
});
|
||||
});
|
||||
Content.displayName = 'Content';
|
||||
var _default = exports.default = Content;
|
||||
11
frontend/node_modules/rc-dialog/lib/Dialog/Mask.d.ts
generated
vendored
Normal file
11
frontend/node_modules/rc-dialog/lib/Dialog/Mask.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as React from 'react';
|
||||
export type MaskProps = {
|
||||
prefixCls: string;
|
||||
visible: boolean;
|
||||
motionName?: string;
|
||||
style?: React.CSSProperties;
|
||||
maskProps?: React.HTMLAttributes<HTMLDivElement>;
|
||||
className?: string;
|
||||
};
|
||||
declare const Mask: React.FC<MaskProps>;
|
||||
export default Mask;
|
||||
38
frontend/node_modules/rc-dialog/lib/Dialog/Mask.js
generated
vendored
Normal file
38
frontend/node_modules/rc-dialog/lib/Dialog/Mask.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
var _typeof = require("@babel/runtime/helpers/typeof");
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcMotion = _interopRequireDefault(require("rc-motion"));
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
var Mask = function Mask(props) {
|
||||
var prefixCls = props.prefixCls,
|
||||
style = props.style,
|
||||
visible = props.visible,
|
||||
maskProps = props.maskProps,
|
||||
motionName = props.motionName,
|
||||
className = props.className;
|
||||
return /*#__PURE__*/React.createElement(_rcMotion.default, {
|
||||
key: "mask",
|
||||
visible: visible,
|
||||
motionName: motionName,
|
||||
leavedClassName: "".concat(prefixCls, "-mask-hidden")
|
||||
}, function (_ref, ref) {
|
||||
var motionClassName = _ref.className,
|
||||
motionStyle = _ref.style;
|
||||
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
||||
ref: ref,
|
||||
style: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, motionStyle), style),
|
||||
className: (0, _classnames.default)("".concat(prefixCls, "-mask"), motionClassName, className)
|
||||
}, maskProps));
|
||||
});
|
||||
};
|
||||
var _default = exports.default = Mask;
|
||||
4
frontend/node_modules/rc-dialog/lib/Dialog/index.d.ts
generated
vendored
Normal file
4
frontend/node_modules/rc-dialog/lib/Dialog/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import type { IDialogPropTypes } from '../IDialogPropTypes';
|
||||
declare const Dialog: React.FC<IDialogPropTypes>;
|
||||
export default Dialog;
|
||||
211
frontend/node_modules/rc-dialog/lib/Dialog/index.js
generated
vendored
Normal file
211
frontend/node_modules/rc-dialog/lib/Dialog/index.js
generated
vendored
Normal file
@@ -0,0 +1,211 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
var _typeof = require("@babel/runtime/helpers/typeof");
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
||||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _contains = _interopRequireDefault(require("rc-util/lib/Dom/contains"));
|
||||
var _useId = _interopRequireDefault(require("rc-util/lib/hooks/useId"));
|
||||
var _KeyCode = _interopRequireDefault(require("rc-util/lib/KeyCode"));
|
||||
var _pickAttrs = _interopRequireDefault(require("rc-util/lib/pickAttrs"));
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
var React = _react;
|
||||
var _util = require("../util");
|
||||
var _Content = _interopRequireDefault(require("./Content"));
|
||||
var _Mask = _interopRequireDefault(require("./Mask"));
|
||||
var _warning = require("rc-util/lib/warning");
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
var Dialog = function Dialog(props) {
|
||||
var _props$prefixCls = props.prefixCls,
|
||||
prefixCls = _props$prefixCls === void 0 ? 'rc-dialog' : _props$prefixCls,
|
||||
zIndex = props.zIndex,
|
||||
_props$visible = props.visible,
|
||||
visible = _props$visible === void 0 ? false : _props$visible,
|
||||
_props$keyboard = props.keyboard,
|
||||
keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
|
||||
_props$focusTriggerAf = props.focusTriggerAfterClose,
|
||||
focusTriggerAfterClose = _props$focusTriggerAf === void 0 ? true : _props$focusTriggerAf,
|
||||
wrapStyle = props.wrapStyle,
|
||||
wrapClassName = props.wrapClassName,
|
||||
wrapProps = props.wrapProps,
|
||||
onClose = props.onClose,
|
||||
afterOpenChange = props.afterOpenChange,
|
||||
afterClose = props.afterClose,
|
||||
transitionName = props.transitionName,
|
||||
animation = props.animation,
|
||||
_props$closable = props.closable,
|
||||
closable = _props$closable === void 0 ? true : _props$closable,
|
||||
_props$mask = props.mask,
|
||||
mask = _props$mask === void 0 ? true : _props$mask,
|
||||
maskTransitionName = props.maskTransitionName,
|
||||
maskAnimation = props.maskAnimation,
|
||||
_props$maskClosable = props.maskClosable,
|
||||
maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
|
||||
maskStyle = props.maskStyle,
|
||||
maskProps = props.maskProps,
|
||||
rootClassName = props.rootClassName,
|
||||
modalClassNames = props.classNames,
|
||||
modalStyles = props.styles;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
['wrapStyle', 'bodyStyle', 'maskStyle'].forEach(function (prop) {
|
||||
// (prop in props) && console.error(`Warning: ${prop} is deprecated, please use styles instead.`)
|
||||
(0, _warning.warning)(!(prop in props), "".concat(prop, " is deprecated, please use styles instead."));
|
||||
});
|
||||
if ('wrapClassName' in props) {
|
||||
(0, _warning.warning)(false, "wrapClassName is deprecated, please use classNames instead.");
|
||||
}
|
||||
}
|
||||
var lastOutSideActiveElementRef = (0, _react.useRef)();
|
||||
var wrapperRef = (0, _react.useRef)();
|
||||
var contentRef = (0, _react.useRef)();
|
||||
var _React$useState = React.useState(visible),
|
||||
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
||||
animatedVisible = _React$useState2[0],
|
||||
setAnimatedVisible = _React$useState2[1];
|
||||
|
||||
// ========================== Init ==========================
|
||||
var ariaId = (0, _useId.default)();
|
||||
function saveLastOutSideActiveElementRef() {
|
||||
if (!(0, _contains.default)(wrapperRef.current, document.activeElement)) {
|
||||
lastOutSideActiveElementRef.current = document.activeElement;
|
||||
}
|
||||
}
|
||||
function focusDialogContent() {
|
||||
if (!(0, _contains.default)(wrapperRef.current, document.activeElement)) {
|
||||
var _contentRef$current;
|
||||
(_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.focus();
|
||||
}
|
||||
}
|
||||
|
||||
// ========================= Events =========================
|
||||
function onDialogVisibleChanged(newVisible) {
|
||||
// Try to focus
|
||||
if (newVisible) {
|
||||
focusDialogContent();
|
||||
} else {
|
||||
// Clean up scroll bar & focus back
|
||||
setAnimatedVisible(false);
|
||||
if (mask && lastOutSideActiveElementRef.current && focusTriggerAfterClose) {
|
||||
try {
|
||||
lastOutSideActiveElementRef.current.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
} catch (e) {
|
||||
// Do nothing
|
||||
}
|
||||
lastOutSideActiveElementRef.current = null;
|
||||
}
|
||||
|
||||
// Trigger afterClose only when change visible from true to false
|
||||
if (animatedVisible) {
|
||||
afterClose === null || afterClose === void 0 || afterClose();
|
||||
}
|
||||
}
|
||||
afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(newVisible);
|
||||
}
|
||||
function onInternalClose(e) {
|
||||
onClose === null || onClose === void 0 || onClose(e);
|
||||
}
|
||||
|
||||
// >>> Content
|
||||
var contentClickRef = (0, _react.useRef)(false);
|
||||
var contentTimeoutRef = (0, _react.useRef)();
|
||||
|
||||
// We need record content click incase content popup out of dialog
|
||||
var onContentMouseDown = function onContentMouseDown() {
|
||||
clearTimeout(contentTimeoutRef.current);
|
||||
contentClickRef.current = true;
|
||||
};
|
||||
var onContentMouseUp = function onContentMouseUp() {
|
||||
contentTimeoutRef.current = setTimeout(function () {
|
||||
contentClickRef.current = false;
|
||||
});
|
||||
};
|
||||
|
||||
// >>> Wrapper
|
||||
// Close only when element not on dialog
|
||||
var onWrapperClick = null;
|
||||
if (maskClosable) {
|
||||
onWrapperClick = function onWrapperClick(e) {
|
||||
if (contentClickRef.current) {
|
||||
contentClickRef.current = false;
|
||||
} else if (wrapperRef.current === e.target) {
|
||||
onInternalClose(e);
|
||||
}
|
||||
};
|
||||
}
|
||||
function onWrapperKeyDown(e) {
|
||||
if (keyboard && e.keyCode === _KeyCode.default.ESC) {
|
||||
e.stopPropagation();
|
||||
onInternalClose(e);
|
||||
return;
|
||||
}
|
||||
|
||||
// keep focus inside dialog
|
||||
if (visible && e.keyCode === _KeyCode.default.TAB) {
|
||||
contentRef.current.changeActive(!e.shiftKey);
|
||||
}
|
||||
}
|
||||
|
||||
// ========================= Effect =========================
|
||||
(0, _react.useEffect)(function () {
|
||||
if (visible) {
|
||||
setAnimatedVisible(true);
|
||||
saveLastOutSideActiveElementRef();
|
||||
}
|
||||
}, [visible]);
|
||||
|
||||
// Remove direct should also check the scroll bar update
|
||||
(0, _react.useEffect)(function () {
|
||||
return function () {
|
||||
clearTimeout(contentTimeoutRef.current);
|
||||
};
|
||||
}, []);
|
||||
var mergedStyle = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
||||
zIndex: zIndex
|
||||
}, wrapStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.wrapper), {}, {
|
||||
display: !animatedVisible ? 'none' : null
|
||||
});
|
||||
|
||||
// ========================= Render =========================
|
||||
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
||||
className: (0, _classnames.default)("".concat(prefixCls, "-root"), rootClassName)
|
||||
}, (0, _pickAttrs.default)(props, {
|
||||
data: true
|
||||
})), /*#__PURE__*/React.createElement(_Mask.default, {
|
||||
prefixCls: prefixCls,
|
||||
visible: mask && visible,
|
||||
motionName: (0, _util.getMotionName)(prefixCls, maskTransitionName, maskAnimation),
|
||||
style: (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
||||
zIndex: zIndex
|
||||
}, maskStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.mask),
|
||||
maskProps: maskProps,
|
||||
className: modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.mask
|
||||
}), /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
||||
tabIndex: -1,
|
||||
onKeyDown: onWrapperKeyDown,
|
||||
className: (0, _classnames.default)("".concat(prefixCls, "-wrap"), wrapClassName, modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.wrapper),
|
||||
ref: wrapperRef,
|
||||
onClick: onWrapperClick,
|
||||
style: mergedStyle
|
||||
}, wrapProps), /*#__PURE__*/React.createElement(_Content.default, (0, _extends2.default)({}, props, {
|
||||
onMouseDown: onContentMouseDown,
|
||||
onMouseUp: onContentMouseUp,
|
||||
ref: contentRef,
|
||||
closable: closable,
|
||||
ariaId: ariaId,
|
||||
prefixCls: prefixCls,
|
||||
visible: visible && animatedVisible,
|
||||
onClose: onInternalClose,
|
||||
onVisibleChanged: onDialogVisibleChanged,
|
||||
motionName: (0, _util.getMotionName)(prefixCls, transitionName, animation)
|
||||
}))));
|
||||
};
|
||||
var _default = exports.default = Dialog;
|
||||
4
frontend/node_modules/rc-dialog/lib/DialogWrap.d.ts
generated
vendored
Normal file
4
frontend/node_modules/rc-dialog/lib/DialogWrap.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import type { IDialogPropTypes } from './IDialogPropTypes';
|
||||
declare const DialogWrap: React.FC<IDialogPropTypes>;
|
||||
export default DialogWrap;
|
||||
69
frontend/node_modules/rc-dialog/lib/DialogWrap.js
generated
vendored
Normal file
69
frontend/node_modules/rc-dialog/lib/DialogWrap.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
var _typeof = require("@babel/runtime/helpers/typeof");
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
||||
var _portal = _interopRequireDefault(require("@rc-component/portal"));
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _context = require("./context");
|
||||
var _Dialog = _interopRequireDefault(require("./Dialog"));
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
// fix issue #10656
|
||||
/*
|
||||
* getContainer remarks
|
||||
* Custom container should not be return, because in the Portal component, it will remove the
|
||||
* return container element here, if the custom container is the only child of it's component,
|
||||
* like issue #10656, It will has a conflict with removeChild method in react-dom.
|
||||
* So here should add a child (div element) to custom container.
|
||||
* */
|
||||
|
||||
var DialogWrap = function DialogWrap(props) {
|
||||
var visible = props.visible,
|
||||
getContainer = props.getContainer,
|
||||
forceRender = props.forceRender,
|
||||
_props$destroyOnClose = props.destroyOnClose,
|
||||
destroyOnClose = _props$destroyOnClose === void 0 ? false : _props$destroyOnClose,
|
||||
_afterClose = props.afterClose,
|
||||
panelRef = props.panelRef;
|
||||
var _React$useState = React.useState(visible),
|
||||
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
||||
animatedVisible = _React$useState2[0],
|
||||
setAnimatedVisible = _React$useState2[1];
|
||||
var refContext = React.useMemo(function () {
|
||||
return {
|
||||
panel: panelRef
|
||||
};
|
||||
}, [panelRef]);
|
||||
React.useEffect(function () {
|
||||
if (visible) {
|
||||
setAnimatedVisible(true);
|
||||
}
|
||||
}, [visible]);
|
||||
|
||||
// Destroy on close will remove wrapped div
|
||||
if (!forceRender && destroyOnClose && !animatedVisible) {
|
||||
return null;
|
||||
}
|
||||
return /*#__PURE__*/React.createElement(_context.RefContext.Provider, {
|
||||
value: refContext
|
||||
}, /*#__PURE__*/React.createElement(_portal.default, {
|
||||
open: visible || forceRender || animatedVisible,
|
||||
autoDestroy: false,
|
||||
getContainer: getContainer,
|
||||
autoLock: visible || animatedVisible
|
||||
}, /*#__PURE__*/React.createElement(_Dialog.default, (0, _extends2.default)({}, props, {
|
||||
destroyOnClose: destroyOnClose,
|
||||
afterClose: function afterClose() {
|
||||
_afterClose === null || _afterClose === void 0 || _afterClose();
|
||||
setAnimatedVisible(false);
|
||||
}
|
||||
}))));
|
||||
};
|
||||
DialogWrap.displayName = 'Dialog';
|
||||
var _default = exports.default = DialogWrap;
|
||||
65
frontend/node_modules/rc-dialog/lib/IDialogPropTypes.d.ts
generated
vendored
Normal file
65
frontend/node_modules/rc-dialog/lib/IDialogPropTypes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { GetContainer } from 'rc-util/lib/PortalWrapper';
|
||||
import type { CSSProperties, ReactNode, SyntheticEvent } from 'react';
|
||||
export interface ModalClassNames {
|
||||
header?: string;
|
||||
body?: string;
|
||||
footer?: string;
|
||||
mask?: string;
|
||||
content?: string;
|
||||
wrapper?: string;
|
||||
}
|
||||
export interface ModalStyles {
|
||||
header?: CSSProperties;
|
||||
body?: CSSProperties;
|
||||
footer?: CSSProperties;
|
||||
mask?: CSSProperties;
|
||||
wrapper?: CSSProperties;
|
||||
content?: CSSProperties;
|
||||
}
|
||||
export type IDialogPropTypes = {
|
||||
className?: string;
|
||||
keyboard?: boolean;
|
||||
style?: CSSProperties;
|
||||
mask?: boolean;
|
||||
children?: React.ReactNode;
|
||||
afterClose?: () => any;
|
||||
afterOpenChange?: (open: boolean) => void;
|
||||
onClose?: (e: SyntheticEvent) => any;
|
||||
closable?: boolean | ({
|
||||
closeIcon?: React.ReactNode;
|
||||
disabled?: boolean;
|
||||
} & React.AriaAttributes);
|
||||
maskClosable?: boolean;
|
||||
visible?: boolean;
|
||||
destroyOnClose?: boolean;
|
||||
mousePosition?: {
|
||||
x: number;
|
||||
y: number;
|
||||
} | null;
|
||||
title?: ReactNode;
|
||||
footer?: ReactNode;
|
||||
transitionName?: string;
|
||||
maskTransitionName?: string;
|
||||
animation?: any;
|
||||
maskAnimation?: any;
|
||||
wrapStyle?: Record<string, any>;
|
||||
bodyStyle?: Record<string, any>;
|
||||
maskStyle?: Record<string, any>;
|
||||
prefixCls?: string;
|
||||
wrapClassName?: string;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
zIndex?: number;
|
||||
bodyProps?: any;
|
||||
maskProps?: any;
|
||||
rootClassName?: string;
|
||||
classNames?: ModalClassNames;
|
||||
styles?: ModalStyles;
|
||||
wrapProps?: any;
|
||||
getContainer?: GetContainer | false;
|
||||
closeIcon?: ReactNode;
|
||||
modalRender?: (node: ReactNode) => ReactNode;
|
||||
forceRender?: boolean;
|
||||
focusTriggerAfterClose?: boolean;
|
||||
panelRef?: React.Ref<HTMLDivElement>;
|
||||
};
|
||||
5
frontend/node_modules/rc-dialog/lib/IDialogPropTypes.js
generated
vendored
Normal file
5
frontend/node_modules/rc-dialog/lib/IDialogPropTypes.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
5
frontend/node_modules/rc-dialog/lib/context.d.ts
generated
vendored
Normal file
5
frontend/node_modules/rc-dialog/lib/context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as React from 'react';
|
||||
export interface RefContextProps {
|
||||
panel?: React.Ref<HTMLDivElement>;
|
||||
}
|
||||
export declare const RefContext: React.Context<RefContextProps>;
|
||||
11
frontend/node_modules/rc-dialog/lib/context.js
generated
vendored
Normal file
11
frontend/node_modules/rc-dialog/lib/context.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
var _typeof = require("@babel/runtime/helpers/typeof");
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.RefContext = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
var RefContext = exports.RefContext = /*#__PURE__*/React.createContext({});
|
||||
6
frontend/node_modules/rc-dialog/lib/index.d.ts
generated
vendored
Normal file
6
frontend/node_modules/rc-dialog/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import DialogWrap from './DialogWrap';
|
||||
import Panel from './Dialog/Content/Panel';
|
||||
import type { IDialogPropTypes as DialogProps } from './IDialogPropTypes';
|
||||
export type { DialogProps };
|
||||
export { Panel };
|
||||
export default DialogWrap;
|
||||
16
frontend/node_modules/rc-dialog/lib/index.js
generated
vendored
Normal file
16
frontend/node_modules/rc-dialog/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "Panel", {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _Panel.default;
|
||||
}
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _DialogWrap = _interopRequireDefault(require("./DialogWrap"));
|
||||
var _Panel = _interopRequireDefault(require("./Dialog/Content/Panel"));
|
||||
var _default = exports.default = _DialogWrap.default;
|
||||
5
frontend/node_modules/rc-dialog/lib/util.d.ts
generated
vendored
Normal file
5
frontend/node_modules/rc-dialog/lib/util.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export declare function getMotionName(prefixCls: string, transitionName?: string, animationName?: string): string;
|
||||
export declare function offset(el: Element): {
|
||||
left: number;
|
||||
top: number;
|
||||
};
|
||||
41
frontend/node_modules/rc-dialog/lib/util.js
generated
vendored
Normal file
41
frontend/node_modules/rc-dialog/lib/util.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getMotionName = getMotionName;
|
||||
exports.offset = offset;
|
||||
// =============================== Motion ===============================
|
||||
function getMotionName(prefixCls, transitionName, animationName) {
|
||||
var motionName = transitionName;
|
||||
if (!motionName && animationName) {
|
||||
motionName = "".concat(prefixCls, "-").concat(animationName);
|
||||
}
|
||||
return motionName;
|
||||
}
|
||||
|
||||
// =============================== Offset ===============================
|
||||
function getScroll(w, top) {
|
||||
var ret = w["page".concat(top ? 'Y' : 'X', "Offset")];
|
||||
var method = "scroll".concat(top ? 'Top' : 'Left');
|
||||
if (typeof ret !== 'number') {
|
||||
var d = w.document;
|
||||
ret = d.documentElement[method];
|
||||
if (typeof ret !== 'number') {
|
||||
ret = d.body[method];
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function offset(el) {
|
||||
var rect = el.getBoundingClientRect();
|
||||
var pos = {
|
||||
left: rect.left,
|
||||
top: rect.top
|
||||
};
|
||||
var doc = el.ownerDocument;
|
||||
var w = doc.defaultView || doc.parentWindow;
|
||||
pos.left += getScroll(w);
|
||||
pos.top += getScroll(w, true);
|
||||
return pos;
|
||||
}
|
||||
98
frontend/node_modules/rc-dialog/package.json
generated
vendored
Normal file
98
frontend/node_modules/rc-dialog/package.json
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"name": "rc-dialog",
|
||||
"version": "9.6.0",
|
||||
"description": "dialog ui component for react",
|
||||
"keywords": [
|
||||
"react",
|
||||
"react-component",
|
||||
"react-dialog",
|
||||
"dialog",
|
||||
"ui"
|
||||
],
|
||||
"homepage": "http://github.com/react-component/dialog",
|
||||
"bugs": {
|
||||
"url": "http://github.com/react-component/dialog/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:react-component/dialog.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "yiminghe@gmail.com",
|
||||
"main": "./lib/index",
|
||||
"module": "./es/index",
|
||||
"files": [
|
||||
"lib",
|
||||
"es",
|
||||
"assets/*.css",
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"compile": "father build && lessc assets/index.less assets/index.css && lessc assets/bootstrap.less assets/bootstrap.css",
|
||||
"coverage": "rc-test --coverage",
|
||||
"deploy": "npm run docs:build && npm run docs:deploy",
|
||||
"docs:build": "dumi build",
|
||||
"docs:deploy": "gh-pages -d dist",
|
||||
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
|
||||
"lint:tsc": "tsc -p tsconfig.json --noEmit",
|
||||
"now-build": "npm run docs:build",
|
||||
"prepare": "husky install",
|
||||
"prepublishOnly": "npm run compile && np --yolo --no-publish",
|
||||
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
|
||||
"start": "dumi dev",
|
||||
"test": "rc-test"
|
||||
},
|
||||
"lint-staged": {
|
||||
"**/*.{js,jsx,tsx,ts,md,json}": [
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.10.1",
|
||||
"@rc-component/portal": "^1.0.0-8",
|
||||
"classnames": "^2.2.6",
|
||||
"rc-motion": "^2.3.0",
|
||||
"rc-util": "^5.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rc-component/father-plugin": "^1.0.1",
|
||||
"@testing-library/jest-dom": "^6.1.6",
|
||||
"@testing-library/react": "^12.0.0",
|
||||
"@types/enzyme": "^3.10.7",
|
||||
"@types/jest": "^29.4.0",
|
||||
"@types/keyv": "3.1.4",
|
||||
"@types/react": "^18.0.24",
|
||||
"@types/react-dom": "^18.0.8",
|
||||
"@umijs/fabric": "^3.0.0",
|
||||
"bootstrap": "^4.3.1",
|
||||
"cheerio": "1.0.0-rc.12",
|
||||
"cross-env": "^7.0.0",
|
||||
"dumi": "^2.1.3",
|
||||
"enzyme": "^3.1.1",
|
||||
"enzyme-adapter-react-16": "^1.0.1",
|
||||
"enzyme-to-json": "^3.1.2",
|
||||
"eslint": "^7.1.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-plugin-react": "^7.20.6",
|
||||
"father": "^4.1.5",
|
||||
"gh-pages": "^6.1.1",
|
||||
"glob": "^11.0.0",
|
||||
"husky": "^8.0.3",
|
||||
"less": "^4.1.3",
|
||||
"lint-staged": "^15.2.0",
|
||||
"np": "^10.0.5",
|
||||
"prettier": "^3.2.1",
|
||||
"rc-drawer": "^7.0.0",
|
||||
"rc-select": "^14.11.0",
|
||||
"rc-test": "^7.0.14",
|
||||
"react": "^16.9.0",
|
||||
"react-dom": "^16.9.0",
|
||||
"react-draggable": "^4.4.3",
|
||||
"typescript": "^5.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.9.0",
|
||||
"react-dom": ">=16.9.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user