Latest updates from IceHrmPro
This commit is contained in:
5
web/node_modules/antd/es/_util/colors.d.ts
generated
vendored
Normal file
5
web/node_modules/antd/es/_util/colors.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ElementOf } from './type';
|
||||
export declare const PresetStatusColorTypes: ["success", "processing", "error", "default", "warning"];
|
||||
export declare const PresetColorTypes: ["pink", "red", "yellow", "orange", "cyan", "green", "blue", "purple", "geekblue", "magenta", "volcano", "gold", "lime"];
|
||||
export declare type PresetColorType = ElementOf<typeof PresetColorTypes>;
|
||||
export declare type PresetStatusColorType = ElementOf<typeof PresetStatusColorTypes>;
|
||||
4
web/node_modules/antd/es/_util/colors.js
generated
vendored
Normal file
4
web/node_modules/antd/es/_util/colors.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { tuple } from './type';
|
||||
export var PresetStatusColorTypes = tuple('success', 'processing', 'error', 'default', 'warning'); // eslint-disable-next-line import/prefer-default-export
|
||||
|
||||
export var PresetColorTypes = tuple('pink', 'red', 'yellow', 'orange', 'cyan', 'green', 'blue', 'purple', 'geekblue', 'magenta', 'volcano', 'gold', 'lime');
|
||||
1
web/node_modules/antd/es/_util/easings.d.ts
generated
vendored
Normal file
1
web/node_modules/antd/es/_util/easings.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function easeInOutCubic(t: number, b: number, c: number, d: number): number;
|
||||
11
web/node_modules/antd/es/_util/easings.js
generated
vendored
Normal file
11
web/node_modules/antd/es/_util/easings.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export function easeInOutCubic(t, b, c, d) {
|
||||
var cc = c - b;
|
||||
t /= d / 2;
|
||||
|
||||
if (t < 1) {
|
||||
return cc / 2 * t * t * t + b;
|
||||
}
|
||||
|
||||
return cc / 2 * ((t -= 2) * t * t + 2) + b;
|
||||
}
|
||||
1
web/node_modules/antd/es/_util/getDataOrAriaProps.d.ts
generated
vendored
Normal file
1
web/node_modules/antd/es/_util/getDataOrAriaProps.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function getDataOrAriaProps(props: any): any;
|
||||
9
web/node_modules/antd/es/_util/getDataOrAriaProps.js
generated
vendored
Normal file
9
web/node_modules/antd/es/_util/getDataOrAriaProps.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export default function getDataOrAriaProps(props) {
|
||||
return Object.keys(props).reduce(function (prev, key) {
|
||||
if ((key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') && key.substr(0, 7) !== 'data-__') {
|
||||
prev[key] = props[key];
|
||||
}
|
||||
|
||||
return prev;
|
||||
}, {});
|
||||
}
|
||||
3
web/node_modules/antd/es/_util/getRenderPropValue.d.ts
generated
vendored
Normal file
3
web/node_modules/antd/es/_util/getRenderPropValue.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
export declare type RenderFunction = () => React.ReactNode;
|
||||
export declare const getRenderPropValue: (propValue?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | RenderFunction | null | undefined) => React.ReactNode;
|
||||
13
web/node_modules/antd/es/_util/getRenderPropValue.js
generated
vendored
Normal file
13
web/node_modules/antd/es/_util/getRenderPropValue.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
export var getRenderPropValue = function getRenderPropValue(propValue) {
|
||||
if (!propValue) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var isRenderFunction = typeof propValue === 'function';
|
||||
|
||||
if (isRenderFunction) {
|
||||
return propValue();
|
||||
}
|
||||
|
||||
return propValue;
|
||||
};
|
||||
2
web/node_modules/antd/es/_util/getScroll.d.ts
generated
vendored
Normal file
2
web/node_modules/antd/es/_util/getScroll.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare function isWindow(obj: any): boolean;
|
||||
export default function getScroll(target: HTMLElement | Window | Document | null, top: boolean): number;
|
||||
25
web/node_modules/antd/es/_util/getScroll.js
generated
vendored
Normal file
25
web/node_modules/antd/es/_util/getScroll.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
export function isWindow(obj) {
|
||||
return obj !== null && obj !== undefined && obj === obj.window;
|
||||
}
|
||||
export default function getScroll(target, top) {
|
||||
if (typeof window === 'undefined') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var method = top ? 'scrollTop' : 'scrollLeft';
|
||||
var result = 0;
|
||||
|
||||
if (isWindow(target)) {
|
||||
result = target[top ? 'pageYOffset' : 'pageXOffset'];
|
||||
} else if (target instanceof Document) {
|
||||
result = target.documentElement[method];
|
||||
} else if (target) {
|
||||
result = target[method];
|
||||
}
|
||||
|
||||
if (target && !isWindow(target) && typeof result !== 'number') {
|
||||
result = (target.ownerDocument || target).documentElement[method];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
1
web/node_modules/antd/es/_util/interopDefault.d.ts
generated
vendored
Normal file
1
web/node_modules/antd/es/_util/interopDefault.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function interopDefault(m: any): any;
|
||||
5
web/node_modules/antd/es/_util/interopDefault.js
generated
vendored
Normal file
5
web/node_modules/antd/es/_util/interopDefault.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
// https://github.com/moment/moment/issues/3650
|
||||
// since we are using ts 3.5.1, it should be safe to remove.
|
||||
export default function interopDefault(m) {
|
||||
return m["default"] || m;
|
||||
}
|
||||
2
web/node_modules/antd/es/_util/isNumeric.d.ts
generated
vendored
Normal file
2
web/node_modules/antd/es/_util/isNumeric.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const isNumeric: (value: any) => boolean;
|
||||
export default isNumeric;
|
||||
5
web/node_modules/antd/es/_util/isNumeric.js
generated
vendored
Normal file
5
web/node_modules/antd/es/_util/isNumeric.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var isNumeric = function isNumeric(value) {
|
||||
return !isNaN(parseFloat(value)) && isFinite(value);
|
||||
};
|
||||
|
||||
export default isNumeric;
|
||||
23
web/node_modules/antd/es/_util/motion.d.ts
generated
vendored
Normal file
23
web/node_modules/antd/es/_util/motion.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import * as React from 'react';
|
||||
declare type MotionFunc = (element: HTMLElement) => React.CSSProperties;
|
||||
interface Motion {
|
||||
visible?: boolean;
|
||||
motionName?: string;
|
||||
motionAppear?: boolean;
|
||||
motionEnter?: boolean;
|
||||
motionLeave?: boolean;
|
||||
motionLeaveImmediately?: boolean;
|
||||
removeOnLeave?: boolean;
|
||||
leavedClassName?: string;
|
||||
onAppearStart?: MotionFunc;
|
||||
onAppearActive?: MotionFunc;
|
||||
onAppearEnd?: MotionFunc;
|
||||
onEnterStart?: MotionFunc;
|
||||
onEnterActive?: MotionFunc;
|
||||
onEnterEnd?: MotionFunc;
|
||||
onLeaveStart?: MotionFunc;
|
||||
onLeaveActive?: MotionFunc;
|
||||
onLeaveEnd?: MotionFunc;
|
||||
}
|
||||
declare const collapseMotion: Motion;
|
||||
export default collapseMotion;
|
||||
31
web/node_modules/antd/es/_util/motion.js
generated
vendored
Normal file
31
web/node_modules/antd/es/_util/motion.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// ================== Collapse Motion ==================
|
||||
var getCollapsedHeight = function getCollapsedHeight() {
|
||||
return {
|
||||
height: 0,
|
||||
opacity: 0
|
||||
};
|
||||
};
|
||||
|
||||
var getRealHeight = function getRealHeight(node) {
|
||||
return {
|
||||
height: node.scrollHeight,
|
||||
opacity: 1
|
||||
};
|
||||
};
|
||||
|
||||
var getCurrentHeight = function getCurrentHeight(node) {
|
||||
return {
|
||||
height: node.offsetHeight
|
||||
};
|
||||
};
|
||||
|
||||
var collapseMotion = {
|
||||
motionName: 'ant-motion-collapse',
|
||||
onAppearStart: getCollapsedHeight,
|
||||
onEnterStart: getCollapsedHeight,
|
||||
onAppearActive: getRealHeight,
|
||||
onEnterActive: getRealHeight,
|
||||
onLeaveStart: getCurrentHeight,
|
||||
onLeaveActive: getCollapsedHeight
|
||||
};
|
||||
export default collapseMotion;
|
||||
6
web/node_modules/antd/es/_util/openAnimation.d.ts
generated
vendored
Normal file
6
web/node_modules/antd/es/_util/openAnimation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
declare const animation: {
|
||||
enter(node: HTMLElement, done: () => void): any;
|
||||
leave(node: HTMLElement, done: () => void): any;
|
||||
appear(node: HTMLElement, done: () => void): any;
|
||||
};
|
||||
export default animation;
|
||||
55
web/node_modules/antd/es/_util/openAnimation.js
generated
vendored
Normal file
55
web/node_modules/antd/es/_util/openAnimation.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Deprecated. We should replace the animation with pure react motion instead of modify style directly.
|
||||
* If you are creating new component with animation, please use `./motion`.
|
||||
*/
|
||||
import cssAnimation from 'css-animation';
|
||||
import raf from 'raf';
|
||||
|
||||
function animate(node, show, done) {
|
||||
var height;
|
||||
var requestAnimationFrameId;
|
||||
return cssAnimation(node, 'ant-motion-collapse-legacy', {
|
||||
start: function start() {
|
||||
if (!show) {
|
||||
node.style.height = "".concat(node.offsetHeight, "px");
|
||||
node.style.opacity = '1';
|
||||
} else {
|
||||
height = node.offsetHeight;
|
||||
node.style.height = '0px';
|
||||
node.style.opacity = '0';
|
||||
}
|
||||
},
|
||||
active: function active() {
|
||||
if (requestAnimationFrameId) {
|
||||
raf.cancel(requestAnimationFrameId);
|
||||
}
|
||||
|
||||
requestAnimationFrameId = raf(function () {
|
||||
node.style.height = "".concat(show ? height : 0, "px");
|
||||
node.style.opacity = show ? '1' : '0';
|
||||
});
|
||||
},
|
||||
end: function end() {
|
||||
if (requestAnimationFrameId) {
|
||||
raf.cancel(requestAnimationFrameId);
|
||||
}
|
||||
|
||||
node.style.height = '';
|
||||
node.style.opacity = '';
|
||||
done();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var animation = {
|
||||
enter: function enter(node, done) {
|
||||
return animate(node, true, done);
|
||||
},
|
||||
leave: function leave(node, done) {
|
||||
return animate(node, false, done);
|
||||
},
|
||||
appear: function appear(node, done) {
|
||||
return animate(node, true, done);
|
||||
}
|
||||
};
|
||||
export default animation;
|
||||
9
web/node_modules/antd/es/_util/raf.d.ts
generated
vendored
Normal file
9
web/node_modules/antd/es/_util/raf.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
interface RafMap {
|
||||
[id: number]: number;
|
||||
}
|
||||
declare function wrapperRaf(callback: () => void, delayFrames?: number): number;
|
||||
declare namespace wrapperRaf {
|
||||
var cancel: (pid?: number | undefined) => void;
|
||||
var ids: RafMap;
|
||||
}
|
||||
export default wrapperRaf;
|
||||
31
web/node_modules/antd/es/_util/raf.js
generated
vendored
Normal file
31
web/node_modules/antd/es/_util/raf.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import raf from 'raf';
|
||||
var id = 0;
|
||||
var ids = {}; // Support call raf with delay specified frame
|
||||
|
||||
export default function wrapperRaf(callback) {
|
||||
var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
||||
var myId = id++;
|
||||
var restFrames = delayFrames;
|
||||
|
||||
function internalCallback() {
|
||||
restFrames -= 1;
|
||||
|
||||
if (restFrames <= 0) {
|
||||
callback();
|
||||
delete ids[myId];
|
||||
} else {
|
||||
ids[myId] = raf(internalCallback);
|
||||
}
|
||||
}
|
||||
|
||||
ids[myId] = raf(internalCallback);
|
||||
return myId;
|
||||
}
|
||||
|
||||
wrapperRaf.cancel = function cancel(pid) {
|
||||
if (pid === undefined) return;
|
||||
raf.cancel(ids[pid]);
|
||||
delete ids[pid];
|
||||
};
|
||||
|
||||
wrapperRaf.ids = ids; // export this for test usage
|
||||
2
web/node_modules/antd/es/_util/reactNode.d.ts
generated
vendored
Normal file
2
web/node_modules/antd/es/_util/reactNode.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import * as React from 'react';
|
||||
export declare function cloneElement(element: React.ReactNode, ...restArgs: any[]): {} | null | undefined;
|
||||
11
web/node_modules/antd/es/_util/reactNode.js
generated
vendored
Normal file
11
web/node_modules/antd/es/_util/reactNode.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as React from 'react'; // eslint-disable-next-line import/prefer-default-export
|
||||
|
||||
export function cloneElement(element) {
|
||||
if (!React.isValidElement(element)) return element;
|
||||
|
||||
for (var _len = arguments.length, restArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
restArgs[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return React.cloneElement.apply(React, [element].concat(restArgs));
|
||||
}
|
||||
3
web/node_modules/antd/es/_util/ref.d.ts
generated
vendored
Normal file
3
web/node_modules/antd/es/_util/ref.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
export declare function fillRef<T>(ref: React.Ref<T>, node: T): void;
|
||||
export declare function composeRef<T>(...refs: React.Ref<T>[]): React.Ref<T>;
|
||||
20
web/node_modules/antd/es/_util/ref.js
generated
vendored
Normal file
20
web/node_modules/antd/es/_util/ref.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
export function fillRef(ref, node) {
|
||||
if (typeof ref === 'function') {
|
||||
ref(node);
|
||||
} else if (_typeof(ref) === 'object' && ref && 'current' in ref) {
|
||||
ref.current = node;
|
||||
}
|
||||
}
|
||||
export function composeRef() {
|
||||
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
refs[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return function (node) {
|
||||
refs.forEach(function (ref) {
|
||||
fillRef(ref, node);
|
||||
});
|
||||
};
|
||||
}
|
||||
15
web/node_modules/antd/es/_util/responsiveObserve.d.ts
generated
vendored
Normal file
15
web/node_modules/antd/es/_util/responsiveObserve.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
export declare type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
||||
export declare type BreakpointMap = Partial<Record<Breakpoint, string>>;
|
||||
export declare type ScreenMap = Partial<Record<Breakpoint, boolean>>;
|
||||
export declare const responsiveArray: Breakpoint[];
|
||||
export declare const responsiveMap: BreakpointMap;
|
||||
declare type SubscribeFunc = (screens: ScreenMap) => void;
|
||||
declare const responsiveObserve: {
|
||||
matchHandlers: {};
|
||||
dispatch(pointMap: Partial<Record<Breakpoint, boolean>>): boolean;
|
||||
subscribe(func: SubscribeFunc): string;
|
||||
unsubscribe(token: string): void;
|
||||
unregister(): void;
|
||||
register(): void;
|
||||
};
|
||||
export default responsiveObserve;
|
||||
87
web/node_modules/antd/es/_util/responsiveObserve.js
generated
vendored
Normal file
87
web/node_modules/antd/es/_util/responsiveObserve.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
export var responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
||||
export var responsiveMap = {
|
||||
xs: '(max-width: 575px)',
|
||||
sm: '(min-width: 576px)',
|
||||
md: '(min-width: 768px)',
|
||||
lg: '(min-width: 992px)',
|
||||
xl: '(min-width: 1200px)',
|
||||
xxl: '(min-width: 1600px)'
|
||||
};
|
||||
var subscribers = [];
|
||||
var subUid = -1;
|
||||
var screens = {};
|
||||
var responsiveObserve = {
|
||||
matchHandlers: {},
|
||||
dispatch: function dispatch(pointMap) {
|
||||
screens = pointMap;
|
||||
|
||||
if (subscribers.length < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
subscribers.forEach(function (item) {
|
||||
item.func(screens);
|
||||
});
|
||||
return true;
|
||||
},
|
||||
subscribe: function subscribe(func) {
|
||||
if (subscribers.length === 0) {
|
||||
this.register();
|
||||
}
|
||||
|
||||
var token = (++subUid).toString();
|
||||
subscribers.push({
|
||||
token: token,
|
||||
func: func
|
||||
});
|
||||
func(screens);
|
||||
return token;
|
||||
},
|
||||
unsubscribe: function unsubscribe(token) {
|
||||
subscribers = subscribers.filter(function (item) {
|
||||
return item.token !== token;
|
||||
});
|
||||
|
||||
if (subscribers.length === 0) {
|
||||
this.unregister();
|
||||
}
|
||||
},
|
||||
unregister: function unregister() {
|
||||
var _this = this;
|
||||
|
||||
Object.keys(responsiveMap).forEach(function (screen) {
|
||||
var matchMediaQuery = responsiveMap[screen];
|
||||
var handler = _this.matchHandlers[matchMediaQuery];
|
||||
|
||||
if (handler && handler.mql && handler.listener) {
|
||||
handler.mql.removeListener(handler.listener);
|
||||
}
|
||||
});
|
||||
},
|
||||
register: function register() {
|
||||
var _this2 = this;
|
||||
|
||||
Object.keys(responsiveMap).forEach(function (screen) {
|
||||
var matchMediaQuery = responsiveMap[screen];
|
||||
|
||||
var listener = function listener(_ref) {
|
||||
var matches = _ref.matches;
|
||||
|
||||
_this2.dispatch(_extends(_extends({}, screens), _defineProperty({}, screen, matches)));
|
||||
};
|
||||
|
||||
var mql = window.matchMedia(matchMediaQuery);
|
||||
mql.addListener(listener);
|
||||
_this2.matchHandlers[matchMediaQuery] = {
|
||||
mql: mql,
|
||||
listener: listener
|
||||
};
|
||||
listener(mql);
|
||||
});
|
||||
}
|
||||
};
|
||||
export default responsiveObserve;
|
||||
10
web/node_modules/antd/es/_util/scrollTo.d.ts
generated
vendored
Normal file
10
web/node_modules/antd/es/_util/scrollTo.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
interface ScrollToOptions {
|
||||
/** Scroll container, default as window */
|
||||
getContainer?: () => HTMLElement | Window | Document;
|
||||
/** Scroll end callback */
|
||||
callback?: () => any;
|
||||
/** Animation duration, default as 450 */
|
||||
duration?: number;
|
||||
}
|
||||
export default function scrollTo(y: number, options?: ScrollToOptions): void;
|
||||
export {};
|
||||
38
web/node_modules/antd/es/_util/scrollTo.js
generated
vendored
Normal file
38
web/node_modules/antd/es/_util/scrollTo.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import raf from 'raf';
|
||||
import getScroll, { isWindow } from './getScroll';
|
||||
import { easeInOutCubic } from './easings';
|
||||
export default function scrollTo(y) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _options$getContainer = options.getContainer,
|
||||
getContainer = _options$getContainer === void 0 ? function () {
|
||||
return window;
|
||||
} : _options$getContainer,
|
||||
callback = options.callback,
|
||||
_options$duration = options.duration,
|
||||
duration = _options$duration === void 0 ? 450 : _options$duration;
|
||||
var container = getContainer();
|
||||
var scrollTop = getScroll(container, true);
|
||||
var startTime = Date.now();
|
||||
|
||||
var frameFunc = function frameFunc() {
|
||||
var timestamp = Date.now();
|
||||
var time = timestamp - startTime;
|
||||
var nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
|
||||
|
||||
if (isWindow(container)) {
|
||||
container.scrollTo(window.pageXOffset, nextScrollTop);
|
||||
} else if (container instanceof Document) {
|
||||
container.documentElement.scrollTop = nextScrollTop;
|
||||
} else {
|
||||
container.scrollTop = nextScrollTop;
|
||||
}
|
||||
|
||||
if (time < duration) {
|
||||
raf(frameFunc);
|
||||
} else if (typeof callback === 'function') {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
raf(frameFunc);
|
||||
}
|
||||
3
web/node_modules/antd/es/_util/styleChecker.d.ts
generated
vendored
Normal file
3
web/node_modules/antd/es/_util/styleChecker.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare const isStyleSupport: (styleName: string | string[]) => boolean;
|
||||
export declare const isFlexSupported: boolean;
|
||||
export default isStyleSupport;
|
||||
14
web/node_modules/antd/es/_util/styleChecker.js
generated
vendored
Normal file
14
web/node_modules/antd/es/_util/styleChecker.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var isStyleSupport = function isStyleSupport(styleName) {
|
||||
if (typeof window !== 'undefined' && window.document && 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;
|
||||
};
|
||||
|
||||
export var isFlexSupported = isStyleSupport(['flex', 'webkitFlex', 'Flex', 'msFlex']);
|
||||
export default isStyleSupport;
|
||||
5
web/node_modules/antd/es/_util/throttleByAnimationFrame.d.ts
generated
vendored
Normal file
5
web/node_modules/antd/es/_util/throttleByAnimationFrame.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export default function throttleByAnimationFrame(fn: (...args: any[]) => void): (...args: any[]) => void;
|
||||
export declare function throttleByAnimationFrameDecorator(): (target: any, key: string, descriptor: any) => {
|
||||
configurable: boolean;
|
||||
get(): any;
|
||||
};
|
||||
65
web/node_modules/antd/es/_util/throttleByAnimationFrame.js
generated
vendored
Normal file
65
web/node_modules/antd/es/_util/throttleByAnimationFrame.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
||||
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
|
||||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
||||
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
||||
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
||||
|
||||
import raf from 'raf';
|
||||
export default function throttleByAnimationFrame(fn) {
|
||||
var requestId;
|
||||
|
||||
var later = function later(args) {
|
||||
return function () {
|
||||
requestId = null;
|
||||
fn.apply(void 0, _toConsumableArray(args));
|
||||
};
|
||||
};
|
||||
|
||||
var throttled = function throttled() {
|
||||
if (requestId == null) {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
requestId = raf(later(args));
|
||||
}
|
||||
};
|
||||
|
||||
throttled.cancel = function () {
|
||||
return raf.cancel(requestId);
|
||||
};
|
||||
|
||||
return throttled;
|
||||
}
|
||||
export function throttleByAnimationFrameDecorator() {
|
||||
// eslint-disable-next-line func-names
|
||||
return function (target, key, descriptor) {
|
||||
var fn = descriptor.value;
|
||||
var definingProperty = false;
|
||||
return {
|
||||
configurable: true,
|
||||
get: function get() {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {
|
||||
return fn;
|
||||
}
|
||||
|
||||
var boundFn = throttleByAnimationFrame(fn.bind(this));
|
||||
definingProperty = true;
|
||||
Object.defineProperty(this, key, {
|
||||
value: boundFn,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
definingProperty = false;
|
||||
return boundFn;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
22
web/node_modules/antd/es/_util/transButton.d.ts
generated
vendored
Normal file
22
web/node_modules/antd/es/_util/transButton.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Wrap of sub component which need use as Button capacity (like Icon component).
|
||||
* This helps accessibility reader to tread as a interactive button to operation.
|
||||
*/
|
||||
import * as React from 'react';
|
||||
interface TransButtonProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
onClick?: (e?: React.MouseEvent<HTMLDivElement>) => void;
|
||||
noStyle?: boolean;
|
||||
autoFocus?: boolean;
|
||||
}
|
||||
declare class TransButton extends React.Component<TransButtonProps> {
|
||||
div?: HTMLDivElement;
|
||||
lastKeyCode?: number;
|
||||
componentDidMount(): void;
|
||||
onKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
|
||||
onKeyUp: React.KeyboardEventHandler<HTMLDivElement>;
|
||||
setRef: (btn: HTMLDivElement) => void;
|
||||
focus(): void;
|
||||
blur(): void;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
export default TransButton;
|
||||
135
web/node_modules/antd/es/_util/transButton.js
generated
vendored
Normal file
135
web/node_modules/antd/es/_util/transButton.js
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
var __rest = this && this.__rest || function (s, e) {
|
||||
var t = {};
|
||||
|
||||
for (var p in s) {
|
||||
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
}
|
||||
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
/**
|
||||
* Wrap of sub component which need use as Button capacity (like Icon component).
|
||||
* This helps accessibility reader to tread as a interactive button to operation.
|
||||
*/
|
||||
|
||||
|
||||
import * as React from 'react';
|
||||
import KeyCode from "rc-util/es/KeyCode";
|
||||
var inlineStyle = {
|
||||
border: 0,
|
||||
background: 'transparent',
|
||||
padding: 0,
|
||||
lineHeight: 'inherit',
|
||||
display: 'inline-block'
|
||||
};
|
||||
|
||||
var TransButton = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(TransButton, _React$Component);
|
||||
|
||||
var _super = _createSuper(TransButton);
|
||||
|
||||
function TransButton() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, TransButton);
|
||||
|
||||
_this = _super.apply(this, arguments);
|
||||
|
||||
_this.onKeyDown = function (event) {
|
||||
var keyCode = event.keyCode;
|
||||
|
||||
if (keyCode === KeyCode.ENTER) {
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
_this.onKeyUp = function (event) {
|
||||
var keyCode = event.keyCode;
|
||||
var onClick = _this.props.onClick;
|
||||
|
||||
if (keyCode === KeyCode.ENTER && onClick) {
|
||||
onClick();
|
||||
}
|
||||
};
|
||||
|
||||
_this.setRef = function (btn) {
|
||||
_this.div = btn;
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(TransButton, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
var autoFocus = this.props.autoFocus;
|
||||
|
||||
if (autoFocus) {
|
||||
this.focus();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "focus",
|
||||
value: function focus() {
|
||||
if (this.div) {
|
||||
this.div.focus();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "blur",
|
||||
value: function blur() {
|
||||
if (this.div) {
|
||||
this.div.blur();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _a = this.props,
|
||||
style = _a.style,
|
||||
noStyle = _a.noStyle,
|
||||
restProps = __rest(_a, ["style", "noStyle"]);
|
||||
|
||||
return /*#__PURE__*/React.createElement("div", _extends({
|
||||
role: "button",
|
||||
tabIndex: 0,
|
||||
ref: this.setRef
|
||||
}, restProps, {
|
||||
onKeyDown: this.onKeyDown,
|
||||
onKeyUp: this.onKeyUp,
|
||||
style: _extends(_extends({}, !noStyle ? inlineStyle : null), style)
|
||||
}));
|
||||
}
|
||||
}]);
|
||||
|
||||
return TransButton;
|
||||
}(React.Component);
|
||||
|
||||
export default TransButton;
|
||||
12
web/node_modules/antd/es/_util/type.d.ts
generated
vendored
Normal file
12
web/node_modules/antd/es/_util/type.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
||||
export declare const tuple: <T extends string[]>(...args: T) => T;
|
||||
export declare const tupleNum: <T extends number[]>(...args: T) => T;
|
||||
/**
|
||||
* https://stackoverflow.com/a/59187769
|
||||
* Extract the type of an element of an array/tuple without performing indexing
|
||||
*/
|
||||
export declare type ElementOf<T> = T extends (infer E)[] ? E : T extends readonly (infer E)[] ? E : never;
|
||||
/**
|
||||
* https://github.com/Microsoft/TypeScript/issues/29729
|
||||
*/
|
||||
export declare type LiteralUnion<T extends U, U> = T | (U & {});
|
||||
15
web/node_modules/antd/es/_util/type.js
generated
vendored
Normal file
15
web/node_modules/antd/es/_util/type.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
|
||||
export var tuple = function tuple() {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return args;
|
||||
};
|
||||
export var tupleNum = function tupleNum() {
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
return args;
|
||||
};
|
||||
3
web/node_modules/antd/es/_util/unreachableException.d.ts
generated
vendored
Normal file
3
web/node_modules/antd/es/_util/unreachableException.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export default class UnreachableException {
|
||||
constructor(value: never);
|
||||
}
|
||||
9
web/node_modules/antd/es/_util/unreachableException.js
generated
vendored
Normal file
9
web/node_modules/antd/es/_util/unreachableException.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var UnreachableException = function UnreachableException(value) {
|
||||
_classCallCheck(this, UnreachableException);
|
||||
|
||||
return new Error("unreachable case: ".concat(JSON.stringify(value)));
|
||||
};
|
||||
|
||||
export { UnreachableException as default };
|
||||
2
web/node_modules/antd/es/_util/usePatchElement.d.ts
generated
vendored
Normal file
2
web/node_modules/antd/es/_util/usePatchElement.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import * as React from 'react';
|
||||
export default function usePatchElement(): [React.ReactElement[], (element: React.ReactElement) => Function];
|
||||
42
web/node_modules/antd/es/_util/usePatchElement.js
generated
vendored
Normal file
42
web/node_modules/antd/es/_util/usePatchElement.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
||||
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
|
||||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
||||
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
||||
|
||||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
||||
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
||||
|
||||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
||||
|
||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||
|
||||
import * as React from 'react';
|
||||
export default function usePatchElement() {
|
||||
var _React$useState = React.useState([]),
|
||||
_React$useState2 = _slicedToArray(_React$useState, 2),
|
||||
elements = _React$useState2[0],
|
||||
setElements = _React$useState2[1];
|
||||
|
||||
function patchElement(element) {
|
||||
setElements(function (originElements) {
|
||||
return [].concat(_toConsumableArray(originElements), [element]);
|
||||
});
|
||||
return function () {
|
||||
setElements(function (originElements) {
|
||||
return originElements.filter(function (ele) {
|
||||
return ele !== element;
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
return [elements, patchElement];
|
||||
}
|
||||
4
web/node_modules/antd/es/_util/warning.d.ts
generated
vendored
Normal file
4
web/node_modules/antd/es/_util/warning.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { resetWarned } from 'rc-util/lib/warning';
|
||||
export { resetWarned };
|
||||
declare const _default: (valid: boolean, component: string, message: string) => void;
|
||||
export default _default;
|
||||
5
web/node_modules/antd/es/_util/warning.js
generated
vendored
Normal file
5
web/node_modules/antd/es/_util/warning.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import warning, { resetWarned } from "rc-util/es/warning";
|
||||
export { resetWarned };
|
||||
export default (function (valid, component, message) {
|
||||
warning(valid, "[antd: ".concat(component, "] ").concat(message));
|
||||
});
|
||||
25
web/node_modules/antd/es/_util/wave.d.ts
generated
vendored
Normal file
25
web/node_modules/antd/es/_util/wave.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import * as React from 'react';
|
||||
import { ConfigConsumerProps } from '../config-provider';
|
||||
export default class Wave extends React.Component<{
|
||||
insertExtraNode?: boolean;
|
||||
}> {
|
||||
private instance?;
|
||||
private extraNode;
|
||||
private clickWaveTimeoutId;
|
||||
private animationStartId;
|
||||
private animationStart;
|
||||
private destroyed;
|
||||
private csp?;
|
||||
componentDidMount(): void;
|
||||
componentWillUnmount(): void;
|
||||
onClick: (node: HTMLElement, waveColor: string) => void;
|
||||
onTransitionStart: (e: AnimationEvent) => void;
|
||||
onTransitionEnd: (e: AnimationEvent) => void;
|
||||
getAttributeName(): "ant-click-animating" | "ant-click-animating-without-extra-node";
|
||||
bindAnimationEvent: (node: HTMLElement) => {
|
||||
cancel: () => void;
|
||||
} | undefined;
|
||||
resetEffect(node: HTMLElement): void;
|
||||
renderWave: ({ csp }: ConfigConsumerProps) => React.ReactNode;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
234
web/node_modules/antd/es/_util/wave.js
generated
vendored
Normal file
234
web/node_modules/antd/es/_util/wave.js
generated
vendored
Normal file
@@ -0,0 +1,234 @@
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
import * as React from 'react';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
import TransitionEvents from "css-animation/es/Event";
|
||||
import raf from './raf';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
var styleForPesudo; // Where el is the DOM element you'd like to test for visibility
|
||||
|
||||
function isHidden(element) {
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !element || element.offsetParent === null;
|
||||
}
|
||||
|
||||
function isNotGrey(color) {
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
var match = (color || '').match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);
|
||||
|
||||
if (match && match[1] && match[2] && match[3]) {
|
||||
return !(match[1] === match[2] && match[2] === match[3]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
var Wave = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(Wave, _React$Component);
|
||||
|
||||
var _super = _createSuper(Wave);
|
||||
|
||||
function Wave() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Wave);
|
||||
|
||||
_this = _super.apply(this, arguments);
|
||||
_this.animationStart = false;
|
||||
_this.destroyed = false;
|
||||
|
||||
_this.onClick = function (node, waveColor) {
|
||||
if (!node || isHidden(node) || node.className.indexOf('-leave') >= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var insertExtraNode = _this.props.insertExtraNode;
|
||||
_this.extraNode = document.createElement('div');
|
||||
|
||||
var _assertThisInitialize = _assertThisInitialized(_this),
|
||||
extraNode = _assertThisInitialize.extraNode;
|
||||
|
||||
extraNode.className = 'ant-click-animating-node';
|
||||
|
||||
var attributeName = _this.getAttributeName();
|
||||
|
||||
node.setAttribute(attributeName, 'true'); // Not white or transparnt or grey
|
||||
|
||||
styleForPesudo = styleForPesudo || document.createElement('style');
|
||||
|
||||
if (waveColor && waveColor !== '#ffffff' && waveColor !== 'rgb(255, 255, 255)' && isNotGrey(waveColor) && !/rgba\((?:\d*, ){3}0\)/.test(waveColor) && // any transparent rgba color
|
||||
waveColor !== 'transparent') {
|
||||
// Add nonce if CSP exist
|
||||
if (_this.csp && _this.csp.nonce) {
|
||||
styleForPesudo.nonce = _this.csp.nonce;
|
||||
}
|
||||
|
||||
extraNode.style.borderColor = waveColor;
|
||||
styleForPesudo.innerHTML = "\n [ant-click-animating-without-extra-node='true']::after, .ant-click-animating-node {\n --antd-wave-shadow-color: ".concat(waveColor, ";\n }");
|
||||
|
||||
if (!document.body.contains(styleForPesudo)) {
|
||||
document.body.appendChild(styleForPesudo);
|
||||
}
|
||||
}
|
||||
|
||||
if (insertExtraNode) {
|
||||
node.appendChild(extraNode);
|
||||
}
|
||||
|
||||
TransitionEvents.addStartEventListener(node, _this.onTransitionStart);
|
||||
TransitionEvents.addEndEventListener(node, _this.onTransitionEnd);
|
||||
};
|
||||
|
||||
_this.onTransitionStart = function (e) {
|
||||
if (_this.destroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
var node = findDOMNode(_assertThisInitialized(_this));
|
||||
|
||||
if (!e || e.target !== node || _this.animationStart) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this.resetEffect(node);
|
||||
};
|
||||
|
||||
_this.onTransitionEnd = function (e) {
|
||||
if (!e || e.animationName !== 'fadeEffect') {
|
||||
return;
|
||||
}
|
||||
|
||||
_this.resetEffect(e.target);
|
||||
};
|
||||
|
||||
_this.bindAnimationEvent = function (node) {
|
||||
if (!node || !node.getAttribute || node.getAttribute('disabled') || node.className.indexOf('disabled') >= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var onClick = function onClick(e) {
|
||||
// Fix radio button click twice
|
||||
if (e.target.tagName === 'INPUT' || isHidden(e.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this.resetEffect(node); // Get wave color from target
|
||||
|
||||
|
||||
var waveColor = getComputedStyle(node).getPropertyValue('border-top-color') || // Firefox Compatible
|
||||
getComputedStyle(node).getPropertyValue('border-color') || getComputedStyle(node).getPropertyValue('background-color');
|
||||
_this.clickWaveTimeoutId = window.setTimeout(function () {
|
||||
return _this.onClick(node, waveColor);
|
||||
}, 0);
|
||||
raf.cancel(_this.animationStartId);
|
||||
_this.animationStart = true; // Render to trigger transition event cost 3 frames. Let's delay 10 frames to reset this.
|
||||
|
||||
_this.animationStartId = raf(function () {
|
||||
_this.animationStart = false;
|
||||
}, 10);
|
||||
};
|
||||
|
||||
node.addEventListener('click', onClick, true);
|
||||
return {
|
||||
cancel: function cancel() {
|
||||
node.removeEventListener('click', onClick, true);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
_this.renderWave = function (_ref) {
|
||||
var csp = _ref.csp;
|
||||
var children = _this.props.children;
|
||||
_this.csp = csp;
|
||||
return children;
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Wave, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
var node = findDOMNode(this);
|
||||
|
||||
if (!node || node.nodeType !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.instance = this.bindAnimationEvent(node);
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
if (this.instance) {
|
||||
this.instance.cancel();
|
||||
}
|
||||
|
||||
if (this.clickWaveTimeoutId) {
|
||||
clearTimeout(this.clickWaveTimeoutId);
|
||||
}
|
||||
|
||||
this.destroyed = true;
|
||||
}
|
||||
}, {
|
||||
key: "getAttributeName",
|
||||
value: function getAttributeName() {
|
||||
var insertExtraNode = this.props.insertExtraNode;
|
||||
return insertExtraNode ? 'ant-click-animating' : 'ant-click-animating-without-extra-node';
|
||||
}
|
||||
}, {
|
||||
key: "resetEffect",
|
||||
value: function resetEffect(node) {
|
||||
if (!node || node === this.extraNode || !(node instanceof Element)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var insertExtraNode = this.props.insertExtraNode;
|
||||
var attributeName = this.getAttributeName();
|
||||
node.setAttribute(attributeName, 'false'); // edge has bug on `removeAttribute` #14466
|
||||
|
||||
if (styleForPesudo) {
|
||||
styleForPesudo.innerHTML = '';
|
||||
}
|
||||
|
||||
if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {
|
||||
node.removeChild(this.extraNode);
|
||||
}
|
||||
|
||||
TransitionEvents.removeStartEventListener(node, this.onTransitionStart);
|
||||
TransitionEvents.removeEndEventListener(node, this.onTransitionEnd);
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderWave);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Wave;
|
||||
}(React.Component);
|
||||
|
||||
export { Wave as default };
|
||||
Reference in New Issue
Block a user