Latest updates from IceHrmPro

This commit is contained in:
Thilina Pituwala
2020-05-20 18:47:29 +02:00
parent 60c92d7935
commit 7453a58aad
18012 changed files with 2089245 additions and 10173 deletions

22
web/node_modules/antd/lib/statistic/Countdown.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
import * as React from 'react';
import { StatisticProps } from './Statistic';
import { countdownValueType, FormatConfig } from './utils';
interface CountdownProps extends StatisticProps {
value?: countdownValueType;
format?: string;
onFinish?: () => void;
}
declare class Countdown extends React.Component<CountdownProps, {}> {
static defaultProps: Partial<CountdownProps>;
countdownId?: number;
componentDidMount(): void;
componentDidUpdate(): void;
componentWillUnmount(): void;
syncTimer: () => void;
startTimer: () => void;
stopTimer: () => void;
formatCountdown: (value: React.ReactText, config: FormatConfig) => string;
valueRender: (node: React.ReactElement<HTMLDivElement, 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.ReactElement<HTMLDivElement, 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;
}
export default Countdown;

146
web/node_modules/antd/lib/statistic/Countdown.js generated vendored Normal file
View File

@@ -0,0 +1,146 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(require("react"));
var _Statistic = _interopRequireDefault(require("./Statistic"));
var _utils = require("./utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _typeof(obj) { "@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 REFRESH_INTERVAL = 1000 / 30;
function getTime(value) {
return new Date(value).getTime();
}
var Countdown = /*#__PURE__*/function (_React$Component) {
_inherits(Countdown, _React$Component);
var _super = _createSuper(Countdown);
function Countdown() {
var _this;
_classCallCheck(this, Countdown);
_this = _super.apply(this, arguments);
_this.syncTimer = function () {
var value = _this.props.value;
var timestamp = getTime(value);
if (timestamp >= Date.now()) {
_this.startTimer();
} else {
_this.stopTimer();
}
};
_this.startTimer = function () {
if (_this.countdownId) return;
_this.countdownId = window.setInterval(function () {
_this.forceUpdate();
}, REFRESH_INTERVAL);
};
_this.stopTimer = function () {
var _this$props = _this.props,
onFinish = _this$props.onFinish,
value = _this$props.value;
if (_this.countdownId) {
clearInterval(_this.countdownId);
_this.countdownId = undefined;
var timestamp = getTime(value);
if (onFinish && timestamp < Date.now()) {
onFinish();
}
}
};
_this.formatCountdown = function (value, config) {
var format = _this.props.format;
return (0, _utils.formatCountdown)(value, _extends(_extends({}, config), {
format: format
}));
}; // Countdown do not need display the timestamp
_this.valueRender = function (node) {
return React.cloneElement(node, {
title: undefined
});
};
return _this;
}
_createClass(Countdown, [{
key: "componentDidMount",
value: function componentDidMount() {
this.syncTimer();
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate() {
this.syncTimer();
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.stopTimer();
}
}, {
key: "render",
value: function render() {
return /*#__PURE__*/React.createElement(_Statistic["default"], _extends({
valueRender: this.valueRender
}, this.props, {
formatter: this.formatCountdown
}));
}
}]);
return Countdown;
}(React.Component);
Countdown.defaultProps = {
format: 'HH:mm:ss'
};
var _default = Countdown;
exports["default"] = _default;

7
web/node_modules/antd/lib/statistic/Number.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import * as React from 'react';
import { valueType, FormatConfig } from './utils';
interface NumberProps extends FormatConfig {
value: valueType;
}
declare const StatisticNumber: React.FC<NumberProps>;
export default StatisticNumber;

72
web/node_modules/antd/lib/statistic/Number.js generated vendored Normal file
View File

@@ -0,0 +1,72 @@
"use strict";
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); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(require("react"));
var _padEnd = _interopRequireDefault(require("lodash/padEnd"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var StatisticNumber = function StatisticNumber(props) {
var value = props.value,
formatter = props.formatter,
precision = props.precision,
decimalSeparator = props.decimalSeparator,
_props$groupSeparator = props.groupSeparator,
groupSeparator = _props$groupSeparator === void 0 ? '' : _props$groupSeparator,
prefixCls = props.prefixCls;
var valueNode;
if (typeof formatter === 'function') {
// Customize formatter
valueNode = formatter(value);
} else {
// Internal formatter
var val = String(value);
var cells = val.match(/^(-?)(\d*)(\.(\d+))?$/); // Process if illegal number
if (!cells || val === '-') {
valueNode = val;
} else {
var negative = cells[1];
var _int = cells[2] || '0';
var decimal = cells[4] || '';
_int = _int.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
if (typeof precision === 'number') {
decimal = (0, _padEnd["default"])(decimal, precision, '0').slice(0, precision);
}
if (decimal) {
decimal = "".concat(decimalSeparator).concat(decimal);
}
valueNode = [/*#__PURE__*/React.createElement("span", {
key: "int",
className: "".concat(prefixCls, "-content-value-int")
}, negative, _int), decimal && /*#__PURE__*/React.createElement("span", {
key: "decimal",
className: "".concat(prefixCls, "-content-value-decimal")
}, decimal)];
}
}
return /*#__PURE__*/React.createElement("span", {
className: "".concat(prefixCls, "-content-value")
}, valueNode);
};
var _default = StatisticNumber;
exports["default"] = _default;

19
web/node_modules/antd/lib/statistic/Statistic.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import * as React from 'react';
import Countdown from './Countdown';
import { valueType, FormatConfig } from './utils';
interface StatisticComponent {
Countdown: typeof Countdown;
}
export interface StatisticProps extends FormatConfig {
prefixCls?: string;
className?: string;
style?: React.CSSProperties;
value?: valueType;
valueStyle?: React.CSSProperties;
valueRender?: (node: React.ReactNode) => React.ReactNode;
title?: React.ReactNode;
prefix?: React.ReactNode;
suffix?: React.ReactNode;
}
declare const WrapperStatistic: React.FC<StatisticProps> & StatisticComponent;
export default WrapperStatistic;

72
web/node_modules/antd/lib/statistic/Statistic.js generated vendored Normal file
View File

@@ -0,0 +1,72 @@
"use strict";
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); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var React = _interopRequireWildcard(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _context = require("../config-provider/context");
var _Number = _interopRequireDefault(require("./Number"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _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); }
var Statistic = function Statistic(props) {
var prefixCls = props.prefixCls,
className = props.className,
style = props.style,
valueStyle = props.valueStyle,
_props$value = props.value,
value = _props$value === void 0 ? 0 : _props$value,
title = props.title,
valueRender = props.valueRender,
prefix = props.prefix,
suffix = props.suffix,
direction = props.direction;
var valueNode = /*#__PURE__*/React.createElement(_Number["default"], _extends({}, props, {
value: value
}));
if (valueRender) {
valueNode = valueRender(valueNode);
}
var cls = (0, _classnames["default"])(prefixCls, className, _defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'));
return /*#__PURE__*/React.createElement("div", {
className: cls,
style: style
}, title && /*#__PURE__*/React.createElement("div", {
className: "".concat(prefixCls, "-title")
}, title), /*#__PURE__*/React.createElement("div", {
style: valueStyle,
className: "".concat(prefixCls, "-content")
}, prefix && /*#__PURE__*/React.createElement("span", {
className: "".concat(prefixCls, "-content-prefix")
}, prefix), valueNode, suffix && /*#__PURE__*/React.createElement("span", {
className: "".concat(prefixCls, "-content-suffix")
}, suffix)));
};
Statistic.defaultProps = {
decimalSeparator: '.',
groupSeparator: ','
};
var WrapperStatistic = (0, _context.withConfigConsumer)({
prefixCls: 'statistic'
})(Statistic);
var _default = WrapperStatistic;
exports["default"] = _default;

2
web/node_modules/antd/lib/statistic/index.d.ts generated vendored Normal file
View File

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

16
web/node_modules/antd/lib/statistic/index.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _Statistic = _interopRequireDefault(require("./Statistic"));
var _Countdown = _interopRequireDefault(require("./Countdown"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
_Statistic["default"].Countdown = _Countdown["default"];
var _default = _Statistic["default"];
exports["default"] = _default;

5
web/node_modules/antd/lib/statistic/style/css.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
"use strict";
require("../../style/index.css");
require("./index.css");

52
web/node_modules/antd/lib/statistic/style/index.css generated vendored Normal file
View File

@@ -0,0 +1,52 @@
/* 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-statistic {
-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-statistic-title {
margin-bottom: 4px;
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
}
.ant-statistic-content {
color: rgba(0, 0, 0, 0.85);
font-size: 24px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}
.ant-statistic-content-value-decimal {
font-size: 16px;
}
.ant-statistic-content-prefix,
.ant-statistic-content-suffix {
display: inline-block;
}
.ant-statistic-content-prefix {
margin-right: 4px;
}
.ant-statistic-content-suffix {
margin-left: 4px;
font-size: 16px;
}
.ant-statistic-rtl {
direction: rtl;
}
.ant-statistic-rtl .ant-statistic-content-prefix {
margin-right: 0;
margin-left: 4px;
}
.ant-statistic-rtl .ant-statistic-content-suffix {
margin-right: 4px;
margin-left: 0;
}

2
web/node_modules/antd/lib/statistic/style/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import '../../style/index.less';
import './index.less';

5
web/node_modules/antd/lib/statistic/style/index.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
"use strict";
require("../../style/index.less");
require("./index.less");

42
web/node_modules/antd/lib/statistic/style/index.less generated vendored Normal file
View File

@@ -0,0 +1,42 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@statistic-prefix-cls: ~'@{ant-prefix}-statistic';
.@{statistic-prefix-cls} {
.reset-component;
&-title {
margin-bottom: @margin-xss;
color: @text-color-secondary;
font-size: @statistic-title-font-size;
}
&-content {
color: @heading-color;
font-size: @statistic-content-font-size;
font-family: @statistic-font-family;
&-value {
&-decimal {
font-size: @statistic-unit-font-size;
}
}
&-prefix,
&-suffix {
display: inline-block;
}
&-prefix {
margin-right: 4px;
}
&-suffix {
margin-left: 4px;
font-size: @statistic-unit-font-size;
}
}
}
@import './rtl';

26
web/node_modules/antd/lib/statistic/style/rtl.less generated vendored Normal file
View File

@@ -0,0 +1,26 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@statistic-prefix-cls: ~'@{ant-prefix}-statistic';
.@{statistic-prefix-cls} {
&-rtl {
direction: rtl;
}
&-content {
&-prefix {
.@{statistic-prefix-cls}-rtl & {
margin-right: 0;
margin-left: 4px;
}
}
&-suffix {
.@{statistic-prefix-cls}-rtl & {
margin-right: 4px;
margin-left: 0;
}
}
}
}

16
web/node_modules/antd/lib/statistic/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import * as React from 'react';
export declare type valueType = number | string;
export declare type countdownValueType = valueType | string;
export declare type Formatter = false | 'number' | 'countdown' | ((value: valueType, config?: FormatConfig) => React.ReactNode);
export interface FormatConfig {
formatter?: Formatter;
decimalSeparator?: string;
groupSeparator?: string;
precision?: number;
prefixCls?: string;
}
export interface CountdownFormatConfig extends FormatConfig {
format?: string;
}
export declare function formatTimeStr(duration: number, format: string): string;
export declare function formatCountdown(value: countdownValueType, config: CountdownFormatConfig): string;

66
web/node_modules/antd/lib/statistic/utils.js generated vendored Normal file
View File

@@ -0,0 +1,66 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.formatTimeStr = formatTimeStr;
exports.formatCountdown = formatCountdown;
var _padStart = _interopRequireDefault(require("lodash/padStart"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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; }
// Countdown
var timeUnits = [['Y', 1000 * 60 * 60 * 24 * 365], ['M', 1000 * 60 * 60 * 24 * 30], ['D', 1000 * 60 * 60 * 24], ['H', 1000 * 60 * 60], ['m', 1000 * 60], ['s', 1000], ['S', 1]];
function formatTimeStr(duration, format) {
var leftDuration = duration;
var escapeRegex = /\[[^\]]*]/g;
var keepList = (format.match(escapeRegex) || []).map(function (str) {
return str.slice(1, -1);
});
var templateText = format.replace(escapeRegex, '[]');
var replacedText = timeUnits.reduce(function (current, _ref) {
var _ref2 = _slicedToArray(_ref, 2),
name = _ref2[0],
unit = _ref2[1];
if (current.indexOf(name) !== -1) {
var value = Math.floor(leftDuration / unit);
leftDuration -= value * unit;
return current.replace(new RegExp("".concat(name, "+"), 'g'), function (match) {
var len = match.length;
return (0, _padStart["default"])(value.toString(), len, '0');
});
}
return current;
}, templateText);
var index = 0;
return replacedText.replace(escapeRegex, function () {
var match = keepList[index];
index += 1;
return match;
});
}
function formatCountdown(value, config) {
var _config$format = config.format,
format = _config$format === void 0 ? '' : _config$format;
var target = new Date(value).getTime();
var current = Date.now();
var diff = Math.max(target - current, 0);
return formatTimeStr(diff, format);
}