@syncfusion/ej2-base 19.2.55 → 19.3.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -1
- package/CHANGELOG.md +1 -89
- package/README.md +1 -1
- package/dist/ej2-base.umd.min.js +2 -2
- package/dist/ej2-base.umd.min.js.map +1 -1
- package/dist/es6/ej2-base.es2015.js +2650 -2401
- package/dist/es6/ej2-base.es2015.js.map +1 -1
- package/dist/es6/ej2-base.es5.js +3186 -2948
- package/dist/es6/ej2-base.es5.js.map +1 -1
- package/dist/global/ej2-base.min.js +2 -2
- package/dist/global/ej2-base.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/e2e/crypto.js +1 -1
- package/e2e/index.d.ts +0 -3
- package/e2e/m.protractor.config.js +1 -1
- package/e2e/protractor.config.js +1 -1
- package/helpers/e2e/base.js +3 -3
- package/package.json +7 -64
- package/src/ajax.d.ts +24 -10
- package/src/ajax.js +14 -6
- package/src/animation-model.d.ts +12 -4
- package/src/animation.d.ts +37 -12
- package/src/animation.js +48 -22
- package/src/base.d.ts +31 -11
- package/src/base.js +34 -16
- package/src/browser.d.ts +63 -25
- package/src/browser.js +60 -15
- package/src/child-property.d.ts +21 -10
- package/src/child-property.js +23 -13
- package/src/component-model.d.ts +4 -1
- package/src/component.d.ts +42 -5
- package/src/component.js +52 -35
- package/src/dom.d.ts +76 -25
- package/src/dom.js +128 -124
- package/src/draggable-model.d.ts +5 -0
- package/src/draggable.d.ts +4 -1
- package/src/draggable.js +8 -2
- package/src/droppable-model.d.ts +7 -4
- package/src/droppable.d.ts +7 -3
- package/src/droppable.js +1 -0
- package/src/event-handler.d.ts +10 -6
- package/src/event-handler.js +11 -7
- package/src/hijri-parser.d.ts +12 -0
- package/src/hijri-parser.js +111 -90
- package/src/internationalization.d.ts +54 -21
- package/src/internationalization.js +55 -18
- package/src/intl/date-formatter.d.ts +19 -8
- package/src/intl/date-formatter.js +36 -13
- package/src/intl/date-parser.d.ts +30 -23
- package/src/intl/date-parser.js +61 -42
- package/src/intl/intl-base.d.ts +123 -46
- package/src/intl/intl-base.js +451 -377
- package/src/intl/number-formatter.d.ts +45 -34
- package/src/intl/number-formatter.js +47 -35
- package/src/intl/number-parser.d.ts +11 -8
- package/src/intl/number-parser.js +14 -11
- package/src/intl/parser-base.d.ts +38 -13
- package/src/intl/parser-base.js +45 -16
- package/src/keyboard-model.d.ts +5 -2
- package/src/keyboard.d.ts +26 -8
- package/src/keyboard.js +24 -9
- package/src/l10n.d.ts +16 -7
- package/src/l10n.js +16 -7
- package/src/module-loader.d.ts +13 -8
- package/src/module-loader.js +13 -9
- package/src/notify-property-change.d.ts +19 -7
- package/src/notify-property-change.js +140 -24
- package/src/observer.d.ts +17 -5
- package/src/observer.js +19 -7
- package/src/sanitize-helper.d.ts +1 -0
- package/src/sanitize-helper.js +1 -1
- package/src/template-engine.d.ts +30 -4
- package/src/template-engine.js +37 -12
- package/src/template.d.ts +8 -3
- package/src/template.js +67 -19
- package/src/touch-model.d.ts +11 -4
- package/src/touch.d.ts +51 -9
- package/src/touch.js +45 -13
- package/src/util.d.ts +67 -37
- package/src/util.js +99 -49
- package/styles/_bootstrap-definition.scss +0 -1
- package/styles/_bootstrap5-dark-definition.scss +10 -0
- package/styles/_bootstrap5-definition.scss +9 -0
- package/styles/_fabric-dark-definition.scss +0 -1
- package/styles/_highcontrast-light-definition.scss +1 -0
- package/styles/_material-definition.scss +1 -0
- package/styles/bootstrap-dark.css +2613 -32
- package/styles/bootstrap.css +2613 -32
- package/styles/bootstrap4.css +2149 -32
- package/styles/bootstrap5-dark.css +2157 -0
- package/styles/bootstrap5-dark.scss +3 -0
- package/styles/bootstrap5.css +2157 -0
- package/styles/bootstrap5.scss +3 -0
- package/styles/common/_core.scss +28 -63
- package/styles/definition/_bootstrap-dark.scss +3 -3
- package/styles/definition/_bootstrap.scss +1 -1
- package/styles/definition/_bootstrap5-dark.scss +357 -0
- package/styles/definition/_bootstrap5.scss +356 -0
- package/styles/definition/_material-dark.scss +1 -1
- package/styles/definition/_tailwind-dark.scss +18 -1
- package/styles/definition/_tailwind.scss +17 -0
- package/styles/fabric-dark.css +2589 -32
- package/styles/fabric.css +2589 -32
- package/styles/highcontrast-light.css +2573 -32
- package/styles/highcontrast.css +2573 -32
- package/styles/material-dark.css +2549 -32
- package/styles/material.css +2549 -32
- package/styles/tailwind-dark.css +2221 -32
- package/styles/tailwind.css +2221 -32
- package/src/virtual-dom.d.ts +0 -32
- package/src/virtual-dom.js +0 -449
|
@@ -15,16 +15,19 @@ export var onIntlChange = new Observer();
|
|
|
15
15
|
export var rightToLeft = false;
|
|
16
16
|
/**
|
|
17
17
|
* Specifies the CLDR data loaded for internationalization functionalities.
|
|
18
|
+
*
|
|
18
19
|
* @private
|
|
19
20
|
*/
|
|
20
21
|
export var cldrData = {};
|
|
21
22
|
/**
|
|
22
23
|
* Specifies the default culture value to be considered.
|
|
24
|
+
*
|
|
23
25
|
* @private
|
|
24
26
|
*/
|
|
25
27
|
export var defaultCulture = 'en-US';
|
|
26
28
|
/**
|
|
27
29
|
* Specifies default currency code to be considered
|
|
30
|
+
*
|
|
28
31
|
* @private
|
|
29
32
|
*/
|
|
30
33
|
export var defaultCurrencyCode = 'USD';
|
|
@@ -72,16 +75,18 @@ var Internationalization = /** @class */ (function () {
|
|
|
72
75
|
}
|
|
73
76
|
/**
|
|
74
77
|
* Returns the format function for given options.
|
|
78
|
+
*
|
|
75
79
|
* @param {DateFormatOptions} options - Specifies the format options in which the format function will return.
|
|
76
|
-
* @returns {Function}
|
|
80
|
+
* @returns {Function} ?
|
|
77
81
|
*/
|
|
78
82
|
Internationalization.prototype.getDateFormat = function (options) {
|
|
79
83
|
return DateFormat.dateFormat(this.getCulture(), options || { type: 'date', skeleton: 'short' }, cldrData);
|
|
80
84
|
};
|
|
81
85
|
/**
|
|
82
86
|
* Returns the format function for given options.
|
|
87
|
+
*
|
|
83
88
|
* @param {NumberFormatOptions} options - Specifies the format options in which the format function will return.
|
|
84
|
-
* @returns {Function}
|
|
89
|
+
* @returns {Function} ?
|
|
85
90
|
*/
|
|
86
91
|
Internationalization.prototype.getNumberFormat = function (options) {
|
|
87
92
|
if (options && !options.currency) {
|
|
@@ -94,16 +99,18 @@ var Internationalization = /** @class */ (function () {
|
|
|
94
99
|
};
|
|
95
100
|
/**
|
|
96
101
|
* Returns the parser function for given options.
|
|
102
|
+
*
|
|
97
103
|
* @param {DateFormatOptions} options - Specifies the format options in which the parser function will return.
|
|
98
|
-
* @returns {Function}
|
|
104
|
+
* @returns {Function} ?
|
|
99
105
|
*/
|
|
100
106
|
Internationalization.prototype.getDateParser = function (options) {
|
|
101
107
|
return DateParser.dateParser(this.getCulture(), options || { skeleton: 'short', type: 'date' }, cldrData);
|
|
102
108
|
};
|
|
103
109
|
/**
|
|
104
110
|
* Returns the parser function for given options.
|
|
111
|
+
*
|
|
105
112
|
* @param {NumberFormatOptions} options - Specifies the format options in which the parser function will return.
|
|
106
|
-
* @returns {Function}
|
|
113
|
+
* @returns {Function} ?
|
|
107
114
|
*/
|
|
108
115
|
Internationalization.prototype.getNumberParser = function (options) {
|
|
109
116
|
if (isBlazor() && options && !options.format) {
|
|
@@ -113,45 +120,50 @@ var Internationalization = /** @class */ (function () {
|
|
|
113
120
|
};
|
|
114
121
|
/**
|
|
115
122
|
* Returns the formatted string based on format options.
|
|
116
|
-
*
|
|
123
|
+
*
|
|
124
|
+
* @param {number} value - Specifies the number to format.
|
|
117
125
|
* @param {NumberFormatOptions} option - Specifies the format options in which the number will be formatted.
|
|
118
|
-
* @returns {string}
|
|
126
|
+
* @returns {string} ?
|
|
119
127
|
*/
|
|
120
128
|
Internationalization.prototype.formatNumber = function (value, option) {
|
|
121
129
|
return this.getNumberFormat(option)(value);
|
|
122
130
|
};
|
|
123
131
|
/**
|
|
124
132
|
* Returns the formatted date string based on format options.
|
|
125
|
-
*
|
|
133
|
+
*
|
|
134
|
+
* @param {Date} value - Specifies the number to format.
|
|
126
135
|
* @param {DateFormatOptions} option - Specifies the format options in which the number will be formatted.
|
|
127
|
-
* @returns {string}
|
|
136
|
+
* @returns {string} ?
|
|
128
137
|
*/
|
|
129
138
|
Internationalization.prototype.formatDate = function (value, option) {
|
|
130
139
|
return this.getDateFormat(option)(value);
|
|
131
140
|
};
|
|
132
141
|
/**
|
|
133
142
|
* Returns the date object for given date string and options.
|
|
143
|
+
*
|
|
134
144
|
* @param {string} value - Specifies the string to parse.
|
|
135
145
|
* @param {DateFormatOptions} option - Specifies the parse options in which the date string will be parsed.
|
|
136
|
-
* @returns {Date}
|
|
146
|
+
* @returns {Date} ?
|
|
137
147
|
*/
|
|
138
148
|
Internationalization.prototype.parseDate = function (value, option) {
|
|
139
149
|
return this.getDateParser(option)(value);
|
|
140
150
|
};
|
|
141
151
|
/**
|
|
142
152
|
* Returns the number object from the given string value and options.
|
|
153
|
+
*
|
|
143
154
|
* @param {string} value - Specifies the string to parse.
|
|
144
155
|
* @param {NumberFormatOptions} option - Specifies the parse options in which the string number will be parsed.
|
|
145
|
-
* @returns {number}
|
|
156
|
+
* @returns {number} ?
|
|
146
157
|
*/
|
|
147
158
|
Internationalization.prototype.parseNumber = function (value, option) {
|
|
148
159
|
return this.getNumberParser(option)(value);
|
|
149
160
|
};
|
|
150
161
|
/**
|
|
151
162
|
* Returns Native Date Time Pattern
|
|
163
|
+
*
|
|
152
164
|
* @param {DateFormatOptions} option - Specifies the parse options for resultant date time pattern.
|
|
153
165
|
* @param {boolean} isExcelFormat - Specifies format value to be converted to excel pattern.
|
|
154
|
-
* @returns {string}
|
|
166
|
+
* @returns {string} ?
|
|
155
167
|
* @private
|
|
156
168
|
*/
|
|
157
169
|
Internationalization.prototype.getDatePattern = function (option, isExcelFormat) {
|
|
@@ -159,8 +171,10 @@ var Internationalization = /** @class */ (function () {
|
|
|
159
171
|
};
|
|
160
172
|
/**
|
|
161
173
|
* Returns Native Number Pattern
|
|
174
|
+
*
|
|
162
175
|
* @param {NumberFormatOptions} option - Specifies the parse options for resultant number pattern.
|
|
163
|
-
* @
|
|
176
|
+
* @param {boolean} isExcel ?
|
|
177
|
+
* @returns {string} ?
|
|
164
178
|
* @private
|
|
165
179
|
*/
|
|
166
180
|
Internationalization.prototype.getNumberPattern = function (option, isExcel) {
|
|
@@ -168,11 +182,17 @@ var Internationalization = /** @class */ (function () {
|
|
|
168
182
|
};
|
|
169
183
|
/**
|
|
170
184
|
* Returns the First Day of the Week
|
|
171
|
-
*
|
|
185
|
+
*
|
|
186
|
+
* @returns {number} ?
|
|
172
187
|
*/
|
|
173
188
|
Internationalization.prototype.getFirstDayOfWeek = function () {
|
|
174
189
|
return IntlBase.getWeekData(this.getCulture(), cldrData);
|
|
175
190
|
};
|
|
191
|
+
/**
|
|
192
|
+
* Returns the culture
|
|
193
|
+
*
|
|
194
|
+
* @returns {string} ?
|
|
195
|
+
*/
|
|
176
196
|
Internationalization.prototype.getCulture = function () {
|
|
177
197
|
return this.culture || defaultCulture;
|
|
178
198
|
};
|
|
@@ -181,7 +201,9 @@ var Internationalization = /** @class */ (function () {
|
|
|
181
201
|
export { Internationalization };
|
|
182
202
|
/**
|
|
183
203
|
* Set the default culture to all EJ2 components
|
|
204
|
+
*
|
|
184
205
|
* @param {string} cultureName - Specifies the culture name to be set as default culture.
|
|
206
|
+
* @returns {void} ?
|
|
185
207
|
*/
|
|
186
208
|
export function setCulture(cultureName) {
|
|
187
209
|
defaultCulture = cultureName;
|
|
@@ -189,8 +211,9 @@ export function setCulture(cultureName) {
|
|
|
189
211
|
}
|
|
190
212
|
/**
|
|
191
213
|
* Set the default currency code to all EJ2 components
|
|
214
|
+
*
|
|
192
215
|
* @param {string} currencyCode Specifies the culture name to be set as default culture.
|
|
193
|
-
* @returns {void}
|
|
216
|
+
* @returns {void} ?
|
|
194
217
|
*/
|
|
195
218
|
export function setCurrencyCode(currencyCode) {
|
|
196
219
|
defaultCurrencyCode = currencyCode;
|
|
@@ -198,8 +221,9 @@ export function setCurrencyCode(currencyCode) {
|
|
|
198
221
|
}
|
|
199
222
|
/**
|
|
200
223
|
* Load the CLDR data into context
|
|
201
|
-
*
|
|
202
|
-
* @
|
|
224
|
+
*
|
|
225
|
+
* @param {Object[]} data Specifies the CLDR data's to be used for formatting and parser.
|
|
226
|
+
* @returns {void} ?
|
|
203
227
|
*/
|
|
204
228
|
export function loadCldr() {
|
|
205
229
|
var data = [];
|
|
@@ -213,8 +237,9 @@ export function loadCldr() {
|
|
|
213
237
|
}
|
|
214
238
|
/**
|
|
215
239
|
* To enable or disable RTL functionality for all components globally.
|
|
240
|
+
*
|
|
216
241
|
* @param {boolean} status - Optional argument Specifies the status value to enable or disable rtl option.
|
|
217
|
-
* @returns {void}
|
|
242
|
+
* @returns {void} ?
|
|
218
243
|
*/
|
|
219
244
|
export function enableRtl(status) {
|
|
220
245
|
if (status === void 0) { status = true; }
|
|
@@ -223,13 +248,17 @@ export function enableRtl(status) {
|
|
|
223
248
|
}
|
|
224
249
|
/**
|
|
225
250
|
* To get the numeric CLDR object for given culture
|
|
251
|
+
*
|
|
226
252
|
* @param {string} locale - Specifies the locale for which numericObject to be returned.
|
|
253
|
+
* @param {string} type ?
|
|
254
|
+
* @returns {Object} ?
|
|
227
255
|
* @ignore
|
|
228
256
|
* @private
|
|
229
257
|
*/
|
|
230
258
|
export function getNumericObject(locale, type) {
|
|
231
|
-
|
|
259
|
+
// eslint-disable-next-line
|
|
232
260
|
var numObject = IntlBase.getDependables(cldrData, locale, '', true)[mapper[0]];
|
|
261
|
+
// eslint-disable-next-line
|
|
233
262
|
var dateObject = IntlBase.getDependables(cldrData, locale, '')[mapper[1]];
|
|
234
263
|
var numSystem = getValue('defaultNumberingSystem', numObject);
|
|
235
264
|
var symbPattern = isBlazor() ? getValue('numberSymbols', numObject) : getValue('symbols-numberSystem-' + numSystem, numObject);
|
|
@@ -238,20 +267,28 @@ export function getNumericObject(locale, type) {
|
|
|
238
267
|
}
|
|
239
268
|
/**
|
|
240
269
|
* To get the numeric CLDR number base object for given culture
|
|
270
|
+
*
|
|
241
271
|
* @param {string} locale - Specifies the locale for which numericObject to be returned.
|
|
242
272
|
* @param {string} currency - Specifies the currency for which numericObject to be returned.
|
|
273
|
+
* @returns {string} ?
|
|
243
274
|
* @ignore
|
|
244
275
|
* @private
|
|
245
276
|
*/
|
|
246
277
|
export function getNumberDependable(locale, currency) {
|
|
278
|
+
// eslint-disable-next-line
|
|
247
279
|
var numObject = IntlBase.getDependables(cldrData, locale, '', true);
|
|
280
|
+
// eslint-disable-next-line
|
|
248
281
|
return IntlBase.getCurrencySymbol(numObject.numericObject, currency);
|
|
249
282
|
}
|
|
250
283
|
/**
|
|
251
284
|
* To get the default date CLDR object.
|
|
285
|
+
*
|
|
286
|
+
* @param {string} mode ?
|
|
287
|
+
* @returns {Object} ?
|
|
252
288
|
* @ignore
|
|
253
289
|
* @private
|
|
254
290
|
*/
|
|
255
291
|
export function getDefaultDateObject(mode) {
|
|
292
|
+
// eslint-disable-next-line
|
|
256
293
|
return IntlBase.getDependables(cldrData, '', mode, false)[mapper[1]];
|
|
257
294
|
}
|
|
@@ -4,6 +4,7 @@ import { IntlBase as base } from './intl-base';
|
|
|
4
4
|
export declare const basicPatterns: string[];
|
|
5
5
|
/**
|
|
6
6
|
* Interface for Date Format Options Modules.
|
|
7
|
+
*
|
|
7
8
|
* @private
|
|
8
9
|
*/
|
|
9
10
|
export interface FormatOptions {
|
|
@@ -24,32 +25,42 @@ export declare const datePartMatcher: {
|
|
|
24
25
|
};
|
|
25
26
|
/**
|
|
26
27
|
* Date Format is a framework provides support for date formatting.
|
|
28
|
+
*
|
|
27
29
|
* @private
|
|
28
30
|
*/
|
|
29
31
|
export declare class DateFormat {
|
|
30
32
|
/**
|
|
31
33
|
* Returns the formatter function for given skeleton.
|
|
32
|
-
*
|
|
33
|
-
* @param {
|
|
34
|
-
* @param {
|
|
35
|
-
* @
|
|
34
|
+
*
|
|
35
|
+
* @param {string} culture - Specifies the culture name to be which formatting.
|
|
36
|
+
* @param {DateFormatOptions} option - Specific the format in which date will format.
|
|
37
|
+
* @param {Object} cldr - Specifies the global cldr data collection.
|
|
38
|
+
* @returns {Function} ?
|
|
36
39
|
*/
|
|
37
40
|
static dateFormat(culture: string, option: DateFormatOptions, cldr: Object): Function;
|
|
38
41
|
/**
|
|
39
42
|
* Returns formatted date string based on options passed.
|
|
40
|
-
*
|
|
41
|
-
* @param {
|
|
43
|
+
*
|
|
44
|
+
* @param {Date} value ?
|
|
45
|
+
* @param {FormatOptions} options ?
|
|
46
|
+
* @returns {string} ?
|
|
42
47
|
*/
|
|
43
48
|
private static intDateFormatter;
|
|
44
49
|
private static getCurrentDateValue;
|
|
45
50
|
/**
|
|
46
51
|
* Returns two digit numbers for given value and length
|
|
52
|
+
*
|
|
53
|
+
* @param {number} val ?
|
|
54
|
+
* @param {number} len ?
|
|
55
|
+
* @returns {string} ?
|
|
47
56
|
*/
|
|
48
57
|
private static checkTwodigitNumber;
|
|
49
58
|
/**
|
|
50
59
|
* Returns the value of the Time Zone.
|
|
51
|
-
*
|
|
52
|
-
* @param {
|
|
60
|
+
*
|
|
61
|
+
* @param {number} tVal ?
|
|
62
|
+
* @param {string} pattern ?
|
|
63
|
+
* @returns {string} ?
|
|
53
64
|
* @private
|
|
54
65
|
*/
|
|
55
66
|
static getTimeZoneValue(tVal: number, pattern: string): string;
|
|
@@ -36,6 +36,7 @@ var timeSeparator = 'timeSeparator';
|
|
|
36
36
|
/* tslint:disable no-any */
|
|
37
37
|
/**
|
|
38
38
|
* Date Format is a framework provides support for date formatting.
|
|
39
|
+
*
|
|
39
40
|
* @private
|
|
40
41
|
*/
|
|
41
42
|
var DateFormat = /** @class */ (function () {
|
|
@@ -43,10 +44,11 @@ var DateFormat = /** @class */ (function () {
|
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
46
|
* Returns the formatter function for given skeleton.
|
|
46
|
-
*
|
|
47
|
-
* @param {
|
|
48
|
-
* @param {
|
|
49
|
-
* @
|
|
47
|
+
*
|
|
48
|
+
* @param {string} culture - Specifies the culture name to be which formatting.
|
|
49
|
+
* @param {DateFormatOptions} option - Specific the format in which date will format.
|
|
50
|
+
* @param {Object} cldr - Specifies the global cldr data collection.
|
|
51
|
+
* @returns {Function} ?
|
|
50
52
|
*/
|
|
51
53
|
DateFormat.dateFormat = function (culture, option, cldr) {
|
|
52
54
|
var _this = this;
|
|
@@ -79,24 +81,26 @@ var DateFormat = /** @class */ (function () {
|
|
|
79
81
|
if (char === 'K') {
|
|
80
82
|
char = 'h';
|
|
81
83
|
}
|
|
82
|
-
/* tslint:disable no-any */
|
|
83
|
-
var charKey = datePartMatcher[char];
|
|
84
84
|
switch (char) {
|
|
85
85
|
case 'E':
|
|
86
86
|
case 'c':
|
|
87
87
|
if (isBlazor()) {
|
|
88
|
+
// eslint-disable-next-line
|
|
88
89
|
formatOptions.weekday = getValue('days.' + base.monthIndex[len], dateObject);
|
|
89
90
|
}
|
|
90
91
|
else {
|
|
92
|
+
// eslint-disable-next-line
|
|
91
93
|
formatOptions.weekday = dependable.dateObject[base.days][standalone][base.monthIndex[len]];
|
|
92
94
|
}
|
|
93
95
|
break;
|
|
94
96
|
case 'M':
|
|
95
97
|
case 'L':
|
|
96
98
|
if (isBlazor()) {
|
|
99
|
+
// eslint-disable-next-line
|
|
97
100
|
formatOptions.month = getValue('months.' + base.monthIndex[len], dateObject);
|
|
98
101
|
}
|
|
99
102
|
else {
|
|
103
|
+
// eslint-disable-next-line
|
|
100
104
|
formatOptions.month = dependable.dateObject[base.month][standalone][base.monthIndex[len]];
|
|
101
105
|
}
|
|
102
106
|
break;
|
|
@@ -105,6 +109,7 @@ var DateFormat = /** @class */ (function () {
|
|
|
105
109
|
getValue('dayPeriods', dateObject) : getValue('dayPeriods.format.wide', dateObject);
|
|
106
110
|
break;
|
|
107
111
|
case 'G':
|
|
112
|
+
// eslint-disable-next-line
|
|
108
113
|
var eText = (len <= 3) ? 'eraAbbr' : (len === 4) ? 'eraNames' : 'eraNarrow';
|
|
109
114
|
formatOptions.era = isBlazor() ? getValue('eras', dateObject) : getValue('eras.' + eText, dependable.dateObject);
|
|
110
115
|
break;
|
|
@@ -123,10 +128,11 @@ var DateFormat = /** @class */ (function () {
|
|
|
123
128
|
};
|
|
124
129
|
/**
|
|
125
130
|
* Returns formatted date string based on options passed.
|
|
126
|
-
*
|
|
127
|
-
* @param {
|
|
131
|
+
*
|
|
132
|
+
* @param {Date} value ?
|
|
133
|
+
* @param {FormatOptions} options ?
|
|
134
|
+
* @returns {string} ?
|
|
128
135
|
*/
|
|
129
|
-
// tslint:disable-next-line:max-func-body-length
|
|
130
136
|
DateFormat.intDateFormatter = function (value, options) {
|
|
131
137
|
var pattern = options.pattern;
|
|
132
138
|
var ret = '';
|
|
@@ -149,6 +155,7 @@ var DateFormat = /** @class */ (function () {
|
|
|
149
155
|
case 'L':
|
|
150
156
|
curval = dObject.month;
|
|
151
157
|
if (length_1 > 2) {
|
|
158
|
+
// eslint-disable-next-line
|
|
152
159
|
ret += options.month[curval];
|
|
153
160
|
}
|
|
154
161
|
else {
|
|
@@ -157,6 +164,7 @@ var DateFormat = /** @class */ (function () {
|
|
|
157
164
|
break;
|
|
158
165
|
case 'E':
|
|
159
166
|
case 'c':
|
|
167
|
+
// eslint-disable-next-line
|
|
160
168
|
ret += options.weekday[weekdayKey[value.getDay()]];
|
|
161
169
|
break;
|
|
162
170
|
case 'H':
|
|
@@ -172,6 +180,7 @@ var DateFormat = /** @class */ (function () {
|
|
|
172
180
|
else if (char === 'f') {
|
|
173
181
|
isNumber = false;
|
|
174
182
|
processNumber = true;
|
|
183
|
+
// eslint-disable-next-line
|
|
175
184
|
curvalstr = value[timeSetter[char]]().toString();
|
|
176
185
|
curvalstr = curvalstr.substring(0, length_1);
|
|
177
186
|
var curlength = curvalstr.length;
|
|
@@ -186,6 +195,7 @@ var DateFormat = /** @class */ (function () {
|
|
|
186
195
|
curstr += curvalstr;
|
|
187
196
|
}
|
|
188
197
|
else {
|
|
198
|
+
// eslint-disable-next-line
|
|
189
199
|
curval = value[timeSetter[char]]();
|
|
190
200
|
}
|
|
191
201
|
if (char === 'h') {
|
|
@@ -200,22 +210,29 @@ var DateFormat = /** @class */ (function () {
|
|
|
200
210
|
}
|
|
201
211
|
break;
|
|
202
212
|
case 'a':
|
|
213
|
+
// eslint-disable-next-line
|
|
203
214
|
var desig = value.getHours() < 12 ? 'am' : 'pm';
|
|
215
|
+
// eslint-disable-next-line
|
|
204
216
|
ret += options.designator[desig];
|
|
205
217
|
break;
|
|
206
218
|
case 'G':
|
|
219
|
+
// eslint-disable-next-line
|
|
207
220
|
var dec = value.getFullYear() < 0 ? 0 : 1;
|
|
221
|
+
// eslint-disable-next-line
|
|
208
222
|
var retu = options.era[dec];
|
|
209
223
|
if (isNullOrUndefined(retu)) {
|
|
224
|
+
// eslint-disable-next-line
|
|
210
225
|
retu = options.era[dec ? 0 : 1];
|
|
211
226
|
}
|
|
212
227
|
ret += retu || '';
|
|
213
228
|
break;
|
|
214
229
|
case '\'':
|
|
215
|
-
ret += (match === '\'\'') ? '\'' : match.replace(
|
|
230
|
+
ret += (match === '\'\'') ? '\'' : match.replace(/'/g, '');
|
|
216
231
|
break;
|
|
217
232
|
case 'z':
|
|
233
|
+
// eslint-disable-next-line
|
|
218
234
|
var timezone = value.getTimezoneOffset();
|
|
235
|
+
// eslint-disable-next-line
|
|
219
236
|
var pattern_1 = (length_1 < 4) ? '+H;-H' : options.timeZone.hourFormat;
|
|
220
237
|
pattern_1 = pattern_1.replace(/:/g, options.numMapper.timeSeparator);
|
|
221
238
|
if (timezone === 0) {
|
|
@@ -228,8 +245,8 @@ var DateFormat = /** @class */ (function () {
|
|
|
228
245
|
curstr = options.timeZone.gmtFormat.replace(/\{0\}/, curstr);
|
|
229
246
|
break;
|
|
230
247
|
case ':':
|
|
248
|
+
// eslint-disable-next-line
|
|
231
249
|
ret += options.numMapper.numberSymbols[timeSeparator];
|
|
232
|
-
/* tslint:enable no-any */
|
|
233
250
|
break;
|
|
234
251
|
case '/':
|
|
235
252
|
ret += options.dateSeperator;
|
|
@@ -259,6 +276,10 @@ var DateFormat = /** @class */ (function () {
|
|
|
259
276
|
};
|
|
260
277
|
/**
|
|
261
278
|
* Returns two digit numbers for given value and length
|
|
279
|
+
*
|
|
280
|
+
* @param {number} val ?
|
|
281
|
+
* @param {number} len ?
|
|
282
|
+
* @returns {string} ?
|
|
262
283
|
*/
|
|
263
284
|
DateFormat.checkTwodigitNumber = function (val, len) {
|
|
264
285
|
var ret = val + '';
|
|
@@ -269,8 +290,10 @@ var DateFormat = /** @class */ (function () {
|
|
|
269
290
|
};
|
|
270
291
|
/**
|
|
271
292
|
* Returns the value of the Time Zone.
|
|
272
|
-
*
|
|
273
|
-
* @param {
|
|
293
|
+
*
|
|
294
|
+
* @param {number} tVal ?
|
|
295
|
+
* @param {string} pattern ?
|
|
296
|
+
* @returns {string} ?
|
|
274
297
|
* @private
|
|
275
298
|
*/
|
|
276
299
|
DateFormat.getTimeZoneValue = function (tVal, pattern) {
|
|
@@ -1,54 +1,61 @@
|
|
|
1
1
|
import { DateFormatOptions } from '../internationalization';
|
|
2
2
|
/**
|
|
3
3
|
* Date Parser.
|
|
4
|
+
*
|
|
4
5
|
* @private
|
|
5
6
|
*/
|
|
6
7
|
export declare class DateParser {
|
|
7
8
|
/**
|
|
8
9
|
* Returns the parser function for given skeleton.
|
|
9
|
-
*
|
|
10
|
-
* @param {
|
|
11
|
-
* @param {
|
|
12
|
-
*
|
|
10
|
+
*
|
|
11
|
+
* @param {string} culture - Specifies the culture name to be which formatting.
|
|
12
|
+
* @param {DateFormatOptions} option - Specific the format in which string date will be parsed.
|
|
13
|
+
* @param {Object} cldr - Specifies the global cldr data collection.
|
|
14
|
+
* @returns {Function} ?
|
|
13
15
|
*/
|
|
14
16
|
static dateParser(culture: string, option: DateFormatOptions, cldr: Object): Function;
|
|
15
17
|
/**
|
|
16
18
|
* Returns date object for provided date options
|
|
17
|
-
*
|
|
18
|
-
* @param {
|
|
19
|
-
* @
|
|
19
|
+
*
|
|
20
|
+
* @param {DateParts} options ?
|
|
21
|
+
* @param {Date} value ?
|
|
22
|
+
* @returns {Date} ?
|
|
20
23
|
*/
|
|
21
24
|
private static getDateObject;
|
|
22
25
|
/**
|
|
23
26
|
* Returns date parsing options for provided value along with parse and numeric options
|
|
24
|
-
*
|
|
25
|
-
* @param {
|
|
26
|
-
* @param {
|
|
27
|
-
* @
|
|
27
|
+
*
|
|
28
|
+
* @param {string} value ?
|
|
29
|
+
* @param {ParseOptions} parseOptions ?
|
|
30
|
+
* @param {NumericOptions} num ?
|
|
31
|
+
* @returns {DateParts} ?
|
|
28
32
|
*/
|
|
29
33
|
private static internalDateParse;
|
|
30
34
|
/**
|
|
31
35
|
* Returns parsed number for provided Numeric string and Numeric Options
|
|
32
|
-
*
|
|
33
|
-
* @param {
|
|
34
|
-
* @
|
|
36
|
+
*
|
|
37
|
+
* @param {string} value ?
|
|
38
|
+
* @param {NumericOptions} option ?
|
|
39
|
+
* @returns {number} ?
|
|
35
40
|
*/
|
|
36
41
|
private static internalNumberParser;
|
|
37
42
|
/**
|
|
38
43
|
* Returns parsed time zone RegExp for provided hour format and time zone
|
|
39
|
-
*
|
|
40
|
-
* @param {
|
|
41
|
-
* @param {
|
|
42
|
-
* @
|
|
44
|
+
*
|
|
45
|
+
* @param {string} hourFormat ?
|
|
46
|
+
* @param {base.TimeZoneOptions} tZone ?
|
|
47
|
+
* @param {string} nRegex ?
|
|
48
|
+
* @returns {string} ?
|
|
43
49
|
*/
|
|
44
50
|
private static parseTimeZoneRegx;
|
|
45
51
|
/**
|
|
46
52
|
* Returns zone based value.
|
|
47
|
-
*
|
|
48
|
-
* @param {
|
|
49
|
-
* @param {string}
|
|
50
|
-
* @param {
|
|
51
|
-
* @
|
|
53
|
+
*
|
|
54
|
+
* @param {boolean} flag ?
|
|
55
|
+
* @param {string} val1 ?
|
|
56
|
+
* @param {string} val2 ?
|
|
57
|
+
* @param {NumericOptions} num ?
|
|
58
|
+
* @returns {number} ?
|
|
52
59
|
*/
|
|
53
60
|
private static getZoneValue;
|
|
54
61
|
}
|