add all frontend files

This commit is contained in:
2026-01-17 15:16:36 -05:00
parent ff16ae7858
commit e40287e4aa
25704 changed files with 1935289 additions and 0 deletions

22
node_modules/rc-util/LICENSE generated vendored Normal file
View File

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

303
node_modules/rc-util/README.md generated vendored Normal file
View File

@@ -0,0 +1,303 @@
# rc-util
Common Utils For React Component.
[![NPM version][npm-image]][npm-url]
[![npm download][download-image]][download-url]
[![build status][github-actions-image]][github-actions-url]
[![Codecov][codecov-image]][codecov-url]
[![bundle size][bundlephobia-image]][bundlephobia-url]
[![dumi][dumi-image]][dumi-url]
[npm-image]: http://img.shields.io/npm/v/rc-util.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-util
[travis-image]: https://img.shields.io/travis/react-component/util/master?style=flat-square
[travis-url]: https://travis-ci.com/react-component/util
[github-actions-image]: https://github.com/react-component/util/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/util/actions
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/util/master.svg?style=flat-square
[codecov-url]: https://app.codecov.io/gh/react-component/util
[david-url]: https://david-dm.org/react-component/util
[david-image]: https://david-dm.org/react-component/util/status.svg?style=flat-square
[david-dev-url]: https://david-dm.org/react-component/util?type=dev
[david-dev-image]: https://david-dm.org/react-component/util/dev-status.svg?style=flat-square
[download-image]: https://img.shields.io/npm/dm/rc-util.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-util
[bundlephobia-url]: https://bundlephobia.com/package/rc-util
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-util
[dumi-url]: https://github.com/umijs/dumi
[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square
## Install
[![rc-util](https://nodei.co/npm/rc-util.png)](https://npmjs.org/package/rc-util)
## API
### createChainedFunction
> (...functions): Function
Create a function which will call all the functions with it's arguments from left to right.
```jsx|pure
import createChainedFunction from 'rc-util/lib/createChainedFunction';
```
### deprecated
> (prop: string, instead: string, component: string): void
Log an error message to warn developers that `prop` is deprecated.
```jsx|pure
import deprecated from 'rc-util/lib/deprecated';
```
### getContainerRenderMixin
> (config: Object): Object
To generate a mixin which will render specific component into specific container automatically.
```jsx|pure
import getContainerRenderMixin from 'rc-util/lib/getContainerRenderMixin';
```
Fields in `config` and their meanings.
| Field | Type | Description | Default |
| ------------- | ---------------------------- | -------------------------------------------------------------------------- | ------- |
| autoMount | boolean | Whether to render component into container automatically | true |
| autoDestroy | boolean | Whether to remove container automatically while the component is unmounted | true |
| isVisible | (instance): boolean | A function to get current visibility of the component | - |
| isForceRender | (instance): boolean | A function to determine whether to render popup even it's not visible | - |
| getComponent | (instance, extra): ReactNode | A function to get the component which will be rendered into container | - |
| getContainer | (instance): HTMLElement | A function to get the container | |
### Portal
Render children to the specific container;
```jsx|pure
import Portal from 'rc-util/lib/Portal';
```
Props:
| Prop | Type | Description | Default |
| ------------ | --------------- | ------------------------------- | ------- |
| children | ReactChildren | Content render to the container | - |
| getContainer | (): HTMLElement | A function to get the container | - |
### getScrollBarSize
> (fresh?: boolean): number
Get the width of scrollbar.
```jsx|pure
import getScrollBarSize from 'rc-util/lib/getScrollBarSize';
```
### guid
> (): string
To generate a global unique id across current application.
```jsx|pure
import guid from 'rc-util/lib/guid';
```
### pickAttrs
> (props: Object): Object
Pick valid HTML attributes and events from props.
```jsx|pure
import pickAttrs from 'rc-util/lib/pickAttrs';
```
### warn
> (msg: string): void
A shallow wrapper of `console.warn`.
```jsx|pure
import warn from 'rc-util/lib/warn';
```
### warning
> (valid: boolean, msg: string): void
A shallow wrapper of [warning](https://github.com/BerkeleyTrue/warning), but only warning once for the same message.
```jsx|pure
import warning, { noteOnce } from 'rc-util/lib/warning';
warning(false, '[antd Component] test hello world');
// Low level note
noteOnce(false, '[antd Component] test hello world');
```
### Children
A collection of functions to operate React elements' children.
#### Children/mapSelf
> (children): children
Return a shallow copy of children.
```jsx|pure
import mapSelf from 'rc-util/lib/Children/mapSelf';
```
#### Children/toArray
> (children: ReactNode[]): ReactNode[]
Convert children into an array.
```jsx|pure
import toArray from 'rc-util/lib/Children/toArray';
```
### Dom
A collection of functions to operate DOM elements.
#### Dom/addEventlistener
> (target: ReactNode, eventType: string, listener: Function): { remove: Function }
A shallow wrapper of [add-dom-event-listener](https://github.com/yiminghe/add-dom-event-listener).
```jsx|pure
import addEventlistener from 'rc-util/lib/Dom/addEventlistener';
```
#### Dom/canUseDom
> (): boolean
Check if DOM is available.
```jsx|pure
import canUseDom from 'rc-util/lib/Dom/canUseDom';
```
#### Dom/class
A collection of functions to operate DOM nodes' class name.
- `hasClass(node: HTMLElement, className: string): boolean`
- `addClass(node: HTMLElement, className: string): void`
- `removeClass(node: HTMLElement, className: string): void`
```jsx|pure
import cssClass from 'rc-util/lib/Dom/class;
```
#### Dom/contains
> (root: HTMLElement, node: HTMLElement): boolean
Check if node is equal to root or in the subtree of root.
```jsx|pure
import contains from 'rc-util/lib/Dom/contains';
```
#### Dom/css
A collection of functions to get or set css styles.
- `get(node: HTMLElement, name?: string): any`
- `set(node: HTMLElement, name?: string, value: any) | set(node, object)`
- `getOuterWidth(el: HTMLElement): number`
- `getOuterHeight(el: HTMLElement): number`
- `getDocSize(): { width: number, height: number }`
- `getClientSize(): { width: number, height: number }`
- `getScroll(): { scrollLeft: number, scrollTop: number }`
- `getOffset(node: HTMLElement): { left: number, top: number }`
```jsx|pure
import css from 'rc-util/lib/Dom/css';
```
#### Dom/focus
A collection of functions to operate focus status of DOM node.
- `saveLastFocusNode(): void`
- `clearLastFocusNode(): void`
- `backLastFocusNode(): void`
- `getFocusNodeList(node: HTMLElement): HTMLElement[]` get a list of focusable nodes from the subtree of node.
- `limitTabRange(node: HTMLElement, e: Event): void`
```jsx|pure
import focus from 'rc-util/lib/Dom/focus';
```
#### Dom/support
> { animation: boolean | Object, transition: boolean | Object }
A flag to tell whether current environment supports `animationend` or `transitionend`.
```jsx|pure
import support from 'rc-util/lib/Dom/support';
```
### KeyCode
> Enum
Enum of KeyCode, please check the [definition](https://github.com/react-component/util/blob/master/src/KeyCode.ts) of it.
```jsx|pure
import KeyCode from 'rc-util/lib/KeyCode';
```
#### KeyCode.isTextModifyingKeyEvent
> (e: Event): boolean
Whether text and modified key is entered at the same time.
#### KeyCode.isCharacterKey
> (keyCode: KeyCode): boolean
Whether character is entered.
### ScrollLocker
> ScrollLocker<{lock: (options: {container: HTMLElement}) => void, unLock: () => void}>
improve shake when page scroll bar hidden.
`ScrollLocker` change body style, and add a class `ant-scrolling-effect` when called, so if you page look abnormal, please check this;
```js
import ScrollLocker from 'rc-util/lib/Dom/scrollLocker';
const scrollLocker = new ScrollLocker();
// lock
scrollLocker.lock()
// unLock
scrollLocker.unLock()
```
## License
[MIT](/LICENSE)

8
node_modules/rc-util/es/Children/mapSelf.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import React from 'react';
function mirror(o) {
return o;
}
export default function mapSelf(children) {
// return ReactFragment
return React.Children.map(children, mirror);
}

5
node_modules/rc-util/es/Children/toArray.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import React from 'react';
export interface Option {
keepEmpty?: boolean;
}
export default function toArray(children: React.ReactNode, option?: Option): React.ReactElement[];

19
node_modules/rc-util/es/Children/toArray.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import isFragment from "../React/isFragment";
import React from 'react';
export default function toArray(children) {
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var ret = [];
React.Children.forEach(children, function (child) {
if ((child === undefined || child === null) && !option.keepEmpty) {
return;
}
if (Array.isArray(child)) {
ret = ret.concat(toArray(child));
} else if (isFragment(child) && child.props) {
ret = ret.concat(toArray(child.props.children, option));
} else {
ret.push(child);
}
});
return ret;
}

88
node_modules/rc-util/es/ContainerRender.js generated vendored Normal file
View File

@@ -0,0 +1,88 @@
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import React from 'react';
import ReactDOM from 'react-dom';
/**
* @deprecated Since we do not need support React15 any more.
* Will remove in next major version.
*/
var ContainerRender = /*#__PURE__*/function (_React$Component) {
_inherits(ContainerRender, _React$Component);
var _super = _createSuper(ContainerRender);
function ContainerRender() {
var _this;
_classCallCheck(this, ContainerRender);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty(_assertThisInitialized(_this), "removeContainer", function () {
if (_this.container) {
ReactDOM.unmountComponentAtNode(_this.container);
_this.container.parentNode.removeChild(_this.container);
_this.container = null;
}
});
_defineProperty(_assertThisInitialized(_this), "renderComponent", function (props, ready) {
var _this$props = _this.props,
visible = _this$props.visible,
getComponent = _this$props.getComponent,
forceRender = _this$props.forceRender,
getContainer = _this$props.getContainer,
parent = _this$props.parent;
if (visible || parent._component || forceRender) {
if (!_this.container) {
_this.container = getContainer();
}
ReactDOM.unstable_renderSubtreeIntoContainer(parent, getComponent(props), _this.container, function callback() {
if (ready) {
ready.call(this);
}
});
}
});
return _this;
}
_createClass(ContainerRender, [{
key: "componentDidMount",
value: function componentDidMount() {
if (this.props.autoMount) {
this.renderComponent();
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
if (this.props.autoMount) {
this.renderComponent();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (this.props.autoDestroy) {
this.removeContainer();
}
}
}, {
key: "render",
value: function render() {
return this.props.children({
renderComponent: this.renderComponent,
removeContainer: this.removeContainer
});
}
}]);
return ContainerRender;
}(React.Component);
_defineProperty(ContainerRender, "defaultProps", {
autoMount: true,
autoDestroy: true,
forceRender: false
});
export { ContainerRender as default };

17
node_modules/rc-util/es/Dom/addEventListener.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import ReactDOM from 'react-dom';
export default function addEventListenerWrap(target, eventType, cb, option) {
/* eslint camelcase: 2 */
var callback = ReactDOM.unstable_batchedUpdates ? function run(e) {
ReactDOM.unstable_batchedUpdates(cb, e);
} : cb;
if (target !== null && target !== void 0 && target.addEventListener) {
target.addEventListener(eventType, callback, option);
}
return {
remove: function remove() {
if (target !== null && target !== void 0 && target.removeEventListener) {
target.removeEventListener(eventType, callback, option);
}
}
};
}

1
node_modules/rc-util/es/Dom/canUseDom.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default function canUseDom(): boolean;

3
node_modules/rc-util/es/Dom/canUseDom.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export default function canUseDom() {
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
}

26
node_modules/rc-util/es/Dom/class.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
export function hasClass(node, className) {
if (node.classList) {
return node.classList.contains(className);
}
var originClass = node.className;
return " ".concat(originClass, " ").indexOf(" ".concat(className, " ")) > -1;
}
export function addClass(node, className) {
if (node.classList) {
node.classList.add(className);
} else {
if (!hasClass(node, className)) {
node.className = "".concat(node.className, " ").concat(className);
}
}
}
export function removeClass(node, className) {
if (node.classList) {
node.classList.remove(className);
} else {
if (hasClass(node, className)) {
var originClass = node.className;
node.className = " ".concat(originClass, " ").replace(" ".concat(className, " "), ' ');
}
}
}

1
node_modules/rc-util/es/Dom/contains.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default function contains(root: Node | null | undefined, n?: Node): boolean;

20
node_modules/rc-util/es/Dom/contains.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
export default function contains(root, n) {
if (!root) {
return false;
}
// Use native if support
if (root.contains) {
return root.contains(n);
}
// `document.contains` not support with IE11
var node = n;
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
}

96
node_modules/rc-util/es/Dom/css.js generated vendored Normal file
View File

@@ -0,0 +1,96 @@
/* eslint-disable no-nested-ternary */
var PIXEL_PATTERN = /margin|padding|width|height|max|min|offset/;
var removePixel = {
left: true,
top: true
};
var floatMap = {
cssFloat: 1,
styleFloat: 1,
float: 1
};
function getComputedStyle(node) {
return node.nodeType === 1 ? node.ownerDocument.defaultView.getComputedStyle(node, null) : {};
}
function getStyleValue(node, type, value) {
type = type.toLowerCase();
if (value === 'auto') {
if (type === 'height') {
return node.offsetHeight;
}
if (type === 'width') {
return node.offsetWidth;
}
}
if (!(type in removePixel)) {
removePixel[type] = PIXEL_PATTERN.test(type);
}
return removePixel[type] ? parseFloat(value) || 0 : value;
}
export function get(node, name) {
var length = arguments.length;
var style = getComputedStyle(node);
name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;
return length === 1 ? style : getStyleValue(node, name, style[name] || node.style[name]);
}
export function set(node, name, value) {
var length = arguments.length;
name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;
if (length === 3) {
if (typeof value === 'number' && PIXEL_PATTERN.test(name)) {
value = "".concat(value, "px");
}
node.style[name] = value; // Number
return value;
}
for (var x in name) {
if (name.hasOwnProperty(x)) {
set(node, x, name[x]);
}
}
return getComputedStyle(node);
}
export function getOuterWidth(el) {
if (el === document.body) {
return document.documentElement.clientWidth;
}
return el.offsetWidth;
}
export function getOuterHeight(el) {
if (el === document.body) {
return window.innerHeight || document.documentElement.clientHeight;
}
return el.offsetHeight;
}
export function getDocSize() {
var width = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
var height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
return {
width: width,
height: height
};
}
export function getClientSize() {
var width = document.documentElement.clientWidth;
var height = window.innerHeight || document.documentElement.clientHeight;
return {
width: width,
height: height
};
}
export function getScroll() {
return {
scrollLeft: Math.max(document.documentElement.scrollLeft, document.body.scrollLeft),
scrollTop: Math.max(document.documentElement.scrollTop, document.body.scrollTop)
};
}
export function getOffset(node) {
var box = node.getBoundingClientRect();
var docElem = document.documentElement;
// < ie8 不支持 win.pageXOffset, 则使用 docElem.scrollLeft
return {
left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),
top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
};
}

25
node_modules/rc-util/es/Dom/dynamicCSS.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
export type ContainerType = Element | ShadowRoot;
export type Prepend = boolean | 'queue';
export type AppendType = 'prependQueue' | 'append' | 'prepend';
interface Options {
attachTo?: ContainerType;
csp?: {
nonce?: string;
};
prepend?: Prepend;
/**
* Config the `priority` of `prependQueue`. Default is `0`.
* It's useful if you need to insert style before other style.
*/
priority?: number;
mark?: string;
styles?: HTMLElement[];
}
export declare function injectCSS(css: string, option?: Options): HTMLStyleElement;
export declare function removeCSS(key: string, option?: Options): void;
/**
* manually clear container cache to avoid global cache in unit testes
*/
export declare function clearContainerCache(): void;
export declare function updateCSS(css: string, key: string, originOption?: Options): HTMLElement;
export {};

148
node_modules/rc-util/es/Dom/dynamicCSS.js generated vendored Normal file
View File

@@ -0,0 +1,148 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import canUseDom from "./canUseDom";
import contains from "./contains";
var APPEND_ORDER = 'data-rc-order';
var APPEND_PRIORITY = 'data-rc-priority';
var MARK_KEY = "rc-util-key";
var containerCache = new Map();
function getMark() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
mark = _ref.mark;
if (mark) {
return mark.startsWith('data-') ? mark : "data-".concat(mark);
}
return MARK_KEY;
}
function getContainer(option) {
if (option.attachTo) {
return option.attachTo;
}
var head = document.querySelector('head');
return head || document.body;
}
function getOrder(prepend) {
if (prepend === 'queue') {
return 'prependQueue';
}
return prepend ? 'prepend' : 'append';
}
/**
* Find style which inject by rc-util
*/
function findStyles(container) {
return Array.from((containerCache.get(container) || container).children).filter(function (node) {
return node.tagName === 'STYLE';
});
}
export function injectCSS(css) {
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (!canUseDom()) {
return null;
}
var csp = option.csp,
prepend = option.prepend,
_option$priority = option.priority,
priority = _option$priority === void 0 ? 0 : _option$priority;
var mergedOrder = getOrder(prepend);
var isPrependQueue = mergedOrder === 'prependQueue';
var styleNode = document.createElement('style');
styleNode.setAttribute(APPEND_ORDER, mergedOrder);
if (isPrependQueue && priority) {
styleNode.setAttribute(APPEND_PRIORITY, "".concat(priority));
}
if (csp !== null && csp !== void 0 && csp.nonce) {
styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
}
styleNode.innerHTML = css;
var container = getContainer(option);
var firstChild = container.firstChild;
if (prepend) {
// If is queue `prepend`, it will prepend first style and then append rest style
if (isPrependQueue) {
var existStyle = (option.styles || findStyles(container)).filter(function (node) {
// Ignore style which not injected by rc-util with prepend
if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {
return false;
}
// Ignore style which priority less then new style
var nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);
return priority >= nodePriority;
});
if (existStyle.length) {
container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
return styleNode;
}
}
// Use `insertBefore` as `prepend`
container.insertBefore(styleNode, firstChild);
} else {
container.appendChild(styleNode);
}
return styleNode;
}
function findExistNode(key) {
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var container = getContainer(option);
return (option.styles || findStyles(container)).find(function (node) {
return node.getAttribute(getMark(option)) === key;
});
}
export function removeCSS(key) {
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var existNode = findExistNode(key, option);
if (existNode) {
var container = getContainer(option);
container.removeChild(existNode);
}
}
/**
* qiankun will inject `appendChild` to insert into other
*/
function syncRealContainer(container, option) {
var cachedRealContainer = containerCache.get(container);
// Find real container when not cached or cached container removed
if (!cachedRealContainer || !contains(document, cachedRealContainer)) {
var placeholderStyle = injectCSS('', option);
var parentNode = placeholderStyle.parentNode;
containerCache.set(container, parentNode);
container.removeChild(placeholderStyle);
}
}
/**
* manually clear container cache to avoid global cache in unit testes
*/
export function clearContainerCache() {
containerCache.clear();
}
export function updateCSS(css, key) {
var originOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var container = getContainer(originOption);
var styles = findStyles(container);
var option = _objectSpread(_objectSpread({}, originOption), {}, {
styles: styles
});
// Sync real parent
syncRealContainer(container, option);
var existNode = findExistNode(key, option);
if (existNode) {
var _option$csp, _option$csp2;
if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) {
var _option$csp3;
existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce;
}
if (existNode.innerHTML !== css) {
existNode.innerHTML = css;
}
return existNode;
}
var newNode = injectCSS(css, option);
newNode.setAttribute(getMark(option), key);
return newNode;
}

12
node_modules/rc-util/es/Dom/findDOMNode.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import React from 'react';
export declare function isDOM(node: any): node is HTMLElement | SVGElement;
/**
* Retrieves a DOM node via a ref, and does not invoke `findDOMNode`.
*/
export declare function getDOM(node: any): HTMLElement | SVGElement | null;
/**
* Return if a node is a DOM node. Else will return by `findDOMNode`
*/
export default function findDOMNode<T = Element | Text>(node: React.ReactInstance | HTMLElement | SVGElement | {
nativeElement: T;
}): T;

36
node_modules/rc-util/es/Dom/findDOMNode.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
import _typeof from "@babel/runtime/helpers/esm/typeof";
import React from 'react';
import ReactDOM from 'react-dom';
export function isDOM(node) {
// https://developer.mozilla.org/en-US/docs/Web/API/Element
// Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement
return node instanceof HTMLElement || node instanceof SVGElement;
}
/**
* Retrieves a DOM node via a ref, and does not invoke `findDOMNode`.
*/
export function getDOM(node) {
if (node && _typeof(node) === 'object' && isDOM(node.nativeElement)) {
return node.nativeElement;
}
if (isDOM(node)) {
return node;
}
return null;
}
/**
* Return if a node is a DOM node. Else will return by `findDOMNode`
*/
export default function findDOMNode(node) {
var domNode = getDOM(node);
if (domNode) {
return domNode;
}
if (node instanceof React.Component) {
var _ReactDOM$findDOMNode;
return (_ReactDOM$findDOMNode = ReactDOM.findDOMNode) === null || _ReactDOM$findDOMNode === void 0 ? void 0 : _ReactDOM$findDOMNode.call(ReactDOM, node);
}
return null;
}

8
node_modules/rc-util/es/Dom/focus.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
export declare function getFocusNodeList(node: HTMLElement, includePositive?: boolean): HTMLElement[];
/** @deprecated Do not use since this may failed when used in async */
export declare function saveLastFocusNode(): void;
/** @deprecated Do not use since this may failed when used in async */
export declare function clearLastFocusNode(): void;
/** @deprecated Do not use since this may failed when used in async */
export declare function backLastFocusNode(): void;
export declare function limitTabRange(node: HTMLElement, e: KeyboardEvent): void;

82
node_modules/rc-util/es/Dom/focus.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import isVisible from "./isVisible";
function focusable(node) {
var includePositive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (isVisible(node)) {
var nodeName = node.nodeName.toLowerCase();
var isFocusableElement =
// Focusable element
['input', 'select', 'textarea', 'button'].includes(nodeName) ||
// Editable element
node.isContentEditable ||
// Anchor with href element
nodeName === 'a' && !!node.getAttribute('href');
// Get tabIndex
var tabIndexAttr = node.getAttribute('tabindex');
var tabIndexNum = Number(tabIndexAttr);
// Parse as number if validate
var tabIndex = null;
if (tabIndexAttr && !Number.isNaN(tabIndexNum)) {
tabIndex = tabIndexNum;
} else if (isFocusableElement && tabIndex === null) {
tabIndex = 0;
}
// Block focusable if disabled
if (isFocusableElement && node.disabled) {
tabIndex = null;
}
return tabIndex !== null && (tabIndex >= 0 || includePositive && tabIndex < 0);
}
return false;
}
export function getFocusNodeList(node) {
var includePositive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var res = _toConsumableArray(node.querySelectorAll('*')).filter(function (child) {
return focusable(child, includePositive);
});
if (focusable(node, includePositive)) {
res.unshift(node);
}
return res;
}
var lastFocusElement = null;
/** @deprecated Do not use since this may failed when used in async */
export function saveLastFocusNode() {
lastFocusElement = document.activeElement;
}
/** @deprecated Do not use since this may failed when used in async */
export function clearLastFocusNode() {
lastFocusElement = null;
}
/** @deprecated Do not use since this may failed when used in async */
export function backLastFocusNode() {
if (lastFocusElement) {
try {
// 元素可能已经被移动了
lastFocusElement.focus();
/* eslint-disable no-empty */
} catch (e) {
// empty
}
/* eslint-enable no-empty */
}
}
export function limitTabRange(node, e) {
if (e.keyCode === 9) {
var tabNodeList = getFocusNodeList(node);
var lastTabNode = tabNodeList[e.shiftKey ? 0 : tabNodeList.length - 1];
var leavingTab = lastTabNode === document.activeElement || node === document.activeElement;
if (leavingTab) {
var target = tabNodeList[e.shiftKey ? tabNodeList.length - 1 : 0];
target.focus();
e.preventDefault();
}
}
}

2
node_modules/rc-util/es/Dom/isVisible.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
declare const _default: (element: Element) => boolean;
export default _default;

27
node_modules/rc-util/es/Dom/isVisible.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
export default (function (element) {
if (!element) {
return false;
}
if (element instanceof Element) {
if (element.offsetParent) {
return true;
}
if (element.getBBox) {
var _getBBox = element.getBBox(),
width = _getBBox.width,
height = _getBBox.height;
if (width || height) {
return true;
}
}
if (element.getBoundingClientRect) {
var _element$getBoundingC = element.getBoundingClientRect(),
_width = _element$getBoundingC.width,
_height = _element$getBoundingC.height;
if (_width || _height) {
return true;
}
}
}
return false;
});

12
node_modules/rc-util/es/Dom/scrollLocker.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
export interface scrollLockOptions {
container: HTMLElement;
}
export default class ScrollLocker {
private lockTarget;
private options;
constructor(options?: scrollLockOptions);
getContainer: () => HTMLElement | undefined;
reLock: (options?: scrollLockOptions) => void;
lock: () => void;
unLock: () => void;
}

126
node_modules/rc-util/es/Dom/scrollLocker.js generated vendored Normal file
View File

@@ -0,0 +1,126 @@
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import getScrollBarSize from "../getScrollBarSize";
import setStyle from "../setStyle";
var uuid = 0;
var locks = [];
var scrollingEffectClassName = 'ant-scrolling-effect';
var scrollingEffectClassNameReg = new RegExp("".concat(scrollingEffectClassName), 'g');
// https://github.com/ant-design/ant-design/issues/19340
// https://github.com/ant-design/ant-design/issues/19332
var cacheStyle = new Map();
var ScrollLocker = /*#__PURE__*/_createClass(function ScrollLocker(_options) {
var _this = this;
_classCallCheck(this, ScrollLocker);
_defineProperty(this, "lockTarget", void 0);
_defineProperty(this, "options", void 0);
_defineProperty(this, "getContainer", function () {
var _this$options;
return (_this$options = _this.options) === null || _this$options === void 0 ? void 0 : _this$options.container;
});
// if options change...
_defineProperty(this, "reLock", function (options) {
var findLock = locks.find(function (_ref) {
var target = _ref.target;
return target === _this.lockTarget;
});
if (findLock) {
_this.unLock();
}
_this.options = options;
if (findLock) {
findLock.options = options;
_this.lock();
}
});
_defineProperty(this, "lock", function () {
var _this$options3;
// If lockTarget exist return
if (locks.some(function (_ref2) {
var target = _ref2.target;
return target === _this.lockTarget;
})) {
return;
}
// If same container effect, return
if (locks.some(function (_ref3) {
var _this$options2;
var options = _ref3.options;
return (options === null || options === void 0 ? void 0 : options.container) === ((_this$options2 = _this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.container);
})) {
locks = [].concat(_toConsumableArray(locks), [{
target: _this.lockTarget,
options: _this.options
}]);
return;
}
var scrollBarSize = 0;
var container = ((_this$options3 = _this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.container) || document.body;
if (container === document.body && window.innerWidth - document.documentElement.clientWidth > 0 || container.scrollHeight > container.clientHeight) {
if (getComputedStyle(container).overflow !== 'hidden') {
scrollBarSize = getScrollBarSize();
}
}
var containerClassName = container.className;
if (locks.filter(function (_ref4) {
var _this$options4;
var options = _ref4.options;
return (options === null || options === void 0 ? void 0 : options.container) === ((_this$options4 = _this.options) === null || _this$options4 === void 0 ? void 0 : _this$options4.container);
}).length === 0) {
cacheStyle.set(container, setStyle({
width: scrollBarSize !== 0 ? "calc(100% - ".concat(scrollBarSize, "px)") : undefined,
overflow: 'hidden',
overflowX: 'hidden',
overflowY: 'hidden'
}, {
element: container
}));
}
// https://github.com/ant-design/ant-design/issues/19729
if (!scrollingEffectClassNameReg.test(containerClassName)) {
var addClassName = "".concat(containerClassName, " ").concat(scrollingEffectClassName);
container.className = addClassName.trim();
}
locks = [].concat(_toConsumableArray(locks), [{
target: _this.lockTarget,
options: _this.options
}]);
});
_defineProperty(this, "unLock", function () {
var _this$options5;
var findLock = locks.find(function (_ref5) {
var target = _ref5.target;
return target === _this.lockTarget;
});
locks = locks.filter(function (_ref6) {
var target = _ref6.target;
return target !== _this.lockTarget;
});
if (!findLock || locks.some(function (_ref7) {
var _findLock$options;
var options = _ref7.options;
return (options === null || options === void 0 ? void 0 : options.container) === ((_findLock$options = findLock.options) === null || _findLock$options === void 0 ? void 0 : _findLock$options.container);
})) {
return;
}
// Remove Effect
var container = ((_this$options5 = _this.options) === null || _this$options5 === void 0 ? void 0 : _this$options5.container) || document.body;
var containerClassName = container.className;
if (!scrollingEffectClassNameReg.test(containerClassName)) return;
setStyle(cacheStyle.get(container), {
element: container
});
cacheStyle.delete(container);
container.className = container.className.replace(scrollingEffectClassNameReg, '').trim();
});
// eslint-disable-next-line no-plusplus
this.lockTarget = uuid++;
this.options = _options;
});
export { ScrollLocker as default };

8
node_modules/rc-util/es/Dom/shadow.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/**
* Check if is in shadowRoot
*/
export declare function inShadow(ele: Node): boolean;
/**
* Return shadowRoot if possible
*/
export declare function getShadowRoot(ele: Node): ShadowRoot;

18
node_modules/rc-util/es/Dom/shadow.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
function getRoot(ele) {
var _ele$getRootNode;
return ele === null || ele === void 0 || (_ele$getRootNode = ele.getRootNode) === null || _ele$getRootNode === void 0 ? void 0 : _ele$getRootNode.call(ele);
}
/**
* Check if is in shadowRoot
*/
export function inShadow(ele) {
return getRoot(ele) instanceof ShadowRoot;
}
/**
* Return shadowRoot if possible
*/
export function getShadowRoot(ele) {
return inShadow(ele) ? getRoot(ele) : null;
}

2
node_modules/rc-util/es/Dom/styleChecker.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare function isStyleSupport(styleName: string | string[]): boolean;
export declare function isStyleSupport(styleName: string, styleValue: any): boolean;

26
node_modules/rc-util/es/Dom/styleChecker.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
import canUseDom from "./canUseDom";
var isStyleNameSupport = function isStyleNameSupport(styleName) {
if (canUseDom() && window.document.documentElement) {
var styleNameList = Array.isArray(styleName) ? styleName : [styleName];
var documentElement = window.document.documentElement;
return styleNameList.some(function (name) {
return name in documentElement.style;
});
}
return false;
};
var isStyleValueSupport = function isStyleValueSupport(styleName, value) {
if (!isStyleNameSupport(styleName)) {
return false;
}
var ele = document.createElement('div');
var origin = ele.style[styleName];
ele.style[styleName] = value;
return ele.style[styleName] !== origin;
};
export function isStyleSupport(styleName, styleValue) {
if (!Array.isArray(styleName) && styleValue !== undefined) {
return isStyleValueSupport(styleName, styleValue);
}
return isStyleNameSupport(styleName);
}

24
node_modules/rc-util/es/Dom/support.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import canUseDOM from "./canUseDom";
var animationEndEventNames = {
WebkitAnimation: 'webkitAnimationEnd',
OAnimation: 'oAnimationEnd',
animation: 'animationend'
};
var transitionEventNames = {
WebkitTransition: 'webkitTransitionEnd',
OTransition: 'oTransitionEnd',
transition: 'transitionend'
};
function supportEnd(names) {
var el = document.createElement('div');
for (var name in names) {
if (names.hasOwnProperty(name) && el.style[name] !== undefined) {
return {
end: names[name]
};
}
}
return false;
}
export var animation = canUseDOM() && supportEnd(animationEndEventNames);
export var transition = canUseDOM() && supportEnd(transitionEventNames);

436
node_modules/rc-util/es/KeyCode.d.ts generated vendored Normal file
View File

@@ -0,0 +1,436 @@
/**
* @ignore
* some key-codes definition and utils from closure-library
* @author yiminghe@gmail.com
*/
declare const KeyCode: {
/**
* MAC_ENTER
*/
MAC_ENTER: number;
/**
* BACKSPACE
*/
BACKSPACE: number;
/**
* TAB
*/
TAB: number;
/**
* NUMLOCK on FF/Safari Mac
*/
NUM_CENTER: number;
/**
* ENTER
*/
ENTER: number;
/**
* SHIFT
*/
SHIFT: number;
/**
* CTRL
*/
CTRL: number;
/**
* ALT
*/
ALT: number;
/**
* PAUSE
*/
PAUSE: number;
/**
* CAPS_LOCK
*/
CAPS_LOCK: number;
/**
* ESC
*/
ESC: number;
/**
* SPACE
*/
SPACE: number;
/**
* PAGE_UP
*/
PAGE_UP: number;
/**
* PAGE_DOWN
*/
PAGE_DOWN: number;
/**
* END
*/
END: number;
/**
* HOME
*/
HOME: number;
/**
* LEFT
*/
LEFT: number;
/**
* UP
*/
UP: number;
/**
* RIGHT
*/
RIGHT: number;
/**
* DOWN
*/
DOWN: number;
/**
* PRINT_SCREEN
*/
PRINT_SCREEN: number;
/**
* INSERT
*/
INSERT: number;
/**
* DELETE
*/
DELETE: number;
/**
* ZERO
*/
ZERO: number;
/**
* ONE
*/
ONE: number;
/**
* TWO
*/
TWO: number;
/**
* THREE
*/
THREE: number;
/**
* FOUR
*/
FOUR: number;
/**
* FIVE
*/
FIVE: number;
/**
* SIX
*/
SIX: number;
/**
* SEVEN
*/
SEVEN: number;
/**
* EIGHT
*/
EIGHT: number;
/**
* NINE
*/
NINE: number;
/**
* QUESTION_MARK
*/
QUESTION_MARK: number;
/**
* A
*/
A: number;
/**
* B
*/
B: number;
/**
* C
*/
C: number;
/**
* D
*/
D: number;
/**
* E
*/
E: number;
/**
* F
*/
F: number;
/**
* G
*/
G: number;
/**
* H
*/
H: number;
/**
* I
*/
I: number;
/**
* J
*/
J: number;
/**
* K
*/
K: number;
/**
* L
*/
L: number;
/**
* M
*/
M: number;
/**
* N
*/
N: number;
/**
* O
*/
O: number;
/**
* P
*/
P: number;
/**
* Q
*/
Q: number;
/**
* R
*/
R: number;
/**
* S
*/
S: number;
/**
* T
*/
T: number;
/**
* U
*/
U: number;
/**
* V
*/
V: number;
/**
* W
*/
W: number;
/**
* X
*/
X: number;
/**
* Y
*/
Y: number;
/**
* Z
*/
Z: number;
/**
* META
*/
META: number;
/**
* WIN_KEY_RIGHT
*/
WIN_KEY_RIGHT: number;
/**
* CONTEXT_MENU
*/
CONTEXT_MENU: number;
/**
* NUM_ZERO
*/
NUM_ZERO: number;
/**
* NUM_ONE
*/
NUM_ONE: number;
/**
* NUM_TWO
*/
NUM_TWO: number;
/**
* NUM_THREE
*/
NUM_THREE: number;
/**
* NUM_FOUR
*/
NUM_FOUR: number;
/**
* NUM_FIVE
*/
NUM_FIVE: number;
/**
* NUM_SIX
*/
NUM_SIX: number;
/**
* NUM_SEVEN
*/
NUM_SEVEN: number;
/**
* NUM_EIGHT
*/
NUM_EIGHT: number;
/**
* NUM_NINE
*/
NUM_NINE: number;
/**
* NUM_MULTIPLY
*/
NUM_MULTIPLY: number;
/**
* NUM_PLUS
*/
NUM_PLUS: number;
/**
* NUM_MINUS
*/
NUM_MINUS: number;
/**
* NUM_PERIOD
*/
NUM_PERIOD: number;
/**
* NUM_DIVISION
*/
NUM_DIVISION: number;
/**
* F1
*/
F1: number;
/**
* F2
*/
F2: number;
/**
* F3
*/
F3: number;
/**
* F4
*/
F4: number;
/**
* F5
*/
F5: number;
/**
* F6
*/
F6: number;
/**
* F7
*/
F7: number;
/**
* F8
*/
F8: number;
/**
* F9
*/
F9: number;
/**
* F10
*/
F10: number;
/**
* F11
*/
F11: number;
/**
* F12
*/
F12: number;
/**
* NUMLOCK
*/
NUMLOCK: number;
/**
* SEMICOLON
*/
SEMICOLON: number;
/**
* DASH
*/
DASH: number;
/**
* EQUALS
*/
EQUALS: number;
/**
* COMMA
*/
COMMA: number;
/**
* PERIOD
*/
PERIOD: number;
/**
* SLASH
*/
SLASH: number;
/**
* APOSTROPHE
*/
APOSTROPHE: number;
/**
* SINGLE_QUOTE
*/
SINGLE_QUOTE: number;
/**
* OPEN_SQUARE_BRACKET
*/
OPEN_SQUARE_BRACKET: number;
/**
* BACKSLASH
*/
BACKSLASH: number;
/**
* CLOSE_SQUARE_BRACKET
*/
CLOSE_SQUARE_BRACKET: number;
/**
* WIN_KEY
*/
WIN_KEY: number;
/**
* MAC_FF_META
*/
MAC_FF_META: number;
/**
* WIN_IME
*/
WIN_IME: number;
/**
* whether text and modified key is entered at the same time.
*/
isTextModifyingKeyEvent: (e: KeyboardEvent) => boolean;
/**
* whether character is entered.
*/
isCharacterKey: (keyCode: number) => boolean;
};
export default KeyCode;

538
node_modules/rc-util/es/KeyCode.js generated vendored Normal file
View File

@@ -0,0 +1,538 @@
/**
* @ignore
* some key-codes definition and utils from closure-library
* @author yiminghe@gmail.com
*/
var KeyCode = {
/**
* MAC_ENTER
*/
MAC_ENTER: 3,
/**
* BACKSPACE
*/
BACKSPACE: 8,
/**
* TAB
*/
TAB: 9,
/**
* NUMLOCK on FF/Safari Mac
*/
NUM_CENTER: 12,
// NUMLOCK on FF/Safari Mac
/**
* ENTER
*/
ENTER: 13,
/**
* SHIFT
*/
SHIFT: 16,
/**
* CTRL
*/
CTRL: 17,
/**
* ALT
*/
ALT: 18,
/**
* PAUSE
*/
PAUSE: 19,
/**
* CAPS_LOCK
*/
CAPS_LOCK: 20,
/**
* ESC
*/
ESC: 27,
/**
* SPACE
*/
SPACE: 32,
/**
* PAGE_UP
*/
PAGE_UP: 33,
// also NUM_NORTH_EAST
/**
* PAGE_DOWN
*/
PAGE_DOWN: 34,
// also NUM_SOUTH_EAST
/**
* END
*/
END: 35,
// also NUM_SOUTH_WEST
/**
* HOME
*/
HOME: 36,
// also NUM_NORTH_WEST
/**
* LEFT
*/
LEFT: 37,
// also NUM_WEST
/**
* UP
*/
UP: 38,
// also NUM_NORTH
/**
* RIGHT
*/
RIGHT: 39,
// also NUM_EAST
/**
* DOWN
*/
DOWN: 40,
// also NUM_SOUTH
/**
* PRINT_SCREEN
*/
PRINT_SCREEN: 44,
/**
* INSERT
*/
INSERT: 45,
// also NUM_INSERT
/**
* DELETE
*/
DELETE: 46,
// also NUM_DELETE
/**
* ZERO
*/
ZERO: 48,
/**
* ONE
*/
ONE: 49,
/**
* TWO
*/
TWO: 50,
/**
* THREE
*/
THREE: 51,
/**
* FOUR
*/
FOUR: 52,
/**
* FIVE
*/
FIVE: 53,
/**
* SIX
*/
SIX: 54,
/**
* SEVEN
*/
SEVEN: 55,
/**
* EIGHT
*/
EIGHT: 56,
/**
* NINE
*/
NINE: 57,
/**
* QUESTION_MARK
*/
QUESTION_MARK: 63,
// needs localization
/**
* A
*/
A: 65,
/**
* B
*/
B: 66,
/**
* C
*/
C: 67,
/**
* D
*/
D: 68,
/**
* E
*/
E: 69,
/**
* F
*/
F: 70,
/**
* G
*/
G: 71,
/**
* H
*/
H: 72,
/**
* I
*/
I: 73,
/**
* J
*/
J: 74,
/**
* K
*/
K: 75,
/**
* L
*/
L: 76,
/**
* M
*/
M: 77,
/**
* N
*/
N: 78,
/**
* O
*/
O: 79,
/**
* P
*/
P: 80,
/**
* Q
*/
Q: 81,
/**
* R
*/
R: 82,
/**
* S
*/
S: 83,
/**
* T
*/
T: 84,
/**
* U
*/
U: 85,
/**
* V
*/
V: 86,
/**
* W
*/
W: 87,
/**
* X
*/
X: 88,
/**
* Y
*/
Y: 89,
/**
* Z
*/
Z: 90,
/**
* META
*/
META: 91,
// WIN_KEY_LEFT
/**
* WIN_KEY_RIGHT
*/
WIN_KEY_RIGHT: 92,
/**
* CONTEXT_MENU
*/
CONTEXT_MENU: 93,
/**
* NUM_ZERO
*/
NUM_ZERO: 96,
/**
* NUM_ONE
*/
NUM_ONE: 97,
/**
* NUM_TWO
*/
NUM_TWO: 98,
/**
* NUM_THREE
*/
NUM_THREE: 99,
/**
* NUM_FOUR
*/
NUM_FOUR: 100,
/**
* NUM_FIVE
*/
NUM_FIVE: 101,
/**
* NUM_SIX
*/
NUM_SIX: 102,
/**
* NUM_SEVEN
*/
NUM_SEVEN: 103,
/**
* NUM_EIGHT
*/
NUM_EIGHT: 104,
/**
* NUM_NINE
*/
NUM_NINE: 105,
/**
* NUM_MULTIPLY
*/
NUM_MULTIPLY: 106,
/**
* NUM_PLUS
*/
NUM_PLUS: 107,
/**
* NUM_MINUS
*/
NUM_MINUS: 109,
/**
* NUM_PERIOD
*/
NUM_PERIOD: 110,
/**
* NUM_DIVISION
*/
NUM_DIVISION: 111,
/**
* F1
*/
F1: 112,
/**
* F2
*/
F2: 113,
/**
* F3
*/
F3: 114,
/**
* F4
*/
F4: 115,
/**
* F5
*/
F5: 116,
/**
* F6
*/
F6: 117,
/**
* F7
*/
F7: 118,
/**
* F8
*/
F8: 119,
/**
* F9
*/
F9: 120,
/**
* F10
*/
F10: 121,
/**
* F11
*/
F11: 122,
/**
* F12
*/
F12: 123,
/**
* NUMLOCK
*/
NUMLOCK: 144,
/**
* SEMICOLON
*/
SEMICOLON: 186,
// needs localization
/**
* DASH
*/
DASH: 189,
// needs localization
/**
* EQUALS
*/
EQUALS: 187,
// needs localization
/**
* COMMA
*/
COMMA: 188,
// needs localization
/**
* PERIOD
*/
PERIOD: 190,
// needs localization
/**
* SLASH
*/
SLASH: 191,
// needs localization
/**
* APOSTROPHE
*/
APOSTROPHE: 192,
// needs localization
/**
* SINGLE_QUOTE
*/
SINGLE_QUOTE: 222,
// needs localization
/**
* OPEN_SQUARE_BRACKET
*/
OPEN_SQUARE_BRACKET: 219,
// needs localization
/**
* BACKSLASH
*/
BACKSLASH: 220,
// needs localization
/**
* CLOSE_SQUARE_BRACKET
*/
CLOSE_SQUARE_BRACKET: 221,
// needs localization
/**
* WIN_KEY
*/
WIN_KEY: 224,
/**
* MAC_FF_META
*/
MAC_FF_META: 224,
// Firefox (Gecko) fires this for the meta key instead of 91
/**
* WIN_IME
*/
WIN_IME: 229,
// ======================== Function ========================
/**
* whether text and modified key is entered at the same time.
*/
isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {
var keyCode = e.keyCode;
if (e.altKey && !e.ctrlKey || e.metaKey ||
// Function keys don't generate text
keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
return false;
}
// The following keys are quite harmless, even in combination with
// CTRL, ALT or SHIFT.
switch (keyCode) {
case KeyCode.ALT:
case KeyCode.CAPS_LOCK:
case KeyCode.CONTEXT_MENU:
case KeyCode.CTRL:
case KeyCode.DOWN:
case KeyCode.END:
case KeyCode.ESC:
case KeyCode.HOME:
case KeyCode.INSERT:
case KeyCode.LEFT:
case KeyCode.MAC_FF_META:
case KeyCode.META:
case KeyCode.NUMLOCK:
case KeyCode.NUM_CENTER:
case KeyCode.PAGE_DOWN:
case KeyCode.PAGE_UP:
case KeyCode.PAUSE:
case KeyCode.PRINT_SCREEN:
case KeyCode.RIGHT:
case KeyCode.SHIFT:
case KeyCode.UP:
case KeyCode.WIN_KEY:
case KeyCode.WIN_KEY_RIGHT:
return false;
default:
return true;
}
},
/**
* whether character is entered.
*/
isCharacterKey: function isCharacterKey(keyCode) {
if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
return true;
}
if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
return true;
}
if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
return true;
}
// Safari sends zero key code for non-latin characters.
if (window.navigator.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
return true;
}
switch (keyCode) {
case KeyCode.SPACE:
case KeyCode.QUESTION_MARK:
case KeyCode.NUM_PLUS:
case KeyCode.NUM_MINUS:
case KeyCode.NUM_PERIOD:
case KeyCode.NUM_DIVISION:
case KeyCode.SEMICOLON:
case KeyCode.DASH:
case KeyCode.EQUALS:
case KeyCode.COMMA:
case KeyCode.PERIOD:
case KeyCode.SLASH:
case KeyCode.APOSTROPHE:
case KeyCode.SINGLE_QUOTE:
case KeyCode.OPEN_SQUARE_BRACKET:
case KeyCode.BACKSLASH:
case KeyCode.CLOSE_SQUARE_BRACKET:
return true;
default:
return false;
}
}
};
export default KeyCode;

9
node_modules/rc-util/es/Portal.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import type * as React from 'react';
export type PortalRef = {};
export interface PortalProps {
didUpdate?: (prevProps: PortalProps) => void;
getContainer: () => HTMLElement;
children?: React.ReactNode;
}
declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<PortalRef>>;
export default Portal;

44
node_modules/rc-util/es/Portal.js generated vendored Normal file
View File

@@ -0,0 +1,44 @@
import { useRef, useEffect, forwardRef, useImperativeHandle } from 'react';
import ReactDOM from 'react-dom';
import canUseDom from "./Dom/canUseDom";
var Portal = /*#__PURE__*/forwardRef(function (props, ref) {
var didUpdate = props.didUpdate,
getContainer = props.getContainer,
children = props.children;
var parentRef = useRef();
var containerRef = useRef();
// Ref return nothing, only for wrapper check exist
useImperativeHandle(ref, function () {
return {};
});
// Create container in client side with sync to avoid useEffect not get ref
var initRef = useRef(false);
if (!initRef.current && canUseDom()) {
containerRef.current = getContainer();
parentRef.current = containerRef.current.parentNode;
initRef.current = true;
}
// [Legacy] Used by `rc-trigger`
useEffect(function () {
didUpdate === null || didUpdate === void 0 || didUpdate(props);
});
useEffect(function () {
// Restore container to original place
// React 18 StrictMode will unmount first and mount back for effect test:
// https://reactjs.org/blog/2022/03/29/react-v18.html#new-strict-mode-behaviors
if (containerRef.current.parentNode === null && parentRef.current !== null) {
parentRef.current.appendChild(containerRef.current);
}
return function () {
var _containerRef$current;
// [Legacy] This should not be handle by Portal but parent PortalWrapper instead.
// Since some component use `Portal` directly, we have to keep the logic here.
(_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 || (_containerRef$current = _containerRef$current.parentNode) === null || _containerRef$current === void 0 || _containerRef$current.removeChild(containerRef.current);
};
}, []);
return containerRef.current ? /*#__PURE__*/ReactDOM.createPortal(children, containerRef.current) : null;
});
export default Portal;

51
node_modules/rc-util/es/PortalWrapper.d.ts generated vendored Normal file
View File

@@ -0,0 +1,51 @@
import * as React from 'react';
import { PortalRef } from './Portal';
import ScrollLocker from './Dom/scrollLocker';
/** @private Test usage only */
export declare function getOpenCount(): number;
export type GetContainer = string | HTMLElement | (() => HTMLElement);
export interface PortalWrapperProps {
visible?: boolean;
getContainer?: GetContainer;
wrapperClassName?: string;
forceRender?: boolean;
children: (info: {
getOpenCount: () => number;
getContainer: () => HTMLElement;
switchScrollingEffect: () => void;
scrollLocker: ScrollLocker;
ref?: (c: any) => void;
}) => React.ReactNode;
}
declare class PortalWrapper extends React.Component<PortalWrapperProps> {
container?: HTMLElement;
componentRef: React.RefObject<PortalRef>;
rafId?: number;
scrollLocker: ScrollLocker;
constructor(props: PortalWrapperProps);
renderComponent?: (info: {
afterClose: Function;
onClose: Function;
visible: boolean;
}) => void;
componentDidMount(): void;
componentDidUpdate(prevProps: PortalWrapperProps): void;
updateScrollLocker: (prevProps?: Partial<PortalWrapperProps>) => void;
updateOpenCount: (prevProps?: Partial<PortalWrapperProps>) => void;
componentWillUnmount(): void;
attachToParent: (force?: boolean) => boolean;
getContainer: () => HTMLElement;
setWrapperClassName: () => void;
removeCurrentContainer: () => void;
/**
* Enhance ./switchScrollingEffect
* 1. Simulate document body scroll bar with
* 2. Record body has overflow style and recover when all of PortalWrapper invisible
* 3. Disable body scroll when PortalWrapper has open
*
* @memberof PortalWrapper
*/
switchScrollingEffect: () => void;
render(): any;
}
export default PortalWrapper;

213
node_modules/rc-util/es/PortalWrapper.js generated vendored Normal file
View File

@@ -0,0 +1,213 @@
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _typeof from "@babel/runtime/helpers/esm/typeof";
/* eslint-disable no-underscore-dangle,react/require-default-props */
import * as React from 'react';
import raf from "./raf";
import Portal from "./Portal";
import canUseDom from "./Dom/canUseDom";
import switchScrollingEffect from "./switchScrollingEffect";
import setStyle from "./setStyle";
import ScrollLocker from "./Dom/scrollLocker";
var openCount = 0;
var supportDom = canUseDom();
/** @private Test usage only */
export function getOpenCount() {
return process.env.NODE_ENV === 'test' ? openCount : 0;
}
// https://github.com/ant-design/ant-design/issues/19340
// https://github.com/ant-design/ant-design/issues/19332
var cacheOverflow = {};
var getParent = function getParent(getContainer) {
if (!supportDom) {
return null;
}
if (getContainer) {
if (typeof getContainer === 'string') {
return document.querySelectorAll(getContainer)[0];
}
if (typeof getContainer === 'function') {
return getContainer();
}
if (_typeof(getContainer) === 'object' && getContainer instanceof window.HTMLElement) {
return getContainer;
}
}
return document.body;
};
var PortalWrapper = /*#__PURE__*/function (_React$Component) {
_inherits(PortalWrapper, _React$Component);
var _super = _createSuper(PortalWrapper);
function PortalWrapper(props) {
var _this;
_classCallCheck(this, PortalWrapper);
_this = _super.call(this, props);
_defineProperty(_assertThisInitialized(_this), "container", void 0);
_defineProperty(_assertThisInitialized(_this), "componentRef", /*#__PURE__*/React.createRef());
_defineProperty(_assertThisInitialized(_this), "rafId", void 0);
_defineProperty(_assertThisInitialized(_this), "scrollLocker", void 0);
_defineProperty(_assertThisInitialized(_this), "renderComponent", void 0);
_defineProperty(_assertThisInitialized(_this), "updateScrollLocker", function (prevProps) {
var _ref = prevProps || {},
prevVisible = _ref.visible;
var _this$props = _this.props,
getContainer = _this$props.getContainer,
visible = _this$props.visible;
if (visible && visible !== prevVisible && supportDom && getParent(getContainer) !== _this.scrollLocker.getContainer()) {
_this.scrollLocker.reLock({
container: getParent(getContainer)
});
}
});
_defineProperty(_assertThisInitialized(_this), "updateOpenCount", function (prevProps) {
var _ref2 = prevProps || {},
prevVisible = _ref2.visible,
prevGetContainer = _ref2.getContainer;
var _this$props2 = _this.props,
visible = _this$props2.visible,
getContainer = _this$props2.getContainer;
// Update count
if (visible !== prevVisible && supportDom && getParent(getContainer) === document.body) {
if (visible && !prevVisible) {
openCount += 1;
} else if (prevProps) {
openCount -= 1;
}
}
// Clean up container if needed
var getContainerIsFunc = typeof getContainer === 'function' && typeof prevGetContainer === 'function';
if (getContainerIsFunc ? getContainer.toString() !== prevGetContainer.toString() : getContainer !== prevGetContainer) {
_this.removeCurrentContainer();
}
});
_defineProperty(_assertThisInitialized(_this), "attachToParent", function () {
var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
if (force || _this.container && !_this.container.parentNode) {
var parent = getParent(_this.props.getContainer);
if (parent) {
parent.appendChild(_this.container);
return true;
}
return false;
}
return true;
});
_defineProperty(_assertThisInitialized(_this), "getContainer", function () {
if (!supportDom) {
return null;
}
if (!_this.container) {
_this.container = document.createElement('div');
_this.attachToParent(true);
}
_this.setWrapperClassName();
return _this.container;
});
_defineProperty(_assertThisInitialized(_this), "setWrapperClassName", function () {
var wrapperClassName = _this.props.wrapperClassName;
if (_this.container && wrapperClassName && wrapperClassName !== _this.container.className) {
_this.container.className = wrapperClassName;
}
});
_defineProperty(_assertThisInitialized(_this), "removeCurrentContainer", function () {
var _this$container;
// Portal will remove from `parentNode`.
// Let's handle this again to avoid refactor issue.
(_this$container = _this.container) === null || _this$container === void 0 || (_this$container = _this$container.parentNode) === null || _this$container === void 0 || _this$container.removeChild(_this.container);
});
/**
* Enhance ./switchScrollingEffect
* 1. Simulate document body scroll bar with
* 2. Record body has overflow style and recover when all of PortalWrapper invisible
* 3. Disable body scroll when PortalWrapper has open
*
* @memberof PortalWrapper
*/
_defineProperty(_assertThisInitialized(_this), "switchScrollingEffect", function () {
if (openCount === 1 && !Object.keys(cacheOverflow).length) {
switchScrollingEffect();
// Must be set after switchScrollingEffect
cacheOverflow = setStyle({
overflow: 'hidden',
overflowX: 'hidden',
overflowY: 'hidden'
});
} else if (!openCount) {
setStyle(cacheOverflow);
cacheOverflow = {};
switchScrollingEffect(true);
}
});
_this.scrollLocker = new ScrollLocker({
container: getParent(props.getContainer)
});
return _this;
}
_createClass(PortalWrapper, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
this.updateOpenCount();
if (!this.attachToParent()) {
this.rafId = raf(function () {
_this2.forceUpdate();
});
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
this.updateOpenCount(prevProps);
this.updateScrollLocker(prevProps);
this.setWrapperClassName();
this.attachToParent();
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
var _this$props3 = this.props,
visible = _this$props3.visible,
getContainer = _this$props3.getContainer;
if (supportDom && getParent(getContainer) === document.body) {
// 离开时不会 render 导到离开时数值不变,改用 func 。。
openCount = visible && openCount ? openCount - 1 : openCount;
}
this.removeCurrentContainer();
raf.cancel(this.rafId);
}
}, {
key: "render",
value: function render() {
var _this$props4 = this.props,
children = _this$props4.children,
forceRender = _this$props4.forceRender,
visible = _this$props4.visible;
var portal = null;
var childProps = {
getOpenCount: function getOpenCount() {
return openCount;
},
getContainer: this.getContainer,
switchScrollingEffect: this.switchScrollingEffect,
scrollLocker: this.scrollLocker
};
if (forceRender || visible || this.componentRef.current) {
portal = /*#__PURE__*/React.createElement(Portal, {
getContainer: this.getContainer,
ref: this.componentRef
}, children(childProps));
}
return portal;
}
}]);
return PortalWrapper;
}(React.Component);
export default PortalWrapper;

48
node_modules/rc-util/es/PureRenderMixin.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ReactComponentWithPureRenderMixin
*/
import isEqual from "./isEqual";
function shallowCompare(instance, nextProps, nextState) {
return !isEqual(instance.props, nextProps, true) || !isEqual(instance.state, nextState, true);
}
/**
* If your React component's render function is "pure", e.g. it will render the
* same result given the same props and state, provide this mixin for a
* considerable performance boost.
*
* Most React components have pure render functions.
*
* Example:
*
* var ReactComponentWithPureRenderMixin =
* require('ReactComponentWithPureRenderMixin');
* React.createClass({
* mixins: [ReactComponentWithPureRenderMixin],
*
* render: function() {
* return <div className={this.props.className}>foo</div>;
* }
* });
*
* Note: This only checks shallow equality for props and state. If these contain
* complex data structures this mixin may have false-negatives for deeper
* differences. Only mixin to components which have simple props and state, or
* use `forceUpdate()` when you know deep data structures have changed.
*
* See https://facebook.github.io/react/docs/pure-render-mixin.html
*/
var ReactComponentWithPureRenderMixin = {
shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) {
return shallowCompare(this, nextProps, nextState);
}
};
export default ReactComponentWithPureRenderMixin;

4
node_modules/rc-util/es/React/isFragment.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
/**
* Compatible with React 18 or 19 to check if node is a Fragment.
*/
export default function isFragment(object: any): boolean;

18
node_modules/rc-util/es/React/isFragment.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
import _typeof from "@babel/runtime/helpers/esm/typeof";
var REACT_ELEMENT_TYPE_18 = Symbol.for('react.element');
var REACT_ELEMENT_TYPE_19 = Symbol.for('react.transitional.element');
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
/**
* Compatible with React 18 or 19 to check if node is a Fragment.
*/
export default function isFragment(object) {
return (
// Base object type
object && _typeof(object) === 'object' && (
// React Element type
object.$$typeof === REACT_ELEMENT_TYPE_18 || object.$$typeof === REACT_ELEMENT_TYPE_19) &&
// React Fragment type
object.type === REACT_FRAGMENT_TYPE
);
}

13
node_modules/rc-util/es/React/render.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import type * as React from 'react';
import type { Root } from 'react-dom/client';
declare const MARK = "__rc_react_root__";
type ContainerType = (Element | DocumentFragment) & {
[MARK]?: Root;
};
/** @private Test usage. Not work in prod */
export declare function _r(node: React.ReactElement, container: ContainerType): void;
export declare function render(node: React.ReactElement, container: ContainerType): void;
/** @private Test usage. Not work in prod */
export declare function _u(container: ContainerType): void;
export declare function unmount(container: ContainerType): Promise<void>;
export {};

109
node_modules/rc-util/es/React/render.js generated vendored Normal file
View File

@@ -0,0 +1,109 @@
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
import _typeof from "@babel/runtime/helpers/esm/typeof";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import * as ReactDOM from 'react-dom';
// Let compiler not to search module usage
var fullClone = _objectSpread({}, ReactDOM);
var version = fullClone.version,
reactRender = fullClone.render,
unmountComponentAtNode = fullClone.unmountComponentAtNode;
var createRoot;
try {
var mainVersion = Number((version || '').split('.')[0]);
if (mainVersion >= 18) {
createRoot = fullClone.createRoot;
}
} catch (e) {
// Do nothing;
}
function toggleWarning(skip) {
var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = fullClone.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && _typeof(__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === 'object') {
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
}
}
var MARK = '__rc_react_root__';
// ========================== Render ==========================
function modernRender(node, container) {
toggleWarning(true);
var root = container[MARK] || createRoot(container);
toggleWarning(false);
root.render(node);
container[MARK] = root;
}
function legacyRender(node, container) {
reactRender === null || reactRender === void 0 || reactRender(node, container);
}
/** @private Test usage. Not work in prod */
export function _r(node, container) {
if (process.env.NODE_ENV !== 'production') {
return legacyRender(node, container);
}
}
export function render(node, container) {
if (createRoot) {
modernRender(node, container);
return;
}
legacyRender(node, container);
}
// ========================= Unmount ==========================
function modernUnmount(_x) {
return _modernUnmount.apply(this, arguments);
}
function _modernUnmount() {
_modernUnmount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(container) {
return _regeneratorRuntime().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", Promise.resolve().then(function () {
var _container$MARK;
(_container$MARK = container[MARK]) === null || _container$MARK === void 0 || _container$MARK.unmount();
delete container[MARK];
}));
case 1:
case "end":
return _context.stop();
}
}, _callee);
}));
return _modernUnmount.apply(this, arguments);
}
function legacyUnmount(container) {
unmountComponentAtNode(container);
}
/** @private Test usage. Not work in prod */
export function _u(container) {
if (process.env.NODE_ENV !== 'production') {
return legacyUnmount(container);
}
}
export function unmount(_x2) {
return _unmount.apply(this, arguments);
}
function _unmount() {
_unmount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(container) {
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (!(createRoot !== undefined)) {
_context2.next = 2;
break;
}
return _context2.abrupt("return", modernUnmount(container));
case 2:
legacyUnmount(container);
case 3:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return _unmount.apply(this, arguments);
}

2
node_modules/rc-util/es/composeProps.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
declare function composeProps<T extends Record<string, any>>(originProps: T, patchProps: Partial<T>, isAll?: boolean): T;
export default composeProps;

19
node_modules/rc-util/es/composeProps.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
function composeProps(originProps, patchProps, isAll) {
var composedProps = _objectSpread(_objectSpread({}, originProps), isAll ? patchProps : {});
Object.keys(patchProps).forEach(function (key) {
var func = patchProps[key];
if (typeof func === 'function') {
composedProps[key] = function () {
var _originProps$key;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
func.apply(void 0, args);
return (_originProps$key = originProps[key]) === null || _originProps$key === void 0 ? void 0 : _originProps$key.call.apply(_originProps$key, [originProps].concat(args));
};
}
});
return composedProps;
}
export default composeProps;

21
node_modules/rc-util/es/createChainedFunction.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
/**
* Safe chained function
*
* Will only create a new function if needed,
* otherwise will pass back existing functions or null.
*
* @returns {function|null}
*/
export default function createChainedFunction() {
var args = [].slice.call(arguments, 0);
if (args.length === 1) {
return args[0];
}
return function chainedFunction() {
for (var i = 0; i < args.length; i++) {
if (args[i] && args[i].apply) {
args[i].apply(this, arguments);
}
}
};
}

65
node_modules/rc-util/es/debug/diff.js generated vendored Normal file
View File

@@ -0,0 +1,65 @@
import _typeof from "@babel/runtime/helpers/esm/typeof";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
/* eslint no-proto: 0 */
function createArray() {
var arr = [];
arr.__proto__ = new Array();
arr.__proto__.format = function toString() {
return this.map(function (obj) {
return _objectSpread(_objectSpread({}, obj), {}, {
path: obj.path.join(' > ')
});
});
};
arr.__proto__.toString = function toString() {
return JSON.stringify(this.format(), null, 2);
};
return arr;
}
export default function diff(obj1, obj2) {
var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
var path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
var diffList = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : createArray();
if (depth <= 0) return diffList;
var keys = new Set([].concat(_toConsumableArray(Object.keys(obj1)), _toConsumableArray(Object.keys(obj2))));
keys.forEach(function (key) {
var value1 = obj1[key];
var value2 = obj2[key];
// Same value
if (value1 === value2) return;
var type1 = _typeof(value1);
var type2 = _typeof(value2);
// Diff type
if (type1 !== type2) {
diffList.push({
path: path.concat(key),
value1: value1,
value2: value2
});
return;
}
// NaN
if (Number.isNaN(value1) && Number.isNaN(value2)) {
return;
}
// Object & Array
if (type1 === 'object' && value1 !== null && value2 !== null) {
diff(value1, value2, depth - 1, path.concat(key), diffList);
return;
}
// Rest
diffList.push({
path: path.concat(key),
value1: value1,
value2: value2
});
});
return diffList;
}

5
node_modules/rc-util/es/deprecated.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export default function deprecated(props, instead, component) {
if (typeof window !== 'undefined' && window.console && window.console.error) {
window.console.error("Warning: ".concat(props, " is deprecated at [ ").concat(component, " ], ") + "use [ ".concat(instead, " ] instead of it."));
}
}

77
node_modules/rc-util/es/getContainerRenderMixin.js generated vendored Normal file
View File

@@ -0,0 +1,77 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import ReactDOM from 'react-dom';
function defaultGetContainer() {
var container = document.createElement('div');
document.body.appendChild(container);
return container;
}
export default function getContainerRenderMixin(config) {
var _config$autoMount = config.autoMount,
autoMount = _config$autoMount === void 0 ? true : _config$autoMount,
_config$autoDestroy = config.autoDestroy,
autoDestroy = _config$autoDestroy === void 0 ? true : _config$autoDestroy,
isVisible = config.isVisible,
isForceRender = config.isForceRender,
getComponent = config.getComponent,
_config$getContainer = config.getContainer,
getContainer = _config$getContainer === void 0 ? defaultGetContainer : _config$getContainer;
var mixin;
function _renderComponent(instance, componentArg, ready) {
if (!isVisible || instance._component || isVisible(instance) || isForceRender && isForceRender(instance)) {
if (!instance._container) {
instance._container = getContainer(instance);
}
var component;
if (instance.getComponent) {
component = instance.getComponent(componentArg);
} else {
component = getComponent(instance, componentArg);
}
ReactDOM.unstable_renderSubtreeIntoContainer(instance, component, instance._container, function callback() {
instance._component = this;
if (ready) {
ready.call(this);
}
});
}
}
if (autoMount) {
mixin = _objectSpread(_objectSpread({}, mixin), {}, {
componentDidMount: function componentDidMount() {
_renderComponent(this);
},
componentDidUpdate: function componentDidUpdate() {
_renderComponent(this);
}
});
}
if (!autoMount || !autoDestroy) {
mixin = _objectSpread(_objectSpread({}, mixin), {}, {
renderComponent: function renderComponent(componentArg, ready) {
_renderComponent(this, componentArg, ready);
}
});
}
function _removeContainer(instance) {
if (instance._container) {
var container = instance._container;
ReactDOM.unmountComponentAtNode(container);
container.parentNode.removeChild(container);
instance._container = null;
}
}
if (autoDestroy) {
mixin = _objectSpread(_objectSpread({}, mixin), {}, {
componentWillUnmount: function componentWillUnmount() {
_removeContainer(this);
}
});
} else {
mixin = _objectSpread(_objectSpread({}, mixin), {}, {
removeContainer: function removeContainer() {
_removeContainer(this);
}
});
}
return mixin;
}

7
node_modules/rc-util/es/getScrollBarSize.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
type ScrollBarSize = {
width: number;
height: number;
};
export default function getScrollBarSize(fresh?: boolean): number;
export declare function getTargetScrollBarSize(target: HTMLElement): ScrollBarSize;
export {};

76
node_modules/rc-util/es/getScrollBarSize.js generated vendored Normal file
View File

@@ -0,0 +1,76 @@
/* eslint-disable no-param-reassign */
import { removeCSS, updateCSS } from "./Dom/dynamicCSS";
var cached;
function measureScrollbarSize(ele) {
var randomId = "rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7));
var measureEle = document.createElement('div');
measureEle.id = randomId;
// Create Style
var measureStyle = measureEle.style;
measureStyle.position = 'absolute';
measureStyle.left = '0';
measureStyle.top = '0';
measureStyle.width = '100px';
measureStyle.height = '100px';
measureStyle.overflow = 'scroll';
// Clone Style if needed
var fallbackWidth;
var fallbackHeight;
if (ele) {
var targetStyle = getComputedStyle(ele);
measureStyle.scrollbarColor = targetStyle.scrollbarColor;
measureStyle.scrollbarWidth = targetStyle.scrollbarWidth;
// Set Webkit style
var webkitScrollbarStyle = getComputedStyle(ele, '::-webkit-scrollbar');
var width = parseInt(webkitScrollbarStyle.width, 10);
var height = parseInt(webkitScrollbarStyle.height, 10);
// Try wrap to handle CSP case
try {
var widthStyle = width ? "width: ".concat(webkitScrollbarStyle.width, ";") : '';
var heightStyle = height ? "height: ".concat(webkitScrollbarStyle.height, ";") : '';
updateCSS("\n#".concat(randomId, "::-webkit-scrollbar {\n").concat(widthStyle, "\n").concat(heightStyle, "\n}"), randomId);
} catch (e) {
// Can't wrap, just log error
console.error(e);
// Get from style directly
fallbackWidth = width;
fallbackHeight = height;
}
}
document.body.appendChild(measureEle);
// Measure. Get fallback style if provided
var scrollWidth = ele && fallbackWidth && !isNaN(fallbackWidth) ? fallbackWidth : measureEle.offsetWidth - measureEle.clientWidth;
var scrollHeight = ele && fallbackHeight && !isNaN(fallbackHeight) ? fallbackHeight : measureEle.offsetHeight - measureEle.clientHeight;
// Clean up
document.body.removeChild(measureEle);
removeCSS(randomId);
return {
width: scrollWidth,
height: scrollHeight
};
}
export default function getScrollBarSize(fresh) {
if (typeof document === 'undefined') {
return 0;
}
if (fresh || cached === undefined) {
cached = measureScrollbarSize();
}
return cached.width;
}
export function getTargetScrollBarSize(target) {
if (typeof document === 'undefined' || !target || !(target instanceof Element)) {
return {
width: 0,
height: 0
};
}
return measureScrollbarSize(target);
}

4
node_modules/rc-util/es/guid.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
var seed = 0;
export default function guid() {
return "".concat(Date.now(), "_").concat(seed++);
}

2
node_modules/rc-util/es/hooks/useEffect.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
/** As `React.useEffect` but pass origin value in callback and not need care deps length change. */
export default function useEffect(callback: (prevDeps: any[]) => void, deps: any[]): void;

14
node_modules/rc-util/es/hooks/useEffect.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import * as React from 'react';
/** As `React.useEffect` but pass origin value in callback and not need care deps length change. */
export default function useEffect(callback, deps) {
var prevRef = React.useRef(deps);
React.useEffect(function () {
if (deps.length !== prevRef.current.length || deps.some(function (dep, index) {
return dep !== prevRef.current[index];
})) {
callback(prevRef.current);
}
prevRef.current = deps;
});
}

1
node_modules/rc-util/es/hooks/useEvent.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default function useEvent<T extends Function>(callback: T): T;

13
node_modules/rc-util/es/hooks/useEvent.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import * as React from 'react';
export default function useEvent(callback) {
var fnRef = React.useRef();
fnRef.current = callback;
var memoFn = React.useCallback(function () {
var _fnRef$current;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
}, []);
return memoFn;
}

4
node_modules/rc-util/es/hooks/useId.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
/** @private Note only worked in develop env. Not work in production. */
export declare function resetUuid(): void;
declare const _default: (id?: string) => string;
export default _default;

59
node_modules/rc-util/es/hooks/useId.js generated vendored Normal file
View File

@@ -0,0 +1,59 @@
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import * as React from 'react';
function getUseId() {
// We need fully clone React function here to avoid webpack warning React 17 do not export `useId`
var fullClone = _objectSpread({}, React);
return fullClone.useId;
}
var uuid = 0;
/** @private Note only worked in develop env. Not work in production. */
export function resetUuid() {
if (process.env.NODE_ENV !== 'production') {
uuid = 0;
}
}
var useOriginId = getUseId();
export default useOriginId ?
// Use React `useId`
function useId(id) {
var reactId = useOriginId();
// Developer passed id is single source of truth
if (id) {
return id;
}
// Test env always return mock id
if (process.env.NODE_ENV === 'test') {
return 'test-id';
}
return reactId;
} :
// Use compatible of `useId`
function useCompatId(id) {
// Inner id for accessibility usage. Only work in client side
var _React$useState = React.useState('ssr-id'),
_React$useState2 = _slicedToArray(_React$useState, 2),
innerId = _React$useState2[0],
setInnerId = _React$useState2[1];
React.useEffect(function () {
var nextId = uuid;
uuid += 1;
setInnerId("rc_unique_".concat(nextId));
}, []);
// Developer passed id is single source of truth
if (id) {
return id;
}
// Test env always return mock id
if (process.env.NODE_ENV === 'test') {
return 'test-id';
}
// Return react native id or inner id
return innerId;
};

4
node_modules/rc-util/es/hooks/useLayoutEffect.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import * as React from 'react';
declare const useLayoutEffect: (callback: (mount: boolean) => void | VoidFunction, deps?: React.DependencyList) => void;
export declare const useLayoutUpdateEffect: typeof React.useEffect;
export default useLayoutEffect;

29
node_modules/rc-util/es/hooks/useLayoutEffect.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
import * as React from 'react';
import canUseDom from "../Dom/canUseDom";
/**
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
*/
var useInternalLayoutEffect = process.env.NODE_ENV !== 'test' && canUseDom() ? React.useLayoutEffect : React.useEffect;
var useLayoutEffect = function useLayoutEffect(callback, deps) {
var firstMountRef = React.useRef(true);
useInternalLayoutEffect(function () {
return callback(firstMountRef.current);
}, deps);
// We tell react that first mount has passed
useInternalLayoutEffect(function () {
firstMountRef.current = false;
return function () {
firstMountRef.current = true;
};
}, []);
};
export var useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
useLayoutEffect(function (firstMount) {
if (!firstMount) {
return callback();
}
}, deps);
};
export default useLayoutEffect;

