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

21
web/node_modules/rc-resize-observer/HISTORY.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
## 0.5.0
- support `theme="dark|light"`.
## 0.4.0
- support `columnLayout`.
- support `backgroundColor`.
## 0.3.0
- support `style` and `className` for footer column and footer item.
- support `LinkComponent` for footer item.
## 0.2.0
- Fix `lib` and `es` folders missing.
## 0.1.0
- First release.

9
web/node_modules/rc-resize-observer/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2019-present afc163
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.

67
web/node_modules/rc-resize-observer/README.md generated vendored Normal file
View File

@@ -0,0 +1,67 @@
# rc-resize-observer
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Codecov][codecov-image]][codecov-url]
[![david deps][david-image]][david-url]
[![david devDeps][david-dev-image]][david-dev-url]
[![npm download][download-image]][download-url]
[npm-image]: http://img.shields.io/npm/v/rc-resize-observer.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-resize-observer
[travis-image]: https://img.shields.io/travis/com/react-component/resize-observer.svg?style=flat-square
[travis-url]: https://travis-ci.com/react-component/resize-observer
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/resize-observer/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/react-component/resize-observer/branch/master
[david-image]: https://david-dm.org/react-component/resize-observer/status.svg?style=flat-square
[david-dev-url]: https://david-dm.org/react-component/resize-observer?type=dev
[david-dev-image]: https://david-dm.org/react-component/resize-observer/dev-status.svg?style=flat-square
[david-url]: https://david-dm.org/react-component/resize-observer
[download-image]: https://img.shields.io/npm/dm/rc-resize-observer.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-resize-observer
Resize observer for React.
## Live Demo
https://react-component.github.io/resize-observer/
## Install
[![rc-resize-observer](https://nodei.co/npm/rc-resize-observer.png)](https://npmjs.org/package/rc-resize-observer)
## Usage
```js
import ResizeObserver from 'rc-resize-observer';
import { render } from 'react-dom';
render(
<ResizeObserver
onResize={() => {
console.log('resized!');
}}
>
<textarea />
</ResizeObserver>,
mountNode,
);
```
## API
| Property | Type | Default | Description |
| -------- | --------------------------- | ------- | ------------------------------- |
| disabled | boolean | false | |
| onResize | ({ width, height }) => void | - | Trigger when child node resized |
## Development
```
npm install
npm start
```
## License
rc-resize-observer is released under the MIT license.

112
web/node_modules/rc-resize-observer/assets/index.css generated vendored Normal file
View File

@@ -0,0 +1,112 @@
.rc-footer {
position: relative;
clear: both;
color: rgba(255, 255, 255, 0.4);
font-size: 14px;
line-height: 1.5;
background-color: #000;
}
.rc-footer a {
transition: all 0.3s;
color: rgba(255, 255, 255, 0.9);
text-decoration: none;
}
.rc-footer a:hover {
color: #40a9ff;
}
.rc-footer-container {
width: 100%;
max-width: 1200px;
padding: 80px 0;
margin: auto;
}
.rc-footer-columns {
display: flex;
justify-content: space-around;
}
.rc-footer-column h2 {
position: relative;
margin: 0 auto 24px;
font-weight: 500;
font-size: 16px;
color: #fff;
}
.rc-footer-column-icon {
margin-right: 0.5em;
width: 22px;
display: inline-block;
vertical-align: middle;
top: -1px;
position: relative;
text-align: center;
}
.rc-footer-column-icon > span,
.rc-footer-column-icon > svg,
.rc-footer-column-icon img {
width: 100%;
display: block;
}
.rc-footer-item {
margin: 12px 0;
}
.rc-footer-item-icon {
margin-right: 0.4em;
width: 16px;
display: inline-block;
vertical-align: middle;
top: -1px;
position: relative;
text-align: center;
}
.rc-footer-item-icon > span,
.rc-footer-item-icon > svg,
.rc-footer-item-icon img {
width: 100%;
display: block;
}
.rc-footer-item-separator {
margin: 0 0.3em;
}
.rc-footer-bottom-container {
border-top: 1px solid rgba(255, 255, 255, 0.25);
width: 100%;
max-width: 1200px;
text-align: center;
margin: 0 auto;
padding: 16px 0;
line-height: 32px;
font-size: 16px;
}
.rc-footer-light {
background-color: transparent;
color: rgba(0, 0, 0, 0.85);
}
.rc-footer-light h2,
.rc-footer-light a {
color: rgba(0, 0, 0, 0.85);
}
.rc-footer-light .rc-footer-bottom-container {
border-top-color: #e8e8e8;
}
.rc-footer-light .rc-footer-item-separator,
.rc-footer-light .rc-footer-item-description {
color: rgba(0, 0, 0, 0.45);
}
@media only screen and (max-width: 767.99px) {
.rc-footer {
text-align: center;
}
.rc-footer-container {
padding: 40px 0;
}
.rc-footer-columns {
display: block;
}
.rc-footer-column {
display: block;
margin-bottom: 40px;
}
.rc-footer-column:last-child {
margin-bottom: 0;
}
}

139
web/node_modules/rc-resize-observer/assets/index.less generated vendored Normal file
View File

@@ -0,0 +1,139 @@
@footer-prefix-cls: rc-footer;
.@{footer-prefix-cls} {
position: relative;
clear: both;
color: rgba(255, 255, 255, .4);
font-size: 14px;
line-height: 1.5;
background-color: #000;
a {
transition: all .3s;
color: rgba(255, 255, 255, .9);
text-decoration: none;
&:hover {
color: #40a9ff;
}
}
&-container {
width: 100%;
max-width: 1200px;
padding: 80px 0;
margin: auto;
}
&-columns {
display: flex;
justify-content: space-around;
}
&-column {
h2 {
position: relative;
margin: 0 auto 24px;
font-weight: 500;
font-size: 16px;
color: #fff;
}
&-icon {
margin-right: .5em;
width: 22px;
display: inline-block;
vertical-align: middle;
top: -1px;
position: relative;
text-align: center;
> span,
> svg,
img {
width: 100%;
display: block;
}
}
}
&-item {
margin: 12px 0;
&-icon {
margin-right: .4em;
width: 16px;
display: inline-block;
vertical-align: middle;
top: -1px;
position: relative;
text-align: center;
> span,
> svg,
img {
width: 100%;
display: block;
}
}
&-separator {
margin: 0 .3em;
}
}
&-bottom {
&-container {
border-top: 1px solid rgba(255, 255, 255, .25);
width: 100%;
max-width: 1200px;
text-align: center;
margin: 0 auto;
padding: 16px 0;
line-height: 32px;
font-size: 16px;
}
}
&-light {
background-color: transparent;
color: rgba(0, 0, 0, .85);
h2,
a {
color: rgba(0, 0, 0, .85);
}
}
&-light &-bottom-container {
border-top-color: #e8e8e8;
}
&-light &-item-separator,
&-light &-item-description {
color: rgba(0, 0, 0, .45);
}
}
@media only screen and (max-width: 767.99px) {
.@{footer-prefix-cls} {
text-align: center;
&-container {
padding: 40px 0;
}
&-columns {
display: block;
}
&-column {
display: block;
margin-bottom: 40px;
&:last-child {
margin-bottom: 0;
}
}
}
}

37
web/node_modules/rc-resize-observer/es/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import * as React from 'react';
import ResizeObserver from 'resize-observer-polyfill';
export interface ResizeObserverProps {
children: React.ReactNode;
disabled?: boolean;
/** Trigger if element resized. Will always trigger when first time render. */
onResize?: (size: {
width: number;
height: number;
offsetWidth: number;
offsetHeight: number;
}) => void;
}
interface ResizeObserverState {
height: number;
width: number;
}
declare type RefNode = React.ReactInstance | HTMLElement | null;
declare class ReactResizeObserver extends React.Component<ResizeObserverProps, ResizeObserverState> {
static displayName: string;
resizeObserver: ResizeObserver | null;
childNode: RefNode;
currentElement: Element | null;
state: {
width: number;
height: number;
};
componentDidMount(): void;
componentDidUpdate(): void;
componentWillUnmount(): void;
onComponentUpdated(): void;
onResize: ResizeObserverCallback;
setChildNode: (node: Element | HTMLElement | React.Component<any, {}, any>) => void;
destroyObserver(): void;
render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)> | React.ReactElement<unknown, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>[];
}
export default ReactResizeObserver;

180
web/node_modules/rc-resize-observer/es/index.js generated vendored Normal file
View File

@@ -0,0 +1,180 @@
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 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(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(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 * as React from 'react';
import findDOMNode from "rc-util/es/Dom/findDOMNode";
import toArray from "rc-util/es/Children/toArray";
import warning from "rc-util/es/warning";
import { composeRef, supportRef } from "rc-util/es/ref";
import ResizeObserver from 'resize-observer-polyfill';
var INTERNAL_PREFIX_KEY = 'rc-observer-key'; // Still need to be compatible with React 15, we use class component here
var ReactResizeObserver =
/*#__PURE__*/
function (_React$Component) {
_inherits(ReactResizeObserver, _React$Component);
function ReactResizeObserver() {
var _this;
_classCallCheck(this, ReactResizeObserver);
_this = _possibleConstructorReturn(this, _getPrototypeOf(ReactResizeObserver).apply(this, arguments));
_this.resizeObserver = null;
_this.childNode = null;
_this.currentElement = null;
_this.state = {
width: 0,
height: 0
};
_this.onResize = function (entries) {
var onResize = _this.props.onResize;
var target = entries[0].target;
var _target$getBoundingCl = target.getBoundingClientRect(),
width = _target$getBoundingCl.width,
height = _target$getBoundingCl.height;
var offsetWidth = target.offsetWidth,
offsetHeight = target.offsetHeight;
/**
* Resize observer trigger when content size changed.
* In most case we just care about element size,
* let's use `boundary` instead of `contentRect` here to avoid shaking.
*/
var fixedWidth = Math.floor(width);
var fixedHeight = Math.floor(height);
if (_this.state.width !== fixedWidth || _this.state.height !== fixedHeight) {
var size = {
width: fixedWidth,
height: fixedHeight
};
_this.setState(size);
if (onResize) {
onResize(_objectSpread({}, size, {
offsetWidth: offsetWidth,
offsetHeight: offsetHeight
}));
}
}
};
_this.setChildNode = function (node) {
_this.childNode = node;
};
return _this;
}
_createClass(ReactResizeObserver, [{
key: "componentDidMount",
value: function componentDidMount() {
this.onComponentUpdated();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
this.onComponentUpdated();
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.destroyObserver();
}
}, {
key: "onComponentUpdated",
value: function onComponentUpdated() {
var disabled = this.props.disabled; // Unregister if disabled
if (disabled) {
this.destroyObserver();
return;
} // Unregister if element changed
var element = findDOMNode(this.childNode || this);
var elementChanged = element !== this.currentElement;
if (elementChanged) {
this.destroyObserver();
this.currentElement = element;
}
if (!this.resizeObserver && element) {
this.resizeObserver = new ResizeObserver(this.onResize);
this.resizeObserver.observe(element);
}
}
}, {
key: "destroyObserver",
value: function destroyObserver() {
if (this.resizeObserver) {
this.resizeObserver.disconnect();
this.resizeObserver = null;
}
}
}, {
key: "render",
value: function render() {
var children = this.props.children;
var childNodes = toArray(children);
if (childNodes.length > 1) {
warning(false, 'Find more than one child node with `children` in ResizeObserver. Will only observe first one.');
} else if (childNodes.length === 0) {
warning(false, '`children` of ResizeObserver is empty. Nothing is in observe.');
return null;
}
var childNode = childNodes[0];
if (React.isValidElement(childNode) && supportRef(childNode)) {
var ref = childNode.ref;
childNodes[0] = React.cloneElement(childNode, {
ref: composeRef(ref, this.setChildNode)
});
}
return childNodes.length === 1 ? childNodes[0] : childNodes.map(function (node, index) {
if (!React.isValidElement(node) || 'key' in node && node.key !== null) {
return node;
}
return React.cloneElement(node, {
key: "".concat(INTERNAL_PREFIX_KEY, "-").concat(index)
});
});
}
}]);
return ReactResizeObserver;
}(React.Component);
ReactResizeObserver.displayName = 'ResizeObserver';
export default ReactResizeObserver;

37
web/node_modules/rc-resize-observer/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import * as React from 'react';
import ResizeObserver from 'resize-observer-polyfill';
export interface ResizeObserverProps {
children: React.ReactNode;
disabled?: boolean;
/** Trigger if element resized. Will always trigger when first time render. */
onResize?: (size: {
width: number;
height: number;
offsetWidth: number;
offsetHeight: number;
}) => void;
}
interface ResizeObserverState {
height: number;
width: number;
}
declare type RefNode = React.ReactInstance | HTMLElement | null;
declare class ReactResizeObserver extends React.Component<ResizeObserverProps, ResizeObserverState> {
static displayName: string;
resizeObserver: ResizeObserver | null;
childNode: RefNode;
currentElement: Element | null;
state: {
width: number;
height: number;
};
componentDidMount(): void;
componentDidUpdate(): void;
componentWillUnmount(): void;
onComponentUpdated(): void;
onResize: ResizeObserverCallback;
setChildNode: (node: Element | HTMLElement | React.Component<any, {}, any>) => void;
destroyObserver(): void;
render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)> | React.ReactElement<unknown, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>[];
}
export default ReactResizeObserver;

200
web/node_modules/rc-resize-observer/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,200 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _findDOMNode = _interopRequireDefault(require("rc-util/lib/Dom/findDOMNode"));
var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray"));
var _warning = _interopRequireDefault(require("rc-util/lib/warning"));
var _ref = require("rc-util/lib/ref");
var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
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; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { 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) { 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(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(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 INTERNAL_PREFIX_KEY = 'rc-observer-key'; // Still need to be compatible with React 15, we use class component here
var ReactResizeObserver =
/*#__PURE__*/
function (_React$Component) {
_inherits(ReactResizeObserver, _React$Component);
function ReactResizeObserver() {
var _this;
_classCallCheck(this, ReactResizeObserver);
_this = _possibleConstructorReturn(this, _getPrototypeOf(ReactResizeObserver).apply(this, arguments));
_this.resizeObserver = null;
_this.childNode = null;
_this.currentElement = null;
_this.state = {
width: 0,
height: 0
};
_this.onResize = function (entries) {
var onResize = _this.props.onResize;
var target = entries[0].target;
var _target$getBoundingCl = target.getBoundingClientRect(),
width = _target$getBoundingCl.width,
height = _target$getBoundingCl.height;
var offsetWidth = target.offsetWidth,
offsetHeight = target.offsetHeight;
/**
* Resize observer trigger when content size changed.
* In most case we just care about element size,
* let's use `boundary` instead of `contentRect` here to avoid shaking.
*/
var fixedWidth = Math.floor(width);
var fixedHeight = Math.floor(height);
if (_this.state.width !== fixedWidth || _this.state.height !== fixedHeight) {
var size = {
width: fixedWidth,
height: fixedHeight
};
_this.setState(size);
if (onResize) {
onResize(_objectSpread({}, size, {
offsetWidth: offsetWidth,
offsetHeight: offsetHeight
}));
}
}
};
_this.setChildNode = function (node) {
_this.childNode = node;
};
return _this;
}
_createClass(ReactResizeObserver, [{
key: "componentDidMount",
value: function componentDidMount() {
this.onComponentUpdated();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
this.onComponentUpdated();
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.destroyObserver();
}
}, {
key: "onComponentUpdated",
value: function onComponentUpdated() {
var disabled = this.props.disabled; // Unregister if disabled
if (disabled) {
this.destroyObserver();
return;
} // Unregister if element changed
var element = (0, _findDOMNode.default)(this.childNode || this);
var elementChanged = element !== this.currentElement;
if (elementChanged) {
this.destroyObserver();
this.currentElement = element;
}
if (!this.resizeObserver && element) {
this.resizeObserver = new _resizeObserverPolyfill.default(this.onResize);
this.resizeObserver.observe(element);
}
}
}, {
key: "destroyObserver",
value: function destroyObserver() {
if (this.resizeObserver) {
this.resizeObserver.disconnect();
this.resizeObserver = null;
}
}
}, {
key: "render",
value: function render() {
var children = this.props.children;
var childNodes = (0, _toArray.default)(children);
if (childNodes.length > 1) {
(0, _warning.default)(false, 'Find more than one child node with `children` in ResizeObserver. Will only observe first one.');
} else if (childNodes.length === 0) {
(0, _warning.default)(false, '`children` of ResizeObserver is empty. Nothing is in observe.');
return null;
}
var childNode = childNodes[0];
if (React.isValidElement(childNode) && (0, _ref.supportRef)(childNode)) {
var ref = childNode.ref;
childNodes[0] = React.cloneElement(childNode, {
ref: (0, _ref.composeRef)(ref, this.setChildNode)
});
}
return childNodes.length === 1 ? childNodes[0] : childNodes.map(function (node, index) {
if (!React.isValidElement(node) || 'key' in node && node.key !== null) {
return node;
}
return React.cloneElement(node, {
key: "".concat(INTERNAL_PREFIX_KEY, "-").concat(index)
});
});
}
}]);
return ReactResizeObserver;
}(React.Component);
ReactResizeObserver.displayName = 'ResizeObserver';
var _default = ReactResizeObserver;
exports.default = _default;

103
web/node_modules/rc-resize-observer/package.json generated vendored Normal file
View File

@@ -0,0 +1,103 @@
{
"_from": "rc-resize-observer@^0.2.0",
"_id": "rc-resize-observer@0.2.1",
"_inBundle": false,
"_integrity": "sha512-GENTRkL3lq05ilrjTxPpHUPrKTC9D7XqUGesSXgi/GyO4j/jKIjLPn7zuZOcJ5QmN5QGRe24IaVWPZHQPE6vLw==",
"_location": "/rc-resize-observer",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "rc-resize-observer@^0.2.0",
"name": "rc-resize-observer",
"escapedName": "rc-resize-observer",
"rawSpec": "^0.2.0",
"saveSpec": null,
"fetchSpec": "^0.2.0"
},
"_requiredBy": [
"/antd",
"/rc-table"
],
"_resolved": "https://registry.npmjs.org/rc-resize-observer/-/rc-resize-observer-0.2.1.tgz",
"_shasum": "4610acb8a0f2a84b5e8d45664964ac32b5d3df72",
"_spec": "rc-resize-observer@^0.2.0",
"_where": "/Users/thilina/TestProjects/icehrm-pro/web/node_modules/antd",
"bugs": {
"url": "http://github.com/react-component/resize-observer/issues"
},
"bundleDependencies": false,
"cnpm": {
"mode": "npm"
},
"dependencies": {
"classnames": "^2.2.1",
"rc-util": "^4.14.0",
"resize-observer-polyfill": "^1.5.1"
},
"deprecated": false,
"description": "Resize observer for React",
"devDependencies": {
"@types/classnames": "^2.2.9",
"@types/jest": "^24.0.18",
"@types/react": "^16.9.2",
"@types/react-dom": "^16.9.0",
"@umijs/fabric": "^1.1.10",
"coveralls": "^3.0.6",
"cross-env": "^6.0.0",
"enzyme": "^3.0.0",
"enzyme-adapter-react-16": "^1.0.1",
"enzyme-to-json": "^3.4.0",
"father": "^2.13.4",
"less": "^3.10.3",
"np": "^5.1.0",
"prettier": "^1.18.2",
"pretty-quick": "^1.11.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0"
},
"files": [
"assets/*.css",
"assets/*.less",
"es",
"lib",
"dist"
],
"homepage": "https://react-component.github.io/resize-observer",
"keywords": [
"react",
"react-component",
"react-resize-observer",
"resize-observer"
],
"license": "MIT",
"main": "./lib/index",
"module": "./es/index",
"name": "rc-resize-observer",
"peerDependencies": {
"react": "^16.0.0",
"react-dom": "^16.0.0"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/react-component/resize-observer.git"
},
"scripts": {
"build": "father doc build --storybook",
"compile": "father build && lessc assets/index.less assets/index.css",
"coverage": "father test --coverage",
"gh-pages": "npm run build && father doc deploy",
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
"now-build": "npm run build",
"postpublish": "npm run gh-pages",
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
"start": "cross-env NODE_ENV=development father doc dev --storybook",
"test": "father test"
},
"tnpm": {
"mode": "npm"
},
"version": "0.2.1"
}