Latest updates from IceHrmPro
This commit is contained in:
34
web/node_modules/rc-drawer/HISTORY.md
generated
vendored
Executable file
34
web/node_modules/rc-drawer/HISTORY.md
generated
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
History
|
||||
|
||||
---
|
||||
|
||||
## 3.0.0
|
||||
|
||||
- Remove `drawerStyle`.
|
||||
|
||||
## 2.1.0
|
||||
|
||||
- Add `drawerStyle`.
|
||||
|
||||
## 1.5.0
|
||||
|
||||
1. Rename `handleChild` -> `handled`, remove `handleStyle`.
|
||||
2. remove `levelTransition`, split into `duration` `ease`.
|
||||
3. add `levelMove`.
|
||||
|
||||
## 1.1.0
|
||||
|
||||
add `maskStyle`;
|
||||
|
||||
## 1.0.0
|
||||
|
||||
### API
|
||||
|
||||
1. remove `openClassName` `width`;
|
||||
2. update `iconChild` -> `handleChild` `onIconClick` -> `onHandleClick` `parent` -> `getContainer`;
|
||||
3. add `handleStyle` `showMask`;
|
||||
|
||||
### Func
|
||||
|
||||
1. add `top` `bottom` placement.
|
||||
2. `handleChild` type remove Array;
|
||||
22
web/node_modules/rc-drawer/LICENSE.md
generated
vendored
Executable file
22
web/node_modules/rc-drawer/LICENSE.md
generated
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
MIT LICENSE
|
||||
|
||||
Copyright (c) 2015-present Alipay.com, https://www.alipay.com/
|
||||
|
||||
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.
|
||||
81
web/node_modules/rc-drawer/README.md
generated
vendored
Executable file
81
web/node_modules/rc-drawer/README.md
generated
vendored
Executable file
@@ -0,0 +1,81 @@
|
||||
# rc-drawer
|
||||
---
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![build status][circleci-image]][circleci-url]
|
||||
[](https://codecov.io/gh/react-component/drawer)
|
||||
[![node version][node-image]][node-url]
|
||||
[![npm download][download-image]][download-url]
|
||||
|
||||
[npm-image]: http://img.shields.io/npm/v/rc-drawer.svg?style=flat-square
|
||||
[npm-url]: http://npmjs.org/package/rc-drawer
|
||||
[circleci-image]: https://img.shields.io/circleci/build/github/react-component/drawer/master.svg?style=flat-square
|
||||
[circleci-url]: https://circleci.com/gh/react-component/drawer/tree/master
|
||||
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
|
||||
[node-url]: http://nodejs.org/download/
|
||||
[download-image]: https://img.shields.io/npm/dm/rc-drawer.svg?style=flat-square
|
||||
[download-url]: https://npmjs.org/package/rc-drawer
|
||||
|
||||
## Example
|
||||
|
||||
http://react-component.github.io/drawer/examples/
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import Drawer from 'rc-drawer';
|
||||
import React from 'react';
|
||||
import ReactDom from 'react-dom';
|
||||
|
||||
ReactDom.render(
|
||||
<Drawer>
|
||||
{menu children}
|
||||
</Drawer>
|
||||
, mountNode);
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
[](https://npmjs.org/package/rc-drawer)
|
||||
|
||||
## Browser Support
|
||||
|
||||
| |  |  |  | |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| IE 10+ ✔ | Chrome 31.0+ ✔ | Firefox 31.0+ ✔ | Opera 30.0+ ✔ | Safari 7.0+ ✔ |
|
||||
|
||||
## API
|
||||
|
||||
| props | type | default | description |
|
||||
|------------|----------------|---------|----------------|
|
||||
| className | string | null | - |
|
||||
| prefixCls | string | 'drawer' | prefix class |
|
||||
| wrapperClassName | string | null | wrapper class name |
|
||||
| width | string \| number | null | drawer content wrapper width, drawer level transition width |
|
||||
| height | string \| number | null | drawer content wrapper height, drawer level transition height |
|
||||
| open | boolean | false | open or close menu |
|
||||
| defaultOpen | boolean | false | default open menu |
|
||||
| handler | boolean \| ReactElement | true | true or false or ReactElement, default: `<divclassName="drawer-handle"><i className="drawer-handle-icon" /></div>`; |
|
||||
| placement | string | `left` | `left` `top` `right` `bottom` |
|
||||
| level | string \| array | `all` | With the drawer level element. `all`/ null / className / id / tagName / array |
|
||||
| levelMove | number \| array \| func | null |level move value. default is drawer width |
|
||||
| duration | string | `.3s` | level animation duration |
|
||||
| ease | string | `cubic-bezier(0.78, 0.14, 0.15, 0.86)` | level animation timing function |
|
||||
| getContainer | string \| func \| HTMLElement | `body` | Return the mount node for Drawer. if is `null` use React.creactElement |
|
||||
| showMask | boolean | true | mask is show |
|
||||
| maskClosable | boolean | true | Clicking on the mask (area outside the Drawer) to close the Drawer or not. |
|
||||
| maskStyle | CSSProperties | null | mask style |
|
||||
| onChange | func | null | change callback(open) |
|
||||
| afterVisibleChange | func | null | transition end callback(open) |
|
||||
| onClose | func | null | close click function |
|
||||
| onHandleClick | func | nul | handle icon click function |
|
||||
| keyboard | Boolean | true | Whether support press esc to close |
|
||||
|
||||
> 2.0 Rename `onMaskClick` -> `onClose`, add `maskClosable`.
|
||||
|
||||
## Development
|
||||
|
||||
```
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
198
web/node_modules/rc-drawer/assets/index.css
generated
vendored
Normal file
198
web/node_modules/rc-drawer/assets/index.css
generated
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
.drawer {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 9999;
|
||||
transition: width 0s ease 0.3s, height 0s ease 0.3s, transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
}
|
||||
.drawer > * {
|
||||
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), opacity 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), box-shadow 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
}
|
||||
.drawer.drawer-open {
|
||||
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
}
|
||||
.drawer .drawer-mask {
|
||||
background: #000;
|
||||
opacity: 0;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transition: opacity 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), height 0s ease 0.3s;
|
||||
}
|
||||
.drawer-content-wrapper {
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
}
|
||||
.drawer-content {
|
||||
overflow: auto;
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
}
|
||||
.drawer-handle {
|
||||
position: absolute;
|
||||
top: 72px;
|
||||
width: 41px;
|
||||
height: 40px;
|
||||
cursor: pointer;
|
||||
z-index: 0;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
}
|
||||
.drawer-handle-icon {
|
||||
width: 14px;
|
||||
height: 2px;
|
||||
background: #333;
|
||||
position: relative;
|
||||
transition: background 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
}
|
||||
.drawer-handle-icon:before,
|
||||
.drawer-handle-icon:after {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
background: #333;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
}
|
||||
.drawer-handle-icon:before {
|
||||
top: -5px;
|
||||
}
|
||||
.drawer-handle-icon:after {
|
||||
top: 5px;
|
||||
}
|
||||
.drawer-left,
|
||||
.drawer-right {
|
||||
width: 0%;
|
||||
height: 100%;
|
||||
}
|
||||
.drawer-left .drawer-content-wrapper,
|
||||
.drawer-right .drawer-content-wrapper,
|
||||
.drawer-left .drawer-content,
|
||||
.drawer-right .drawer-content {
|
||||
height: 100%;
|
||||
}
|
||||
.drawer-left.drawer-open,
|
||||
.drawer-right.drawer-open {
|
||||
width: 100%;
|
||||
}
|
||||
.drawer-left.drawer-open.no-mask,
|
||||
.drawer-right.drawer-open.no-mask {
|
||||
width: 0%;
|
||||
}
|
||||
.drawer-left {
|
||||
left: 0;
|
||||
}
|
||||
.drawer-left .drawer-handle {
|
||||
right: -40px;
|
||||
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
.drawer-left.drawer-open .drawer-content-wrapper {
|
||||
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.drawer-right {
|
||||
right: 0;
|
||||
}
|
||||
.drawer-right .drawer-content-wrapper {
|
||||
right: 0;
|
||||
}
|
||||
.drawer-right .drawer-handle {
|
||||
left: -40px;
|
||||
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
|
||||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
.drawer-right.drawer-open .drawer-content-wrapper {
|
||||
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.drawer-right.drawer-open.no-mask {
|
||||
right: 1px;
|
||||
transform: translateX(1px);
|
||||
}
|
||||
.drawer-top,
|
||||
.drawer-bottom {
|
||||
width: 100%;
|
||||
height: 0%;
|
||||
}
|
||||
.drawer-top .drawer-content-wrapper,
|
||||
.drawer-bottom .drawer-content-wrapper,
|
||||
.drawer-top .drawer-content,
|
||||
.drawer-bottom .drawer-content {
|
||||
width: 100%;
|
||||
}
|
||||
.drawer-top .drawer-content,
|
||||
.drawer-bottom .drawer-content {
|
||||
height: 100%;
|
||||
}
|
||||
.drawer-top.drawer-open,
|
||||
.drawer-bottom.drawer-open {
|
||||
height: 100%;
|
||||
}
|
||||
.drawer-top.drawer-open.no-mask,
|
||||
.drawer-bottom.drawer-open.no-mask {
|
||||
height: 0%;
|
||||
}
|
||||
.drawer-top .drawer-handle,
|
||||
.drawer-bottom .drawer-handle {
|
||||
left: 50%;
|
||||
margin-left: -20px;
|
||||
}
|
||||
.drawer-top {
|
||||
top: 0;
|
||||
}
|
||||
.drawer-top .drawer-handle {
|
||||
top: auto;
|
||||
bottom: -40px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
border-radius: 0 0 4px 4px;
|
||||
}
|
||||
.drawer-top.drawer-open .drawer-content-wrapper {
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.drawer-bottom {
|
||||
bottom: 0;
|
||||
}
|
||||
.drawer-bottom .drawer-content-wrapper {
|
||||
bottom: 0;
|
||||
}
|
||||
.drawer-bottom .drawer-handle {
|
||||
top: -40px;
|
||||
box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
|
||||
border-radius: 4px 4px 0 0;
|
||||
}
|
||||
.drawer-bottom.drawer-open .drawer-content-wrapper {
|
||||
box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.drawer-bottom.drawer-open.no-mask {
|
||||
bottom: 1px;
|
||||
transform: translateY(1px);
|
||||
}
|
||||
.drawer.drawer-open .drawer-mask {
|
||||
opacity: 0.3;
|
||||
height: 100%;
|
||||
animation: rcDrawerFadeIn 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
transition: none;
|
||||
}
|
||||
.drawer.drawer-open .drawer-handle-icon {
|
||||
background: transparent;
|
||||
}
|
||||
.drawer.drawer-open .drawer-handle-icon:before {
|
||||
transform: translateY(5px) rotate(45deg);
|
||||
}
|
||||
.drawer.drawer-open .drawer-handle-icon:after {
|
||||
transform: translateY(-5px) rotate(-45deg);
|
||||
}
|
||||
@keyframes rcDrawerFadeIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 0.3;
|
||||
}
|
||||
}
|
||||
56
web/node_modules/rc-drawer/es/DrawerChild.d.ts
generated
vendored
Normal file
56
web/node_modules/rc-drawer/es/DrawerChild.d.ts
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
import * as React from 'react';
|
||||
import { IDrawerChildProps } from './IDrawerPropTypes';
|
||||
interface IState {
|
||||
_self: DrawerChild;
|
||||
prevProps?: IDrawerChildProps;
|
||||
}
|
||||
declare class DrawerChild extends React.Component<IDrawerChildProps, IState> {
|
||||
static defaultProps: {
|
||||
switchScrollingEffect: () => void;
|
||||
};
|
||||
static getDerivedStateFromProps(props: IDrawerChildProps, { prevProps, _self }: {
|
||||
prevProps: IDrawerChildProps;
|
||||
_self: DrawerChild;
|
||||
}): {
|
||||
prevProps: IDrawerChildProps;
|
||||
};
|
||||
private levelDom;
|
||||
private dom;
|
||||
private contentWrapper;
|
||||
private contentDom;
|
||||
private maskDom;
|
||||
private handlerDom;
|
||||
private drawerId;
|
||||
private timeout;
|
||||
private passive;
|
||||
private startPos;
|
||||
constructor(props: IDrawerChildProps);
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate(prevProps: IDrawerChildProps): void;
|
||||
componentWillUnmount(): void;
|
||||
private domFocus;
|
||||
private removeStartHandler;
|
||||
private removeMoveHandler;
|
||||
private transitionEnd;
|
||||
private onKeyDown;
|
||||
private onWrapperTransitionEnd;
|
||||
private openLevelTransition;
|
||||
private setLevelTransform;
|
||||
private setLevelAndScrolling;
|
||||
private toggleScrollingToDrawerAndBody;
|
||||
private addScrollingEffect;
|
||||
private remScrollingEffect;
|
||||
private getCurrentDrawerSome;
|
||||
private getLevelDom;
|
||||
private getHorizontalBoolAndPlacementName;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
declare const _default: typeof DrawerChild & {
|
||||
prototype: DrawerChild;
|
||||
defaultProps: {
|
||||
switchScrollingEffect: () => void;
|
||||
};
|
||||
getDerivedStateFromProps: typeof DrawerChild.getDerivedStateFromProps;
|
||||
contextType?: React.Context<any>;
|
||||
};
|
||||
export default _default;
|
||||
590
web/node_modules/rc-drawer/es/DrawerChild.js
generated
vendored
Normal file
590
web/node_modules/rc-drawer/es/DrawerChild.js
generated
vendored
Normal file
@@ -0,0 +1,590 @@
|
||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
import classnames from 'classnames';
|
||||
import getScrollBarSize from "rc-util/es/getScrollBarSize";
|
||||
import KeyCode from "rc-util/es/KeyCode";
|
||||
import * as React from 'react';
|
||||
import { polyfill } from 'react-lifecycles-compat';
|
||||
import { addEventListener, dataToArray, getTouchParentScroll, isNumeric, removeEventListener, transformArguments, transitionEnd, transitionStr, windowIsUndefined } from './utils';
|
||||
var currentDrawer = {};
|
||||
|
||||
var DrawerChild =
|
||||
/*#__PURE__*/
|
||||
function (_React$Component) {
|
||||
_inherits(DrawerChild, _React$Component);
|
||||
|
||||
function DrawerChild(props) {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, DrawerChild);
|
||||
|
||||
_this = _possibleConstructorReturn(this, _getPrototypeOf(DrawerChild).call(this, props));
|
||||
|
||||
_this.domFocus = function () {
|
||||
if (_this.dom) {
|
||||
_this.dom.focus();
|
||||
}
|
||||
};
|
||||
|
||||
_this.removeStartHandler = function (e) {
|
||||
if (e.touches.length > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this.startPos = {
|
||||
x: e.touches[0].clientX,
|
||||
y: e.touches[0].clientY
|
||||
};
|
||||
};
|
||||
|
||||
_this.removeMoveHandler = function (e) {
|
||||
if (e.changedTouches.length > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var currentTarget = e.currentTarget;
|
||||
var differX = e.changedTouches[0].clientX - _this.startPos.x;
|
||||
var differY = e.changedTouches[0].clientY - _this.startPos.y;
|
||||
|
||||
if (currentTarget === _this.maskDom || currentTarget === _this.handlerDom || currentTarget === _this.contentDom && getTouchParentScroll(currentTarget, e.target, differX, differY)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
_this.transitionEnd = function (e) {
|
||||
var dom = e.target;
|
||||
removeEventListener(dom, transitionEnd, _this.transitionEnd);
|
||||
dom.style.transition = '';
|
||||
};
|
||||
|
||||
_this.onKeyDown = function (e) {
|
||||
if (e.keyCode === KeyCode.ESC) {
|
||||
var onClose = _this.props.onClose;
|
||||
e.stopPropagation();
|
||||
|
||||
if (onClose) {
|
||||
onClose(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_this.onWrapperTransitionEnd = function (e) {
|
||||
var _this$props = _this.props,
|
||||
open = _this$props.open,
|
||||
afterVisibleChange = _this$props.afterVisibleChange;
|
||||
|
||||
if (e.target === _this.contentWrapper && e.propertyName.match(/transform$/)) {
|
||||
_this.dom.style.transition = '';
|
||||
|
||||
if (!open && _this.getCurrentDrawerSome()) {
|
||||
document.body.style.overflowX = '';
|
||||
|
||||
if (_this.maskDom) {
|
||||
_this.maskDom.style.left = '';
|
||||
_this.maskDom.style.width = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (afterVisibleChange) {
|
||||
afterVisibleChange(!!open);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_this.openLevelTransition = function () {
|
||||
var _this$props2 = _this.props,
|
||||
open = _this$props2.open,
|
||||
width = _this$props2.width,
|
||||
height = _this$props2.height;
|
||||
|
||||
var _this$getHorizontalBo = _this.getHorizontalBoolAndPlacementName(),
|
||||
isHorizontal = _this$getHorizontalBo.isHorizontal,
|
||||
placementName = _this$getHorizontalBo.placementName;
|
||||
|
||||
var contentValue = _this.contentDom ? _this.contentDom.getBoundingClientRect()[isHorizontal ? 'width' : 'height'] : 0;
|
||||
var value = (isHorizontal ? width : height) || contentValue;
|
||||
|
||||
_this.setLevelAndScrolling(open, placementName, value);
|
||||
};
|
||||
|
||||
_this.setLevelTransform = function (open, placementName, value, right) {
|
||||
var _this$props3 = _this.props,
|
||||
placement = _this$props3.placement,
|
||||
levelMove = _this$props3.levelMove,
|
||||
duration = _this$props3.duration,
|
||||
ease = _this$props3.ease,
|
||||
showMask = _this$props3.showMask; // router 切换时可能会导至页面失去滚动条,所以需要时时获取。
|
||||
|
||||
_this.levelDom.forEach(function (dom) {
|
||||
dom.style.transition = "transform ".concat(duration, " ").concat(ease);
|
||||
addEventListener(dom, transitionEnd, _this.transitionEnd);
|
||||
var levelValue = open ? value : 0;
|
||||
|
||||
if (levelMove) {
|
||||
var $levelMove = transformArguments(levelMove, {
|
||||
target: dom,
|
||||
open: open
|
||||
});
|
||||
levelValue = open ? $levelMove[0] : $levelMove[1] || 0;
|
||||
}
|
||||
|
||||
var $value = typeof levelValue === 'number' ? "".concat(levelValue, "px") : levelValue;
|
||||
var placementPos = placement === 'left' || placement === 'top' ? $value : "-".concat($value);
|
||||
placementPos = showMask && placement === 'right' && right ? "calc(".concat(placementPos, " + ").concat(right, "px)") : placementPos;
|
||||
dom.style.transform = levelValue ? "".concat(placementName, "(").concat(placementPos, ")") : '';
|
||||
});
|
||||
};
|
||||
|
||||
_this.setLevelAndScrolling = function (open, placementName, value) {
|
||||
var onChange = _this.props.onChange;
|
||||
|
||||
if (!windowIsUndefined) {
|
||||
var right = document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth ? getScrollBarSize(true) : 0;
|
||||
|
||||
_this.setLevelTransform(open, placementName, value, right);
|
||||
|
||||
_this.toggleScrollingToDrawerAndBody(right);
|
||||
}
|
||||
|
||||
if (onChange) {
|
||||
onChange(open);
|
||||
}
|
||||
};
|
||||
|
||||
_this.toggleScrollingToDrawerAndBody = function (right) {
|
||||
var _this$props4 = _this.props,
|
||||
getOpenCount = _this$props4.getOpenCount,
|
||||
getContainer = _this$props4.getContainer,
|
||||
showMask = _this$props4.showMask,
|
||||
open = _this$props4.open;
|
||||
var container = getContainer && getContainer();
|
||||
var openCount = getOpenCount && getOpenCount(); // 处理 body 滚动
|
||||
|
||||
if (container && container.parentNode === document.body && showMask) {
|
||||
var eventArray = ['touchstart'];
|
||||
var domArray = [document.body, _this.maskDom, _this.handlerDom, _this.contentDom];
|
||||
|
||||
if (open && document.body.style.overflow !== 'hidden') {
|
||||
if (right) {
|
||||
_this.addScrollingEffect(right);
|
||||
}
|
||||
|
||||
if (openCount === 1) {
|
||||
document.body.style.overflow = 'hidden';
|
||||
}
|
||||
|
||||
document.body.style.touchAction = 'none'; // 手机禁滚
|
||||
|
||||
domArray.forEach(function (item, i) {
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
|
||||
addEventListener(item, eventArray[i] || 'touchmove', i ? _this.removeMoveHandler : _this.removeStartHandler, _this.passive);
|
||||
});
|
||||
} else if (_this.getCurrentDrawerSome()) {
|
||||
// 没有弹框的状态下清除 overflow;
|
||||
if (!openCount) {
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
|
||||
document.body.style.touchAction = '';
|
||||
|
||||
if (right) {
|
||||
_this.remScrollingEffect(right);
|
||||
} // 恢复事件
|
||||
|
||||
|
||||
domArray.forEach(function (item, i) {
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
|
||||
removeEventListener(item, eventArray[i] || 'touchmove', i ? _this.removeMoveHandler : _this.removeStartHandler, _this.passive);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_this.addScrollingEffect = function (right) {
|
||||
var _this$props5 = _this.props,
|
||||
placement = _this$props5.placement,
|
||||
duration = _this$props5.duration,
|
||||
ease = _this$props5.ease,
|
||||
getOpenCount = _this$props5.getOpenCount,
|
||||
switchScrollingEffect = _this$props5.switchScrollingEffect;
|
||||
var openCount = getOpenCount && getOpenCount();
|
||||
|
||||
if (openCount === 1) {
|
||||
switchScrollingEffect();
|
||||
}
|
||||
|
||||
var widthTransition = "width ".concat(duration, " ").concat(ease);
|
||||
var transformTransition = "transform ".concat(duration, " ").concat(ease);
|
||||
_this.dom.style.transition = 'none';
|
||||
|
||||
switch (placement) {
|
||||
case 'right':
|
||||
_this.dom.style.transform = "translateX(-".concat(right, "px)");
|
||||
break;
|
||||
|
||||
case 'top':
|
||||
case 'bottom':
|
||||
_this.dom.style.width = "calc(100% - ".concat(right, "px)");
|
||||
_this.dom.style.transform = 'translateZ(0)';
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
clearTimeout(_this.timeout);
|
||||
_this.timeout = setTimeout(function () {
|
||||
if (_this.dom) {
|
||||
_this.dom.style.transition = "".concat(transformTransition, ",").concat(widthTransition);
|
||||
_this.dom.style.width = '';
|
||||
_this.dom.style.transform = '';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
_this.remScrollingEffect = function (right) {
|
||||
var _this$props6 = _this.props,
|
||||
placement = _this$props6.placement,
|
||||
duration = _this$props6.duration,
|
||||
ease = _this$props6.ease,
|
||||
getOpenCount = _this$props6.getOpenCount,
|
||||
switchScrollingEffect = _this$props6.switchScrollingEffect;
|
||||
var openCount = getOpenCount && getOpenCount();
|
||||
|
||||
if (!openCount) {
|
||||
switchScrollingEffect(true);
|
||||
}
|
||||
|
||||
if (transitionStr) {
|
||||
document.body.style.overflowX = 'hidden';
|
||||
}
|
||||
|
||||
_this.dom.style.transition = 'none';
|
||||
var heightTransition;
|
||||
var widthTransition = "width ".concat(duration, " ").concat(ease);
|
||||
var transformTransition = "transform ".concat(duration, " ").concat(ease);
|
||||
|
||||
switch (placement) {
|
||||
case 'left':
|
||||
{
|
||||
_this.dom.style.width = '100%';
|
||||
widthTransition = "width 0s ".concat(ease, " ").concat(duration);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'right':
|
||||
{
|
||||
_this.dom.style.transform = "translateX(".concat(right, "px)");
|
||||
_this.dom.style.width = '100%';
|
||||
widthTransition = "width 0s ".concat(ease, " ").concat(duration);
|
||||
|
||||
if (_this.maskDom) {
|
||||
_this.maskDom.style.left = "-".concat(right, "px");
|
||||
_this.maskDom.style.width = "calc(100% + ".concat(right, "px)");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'top':
|
||||
case 'bottom':
|
||||
{
|
||||
_this.dom.style.width = "calc(100% + ".concat(right, "px)");
|
||||
_this.dom.style.height = '100%';
|
||||
_this.dom.style.transform = 'translateZ(0)';
|
||||
heightTransition = "height 0s ".concat(ease, " ").concat(duration);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
clearTimeout(_this.timeout);
|
||||
_this.timeout = setTimeout(function () {
|
||||
if (_this.dom) {
|
||||
_this.dom.style.transition = "".concat(transformTransition, ",").concat(heightTransition ? "".concat(heightTransition, ",") : '').concat(widthTransition);
|
||||
_this.dom.style.transform = '';
|
||||
_this.dom.style.width = '';
|
||||
_this.dom.style.height = '';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
_this.getCurrentDrawerSome = function () {
|
||||
return !Object.keys(currentDrawer).some(function (key) {
|
||||
return currentDrawer[key];
|
||||
});
|
||||
};
|
||||
|
||||
_this.getLevelDom = function (_ref) {
|
||||
var level = _ref.level,
|
||||
getContainer = _ref.getContainer;
|
||||
|
||||
if (windowIsUndefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
var container = getContainer && getContainer();
|
||||
var parent = container ? container.parentNode : null;
|
||||
_this.levelDom = [];
|
||||
|
||||
if (level === 'all') {
|
||||
var children = parent ? Array.prototype.slice.call(parent.children) : [];
|
||||
children.forEach(function (child) {
|
||||
if (child.nodeName !== 'SCRIPT' && child.nodeName !== 'STYLE' && child.nodeName !== 'LINK' && child !== container) {
|
||||
_this.levelDom.push(child);
|
||||
}
|
||||
});
|
||||
} else if (level) {
|
||||
dataToArray(level).forEach(function (key) {
|
||||
document.querySelectorAll(key).forEach(function (item) {
|
||||
_this.levelDom.push(item);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_this.getHorizontalBoolAndPlacementName = function () {
|
||||
var placement = _this.props.placement;
|
||||
var isHorizontal = placement === 'left' || placement === 'right';
|
||||
var placementName = "translate".concat(isHorizontal ? 'X' : 'Y');
|
||||
return {
|
||||
isHorizontal: isHorizontal,
|
||||
placementName: placementName
|
||||
};
|
||||
};
|
||||
|
||||
_this.state = {
|
||||
_self: _assertThisInitialized(_this)
|
||||
};
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(DrawerChild, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
var _this2 = this;
|
||||
|
||||
if (!windowIsUndefined) {
|
||||
var passiveSupported = false;
|
||||
|
||||
try {
|
||||
window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
|
||||
get: function get() {
|
||||
passiveSupported = true;
|
||||
return null;
|
||||
}
|
||||
}));
|
||||
} catch (err) {}
|
||||
|
||||
this.passive = passiveSupported ? {
|
||||
passive: false
|
||||
} : false;
|
||||
}
|
||||
|
||||
var open = this.props.open;
|
||||
this.drawerId = "drawer_id_".concat(Number((Date.now() + Math.random()).toString().replace('.', Math.round(Math.random() * 9).toString())).toString(16));
|
||||
this.getLevelDom(this.props);
|
||||
|
||||
if (open) {
|
||||
currentDrawer[this.drawerId] = open; // 默认打开状态时推出 level;
|
||||
|
||||
this.openLevelTransition();
|
||||
this.forceUpdate(function () {
|
||||
_this2.domFocus();
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(prevProps) {
|
||||
var open = this.props.open;
|
||||
|
||||
if (open !== prevProps.open) {
|
||||
if (open) {
|
||||
this.domFocus();
|
||||
}
|
||||
|
||||
currentDrawer[this.drawerId] = !!open;
|
||||
this.openLevelTransition();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
var _this$props7 = this.props,
|
||||
getOpenCount = _this$props7.getOpenCount,
|
||||
open = _this$props7.open,
|
||||
switchScrollingEffect = _this$props7.switchScrollingEffect;
|
||||
var openCount = typeof getOpenCount === 'function' && getOpenCount();
|
||||
delete currentDrawer[this.drawerId];
|
||||
|
||||
if (open) {
|
||||
this.setLevelTransform(false);
|
||||
document.body.style.touchAction = '';
|
||||
}
|
||||
|
||||
if (!openCount) {
|
||||
document.body.style.overflow = '';
|
||||
switchScrollingEffect(true);
|
||||
}
|
||||
} // tslint:disable-next-line:member-ordering
|
||||
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _classnames,
|
||||
_this3 = this;
|
||||
|
||||
var _this$props8 = this.props,
|
||||
className = _this$props8.className,
|
||||
children = _this$props8.children,
|
||||
style = _this$props8.style,
|
||||
width = _this$props8.width,
|
||||
height = _this$props8.height,
|
||||
defaultOpen = _this$props8.defaultOpen,
|
||||
$open = _this$props8.open,
|
||||
prefixCls = _this$props8.prefixCls,
|
||||
placement = _this$props8.placement,
|
||||
level = _this$props8.level,
|
||||
levelMove = _this$props8.levelMove,
|
||||
ease = _this$props8.ease,
|
||||
duration = _this$props8.duration,
|
||||
getContainer = _this$props8.getContainer,
|
||||
handler = _this$props8.handler,
|
||||
onChange = _this$props8.onChange,
|
||||
afterVisibleChange = _this$props8.afterVisibleChange,
|
||||
showMask = _this$props8.showMask,
|
||||
maskClosable = _this$props8.maskClosable,
|
||||
maskStyle = _this$props8.maskStyle,
|
||||
onClose = _this$props8.onClose,
|
||||
onHandleClick = _this$props8.onHandleClick,
|
||||
keyboard = _this$props8.keyboard,
|
||||
getOpenCount = _this$props8.getOpenCount,
|
||||
switchScrollingEffect = _this$props8.switchScrollingEffect,
|
||||
props = _objectWithoutProperties(_this$props8, ["className", "children", "style", "width", "height", "defaultOpen", "open", "prefixCls", "placement", "level", "levelMove", "ease", "duration", "getContainer", "handler", "onChange", "afterVisibleChange", "showMask", "maskClosable", "maskStyle", "onClose", "onHandleClick", "keyboard", "getOpenCount", "switchScrollingEffect"]); // 首次渲染都将是关闭状态。
|
||||
|
||||
|
||||
var open = this.dom ? $open : false;
|
||||
var wrapperClassName = classnames(prefixCls, (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-").concat(placement), true), _defineProperty(_classnames, "".concat(prefixCls, "-open"), open), _defineProperty(_classnames, className || '', !!className), _defineProperty(_classnames, 'no-mask', !showMask), _classnames));
|
||||
|
||||
var _this$getHorizontalBo2 = this.getHorizontalBoolAndPlacementName(),
|
||||
placementName = _this$getHorizontalBo2.placementName; // 百分比与像素动画不同步,第一次打用后全用像素动画。
|
||||
// const defaultValue = !this.contentDom || !level ? '100%' : `${value}px`;
|
||||
|
||||
|
||||
var placementPos = placement === 'left' || placement === 'top' ? '-100%' : '100%';
|
||||
var transform = open ? '' : "".concat(placementName, "(").concat(placementPos, ")");
|
||||
var handlerChildren = handler && React.cloneElement(handler, {
|
||||
onClick: function onClick(e) {
|
||||
if (handler.props.onClick) {
|
||||
handler.props.onClick();
|
||||
}
|
||||
|
||||
if (onHandleClick) {
|
||||
onHandleClick(e);
|
||||
}
|
||||
},
|
||||
ref: function ref(c) {
|
||||
_this3.handlerDom = c;
|
||||
}
|
||||
});
|
||||
return React.createElement("div", Object.assign({}, props, {
|
||||
tabIndex: -1,
|
||||
className: wrapperClassName,
|
||||
style: style,
|
||||
ref: function ref(c) {
|
||||
_this3.dom = c;
|
||||
},
|
||||
onKeyDown: open && keyboard ? this.onKeyDown : undefined,
|
||||
onTransitionEnd: this.onWrapperTransitionEnd
|
||||
}), showMask && React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-mask"),
|
||||
onClick: maskClosable ? onClose : undefined,
|
||||
style: maskStyle,
|
||||
ref: function ref(c) {
|
||||
_this3.maskDom = c;
|
||||
}
|
||||
}), React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-content-wrapper"),
|
||||
style: {
|
||||
transform: transform,
|
||||
msTransform: transform,
|
||||
width: isNumeric(width) ? "".concat(width, "px") : width,
|
||||
height: isNumeric(height) ? "".concat(height, "px") : height
|
||||
},
|
||||
ref: function ref(c) {
|
||||
_this3.contentWrapper = c;
|
||||
}
|
||||
}, React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-content"),
|
||||
ref: function ref(c) {
|
||||
_this3.contentDom = c;
|
||||
},
|
||||
onTouchStart: open && showMask ? this.removeStartHandler : undefined,
|
||||
onTouchMove: open && showMask ? this.removeMoveHandler : undefined
|
||||
}, children), handlerChildren));
|
||||
}
|
||||
}], [{
|
||||
key: "getDerivedStateFromProps",
|
||||
value: function getDerivedStateFromProps(props, _ref2) {
|
||||
var prevProps = _ref2.prevProps,
|
||||
_self = _ref2._self;
|
||||
var nextState = {
|
||||
prevProps: props
|
||||
};
|
||||
|
||||
if (prevProps !== undefined) {
|
||||
var placement = props.placement,
|
||||
level = props.level;
|
||||
|
||||
if (placement !== prevProps.placement) {
|
||||
// test 的 bug, 有动画过场,删除 dom
|
||||
_self.contentDom = null;
|
||||
}
|
||||
|
||||
if (level !== prevProps.level) {
|
||||
_self.getLevelDom(props);
|
||||
}
|
||||
}
|
||||
|
||||
return nextState;
|
||||
}
|
||||
}]);
|
||||
|
||||
return DrawerChild;
|
||||
}(React.Component);
|
||||
|
||||
DrawerChild.defaultProps = {
|
||||
switchScrollingEffect: function switchScrollingEffect() {}
|
||||
};
|
||||
export default polyfill(DrawerChild);
|
||||
62
web/node_modules/rc-drawer/es/DrawerWrapper.d.ts
generated
vendored
Normal file
62
web/node_modules/rc-drawer/es/DrawerWrapper.d.ts
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import * as React from 'react';
|
||||
import { IDrawerProps } from './IDrawerPropTypes';
|
||||
interface IState {
|
||||
open: boolean;
|
||||
}
|
||||
declare class DrawerWrapper extends React.Component<IDrawerProps, IState> {
|
||||
static defaultProps: {
|
||||
prefixCls: string;
|
||||
placement: string;
|
||||
getContainer: string;
|
||||
defaultOpen: boolean;
|
||||
level: string;
|
||||
duration: string;
|
||||
ease: string;
|
||||
onChange: () => void;
|
||||
afterVisibleChange: () => void;
|
||||
handler: JSX.Element;
|
||||
showMask: boolean;
|
||||
maskClosable: boolean;
|
||||
maskStyle: {};
|
||||
wrapperClassName: string;
|
||||
className: string;
|
||||
keyboard: boolean;
|
||||
forceRender: boolean;
|
||||
};
|
||||
static getDerivedStateFromProps(props: IDrawerProps, { prevProps }: {
|
||||
prevProps: IDrawerProps;
|
||||
}): {
|
||||
open?: boolean;
|
||||
prevProps: IDrawerProps;
|
||||
};
|
||||
dom: HTMLElement | null;
|
||||
constructor(props: IDrawerProps);
|
||||
private onHandleClick;
|
||||
private onClose;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
declare const _default: typeof DrawerWrapper & {
|
||||
prototype: DrawerWrapper;
|
||||
defaultProps: {
|
||||
prefixCls: string;
|
||||
placement: string;
|
||||
getContainer: string;
|
||||
defaultOpen: boolean;
|
||||
level: string;
|
||||
duration: string;
|
||||
ease: string;
|
||||
onChange: () => void;
|
||||
afterVisibleChange: () => void;
|
||||
handler: JSX.Element;
|
||||
showMask: boolean;
|
||||
maskClosable: boolean;
|
||||
maskStyle: {};
|
||||
wrapperClassName: string;
|
||||
className: string;
|
||||
keyboard: boolean;
|
||||
forceRender: boolean;
|
||||
};
|
||||
getDerivedStateFromProps: typeof DrawerWrapper.getDerivedStateFromProps;
|
||||
contextType?: React.Context<any>;
|
||||
};
|
||||
export default _default;
|
||||
184
web/node_modules/rc-drawer/es/DrawerWrapper.js
generated
vendored
Normal file
184
web/node_modules/rc-drawer/es/DrawerWrapper.js
generated
vendored
Normal file
@@ -0,0 +1,184 @@
|
||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
import Portal from "rc-util/es/PortalWrapper";
|
||||
import * as React from 'react';
|
||||
import { polyfill } from 'react-lifecycles-compat';
|
||||
import Child from './DrawerChild';
|
||||
|
||||
var DrawerWrapper =
|
||||
/*#__PURE__*/
|
||||
function (_React$Component) {
|
||||
_inherits(DrawerWrapper, _React$Component);
|
||||
|
||||
function DrawerWrapper(props) {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, DrawerWrapper);
|
||||
|
||||
_this = _possibleConstructorReturn(this, _getPrototypeOf(DrawerWrapper).call(this, props));
|
||||
|
||||
_this.onHandleClick = function (e) {
|
||||
var _this$props = _this.props,
|
||||
onHandleClick = _this$props.onHandleClick,
|
||||
$open = _this$props.open;
|
||||
|
||||
if (onHandleClick) {
|
||||
onHandleClick(e);
|
||||
}
|
||||
|
||||
if (typeof $open === 'undefined') {
|
||||
var _open = _this.state.open;
|
||||
|
||||
_this.setState({
|
||||
open: !_open
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_this.onClose = function (e) {
|
||||
var _this$props2 = _this.props,
|
||||
onClose = _this$props2.onClose,
|
||||
open = _this$props2.open;
|
||||
|
||||
if (onClose) {
|
||||
onClose(e);
|
||||
}
|
||||
|
||||
if (typeof open === 'undefined') {
|
||||
_this.setState({
|
||||
open: false
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var open = typeof props.open !== 'undefined' ? props.open : !!props.defaultOpen;
|
||||
_this.state = {
|
||||
open: open
|
||||
};
|
||||
|
||||
if ('onMaskClick' in props) {
|
||||
console.warn('`onMaskClick` are removed, please use `onClose` instead.');
|
||||
}
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(DrawerWrapper, [{
|
||||
key: "render",
|
||||
// tslint:disable-next-line:member-ordering
|
||||
value: function render() {
|
||||
var _this2 = this;
|
||||
|
||||
var _this$props3 = this.props,
|
||||
defaultOpen = _this$props3.defaultOpen,
|
||||
getContainer = _this$props3.getContainer,
|
||||
wrapperClassName = _this$props3.wrapperClassName,
|
||||
forceRender = _this$props3.forceRender,
|
||||
handler = _this$props3.handler,
|
||||
props = _objectWithoutProperties(_this$props3, ["defaultOpen", "getContainer", "wrapperClassName", "forceRender", "handler"]);
|
||||
|
||||
var open = this.state.open; // 渲染在当前 dom 里;
|
||||
|
||||
if (!getContainer) {
|
||||
return React.createElement("div", {
|
||||
className: wrapperClassName,
|
||||
ref: function ref(c) {
|
||||
_this2.dom = c;
|
||||
}
|
||||
}, React.createElement(Child, Object.assign({}, props, {
|
||||
open: open,
|
||||
handler: handler,
|
||||
getContainer: function getContainer() {
|
||||
return _this2.dom;
|
||||
},
|
||||
onClose: this.onClose,
|
||||
onHandleClick: this.onHandleClick
|
||||
})));
|
||||
} // 如果有 handler 为内置强制渲染;
|
||||
|
||||
|
||||
var $forceRender = !!handler || forceRender;
|
||||
return React.createElement(Portal, {
|
||||
visible: open,
|
||||
forceRender: $forceRender,
|
||||
getContainer: getContainer,
|
||||
wrapperClassName: wrapperClassName
|
||||
}, function (_ref) {
|
||||
var visible = _ref.visible,
|
||||
afterClose = _ref.afterClose,
|
||||
rest = _objectWithoutProperties(_ref, ["visible", "afterClose"]);
|
||||
|
||||
return (// react 15,componentWillUnmount 时 Portal 返回 afterClose, visible.
|
||||
React.createElement(Child, Object.assign({}, props, rest, {
|
||||
open: visible !== undefined ? visible : open,
|
||||
afterVisibleChange: afterClose !== undefined ? afterClose : props.afterVisibleChange,
|
||||
handler: handler,
|
||||
onClose: _this2.onClose,
|
||||
onHandleClick: _this2.onHandleClick
|
||||
}))
|
||||
);
|
||||
});
|
||||
}
|
||||
}], [{
|
||||
key: "getDerivedStateFromProps",
|
||||
value: function getDerivedStateFromProps(props, _ref2) {
|
||||
var prevProps = _ref2.prevProps;
|
||||
var newState = {
|
||||
prevProps: props
|
||||
};
|
||||
|
||||
if (typeof prevProps !== 'undefined' && props.open !== prevProps.open) {
|
||||
newState.open = props.open;
|
||||
}
|
||||
|
||||
return newState;
|
||||
}
|
||||
}]);
|
||||
|
||||
return DrawerWrapper;
|
||||
}(React.Component);
|
||||
|
||||
DrawerWrapper.defaultProps = {
|
||||
prefixCls: 'drawer',
|
||||
placement: 'left',
|
||||
getContainer: 'body',
|
||||
defaultOpen: false,
|
||||
level: 'all',
|
||||
duration: '.3s',
|
||||
ease: 'cubic-bezier(0.78, 0.14, 0.15, 0.86)',
|
||||
onChange: function onChange() {},
|
||||
afterVisibleChange: function afterVisibleChange() {},
|
||||
handler: React.createElement("div", {
|
||||
className: "drawer-handle"
|
||||
}, React.createElement("i", {
|
||||
className: "drawer-handle-icon"
|
||||
})),
|
||||
showMask: true,
|
||||
maskClosable: true,
|
||||
maskStyle: {},
|
||||
wrapperClassName: '',
|
||||
className: '',
|
||||
keyboard: true,
|
||||
forceRender: false
|
||||
};
|
||||
export default polyfill(DrawerWrapper);
|
||||
40
web/node_modules/rc-drawer/es/IDrawerPropTypes.d.ts
generated
vendored
Normal file
40
web/node_modules/rc-drawer/es/IDrawerPropTypes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import * as React from 'react';
|
||||
export declare type IPlacement = 'left' | 'top' | 'right' | 'bottom';
|
||||
declare type ILevelMove = number | [number, number];
|
||||
declare type IStringOrHtmlElement = string | HTMLElement;
|
||||
declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
||||
interface IProps extends Omit<React.HTMLAttributes<any>, 'onChange'> {
|
||||
prefixCls?: string;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
open?: boolean;
|
||||
defaultOpen?: boolean;
|
||||
handler?: React.ReactElement | null | false;
|
||||
placement?: IPlacement;
|
||||
level?: null | string | string[];
|
||||
levelMove?: ILevelMove | ((e: {
|
||||
target: HTMLElement;
|
||||
open: boolean;
|
||||
}) => ILevelMove);
|
||||
duration?: string;
|
||||
ease?: string;
|
||||
showMask?: boolean;
|
||||
maskClosable?: boolean;
|
||||
maskStyle?: React.CSSProperties;
|
||||
onChange?: ((open?: boolean) => void);
|
||||
afterVisibleChange?: ((open: boolean) => void);
|
||||
onHandleClick?: ((e: React.MouseEvent | React.KeyboardEvent) => void);
|
||||
onClose?: ((e: React.MouseEvent | React.KeyboardEvent) => void);
|
||||
keyboard?: boolean;
|
||||
}
|
||||
export interface IDrawerProps extends IProps {
|
||||
wrapperClassName?: string;
|
||||
forceRender?: boolean;
|
||||
getContainer?: IStringOrHtmlElement | (() => IStringOrHtmlElement) | null | false;
|
||||
}
|
||||
export interface IDrawerChildProps extends IProps {
|
||||
getContainer?: () => HTMLElement;
|
||||
getOpenCount?: () => number;
|
||||
switchScrollingEffect?: (close?: boolean) => void;
|
||||
}
|
||||
export {};
|
||||
0
web/node_modules/rc-drawer/es/IDrawerPropTypes.js
generated
vendored
Normal file
0
web/node_modules/rc-drawer/es/IDrawerPropTypes.js
generated
vendored
Normal file
2
web/node_modules/rc-drawer/es/index.d.ts
generated
vendored
Normal file
2
web/node_modules/rc-drawer/es/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import Drawer from './DrawerWrapper';
|
||||
export default Drawer;
|
||||
3
web/node_modules/rc-drawer/es/index.js
generated
vendored
Normal file
3
web/node_modules/rc-drawer/es/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
// export this package's api
|
||||
import Drawer from './DrawerWrapper';
|
||||
export default Drawer;
|
||||
10
web/node_modules/rc-drawer/es/utils.d.ts
generated
vendored
Normal file
10
web/node_modules/rc-drawer/es/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference types="react" />
|
||||
export declare function dataToArray(vars: any): any[];
|
||||
export declare const transitionStr: string;
|
||||
export declare const transitionEnd: string;
|
||||
export declare function addEventListener(target: HTMLElement, eventType: string, callback: (e: React.TouchEvent | TouchEvent | Event) => void, options?: any): void;
|
||||
export declare function removeEventListener(target: HTMLElement, eventType: string, callback: (e: React.TouchEvent | TouchEvent | Event) => void, options?: any): void;
|
||||
export declare function transformArguments(arg: any, cb: any): any[];
|
||||
export declare const isNumeric: (value: string | number) => boolean;
|
||||
export declare const windowIsUndefined: boolean;
|
||||
export declare const getTouchParentScroll: (root: HTMLElement, currentTarget: HTMLElement | Document, differX: number, differY: number) => boolean;
|
||||
81
web/node_modules/rc-drawer/es/utils.js
generated
vendored
Normal file
81
web/node_modules/rc-drawer/es/utils.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
export function dataToArray(vars) {
|
||||
if (Array.isArray(vars)) {
|
||||
return vars;
|
||||
}
|
||||
|
||||
return [vars];
|
||||
}
|
||||
var transitionEndObject = {
|
||||
transition: 'transitionend',
|
||||
WebkitTransition: 'webkitTransitionEnd',
|
||||
MozTransition: 'transitionend',
|
||||
OTransition: 'oTransitionEnd otransitionend'
|
||||
};
|
||||
export var transitionStr = Object.keys(transitionEndObject).filter(function (key) {
|
||||
if (typeof document === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var html = document.getElementsByTagName('html')[0];
|
||||
return key in (html ? html.style : {});
|
||||
})[0];
|
||||
export var transitionEnd = transitionEndObject[transitionStr];
|
||||
export function addEventListener(target, eventType, callback, options) {
|
||||
if (target.addEventListener) {
|
||||
target.addEventListener(eventType, callback, options);
|
||||
} else if (target.attachEvent) {
|
||||
// tslint:disable-line
|
||||
target.attachEvent("on".concat(eventType), callback); // tslint:disable-line
|
||||
}
|
||||
}
|
||||
export function removeEventListener(target, eventType, callback, options) {
|
||||
if (target.removeEventListener) {
|
||||
target.removeEventListener(eventType, callback, options);
|
||||
} else if (target.attachEvent) {
|
||||
// tslint:disable-line
|
||||
target.detachEvent("on".concat(eventType), callback); // tslint:disable-line
|
||||
}
|
||||
}
|
||||
export function transformArguments(arg, cb) {
|
||||
var result = typeof arg === 'function' ? arg(cb) : arg;
|
||||
|
||||
if (Array.isArray(result)) {
|
||||
if (result.length === 2) {
|
||||
return result;
|
||||
}
|
||||
|
||||
return [result[0], result[1]];
|
||||
}
|
||||
|
||||
return [result];
|
||||
}
|
||||
export var isNumeric = function isNumeric(value) {
|
||||
return !isNaN(parseFloat(value)) && isFinite(value);
|
||||
};
|
||||
export var windowIsUndefined = !(typeof window !== 'undefined' && window.document && window.document.createElement);
|
||||
export var getTouchParentScroll = function getTouchParentScroll(root, currentTarget, differX, differY) {
|
||||
if (!currentTarget || currentTarget === document || currentTarget instanceof Document) {
|
||||
return false;
|
||||
} // root 为 drawer-content 设定了 overflow, 判断为 root 的 parent 时结束滚动;
|
||||
|
||||
|
||||
if (currentTarget === root.parentNode) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var isY = Math.max(Math.abs(differX), Math.abs(differY)) === Math.abs(differY);
|
||||
var isX = Math.max(Math.abs(differX), Math.abs(differY)) === Math.abs(differX);
|
||||
var scrollY = currentTarget.scrollHeight - currentTarget.clientHeight;
|
||||
var scrollX = currentTarget.scrollWidth - currentTarget.clientWidth;
|
||||
var style = document.defaultView.getComputedStyle(currentTarget);
|
||||
var overflowY = style.overflowY === 'auto' || style.overflowY === 'scroll';
|
||||
var overflowX = style.overflowX === 'auto' || style.overflowX === 'scroll';
|
||||
var y = scrollY && overflowY;
|
||||
var x = scrollX && overflowX;
|
||||
|
||||
if (isY && (!y || y && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!x || x && (currentTarget.scrollLeft >= scrollX && scrollX < 0 || currentTarget.scrollLeft <= 0 && scrollX > 0))) {
|
||||
return getTouchParentScroll(root, currentTarget.parentNode, differX, differY);
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
56
web/node_modules/rc-drawer/lib/DrawerChild.d.ts
generated
vendored
Normal file
56
web/node_modules/rc-drawer/lib/DrawerChild.d.ts
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
import * as React from 'react';
|
||||
import { IDrawerChildProps } from './IDrawerPropTypes';
|
||||
interface IState {
|
||||
_self: DrawerChild;
|
||||
prevProps?: IDrawerChildProps;
|
||||
}
|
||||
declare class DrawerChild extends React.Component<IDrawerChildProps, IState> {
|
||||
static defaultProps: {
|
||||
switchScrollingEffect: () => void;
|
||||
};
|
||||
static getDerivedStateFromProps(props: IDrawerChildProps, { prevProps, _self }: {
|
||||
prevProps: IDrawerChildProps;
|
||||
_self: DrawerChild;
|
||||
}): {
|
||||
prevProps: IDrawerChildProps;
|
||||
};
|
||||
private levelDom;
|
||||
private dom;
|
||||
private contentWrapper;
|
||||
private contentDom;
|
||||
private maskDom;
|
||||
private handlerDom;
|
||||
private drawerId;
|
||||
private timeout;
|
||||
private passive;
|
||||
private startPos;
|
||||
constructor(props: IDrawerChildProps);
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate(prevProps: IDrawerChildProps): void;
|
||||
componentWillUnmount(): void;
|
||||
private domFocus;
|
||||
private removeStartHandler;
|
||||
private removeMoveHandler;
|
||||
private transitionEnd;
|
||||
private onKeyDown;
|
||||
private onWrapperTransitionEnd;
|
||||
private openLevelTransition;
|
||||
private setLevelTransform;
|
||||
private setLevelAndScrolling;
|
||||
private toggleScrollingToDrawerAndBody;
|
||||
private addScrollingEffect;
|
||||
private remScrollingEffect;
|
||||
private getCurrentDrawerSome;
|
||||
private getLevelDom;
|
||||
private getHorizontalBoolAndPlacementName;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
declare const _default: typeof DrawerChild & {
|
||||
prototype: DrawerChild;
|
||||
defaultProps: {
|
||||
switchScrollingEffect: () => void;
|
||||
};
|
||||
getDerivedStateFromProps: typeof DrawerChild.getDerivedStateFromProps;
|
||||
contextType?: React.Context<any>;
|
||||
};
|
||||
export default _default;
|
||||
612
web/node_modules/rc-drawer/lib/DrawerChild.js
generated
vendored
Normal file
612
web/node_modules/rc-drawer/lib/DrawerChild.js
generated
vendored
Normal file
@@ -0,0 +1,612 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _classnames2 = _interopRequireDefault(require("classnames"));
|
||||
|
||||
var _getScrollBarSize = _interopRequireDefault(require("rc-util/lib/getScrollBarSize"));
|
||||
|
||||
var _KeyCode = _interopRequireDefault(require("rc-util/lib/KeyCode"));
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _reactLifecyclesCompat = require("react-lifecycles-compat");
|
||||
|
||||
var _utils = require("./utils");
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
var currentDrawer = {};
|
||||
|
||||
var DrawerChild =
|
||||
/*#__PURE__*/
|
||||
function (_React$Component) {
|
||||
_inherits(DrawerChild, _React$Component);
|
||||
|
||||
function DrawerChild(props) {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, DrawerChild);
|
||||
|
||||
_this = _possibleConstructorReturn(this, _getPrototypeOf(DrawerChild).call(this, props));
|
||||
|
||||
_this.domFocus = function () {
|
||||
if (_this.dom) {
|
||||
_this.dom.focus();
|
||||
}
|
||||
};
|
||||
|
||||
_this.removeStartHandler = function (e) {
|
||||
if (e.touches.length > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this.startPos = {
|
||||
x: e.touches[0].clientX,
|
||||
y: e.touches[0].clientY
|
||||
};
|
||||
};
|
||||
|
||||
_this.removeMoveHandler = function (e) {
|
||||
if (e.changedTouches.length > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var currentTarget = e.currentTarget;
|
||||
var differX = e.changedTouches[0].clientX - _this.startPos.x;
|
||||
var differY = e.changedTouches[0].clientY - _this.startPos.y;
|
||||
|
||||
if (currentTarget === _this.maskDom || currentTarget === _this.handlerDom || currentTarget === _this.contentDom && (0, _utils.getTouchParentScroll)(currentTarget, e.target, differX, differY)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
_this.transitionEnd = function (e) {
|
||||
var dom = e.target;
|
||||
(0, _utils.removeEventListener)(dom, _utils.transitionEnd, _this.transitionEnd);
|
||||
dom.style.transition = '';
|
||||
};
|
||||
|
||||
_this.onKeyDown = function (e) {
|
||||
if (e.keyCode === _KeyCode.default.ESC) {
|
||||
var onClose = _this.props.onClose;
|
||||
e.stopPropagation();
|
||||
|
||||
if (onClose) {
|
||||
onClose(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_this.onWrapperTransitionEnd = function (e) {
|
||||
var _this$props = _this.props,
|
||||
open = _this$props.open,
|
||||
afterVisibleChange = _this$props.afterVisibleChange;
|
||||
|
||||
if (e.target === _this.contentWrapper && e.propertyName.match(/transform$/)) {
|
||||
_this.dom.style.transition = '';
|
||||
|
||||
if (!open && _this.getCurrentDrawerSome()) {
|
||||
document.body.style.overflowX = '';
|
||||
|
||||
if (_this.maskDom) {
|
||||
_this.maskDom.style.left = '';
|
||||
_this.maskDom.style.width = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (afterVisibleChange) {
|
||||
afterVisibleChange(!!open);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_this.openLevelTransition = function () {
|
||||
var _this$props2 = _this.props,
|
||||
open = _this$props2.open,
|
||||
width = _this$props2.width,
|
||||
height = _this$props2.height;
|
||||
|
||||
var _this$getHorizontalBo = _this.getHorizontalBoolAndPlacementName(),
|
||||
isHorizontal = _this$getHorizontalBo.isHorizontal,
|
||||
placementName = _this$getHorizontalBo.placementName;
|
||||
|
||||
var contentValue = _this.contentDom ? _this.contentDom.getBoundingClientRect()[isHorizontal ? 'width' : 'height'] : 0;
|
||||
var value = (isHorizontal ? width : height) || contentValue;
|
||||
|
||||
_this.setLevelAndScrolling(open, placementName, value);
|
||||
};
|
||||
|
||||
_this.setLevelTransform = function (open, placementName, value, right) {
|
||||
var _this$props3 = _this.props,
|
||||
placement = _this$props3.placement,
|
||||
levelMove = _this$props3.levelMove,
|
||||
duration = _this$props3.duration,
|
||||
ease = _this$props3.ease,
|
||||
showMask = _this$props3.showMask; // router 切换时可能会导至页面失去滚动条,所以需要时时获取。
|
||||
|
||||
_this.levelDom.forEach(function (dom) {
|
||||
dom.style.transition = "transform ".concat(duration, " ").concat(ease);
|
||||
(0, _utils.addEventListener)(dom, _utils.transitionEnd, _this.transitionEnd);
|
||||
var levelValue = open ? value : 0;
|
||||
|
||||
if (levelMove) {
|
||||
var $levelMove = (0, _utils.transformArguments)(levelMove, {
|
||||
target: dom,
|
||||
open: open
|
||||
});
|
||||
levelValue = open ? $levelMove[0] : $levelMove[1] || 0;
|
||||
}
|
||||
|
||||
var $value = typeof levelValue === 'number' ? "".concat(levelValue, "px") : levelValue;
|
||||
var placementPos = placement === 'left' || placement === 'top' ? $value : "-".concat($value);
|
||||
placementPos = showMask && placement === 'right' && right ? "calc(".concat(placementPos, " + ").concat(right, "px)") : placementPos;
|
||||
dom.style.transform = levelValue ? "".concat(placementName, "(").concat(placementPos, ")") : '';
|
||||
});
|
||||
};
|
||||
|
||||
_this.setLevelAndScrolling = function (open, placementName, value) {
|
||||
var onChange = _this.props.onChange;
|
||||
|
||||
if (!_utils.windowIsUndefined) {
|
||||
var right = document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth ? (0, _getScrollBarSize.default)(true) : 0;
|
||||
|
||||
_this.setLevelTransform(open, placementName, value, right);
|
||||
|
||||
_this.toggleScrollingToDrawerAndBody(right);
|
||||
}
|
||||
|
||||
if (onChange) {
|
||||
onChange(open);
|
||||
}
|
||||
};
|
||||
|
||||
_this.toggleScrollingToDrawerAndBody = function (right) {
|
||||
var _this$props4 = _this.props,
|
||||
getOpenCount = _this$props4.getOpenCount,
|
||||
getContainer = _this$props4.getContainer,
|
||||
showMask = _this$props4.showMask,
|
||||
open = _this$props4.open;
|
||||
var container = getContainer && getContainer();
|
||||
var openCount = getOpenCount && getOpenCount(); // 处理 body 滚动
|
||||
|
||||
if (container && container.parentNode === document.body && showMask) {
|
||||
var eventArray = ['touchstart'];
|
||||
var domArray = [document.body, _this.maskDom, _this.handlerDom, _this.contentDom];
|
||||
|
||||
if (open && document.body.style.overflow !== 'hidden') {
|
||||
if (right) {
|
||||
_this.addScrollingEffect(right);
|
||||
}
|
||||
|
||||
if (openCount === 1) {
|
||||
document.body.style.overflow = 'hidden';
|
||||
}
|
||||
|
||||
document.body.style.touchAction = 'none'; // 手机禁滚
|
||||
|
||||
domArray.forEach(function (item, i) {
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
|
||||
(0, _utils.addEventListener)(item, eventArray[i] || 'touchmove', i ? _this.removeMoveHandler : _this.removeStartHandler, _this.passive);
|
||||
});
|
||||
} else if (_this.getCurrentDrawerSome()) {
|
||||
// 没有弹框的状态下清除 overflow;
|
||||
if (!openCount) {
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
|
||||
document.body.style.touchAction = '';
|
||||
|
||||
if (right) {
|
||||
_this.remScrollingEffect(right);
|
||||
} // 恢复事件
|
||||
|
||||
|
||||
domArray.forEach(function (item, i) {
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
|
||||
(0, _utils.removeEventListener)(item, eventArray[i] || 'touchmove', i ? _this.removeMoveHandler : _this.removeStartHandler, _this.passive);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_this.addScrollingEffect = function (right) {
|
||||
var _this$props5 = _this.props,
|
||||
placement = _this$props5.placement,
|
||||
duration = _this$props5.duration,
|
||||
ease = _this$props5.ease,
|
||||
getOpenCount = _this$props5.getOpenCount,
|
||||
switchScrollingEffect = _this$props5.switchScrollingEffect;
|
||||
var openCount = getOpenCount && getOpenCount();
|
||||
|
||||
if (openCount === 1) {
|
||||
switchScrollingEffect();
|
||||
}
|
||||
|
||||
var widthTransition = "width ".concat(duration, " ").concat(ease);
|
||||
var transformTransition = "transform ".concat(duration, " ").concat(ease);
|
||||
_this.dom.style.transition = 'none';
|
||||
|
||||
switch (placement) {
|
||||
case 'right':
|
||||
_this.dom.style.transform = "translateX(-".concat(right, "px)");
|
||||
break;
|
||||
|
||||
case 'top':
|
||||
case 'bottom':
|
||||
_this.dom.style.width = "calc(100% - ".concat(right, "px)");
|
||||
_this.dom.style.transform = 'translateZ(0)';
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
clearTimeout(_this.timeout);
|
||||
_this.timeout = setTimeout(function () {
|
||||
if (_this.dom) {
|
||||
_this.dom.style.transition = "".concat(transformTransition, ",").concat(widthTransition);
|
||||
_this.dom.style.width = '';
|
||||
_this.dom.style.transform = '';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
_this.remScrollingEffect = function (right) {
|
||||
var _this$props6 = _this.props,
|
||||
placement = _this$props6.placement,
|
||||
duration = _this$props6.duration,
|
||||
ease = _this$props6.ease,
|
||||
getOpenCount = _this$props6.getOpenCount,
|
||||
switchScrollingEffect = _this$props6.switchScrollingEffect;
|
||||
var openCount = getOpenCount && getOpenCount();
|
||||
|
||||
if (!openCount) {
|
||||
switchScrollingEffect(true);
|
||||
}
|
||||
|
||||
if (_utils.transitionStr) {
|
||||
document.body.style.overflowX = 'hidden';
|
||||
}
|
||||
|
||||
_this.dom.style.transition = 'none';
|
||||
var heightTransition;
|
||||
var widthTransition = "width ".concat(duration, " ").concat(ease);
|
||||
var transformTransition = "transform ".concat(duration, " ").concat(ease);
|
||||
|
||||
switch (placement) {
|
||||
case 'left':
|
||||
{
|
||||
_this.dom.style.width = '100%';
|
||||
widthTransition = "width 0s ".concat(ease, " ").concat(duration);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'right':
|
||||
{
|
||||
_this.dom.style.transform = "translateX(".concat(right, "px)");
|
||||
_this.dom.style.width = '100%';
|
||||
widthTransition = "width 0s ".concat(ease, " ").concat(duration);
|
||||
|
||||
if (_this.maskDom) {
|
||||
_this.maskDom.style.left = "-".concat(right, "px");
|
||||
_this.maskDom.style.width = "calc(100% + ".concat(right, "px)");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'top':
|
||||
case 'bottom':
|
||||
{
|
||||
_this.dom.style.width = "calc(100% + ".concat(right, "px)");
|
||||
_this.dom.style.height = '100%';
|
||||
_this.dom.style.transform = 'translateZ(0)';
|
||||
heightTransition = "height 0s ".concat(ease, " ").concat(duration);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
clearTimeout(_this.timeout);
|
||||
_this.timeout = setTimeout(function () {
|
||||
if (_this.dom) {
|
||||
_this.dom.style.transition = "".concat(transformTransition, ",").concat(heightTransition ? "".concat(heightTransition, ",") : '').concat(widthTransition);
|
||||
_this.dom.style.transform = '';
|
||||
_this.dom.style.width = '';
|
||||
_this.dom.style.height = '';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
_this.getCurrentDrawerSome = function () {
|
||||
return !Object.keys(currentDrawer).some(function (key) {
|
||||
return currentDrawer[key];
|
||||
});
|
||||
};
|
||||
|
||||
_this.getLevelDom = function (_ref) {
|
||||
var level = _ref.level,
|
||||
getContainer = _ref.getContainer;
|
||||
|
||||
if (_utils.windowIsUndefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
var container = getContainer && getContainer();
|
||||
var parent = container ? container.parentNode : null;
|
||||
_this.levelDom = [];
|
||||
|
||||
if (level === 'all') {
|
||||
var children = parent ? Array.prototype.slice.call(parent.children) : [];
|
||||
children.forEach(function (child) {
|
||||
if (child.nodeName !== 'SCRIPT' && child.nodeName !== 'STYLE' && child.nodeName !== 'LINK' && child !== container) {
|
||||
_this.levelDom.push(child);
|
||||
}
|
||||
});
|
||||
} else if (level) {
|
||||
(0, _utils.dataToArray)(level).forEach(function (key) {
|
||||
document.querySelectorAll(key).forEach(function (item) {
|
||||
_this.levelDom.push(item);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_this.getHorizontalBoolAndPlacementName = function () {
|
||||
var placement = _this.props.placement;
|
||||
var isHorizontal = placement === 'left' || placement === 'right';
|
||||
var placementName = "translate".concat(isHorizontal ? 'X' : 'Y');
|
||||
return {
|
||||
isHorizontal: isHorizontal,
|
||||
placementName: placementName
|
||||
};
|
||||
};
|
||||
|
||||
_this.state = {
|
||||
_self: _assertThisInitialized(_this)
|
||||
};
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(DrawerChild, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
var _this2 = this;
|
||||
|
||||
if (!_utils.windowIsUndefined) {
|
||||
var passiveSupported = false;
|
||||
|
||||
try {
|
||||
window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
|
||||
get: function get() {
|
||||
passiveSupported = true;
|
||||
return null;
|
||||
}
|
||||
}));
|
||||
} catch (err) {}
|
||||
|
||||
this.passive = passiveSupported ? {
|
||||
passive: false
|
||||
} : false;
|
||||
}
|
||||
|
||||
var open = this.props.open;
|
||||
this.drawerId = "drawer_id_".concat(Number((Date.now() + Math.random()).toString().replace('.', Math.round(Math.random() * 9).toString())).toString(16));
|
||||
this.getLevelDom(this.props);
|
||||
|
||||
if (open) {
|
||||
currentDrawer[this.drawerId] = open; // 默认打开状态时推出 level;
|
||||
|
||||
this.openLevelTransition();
|
||||
this.forceUpdate(function () {
|
||||
_this2.domFocus();
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(prevProps) {
|
||||
var open = this.props.open;
|
||||
|
||||
if (open !== prevProps.open) {
|
||||
if (open) {
|
||||
this.domFocus();
|
||||
}
|
||||
|
||||
currentDrawer[this.drawerId] = !!open;
|
||||
this.openLevelTransition();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
var _this$props7 = this.props,
|
||||
getOpenCount = _this$props7.getOpenCount,
|
||||
open = _this$props7.open,
|
||||
switchScrollingEffect = _this$props7.switchScrollingEffect;
|
||||
var openCount = typeof getOpenCount === 'function' && getOpenCount();
|
||||
delete currentDrawer[this.drawerId];
|
||||
|
||||
if (open) {
|
||||
this.setLevelTransform(false);
|
||||
document.body.style.touchAction = '';
|
||||
}
|
||||
|
||||
if (!openCount) {
|
||||
document.body.style.overflow = '';
|
||||
switchScrollingEffect(true);
|
||||
}
|
||||
} // tslint:disable-next-line:member-ordering
|
||||
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _classnames,
|
||||
_this3 = this;
|
||||
|
||||
var _this$props8 = this.props,
|
||||
className = _this$props8.className,
|
||||
children = _this$props8.children,
|
||||
style = _this$props8.style,
|
||||
width = _this$props8.width,
|
||||
height = _this$props8.height,
|
||||
defaultOpen = _this$props8.defaultOpen,
|
||||
$open = _this$props8.open,
|
||||
prefixCls = _this$props8.prefixCls,
|
||||
placement = _this$props8.placement,
|
||||
level = _this$props8.level,
|
||||
levelMove = _this$props8.levelMove,
|
||||
ease = _this$props8.ease,
|
||||
duration = _this$props8.duration,
|
||||
getContainer = _this$props8.getContainer,
|
||||
handler = _this$props8.handler,
|
||||
onChange = _this$props8.onChange,
|
||||
afterVisibleChange = _this$props8.afterVisibleChange,
|
||||
showMask = _this$props8.showMask,
|
||||
maskClosable = _this$props8.maskClosable,
|
||||
maskStyle = _this$props8.maskStyle,
|
||||
onClose = _this$props8.onClose,
|
||||
onHandleClick = _this$props8.onHandleClick,
|
||||
keyboard = _this$props8.keyboard,
|
||||
getOpenCount = _this$props8.getOpenCount,
|
||||
switchScrollingEffect = _this$props8.switchScrollingEffect,
|
||||
props = _objectWithoutProperties(_this$props8, ["className", "children", "style", "width", "height", "defaultOpen", "open", "prefixCls", "placement", "level", "levelMove", "ease", "duration", "getContainer", "handler", "onChange", "afterVisibleChange", "showMask", "maskClosable", "maskStyle", "onClose", "onHandleClick", "keyboard", "getOpenCount", "switchScrollingEffect"]); // 首次渲染都将是关闭状态。
|
||||
|
||||
|
||||
var open = this.dom ? $open : false;
|
||||
var wrapperClassName = (0, _classnames2.default)(prefixCls, (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-").concat(placement), true), _defineProperty(_classnames, "".concat(prefixCls, "-open"), open), _defineProperty(_classnames, className || '', !!className), _defineProperty(_classnames, 'no-mask', !showMask), _classnames));
|
||||
|
||||
var _this$getHorizontalBo2 = this.getHorizontalBoolAndPlacementName(),
|
||||
placementName = _this$getHorizontalBo2.placementName; // 百分比与像素动画不同步,第一次打用后全用像素动画。
|
||||
// const defaultValue = !this.contentDom || !level ? '100%' : `${value}px`;
|
||||
|
||||
|
||||
var placementPos = placement === 'left' || placement === 'top' ? '-100%' : '100%';
|
||||
var transform = open ? '' : "".concat(placementName, "(").concat(placementPos, ")");
|
||||
var handlerChildren = handler && React.cloneElement(handler, {
|
||||
onClick: function onClick(e) {
|
||||
if (handler.props.onClick) {
|
||||
handler.props.onClick();
|
||||
}
|
||||
|
||||
if (onHandleClick) {
|
||||
onHandleClick(e);
|
||||
}
|
||||
},
|
||||
ref: function ref(c) {
|
||||
_this3.handlerDom = c;
|
||||
}
|
||||
});
|
||||
return React.createElement("div", Object.assign({}, props, {
|
||||
tabIndex: -1,
|
||||
className: wrapperClassName,
|
||||
style: style,
|
||||
ref: function ref(c) {
|
||||
_this3.dom = c;
|
||||
},
|
||||
onKeyDown: open && keyboard ? this.onKeyDown : undefined,
|
||||
onTransitionEnd: this.onWrapperTransitionEnd
|
||||
}), showMask && React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-mask"),
|
||||
onClick: maskClosable ? onClose : undefined,
|
||||
style: maskStyle,
|
||||
ref: function ref(c) {
|
||||
_this3.maskDom = c;
|
||||
}
|
||||
}), React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-content-wrapper"),
|
||||
style: {
|
||||
transform: transform,
|
||||
msTransform: transform,
|
||||
width: (0, _utils.isNumeric)(width) ? "".concat(width, "px") : width,
|
||||
height: (0, _utils.isNumeric)(height) ? "".concat(height, "px") : height
|
||||
},
|
||||
ref: function ref(c) {
|
||||
_this3.contentWrapper = c;
|
||||
}
|
||||
}, React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-content"),
|
||||
ref: function ref(c) {
|
||||
_this3.contentDom = c;
|
||||
},
|
||||
onTouchStart: open && showMask ? this.removeStartHandler : undefined,
|
||||
onTouchMove: open && showMask ? this.removeMoveHandler : undefined
|
||||
}, children), handlerChildren));
|
||||
}
|
||||
}], [{
|
||||
key: "getDerivedStateFromProps",
|
||||
value: function getDerivedStateFromProps(props, _ref2) {
|
||||
var prevProps = _ref2.prevProps,
|
||||
_self = _ref2._self;
|
||||
var nextState = {
|
||||
prevProps: props
|
||||
};
|
||||
|
||||
if (prevProps !== undefined) {
|
||||
var placement = props.placement,
|
||||
level = props.level;
|
||||
|
||||
if (placement !== prevProps.placement) {
|
||||
// test 的 bug, 有动画过场,删除 dom
|
||||
_self.contentDom = null;
|
||||
}
|
||||
|
||||
if (level !== prevProps.level) {
|
||||
_self.getLevelDom(props);
|
||||
}
|
||||
}
|
||||
|
||||
return nextState;
|
||||
}
|
||||
}]);
|
||||
|
||||
return DrawerChild;
|
||||
}(React.Component);
|
||||
|
||||
DrawerChild.defaultProps = {
|
||||
switchScrollingEffect: function switchScrollingEffect() {}
|
||||
};
|
||||
|
||||
var _default = (0, _reactLifecyclesCompat.polyfill)(DrawerChild);
|
||||
|
||||
exports.default = _default;
|
||||
62
web/node_modules/rc-drawer/lib/DrawerWrapper.d.ts
generated
vendored
Normal file
62
web/node_modules/rc-drawer/lib/DrawerWrapper.d.ts
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import * as React from 'react';
|
||||
import { IDrawerProps } from './IDrawerPropTypes';
|
||||
interface IState {
|
||||
open: boolean;
|
||||
}
|
||||
declare class DrawerWrapper extends React.Component<IDrawerProps, IState> {
|
||||
static defaultProps: {
|
||||
prefixCls: string;
|
||||
placement: string;
|
||||
getContainer: string;
|
||||
defaultOpen: boolean;
|
||||
level: string;
|
||||
duration: string;
|
||||
ease: string;
|
||||
onChange: () => void;
|
||||
afterVisibleChange: () => void;
|
||||
handler: JSX.Element;
|
||||
showMask: boolean;
|
||||
maskClosable: boolean;
|
||||
maskStyle: {};
|
||||
wrapperClassName: string;
|
||||
className: string;
|
||||
keyboard: boolean;
|
||||
forceRender: boolean;
|
||||
};
|
||||
static getDerivedStateFromProps(props: IDrawerProps, { prevProps }: {
|
||||
prevProps: IDrawerProps;
|
||||
}): {
|
||||
open?: boolean;
|
||||
prevProps: IDrawerProps;
|
||||
};
|
||||
dom: HTMLElement | null;
|
||||
constructor(props: IDrawerProps);
|
||||
private onHandleClick;
|
||||
private onClose;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
declare const _default: typeof DrawerWrapper & {
|
||||
prototype: DrawerWrapper;
|
||||
defaultProps: {
|
||||
prefixCls: string;
|
||||
placement: string;
|
||||
getContainer: string;
|
||||
defaultOpen: boolean;
|
||||
level: string;
|
||||
duration: string;
|
||||
ease: string;
|
||||
onChange: () => void;
|
||||
afterVisibleChange: () => void;
|
||||
handler: JSX.Element;
|
||||
showMask: boolean;
|
||||
maskClosable: boolean;
|
||||
maskStyle: {};
|
||||
wrapperClassName: string;
|
||||
className: string;
|
||||
keyboard: boolean;
|
||||
forceRender: boolean;
|
||||
};
|
||||
getDerivedStateFromProps: typeof DrawerWrapper.getDerivedStateFromProps;
|
||||
contextType?: React.Context<any>;
|
||||
};
|
||||
export default _default;
|
||||
203
web/node_modules/rc-drawer/lib/DrawerWrapper.js
generated
vendored
Normal file
203
web/node_modules/rc-drawer/lib/DrawerWrapper.js
generated
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _PortalWrapper = _interopRequireDefault(require("rc-util/lib/PortalWrapper"));
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _reactLifecyclesCompat = require("react-lifecycles-compat");
|
||||
|
||||
var _DrawerChild = _interopRequireDefault(require("./DrawerChild"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
var DrawerWrapper =
|
||||
/*#__PURE__*/
|
||||
function (_React$Component) {
|
||||
_inherits(DrawerWrapper, _React$Component);
|
||||
|
||||
function DrawerWrapper(props) {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, DrawerWrapper);
|
||||
|
||||
_this = _possibleConstructorReturn(this, _getPrototypeOf(DrawerWrapper).call(this, props));
|
||||
|
||||
_this.onHandleClick = function (e) {
|
||||
var _this$props = _this.props,
|
||||
onHandleClick = _this$props.onHandleClick,
|
||||
$open = _this$props.open;
|
||||
|
||||
if (onHandleClick) {
|
||||
onHandleClick(e);
|
||||
}
|
||||
|
||||
if (typeof $open === 'undefined') {
|
||||
var _open = _this.state.open;
|
||||
|
||||
_this.setState({
|
||||
open: !_open
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_this.onClose = function (e) {
|
||||
var _this$props2 = _this.props,
|
||||
onClose = _this$props2.onClose,
|
||||
open = _this$props2.open;
|
||||
|
||||
if (onClose) {
|
||||
onClose(e);
|
||||
}
|
||||
|
||||
if (typeof open === 'undefined') {
|
||||
_this.setState({
|
||||
open: false
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var open = typeof props.open !== 'undefined' ? props.open : !!props.defaultOpen;
|
||||
_this.state = {
|
||||
open: open
|
||||
};
|
||||
|
||||
if ('onMaskClick' in props) {
|
||||
console.warn('`onMaskClick` are removed, please use `onClose` instead.');
|
||||
}
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(DrawerWrapper, [{
|
||||
key: "render",
|
||||
// tslint:disable-next-line:member-ordering
|
||||
value: function render() {
|
||||
var _this2 = this;
|
||||
|
||||
var _this$props3 = this.props,
|
||||
defaultOpen = _this$props3.defaultOpen,
|
||||
getContainer = _this$props3.getContainer,
|
||||
wrapperClassName = _this$props3.wrapperClassName,
|
||||
forceRender = _this$props3.forceRender,
|
||||
handler = _this$props3.handler,
|
||||
props = _objectWithoutProperties(_this$props3, ["defaultOpen", "getContainer", "wrapperClassName", "forceRender", "handler"]);
|
||||
|
||||
var open = this.state.open; // 渲染在当前 dom 里;
|
||||
|
||||
if (!getContainer) {
|
||||
return React.createElement("div", {
|
||||
className: wrapperClassName,
|
||||
ref: function ref(c) {
|
||||
_this2.dom = c;
|
||||
}
|
||||
}, React.createElement(_DrawerChild.default, Object.assign({}, props, {
|
||||
open: open,
|
||||
handler: handler,
|
||||
getContainer: function getContainer() {
|
||||
return _this2.dom;
|
||||
},
|
||||
onClose: this.onClose,
|
||||
onHandleClick: this.onHandleClick
|
||||
})));
|
||||
} // 如果有 handler 为内置强制渲染;
|
||||
|
||||
|
||||
var $forceRender = !!handler || forceRender;
|
||||
return React.createElement(_PortalWrapper.default, {
|
||||
visible: open,
|
||||
forceRender: $forceRender,
|
||||
getContainer: getContainer,
|
||||
wrapperClassName: wrapperClassName
|
||||
}, function (_ref) {
|
||||
var visible = _ref.visible,
|
||||
afterClose = _ref.afterClose,
|
||||
rest = _objectWithoutProperties(_ref, ["visible", "afterClose"]);
|
||||
|
||||
return (// react 15,componentWillUnmount 时 Portal 返回 afterClose, visible.
|
||||
React.createElement(_DrawerChild.default, Object.assign({}, props, rest, {
|
||||
open: visible !== undefined ? visible : open,
|
||||
afterVisibleChange: afterClose !== undefined ? afterClose : props.afterVisibleChange,
|
||||
handler: handler,
|
||||
onClose: _this2.onClose,
|
||||
onHandleClick: _this2.onHandleClick
|
||||
}))
|
||||
);
|
||||
});
|
||||
}
|
||||
}], [{
|
||||
key: "getDerivedStateFromProps",
|
||||
value: function getDerivedStateFromProps(props, _ref2) {
|
||||
var prevProps = _ref2.prevProps;
|
||||
var newState = {
|
||||
prevProps: props
|
||||
};
|
||||
|
||||
if (typeof prevProps !== 'undefined' && props.open !== prevProps.open) {
|
||||
newState.open = props.open;
|
||||
}
|
||||
|
||||
return newState;
|
||||
}
|
||||
}]);
|
||||
|
||||
return DrawerWrapper;
|
||||
}(React.Component);
|
||||
|
||||
DrawerWrapper.defaultProps = {
|
||||
prefixCls: 'drawer',
|
||||
placement: 'left',
|
||||
getContainer: 'body',
|
||||
defaultOpen: false,
|
||||
level: 'all',
|
||||
duration: '.3s',
|
||||
ease: 'cubic-bezier(0.78, 0.14, 0.15, 0.86)',
|
||||
onChange: function onChange() {},
|
||||
afterVisibleChange: function afterVisibleChange() {},
|
||||
handler: React.createElement("div", {
|
||||
className: "drawer-handle"
|
||||
}, React.createElement("i", {
|
||||
className: "drawer-handle-icon"
|
||||
})),
|
||||
showMask: true,
|
||||
maskClosable: true,
|
||||
maskStyle: {},
|
||||
wrapperClassName: '',
|
||||
className: '',
|
||||
keyboard: true,
|
||||
forceRender: false
|
||||
};
|
||||
|
||||
var _default = (0, _reactLifecyclesCompat.polyfill)(DrawerWrapper);
|
||||
|
||||
exports.default = _default;
|
||||
40
web/node_modules/rc-drawer/lib/IDrawerPropTypes.d.ts
generated
vendored
Normal file
40
web/node_modules/rc-drawer/lib/IDrawerPropTypes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import * as React from 'react';
|
||||
export declare type IPlacement = 'left' | 'top' | 'right' | 'bottom';
|
||||
declare type ILevelMove = number | [number, number];
|
||||
declare type IStringOrHtmlElement = string | HTMLElement;
|
||||
declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
||||
interface IProps extends Omit<React.HTMLAttributes<any>, 'onChange'> {
|
||||
prefixCls?: string;
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
open?: boolean;
|
||||
defaultOpen?: boolean;
|
||||
handler?: React.ReactElement | null | false;
|
||||
placement?: IPlacement;
|
||||
level?: null | string | string[];
|
||||
levelMove?: ILevelMove | ((e: {
|
||||
target: HTMLElement;
|
||||
open: boolean;
|
||||
}) => ILevelMove);
|
||||
duration?: string;
|
||||
ease?: string;
|
||||
showMask?: boolean;
|
||||
maskClosable?: boolean;
|
||||
maskStyle?: React.CSSProperties;
|
||||
onChange?: ((open?: boolean) => void);
|
||||
afterVisibleChange?: ((open: boolean) => void);
|
||||
onHandleClick?: ((e: React.MouseEvent | React.KeyboardEvent) => void);
|
||||
onClose?: ((e: React.MouseEvent | React.KeyboardEvent) => void);
|
||||
keyboard?: boolean;
|
||||
}
|
||||
export interface IDrawerProps extends IProps {
|
||||
wrapperClassName?: string;
|
||||
forceRender?: boolean;
|
||||
getContainer?: IStringOrHtmlElement | (() => IStringOrHtmlElement) | null | false;
|
||||
}
|
||||
export interface IDrawerChildProps extends IProps {
|
||||
getContainer?: () => HTMLElement;
|
||||
getOpenCount?: () => number;
|
||||
switchScrollingEffect?: (close?: boolean) => void;
|
||||
}
|
||||
export {};
|
||||
1
web/node_modules/rc-drawer/lib/IDrawerPropTypes.js
generated
vendored
Normal file
1
web/node_modules/rc-drawer/lib/IDrawerPropTypes.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";
|
||||
2
web/node_modules/rc-drawer/lib/index.d.ts
generated
vendored
Normal file
2
web/node_modules/rc-drawer/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import Drawer from './DrawerWrapper';
|
||||
export default Drawer;
|
||||
14
web/node_modules/rc-drawer/lib/index.js
generated
vendored
Normal file
14
web/node_modules/rc-drawer/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _DrawerWrapper = _interopRequireDefault(require("./DrawerWrapper"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
// export this package's api
|
||||
var _default = _DrawerWrapper.default;
|
||||
exports.default = _default;
|
||||
10
web/node_modules/rc-drawer/lib/utils.d.ts
generated
vendored
Normal file
10
web/node_modules/rc-drawer/lib/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference types="react" />
|
||||
export declare function dataToArray(vars: any): any[];
|
||||
export declare const transitionStr: string;
|
||||
export declare const transitionEnd: string;
|
||||
export declare function addEventListener(target: HTMLElement, eventType: string, callback: (e: React.TouchEvent | TouchEvent | Event) => void, options?: any): void;
|
||||
export declare function removeEventListener(target: HTMLElement, eventType: string, callback: (e: React.TouchEvent | TouchEvent | Event) => void, options?: any): void;
|
||||
export declare function transformArguments(arg: any, cb: any): any[];
|
||||
export declare const isNumeric: (value: string | number) => boolean;
|
||||
export declare const windowIsUndefined: boolean;
|
||||
export declare const getTouchParentScroll: (root: HTMLElement, currentTarget: HTMLElement | Document, differX: number, differY: number) => boolean;
|
||||
105
web/node_modules/rc-drawer/lib/utils.js
generated
vendored
Normal file
105
web/node_modules/rc-drawer/lib/utils.js
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.dataToArray = dataToArray;
|
||||
exports.addEventListener = addEventListener;
|
||||
exports.removeEventListener = removeEventListener;
|
||||
exports.transformArguments = transformArguments;
|
||||
exports.getTouchParentScroll = exports.windowIsUndefined = exports.isNumeric = exports.transitionEnd = exports.transitionStr = void 0;
|
||||
|
||||
function dataToArray(vars) {
|
||||
if (Array.isArray(vars)) {
|
||||
return vars;
|
||||
}
|
||||
|
||||
return [vars];
|
||||
}
|
||||
|
||||
var transitionEndObject = {
|
||||
transition: 'transitionend',
|
||||
WebkitTransition: 'webkitTransitionEnd',
|
||||
MozTransition: 'transitionend',
|
||||
OTransition: 'oTransitionEnd otransitionend'
|
||||
};
|
||||
var transitionStr = Object.keys(transitionEndObject).filter(function (key) {
|
||||
if (typeof document === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var html = document.getElementsByTagName('html')[0];
|
||||
return key in (html ? html.style : {});
|
||||
})[0];
|
||||
exports.transitionStr = transitionStr;
|
||||
var transitionEnd = transitionEndObject[transitionStr];
|
||||
exports.transitionEnd = transitionEnd;
|
||||
|
||||
function addEventListener(target, eventType, callback, options) {
|
||||
if (target.addEventListener) {
|
||||
target.addEventListener(eventType, callback, options);
|
||||
} else if (target.attachEvent) {
|
||||
// tslint:disable-line
|
||||
target.attachEvent("on".concat(eventType), callback); // tslint:disable-line
|
||||
}
|
||||
}
|
||||
|
||||
function removeEventListener(target, eventType, callback, options) {
|
||||
if (target.removeEventListener) {
|
||||
target.removeEventListener(eventType, callback, options);
|
||||
} else if (target.attachEvent) {
|
||||
// tslint:disable-line
|
||||
target.detachEvent("on".concat(eventType), callback); // tslint:disable-line
|
||||
}
|
||||
}
|
||||
|
||||
function transformArguments(arg, cb) {
|
||||
var result = typeof arg === 'function' ? arg(cb) : arg;
|
||||
|
||||
if (Array.isArray(result)) {
|
||||
if (result.length === 2) {
|
||||
return result;
|
||||
}
|
||||
|
||||
return [result[0], result[1]];
|
||||
}
|
||||
|
||||
return [result];
|
||||
}
|
||||
|
||||
var isNumeric = function isNumeric(value) {
|
||||
return !isNaN(parseFloat(value)) && isFinite(value);
|
||||
};
|
||||
|
||||
exports.isNumeric = isNumeric;
|
||||
var windowIsUndefined = !(typeof window !== 'undefined' && window.document && window.document.createElement);
|
||||
exports.windowIsUndefined = windowIsUndefined;
|
||||
|
||||
var getTouchParentScroll = function getTouchParentScroll(root, currentTarget, differX, differY) {
|
||||
if (!currentTarget || currentTarget === document || currentTarget instanceof Document) {
|
||||
return false;
|
||||
} // root 为 drawer-content 设定了 overflow, 判断为 root 的 parent 时结束滚动;
|
||||
|
||||
|
||||
if (currentTarget === root.parentNode) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var isY = Math.max(Math.abs(differX), Math.abs(differY)) === Math.abs(differY);
|
||||
var isX = Math.max(Math.abs(differX), Math.abs(differY)) === Math.abs(differX);
|
||||
var scrollY = currentTarget.scrollHeight - currentTarget.clientHeight;
|
||||
var scrollX = currentTarget.scrollWidth - currentTarget.clientWidth;
|
||||
var style = document.defaultView.getComputedStyle(currentTarget);
|
||||
var overflowY = style.overflowY === 'auto' || style.overflowY === 'scroll';
|
||||
var overflowX = style.overflowX === 'auto' || style.overflowX === 'scroll';
|
||||
var y = scrollY && overflowY;
|
||||
var x = scrollX && overflowX;
|
||||
|
||||
if (isY && (!y || y && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!x || x && (currentTarget.scrollLeft >= scrollX && scrollX < 0 || currentTarget.scrollLeft <= 0 && scrollX > 0))) {
|
||||
return getTouchParentScroll(root, currentTarget.parentNode, differX, differY);
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
exports.getTouchParentScroll = getTouchParentScroll;
|
||||
104
web/node_modules/rc-drawer/package.json
generated
vendored
Normal file
104
web/node_modules/rc-drawer/package.json
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"_from": "rc-drawer@~3.1.1",
|
||||
"_id": "rc-drawer@3.1.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-2z+RdxmzXyZde/1OhVMfDR1e/GBswFeWSZ7FS3Fdd0qhgVdpV1wSzILzzxRaT481ItB5hOV+e8pZT07vdJE8kg==",
|
||||
"_location": "/rc-drawer",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "rc-drawer@~3.1.1",
|
||||
"name": "rc-drawer",
|
||||
"escapedName": "rc-drawer",
|
||||
"rawSpec": "~3.1.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~3.1.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/antd"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/rc-drawer/-/rc-drawer-3.1.3.tgz",
|
||||
"_shasum": "cbcb04d4c07f0b66f2ece11d847f4a1bd80ea0b7",
|
||||
"_spec": "rc-drawer@~3.1.1",
|
||||
"_where": "/Users/thilina/TestProjects/icehrm-pro/web/node_modules/antd",
|
||||
"author": {
|
||||
"name": "155259966@qq.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ant-motion/drawer/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.6",
|
||||
"rc-util": "^4.16.1",
|
||||
"react-lifecycles-compat": "^3.0.4"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "drawer component for react",
|
||||
"devDependencies": {
|
||||
"@types/classnames": "^2.2.9",
|
||||
"@types/enzyme": "^3.1.15",
|
||||
"@types/jest": "^24.0.15",
|
||||
"@types/raf": "^3.4.0",
|
||||
"@types/react": "^16.9.5",
|
||||
"@types/react-dom": "^16.9.1",
|
||||
"@types/react-lifecycles-compat": "^3.0.1",
|
||||
"@types/warning": "^3.0.0",
|
||||
"@umijs/fabric": "^2.0.0",
|
||||
"enzyme": "^3.10.0",
|
||||
"enzyme-adapter-react-16": "^1.14.0",
|
||||
"enzyme-to-json": "^3.4.2",
|
||||
"eslint": "^6.5.1",
|
||||
"father": "^2.13.2",
|
||||
"jsonp": "^0.2.0",
|
||||
"less": "^3.10.3",
|
||||
"np": "^5.0.3",
|
||||
"pre-commit": "^1.2.2",
|
||||
"querystring": "^0.2.0",
|
||||
"rc-test": "^6.0.1",
|
||||
"react": "^16.10.2",
|
||||
"react-dom": "^16.10.2",
|
||||
"react-test-renderer": "^16.10.2",
|
||||
"typescript": "^3.6.3"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"assets/*.css",
|
||||
"es"
|
||||
],
|
||||
"homepage": "https://github.com/ant-motion/drawer",
|
||||
"keywords": [
|
||||
"react",
|
||||
"react-component",
|
||||
"react-drawer",
|
||||
"drawer",
|
||||
"drawer-menu",
|
||||
"rc-drawer-menu",
|
||||
"react-drawer-menu",
|
||||
"animation",
|
||||
"drawer-motion",
|
||||
"drawer-animation"
|
||||
],
|
||||
"licenses": "MIT",
|
||||
"main": "./lib/index",
|
||||
"module": "./es/index",
|
||||
"name": "rc-drawer",
|
||||
"peerDependencies": {
|
||||
"react": "*"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ant-motion/drawer.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "father doc build --storybook",
|
||||
"compile": "father build && lessc assets/index.less assets/index.css",
|
||||
"lint": "eslint src/ --ext .tsx,.ts",
|
||||
"now-build": "npm run build",
|
||||
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
|
||||
"start": "rm -rf .storybook lib es && father doc dev --storybook",
|
||||
"test": "father test"
|
||||
},
|
||||
"version": "3.1.3"
|
||||
}
|
||||
Reference in New Issue
Block a user