1
node_modules/rc-util/es/hooks/useMemo.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default function useMemo<Value, Condition = any[]>(getValue: () => Value, condition: Condition, shouldUpdate: (prev: Condition, next: Condition) => boolean): Value;

9
node_modules/rc-util/es/hooks/useMemo.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import * as React from 'react';
export default function useMemo(getValue, condition, shouldUpdate) {
var cacheRef = React.useRef({});
if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
cacheRef.current.value = getValue();
cacheRef.current.condition = condition;
}
return cacheRef.current.value;
}

12
node_modules/rc-util/es/hooks/useMergedState.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
type Updater<T> = (updater: T | ((origin: T) => T), ignoreDestroy?: boolean) => void;
/**
* Similar to `useState` but will use props value if provided.
* Note that internal use rc-util `useState` hook.
*/
export default function useMergedState<T, R = T>(defaultStateValue: T | (() => T), option?: {
defaultValue?: T | (() => T);
value?: T;
onChange?: (value: T, prevValue: T) => void;
postState?: (value: T) => T;
}): [R, Updater<T>];
export {};

63
node_modules/rc-util/es/hooks/useMergedState.js generated vendored Normal file
View File

@@ -0,0 +1,63 @@
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import useEvent from "./useEvent";
import { useLayoutUpdateEffect } from "./useLayoutEffect";
import useState from "./useState";
/** We only think `undefined` is empty */
function hasValue(value) {
return value !== undefined;
}
/**
* Similar to `useState` but will use props value if provided.
* Note that internal use rc-util `useState` hook.
*/
export default function useMergedState(defaultStateValue, option) {
var _ref = option || {},
defaultValue = _ref.defaultValue,
value = _ref.value,
onChange = _ref.onChange,
postState = _ref.postState;
// ======================= Init =======================
var _useState = useState(function () {
if (hasValue(value)) {
return value;
} else if (hasValue(defaultValue)) {
return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
} else {
return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
}
}),
_useState2 = _slicedToArray(_useState, 2),
innerValue = _useState2[0],
setInnerValue = _useState2[1];
var mergedValue = value !== undefined ? value : innerValue;
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
// ====================== Change ======================
var onChangeFn = useEvent(onChange);
var _useState3 = useState([mergedValue]),
_useState4 = _slicedToArray(_useState3, 2),
prevValue = _useState4[0],
setPrevValue = _useState4[1];
useLayoutUpdateEffect(function () {
var prev = prevValue[0];
if (innerValue !== prev) {
onChangeFn(innerValue, prev);
}
}, [prevValue]);
// Sync value back to `undefined` when it from control to un-control
useLayoutUpdateEffect(function () {
if (!hasValue(value)) {
setInnerValue(value);
}
}, [value]);
// ====================== Update ======================
var triggerChange = useEvent(function (updater, ignoreDestroy) {
setInnerValue(updater, ignoreDestroy);
setPrevValue([mergedValue], ignoreDestroy);
});
return [postMergedValue, triggerChange];
}

