Latest updates from IceHrmPro

This commit is contained in:
Thilina Pituwala
2020-05-20 18:47:29 +02:00
parent 60c92d7935
commit 7453a58aad
18012 changed files with 2089245 additions and 10173 deletions

50
web/node_modules/rc-dialog/es/Dialog.d.ts generated vendored Normal file
View File

@@ -0,0 +1,50 @@
import * as React from 'react';
import IDialogPropTypes from './IDialogPropTypes';
export interface IDialogChildProps extends IDialogPropTypes {
getOpenCount: () => number;
switchScrollingEffect?: () => void;
}
export default class Dialog extends React.Component<IDialogChildProps, any> {
static defaultProps: {
className: string;
mask: boolean;
visible: boolean;
keyboard: boolean;
closable: boolean;
maskClosable: boolean;
destroyOnClose: boolean;
prefixCls: string;
focusTriggerAfterClose: boolean;
};
private inTransition;
private titleId;
private openTime;
private lastOutSideFocusNode;
private wrap;
private dialog;
private sentinelStart;
private sentinelEnd;
private dialogMouseDown;
private timeoutId;
private switchScrollingEffect;
constructor(props: IDialogChildProps);
componentDidMount(): void;
componentDidUpdate(prevProps: IDialogPropTypes): void;
componentWillUnmount(): void;
tryFocus(): void;
onAnimateLeave: () => void;
onDialogMouseDown: () => void;
onMaskMouseUp: React.MouseEventHandler<HTMLDivElement>;
onMaskClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
onKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => void;
getDialogElement: () => JSX.Element;
getZIndexStyle: () => any;
getWrapStyle: () => any;
getMaskStyle: () => any;
getMaskElement: () => JSX.Element | undefined;
getMaskTransitionName: () => string | undefined;
getTransitionName: () => string | undefined;
close: (e: any) => void;
saveRef: (name: string) => (node: any) => void;
render(): JSX.Element;
}

288
web/node_modules/rc-dialog/es/Dialog.js generated vendored Normal file
View File

