@progress/kendo-react-intl 7.2.4-develop.2 → 7.2.4-develop.4

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.
Files changed (45) hide show
  1. package/Intl/IntlProvider.js +8 -0
  2. package/Intl/IntlProvider.mjs +33 -0
  3. package/Intl/IntlService.js +8 -0
  4. package/Intl/IntlService.mjs +140 -0
  5. package/Localization/LocalizationProvider.js +8 -0
  6. package/Localization/LocalizationProvider.mjs +33 -0
  7. package/Localization/LocalizationService.js +8 -0
  8. package/Localization/LocalizationService.mjs +31 -0
  9. package/Localization/loadMessages.js +8 -0
  10. package/Localization/loadMessages.mjs +28 -0
  11. package/Localization/messages.js +8 -0
  12. package/Localization/messages.mjs +12 -0
  13. package/dist/cdn/js/kendo-react-intl.js +8 -5
  14. package/globalization/GlobalizationContext.js +8 -0
  15. package/globalization/GlobalizationContext.mjs +18 -0
  16. package/hooks/useInternationalization.js +8 -0
  17. package/hooks/useInternationalization.mjs +14 -0
  18. package/hooks/useLocalization.js +8 -0
  19. package/hooks/useLocalization.mjs +14 -0
  20. package/index.d.mts +277 -5
  21. package/index.d.ts +277 -11
  22. package/index.js +8 -5
  23. package/index.mjs +32 -250
  24. package/intlUtils.js +8 -0
  25. package/intlUtils.mjs +35 -0
  26. package/package-metadata.js +8 -0
  27. package/package-metadata.mjs +19 -0
  28. package/package.json +2 -2
  29. package/Intl/IntlProvider.d.ts +0 -27
  30. package/Intl/IntlProviderProps.d.ts +0 -17
  31. package/Intl/IntlService.d.ts +0 -106
  32. package/Intl/main.d.ts +0 -8
  33. package/Localization/LocalizationProvider.d.ts +0 -27
  34. package/Localization/LocalizationProviderProps.d.ts +0 -17
  35. package/Localization/LocalizationService.d.ts +0 -20
  36. package/Localization/loadMessages.d.ts +0 -11
  37. package/Localization/main.d.ts +0 -9
  38. package/Localization/messages.d.ts +0 -8
  39. package/coreExports.d.ts +0 -6
  40. package/globalization/GlobalizationContext.d.ts +0 -14
  41. package/hooks/index.d.ts +0 -6
  42. package/hooks/useInternationalization.d.ts +0 -9
  43. package/hooks/useLocalization.d.ts +0 -9
  44. package/intlUtils.d.ts +0 -31
  45. package/package-metadata.d.ts +0 -9