6
node_modules/rc-util/es/hooks/useMobile.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
/**
* Hook to detect if the user is on a mobile device
* Notice that this hook will only detect the device type in effect, so it will always be false in server side
*/
declare const useMobile: () => boolean;
export default useMobile;

20
node_modules/rc-util/es/hooks/useMobile.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import { useState } from 'react';
import isMobile from "../isMobile";
import useLayoutEffect from "./useLayoutEffect";
/**
* Hook to detect if the user is on a mobile device
* Notice that this hook will only detect the device type in effect, so it will always be false in server side
*/
var useMobile = function useMobile() {
var _useState = useState(false),
_useState2 = _slicedToArray(_useState, 2),
mobile = _useState2[0],
setMobile = _useState2[1];
useLayoutEffect(function () {
setMobile(isMobile());
}, []);
return mobile;
};
export default useMobile;

14
node_modules/rc-util/es/hooks/useState.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
type Updater<T> = T | ((prevValue: T) => T);
export type SetState<T> = (nextValue: Updater<T>,
/**
* Will not update state when destroyed.
* Developer should make sure this is safe to ignore.
*/
ignoreDestroy?: boolean) => void;
/**
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
* We do not make this auto is to avoid real memory leak.
* Developer should confirm it's safe to ignore themselves.
*/
export default function useSafeState<T>(defaultValue?: T | (() => T)): [T, SetState<T>];
export {};

27
node_modules/rc-util/es/hooks/useState.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import * as React from 'react';
/**
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
* We do not make this auto is to avoid real memory leak.
* Developer should confirm it's safe to ignore themselves.
*/
export default function useSafeState(defaultValue) {
var destroyRef = React.useRef(false);
var _React$useState = React.useState(defaultValue),
_React$useState2 = _slicedToArray(_React$useState, 2),
value = _React$useState2[0],
setValue = _React$useState2[1];
React.useEffect(function () {
destroyRef.current = false;
return function () {
destroyRef.current = true;
};
}, []);
function safeSetState(updater, ignoreDestroy) {
if (ignoreDestroy && destroyRef.current) {
return;
}
setValue(updater);
}
return [value, safeSetState];
}

9
node_modules/rc-util/es/hooks/useSyncState.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
type Updater<T> = T | ((prevValue: T) => T);
export type SetState<T> = (nextValue: Updater<T>) => void;
/**
* Same as React.useState but will always get latest state.
* This is useful when React merge multiple state updates into one.
* e.g. onTransitionEnd trigger multiple event at once will be merged state update in React.
*/
export default function useSyncState<T>(defaultValue?: T): [get: () => T, set: SetState<T>];
export {};

24
node_modules/rc-util/es/hooks/useSyncState.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
import * as React from 'react';
import useEvent from "./useEvent";
/**
* Same as React.useState but will always get latest state.
* This is useful when React merge multiple state updates into one.
* e.g. onTransitionEnd trigger multiple event at once will be merged state update in React.
*/
export default function useSyncState(defaultValue) {
var _React$useReducer = React.useReducer(function (x) {
return x + 1;
}, 0),
_React$useReducer2 = _slicedToArray(_React$useReducer, 2),
forceUpdate = _React$useReducer2[1];
var currentValueRef = React.useRef(defaultValue);
var getValue = useEvent(function () {
return currentValueRef.current;
});
var setValue = useEvent(function (updater) {
currentValueRef.current = typeof updater === 'function' ? updater(currentValueRef.current) : updater;
forceUpdate();
});
return [getValue, setValue];
}