@@ -0,0 +1,288 @@
import _extends from 'babel-runtime/helpers/extends';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import KeyCode from 'rc-util/es/KeyCode';
import contains from 'rc-util/es/Dom/contains';
import Animate from 'rc-animate';
import LazyRenderBox from './LazyRenderBox';
var uuid = 0;
/* eslint react/no-is-mounted:0 */
function getScroll(w, top) {
var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
var method = 'scroll' + (top ? 'Top' : 'Left');
if (typeof ret !== 'number') {
var d = w.document;
ret = d.documentElement[method];
if (typeof ret !== 'number') {
ret = d.body[method];
}
}
return ret;
}
function setTransformOrigin(node, value) {
var style = node.style;
['Webkit', 'Moz', 'Ms', 'ms'].forEach(function (prefix) {
style[prefix + 'TransformOrigin'] = value;
});
style['transformOrigin'] = value;
}
function offset(el) {
var rect = el.getBoundingClientRect();
var pos = {
left: rect.left,
top: rect.top
};
var doc = el.ownerDocument;
var w = doc.defaultView || doc.parentWindow;
pos.left += getScroll(w);
pos.top += getScroll(w, true);
return pos;
}
var Dialog = function (_React$Component) {
_inherits(Dialog, _React$Component);
function Dialog(props) {
_classCallCheck(this, Dialog);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_this.inTransition = false;
_this.onAnimateLeave = function () {
var afterClose = _this.props.afterClose;
// need demo?
// https://github.com/react-component/dialog/pull/28
if (_this.wrap) {
_this.wrap.style.display = 'none';
}
_this.inTransition = false;
_this.switchScrollingEffect();
if (afterClose) {
afterClose();
}
};
_this.onDialogMouseDown = function () {
_this.dialogMouseDown = true;
};
_this.onMaskMouseUp = function () {
if (_this.dialogMouseDown) {
_this.timeoutId = setTimeout(function () {
_this.dialogMouseDown = false;
}, 0);
}
};
_this.onMaskClick = function (e) {
// android trigger click on open (fastclick??)
if (Date.now() - _this.openTime < 300) {
return;
}
if (e.target === e.currentTarget && !_this.dialogMouseDown) {
_this.close(e);
}
};
_this.onKeyDown = function (e) {
var props = _this.props;
if (props.keyboard && e.keyCode === KeyCode.ESC) {
e.stopPropagation();
_this.close(e);
return;
}
// keep focus inside dialog
if (props.visible) {
if (e.keyCode === KeyCode.TAB) {
var activeElement = document.activeElement;
var sentinelStart = _this.sentinelStart;
if (e.shiftKey) {
if (activeElement === sentinelStart) {
_this.sentinelEnd.focus();
}
} else if (activeElement === _this.sentinelEnd) {
sentinelStart.focus();
}
}
}
};
_this.getDialogElement = function () {
var props = _this.props;
var closable = props.closable;
var prefixCls = props.prefixCls;
var dest = {};
if (props.width !== undefined) {
dest.width = props.width;
}
if (props.height !== undefined) {
dest.height = props.height;
}
var footer = void 0;
if (props.footer) {
footer = React.createElement("div", { className: prefixCls + '-footer', ref: _this.saveRef('footer') }, props.footer);
}
var header = void 0;
if (props.title) {
header = React.createElement("div", { className: prefixCls + '-header', ref: _this.saveRef('header') }, React.createElement("div", { className: prefixCls + '-title', id: _this.titleId }, props.title));
}
var closer = void 0;
if (closable) {
closer = React.createElement("button", { type: "button", onClick: _this.close, "aria-label": "Close", className: prefixCls + '-close' }, props.closeIcon || React.createElement("span", { className: prefixCls + '-close-x' }));
}
var style = _extends({}, props.style, dest);
var sentinelStyle = { width: 0, height: 0, overflow: 'hidden', outline: 'none' };
var transitionName = _this.getTransitionName();
var dialogElement = React.createElement(LazyRenderBox, { key: "dialog-element", role: "document", ref: _this.saveRef('dialog'), style: style, className: prefixCls + ' ' + (props.className || ''), visible: props.visible, forceRender: props.forceRender, onMouseDown: _this.onDialogMouseDown }, React.createElement("div", { tabIndex: 0, ref: _this.saveRef('sentinelStart'), style: sentinelStyle, "aria-hidden": "true" }), React.createElement("div", { className: prefixCls + '-content' }, closer, header, React.createElement("div", _extends({ className: prefixCls + '-body', style: props.bodyStyle, ref: _this.saveRef('body') }, props.bodyProps), props.children), footer), React.createElement("div", { tabIndex: 0, ref: _this.saveRef('sentinelEnd'), style: sentinelStyle, "aria-hidden": "true" }));
return React.createElement(Animate, { key: "dialog", showProp: "visible", onLeave: _this.onAnimateLeave, transitionName: transitionName, component: "", transitionAppear: true }, props.visible || !props.destroyOnClose ? dialogElement : null);
};
_this.getZIndexStyle = function () {
var style = {};
var props = _this.props;
if (props.zIndex !== undefined) {
style.zIndex = props.zIndex;
}
return style;
};
_this.getWrapStyle = function () {
return _extends({}, _this.getZIndexStyle(), _this.props.wrapStyle);
};
_this.getMaskStyle = function () {
return _extends({}, _this.getZIndexStyle(), _this.props.maskStyle);
};
_this.getMaskElement = function () {
var props = _this.props;
var maskElement = void 0;
if (props.mask) {
var maskTransition = _this.getMaskTransitionName();
maskElement = React.createElement(LazyRenderBox, _extends({ style: _this.getMaskStyle(), key: "mask", className: props.prefixCls + '-mask', hiddenClassName: props.prefixCls + '-mask-hidden', visible: props.visible }, props.maskProps));
if (maskTransition) {
maskElement = React.createElement(Animate, { key: "mask", showProp: "visible", transitionAppear: true, component: "", transitionName: maskTransition }, maskElement);
}
}
return maskElement;
};
_this.getMaskTransitionName = function () {
var props = _this.props;
var transitionName = props.maskTransitionName;
var animation = props.maskAnimation;
if (!transitionName && animation) {
transitionName = props.prefixCls + '-' + animation;
}
return transitionName;
};
_this.getTransitionName = function () {
var props = _this.props;
var transitionName = props.transitionName;
var animation = props.animation;
if (!transitionName && animation) {
transitionName = props.prefixCls + '-' + animation;
}
return transitionName;
};
_this.close = function (e) {
var onClose = _this.props.onClose;
if (onClose) {
onClose(e);
}
};
_this.saveRef = function (name) {
return function (node) {
_this[name] = node;
};
};
_this.titleId = 'rcDialogTitle' + uuid++;
_this.switchScrollingEffect = props.switchScrollingEffect || function () {};
return _this;
}
Dialog.prototype.componentDidMount = function componentDidMount() {
this.componentDidUpdate({});
// if forceRender is true, set element style display to be none;
if ((this.props.forceRender || this.props.getContainer === false && !this.props.visible) && this.wrap) {
this.wrap.style.display = 'none';
}
};
Dialog.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
var _props = this.props,
visible = _props.visible,
mask = _props.mask,
focusTriggerAfterClose = _props.focusTriggerAfterClose;
var mousePosition = this.props.mousePosition;
if (visible) {
// first show
if (!prevProps.visible) {
this.openTime = Date.now();
this.switchScrollingEffect();
this.tryFocus();
var dialogNode = ReactDOM.findDOMNode(this.dialog);
if (mousePosition) {
var elOffset = offset(dialogNode);
setTransformOrigin(dialogNode, mousePosition.x - elOffset.left + 'px ' + (mousePosition.y - elOffset.top) + 'px');
} else {
setTransformOrigin(dialogNode, '');
}
}
} else if (prevProps.visible) {
this.inTransition = true;
if (mask && this.lastOutSideFocusNode && focusTriggerAfterClose) {
try {
this.lastOutSideFocusNode.focus();
} catch (e) {
this.lastOutSideFocusNode = null;
}
this.lastOutSideFocusNode = null;
}
}
};
Dialog.prototype.componentWillUnmount = function componentWillUnmount() {
var _props2 = this.props,
visible = _props2.visible,
getOpenCount = _props2.getOpenCount;
if ((visible || this.inTransition) && !getOpenCount()) {
this.switchScrollingEffect();
}
clearTimeout(this.timeoutId);
};
Dialog.prototype.tryFocus = function tryFocus() {
if (!contains(this.wrap, document.activeElement)) {
this.lastOutSideFocusNode = document.activeElement;
this.sentinelStart.focus();
}
};
Dialog.prototype.render = function render() {
var props = this.props;
var prefixCls = props.prefixCls,
maskClosable = props.maskClosable;
var style = this.getWrapStyle();
// clear hide display
// and only set display after async anim, not here for hide
if (props.visible) {
style.display = null;
}
return React.createElement("div", { className: prefixCls + '-root' }, this.getMaskElement(), React.createElement("div", _extends({ tabIndex: -1, onKeyDown: this.onKeyDown, className: prefixCls + '-wrap ' + (props.wrapClassName || ''), ref: this.saveRef('wrap'), onClick: maskClosable ? this.onMaskClick : null, onMouseUp: maskClosable ? this.onMaskMouseUp : null, role: "dialog", "aria-labelledby": props.title ? this.titleId : null, style: style }, props.wrapProps), this.getDialogElement()));
};
return Dialog;
}(React.Component);
export default Dialog;
Dialog.defaultProps = {
className: '',
mask: true,
visible: false,
keyboard: true,
closable: true,
maskClosable: true,
destroyOnClose: false,
prefixCls: 'rc-dialog',
focusTriggerAfterClose: true
};

