@progress/kendo-vue-intl 3.5.0 → 3.5.1-dev.202208150613

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 (44) hide show
  1. package/dist/cdn/js/kendo-vue-intl.js +1 -1
  2. package/dist/es/Intl/IntlProviderProps.js +1 -0
  3. package/dist/es/Localization/LocalizationProviderProps.js +1 -0
  4. package/dist/es/Localization/loadMessages.js +9 -7
  5. package/dist/es/intlUtils.js +2 -2
  6. package/dist/es/package-metadata.js +1 -1
  7. package/dist/esm/Intl/IntlProvider.d.ts +49 -0
  8. package/dist/esm/Intl/IntlProvider.js +95 -0
  9. package/dist/esm/Intl/IntlProviderProps.d.ts +9 -0
  10. package/dist/esm/Intl/IntlProviderProps.js +1 -0
  11. package/dist/esm/Intl/IntlService.d.ts +98 -0
  12. package/dist/esm/Intl/IntlService.js +134 -0
  13. package/dist/esm/Intl/main.d.ts +4 -0
  14. package/dist/esm/Intl/main.js +8 -0
  15. package/dist/esm/Localization/LocalizationProvider.d.ts +49 -0
  16. package/dist/esm/Localization/LocalizationProvider.js +92 -0
  17. package/dist/esm/Localization/LocalizationProviderProps.d.ts +9 -0
  18. package/dist/esm/Localization/LocalizationProviderProps.js +1 -0
  19. package/dist/esm/Localization/LocalizationService.d.ts +18 -0
  20. package/dist/esm/Localization/LocalizationService.js +39 -0
  21. package/dist/esm/Localization/loadMessages.d.ts +7 -0
  22. package/dist/esm/Localization/loadMessages.js +35 -0
  23. package/dist/esm/Localization/main.d.ts +5 -0
  24. package/dist/esm/Localization/main.js +9 -0
  25. package/dist/esm/Localization/messages.d.ts +4 -0
  26. package/dist/esm/Localization/messages.js +4 -0
  27. package/dist/esm/additionalTypes.ts +21 -0
  28. package/dist/esm/coreExports.d.ts +1 -0
  29. package/dist/esm/coreExports.js +1 -0
  30. package/dist/esm/intlUtils.d.ts +21 -0
  31. package/dist/esm/intlUtils.js +37 -0
  32. package/dist/esm/main.d.ts +4 -0
  33. package/dist/esm/main.js +4 -0
  34. package/dist/esm/package-metadata.d.ts +5 -0
  35. package/dist/esm/package-metadata.js +11 -0
  36. package/dist/esm/package.json +3 -0
  37. package/dist/npm/Intl/IntlProvider.js +2 -2
  38. package/dist/npm/Localization/LocalizationProvider.js +1 -1
  39. package/dist/npm/Localization/loadMessages.js +9 -7
  40. package/dist/npm/coreExports.js +1 -0
  41. package/dist/npm/intlUtils.js +2 -2
  42. package/dist/npm/main.js +6 -2
  43. package/dist/npm/package-metadata.js +1 -1
  44. package/package.json +8 -2