6
node_modules/rc-util/es/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export { default as useEvent } from './hooks/useEvent';
export { default as useMergedState } from './hooks/useMergedState';
export { supportNodeRef, supportRef, useComposeRef } from './ref';
export { default as get } from './utils/get';
export { default as set } from './utils/set';
export { default as warning } from './warning';

6
node_modules/rc-util/es/index.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export { default as useEvent } from "./hooks/useEvent";
export { default as useMergedState } from "./hooks/useMergedState";
export { supportNodeRef, supportRef, useComposeRef } from "./ref";
export { default as get } from "./utils/get";
export { default as set } from "./utils/set";
export { default as warning } from "./warning";

9
node_modules/rc-util/es/isEqual.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
/**
* Deeply compares two object literals.
* @param obj1 object 1
* @param obj2 object 2
* @param shallow shallow compare
* @returns
*/
declare function isEqual(obj1: any, obj2: any, shallow?: boolean): boolean;
export default isEqual;

55
node_modules/rc-util/es/isEqual.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
import _typeof from "@babel/runtime/helpers/esm/typeof";
import warning from "./warning";
/**
* Deeply compares two object literals.
* @param obj1 object 1
* @param obj2 object 2
* @param shallow shallow compare
* @returns
*/
function isEqual(obj1, obj2) {
var shallow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
// https://github.com/mapbox/mapbox-gl-js/pull/5979/files#diff-fde7145050c47cc3a306856efd5f9c3016e86e859de9afbd02c879be5067e58f
var refSet = new Set();
function deepEqual(a, b) {
var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
var circular = refSet.has(a);
warning(!circular, 'Warning: There may be circular references');
if (circular) {
return false;
}
if (a === b) {
return true;
}
if (shallow && level > 1) {
return false;
}
refSet.add(a);
var newLevel = level + 1;
if (Array.isArray(a)) {
if (!Array.isArray(b) || a.length !== b.length) {
return false;
}
for (var i = 0; i < a.length; i++) {
if (!deepEqual(a[i], b[i], newLevel)) {
return false;
}
}
return true;
}
if (a && b && _typeof(a) === 'object' && _typeof(b) === 'object') {
var keys = Object.keys(a);
if (keys.length !== Object.keys(b).length) {
return false;
}
return keys.every(function (key) {
return deepEqual(a[key], b[key], newLevel);
});
}
// other
return false;
}
return deepEqual(obj1, obj2);
}
export default isEqual;

2
node_modules/rc-util/es/isMobile.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
declare const _default: () => boolean;
export default _default;

7
node_modules/rc-util/es/isMobile.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export default (function () {
if (typeof navigator === 'undefined' || typeof window === 'undefined') {
return false;
}
var agent = navigator.userAgent || navigator.vendor || window.opera;
return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent === null || agent === void 0 ? void 0 : agent.substr(0, 4));
});

1
node_modules/rc-util/es/omit.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default function omit<T extends object, K extends keyof T>(obj: T, fields: K[] | readonly K[]): Omit<T, K>;

9
node_modules/rc-util/es/omit.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
export default function omit(obj, fields) {
var clone = Object.assign({}, obj);
if (Array.isArray(fields)) {
fields.forEach(function (key) {
delete clone[key];
});
}
return clone;
}

11
node_modules/rc-util/es/pickAttrs.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
export interface PickConfig {
aria?: boolean;
data?: boolean;
attr?: boolean;
}
/**
* Picker props from exist props with filter
* @param props Passed props
* @param ariaOnly boolean | { aria?: boolean; data?: boolean; attr?: boolean; } filter config
*/
export default function pickAttrs(props: object, ariaOnly?: boolean | PickConfig): {};

46
node_modules/rc-util/es/pickAttrs.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
var attributes = "accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap";
var eventsName = "onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError";
var propList = "".concat(attributes, " ").concat(eventsName).split(/[\s\n]+/);
/* eslint-enable max-len */
var ariaPrefix = 'aria-';
var dataPrefix = 'data-';
function match(key, prefix) {
return key.indexOf(prefix) === 0;
}
/**
* Picker props from exist props with filter
* @param props Passed props
* @param ariaOnly boolean | { aria?: boolean; data?: boolean; attr?: boolean; } filter config
*/
export default function pickAttrs(props) {
var ariaOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var mergedConfig;
if (ariaOnly === false) {
mergedConfig = {
aria: true,
data: true,
attr: true
};
} else if (ariaOnly === true) {
mergedConfig = {
aria: true
};
} else {
mergedConfig = _objectSpread({}, ariaOnly);
}
var attrs = {};
Object.keys(props).forEach(function (key) {
if (
// Aria
mergedConfig.aria && (key === 'role' || match(key, ariaPrefix)) ||
// Data
mergedConfig.data && match(key, dataPrefix) ||
// Attr
mergedConfig.attr && propList.includes(key)) {
attrs[key] = props[key];
}
});
return attrs;
}