4
web/node_modules/rc-dialog/es/DialogWrap.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
/// <reference types="react" />
import IDialogPropTypes from './IDialogPropTypes';
declare const _default: (props: IDialogPropTypes) => JSX.Element;
export default _default;

27
web/node_modules/rc-dialog/es/DialogWrap.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
import _extends from 'babel-runtime/helpers/extends';
import * as React from 'react';
import Dialog from './Dialog';
import Portal from 'rc-util/es/PortalWrapper';
// fix issue #10656
/*
* getContainer remarks
* Custom container should not be return, because in the Portal component, it will remove the
* return container element here, if the custom container is the only child of it's component,
* like issue #10656, It will has a conflict with removeChild method in react-dom.
* So here should add a child (div element) to custom container.
* */
export default (function (props) {
var visible = props.visible,
getContainer = props.getContainer,
forceRender = props.forceRender;
// 渲染在当前 dom 里;
if (getContainer === false) {
return React.createElement(Dialog, _extends({}, props, { getOpenCount: function getOpenCount() {
return 2;
} }));
}
return React.createElement(Portal, { visible: visible, forceRender: forceRender, getContainer: getContainer }, function (childProps) {
return React.createElement(Dialog, _extends({}, props, childProps));
});
});

41
web/node_modules/rc-dialog/es/IDialogPropTypes.d.ts generated vendored Normal file
View File

