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 };
|
||||
53
web/node_modules/antd/es/affix/index.d.ts
generated
vendored
Normal file
53
web/node_modules/antd/es/affix/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
import * as React from 'react';
|
||||
import { ConfigConsumerProps } from '../config-provider';
|
||||
declare function getDefaultTarget(): (Window & typeof globalThis) | null;
|
||||
export interface AffixProps {
|
||||
/**
|
||||
* 距离窗口顶部达到指定偏移量后触发
|
||||
*/
|
||||
offsetTop?: number;
|
||||
/** 距离窗口底部达到指定偏移量后触发 */
|
||||
offsetBottom?: number;
|
||||
style?: React.CSSProperties;
|
||||
/** 固定状态改变时触发的回调函数 */
|
||||
onChange?: (affixed?: boolean) => void;
|
||||
/** 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */
|
||||
target?: () => Window | HTMLElement | null;
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
declare enum AffixStatus {
|
||||
None = 0,
|
||||
Prepare = 1
|
||||
}
|
||||
export interface AffixState {
|
||||
affixStyle?: React.CSSProperties;
|
||||
placeholderStyle?: React.CSSProperties;
|
||||
status: AffixStatus;
|
||||
lastAffix: boolean;
|
||||
prevTarget: Window | HTMLElement | null;
|
||||
}
|
||||
declare class Affix extends React.Component<AffixProps, AffixState> {
|
||||
static defaultProps: {
|
||||
target: typeof getDefaultTarget;
|
||||
};
|
||||
state: AffixState;
|
||||
placeholderNode: HTMLDivElement;
|
||||
fixedNode: HTMLDivElement;
|
||||
private timeout;
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate(prevProps: AffixProps): void;
|
||||
componentWillUnmount(): void;
|
||||
getOffsetTop: () => number | undefined;
|
||||
getOffsetBottom: () => number | undefined;
|
||||
savePlaceholderNode: (node: HTMLDivElement) => void;
|
||||
saveFixedNode: (node: HTMLDivElement) => void;
|
||||
measure: () => void;
|
||||
prepareMeasure: () => void;
|
||||
updatePosition(): void;
|
||||
lazyUpdatePosition(): void;
|
||||
renderAffix: ({ getPrefixCls }: ConfigConsumerProps) => JSX.Element;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
export default Affix;
|
||||
326
web/node_modules/antd/es/affix/index.js
generated
vendored
Normal file
326
web/node_modules/antd/es/affix/index.js
generated
vendored
Normal file
@@ -0,0 +1,326 @@
|
||||
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _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); }
|
||||
|
||||
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); }
|
||||
|
||||
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
||||
var c = arguments.length,
|
||||
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
||||
d;
|
||||
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
}
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import omit from 'omit.js';
|
||||
import ResizeObserver from 'rc-resize-observer';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame';
|
||||
import { addObserveTarget, removeObserveTarget, getTargetRect, getFixedTop, getFixedBottom } from './utils';
|
||||
|
||||
function getDefaultTarget() {
|
||||
return typeof window !== 'undefined' ? window : null;
|
||||
}
|
||||
|
||||
var AffixStatus;
|
||||
|
||||
(function (AffixStatus) {
|
||||
AffixStatus[AffixStatus["None"] = 0] = "None";
|
||||
AffixStatus[AffixStatus["Prepare"] = 1] = "Prepare";
|
||||
})(AffixStatus || (AffixStatus = {}));
|
||||
|
||||
var Affix = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(Affix, _React$Component);
|
||||
|
||||
var _super = _createSuper(Affix);
|
||||
|
||||
function Affix() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Affix);
|
||||
|
||||
_this = _super.apply(this, arguments);
|
||||
_this.state = {
|
||||
status: AffixStatus.None,
|
||||
lastAffix: false,
|
||||
prevTarget: null
|
||||
};
|
||||
|
||||
_this.getOffsetTop = function () {
|
||||
var offsetBottom = _this.props.offsetBottom;
|
||||
var offsetTop = _this.props.offsetTop;
|
||||
|
||||
if (offsetBottom === undefined && offsetTop === undefined) {
|
||||
offsetTop = 0;
|
||||
}
|
||||
|
||||
return offsetTop;
|
||||
};
|
||||
|
||||
_this.getOffsetBottom = function () {
|
||||
return _this.props.offsetBottom;
|
||||
};
|
||||
|
||||
_this.savePlaceholderNode = function (node) {
|
||||
_this.placeholderNode = node;
|
||||
};
|
||||
|
||||
_this.saveFixedNode = function (node) {
|
||||
_this.fixedNode = node;
|
||||
}; // =================== Measure ===================
|
||||
|
||||
|
||||
_this.measure = function () {
|
||||
var _this$state = _this.state,
|
||||
status = _this$state.status,
|
||||
lastAffix = _this$state.lastAffix;
|
||||
var _this$props = _this.props,
|
||||
target = _this$props.target,
|
||||
onChange = _this$props.onChange;
|
||||
|
||||
if (status !== AffixStatus.Prepare || !_this.fixedNode || !_this.placeholderNode || !target) {
|
||||
return;
|
||||
}
|
||||
|
||||
var offsetTop = _this.getOffsetTop();
|
||||
|
||||
var offsetBottom = _this.getOffsetBottom();
|
||||
|
||||
var targetNode = target();
|
||||
|
||||
if (!targetNode) {
|
||||
return;
|
||||
}
|
||||
|
||||
var newState = {
|
||||
status: AffixStatus.None
|
||||
};
|
||||
var targetRect = getTargetRect(targetNode);
|
||||
var placeholderReact = getTargetRect(_this.placeholderNode);
|
||||
var fixedTop = getFixedTop(placeholderReact, targetRect, offsetTop);
|
||||
var fixedBottom = getFixedBottom(placeholderReact, targetRect, offsetBottom);
|
||||
|
||||
if (fixedTop !== undefined) {
|
||||
newState.affixStyle = {
|
||||
position: 'fixed',
|
||||
top: fixedTop,
|
||||
width: placeholderReact.width,
|
||||
height: placeholderReact.height
|
||||
};
|
||||
newState.placeholderStyle = {
|
||||
width: placeholderReact.width,
|
||||
height: placeholderReact.height
|
||||
};
|
||||
} else if (fixedBottom !== undefined) {
|
||||
newState.affixStyle = {
|
||||
position: 'fixed',
|
||||
bottom: fixedBottom,
|
||||
width: placeholderReact.width,
|
||||
height: placeholderReact.height
|
||||
};
|
||||
newState.placeholderStyle = {
|
||||
width: placeholderReact.width,
|
||||
height: placeholderReact.height
|
||||
};
|
||||
}
|
||||
|
||||
newState.lastAffix = !!newState.affixStyle;
|
||||
|
||||
if (onChange && lastAffix !== newState.lastAffix) {
|
||||
onChange(newState.lastAffix);
|
||||
}
|
||||
|
||||
_this.setState(newState);
|
||||
}; // @ts-ignore TS6133
|
||||
|
||||
|
||||
_this.prepareMeasure = function () {
|
||||
// event param is used before. Keep compatible ts define here.
|
||||
_this.setState({
|
||||
status: AffixStatus.Prepare,
|
||||
affixStyle: undefined,
|
||||
placeholderStyle: undefined
|
||||
}); // Test if `updatePosition` called
|
||||
|
||||
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
var onTestUpdatePosition = _this.props.onTestUpdatePosition;
|
||||
|
||||
if (onTestUpdatePosition) {
|
||||
onTestUpdatePosition();
|
||||
}
|
||||
}
|
||||
}; // =================== Render ===================
|
||||
|
||||
|
||||
_this.renderAffix = function (_ref) {
|
||||
var getPrefixCls = _ref.getPrefixCls;
|
||||
var _this$state2 = _this.state,
|
||||
affixStyle = _this$state2.affixStyle,
|
||||
placeholderStyle = _this$state2.placeholderStyle;
|
||||
var _this$props2 = _this.props,
|
||||
prefixCls = _this$props2.prefixCls,
|
||||
children = _this$props2.children;
|
||||
var className = classNames(_defineProperty({}, getPrefixCls('affix', prefixCls), affixStyle));
|
||||
var props = omit(_this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target', 'onChange']); // Omit this since `onTestUpdatePosition` only works on test.
|
||||
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
props = omit(props, ['onTestUpdatePosition']);
|
||||
}
|
||||
|
||||
return /*#__PURE__*/React.createElement(ResizeObserver, {
|
||||
onResize: function onResize() {
|
||||
_this.updatePosition();
|
||||
}
|
||||
}, /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
||||
ref: _this.savePlaceholderNode
|
||||
}), affixStyle && /*#__PURE__*/React.createElement("div", {
|
||||
style: placeholderStyle,
|
||||
"aria-hidden": "true"
|
||||
}), /*#__PURE__*/React.createElement("div", {
|
||||
className: className,
|
||||
ref: _this.saveFixedNode,
|
||||
style: affixStyle
|
||||
}, /*#__PURE__*/React.createElement(ResizeObserver, {
|
||||
onResize: function onResize() {
|
||||
_this.updatePosition();
|
||||
}
|
||||
}, children))));
|
||||
};
|
||||
|
||||
return _this;
|
||||
} // Event handler
|
||||
|
||||
|
||||
_createClass(Affix, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
var _this2 = this;
|
||||
|
||||
var target = this.props.target;
|
||||
|
||||
if (target) {
|
||||
// [Legacy] Wait for parent component ref has its value.
|
||||
// We should use target as directly element instead of function which makes element check hard.
|
||||
this.timeout = setTimeout(function () {
|
||||
addObserveTarget(target(), _this2); // Mock Event object.
|
||||
|
||||
_this2.updatePosition();
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(prevProps) {
|
||||
var prevTarget = this.state.prevTarget;
|
||||
var target = this.props.target;
|
||||
var newTarget = null;
|
||||
|
||||
if (target) {
|
||||
newTarget = target() || null;
|
||||
}
|
||||
|
||||
if (prevTarget !== newTarget) {
|
||||
removeObserveTarget(this);
|
||||
|
||||
if (newTarget) {
|
||||
addObserveTarget(newTarget, this); // Mock Event object.
|
||||
|
||||
this.updatePosition();
|
||||
}
|
||||
|
||||
this.setState({
|
||||
prevTarget: newTarget
|
||||
});
|
||||
}
|
||||
|
||||
if (prevProps.offsetTop !== this.props.offsetTop || prevProps.offsetBottom !== this.props.offsetBottom) {
|
||||
this.updatePosition();
|
||||
}
|
||||
|
||||
this.measure();
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
clearTimeout(this.timeout);
|
||||
removeObserveTarget(this);
|
||||
this.updatePosition.cancel(); // https://github.com/ant-design/ant-design/issues/22683
|
||||
|
||||
this.lazyUpdatePosition.cancel();
|
||||
} // Handle realign logic
|
||||
|
||||
}, {
|
||||
key: "updatePosition",
|
||||
value: function updatePosition() {
|
||||
this.prepareMeasure();
|
||||
}
|
||||
}, {
|
||||
key: "lazyUpdatePosition",
|
||||
value: function lazyUpdatePosition() {
|
||||
var target = this.props.target;
|
||||
var affixStyle = this.state.affixStyle; // Check position change before measure to make Safari smooth
|
||||
|
||||
if (target && affixStyle) {
|
||||
var offsetTop = this.getOffsetTop();
|
||||
var offsetBottom = this.getOffsetBottom();
|
||||
var targetNode = target();
|
||||
|
||||
if (targetNode && this.placeholderNode) {
|
||||
var targetRect = getTargetRect(targetNode);
|
||||
var placeholderReact = getTargetRect(this.placeholderNode);
|
||||
var fixedTop = getFixedTop(placeholderReact, targetRect, offsetTop);
|
||||
var fixedBottom = getFixedBottom(placeholderReact, targetRect, offsetBottom);
|
||||
|
||||
if (fixedTop !== undefined && affixStyle.top === fixedTop || fixedBottom !== undefined && affixStyle.bottom === fixedBottom) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} // Directly call prepare measure since it's already throttled.
|
||||
|
||||
|
||||
this.prepareMeasure();
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderAffix);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Affix;
|
||||
}(React.Component);
|
||||
|
||||
Affix.defaultProps = {
|
||||
target: getDefaultTarget
|
||||
};
|
||||
|
||||
__decorate([throttleByAnimationFrameDecorator()], Affix.prototype, "updatePosition", null);
|
||||
|
||||
__decorate([throttleByAnimationFrameDecorator()], Affix.prototype, "lazyUpdatePosition", null);
|
||||
|
||||
export default Affix;
|
||||
2
web/node_modules/antd/es/affix/style/css.js
generated
vendored
Normal file
2
web/node_modules/antd/es/affix/style/css.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.css';
|
||||
import './index.css';
|
||||
8
web/node_modules/antd/es/affix/style/index.css
generated
vendored
Normal file
8
web/node_modules/antd/es/affix/style/index.css
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
||||
/* stylelint-disable no-duplicate-selectors */
|
||||
/* stylelint-disable */
|
||||
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
||||
.ant-affix {
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
}
|
||||
2
web/node_modules/antd/es/affix/style/index.d.ts
generated
vendored
Normal file
2
web/node_modules/antd/es/affix/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
2
web/node_modules/antd/es/affix/style/index.js
generated
vendored
Normal file
2
web/node_modules/antd/es/affix/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
6
web/node_modules/antd/es/affix/style/index.less
generated
vendored
Normal file
6
web/node_modules/antd/es/affix/style/index.less
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
@import '../../style/themes/index';
|
||||
|
||||
.@{ant-prefix}-affix {
|
||||
position: fixed;
|
||||
z-index: @zindex-affix;
|
||||
}
|
||||
17
web/node_modules/antd/es/affix/utils.d.ts
generated
vendored
Normal file
17
web/node_modules/antd/es/affix/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import Affix from '.';
|
||||
export declare type BindElement = HTMLElement | Window | null | undefined;
|
||||
export declare type Rect = ClientRect | DOMRect;
|
||||
export declare function getTargetRect(target: BindElement): ClientRect;
|
||||
export declare function getFixedTop(placeholderReact: Rect, targetRect: Rect, offsetTop: number | undefined): number | undefined;
|
||||
export declare function getFixedBottom(placeholderReact: Rect, targetRect: Rect, offsetBottom: number | undefined): number | undefined;
|
||||
interface ObserverEntity {
|
||||
target: HTMLElement | Window;
|
||||
affixList: Affix[];
|
||||
eventHandlers: {
|
||||
[eventName: string]: any;
|
||||
};
|
||||
}
|
||||
export declare function getObserverEntities(): ObserverEntity[];
|
||||
export declare function addObserveTarget(target: HTMLElement | Window | null, affix: Affix): void;
|
||||
export declare function removeObserveTarget(affix: Affix): void;
|
||||
export {};
|
||||
83
web/node_modules/antd/es/affix/utils.js
generated
vendored
Normal file
83
web/node_modules/antd/es/affix/utils.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
import addEventListener from "rc-util/es/Dom/addEventListener";
|
||||
export function getTargetRect(target) {
|
||||
return target !== window ? target.getBoundingClientRect() : {
|
||||
top: 0,
|
||||
bottom: window.innerHeight
|
||||
};
|
||||
}
|
||||
export function getFixedTop(placeholderReact, targetRect, offsetTop) {
|
||||
if (offsetTop !== undefined && targetRect.top > placeholderReact.top - offsetTop) {
|
||||
return offsetTop + targetRect.top;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
export function getFixedBottom(placeholderReact, targetRect, offsetBottom) {
|
||||
if (offsetBottom !== undefined && targetRect.bottom < placeholderReact.bottom + offsetBottom) {
|
||||
var targetBottomOffset = window.innerHeight - targetRect.bottom;
|
||||
return offsetBottom + targetBottomOffset;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
} // ======================== Observer ========================
|
||||
|
||||
var TRIGGER_EVENTS = ['resize', 'scroll', 'touchstart', 'touchmove', 'touchend', 'pageshow', 'load'];
|
||||
var observerEntities = [];
|
||||
export function getObserverEntities() {
|
||||
// Only used in test env. Can be removed if refactor.
|
||||
return observerEntities;
|
||||
}
|
||||
export function addObserveTarget(target, affix) {
|
||||
if (!target) return;
|
||||
var entity = observerEntities.find(function (item) {
|
||||
return item.target === target;
|
||||
});
|
||||
|
||||
if (entity) {
|
||||
entity.affixList.push(affix);
|
||||
} else {
|
||||
entity = {
|
||||
target: target,
|
||||
affixList: [affix],
|
||||
eventHandlers: {}
|
||||
};
|
||||
observerEntities.push(entity); // Add listener
|
||||
|
||||
TRIGGER_EVENTS.forEach(function (eventName) {
|
||||
entity.eventHandlers[eventName] = addEventListener(target, eventName, function () {
|
||||
entity.affixList.forEach(function (targetAffix) {
|
||||
targetAffix.lazyUpdatePosition();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
export function removeObserveTarget(affix) {
|
||||
var observerEntity = observerEntities.find(function (oriObserverEntity) {
|
||||
var hasAffix = oriObserverEntity.affixList.some(function (item) {
|
||||
return item === affix;
|
||||
});
|
||||
|
||||
if (hasAffix) {
|
||||
oriObserverEntity.affixList = oriObserverEntity.affixList.filter(function (item) {
|
||||
return item !== affix;
|
||||
});
|
||||
}
|
||||
|
||||
return hasAffix;
|
||||
});
|
||||
|
||||
if (observerEntity && observerEntity.affixList.length === 0) {
|
||||
observerEntities = observerEntities.filter(function (item) {
|
||||
return item !== observerEntity;
|
||||
}); // Remove listener
|
||||
|
||||
TRIGGER_EVENTS.forEach(function (eventName) {
|
||||
var handler = observerEntity.eventHandlers[eventName];
|
||||
|
||||
if (handler && handler.remove) {
|
||||
handler.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
21
web/node_modules/antd/es/alert/ErrorBoundary.d.ts
generated
vendored
Normal file
21
web/node_modules/antd/es/alert/ErrorBoundary.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as React from 'react';
|
||||
interface ErrorBoundaryProps {
|
||||
message?: React.ReactNode;
|
||||
description?: React.ReactNode;
|
||||
}
|
||||
export default class ErrorBoundary extends React.Component<ErrorBoundaryProps, {
|
||||
error?: Error | null;
|
||||
info: {
|
||||
componentStack?: string;
|
||||
};
|
||||
}> {
|
||||
state: {
|
||||
error: undefined;
|
||||
info: {
|
||||
componentStack: string;
|
||||
};
|
||||
};
|
||||
componentDidCatch(error: Error | null, info: object): void;
|
||||
render(): {} | null | undefined;
|
||||
}
|
||||
export {};
|
||||
83
web/node_modules/antd/es/alert/ErrorBoundary.js
generated
vendored
Normal file
83
web/node_modules/antd/es/alert/ErrorBoundary.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
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 Alert from '.';
|
||||
|
||||
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(ErrorBoundary, _React$Component);
|
||||
|
||||
var _super = _createSuper(ErrorBoundary);
|
||||
|
||||
function ErrorBoundary() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, ErrorBoundary);
|
||||
|
||||
_this = _super.apply(this, arguments);
|
||||
_this.state = {
|
||||
error: undefined,
|
||||
info: {
|
||||
componentStack: ''
|
||||
}
|
||||
};
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(ErrorBoundary, [{
|
||||
key: "componentDidCatch",
|
||||
value: function componentDidCatch(error, info) {
|
||||
this.setState({
|
||||
error: error,
|
||||
info: info
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _this$props = this.props,
|
||||
message = _this$props.message,
|
||||
description = _this$props.description,
|
||||
children = _this$props.children;
|
||||
var _this$state = this.state,
|
||||
error = _this$state.error,
|
||||
info = _this$state.info;
|
||||
var componentStack = info && info.componentStack ? info.componentStack : null;
|
||||
var errorMessage = typeof message === 'undefined' ? (error || '').toString() : message;
|
||||
var errorDescription = typeof description === 'undefined' ? componentStack : description;
|
||||
|
||||
if (error) {
|
||||
return /*#__PURE__*/React.createElement(Alert, {
|
||||
type: "error",
|
||||
message: errorMessage,
|
||||
description: /*#__PURE__*/React.createElement("pre", null, errorDescription)
|
||||
});
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
}]);
|
||||
|
||||
return ErrorBoundary;
|
||||
}(React.Component);
|
||||
|
||||
export { ErrorBoundary as default };
|
||||
46
web/node_modules/antd/es/alert/index.d.ts
generated
vendored
Normal file
46
web/node_modules/antd/es/alert/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
import * as React from 'react';
|
||||
import { ConfigConsumerProps } from '../config-provider';
|
||||
import ErrorBoundary from './ErrorBoundary';
|
||||
export interface AlertProps {
|
||||
/**
|
||||
* Type of Alert styles, options:`success`, `info`, `warning`, `error`
|
||||
*/
|
||||
type?: 'success' | 'info' | 'warning' | 'error';
|
||||
/** Whether Alert can be closed */
|
||||
closable?: boolean;
|
||||
/** Close text to show */
|
||||
closeText?: React.ReactNode;
|
||||
/** Content of Alert */
|
||||
message: React.ReactNode;
|
||||
/** Additional content of Alert */
|
||||
description?: React.ReactNode;
|
||||
/** Callback when close Alert */
|
||||
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
||||
/** Trigger when animation ending of Alert */
|
||||
afterClose?: () => void;
|
||||
/** Whether to show icon */
|
||||
showIcon?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
banner?: boolean;
|
||||
icon?: React.ReactNode;
|
||||
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
||||
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
||||
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
||||
}
|
||||
export interface AlertState {
|
||||
closing: boolean;
|
||||
closed: boolean;
|
||||
}
|
||||
export default class Alert extends React.Component<AlertProps, AlertState> {
|
||||
static ErrorBoundary: typeof ErrorBoundary;
|
||||
state: {
|
||||
closing: boolean;
|
||||
closed: boolean;
|
||||
};
|
||||
handleClose: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
||||
animationEnd: () => void;
|
||||
renderAlert: ({ getPrefixCls, direction }: ConfigConsumerProps) => JSX.Element | null;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
186
web/node_modules/antd/es/alert/index.js
generated
vendored
Normal file
186
web/node_modules/antd/es/alert/index.js
generated
vendored
Normal file
@@ -0,0 +1,186 @@
|
||||
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _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 * as ReactDOM from 'react-dom';
|
||||
import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
||||
import CheckCircleOutlined from '@ant-design/icons/CheckCircleOutlined';
|
||||
import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
|
||||
import InfoCircleOutlined from '@ant-design/icons/InfoCircleOutlined';
|
||||
import CloseCircleOutlined from '@ant-design/icons/CloseCircleOutlined';
|
||||
import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled';
|
||||
import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled';
|
||||
import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled';
|
||||
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
|
||||
import Animate from 'rc-animate';
|
||||
import classNames from 'classnames';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
import getDataOrAriaProps from '../_util/getDataOrAriaProps';
|
||||
import ErrorBoundary from './ErrorBoundary';
|
||||
|
||||
function noop() {}
|
||||
|
||||
var iconMapFilled = {
|
||||
success: CheckCircleFilled,
|
||||
info: InfoCircleFilled,
|
||||
error: CloseCircleFilled,
|
||||
warning: ExclamationCircleFilled
|
||||
};
|
||||
var iconMapOutlined = {
|
||||
success: CheckCircleOutlined,
|
||||
info: InfoCircleOutlined,
|
||||
error: CloseCircleOutlined,
|
||||
warning: ExclamationCircleOutlined
|
||||
};
|
||||
|
||||
var Alert = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(Alert, _React$Component);
|
||||
|
||||
var _super = _createSuper(Alert);
|
||||
|
||||
function Alert() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Alert);
|
||||
|
||||
_this = _super.apply(this, arguments);
|
||||
_this.state = {
|
||||
closing: false,
|
||||
closed: false
|
||||
};
|
||||
|
||||
_this.handleClose = function (e) {
|
||||
e.preventDefault();
|
||||
var dom = ReactDOM.findDOMNode(_assertThisInitialized(_this));
|
||||
dom.style.height = "".concat(dom.offsetHeight, "px"); // Magic code
|
||||
// 重复一次后才能正确设置 height
|
||||
|
||||
dom.style.height = "".concat(dom.offsetHeight, "px");
|
||||
|
||||
_this.setState({
|
||||
closing: true
|
||||
});
|
||||
|
||||
(_this.props.onClose || noop)(e);
|
||||
};
|
||||
|
||||
_this.animationEnd = function () {
|
||||
_this.setState({
|
||||
closing: false,
|
||||
closed: true
|
||||
});
|
||||
|
||||
(_this.props.afterClose || noop)();
|
||||
};
|
||||
|
||||
_this.renderAlert = function (_ref) {
|
||||
var _classNames;
|
||||
|
||||
var getPrefixCls = _ref.getPrefixCls,
|
||||
direction = _ref.direction;
|
||||
var _this$props = _this.props,
|
||||
description = _this$props.description,
|
||||
customizePrefixCls = _this$props.prefixCls,
|
||||
message = _this$props.message,
|
||||
closeText = _this$props.closeText,
|
||||
banner = _this$props.banner,
|
||||
_this$props$className = _this$props.className,
|
||||
className = _this$props$className === void 0 ? '' : _this$props$className,
|
||||
style = _this$props.style,
|
||||
icon = _this$props.icon,
|
||||
onMouseEnter = _this$props.onMouseEnter,
|
||||
onMouseLeave = _this$props.onMouseLeave,
|
||||
onClick = _this$props.onClick;
|
||||
var _this$props2 = _this.props,
|
||||
closable = _this$props2.closable,
|
||||
type = _this$props2.type,
|
||||
showIcon = _this$props2.showIcon;
|
||||
var _this$state = _this.state,
|
||||
closing = _this$state.closing,
|
||||
closed = _this$state.closed;
|
||||
var prefixCls = getPrefixCls('alert', customizePrefixCls); // banner模式默认有 Icon
|
||||
|
||||
showIcon = banner && showIcon === undefined ? true : showIcon; // banner模式默认为警告
|
||||
|
||||
type = banner && type === undefined ? 'warning' : type || 'info'; // use outline icon in alert with description
|
||||
|
||||
var iconType = (description ? iconMapOutlined : iconMapFilled)[type] || null; // closeable when closeText is assigned
|
||||
|
||||
if (closeText) {
|
||||
closable = true;
|
||||
}
|
||||
|
||||
var alertCls = classNames(prefixCls, "".concat(prefixCls, "-").concat(type), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-closing"), closing), _defineProperty(_classNames, "".concat(prefixCls, "-with-description"), !!description), _defineProperty(_classNames, "".concat(prefixCls, "-no-icon"), !showIcon), _defineProperty(_classNames, "".concat(prefixCls, "-banner"), !!banner), _defineProperty(_classNames, "".concat(prefixCls, "-closable"), closable), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames), className);
|
||||
var closeIcon = closable ? /*#__PURE__*/React.createElement("button", {
|
||||
type: "button",
|
||||
onClick: _this.handleClose,
|
||||
className: "".concat(prefixCls, "-close-icon"),
|
||||
tabIndex: 0
|
||||
}, closeText ? /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-close-text")
|
||||
}, closeText) : /*#__PURE__*/React.createElement(CloseOutlined, null)) : null;
|
||||
var dataOrAriaProps = getDataOrAriaProps(_this.props);
|
||||
var iconNode = icon && (React.isValidElement(icon) ? React.cloneElement(icon, {
|
||||
className: classNames("".concat(prefixCls, "-icon"), _defineProperty({}, icon.props.className, icon.props.className))
|
||||
}) : /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}, icon)) || React.createElement(iconType, {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
});
|
||||
return closed ? null : /*#__PURE__*/React.createElement(Animate, {
|
||||
component: "",
|
||||
showProp: "data-show",
|
||||
transitionName: "".concat(prefixCls, "-slide-up"),
|
||||
onEnd: _this.animationEnd
|
||||
}, /*#__PURE__*/React.createElement("div", _extends({
|
||||
"data-show": !closing,
|
||||
className: alertCls,
|
||||
style: style,
|
||||
onMouseEnter: onMouseEnter,
|
||||
onMouseLeave: onMouseLeave,
|
||||
onClick: onClick
|
||||
}, dataOrAriaProps), showIcon ? iconNode : null, /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-message")
|
||||
}, message), /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-description")
|
||||
}, description), closeIcon));
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Alert, [{
|
||||
key: "render",
|
||||
value: function render() {
|
||||
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderAlert);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Alert;
|
||||
}(React.Component);
|
||||
|
||||
export { Alert as default };
|
||||
Alert.ErrorBoundary = ErrorBoundary;
|
||||
2
web/node_modules/antd/es/alert/style/css.js
generated
vendored
Normal file
2
web/node_modules/antd/es/alert/style/css.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.css';
|
||||
import './index.css';
|
||||
248
web/node_modules/antd/es/alert/style/index.css
generated
vendored
Normal file
248
web/node_modules/antd/es/alert/style/index.css
generated
vendored
Normal file
@@ -0,0 +1,248 @@
|
||||
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
||||
/* stylelint-disable no-duplicate-selectors */
|
||||
/* stylelint-disable */
|
||||
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
||||
.ant-alert {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
font-size: 14px;
|
||||
font-variant: tabular-nums;
|
||||
line-height: 1.5715;
|
||||
list-style: none;
|
||||
-webkit-font-feature-settings: 'tnum';
|
||||
font-feature-settings: 'tnum';
|
||||
position: relative;
|
||||
padding: 8px 15px 8px 37px;
|
||||
word-wrap: break-word;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.ant-alert.ant-alert-no-icon {
|
||||
padding: 8px 15px;
|
||||
}
|
||||
.ant-alert.ant-alert-closable {
|
||||
padding-right: 30px;
|
||||
}
|
||||
.ant-alert-icon {
|
||||
position: absolute;
|
||||
top: 12.0005px;
|
||||
left: 16px;
|
||||
}
|
||||
.ant-alert-description {
|
||||
display: none;
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.ant-alert-success {
|
||||
background-color: #f6ffed;
|
||||
border: 1px solid #b7eb8f;
|
||||
}
|
||||
.ant-alert-success .ant-alert-icon {
|
||||
color: #52c41a;
|
||||
}
|
||||
.ant-alert-info {
|
||||
background-color: #e6f7ff;
|
||||
border: 1px solid #91d5ff;
|
||||
}
|
||||
.ant-alert-info .ant-alert-icon {
|
||||
color: #1890ff;
|
||||
}
|
||||
.ant-alert-warning {
|
||||
background-color: #fffbe6;
|
||||
border: 1px solid #ffe58f;
|
||||
}
|
||||
.ant-alert-warning .ant-alert-icon {
|
||||
color: #faad14;
|
||||
}
|
||||
.ant-alert-error {
|
||||
background-color: #fff2f0;
|
||||
border: 1px solid #ffccc7;
|
||||
}
|
||||
.ant-alert-error .ant-alert-icon {
|
||||
color: #ff4d4f;
|
||||
}
|
||||
.ant-alert-error .ant-alert-description > pre {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.ant-alert-close-icon {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 16px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
font-size: 12px;
|
||||
line-height: 22px;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ant-alert-close-icon .anticon-close {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
-webkit-transition: color 0.3s;
|
||||
transition: color 0.3s;
|
||||
}
|
||||
.ant-alert-close-icon .anticon-close:hover {
|
||||
color: rgba(0, 0, 0, 0.75);
|
||||
}
|
||||
.ant-alert-close-text {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
-webkit-transition: color 0.3s;
|
||||
transition: color 0.3s;
|
||||
}
|
||||
.ant-alert-close-text:hover {
|
||||
color: rgba(0, 0, 0, 0.75);
|
||||
}
|
||||
.ant-alert-with-description {
|
||||
position: relative;
|
||||
padding: 15px 15px 15px 64px;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
line-height: 1.5715;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.ant-alert-with-description.ant-alert-no-icon {
|
||||
padding: 15px 15px;
|
||||
}
|
||||
.ant-alert-with-description .ant-alert-icon {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
left: 24px;
|
||||
font-size: 24px;
|
||||
}
|
||||
.ant-alert-with-description .ant-alert-close-icon {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ant-alert-with-description .ant-alert-message {
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-size: 16px;
|
||||
}
|
||||
.ant-alert-message {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
.ant-alert-with-description .ant-alert-description {
|
||||
display: block;
|
||||
}
|
||||
.ant-alert.ant-alert-closing {
|
||||
height: 0 !important;
|
||||
margin: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
-webkit-transform-origin: 50% 0;
|
||||
transform-origin: 50% 0;
|
||||
-webkit-transition: all 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
transition: all 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
}
|
||||
.ant-alert-slide-up-leave {
|
||||
-webkit-animation: antAlertSlideUpOut 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
animation: antAlertSlideUpOut 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
||||
-webkit-animation-fill-mode: both;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
.ant-alert-banner {
|
||||
margin-bottom: 0;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
@-webkit-keyframes antAlertSlideUpIn {
|
||||
0% {
|
||||
-webkit-transform: scaleY(0);
|
||||
transform: scaleY(0);
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scaleY(1);
|
||||
transform: scaleY(1);
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes antAlertSlideUpIn {
|
||||
0% {
|
||||
-webkit-transform: scaleY(0);
|
||||
transform: scaleY(0);
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scaleY(1);
|
||||
transform: scaleY(1);
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes antAlertSlideUpOut {
|
||||
0% {
|
||||
-webkit-transform: scaleY(1);
|
||||
transform: scaleY(1);
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scaleY(0);
|
||||
transform: scaleY(0);
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes antAlertSlideUpOut {
|
||||
0% {
|
||||
-webkit-transform: scaleY(1);
|
||||
transform: scaleY(1);
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scaleY(0);
|
||||
transform: scaleY(0);
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
.ant-alert-rtl {
|
||||
padding: 8px 37px 8px 15px;
|
||||
direction: rtl;
|
||||
}
|
||||
.ant-alert-rtl.ant-alert.ant-alert-closable {
|
||||
padding-right: 15px;
|
||||
padding-left: 30px;
|
||||
}
|
||||
.ant-alert-rtl .ant-alert-icon {
|
||||
right: 16px;
|
||||
left: auto;
|
||||
}
|
||||
.ant-alert-rtl .ant-alert-close-icon {
|
||||
right: auto;
|
||||
left: 16px;
|
||||
}
|
||||
.ant-alert-rtl.ant-alert-with-description {
|
||||
padding: 15px 64px 15px 15px;
|
||||
}
|
||||
.ant-alert-rtl.ant-alert-with-description.ant-alert-no-icon {
|
||||
padding: 15px;
|
||||
}
|
||||
.ant-alert-rtl.ant-alert-with-description .ant-alert-icon {
|
||||
right: 24px;
|
||||
left: auto;
|
||||
}
|
||||
.ant-alert-rtl.ant-alert-with-description .ant-alert-close-icon {
|
||||
right: auto;
|
||||
left: 16px;
|
||||
}
|
||||
2
web/node_modules/antd/es/alert/style/index.d.ts
generated
vendored
Normal file
2
web/node_modules/antd/es/alert/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
2
web/node_modules/antd/es/alert/style/index.js
generated
vendored
Normal file
2
web/node_modules/antd/es/alert/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
191
web/node_modules/antd/es/alert/style/index.less
generated
vendored
Normal file
191
web/node_modules/antd/es/alert/style/index.less
generated
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../style/mixins/index';
|
||||
|
||||
@alert-prefix-cls: ~'@{ant-prefix}-alert';
|
||||
|
||||
.@{alert-prefix-cls} {
|
||||
.reset-component;
|
||||
|
||||
position: relative;
|
||||
padding: 8px 15px 8px 37px;
|
||||
word-wrap: break-word;
|
||||
border-radius: @border-radius-base;
|
||||
|
||||
&&-no-icon {
|
||||
padding: @alert-no-icon-padding-vertical 15px;
|
||||
}
|
||||
|
||||
&&-closable {
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
&-icon {
|
||||
position: absolute;
|
||||
top: 8px + @font-size-base * @line-height-base / 2 - @font-size-base / 2;
|
||||
left: 16px;
|
||||
}
|
||||
|
||||
&-description {
|
||||
display: none;
|
||||
font-size: @font-size-base;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
&-success {
|
||||
background-color: @alert-success-bg-color;
|
||||
border: @border-width-base @border-style-base @alert-success-border-color;
|
||||
.@{alert-prefix-cls}-icon {
|
||||
color: @alert-success-icon-color;
|
||||
}
|
||||
}
|
||||
|
||||
&-info {
|
||||
background-color: @alert-info-bg-color;
|
||||
border: @border-width-base @border-style-base @alert-info-border-color;
|
||||
.@{alert-prefix-cls}-icon {
|
||||
color: @alert-info-icon-color;
|
||||
}
|
||||
}
|
||||
|
||||
&-warning {
|
||||
background-color: @alert-warning-bg-color;
|
||||
border: @border-width-base @border-style-base @alert-warning-border-color;
|
||||
.@{alert-prefix-cls}-icon {
|
||||
color: @alert-warning-icon-color;
|
||||
}
|
||||
}
|
||||
|
||||
&-error {
|
||||
background-color: @alert-error-bg-color;
|
||||
border: @border-width-base @border-style-base @alert-error-border-color;
|
||||
|
||||
.@{alert-prefix-cls}-icon {
|
||||
color: @alert-error-icon-color;
|
||||
}
|
||||
|
||||
.@{alert-prefix-cls}-description > pre {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-close-icon {
|
||||
position: absolute;
|
||||
top: @padding-xs;
|
||||
right: 16px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 22px;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
|
||||
.@{iconfont-css-prefix}-close {
|
||||
color: @alert-close-color;
|
||||
transition: color 0.3s;
|
||||
&:hover {
|
||||
color: @alert-close-hover-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-close-text {
|
||||
color: @alert-close-color;
|
||||
transition: color 0.3s;
|
||||
&:hover {
|
||||
color: @alert-close-hover-color;
|
||||
}
|
||||
}
|
||||
|
||||
&-with-description {
|
||||
position: relative;
|
||||
padding: 15px 15px 15px 64px;
|
||||
color: @alert-text-color;
|
||||
line-height: @line-height-base;
|
||||
border-radius: @border-radius-base;
|
||||
}
|
||||
|
||||
&-with-description&-no-icon {
|
||||
padding: @alert-with-description-no-icon-padding-vertical 15px;
|
||||
}
|
||||
|
||||
&-with-description &-icon {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
left: 24px;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
&-with-description &-close-icon {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
font-size: @font-size-base;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&-with-description &-message {
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
color: @alert-message-color;
|
||||
font-size: @font-size-lg;
|
||||
}
|
||||
|
||||
&-message {
|
||||
color: @alert-message-color;
|
||||
}
|
||||
|
||||
&-with-description &-description {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&&-closing {
|
||||
height: 0 !important;
|
||||
margin: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
transform-origin: 50% 0;
|
||||
transition: all 0.3s @ease-in-out-circ;
|
||||
}
|
||||
|
||||
&-slide-up-leave {
|
||||
animation: antAlertSlideUpOut 0.3s @ease-in-out-circ;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
|
||||
&-banner {
|
||||
margin-bottom: 0;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes antAlertSlideUpIn {
|
||||
0% {
|
||||
transform: scaleY(0);
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: scaleY(1);
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes antAlertSlideUpOut {
|
||||
0% {
|
||||
transform: scaleY(1);
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
transform: scaleY(0);
|
||||
transform-origin: 0% 0%;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@import './rtl.less';
|
||||
58
web/node_modules/antd/es/alert/style/rtl.less
generated
vendored
Normal file
58
web/node_modules/antd/es/alert/style/rtl.less
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../style/mixins/index';
|
||||
|
||||
@alert-prefix-cls: ~'@{ant-prefix}-alert';
|
||||
|
||||
.@{alert-prefix-cls} {
|
||||
&-rtl {
|
||||
padding: 8px 37px 8px 15px;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
&&-closable {
|
||||
.@{alert-prefix-cls}-rtl& {
|
||||
padding-right: 15px;
|
||||
padding-left: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
&-icon {
|
||||
.@{alert-prefix-cls}-rtl & {
|
||||
right: 16px;
|
||||
left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&-close-icon {
|
||||
.@{alert-prefix-cls}-rtl & {
|
||||
right: auto;
|
||||
left: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
&-with-description {
|
||||
.@{alert-prefix-cls}-rtl& {
|
||||
padding: 15px 64px 15px 15px;
|
||||
}
|
||||
}
|
||||
|
||||
&-with-description&-no-icon {
|
||||
.@{alert-prefix-cls}-rtl& {
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
&-with-description &-icon {
|
||||
.@{alert-prefix-cls}-rtl& {
|
||||
right: 24px;
|
||||
left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&-with-description &-close-icon {
|
||||
.@{alert-prefix-cls}-rtl& {
|
||||
right: auto;
|
||||
left: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
81
web/node_modules/antd/es/anchor/Anchor.d.ts
generated
vendored
Normal file
81
web/node_modules/antd/es/anchor/Anchor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
import * as React from 'react';
|
||||
import * as PropTypes from 'prop-types';
|
||||
import AnchorLink from './AnchorLink';
|
||||
import { ConfigConsumerProps } from '../config-provider';
|
||||
declare function getDefaultContainer(): Window & typeof globalThis;
|
||||
export declare type AnchorContainer = HTMLElement | Window;
|
||||
export interface AnchorProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
children?: React.ReactNode;
|
||||
offsetTop?: number;
|
||||
bounds?: number;
|
||||
affix?: boolean;
|
||||
showInkInFixed?: boolean;
|
||||
getContainer?: () => AnchorContainer;
|
||||
/** Return customize highlight anchor */
|
||||
getCurrentAnchor?: () => string;
|
||||
onClick?: (e: React.MouseEvent<HTMLElement>, link: {
|
||||
title: React.ReactNode;
|
||||
href: string;
|
||||
}) => void;
|
||||
/** Scroll to target offset value, if none, it's offsetTop prop value or 0. */
|
||||
targetOffset?: number;
|
||||
/** Listening event when scrolling change active link */
|
||||
onChange?: (currentActiveLink: string) => void;
|
||||
}
|
||||
export interface AnchorState {
|
||||
activeLink: null | string;
|
||||
}
|
||||
export interface AnchorDefaultProps extends AnchorProps {
|
||||
prefixCls: string;
|
||||
affix: boolean;
|
||||
showInkInFixed: boolean;
|
||||
getContainer: () => AnchorContainer;
|
||||
}
|
||||
export interface AntAnchor {
|
||||
registerLink: (link: string) => void;
|
||||
unregisterLink: (link: string) => void;
|
||||
activeLink: string | null;
|
||||
scrollTo: (link: string) => void;
|
||||
onClick?: (e: React.MouseEvent<HTMLElement>, link: {
|
||||
title: React.ReactNode;
|
||||
href: string;
|
||||
}) => void;
|
||||
}
|
||||
export default class Anchor extends React.Component<AnchorProps, AnchorState> {
|
||||
static Link: typeof AnchorLink;
|
||||
static defaultProps: {
|
||||
affix: boolean;
|
||||
showInkInFixed: boolean;
|
||||
getContainer: typeof getDefaultContainer;
|
||||
};
|
||||
static childContextTypes: {
|
||||
antAnchor: PropTypes.Requireable<object>;
|
||||
};
|
||||
state: {
|
||||
activeLink: null;
|
||||
};
|
||||
private inkNode;
|
||||
private scrollContainer;
|
||||
private links;
|
||||
private scrollEvent;
|
||||
private animating;
|
||||
private prefixCls?;
|
||||
getChildContext(): {
|
||||
antAnchor: AntAnchor;
|
||||
};
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate(): void;
|
||||
componentWillUnmount(): void;
|
||||
getCurrentAnchor(offsetTop?: number, bounds?: number): string;
|
||||
handleScrollTo: (link: string) => void;
|
||||
saveInkNode: (node: HTMLSpanElement) => void;
|
||||
setCurrentActiveLink: (link: string) => void;
|
||||
handleScroll: () => void;
|
||||
updateInk: () => void;
|
||||
renderAnchor: ({ getPrefixCls, direction }: ConfigConsumerProps) => JSX.Element;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
export {};
|
||||
343
web/node_modules/antd/es/anchor/Anchor.js
generated
vendored
Normal file
343
web/node_modules/antd/es/anchor/Anchor.js
generated
vendored
Normal file
@@ -0,0 +1,343 @@
|
||||
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _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 * as ReactDOM from 'react-dom';
|
||||
import * as PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import addEventListener from "rc-util/es/Dom/addEventListener";
|
||||
import Affix from '../affix';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
import scrollTo from '../_util/scrollTo';
|
||||
import getScroll from '../_util/getScroll';
|
||||
|
||||
function getDefaultContainer() {
|
||||
return window;
|
||||
}
|
||||
|
||||
function getOffsetTop(element, container) {
|
||||
if (!element) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!element.getClientRects().length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var rect = element.getBoundingClientRect();
|
||||
|
||||
if (rect.width || rect.height) {
|
||||
if (container === window) {
|
||||
container = element.ownerDocument.documentElement;
|
||||
return rect.top - container.clientTop;
|
||||
}
|
||||
|
||||
return rect.top - container.getBoundingClientRect().top;
|
||||
}
|
||||
|
||||
return rect.top;
|
||||
}
|
||||
|
||||
var sharpMatcherRegx = /#([^#]+)$/;
|
||||
|
||||
var Anchor = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(Anchor, _React$Component);
|
||||
|
||||
var _super = _createSuper(Anchor);
|
||||
|
||||
function Anchor() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Anchor);
|
||||
|
||||
_this = _super.apply(this, arguments);
|
||||
_this.state = {
|
||||
activeLink: null
|
||||
};
|
||||
_this.links = [];
|
||||
|
||||
_this.handleScrollTo = function (link) {
|
||||
var _this$props = _this.props,
|
||||
offsetTop = _this$props.offsetTop,
|
||||
getContainer = _this$props.getContainer,
|
||||
targetOffset = _this$props.targetOffset;
|
||||
|
||||
_this.setCurrentActiveLink(link);
|
||||
|
||||
var container = getContainer();
|
||||
var scrollTop = getScroll(container, true);
|
||||
var sharpLinkMatch = sharpMatcherRegx.exec(link);
|
||||
|
||||
if (!sharpLinkMatch) {
|
||||
return;
|
||||
}
|
||||
|
||||
var targetElement = document.getElementById(sharpLinkMatch[1]);
|
||||
|
||||
if (!targetElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
var eleOffsetTop = getOffsetTop(targetElement, container);
|
||||
var y = scrollTop + eleOffsetTop;
|
||||
y -= targetOffset !== undefined ? targetOffset : offsetTop || 0;
|
||||
_this.animating = true;
|
||||
scrollTo(y, {
|
||||
callback: function callback() {
|
||||
_this.animating = false;
|
||||
},
|
||||
getContainer: getContainer
|
||||
});
|
||||
};
|
||||
|
||||
_this.saveInkNode = function (node) {
|
||||
_this.inkNode = node;
|
||||
};
|
||||
|
||||
_this.setCurrentActiveLink = function (link) {
|
||||
var activeLink = _this.state.activeLink;
|
||||
var onChange = _this.props.onChange;
|
||||
|
||||
if (activeLink !== link) {
|
||||
_this.setState({
|
||||
activeLink: link
|
||||
});
|
||||
|
||||
if (onChange) {
|
||||
onChange(link);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_this.handleScroll = function () {
|
||||
if (_this.animating) {
|
||||
return;
|
||||
}
|
||||
|
||||
var _this$props2 = _this.props,
|
||||
offsetTop = _this$props2.offsetTop,
|
||||
bounds = _this$props2.bounds,
|
||||
targetOffset = _this$props2.targetOffset;
|
||||
|
||||
var currentActiveLink = _this.getCurrentAnchor(targetOffset !== undefined ? targetOffset : offsetTop || 0, bounds);
|
||||
|
||||
_this.setCurrentActiveLink(currentActiveLink);
|
||||
};
|
||||
|
||||
_this.updateInk = function () {
|
||||
if (typeof document === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
var _assertThisInitialize = _assertThisInitialized(_this),
|
||||
prefixCls = _assertThisInitialize.prefixCls;
|
||||
|
||||
var anchorNode = ReactDOM.findDOMNode(_assertThisInitialized(_this));
|
||||
var linkNode = anchorNode.getElementsByClassName("".concat(prefixCls, "-link-title-active"))[0];
|
||||
|
||||
if (linkNode) {
|
||||
_this.inkNode.style.top = "".concat(linkNode.offsetTop + linkNode.clientHeight / 2 - 4.5, "px");
|
||||
}
|
||||
};
|
||||
|
||||
_this.renderAnchor = function (_ref) {
|
||||
var getPrefixCls = _ref.getPrefixCls,
|
||||
direction = _ref.direction;
|
||||
var _this$props3 = _this.props,
|
||||
customizePrefixCls = _this$props3.prefixCls,
|
||||
_this$props3$classNam = _this$props3.className,
|
||||
className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
|
||||
style = _this$props3.style,
|
||||
offsetTop = _this$props3.offsetTop,
|
||||
affix = _this$props3.affix,
|
||||
showInkInFixed = _this$props3.showInkInFixed,
|
||||
children = _this$props3.children,
|
||||
getContainer = _this$props3.getContainer;
|
||||
var activeLink = _this.state.activeLink;
|
||||
var prefixCls = getPrefixCls('anchor', customizePrefixCls); // To support old version react.
|
||||
// Have to add prefixCls on the instance.
|
||||
// https://github.com/facebook/react/issues/12397
|
||||
|
||||
_this.prefixCls = prefixCls;
|
||||
var inkClass = classNames("".concat(prefixCls, "-ink-ball"), {
|
||||
visible: activeLink
|
||||
});
|
||||
var wrapperClass = classNames(className, "".concat(prefixCls, "-wrapper"), _defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'));
|
||||
var anchorClass = classNames(prefixCls, {
|
||||
fixed: !affix && !showInkInFixed
|
||||
});
|
||||
|
||||
var wrapperStyle = _extends({
|
||||
maxHeight: offsetTop ? "calc(100vh - ".concat(offsetTop, "px)") : '100vh'
|
||||
}, style);
|
||||
|
||||
var anchorContent = /*#__PURE__*/React.createElement("div", {
|
||||
className: wrapperClass,
|
||||
style: wrapperStyle
|
||||
}, /*#__PURE__*/React.createElement("div", {
|
||||
className: anchorClass
|
||||
}, /*#__PURE__*/React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-ink")
|
||||
}, /*#__PURE__*/React.createElement("span", {
|
||||
className: inkClass,
|
||||
ref: _this.saveInkNode
|
||||
})), children));
|
||||
return !affix ? anchorContent : /*#__PURE__*/React.createElement(Affix, {
|
||||
offsetTop: offsetTop,
|
||||
target: getContainer
|
||||
}, anchorContent);
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Anchor, [{
|
||||
key: "getChildContext",
|
||||
value: function getChildContext() {
|
||||
var _this2 = this;
|
||||
|
||||
var antAnchor = {
|
||||
registerLink: function registerLink(link) {
|
||||
if (!_this2.links.includes(link)) {
|
||||
_this2.links.push(link);
|
||||
}
|
||||
},
|
||||
unregisterLink: function unregisterLink(link) {
|
||||
var index = _this2.links.indexOf(link);
|
||||
|
||||
if (index !== -1) {
|
||||
_this2.links.splice(index, 1);
|
||||
}
|
||||
},
|
||||
activeLink: this.state.activeLink,
|
||||
scrollTo: this.handleScrollTo,
|
||||
onClick: this.props.onClick
|
||||
};
|
||||
return {
|
||||
antAnchor: antAnchor
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
var getContainer = this.props.getContainer;
|
||||
this.scrollContainer = getContainer();
|
||||
this.scrollEvent = addEventListener(this.scrollContainer, 'scroll', this.handleScroll);
|
||||
this.handleScroll();
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate() {
|
||||
if (this.scrollEvent) {
|
||||
var getContainer = this.props.getContainer;
|
||||
var currentContainer = getContainer();
|
||||
|
||||
if (this.scrollContainer !== currentContainer) {
|
||||
this.scrollContainer = currentContainer;
|
||||
this.scrollEvent.remove();
|
||||
this.scrollEvent = addEventListener(this.scrollContainer, 'scroll', this.handleScroll);
|
||||
this.handleScroll();
|
||||
}
|
||||
}
|
||||
|
||||
this.updateInk();
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
if (this.scrollEvent) {
|
||||
this.scrollEvent.remove();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "getCurrentAnchor",
|
||||
value: function getCurrentAnchor() {
|
||||
var offsetTop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
||||
var bounds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
|
||||
var getCurrentAnchor = this.props.getCurrentAnchor;
|
||||
|
||||
if (typeof getCurrentAnchor === 'function') {
|
||||
return getCurrentAnchor();
|
||||
}
|
||||
|
||||
var activeLink = '';
|
||||
|
||||
if (typeof document === 'undefined') {
|
||||
return activeLink;
|
||||
}
|
||||
|
||||
var linkSections = [];
|
||||
var getContainer = this.props.getContainer;
|
||||
var container = getContainer();
|
||||
this.links.forEach(function (link) {
|
||||
var sharpLinkMatch = sharpMatcherRegx.exec(link.toString());
|
||||
|
||||
if (!sharpLinkMatch) {
|
||||
return;
|
||||
}
|
||||
|
||||
var target = document.getElementById(sharpLinkMatch[1]);
|
||||
|
||||
if (target) {
|
||||
var top = getOffsetTop(target, container);
|
||||
|
||||
if (top < offsetTop + bounds) {
|
||||
linkSections.push({
|
||||
link: link,
|
||||
top: top
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (linkSections.length) {
|
||||
var maxSection = linkSections.reduce(function (prev, curr) {
|
||||
return curr.top > prev.top ? curr : prev;
|
||||
});
|
||||
return maxSection.link;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderAnchor);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Anchor;
|
||||
}(React.Component);
|
||||
|
||||
export { Anchor as default };
|
||||
Anchor.defaultProps = {
|
||||
affix: true,
|
||||
showInkInFixed: false,
|
||||
getContainer: getDefaultContainer
|
||||
};
|
||||
Anchor.childContextTypes = {
|
||||
antAnchor: PropTypes.object
|
||||
};
|
||||
30
web/node_modules/antd/es/anchor/AnchorLink.d.ts
generated
vendored
Normal file
30
web/node_modules/antd/es/anchor/AnchorLink.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import * as React from 'react';
|
||||
import * as PropTypes from 'prop-types';
|
||||
import { AntAnchor } from './Anchor';
|
||||
import { ConfigConsumerProps } from '../config-provider';
|
||||
export interface AnchorLinkProps {
|
||||
prefixCls?: string;
|
||||
href: string;
|
||||
target?: string;
|
||||
title: React.ReactNode;
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
declare class AnchorLink extends React.Component<AnchorLinkProps, any> {
|
||||
static defaultProps: {
|
||||
href: string;
|
||||
};
|
||||
static contextTypes: {
|
||||
antAnchor: PropTypes.Requireable<object>;
|
||||
};
|
||||
context: {
|
||||
antAnchor: AntAnchor;
|
||||
};
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate({ href: prevHref }: AnchorLinkProps): void;
|
||||
componentWillUnmount(): void;
|
||||
handleClick: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||
renderAnchorLink: ({ getPrefixCls }: ConfigConsumerProps) => JSX.Element;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
export default AnchorLink;
|
||||
124
web/node_modules/antd/es/anchor/AnchorLink.js
generated
vendored
Normal file
124
web/node_modules/antd/es/anchor/AnchorLink.js
generated
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _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 * as PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
|
||||
var AnchorLink = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(AnchorLink, _React$Component);
|
||||
|
||||
var _super = _createSuper(AnchorLink);
|
||||
|
||||
function AnchorLink() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, AnchorLink);
|
||||
|
||||
_this = _super.apply(this, arguments);
|
||||
|
||||
_this.handleClick = function (e) {
|
||||
var _this$context$antAnch = _this.context.antAnchor,
|
||||
scrollTo = _this$context$antAnch.scrollTo,
|
||||
onClick = _this$context$antAnch.onClick;
|
||||
var _this$props = _this.props,
|
||||
href = _this$props.href,
|
||||
title = _this$props.title;
|
||||
|
||||
if (onClick) {
|
||||
onClick(e, {
|
||||
title: title,
|
||||
href: href
|
||||
});
|
||||
}
|
||||
|
||||
scrollTo(href);
|
||||
};
|
||||
|
||||
_this.renderAnchorLink = function (_ref) {
|
||||
var getPrefixCls = _ref.getPrefixCls;
|
||||
var _this$props2 = _this.props,
|
||||
customizePrefixCls = _this$props2.prefixCls,
|
||||
href = _this$props2.href,
|
||||
title = _this$props2.title,
|
||||
children = _this$props2.children,
|
||||
className = _this$props2.className,
|
||||
target = _this$props2.target;
|
||||
var prefixCls = getPrefixCls('anchor', customizePrefixCls);
|
||||
var active = _this.context.antAnchor.activeLink === href;
|
||||
var wrapperClassName = classNames(className, "".concat(prefixCls, "-link"), _defineProperty({}, "".concat(prefixCls, "-link-active"), active));
|
||||
var titleClassName = classNames("".concat(prefixCls, "-link-title"), _defineProperty({}, "".concat(prefixCls, "-link-title-active"), active));
|
||||
return /*#__PURE__*/React.createElement("div", {
|
||||
className: wrapperClassName
|
||||
}, /*#__PURE__*/React.createElement("a", {
|
||||
className: titleClassName,
|
||||
href: href,
|
||||
title: typeof title === 'string' ? title : '',
|
||||
target: target,
|
||||
onClick: _this.handleClick
|
||||
}, title), children);
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(AnchorLink, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
this.context.antAnchor.registerLink(this.props.href);
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(_ref2) {
|
||||
var prevHref = _ref2.href;
|
||||
var href = this.props.href;
|
||||
|
||||
if (prevHref !== href) {
|
||||
this.context.antAnchor.unregisterLink(prevHref);
|
||||
this.context.antAnchor.registerLink(href);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
this.context.antAnchor.unregisterLink(this.props.href);
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderAnchorLink);
|
||||
}
|
||||
}]);
|
||||
|
||||
return AnchorLink;
|
||||
}(React.Component);
|
||||
|
||||
AnchorLink.defaultProps = {
|
||||
href: '#'
|
||||
};
|
||||
AnchorLink.contextTypes = {
|
||||
antAnchor: PropTypes.object
|
||||
};
|
||||
export default AnchorLink;
|
||||
4
web/node_modules/antd/es/anchor/index.d.ts
generated
vendored
Normal file
4
web/node_modules/antd/es/anchor/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import Anchor from './Anchor';
|
||||
export { AnchorProps } from './Anchor';
|
||||
export { AnchorLinkProps } from './AnchorLink';
|
||||
export default Anchor;
|
||||
4
web/node_modules/antd/es/anchor/index.js
generated
vendored
Normal file
4
web/node_modules/antd/es/anchor/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import Anchor from './Anchor';
|
||||
import AnchorLink from './AnchorLink';
|
||||
Anchor.Link = AnchorLink;
|
||||
export default Anchor;
|
||||
4
web/node_modules/antd/es/anchor/style/css.js
generated
vendored
Normal file
4
web/node_modules/antd/es/anchor/style/css.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import '../../style/index.css';
|
||||
import './index.css'; // style dependencies
|
||||
|
||||
import '../../affix/style/css';
|
||||
107
web/node_modules/antd/es/anchor/style/index.css
generated
vendored
Normal file
107
web/node_modules/antd/es/anchor/style/index.css
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
||||
/* stylelint-disable no-duplicate-selectors */
|
||||
/* stylelint-disable */
|
||||
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
||||
.ant-anchor {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
font-size: 14px;
|
||||
font-variant: tabular-nums;
|
||||
line-height: 1.5715;
|
||||
list-style: none;
|
||||
-webkit-font-feature-settings: 'tnum';
|
||||
font-feature-settings: 'tnum';
|
||||
position: relative;
|
||||
padding-left: 2px;
|
||||
}
|
||||
.ant-anchor-wrapper {
|
||||
margin-left: -4px;
|
||||
padding-left: 4px;
|
||||
overflow: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
.ant-anchor-ink {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
}
|
||||
.ant-anchor-ink::before {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 2px;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
background-color: #f0f0f0;
|
||||
content: ' ';
|
||||
}
|
||||
.ant-anchor-ink-ball {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
display: none;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background-color: #fff;
|
||||
border: 2px solid #1890ff;
|
||||
border-radius: 8px;
|
||||
-webkit-transform: translateX(-50%);
|
||||
transform: translateX(-50%);
|
||||
-webkit-transition: top 0.3s ease-in-out;
|
||||
transition: top 0.3s ease-in-out;
|
||||
}
|
||||
.ant-anchor-ink-ball.visible {
|
||||
display: inline-block;
|
||||
}
|
||||
.ant-anchor.fixed .ant-anchor-ink .ant-anchor-ink-ball {
|
||||
display: none;
|
||||
}
|
||||
.ant-anchor-link {
|
||||
padding: 7px 0 7px 16px;
|
||||
line-height: 1.143;
|
||||
}
|
||||
.ant-anchor-link-title {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
overflow: hidden;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-transition: all 0.3s;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.ant-anchor-link-title:only-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.ant-anchor-link-active > .ant-anchor-link-title {
|
||||
color: #1890ff;
|
||||
}
|
||||
.ant-anchor-link .ant-anchor-link {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
.ant-anchor-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
.ant-anchor-rtl.ant-anchor-wrapper {
|
||||
margin-right: -4px;
|
||||
margin-left: 0;
|
||||
padding-right: 4px;
|
||||
padding-left: 0;
|
||||
}
|
||||
.ant-anchor-rtl .ant-anchor-ink {
|
||||
right: 0;
|
||||
left: auto;
|
||||
}
|
||||
.ant-anchor-rtl .ant-anchor-ink-ball {
|
||||
right: 50%;
|
||||
left: 0;
|
||||
-webkit-transform: translateX(50%);
|
||||
transform: translateX(50%);
|
||||
}
|
||||
.ant-anchor-rtl .ant-anchor-link {
|
||||
padding: 7px 16px 7px 0;
|
||||
}
|
||||
3
web/node_modules/antd/es/anchor/style/index.d.ts
generated
vendored
Normal file
3
web/node_modules/antd/es/anchor/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
import '../../affix/style';
|
||||
4
web/node_modules/antd/es/anchor/style/index.js
generated
vendored
Normal file
4
web/node_modules/antd/es/anchor/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less'; // style dependencies
|
||||
|
||||
import '../../affix/style';
|
||||
84
web/node_modules/antd/es/anchor/style/index.less
generated
vendored
Normal file
84
web/node_modules/antd/es/anchor/style/index.less
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../style/mixins/index';
|
||||
|
||||
@anchor-border-width: 2px;
|
||||
|
||||
.@{ant-prefix}-anchor {
|
||||
.reset-component;
|
||||
|
||||
position: relative;
|
||||
padding-left: @anchor-border-width;
|
||||
|
||||
&-wrapper {
|
||||
margin-left: -4px;
|
||||
padding-left: 4px;
|
||||
overflow: auto;
|
||||
background-color: @anchor-bg;
|
||||
}
|
||||
|
||||
&-ink {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
&::before {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: @anchor-border-width;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
background-color: @anchor-border-color;
|
||||
content: ' ';
|
||||
}
|
||||
&-ball {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
display: none;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background-color: @component-background;
|
||||
border: 2px solid @primary-color;
|
||||
border-radius: 8px;
|
||||
transform: translateX(-50%);
|
||||
transition: top 0.3s ease-in-out;
|
||||
&.visible {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.fixed &-ink &-ink-ball {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&-link {
|
||||
padding: 7px 0 7px 16px;
|
||||
line-height: 1.143;
|
||||
|
||||
&-title {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
overflow: hidden;
|
||||
color: @text-color;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:only-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-active > &-title {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
&-link &-link {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
@import './rtl';
|
||||
40
web/node_modules/antd/es/anchor/style/rtl.less
generated
vendored
Normal file
40
web/node_modules/antd/es/anchor/style/rtl.less
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../style/mixins/index';
|
||||
|
||||
@anchor-border-width: 2px;
|
||||
|
||||
.@{ant-prefix}-anchor {
|
||||
&-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
&-wrapper {
|
||||
.@{ant-prefix}-anchor-rtl& {
|
||||
margin-right: -4px;
|
||||
margin-left: 0;
|
||||
padding-right: 4px;
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-ink {
|
||||
.@{ant-prefix}-anchor-rtl & {
|
||||
right: 0;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
&-ball {
|
||||
.@{ant-prefix}-anchor-rtl & {
|
||||
right: 50%;
|
||||
left: 0;
|
||||
transform: translateX(50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-link {
|
||||
.@{ant-prefix}-anchor-rtl & {
|
||||
padding: 7px 16px 7px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
22
web/node_modules/antd/es/auto-complete/index.d.ts
generated
vendored
Normal file
22
web/node_modules/antd/es/auto-complete/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* TODO: 4.0
|
||||
* - remove `dataSource`
|
||||
* - `size` not work with customizeInput
|
||||
* - customizeInput not feedback `ENTER` key since accessibility enhancement
|
||||
*/
|
||||
import * as React from 'react';
|
||||
import Select, { InternalSelectProps, OptionType } from '../select';
|
||||
export interface DataSourceItemObject {
|
||||
value: string;
|
||||
text: string;
|
||||
}
|
||||
export declare type DataSourceItemType = string | DataSourceItemObject;
|
||||
export interface AutoCompleteProps extends Omit<InternalSelectProps<string>, 'inputIcon' | 'loading' | 'mode' | 'optionLabelProp' | 'labelInValue'> {
|
||||
dataSource?: DataSourceItemType[];
|
||||
}
|
||||
declare const RefAutoComplete: React.ForwardRefExoticComponent<AutoCompleteProps & React.RefAttributes<Select<import("../select").SelectValue>>>;
|
||||
declare type RefAutoComplete = typeof RefAutoComplete & {
|
||||
Option: OptionType;
|
||||
};
|
||||
declare const _default: RefAutoComplete;
|
||||
export default _default;
|
||||
100
web/node_modules/antd/es/auto-complete/index.js
generated
vendored
Normal file
100
web/node_modules/antd/es/auto-complete/index.js
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
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 _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); }
|
||||
|
||||
/**
|
||||
* TODO: 4.0
|
||||
* - remove `dataSource`
|
||||
* - `size` not work with customizeInput
|
||||
* - customizeInput not feedback `ENTER` key since accessibility enhancement
|
||||
*/
|
||||
import * as React from 'react';
|
||||
import toArray from "rc-util/es/Children/toArray";
|
||||
import classNames from 'classnames';
|
||||
import omit from 'omit.js';
|
||||
import Select from '../select';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
var Option = Select.Option;
|
||||
var InternalSelect = Select;
|
||||
|
||||
function isSelectOptionOrSelectOptGroup(child) {
|
||||
return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
|
||||
}
|
||||
|
||||
var AutoComplete = function AutoComplete(props, ref) {
|
||||
var customizePrefixCls = props.prefixCls,
|
||||
className = props.className,
|
||||
children = props.children,
|
||||
dataSource = props.dataSource;
|
||||
var childNodes = toArray(children);
|
||||
var selectRef = React.useRef();
|
||||
React.useImperativeHandle(ref, function () {
|
||||
return selectRef.current;
|
||||
}); // ============================= Input =============================
|
||||
|
||||
var customizeInput;
|
||||
|
||||
if (childNodes.length === 1 && React.isValidElement(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {
|
||||
customizeInput = childNodes[0];
|
||||
}
|
||||
|
||||
var getInputElement = function getInputElement() {
|
||||
return customizeInput;
|
||||
}; // ============================ Options ============================
|
||||
|
||||
|
||||
var optionChildren; // [Legacy] convert `children` or `dataSource` into option children
|
||||
|
||||
if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {
|
||||
optionChildren = children;
|
||||
} else {
|
||||
optionChildren = dataSource ? dataSource.map(function (item) {
|
||||
if (React.isValidElement(item)) {
|
||||
return item;
|
||||
}
|
||||
|
||||
switch (_typeof(item)) {
|
||||
case 'string':
|
||||
return /*#__PURE__*/React.createElement(Option, {
|
||||
key: item,
|
||||
value: item
|
||||
}, item);
|
||||
|
||||
case 'object':
|
||||
{
|
||||
var optionValue = item.value;
|
||||
return /*#__PURE__*/React.createElement(Option, {
|
||||
key: optionValue,
|
||||
value: optionValue
|
||||
}, item.text);
|
||||
}
|
||||
|
||||
default:
|
||||
throw new Error('AutoComplete[dataSource] only supports type `string[] | Object[]`.');
|
||||
}
|
||||
}) : [];
|
||||
} // ============================ Warning ============================
|
||||
|
||||
|
||||
React.useEffect(function () {
|
||||
warning(!('dataSource' in props), 'AutoComplete', '`dataSource` is deprecated, please use `options` instead.');
|
||||
warning(!customizeInput || !('size' in props), 'AutoComplete', 'You need to control style self instead of setting `size` when using customize input.');
|
||||
}, []);
|
||||
return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (_ref) {
|
||||
var getPrefixCls = _ref.getPrefixCls;
|
||||
var prefixCls = getPrefixCls('select', customizePrefixCls);
|
||||
return /*#__PURE__*/React.createElement(InternalSelect, _extends({
|
||||
ref: selectRef
|
||||
}, omit(props, ['dataSource']), {
|
||||
prefixCls: prefixCls,
|
||||
className: classNames(className, "".concat(prefixCls, "-auto-complete")),
|
||||
mode: Select.SECRET_COMBOBOX_MODE_DO_NOT_USE,
|
||||
getInputElement: getInputElement
|
||||
}), optionChildren);
|
||||
});
|
||||
};
|
||||
|
||||
var RefAutoComplete = React.forwardRef(AutoComplete);
|
||||
RefAutoComplete.Option = Option;
|
||||
export default RefAutoComplete;
|
||||
4
web/node_modules/antd/es/auto-complete/style/css.js
generated
vendored
Normal file
4
web/node_modules/antd/es/auto-complete/style/css.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import '../../style/index.css';
|
||||
import './index.css'; // style dependencies
|
||||
|
||||
import '../../select/style/css';
|
||||
20
web/node_modules/antd/es/auto-complete/style/index.css
generated
vendored
Normal file
20
web/node_modules/antd/es/auto-complete/style/index.css
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
||||
/* stylelint-disable no-duplicate-selectors */
|
||||
/* stylelint-disable */
|
||||
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
||||
.ant-select-auto-complete {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
font-size: 14px;
|
||||
font-variant: tabular-nums;
|
||||
line-height: 1.5715;
|
||||
list-style: none;
|
||||
-webkit-font-feature-settings: 'tnum';
|
||||
font-feature-settings: 'tnum';
|
||||
}
|
||||
.ant-select-auto-complete .ant-select-clear {
|
||||
right: 13px;
|
||||
}
|
||||
3
web/node_modules/antd/es/auto-complete/style/index.d.ts
generated
vendored
Normal file
3
web/node_modules/antd/es/auto-complete/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
import '../../select/style';
|
||||
4
web/node_modules/antd/es/auto-complete/style/index.js
generated
vendored
Normal file
4
web/node_modules/antd/es/auto-complete/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less'; // style dependencies
|
||||
|
||||
import '../../select/style';
|
||||
16
web/node_modules/antd/es/auto-complete/style/index.less
generated
vendored
Normal file
16
web/node_modules/antd/es/auto-complete/style/index.less
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../style/mixins/index';
|
||||
@import '../../input/style/mixin';
|
||||
|
||||
@input-prefix-cls: ~'@{ant-prefix}-input';
|
||||
@select-prefix-cls: ~'@{ant-prefix}-select';
|
||||
@autocomplete-prefix-cls: ~'@{select-prefix-cls}-auto-complete';
|
||||
|
||||
.@{autocomplete-prefix-cls} {
|
||||
.reset-component;
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/22302
|
||||
.@{select-prefix-cls}-clear {
|
||||
right: 13px;
|
||||
}
|
||||
}
|
||||
45
web/node_modules/antd/es/avatar/index.d.ts
generated
vendored
Normal file
45
web/node_modules/antd/es/avatar/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import * as React from 'react';
|
||||
import { ConfigConsumerProps } from '../config-provider';
|
||||
export interface AvatarProps {
|
||||
/** Shape of avatar, options:`circle`, `square` */
|
||||
shape?: 'circle' | 'square';
|
||||
size?: 'large' | 'small' | 'default' | number;
|
||||
/** Src of image avatar */
|
||||
src?: string;
|
||||
/** Srcset of image avatar */
|
||||
srcSet?: string;
|
||||
/** icon to be used in avatar */
|
||||
icon?: React.ReactNode;
|
||||
style?: React.CSSProperties;
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
children?: React.ReactNode;
|
||||
alt?: string;
|
||||
onError?: () => boolean;
|
||||
}
|
||||
export interface AvatarState {
|
||||
scale: number;
|
||||
mounted: boolean;
|
||||
isImgExist: boolean;
|
||||
}
|
||||
export default class Avatar extends React.Component<AvatarProps, AvatarState> {
|
||||
static defaultProps: {
|
||||
shape: "circle" | "square" | undefined;
|
||||
size: number | "small" | "large" | "default" | undefined;
|
||||
};
|
||||
state: {
|
||||
scale: number;
|
||||
mounted: boolean;
|
||||
isImgExist: boolean;
|
||||
};
|
||||
private avatarNode;
|
||||
private avatarChildren;
|
||||
private lastChildrenWidth;
|
||||
private lastNodeWidth;
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate(prevProps: AvatarProps): void;
|
||||
setScale: () => void;
|
||||
handleImgLoadError: () => void;
|
||||
renderAvatar: ({ getPrefixCls }: ConfigConsumerProps) => JSX.Element;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
220
web/node_modules/antd/es/avatar/index.js
generated
vendored
Normal file
220
web/node_modules/antd/es/avatar/index.js
generated
vendored
Normal file
@@ -0,0 +1,220 @@
|
||||
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _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;
|
||||
};
|
||||
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
|
||||
var Avatar = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(Avatar, _React$Component);
|
||||
|
||||
var _super = _createSuper(Avatar);
|
||||
|
||||
function Avatar() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Avatar);
|
||||
|
||||
_this = _super.apply(this, arguments);
|
||||
_this.state = {
|
||||
scale: 1,
|
||||
mounted: false,
|
||||
isImgExist: true
|
||||
};
|
||||
|
||||
_this.setScale = function () {
|
||||
if (!_this.avatarChildren || !_this.avatarNode) {
|
||||
return;
|
||||
}
|
||||
|
||||
var childrenWidth = _this.avatarChildren.offsetWidth; // offsetWidth avoid affecting be transform scale
|
||||
|
||||
var nodeWidth = _this.avatarNode.offsetWidth; // denominator is 0 is no meaning
|
||||
|
||||
if (childrenWidth === 0 || nodeWidth === 0 || _this.lastChildrenWidth === childrenWidth && _this.lastNodeWidth === nodeWidth) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this.lastChildrenWidth = childrenWidth;
|
||||
_this.lastNodeWidth = nodeWidth; // add 4px gap for each side to get better performance
|
||||
|
||||
_this.setState({
|
||||
scale: nodeWidth - 8 < childrenWidth ? (nodeWidth - 8) / childrenWidth : 1
|
||||
});
|
||||
};
|
||||
|
||||
_this.handleImgLoadError = function () {
|
||||
var onError = _this.props.onError;
|
||||
var errorFlag = onError ? onError() : undefined;
|
||||
|
||||
if (errorFlag !== false) {
|
||||
_this.setState({
|
||||
isImgExist: false
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_this.renderAvatar = function (_ref) {
|
||||
var _classNames, _classNames2;
|
||||
|
||||
var getPrefixCls = _ref.getPrefixCls;
|
||||
|
||||
var _a = _this.props,
|
||||
customizePrefixCls = _a.prefixCls,
|
||||
shape = _a.shape,
|
||||
size = _a.size,
|
||||
src = _a.src,
|
||||
srcSet = _a.srcSet,
|
||||
icon = _a.icon,
|
||||
className = _a.className,
|
||||
alt = _a.alt,
|
||||
others = __rest(_a, ["prefixCls", "shape", "size", "src", "srcSet", "icon", "className", "alt"]);
|
||||
|
||||
warning(!(typeof icon === 'string' && icon.length > 2), 'Avatar', "`icon` is using ReactNode instead of string naming in v4. Please check `".concat(icon, "` at https://ant.design/components/icon"));
|
||||
var _this$state = _this.state,
|
||||
isImgExist = _this$state.isImgExist,
|
||||
scale = _this$state.scale,
|
||||
mounted = _this$state.mounted;
|
||||
var prefixCls = getPrefixCls('avatar', customizePrefixCls);
|
||||
var sizeCls = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-lg"), size === 'large'), _defineProperty(_classNames, "".concat(prefixCls, "-sm"), size === 'small'), _classNames));
|
||||
var classString = classNames(prefixCls, className, sizeCls, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-").concat(shape), shape), _defineProperty(_classNames2, "".concat(prefixCls, "-image"), src && isImgExist), _defineProperty(_classNames2, "".concat(prefixCls, "-icon"), icon), _classNames2));
|
||||
var sizeStyle = typeof size === 'number' ? {
|
||||
width: size,
|
||||
height: size,
|
||||
lineHeight: "".concat(size, "px"),
|
||||
fontSize: icon ? size / 2 : 18
|
||||
} : {};
|
||||
var children = _this.props.children;
|
||||
|
||||
if (src && isImgExist) {
|
||||
children = /*#__PURE__*/React.createElement("img", {
|
||||
src: src,
|
||||
srcSet: srcSet,
|
||||
onError: _this.handleImgLoadError,
|
||||
alt: alt
|
||||
});
|
||||
} else if (icon) {
|
||||
children = icon;
|
||||
} else {
|
||||
var childrenNode = _this.avatarChildren;
|
||||
|
||||
if (childrenNode || scale !== 1) {
|
||||
var transformString = "scale(".concat(scale, ") translateX(-50%)");
|
||||
var childrenStyle = {
|
||||
msTransform: transformString,
|
||||
WebkitTransform: transformString,
|
||||
transform: transformString
|
||||
};
|
||||
var sizeChildrenStyle = typeof size === 'number' ? {
|
||||
lineHeight: "".concat(size, "px")
|
||||
} : {};
|
||||
children = /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-string"),
|
||||
ref: function ref(node) {
|
||||
return _this.avatarChildren = node;
|
||||
},
|
||||
style: _extends(_extends({}, sizeChildrenStyle), childrenStyle)
|
||||
}, children);
|
||||
} else {
|
||||
var _childrenStyle = {};
|
||||
|
||||
if (!mounted) {
|
||||
_childrenStyle.opacity = 0;
|
||||
}
|
||||
|
||||
children = /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-string"),
|
||||
style: {
|
||||
opacity: 0
|
||||
},
|
||||
ref: function ref(node) {
|
||||
return _this.avatarChildren = node;
|
||||
}
|
||||
}, children);
|
||||
}
|
||||
}
|
||||
|
||||
return /*#__PURE__*/React.createElement("span", _extends({}, others, {
|
||||
style: _extends(_extends({}, sizeStyle), others.style),
|
||||
className: classString,
|
||||
ref: function ref(node) {
|
||||
return _this.avatarNode = node;
|
||||
}
|
||||
}), children);
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Avatar, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
this.setScale();
|
||||
this.setState({
|
||||
mounted: true
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(prevProps) {
|
||||
this.setScale();
|
||||
|
||||
if (prevProps.src !== this.props.src) {
|
||||
this.setState({
|
||||
isImgExist: true,
|
||||
scale: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderAvatar);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Avatar;
|
||||
}(React.Component);
|
||||
|
||||
export { Avatar as default };
|
||||
Avatar.defaultProps = {
|
||||
shape: 'circle',
|
||||
size: 'default'
|
||||
};
|
||||
2
web/node_modules/antd/es/avatar/style/css.js
generated
vendored
Normal file
2
web/node_modules/antd/es/avatar/style/css.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.css';
|
||||
import './index.css';
|
||||
90
web/node_modules/antd/es/avatar/style/index.css
generated
vendored
Normal file
90
web/node_modules/antd/es/avatar/style/index.css
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
||||
/* stylelint-disable no-duplicate-selectors */
|
||||
/* stylelint-disable */
|
||||
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
||||
.ant-avatar {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
font-size: 14px;
|
||||
font-variant: tabular-nums;
|
||||
line-height: 1.5715;
|
||||
list-style: none;
|
||||
-webkit-font-feature-settings: 'tnum';
|
||||
font-feature-settings: 'tnum';
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
background: #ccc;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.ant-avatar-image {
|
||||
background: transparent;
|
||||
}
|
||||
.ant-avatar-string {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
-webkit-transform-origin: 0 center;
|
||||
transform-origin: 0 center;
|
||||
}
|
||||
.ant-avatar.ant-avatar-icon {
|
||||
font-size: 18px;
|
||||
}
|
||||
.ant-avatar.ant-avatar-icon > .anticon {
|
||||
margin: 0;
|
||||
}
|
||||
.ant-avatar-lg {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.ant-avatar-lg-string {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
-webkit-transform-origin: 0 center;
|
||||
transform-origin: 0 center;
|
||||
}
|
||||
.ant-avatar-lg.ant-avatar-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
.ant-avatar-lg.ant-avatar-icon > .anticon {
|
||||
margin: 0;
|
||||
}
|
||||
.ant-avatar-sm {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.ant-avatar-sm-string {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
-webkit-transform-origin: 0 center;
|
||||
transform-origin: 0 center;
|
||||
}
|
||||
.ant-avatar-sm.ant-avatar-icon {
|
||||
font-size: 14px;
|
||||
}
|
||||
.ant-avatar-sm.ant-avatar-icon > .anticon {
|
||||
margin: 0;
|
||||
}
|
||||
.ant-avatar-square {
|
||||
border-radius: 2px;
|
||||
}
|
||||
.ant-avatar > img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
}
|
||||
2
web/node_modules/antd/es/avatar/style/index.d.ts
generated
vendored
Normal file
2
web/node_modules/antd/es/avatar/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
2
web/node_modules/antd/es/avatar/style/index.js
generated
vendored
Normal file
2
web/node_modules/antd/es/avatar/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
63
web/node_modules/antd/es/avatar/style/index.less
generated
vendored
Normal file
63
web/node_modules/antd/es/avatar/style/index.less
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../style/mixins/index';
|
||||
|
||||
@avatar-prefix-cls: ~'@{ant-prefix}-avatar';
|
||||
|
||||
.@{avatar-prefix-cls} {
|
||||
.reset-component;
|
||||
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
color: @avatar-color;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
background: @avatar-bg;
|
||||
|
||||
&-image {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.avatar-size(@avatar-size-base, @avatar-font-size-base);
|
||||
|
||||
&-lg {
|
||||
.avatar-size(@avatar-size-lg, @avatar-font-size-lg);
|
||||
}
|
||||
|
||||
&-sm {
|
||||
.avatar-size(@avatar-size-sm, @avatar-font-size-sm);
|
||||
}
|
||||
|
||||
&-square {
|
||||
border-radius: @avatar-border-radius;
|
||||
}
|
||||
|
||||
& > img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.avatar-size(@size, @font-size) {
|
||||
width: @size;
|
||||
height: @size;
|
||||
line-height: @size;
|
||||
border-radius: 50%;
|
||||
|
||||
&-string {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform-origin: 0 center;
|
||||
}
|
||||
|
||||
&.@{avatar-prefix-cls}-icon {
|
||||
font-size: @font-size;
|
||||
|
||||
> .@{iconfont-css-prefix} {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
37
web/node_modules/antd/es/back-top/index.d.ts
generated
vendored
Normal file
37
web/node_modules/antd/es/back-top/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import * as React from 'react';
|
||||
import { ConfigConsumerProps } from '../config-provider';
|
||||
export interface BackTopProps {
|
||||
visibilityHeight?: number;
|
||||
onClick?: React.MouseEventHandler<HTMLElement>;
|
||||
target?: () => HTMLElement | Window | Document;
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
visible?: boolean;
|
||||
}
|
||||
export default class BackTop extends React.Component<BackTopProps, any> {
|
||||
static defaultProps: {
|
||||
visibilityHeight: number;
|
||||
};
|
||||
state: {
|
||||
visible: boolean;
|
||||
};
|
||||
scrollEvent: any;
|
||||
node: HTMLDivElement;
|
||||
componentDidMount(): void;
|
||||
componentDidUpdate(prevProps: BackTopProps): void;
|
||||
componentWillUnmount(): void;
|
||||
bindScrollEvent(): void;
|
||||
getVisible(): boolean | undefined;
|
||||
getDefaultTarget: () => Document | (Window & typeof globalThis);
|
||||
saveDivRef: (node: HTMLDivElement) => void;
|
||||
scrollToTop: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
||||
handleScroll(e: React.UIEvent<HTMLElement> | {
|
||||
target: any;
|
||||
}): void;
|
||||
renderChildren({ prefixCls }: {
|
||||
prefixCls: string;
|
||||
}): JSX.Element;
|
||||
renderBackTop: ({ getPrefixCls, direction }: ConfigConsumerProps) => JSX.Element;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
197
web/node_modules/antd/es/back-top/index.js
generated
vendored
Normal file
197
web/node_modules/antd/es/back-top/index.js
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _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); }
|
||||
|
||||
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); }
|
||||
|
||||
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
||||
var c = arguments.length,
|
||||
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
||||
d;
|
||||
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
}
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
|
||||
import * as React from 'react';
|
||||
import Animate from 'rc-animate';
|
||||
import addEventListener from "rc-util/es/Dom/addEventListener";
|
||||
import classNames from 'classnames';
|
||||
import omit from 'omit.js';
|
||||
import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
import getScroll from '../_util/getScroll';
|
||||
import scrollTo from '../_util/scrollTo';
|
||||
|
||||
var BackTop = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(BackTop, _React$Component);
|
||||
|
||||
var _super = _createSuper(BackTop);
|
||||
|
||||
function BackTop() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, BackTop);
|
||||
|
||||
_this = _super.apply(this, arguments);
|
||||
_this.state = {
|
||||
visible: false
|
||||
};
|
||||
|
||||
_this.getDefaultTarget = function () {
|
||||
return _this.node && _this.node.ownerDocument ? _this.node.ownerDocument : window;
|
||||
};
|
||||
|
||||
_this.saveDivRef = function (node) {
|
||||
_this.node = node;
|
||||
};
|
||||
|
||||
_this.scrollToTop = function (e) {
|
||||
var _this$props = _this.props,
|
||||
onClick = _this$props.onClick,
|
||||
target = _this$props.target;
|
||||
scrollTo(0, {
|
||||
getContainer: target || _this.getDefaultTarget
|
||||
});
|
||||
|
||||
if (typeof onClick === 'function') {
|
||||
onClick(e);
|
||||
}
|
||||
};
|
||||
|
||||
_this.renderBackTop = function (_ref) {
|
||||
var getPrefixCls = _ref.getPrefixCls,
|
||||
direction = _ref.direction;
|
||||
var _this$props2 = _this.props,
|
||||
customizePrefixCls = _this$props2.prefixCls,
|
||||
_this$props2$classNam = _this$props2.className,
|
||||
className = _this$props2$classNam === void 0 ? '' : _this$props2$classNam;
|
||||
var prefixCls = getPrefixCls('back-top', customizePrefixCls);
|
||||
var classString = classNames(prefixCls, className, _defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl')); // fix https://fb.me/react-unknown-prop
|
||||
|
||||
var divProps = omit(_this.props, ['prefixCls', 'className', 'children', 'visibilityHeight', 'target', 'visible']);
|
||||
return /*#__PURE__*/React.createElement("div", _extends({}, divProps, {
|
||||
className: classString,
|
||||
onClick: _this.scrollToTop,
|
||||
ref: _this.saveDivRef
|
||||
}), _this.renderChildren({
|
||||
prefixCls: prefixCls
|
||||
}));
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(BackTop, [{
|
||||
key: "componentDidMount",
|
||||
value: function componentDidMount() {
|
||||
this.bindScrollEvent();
|
||||
}
|
||||
}, {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(prevProps) {
|
||||
var target = this.props.target;
|
||||
|
||||
if (prevProps.target !== target) {
|
||||
this.bindScrollEvent();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
if (this.scrollEvent) {
|
||||
this.scrollEvent.remove();
|
||||
}
|
||||
|
||||
this.handleScroll.cancel();
|
||||
}
|
||||
}, {
|
||||
key: "bindScrollEvent",
|
||||
value: function bindScrollEvent() {
|
||||
var _this2 = this;
|
||||
|
||||
if (this.scrollEvent) {
|
||||
this.scrollEvent.remove();
|
||||
}
|
||||
|
||||
var target = this.props.target;
|
||||
var getTarget = target || this.getDefaultTarget;
|
||||
var container = getTarget();
|
||||
this.scrollEvent = addEventListener(container, 'scroll', function (e) {
|
||||
_this2.handleScroll(e);
|
||||
});
|
||||
this.handleScroll({
|
||||
target: container
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "getVisible",
|
||||
value: function getVisible() {
|
||||
if ('visible' in this.props) {
|
||||
return this.props.visible;
|
||||
}
|
||||
|
||||
return this.state.visible;
|
||||
}
|
||||
}, {
|
||||
key: "handleScroll",
|
||||
value: function handleScroll(e) {
|
||||
var _this$props$visibilit = this.props.visibilityHeight,
|
||||
visibilityHeight = _this$props$visibilit === void 0 ? 0 : _this$props$visibilit;
|
||||
var scrollTop = getScroll(e.target, true);
|
||||
this.setState({
|
||||
visible: scrollTop > visibilityHeight
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "renderChildren",
|
||||
value: function renderChildren(_ref2) {
|
||||
var prefixCls = _ref2.prefixCls;
|
||||
var children = this.props.children;
|
||||
var defaultElement = /*#__PURE__*/React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-content")
|
||||
}, /*#__PURE__*/React.createElement("div", {
|
||||
className: "".concat(prefixCls, "-icon")
|
||||
}));
|
||||
return /*#__PURE__*/React.createElement(Animate, {
|
||||
component: "",
|
||||
transitionName: "fade"
|
||||
}, this.getVisible() ? /*#__PURE__*/React.createElement("div", null, children || defaultElement) : null);
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderBackTop);
|
||||
}
|
||||
}]);
|
||||
|
||||
return BackTop;
|
||||
}(React.Component);
|
||||
|
||||
export { BackTop as default };
|
||||
BackTop.defaultProps = {
|
||||
visibilityHeight: 400
|
||||
};
|
||||
|
||||
__decorate([throttleByAnimationFrameDecorator()], BackTop.prototype, "handleScroll", null);
|
||||
2
web/node_modules/antd/es/back-top/style/css.js
generated
vendored
Normal file
2
web/node_modules/antd/es/back-top/style/css.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.css';
|
||||
import './index.css';
|
||||
61
web/node_modules/antd/es/back-top/style/index.css
generated
vendored
Normal file
61
web/node_modules/antd/es/back-top/style/index.css
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
||||
/* stylelint-disable no-duplicate-selectors */
|
||||
/* stylelint-disable */
|
||||
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
||||
.ant-back-top {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
font-size: 14px;
|
||||
font-variant: tabular-nums;
|
||||
line-height: 1.5715;
|
||||
list-style: none;
|
||||
-webkit-font-feature-settings: 'tnum';
|
||||
font-feature-settings: 'tnum';
|
||||
position: fixed;
|
||||
right: 100px;
|
||||
bottom: 50px;
|
||||
z-index: 10;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ant-back-top-rtl {
|
||||
right: auto;
|
||||
left: 100px;
|
||||
direction: rtl;
|
||||
}
|
||||
.ant-back-top-content {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
overflow: hidden;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background-color: rgba(0, 0, 0, 0.45);
|
||||
border-radius: 20px;
|
||||
-webkit-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||
}
|
||||
.ant-back-top-content:hover {
|
||||
background-color: rgba(0, 0, 0, 0.65);
|
||||
-webkit-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||
}
|
||||
.ant-back-top-icon {
|
||||
width: 14px;
|
||||
height: 16px;
|
||||
margin: 12px auto;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAoCAYAAACWwljjAAAABGdBTUEAALGPC/xhBQAAAbtJREFUWAntmMtKw0AUhhMvS5cuxILgQlRUpIggIoKIIoigG1eC+AA+jo+i6FIXBfeuXIgoeKVeitVWJX5HWhhDksnUpp3FDPyZk3Nm5nycmZKkXhAEOXSA3lG7muTeRzmfy6HneUvIhnYkQK+Q9NhAA0Opg0vBEhjBKHiyb8iGMyQMOYuK41BcBSypAL+MYXSKjtFAW7EAGEO3qN4uMQbbAkXiSfRQJ1H6a+yhlkKRcAoVFYiweYNjtCVQJJpBz2GCiPt7fBOZQpFgDpUikse5HgnkM4Fi4QX0Fpc5wf9EbLqpUCy4jMoJSXWhFwbMNgWKhVbRhy5jirhs9fy/oFhgHVVTJEs7RLZ8sSEoJm6iz7SZDMbJ+/OKERQTttCXQRLToRUmrKWCYuA2+jbN0MB4OQobYShfdTCgn/sL1K36M7TLrN3n+758aPy2rrpR6+/od5E8tf/A1uLS9aId5T7J3CNYihkQ4D9PiMdMC7mp4rjB9kjFjZp8BlnVHJBuO1yFXIV0FdDF3RlyFdJVQBdv5AxVdIsq8apiZ2PyYO1EVykesGfZEESsCkweyR8MUW+V8uJ1gkYipmpdP1pm2aJVPEGzAAAAAElFTkSuQmCC) 100%/100% no-repeat;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.ant-back-top {
|
||||
right: 60px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 480px) {
|
||||
.ant-back-top {
|
||||
right: 20px;
|
||||
}
|
||||
}
|
||||
2
web/node_modules/antd/es/back-top/style/index.d.ts
generated
vendored
Normal file
2
web/node_modules/antd/es/back-top/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
2
web/node_modules/antd/es/back-top/style/index.js
generated
vendored
Normal file
2
web/node_modules/antd/es/back-top/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
48
web/node_modules/antd/es/back-top/style/index.less
generated
vendored
Normal file
48
web/node_modules/antd/es/back-top/style/index.less
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../style/mixins/index';
|
||||
|
||||
@backtop-prefix-cls: ~'@{ant-prefix}-back-top';
|
||||
|
||||
.@{backtop-prefix-cls} {
|
||||
.reset-component;
|
||||
|
||||
position: fixed;
|
||||
right: 100px;
|
||||
bottom: 50px;
|
||||
z-index: @zindex-back-top;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
cursor: pointer;
|
||||
|
||||
&-rtl {
|
||||
right: auto;
|
||||
left: 100px;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
&-content {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
overflow: hidden;
|
||||
color: @back-top-color;
|
||||
text-align: center;
|
||||
background-color: @back-top-bg;
|
||||
border-radius: 20px;
|
||||
transition: all 0.3s @ease-in-out;
|
||||
|
||||
&:hover {
|
||||
background-color: @back-top-hover-bg;
|
||||
transition: all 0.3s @ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
&-icon {
|
||||
width: 14px;
|
||||
height: 16px;
|
||||
margin: 12px auto;
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAoCAYAAACWwljjAAAABGdBTUEAALGPC/xhBQAAAbtJREFUWAntmMtKw0AUhhMvS5cuxILgQlRUpIggIoKIIoigG1eC+AA+jo+i6FIXBfeuXIgoeKVeitVWJX5HWhhDksnUpp3FDPyZk3Nm5nycmZKkXhAEOXSA3lG7muTeRzmfy6HneUvIhnYkQK+Q9NhAA0Opg0vBEhjBKHiyb8iGMyQMOYuK41BcBSypAL+MYXSKjtFAW7EAGEO3qN4uMQbbAkXiSfRQJ1H6a+yhlkKRcAoVFYiweYNjtCVQJJpBz2GCiPt7fBOZQpFgDpUikse5HgnkM4Fi4QX0Fpc5wf9EbLqpUCy4jMoJSXWhFwbMNgWKhVbRhy5jirhs9fy/oFhgHVVTJEs7RLZ8sSEoJm6iz7SZDMbJ+/OKERQTttCXQRLToRUmrKWCYuA2+jbN0MB4OQobYShfdTCgn/sL1K36M7TLrN3n+758aPy2rrpR6+/od5E8tf/A1uLS9aId5T7J3CNYihkQ4D9PiMdMC7mp4rjB9kjFjZp8BlnVHJBuO1yFXIV0FdDF3RlyFdJVQBdv5AxVdIsq8apiZ2PyYO1EVykesGfZEESsCkweyR8MUW+V8uJ1gkYipmpdP1pm2aJVPEGzAAAAAElFTkSuQmCC)
|
||||
~'100%/100%' no-repeat;
|
||||
}
|
||||
}
|
||||
|
||||
@import './responsive';
|
||||
11
web/node_modules/antd/es/back-top/style/responsive.less
generated
vendored
Normal file
11
web/node_modules/antd/es/back-top/style/responsive.less
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
@media screen and (max-width: @screen-md) {
|
||||
.@{backtop-prefix-cls} {
|
||||
right: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: @screen-xs) {
|
||||
.@{backtop-prefix-cls} {
|
||||
right: 20px;
|
||||
}
|
||||
}
|
||||
38
web/node_modules/antd/es/badge/ScrollNumber.d.ts
generated
vendored
Normal file
38
web/node_modules/antd/es/badge/ScrollNumber.d.ts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import * as React from 'react';
|
||||
import { ConfigConsumerProps } from '../config-provider';
|
||||
export interface ScrollNumberProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
count?: string | number | null;
|
||||
displayComponent?: React.ReactElement<HTMLElement>;
|
||||
component?: string;
|
||||
onAnimated?: Function;
|
||||
style?: React.CSSProperties;
|
||||
title?: string | number | null;
|
||||
}
|
||||
export interface ScrollNumberState {
|
||||
animateStarted?: boolean;
|
||||
count?: string | number | null;
|
||||
}
|
||||
declare class ScrollNumber extends React.Component<ScrollNumberProps, ScrollNumberState> {
|
||||
static defaultProps: {
|
||||
count: null;
|
||||
onAnimated(): void;
|
||||
};
|
||||
static getDerivedStateFromProps(nextProps: ScrollNumberProps, nextState: ScrollNumberState): {
|
||||
animateStarted: boolean;
|
||||
} | null;
|
||||
lastCount?: string | number | null;
|
||||
private timeout?;
|
||||
constructor(props: ScrollNumberProps);
|
||||
componentDidUpdate(_: any, prevState: ScrollNumberState): void;
|
||||
componentWillUnmount(): void;
|
||||
getPositionByNum(num: number, i: number): number;
|
||||
onAnimated: () => void;
|
||||
renderCurrentNumber(prefixCls: string, num: number | string, i: number): JSX.Element;
|
||||
renderNumberElement(prefixCls: string): string | number | JSX.Element[] | null | undefined;
|
||||
renderScrollNumber: ({ getPrefixCls }: ConfigConsumerProps) => React.CElement<any, React.Component<any, any, any>> | React.ReactElement<HTMLElement, 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>)>;
|
||||
render(): JSX.Element;
|
||||
private clearTimeout;
|
||||
}
|
||||
export default ScrollNumber;
|
||||
257
web/node_modules/antd/es/badge/ScrollNumber.js
generated
vendored
Normal file
257
web/node_modules/antd/es/badge/ScrollNumber.js
generated
vendored
Normal file
@@ -0,0 +1,257 @@
|
||||
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); }
|
||||
|
||||
import * as React from 'react';
|
||||
import omit from 'omit.js';
|
||||
import classNames from 'classnames';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
|
||||
function getNumberArray(num) {
|
||||
return num ? num.toString().split('').reverse().map(function (i) {
|
||||
var current = Number(i);
|
||||
return isNaN(current) ? i : current;
|
||||
}) : [];
|
||||
}
|
||||
|
||||
function renderNumberList(position, className) {
|
||||
var childrenToReturn = [];
|
||||
|
||||
for (var i = 0; i < 30; i++) {
|
||||
childrenToReturn.push( /*#__PURE__*/React.createElement("p", {
|
||||
key: i.toString(),
|
||||
className: classNames(className, {
|
||||
current: position === i
|
||||
})
|
||||
}, i % 10));
|
||||
}
|
||||
|
||||
return childrenToReturn;
|
||||
}
|
||||
|
||||
var ScrollNumber = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(ScrollNumber, _React$Component);
|
||||
|
||||
var _super = _createSuper(ScrollNumber);
|
||||
|
||||
function ScrollNumber(props) {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, ScrollNumber);
|
||||
|
||||
_this = _super.call(this, props);
|
||||
|
||||
_this.onAnimated = function () {
|
||||
var onAnimated = _this.props.onAnimated;
|
||||
|
||||
if (onAnimated) {
|
||||
onAnimated();
|
||||
}
|
||||
};
|
||||
|
||||
_this.renderScrollNumber = function (_ref) {
|
||||
var getPrefixCls = _ref.getPrefixCls;
|
||||
var _this$props = _this.props,
|
||||
customizePrefixCls = _this$props.prefixCls,
|
||||
className = _this$props.className,
|
||||
style = _this$props.style,
|
||||
title = _this$props.title,
|
||||
_this$props$component = _this$props.component,
|
||||
component = _this$props$component === void 0 ? 'sup' : _this$props$component,
|
||||
displayComponent = _this$props.displayComponent; // fix https://fb.me/react-unknown-prop
|
||||
|
||||
var restProps = omit(_this.props, ['count', 'onAnimated', 'component', 'prefixCls', 'displayComponent']);
|
||||
var prefixCls = getPrefixCls('scroll-number', customizePrefixCls);
|
||||
|
||||
var newProps = _extends(_extends({}, restProps), {
|
||||
className: classNames(prefixCls, className),
|
||||
title: title
|
||||
}); // allow specify the border
|
||||
// mock border-color by box-shadow for compatible with old usage:
|
||||
// <Badge count={4} style={{ backgroundColor: '#fff', color: '#999', borderColor: '#d9d9d9' }} />
|
||||
|
||||
|
||||
if (style && style.borderColor) {
|
||||
newProps.style = _extends(_extends({}, style), {
|
||||
boxShadow: "0 0 0 1px ".concat(style.borderColor, " inset")
|
||||
});
|
||||
}
|
||||
|
||||
if (displayComponent) {
|
||||
return React.cloneElement(displayComponent, {
|
||||
className: classNames("".concat(prefixCls, "-custom-component"), displayComponent.props && displayComponent.props.className)
|
||||
});
|
||||
}
|
||||
|
||||
return React.createElement(component, newProps, _this.renderNumberElement(prefixCls));
|
||||
};
|
||||
|
||||
_this.state = {
|
||||
animateStarted: true,
|
||||
count: props.count
|
||||
};
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(ScrollNumber, [{
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(_, prevState) {
|
||||
var _this2 = this;
|
||||
|
||||
this.lastCount = prevState.count;
|
||||
var animateStarted = this.state.animateStarted;
|
||||
|
||||
if (animateStarted) {
|
||||
this.clearTimeout(); // Let browser has time to reset the scroller before actually
|
||||
// performing the transition.
|
||||
|
||||
this.timeout = setTimeout(function () {
|
||||
// eslint-disable-next-line react/no-did-update-set-state
|
||||
_this2.setState(function (__, props) {
|
||||
return {
|
||||
animateStarted: false,
|
||||
count: props.count
|
||||
};
|
||||
}, _this2.onAnimated);
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
this.clearTimeout();
|
||||
}
|
||||
}, {
|
||||
key: "getPositionByNum",
|
||||
value: function getPositionByNum(num, i) {
|
||||
var count = this.state.count;
|
||||
var currentCount = Math.abs(Number(count));
|
||||
var lastCount = Math.abs(Number(this.lastCount));
|
||||
var currentDigit = Math.abs(getNumberArray(this.state.count)[i]);
|
||||
var lastDigit = Math.abs(getNumberArray(this.lastCount)[i]);
|
||||
|
||||
if (this.state.animateStarted) {
|
||||
return 10 + num;
|
||||
} // 同方向则在同一侧切换数字
|
||||
|
||||
|
||||
if (currentCount > lastCount) {
|
||||
if (currentDigit >= lastDigit) {
|
||||
return 10 + num;
|
||||
}
|
||||
|
||||
return 20 + num;
|
||||
}
|
||||
|
||||
if (currentDigit <= lastDigit) {
|
||||
return 10 + num;
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
}, {
|
||||
key: "renderCurrentNumber",
|
||||
value: function renderCurrentNumber(prefixCls, num, i) {
|
||||
if (typeof num === 'number') {
|
||||
var position = this.getPositionByNum(num, i);
|
||||
var removeTransition = this.state.animateStarted || getNumberArray(this.lastCount)[i] === undefined;
|
||||
return React.createElement('span', {
|
||||
className: "".concat(prefixCls, "-only"),
|
||||
style: {
|
||||
transition: removeTransition ? 'none' : undefined,
|
||||
msTransform: "translateY(".concat(-position * 100, "%)"),
|
||||
WebkitTransform: "translateY(".concat(-position * 100, "%)"),
|
||||
transform: "translateY(".concat(-position * 100, "%)")
|
||||
},
|
||||
key: i
|
||||
}, renderNumberList(position, "".concat(prefixCls, "-only-unit")));
|
||||
}
|
||||
|
||||
return /*#__PURE__*/React.createElement("span", {
|
||||
key: "symbol",
|
||||
className: "".concat(prefixCls, "-symbol")
|
||||
}, num);
|
||||
}
|
||||
}, {
|
||||
key: "renderNumberElement",
|
||||
value: function renderNumberElement(prefixCls) {
|
||||
var _this3 = this;
|
||||
|
||||
var count = this.state.count;
|
||||
|
||||
if (count && Number(count) % 1 === 0) {
|
||||
return getNumberArray(count).map(function (num, i) {
|
||||
return _this3.renderCurrentNumber(prefixCls, num, i);
|
||||
}).reverse();
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderScrollNumber);
|
||||
}
|
||||
}, {
|
||||
key: "clearTimeout",
|
||||
value: function (_clearTimeout) {
|
||||
function clearTimeout() {
|
||||
return _clearTimeout.apply(this, arguments);
|
||||
}
|
||||
|
||||
clearTimeout.toString = function () {
|
||||
return _clearTimeout.toString();
|
||||
};
|
||||
|
||||
return clearTimeout;
|
||||
}(function () {
|
||||
if (this.timeout) {
|
||||
clearTimeout(this.timeout);
|
||||
this.timeout = undefined;
|
||||
}
|
||||
})
|
||||
}], [{
|
||||
key: "getDerivedStateFromProps",
|
||||
value: function getDerivedStateFromProps(nextProps, nextState) {
|
||||
if ('count' in nextProps) {
|
||||
if (nextState.count === nextProps.count) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
animateStarted: true
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}]);
|
||||
|
||||
return ScrollNumber;
|
||||
}(React.Component);
|
||||
|
||||
ScrollNumber.defaultProps = {
|
||||
count: null,
|
||||
onAnimated: function onAnimated() {}
|
||||
};
|
||||
export default ScrollNumber;
|
||||
45
web/node_modules/antd/es/badge/index.d.ts
generated
vendored
Normal file
45
web/node_modules/antd/es/badge/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import * as React from 'react';
|
||||
import { PresetColorType, PresetStatusColorType } from '../_util/colors';
|
||||
import { ConfigConsumerProps } from '../config-provider';
|
||||
import { LiteralUnion } from '../_util/type';
|
||||
export { ScrollNumberProps } from './ScrollNumber';
|
||||
export interface BadgeProps {
|
||||
/** Number to show in badge */
|
||||
count?: React.ReactNode;
|
||||
showZero?: boolean;
|
||||
/** Max count to show */
|
||||
overflowCount?: number;
|
||||
/** whether to show red dot without number */
|
||||
dot?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
prefixCls?: string;
|
||||
scrollNumberPrefixCls?: string;
|
||||
className?: string;
|
||||
status?: PresetStatusColorType;
|
||||
color?: LiteralUnion<PresetColorType, string>;
|
||||
text?: React.ReactNode;
|
||||
offset?: [number | string, number | string];
|
||||
title?: string;
|
||||
}
|
||||
export default class Badge extends React.Component<BadgeProps, any> {
|
||||
static defaultProps: {
|
||||
count: null;
|
||||
showZero: boolean;
|
||||
dot: boolean;
|
||||
overflowCount: number;
|
||||
};
|
||||
getNumberedDisplayCount(): string | number | null;
|
||||
getDisplayCount(): string | number | null;
|
||||
getScrollNumberTitle(): string | number | undefined;
|
||||
getStyleWithOffset(): React.CSSProperties | undefined;
|
||||
getBadgeClassName(prefixCls: string, direction?: string): string;
|
||||
hasStatus(): boolean;
|
||||
isZero(): boolean;
|
||||
isDot(): boolean;
|
||||
isHidden(): boolean;
|
||||
renderStatusText(prefixCls: string): JSX.Element | null;
|
||||
renderDisplayComponent(): 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>)> | undefined;
|
||||
renderBadgeNumber(prefixCls: string, scrollNumberPrefixCls: string): JSX.Element | null;
|
||||
renderBadge: ({ getPrefixCls, direction }: ConfigConsumerProps) => JSX.Element;
|
||||
render(): JSX.Element;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user