4
node_modules/rc-util/es/proxyObject.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
/**
* Proxy object if environment supported
*/
export default function proxyObject<Obj extends object, ExtendObj extends object>(obj: Obj, extendProps: ExtendObj): Obj & ExtendObj;

19
node_modules/rc-util/es/proxyObject.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
/**
* Proxy object if environment supported
*/
export default function proxyObject(obj, extendProps) {
if (typeof Proxy !== 'undefined' && obj) {
return new Proxy(obj, {
get: function get(target, prop) {
if (extendProps[prop]) {
return extendProps[prop];
}
// Proxy origin property
var originProp = target[prop];
return typeof originProp === 'function' ? originProp.bind(target) : originProp;
}
});
}
return obj;
}

6
node_modules/rc-util/es/raf.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
declare const wrapperRaf: {
(callback: () => void, times?: number): number;
cancel(id: number): void;
ids(): Map<number, number>;
};
export default wrapperRaf;

54
node_modules/rc-util/es/raf.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
var raf = function raf(callback) {
return +setTimeout(callback, 16);
};
var caf = function caf(num) {
return clearTimeout(num);
};
if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
raf = function raf(callback) {
return window.requestAnimationFrame(callback);
};
caf = function caf(handle) {
return window.cancelAnimationFrame(handle);
};
}
var rafUUID = 0;
var rafIds = new Map();
function cleanup(id) {
rafIds.delete(id);
}
var wrapperRaf = function wrapperRaf(callback) {
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
rafUUID += 1;
var id = rafUUID;
function callRef(leftTimes) {
if (leftTimes === 0) {
// Clean up
cleanup(id);
// Trigger
callback();
} else {
// Next raf
var realId = raf(function () {
callRef(leftTimes - 1);
});
// Bind real raf id
rafIds.set(id, realId);
}
}
callRef(times);
return id;
};
wrapperRaf.cancel = function (id) {
var realId = rafIds.get(id);
cleanup(id);
return caf(realId);
};
if (process.env.NODE_ENV !== 'production') {
wrapperRaf.ids = function () {
return rafIds;
};
}
export default wrapperRaf;

19
node_modules/rc-util/es/ref.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import type * as React from 'react';
export declare const fillRef: <T>(ref: React.Ref<T>, node: T) => void;
/**
* Merge refs into one ref function to support ref passing.
*/
export declare const composeRef: <T>(...refs: React.Ref<T>[]) => React.Ref<T>;
export declare const useComposeRef: <T>(...refs: React.Ref<T>[]) => React.Ref<T>;
export declare const supportRef: (nodeOrComponent: any) => boolean;
interface RefAttributes<T> extends React.Attributes {
ref: React.Ref<T>;
}
export declare const supportNodeRef: <T = any>(node: React.ReactNode) => node is React.ReactElement<any, string | React.JSXElementConstructor<any>> & RefAttributes<T>;
/**
* In React 19. `ref` is not a property from node.
* But a property from `props.ref`.
* To check if `props.ref` exist or fallback to `ref`.
*/
export declare const getNodeRef: <T = any>(node: React.ReactNode) => React.Ref<T> | null;
export {};

88
node_modules/rc-util/es/ref.js generated vendored Normal file
View File

@@ -0,0 +1,88 @@
import _typeof from "@babel/runtime/helpers/esm/typeof";
import { isValidElement, version } from 'react';
import { ForwardRef, isMemo } from 'react-is';
import useMemo from "./hooks/useMemo";
import isFragment from "./React/isFragment";
var ReactMajorVersion = Number(version.split('.')[0]);
export var fillRef = function fillRef(ref, node) {
if (typeof ref === 'function') {
ref(node);
} else if (_typeof(ref) === 'object' && ref && 'current' in ref) {
ref.current = node;
}
};
/**
* Merge refs into one ref function to support ref passing.
*/
export var composeRef = function composeRef() {
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
refs[_key] = arguments[_key];
}
var refList = refs.filter(Boolean);
if (refList.length <= 1) {
return refList[0];
}
return function (node) {
refs.forEach(function (ref) {
fillRef(ref, node);
});
};
};
export var useComposeRef = function useComposeRef() {
for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
refs[_key2] = arguments[_key2];
}
return useMemo(function () {
return composeRef.apply(void 0, refs);
}, refs, function (prev, next) {
return prev.length !== next.length || prev.every(function (ref, i) {
return ref !== next[i];
});
});
};
export var supportRef = function supportRef(nodeOrComponent) {
var _type$prototype, _nodeOrComponent$prot;
if (!nodeOrComponent) {
return false;
}
// React 19 no need `forwardRef` anymore. So just pass if is a React element.
if (isReactElement(nodeOrComponent) && ReactMajorVersion >= 19) {
return true;
}
var type = isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
// Function component node
if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render) && type.$$typeof !== ForwardRef) {
return false;
}
// Class component
if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render) && nodeOrComponent.$$typeof !== ForwardRef) {
return false;
}
return true;
};
function isReactElement(node) {
return /*#__PURE__*/isValidElement(node) && !isFragment(node);
}
export var supportNodeRef = function supportNodeRef(node) {
return isReactElement(node) && supportRef(node);
};
/**
* In React 19. `ref` is not a property from node.
* But a property from `props.ref`.
* To check if `props.ref` exist or fallback to `ref`.
*/
export var getNodeRef = function getNodeRef(node) {
if (node && isReactElement(node)) {
var ele = node;
// Source from:
// https://github.com/mui/material-ui/blob/master/packages/mui-utils/src/getReactNodeRef/getReactNodeRef.ts
return ele.props.propertyIsEnumerable('ref') ? ele.props.ref : ele.ref;
}
return null;
};

12
node_modules/rc-util/es/setStyle.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import * as React from 'react';
export interface SetStyleOptions {
element?: HTMLElement;
}
/**
* Easy to set element style, return previous style
* IE browser compatible(IE browser doesn't merge overflow style, need to set it separately)
* https://github.com/ant-design/ant-design/issues/19393
*
*/
declare function setStyle(style: React.CSSProperties, options?: SetStyleOptions): React.CSSProperties;
export default setStyle;

26
node_modules/rc-util/es/setStyle.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
/**
* Easy to set element style, return previous style
* IE browser compatible(IE browser doesn't merge overflow style, need to set it separately)
* https://github.com/ant-design/ant-design/issues/19393
*
*/
function setStyle(style) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (!style) {
return {};
}
var _options$element = options.element,
element = _options$element === void 0 ? document.body : _options$element;
var oldStyle = {};
var styleKeys = Object.keys(style);
// IE browser compatible
styleKeys.forEach(function (key) {
oldStyle[key] = element.style[key];
});
styleKeys.forEach(function (key) {
element.style[key] = style[key];
});
return oldStyle;
}
export default setStyle;

34
node_modules/rc-util/es/switchScrollingEffect.js generated vendored Normal file
View File

@@ -0,0 +1,34 @@
import getScrollBarSize from "./getScrollBarSize";
import setStyle from "./setStyle";
function isBodyOverflowing() {
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
}
var cacheStyle = {};
export default (function (close) {
if (!isBodyOverflowing() && !close) {
return;
}
// https://github.com/ant-design/ant-design/issues/19729
var scrollingEffectClassName = 'ant-scrolling-effect';
var scrollingEffectClassNameReg = new RegExp("".concat(scrollingEffectClassName), 'g');
var bodyClassName = document.body.className;
if (close) {
if (!scrollingEffectClassNameReg.test(bodyClassName)) return;
setStyle(cacheStyle);
cacheStyle = {};
document.body.className = bodyClassName.replace(scrollingEffectClassNameReg, '').trim();
return;
}
var scrollBarSize = getScrollBarSize();
if (scrollBarSize) {
cacheStyle = setStyle({
position: 'relative',
width: "calc(100% - ".concat(scrollBarSize, "px)")
});
if (!scrollingEffectClassNameReg.test(bodyClassName)) {
var addClassName = "".concat(bodyClassName, " ").concat(scrollingEffectClassName);
document.body.className = addClassName.trim();
}
}
});