package/index.d.mts CHANGED
@@ -1,5 +1,277 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export * from './index';
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { DateFieldNameOptions } from '@progress/kendo-intl';
9
+ import { DateFormatNameOptions } from '@progress/kendo-intl';
10
+ import { DateFormatOptions } from '@progress/kendo-intl';
11
+ import { DateFormatPart } from '@progress/kendo-intl';
12
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
13
+ import { load } from '@progress/kendo-intl';
14
+ import { NumberFormatOptions } from '@progress/kendo-intl';
15
+ import PropTypes from 'prop-types';
16
+ import * as React_2 from 'react';
17
+
18
+ export { DateFieldNameOptions }
19
+
20
+ export { DateFormatNameOptions }
21
+
22
+ export { DateFormatOptions }
23
+
24
+ export { DateFormatPart }
25
+
26
+ /** @hidden */
27
+ export declare const GlobalizationContext: React_2.Context<GlobalizationContextType>;
28
+
29
+ /** @hidden */
30
+ declare type GlobalizationContextType = {
31
+ intl: IntlService;
32
+ localization: LocalizationService;
33
+ };
34
+
35
+ /**
36
+ * A React component which provides an internationalization service. Expects a locale string as a property of the component.
37
+ */
38
+ export declare class IntlProvider extends React_2.Component<IntlProviderProps, {}> {
39
+ /**
40
+ * @hidden
41
+ */
42
+ static propTypes: {
43
+ locale: PropTypes.Requireable<string>;
44
+ };
45
+ /**
46
+ * Returns an internationalization service. The method is suitable for overriding when you implement custom internationalization behavior.
47
+ */
48
+ getIntlService(): IntlService;
49
+ /**
50
+ * @hidden
51
+ */
52
+ render(): JSX_2.Element;
53
+ }
54
+
55
+ /**
56
+ * Represents the props of the KendoReact IntlProvider component.
57
+ */
58
+ export declare interface IntlProviderProps {
59
+ /**
60
+ * The locale that will be used by the child components.
61
+ */
62
+ locale: string;
63
+ /**
64
+ * @hidden
65
+ */
66
+ children?: React.ReactNode;
67
+ }
68
+
69
+ /**
70
+ * A service which provides internationalization methods and is bound to a specific locale.
71
+ */
72
+ export declare class IntlService {
73
+ locale: string;
74
+ /**
75
+ * Creates a new instance of the internationalization service.
76
+ *
77
+ * @param locale - The locale that will be used by the internationalization methods.
78
+ */
79
+ constructor(locale: string);
80
+ /**
81
+ * Formats a string with placeholders such as `Total amount {0:c}`.
82
+ *
83
+ * @param format - The format string.
84
+ * @param values - One or more values to output in the format string placeholders.
85
+ * @return - The formatted string.
86
+ */
87
+ format(format: string, ...values: any[]): string;
88
+ /**
89
+ * Converts a `Date` object to a string based on the specified format. If no format is provided, the default short date format is used.
90
+ *
91
+ * @param value - The date which will be formatted.
92
+ * @param format - The format string or options.
93
+ * @return - The formatted date.
94
+ */
95
+ formatDate(value: Date, format?: string | DateFormatOptions): string;
96
+ /**
97
+ * Converts an object to a string based on the specified format.
98
+ *
99
+ * @param value - The value which will be formatted.
100
+ * @param format - The format to use.
101
+ * @return - The formatted object.
102
+ */
103
+ toString(value: any, format: string | any): string;
104
+ /**
105
+ * Converts a string to a `Number`.
106
+ *
107
+ * @param value - The string which will be parsed.
108
+ * @param format - The format string or options.
109
+ * @return - The parsed number.
110
+ */
111
+ parseNumber(value: string, format?: string | NumberFormatOptions): number;
112
+ /**
113
+ * Converts a string to a `Date` object based on the specified format.
114
+ *
115
+ * @param value - The string which will be converted.
116
+ * @param format - The format strings or options.
117
+ * @return - The parsed date.
118
+ */
119
+ parseDate(value: string, format?: string | DateFormatOptions | string[] | DateFormatOptions[]): Date;
120
+ /**
121
+ * Converts a `Number` to a string based on the specified format.
122
+ *
123
+ * @param value - The number which will be formatted.
124
+ * @param format - The format string or options.
125
+ * @return - The formatted number.
126
+ */
127
+ formatNumber(value: number, format: string | NumberFormatOptions): string;
128
+ /**
129
+ * Returns a localized date field name based on specific `dateFieldName` options.
130
+ *
131
+ * @param options - The detailed configuration for the desired date field name.
132
+ * @returns - The localized date field name from the current locale based on the option.
133
+ */
134
+ dateFieldName(options: DateFieldNameOptions): string;
135
+ /**
136
+ * Returns the day names from the current locale based on the option.
137
+ *
138
+ * @param options - The detailed configuration for the desired date format.
139
+ * @return - The day names from the current locale based on the option.
140
+ */
141
+ dateFormatNames(options: DateFormatNameOptions): any;
142
+ /**
143
+ * Splits the date format into objects which contain information about each part of the pattern.
144
+ *
145
+ * @param format - The format string or options.
146
+ * @returns - The date format parts.
147
+ */
148
+ splitDateFormat(format: string | DateFormatOptions): DateFormatPart[];
149
+ /**
150
+ * Returns the number symbols from the current locale.
151
+ *
152
+ * @return - The number symbols from the current locale.
153
+ */
154
+ numberSymbols(): any;
155
+ /**
156
+ * Returns the first day index, starting from Sunday.
157
+ *
158
+ * @return - The index of the first day of the week (0 == Sunday).
159
+ */
160
+ firstDay(): number;
161
+ /**
162
+ * @hidden
163
+ */
164
+ localeInfo(): any;
165
+ /**
166
+ * @hidden
167
+ */
168
+ localeCurrency(): any;
169
+ }
170
+
171
+ export { load }
172
+
173
+ /**
174
+ * Provides mechanism to load language-specific messages for the KendoReact components.
175
+ *
176
+ * @param messages - An iterable object which contains key-value pairs.
177
+ * @param languages - The language to which the messages are associated.
178
+ */
179
+ export declare function loadMessages(messages: any, language: string): void;
180
+
181
+ /**
182
+ * @hidden
183
+ */
184
+ export declare const localizationMessages: any;
185
+
186
+ /**
187
+ * A React component which provides a localization service. Expects a language string as a property of the component.
188
+ */
189
+ export declare class LocalizationProvider extends React_2.Component<LocalizationProviderProps, {}> {
190
+ /**
191
+ * @hidden
192
+ */
193
+ static propTypes: {
194
+ language: PropTypes.Requireable<string>;
195
+ };
196
+ /**
197
+ * Returns a localization service. The method is suitable for overriding when you implement custom localization behavior.
198
+ */
199
+ getLocalizationService(): LocalizationService;
200
+ /**
201
+ * @hidden
202
+ */
203
+ render(): JSX_2.Element;
204
+ }
205
+
206
+ /**
207
+ * Represents the props of the KendoReact LocalizationProvider component.
208
+ */
209
+ export declare interface LocalizationProviderProps {
210
+ /**
211
+ * The language that will be used by the child components.
212
+ */
213
+ language: string;
214
+ /**
215
+ * @hidden
216
+ */
217
+ children?: React.ReactNode;
218
+ }
219
+
220
+ /**
221
+ * A service which provides localization methods.
222
+ */
223
+ export declare class LocalizationService {
224
+ language?: string | undefined;
225
+ constructor(language?: string | undefined);
226
+ /**
227
+ * Provides a string based on a key for the current language. When no string for the current language is available under this key, the `defaultValue` is returned.
228
+ *
229
+ * @param key - The key which identifies the string for the current language.
230
+ * @param defaultValue - The default value which will be returned when no string
231
+ * for the current language is available under the key.
232
+ * @return - The string for the current language.
233
+ */
234
+ toLanguageString(key: string, defaultValue: string): string;
235
+ }
236
+
237
+ export { NumberFormatOptions }
238
+
239
+ /**
240
+ * Provides an internationalization service. When the passed component is a direct or indirect child of `IntlProvider`, the returned service uses the locale of the provider. Otherwise, uses `en` as a default locale. To handle locale changes, call the method on each `render`.
241
+ *
242
+ * @param componentClass - The React component class that will use the internationalization service.
243
+ */
244
+ export declare function provideIntlService(component: React_2.Component): IntlService;
245
+
246
+ /**
247
+ * Provides a localization service. When the passed component is a direct or indirect child of `LocalizationProvider`, the returned service uses the language of the provider. To handle locale changes, call the method on each `render`.
248
+ *
249
+ * @param componentClass - The React component class that will use the internationalization service.
250
+ */
251
+ export declare function provideLocalizationService(component: React_2.Component): LocalizationService;
252
+
253
+ /**
254
+ * A method which registers a component class or a functional stateless component for internationalization. When a component of that type is a direct or indirect child of `IntlProvider`, the locale of the provider is used. Otherwise, uses `en` as a default locale.
255
+ *
256
+ * @param component - The React component class that will use the internationalization methods.
257
+ */
258
+ export declare function registerForIntl(component: React_2.ComponentClass<any, any>): void;
259
+
260
+ /**
261
+ * A method which registers a component class or a stateless functional component for localization. When a component of that type is a direct or indirect child of `LocalizationProvider`, the language of the provider is used.
262
+ *
263
+ * @param component - The React component class that will use the internationalization methods.
264
+ */
265
+ export declare function registerForLocalization(component: React_2.ComponentClass<any, any>): void;
266
+
267
+ /**
268
+ * A custom [React Hook](https://reactjs.org/docs/hooks-intro.html) providing access to an [IntlService]({% slug api_intl_intlservice %}).
269
+ */
270
+ export declare const useInternationalization: () => IntlService;
271
+
272
+ /**
273
+ * A custom [React Hook](https://reactjs.org/docs/hooks-intro.html) providing access to an [LocalizationService]({% slug api_intl_localizationservice %}).
274
+ */
275
+ export declare const useLocalization: () => LocalizationService;
276
+
277
+ export { }
package/index.d.ts CHANGED
@@ -1,11 +1,277 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- export { GlobalizationContext } from './globalization/GlobalizationContext';
6
- export { messages as localizationMessages } from './Localization/messages';
7
- export * from './Intl/main';
8
- export * from './Localization/main';
9
- export * from './coreExports';
10
- export * from './intlUtils';
11
- export * from './hooks';
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { DateFieldNameOptions } from '@progress/kendo-intl';
9
+ import { DateFormatNameOptions } from '@progress/kendo-intl';
10
+ import { DateFormatOptions } from '@progress/kendo-intl';
11
+ import { DateFormatPart } from '@progress/kendo-intl';
12
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
13
+ import { load } from '@progress/kendo-intl';
14
+ import { NumberFormatOptions } from '@progress/kendo-intl';
15
+ import PropTypes from 'prop-types';
16
+ import * as React_2 from 'react';
17
+
18
+ export { DateFieldNameOptions }
19
+
20
+ export { DateFormatNameOptions }
21
+
22
+ export { DateFormatOptions }
23
+
24
+ export { DateFormatPart }
25
+
26
+ /** @hidden */
27
+ export declare const GlobalizationContext: React_2.Context<GlobalizationContextType>;
28
+
29
+ /** @hidden */
30
+ declare type GlobalizationContextType = {
31
+ intl: IntlService;
32
+ localization: LocalizationService;
33
+ };
34
+
35
+ /**
36
+ * A React component which provides an internationalization service. Expects a locale string as a property of the component.
37
+ */
38
+ export declare class IntlProvider extends React_2.Component<IntlProviderProps, {}> {
39
+ /**
40
+ * @hidden
41
+ */
42
+ static propTypes: {
43
+ locale: PropTypes.Requireable<string>;
44
+ };
45
+ /**
46
+ * Returns an internationalization service. The method is suitable for overriding when you implement custom internationalization behavior.
47
+ */
48
+ getIntlService(): IntlService;
49
+ /**
50
+ * @hidden
51
+ */
52
+ render(): JSX_2.Element;
53
+ }
54
+
55
+ /**
56
+ * Represents the props of the KendoReact IntlProvider component.
57
+ */
58
+ export declare interface IntlProviderProps {
59
+ /**
60
+ * The locale that will be used by the child components.
61
+ */
62
+ locale: string;
63
+ /**
64
+ * @hidden
65
+ */
66
+ children?: React.ReactNode;
67
+ }
68
+
69
+ /**
70
+ * A service which provides internationalization methods and is bound to a specific locale.
71
+ */
72
+ export declare class IntlService {
73
+ locale: string;
74
+ /**
75
+ * Creates a new instance of the internationalization service.
76
+ *
77
+ * @param locale - The locale that will be used by the internationalization methods.
78
+ */
79
+ constructor(locale: string);
80
+ /**
81
+ * Formats a string with placeholders such as `Total amount {0:c}`.
82
+ *
83
+ * @param format - The format string.
84
+ * @param values - One or more values to output in the format string placeholders.
85
+ * @return - The formatted string.
86
+ */
87
+ format(format: string, ...values: any[]): string;
88
+ /**
89
+ * Converts a `Date` object to a string based on the specified format. If no format is provided, the default short date format is used.
90
+ *
91
+ * @param value - The date which will be formatted.
92
+ * @param format - The format string or options.
93
+ * @return - The formatted date.
94
+ */
95
+ formatDate(value: Date, format?: string | DateFormatOptions): string;
96
+ /**
97
+ * Converts an object to a string based on the specified format.
98
+ *
99
+ * @param value - The value which will be formatted.
100
+ * @param format - The format to use.
101
+ * @return - The formatted object.
102
+ */
103
+ toString(value: any, format: string | any): string;
104
+ /**
105
+ * Converts a string to a `Number`.
106
+ *
107
+ * @param value - The string which will be parsed.
108
+ * @param format - The format string or options.
109
+ * @return - The parsed number.
110
+ */
111
+ parseNumber(value: string, format?: string | NumberFormatOptions): number;
112
+ /**
113
+ * Converts a string to a `Date` object based on the specified format.
114
+ *
115
+ * @param value - The string which will be converted.
116
+ * @param format - The format strings or options.
117
+ * @return - The parsed date.
118
+ */
119
+ parseDate(value: string, format?: string | DateFormatOptions | string[] | DateFormatOptions[]): Date;
120
+ /**
121
+ * Converts a `Number` to a string based on the specified format.
122
+ *
123
+ * @param value - The number which will be formatted.
124
+ * @param format - The format string or options.
125
+ * @return - The formatted number.
126
+ */
127
+ formatNumber(value: number, format: string | NumberFormatOptions): string;
128
+ /**
129
+ * Returns a localized date field name based on specific `dateFieldName` options.
130
+ *
131
+ * @param options - The detailed configuration for the desired date field name.
132
+ * @returns - The localized date field name from the current locale based on the option.
133
+ */
134
+ dateFieldName(options: DateFieldNameOptions): string;
135
+ /**
136
+ * Returns the day names from the current locale based on the option.
137
+ *
138
+ * @param options - The detailed configuration for the desired date format.
139
+ * @return - The day names from the current locale based on the option.
140
+ */
141
+ dateFormatNames(options: DateFormatNameOptions): any;
142
+ /**
143
+ * Splits the date format into objects which contain information about each part of the pattern.
144
+ *
145
+ * @param format - The format string or options.
146
+ * @returns - The date format parts.
147
+ */
148
+ splitDateFormat(format: string | DateFormatOptions): DateFormatPart[];
149
+ /**
150
+ * Returns the number symbols from the current locale.
151
+ *
152
+ * @return - The number symbols from the current locale.
153
+ */
154
+ numberSymbols(): any;
155
+ /**
156
+ * Returns the first day index, starting from Sunday.
157
+ *
158
+ * @return - The index of the first day of the week (0 == Sunday).
159
+ */
160
+ firstDay(): number;
161
+ /**
162
+ * @hidden
163
+ */
164
+ localeInfo(): any;
165
+ /**
166
+ * @hidden
167
+ */
168
+ localeCurrency(): any;
169
+ }
170
+
171
+ export { load }
172
+
173
+ /**
174
+ * Provides mechanism to load language-specific messages for the KendoReact components.
175
+ *
176
+ * @param messages - An iterable object which contains key-value pairs.
177
+ * @param languages - The language to which the messages are associated.
178
+ */
179
+ export declare function loadMessages(messages: any, language: string): void;
180
+
181
+ /**
182
+ * @hidden
183
+ */
184
+ export declare const localizationMessages: any;
185
+
186
+ /**
187
+ * A React component which provides a localization service. Expects a language string as a property of the component.
188
+ */
189
+ export declare class LocalizationProvider extends React_2.Component<LocalizationProviderProps, {}> {
190
+ /**
191
+ * @hidden
192
+ */
193
+ static propTypes: {
194
+ language: PropTypes.Requireable<string>;
195
+ };
196
+ /**
197
+ * Returns a localization service. The method is suitable for overriding when you implement custom localization behavior.
198
+ */
199
+ getLocalizationService(): LocalizationService;
200
+ /**
201
+ * @hidden
202
+ */
203
+ render(): JSX_2.Element;
204
+ }
205
+
206
+ /**
207
+ * Represents the props of the KendoReact LocalizationProvider component.
208
+ */
209
+ export declare interface LocalizationProviderProps {
210
+ /**
211
+ * The language that will be used by the child components.
212
+ */
213
+ language: string;
214
+ /**
215
+ * @hidden
216
+ */
217
+ children?: React.ReactNode;
218
+ }
219
+
220
+ /**
221
+ * A service which provides localization methods.
222
+ */
223
+ export declare class LocalizationService {
224
+ language?: string | undefined;
225
+ constructor(language?: string | undefined);
226
+ /**
227
+ * Provides a string based on a key for the current language. When no string for the current language is available under this key, the `defaultValue` is returned.
228
+ *
229
+ * @param key - The key which identifies the string for the current language.
230
+ * @param defaultValue - The default value which will be returned when no string
231
+ * for the current language is available under the key.
232
+ * @return - The string for the current language.
233
+ */
234
+ toLanguageString(key: string, defaultValue: string): string;
235
+ }
236
+
237
+ export { NumberFormatOptions }
238
+
239
+ /**
240
+ * Provides an internationalization service. When the passed component is a direct or indirect child of `IntlProvider`, the returned service uses the locale of the provider. Otherwise, uses `en` as a default locale. To handle locale changes, call the method on each `render`.
241
+ *
242
+ * @param componentClass - The React component class that will use the internationalization service.
243
+ */
244
+ export declare function provideIntlService(component: React_2.Component): IntlService;
245
+
246
+ /**
247
+ * Provides a localization service. When the passed component is a direct or indirect child of `LocalizationProvider`, the returned service uses the language of the provider. To handle locale changes, call the method on each `render`.
248
+ *
249
+ * @param componentClass - The React component class that will use the internationalization service.
250
+ */
251
+ export declare function provideLocalizationService(component: React_2.Component): LocalizationService;
252
+
253
+ /**
254
+ * A method which registers a component class or a functional stateless component for internationalization. When a component of that type is a direct or indirect child of `IntlProvider`, the locale of the provider is used. Otherwise, uses `en` as a default locale.
255
+ *
256
+ * @param component - The React component class that will use the internationalization methods.
257
+ */
258
+ export declare function registerForIntl(component: React_2.ComponentClass<any, any>): void;
259
+
260
+ /**
261
+ * A method which registers a component class or a stateless functional component for localization. When a component of that type is a direct or indirect child of `LocalizationProvider`, the language of the provider is used.
262
+ *
263
+ * @param component - The React component class that will use the internationalization methods.
264
+ */
265
+ export declare function registerForLocalization(component: React_2.ComponentClass<any, any>): void;
266
+
267
+ /**
268
+ * A custom [React Hook](https://reactjs.org/docs/hooks-intro.html) providing access to an [IntlService]({% slug api_intl_intlservice %}).
269
+ */
270
+ export declare const useInternationalization: () => IntlService;
271
+
272
+ /**
273
+ * A custom [React Hook](https://reactjs.org/docs/hooks-intro.html) providing access to an [LocalizationService]({% slug api_intl_localizationservice %}).
274
+ */
275
+ export declare const useLocalization: () => LocalizationService;
276
+
277
+ export { }
package/index.js CHANGED
@@ -1,5 +1,8 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),p=require("@progress/kendo-intl"),z=require("@progress/kendo-react-common"),d=require("prop-types");function g(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const n=g(y),o=g(p),b={name:"@progress/kendo-react-intl",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};class s{constructor(e){if(this.locale=e,z.validatePackage(b),e===""&&process.env.NODE_ENV!=="production")throw"Locale should not be empty string"}format(e,...r){return r.length===1&&Array.isArray(r[0])?o.format(e,r[0],this.locale):o.format(e,r,this.locale)}formatDate(e,r){return o.formatDate(e,r,this.locale)}toString(e,r){return o.toString(e,r,this.locale)}parseNumber(e,r){return o.parseNumber(e,this.locale,r)}parseDate(e,r){return o.parseDate(e,r,this.locale)}formatNumber(e,r){return o.formatNumber(e,r,this.locale)}dateFieldName(e){return o.dateFieldName(e,this.locale)}dateFormatNames(e){return o.dateFormatNames(this.locale,e)}splitDateFormat(e){return o.splitDateFormat(e,this.locale)}numberSymbols(){return o.numberSymbols(this.locale)}firstDay(){return o.firstDay(this.locale)}localeInfo(){return o.localeInfo(this.locale)}localeCurrency(){return o.localeCurrency(this.locale)}}const l=Object.create({});class c{constructor(e){if(this.language=e,e===""&&process.env.NODE_ENV!=="production")throw"Language should not be an empty string"}toLanguageString(e,r){return this.language&&l[this.language]&&l[this.language].hasOwnProperty(e)?l[this.language][e]:r}}const a=n.createContext({intl:new s("en"),localization:new c});class m extends n.Component{getIntlService(){return new s(this.props.locale)}render(){return n.createElement(a.Consumer,null,e=>n.createElement(a.Provider,{value:{...e,intl:this.getIntlService()}},this.props.children))}}m.propTypes={locale:d.string};const h=(t,e,r)=>{for(const i in t)if(t.hasOwnProperty(i)){const u=[...r];if(u.push(i),typeof t[i]!="string")h(t[i],e,u);else{const v=t[i];Object.defineProperty(e,u.join("."),{value:v})}}};function S(t,e){let r=l[e]=l[e]||{};h(t,r,[])}class f extends n.Component{getLocalizationService(){return new c(this.props.language)}render(){return n.createElement(a.Consumer,null,e=>n.createElement(a.Provider,{value:{...e,localization:this.getLocalizationService()}},this.props.children))}}f.propTypes={language:d.string};function N(t){if(!t&&process.env.NODE_ENV!=="production")throw`Passed component - ${t} is invalid.`;const e=t.context;return e&&e.intl?e.intl:new s("en")}function D(t){if(!t&&process.env.NODE_ENV!=="production")throw`Passed component - ${t} is invalid.`;const e=t.context;return e&&e.localization?e.localization:new c}function I(t){t.contextType=a}function O(t){t.contextType=a}const P=()=>n.useContext(a).intl,E=()=>n.useContext(a).localization;Object.defineProperty(exports,"load",{enumerable:!0,get:()=>p.load});exports.GlobalizationContext=a;exports.IntlProvider=m;exports.IntlService=s;exports.LocalizationProvider=f;exports.LocalizationService=c;exports.loadMessages=S;exports.localizationMessages=l;exports.provideIntlService=N;exports.provideLocalizationService=D;exports.registerForIntl=I;exports.registerForLocalization=O;exports.useInternationalization=P;exports.useLocalization=E;
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./globalization/GlobalizationContext.js"),o=require("./Localization/messages.js"),e=require("./intlUtils.js"),r=require("./Intl/IntlProvider.js"),t=require("./Intl/IntlService.js"),n=require("./Localization/loadMessages.js"),a=require("./Localization/LocalizationProvider.js"),l=require("./Localization/LocalizationService.js"),s=require("@progress/kendo-intl"),c=require("./hooks/useInternationalization.js"),u=require("./hooks/useLocalization.js");exports.GlobalizationContext=i.GlobalizationContext;exports.localizationMessages=o.messages;exports.provideIntlService=e.provideIntlService;exports.provideLocalizationService=e.provideLocalizationService;exports.registerForIntl=e.registerForIntl;exports.registerForLocalization=e.registerForLocalization;exports.IntlProvider=r.IntlProvider;exports.IntlService=t.IntlService;exports.loadMessages=n.loadMessages;exports.LocalizationProvider=a.LocalizationProvider;exports.LocalizationService=l.LocalizationService;Object.defineProperty(exports,"load",{enumerable:!0,get:()=>s.load});exports.useInternationalization=c.useInternationalization;exports.useLocalization=u.useLocalization;