Open yooocen opened 6 years ago
/*!
*/ var GC = GC || {}; GC["Spread"] = /**/ (function(modules) { // webpackBootstrap /**/ // The module cache /**/ var installedModules = {}; /**/ /**/ // The require function /**/ function webpack_require(moduleId) { /**/ /**/ // Check if module is in cache /**/ if(installedModules[moduleId]) /**/ return installedModules[moduleId].exports; /**/ /**/ // Create a new module (and put it into the cache) /**/ var module = installedModules[moduleId] = { /**/ exports: {}, /**/ id: moduleId, /**/ loaded: false /**/ }; /**/ /**/ // Execute the module function /**/ modules[moduleId].call(module.exports, module, module.exports, webpack_require); /**/ /**/ // Flag the module as loaded /**/ module.loaded = true; /**/ /**/ // Return the exports of the module /**/ return module.exports; /**/ } /**/ /**/ /**/ // expose the modules object (webpack_modules) /**/ webpack_require.m = modules; /**/ /**/ // expose the module cache /**/ webpack_require.c = installedModules; /**/ /**/ // webpack_public_path /**/ webpack_require.p = ""; /**/ /**/ // Load entry module and return exports /**/ return webpack_require(0); /**/ }) /****/ /**/ ([ / 0 / /***/ (function(module, exports, webpack_require) {
GC = GC || {}; GC.Spread = GC.Spread || {}; GC.Spread = webpack_require(1); GC.Spread.CalcEngine = webpack_require(24); GC.Spread.CalcEngine.BasicFunctions = webpack_require(31); GC.Spread.CalcEngine.AdvancedFunctions = webpack_require(35); GC.Spread.Sheets = webpack_require(41); GC.Spread.Sheets.CellTypes = webpack_require(82); GC.Spread.Sheets.Bindings = webpack_require(88); GC.Spread.Sheets.Search = webpack_require(94); GC.Spread.Sheets.Outlines = webpack_require(96); GC.Spread.Sheets.Touch = webpack_require(100); GC.Spread.Sheets.FloatingObjects = webpack_require(103); GC.Spread.Sheets.Sparklines = webpack_require(110); GC.Spread.Sheets.Comments = webpack_require(114); GC.Spread.Sheets.ConditionalFormatting = webpack_require(118); GC.Spread.Sheets.Filter = webpack_require(121); GC.Spread.Sheets.Tables = webpack_require(126); GC.Spread.Sheets.Slicers = webpack_require(131); GC.Spread.Sheets.DataValidation = webpack_require(138); GC.Spread.Sheets.Fill = webpack_require(141); GC.Spread.Sheets.FormulaTextBox = webpack_require(147); module.exports = GC.Spread;
// }), / 1 / // (function(module, exports, __webpack_require__) {
exports.Common = __webpack_require__(2);
exports.Commands = __webpack_require__(14);
exports.Formatter = __webpack_require__(17);
exports.Sparklines = __webpack_require__(20);
exports.Slicers = __webpack_require__(22);
// }), / 2 / // (function(module, exports, __webpack_require__) {
var common = __webpack_require__(3);
__webpack_require__(11);
var culture = __webpack_require__(4);
_CopyProperty(common, culture);
var functionHelper = __webpack_require__(12);
_CopyProperty(common, functionHelper);
common._Types = __webpack_require__(5);
common._ArrayHelper = __webpack_require__(10);
common._DateTimeHelper = __webpack_require__(9);
common._NumberHelper = __webpack_require__(6);
common._RegexHelper = __webpack_require__(7);
common._StringHelper = __webpack_require__(8);
common.SR = {};
common.SR['en'] = __webpack_require__(13);
module.exports = common;
function _CopyProperty (to, from) {
for (var prop in from) {
if (from.hasOwnProperty(prop)) {
to[prop] = from[prop];
}
}
}
/***/ }),
/ 3 / /***/ (function(module, exports, __webpack_require__) {
var common = {};
var cM = __webpack_require__(4).CultureManager;
var getResource = function (resources) {
return function () {
var cultureName = cM.culture();
if (resources && cultureName) {
var key = cultureName.substr(0, 2).toLowerCase();
if (resources.hasOwnProperty(key)) {
return resources[key];
}
return resources.en;
}
return {};
};
};
function addElements(a, aCount, index, count) {
if (a && 0 <= index && index < aCount) {
var rows = [], rowCount, i;
for (i = index; i < aCount; i++) {
if (typeof (a[i]) !== 'undefined') {
rows.push(i);
}
}
rowCount = rows.length;
for (i = 0; i < rowCount; i++) {
var k = rows[rowCount - i - 1];
var value = a[k];
a[k] = null;
a[Math.floor(k) + count] = value;
}
}
}
function deleteElements(a, aCount, index, count) {
if (a && 0 <= index && index < aCount) {
var rows = [], rowCount, index2 = index + count, i;
for (i = index; i < aCount; i++) {
if (typeof (a[i]) !== 'undefined') {
if (index <= i && i < index2) {
a[i] = null;
} else if (i >= index2) {
rows.push(i);
}
}
}
rowCount = rows.length;
for (i = 0; i < rowCount; i++) {
var k = rows[i];
var value = a[k];
a[k] = null;
a[Math.floor(k) - count] = value;
}
}
}
function hasOwnProperty(obj, property) {
return obj.hasOwnProperty(property);
}
function isInstanceOf(obj, type) {
return obj instanceof type;
}
common._addElements = addElements;
common._deleteElements = deleteElements;
common._getResource = getResource;
common._hasOwnProperty = hasOwnProperty;
common._isInstanceOf = isInstanceOf;
module.exports = common;
// }), / 4 / // (function(module, exports, __webpack_require__) {
var types = __webpack_require__(5);
var keyword_undefined = undefined, keyword_null = null;
var inherit = types._inherit, each = types._each;
var _EraHelper = (function () {
function _EraHelper() {
}
_EraHelper._isValidEraDate = function (date) {
return date >= this._getEraMin() && date <= this._getEraMax();
};
_EraHelper._getEraDates = function () {
var eras = CultureInfo.eras;
if (eras !== keyword_undefined) {
var eraDates = [];
for (var i = 0; i < eras.length; i++) {
eraDates[i] = new Date(eras[i].startDate.replace(/-/g, '/'));
}
return eraDates;
}
return this._EraDates;
};
_EraHelper._getEraPropByFormat = function (format) {
var self = this, propName, retValue;
switch (format) {
case 'g':
propName = 'symbol';
retValue = self._symbols;
break;
case 'gg':
propName = 'abbreviation';
retValue = self._abbreviations;
break;
case 'ggg':
propName = 'name';
retValue = self._names;
break;
default:
return [];
}
var eras = CultureInfo.eras;
var eraNames = [];
if (eras !== keyword_undefined) {
for (var i = 0; i < eras.length; i++) {
eraNames[i] = eras[i][propName];
}
return eraNames;
}
return retValue;
};
_EraHelper._getEraMax = function () {
var eras = CultureInfo.eras;
if (eras !== keyword_undefined) {
if (eras.length > 0) {
var date = new Date(eras[eras.length - 1].startDate.replace(/-/g, '/'));
date.setFullYear(date.getFullYear() + 99);
return date;
}
}
return this._EraMax;
};
_EraHelper._getEraMin = function () {
var eras = CultureInfo.eras;
if (eras !== keyword_undefined) {
if (eras.length > 0) {
return new Date(eras[0].startDate.replace(/-/g, '/'));
}
}
return this._EraMin;
};
_EraHelper._getEraCount = function () {
var eras = CultureInfo.eras;
if (eras !== keyword_undefined) {
return eras.length;
}
return this._EraCount;
};
_EraHelper._getEraYears = function () {
var eras = CultureInfo.eras;
if (eras !== keyword_undefined) {
var eraYears = [];
for (var i = 1; i < eras.length; i++) {
var date1 = new Date(eras[i - 1].startDate.replace(/-/g, '/'));
var date2 = new Date(eras[i].startDate.replace(/-/g, '/'));
eraYears[i - 1] = date2.getFullYear() - date1.getFullYear() + 1;
}
eraYears[i - 1] = 99;
return eraYears;
}
return this._EraYears;
};
_EraHelper._getEraDate = function (date) {
var eraDate = {};
eraDate._era = -1;
eraDate._eraYear = -1;
var self = this;
if (!self._isValidEraDate(date)) {
return eraDate;
}
for (var i = 0; i < self._getEraCount(); i++) {
var nextDate = i + 1 !== self._getEraCount() ? self._getEraDates()[i + 1] : self._addMilliseconds(self._getEraMax(), 1);
if (date < nextDate) {
eraDate._era = i;
eraDate._eraYear = date.getFullYear() - self._getEraDates()[i].getFullYear() + 1;
break;
}
}
return eraDate;
};
_EraHelper._addMilliseconds = function (date, msec) {
var newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds());
newDate.setMilliseconds(newDate.getMilliseconds() + msec);
return new Date(newDate.valueOf());
};
_EraHelper._getYearFromEra = function (era, eraYear) {
var startYear = _EraHelper._getEraDates()[era].getFullYear();
return startYear + eraYear - 1;
};
_EraHelper._parseEraPart = function (format, text) {
text = text.toUpperCase();
var eraNames = _EraHelper._getEraPropByFormat(format);
for (var i = 0; i < eraNames.length; i++) {
if (eraNames[i] === text) {
return i;
}
}
return -1;
};
_EraHelper._formatEraPart = function (format, date) {
var eras = _EraHelper;
var eraDateInfo = eras._getEraDate(date);
var era = eraDateInfo._era;
if (era >= 0) {
var ret = eras._getEraPropByFormat(format);
if (ret.length > 0) {
return ret[era];
}
}
var eraYear = eraDateInfo._eraYear;
if (eraYear >= 0) {
var eraYearStr = eraYear.toString();
if (format === 'ee') {
if (eraYearStr.length === 1) {
eraYearStr = '0' + eraYearStr;
}
return eraYearStr;
}
if (format === 'e') {
return eraYearStr;
}
}
return '';
};
_EraHelper._EraDates = [new Date(1868, 9 - 1, 8), new Date(1912, 7 - 1, 30), new Date(1926, 12 - 1, 25), new Date(1989, 1 - 1, 8)];
_EraHelper._EraCount = 4;
_EraHelper._EraYears = [45, 15, 64, 99];
_EraHelper._EraMax = new Date(2087, 12 - 1, 31, 23, 59, 59);
_EraHelper._EraMin = new Date(1868, 9 - 1, 8);
_EraHelper._shortcuts = ['1,m', '2,t', '3,s', '4,h'];
_EraHelper._EraIndices = [0, 1, 2, 3, 0, 1, 2, 3];
_EraHelper._names = ['\u660e\u6cbb', '\u5927\u6b63', '\u662d\u548c', '\u5e73\u6210'];
_EraHelper._symbols = ['M', 'T', 'S', 'H'];
_EraHelper._abbreviations = ['\u660e', '\u5927', '\u662d', '\u5e73'];
_EraHelper._EraYearMax = 99;
return _EraHelper;
})();
var CultureInfo = (function () {
function CultureInfo() {
this.NumberFormat = {
currencyDecimalDigits: 2,
currencyDecimalSeparator: '.',
currencyGroupSeparator: ',',
currencyGroupSizes: [3],
currencyNegativePattern: 0,
currencyPositivePattern: 0,
currencySymbol: '\u00A4',
digitSubstitution: 1,
isReadOnly: true,
numberGroupSizes: [3],
nanSymbol: 'NaN',
nativeDigits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
numberNegativePattern: 1,
negativeInfinitySymbol: '-Infinity',
negativeSign: '-',
numberDecimalDigits: 2,
numberDecimalSeparator: '.',
numberGroupSeparator: ',',
positiveInfinitySymbol: 'Infinity',
positiveSign: '+',
percentDecimalDigits: 2,
percentDecimalSeparator: '.',
percentGroupSeparator: ',',
percentGroupSizes: [3],
percentNegativePattern: 0,
percentPositivePattern: 0,
percentSymbol: '%',
perMilleSymbol: '\u2030',
listSeparator: ',',
arrayListSeparator: ',',
arrayGroupSeparator: ';',
dbNumber: {}
};
this.DateTimeFormat = {
abbreviatedDayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
abbreviatedMonthGenitiveNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ''],
abbreviatedMonthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ''],
amDesignator: 'AM',
calendarIsReadOnly: true,
calendarWeekRule: 0,
Calendar: {
MinSupportedDateTime: '@-62135568000000@',
MaxSupportedDateTime: '@253402300799999@',
AlgorithmType: 1,
CalendarType: 1,
Eras: [1],
TwoDigitYearMax: 2029,
isReadOnly: true
},
dateSeparator: '/',
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
firstDayOfWeek: 0,
fullDateTimePattern: 'dddd, dd MMMM yyyy HH:mm:ss',
longDatePattern: 'dddd, dd MMMM yyyy',
longTimePattern: 'HH:mm:ss',
monthDayPattern: 'MMMM dd',
monthGenitiveNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ''],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ''],
nativeCalendarName: 'Gregorian Calendar',
pmDesignator: 'PM',
rfc1123Pattern: 'ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'',
shortDatePattern: 'MM/dd/yyyy',
shortestDayNames: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
shortTimePattern: 'HH:mm',
sortableDateTimePattern: 'yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss',
timeSeparator: ':',
universalSortableDateTimePattern: 'yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'',
yearMonthPattern: 'yyyy MMMM'
};
this.name = function () {
return '';
};
this.id = -1;
}
CultureInfo.prototype = {
constructor: CultureInfo,
_getDateTimePattern: function () {
if (!this._dateTimeFormatPattern) {
var dateTimeFormat = this.DateTimeFormat;
var shortDatePattern = dateTimeFormat.shortDatePattern.replace(/m/g, 'M');
var cultureDateTimeFormatPattern = [shortDatePattern,
shortDatePattern + ' h:mm',
shortDatePattern + ' h:mm:ss',
shortDatePattern + ' h:mm:ss.0'];
this._dateTimeFormatPattern = cultureDateTimeFormatPattern.concat(dateTimeFormatPattern);
}
return this._dateTimeFormatPattern;
},
_getMonthIndex: function (value) {
var self = this;
if (!self._upperMonths) {
self._upperMonths = __toUpperArray(self.DateTimeFormat.monthNames);
self._upperMonthsGenitive = __toUpperArray(self.DateTimeFormat.monthGenitiveNames);
}
return __getIndex(value, self._upperMonths, self._upperMonthsGenitive);
},
_getAbbrMonthIndex: function (value) {
var self = this;
if (!self._upperAbbrMonths) {
self._upperAbbrMonths = __toUpperArray(self.DateTimeFormat.abbreviatedMonthNames);
self._upperAbbrMonthsGenitive = __toUpperArray(self.DateTimeFormat.abbreviatedMonthGenitiveNames);
}
return __getIndex(value, self._upperAbbrMonths, self._upperAbbrMonthsGenitive);
},
_getDayIndex: function (value) {
var self = this;
if (!self._upperDays) {
self._upperDays = __toUpperArray(self.DateTimeFormat.dayNames);
}
return self._upperDays.indexOf(__toUpper(value));
},
_getAbbrDayIndex: function (value) {
var self = this;
if (!self._upperAbbrDays) {
self._upperAbbrDays = __toUpperArray(self.DateTimeFormat.abbreviatedDayNames);
}
return self._upperAbbrDays.indexOf(__toUpper(value));
}
};
function __toUpper(value) {
return value.split('\u00A0').join(' ').toUpperCase();
}
function __toUpperArray(arr) {
var result = [];
for (var i = 0, il = arr.length; i < il; i++) {
result[i] = __toUpper(arr[i]);
}
return result;
}
function __getIndex(value, a1, a2) {
var upper = __toUpper(value), i = a1.indexOf(upper);
if (i === -1) {
i = a2.indexOf(upper);
}
return i;
}
return CultureInfo;
})();
var _ENCultureInfo = (function (_super) {
inherit(_ENCultureInfo, _super);
function _ENCultureInfo() {
_super.apply(this, arguments);
overridePro.call(this, 'NumberFormat', ['currencySymbol', 'isReadOnly'], ['$', false]);
overridePro.call(this, 'DateTimeFormat',
['fullDateTimePattern', 'longDatePattern', 'longTimePattern', 'shortDatePattern', 'shortTimePattern', 'yearMonthPattern', 'calendarIsReadOnly'],
['dddd, MMMM dd, yyyy h:mm:ss tt', 'dddd, MMMM dd, yyyy', 'h:mm:ss tt', 'M/d/yyyy', 'h:mm tt', 'MMMM, yyyy', false]);
this.name = function () {
return 'en-US';
};
this.id = 0x0409;
}
return _ENCultureInfo;
})(CultureInfo);
var _JACultureInfo = (function (_super) {
inherit(_JACultureInfo, _super);
function _JACultureInfo() {
_super.apply(this, arguments);
var dbNumber = {
1: {
letters: ['\u5146', '\u5343', '\u767e', '\u5341', '\u4ebf', '\u5343', '\u767e', '\u5341', '\u4e07', '\u5343', '\u767e', '\u5341', ''],
numbers: ['\u3007', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d']
},
2: {
letters: ['\u5146', '\u9621', '\u767e', '\u62fe', '\u5104', '\u9621', '\u767e', '\u62fe', '\u842c', '\u9621', '\u767e', '\u62fe', ''],
numbers: ['\u3007', '\u58f1', '\u5f10', '\u53c2', '\u56db', '\u4f0d', '\u516d', '\u4e03', '\u516b', '\u4e5d']
},
3: {
letters: keyword_null,
numbers: ['\uff10', '\uff11', '\uff12', '\uff13', '\uff14', '\uff15', '\uff16', '\uff17', '\uff18', '\uff19']
}
};
overridePro.call(this, 'NumberFormat',
['currencyDecimalDigits', 'currencyNegativePattern', 'currencySymbol', 'isReadOnly', 'nanSymbol',
'negativeInfinitySymbol', 'percentNegativePattern', 'percentPositivePattern', 'positiveInfinitySymbol', 'dbNumber'],
[0, 1, '\xa5', false, 'NaN (\u975e\u6570\u5024)', '-\u221e', 1, 1, '+\u221e', dbNumber]);
var monthNum = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ''];
var monthNames = ['1\u6708', '2\u6708', '3\u6708', '4\u6708', '5\u6708', '6\u6708', '7\u6708', '8\u6708', '9\u6708', '10\u6708', '11\u6708', '12\u6708', ''];
overridePro.call(this, 'DateTimeFormat', ['abbreviatedDayNames', 'abbreviatedMonthGenitiveNames', 'abbreviatedMonthNames', 'amDesignator',
'calendarIsReadOnly', 'dayNames', 'fullDateTimePattern', 'longDatePattern', 'longTimePattern', 'monthDayPattern', 'monthGenitiveNames',
'monthNames', 'nativeCalendarName', 'pmDesignator', 'shortDatePattern', 'shortestDayNames', 'shortTimePattern', 'yearMonthPattern'],
[['\u65e5', '\u6708', '\u706b', '\u6c34', '\u6728', '\u91d1', '\u571f'], monthNum, monthNum, '\u5348\u524d', false, ['\u65e5\u66dc\u65e5', '\u6708\u66dc\u65e5', '\u706b\u66dc\u65e5', '\u6c34\u66dc\u65e5', '\u6728\u66dc\u65e5', '\u91d1\u66dc\u65e5', '\u571f\u66dc\u65e5'],
'yyyy\'\u5e74\'M\'\u6708\'d\'\u65e5\' H:mm:ss', 'yyyy\'\u5e74\'M\'\u6708\'d\'\u65e5\'', 'H:mm:ss', 'M\'\u6708\'d\'\u65e5\'', monthNames, monthNames,
'\u897f\u66a6 (\u65e5\u672c\u8a9e)', '\u5348\u5f8c', 'yyyy/MM/dd', ['\u65e5', '\u6708', '\u706b', '\u6c34', '\u6728', '\u91d1', '\u571f'], 'H:mm', 'yyyy\'\u5e74\'M\'\u6708\'']);
this.DateTimeFormat.eras = _EraHelper;
this.name = function () {
return 'ja-JP';
};
this.id = 0x0411;
}
return _JACultureInfo;
})(CultureInfo);
var _ZHCultureInfo = (function (_super) {
inherit(_ZHCultureInfo, _super);
function _ZHCultureInfo() {
_super.apply(this, arguments);
var dbNumber = {
1: {
letters: ['\u5146', '\u5343', '\u767e', '\u5341', '\u4ebf', '\u5343', '\u767e', '\u5341', '\u4e07', '\u5343', '\u767e', '\u5341', ''],
numbers: ['\u25cb', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d']
},
2: {
letters: ['\u5146', '\u4edf', '\u4f70', '\u62fe', '\u4ebf', '\u4edf', '\u4f70', '\u62fe', '\u4e07', '\u4edf', '\u4f70', '\u62fe', ''],
numbers: ['\u96f6', '\u58f9', '\u8d30', '\u53c1', '\u8086', '\u4f0d', '\u9646', '\u67d2', '\u634c', '\u7396']
},
3: {
letters: keyword_null,
numbers: ['\uff10', '\uff11', '\uff12', '\uff13', '\uff14', '\uff15', '\uff16', '\uff17', '\uff18', '\uff19']
}
};
overridePro.call(this, 'NumberFormat', ['currencyNegativePattern', 'currencySymbol', 'isReadOnly', 'nanSymbol', 'negativeInfinitySymbol',
'percentNegativePattern', 'percentPositivePattern', 'positiveInfinitySymbol', 'dbNumber'],
[2, '\xa5', false, '\u975e\u6570\u5b57', '\u8d1f\u65e0\u7a77\u5927', 1, 1, '\u6b63\u65e0\u7a77\u5927', dbNumber]);
var abbMNames = ['1\u6708', '2\u6708', '3\u6708', '4\u6708', '5\u6708', '6\u6708', '7\u6708', '8\u6708', '9\u6708', '10\u6708', '11\u6708', '12\u6708', ''];
var mNames = ['\u4e00\u6708', '\u4e8c\u6708', '\u4e09\u6708', '\u56db\u6708', '\u4e94\u6708', '\u516d\u6708', '\u4e03\u6708', '\u516b\u6708', '\u4e5d\u6708', '\u5341\u6708', '\u5341\u4e00\u6708', '\u5341\u4e8c\u6708', ''];
overridePro.call(this, 'DateTimeFormat', ['abbreviatedDayNames', 'abbreviatedMonthGenitiveNames', 'abbreviatedMonthNames',
'amDesignator', 'calendarIsReadOnly', 'dayNames', 'firstDayOfWeek', 'fullDateTimePattern', 'longDatePattern', 'longTimePattern',
'monthDayPattern', 'monthGenitiveNames', 'monthNames', 'nativeCalendarName', 'pmDesignator',
'shortDatePattern', 'shortestDayNames', 'shortTimePattern', 'yearMonthPattern'],
[['\u5468\u65e5', '\u5468\u4e00', '\u5468\u4e8c', '\u5468\u4e09', '\u5468\u56db', '\u5468\u4e94', '\u5468\u516d'], abbMNames, abbMNames, '\u4e0a\u5348', false, ['\u661f\u671f\u65e5', '\u661f\u671f\u4e00', '\u661f\u671f\u4e8c', '\u661f\u671f\u4e09', '\u661f\u671f\u56db', '\u661f\u671f\u4e94', '\u661f\u671f\u516d'], 1,
'yyyy\'\u5e74\'M\'\u6708\'d\'\u65e5\' H:mm:ss', 'yyyy\'\u5e74\'M\'\u6708\'d\'\u65e5\'', 'H:mm:ss', 'M\'\u6708\'d\'\u65e5\'', mNames, mNames, '\u516c\u5386', '\u4e0b\u5348', 'yyyy/M/d',
['\u65e5', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d'], 'H:mm', 'yyyy\'\u5e74\'M\'\u6708\'']);
this.name = function () {
return 'zh-cn';
};
this.id = 0x0804;
}
return _ZHCultureInfo;
})(CultureInfo);
var _KOCultureInfo = (function (_super) {
inherit(_KOCultureInfo, _super);
function _KOCultureInfo() {
_super.apply(this, arguments);
var dbNumber = {
1: {
letters: ['\u5146', '\u5343', '\u767e', '\u5341', '\u5104', '\u5343', '\u767e', '\u5341', '\u4e07', '\u5343', '\u767e', '\u5341', ''],
numbers: ['\uff10', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\uf9d1', '\u4e03', '\u516b', '\u4e5d']
},
2: {
letters: ['\u5146', '\u9621', '\u767e', '\uf973', '\u5104', '\u9621', '\u767e', '\uf973', '\u842c', '\u9621', '\u767e', '\uf973', ''],
numbers: ['\uf9b2', '\u58f9', '\u8cb3', '\uf96b', '\u56db', '\u4f0d', '\uf9d1', '\u4e03', '\u516b', '\u4e5d']
},
3: {
letters: ['\u5146', '\u5343', '\u767e', '\u5341', '\u5104', '\u5343', '\u767e', '\u5341', '\u4e07', '\u5343', '\u767e', '\u5341', ''],
numbers: ['\uff10', '\uff11', '\uff12', '\uff13', '\uff14', '\uff15', '\uff16', '\uff17', '\uff18', '\uff19']
}
};
overridePro.call(this, 'NumberFormat', ['currencyDecimalDigits', 'currencyNegativePattern', 'currencySymbol', 'isReadOnly', 'dbNumber'],
[0, 1, '\u20a9', false, dbNumber]);
var abbMNames = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", ""];
var mNames = ["1\uc6d4", "2\uc6d4", "3\uc6d4", "4\uc6d4", "5\uc6d4", "6\uc6d4", "7\uc6d4", "8\uc6d4", "9\uc6d4", "10\uc6d4", "11\uc6d4", "12\uc6d4", ""];
overridePro.call(this, 'DateTimeFormat', ['abbreviatedDayNames', 'abbreviatedMonthGenitiveNames', 'abbreviatedMonthNames',
'amDesignator', 'calendarIsReadOnly', 'dayNames', 'firstDayOfWeek', 'fullDateTimePattern', 'longDatePattern', 'longTimePattern',
'monthDayPattern', 'monthGenitiveNames', 'monthNames', 'nativeCalendarName', 'pmDesignator',
'shortDatePattern', 'shortestDayNames', 'shortTimePattern', 'yearMonthPattern'],
[["\uc77c", "\uc6d4", "\ud654", "\uc218", "\ubaa9", "\uae08", "\ud1a0"], abbMNames, abbMNames, '\uc624\uc804', false, ["\uc77c\uc694\uc77c", "\uc6d4\uc694\uc77c", "\ud654\uc694\uc77c", "\uc218\uc694\uc77c", "\ubaa9\uc694\uc77c", "\uae08\uc694\uc77c", "\ud1a0\uc694\uc77c"], 1,
'yyyy\'\ub144\' M\'\uc6d4\' d\'\uc77c\' dddd h:mm:ss', 'yyyy\'\ub144\' M\'\uc6d4\' d\'\uc77c\' dddd', 'h:mm:ss', 'M\'\uc6d4\' d\'\uc77c\'', mNames, mNames, '\uc11c\uae30', '\uc624\ud6c4', 'yyyy-MM-dd',
["\uc77c", "\uc6d4", "\ud654", "\uc218", "\ubaa9", "\uae08", "\ud1a0"], 'tt h:mm', 'yyyy\'\ub144\' M\'\uc6d4\'']);
this.name = function () {
return 'ko-kr';
};
this.id = 0x0412;
}
return _KOCultureInfo;
})(CultureInfo);
var cultureInfoDict = {
'invariant': new CultureInfo(),
'en-us': new _ENCultureInfo(),
'ja-jp': new _JACultureInfo(),
'zh-cn': new _ZHCultureInfo(),
'ko-kr': new _KOCultureInfo()
};
var datePattern1 = [
'MM/dd/yyyy',
'MM/d/yyyy',
'M/dd/yyyy',
'M/d/yyyy',
'yy/MM/dd',
'yy/MM/d',
'yy/M/dd',
'yy/M/d',
'yyyy/MM/dd',
'yyyy/MM/d',
'yyyy/M/dd',
'yyyy/M/d'
], timePattern1 = [
'hh:mm:ss',
'hh:mm:s',
'hh:m:ss',
'hh:m:s',
'h:mm:ss',
'h:mm:s',
'h:m:ss',
'h:m:s',
'hh:mm:ss tt',
'hh:mm:s tt',
'hh:m:ss tt',
'hh:m:s tt',
'h:mm:ss tt',
'h:mm:s tt',
'h:m:ss tt',
'h:m:s tt',
'hh:mm',
'hh:m',
'h:mm',
'h:m',
'hh:mm tt',
'hh:m tt',
'h:mm tt',
'h:m tt'
], datePattern2 = [
'MM-dd-yyyy',
'MM-d-yyyy',
'M-dd-yyyy',
'M-d-yyyy',
'yy-MM-dd',
'yy-MM-d',
'yy-M-dd',
'yy-M-d',
'yyyy-MM-dd',
'yyyy-MM-d',
'yyyy-M-dd',
'yyyy-M-d',
'dd-MMMM-yy',
'dd-MMM-yy'
];
var dateTimeFormatPattern = datePattern1.concat(timePattern1);
each(datePattern1, function (dateIndex, dateValue) {
each(timePattern1, function (timeIndex, timeValue) {
if (timeIndex < timePattern1.length - 4) {
dateTimeFormatPattern.push(dateValue + ' ' + timeValue);
}
});
});
dateTimeFormatPattern = dateTimeFormatPattern.concat(datePattern2);
each(datePattern2, function (dateIndex, dateValue) {
each(timePattern1, function (timeIndex, timeValue) {
if (timeIndex < timePattern1.length - 4) {
dateTimeFormatPattern.push(dateValue + ' ' + timeValue);
}
});
});
function overridePro(proName, fields, values) {
var self = this;
var field;
for (var i = 0, len = fields.length; i < len; i++) {
field = fields[i];
self[proName][field] = values[i];
}
}
var CultureManager = (function () {
if (typeof CultureManager.instance === 'object') {
return CultureManager.instance;
}
function CultureManager() {
var cRName = 'en-us';
this.culture = function (cultureName) {
if (arguments.length === 0) {
return cRName;
}
if (!cultureName) {
return;
}
if (cRName !== cultureName) {
cRName = cultureName.toLowerCase();
triggerEvent(cRName);
}
};
this.addCultureInfo = function (cultureName, culture) {
var numberDecimalSeparator = culture.NumberFormat.numberDecimalSeparator,
arrayListSeparator = culture.NumberFormat.arrayListSeparator,
arrayGroupSeparator = culture.NumberFormat.arrayGroupSeparator;
if (numberDecimalSeparator === culture.NumberFormat.listSeparator || arrayGroupSeparator === arrayListSeparator) {
var Common = __webpack_require__(3);
throw Common._getResource(Common.SR)().Exp_Separator;
}
cultureInfoDict[cultureName.toLowerCase()] = culture;
};
this.getCultureInfo = function (cultureName) {
if (arguments.length === 0) {
return cultureInfoDict[cRName];
}
var isString = typeof (cultureName) === 'string';
cultureName = isString ? cultureName.toLowerCase() : cultureName;
var dic = cultureInfoDict;
var culture = keyword_null;
for (var p in dic) {
if (p === cultureName || (dic[p].id !== keyword_undefined && dic[p].id === cultureName)) {
culture = dic[p];
break;
}
}
return culture;
};
this._getCultureInfo = function (cultureName) {
var culture = this.getCultureInfo(cultureName);
if (!culture) {
culture = cultureInfoDict[cRName];
if (!culture) {
culture = new CultureInfo();
}
}
return culture;
};
CultureManager.instance = this;
}
function triggerEvent(culture) {
var evt;
if (typeof CustomEvent !== 'function') {
evt = document.createEvent('CustomEvent');
evt.initCustomEvent('cultureChanged', false, false, undefined);
} else {
evt = new CustomEvent('cultureChanged', {});
}
evt.cultureInfo = culture;
document.dispatchEvent(evt);
}
return CultureManager;
})();
module.exports = {
CultureInfo: CultureInfo,
CultureManager: new CultureManager()
};
/***/ }),
mvn deploy:deploy-file -DgroupId=com.huawei.unistar.sct.sctserver -DartifactId=com.huawei.unistar.webcfg.stub -Dversion=1.0.18 -DgeneratePom=true -Dpackaging=jar -DrepositoryId=nexus -Durl=http://100.100.187.240:8081/repository/maven-releases/ -Dfile=d:\com.huawei.unistar.webcfg.stub.jar
/ 5 / /***/ (function(module, exports, __webpack_require__) {
var Types = {};
Types._each = function (obj, callback) {
var value, isArray = Types._isArraylike(obj);
if (isArray) {
for (var i = 0, length = obj.length; i < length; i++) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
} else {
for (var p in obj) {
if (obj.hasOwnProperty(p)) {
value = callback.call(obj[p], p, obj[p]);
if (value === false) {
break;
}
}
}
}
return obj;
};
Types._isEmptyObject = function (obj) {
return obj ? (typeof obj === 'object') && (Object.keys(obj).length === 0) : true;
};
Types._isFunction = function (obj) {
return Types._getType(obj) === 'function';
};
Types._isArray = function (obj) {
if (Array.isArray) {
return Array.isArray(obj);
}
return Types._getType(obj) === 'array';
};
Types._isNumeric = function (obj) {
return !isNaN(parseFloat(obj)) && isFinite(obj);
};
Types._getType = function (obj) {
if (obj === null) {
return "null";
}
var class2type = Types._class2type;
if (!class2type) {
class2type = Types._class2type = {};
var arr = ['Boolean', 'Number', 'String', 'Function', 'Array', 'Date', 'RegExp', 'Object', 'Error'];
for (var i = 0, length = arr.length; i < length; i++) {
class2type['[object ' + arr[i] + ']'] = arr[i].toLowerCase();
}
}
var core_toString = class2type.toString;
var typeofObj = typeof obj;
return typeofObj === 'object' || typeofObj === 'function' ? class2type[core_toString.call(obj)] || 'object' : typeofObj;
};
Types._inArray = function (elem, arr, i) {
var len;
if (arr) {
var core_indexOf = [].indexOf;
if (core_indexOf) {
return core_indexOf.call(arr, elem, i);
}
len = arr.length;
if (Types._isNullOrUndefined(i)) {
i = 0;
}
i = i < 0 ? Math.max(0, len + i) : i;
for (; i < len; i++) {
if (i in arr && arr[i] === elem) {
return i;
}
}
}
return -1;
};
Types._merge = function (first, second) {
var l = second.length, i = first.length, j = 0;
if (typeof l === 'number') {
for (; j < l; j++) {
first[i++] = second[j];
}
} else {
while (second[j] !== undefined) {
first[i++] = second[j++];
}
}
first.length = i;
return first;
};
Types._map = function (elems, callback, arg) {
var value, i = 0, length = elems.length, isArray = Types._isArraylike(elems), ret = [];
if (isArray) {
for (; i < length; i++) {
value = callback(elems[i], i, arg);
if (value !== null) {
ret[ret.length] = value;
}
}
} else {
for (i in elems) {
if (elems.hasOwnProperty(i)) {
value = callback(elems[i], i, arg);
if (value !== null) {
ret[ret.length] = value;
}
}
}
}
var core_concat = [].concat;
return core_concat.apply([], ret);
};
Types._extend = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;
if (typeof target === 'boolean') {
deep = target;
target = arguments[1] || {};
i = 2;
}
if (typeof target !== 'object' && !Types._isFunction(target)) {
target = {};
}
if (length === i) {
target = this;
--i;
}
for (; i < length; i++) {
if (!Types._isNullOrUndefined(options = arguments[i])) {
for (name in options) {
src = target[name];
copy = options[name];
if (target === copy) {
continue;
}
if (deep && copy && (Types._isPlainObject(copy) || (copyIsArray = Types._isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && Types._isArray(src) ? src : [];
} else {
clone = src && Types._isPlainObject(src) ? src : {};
}
target[name] = Types._extend(deep, clone, copy);
} else if (copy !== undefined) {
target[name] = copy;
}
}
}
}
return target;
};
Types._inherit = function (d, b) {
for (var p in b) {
if (b.hasOwnProperty(p)) {
d[p] = b[p];
}
}
function __() {
this.constructor = d;
}
__.prototype = b.prototype;
d.prototype = new __();
};
Types._isWindow = function (obj) {
return obj !== null && obj === obj.window;
};
Types._isPlainObject = function (obj) {
if (!obj || Types._getType(obj) !== 'object' || obj.nodeType || Types._isWindow(obj)) {
return false;
}
var core_hasOwn = {}.hasOwnProperty;
try {
if (obj.constructor && !core_hasOwn.call(obj, 'constructor') && !core_hasOwn.call(obj.constructor.prototype, 'isPrototypeOf')) {
return false;
}
} catch (e) {
return false;
}
var key;
for (key in obj) {
}
return key === undefined || core_hasOwn.call(obj, key);
};
Types._isArraylike = function (obj) {
if (Types._isNullOrUndefined(obj)) {
return false;
}
var length = obj.length, type = Types._getType(obj);
if (Types._isWindow(obj)) {
return false;
}
if (obj.nodeType === 1 && length) {
return true;
}
return type === 'array' || type !== 'function' && (length === 0 || typeof length === 'number' && length > 0 && (length - 1) in obj);
};
Types._makeArray = function (arr, results) {
var ret = results || [];
if (arr !== null) {
if (Types._isArraylike(Object(arr))) {
Types._merge(ret, typeof arr === 'string' ? [arr] : arr);
} else {
[].push.call(ret, arr);
}
}
return ret;
};
Types._isType = function (obj, type) {
if (Types._isNullOrUndefined(obj)) {
return type === 'null';
}
if (!type) {
return false;
}
if (type instanceof Function && obj instanceof type) {
return true;
}
if (typeof obj === type) {
return true;
}
if (type === 'function' && /^\s*\bfunction\b/.test('' + obj)) {
return true;
}
if (Object.prototype.toString.call(obj).slice(8, -1).toLowerCase() === type.toLowerCase()) {
return true;
}
if (type === 'DateTime' || type === 'TimeSpan') {
return obj instanceof Date;
}
if (typeof type === 'string') {
if ('undefined number boolean string'.indexOf(type) > -1) {
return false;
}
}
return false;
};
Types._isNullOrUndefined = function (value) {
return value === void 0 || value === null;
};
Types._isNumber = function (value, cultureName) {
var numHelper = __webpack_require__(6);
if (!numHelper._isValidCultureNumberString(value, cultureName)) {
return false;
}
value = numHelper._replaceCultureSymbolToNormal(value, cultureName);
return Types._isType(value, 'number') || Types._isType(value, 'DateTime') || Types._isType(value, 'TimeSpan') ||
(value && !Types._isType(value, 'boolean') && !isNaN(value) && !isNaN(parseFloat(value)) && !(value.length >= 2 && value[0] === '0' && value[1] === 'x'));
};
Types._toDouble = function (value) {
var DateTimeHelper = __webpack_require__(9);
if (Types._isNullOrUndefined(value) || value === '') {
return 0.0;
} else if (Types._isType(value, 'number')) {
return value;
} else if (Types._isType(value, 'string') && !isNaN(value)) {
return __webpack_require__(6)._parseLocale(value);
} else if (Types._isType(value, 'boolean')) {
return value ? 1.0 : 0.0;
} else if (Types._isType(value, 'DateTime')) {
return DateTimeHelper._toOADate(value);
} else if (Types._isType(value, 'TimeSpan')) {
return Math.floor(DateTimeHelper._toOADate(value));
}
return parseFloat(value);
};
Types._cloneObject = function (obj) {
if (!obj) {
return obj;
}
if (typeof (obj) === 'number' || typeof (obj) === 'string' || typeof (obj) === 'boolean' || Types._isNullOrUndefined(obj)) {
return obj;
} else if (obj.clone) {
return obj.clone();
} else if (obj instanceof Date) {
return new Date(obj);
}
var objClone, key, value;
if (obj instanceof Object) {
objClone = new obj.constructor();
} else {
objClone = new obj.constructor(obj.valueOf());
}
for (key in obj) {
if (obj.hasOwnProperty(key)) {
value = obj[key];
if (obj.hasOwnProperty(key) && objClone[key] !== value) {
if (typeof (value) === 'object') {
objClone[key] = Types._cloneObject(value);
} else {
objClone[key] = value;
}
}
}
}
objClone.toString = obj.toString;
objClone.valueOf = obj.valueOf;
return objClone;
}
module.exports = Types;
// }), / 6 / // (function(module, exports, __webpack_require__) {
var Common = __webpack_require__(3);
var isNullOrUndefined = __webpack_require__(5)._isNullOrUndefined;
var RegexHelper = __webpack_require__(7);
var StringHelper = __webpack_require__(8);
var padZeroLeft = StringHelper._padZeroLeft, padZeroRight = StringHelper._padZeroRight;
var cM = __webpack_require__(4).CultureManager;
var keyword_null = null, keyword_undefined = undefined, parseIntFn = parseInt, parseFloatFn = parseFloat,
FALSE = false, TRUE = true, Math_floor = Math.floor, Math_abs = Math.abs, Math_pow = Math.pow;
function substr(str, start, length) {
return str.substr(start, length)
}
var sR = function () {
return Common._getResource(Common.SR)();
};
var NumberHelper = (function () {
var _generalNumberInt = '##################0';
var _generalNumberDec = '################';
var _signs = {'1': '+', '0': '', '-1': '-'};
var _maxInt32 = 4294967295;
var _percentPositivePattern = ['n %', 'n%', '%n', '% n'];
var _percentNegativePattern = ['-n %', '-n%', '-%n', '%-n', '%n-', 'n-%', 'n%-', '-% n', 'n %-', '% n-', '% -n', 'n- %'];
var _numberNegativePattern = ['(n)', '-n', '- n', 'n-', 'n -'];
var _currencyPositivePattern = ['$n', 'n$', '$ n', 'n $'];
var _currencyNegativePattern = ['($n)', '-$n', '$-n', '$n-', '(n$)', '-n$', 'n-$', 'n$-', '-n $', '-$ n', 'n $-', '$ n-', '$ -n', 'n- $', '($ n)', '(n $)'];
function _toFormattedString(num, format, cultureInfo) {
if (!format || (format.length === 0) || (format === 'i')) {
if (cultureInfo && (cultureInfo.name.length > 0)) {
return num.toLocaleString();
}
return num.toString();
}
if (_getStandardTokenRegExp().test(format)) {
return _toStandardFormattedString(num, format, cultureInfo.NumberFormat);
}
return _toCustomFormattedString(num, format, cultureInfo.NumberFormat);
}
function _toScientificNotation(num, numString, pattern, format, precision, nf) {
pattern = 'n';
numString = _toScientific(Math_abs(num), format.charAt(0), precision === -1 ? 6 : precision, nf.numberGroupSizes, nf.numberGroupSeparator, nf.numberDecimalSeparator, nf.negativeSign);
if (num < 0) {
numString = '-' + numString;
}
return [numString, pattern];
}
function _toFixedPoint(num, numString, pattern, format, precision, nf) {
if (num < 0) {
pattern = _numberNegativePattern[nf.numberNegativePattern];
} else {
pattern = 'n';
}
if (precision === -1) {
precision = 2;
}
var numberValue = parseFloatFn(numString);
var integer = Math_floor(numberValue);
var dec = numberValue - integer;
numString = _expandNumber(dec, precision, nf.numberGroupSizes, nf.numberGroupSeparator, nf.numberDecimalSeparator, nf.negativeSign);
numString = '' + (integer + (+numString >= 1 ? 1 : 0)) + numString.substring(1);
return [numString, pattern];
}
function _toStandardFormattedString(num, format, nf) {
var numString = Math_abs(num).toString();
if (!format) {
format = 'D';
}
var precision = -1;
if (format.length > 1) {
precision = parseIntFn(format.slice(1), 10);
}
var pattern, resultArray;
switch (format.charAt(0)) {
case 'd':
case 'D':
pattern = 'n';
if (precision !== -1) {
numString = padZeroLeft('' + numString, precision);
}
if (num < 0) {
numString = '-' + numString;
}
break;
case 'c':
case 'C':
if (num < 0) {
pattern = _currencyNegativePattern[nf.currencyNegativePattern];
} else {
pattern = _currencyPositivePattern[nf.currencyPositivePattern];
}
if (precision === -1) {
precision = nf.currencyDecimalDigits;
}
numString = _expandNumber(Math_abs(num), precision, nf.currencyGroupSizes, nf.currencyGroupSeparator, nf.currencyDecimalSeparator, nf.negativeSign);
break;
case 'n':
case 'N':
if (num < 0) {
pattern = _numberNegativePattern[nf.numberNegativePattern];
} else {
pattern = 'n';
}
if (precision === -1) {
precision = nf.numberDecimalDigits;
}
numString = _expandNumber(Math_abs(num), precision, nf.numberGroupSizes, nf.numberGroupSeparator, nf.numberDecimalSeparator, nf.negativeSign);
break;
case 'p':
case 'P':
if (num < 0) {
pattern = _percentNegativePattern[nf.percentNegativePattern];
} else {
pattern = _percentPositivePattern[nf.percentPositivePattern];
}
if (precision === -1) {
precision = nf.percentDecimalDigits;
}
numString = _expandNumber(Math_abs(num) * 100, precision, nf.percentGroupSizes, nf.percentGroupSeparator, nf.percentDecimalSeparator, nf.negativeSign);
break;
case 'F':
case 'f':
resultArray = _toFixedPoint(num, numString, pattern, format, precision, nf);
numString = resultArray[0];
pattern = resultArray[1];
break;
case 'e':
case 'E':
resultArray = _toScientificNotation(num, numString, pattern, format, precision, nf);
numString = resultArray[0];
pattern = resultArray[1];
break;
case 'x':
case 'X':
pattern = 'n';
numString = _toHexString(num, format.charAt(0) === 'x', precision === -1 ? 0 : precision);
break;
case 'g':
case 'G':
var numToStr = num.toString();
resultArray = [];
if ((numToStr.indexOf('e')) === -1 && (numToStr.indexOf('E') === -1)) {
resultArray = _toFixedPoint(num, numString, pattern, format, precision, nf);
} else {
resultArray = _toScientificNotation(num, numString, pattern, format.replace('g', 'e').replace('G', 'E'), precision, nf);
}
numString = resultArray[0];
pattern = resultArray[1];
break;
default:
throw new Error(sR().Exp_BadFormatSpecifier);
}
var regex = /n|\$|-|%/g;
var ret = '';
for (; ;) {
var index = regex.lastIndex;
var ar = regex.exec(pattern);
ret += pattern.slice(index, ar ? ar.index : pattern.length);
if (!ar) {
break;
}
switch (ar[0]) {
case 'n':
ret += numString;
break;
case '$':
ret += nf.currencySymbol;
break;
case '-':
if (/[1-9]/.test(numString)) {
ret += nf.negativeSign;
}
break;
case '%':
ret += nf.percentSymbol;
break;
default:
throw new Error(sR().Exp_InvalidNumberFormat);
}
}
return ret;
}
function _toCustomFormattedString(num, format, nf) {
var parsedFormat = _parseCustomNumberFormatter(format);
var formatter = keyword_null;
if (num === 0) {
formatter = parsedFormat._zero;
} else if (num < 0) {
formatter = parsedFormat._negative;
}
if (!formatter) {
formatter = parsedFormat._normal;
}
var result = _formatNumber(num, formatter, nf) + '';
if ((result.indexOf(nf.negativeSign) === 1) && (result.indexOf(nf.currencySymbol) === 0)) {
result = result[1] + result[0] + result.substring(2);
}
return result;
}
function _getStandardTokenRegExp() {
return /^(C|c|D|d|E|e|F|f|G|g|N|n|P|p|R|r|X|x)(\d*)$/g;
}
function _getDigitLength(value, separator) {
var ip = Math_floor(Math_abs(value));
var digit = {_integer: 1, _decimal: 0};
while (ip >= 10) {
ip = ip / 10;
digit._integer++;
}
var valueStr = value.toString();
var exponentIndex = valueStr.search(/e/ig);
var pointIndex = valueStr.indexOf(separator);
var length;
if (exponentIndex !== -1) {
var numPart = substr(valueStr, 0, exponentIndex);
var expPart = substr(valueStr, exponentIndex + 1);
var decimalPartLength = 0;
if (pointIndex !== -1) {
decimalPartLength = substr(numPart, pointIndex + 1).length;
}
var expValue = parseFloatFn(expPart);
length = decimalPartLength - expValue;
if (length < 0) {
length = 0;
}
digit._decimal = length;
} else {
length = 0;
if (pointIndex !== -1) {
length = substr(valueStr, pointIndex + 1).length;
}
digit._decimal = length;
}
return digit;
}
function _parseExponentFormat(format) {
var exponent = {
_symbol: format.charAt(0),
_sign: 0,
_exp: 0
};
var ss = '';
for (var si = 1; si < format.length; si++) {
ss = format.charAt(si);
if (ss === '+') {
exponent._sign = 1;
} else if (ss === '-') {
exponent._sign = -1;
} else if (ss === '0') {
exponent._exp = format.length - si;
break;
} else {
throw new Error(sR().Exp_InvalidExponentFormat);
}
}
return exponent;
}
function _parseCustomNumberFormatter(format) {
var partNormal = keyword_null, partNegative = keyword_null, partZero = keyword_null;
var partCurr = {
_intPart: keyword_null,
_decPart: keyword_null,
_group: FALSE,
_scale: 0,
_percent: 0,
_permile: 0,
_exponent: keyword_null
};
var strBuf = '', insqStr = FALSE, indqStr = FALSE, inESC = FALSE, inSci = FALSE, decPointFound = FALSE, groupSepFound = FALSE, sciFound = FALSE, intPlaceHoldFound = FALSE;
var curChar = keyword_null, prevChar = keyword_null, curPart = [];
for (var i = 0; i < format.length; i++) {
curChar = format.charAt(i);
if (insqStr) {
if (curChar !== '\'') {
strBuf += curChar;
} else {
curPart.push(strBuf);
strBuf = '';
insqStr = FALSE;
}
prevChar = curChar;
continue;
} else if (indqStr) {
if (curChar !== '"') {
strBuf += curChar;
} else {
curPart.push(strBuf);
strBuf = '';
indqStr = FALSE;
}
prevChar = curChar;
continue;
} else if (inESC) {
curPart.push(strBuf + curChar);
strBuf = '';
prevChar = curChar;
continue;
} else if (inSci) {
if (prevChar === 'E' || prevChar === 'e') {
if (curChar === '+' || curChar === '-' || curChar === '0') {
strBuf += curChar;
continue;
} else {
inSci = FALSE;
}
} else if (prevChar === '+' || prevChar === '-') {
if (curChar === '0') {
strBuf += curChar;
continue;
} else {
inSci = FALSE;
curPart.push(strBuf);
strBuf = '';
}
} else if (prevChar === '0') {
if (curChar === '0') {
strBuf += curChar;
continue;
} else {
inSci = FALSE;
if (!sciFound) {
sciFound = TRUE;
partCurr._exponent = _parseExponentFormat(strBuf);
}
curPart.push(strBuf);
strBuf = '';
}
}
} else if ((curChar === '0' || curChar === '#')) {
intPlaceHoldFound = TRUE;
if (prevChar === '0' || prevChar === '#') {
strBuf += curChar;
prevChar = curChar;
continue;
} else if (strBuf !== '') {
curPart.push(strBuf);
strBuf = '';
}
} else if ((prevChar === '0' || prevChar === '#') && curChar !== '0' && curChar !== '#') {
curPart.push(strBuf);
strBuf = '';
}
if (curChar === ';') {
if (strBuf !== '') {
if (inSci && !sciFound) {
partCurr._exponent = _parseExponentFormat(strBuf);
}
curPart.push(strBuf);
strBuf = '';
}
if (!decPointFound) {
partCurr._intPart = curPart;
} else {
partCurr._decPart = curChar;
}
curPart = [];
if (isNullOrUndefined(partNormal)) {
partNormal = partCurr;
} else if (isNullOrUndefined(partNegative)) {
partNegative = partCurr;
} else if (isNullOrUndefined(partZero)) {
partZero = partCurr;
} else {
throw new Error(sR().Exp_InvalidSemicolons);
}
decPointFound = FALSE;
intPlaceHoldFound = FALSE;
if (groupSepFound) {
partCurr._group = TRUE;
groupSepFound = FALSE;
}
partCurr = {};
} else if (!decPointFound && curChar === '.') {
if (prevChar !== '#' && prevChar !== '0') {
curPart.push(strBuf);
strBuf = '#';
}
if (strBuf !== '') {
curPart.push(strBuf);
strBuf = '';
}
partCurr._intPart = curPart;
curPart = [];
decPointFound = TRUE;
intPlaceHoldFound = FALSE;
if (groupSepFound) {
partCurr._group = TRUE;
groupSepFound = FALSE;
}
} else if (curChar === '\'') {
insqStr = TRUE;
} else if (curChar === '"') {
indqStr = TRUE;
} else if (curChar === '%') {
partCurr._percent++;
if (strBuf !== '') {
curPart.push(strBuf);
strBuf = '';
}
curPart.push(curChar);
} else if (curChar === cM._getCultureInfo().NumberFormat.perMilleSymbol) {
partCurr._permile++;
curPart.push(curChar);
} else if (curChar === '0' || curChar === '#') {
strBuf += curChar;
} else if (curChar === ',') {
if (!decPointFound) {
if (strBuf !== '') {
curPart.push(strBuf);
strBuf = '';
}
if (!intPlaceHoldFound) {
continue;
}
var isScale = TRUE, strQuote = '';
for (var j = i + 1; j < format.length; j++) {
var nextChar = format.charAt(j);
if (strQuote !== '') {
if (nextChar === '\'' || nextChar === '"') {
strQuote = '';
}
continue;
}
if (nextChar === '\'' || nextChar === '"') {
strQuote = nextChar;
} else if (nextChar === '0' || nextChar === '#') {
isScale = FALSE;
break;
} else if (nextChar === '.' || nextChar === ';') {
break;
}
}
if (isScale) {
partCurr._scale++;
} else {
groupSepFound = TRUE;
}
} else if (strBuf !== '') {
curPart.push(strBuf);
strBuf = '';
}
} else if (curChar === 'E' || curChar === 'e') {
inSci = TRUE;
if (strBuf !== '') {
curPart.push(strBuf);
}
strBuf = curChar;
} else {
strBuf += curChar;
}
prevChar = curChar;
}
if (strBuf !== '') {
if (inSci && !sciFound) {
partCurr._exponent = _parseExponentFormat(strBuf);
}
curPart.push(strBuf);
}
if (groupSepFound) {
partCurr._group = TRUE;
}
if (!decPointFound) {
partCurr._intPart = curPart;
} else {
partCurr._decPart = curPart;
}
if (isNullOrUndefined(partNormal)) {
partNormal = partCurr;
} else if (isNullOrUndefined(partNegative)) {
partNegative = partCurr;
} else if (isNullOrUndefined(partZero)) {
partZero = partCurr;
}
return {
_normal: partNormal,
_negative: partNegative,
_zero: partZero
};
}
function _insertGroupSeparator(numberString, groupSizes, sep) {
var curSize = groupSizes[0];
var curGroupIndex = 1;
var stringIndex = numberString.length - 1;
var result = '';
var numberCount = 0;
var needSep = FALSE;
while (stringIndex >= 0) {
if (curSize < 1 || curSize > 9) {
throw new Error(sR().Exp_InvalidNumberGroupSize);
}
if (/\d/ig.test(numberString[stringIndex])) {
if (needSep) {
result = sep + result;
needSep = FALSE;
}
numberCount++;
} else {
numberCount = 0;
}
result = numberString[stringIndex] + result;
if (numberCount === curSize) {
needSep = TRUE;
numberCount = 0;
if (curGroupIndex < groupSizes.length) {
curSize = groupSizes[curGroupIndex];
curGroupIndex++;
}
}
stringIndex--;
}
return result;
}
function _expandNumber(num, precision, groupSizes, sep, decimalChar, negativeSign, noGroupSep) {
var rounded = round10(num, -precision);
if (!isFinite(rounded)) {
rounded = num;
}
num = rounded;
var numberString = num.toString();
var right;
var exponent;
var split = numberString.split(/e/i);
numberString = split[0];
exponent = (split.length > 1 ? parseIntFn(split[1], 10) : 0);
split = numberString.split('.');
numberString = split[0];
right = split.length > 1 ? split[1] : '';
if (exponent > 0) {
right = padZeroRight(right, exponent);
numberString += right.slice(0, exponent);
right = substr(right, exponent);
} else if (exponent < 0) {
exponent = -exponent;
if (num < 0) {
numberString = negativeSign + padZeroLeft(numberString.replace(negativeSign, ''), exponent + 1);
} else {
numberString = padZeroLeft(numberString, exponent + 1);
}
right = numberString.slice(-exponent, numberString.length) + right;
numberString = numberString.slice(0, -exponent);
}
if (precision > 0) {
if (right.length > precision) {
right = right.slice(0, precision);
} else {
right = padZeroRight(right, precision);
}
right = decimalChar + right;
} else {
right = '';
}
if (noGroupSep === TRUE) {
return numberString + right;
}
return _insertGroupSeparator(numberString, groupSizes, sep, negativeSign) + right;
}
function _formatNumber(value, formatter, nf) {
var resultString = '';
value = value * (Math_pow(100, formatter._percent));
value = value * (Math_pow(1000, formatter._permile));
value = value / (Math_pow(10, formatter._scale * 3));
var intPart = formatter._intPart, decPart = formatter._decPart;
if (!intPart && !decPart) {
return '';
}
var partIntFormatter = keyword_null, partDecFormatter = keyword_null;
var i, ip, d, dp, exp;
if (intPart) {
partIntFormatter = '';
for (i = 0; i < intPart.length; i++) {
ip = intPart[i];
if (/^(0|#)+/g.test(ip)) {
partIntFormatter += ip;
}
}
}
if (decPart) {
partDecFormatter = '';
for (d = 0; d < decPart.length; d++) {
dp = decPart[d];
if (/^(0|#)+/g.test(dp)) {
partDecFormatter += dp;
}
}
}
if (!partIntFormatter && !partDecFormatter) {
return (intPart ? intPart.join('') : '') + (decPart ? decPart.join('') : '');
} else if (!partDecFormatter) {
partDecFormatter = '';
}
var exponentValue = 0;
var dl = _getDigitLength(value, '.');
if (formatter._exponent) {
var aValue = Math_abs(value);
var intLen = (!partIntFormatter) ? 1 : partIntFormatter.length;
if (aValue >= 1) {
if (dl._integer > intLen) {
dl._integer -= intLen;
dl._decimal += intLen;
value = value / Math_pow(10, dl._integer);
exponentValue = dl._integer;
} else if (dl._integer < intLen) {
exponentValue = 0;
} else {
exponentValue = 0;
}
if (formatter._exponent._sign === -1) {
formatter._exponent._sign = 0;
}
} else if (aValue < 1 && aValue > 0) {
formatter._exponent._sign = -1;
dl._integer = intLen;
dl._decimal -= intLen;
var baseVal = Math_pow(10, intLen);
while (aValue * 10 < baseVal) {
aValue *= 10;
exponentValue++;
}
value *= Math_pow(10, exponentValue);
}
}
var zerophIndex = partDecFormatter.lastIndexOf('0');
var digitphIndex = partDecFormatter.lastIndexOf('#');
var numberGroupSizes = nf.numberGroupSizes, numberGroupSeparator = nf.numberGroupSeparator, numberDecimalSeparator = nf.numberDecimalSeparator, negativeSign = nf.negativeSign;
var precision = dl._decimal;
if (zerophIndex >= 0) {
precision = zerophIndex + 1;
}
if (digitphIndex > zerophIndex && digitphIndex < dl._decimal) {
precision = digitphIndex + 1;
}
if (!decPart) {
precision = 0;
}
var numbers = _expandNumber(value, precision, numberGroupSizes, numberGroupSeparator, numberDecimalSeparator, negativeSign, TRUE);
if (numbers === '') {
return (intPart ? intPart.join('') : '') + (decPart ? decPart.join('') : '');
}
var replaceExponent = FALSE;
if (intPart) {
var numberIntPart = numbers.split(numberDecimalSeparator)[0];
var neg = substr(numberIntPart, 0, 1);
if (neg === negativeSign) {
numberIntPart = substr(numberIntPart, 1);
}
var procDigitLen = 0, procIntPart = '';
var firstZerophIndex = partIntFormatter.indexOf('0');
var numIntPartLength = numberIntPart.length === 1 && numberIntPart === '0' ? 0 : numberIntPart.length;
var intDigLen = (firstZerophIndex === -1) ? numIntPartLength : (partIntFormatter.length - firstZerophIndex);
numberIntPart = intDigLen === 0 ? '' : numberIntPart;
for (i = intPart.length - 1; i >= 0; i--) {
ip = intPart[i];
if (/^(0|#)+/g.test(ip)) {
procIntPart = ip + procIntPart;
if (procIntPart !== partIntFormatter) {
var iplen = ip.length;
for (var ipi = numberIntPart.length - procDigitLen - 1; ipi >= 0 && iplen > 0; ipi--) {
var nc = numberIntPart.charAt(ipi);
resultString = nc + resultString;
iplen--;
procDigitLen++;
}
if (procDigitLen >= numberIntPart.length && procDigitLen < intDigLen && iplen > 0) {
resultString = (new Array(iplen + 1)).join('0') + resultString;
procDigitLen += iplen;
}
} else {
var part = substr(numberIntPart, 0, numberIntPart.length - procDigitLen);
if (firstZerophIndex >= 0 && firstZerophIndex < partIntFormatter.length - procDigitLen - part.length) {
part = new Array(partIntFormatter.length - procDigitLen - firstZerophIndex - part.length + 1).join('0') + part;
}
resultString = part + resultString;
}
} else if (formatter._exponent && !replaceExponent && /^((E(\+|-)?|e(\+|-)?)\d+)/g.test(ip)) {
replaceExponent = TRUE;
exp = '';
exp += formatter._exponent._symbol;
exp += _signs[formatter._exponent._sign];
exp += padZeroLeft(exponentValue.toString(), formatter._exponent._exp);
resultString = exp + resultString;
} else {
resultString = ip + resultString;
}
}
if (neg === negativeSign) {
resultString = neg + resultString;
}
if (formatter._group === TRUE) {
resultString = _insertGroupSeparator(resultString, numberGroupSizes, numberGroupSeparator, negativeSign);
}
}
if (decPart) {
var numberDecPart = '';
if (precision > 0) {
var decSepIndex = numbers.indexOf(numberDecimalSeparator);
if (decSepIndex !== -1) {
numberDecPart = numbers.substring(decSepIndex + 1);
if (partIntFormatter === '') {
resultString += substr(numbers, 0, decSepIndex);
}
resultString += numberDecimalSeparator;
}
} else if (!/^(#+)$/ig.test(partDecFormatter) || decPart.join('').length !== partDecFormatter.length) {
if (!(zerophIndex <= 0 && numbers.indexOf(numberDecimalSeparator) < 0 && partIntFormatter === _generalNumberInt && partDecFormatter === _generalNumberDec)) {
resultString += numberDecimalSeparator;
}
if (zerophIndex > 0) {
numberDecPart = new Array(zerophIndex + 1).join('0');
}
}
var numDecIndex = 0;
for (d = 0; d < decPart.length; d++) {
dp = decPart[d];
if (/^(0|#)+/g.test(dp)) {
resultString += substr(numberDecPart, numDecIndex, dp.length);
numDecIndex += dp.length;
} else if (formatter._exponent && !replaceExponent && /^((E(\+|-)?|e(\+|-)?)\d+)/g.test(dp)) {
replaceExponent = TRUE;
exp = '';
exp += formatter._exponent._symbol;
exp += _signs[formatter._exponent._sign];
exp += padZeroLeft(exponentValue.toString(), formatter._exponent._exp);
resultString += exp;
} else {
resultString += dp;
}
}
}
var zeroDotIndex = resultString.indexOf('0' + numberDecimalSeparator);
if (zeroDotIndex === 0) {
if (zeroDotIndex + 2 === resultString.length && dl._decimal === 0) {
resultString = resultString.replace('0' + numberDecimalSeparator, numberDecimalSeparator);
} else if (zeroDotIndex + 2 < resultString.length) {
if (!/[0-9]+/g.test(resultString.charAt(zeroDotIndex + 2))) {
resultString = resultString.replace('0' + numberDecimalSeparator, numberDecimalSeparator);
}
}
}
return resultString;
}
function _parseNumber(value, cultureInfo) {
value = (!isNullOrUndefined(value)) ? StringHelper._trimEnd(value, '') : '';
if (value.match(/^[+-]?infinity$/i)) {
return parseFloatFn(value);
}
if (value.match(/^0x[a-f0-9]+$/i)) {
return parseIntFn(value, 10);
}
var numFormat = cultureInfo.NumberFormat;
var numberNegativePattern = numFormat.numberNegativePattern;
var signInfo = _parseNumberNegativePattern(value, numFormat, numberNegativePattern);
var sign = signInfo[0];
var num = signInfo[1];
if ((sign === '') && (numberNegativePattern !== 1)) {
signInfo = _parseNumberNegativePattern(value, numFormat, 1);
sign = signInfo[0];
num = signInfo[1];
}
if (sign === '') {
sign = '+';
}
if (num[0] === numFormat.currencySymbol) {
num = substr(num, 1);
}
var exponent;
var intAndFraction;
var exponentPos = num.indexOf('e');
if (exponentPos < 0) {
exponentPos = num.indexOf('E');
}
if (exponentPos < 0) {
intAndFraction = num;
exponent = keyword_null;
} else {
intAndFraction = substr(num, 0, exponentPos);
exponent = substr(num, exponentPos + 1);
}
var integer, fraction;
var decimalPos = intAndFraction.indexOf('.');
if (decimalPos < 0) {
integer = intAndFraction;
fraction = keyword_null;
} else {
integer = substr(intAndFraction, 0, decimalPos);
fraction = substr(intAndFraction, decimalPos + '.'.length);
}
integer = integer.split(',').join('');
var altNumGroupSeparator = ','.replace(/\u00A0/g, ' ');
if (',' !== altNumGroupSeparator) {
integer = integer.split(altNumGroupSeparator).join('');
}
var p = sign + integer;
if (fraction !== keyword_null) {
p += '.' + fraction;
}
var lastChar = p[p.length - 1];
if (lastChar === numFormat.percentSymbol) {
p = substr(p, 0, p.length - 1);
p = StringHelper._trimEnd(p, '');
var ndp = p.indexOf('.');
if (ndp === -1) {
ndp = p.length;
}
var resultBuilder = '';
resultBuilder += substr(p, 0, ndp - 2);
resultBuilder += '.';
resultBuilder += substr(p, ndp - 2, 2);
resultBuilder += substr(p, ndp + 1);
p = resultBuilder;
}
if (exponent !== keyword_null) {
var expSignInfo = _parseNumberNegativePattern(exponent, numFormat, 1);
if (expSignInfo[0] === '') {
expSignInfo[0] = '+';
}
p += 'e' + expSignInfo[0] + expSignInfo[1];
}
if (p.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)) {
return parseFloatFn(p);
}
return NaN;
}
function _parseNumberNegativePattern(value, numFormat, numberNegativePattern) {
var neg = numFormat.negativeSign;
var pos = numFormat.positiveSign;
var strHelper = StringHelper;
if (numberNegativePattern === 4 || numberNegativePattern === 2) {
neg = ' ' + neg;
pos = ' ' + pos;
}
if (numberNegativePattern === 4 || numberNegativePattern === 3) {
if (strHelper._endsWith(value, neg)) {
return ['-', substr(value, 0, value.length - neg.length)];
} else if (strHelper._endsWith(value, pos)) {
return ['+', substr(value, 0, value.length - pos.length)];
}
} else if (numberNegativePattern === 2 || numberNegativePattern === 1) {
if (strHelper._startsWith(value, neg)) {
return ['-', substr(value, neg.length)];
} else if (strHelper._startsWith(value, pos)) {
return ['+', substr(value, pos.length)];
}
} else if (numberNegativePattern === 0) {
if (strHelper._startsWith(value, '(') && strHelper._endsWith(value, ')')) {
return ['-', substr(value, 1, value.length - 2)];
}
} else {
throw new Error('');
}
return ['', value];
}
function _toHexString(num, lowCase, precision) {
if (Math_abs(Math_floor(num) - num) !== 0) {
throw new Error(sR().Exp_BadFormatSpecifier);
}
var number = num >= 0 ? num.toString(16) : (_maxInt32 + num + 1).toString(16);
number = lowCase ? number.toLowerCase() : number.toUpperCase();
if (!isNullOrUndefined(precision) && number.length < precision) {
return padZeroLeft(number, precision);
}
return number;
}
function _toScientific(num, e, precision, groupSizes, sep, decimalChar, negativeSign) {
var digitLen = 0;
var digSepMoveRight = (num >= 1 || num === 0);
while (digitLen < 1000) {
var base = Math_pow(10, digitLen);
if (digSepMoveRight && (num / base < 10) || !digSepMoveRight && (num * base >= 1)) {
break;
}
digitLen++;
}
num = digSepMoveRight ? Math_abs(num) / Math_pow(10, digitLen) : Math_abs(num) * Math_pow(10, digitLen);
var number = _expandNumber(num, precision, groupSizes, sep, decimalChar, negativeSign);
number += e + (digSepMoveRight ? '+' : '-') + padZeroLeft(digitLen.toString(), 3);
return number;
}
function round10(value, exp) {
if (typeof exp === keyword_undefined || +exp === 0) {
return Math.round(value);
}
value = +value;
exp = +exp;
if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {
return NaN;
}
value = value.toString().split('e');
value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp)));
value = value.toString().split('e');
return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp));
}
var DOT_REPLACE_SYMBOL = '#dot#';
var GROUP_REPLACE_SYMBOL = '#group#';
function getNumberFormat(cultureName) {
var numberFormat = cM._getCultureInfo().NumberFormat;
if (typeof cultureName === 'string') {
numberFormat = cM._getCultureInfo(cultureName).NumberFormat;
}
return numberFormat;
}
function _fixNumber(value, num) {
if (typeof value === 'number' && value.toString().length >= num) {
value = (value < 1 && value > -1) ?
+value.toFixed(num) :
+value.toPrecision(num);
}
return value;
}
return {
_parseLocale: function (value) {
return _parseNumber(value, cM._getCultureInfo());
},
_parseInvariant: function (value) {
return _parseNumber(value, cM._getCultureInfo('invariant'));
},
_customCultureFormat: function (num, format, cultureInfo) {
if (!cultureInfo) {
cultureInfo = cM._getCultureInfo();
}
return _toFormattedString(num, format, cultureInfo);
},
_replaceNormalToCultureSymbol: function (value, cultureName) {
if (typeof value !== 'string') {
return value;
}
var numberFormat = getNumberFormat(cultureName);
var decimalSeparator = numberFormat.numberDecimalSeparator;
var groupSeparator = numberFormat.numberGroupSeparator;
if (decimalSeparator !== '.') {
value = value.replace(_getReg('[.]'), DOT_REPLACE_SYMBOL);
}
if (groupSeparator !== ',') {
value = value.replace(_getReg('[,]'), GROUP_REPLACE_SYMBOL);
}
if (decimalSeparator !== '.') {
value = value.replace(_getReg(DOT_REPLACE_SYMBOL), decimalSeparator);
}
if (groupSeparator !== ',') {
value = value.replace(_getReg(GROUP_REPLACE_SYMBOL), groupSeparator);
}
return value;
},
_replaceCultureSymbolToNormal: function (value, cultureName) {
if (typeof value !== 'string') {
return value;
}
var numberFormat = getNumberFormat(cultureName);
var decimalSeparator = numberFormat.numberDecimalSeparator;
var groupSeparator = numberFormat.numberGroupSeparator;
if (decimalSeparator !== '.') {
value = value.replace(_getReg('[' + decimalSeparator + ']'), DOT_REPLACE_SYMBOL);
}
if (groupSeparator !== ',') {
value = value.replace(_getReg('[' + groupSeparator + ']'), GROUP_REPLACE_SYMBOL);
}
if (decimalSeparator !== '.') {
value = value.replace(_getReg(DOT_REPLACE_SYMBOL), '.');
}
if (groupSeparator !== ',') {
value = value.replace(_getReg(GROUP_REPLACE_SYMBOL), ',');
}
return value;
},
_isValidCultureNumberString: function (value, cultureName) {
if (typeof value === 'string') {
var numberFormat = getNumberFormat(cultureName);
var decimalSeparator = numberFormat.numberDecimalSeparator;
var groupSeparator = numberFormat.numberGroupSeparator;
if ((decimalSeparator !== '.' && groupSeparator !== '.' && value.indexOf('.') >= 0)
|| (decimalSeparator !== ',' && groupSeparator !== ',' && value.indexOf(',') >= 0)) {
return false;
}
}
return true;
},
_parseFloat: function (number, cultureName) {
return parseFloatFn(this._replaceCultureSymbolToNormal(number, cultureName));
},
_toHexString: _toHexString,
_fixNumber: _fixNumber
};
})();
function _getReg(regStr) {
return RegexHelper._getReg(regStr);
}
module.exports = NumberHelper;
/***/ }),
/ 7 / /***/ (function(module, exports, __webpack_require__) {
var StringHelper = __webpack_require__(8);
var RegexHelper = (function () {
function RegexHelper() {
}
RegexHelper._getReg = function (regStr) {
var reg = RegexHelper._regDict[regStr];
if (!reg) {
reg = RegexHelper._regDict[regStr] = new RegExp(regStr, 'g');
}
reg.lastIndex = 0;
return reg;
};
RegexHelper._getRegIgnoreCase = function (regStr) {
var reg = RegexHelper._regDictIgnoreCase[regStr];
if (!reg) {
reg = RegexHelper._regDictIgnoreCase[regStr] = new RegExp(regStr, 'gi');
}
reg.lastIndex = 0;
return reg;
};
RegexHelper._getWildcardCriteria = function (criteria, ignoreTilda ) {
if (RegexHelper._wildcardParseRecord[criteria]) {
return RegexHelper._wildcardParseResultBuffer[criteria];
}
var wildcardChars = '[~?*]+';
if (RegexHelper._getReg(wildcardChars).test(criteria)) {
var result = [];
var charArray = criteria.split(''), currentChar;
for (var i = 0; i < charArray.length; i++) {
currentChar = charArray[i];
if (currentChar === '~' && i < charArray.length - 1) {
i++;
currentChar = charArray[i];
if (currentChar === '*' || currentChar === '?') {
result.push('\\');
} else if (ignoreTilda) {
result.push('~');
}
result.push(currentChar);
} else if (currentChar === '?') {
result.push('.');
} else if (currentChar === '*') {
result.push('.');
result.push('*');
} else {
result.push(currentChar);
}
}
return result.join('');
}
return null;
};
RegexHelper._getWildcardCriteriaFullMatch = function (criteria, ignoreTilda ) {
var criteriaTemp = RegexHelper._getWildcardCriteria(criteria, ignoreTilda);
if (criteriaTemp) {
criteriaTemp = '^' + criteriaTemp + '$';
}
return criteriaTemp;
};
RegexHelper._getReplaceSymbol = function (expectSymbol, srcStr) {
var asteriskSymbol = '#' + expectSymbol + '0#';
var i = 1;
while (srcStr.indexOf(asteriskSymbol) > 0) {
asteriskSymbol = StringHelper._join(asteriskSymbol, '#' + expectSymbol + (i - 1) + '#', '#' + expectSymbol + i + '#');
i++;
}
return asteriskSymbol;
};
RegexHelper._regDict = {};
RegexHelper._regDictIgnoreCase = {};
RegexHelper._wildcardParseRecord = {};
RegexHelper._wildcardParseResultBuffer = {};
RegexHelper._replaceRegString2NormalString = function (srcStr) {
return srcStr.replace(/([\~\!\@\#\$\%\^\&\*\(\)\-\_\+\=\[\]\{\}\|\\\;\:\'\"\,\.\/\<\>\?])/, '\\$1');
};
return RegexHelper;
})();
module.exports = RegexHelper;
// }), / 8 / // (function(module, exports, __webpack_require__) {
var isNullOrUndefined = __webpack_require__(5)._isNullOrUndefined;
function substr(str, start, length) {
return str.substr(start, length)
}
var StringHelper = {
_contains: function (str, value, ignoreCase) {
if (ignoreCase) {
str = str.toLowerCase();
value = value.toLowerCase();
}
return value === '' || str.indexOf(value) >= 0;
},
_indexOf: function (str, value, ignoreCase) {
if (!ignoreCase) {
return str.indexOf(value);
} else if (ignoreCase) {
var tempStr = str.toLowerCase();
var tempValue = value.toLowerCase();
return tempStr.indexOf(tempValue);
}
return str.indexOf(value);
},
_trimStart: function (str, trimChar) {
if (!trimChar) {
return str;
}
var temp = str;
while (substr(temp, 0, trimChar.length) === trimChar) {
temp = substr(temp, trimChar.length);
}
return temp;
},
_trimEnd: function (str, trimChar) {
if (!trimChar) {
return str;
}
var temp = str;
while (substr(temp, temp.length - trimChar.length, trimChar.length) === trimChar) {
temp = substr(temp, 0, temp.length - trimChar.length);
}
return temp;
},
_insert: function (str, startIndex, value) {
if (startIndex < 0 || startIndex > str.length || isNullOrUndefined(value)) {
throw new Error();
}
var tempStrStart = substr(str, 0, startIndex);
var tempStrEnd = substr(str, startIndex, str.length - startIndex);
return tempStrStart + value + tempStrEnd;
},
_remove: function (str, startIndex, count) {
if (isNullOrUndefined(count)) {
count = str.length - startIndex;
}
if (startIndex < 0 || count < 0 || startIndex + count > str.length) {
throw new Error();
}
var valueStart = substr(str, 0, startIndex);
var valueEnd = substr(str, startIndex + count, str.length - startIndex - count);
return valueStart + valueEnd;
},
_startsWith: function (str, value, ignoreCase) {
return stringWith(str, value, ignoreCase, function (str1, str2) {
return str1.slice(0, str2.length) === str2;
});
},
_endsWith: function (str, value, ignoreCase) {
return stringWith(str, value, ignoreCase, function (str1, str2) {
return str1.slice(-str2.length) === str2;
});
},
_replace: function (str, oldValue, newValue, ignoreCase) {
if (!oldValue || oldValue === '') {
throw new Error();
}
newValue = ('' + newValue).replace(/\$/g, '$$$$');
return str.replace(new RegExp(oldValue, 'g' + (ignoreCase ? 'i' : '')), newValue);
},
_replaceAllNoReg: function (str, oldValue, newValue, ignoreCase) {
oldValue = __webpack_require__(7)._replaceRegString2NormalString(oldValue);
return this._replace(str, oldValue, newValue, ignoreCase);
},
_leftBefore: function (src, suffex) {
var index = src.indexOf(suffex);
if (index < 0 || index >= src.length) {
return src;
}
return substr(src, 0, index);
},
_count: function (src, ss) {
var count = 0, pos = src.indexOf(ss);
while (pos >= 0) {
count += 1;
pos = src.indexOf(ss, pos + 1);
}
return count;
},
_join: function (src, substr, replacement) {
return src.split(substr).join(replacement);
},
_format: function (format, args) {
var f = format;
for (var i = 0; i < args.length; i++) {
var re = new RegExp('\\{' + i + '\\}', 'g');
f = f.replace(re, args[i]);
}
return f;
},
_padZero: function (str, count, left) {
var str2 = str.toString();
for (var l = str2.length; l < count; l++) {
str2 = (left ? ('0' + str2) : (str2 + '0'));
}
return str2;
},
_padZeroLeft: function (string, count) {
return StringHelper._padZero(string, count, true);
},
_padZeroRight: function (string, count) {
return StringHelper._padZero(string, count, false);
},
_compareStringIgnoreCase: function (s1, s2) {
return s1 === s2 || !s1 && !s2 || s1 && s2 && s1.toLowerCase() === s2.toLowerCase();
},
_toUpperCase: function (string) {
return string.toUpperCase();
},
_escapeHtml: function (str) {
var map = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
'\'': ''',
'`': '`'
};
var replaceReg = __webpack_require__(7)._getReg('(?:&|<|>|\"|\'|`)');
return replaceReg.test(str) ? str.replace(replaceReg, function (m) {
return map[m];
}) : str;
},
_unescapeHtml: function (str) {
var map = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
''': '\'',
'`': '`'
};
var replaceReg = __webpack_require__(7)._getReg('(?:&|<|>|"|'|`)');
return replaceReg.test(str) ? str.replace(replaceReg, function (m) {
return map[m];
}) : str;
}
};
function stringWith(str, value, ignoreCase, callBack) {
if (!value) {
throw new Error();
}
if (value === '') {
return true;
}
if (value.length > str.length) {
return false;
}
var thisStr = str;
var valueStr = value;
if (ignoreCase) {
thisStr = thisStr.toLowerCase();
valueStr = valueStr.toLowerCase();
}
return callBack(thisStr, valueStr);
}
module.exports = StringHelper;
// }), / 9 / // (function(module, exports, __webpack_require__) {
var Common = __webpack_require__(3);
var StringHelper = __webpack_require__(8);
var ArrayHelper = __webpack_require__(10);
var cM = __webpack_require__(4).CultureManager;
var isNullOrUndefined = __webpack_require__(5)._isNullOrUndefined;
var padZeroLeft = StringHelper._padZeroLeft;
var keyword_null = null, parseIntFn = parseInt, FALSE = false, TRUE = true, Math_floor = Math.floor, Math_abs = Math.abs;
var sR = function () {
return Common._getResource(Common.SR)();
};
var dateCache = {};
var DateTimeHelper = (function () {
function parseDate(value, cultureInfo, args) {
var i, l, date, format, formats, custom = FALSE;
formats = args;
formats.slice(1).forEach(function (f) {
if (f) {
custom = true;
}
});
if (!custom) {
formats = formats.concat(cultureInfo._getDateTimePattern());
}
for (i = 1, l = formats.length; i < l; i++) {
format = formats[i];
if (format) {
custom = TRUE;
date = parseDateExact(value, format, cultureInfo);
if (date) {
return date;
}
}
}
return keyword_null;
}
function toFormattedString(date, format, cultureInfo) {
var dtf = cultureInfo.DateTimeFormat, convert = dtf.Calendar.convert;
if (!format || !format.length) {
if (cultureInfo && cultureInfo.name.length) {
if (convert) {
return toFormattedString(date, dtf.fullDateTimePattern, cultureInfo);
}
return date.toLocaleString();
}
return date.toString();
}
var eras = dtf.eras, sortable = (format === 's');
var ret = '';
var hour;
var foundDay, checkedDay, dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g;
function hasDay() {
if (foundDay || checkedDay) {
return foundDay;
}
foundDay = dayPartRegExp.test(format);
checkedDay = TRUE;
return foundDay;
}
var quoteCount = 0, tokenRegExp = getTokenRegExp(), converted;
if (!sortable && convert) {
converted = convert.fromGregorian(date);
}
function getPart(date, part) {
if (converted) {
return converted[part];
}
switch (part) {
case 0:
return date.getFullYear();
case 1:
return date.getMonth();
case 2:
return date.getDate();
}
}
var eraIndex = -2;
var eraYearIndex = -2;
var stringValue = {_value: ''};
for (var tokenIndex = 0; ; tokenIndex++) {
var index = tokenRegExp.lastIndex;
var ar = tokenRegExp.exec(format);
var preMatch = format.slice(index, ar ? ar.index : format.length);
stringValue._value = '';
quoteCount += appendPreOrPostMatch(preMatch, stringValue);
ret += stringValue._value;
if (!ar) {
break;
}
if ((quoteCount % 2) === 1) {
ret += (ar[0]);
continue;
}
var fullYear = date.getFullYear(),
day = date.getDay(),
hours = date.getHours(),
minutes = date.getMinutes(),
seconds = date.getSeconds(),
milliseconds = date.getMilliseconds(),
timezoneOffset = date.getTimezoneOffset();
switch (ar[0]) {
case 'dddd':
ret += (dtf.dayNames[day]);
break;
case 'ddd':
ret += (dtf.abbreviatedDayNames[day]);
break;
case 'dd':
foundDay = TRUE;
ret += (padZeroLeft(getPart(date, 2), 2));
break;
case 'd':
foundDay = TRUE;
ret += (getPart(date, 2));
break;
case 'MMMM':
ret += ((dtf.monthGenitiveNames && hasDay()) ? dtf.monthGenitiveNames[getPart(date, 1)] : dtf.monthNames[getPart(date, 1)]);
break;
case 'MMM':
ret += ((dtf.abbreviatedMonthGenitiveNames && hasDay()) ? dtf.abbreviatedMonthGenitiveNames[getPart(date, 1)] : dtf.abbreviatedMonthNames[getPart(date, 1)]);
break;
case 'MM':
ret += padZeroLeft(getPart(date, 1) + 1, 2);
break;
case 'M':
ret += (getPart(date, 1) + 1);
break;
case 'yyyy':
case 'yyy':
if (eraIndex >= 0) {
ret += eras._formatEraPart('ee', date);
} else {
ret += padZeroLeft((converted ? converted[0] : fullYear), 4);
}
break;
case 'yy':
if (eraIndex >= 0) {
ret += eras._formatEraPart('ee', date);
} else {
ret += padZeroLeft((converted ? converted[0] : fullYear) % 100, 2);
}
break;
case 'y':
if (eraIndex >= 0) {
ret += eras._formatEraPart('e', date);
} else {
ret += (((converted ? converted[0] : fullYear) % 100).toString());
}
break;
case 'hh':
hour = hours % 12;
if (hour === 0) {
hour = 12;
}
ret += (padZeroLeft(hour, 2));
break;
case 'h':
hour = hours % 12;
if (hour === 0) {
hour = 12;
}
ret += (hour);
break;
case 'HH':
ret += padZeroLeft(hours, 2);
break;
case 'H':
ret += (hours.toString());
break;
case 'mm':
ret += padZeroLeft(minutes, 2);
break;
case 'm':
ret += (minutes.toString());
break;
case 'ss':
ret += padZeroLeft(seconds, 2);
break;
case 's':
ret += (seconds.toString());
break;
case 'tt':
ret += ((hours < 12) ? dtf.amDesignator : dtf.pmDesignator);
break;
case 't':
ret += (((hours < 12) ? dtf.amDesignator : dtf.pmDesignator).charAt(0));
break;
case 'f':
ret += (padZeroLeft(milliseconds, 3).charAt(0));
break;
case 'ff':
ret += (padZeroLeft(milliseconds, 3).substr(0, 2));
break;
case 'fff':
ret += (padZeroLeft(milliseconds, 3));
break;
case 'z':
hour = timezoneOffset / 60;
ret += (((hour <= 0) ? '+' : '-') + Math_floor(Math_abs(hour)));
break;
case 'zz':
hour = timezoneOffset / 60;
ret += (((hour <= 0) ? '+' : '-') + padZeroLeft(Math_floor(Math_abs(hour)), 2));
break;
case 'zzz':
hour = timezoneOffset / 60;
ret += (((hour <= 0) ? '+' : '-') + padZeroLeft(Math_floor(Math_abs(hour)), 2) + ':' + padZeroLeft(Math_abs(timezoneOffset % 60), 2));
break;
case 'g':
case 'gg':
case 'ggg':
if (!eras) {
break;
}
if (eraIndex === tokenIndex - 1) {
eraIndex = tokenIndex;
break;
} else {
ret += eras._formatEraPart(ar[0], date);
eraIndex = tokenIndex;
}
break;
case 'e':
case 'ee':
if (!eras) {
ret += padZeroLeft((converted ? converted[0] : fullYear), 4);
break;
} else if (eraYearIndex === tokenIndex - 1) {
eraYearIndex = tokenIndex;
break;
} else {
ret += eras._formatEraPart(ar[0], date);
eraYearIndex = tokenIndex;
}
break;
case '/':
ret += (dtf.dateSeparator);
break;
case '[h]':
case '[hh]':
case '[H]':
case '[HH]':
case '[mm]':
case '[ss]':
ret += ar[0];
break;
default:
throw new Error(sR().Exp_InvalidDateFormat);
}
}
return ret.toString();
}
function appendPreOrPostMatch(preMatch, strBuilder) {
var quoteCount = 0;
var escaped = FALSE;
for (var i = 0, il = preMatch.length; i < il; i++) {
var c = preMatch.charAt(i);
switch (c) {
case '\"':
if (escaped) {
strBuilder._value += '\'';
} else {
quoteCount++;
}
escaped = FALSE;
break;
case '\\':
if (escaped) {
strBuilder._value += '\\';
}
escaped = !escaped;
break;
default:
strBuilder._value += c;
escaped = FALSE;
break;
}
}
return quoteCount;
}
function expandYear(cultureInfo, year) {
var now = new Date();
var eras = cultureInfo.DateTimeFormat.eras;
if (eras && year < 100) {
var curr = eras._getEraDate(now)._eraYear;
year += curr - (curr % 100);
if (year > cultureInfo.DateTimeFormat.Calendar.TwoDigitYearMax) {
year -= 100;
}
}
return year;
}
function getTokenRegExp() {
return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|ggg|gg|g|ee|e|\[H\]|\[HH\]|\[h\]|\[hh\]|\[mm\]|\[ss\]/g;
}
function getParseRegExp(dtf, format) {
if (!dtf._parseRegExp) {
dtf._parseRegExp = {};
} else if (dtf._parseRegExp[format]) {
return dtf._parseRegExp[format];
}
var expFormat = format;
expFormat = expFormat.replace('%M', 'M');
expFormat = expFormat.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, '\\\\$1');
var regexp = '^';
var stringValue = {_value: ''};
var groups = [];
var index = 0;
var quoteCount = 0;
var tokenRegExp = getTokenRegExp();
var match;
while ((match = tokenRegExp.exec(expFormat)) !== keyword_null) {
stringValue._value = '';
var preMatch = expFormat.slice(index, match.index);
index = tokenRegExp.lastIndex;
quoteCount += appendPreOrPostMatch(preMatch, stringValue);
regexp += stringValue._value;
if ((quoteCount % 2) === 1) {
regexp += match[0];
continue;
}
switch (match[0]) {
case 'dddd':
case 'ddd':
case 'MMMM':
case 'MMM':
case 'gggg':
case 'ggg':
case 'gg':
case 'g':
regexp += '(\\D+)';
break;
case 'tt':
case 't':
regexp += '(\\D*)';
break;
case 'dd':
case 'd':
case 'MM':
case 'M':
case 'yy':
case 'y':
case 'eee':
case 'ee':
case 'e':
case 'HH':
case 'H':
case 'hh':
case 'h':
case 'mm':
case 'm':
case 'ss':
case 's':
regexp += '(\\d\\d?)';
break;
case 'yyy':
case 'yyyy':
regexp += '(\\d{2}|\\d{4})';
break;
case 'fff':
regexp += '(\\d{3})';
break;
case 'ff':
regexp += '(\\d{2})';
break;
case 'f':
regexp += '(\\d)';
break;
case 'zzz':
regexp += '([+-]?\\d\\d?:\\d{2})';
break;
case 'zz':
case 'z':
regexp += '([+-]?\\d\\d?)';
break;
case '/':
regexp += '(\\' + dtf.dateSeparator + ')';
break;
default:
throw new Error(sR().Exp_InvalidDateFormat);
}
ArrayHelper._add(groups, match[0]);
}
stringValue._value = '';
appendPreOrPostMatch(expFormat.slice(index), stringValue);
regexp += stringValue._value;
regexp += '$';
var regexpStr = regexp.toString().replace(/\s+/g, '\\s+');
var parseRegExp = {'_regExp': regexpStr, '_groups': groups, '_exp': new RegExp(regexpStr)};
dtf._parseRegExp[format] = parseRegExp;
return parseRegExp;
}
function parseDateExact(value, format, cultureInfo) {
value = value.trim();
var dtf = cultureInfo.DateTimeFormat, parseInfo = getParseRegExp(dtf, format), match = parseInfo._exp.exec(value);
if (match === keyword_null) {
return keyword_null;
}
var groups = parseInfo._groups, era = keyword_null, year = keyword_null, month = keyword_null, date = keyword_null,
weekDay = keyword_null, hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = keyword_null, pmHour = FALSE;
for (var j = 0, jl = groups.length; j < jl; j++) {
var matchGroup = match[j + 1];
if (matchGroup) {
switch (groups[j]) {
case 'dd':
case 'd':
date = parseIntFn(matchGroup, 10);
if ((date < 1) || (date > 31)) {
return keyword_null;
}
break;
case 'MMMM':
month = cultureInfo._getMonthIndex(matchGroup);
if ((month < 0) || (month > 11)) {
return keyword_null;
}
break;
case 'MMM':
month = cultureInfo._getAbbrMonthIndex(matchGroup);
if ((month < 0) || (month > 11)) {
return keyword_null;
}
break;
case 'M':
case 'MM':
case '%M':
month = parseIntFn(matchGroup, 10) - 1;
if ((month < 0) || (month > 11)) {
return keyword_null;
}
break;
case 'e':
case 'ee':
year = expandYear(cultureInfo, parseIntFn(matchGroup, 10));
if ((year < 0) || (year > 9999)) {
return keyword_null;
}
break;
case 'y':
case 'yy':
case 'yyy':
case 'yyyy':
year = parseIntFn(matchGroup, 10);
if ((year < 0) || (year > 9999)) {
return keyword_null;
}
break;
case 'h':
case 'hh':
case 'H':
case 'HH':
hour = parseIntFn(matchGroup, 10);
if (hour < 0) {
return keyword_null;
}
break;
case 'm':
case 'mm':
min = parseIntFn(matchGroup, 10);
if ((min < 0) || (min > 59)) {
return keyword_null;
}
break;
case 's':
case 'ss':
sec = parseIntFn(matchGroup, 10);
if ((sec < 0) || (sec > 59)) {
return keyword_null;
}
break;
case 'tt':
case 't':
var upperToken = matchGroup.toUpperCase();
pmHour = (upperToken === dtf.pmDesignator.toUpperCase());
if (!pmHour && (upperToken !== dtf.amDesignator.toUpperCase())) {
return keyword_null;
}
break;
case 'f':
msec = parseIntFn(matchGroup, 10) * 100;
if ((msec < 0) || (msec > 999)) {
return keyword_null;
}
break;
case 'ff':
msec = parseIntFn(matchGroup, 10) * 10;
if ((msec < 0) || (msec > 999)) {
return keyword_null;
}
break;
case 'fff':
msec = parseIntFn(matchGroup, 10);
if ((msec < 0) || (msec > 999)) {
return keyword_null;
}
break;
case 'dddd':
weekDay = cultureInfo._getDayIndex(matchGroup);
if ((weekDay < 0) || (weekDay > 6)) {
return keyword_null;
}
break;
case 'ddd':
weekDay = cultureInfo._getAbbrDayIndex(matchGroup);
if ((weekDay < 0) || (weekDay > 6)) {
return keyword_null;
}
break;
case 'zzz':
var offsets = matchGroup.split(/:/);
if (offsets.length !== 2) {
return keyword_null;
}
hourOffset = parseIntFn(offsets[0], 10);
if ((hourOffset < -12) || (hourOffset > 13)) {
return keyword_null;
}
var minOffset = parseIntFn(offsets[1], 10);
if ((minOffset < 0) || (minOffset > 59)) {
return keyword_null;
}
tzMinOffset = (hourOffset * 60) + (StringHelper._startsWith(matchGroup, '-') ? -minOffset : minOffset);
break;
case 'z':
case 'zz':
hourOffset = parseIntFn(matchGroup, 10);
if ((hourOffset < -12) || (hourOffset > 13)) {
return keyword_null;
}
tzMinOffset = hourOffset * 60;
break;
case 'g':
case 'gg':
case 'ggg':
var eraName = matchGroup;
if (!eraName || !dtf.eras) {
return keyword_null;
}
era = dtf.eras._parseEraPart(groups[j], eraName);
if (era < 0) {
return keyword_null;
}
break;
}
}
}
var timeOnly = /^(\d|\d\d):/.test(value);
var result = timeOnly ? new Date(1899, 11, 30) : new Date(), defaults, convert = dtf.Calendar.convert;
if (convert) {
defaults = convert.fromGregorian(result);
}
if (!convert) {
defaults = [result.getFullYear(), result.getMonth(), result.getDate()];
}
if (year === keyword_null) {
year = defaults[0];
} else if (year < 100) {
if (dtf.eras) {
year = dtf.eras._getYearFromEra(era || 0, year);
} else if (year >= 30) {
year += 1900;
} else {
year += 2000;
}
}
if (month === keyword_null) {
month = defaults[1];
}
if (date === keyword_null) {
date = defaults[2];
}
if (convert) {
result = convert.toGregorian(year, month, date);
if (result === keyword_null) {
return keyword_null;
}
} else {
result.setFullYear(year, month, date);
if (result.getDate() !== date) {
return keyword_null;
}
if ((weekDay !== keyword_null) && (result.getDay() !== weekDay)) {
return keyword_null;
}
}
if (pmHour && (hour < 12)) {
hour += 12;
}
result.setHours(hour, min, sec, msec);
if (tzMinOffset !== keyword_null) {
var adjustedMin = result.getMinutes() - (tzMinOffset + result.getTimezoneOffset());
result.setHours(result.getHours() + adjustedMin / 60, adjustedMin % 60);
}
return result;
}
return {
_customCultureFormat: function (date, format, cultureInfo) {
if (!cultureInfo) {
cultureInfo = cM._getCultureInfo();
}
return toFormattedString(date, format, cultureInfo);
},
_localeFormat: function (date, format, cultureInfo) {
return toFormattedString(date, format, cultureInfo || cM._getCultureInfo());
},
_parseLocale: function (value, formats, cultureInfo) {
var args, result;
if (!formats && !cultureInfo) {
result = dateCache[value];
if (result !== undefined) {
return result ? new Date(result) : result;
}
}
if (formats) {
args = [value, formats];
} else {
args = [value];
}
result = parseDate(value, cultureInfo || cM._getCultureInfo(), args);
if (!formats && !cultureInfo) {
dateCache[value] = result;
}
return result ? new Date(result) : result;
},
_parseInvariant: function (value, formats) {
return parseDate(value, cM._getCultureInfo('invariant'), [value, formats]);
},
_parseExact: parseDateExact,
_fromOADate: function (oadate) {
var offsetDay = oadate - 25569;
var date = new Date(offsetDay * 86400000);
var adjustValue = offsetDay >= 0 ? 1 : -1;
var oldDateTimezoneOffset = date.getTimezoneOffset();
var ms = (oadate * 86400000 * 1440 + adjustValue - 25569 * 86400000 * 1440 + oldDateTimezoneOffset * 86400000) / 1440;
var firstResult = new Date(ms);
var fixHourSign = oldDateTimezoneOffset >= 0 ? 1 : -1;
var nextHour = new Date(ms + fixHourSign * 3600000);
var nextHourTimezoneOffset = nextHour.getTimezoneOffset();
if (oldDateTimezoneOffset !== nextHourTimezoneOffset) {
var newResult = new Date(ms + (nextHourTimezoneOffset - oldDateTimezoneOffset) * 60 * 1000);
if (oldDateTimezoneOffset > nextHourTimezoneOffset) {
if (fixHourSign === -1 || nextHourTimezoneOffset === firstResult.getTimezoneOffset()) {
return newResult;
}
} else if (oldDateTimezoneOffset < nextHourTimezoneOffset) {
if (fixHourSign === 1 || nextHourTimezoneOffset === firstResult.getTimezoneOffset()) {
return newResult;
}
}
}
return firstResult;
},
_fromOADateString: function (oadateString) {
if (oadateString.substr(0, 8) === '/OADate(') {
var oadate = parseFloat(oadateString.substr(8, oadateString.length - 10));// 10 for '/OADate(' length and ')/' length
return this._fromOADate(oadate);
}
},
_toOADateString: function (date) {
return '/OADate(' + this._toOADate(date) + ')/';
},
_toOADate: function (date) {
if (isNullOrUndefined(date)) {
return 0;
}
if (typeof date === 'number') {
date = new Date(date);
}
return (date.getTime() * 1440 + 25569 * 86400000 * 1440 - date.getTimezoneOffset() * 86400000) / (86400000 * 1440);
},
_DT: function (value) {
var dateValue = keyword_null;
var sucess = TRUE;
if (isNullOrUndefined(value)) {
dateValue = this._fromOADate(0);
} else if (value instanceof Date) {
dateValue = new Date(value);
} else if (typeof value === 'string') {
var dateTime = this._parseLocale(value);
if (!dateTime) {
if (!isNaN(value)) {
dateTime = DateTimeHelper._fromOADate(parseFloat(value));
if (!dateTime) {
sucess = FALSE;
}
} else {
dateTime = new Date(value);
if (isNaN(dateTime.valueOf())) {
sucess = FALSE;
}
var reg = /^[-+=\s]*(\d+)\W+(\d+)\W+(\d+)$/;
var results = reg.exec(value.replace(/ |\n/g, '').trim());
if (results && results.length === 4) {
if (results.indexOf(dateTime.getFullYear().toString()) === -1 ||
results.indexOf((dateTime.getMonth() + 1).toString()) === -1 ||
results.indexOf(dateTime.getDate().toString()) === -1) {
sucess = FALSE;
}
}
}
}
dateValue = dateTime;
} else if (typeof value === 'number') {
dateValue = this._fromOADate(value);
} else {
sucess = FALSE;
}
if (sucess) {
return dateValue;
}
throw sR().Exp_InvalidCast;
},
_isDate: function (value) {
return value && (value.constructor === Date || value.getUTCDate && value.setFullYear);
}
};
})();
module.exports = DateTimeHelper;
/***/ }),
1.为什么提示没有webpack这个插件
Can not load "webpack", it is not registered! Perhaps you are missing some plugin?
解决方法: npm install -g karma-cli
2.为什么执行
karma start
会出现缺少什么报错的情况如果package.json已经有加上所有的依赖的话,执行一下 npm install
3.怎么用vs code去调试mocha里面的用例
主要是调试的配置文件怎么写的问题
需要留意的是,只需要configurations数组中只要留下一个对象就好