Latest updates from IceHrmPro
This commit is contained in:
17
web/node_modules/rc-notification/HISTORY.md
generated
vendored
Normal file
17
web/node_modules/rc-notification/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# History
|
||||
|
||||
## 3.3.0
|
||||
|
||||
- Add `onClick` property.
|
||||
|
||||
## 3.2.0
|
||||
|
||||
- Add `closeIcon`. [#45](https://github.com/react-component/notification/pull/45) [@HeskeyBaozi](https://github.com/HeskeyBaozi)
|
||||
|
||||
## 2.0.0
|
||||
|
||||
- [Beack Change] Remove wrapper span element when just single notification. [#17](https://github.com/react-component/notification/pull/17)
|
||||
|
||||
## 1.4.0
|
||||
|
||||
- Added `getContainer` property.
|
||||
9
web/node_modules/rc-notification/LICENSE.md
generated
vendored
Normal file
9
web/node_modules/rc-notification/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-present yiminghe
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
188
web/node_modules/rc-notification/README.md
generated
vendored
Normal file
188
web/node_modules/rc-notification/README.md
generated
vendored
Normal file
@@ -0,0 +1,188 @@
|
||||
# rc-notification
|
||||
---
|
||||
|
||||
React Notification UI Component
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![build status][travis-image]][travis-url]
|
||||
[![Test coverage][coveralls-image]][coveralls-url]
|
||||
[![gemnasium deps][gemnasium-image]][gemnasium-url]
|
||||
[![node version][node-image]][node-url]
|
||||
[![npm download][download-image]][download-url]
|
||||
|
||||
[npm-image]: http://img.shields.io/npm/v/rc-notification.svg?style=flat-square
|
||||
[npm-url]: http://npmjs.org/package/rc-notification
|
||||
[travis-image]: https://img.shields.io/travis/react-component/notification.svg?style=flat-square
|
||||
[travis-url]: https://travis-ci.org/react-component/notification
|
||||
[coveralls-image]: https://img.shields.io/coveralls/react-component/notification.svg?style=flat-square
|
||||
[coveralls-url]: https://coveralls.io/r/react-component/notification?branch=master
|
||||
[gemnasium-image]: http://img.shields.io/gemnasium/react-component/notification.svg?style=flat-square
|
||||
[gemnasium-url]: https://gemnasium.com/react-component/notification
|
||||
[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-notification.svg?style=flat-square
|
||||
[download-url]: https://npmjs.org/package/rc-notification
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
```
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
http://localhost:8000/examples/
|
||||
|
||||
online example: http://react-component.github.io/notification/examples/
|
||||
|
||||
|
||||
## Feature
|
||||
|
||||
* support ie9,ie9+,chrome,firefox,safari
|
||||
|
||||
|
||||
## install
|
||||
|
||||
[](https://npmjs.org/package/rc-notification)
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var Notification = require('rc-notification');
|
||||
Notification.newInstance({}, notification => {
|
||||
notification.notice({
|
||||
content: 'content'
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### Notification.newInstance(props, (notification) => void) => void
|
||||
|
||||
props details:
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 100px;">name</th>
|
||||
<th style="width: 50px;">type</th>
|
||||
<th style="width: 50px;">default</th>
|
||||
<th>description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>prefixCls</td>
|
||||
<td>String</td>
|
||||
<td></td>
|
||||
<td>prefix class name for notification container</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>style</td>
|
||||
<td>Object</td>
|
||||
<td>{'top': 65, left: '50%'}</td>
|
||||
<td>additional style for notification container.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>getContainer</td>
|
||||
<td>getContainer(): HTMLElement</td>
|
||||
<td></td>
|
||||
<td>function returning html node which will act as notification container</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maxCount</td>
|
||||
<td>number</td>
|
||||
<td></td>
|
||||
<td>max notices show, drop first notice if exceed limit</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### notification.notice(props)
|
||||
|
||||
props details:
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 100px;">name</th>
|
||||
<th style="width: 50px;">type</th>
|
||||
<th style="width: 50px;">default</th>
|
||||
<th>description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>content</td>
|
||||
<td>React.Element</td>
|
||||
<td></td>
|
||||
<td>content of notice</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>key</td>
|
||||
<td>String</td>
|
||||
<td></td>
|
||||
<td>id of this notice</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>closable</td>
|
||||
<td>Boolean</td>
|
||||
<td></td>
|
||||
<td>whether show close button</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>onClose</td>
|
||||
<td>Function</td>
|
||||
<td></td>
|
||||
<td>called when notice close</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>duration</td>
|
||||
<td>number</td>
|
||||
<td>1.5</td>
|
||||
<td>after duration of time, this notice will disappear.(seconds)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>style</td>
|
||||
<td>Object</td>
|
||||
<td> { right: '50%' } </td>
|
||||
<td>additional style for single notice node.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>closeIcon</td>
|
||||
<td>ReactNode</td>
|
||||
<td></td>
|
||||
<td>specific the close icon.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### notification.removeNotice(key:string)
|
||||
|
||||
remove single notice with specified key
|
||||
|
||||
### notification.destroy()
|
||||
|
||||
destroy current notification
|
||||
|
||||
## Test Case
|
||||
|
||||
```
|
||||
npm test
|
||||
npm run chrome-test
|
||||
```
|
||||
|
||||
## Coverage
|
||||
|
||||
```
|
||||
npm run coverage
|
||||
```
|
||||
|
||||
open coverage/ dir
|
||||
|
||||
## License
|
||||
|
||||
rc-notification is released under the MIT license.
|
||||
81
web/node_modules/rc-notification/assets/index.css
generated
vendored
Normal file
81
web/node_modules/rc-notification/assets/index.css
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
.rc-notification {
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
}
|
||||
.rc-notification-notice {
|
||||
padding: 7px 20px 7px 10px;
|
||||
border-radius: 3px 3px;
|
||||
border: 1px solid #999;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
||||
border: 0px solid rgba(0, 0, 0, 0);
|
||||
background: #fff;
|
||||
display: block;
|
||||
width: auto;
|
||||
line-height: 1.5;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
margin: 10px 0;
|
||||
}
|
||||
.rc-notification-notice-closable {
|
||||
padding-right: 20px;
|
||||
}
|
||||
.rc-notification-notice-close {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 3px;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
filter: alpha(opacity=20);
|
||||
opacity: 0.2;
|
||||
text-decoration: none;
|
||||
}
|
||||
.rc-notification-notice-close-x:after {
|
||||
content: '×';
|
||||
}
|
||||
.rc-notification-notice-close:hover {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
text-decoration: none;
|
||||
}
|
||||
.rc-notification-fade-enter {
|
||||
opacity: 0;
|
||||
animation-duration: 0.3s;
|
||||
animation-fill-mode: both;
|
||||
animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.rc-notification-fade-leave {
|
||||
animation-duration: 0.3s;
|
||||
animation-fill-mode: both;
|
||||
animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.rc-notification-fade-enter.rc-notification-fade-enter-active {
|
||||
animation-name: rcNotificationFadeIn;
|
||||
animation-play-state: running;
|
||||
}
|
||||
.rc-notification-fade-leave.rc-notification-fade-leave-active {
|
||||
animation-name: rcDialogFadeOut;
|
||||
animation-play-state: running;
|
||||
}
|
||||
@keyframes rcNotificationFadeIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes rcDialogFadeOut {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
96
web/node_modules/rc-notification/assets/index.less
generated
vendored
Normal file
96
web/node_modules/rc-notification/assets/index.less
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
@notificationPrefixCls: rc-notification;
|
||||
|
||||
.@{notificationPrefixCls} {
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
|
||||
&-notice {
|
||||
padding: 7px 20px 7px 10px;
|
||||
border-radius: 3px 3px;
|
||||
border: 1px solid #999;;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
||||
border: 0px solid rgba(0, 0, 0, 0);;
|
||||
background: #fff;
|
||||
display: block;
|
||||
width: auto;
|
||||
line-height: 1.5;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
margin: 10px 0;
|
||||
|
||||
&-closable {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
&-close {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 3px;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
filter: alpha(opacity=20);
|
||||
opacity: .2;
|
||||
text-decoration: none;
|
||||
|
||||
&-x:after {
|
||||
content: '×';
|
||||
}
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fade-effect() {
|
||||
animation-duration: 0.3s;
|
||||
animation-fill-mode: both;
|
||||
animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
|
||||
}
|
||||
|
||||
&-fade-enter {
|
||||
opacity: 0;
|
||||
.fade-effect();
|
||||
animation-play-state: paused;
|
||||
}
|
||||
|
||||
&-fade-leave {
|
||||
.fade-effect();
|
||||
animation-play-state: paused;
|
||||
}
|
||||
|
||||
&-fade-enter&-fade-enter-active {
|
||||
animation-name: rcNotificationFadeIn;
|
||||
animation-play-state: running;
|
||||
}
|
||||
|
||||
&-fade-leave&-fade-leave-active {
|
||||
animation-name: rcDialogFadeOut;
|
||||
animation-play-state: running;
|
||||
}
|
||||
|
||||
@keyframes rcNotificationFadeIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rcDialogFadeOut {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
33
web/node_modules/rc-notification/es/Notice.d.ts
generated
vendored
Normal file
33
web/node_modules/rc-notification/es/Notice.d.ts
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import React, { Component } from 'react';
|
||||
export interface NoticeProps {
|
||||
prefixCls: string;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
duration?: number | null;
|
||||
children?: React.ReactNode;
|
||||
update?: boolean;
|
||||
closeIcon?: React.ReactNode;
|
||||
closable?: boolean;
|
||||
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
||||
onClose?: () => void;
|
||||
/** @private Only for internal usage. We don't promise that we will refactor this */
|
||||
holder?: HTMLDivElement;
|
||||
}
|
||||
export default class Notice extends Component<NoticeProps> {
|
||||
static defaultProps: {
|
||||
onClose(): void;
|
||||
duration: number;
|
||||
style: {
|
||||
right: string;
|
||||
};
|
||||
};
|
||||
closeTimer: number;
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate(prevProps: NoticeProps): void;
|
||||
componentWillUnmount(): void;
|
||||
close: (e?: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
|
||||
startCloseTimer: () => void;
|
||||
clearCloseTimer: () => void;
|
||||
restartCloseTimer(): void;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
135
web/node_modules/rc-notification/es/Notice.js
generated
vendored
Normal file
135
web/node_modules/rc-notification/es/Notice.js
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; 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 _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 React, { Component } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import classNames from 'classnames';
|
||||
|
||||
var Notice =
|
||||
/*#__PURE__*/
|
||||
function (_Component) {
|
||||
_inherits(Notice, _Component);
|
||||
|
||||
function Notice() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Notice);
|
||||
|
||||
_this = _possibleConstructorReturn(this, _getPrototypeOf(Notice).apply(this, arguments));
|
||||
|
||||
_this.close = function (e) {
|
||||
if (e) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
_this.clearCloseTimer();
|
||||
|
||||
_this.props.onClose();
|
||||
};
|
||||
|
||||
_this.startCloseTimer = function () {
|
||||
if (_this.props.duration) {
|
||||
_this.closeTimer = window.setTimeout(function () {
|
||||
_this.close();
|
||||
}, _this.props.duration * 1000);
|
||||
}
|
||||
};
|
||||
|
||||
_this.clearCloseTimer = function () {
|
||||
if (_this.closeTimer) {
|
||||
clearTimeout(_this.closeTimer);
|
||||
_this.closeTimer = null;
|
||||
}
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Notice, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
this.startCloseTimer();
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(prevProps) {
|
||||
if (this.props.duration !== prevProps.duration || this.props.update) {
|
||||
this.restartCloseTimer();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
this.clearCloseTimer();
|
||||
}
|
||||
}, {
|
||||
key: "restartCloseTimer",
|
||||
value: function restartCloseTimer() {
|
||||
this.clearCloseTimer();
|
||||
this.startCloseTimer();
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _this$props = this.props,
|
||||
prefixCls = _this$props.prefixCls,
|
||||
className = _this$props.className,
|
||||
closable = _this$props.closable,
|
||||
closeIcon = _this$props.closeIcon,
|
||||
style = _this$props.style,
|
||||
onClick = _this$props.onClick,
|
||||
children = _this$props.children,
|
||||
holder = _this$props.holder;
|
||||
var componentClass = "".concat(prefixCls, "-notice");
|
||||
var node = React.createElement("div", {
|
||||
className: classNames(componentClass, className, _defineProperty({}, "".concat(componentClass, "-closable"), closable)),
|
||||
style: style,
|
||||
onMouseEnter: this.clearCloseTimer,
|
||||
onMouseLeave: this.startCloseTimer,
|
||||
onClick: onClick
|
||||
}, React.createElement("div", {
|
||||
className: "".concat(componentClass, "-content")
|
||||
}, children), closable ? React.createElement("a", {
|
||||
tabIndex: 0,
|
||||
onClick: this.close,
|
||||
className: "".concat(componentClass, "-close")
|
||||
}, closeIcon || React.createElement("span", {
|
||||
className: "".concat(componentClass, "-close-x")
|
||||
})) : null);
|
||||
|
||||
if (holder) {
|
||||
return ReactDOM.createPortal(node, holder);
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Notice;
|
||||
}(Component);
|
||||
|
||||
export { Notice as default };
|
||||
Notice.defaultProps = {
|
||||
onClose: function onClose() {},
|
||||
duration: 1.5,
|
||||
style: {
|
||||
right: '50%'
|
||||
}
|
||||
};
|
||||
54
web/node_modules/rc-notification/es/Notification.d.ts
generated
vendored
Normal file
54
web/node_modules/rc-notification/es/Notification.d.ts
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import React, { Component } from 'react';
|
||||
import { NoticeProps } from './Notice';
|
||||
export interface NoticeContent extends Omit<NoticeProps, 'prefixCls' | 'children'> {
|
||||
prefixCls?: string;
|
||||
key?: React.Key;
|
||||
updateKey?: React.Key;
|
||||
content?: React.ReactNode;
|
||||
}
|
||||
export declare type NoticeFunc = (noticeProps: NoticeContent) => void;
|
||||
export declare type HolderReadyCallback = (div: HTMLDivElement, noticeProps: NoticeProps & {
|
||||
key: React.Key;
|
||||
}) => void;
|
||||
export interface NotificationInstance {
|
||||
notice: NoticeFunc;
|
||||
removeNotice: (key: React.Key) => void;
|
||||
destroy: () => void;
|
||||
component: Notification;
|
||||
useNotification: () => [NoticeFunc, React.ReactElement];
|
||||
}
|
||||
export interface NotificationProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
transitionName?: string;
|
||||
animation?: string | object;
|
||||
maxCount?: number;
|
||||
closeIcon?: React.ReactNode;
|
||||
}
|
||||
interface NotificationState {
|
||||
notices: {
|
||||
notice: NoticeContent;
|
||||
holderCallback?: HolderReadyCallback;
|
||||
}[];
|
||||
}
|
||||
declare class Notification extends Component<NotificationProps, NotificationState> {
|
||||
static newInstance: (properties: NotificationProps & {
|
||||
getContainer?: () => HTMLElement;
|
||||
}, callback: (instance: NotificationInstance) => void) => void;
|
||||
static defaultProps: {
|
||||
prefixCls: string;
|
||||
animation: string;
|
||||
style: {
|
||||
top: number;
|
||||
left: string;
|
||||
};
|
||||
};
|
||||
state: NotificationState;
|
||||
private hookRefs;
|
||||
getTransitionName(): string;
|
||||
add: (notice: NoticeContent, holderCallback?: HolderReadyCallback) => void;
|
||||
remove: (key: string | number) => void;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
export default Notification;
|
||||
249
web/node_modules/rc-notification/es/Notification.js
generated
vendored
Normal file
249
web/node_modules/rc-notification/es/Notification.js
generated
vendored
Normal file
@@ -0,0 +1,249 @@
|
||||
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 _typeof(obj) { "@babel/helpers - typeof"; 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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
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 _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 React, { Component } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Animate from 'rc-animate';
|
||||
import createChainedFunction from "rc-util/es/createChainedFunction";
|
||||
import classnames from 'classnames';
|
||||
import Notice from './Notice';
|
||||
import _useNotification from './useNotification';
|
||||
var seed = 0;
|
||||
var now = Date.now();
|
||||
|
||||
function getUuid() {
|
||||
var id = seed;
|
||||
seed += 1;
|
||||
return "rcNotification_".concat(now, "_").concat(id);
|
||||
}
|
||||
|
||||
var Notification =
|
||||
/*#__PURE__*/
|
||||
function (_Component) {
|
||||
_inherits(Notification, _Component);
|
||||
|
||||
function Notification() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Notification);
|
||||
|
||||
_this = _possibleConstructorReturn(this, _getPrototypeOf(Notification).apply(this, arguments));
|
||||
_this.state = {
|
||||
notices: []
|
||||
};
|
||||
_this.hookRefs = new Map();
|
||||
|
||||
_this.add = function (notice, holderCallback) {
|
||||
notice.key = notice.key || getUuid();
|
||||
var key = notice.key;
|
||||
var maxCount = _this.props.maxCount;
|
||||
|
||||
_this.setState(function (previousState) {
|
||||
var notices = previousState.notices;
|
||||
var noticeIndex = notices.map(function (v) {
|
||||
return v.notice.key;
|
||||
}).indexOf(key);
|
||||
var updatedNotices = notices.concat();
|
||||
|
||||
if (noticeIndex !== -1) {
|
||||
updatedNotices.splice(noticeIndex, 1, {
|
||||
notice: notice,
|
||||
holderCallback: holderCallback
|
||||
});
|
||||
} else {
|
||||
if (maxCount && notices.length >= maxCount) {
|
||||
// XXX, use key of first item to update new added (let React to move exsiting
|
||||
// instead of remove and mount). Same key was used before for both a) external
|
||||
// manual control and b) internal react 'key' prop , which is not that good.
|
||||
notice.updateKey = updatedNotices[0].notice.updateKey || updatedNotices[0].notice.key;
|
||||
updatedNotices.shift();
|
||||
}
|
||||
|
||||
updatedNotices.push({
|
||||
notice: notice,
|
||||
holderCallback: holderCallback
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
notices: updatedNotices
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
_this.remove = function (key) {
|
||||
_this.setState(function (previousState) {
|
||||
return {
|
||||
notices: previousState.notices.filter(function (_ref) {
|
||||
var notice = _ref.notice;
|
||||
return notice.key !== key;
|
||||
})
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Notification, [{
|
||||
key: "getTransitionName",
|
||||
value: function getTransitionName() {
|
||||
var _this$props = this.props,
|
||||
prefixCls = _this$props.prefixCls,
|
||||
animation = _this$props.animation;
|
||||
var transitionName = this.props.transitionName;
|
||||
|
||||
if (!transitionName && animation) {
|
||||
transitionName = "".concat(prefixCls, "-").concat(animation);
|
||||
}
|
||||
|
||||
return transitionName;
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _this2 = this;
|
||||
|
||||
var notices = this.state.notices;
|
||||
var _this$props2 = this.props,
|
||||
prefixCls = _this$props2.prefixCls,
|
||||
className = _this$props2.className,
|
||||
closeIcon = _this$props2.closeIcon,
|
||||
style = _this$props2.style;
|
||||
var noticeNodes = notices.map(function (_ref2, index) {
|
||||
var notice = _ref2.notice,
|
||||
holderCallback = _ref2.holderCallback;
|
||||
var update = Boolean(index === notices.length - 1 && notice.updateKey);
|
||||
var key = notice.updateKey ? notice.updateKey : notice.key;
|
||||
var onClose = createChainedFunction(_this2.remove.bind(_this2, notice.key), notice.onClose);
|
||||
|
||||
var noticeProps = _objectSpread({
|
||||
prefixCls: prefixCls,
|
||||
closeIcon: closeIcon
|
||||
}, notice, {
|
||||
key: key,
|
||||
update: update,
|
||||
onClose: onClose,
|
||||
onClick: notice.onClick,
|
||||
children: notice.content
|
||||
});
|
||||
|
||||
if (holderCallback) {
|
||||
return React.createElement("div", {
|
||||
key: key,
|
||||
className: "".concat(prefixCls, "-hook-holder"),
|
||||
ref: function ref(div) {
|
||||
if (div) {
|
||||
_this2.hookRefs.set(key, div);
|
||||
|
||||
holderCallback(div, noticeProps);
|
||||
} else {
|
||||
_this2.hookRefs.delete(key);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return React.createElement(Notice, Object.assign({}, noticeProps));
|
||||
});
|
||||
return React.createElement("div", {
|
||||
className: classnames(prefixCls, className),
|
||||
style: style
|
||||
}, React.createElement(Animate, {
|
||||
transitionName: this.getTransitionName()
|
||||
}, noticeNodes));
|
||||
}
|
||||
}]);
|
||||
|
||||
return Notification;
|
||||
}(Component);
|
||||
|
||||
Notification.defaultProps = {
|
||||
prefixCls: 'rc-notification',
|
||||
animation: 'fade',
|
||||
style: {
|
||||
top: 65,
|
||||
left: '50%'
|
||||
}
|
||||
};
|
||||
|
||||
Notification.newInstance = function newNotificationInstance(properties, callback) {
|
||||
var _ref3 = properties || {},
|
||||
getContainer = _ref3.getContainer,
|
||||
props = _objectWithoutProperties(_ref3, ["getContainer"]);
|
||||
|
||||
var div = document.createElement('div');
|
||||
|
||||
if (getContainer) {
|
||||
var root = getContainer();
|
||||
root.appendChild(div);
|
||||
} else {
|
||||
document.body.appendChild(div);
|
||||
}
|
||||
|
||||
var called = false;
|
||||
|
||||
function ref(notification) {
|
||||
if (called) {
|
||||
return;
|
||||
}
|
||||
|
||||
called = true;
|
||||
callback({
|
||||
notice: function notice(noticeProps) {
|
||||
notification.add(noticeProps);
|
||||
},
|
||||
removeNotice: function removeNotice(key) {
|
||||
notification.remove(key);
|
||||
},
|
||||
component: notification,
|
||||
destroy: function destroy() {
|
||||
ReactDOM.unmountComponentAtNode(div);
|
||||
div.parentNode.removeChild(div);
|
||||
},
|
||||
// Hooks
|
||||
useNotification: function useNotification() {
|
||||
return _useNotification(notification);
|
||||
}
|
||||
});
|
||||
} // Only used for test case usage
|
||||
|
||||
|
||||
if (process.env.NODE_ENV === 'test' && properties.TEST_RENDER) {
|
||||
properties.TEST_RENDER(React.createElement(Notification, Object.assign({}, props, {
|
||||
ref: ref
|
||||
})));
|
||||
return;
|
||||
}
|
||||
|
||||
ReactDOM.render(React.createElement(Notification, Object.assign({}, props, {
|
||||
ref: ref
|
||||
})), div);
|
||||
};
|
||||
|
||||
export default Notification;
|
||||
2
web/node_modules/rc-notification/es/index.d.ts
generated
vendored
Normal file
2
web/node_modules/rc-notification/es/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import Notification from './Notification';
|
||||
export default Notification;
|
||||
2
web/node_modules/rc-notification/es/index.js
generated
vendored
Normal file
2
web/node_modules/rc-notification/es/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import Notification from './Notification';
|
||||
export default Notification;
|
||||
3
web/node_modules/rc-notification/es/useNotification.d.ts
generated
vendored
Normal file
3
web/node_modules/rc-notification/es/useNotification.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as React from 'react';
|
||||
import Notification, { NoticeFunc } from './Notification';
|
||||
export default function useNotification(notificationInstance: Notification): [NoticeFunc, React.ReactElement];
|
||||
44
web/node_modules/rc-notification/es/useNotification.js
generated
vendored
Normal file
44
web/node_modules/rc-notification/es/useNotification.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
||||
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
||||
|
||||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
||||
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
||||
|
||||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
||||
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
||||
|
||||
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
||||
|
||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||
|
||||
import * as React from 'react';
|
||||
import Notice from './Notice';
|
||||
export default function useNotification(notificationInstance) {
|
||||
var createdRef = React.useRef({});
|
||||
|
||||
var _React$useState = React.useState([]),
|
||||
_React$useState2 = _slicedToArray(_React$useState, 2),
|
||||
elements = _React$useState2[0],
|
||||
setElements = _React$useState2[1];
|
||||
|
||||
function notify(noticeProps) {
|
||||
notificationInstance.add(noticeProps, function (div, props) {
|
||||
var key = props.key;
|
||||
|
||||
if (div && !createdRef.current[key]) {
|
||||
var noticeEle = React.createElement(Notice, Object.assign({}, props, {
|
||||
holder: div
|
||||
}));
|
||||
createdRef.current[key] = noticeEle;
|
||||
setElements(function (originElements) {
|
||||
return [].concat(_toConsumableArray(originElements), [noticeEle]);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return [notify, React.createElement(React.Fragment, null, elements)];
|
||||
}
|
||||
33
web/node_modules/rc-notification/lib/Notice.d.ts
generated
vendored
Normal file
33
web/node_modules/rc-notification/lib/Notice.d.ts
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import React, { Component } from 'react';
|
||||
export interface NoticeProps {
|
||||
prefixCls: string;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
duration?: number | null;
|
||||
children?: React.ReactNode;
|
||||
update?: boolean;
|
||||
closeIcon?: React.ReactNode;
|
||||
closable?: boolean;
|
||||
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
||||
onClose?: () => void;
|
||||
/** @private Only for internal usage. We don't promise that we will refactor this */
|
||||
holder?: HTMLDivElement;
|
||||
}
|
||||
export default class Notice extends Component<NoticeProps> {
|
||||
static defaultProps: {
|
||||
onClose(): void;
|
||||
duration: number;
|
||||
style: {
|
||||
right: string;
|
||||
};
|
||||
};
|
||||
closeTimer: number;
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate(prevProps: NoticeProps): void;
|
||||
componentWillUnmount(): void;
|
||||
close: (e?: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
|
||||
startCloseTimer: () => void;
|
||||
clearCloseTimer: () => void;
|
||||
restartCloseTimer(): void;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
151
web/node_modules/rc-notification/lib/Notice.js
generated
vendored
Normal file
151
web/node_modules/rc-notification/lib/Notice.js
generated
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _reactDom = _interopRequireDefault(require("react-dom"));
|
||||
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
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 _typeof(obj) { "@babel/helpers - typeof"; 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 _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 Notice =
|
||||
/*#__PURE__*/
|
||||
function (_Component) {
|
||||
_inherits(Notice, _Component);
|
||||
|
||||
function Notice() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Notice);
|
||||
|
||||
_this = _possibleConstructorReturn(this, _getPrototypeOf(Notice).apply(this, arguments));
|
||||
|
||||
_this.close = function (e) {
|
||||
if (e) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
_this.clearCloseTimer();
|
||||
|
||||
_this.props.onClose();
|
||||
};
|
||||
|
||||
_this.startCloseTimer = function () {
|
||||
if (_this.props.duration) {
|
||||
_this.closeTimer = window.setTimeout(function () {
|
||||
_this.close();
|
||||
}, _this.props.duration * 1000);
|
||||
}
|
||||
};
|
||||
|
||||
_this.clearCloseTimer = function () {
|
||||
if (_this.closeTimer) {
|
||||
clearTimeout(_this.closeTimer);
|
||||
_this.closeTimer = null;
|
||||
}
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Notice, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
this.startCloseTimer();
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(prevProps) {
|
||||
if (this.props.duration !== prevProps.duration || this.props.update) {
|
||||
this.restartCloseTimer();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
this.clearCloseTimer();
|
||||
}
|
||||
}, {
|
||||
key: "restartCloseTimer",
|
||||
value: function restartCloseTimer() {
|
||||
this.clearCloseTimer();
|
||||
this.startCloseTimer();
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _this$props = this.props,
|
||||
prefixCls = _this$props.prefixCls,
|
||||
className = _this$props.className,
|
||||
closable = _this$props.closable,
|
||||
closeIcon = _this$props.closeIcon,
|
||||
style = _this$props.style,
|
||||
onClick = _this$props.onClick,
|
||||
children = _this$props.children,
|
||||
holder = _this$props.holder;
|
||||
var componentClass = "".concat(prefixCls, "-notice");
|
||||
|
||||
var node = _react.default.createElement("div", {
|
||||
className: (0, _classnames.default)(componentClass, className, _defineProperty({}, "".concat(componentClass, "-closable"), closable)),
|
||||
style: style,
|
||||
onMouseEnter: this.clearCloseTimer,
|
||||
onMouseLeave: this.startCloseTimer,
|
||||
onClick: onClick
|
||||
}, _react.default.createElement("div", {
|
||||
className: "".concat(componentClass, "-content")
|
||||
}, children), closable ? _react.default.createElement("a", {
|
||||
tabIndex: 0,
|
||||
onClick: this.close,
|
||||
className: "".concat(componentClass, "-close")
|
||||
}, closeIcon || _react.default.createElement("span", {
|
||||
className: "".concat(componentClass, "-close-x")
|
||||
})) : null);
|
||||
|
||||
if (holder) {
|
||||
return _reactDom.default.createPortal(node, holder);
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Notice;
|
||||
}(_react.Component);
|
||||
|
||||
exports.default = Notice;
|
||||
Notice.defaultProps = {
|
||||
onClose: function onClose() {},
|
||||
duration: 1.5,
|
||||
style: {
|
||||
right: '50%'
|
||||
}
|
||||
};
|
||||
54
web/node_modules/rc-notification/lib/Notification.d.ts
generated
vendored
Normal file
54
web/node_modules/rc-notification/lib/Notification.d.ts
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import React, { Component } from 'react';
|
||||
import { NoticeProps } from './Notice';
|
||||
export interface NoticeContent extends Omit<NoticeProps, 'prefixCls' | 'children'> {
|
||||
prefixCls?: string;
|
||||
key?: React.Key;
|
||||
updateKey?: React.Key;
|
||||
content?: React.ReactNode;
|
||||
}
|
||||
export declare type NoticeFunc = (noticeProps: NoticeContent) => void;
|
||||
export declare type HolderReadyCallback = (div: HTMLDivElement, noticeProps: NoticeProps & {
|
||||
key: React.Key;
|
||||
}) => void;
|
||||
export interface NotificationInstance {
|
||||
notice: NoticeFunc;
|
||||
removeNotice: (key: React.Key) => void;
|
||||
destroy: () => void;
|
||||
component: Notification;
|
||||
useNotification: () => [NoticeFunc, React.ReactElement];
|
||||
}
|
||||
export interface NotificationProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
transitionName?: string;
|
||||
animation?: string | object;
|
||||
maxCount?: number;
|
||||
closeIcon?: React.ReactNode;
|
||||
}
|
||||
interface NotificationState {
|
||||
notices: {
|
||||
notice: NoticeContent;
|
||||
holderCallback?: HolderReadyCallback;
|
||||
}[];
|
||||
}
|
||||
declare class Notification extends Component<NotificationProps, NotificationState> {
|
||||
static newInstance: (properties: NotificationProps & {
|
||||
getContainer?: () => HTMLElement;
|
||||
}, callback: (instance: NotificationInstance) => void) => void;
|
||||
static defaultProps: {
|
||||
prefixCls: string;
|
||||
animation: string;
|
||||
style: {
|
||||
top: number;
|
||||
left: string;
|
||||
};
|
||||
};
|
||||
state: NotificationState;
|
||||
private hookRefs;
|
||||
getTransitionName(): string;
|
||||
add: (notice: NoticeContent, holderCallback?: HolderReadyCallback) => void;
|
||||
remove: (key: string | number) => void;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
export default Notification;
|
||||
271
web/node_modules/rc-notification/lib/Notification.js
generated
vendored
Normal file
271
web/node_modules/rc-notification/lib/Notification.js
generated
vendored
Normal file
@@ -0,0 +1,271 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _reactDom = _interopRequireDefault(require("react-dom"));
|
||||
|
||||
var _rcAnimate = _interopRequireDefault(require("rc-animate"));
|
||||
|
||||
var _createChainedFunction = _interopRequireDefault(require("rc-util/lib/createChainedFunction"));
|
||||
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
|
||||
var _Notice = _interopRequireDefault(require("./Notice"));
|
||||
|
||||
var _useNotification2 = _interopRequireDefault(require("./useNotification"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
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 _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 _typeof(obj) { "@babel/helpers - typeof"; 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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
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 _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 seed = 0;
|
||||
var now = Date.now();
|
||||
|
||||
function getUuid() {
|
||||
var id = seed;
|
||||
seed += 1;
|
||||
return "rcNotification_".concat(now, "_").concat(id);
|
||||
}
|
||||
|
||||
var Notification =
|
||||
/*#__PURE__*/
|
||||
function (_Component) {
|
||||
_inherits(Notification, _Component);
|
||||
|
||||
function Notification() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Notification);
|
||||
|
||||
_this = _possibleConstructorReturn(this, _getPrototypeOf(Notification).apply(this, arguments));
|
||||
_this.state = {
|
||||
notices: []
|
||||
};
|
||||
_this.hookRefs = new Map();
|
||||
|
||||
_this.add = function (notice, holderCallback) {
|
||||
notice.key = notice.key || getUuid();
|
||||
var key = notice.key;
|
||||
var maxCount = _this.props.maxCount;
|
||||
|
||||
_this.setState(function (previousState) {
|
||||
var notices = previousState.notices;
|
||||
var noticeIndex = notices.map(function (v) {
|
||||
return v.notice.key;
|
||||
}).indexOf(key);
|
||||
var updatedNotices = notices.concat();
|
||||
|
||||
if (noticeIndex !== -1) {
|
||||
updatedNotices.splice(noticeIndex, 1, {
|
||||
notice: notice,
|
||||
holderCallback: holderCallback
|
||||
});
|
||||
} else {
|
||||
if (maxCount && notices.length >= maxCount) {
|
||||
// XXX, use key of first item to update new added (let React to move exsiting
|
||||
// instead of remove and mount). Same key was used before for both a) external
|
||||
// manual control and b) internal react 'key' prop , which is not that good.
|
||||
notice.updateKey = updatedNotices[0].notice.updateKey || updatedNotices[0].notice.key;
|
||||
updatedNotices.shift();
|
||||
}
|
||||
|
||||
updatedNotices.push({
|
||||
notice: notice,
|
||||
holderCallback: holderCallback
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
notices: updatedNotices
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
_this.remove = function (key) {
|
||||
_this.setState(function (previousState) {
|
||||
return {
|
||||
notices: previousState.notices.filter(function (_ref) {
|
||||
var notice = _ref.notice;
|
||||
return notice.key !== key;
|
||||
})
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Notification, [{
|
||||
key: "getTransitionName",
|
||||
value: function getTransitionName() {
|
||||
var _this$props = this.props,
|
||||
prefixCls = _this$props.prefixCls,
|
||||
animation = _this$props.animation;
|
||||
var transitionName = this.props.transitionName;
|
||||
|
||||
if (!transitionName && animation) {
|
||||
transitionName = "".concat(prefixCls, "-").concat(animation);
|
||||
}
|
||||
|
||||
return transitionName;
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _this2 = this;
|
||||
|
||||
var notices = this.state.notices;
|
||||
var _this$props2 = this.props,
|
||||
prefixCls = _this$props2.prefixCls,
|
||||
className = _this$props2.className,
|
||||
closeIcon = _this$props2.closeIcon,
|
||||
style = _this$props2.style;
|
||||
var noticeNodes = notices.map(function (_ref2, index) {
|
||||
var notice = _ref2.notice,
|
||||
holderCallback = _ref2.holderCallback;
|
||||
var update = Boolean(index === notices.length - 1 && notice.updateKey);
|
||||
var key = notice.updateKey ? notice.updateKey : notice.key;
|
||||
var onClose = (0, _createChainedFunction.default)(_this2.remove.bind(_this2, notice.key), notice.onClose);
|
||||
|
||||
var noticeProps = _objectSpread({
|
||||
prefixCls: prefixCls,
|
||||
closeIcon: closeIcon
|
||||
}, notice, {
|
||||
key: key,
|
||||
update: update,
|
||||
onClose: onClose,
|
||||
onClick: notice.onClick,
|
||||
children: notice.content
|
||||
});
|
||||
|
||||
if (holderCallback) {
|
||||
return _react.default.createElement("div", {
|
||||
key: key,
|
||||
className: "".concat(prefixCls, "-hook-holder"),
|
||||
ref: function ref(div) {
|
||||
if (div) {
|
||||
_this2.hookRefs.set(key, div);
|
||||
|
||||
holderCallback(div, noticeProps);
|
||||
} else {
|
||||
_this2.hookRefs.delete(key);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return _react.default.createElement(_Notice.default, Object.assign({}, noticeProps));
|
||||
});
|
||||
return _react.default.createElement("div", {
|
||||
className: (0, _classnames.default)(prefixCls, className),
|
||||
style: style
|
||||
}, _react.default.createElement(_rcAnimate.default, {
|
||||
transitionName: this.getTransitionName()
|
||||
}, noticeNodes));
|
||||
}
|
||||
}]);
|
||||
|
||||
return Notification;
|
||||
}(_react.Component);
|
||||
|
||||
Notification.defaultProps = {
|
||||
prefixCls: 'rc-notification',
|
||||
animation: 'fade',
|
||||
style: {
|
||||
top: 65,
|
||||
left: '50%'
|
||||
}
|
||||
};
|
||||
|
||||
Notification.newInstance = function newNotificationInstance(properties, callback) {
|
||||
var _ref3 = properties || {},
|
||||
getContainer = _ref3.getContainer,
|
||||
props = _objectWithoutProperties(_ref3, ["getContainer"]);
|
||||
|
||||
var div = document.createElement('div');
|
||||
|
||||
if (getContainer) {
|
||||
var root = getContainer();
|
||||
root.appendChild(div);
|
||||
} else {
|
||||
document.body.appendChild(div);
|
||||
}
|
||||
|
||||
var called = false;
|
||||
|
||||
function ref(notification) {
|
||||
if (called) {
|
||||
return;
|
||||
}
|
||||
|
||||
called = true;
|
||||
callback({
|
||||
notice: function notice(noticeProps) {
|
||||
notification.add(noticeProps);
|
||||
},
|
||||
removeNotice: function removeNotice(key) {
|
||||
notification.remove(key);
|
||||
},
|
||||
component: notification,
|
||||
destroy: function destroy() {
|
||||
_reactDom.default.unmountComponentAtNode(div);
|
||||
|
||||
div.parentNode.removeChild(div);
|
||||
},
|
||||
// Hooks
|
||||
useNotification: function useNotification() {
|
||||
return (0, _useNotification2.default)(notification);
|
||||
}
|
||||
});
|
||||
} // Only used for test case usage
|
||||
|
||||
|
||||
if (process.env.NODE_ENV === 'test' && properties.TEST_RENDER) {
|
||||
properties.TEST_RENDER(_react.default.createElement(Notification, Object.assign({}, props, {
|
||||
ref: ref
|
||||
})));
|
||||
return;
|
||||
}
|
||||
|
||||
_reactDom.default.render(_react.default.createElement(Notification, Object.assign({}, props, {
|
||||
ref: ref
|
||||
})), div);
|
||||
};
|
||||
|
||||
var _default = Notification;
|
||||
exports.default = _default;
|
||||
2
web/node_modules/rc-notification/lib/index.d.ts
generated
vendored
Normal file
2
web/node_modules/rc-notification/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import Notification from './Notification';
|
||||
export default Notification;
|
||||
13
web/node_modules/rc-notification/lib/index.js
generated
vendored
Normal file
13
web/node_modules/rc-notification/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _Notification = _interopRequireDefault(require("./Notification"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = _Notification.default;
|
||||
exports.default = _default;
|
||||
3
web/node_modules/rc-notification/lib/useNotification.d.ts
generated
vendored
Normal file
3
web/node_modules/rc-notification/lib/useNotification.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as React from 'react';
|
||||
import Notification, { NoticeFunc } from './Notification';
|
||||
export default function useNotification(notificationInstance: Notification): [NoticeFunc, React.ReactElement];
|
||||
61
web/node_modules/rc-notification/lib/useNotification.js
generated
vendored
Normal file
61
web/node_modules/rc-notification/lib/useNotification.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = useNotification;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _Notice = _interopRequireDefault(require("./Notice"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
||||
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
||||
|
||||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
||||
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
||||
|
||||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
||||
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
||||
|
||||
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
||||
|
||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||
|
||||
function useNotification(notificationInstance) {
|
||||
var createdRef = React.useRef({});
|
||||
|
||||
var _React$useState = React.useState([]),
|
||||
_React$useState2 = _slicedToArray(_React$useState, 2),
|
||||
elements = _React$useState2[0],
|
||||
setElements = _React$useState2[1];
|
||||
|
||||
function notify(noticeProps) {
|
||||
notificationInstance.add(noticeProps, function (div, props) {
|
||||
var key = props.key;
|
||||
|
||||
if (div && !createdRef.current[key]) {
|
||||
var noticeEle = React.createElement(_Notice.default, Object.assign({}, props, {
|
||||
holder: div
|
||||
}));
|
||||
createdRef.current[key] = noticeEle;
|
||||
setElements(function (originElements) {
|
||||
return [].concat(_toConsumableArray(originElements), [noticeEle]);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return [notify, React.createElement(React.Fragment, null, elements)];
|
||||
}
|
||||
99
web/node_modules/rc-notification/package.json
generated
vendored
Normal file
99
web/node_modules/rc-notification/package.json
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"_from": "rc-notification@~4.0.0",
|
||||
"_id": "rc-notification@4.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-In9FimkJY+JSIq3/eopPfBpQQr2Zugq5i9Aw9vdiNCGCsAsSO9bGq2dPsn8bamOydNrhc3djljGfmxUUMbcZnA==",
|
||||
"_location": "/rc-notification",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "rc-notification@~4.0.0",
|
||||
"name": "rc-notification",
|
||||
"escapedName": "rc-notification",
|
||||
"rawSpec": "~4.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~4.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/antd"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/rc-notification/-/rc-notification-4.0.0.tgz",
|
||||
"_shasum": "ffe59783d6738003972dde8b9658f1acd469cd2c",
|
||||
"_spec": "rc-notification@~4.0.0",
|
||||
"_where": "/Users/thilina/TestProjects/icehrm-pro/web/node_modules/antd",
|
||||
"bugs": {
|
||||
"url": "http://github.com/react-component/notification/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"classnames": "2.x",
|
||||
"rc-animate": "2.x",
|
||||
"rc-util": "^4.0.4"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "notification ui component for react",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^25.1.0",
|
||||
"@types/react": "^16.8.19",
|
||||
"@types/react-dom": "^16.8.4",
|
||||
"cross-env": "^7.0.0",
|
||||
"enzyme": "^3.3.0",
|
||||
"enzyme-to-json": "^3.4.0",
|
||||
"father": "^2.13.2",
|
||||
"less": "^3.10.3",
|
||||
"np": "^6.0.0",
|
||||
"react": "^16.9.0",
|
||||
"react-dom": "^16.9.0",
|
||||
"typescript": "^3.7.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.x"
|
||||
},
|
||||
"files": [
|
||||
"assets/*.css",
|
||||
"assets/*.less",
|
||||
"es",
|
||||
"lib"
|
||||
],
|
||||
"homepage": "http://github.com/react-component/notification",
|
||||
"keywords": [
|
||||
"react",
|
||||
"react-component",
|
||||
"react-notification",
|
||||
"notification"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "yiminghe@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "skyking_H@hotmail.com"
|
||||
},
|
||||
{
|
||||
"name": "hust2012jiangkai@gmail.com"
|
||||
}
|
||||
],
|
||||
"module": "es/index",
|
||||
"name": "rc-notification",
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
"react-dom": "*"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/react-component/notification.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "father doc build --storybook",
|
||||
"compile": "father build && lessc assets/index.less assets/index.css",
|
||||
"lint": "eslint src/ examples/ --ext .tsx,.ts,.jsx,.js",
|
||||
"now-build": "npm run build",
|
||||
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
|
||||
"start": "cross-env NODE_ENV=development father doc dev --storybook",
|
||||
"test": "father test"
|
||||
},
|
||||
"version": "4.0.0"
|
||||
}
|
||||
Reference in New Issue
Block a user