@@ -0,0 +1,98 @@
1
+ import { DateFormatOptions, NumberFormatOptions, DateFieldNameOptions, DateFormatNameOptions, DateFormatPart } from './../coreExports';
2
+ /**
3
+ * A service which provides internationalization methods
4
+ * and is bound to a specific locale.
5
+ */
6
+ export declare class IntlService {
7
+ private locale;
8
+ /**
9
+ * Creates a new instance of the internationalization service.
10
+ *
11
+ * @param locale - The locale that will be used by the internationalization methods.
12
+ */
13
+ constructor(locale: string);
14
+ /**
15
+ * Formats a string with placeholders such as
16
+ * `Total amount {0:c}`.
17
+ *
18
+ * @param format - The format string.
19
+ * @param values - One or more values to output in the format string placeholders.
20
+ * @return - The formatted string.
21
+ */
22
+ format(format: string, ...values: any[]): string;
23
+ /**
24
+ * Converts a `Date` object to a string based on the specified format.
25
+ * If no format is provided, the default short date format is used.
26
+ *
27
+ * @param value - The date which will be formatted.
28
+ * @param format - The format string or options.
29
+ * @return - The formatted date.
30
+ */
31
+ formatDate(value: Date, format?: string | DateFormatOptions): string;
32
+ /**
33
+ * Converts an object to a string based on the specified format.
34
+ *
35
+ * @param value - The value which will be formatted.
36
+ * @param format - The format to use.
37
+ * @return - The formatted object.
38
+ */
39
+ toString(value: any, format: string | any): string;
40
+ /**
41
+ * Converts a string to a `Number`.
42
+ *
43
+ * @param value - The string which will be parsed.
44
+ * @param format - The format string or options.
45
+ * @return - The parsed number.
46
+ */
47
+ parseNumber(value: string, format?: string | NumberFormatOptions): number;
48
+ /**
49
+ * Converts a string to a `Date` object based on the specified format.
50
+ *
51
+ * @param value - The string which will be converted.
52
+ * @param format - The format strings or options.
53
+ * @return - The parsed date.
54
+ */
55
+ parseDate(value: string, format?: string | DateFormatOptions | string[] | DateFormatOptions[]): Date;
56
+ /**
57
+ * Converts a `Number` to a string based on the specified format.
58
+ *
59
+ * @param value - The number which will be formatted.
60
+ * @param format - The format string or options.
61
+ * @return - The formatted number.
62
+ */
63
+ formatNumber(value: number, format: string | NumberFormatOptions): string;
64
+ /**
65
+ * Returns a localized date field name based on specific `dateFieldName` options.
66
+ *
67
+ * @param options - The detailed configuration for the desired date field name.
68
+ * @returns - The localized date field name from the current locale based on the option.
69
+ */
70
+ dateFieldName(options: DateFieldNameOptions): string;
71
+ /**
72
+ * Returns the day names from the current locale based on the option.
73
+ *
74
+ * @param options - The detailed configuration for the desired date format.
75
+ * @return - The day names from the current locale based on the option.
76
+ */
77
+ dateFormatNames(options: DateFormatNameOptions): any;
78
+ /**
79
+ * Splits the date format into objects which contain
80
+ * information about each part of the pattern.
81
+ *
82
+ * @param format - The format string or options.
83
+ * @returns - The date format parts.
84
+ */
85
+ splitDateFormat(format: string | DateFormatOptions): DateFormatPart[];
86
+ /**
87
+ * Returns the number symbols from the current locale.
88
+ *
89
+ * @return - The number symbols from the current locale.
90
+ */
91
+ numberSymbols(): any;
92
+ /**
93
+ * Returns the first day index, starting from Sunday.
94
+ *
95
+ * @return - The index of the first day of the week (0 == Sunday).
96
+ */
97
+ firstDay(): number;
98
+ }
@@ -0,0 +1,134 @@
1
+ import * as coreIntl from '@progress/kendo-intl';
2
+ /**
3
+ * A service which provides internationalization methods
4
+ * and is bound to a specific locale.
5
+ */
6
+ var IntlService = /** @class */ (function () {
7
+ /**
8
+ * Creates a new instance of the internationalization service.
9
+ *
10
+ * @param locale - The locale that will be used by the internationalization methods.
11
+ */
12
+ function IntlService(locale) {
13
+ this.locale = locale;
14
+ if (locale === '' && process.env.NODE_ENV !== 'production') {
15
+ throw 'Locale should not be empty string';
16
+ }
17
+ }
18
+ /**
19
+ * Formats a string with placeholders such as
20
+ * `Total amount {0:c}`.
21
+ *
22
+ * @param format - The format string.
23
+ * @param values - One or more values to output in the format string placeholders.
24
+ * @return - The formatted string.
25
+ */
26
+ IntlService.prototype.format = function (format) {
27
+ var values = [];
28
+ for (var _i = 1; _i < arguments.length; _i++) {
29
+ values[_i - 1] = arguments[_i];
30
+ }
31
+ /* The following code retains backward compatibility with the old API */
32
+ if (values.length === 1 && Array.isArray(values[0])) {
33
+ return coreIntl.format(format, values[0], this.locale);
34
+ }
35
+ return coreIntl.format(format, values, this.locale);
36
+ };
37
+ /**
38
+ * Converts a `Date` object to a string based on the specified format.
39
+ * If no format is provided, the default short date format is used.
40
+ *
41
+ * @param value - The date which will be formatted.
42
+ * @param format - The format string or options.
43
+ * @return - The formatted date.
44
+ */
45
+ IntlService.prototype.formatDate = function (value, format) {
46
+ return coreIntl.formatDate(value, format, this.locale);
47
+ };
48
+ /**
49
+ * Converts an object to a string based on the specified format.
50
+ *
51
+ * @param value - The value which will be formatted.
52
+ * @param format - The format to use.
53
+ * @return - The formatted object.
54
+ */
55
+ IntlService.prototype.toString = function (value, format) {
56
+ return coreIntl.toString(value, format, this.locale);
57
+ };
58
+ /**
59
+ * Converts a string to a `Number`.
60
+ *
61
+ * @param value - The string which will be parsed.
62
+ * @param format - The format string or options.
63
+ * @return - The parsed number.
64
+ */
65
+ IntlService.prototype.parseNumber = function (value, format) {
66
+ return coreIntl.parseNumber(value, this.locale, format);
67
+ };
68
+ /**
69
+ * Converts a string to a `Date` object based on the specified format.
70
+ *
71
+ * @param value - The string which will be converted.
72
+ * @param format - The format strings or options.
73
+ * @return - The parsed date.
74
+ */
75
+ IntlService.prototype.parseDate = function (value, format) {
76
+ return coreIntl.parseDate(value, format, this.locale);
77
+ };
78
+ /**
79
+ * Converts a `Number` to a string based on the specified format.
80
+ *
81
+ * @param value - The number which will be formatted.
82
+ * @param format - The format string or options.
83
+ * @return - The formatted number.
84
+ */
85
+ IntlService.prototype.formatNumber = function (value, format) {
86
+ return coreIntl.formatNumber(value, format, this.locale);
87
+ };
88
+ /**
89
+ * Returns a localized date field name based on specific `dateFieldName` options.
90
+ *
91
+ * @param options - The detailed configuration for the desired date field name.
92
+ * @returns - The localized date field name from the current locale based on the option.
93
+ */
94
+ IntlService.prototype.dateFieldName = function (options) {
95
+ return coreIntl.dateFieldName(options, this.locale);
96
+ };
97
+ /**
98
+ * Returns the day names from the current locale based on the option.
99
+ *
100
+ * @param options - The detailed configuration for the desired date format.
101
+ * @return - The day names from the current locale based on the option.
102
+ */
103
+ IntlService.prototype.dateFormatNames = function (options) {
104
+ return coreIntl.dateFormatNames(this.locale, options);
105
+ };
106
+ /**
107
+ * Splits the date format into objects which contain
108
+ * information about each part of the pattern.
109
+ *
110
+ * @param format - The format string or options.
111
+ * @returns - The date format parts.
112
+ */
113
+ IntlService.prototype.splitDateFormat = function (format) {
114
+ return coreIntl.splitDateFormat(format, this.locale);
115
+ };
116
+ /**
117
+ * Returns the number symbols from the current locale.
118
+ *
119
+ * @return - The number symbols from the current locale.
120
+ */
121
+ IntlService.prototype.numberSymbols = function () {
122
+ return coreIntl.numberSymbols(this.locale);
123
+ };
124
+ /**
125
+ * Returns the first day index, starting from Sunday.
126
+ *
127
+ * @return - The index of the first day of the week (0 == Sunday).
128
+ */
129
+ IntlService.prototype.firstDay = function () {
130
+ return coreIntl.firstDay(this.locale);
131
+ };
132
+ return IntlService;
133
+ }());
134
+ export { IntlService };
@@ -0,0 +1,4 @@
1
+ import { IntlProvider, IntlProviderVue2 } from './IntlProvider';
2
+ import { IntlProviderProps } from './IntlProviderProps';
3
+ import { IntlService } from './IntlService';
4
+ export { IntlProvider, IntlProviderVue2, IntlProviderProps, IntlService };
@@ -0,0 +1,8 @@
1
+ import { IntlProvider, IntlProviderVue2 } from './IntlProvider.js';
2
+ import { IntlService } from './IntlService.js';
3
+ export { IntlProvider, IntlProviderVue2, IntlService };
4
+ // Automatic installation if Vue has been added to the global scope.
5
+ var vue = 'Vue';
6
+ if (typeof window !== 'undefined' && window[vue] && window[vue].component) {
7
+ window[vue].component('kendo-intl-provider', IntlProvider);
8
+ }
@@ -0,0 +1,49 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
2
+ declare type DefaultMethods<V> = {
3
+ [key: string]: (this: V, ...args: any[]) => any;
4
+ };
5
+ declare type DefaultData<V> = object | ((this: V) => LocalizationProviderData);
6
+ import { LocalizationProviderProps } from './LocalizationProviderProps';
7
+ /**
8
+ * @hidden
9
+ */
10
+ export interface LocalizationProviderMethods {
11
+ [key: string]: any;
12
+ getLocalizationService: () => void;
13
+ getChildContext: () => void;
14
+ }
15
+ /**
16
+ * @hidden
17
+ */
18
+ export interface LocalizationProviderData {
19
+ }
20
+ /**
21
+ * @hidden
22
+ */
23
+ export interface LocalizationProviderAllMethods extends Vue2type, LocalizationProviderMethods {
24
+ }
25
+ /**
26
+ * @hidden
27
+ */
28
+ declare let LocalizationProviderVue2: ComponentOptions<LocalizationProviderAllMethods, DefaultData<LocalizationProviderData>, DefaultMethods<LocalizationProviderAllMethods>, {}, RecordPropsDefinition<LocalizationProviderProps>>;
29
+ /**
30
+ *
31
+ *
32
+ * A Vue component which provides a localization service. Expects a language string as a property of the component.
33
+ *
34
+ *
35
+ * ### props
36
+ * The props of the LocalizationProvider component.
37
+ *
38
+ *
39
+ *
40
+ * ## Methods
41
+ *
42
+ * ### getLocalizationService
43
+ * Returns a localization service. The method is suitable for overriding when you implement custom localization behavior.
44
+ *
45
+ * #### Returns
46
+ * <span class='code'>[LocalizationService]({% slug api_intl_localizationservice %})</span>
47
+ */
48
+ declare const LocalizationProvider: DefineComponent<LocalizationProviderProps, any, LocalizationProviderData, {}, LocalizationProviderMethods, {}, {}, {}, string, LocalizationProviderProps, LocalizationProviderProps, {}>;
49
+ export { LocalizationProvider, LocalizationProviderVue2 };
@@ -0,0 +1,92 @@
1
+ // @ts-ignore
2
+ import * as Vue from 'vue';
3
+ var allVue = Vue;
4
+ var gh = allVue.h;
5
+ var isV3 = allVue.version && allVue.version[0] === '3';
6
+ var ref = allVue.ref;
7
+ var provide = allVue.provide;
8
+ import { LocalizationService } from './LocalizationService.js';
9
+ import { getDefaultSlots } from '@progress/kendo-vue-common';
10
+ /**
11
+ * @hidden
12
+ */
13
+
14
+ var LocalizationProviderVue2 = {
15
+ props: {
16
+ language: String
17
+ },
18
+ data: function data() {
19
+ return this.getChildContext();
20
+ },
21
+ watch: {
22
+ language: function language(newLanguage) {
23
+ this.$data.kendoLocalizationService.language = newLanguage;
24
+ }
25
+ },
26
+ // @ts-ignore
27
+ setup: !isV3 ? undefined : function (props) {
28
+ var v3 = !!isV3;
29
+ var localizationService = ref(new LocalizationService(props.language));
30
+ provide('kendoLocalizationService', localizationService);
31
+ return {
32
+ v3: v3
33
+ };
34
+ },
35
+ provide: function provide() {
36
+ return {
37
+ kendoLocalizationService: this.$data.kendoLocalizationService
38
+ };
39
+ },
40
+ methods: {
41
+ /**
42
+ * Returns a localization service.
43
+ * The method is suitable for overriding when you
44
+ * implement custom localization behavior.
45
+ */
46
+ getLocalizationService: function getLocalizationService() {
47
+ return new LocalizationService(this.$props.language);
48
+ },
49
+
50
+ /**
51
+ * @hidden
52
+ */
53
+ getChildContext: function getChildContext() {
54
+ return {
55
+ kendoLocalizationService: this.getLocalizationService()
56
+ };
57
+ }
58
+ },
59
+
60
+ /**
61
+ * @hidden
62
+ */
63
+ // @ts-ignore
64
+ render: function render(createElement) {
65
+ // @ts-ignore
66
+ var h = gh || createElement;
67
+ var defaultSlot = getDefaultSlots(this);
68
+ return h("div", [defaultSlot]);
69
+ }
70
+ };
71
+ /**
72
+ *
73
+ *
74
+ * A Vue component which provides a localization service. Expects a language string as a property of the component.
75
+ *
76
+ *
77
+ * ### props
78
+ * The props of the LocalizationProvider component.
79
+ *
80
+ *
81
+ *
82
+ * ## Methods
83
+ *
84
+ * ### getLocalizationService
85
+ * Returns a localization service. The method is suitable for overriding when you implement custom localization behavior.
86
+ *
87
+ * #### Returns
88
+ * <span class='code'>[LocalizationService]({% slug api_intl_localizationservice %})</span>
89
+ */
90
+
91
+ var LocalizationProvider = LocalizationProviderVue2;
92
+ export { LocalizationProvider, LocalizationProviderVue2 };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Represents the props of the KendoVue LocalizationProvider component.
3
+ */
4
+ export interface LocalizationProviderProps {
5
+ /**
6
+ * The language that will be used by the child components.
7
+ */
8
+ language: string;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * A service which provides localization methods.
3
+ */
4
+ export declare class LocalizationService {
5
+ private language?;
6
+ constructor(language?: string);
7
+ /**
8
+ * Provides a string based on a key for the current language.
9
+ * When no string for the current language is available under this key,
10
+ * the `defaultValue` is returned.
11
+ *
12
+ * @param key - The key which identifies the string for the current language.
13
+ * @param defaultValue - The default value which will be returned when no string
14
+ * for the current language is available under the key.
15
+ * @return - The string for the current language.
16
+ */
17
+ toLanguageString(key: string, defaultValue: string): string;
18
+ }
@@ -0,0 +1,39 @@
1
+ import { messages } from './messages.js';
2
+ /**
3
+ * A service which provides localization methods.
4
+ */
5
+ var LocalizationService = /** @class */ (function () {
6
+ function LocalizationService(language) {
7
+ this.language = language;
8
+ if (language === '' && process.env.NODE_ENV !== 'production') {
9
+ throw 'Language should not be an empty string';
10
+ }
11
+ }
12
+ /**
13
+ * Provides a string based on a key for the current language.
14
+ * When no string for the current language is available under this key,
15
+ * the `defaultValue` is returned.
16
+ *
17
+ * @param key - The key which identifies the string for the current language.
18
+ * @param defaultValue - The default value which will be returned when no string
19
+ * for the current language is available under the key.
20
+ * @return - The string for the current language.
21
+ */
22
+ LocalizationService.prototype.toLanguageString = function (key, defaultValue) {
23
+ if (this.language &&
24
+ messages[this.language] &&
25
+ messages[this.language].hasOwnProperty(key)) {
26
+ return messages[this.language][key];
27
+ }
28
+ else if (Object.keys(this)[0] &&
29
+ messages[Object.values(this)[0]] &&
30
+ messages[Object.values(this)[0]].hasOwnProperty(key)) {
31
+ return messages[Object.values(this)[0]][key];
32
+ }
33
+ else {
34
+ return defaultValue;
35
+ }
36
+ };
37
+ return LocalizationService;
38
+ }());
39
+ export { LocalizationService };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Provides mechanism to load language-specific messages for the KendoVue components.
3
+ *
4
+ * @param messages - An iterable object which contains key-value pairs.
5
+ * @param languages - The language to which the messages are associated.
6
+ */
7
+ export declare function loadMessages(messages: any, language: string): void;
@@ -0,0 +1,35 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
10
+ import { messages as msg } from './messages.js';
11
+ var traverse = function (iterable, langInfo, acc) {
12
+ for (var key in iterable) {
13
+ if (iterable.hasOwnProperty(key)) {
14
+ var accumulator = __spreadArray([], acc, true);
15
+ accumulator.push(key);
16
+ if (typeof iterable[key] !== 'string') {
17
+ traverse(iterable[key], langInfo, accumulator);
18
+ }
19
+ else {
20
+ var value = iterable[key];
21
+ Object.defineProperty(langInfo, accumulator.join('.'), { value: value });
22
+ }
23
+ }
24
+ }
25
+ };
26
+ /**
27
+ * Provides mechanism to load language-specific messages for the KendoVue components.
28
+ *
29
+ * @param messages - An iterable object which contains key-value pairs.
30
+ * @param languages - The language to which the messages are associated.
31
+ */
32
+ export function loadMessages(messages, language) {
33
+ var langInfo = msg[language] = msg[language] || {};
34
+ traverse(messages, langInfo, []);
35
+ }
@@ -0,0 +1,5 @@
1
+ import { loadMessages } from './loadMessages';
2
+ import { LocalizationProvider, LocalizationProviderVue2 } from './LocalizationProvider';
3
+ import { LocalizationProviderProps } from './LocalizationProviderProps';
4
+ import { LocalizationService } from './LocalizationService';
5
+ export { loadMessages, LocalizationProvider, LocalizationProviderVue2, LocalizationProviderProps, LocalizationService };
@@ -0,0 +1,9 @@
1
+ import { loadMessages } from './loadMessages.js';
2
+ import { LocalizationProvider, LocalizationProviderVue2 } from './LocalizationProvider.js';
3
+ import { LocalizationService } from './LocalizationService.js';
4
+ export { loadMessages, LocalizationProvider, LocalizationProviderVue2, LocalizationService };
5
+ // Automatic installation if Vue has been added to the global scope.
6
+ var vue = 'Vue';
7
+ if (typeof window !== 'undefined' && window[vue] && window[vue].component) {
8
+ window[vue].component('kendo-localization-provider', LocalizationProvider);
9
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export declare const messages: any;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export var messages = Object.create({});
@@ -0,0 +1,21 @@
1
+ // @ts-ignore
2
+ import { DefineComponent } from 'vue';
3
+ // @ts-ignore
4
+ import * as Vue from 'vue';
5
+
6
+ /**
7
+ * @hidden
8
+ */
9
+ // @ts-ignore
10
+ type Vue2type = Vue.default;
11
+
12
+ /**
13
+ * @hidden
14
+ */
15
+ // @ts-ignore
16
+ import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
17
+ /**
18
+ * @hidden
19
+ */
20
+ // @ts-ignore
21
+ export { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type };
@@ -0,0 +1 @@
1
+ export { DateFormatOptions, NumberFormatOptions, DateFieldNameOptions, DateFormatNameOptions, DateFormatPart, load } from '@progress/kendo-intl';
@@ -0,0 +1 @@
1
+ export { load } from '@progress/kendo-intl';
@@ -0,0 +1,21 @@
1
+ import { IntlService } from './Intl/IntlService';
2
+ import { LocalizationService } from './Localization/LocalizationService';
3
+ /**
4
+ * Provides an internationalization service.
5
+ * When the passed component is a direct or indirect child of
6
+ * `IntlProvider`, the returned service uses the locale of the provider.
7
+ * Otherwise, uses `en` as a default locale.
8
+ * To handle locale changes, call the method on each `render`.
9
+ *
10
+ * @param componentClass - The Vue component class that will use the internationalization service.
11
+ */
12
+ export declare function provideIntlService(component: any): IntlService;
13
+ /**
14
+ * Provides a localization service.
15
+ * When the passed component is a direct or indirect child of
16
+ * `LocalizationProvider`, the returned service uses the language of the provider.
17
+ * To handle locale changes, call the method on each `render`.
18
+ *
19
+ * @param componentClass - The Vue component class that will use the internationalization service.
20
+ */
21
+ export declare function provideLocalizationService(component: any): LocalizationService;
@@ -0,0 +1,37 @@
1
+ import { IntlService } from './Intl/IntlService.js';
2
+ import { LocalizationService } from './Localization/LocalizationService.js';
3
+ /**
4
+ * Provides an internationalization service.
5
+ * When the passed component is a direct or indirect child of
6
+ * `IntlProvider`, the returned service uses the locale of the provider.
7
+ * Otherwise, uses `en` as a default locale.
8
+ * To handle locale changes, call the method on each `render`.
9
+ *
10
+ * @param componentClass - The Vue component class that will use the internationalization service.
11
+ */
12
+ export function provideIntlService(component) {
13
+ if (!component && process.env.NODE_ENV !== 'production') {
14
+ throw "Passed component - ".concat(component, " is invalid.");
15
+ }
16
+ var intlServiceFromContext = component.kendoIntlService;
17
+ return (intlServiceFromContext &&
18
+ Object.keys(intlServiceFromContext).some(function (item) { return item === 'locale'; }))
19
+ ? intlServiceFromContext : new IntlService('en');
20
+ }
21
+ /**
22
+ * Provides a localization service.
23
+ * When the passed component is a direct or indirect child of
24
+ * `LocalizationProvider`, the returned service uses the language of the provider.
25
+ * To handle locale changes, call the method on each `render`.
26
+ *
27
+ * @param componentClass - The Vue component class that will use the internationalization service.
28
+ */
29
+ export function provideLocalizationService(component) {
30
+ if (!component && process.env.NODE_ENV !== 'production') {
31
+ throw "Passed component - ".concat(component, " is invalid.");
32
+ }
33
+ var localizationServiceFromContext = component.kendoLocalizationService;
34
+ return (localizationServiceFromContext &&
35
+ Object.keys(localizationServiceFromContext).some(function (item) { return item === 'language'; }))
36
+ ? localizationServiceFromContext : new LocalizationService();
37
+ }
@@ -0,0 +1,4 @@
1
+ export * from './Intl/main';
2
+ export * from './Localization/main';
3
+ export * from './coreExports';
4
+ export * from './intlUtils';
@@ -0,0 +1,4 @@
1
+ export * from './Intl/main.js';
2
+ export * from './Localization/main.js';
3
+ export * from './coreExports.js';
4
+ export * from './intlUtils.js';
@@ -0,0 +1,5 @@
1
+ import { PackageMetadata } from '@progress/kendo-licensing';
2
+ /**
3
+ * @hidden
4
+ */
5
+ export declare const packageMetadata: PackageMetadata;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @hidden
3
+ */
4
+ export var packageMetadata = {
5
+ name: '@progress/kendo-vue-intl',
6
+ productName: 'Kendo UI for Vue',
7
+ productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
8
+ publishDate: 1660543026,
9
+ version: '',
10
+ licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
11
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }