Latest updates from IceHrmPro
This commit is contained in:
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;
|
||||
}
|
||||
283
web/node_modules/antd/es/badge/index.js
generated
vendored
Normal file
283
web/node_modules/antd/es/badge/index.js
generated
vendored
Normal file
@@ -0,0 +1,283 @@
|
||||
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 Animate from 'rc-animate';
|
||||
import omit from 'omit.js';
|
||||
import classNames from 'classnames';
|
||||
import ScrollNumber from './ScrollNumber';
|
||||
import { PresetColorTypes } from '../_util/colors';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
|
||||
function isPresetColor(color) {
|
||||
return PresetColorTypes.indexOf(color) !== -1;
|
||||
}
|
||||
|
||||
var Badge = /*#__PURE__*/function (_React$Component) {
|
||||
_inherits(Badge, _React$Component);
|
||||
|
||||
var _super = _createSuper(Badge);
|
||||
|
||||
function Badge() {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, Badge);
|
||||
|
||||
_this = _super.apply(this, arguments);
|
||||
|
||||
_this.renderBadge = function (_ref) {
|
||||
var _classNames;
|
||||
|
||||
var getPrefixCls = _ref.getPrefixCls,
|
||||
direction = _ref.direction;
|
||||
|
||||
var _a = _this.props,
|
||||
customizePrefixCls = _a.prefixCls,
|
||||
customizeScrollNumberPrefixCls = _a.scrollNumberPrefixCls,
|
||||
children = _a.children,
|
||||
status = _a.status,
|
||||
text = _a.text,
|
||||
color = _a.color,
|
||||
restProps = __rest(_a, ["prefixCls", "scrollNumberPrefixCls", "children", "status", "text", "color"]);
|
||||
|
||||
var omitArr = ['count', 'showZero', 'overflowCount', 'className', 'style', 'dot', 'offset', 'title'];
|
||||
var prefixCls = getPrefixCls('badge', customizePrefixCls);
|
||||
var scrollNumberPrefixCls = getPrefixCls('scroll-number', customizeScrollNumberPrefixCls);
|
||||
|
||||
var scrollNumber = _this.renderBadgeNumber(prefixCls, scrollNumberPrefixCls);
|
||||
|
||||
var statusText = _this.renderStatusText(prefixCls);
|
||||
|
||||
var statusCls = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-status-dot"), _this.hasStatus()), _defineProperty(_classNames, "".concat(prefixCls, "-status-").concat(status), !!status), _defineProperty(_classNames, "".concat(prefixCls, "-status-").concat(color), isPresetColor(color)), _classNames));
|
||||
var statusStyle = {};
|
||||
|
||||
if (color && !isPresetColor(color)) {
|
||||
statusStyle.background = color;
|
||||
} // <Badge status="success" />
|
||||
|
||||
|
||||
if (!children && _this.hasStatus()) {
|
||||
var styleWithOffset = _this.getStyleWithOffset();
|
||||
|
||||
var statusTextColor = styleWithOffset && styleWithOffset.color;
|
||||
return /*#__PURE__*/React.createElement("span", _extends({}, omit(restProps, omitArr), {
|
||||
className: _this.getBadgeClassName(prefixCls, direction),
|
||||
style: styleWithOffset
|
||||
}), /*#__PURE__*/React.createElement("span", {
|
||||
className: statusCls,
|
||||
style: statusStyle
|
||||
}), /*#__PURE__*/React.createElement("span", {
|
||||
style: {
|
||||
color: statusTextColor
|
||||
},
|
||||
className: "".concat(prefixCls, "-status-text")
|
||||
}, text));
|
||||
}
|
||||
|
||||
return /*#__PURE__*/React.createElement("span", _extends({}, omit(restProps, omitArr), {
|
||||
className: _this.getBadgeClassName(prefixCls, direction)
|
||||
}), children, /*#__PURE__*/React.createElement(Animate, {
|
||||
component: "",
|
||||
showProp: "data-show",
|
||||
transitionName: children ? "".concat(prefixCls, "-zoom") : '',
|
||||
transitionAppear: true
|
||||
}, scrollNumber), statusText);
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(Badge, [{
|
||||
key: "getNumberedDisplayCount",
|
||||
value: function getNumberedDisplayCount() {
|
||||
var _this$props = this.props,
|
||||
count = _this$props.count,
|
||||
overflowCount = _this$props.overflowCount;
|
||||
var displayCount = count > overflowCount ? "".concat(overflowCount, "+") : count;
|
||||
return displayCount;
|
||||
}
|
||||
}, {
|
||||
key: "getDisplayCount",
|
||||
value: function getDisplayCount() {
|
||||
var isDot = this.isDot(); // dot mode don't need count
|
||||
|
||||
if (isDot) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return this.getNumberedDisplayCount();
|
||||
}
|
||||
}, {
|
||||
key: "getScrollNumberTitle",
|
||||
value: function getScrollNumberTitle() {
|
||||
var _this$props2 = this.props,
|
||||
title = _this$props2.title,
|
||||
count = _this$props2.count;
|
||||
|
||||
if (title) {
|
||||
return title;
|
||||
}
|
||||
|
||||
return typeof count === 'string' || typeof count === 'number' ? count : undefined;
|
||||
}
|
||||
}, {
|
||||
key: "getStyleWithOffset",
|
||||
value: function getStyleWithOffset() {
|
||||
var _this$props3 = this.props,
|
||||
offset = _this$props3.offset,
|
||||
style = _this$props3.style;
|
||||
return offset ? _extends({
|
||||
right: -parseInt(offset[0], 10),
|
||||
marginTop: offset[1]
|
||||
}, style) : style;
|
||||
}
|
||||
}, {
|
||||
key: "getBadgeClassName",
|
||||
value: function getBadgeClassName(prefixCls) {
|
||||
var _classNames2;
|
||||
|
||||
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ltr';
|
||||
var _this$props4 = this.props,
|
||||
className = _this$props4.className,
|
||||
children = _this$props4.children;
|
||||
return classNames(className, prefixCls, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-status"), this.hasStatus()), _defineProperty(_classNames2, "".concat(prefixCls, "-not-a-wrapper"), !children), _defineProperty(_classNames2, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames2));
|
||||
}
|
||||
}, {
|
||||
key: "hasStatus",
|
||||
value: function hasStatus() {
|
||||
var _this$props5 = this.props,
|
||||
status = _this$props5.status,
|
||||
color = _this$props5.color;
|
||||
return !!status || !!color;
|
||||
}
|
||||
}, {
|
||||
key: "isZero",
|
||||
value: function isZero() {
|
||||
var numberedDisplayCount = this.getNumberedDisplayCount();
|
||||
return numberedDisplayCount === '0' || numberedDisplayCount === 0;
|
||||
}
|
||||
}, {
|
||||
key: "isDot",
|
||||
value: function isDot() {
|
||||
var dot = this.props.dot;
|
||||
var isZero = this.isZero();
|
||||
return dot && !isZero || this.hasStatus();
|
||||
}
|
||||
}, {
|
||||
key: "isHidden",
|
||||
value: function isHidden() {
|
||||
var showZero = this.props.showZero;
|
||||
var displayCount = this.getDisplayCount();
|
||||
var isZero = this.isZero();
|
||||
var isDot = this.isDot();
|
||||
var isEmpty = displayCount === null || displayCount === undefined || displayCount === '';
|
||||
return (isEmpty || isZero && !showZero) && !isDot;
|
||||
}
|
||||
}, {
|
||||
key: "renderStatusText",
|
||||
value: function renderStatusText(prefixCls) {
|
||||
var text = this.props.text;
|
||||
var hidden = this.isHidden();
|
||||
return hidden || !text ? null : /*#__PURE__*/React.createElement("span", {
|
||||
className: "".concat(prefixCls, "-status-text")
|
||||
}, text);
|
||||
}
|
||||
}, {
|
||||
key: "renderDisplayComponent",
|
||||
value: function renderDisplayComponent() {
|
||||
var count = this.props.count;
|
||||
var customNode = count;
|
||||
|
||||
if (!customNode || _typeof(customNode) !== 'object') {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return React.cloneElement(customNode, {
|
||||
style: _extends(_extends({}, this.getStyleWithOffset()), customNode.props && customNode.props.style)
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "renderBadgeNumber",
|
||||
value: function renderBadgeNumber(prefixCls, scrollNumberPrefixCls) {
|
||||
var _classNames3;
|
||||
|
||||
var _this$props6 = this.props,
|
||||
status = _this$props6.status,
|
||||
count = _this$props6.count,
|
||||
color = _this$props6.color;
|
||||
var displayCount = this.getDisplayCount();
|
||||
var isDot = this.isDot();
|
||||
var hidden = this.isHidden();
|
||||
var scrollNumberCls = classNames((_classNames3 = {}, _defineProperty(_classNames3, "".concat(prefixCls, "-dot"), isDot), _defineProperty(_classNames3, "".concat(prefixCls, "-count"), !isDot), _defineProperty(_classNames3, "".concat(prefixCls, "-multiple-words"), !isDot && count && count.toString && count.toString().length > 1), _defineProperty(_classNames3, "".concat(prefixCls, "-status-").concat(status), !!status), _defineProperty(_classNames3, "".concat(prefixCls, "-status-").concat(color), isPresetColor(color)), _classNames3));
|
||||
var statusStyle = this.getStyleWithOffset();
|
||||
|
||||
if (color && !isPresetColor(color)) {
|
||||
statusStyle = statusStyle || {};
|
||||
statusStyle.background = color;
|
||||
}
|
||||
|
||||
return hidden ? null : /*#__PURE__*/React.createElement(ScrollNumber, {
|
||||
prefixCls: scrollNumberPrefixCls,
|
||||
"data-show": !hidden,
|
||||
className: scrollNumberCls,
|
||||
count: displayCount,
|
||||
displayComponent: this.renderDisplayComponent() // <Badge status="success" count={<Icon type="xxx" />}></Badge>
|
||||
,
|
||||
title: this.getScrollNumberTitle(),
|
||||
style: statusStyle,
|
||||
key: "scrollNumber"
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderBadge);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Badge;
|
||||
}(React.Component);
|
||||
|
||||
export { Badge as default };
|
||||
Badge.defaultProps = {
|
||||
count: null,
|
||||
showZero: false,
|
||||
dot: false,
|
||||
overflowCount: 99
|
||||
};
|
||||
2
web/node_modules/antd/es/badge/style/css.js
generated
vendored
Normal file
2
web/node_modules/antd/es/badge/style/css.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.css';
|
||||
import './index.css';
|
||||
341
web/node_modules/antd/es/badge/style/index.css
generated
vendored
Normal file
341
web/node_modules/antd/es/badge/style/index.css
generated
vendored
Normal file
@@ -0,0 +1,341 @@
|
||||
/* 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-badge {
|
||||
-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;
|
||||
color: unset;
|
||||
line-height: 1;
|
||||
}
|
||||
.ant-badge-count {
|
||||
z-index: auto;
|
||||
min-width: 20px;
|
||||
height: 20px;
|
||||
padding: 0 6px;
|
||||
color: #fff;
|
||||
font-weight: normal;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
background: #ff4d4f;
|
||||
border-radius: 10px;
|
||||
-webkit-box-shadow: 0 0 0 1px #fff;
|
||||
box-shadow: 0 0 0 1px #fff;
|
||||
}
|
||||
.ant-badge-count a,
|
||||
.ant-badge-count a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
.ant-badge-multiple-words {
|
||||
padding: 0 8px;
|
||||
}
|
||||
.ant-badge-dot {
|
||||
z-index: auto;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
background: #ff4d4f;
|
||||
border-radius: 100%;
|
||||
-webkit-box-shadow: 0 0 0 1px #fff;
|
||||
box-shadow: 0 0 0 1px #fff;
|
||||
}
|
||||
.ant-badge-count,
|
||||
.ant-badge-dot,
|
||||
.ant-badge .ant-scroll-number-custom-component {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
-webkit-transform: translate(50%, -50%);
|
||||
transform: translate(50%, -50%);
|
||||
-webkit-transform-origin: 100% 0%;
|
||||
transform-origin: 100% 0%;
|
||||
}
|
||||
.ant-badge-status {
|
||||
line-height: inherit;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
.ant-badge-status-dot {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
vertical-align: middle;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.ant-badge-status-success {
|
||||
background-color: #52c41a;
|
||||
}
|
||||
.ant-badge-status-processing {
|
||||
position: relative;
|
||||
background-color: #1890ff;
|
||||
}
|
||||
.ant-badge-status-processing::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #1890ff;
|
||||
border-radius: 50%;
|
||||
-webkit-animation: antStatusProcessing 1.2s infinite ease-in-out;
|
||||
animation: antStatusProcessing 1.2s infinite ease-in-out;
|
||||
content: '';
|
||||
}
|
||||
.ant-badge-status-default {
|
||||
background-color: #d9d9d9;
|
||||
}
|
||||
.ant-badge-status-error {
|
||||
background-color: #ff4d4f;
|
||||
}
|
||||
.ant-badge-status-warning {
|
||||
background-color: #faad14;
|
||||
}
|
||||
.ant-badge-status-pink {
|
||||
background: #eb2f96;
|
||||
}
|
||||
.ant-badge-status-magenta {
|
||||
background: #eb2f96;
|
||||
}
|
||||
.ant-badge-status-red {
|
||||
background: #f5222d;
|
||||
}
|
||||
.ant-badge-status-volcano {
|
||||
background: #fa541c;
|
||||
}
|
||||
.ant-badge-status-orange {
|
||||
background: #fa8c16;
|
||||
}
|
||||
.ant-badge-status-yellow {
|
||||
background: #fadb14;
|
||||
}
|
||||
.ant-badge-status-gold {
|
||||
background: #faad14;
|
||||
}
|
||||
.ant-badge-status-cyan {
|
||||
background: #13c2c2;
|
||||
}
|
||||
.ant-badge-status-lime {
|
||||
background: #a0d911;
|
||||
}
|
||||
.ant-badge-status-green {
|
||||
background: #52c41a;
|
||||
}
|
||||
.ant-badge-status-blue {
|
||||
background: #1890ff;
|
||||
}
|
||||
.ant-badge-status-geekblue {
|
||||
background: #2f54eb;
|
||||
}
|
||||
.ant-badge-status-purple {
|
||||
background: #722ed1;
|
||||
}
|
||||
.ant-badge-status-text {
|
||||
margin-left: 8px;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
font-size: 14px;
|
||||
}
|
||||
.ant-badge-zoom-appear,
|
||||
.ant-badge-zoom-enter {
|
||||
-webkit-animation: antZoomBadgeIn 0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46);
|
||||
animation: antZoomBadgeIn 0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46);
|
||||
-webkit-animation-fill-mode: both;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
.ant-badge-zoom-leave {
|
||||
-webkit-animation: antZoomBadgeOut 0.3s cubic-bezier(0.71, -0.46, 0.88, 0.6);
|
||||
animation: antZoomBadgeOut 0.3s cubic-bezier(0.71, -0.46, 0.88, 0.6);
|
||||
-webkit-animation-fill-mode: both;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
.ant-badge-not-a-wrapper:not(.ant-badge-status) {
|
||||
vertical-align: middle;
|
||||
}
|
||||
.ant-badge-not-a-wrapper .ant-scroll-number {
|
||||
position: relative;
|
||||
top: auto;
|
||||
display: block;
|
||||
}
|
||||
.ant-badge-not-a-wrapper .ant-badge-count {
|
||||
-webkit-transform: none;
|
||||
transform: none;
|
||||
}
|
||||
@-webkit-keyframes antStatusProcessing {
|
||||
0% {
|
||||
-webkit-transform: scale(0.8);
|
||||
transform: scale(0.8);
|
||||
opacity: 0.5;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(2.4);
|
||||
transform: scale(2.4);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes antStatusProcessing {
|
||||
0% {
|
||||
-webkit-transform: scale(0.8);
|
||||
transform: scale(0.8);
|
||||
opacity: 0.5;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(2.4);
|
||||
transform: scale(2.4);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
.ant-scroll-number {
|
||||
overflow: hidden;
|
||||
}
|
||||
.ant-scroll-number-only {
|
||||
display: inline-block;
|
||||
height: 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-scroll-number-only > p.ant-scroll-number-only-unit {
|
||||
height: 20px;
|
||||
margin: 0;
|
||||
}
|
||||
.ant-scroll-number-symbol {
|
||||
vertical-align: top;
|
||||
}
|
||||
@-webkit-keyframes antZoomBadgeIn {
|
||||
0% {
|
||||
-webkit-transform: scale(0) translate(50%, -50%);
|
||||
transform: scale(0) translate(50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(1) translate(50%, -50%);
|
||||
transform: scale(1) translate(50%, -50%);
|
||||
}
|
||||
}
|
||||
@keyframes antZoomBadgeIn {
|
||||
0% {
|
||||
-webkit-transform: scale(0) translate(50%, -50%);
|
||||
transform: scale(0) translate(50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(1) translate(50%, -50%);
|
||||
transform: scale(1) translate(50%, -50%);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes antZoomBadgeOut {
|
||||
0% {
|
||||
-webkit-transform: scale(1) translate(50%, -50%);
|
||||
transform: scale(1) translate(50%, -50%);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(0) translate(50%, -50%);
|
||||
transform: scale(0) translate(50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes antZoomBadgeOut {
|
||||
0% {
|
||||
-webkit-transform: scale(1) translate(50%, -50%);
|
||||
transform: scale(1) translate(50%, -50%);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(0) translate(50%, -50%);
|
||||
transform: scale(0) translate(50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
.ant-badge-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
.ant-badge-rtl .ant-badge-count,
|
||||
.ant-badge-rtl .ant-badge-dot,
|
||||
.ant-badge-rtl .ant-badge .ant-scroll-number-custom-component {
|
||||
right: auto;
|
||||
left: 0;
|
||||
direction: ltr;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
}
|
||||
.ant-badge-rtl.ant-badge .ant-scroll-number-custom-component {
|
||||
right: auto;
|
||||
left: 0;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
}
|
||||
.ant-badge-rtl .ant-badge-status-text {
|
||||
margin-right: 8px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.ant-badge-rtl .ant-badge-zoom-appear,
|
||||
.ant-badge-rtl .ant-badge-zoom-enter {
|
||||
-webkit-animation-name: antZoomBadgeInRtl;
|
||||
animation-name: antZoomBadgeInRtl;
|
||||
}
|
||||
.ant-badge-rtl .ant-badge-zoom-leave {
|
||||
-webkit-animation-name: antZoomBadgeOutRtl;
|
||||
animation-name: antZoomBadgeOutRtl;
|
||||
}
|
||||
.ant-badge-not-a-wrapper .ant-badge-count {
|
||||
-webkit-transform: none;
|
||||
transform: none;
|
||||
}
|
||||
@-webkit-keyframes antZoomBadgeInRtl {
|
||||
0% {
|
||||
-webkit-transform: scale(0) translate(-50%, -50%);
|
||||
transform: scale(0) translate(-50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(1) translate(-50%, -50%);
|
||||
transform: scale(1) translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
@keyframes antZoomBadgeInRtl {
|
||||
0% {
|
||||
-webkit-transform: scale(0) translate(-50%, -50%);
|
||||
transform: scale(0) translate(-50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(1) translate(-50%, -50%);
|
||||
transform: scale(1) translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes antZoomBadgeOutRtl {
|
||||
0% {
|
||||
-webkit-transform: scale(1) translate(-50%, -50%);
|
||||
transform: scale(1) translate(-50%, -50%);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(0) translate(-50%, -50%);
|
||||
transform: scale(0) translate(-50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes antZoomBadgeOutRtl {
|
||||
0% {
|
||||
-webkit-transform: scale(1) translate(-50%, -50%);
|
||||
transform: scale(1) translate(-50%, -50%);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(0) translate(-50%, -50%);
|
||||
transform: scale(0) translate(-50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
2
web/node_modules/antd/es/badge/style/index.d.ts
generated
vendored
Normal file
2
web/node_modules/antd/es/badge/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/badge/style/index.js
generated
vendored
Normal file
2
web/node_modules/antd/es/badge/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
193
web/node_modules/antd/es/badge/style/index.less
generated
vendored
Normal file
193
web/node_modules/antd/es/badge/style/index.less
generated
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../style/mixins/index';
|
||||
|
||||
@badge-prefix-cls: ~'@{ant-prefix}-badge';
|
||||
@number-prefix-cls: ~'@{ant-prefix}-scroll-number';
|
||||
|
||||
.@{badge-prefix-cls} {
|
||||
.reset-component;
|
||||
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
color: unset;
|
||||
line-height: 1;
|
||||
|
||||
&-count {
|
||||
z-index: @zindex-badge;
|
||||
min-width: @badge-height;
|
||||
height: @badge-height;
|
||||
padding: 0 6px;
|
||||
color: @badge-text-color;
|
||||
font-weight: @badge-font-weight;
|
||||
font-size: @badge-font-size;
|
||||
line-height: @badge-height;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
background: @highlight-color;
|
||||
border-radius: @badge-height / 2;
|
||||
box-shadow: 0 0 0 1px @shadow-color-inverse;
|
||||
a,
|
||||
a:hover {
|
||||
color: @badge-text-color;
|
||||
}
|
||||
}
|
||||
|
||||
&-multiple-words {
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
&-dot {
|
||||
z-index: @zindex-badge;
|
||||
width: @badge-dot-size;
|
||||
height: @badge-dot-size;
|
||||
background: @highlight-color;
|
||||
border-radius: 100%;
|
||||
box-shadow: 0 0 0 1px @shadow-color-inverse;
|
||||
}
|
||||
|
||||
&-count,
|
||||
&-dot,
|
||||
.@{number-prefix-cls}-custom-component {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
transform: translate(50%, -50%);
|
||||
transform-origin: 100% 0%;
|
||||
}
|
||||
|
||||
&-status {
|
||||
line-height: inherit;
|
||||
vertical-align: baseline;
|
||||
|
||||
&-dot {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
display: inline-block;
|
||||
width: @badge-status-size;
|
||||
height: @badge-status-size;
|
||||
vertical-align: middle;
|
||||
border-radius: 50%;
|
||||
}
|
||||
&-success {
|
||||
background-color: @success-color;
|
||||
}
|
||||
&-processing {
|
||||
position: relative;
|
||||
background-color: @processing-color;
|
||||
&::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid @processing-color;
|
||||
border-radius: 50%;
|
||||
animation: antStatusProcessing 1.2s infinite ease-in-out;
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
&-default {
|
||||
background-color: @normal-color;
|
||||
}
|
||||
&-error {
|
||||
background-color: @error-color;
|
||||
}
|
||||
&-warning {
|
||||
background-color: @warning-color;
|
||||
}
|
||||
|
||||
// mixin to iterate over colors and create CSS class for each one
|
||||
.make-color-classes(@i: length(@preset-colors)) when (@i > 0) {
|
||||
.make-color-classes(@i - 1);
|
||||
@color: extract(@preset-colors, @i);
|
||||
@darkColor: '@{color}-6';
|
||||
&-@{color} {
|
||||
background: @@darkColor;
|
||||
}
|
||||
}
|
||||
.make-color-classes();
|
||||
|
||||
&-text {
|
||||
margin-left: 8px;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
}
|
||||
}
|
||||
|
||||
&-zoom-appear,
|
||||
&-zoom-enter {
|
||||
animation: antZoomBadgeIn 0.3s @ease-out-back;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
|
||||
&-zoom-leave {
|
||||
animation: antZoomBadgeOut 0.3s @ease-in-back;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
|
||||
&-not-a-wrapper {
|
||||
&:not(.@{badge-prefix-cls}-status) {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.@{ant-prefix}-scroll-number {
|
||||
position: relative;
|
||||
top: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.@{badge-prefix-cls}-count {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes antStatusProcessing {
|
||||
0% {
|
||||
transform: scale(0.8);
|
||||
opacity: 0.5;
|
||||
}
|
||||
100% {
|
||||
transform: scale(2.4);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.@{number-prefix-cls} {
|
||||
overflow: hidden;
|
||||
&-only {
|
||||
display: inline-block;
|
||||
height: @badge-height;
|
||||
transition: all 0.3s @ease-in-out;
|
||||
> p.@{number-prefix-cls}-only-unit {
|
||||
height: @badge-height;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-symbol {
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes antZoomBadgeIn {
|
||||
0% {
|
||||
transform: scale(0) translate(50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: scale(1) translate(50%, -50%);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes antZoomBadgeOut {
|
||||
0% {
|
||||
transform: scale(1) translate(50%, -50%);
|
||||
}
|
||||
100% {
|
||||
transform: scale(0) translate(50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@import './rtl';
|
||||
78
web/node_modules/antd/es/badge/style/rtl.less
generated
vendored
Normal file
78
web/node_modules/antd/es/badge/style/rtl.less
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
@import '../../style/themes/index';
|
||||
@import '../../style/mixins/index';
|
||||
|
||||
@badge-prefix-cls: ~'@{ant-prefix}-badge';
|
||||
@number-prefix-cls: ~'@{ant-prefix}-scroll-number';
|
||||
|
||||
.@{badge-prefix-cls} {
|
||||
&-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
&-count,
|
||||
&-dot,
|
||||
.@{number-prefix-cls}-custom-component {
|
||||
.@{badge-prefix-cls}-rtl & {
|
||||
right: auto;
|
||||
left: 0;
|
||||
direction: ltr;
|
||||
transform: translate(-50%, -50%);
|
||||
transform-origin: 0% 0%;
|
||||
}
|
||||
}
|
||||
|
||||
.@{badge-prefix-cls}-rtl& .@{number-prefix-cls}-custom-component {
|
||||
right: auto;
|
||||
left: 0;
|
||||
transform: translate(-50%, -50%);
|
||||
transform-origin: 0% 0%;
|
||||
}
|
||||
|
||||
&-status {
|
||||
&-text {
|
||||
.@{badge-prefix-cls}-rtl & {
|
||||
margin-right: 8px;
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-zoom-appear,
|
||||
&-zoom-enter {
|
||||
.@{badge-prefix-cls}-rtl & {
|
||||
animation-name: antZoomBadgeInRtl;
|
||||
}
|
||||
}
|
||||
|
||||
&-zoom-leave {
|
||||
.@{badge-prefix-cls}-rtl & {
|
||||
animation-name: antZoomBadgeOutRtl;
|
||||
}
|
||||
}
|
||||
|
||||
&-not-a-wrapper {
|
||||
.@{badge-prefix-cls}-count {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes antZoomBadgeInRtl {
|
||||
0% {
|
||||
transform: scale(0) translate(-50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: scale(1) translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes antZoomBadgeOutRtl {
|
||||
0% {
|
||||
transform: scale(1) translate(-50%, -50%);
|
||||
}
|
||||
100% {
|
||||
transform: scale(0) translate(-50%, -50%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user