@@ -0,0 +1,41 @@
import { ReactNode, CSSProperties, SyntheticEvent } from 'react';
declare type IStringOrHtmlElement = string | HTMLElement;
interface IDialogPropTypes {
className?: string;
keyboard?: boolean;
style?: CSSProperties;
mask?: boolean;
children?: any;
afterClose?: () => any;
onClose?: (e: SyntheticEvent<HTMLDivElement>) => any;
closable?: boolean;
maskClosable?: boolean;
visible?: boolean;
destroyOnClose?: boolean;
mousePosition?: {
x: number;
y: number;
};
title?: ReactNode;
footer?: ReactNode;
transitionName?: string;
maskTransitionName?: string;
animation?: any;
maskAnimation?: any;
wrapStyle?: {};
bodyStyle?: {};
maskStyle?: {};
prefixCls?: string;
wrapClassName?: string;
width?: number;
height?: number;
zIndex?: number;
bodyProps?: any;
maskProps?: any;
wrapProps?: any;
getContainer?: IStringOrHtmlElement | (() => IStringOrHtmlElement) | false;
closeIcon?: ReactNode;
forceRender?: boolean;
focusTriggerAfterClose?: boolean;
}
export default IDialogPropTypes;

0
web/node_modules/rc-dialog/es/IDialogPropTypes.js generated vendored Normal file
View File

14
web/node_modules/rc-dialog/es/LazyRenderBox.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import * as React from 'react';
export interface ILazyRenderBoxPropTypes {
className?: string;
visible?: boolean;
hiddenClassName?: string;
role?: string;
style?: {};
forceRender?: boolean;
onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
}
export default class LazyRenderBox extends React.Component<ILazyRenderBoxPropTypes, any> {
shouldComponentUpdate(nextProps: ILazyRenderBoxPropTypes): boolean;
render(): JSX.Element;
}

48
web/node_modules/rc-dialog/es/LazyRenderBox.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
import _extends from "babel-runtime/helpers/extends";
import _classCallCheck from "babel-runtime/helpers/classCallCheck";
import _possibleConstructorReturn from "babel-runtime/helpers/possibleConstructorReturn";
import _inherits from "babel-runtime/helpers/inherits";
var __rest = this && this.__rest || function (s, e) {
var t = {};
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
}if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
}return t;
};
import * as React from 'react';
var LazyRenderBox = function (_React$Component) {
_inherits(LazyRenderBox, _React$Component);
function LazyRenderBox() {
_classCallCheck(this, LazyRenderBox);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
LazyRenderBox.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
if (nextProps.forceRender) {
return true;
}
return !!nextProps.hiddenClassName || !!nextProps.visible;
};
LazyRenderBox.prototype.render = function render() {
var _a = this.props,
className = _a.className,
hiddenClassName = _a.hiddenClassName,
visible = _a.visible,
forceRender = _a.forceRender,
restProps = __rest(_a, ["className", "hiddenClassName", "visible", "forceRender"]);
var useClassName = className;
if (!!hiddenClassName && !visible) {
useClassName += " " + hiddenClassName;
}
return React.createElement("div", _extends({}, restProps, { className: useClassName }));
};
return LazyRenderBox;
}(React.Component);
export default LazyRenderBox;