8
node_modules/rc-util/es/test/domHook.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
export type ElementClass = Function;
export type Property = PropertyDescriptor | Function;
export declare function spyElementPrototypes<T extends ElementClass>(elementClass: T, properties: Record<string, Property>): {
mockRestore(): void;
};
export declare function spyElementPrototype(Element: ElementClass, propName: string, property: Property): {
mockRestore(): void;
};

59
node_modules/rc-util/es/test/domHook.js generated vendored Normal file
View File

@@ -0,0 +1,59 @@
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
/* eslint-disable no-param-reassign */
var NO_EXIST = {
__NOT_EXIST: true
};
export function spyElementPrototypes(elementClass, properties) {
var propNames = Object.keys(properties);
var originDescriptors = {};
propNames.forEach(function (propName) {
var originDescriptor = Object.getOwnPropertyDescriptor(elementClass.prototype, propName);
originDescriptors[propName] = originDescriptor || NO_EXIST;
var spyProp = properties[propName];
if (typeof spyProp === 'function') {
// If is a function
elementClass.prototype[propName] = function spyFunc() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return spyProp.call.apply(spyProp, [this, originDescriptor].concat(args));
};
} else {
// Otherwise tread as a property
Object.defineProperty(elementClass.prototype, propName, _objectSpread(_objectSpread({}, spyProp), {}, {
set: function set(value) {
if (spyProp.set) {
return spyProp.set.call(this, originDescriptor, value);
}
return originDescriptor.set(value);
},
get: function get() {
if (spyProp.get) {
return spyProp.get.call(this, originDescriptor);
}
return originDescriptor.get();
},
configurable: true
}));
}
});
return {
mockRestore: function mockRestore() {
propNames.forEach(function (propName) {
var originDescriptor = originDescriptors[propName];
if (originDescriptor === NO_EXIST) {
delete elementClass.prototype[propName];
} else if (typeof originDescriptor === 'function') {
elementClass.prototype[propName] = originDescriptor;
} else {
Object.defineProperty(elementClass.prototype, propName, originDescriptor);
}
});
}
};
}
export function spyElementPrototype(Element, propName, property) {
return spyElementPrototypes(Element, _defineProperty({}, propName, property));
}
/* eslint-enable */

24
node_modules/rc-util/es/unsafeLifecyclesPolyfill.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import React from 'react';
var unsafeLifecyclesPolyfill = function unsafeLifecyclesPolyfill(Component) {
var prototype = Component.prototype;
if (!prototype || !prototype.isReactComponent) {
throw new Error('Can only polyfill class components');
}
// only handle componentWillReceiveProps
if (typeof prototype.componentWillReceiveProps !== 'function') {
return Component;
}
// In React 16.9, React.Profiler was introduced together with UNSAFE_componentWillReceiveProps
// https://reactjs.org/blog/2019/08/08/react-v16.9.0.html#performance-measurements-with-reactprofiler
if (!React.Profiler) {
return Component;
}
// Here polyfill get started
prototype.UNSAFE_componentWillReceiveProps = prototype.componentWillReceiveProps;
delete prototype.componentWillReceiveProps;
return Component;
};
export default unsafeLifecyclesPolyfill;

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

@@ -0,0 +1 @@
export default function get(entity: any, path: (string | number | symbol)[] | readonly (string | number | symbol)[]): any;

10
node_modules/rc-util/es/utils/get.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
export default function get(entity, path) {
var current = entity;
for (var i = 0; i < path.length; i += 1) {
if (current === null || current === undefined) {
return undefined;
}
current = current[path[i]];
}
return current;
}

6
node_modules/rc-util/es/utils/set.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export type Path = (string | number | symbol)[];
export default function set<Entity = any, Output = Entity, Value = any>(entity: Entity, paths: Path, value: Value, removeIfUndefined?: boolean): Output;
/**
* Merge objects which will create
*/
export declare function merge<T extends object>(...sources: T[]): T;

82
node_modules/rc-util/es/utils/set.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
import _typeof from "@babel/runtime/helpers/esm/typeof";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _toArray from "@babel/runtime/helpers/esm/toArray";
import get from "./get";
function internalSet(entity, paths, value, removeIfUndefined) {
if (!paths.length) {
return value;
}
var _paths = _toArray(paths),
path = _paths[0],
restPath = _paths.slice(1);
var clone;
if (!entity && typeof path === 'number') {
clone = [];
} else if (Array.isArray(entity)) {
clone = _toConsumableArray(entity);
} else {
clone = _objectSpread({}, entity);
}
// Delete prop if `removeIfUndefined` and value is undefined
if (removeIfUndefined && value === undefined && restPath.length === 1) {
delete clone[path][restPath[0]];
} else {
clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
}
return clone;
}
export default function set(entity, paths, value) {
var removeIfUndefined = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
// Do nothing if `removeIfUndefined` and parent object not exist
if (paths.length && removeIfUndefined && value === undefined && !get(entity, paths.slice(0, -1))) {
return entity;
}
return internalSet(entity, paths, value, removeIfUndefined);
}
function isObject(obj) {
return _typeof(obj) === 'object' && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;
}
function createEmpty(source) {
return Array.isArray(source) ? [] : {};
}
var keys = typeof Reflect === 'undefined' ? Object.keys : Reflect.ownKeys;
/**
* Merge objects which will create
*/
export function merge() {
for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
sources[_key] = arguments[_key];
}
var clone = createEmpty(sources[0]);
sources.forEach(function (src) {
function internalMerge(path, parentLoopSet) {
var loopSet = new Set(parentLoopSet);
var value = get(src, path);
var isArr = Array.isArray(value);
if (isArr || isObject(value)) {
// Only add not loop obj
if (!loopSet.has(value)) {
loopSet.add(value);
var originValue = get(clone, path);
if (isArr) {
// Array will always be override
clone = set(clone, path, []);
} else if (!originValue || _typeof(originValue) !== 'object') {
// Init container if not exist
clone = set(clone, path, createEmpty(value));
}
keys(value).forEach(function (key) {
internalMerge([].concat(_toConsumableArray(path), [key]), loopSet);
});
}
} else {
clone = set(clone, path, value);
}
}
internalMerge([]);
});
return clone;
}

8
node_modules/rc-util/es/warn.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/** @deprecated Use `warning` instead. This will be removed in next major version */
export default function warn(msg) {
if (process.env.NODE_ENV !== 'production') {
if (typeof console !== 'undefined' && console.warn) {
console.warn(msg);
}
}
}

32
node_modules/rc-util/es/warning.d.ts generated vendored Normal file
View File

@@ -0,0 +1,32 @@
export type preMessageFn = (message: string, type: 'warning' | 'note') => string | null | undefined | number;
/**
* Pre warning enable you to parse content before console.error.
* Modify to null will prevent warning.
*/
export declare const preMessage: (fn: preMessageFn) => void;
/**
* Warning if condition not match.
* @param valid Condition
* @param message Warning message
* @example
* ```js
* warning(false, 'some error'); // print some error
* warning(true, 'some error'); // print nothing
* warning(1 === 2, 'some error'); // print some error
* ```
*/
export declare function warning(valid: boolean, message: string): void;
/** @see Similar to {@link warning} */
export declare function note(valid: boolean, message: string): void;
export declare function resetWarned(): void;
export declare function call(method: (valid: boolean, message: string) => void, valid: boolean, message: string): void;
/** @see Same as {@link warning}, but only warn once for the same message */
export declare function warningOnce(valid: boolean, message: string): void;
export declare namespace warningOnce {
var preMessage: (fn: preMessageFn) => void;
var resetWarned: typeof import("./warning").resetWarned;
var noteOnce: typeof import("./warning").noteOnce;
}
/** @see Same as {@link warning}, but only warn once for the same message */
export declare function noteOnce(valid: boolean, message: string): void;
export default warningOnce;

68
node_modules/rc-util/es/warning.js generated vendored Normal file
View File

@@ -0,0 +1,68 @@
/* eslint-disable no-console */
var warned = {};
var preWarningFns = [];
/**
* Pre warning enable you to parse content before console.error.
* Modify to null will prevent warning.
*/
export var preMessage = function preMessage(fn) {
preWarningFns.push(fn);
};
/**
* Warning if condition not match.
* @param valid Condition
* @param message Warning message
* @example
* ```js
* warning(false, 'some error'); // print some error
* warning(true, 'some error'); // print nothing
* warning(1 === 2, 'some error'); // print some error
* ```
*/
export function warning(valid, message) {
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'warning');
}, message);
if (finalMessage) {
console.error("Warning: ".concat(finalMessage));
}
}
}
/** @see Similar to {@link warning} */
export function note(valid, message) {
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'note');
}, message);
if (finalMessage) {
console.warn("Note: ".concat(finalMessage));
}
}
}
export function resetWarned() {
warned = {};
}
export function call(method, valid, message) {
if (!valid && !warned[message]) {
method(false, message);
warned[message] = true;
}
}
/** @see Same as {@link warning}, but only warn once for the same message */
export function warningOnce(valid, message) {
call(warning, valid, message);
}
/** @see Same as {@link warning}, but only warn once for the same message */
export function noteOnce(valid, message) {
call(note, valid, message);
}
warningOnce.preMessage = preMessage;
warningOnce.resetWarned = resetWarned;
warningOnce.noteOnce = noteOnce;
export default warningOnce;

15
node_modules/rc-util/lib/Children/mapSelf.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = mapSelf;
var _react = _interopRequireDefault(require("react"));
function mirror(o) {
return o;
}
function mapSelf(children) {
// return ReactFragment
return _react.default.Children.map(children, mirror);
}

5
node_modules/rc-util/lib/Children/toArray.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import React from 'react';
export interface Option {
keepEmpty?: boolean;
}
export default function toArray(children: React.ReactNode, option?: Option): React.ReactElement[];

26
node_modules/rc-util/lib/Children/toArray.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toArray;
var _isFragment = _interopRequireDefault(require("../React/isFragment"));
var _react = _interopRequireDefault(require("react"));
function toArray(children) {
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var ret = [];
_react.default.Children.forEach(children, function (child) {
if ((child === undefined || child === null) && !option.keepEmpty) {
return;
}
if (Array.isArray(child)) {
ret = ret.concat(toArray(child));
} else if ((0, _isFragment.default)(child) && child.props) {
ret = ret.concat(toArray(child.props.children, option));
} else {
ret.push(child);
}
});
return ret;
}

93
node_modules/rc-util/lib/ContainerRender.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _react = _interopRequireDefault(require("react"));
var _reactDom = _interopRequireDefault(require("react-dom"));
/**
* @deprecated Since we do not need support React15 any more.
* Will remove in next major version.
*/
var ContainerRender = exports.default = /*#__PURE__*/function (_React$Component) {
(0, _inherits2.default)(ContainerRender, _React$Component);
var _super = (0, _createSuper2.default)(ContainerRender);
function ContainerRender() {
var _this;
(0, _classCallCheck2.default)(this, ContainerRender);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "removeContainer", function () {
if (_this.container) {
_reactDom.default.unmountComponentAtNode(_this.container);
_this.container.parentNode.removeChild(_this.container);
_this.container = null;
}
});
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderComponent", function (props, ready) {
var _this$props = _this.props,
visible = _this$props.visible,
getComponent = _this$props.getComponent,
forceRender = _this$props.forceRender,
getContainer = _this$props.getContainer,
parent = _this$props.parent;
if (visible || parent._component || forceRender) {
if (!_this.container) {
_this.container = getContainer();
}
_reactDom.default.unstable_renderSubtreeIntoContainer(parent, getComponent(props), _this.container, function callback() {
if (ready) {
ready.call(this);
}
});
}
});
return _this;
}
(0, _createClass2.default)(ContainerRender, [{
key: "componentDidMount",
value: function componentDidMount() {
if (this.props.autoMount) {
this.renderComponent();
}
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
if (this.props.autoMount) {
this.renderComponent();
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (this.props.autoDestroy) {
this.removeContainer();
}
}
}, {
key: "render",
value: function render() {
return this.props.children({
renderComponent: this.renderComponent,
removeContainer: this.removeContainer
});
}
}]);
return ContainerRender;
}(_react.default.Component);
(0, _defineProperty2.default)(ContainerRender, "defaultProps", {
autoMount: true,
autoDestroy: true,
forceRender: false
});

24
node_modules/rc-util/lib/Dom/addEventListener.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = addEventListenerWrap;
var _reactDom = _interopRequireDefault(require("react-dom"));
function addEventListenerWrap(target, eventType, cb, option) {
/* eslint camelcase: 2 */
var callback = _reactDom.default.unstable_batchedUpdates ? function run(e) {
_reactDom.default.unstable_batchedUpdates(cb, e);
} : cb;
if (target !== null && target !== void 0 && target.addEventListener) {
target.addEventListener(eventType, callback, option);
}
return {
remove: function remove() {
if (target !== null && target !== void 0 && target.removeEventListener) {
target.removeEventListener(eventType, callback, option);
}
}
};
}

Some files were not shown because too many files have changed in this diff Show More