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

84
web/node_modules/rc-cascader/HISTORY.md generated vendored Normal file
View File

@@ -0,0 +1,84 @@
# History
---
## 0.17.0 / 2018/12/14
- should close popup on double click when changeOnSelect is set
## 0.16.0 / 2018/08/23
- Add loadingIcon.
## 0.15.0 / 2018/08/10
- Add expandIcon.
## 0.14.0 / 2018/07/03
- Fix typo `filedNames` to `fieldNames`. [ant-design/ant-design#10896](https://github.com/ant-design/ant-design/issues/10896)
## 0.13.0 / 2018/04/27
- Allow to custom the field name of options. [#23](https://github.com/react-component/cascader/pull/23)
## 0.12.0
- Add es build
- support React 16
## 0.11.0 / 2017-01-17
- Add Keyboard support
## 0.10.0 / 2016-08-20
- Add `dropdownMenuColumnStyle`
- Fix `changeOnSelect` when load data dynamicly
## 0.9.0 / 2016-02-19
- support `popupPlacement`
## 0.8.0 / 2016-01-26
- Add prop `changeOnSelect`
## 0.7.0 / 2016-01-25
- Support disabled item
## 0.6.1 / 2016-01-18
- Hide popup menu when there is no options, fix #4
## 0.6.0 / 2016-01-05
- Add prop `disabled`.
## 0.5.1 / 2015-12-31
- Always scroll to show active menu item
## 0.5.0 / 2015-12-30
- Remove `onSelect`
- Add `loadData` for dynamicly changing options
## 0.4.0 / 2015-12-29
- Add prop `popupVisible`.
- `onVisibleChange` => `onPopupVisibleChange`.
## 0.3.0 / 2015-12-28
- Fix value and defaultValue.
- Add Test Cases.
## 0.2.0 / 2015-12-25
- Add prop `expandTrigger`.
## 0.1.0 / 2015-12-25
First release.

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

@@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2014-present alipay.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

281
web/node_modules/rc-cascader/README.md generated vendored Normal file
View File

@@ -0,0 +1,281 @@
# rc-cascader
---
React Cascader Component
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![Dependencies](https://img.shields.io/david/react-component/cascader.svg?style=flat-square)](https://david-dm.org/react-component/cascader)
[![DevDependencies](https://img.shields.io/david/dev/react-component/cascader.svg?style=flat-square)](https://david-dm.org/react-component/cascader?type=dev)
[![npm download][download-image]][download-url]
[npm-image]: http://img.shields.io/npm/v/rc-cascader.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-cascader
[travis-image]: https://img.shields.io/travis/react-component/cascader.svg?style=flat-square
[travis-url]: https://travis-ci.org/react-component/cascader
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/cascader/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/react-component/cascader/branch/master
[download-image]: https://img.shields.io/npm/dm/rc-cascader.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-cascader
## Browser Support
|![IE](https://raw.github.com/alrra/browser-logos/master/internet-explorer/internet-explorer_48x48.png) | ![Chrome](https://raw.github.com/alrra/browser-logos/master/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/safari/safari_48x48.png)|
| --- | --- | --- | --- | --- |
| IE 8+ ✔ | Chrome 31.0+ ✔ | Firefox 31.0+ ✔ | Opera 30.0+ ✔ | Safari 7.0+ ✔ |
## Screenshots
<img src="https://os.alipayobjects.com/rmsportal/TYFXEbuQXIaMqQF.png" width="288"/>
## Example
http://react-component.github.io/cascader/
## Install
[![rc-cascader](https://nodei.co/npm/rc-cascader.png)](https://npmjs.org/package/rc-cascader)
```bash
$ npm install rc-cascader --save
```
## Usage
```js
import React from 'react';
import Cascader from 'rc-cascader';
const options = [{
'label': '福建',
'value': 'fj',
'children': [{
'label': '福州',
'value': 'fuzhou',
'children': [{
'label': '马尾',
'value': 'mawei',
}],
}, {
'label': '泉州',
'value': 'quanzhou',
}],
}, {
'label': '浙江',
'value': 'zj',
'children': [{
'label': '杭州',
'value': 'hangzhou',
'children': [{
'label': '余杭',
'value': 'yuhang',
}],
}],
}, {
'label': '北京',
'value': 'bj',
'children': [{
'label': '朝阳区',
'value': 'chaoyang',
}, {
'label': '海淀区',
'value': 'haidian',
}],
}];
React.render(
<Cascader options={options}>
...
</Cascader>
, container);
```
## API
### props
<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>options</td>
<td>Object</td>
<td></td>
<td>The data options of cascade</td>
</tr>
<tr>
<td>value</td>
<td>Array</td>
<td></td>
<td>selected value</td>
</tr>
<tr>
<td>defaultValue</td>
<td>Array</td>
<td></td>
<td>initial selected value</td>
</tr>
<tr>
<td>onChange</td>
<td>Function(value, selectedOptions)</td>
<td></td>
<td>callback when finishing cascader select</td>
</tr>
<tr>
<td>changeOnSelect</td>
<td>Boolean</td>
<td>false</td>
<td>change value on each selection</td>
</tr>
<tr>
<td>loadData</td>
<td>Function(selectedOptions)</td>
<td></td>
<td>callback when click any option, use for loading more options</td>
</tr>
<tr>
<td>expandTrigger</td>
<td>String</td>
<td>'click'</td>
<td>expand current item when click or hover</td>
</tr>
<tr>
<td>popupVisible</td>
<td>Boolean</td>
<td></td>
<td>visibility of popup overlay</td>
</tr>
<tr>
<td>onPopupVisibleChange</td>
<td>Function(visible)</td>
<td></td>
<td>callback when popup overlay's visibility changed</td>
</tr>
<tr>
<td>transitionName</td>
<td>String</td>
<td></td>
<td>transition className like "slide-up"</td>
</tr>
<tr>
<td>prefixCls</td>
<td>String</td>
<td>rc-cascader</td>
<td>prefix className of popup overlay</td>
</tr>
<tr>
<td>popupClassName</td>
<td>String</td>
<td></td>
<td>additional className of popup overlay</td>
</tr>
<tr>
<td>popupPlacement</td>
<td>String</td>
<td>bottomLeft</td>
<td>use preset popup align config from builtinPlacementsbottomRight topRight bottomLeft topLeft</td>
</tr>
<tr>
<td>getPopupContainer</td>
<td>function(trigger:Node):Node</td>
<td>() => document.body</td>
<td>container which popup select menu rendered into</td>
</tr>
<tr>
<td>dropdownMenuColumnStyle</td>
<td>Object</td>
<td></td>
<td>style object for each cascader pop menu</td>
</tr>
<tr>
<td>fieldNames</td>
<td>Object</td>
<td>{ label: 'label', value: 'value', children: 'children' }</td>
<td>custom field name for label and value and children</td>
</tr>
<tr>
<td>expandIcon</td>
<td>ReactNode</td>
<td>></td>
<td>specific the default expand icon</td>
</tr>
<tr>
<td>loadingIcon</td>
<td>ReactNode</td>
<td>></td>
<td>specific the default loading icon</td>
</tr>
</tbody>
</table>
### option
<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>label</td>
<td>String</td>
<td></td>
<td>option text to display</td>
</tr>
<tr>
<td>value</td>
<td>String</td>
<td></td>
<td>option value as react key</td>
</tr>
<tr>
<td>disabled</td>
<td>Boolean</td>
<td></td>
<td>disabled option</td>
</tr>
<tr>
<td>children</td>
<td>Array</td>
<td></td>
<td>children options</td>
</tr>
</tbody>
</table>
## Development
```bash
$ npm install
$ npm start
```
## Test Case
```bash
$ npm test
```
## Coverage
```bash
$ npm run coverage
```
## License
rc-cascader is released under the MIT license.

166
web/node_modules/rc-cascader/assets/index.less generated vendored Normal file
View File

@@ -0,0 +1,166 @@
.effect() {
animation-duration: .3s;
animation-fill-mode: both;
transform-origin: 0 0;
}
.rc-cascader {
font-size: 12px;
&-menus {
font-size: 12px;
overflow: hidden;
background: #fff;
position: absolute;
border: 1px solid #d9d9d9;
border-radius: 6px;
box-shadow: 0 0 4px rgba(0,0,0,0.17);
white-space: nowrap;
&-hidden {
display: none;
}
&.slide-up-enter, &.slide-up-appear {
.effect();
opacity: 0;
animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
animation-play-state: paused;
}
&.slide-up-leave {
.effect();
opacity: 1;
animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
animation-play-state: paused;
}
&.slide-up-enter.slide-up-enter-active&-placement-bottomLeft,
&.slide-up-appear.slide-up-appear-active&-placement-bottomLeft {
animation-name: SlideUpIn;
animation-play-state: running;
}
&.slide-up-enter.slide-up-enter-active&-placement-topLeft,
&.slide-up-appear.slide-up-appear-active&-placement-topLeft {
animation-name: SlideDownIn;
animation-play-state: running;
}
&.slide-up-leave.slide-up-leave-active&-placement-bottomLeft {
animation-name: SlideUpOut;
animation-play-state: running;
}
&.slide-up-leave.slide-up-leave-active&-placement-topLeft {
animation-name: SlideDownOut;
animation-play-state: running;
}
}
&-menu {
display: inline-block;
width: 100px;
height: 192px;
list-style: none;
margin: 0;
padding: 0;
border-right: 1px solid #e9e9e9;
overflow: auto;
&:last-child {
border-right: 0;
}
}
&-menu-item {
height: 32px;
line-height: 32px;
padding: 0 16px;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
transition: all 0.3s ease;
position: relative;
&:hover {
background: tint(#2db7f5, 90%);
}
&-disabled {
cursor: not-allowed;
color: #ccc;
&:hover {
background: transparent;
}
}
&-loading:after {
position: absolute;
right: 12px;
content: 'loading';
color: #aaa;
font-style: italic;
}
&-active {
background: tint(#2db7f5, 80%);
&:hover {
background: tint(#2db7f5, 80%);
}
}
&-expand {
position: relative;
&-icon {
font-size: 12px;
color: #999;
position: absolute;
right: 16px;
line-height: 32px;
}
}
}
}
@keyframes SlideUpIn {
0% {
opacity: 0;
transform-origin: 0% 0%;
transform: scaleY(.8);
}
100% {
opacity: 1;
transform-origin: 0% 0%;
transform: scaleY(1);
}
}
@keyframes SlideUpOut {
0% {
opacity: 1;
transform-origin: 0% 0%;
transform: scaleY(1);
}
100% {
opacity: 0;
transform-origin: 0% 0%;
transform: scaleY(0.8);
}
}
@keyframes SlideDownIn {
0% {
opacity: 0;
transform-origin: 0% 100%;
transform: scaleY(0.8);
}
100% {
opacity: 1;
transform-origin: 0% 100%;
transform: scaleY(1);
}
}
@keyframes SlideDownOut {
0% {
opacity: 1;
transform-origin: 0% 100%;
transform: scaleY(1);
}
100% {
opacity: 0;
transform-origin: 0% 100%;
transform: scaleY(0.8);
}
}

69
web/node_modules/rc-cascader/es/Cascader.d.ts generated vendored Normal file
View File

@@ -0,0 +1,69 @@
import * as React from 'react';
import { BuildInPlacements, TriggerProps } from 'rc-trigger';
export interface CascaderFieldNames {
value?: string;
label?: string;
children?: string;
}
export interface CascaderOption {
value?: string;
label?: React.ReactNode;
disabled?: boolean;
isLeaf?: boolean;
loading?: boolean;
children?: CascaderOption[];
[key: string]: any;
}
export interface CascaderProps extends Pick<TriggerProps, 'getPopupContainer'> {
value?: string[];
defaultValue?: string[];
options?: CascaderOption[];
onChange?: (value: string[], selectOptions: CascaderOption[]) => void;
onPopupVisibleChange?: (popupVisible: boolean) => void;
popupVisible?: boolean;
disabled?: boolean;
transitionName?: string;
popupClassName?: string;
popupPlacement?: string;
prefixCls?: string;
dropdownMenuColumnStyle?: React.CSSProperties;
builtinPlacements?: BuildInPlacements;
loadData?: (selectOptions: CascaderOption[]) => void;
changeOnSelect?: boolean;
children?: React.ReactElement;
onKeyDown?: (e: React.KeyboardEvent<HTMLElement>) => void;
expandTrigger?: string;
fieldNames?: CascaderFieldNames;
filedNames?: CascaderFieldNames;
expandIcon?: React.ReactNode;
loadingIcon?: React.ReactNode;
}
interface CascaderState {
popupVisible?: boolean;
activeValue?: string[];
value?: string[];
prevProps?: CascaderProps;
}
declare class Cascader extends React.Component<CascaderProps, CascaderState> {
defaultFieldNames: object;
trigger: any;
constructor(props: CascaderProps);
static defaultProps: CascaderProps;
static getDerivedStateFromProps(nextProps: CascaderProps, prevState: CascaderState): CascaderState;
getPopupDOMNode(): any;
getFieldName(name: string): string;
getFieldNames(): CascaderFieldNames;
getCurrentLevelOptions(): CascaderOption[];
getActiveOptions(activeValue: string[]): CascaderOption[];
setPopupVisible: (popupVisible: boolean) => void;
handleChange: (options: CascaderOption[], { visible }: {
visible: any;
}, e: React.KeyboardEvent<HTMLElement>) => void;
handlePopupVisibleChange: (popupVisible: boolean) => void;
handleMenuSelect: (targetOption: CascaderOption, menuIndex: number, e: React.KeyboardEvent<HTMLElement>) => void;
handleItemDoubleClick: () => void;
handleKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
saveTrigger: (node: any) => void;
render(): JSX.Element;
}
export default Cascader;

431
web/node_modules/rc-cascader/es/Cascader.js generated vendored Normal file
View File

@@ -0,0 +1,431 @@
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function _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 _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 Trigger from 'rc-trigger';
import warning from 'warning';
import KeyCode from "rc-util/es/KeyCode";
import arrayTreeFilter from 'array-tree-filter';
import { isEqualArrays } from './utils';
import Menus from './Menus';
import BUILT_IN_PLACEMENTS from './placements';
var Cascader =
/*#__PURE__*/
function (_React$Component) {
_inherits(Cascader, _React$Component);
function Cascader(props) {
var _this;
_classCallCheck(this, Cascader);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Cascader).call(this, props));
_this.setPopupVisible = function (popupVisible) {
var value = _this.state.value;
if (!('popupVisible' in _this.props)) {
_this.setState({
popupVisible: popupVisible
});
} // sync activeValue with value when panel open
if (popupVisible && !_this.state.popupVisible) {
_this.setState({
activeValue: value
});
}
_this.props.onPopupVisibleChange(popupVisible);
};
_this.handleChange = function (options, _ref, e) {
var visible = _ref.visible;
if (e.type !== 'keydown' || e.keyCode === KeyCode.ENTER) {
_this.props.onChange(options.map(function (o) {
return o[_this.getFieldName('value')];
}), options);
_this.setPopupVisible(visible);
}
};
_this.handlePopupVisibleChange = function (popupVisible) {
_this.setPopupVisible(popupVisible);
};
_this.handleMenuSelect = function (targetOption, menuIndex, e) {
// Keep focused state for keyboard support
var triggerNode = _this.trigger.getRootDomNode();
if (triggerNode && triggerNode.focus) {
triggerNode.focus();
}
var _this$props = _this.props,
changeOnSelect = _this$props.changeOnSelect,
loadData = _this$props.loadData,
expandTrigger = _this$props.expandTrigger;
if (!targetOption || targetOption.disabled) {
return;
}
var activeValue = _this.state.activeValue;
activeValue = activeValue.slice(0, menuIndex + 1);
activeValue[menuIndex] = targetOption[_this.getFieldName('value')];
var activeOptions = _this.getActiveOptions(activeValue);
if (targetOption.isLeaf === false && !targetOption[_this.getFieldName('children')] && loadData) {
if (changeOnSelect) {
_this.handleChange(activeOptions, {
visible: true
}, e);
}
_this.setState({
activeValue: activeValue
});
loadData(activeOptions);
return;
}
var newState = {};
if (!targetOption[_this.getFieldName('children')] || !targetOption[_this.getFieldName('children')].length) {
_this.handleChange(activeOptions, {
visible: false
}, e); // set value to activeValue when select leaf option
newState.value = activeValue; // add e.type judgement to prevent `onChange` being triggered by mouseEnter
} else if (changeOnSelect && (e.type === 'click' || e.type === 'keydown')) {
if (expandTrigger === 'hover') {
_this.handleChange(activeOptions, {
visible: false
}, e);
} else {
_this.handleChange(activeOptions, {
visible: true
}, e);
} // set value to activeValue on every select
newState.value = activeValue;
}
newState.activeValue = activeValue; // not change the value by keyboard
if ('value' in _this.props || e.type === 'keydown' && e.keyCode !== KeyCode.ENTER) {
delete newState.value;
}
_this.setState(newState);
};
_this.handleItemDoubleClick = function () {
var changeOnSelect = _this.props.changeOnSelect;
if (changeOnSelect) {
_this.setPopupVisible(false);
}
};
_this.handleKeyDown = function (e) {
var children = _this.props.children; // https://github.com/ant-design/ant-design/issues/6717
// Don't bind keyboard support when children specify the onKeyDown
if (children && children.props.onKeyDown) {
children.props.onKeyDown(e);
return;
}
var activeValue = _toConsumableArray(_this.state.activeValue);
var currentLevel = activeValue.length - 1 < 0 ? 0 : activeValue.length - 1;
var currentOptions = _this.getCurrentLevelOptions();
var currentIndex = currentOptions.map(function (o) {
return o[_this.getFieldName('value')];
}).indexOf(activeValue[currentLevel]);
if (e.keyCode !== KeyCode.DOWN && e.keyCode !== KeyCode.UP && e.keyCode !== KeyCode.LEFT && e.keyCode !== KeyCode.RIGHT && e.keyCode !== KeyCode.ENTER && e.keyCode !== KeyCode.SPACE && e.keyCode !== KeyCode.BACKSPACE && e.keyCode !== KeyCode.ESC && e.keyCode !== KeyCode.TAB) {
return;
} // Press any keys above to reopen menu
if (!_this.state.popupVisible && e.keyCode !== KeyCode.BACKSPACE && e.keyCode !== KeyCode.LEFT && e.keyCode !== KeyCode.RIGHT && e.keyCode !== KeyCode.ESC && e.keyCode !== KeyCode.TAB) {
_this.setPopupVisible(true);
return;
}
if (e.keyCode === KeyCode.DOWN || e.keyCode === KeyCode.UP) {
e.preventDefault();
var nextIndex = currentIndex;
if (nextIndex !== -1) {
if (e.keyCode === KeyCode.DOWN) {
nextIndex += 1;
nextIndex = nextIndex >= currentOptions.length ? 0 : nextIndex;
} else {
nextIndex -= 1;
nextIndex = nextIndex < 0 ? currentOptions.length - 1 : nextIndex;
}
} else {
nextIndex = 0;
}
activeValue[currentLevel] = currentOptions[nextIndex][_this.getFieldName('value')];
} else if (e.keyCode === KeyCode.LEFT || e.keyCode === KeyCode.BACKSPACE) {
e.preventDefault();
activeValue.splice(activeValue.length - 1, 1);
} else if (e.keyCode === KeyCode.RIGHT) {
e.preventDefault();
if (currentOptions[currentIndex] && currentOptions[currentIndex][_this.getFieldName('children')]) {
activeValue.push(currentOptions[currentIndex][_this.getFieldName('children')][0][_this.getFieldName('value')]);
}
} else if (e.keyCode === KeyCode.ESC || e.keyCode === KeyCode.TAB) {
_this.setPopupVisible(false);
return;
}
if (!activeValue || activeValue.length === 0) {
_this.setPopupVisible(false);
}
var activeOptions = _this.getActiveOptions(activeValue);
var targetOption = activeOptions[activeOptions.length - 1];
_this.handleMenuSelect(targetOption, activeOptions.length - 1, e);
if (_this.props.onKeyDown) {
_this.props.onKeyDown(e);
}
};
_this.saveTrigger = function (node) {
_this.trigger = node;
};
var initialValue = [];
if ('value' in props) {
initialValue = props.value || [];
} else if ('defaultValue' in props) {
initialValue = props.defaultValue || [];
}
warning(!('filedNames' in props), '`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead.');
_this.state = {
popupVisible: props.popupVisible,
activeValue: initialValue,
value: initialValue,
prevProps: props
};
_this.defaultFieldNames = {
label: 'label',
value: 'value',
children: 'children'
};
return _this;
}
_createClass(Cascader, [{
key: "getPopupDOMNode",
value: function getPopupDOMNode() {
return this.trigger.getPopupDomNode();
}
}, {
key: "getFieldName",
value: function getFieldName(name) {
var defaultFieldNames = this.defaultFieldNames;
var _this$props2 = this.props,
fieldNames = _this$props2.fieldNames,
filedNames = _this$props2.filedNames;
if ('filedNames' in this.props) {
return filedNames[name] || defaultFieldNames[name]; // For old compatibility
}
return fieldNames[name] || defaultFieldNames[name];
}
}, {
key: "getFieldNames",
value: function getFieldNames() {
var _this$props3 = this.props,
fieldNames = _this$props3.fieldNames,
filedNames = _this$props3.filedNames;
if ('filedNames' in this.props) {
return filedNames; // For old compatibility
}
return fieldNames;
}
}, {
key: "getCurrentLevelOptions",
value: function getCurrentLevelOptions() {
var _this2 = this;
var _this$props$options = this.props.options,
options = _this$props$options === void 0 ? [] : _this$props$options;
var _this$state$activeVal = this.state.activeValue,
activeValue = _this$state$activeVal === void 0 ? [] : _this$state$activeVal;
var result = arrayTreeFilter(options, function (o, level) {
return o[_this2.getFieldName('value')] === activeValue[level];
}, {
childrenKeyName: this.getFieldName('children')
});
if (result[result.length - 2]) {
return result[result.length - 2][this.getFieldName('children')];
}
return _toConsumableArray(options).filter(function (o) {
return !o.disabled;
});
}
}, {
key: "getActiveOptions",
value: function getActiveOptions(activeValue) {
var _this3 = this;
return arrayTreeFilter(this.props.options || [], function (o, level) {
return o[_this3.getFieldName('value')] === activeValue[level];
}, {
childrenKeyName: this.getFieldName('children')
});
}
}, {
key: "render",
value: function render() {
var _this$props4 = this.props,
prefixCls = _this$props4.prefixCls,
transitionName = _this$props4.transitionName,
popupClassName = _this$props4.popupClassName,
_this$props4$options = _this$props4.options,
options = _this$props4$options === void 0 ? [] : _this$props4$options,
disabled = _this$props4.disabled,
builtinPlacements = _this$props4.builtinPlacements,
popupPlacement = _this$props4.popupPlacement,
children = _this$props4.children,
restProps = _objectWithoutProperties(_this$props4, ["prefixCls", "transitionName", "popupClassName", "options", "disabled", "builtinPlacements", "popupPlacement", "children"]); // Did not show popup when there is no options
var menus = React.createElement("div", null);
var emptyMenuClassName = '';
if (options && options.length > 0) {
menus = React.createElement(Menus, Object.assign({}, this.props, {
fieldNames: this.getFieldNames(),
defaultFieldNames: this.defaultFieldNames,
activeValue: this.state.activeValue,
onSelect: this.handleMenuSelect,
onItemDoubleClick: this.handleItemDoubleClick,
visible: this.state.popupVisible
}));
} else {
emptyMenuClassName = " ".concat(prefixCls, "-menus-empty");
}
return React.createElement(Trigger, Object.assign({
ref: this.saveTrigger
}, restProps, {
popupPlacement: popupPlacement,
builtinPlacements: builtinPlacements,
popupTransitionName: transitionName,
action: disabled ? [] : ['click'],
popupVisible: disabled ? false : this.state.popupVisible,
onPopupVisibleChange: this.handlePopupVisibleChange,
prefixCls: "".concat(prefixCls, "-menus"),
popupClassName: popupClassName + emptyMenuClassName,
popup: menus
}), React.cloneElement(children, {
onKeyDown: this.handleKeyDown,
tabIndex: disabled ? undefined : 0
}));
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(nextProps, prevState) {
var _prevState$prevProps = prevState.prevProps,
prevProps = _prevState$prevProps === void 0 ? {} : _prevState$prevProps;
var newState = {
prevProps: nextProps
};
if ('value' in nextProps && !isEqualArrays(prevProps.value, nextProps.value)) {
newState.value = nextProps.value || []; // allow activeValue diff from value
// https://github.com/ant-design/ant-design/issues/2767
if (!('loadData' in nextProps)) {
newState.activeValue = nextProps.value || [];
}
}
if ('popupVisible' in nextProps) {
newState.popupVisible = nextProps.popupVisible;
}
return newState;
}
}]);
return Cascader;
}(React.Component);
Cascader.defaultProps = {
onChange: function onChange() {},
onPopupVisibleChange: function onPopupVisibleChange() {},
disabled: false,
transitionName: '',
prefixCls: 'rc-cascader',
popupClassName: '',
popupPlacement: 'bottomLeft',
builtinPlacements: BUILT_IN_PLACEMENTS,
expandTrigger: 'click',
fieldNames: {
label: 'label',
value: 'value',
children: 'children'
},
expandIcon: '>'
};
export default Cascader;

37
web/node_modules/rc-cascader/es/Menus.d.ts generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import * as React from 'react';
import { CascaderOption, CascaderFieldNames } from './Cascader';
interface MenusProps {
value?: string[];
activeValue?: string[];
options?: CascaderOption[];
prefixCls?: string;
expandTrigger?: string;
onSelect?: (targetOption: string[], index: number, e: React.KeyboardEvent<HTMLElement>) => void;
visible?: boolean;
dropdownMenuColumnStyle?: React.CSSProperties;
defaultFieldNames?: CascaderFieldNames;
fieldNames?: CascaderFieldNames;
expandIcon?: React.ReactNode;
loadingIcon?: React.ReactNode;
onItemDoubleClick?: (targetOption: string[], index: number, e: React.MouseEvent<HTMLElement>) => void;
}
interface MenuItems {
[index: number]: HTMLLIElement;
}
declare class Menus extends React.Component<MenusProps> {
menuItems: MenuItems;
delayTimer: number;
static defaultProps: MenusProps;
componentDidMount(): void;
componentDidUpdate(prevProps: MenusProps): void;
getFieldName(name: any): any;
getOption(option: CascaderOption, menuIndex: number): JSX.Element;
getActiveOptions(values?: CascaderOption[]): CascaderOption[];
getShowOptions(): CascaderOption[][];
delayOnSelect(onSelect: any, ...args: any[]): void;
scrollActiveItemToView(): void;
isActiveOption(option: any, menuIndex: any): boolean;
saveMenuItem: (index: any) => (node: any) => void;
render(): JSX.Element;
}
export default Menus;

238
web/node_modules/rc-cascader/es/Menus.js generated vendored Normal file
View File

@@ -0,0 +1,238 @@
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 _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 arrayTreeFilter from 'array-tree-filter';
var Menus =
/*#__PURE__*/
function (_React$Component) {
_inherits(Menus, _React$Component);
function Menus() {
var _this;
_classCallCheck(this, Menus);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Menus).apply(this, arguments));
_this.menuItems = {};
_this.saveMenuItem = function (index) {
return function (node) {
_this.menuItems[index] = node;
};
};
return _this;
}
_createClass(Menus, [{
key: "componentDidMount",
value: function componentDidMount() {
this.scrollActiveItemToView();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
if (!prevProps.visible && this.props.visible) {
this.scrollActiveItemToView();
}
}
}, {
key: "getFieldName",
value: function getFieldName(name) {
var _this$props = this.props,
fieldNames = _this$props.fieldNames,
defaultFieldNames = _this$props.defaultFieldNames; // 防止只设置单个属性的名字
return fieldNames[name] || defaultFieldNames[name];
}
}, {
key: "getOption",
value: function getOption(option, menuIndex) {
var _this$props2 = this.props,
prefixCls = _this$props2.prefixCls,
expandTrigger = _this$props2.expandTrigger,
expandIcon = _this$props2.expandIcon,
loadingIcon = _this$props2.loadingIcon;
var onSelect = this.props.onSelect.bind(this, option, menuIndex);
var onItemDoubleClick = this.props.onItemDoubleClick.bind(this, option, menuIndex);
var expandProps = {
onClick: onSelect,
onDoubleClick: onItemDoubleClick
};
var menuItemCls = "".concat(prefixCls, "-menu-item");
var expandIconNode = null;
var hasChildren = option[this.getFieldName('children')] && option[this.getFieldName('children')].length > 0;
if (hasChildren || option.isLeaf === false) {
menuItemCls += " ".concat(prefixCls, "-menu-item-expand");
if (!option.loading) {
expandIconNode = React.createElement("span", {
className: "".concat(prefixCls, "-menu-item-expand-icon")
}, expandIcon);
}
}
if (expandTrigger === 'hover' && (hasChildren || option.isLeaf === false)) {
expandProps = {
onMouseEnter: this.delayOnSelect.bind(this, onSelect),
onMouseLeave: this.delayOnSelect.bind(this),
onClick: onSelect
};
}
if (this.isActiveOption(option, menuIndex)) {
menuItemCls += " ".concat(prefixCls, "-menu-item-active");
expandProps.ref = this.saveMenuItem(menuIndex);
}
if (option.disabled) {
menuItemCls += " ".concat(prefixCls, "-menu-item-disabled");
}
var loadingIconNode = null;
if (option.loading) {
menuItemCls += " ".concat(prefixCls, "-menu-item-loading");
loadingIconNode = loadingIcon || null;
}
var title = '';
if ('title' in option) {
// eslint-disable-next-line prefer-destructuring
title = option.title;
} else if (typeof option[this.getFieldName('label')] === 'string') {
title = option[this.getFieldName('label')];
}
return React.createElement("li", Object.assign({
key: option[this.getFieldName('value')],
className: menuItemCls,
title: title
}, expandProps, {
role: "menuitem",
onMouseDown: function onMouseDown(e) {
return e.preventDefault();
}
}), option[this.getFieldName('label')], expandIconNode, loadingIconNode);
}
}, {
key: "getActiveOptions",
value: function getActiveOptions(values) {
var _this2 = this;
var options = this.props.options;
var activeValue = values || this.props.activeValue;
return arrayTreeFilter(options, function (o, level) {
return o[_this2.getFieldName('value')] === activeValue[level];
}, {
childrenKeyName: this.getFieldName('children')
});
}
}, {
key: "getShowOptions",
value: function getShowOptions() {
var _this3 = this;
var options = this.props.options;
var result = this.getActiveOptions().map(function (activeOption) {
return activeOption[_this3.getFieldName('children')];
}).filter(function (activeOption) {
return !!activeOption;
});
result.unshift(options);
return result;
}
}, {
key: "delayOnSelect",
value: function delayOnSelect(onSelect) {
var _this4 = this;
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (this.delayTimer) {
clearTimeout(this.delayTimer);
this.delayTimer = null;
}
if (typeof onSelect === 'function') {
this.delayTimer = window.setTimeout(function () {
onSelect(args);
_this4.delayTimer = null;
}, 150);
}
}
}, {
key: "scrollActiveItemToView",
value: function scrollActiveItemToView() {
// scroll into view
var optionsLength = this.getShowOptions().length; // eslint-disable-next-line no-plusplus
for (var i = 0; i < optionsLength; i++) {
var itemComponent = this.menuItems[i];
if (itemComponent && itemComponent.parentElement) {
itemComponent.parentElement.scrollTop = itemComponent.offsetTop;
}
}
}
}, {
key: "isActiveOption",
value: function isActiveOption(option, menuIndex) {
var _this$props$activeVal = this.props.activeValue,
activeValue = _this$props$activeVal === void 0 ? [] : _this$props$activeVal;
return activeValue[menuIndex] === option[this.getFieldName('value')];
}
}, {
key: "render",
value: function render() {
var _this5 = this;
var _this$props3 = this.props,
prefixCls = _this$props3.prefixCls,
dropdownMenuColumnStyle = _this$props3.dropdownMenuColumnStyle;
return React.createElement("div", null, this.getShowOptions().map(function (options, menuIndex) {
return React.createElement("ul", {
className: "".concat(prefixCls, "-menu"),
key: menuIndex,
style: dropdownMenuColumnStyle
}, options.map(function (option) {
return _this5.getOption(option, menuIndex);
}));
}));
}
}]);
return Menus;
}(React.Component);
Menus.defaultProps = {
options: [],
value: [],
activeValue: [],
onSelect: function onSelect() {},
prefixCls: 'rc-cascader-menus',
visible: false,
expandTrigger: 'click'
};
export default Menus;

2
web/node_modules/rc-cascader/es/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import Cascader from './Cascader';
export default Cascader;

2
web/node_modules/rc-cascader/es/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import Cascader from './Cascader';
export default Cascader;

3
web/node_modules/rc-cascader/es/placements.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import { BuildInPlacements } from 'rc-trigger';
declare const BUILT_IN_PLACEMENTS: BuildInPlacements;
export default BUILT_IN_PLACEMENTS;

35
web/node_modules/rc-cascader/es/placements.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
var BUILT_IN_PLACEMENTS = {
bottomLeft: {
points: ['tl', 'bl'],
offset: [0, 4],
overflow: {
adjustX: 1,
adjustY: 1
}
},
topLeft: {
points: ['bl', 'tl'],
offset: [0, -4],
overflow: {
adjustX: 1,
adjustY: 1
}
},
bottomRight: {
points: ['tr', 'br'],
offset: [0, 4],
overflow: {
adjustX: 1,
adjustY: 1
}
},
topRight: {
points: ['br', 'tr'],
offset: [0, -4],
overflow: {
adjustX: 1,
adjustY: 1
}
}
};
export default BUILT_IN_PLACEMENTS;

1
web/node_modules/rc-cascader/es/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function isEqualArrays(arrA: any[], arrB: any[]): boolean;

24
web/node_modules/rc-cascader/es/utils.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
export function isEqualArrays(arrA, arrB) {
if (arrA === arrB) {
return true;
}
if (!arrA || !arrB) {
return false;
}
var len = arrA.length;
if (arrB.length !== len) {
return false;
} // eslint-disable-next-line no-plusplus
for (var i = 0; i < len; i++) {
if (arrA[i] !== arrB[i]) {
return false;
}
}
return true;
}

69
web/node_modules/rc-cascader/lib/Cascader.d.ts generated vendored Normal file
View File

@@ -0,0 +1,69 @@
import * as React from 'react';
import { BuildInPlacements, TriggerProps } from 'rc-trigger';
export interface CascaderFieldNames {
value?: string;
label?: string;
children?: string;
}
export interface CascaderOption {
value?: string;
label?: React.ReactNode;
disabled?: boolean;
isLeaf?: boolean;
loading?: boolean;
children?: CascaderOption[];
[key: string]: any;
}
export interface CascaderProps extends Pick<TriggerProps, 'getPopupContainer'> {
value?: string[];
defaultValue?: string[];
options?: CascaderOption[];
onChange?: (value: string[], selectOptions: CascaderOption[]) => void;
onPopupVisibleChange?: (popupVisible: boolean) => void;
popupVisible?: boolean;
disabled?: boolean;
transitionName?: string;
popupClassName?: string;
popupPlacement?: string;
prefixCls?: string;
dropdownMenuColumnStyle?: React.CSSProperties;
builtinPlacements?: BuildInPlacements;
loadData?: (selectOptions: CascaderOption[]) => void;
changeOnSelect?: boolean;
children?: React.ReactElement;
onKeyDown?: (e: React.KeyboardEvent<HTMLElement>) => void;
expandTrigger?: string;
fieldNames?: CascaderFieldNames;
filedNames?: CascaderFieldNames;
expandIcon?: React.ReactNode;
loadingIcon?: React.ReactNode;
}
interface CascaderState {
popupVisible?: boolean;
activeValue?: string[];
value?: string[];
prevProps?: CascaderProps;
}
declare class Cascader extends React.Component<CascaderProps, CascaderState> {
defaultFieldNames: object;
trigger: any;
constructor(props: CascaderProps);
static defaultProps: CascaderProps;
static getDerivedStateFromProps(nextProps: CascaderProps, prevState: CascaderState): CascaderState;
getPopupDOMNode(): any;
getFieldName(name: string): string;
getFieldNames(): CascaderFieldNames;
getCurrentLevelOptions(): CascaderOption[];
getActiveOptions(activeValue: string[]): CascaderOption[];
setPopupVisible: (popupVisible: boolean) => void;
handleChange: (options: CascaderOption[], { visible }: {
visible: any;
}, e: React.KeyboardEvent<HTMLElement>) => void;
handlePopupVisibleChange: (popupVisible: boolean) => void;
handleMenuSelect: (targetOption: CascaderOption, menuIndex: number, e: React.KeyboardEvent<HTMLElement>) => void;
handleItemDoubleClick: () => void;
handleKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
saveTrigger: (node: any) => void;
render(): JSX.Element;
}
export default Cascader;

452
web/node_modules/rc-cascader/lib/Cascader.js generated vendored Normal file
View File

@@ -0,0 +1,452 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _rcTrigger = _interopRequireDefault(require("rc-trigger"));
var _warning = _interopRequireDefault(require("warning"));
var _KeyCode = _interopRequireDefault(require("rc-util/lib/KeyCode"));
var _arrayTreeFilter = _interopRequireDefault(require("array-tree-filter"));
var _utils = require("./utils");
var _Menus = _interopRequireDefault(require("./Menus"));
var _placements = _interopRequireDefault(require("./placements"));
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) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function _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 _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 Cascader =
/*#__PURE__*/
function (_React$Component) {
_inherits(Cascader, _React$Component);
function Cascader(props) {
var _this;
_classCallCheck(this, Cascader);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Cascader).call(this, props));
_this.setPopupVisible = function (popupVisible) {
var value = _this.state.value;
if (!('popupVisible' in _this.props)) {
_this.setState({
popupVisible: popupVisible
});
} // sync activeValue with value when panel open
if (popupVisible && !_this.state.popupVisible) {
_this.setState({
activeValue: value
});
}
_this.props.onPopupVisibleChange(popupVisible);
};
_this.handleChange = function (options, _ref, e) {
var visible = _ref.visible;
if (e.type !== 'keydown' || e.keyCode === _KeyCode.default.ENTER) {
_this.props.onChange(options.map(function (o) {
return o[_this.getFieldName('value')];
}), options);
_this.setPopupVisible(visible);
}
};
_this.handlePopupVisibleChange = function (popupVisible) {
_this.setPopupVisible(popupVisible);
};
_this.handleMenuSelect = function (targetOption, menuIndex, e) {
// Keep focused state for keyboard support
var triggerNode = _this.trigger.getRootDomNode();
if (triggerNode && triggerNode.focus) {
triggerNode.focus();
}
var _this$props = _this.props,
changeOnSelect = _this$props.changeOnSelect,
loadData = _this$props.loadData,
expandTrigger = _this$props.expandTrigger;
if (!targetOption || targetOption.disabled) {
return;
}
var activeValue = _this.state.activeValue;
activeValue = activeValue.slice(0, menuIndex + 1);
activeValue[menuIndex] = targetOption[_this.getFieldName('value')];
var activeOptions = _this.getActiveOptions(activeValue);
if (targetOption.isLeaf === false && !targetOption[_this.getFieldName('children')] && loadData) {
if (changeOnSelect) {
_this.handleChange(activeOptions, {
visible: true
}, e);
}
_this.setState({
activeValue: activeValue
});
loadData(activeOptions);
return;
}
var newState = {};
if (!targetOption[_this.getFieldName('children')] || !targetOption[_this.getFieldName('children')].length) {
_this.handleChange(activeOptions, {
visible: false
}, e); // set value to activeValue when select leaf option
newState.value = activeValue; // add e.type judgement to prevent `onChange` being triggered by mouseEnter
} else if (changeOnSelect && (e.type === 'click' || e.type === 'keydown')) {
if (expandTrigger === 'hover') {
_this.handleChange(activeOptions, {
visible: false
}, e);
} else {
_this.handleChange(activeOptions, {
visible: true
}, e);
} // set value to activeValue on every select
newState.value = activeValue;
}
newState.activeValue = activeValue; // not change the value by keyboard
if ('value' in _this.props || e.type === 'keydown' && e.keyCode !== _KeyCode.default.ENTER) {
delete newState.value;
}
_this.setState(newState);
};
_this.handleItemDoubleClick = function () {
var changeOnSelect = _this.props.changeOnSelect;
if (changeOnSelect) {
_this.setPopupVisible(false);
}
};
_this.handleKeyDown = function (e) {
var children = _this.props.children; // https://github.com/ant-design/ant-design/issues/6717
// Don't bind keyboard support when children specify the onKeyDown
if (children && children.props.onKeyDown) {
children.props.onKeyDown(e);
return;
}
var activeValue = _toConsumableArray(_this.state.activeValue);
var currentLevel = activeValue.length - 1 < 0 ? 0 : activeValue.length - 1;
var currentOptions = _this.getCurrentLevelOptions();
var currentIndex = currentOptions.map(function (o) {
return o[_this.getFieldName('value')];
}).indexOf(activeValue[currentLevel]);
if (e.keyCode !== _KeyCode.default.DOWN && e.keyCode !== _KeyCode.default.UP && e.keyCode !== _KeyCode.default.LEFT && e.keyCode !== _KeyCode.default.RIGHT && e.keyCode !== _KeyCode.default.ENTER && e.keyCode !== _KeyCode.default.SPACE && e.keyCode !== _KeyCode.default.BACKSPACE && e.keyCode !== _KeyCode.default.ESC && e.keyCode !== _KeyCode.default.TAB) {
return;
} // Press any keys above to reopen menu
if (!_this.state.popupVisible && e.keyCode !== _KeyCode.default.BACKSPACE && e.keyCode !== _KeyCode.default.LEFT && e.keyCode !== _KeyCode.default.RIGHT && e.keyCode !== _KeyCode.default.ESC && e.keyCode !== _KeyCode.default.TAB) {
_this.setPopupVisible(true);
return;
}
if (e.keyCode === _KeyCode.default.DOWN || e.keyCode === _KeyCode.default.UP) {
e.preventDefault();
var nextIndex = currentIndex;
if (nextIndex !== -1) {
if (e.keyCode === _KeyCode.default.DOWN) {
nextIndex += 1;
nextIndex = nextIndex >= currentOptions.length ? 0 : nextIndex;
} else {
nextIndex -= 1;
nextIndex = nextIndex < 0 ? currentOptions.length - 1 : nextIndex;
}
} else {
nextIndex = 0;
}
activeValue[currentLevel] = currentOptions[nextIndex][_this.getFieldName('value')];
} else if (e.keyCode === _KeyCode.default.LEFT || e.keyCode === _KeyCode.default.BACKSPACE) {
e.preventDefault();
activeValue.splice(activeValue.length - 1, 1);
} else if (e.keyCode === _KeyCode.default.RIGHT) {
e.preventDefault();
if (currentOptions[currentIndex] && currentOptions[currentIndex][_this.getFieldName('children')]) {
activeValue.push(currentOptions[currentIndex][_this.getFieldName('children')][0][_this.getFieldName('value')]);
}
} else if (e.keyCode === _KeyCode.default.ESC || e.keyCode === _KeyCode.default.TAB) {
_this.setPopupVisible(false);
return;
}
if (!activeValue || activeValue.length === 0) {
_this.setPopupVisible(false);
}
var activeOptions = _this.getActiveOptions(activeValue);
var targetOption = activeOptions[activeOptions.length - 1];
_this.handleMenuSelect(targetOption, activeOptions.length - 1, e);
if (_this.props.onKeyDown) {
_this.props.onKeyDown(e);
}
};
_this.saveTrigger = function (node) {
_this.trigger = node;
};
var initialValue = [];
if ('value' in props) {
initialValue = props.value || [];
} else if ('defaultValue' in props) {
initialValue = props.defaultValue || [];
}
(0, _warning.default)(!('filedNames' in props), '`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead.');
_this.state = {
popupVisible: props.popupVisible,
activeValue: initialValue,
value: initialValue,
prevProps: props
};
_this.defaultFieldNames = {
label: 'label',
value: 'value',
children: 'children'
};
return _this;
}
_createClass(Cascader, [{
key: "getPopupDOMNode",
value: function getPopupDOMNode() {
return this.trigger.getPopupDomNode();
}
}, {
key: "getFieldName",
value: function getFieldName(name) {
var defaultFieldNames = this.defaultFieldNames;
var _this$props2 = this.props,
fieldNames = _this$props2.fieldNames,
filedNames = _this$props2.filedNames;
if ('filedNames' in this.props) {
return filedNames[name] || defaultFieldNames[name]; // For old compatibility
}
return fieldNames[name] || defaultFieldNames[name];
}
}, {
key: "getFieldNames",
value: function getFieldNames() {
var _this$props3 = this.props,
fieldNames = _this$props3.fieldNames,
filedNames = _this$props3.filedNames;
if ('filedNames' in this.props) {
return filedNames; // For old compatibility
}
return fieldNames;
}
}, {
key: "getCurrentLevelOptions",
value: function getCurrentLevelOptions() {
var _this2 = this;
var _this$props$options = this.props.options,
options = _this$props$options === void 0 ? [] : _this$props$options;
var _this$state$activeVal = this.state.activeValue,
activeValue = _this$state$activeVal === void 0 ? [] : _this$state$activeVal;
var result = (0, _arrayTreeFilter.default)(options, function (o, level) {
return o[_this2.getFieldName('value')] === activeValue[level];
}, {
childrenKeyName: this.getFieldName('children')
});
if (result[result.length - 2]) {
return result[result.length - 2][this.getFieldName('children')];
}
return _toConsumableArray(options).filter(function (o) {
return !o.disabled;
});
}
}, {
key: "getActiveOptions",
value: function getActiveOptions(activeValue) {
var _this3 = this;
return (0, _arrayTreeFilter.default)(this.props.options || [], function (o, level) {
return o[_this3.getFieldName('value')] === activeValue[level];
}, {
childrenKeyName: this.getFieldName('children')
});
}
}, {
key: "render",
value: function render() {
var _this$props4 = this.props,
prefixCls = _this$props4.prefixCls,
transitionName = _this$props4.transitionName,
popupClassName = _this$props4.popupClassName,
_this$props4$options = _this$props4.options,
options = _this$props4$options === void 0 ? [] : _this$props4$options,
disabled = _this$props4.disabled,
builtinPlacements = _this$props4.builtinPlacements,
popupPlacement = _this$props4.popupPlacement,
children = _this$props4.children,
restProps = _objectWithoutProperties(_this$props4, ["prefixCls", "transitionName", "popupClassName", "options", "disabled", "builtinPlacements", "popupPlacement", "children"]); // Did not show popup when there is no options
var menus = React.createElement("div", null);
var emptyMenuClassName = '';
if (options && options.length > 0) {
menus = React.createElement(_Menus.default, Object.assign({}, this.props, {
fieldNames: this.getFieldNames(),
defaultFieldNames: this.defaultFieldNames,
activeValue: this.state.activeValue,
onSelect: this.handleMenuSelect,
onItemDoubleClick: this.handleItemDoubleClick,
visible: this.state.popupVisible
}));
} else {
emptyMenuClassName = " ".concat(prefixCls, "-menus-empty");
}
return React.createElement(_rcTrigger.default, Object.assign({
ref: this.saveTrigger
}, restProps, {
popupPlacement: popupPlacement,
builtinPlacements: builtinPlacements,
popupTransitionName: transitionName,
action: disabled ? [] : ['click'],
popupVisible: disabled ? false : this.state.popupVisible,
onPopupVisibleChange: this.handlePopupVisibleChange,
prefixCls: "".concat(prefixCls, "-menus"),
popupClassName: popupClassName + emptyMenuClassName,
popup: menus
}), React.cloneElement(children, {
onKeyDown: this.handleKeyDown,
tabIndex: disabled ? undefined : 0
}));
}
}], [{
key: "getDerivedStateFromProps",
value: function getDerivedStateFromProps(nextProps, prevState) {
var _prevState$prevProps = prevState.prevProps,
prevProps = _prevState$prevProps === void 0 ? {} : _prevState$prevProps;
var newState = {
prevProps: nextProps
};
if ('value' in nextProps && !(0, _utils.isEqualArrays)(prevProps.value, nextProps.value)) {
newState.value = nextProps.value || []; // allow activeValue diff from value
// https://github.com/ant-design/ant-design/issues/2767
if (!('loadData' in nextProps)) {
newState.activeValue = nextProps.value || [];
}
}
if ('popupVisible' in nextProps) {
newState.popupVisible = nextProps.popupVisible;
}
return newState;
}
}]);
return Cascader;
}(React.Component);
Cascader.defaultProps = {
onChange: function onChange() {},
onPopupVisibleChange: function onPopupVisibleChange() {},
disabled: false,
transitionName: '',
prefixCls: 'rc-cascader',
popupClassName: '',
popupPlacement: 'bottomLeft',
builtinPlacements: _placements.default,
expandTrigger: 'click',
fieldNames: {
label: 'label',
value: 'value',
children: 'children'
},
expandIcon: '>'
};
var _default = Cascader;
exports.default = _default;

37
web/node_modules/rc-cascader/lib/Menus.d.ts generated vendored Normal file
View File

@@ -0,0 +1,37 @@
import * as React from 'react';
import { CascaderOption, CascaderFieldNames } from './Cascader';
interface MenusProps {
value?: string[];
activeValue?: string[];
options?: CascaderOption[];
prefixCls?: string;
expandTrigger?: string;
onSelect?: (targetOption: string[], index: number, e: React.KeyboardEvent<HTMLElement>) => void;
visible?: boolean;
dropdownMenuColumnStyle?: React.CSSProperties;
defaultFieldNames?: CascaderFieldNames;
fieldNames?: CascaderFieldNames;
expandIcon?: React.ReactNode;
loadingIcon?: React.ReactNode;
onItemDoubleClick?: (targetOption: string[], index: number, e: React.MouseEvent<HTMLElement>) => void;
}
interface MenuItems {
[index: number]: HTMLLIElement;
}
declare class Menus extends React.Component<MenusProps> {
menuItems: MenuItems;
delayTimer: number;
static defaultProps: MenusProps;
componentDidMount(): void;
componentDidUpdate(prevProps: MenusProps): void;
getFieldName(name: any): any;
getOption(option: CascaderOption, menuIndex: number): JSX.Element;
getActiveOptions(values?: CascaderOption[]): CascaderOption[];
getShowOptions(): CascaderOption[][];
delayOnSelect(onSelect: any, ...args: any[]): void;
scrollActiveItemToView(): void;
isActiveOption(option: any, menuIndex: any): boolean;
saveMenuItem: (index: any) => (node: any) => void;
render(): JSX.Element;
}
export default Menus;

253
web/node_modules/rc-cascader/lib/Menus.js generated vendored Normal file
View File

@@ -0,0 +1,253 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _arrayTreeFilter = _interopRequireDefault(require("array-tree-filter"));
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) { 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 _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 Menus =
/*#__PURE__*/
function (_React$Component) {
_inherits(Menus, _React$Component);
function Menus() {
var _this;
_classCallCheck(this, Menus);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Menus).apply(this, arguments));
_this.menuItems = {};
_this.saveMenuItem = function (index) {
return function (node) {
_this.menuItems[index] = node;
};
};
return _this;
}
_createClass(Menus, [{
key: "componentDidMount",
value: function componentDidMount() {
this.scrollActiveItemToView();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
if (!prevProps.visible && this.props.visible) {
this.scrollActiveItemToView();
}
}
}, {
key: "getFieldName",
value: function getFieldName(name) {
var _this$props = this.props,
fieldNames = _this$props.fieldNames,
defaultFieldNames = _this$props.defaultFieldNames; // 防止只设置单个属性的名字
return fieldNames[name] || defaultFieldNames[name];
}
}, {
key: "getOption",
value: function getOption(option, menuIndex) {
var _this$props2 = this.props,
prefixCls = _this$props2.prefixCls,
expandTrigger = _this$props2.expandTrigger,
expandIcon = _this$props2.expandIcon,
loadingIcon = _this$props2.loadingIcon;
var onSelect = this.props.onSelect.bind(this, option, menuIndex);
var onItemDoubleClick = this.props.onItemDoubleClick.bind(this, option, menuIndex);
var expandProps = {
onClick: onSelect,
onDoubleClick: onItemDoubleClick
};
var menuItemCls = "".concat(prefixCls, "-menu-item");
var expandIconNode = null;
var hasChildren = option[this.getFieldName('children')] && option[this.getFieldName('children')].length > 0;
if (hasChildren || option.isLeaf === false) {
menuItemCls += " ".concat(prefixCls, "-menu-item-expand");
if (!option.loading) {
expandIconNode = React.createElement("span", {
className: "".concat(prefixCls, "-menu-item-expand-icon")
}, expandIcon);
}
}
if (expandTrigger === 'hover' && (hasChildren || option.isLeaf === false)) {
expandProps = {
onMouseEnter: this.delayOnSelect.bind(this, onSelect),
onMouseLeave: this.delayOnSelect.bind(this),
onClick: onSelect
};
}
if (this.isActiveOption(option, menuIndex)) {
menuItemCls += " ".concat(prefixCls, "-menu-item-active");
expandProps.ref = this.saveMenuItem(menuIndex);
}
if (option.disabled) {
menuItemCls += " ".concat(prefixCls, "-menu-item-disabled");
}
var loadingIconNode = null;
if (option.loading) {
menuItemCls += " ".concat(prefixCls, "-menu-item-loading");
loadingIconNode = loadingIcon || null;
}
var title = '';
if ('title' in option) {
// eslint-disable-next-line prefer-destructuring
title = option.title;
} else if (typeof option[this.getFieldName('label')] === 'string') {
title = option[this.getFieldName('label')];
}
return React.createElement("li", Object.assign({
key: option[this.getFieldName('value')],
className: menuItemCls,
title: title
}, expandProps, {
role: "menuitem",
onMouseDown: function onMouseDown(e) {
return e.preventDefault();
}
}), option[this.getFieldName('label')], expandIconNode, loadingIconNode);
}
}, {
key: "getActiveOptions",
value: function getActiveOptions(values) {
var _this2 = this;
var options = this.props.options;
var activeValue = values || this.props.activeValue;
return (0, _arrayTreeFilter.default)(options, function (o, level) {
return o[_this2.getFieldName('value')] === activeValue[level];
}, {
childrenKeyName: this.getFieldName('children')
});
}
}, {
key: "getShowOptions",
value: function getShowOptions() {
var _this3 = this;
var options = this.props.options;
var result = this.getActiveOptions().map(function (activeOption) {
return activeOption[_this3.getFieldName('children')];
}).filter(function (activeOption) {
return !!activeOption;
});
result.unshift(options);
return result;
}
}, {
key: "delayOnSelect",
value: function delayOnSelect(onSelect) {
var _this4 = this;
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (this.delayTimer) {
clearTimeout(this.delayTimer);
this.delayTimer = null;
}
if (typeof onSelect === 'function') {
this.delayTimer = window.setTimeout(function () {
onSelect(args);
_this4.delayTimer = null;
}, 150);
}
}
}, {
key: "scrollActiveItemToView",
value: function scrollActiveItemToView() {
// scroll into view
var optionsLength = this.getShowOptions().length; // eslint-disable-next-line no-plusplus
for (var i = 0; i < optionsLength; i++) {
var itemComponent = this.menuItems[i];
if (itemComponent && itemComponent.parentElement) {
itemComponent.parentElement.scrollTop = itemComponent.offsetTop;
}
}
}
}, {
key: "isActiveOption",
value: function isActiveOption(option, menuIndex) {
var _this$props$activeVal = this.props.activeValue,
activeValue = _this$props$activeVal === void 0 ? [] : _this$props$activeVal;
return activeValue[menuIndex] === option[this.getFieldName('value')];
}
}, {
key: "render",
value: function render() {
var _this5 = this;
var _this$props3 = this.props,
prefixCls = _this$props3.prefixCls,
dropdownMenuColumnStyle = _this$props3.dropdownMenuColumnStyle;
return React.createElement("div", null, this.getShowOptions().map(function (options, menuIndex) {
return React.createElement("ul", {
className: "".concat(prefixCls, "-menu"),
key: menuIndex,
style: dropdownMenuColumnStyle
}, options.map(function (option) {
return _this5.getOption(option, menuIndex);
}));
}));
}
}]);
return Menus;
}(React.Component);
Menus.defaultProps = {
options: [],
value: [],
activeValue: [],
onSelect: function onSelect() {},
prefixCls: 'rc-cascader-menus',
visible: false,
expandTrigger: 'click'
};
var _default = Menus;
exports.default = _default;

2
web/node_modules/rc-cascader/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import Cascader from './Cascader';
export default Cascader;

13
web/node_modules/rc-cascader/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _Cascader = _interopRequireDefault(require("./Cascader"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = _Cascader.default;
exports.default = _default;

3
web/node_modules/rc-cascader/lib/placements.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import { BuildInPlacements } from 'rc-trigger';
declare const BUILT_IN_PLACEMENTS: BuildInPlacements;
export default BUILT_IN_PLACEMENTS;

42
web/node_modules/rc-cascader/lib/placements.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var BUILT_IN_PLACEMENTS = {
bottomLeft: {
points: ['tl', 'bl'],
offset: [0, 4],
overflow: {
adjustX: 1,
adjustY: 1
}
},
topLeft: {
points: ['bl', 'tl'],
offset: [0, -4],
overflow: {
adjustX: 1,
adjustY: 1
}
},
bottomRight: {
points: ['tr', 'br'],
offset: [0, 4],
overflow: {
adjustX: 1,
adjustY: 1
}
},
topRight: {
points: ['br', 'tr'],
offset: [0, -4],
overflow: {
adjustX: 1,
adjustY: 1
}
}
};
var _default = BUILT_IN_PLACEMENTS;
exports.default = _default;

1
web/node_modules/rc-cascader/lib/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function isEqualArrays(arrA: any[], arrB: any[]): boolean;

31
web/node_modules/rc-cascader/lib/utils.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isEqualArrays = isEqualArrays;
function isEqualArrays(arrA, arrB) {
if (arrA === arrB) {
return true;
}
if (!arrA || !arrB) {
return false;
}
var len = arrA.length;
if (arrB.length !== len) {
return false;
} // eslint-disable-next-line no-plusplus
for (var i = 0; i < len; i++) {
if (arrA[i] !== arrB[i]) {
return false;
}
}
return true;
}

98
web/node_modules/rc-cascader/package.json generated vendored Normal file
View File

@@ -0,0 +1,98 @@
{
"_from": "rc-cascader@~1.0.0",
"_id": "rc-cascader@1.0.1",
"_inBundle": false,
"_integrity": "sha512-3mk33+YKJBP1XSrTYbdVLuCC73rUDq5STNALhvua5i8vyIgIxtb5fSl96JdWWq1Oj8tIBoHnCgoEoOYnIXkthQ==",
"_location": "/rc-cascader",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "rc-cascader@~1.0.0",
"name": "rc-cascader",
"escapedName": "rc-cascader",
"rawSpec": "~1.0.0",
"saveSpec": null,
"fetchSpec": "~1.0.0"
},
"_requiredBy": [
"/antd"
],
"_resolved": "https://registry.npmjs.org/rc-cascader/-/rc-cascader-1.0.1.tgz",
"_shasum": "770de1e1fa7bd559aabd4d59e525819b8bc809b7",
"_spec": "rc-cascader@~1.0.0",
"_where": "/Users/thilina/TestProjects/icehrm-pro/web/node_modules/antd",
"author": {
"name": "afc163@gmail.com"
},
"bugs": {
"url": "https://github.com/react-component/cascader/issues"
},
"bundleDependencies": false,
"dependencies": {
"array-tree-filter": "^2.1.0",
"rc-trigger": "^4.0.0",
"rc-util": "^4.0.4",
"warning": "^4.0.1"
},
"deprecated": false,
"description": "cascade select ui component for react",
"devDependencies": {
"@types/classnames": "^2.2.6",
"@types/enzyme": "^3.1.15",
"@types/jest": "^25.1.0",
"@types/react": "^16.8.19",
"@types/react-dom": "^16.8.4",
"@types/warning": "^3.0.0",
"cross-env": "^7.0.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.0.2",
"enzyme-to-json": "^3.2.1",
"father": "^2.13.2",
"jest": "^25.1.0",
"np": "^6.0.0",
"rc-form": "^2.4.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"typescript": "^3.5.2"
},
"files": [
"lib",
"es",
"assets/*.css",
"assets/*.less"
],
"homepage": "https://github.com/react-component/cascader",
"keywords": [
"react",
"react-component",
"react-cascader",
"react-select",
"select",
"cascade",
"cascader"
],
"license": "MIT",
"main": "./lib/index",
"module": "./es/index",
"name": "rc-cascader",
"peerDependencies": {
"react": "^15.0.0 || ^16.0.0",
"react-dom": "^15.0.0 || ^16.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/react-component/cascader.git"
},
"scripts": {
"build": "father doc build --storybook",
"compile": "father build",
"coverage": "father test --coverage",
"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": "1.0.1"
}