@progress/kendo-angular-intl 19.1.1-develop.2 → 19.1.2-develop.1
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/date.pipe.d.ts +4 -4
- package/directives.d.ts +3 -3
- package/esm2022/date.pipe.mjs +4 -4
- package/esm2022/directives.mjs +3 -3
- package/esm2022/intl-members.mjs +14 -3
- package/esm2022/intl.service.mjs +42 -35
- package/esm2022/number.pipe.mjs +4 -4
- package/esm2022/package-metadata.mjs +2 -2
- package/fesm2022/progress-kendo-angular-intl.mjs +69 -51
- package/intl-members.d.ts +14 -3
- package/intl.service.d.ts +68 -61
- package/locale-data.interface.d.ts +13 -13
- package/number.pipe.d.ts +4 -4
- package/package.json +4 -4
package/date.pipe.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
* This pipe uses the [IntlService]({% slug api_intl_intlservice %}).
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
|
-
* ```
|
|
14
|
+
* ```html
|
|
15
15
|
* <ul>
|
|
16
16
|
* <li>{{date | kendoDate }}</li>
|
|
17
17
|
* <li>{{milliseconds | kendoDate: 'M/dd/yyy' }}</li>
|
|
@@ -30,9 +30,9 @@ export declare class DatePipe implements PipeTransform {
|
|
|
30
30
|
* If no format is provided, the default short date format is used.
|
|
31
31
|
*
|
|
32
32
|
* @param value - The date to format.
|
|
33
|
-
* @param format - The format string or options.
|
|
34
|
-
* @param localeId -
|
|
35
|
-
* @
|
|
33
|
+
* @param format - The format string or options (optional).
|
|
34
|
+
* @param localeId - The ID of the locale which will be used instead of the default one (optional).
|
|
35
|
+
* @returns The formatted date as a string.
|
|
36
36
|
*/
|
|
37
37
|
transform(value: any, format?: string | DateFormatOptions, localeId?: string): any;
|
|
38
38
|
private normalize;
|
package/directives.d.ts
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import { DatePipe } from "./date.pipe";
|
|
6
6
|
import { NumberPipe } from "./number.pipe";
|
|
7
7
|
/**
|
|
8
|
-
* Utility array that contains all `kendoNumber` related components and directives
|
|
8
|
+
* Utility array that contains all `kendoNumber` related components and directives.
|
|
9
9
|
*/
|
|
10
10
|
export declare const KENDO_NUMBER: readonly [typeof NumberPipe];
|
|
11
11
|
/**
|
|
12
|
-
* Utility array that contains all `kendoDate` related components and directives
|
|
12
|
+
* Utility array that contains all `kendoDate` related components and directives.
|
|
13
13
|
*/
|
|
14
14
|
export declare const KENDO_DATE: readonly [typeof DatePipe];
|
|
15
15
|
/**
|
|
16
|
-
* Utility array that contains all `@progress/kendo-angular-intl` related components and directives
|
|
16
|
+
* Utility array that contains all `@progress/kendo-angular-intl` related components and directives.
|
|
17
17
|
*/
|
|
18
18
|
export declare const KENDO_INTL: readonly [typeof NumberPipe, typeof DatePipe];
|
package/esm2022/date.pipe.mjs
CHANGED
|
@@ -12,7 +12,7 @@ const isNumeric = (value) => !isNaN(value - parseFloat(value));
|
|
|
12
12
|
* This pipe uses the [IntlService]({% slug api_intl_intlservice %}).
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
|
-
* ```
|
|
15
|
+
* ```html
|
|
16
16
|
* <ul>
|
|
17
17
|
* <li>{{date | kendoDate }}</li>
|
|
18
18
|
* <li>{{milliseconds | kendoDate: 'M/dd/yyy' }}</li>
|
|
@@ -33,9 +33,9 @@ export class DatePipe {
|
|
|
33
33
|
* If no format is provided, the default short date format is used.
|
|
34
34
|
*
|
|
35
35
|
* @param value - The date to format.
|
|
36
|
-
* @param format - The format string or options.
|
|
37
|
-
* @param localeId -
|
|
38
|
-
* @
|
|
36
|
+
* @param format - The format string or options (optional).
|
|
37
|
+
* @param localeId - The ID of the locale which will be used instead of the default one (optional).
|
|
38
|
+
* @returns The formatted date as a string.
|
|
39
39
|
*/
|
|
40
40
|
transform(value, format = "", localeId) {
|
|
41
41
|
value = this.normalize(value);
|
package/esm2022/directives.mjs
CHANGED
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
import { DatePipe } from "./date.pipe";
|
|
6
6
|
import { NumberPipe } from "./number.pipe";
|
|
7
7
|
/**
|
|
8
|
-
* Utility array that contains all `kendoNumber` related components and directives
|
|
8
|
+
* Utility array that contains all `kendoNumber` related components and directives.
|
|
9
9
|
*/
|
|
10
10
|
export const KENDO_NUMBER = [
|
|
11
11
|
NumberPipe
|
|
12
12
|
];
|
|
13
13
|
/**
|
|
14
|
-
* Utility array that contains all `kendoDate` related components and directives
|
|
14
|
+
* Utility array that contains all `kendoDate` related components and directives.
|
|
15
15
|
*/
|
|
16
16
|
export const KENDO_DATE = [
|
|
17
17
|
DatePipe
|
|
18
18
|
];
|
|
19
19
|
/**
|
|
20
|
-
* Utility array that contains all `@progress/kendo-angular-intl` related components and directives
|
|
20
|
+
* Utility array that contains all `@progress/kendo-angular-intl` related components and directives.
|
|
21
21
|
*/
|
|
22
22
|
export const KENDO_INTL = [
|
|
23
23
|
...KENDO_NUMBER,
|
package/esm2022/intl-members.mjs
CHANGED
|
@@ -21,6 +21,17 @@ function intlMethod(fn) {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Wraps Kendo Intl methods to provide enhanced error handling and documentation for the Kendo Angular Intl package.
|
|
26
|
+
*
|
|
27
|
+
* Includes utility functions for formatting, parsing, and retrieving locale data, as well as error message enhancements.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { formatDate, parseNumber, localeData } from '@progress/kendo-angular-intl';
|
|
32
|
+
* const formatted = formatDate(new Date(), { date: 'short' });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
24
35
|
/**
|
|
25
36
|
* @hidden
|
|
26
37
|
*/
|
|
@@ -76,14 +87,14 @@ export const weekendRange = intlMethod(intl.weekendRange);
|
|
|
76
87
|
/**
|
|
77
88
|
* Sets a pre-built locale.
|
|
78
89
|
*
|
|
79
|
-
* @
|
|
90
|
+
* @param data - The pre-built locale data.
|
|
80
91
|
*/
|
|
81
92
|
export const setData = (data) => intl.setData(data);
|
|
82
93
|
/**
|
|
83
94
|
* Retrieves the locale data for the specified locale.
|
|
84
95
|
*
|
|
85
|
-
* @
|
|
86
|
-
* @returns
|
|
96
|
+
* @param locale - The locale ID.
|
|
97
|
+
* @returns The locale data.
|
|
87
98
|
*/
|
|
88
99
|
export const localeData = (locale) => {
|
|
89
100
|
try {
|
package/esm2022/intl.service.mjs
CHANGED
|
@@ -15,9 +15,10 @@ export function cldrServiceFactory(localeId) {
|
|
|
15
15
|
return new CldrIntlService(localeId);
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* the
|
|
20
|
-
*
|
|
18
|
+
* Represents the abstract base class for the Kendo UI for Angular Internationalization service.
|
|
19
|
+
* Provides methods for formatting and parsing dates, numbers, and strings according to the current locale.
|
|
20
|
+
*
|
|
21
|
+
* Extend this class to implement custom internationalization logic or use the default CLDR-based implementation.
|
|
21
22
|
*/
|
|
22
23
|
export class IntlService {
|
|
23
24
|
/**
|
|
@@ -31,7 +32,7 @@ export class IntlService {
|
|
|
31
32
|
validatePackage(packageMetadata);
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
|
-
*
|
|
35
|
+
* Specifies that the service was changed.
|
|
35
36
|
*/
|
|
36
37
|
notify() {
|
|
37
38
|
this.changes.emit();
|
|
@@ -48,13 +49,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
48
49
|
}]
|
|
49
50
|
}], ctorParameters: function () { return []; } });
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
52
|
+
* Represents the Internationalization service implemented using the CLDR Database via the `@progress/kendo-intl` package.
|
|
53
|
+
* Provides locale-aware formatting and parsing for dates, numbers, and strings.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* import { CldrIntlService } from '@progress/kendo-angular-intl';
|
|
58
|
+
* const intl = new CldrIntlService('en-US');
|
|
59
|
+
* intl.formatDate(new Date(), { date: 'short' });
|
|
60
|
+
* ```
|
|
53
61
|
*/
|
|
54
62
|
export class CldrIntlService extends IntlService {
|
|
55
63
|
locale;
|
|
56
64
|
/**
|
|
57
|
-
*
|
|
65
|
+
* Specifies or gets the current locale ID.
|
|
58
66
|
*/
|
|
59
67
|
get localeId() {
|
|
60
68
|
return this.locale;
|
|
@@ -87,7 +95,7 @@ export class CldrIntlService extends IntlService {
|
|
|
87
95
|
*
|
|
88
96
|
* @param format - The format string.
|
|
89
97
|
* @param values - One or more values to output in the format string placeholders.
|
|
90
|
-
* @
|
|
98
|
+
* @returns The formatted string.
|
|
91
99
|
*/
|
|
92
100
|
format(format, ...values) {
|
|
93
101
|
return intlFormat(format, values, this.localeId);
|
|
@@ -97,8 +105,8 @@ export class CldrIntlService extends IntlService {
|
|
|
97
105
|
*
|
|
98
106
|
* @param value - The value to format.
|
|
99
107
|
* @param format - The format to use.
|
|
100
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
101
|
-
* @
|
|
108
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
109
|
+
* @returns The formatted object as a string.
|
|
102
110
|
*/
|
|
103
111
|
toString(value, format, localeId) {
|
|
104
112
|
return toString(value, format, localeId || this.localeId);
|
|
@@ -108,9 +116,9 @@ export class CldrIntlService extends IntlService {
|
|
|
108
116
|
* If no format is provided, the default short date format is used.
|
|
109
117
|
*
|
|
110
118
|
* @param value - The date to format.
|
|
111
|
-
* @param format - The format string or options.
|
|
112
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
113
|
-
* @
|
|
119
|
+
* @param format - The format string or options (optional).
|
|
120
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
121
|
+
* @returns The formatted date as a string.
|
|
114
122
|
*/
|
|
115
123
|
formatDate(value, format, localeId) {
|
|
116
124
|
return formatDate(value, format, localeId || this.localeId);
|
|
@@ -119,9 +127,9 @@ export class CldrIntlService extends IntlService {
|
|
|
119
127
|
* Converts a string into a `Date` object based on the specified format.
|
|
120
128
|
*
|
|
121
129
|
* @param value - The string to convert.
|
|
122
|
-
* @param format - The format strings or options.
|
|
123
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
124
|
-
* @
|
|
130
|
+
* @param format - The format strings or options (optional).
|
|
131
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
132
|
+
* @returns The parsed date.
|
|
125
133
|
*/
|
|
126
134
|
parseDate(value, format, localeId) {
|
|
127
135
|
return parseDate(value, format, localeId || this.localeId);
|
|
@@ -130,9 +138,9 @@ export class CldrIntlService extends IntlService {
|
|
|
130
138
|
* Converts a string into a `Number`.
|
|
131
139
|
*
|
|
132
140
|
* @param value - The string to convert.
|
|
133
|
-
* @param format - The format string or options.
|
|
134
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
135
|
-
* @
|
|
141
|
+
* @param format - The format string or options (optional).
|
|
142
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
143
|
+
* @returns The parsed number.
|
|
136
144
|
*/
|
|
137
145
|
parseNumber(value, format, localeId) {
|
|
138
146
|
return parseNumber(value, localeId || this.localeId, format);
|
|
@@ -142,8 +150,8 @@ export class CldrIntlService extends IntlService {
|
|
|
142
150
|
*
|
|
143
151
|
* @param value - The number to format.
|
|
144
152
|
* @param format - The format string or options.
|
|
145
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
146
|
-
* @
|
|
153
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
154
|
+
* @returns The formatted number as a string.
|
|
147
155
|
*/
|
|
148
156
|
formatNumber(value, format, localeId) {
|
|
149
157
|
return formatNumber(value, format, localeId || this.localeId);
|
|
@@ -170,9 +178,8 @@ export class CldrIntlService extends IntlService {
|
|
|
170
178
|
* - `short`
|
|
171
179
|
*
|
|
172
180
|
* @param options - Detailed configuration for the desired date field name.
|
|
173
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
174
|
-
* @
|
|
175
|
-
* @returns The localized date field name from the current locale based on the option.
|
|
181
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
182
|
+
* @returns The day names from the current locale based on the option.
|
|
176
183
|
*
|
|
177
184
|
* @example
|
|
178
185
|
* ```ts
|
|
@@ -186,7 +193,7 @@ export class CldrIntlService extends IntlService {
|
|
|
186
193
|
return dateFieldName(options, localeId || this.localeId);
|
|
187
194
|
}
|
|
188
195
|
/**
|
|
189
|
-
* Returns a localized date field name based on specific dateFieldName options.
|
|
196
|
+
* Returns a localized date field name based on specific `dateFieldName` options.
|
|
190
197
|
*
|
|
191
198
|
* The available type values are:
|
|
192
199
|
* - `day`
|
|
@@ -196,8 +203,8 @@ export class CldrIntlService extends IntlService {
|
|
|
196
203
|
* - `eras`
|
|
197
204
|
*
|
|
198
205
|
* @param options - Detailed configuration for the desired date format.
|
|
199
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
200
|
-
* @
|
|
206
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
207
|
+
* @returns The day names from the current locale based on the option.
|
|
201
208
|
*/
|
|
202
209
|
dateFormatNames(options, localeId) {
|
|
203
210
|
return dateFormatNames(localeId || this.localeId, options);
|
|
@@ -205,8 +212,8 @@ export class CldrIntlService extends IntlService {
|
|
|
205
212
|
/**
|
|
206
213
|
* Splits the date format into objects containing information about each part of the pattern.
|
|
207
214
|
*
|
|
208
|
-
* @param format The format string or options.
|
|
209
|
-
* @param localeId The
|
|
215
|
+
* @param format - The format string or options.
|
|
216
|
+
* @param localeId - The locale ID to use (optional). If not specified, the `"en"` locale ID is used.
|
|
210
217
|
* @returns The date format parts.
|
|
211
218
|
*/
|
|
212
219
|
splitDateFormat(format, localeId) {
|
|
@@ -215,8 +222,8 @@ export class CldrIntlService extends IntlService {
|
|
|
215
222
|
/**
|
|
216
223
|
* Returns the number symbols from the current locale based on the option.
|
|
217
224
|
*
|
|
218
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
219
|
-
* @
|
|
225
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
226
|
+
* @returns The number symbols from the current locale.
|
|
220
227
|
*/
|
|
221
228
|
numberSymbols(localeId) {
|
|
222
229
|
return numberSymbols(localeId || this.localeId);
|
|
@@ -224,8 +231,8 @@ export class CldrIntlService extends IntlService {
|
|
|
224
231
|
/**
|
|
225
232
|
* Returns the first day index starting from Sunday.
|
|
226
233
|
*
|
|
227
|
-
* @param localeId - The locale ID. Defaults to the current locale ID.
|
|
228
|
-
* @
|
|
234
|
+
* @param localeId - The locale ID (optional). Defaults to the current locale ID.
|
|
235
|
+
* @returns The index of the first day of the week (0 == Sunday).
|
|
229
236
|
*/
|
|
230
237
|
firstDay(localeId) {
|
|
231
238
|
return firstDay(localeId || this.localeId);
|
|
@@ -233,8 +240,8 @@ export class CldrIntlService extends IntlService {
|
|
|
233
240
|
/**
|
|
234
241
|
* Returns the start and end index of the locale weekend starting from Sunday.
|
|
235
242
|
*
|
|
236
|
-
* @param localeId - The locale ID. Defaults to the current locale ID.
|
|
237
|
-
* @
|
|
243
|
+
* @param localeId - The locale ID (optional). Defaults to the current locale ID.
|
|
244
|
+
* @returns The start and end index of the locale weekend (0 == Sunday).
|
|
238
245
|
*/
|
|
239
246
|
weekendRange(localeId) {
|
|
240
247
|
return weekendRange(localeId || this.localeId);
|
package/esm2022/number.pipe.mjs
CHANGED
|
@@ -32,10 +32,10 @@ export class NumberPipe {
|
|
|
32
32
|
* If no format is provided, the value is formatted as decimal number using the
|
|
33
33
|
* [`"n"`](https://github.com/telerik/kendo-intl/blob/master/docs/num-formatting/index.md#standard) format.
|
|
34
34
|
*
|
|
35
|
-
* @param value - The
|
|
36
|
-
* @param format - The format string or options.
|
|
37
|
-
* @param localeId -
|
|
38
|
-
* @
|
|
35
|
+
* @param value - The number that will be formatted.
|
|
36
|
+
* @param format - The format string or options (optional).
|
|
37
|
+
* @param localeId - The locale ID that will be used in place of the default one (optional).
|
|
38
|
+
* @returns The formatted number as a string.
|
|
39
39
|
*/
|
|
40
40
|
transform(value, format, localeId) {
|
|
41
41
|
if (typeof value === 'string') {
|
|
@@ -10,7 +10,7 @@ export const packageMetadata = {
|
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCode: 'KENDOUIANGULAR',
|
|
12
12
|
productCodes: ['KENDOUIANGULAR'],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: '19.1.
|
|
13
|
+
publishDate: 1749804072,
|
|
14
|
+
version: '19.1.2-develop.1',
|
|
15
15
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
16
16
|
};
|
|
@@ -15,8 +15,8 @@ const packageMetadata = {
|
|
|
15
15
|
productName: 'Kendo UI for Angular',
|
|
16
16
|
productCode: 'KENDOUIANGULAR',
|
|
17
17
|
productCodes: ['KENDOUIANGULAR'],
|
|
18
|
-
publishDate:
|
|
19
|
-
version: '19.1.
|
|
18
|
+
publishDate: 1749804072,
|
|
19
|
+
version: '19.1.2-develop.1',
|
|
20
20
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -53,6 +53,17 @@ function intlMethod(fn) {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Wraps Kendo Intl methods to provide enhanced error handling and documentation for the Kendo Angular Intl package.
|
|
58
|
+
*
|
|
59
|
+
* Includes utility functions for formatting, parsing, and retrieving locale data, as well as error message enhancements.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* import { formatDate, parseNumber, localeData } from '@progress/kendo-angular-intl';
|
|
64
|
+
* const formatted = formatDate(new Date(), { date: 'short' });
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
56
67
|
/**
|
|
57
68
|
* @hidden
|
|
58
69
|
*/
|
|
@@ -108,14 +119,14 @@ const weekendRange = intlMethod(intl.weekendRange);
|
|
|
108
119
|
/**
|
|
109
120
|
* Sets a pre-built locale.
|
|
110
121
|
*
|
|
111
|
-
* @
|
|
122
|
+
* @param data - The pre-built locale data.
|
|
112
123
|
*/
|
|
113
124
|
const setData = (data) => intl.setData(data);
|
|
114
125
|
/**
|
|
115
126
|
* Retrieves the locale data for the specified locale.
|
|
116
127
|
*
|
|
117
|
-
* @
|
|
118
|
-
* @returns
|
|
128
|
+
* @param locale - The locale ID.
|
|
129
|
+
* @returns The locale data.
|
|
119
130
|
*/
|
|
120
131
|
const localeData = (locale) => {
|
|
121
132
|
try {
|
|
@@ -135,9 +146,10 @@ function cldrServiceFactory(localeId) {
|
|
|
135
146
|
return new CldrIntlService(localeId);
|
|
136
147
|
}
|
|
137
148
|
/**
|
|
138
|
-
*
|
|
139
|
-
* the
|
|
140
|
-
*
|
|
149
|
+
* Represents the abstract base class for the Kendo UI for Angular Internationalization service.
|
|
150
|
+
* Provides methods for formatting and parsing dates, numbers, and strings according to the current locale.
|
|
151
|
+
*
|
|
152
|
+
* Extend this class to implement custom internationalization logic or use the default CLDR-based implementation.
|
|
141
153
|
*/
|
|
142
154
|
class IntlService {
|
|
143
155
|
/**
|
|
@@ -151,7 +163,7 @@ class IntlService {
|
|
|
151
163
|
validatePackage(packageMetadata);
|
|
152
164
|
}
|
|
153
165
|
/**
|
|
154
|
-
*
|
|
166
|
+
* Specifies that the service was changed.
|
|
155
167
|
*/
|
|
156
168
|
notify() {
|
|
157
169
|
this.changes.emit();
|
|
@@ -168,13 +180,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
168
180
|
}]
|
|
169
181
|
}], ctorParameters: function () { return []; } });
|
|
170
182
|
/**
|
|
171
|
-
*
|
|
172
|
-
*
|
|
183
|
+
* Represents the Internationalization service implemented using the CLDR Database via the `@progress/kendo-intl` package.
|
|
184
|
+
* Provides locale-aware formatting and parsing for dates, numbers, and strings.
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```ts
|
|
188
|
+
* import { CldrIntlService } from '@progress/kendo-angular-intl';
|
|
189
|
+
* const intl = new CldrIntlService('en-US');
|
|
190
|
+
* intl.formatDate(new Date(), { date: 'short' });
|
|
191
|
+
* ```
|
|
173
192
|
*/
|
|
174
193
|
class CldrIntlService extends IntlService {
|
|
175
194
|
locale;
|
|
176
195
|
/**
|
|
177
|
-
*
|
|
196
|
+
* Specifies or gets the current locale ID.
|
|
178
197
|
*/
|
|
179
198
|
get localeId() {
|
|
180
199
|
return this.locale;
|
|
@@ -207,7 +226,7 @@ class CldrIntlService extends IntlService {
|
|
|
207
226
|
*
|
|
208
227
|
* @param format - The format string.
|
|
209
228
|
* @param values - One or more values to output in the format string placeholders.
|
|
210
|
-
* @
|
|
229
|
+
* @returns The formatted string.
|
|
211
230
|
*/
|
|
212
231
|
format(format$1, ...values) {
|
|
213
232
|
return format(format$1, values, this.localeId);
|
|
@@ -217,8 +236,8 @@ class CldrIntlService extends IntlService {
|
|
|
217
236
|
*
|
|
218
237
|
* @param value - The value to format.
|
|
219
238
|
* @param format - The format to use.
|
|
220
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
221
|
-
* @
|
|
239
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
240
|
+
* @returns The formatted object as a string.
|
|
222
241
|
*/
|
|
223
242
|
toString(value, format, localeId) {
|
|
224
243
|
return toString(value, format, localeId || this.localeId);
|
|
@@ -228,9 +247,9 @@ class CldrIntlService extends IntlService {
|
|
|
228
247
|
* If no format is provided, the default short date format is used.
|
|
229
248
|
*
|
|
230
249
|
* @param value - The date to format.
|
|
231
|
-
* @param format - The format string or options.
|
|
232
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
233
|
-
* @
|
|
250
|
+
* @param format - The format string or options (optional).
|
|
251
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
252
|
+
* @returns The formatted date as a string.
|
|
234
253
|
*/
|
|
235
254
|
formatDate(value, format, localeId) {
|
|
236
255
|
return formatDate(value, format, localeId || this.localeId);
|
|
@@ -239,9 +258,9 @@ class CldrIntlService extends IntlService {
|
|
|
239
258
|
* Converts a string into a `Date` object based on the specified format.
|
|
240
259
|
*
|
|
241
260
|
* @param value - The string to convert.
|
|
242
|
-
* @param format - The format strings or options.
|
|
243
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
244
|
-
* @
|
|
261
|
+
* @param format - The format strings or options (optional).
|
|
262
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
263
|
+
* @returns The parsed date.
|
|
245
264
|
*/
|
|
246
265
|
parseDate(value, format, localeId) {
|
|
247
266
|
return parseDate(value, format, localeId || this.localeId);
|
|
@@ -250,9 +269,9 @@ class CldrIntlService extends IntlService {
|
|
|
250
269
|
* Converts a string into a `Number`.
|
|
251
270
|
*
|
|
252
271
|
* @param value - The string to convert.
|
|
253
|
-
* @param format - The format string or options.
|
|
254
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
255
|
-
* @
|
|
272
|
+
* @param format - The format string or options (optional).
|
|
273
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
274
|
+
* @returns The parsed number.
|
|
256
275
|
*/
|
|
257
276
|
parseNumber(value, format, localeId) {
|
|
258
277
|
return parseNumber(value, localeId || this.localeId, format);
|
|
@@ -262,8 +281,8 @@ class CldrIntlService extends IntlService {
|
|
|
262
281
|
*
|
|
263
282
|
* @param value - The number to format.
|
|
264
283
|
* @param format - The format string or options.
|
|
265
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
266
|
-
* @
|
|
284
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
285
|
+
* @returns The formatted number as a string.
|
|
267
286
|
*/
|
|
268
287
|
formatNumber(value, format, localeId) {
|
|
269
288
|
return formatNumber(value, format, localeId || this.localeId);
|
|
@@ -290,9 +309,8 @@ class CldrIntlService extends IntlService {
|
|
|
290
309
|
* - `short`
|
|
291
310
|
*
|
|
292
311
|
* @param options - Detailed configuration for the desired date field name.
|
|
293
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
294
|
-
* @
|
|
295
|
-
* @returns The localized date field name from the current locale based on the option.
|
|
312
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
313
|
+
* @returns The day names from the current locale based on the option.
|
|
296
314
|
*
|
|
297
315
|
* @example
|
|
298
316
|
* ```ts
|
|
@@ -306,7 +324,7 @@ class CldrIntlService extends IntlService {
|
|
|
306
324
|
return dateFieldName(options, localeId || this.localeId);
|
|
307
325
|
}
|
|
308
326
|
/**
|
|
309
|
-
* Returns a localized date field name based on specific dateFieldName options.
|
|
327
|
+
* Returns a localized date field name based on specific `dateFieldName` options.
|
|
310
328
|
*
|
|
311
329
|
* The available type values are:
|
|
312
330
|
* - `day`
|
|
@@ -316,8 +334,8 @@ class CldrIntlService extends IntlService {
|
|
|
316
334
|
* - `eras`
|
|
317
335
|
*
|
|
318
336
|
* @param options - Detailed configuration for the desired date format.
|
|
319
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
320
|
-
* @
|
|
337
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
338
|
+
* @returns The day names from the current locale based on the option.
|
|
321
339
|
*/
|
|
322
340
|
dateFormatNames(options, localeId) {
|
|
323
341
|
return dateFormatNames(localeId || this.localeId, options);
|
|
@@ -325,8 +343,8 @@ class CldrIntlService extends IntlService {
|
|
|
325
343
|
/**
|
|
326
344
|
* Splits the date format into objects containing information about each part of the pattern.
|
|
327
345
|
*
|
|
328
|
-
* @param format The format string or options.
|
|
329
|
-
* @param localeId The
|
|
346
|
+
* @param format - The format string or options.
|
|
347
|
+
* @param localeId - The locale ID to use (optional). If not specified, the `"en"` locale ID is used.
|
|
330
348
|
* @returns The date format parts.
|
|
331
349
|
*/
|
|
332
350
|
splitDateFormat(format, localeId) {
|
|
@@ -335,8 +353,8 @@ class CldrIntlService extends IntlService {
|
|
|
335
353
|
/**
|
|
336
354
|
* Returns the number symbols from the current locale based on the option.
|
|
337
355
|
*
|
|
338
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
339
|
-
* @
|
|
356
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
357
|
+
* @returns The number symbols from the current locale.
|
|
340
358
|
*/
|
|
341
359
|
numberSymbols(localeId) {
|
|
342
360
|
return numberSymbols(localeId || this.localeId);
|
|
@@ -344,8 +362,8 @@ class CldrIntlService extends IntlService {
|
|
|
344
362
|
/**
|
|
345
363
|
* Returns the first day index starting from Sunday.
|
|
346
364
|
*
|
|
347
|
-
* @param localeId - The locale ID. Defaults to the current locale ID.
|
|
348
|
-
* @
|
|
365
|
+
* @param localeId - The locale ID (optional). Defaults to the current locale ID.
|
|
366
|
+
* @returns The index of the first day of the week (0 == Sunday).
|
|
349
367
|
*/
|
|
350
368
|
firstDay(localeId) {
|
|
351
369
|
return firstDay(localeId || this.localeId);
|
|
@@ -353,8 +371,8 @@ class CldrIntlService extends IntlService {
|
|
|
353
371
|
/**
|
|
354
372
|
* Returns the start and end index of the locale weekend starting from Sunday.
|
|
355
373
|
*
|
|
356
|
-
* @param localeId - The locale ID. Defaults to the current locale ID.
|
|
357
|
-
* @
|
|
374
|
+
* @param localeId - The locale ID (optional). Defaults to the current locale ID.
|
|
375
|
+
* @returns The start and end index of the locale weekend (0 == Sunday).
|
|
358
376
|
*/
|
|
359
377
|
weekendRange(localeId) {
|
|
360
378
|
return weekendRange(localeId || this.localeId);
|
|
@@ -375,7 +393,7 @@ const isNumeric = (value) => !isNaN(value - parseFloat(value));
|
|
|
375
393
|
* This pipe uses the [IntlService]({% slug api_intl_intlservice %}).
|
|
376
394
|
*
|
|
377
395
|
* @example
|
|
378
|
-
* ```
|
|
396
|
+
* ```html
|
|
379
397
|
* <ul>
|
|
380
398
|
* <li>{{date | kendoDate }}</li>
|
|
381
399
|
* <li>{{milliseconds | kendoDate: 'M/dd/yyy' }}</li>
|
|
@@ -396,9 +414,9 @@ class DatePipe {
|
|
|
396
414
|
* If no format is provided, the default short date format is used.
|
|
397
415
|
*
|
|
398
416
|
* @param value - The date to format.
|
|
399
|
-
* @param format - The format string or options.
|
|
400
|
-
* @param localeId -
|
|
401
|
-
* @
|
|
417
|
+
* @param format - The format string or options (optional).
|
|
418
|
+
* @param localeId - The ID of the locale which will be used instead of the default one (optional).
|
|
419
|
+
* @returns The formatted date as a string.
|
|
402
420
|
*/
|
|
403
421
|
transform(value, format = "", localeId) {
|
|
404
422
|
value = this.normalize(value);
|
|
@@ -453,10 +471,10 @@ class NumberPipe {
|
|
|
453
471
|
* If no format is provided, the value is formatted as decimal number using the
|
|
454
472
|
* [`"n"`](https://github.com/telerik/kendo-intl/blob/master/docs/num-formatting/index.md#standard) format.
|
|
455
473
|
*
|
|
456
|
-
* @param value - The
|
|
457
|
-
* @param format - The format string or options.
|
|
458
|
-
* @param localeId -
|
|
459
|
-
* @
|
|
474
|
+
* @param value - The number that will be formatted.
|
|
475
|
+
* @param format - The format string or options (optional).
|
|
476
|
+
* @param localeId - The locale ID that will be used in place of the default one (optional).
|
|
477
|
+
* @returns The formatted number as a string.
|
|
460
478
|
*/
|
|
461
479
|
transform(value, format, localeId) {
|
|
462
480
|
if (typeof value === 'string') {
|
|
@@ -479,19 +497,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
479
497
|
}], ctorParameters: function () { return [{ type: IntlService }]; } });
|
|
480
498
|
|
|
481
499
|
/**
|
|
482
|
-
* Utility array that contains all `kendoNumber` related components and directives
|
|
500
|
+
* Utility array that contains all `kendoNumber` related components and directives.
|
|
483
501
|
*/
|
|
484
502
|
const KENDO_NUMBER = [
|
|
485
503
|
NumberPipe
|
|
486
504
|
];
|
|
487
505
|
/**
|
|
488
|
-
* Utility array that contains all `kendoDate` related components and directives
|
|
506
|
+
* Utility array that contains all `kendoDate` related components and directives.
|
|
489
507
|
*/
|
|
490
508
|
const KENDO_DATE = [
|
|
491
509
|
DatePipe
|
|
492
510
|
];
|
|
493
511
|
/**
|
|
494
|
-
* Utility array that contains all `@progress/kendo-angular-intl` related components and directives
|
|
512
|
+
* Utility array that contains all `@progress/kendo-angular-intl` related components and directives.
|
|
495
513
|
*/
|
|
496
514
|
const KENDO_INTL = [
|
|
497
515
|
...KENDO_NUMBER,
|
package/intl-members.d.ts
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Locale } from './locale-data.interface';
|
|
6
6
|
export { DateFieldNameOptions, DateFormatNameOptions, DateFormatOptions, NumberFormatOptions, DateFormatPart } from '@progress/kendo-intl';
|
|
7
|
+
/**
|
|
8
|
+
* Wraps Kendo Intl methods to provide enhanced error handling and documentation for the Kendo Angular Intl package.
|
|
9
|
+
*
|
|
10
|
+
* Includes utility functions for formatting, parsing, and retrieving locale data, as well as error message enhancements.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { formatDate, parseNumber, localeData } from '@progress/kendo-angular-intl';
|
|
15
|
+
* const formatted = formatDate(new Date(), { date: 'short' });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
7
18
|
/**
|
|
8
19
|
* @hidden
|
|
9
20
|
*/
|
|
@@ -59,13 +70,13 @@ export declare const weekendRange: Function;
|
|
|
59
70
|
/**
|
|
60
71
|
* Sets a pre-built locale.
|
|
61
72
|
*
|
|
62
|
-
* @
|
|
73
|
+
* @param data - The pre-built locale data.
|
|
63
74
|
*/
|
|
64
75
|
export declare const setData: (data: any) => void;
|
|
65
76
|
/**
|
|
66
77
|
* Retrieves the locale data for the specified locale.
|
|
67
78
|
*
|
|
68
|
-
* @
|
|
69
|
-
* @returns
|
|
79
|
+
* @param locale - The locale ID.
|
|
80
|
+
* @returns The locale data.
|
|
70
81
|
*/
|
|
71
82
|
export declare const localeData: (locale: string) => Locale;
|
package/intl.service.d.ts
CHANGED
|
@@ -10,9 +10,10 @@ import * as i0 from "@angular/core";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function cldrServiceFactory(localeId: string): CldrIntlService;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* the
|
|
15
|
-
*
|
|
13
|
+
* Represents the abstract base class for the Kendo UI for Angular Internationalization service.
|
|
14
|
+
* Provides methods for formatting and parsing dates, numbers, and strings according to the current locale.
|
|
15
|
+
*
|
|
16
|
+
* Extend this class to implement custom internationalization logic or use the default CLDR-based implementation.
|
|
16
17
|
*/
|
|
17
18
|
export declare abstract class IntlService {
|
|
18
19
|
/**
|
|
@@ -24,7 +25,7 @@ export declare abstract class IntlService {
|
|
|
24
25
|
*/
|
|
25
26
|
constructor();
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* Specifies that the service was changed.
|
|
28
29
|
*/
|
|
29
30
|
notify(): void;
|
|
30
31
|
/**
|
|
@@ -33,7 +34,7 @@ export declare abstract class IntlService {
|
|
|
33
34
|
*
|
|
34
35
|
* @param format - The format string.
|
|
35
36
|
* @param values - One or more values to output in the format string placeholders.
|
|
36
|
-
* @
|
|
37
|
+
* @returns The formatted string.
|
|
37
38
|
*/
|
|
38
39
|
abstract format(format: string, ...values: any[]): string;
|
|
39
40
|
/**
|
|
@@ -41,8 +42,8 @@ export declare abstract class IntlService {
|
|
|
41
42
|
*
|
|
42
43
|
* @param value - The value to format.
|
|
43
44
|
* @param format - The format to use.
|
|
44
|
-
* @param localeId - The locale ID to use in place of the default
|
|
45
|
-
* @
|
|
45
|
+
* @param localeId - The locale ID to use in place of the default (optional).
|
|
46
|
+
* @returns The formatted object as a string.
|
|
46
47
|
*/
|
|
47
48
|
abstract toString(value: any, format: string | any, localeId?: string): string;
|
|
48
49
|
/**
|
|
@@ -51,27 +52,27 @@ export declare abstract class IntlService {
|
|
|
51
52
|
* If no format is provided, the default short date format is used.
|
|
52
53
|
*
|
|
53
54
|
* @param value - The date to format.
|
|
54
|
-
* @param format - The format string or options.
|
|
55
|
-
* @param localeId - The locale ID to use in place of the default
|
|
56
|
-
* @
|
|
55
|
+
* @param format - The format string or options (optional).
|
|
56
|
+
* @param localeId - The locale ID to use in place of the default (optional).
|
|
57
|
+
* @returns The formatted date as a string.
|
|
57
58
|
*/
|
|
58
59
|
abstract formatDate(value: Date, format?: string | DateFormatOptions, localeId?: string): string;
|
|
59
60
|
/**
|
|
60
61
|
* Converts a string into a `Date` object based on the specified format.
|
|
61
62
|
*
|
|
62
63
|
* @param value - The string to convert.
|
|
63
|
-
* @param format - The format strings or options.
|
|
64
|
-
* @param localeId - The locale ID to use in place of the default
|
|
65
|
-
* @
|
|
64
|
+
* @param format - The format strings or options (optional).
|
|
65
|
+
* @param localeId - The locale ID to use in place of the default (optional).
|
|
66
|
+
* @returns The parsed date.
|
|
66
67
|
*/
|
|
67
68
|
abstract parseDate(value: string, format?: string | DateFormatOptions | string[] | DateFormatOptions[], localeId?: string): Date;
|
|
68
69
|
/**
|
|
69
70
|
* Converts a string into a `Number`.
|
|
70
71
|
*
|
|
71
72
|
* @param value - The string to convert.
|
|
72
|
-
* @param format - The format string or options.
|
|
73
|
-
* @param localeId - The locale ID to use in place of the default
|
|
74
|
-
* @
|
|
73
|
+
* @param format - The format string or options (optional).
|
|
74
|
+
* @param localeId - The locale ID to use in place of the default (optional).
|
|
75
|
+
* @returns The parsed number.
|
|
75
76
|
*/
|
|
76
77
|
abstract parseNumber(value: string, format?: string | NumberFormatOptions, localeId?: string): number;
|
|
77
78
|
/**
|
|
@@ -79,23 +80,23 @@ export declare abstract class IntlService {
|
|
|
79
80
|
*
|
|
80
81
|
* @param value - The number to format.
|
|
81
82
|
* @param format - The format string or options.
|
|
82
|
-
* @param localeId - The locale ID to use in place of the default
|
|
83
|
-
* @
|
|
83
|
+
* @param localeId - The locale ID to use in place of the default (optional).
|
|
84
|
+
* @returns The formatted number as a string.
|
|
84
85
|
*/
|
|
85
86
|
abstract formatNumber(value: number, format: string | NumberFormatOptions, localeId?: string): string;
|
|
86
87
|
/**
|
|
87
88
|
* Returns the day names from the current locale based on the option.
|
|
88
89
|
*
|
|
89
90
|
* @param options - Detailed configuration for the desired date format.
|
|
90
|
-
* @param localeId - The locale ID to use in place of the default
|
|
91
|
-
* @
|
|
91
|
+
* @param localeId - The locale ID to use in place of the default (optional).
|
|
92
|
+
* @returns The day names from the current locale based on the option.
|
|
92
93
|
*/
|
|
93
94
|
abstract dateFormatNames(options: DateFormatNameOptions, localeId?: string): any;
|
|
94
95
|
/**
|
|
95
|
-
* Returns a localized date field name based on specific dateFieldName options.
|
|
96
|
+
* Returns a localized date field name based on specific `dateFieldName` options.
|
|
96
97
|
*
|
|
97
98
|
* @param options - Detailed configuration for the desired date field name.
|
|
98
|
-
* @param localeId The
|
|
99
|
+
* @param localeId - The locale ID to use (optional). If not specified, the `"en"` locale ID is used.
|
|
99
100
|
* @returns The localized date field name from the current locale based on the option.
|
|
100
101
|
*
|
|
101
102
|
* @example
|
|
@@ -110,43 +111,50 @@ export declare abstract class IntlService {
|
|
|
110
111
|
/**
|
|
111
112
|
* Splits the date format into objects containing information about each part of the pattern.
|
|
112
113
|
*
|
|
113
|
-
* @param format The format string or options.
|
|
114
|
-
* @param localeId The
|
|
114
|
+
* @param format - The format string or options.
|
|
115
|
+
* @param localeId - The locale ID to use (optional). If not specified, the `"en"` locale ID is used.
|
|
115
116
|
* @returns The date format parts.
|
|
116
117
|
*/
|
|
117
118
|
abstract splitDateFormat(format: string | DateFormatOptions, localeId?: string): DateFormatPart[];
|
|
118
119
|
/**
|
|
119
120
|
* Returns the number symbols from the current locale based on the option.
|
|
120
121
|
*
|
|
121
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
122
|
-
* @
|
|
122
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
123
|
+
* @returns The number symbols from the current locale.
|
|
123
124
|
*/
|
|
124
125
|
abstract numberSymbols(localeId?: string): any;
|
|
125
126
|
/**
|
|
126
127
|
* Returns the first day index starting from Sunday.
|
|
127
128
|
*
|
|
128
|
-
* @param localeId - The locale ID. Defaults to the current locale ID.
|
|
129
|
-
* @
|
|
129
|
+
* @param localeId - The locale ID (optional). Defaults to the current locale ID.
|
|
130
|
+
* @returns The index of the first day of the week (0 == Sunday).
|
|
130
131
|
*/
|
|
131
132
|
abstract firstDay(localeId?: string): number;
|
|
132
133
|
/**
|
|
133
134
|
* Returns the start and end index of the locale weekend starting from Sunday.
|
|
134
135
|
*
|
|
135
|
-
* @param localeId - The locale ID. Defaults to the current locale ID.
|
|
136
|
-
* @
|
|
136
|
+
* @param localeId - The locale ID (optional). Defaults to the current locale ID.
|
|
137
|
+
* @returns The start and end index of the locale weekend (0 == Sunday).
|
|
137
138
|
*/
|
|
138
139
|
abstract weekendRange(localeId?: string): DayRange;
|
|
139
140
|
static ɵfac: i0.ɵɵFactoryDeclaration<IntlService, never>;
|
|
140
141
|
static ɵprov: i0.ɵɵInjectableDeclaration<IntlService>;
|
|
141
142
|
}
|
|
142
143
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
144
|
+
* Represents the Internationalization service implemented using the CLDR Database via the `@progress/kendo-intl` package.
|
|
145
|
+
* Provides locale-aware formatting and parsing for dates, numbers, and strings.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* import { CldrIntlService } from '@progress/kendo-angular-intl';
|
|
150
|
+
* const intl = new CldrIntlService('en-US');
|
|
151
|
+
* intl.formatDate(new Date(), { date: 'short' });
|
|
152
|
+
* ```
|
|
145
153
|
*/
|
|
146
154
|
export declare class CldrIntlService extends IntlService {
|
|
147
155
|
private locale;
|
|
148
156
|
/**
|
|
149
|
-
*
|
|
157
|
+
* Specifies or gets the current locale ID.
|
|
150
158
|
*/
|
|
151
159
|
get localeId(): string;
|
|
152
160
|
set localeId(value: string);
|
|
@@ -165,7 +173,7 @@ export declare class CldrIntlService extends IntlService {
|
|
|
165
173
|
*
|
|
166
174
|
* @param format - The format string.
|
|
167
175
|
* @param values - One or more values to output in the format string placeholders.
|
|
168
|
-
* @
|
|
176
|
+
* @returns The formatted string.
|
|
169
177
|
*/
|
|
170
178
|
format(format: string, ...values: any[]): string;
|
|
171
179
|
/**
|
|
@@ -173,8 +181,8 @@ export declare class CldrIntlService extends IntlService {
|
|
|
173
181
|
*
|
|
174
182
|
* @param value - The value to format.
|
|
175
183
|
* @param format - The format to use.
|
|
176
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
177
|
-
* @
|
|
184
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
185
|
+
* @returns The formatted object as a string.
|
|
178
186
|
*/
|
|
179
187
|
toString(value: any, format: string | any, localeId?: string): string;
|
|
180
188
|
/**
|
|
@@ -182,27 +190,27 @@ export declare class CldrIntlService extends IntlService {
|
|
|
182
190
|
* If no format is provided, the default short date format is used.
|
|
183
191
|
*
|
|
184
192
|
* @param value - The date to format.
|
|
185
|
-
* @param format - The format string or options.
|
|
186
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
187
|
-
* @
|
|
193
|
+
* @param format - The format string or options (optional).
|
|
194
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
195
|
+
* @returns The formatted date as a string.
|
|
188
196
|
*/
|
|
189
197
|
formatDate(value: Date, format?: string | DateFormatOptions, localeId?: string): string;
|
|
190
198
|
/**
|
|
191
199
|
* Converts a string into a `Date` object based on the specified format.
|
|
192
200
|
*
|
|
193
201
|
* @param value - The string to convert.
|
|
194
|
-
* @param format - The format strings or options.
|
|
195
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
196
|
-
* @
|
|
202
|
+
* @param format - The format strings or options (optional).
|
|
203
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
204
|
+
* @returns The parsed date.
|
|
197
205
|
*/
|
|
198
206
|
parseDate(value: string, format?: string | DateFormatOptions | string[] | DateFormatOptions[], localeId?: string): Date;
|
|
199
207
|
/**
|
|
200
208
|
* Converts a string into a `Number`.
|
|
201
209
|
*
|
|
202
210
|
* @param value - The string to convert.
|
|
203
|
-
* @param format - The format string or options.
|
|
204
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
205
|
-
* @
|
|
211
|
+
* @param format - The format string or options (optional).
|
|
212
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
213
|
+
* @returns The parsed number.
|
|
206
214
|
*/
|
|
207
215
|
parseNumber(value: string, format?: string | NumberFormatOptions, localeId?: string): number;
|
|
208
216
|
/**
|
|
@@ -210,8 +218,8 @@ export declare class CldrIntlService extends IntlService {
|
|
|
210
218
|
*
|
|
211
219
|
* @param value - The number to format.
|
|
212
220
|
* @param format - The format string or options.
|
|
213
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
214
|
-
* @
|
|
221
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
222
|
+
* @returns The formatted number as a string.
|
|
215
223
|
*/
|
|
216
224
|
formatNumber(value: number, format: string | NumberFormatOptions, localeId?: string): string;
|
|
217
225
|
/**
|
|
@@ -236,9 +244,8 @@ export declare class CldrIntlService extends IntlService {
|
|
|
236
244
|
* - `short`
|
|
237
245
|
*
|
|
238
246
|
* @param options - Detailed configuration for the desired date field name.
|
|
239
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
240
|
-
* @
|
|
241
|
-
* @returns The localized date field name from the current locale based on the option.
|
|
247
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
248
|
+
* @returns The day names from the current locale based on the option.
|
|
242
249
|
*
|
|
243
250
|
* @example
|
|
244
251
|
* ```ts
|
|
@@ -250,7 +257,7 @@ export declare class CldrIntlService extends IntlService {
|
|
|
250
257
|
*/
|
|
251
258
|
dateFieldName(options: DateFieldNameOptions, localeId?: string): string;
|
|
252
259
|
/**
|
|
253
|
-
* Returns a localized date field name based on specific dateFieldName options.
|
|
260
|
+
* Returns a localized date field name based on specific `dateFieldName` options.
|
|
254
261
|
*
|
|
255
262
|
* The available type values are:
|
|
256
263
|
* - `day`
|
|
@@ -260,37 +267,37 @@ export declare class CldrIntlService extends IntlService {
|
|
|
260
267
|
* - `eras`
|
|
261
268
|
*
|
|
262
269
|
* @param options - Detailed configuration for the desired date format.
|
|
263
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
264
|
-
* @
|
|
270
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
271
|
+
* @returns The day names from the current locale based on the option.
|
|
265
272
|
*/
|
|
266
273
|
dateFormatNames(options: DateFormatNameOptions, localeId?: string): any;
|
|
267
274
|
/**
|
|
268
275
|
* Splits the date format into objects containing information about each part of the pattern.
|
|
269
276
|
*
|
|
270
|
-
* @param format The format string or options.
|
|
271
|
-
* @param localeId The
|
|
277
|
+
* @param format - The format string or options.
|
|
278
|
+
* @param localeId - The locale ID to use (optional). If not specified, the `"en"` locale ID is used.
|
|
272
279
|
* @returns The date format parts.
|
|
273
280
|
*/
|
|
274
281
|
splitDateFormat(format: string | DateFormatOptions, localeId?: string): DateFormatPart[];
|
|
275
282
|
/**
|
|
276
283
|
* Returns the number symbols from the current locale based on the option.
|
|
277
284
|
*
|
|
278
|
-
* @param localeId - The locale ID to use in place of the default one
|
|
279
|
-
* @
|
|
285
|
+
* @param localeId - The locale ID to use in place of the default one (optional).
|
|
286
|
+
* @returns The number symbols from the current locale.
|
|
280
287
|
*/
|
|
281
288
|
numberSymbols(localeId?: string): any;
|
|
282
289
|
/**
|
|
283
290
|
* Returns the first day index starting from Sunday.
|
|
284
291
|
*
|
|
285
|
-
* @param localeId - The locale ID. Defaults to the current locale ID.
|
|
286
|
-
* @
|
|
292
|
+
* @param localeId - The locale ID (optional). Defaults to the current locale ID.
|
|
293
|
+
* @returns The index of the first day of the week (0 == Sunday).
|
|
287
294
|
*/
|
|
288
295
|
firstDay(localeId?: string): number;
|
|
289
296
|
/**
|
|
290
297
|
* Returns the start and end index of the locale weekend starting from Sunday.
|
|
291
298
|
*
|
|
292
|
-
* @param localeId - The locale ID. Defaults to the current locale ID.
|
|
293
|
-
* @
|
|
299
|
+
* @param localeId - The locale ID (optional). Defaults to the current locale ID.
|
|
300
|
+
* @returns The start and end index of the locale weekend (0 == Sunday).
|
|
294
301
|
*/
|
|
295
302
|
weekendRange(localeId?: string): DayRange;
|
|
296
303
|
static ɵfac: i0.ɵɵFactoryDeclaration<CldrIntlService, never>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Describes the number symbols of the locale.
|
|
6
|
+
* Describes the number symbols of the locale, such as decimal and group separators.
|
|
7
7
|
*/
|
|
8
8
|
export interface LocaleNumberSymbols {
|
|
9
9
|
/**
|
|
@@ -20,7 +20,7 @@ export interface LocaleNumberSymbols {
|
|
|
20
20
|
percentSign?: string;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Describes a currency of a locale.
|
|
23
|
+
* Describes a currency of a locale, including display name and symbols.
|
|
24
24
|
*/
|
|
25
25
|
export interface LocaleCurrency {
|
|
26
26
|
/**
|
|
@@ -37,7 +37,7 @@ export interface LocaleCurrency {
|
|
|
37
37
|
"symbol-alt-narrow"?: string;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Describes the currencies of the locale.
|
|
40
|
+
* Describes the currencies of the locale, indexed by currency code.
|
|
41
41
|
*/
|
|
42
42
|
export interface LocaleCurrencies {
|
|
43
43
|
/**
|
|
@@ -46,7 +46,7 @@ export interface LocaleCurrencies {
|
|
|
46
46
|
[propName: string]: LocaleCurrency;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* Describes the number data of the locale.
|
|
49
|
+
* Describes the number data of the locale, including symbols and currencies.
|
|
50
50
|
*/
|
|
51
51
|
export interface LocaleNumbers {
|
|
52
52
|
/**
|
|
@@ -63,7 +63,7 @@ export interface LocaleNumbers {
|
|
|
63
63
|
localeCurrency: string;
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
-
* Describes the calendar
|
|
66
|
+
* Describes the calendar patterns of the locale, such as date and time formats.
|
|
67
67
|
*/
|
|
68
68
|
export interface LocaleCalendarPatterns {
|
|
69
69
|
/**
|
|
@@ -187,7 +187,7 @@ export interface LocaleDateFormats {
|
|
|
187
187
|
short?: string;
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
190
|
-
* Describes the name types of the locale date formats.
|
|
190
|
+
* Describes the name types of the locale date formats (abbreviated, narrow, short, wide).
|
|
191
191
|
*/
|
|
192
192
|
export interface LocaleDateFormatNames {
|
|
193
193
|
/**
|
|
@@ -208,7 +208,7 @@ export interface LocaleDateFormatNames {
|
|
|
208
208
|
wide?: string[];
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
|
-
* Describes the date-format names of the locale.
|
|
211
|
+
* Describes the date-format names of the locale, including format and stand-alone names.
|
|
212
212
|
*/
|
|
213
213
|
export interface LocaleDateFormatNameTypes {
|
|
214
214
|
/**
|
|
@@ -221,7 +221,7 @@ export interface LocaleDateFormatNameTypes {
|
|
|
221
221
|
'stand-alone'?: LocaleDateFormatNames;
|
|
222
222
|
}
|
|
223
223
|
/**
|
|
224
|
-
* Describes the day-period names of the locale.
|
|
224
|
+
* Describes the day-period names of the locale (AM/PM).
|
|
225
225
|
*/
|
|
226
226
|
export interface LocaleDayPeriodNames {
|
|
227
227
|
/**
|
|
@@ -234,7 +234,7 @@ export interface LocaleDayPeriodNames {
|
|
|
234
234
|
pm?: string;
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
237
|
-
* Describes the data for the day-period names of the locale.
|
|
237
|
+
* Describes the data for the day-period names of the locale, including format and stand-alone.
|
|
238
238
|
*/
|
|
239
239
|
export interface LocaleDayPeriodNameTypes {
|
|
240
240
|
/**
|
|
@@ -247,7 +247,7 @@ export interface LocaleDayPeriodNameTypes {
|
|
|
247
247
|
'stand-alone'?: LocaleDayPeriodNames;
|
|
248
248
|
}
|
|
249
249
|
/**
|
|
250
|
-
* Describes the date-field names of the locale.
|
|
250
|
+
* Describes the date-field names of the locale (wide, short, narrow).
|
|
251
251
|
*/
|
|
252
252
|
export interface LocaleDateFieldNames {
|
|
253
253
|
/**
|
|
@@ -264,7 +264,7 @@ export interface LocaleDateFieldNames {
|
|
|
264
264
|
narrow?: string;
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
267
|
-
* Describes the data for the date-field names of the locale.
|
|
267
|
+
* Describes the data for the date-field names of the locale, for each field type.
|
|
268
268
|
*/
|
|
269
269
|
export interface LocaleDateFieldNameTypes {
|
|
270
270
|
/**
|
|
@@ -317,7 +317,7 @@ export interface LocaleDateFieldNameTypes {
|
|
|
317
317
|
zone?: LocaleDateFieldNames;
|
|
318
318
|
}
|
|
319
319
|
/**
|
|
320
|
-
* Describes the calendar data of the locale.
|
|
320
|
+
* Describes the calendar data of the locale, including patterns, formats, and field names.
|
|
321
321
|
*/
|
|
322
322
|
export interface LocaleCalendar {
|
|
323
323
|
/**
|
|
@@ -370,7 +370,7 @@ export interface LocaleCalendar {
|
|
|
370
370
|
dateFields: LocaleDateFieldNameTypes;
|
|
371
371
|
}
|
|
372
372
|
/**
|
|
373
|
-
* Describes the data of the locale.
|
|
373
|
+
* Describes the data of the locale, including name, territory, numbers, and calendar.
|
|
374
374
|
*/
|
|
375
375
|
export interface Locale {
|
|
376
376
|
/**
|
package/number.pipe.d.ts
CHANGED
|
@@ -30,10 +30,10 @@ export declare class NumberPipe implements PipeTransform {
|
|
|
30
30
|
* If no format is provided, the value is formatted as decimal number using the
|
|
31
31
|
* [`"n"`](https://github.com/telerik/kendo-intl/blob/master/docs/num-formatting/index.md#standard) format.
|
|
32
32
|
*
|
|
33
|
-
* @param value - The
|
|
34
|
-
* @param format - The format string or options.
|
|
35
|
-
* @param localeId -
|
|
36
|
-
* @
|
|
33
|
+
* @param value - The number that will be formatted.
|
|
34
|
+
* @param format - The format string or options (optional).
|
|
35
|
+
* @param localeId - The locale ID that will be used in place of the default one (optional).
|
|
36
|
+
* @returns The formatted number as a string.
|
|
37
37
|
*/
|
|
38
38
|
transform(value: any, format?: string | NumberFormatOptions, localeId?: string): any;
|
|
39
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<NumberPipe, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-intl",
|
|
3
|
-
"version": "19.1.
|
|
3
|
+
"version": "19.1.2-develop.1",
|
|
4
4
|
"description": "Kendo UI Internationalization for Angular components",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"package": {
|
|
20
20
|
"productName": "Kendo UI for Angular",
|
|
21
21
|
"productCode": "KENDOUIANGULAR",
|
|
22
|
-
"publishDate":
|
|
22
|
+
"publishDate": 1749804072,
|
|
23
23
|
"licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"@angular/common": "16 - 20",
|
|
35
35
|
"@angular/core": "16 - 20",
|
|
36
36
|
"@angular/platform-browser": "16 - 20",
|
|
37
|
-
"@progress/kendo-angular-common": "19.1.
|
|
37
|
+
"@progress/kendo-angular-common": "19.1.2-develop.1",
|
|
38
38
|
"@progress/kendo-licensing": "^1.5.0",
|
|
39
39
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"tslib": "^2.3.1",
|
|
43
|
-
"@progress/kendo-angular-schematics": "19.1.
|
|
43
|
+
"@progress/kendo-angular-schematics": "19.1.2-develop.1",
|
|
44
44
|
"@progress/kendo-intl": "^3.1.0"
|
|
45
45
|
},
|
|
46
46
|
"schematics": "./schematics/collection.json",
|