@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
@@ -0,0 +1,8 @@
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 a=require("react"),s=require("prop-types"),u=require("./IntlService.js"),c=require("../globalization/GlobalizationContext.js");function p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=p(a),i=class i extends r.Component{getIntlService(){return new u.IntlService(this.props.locale)}render(){return r.createElement(c.GlobalizationContext.Consumer,null,t=>r.createElement(c.GlobalizationContext.Provider,{value:{...t,intl:this.getIntlService()}},this.props.children))}};i.propTypes={locale:s.string};let o=i;exports.IntlProvider=o;
@@ -0,0 +1,33 @@
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";
9
+ import * as e from "react";
10
+ import i from "prop-types";
11
+ import { IntlService as l } from "./IntlService.mjs";
12
+ import { GlobalizationContext as r } from "../globalization/GlobalizationContext.mjs";
13
+ const t = class t extends e.Component {
14
+ /**
15
+ * Returns an internationalization service. The method is suitable for overriding when you implement custom internationalization behavior.
16
+ */
17
+ getIntlService() {
18
+ return new l(this.props.locale);
19
+ }
20
+ /**
21
+ * @hidden
22
+ */
23
+ render() {
24
+ return /* @__PURE__ */ e.createElement(r.Consumer, null, (n) => /* @__PURE__ */ e.createElement(r.Provider, { value: { ...n, intl: this.getIntlService() } }, this.props.children));
25
+ }
26
+ };
27
+ t.propTypes = {
28
+ locale: i.string
29
+ };
30
+ let o = t;
31
+ export {
32
+ o as IntlProvider
33
+ };
@@ -0,0 +1,8 @@
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 l=require("@progress/kendo-intl"),n=require("@progress/kendo-react-common"),c=require("../package-metadata.js");function i(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const r=i(l);class s{constructor(e){if(this.locale=e,n.validatePackage(c.packageMetadata),e===""&&process.env.NODE_ENV!=="production")throw"Locale should not be empty string"}format(e,...t){return t.length===1&&Array.isArray(t[0])?r.format(e,t[0],this.locale):r.format(e,t,this.locale)}formatDate(e,t){return r.formatDate(e,t,this.locale)}toString(e,t){return r.toString(e,t,this.locale)}parseNumber(e,t){return r.parseNumber(e,this.locale,t)}parseDate(e,t){return r.parseDate(e,t,this.locale)}formatNumber(e,t){return r.formatNumber(e,t,this.locale)}dateFieldName(e){return r.dateFieldName(e,this.locale)}dateFormatNames(e){return r.dateFormatNames(this.locale,e)}splitDateFormat(e){return r.splitDateFormat(e,this.locale)}numberSymbols(){return r.numberSymbols(this.locale)}firstDay(){return r.firstDay(this.locale)}localeInfo(){return r.localeInfo(this.locale)}localeCurrency(){return r.localeCurrency(this.locale)}}exports.IntlService=s;
@@ -0,0 +1,140 @@
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";
9
+ import * as e from "@progress/kendo-intl";
10
+ import { validatePackage as a } from "@progress/kendo-react-common";
11
+ import { packageMetadata as o } from "../package-metadata.mjs";
12
+ class c {
13
+ /**
14
+ * Creates a new instance of the internationalization service.
15
+ *
16
+ * @param locale - The locale that will be used by the internationalization methods.
17
+ */
18
+ constructor(r) {
19
+ if (this.locale = r, a(o), r === "" && process.env.NODE_ENV !== "production")
20
+ throw "Locale should not be empty string";
21
+ }
22
+ /**
23
+ * Formats a string with placeholders such as `Total amount {0:c}`.
24
+ *
25
+ * @param format - The format string.
26
+ * @param values - One or more values to output in the format string placeholders.
27
+ * @return - The formatted string.
28
+ */
29
+ format(r, ...t) {
30
+ return t.length === 1 && Array.isArray(t[0]) ? e.format(r, t[0], this.locale) : e.format(r, t, this.locale);
31
+ }
32
+ /**
33
+ * Converts a `Date` object to a string based on the specified format. If no format is provided, the default short date format is used.
34
+ *
35
+ * @param value - The date which will be formatted.
36
+ * @param format - The format string or options.
37
+ * @return - The formatted date.
38
+ */
39
+ formatDate(r, t) {
40
+ return e.formatDate(r, t, this.locale);
41
+ }
42
+ /**
43
+ * Converts an object to a string based on the specified format.
44
+ *
45
+ * @param value - The value which will be formatted.
46
+ * @param format - The format to use.
47
+ * @return - The formatted object.
48
+ */
49
+ toString(r, t) {
50
+ return e.toString(r, t, this.locale);
51
+ }
52
+ /**
53
+ * Converts a string to a `Number`.
54
+ *
55
+ * @param value - The string which will be parsed.
56
+ * @param format - The format string or options.
57
+ * @return - The parsed number.
58
+ */
59
+ parseNumber(r, t) {
60
+ return e.parseNumber(r, this.locale, t);
61
+ }
62
+ /**
63
+ * Converts a string to a `Date` object based on the specified format.
64
+ *
65
+ * @param value - The string which will be converted.
66
+ * @param format - The format strings or options.
67
+ * @return - The parsed date.
68
+ */
69
+ parseDate(r, t) {
70
+ return e.parseDate(r, t, this.locale);
71
+ }
72
+ /**
73
+ * Converts a `Number` to a string based on the specified format.
74
+ *
75
+ * @param value - The number which will be formatted.
76
+ * @param format - The format string or options.
77
+ * @return - The formatted number.
78
+ */
79
+ formatNumber(r, t) {
80
+ return e.formatNumber(r, t, this.locale);
81
+ }
82
+ /**
83
+ * Returns a localized date field name based on specific `dateFieldName` options.
84
+ *
85
+ * @param options - The detailed configuration for the desired date field name.
86
+ * @returns - The localized date field name from the current locale based on the option.
87
+ */
88
+ dateFieldName(r) {
89
+ return e.dateFieldName(r, this.locale);
90
+ }
91
+ /**
92
+ * Returns the day names from the current locale based on the option.
93
+ *
94
+ * @param options - The detailed configuration for the desired date format.
95
+ * @return - The day names from the current locale based on the option.
96
+ */
97
+ dateFormatNames(r) {
98
+ return e.dateFormatNames(this.locale, r);
99
+ }
100
+ /**
101
+ * Splits the date format into objects which contain information about each part of the pattern.
102
+ *
103
+ * @param format - The format string or options.
104
+ * @returns - The date format parts.
105
+ */
106
+ splitDateFormat(r) {
107
+ return e.splitDateFormat(r, this.locale);
108
+ }
109
+ /**
110
+ * Returns the number symbols from the current locale.
111
+ *
112
+ * @return - The number symbols from the current locale.
113
+ */
114
+ numberSymbols() {
115
+ return e.numberSymbols(this.locale);
116
+ }
117
+ /**
118
+ * Returns the first day index, starting from Sunday.
119
+ *
120
+ * @return - The index of the first day of the week (0 == Sunday).
121
+ */
122
+ firstDay() {
123
+ return e.firstDay(this.locale);
124
+ }
125
+ /**
126
+ * @hidden
127
+ */
128
+ localeInfo() {
129
+ return e.localeInfo(this.locale);
130
+ }
131
+ /**
132
+ * @hidden
133
+ */
134
+ localeCurrency() {
135
+ return e.localeCurrency(this.locale);
136
+ }
137
+ }
138
+ export {
139
+ c as IntlService
140
+ };
@@ -0,0 +1,8 @@
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 l=require("react"),s=require("prop-types"),u=require("./LocalizationService.js"),c=require("../globalization/GlobalizationContext.js");function p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=p(l),i=class i extends r.Component{getLocalizationService(){return new u.LocalizationService(this.props.language)}render(){return r.createElement(c.GlobalizationContext.Consumer,null,t=>r.createElement(c.GlobalizationContext.Provider,{value:{...t,localization:this.getLocalizationService()}},this.props.children))}};i.propTypes={language:s.string};let o=i;exports.LocalizationProvider=o;
@@ -0,0 +1,33 @@
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";
9
+ import * as e from "react";
10
+ import n from "prop-types";
11
+ import { LocalizationService as a } from "./LocalizationService.mjs";
12
+ import { GlobalizationContext as r } from "../globalization/GlobalizationContext.mjs";
13
+ const t = class t extends e.Component {
14
+ /**
15
+ * Returns a localization service. The method is suitable for overriding when you implement custom localization behavior.
16
+ */
17
+ getLocalizationService() {
18
+ return new a(this.props.language);
19
+ }
20
+ /**
21
+ * @hidden
22
+ */
23
+ render() {
24
+ return /* @__PURE__ */ e.createElement(r.Consumer, null, (i) => /* @__PURE__ */ e.createElement(r.Provider, { value: { ...i, localization: this.getLocalizationService() } }, this.props.children));
25
+ }
26
+ };
27
+ t.propTypes = {
28
+ language: n.string
29
+ };
30
+ let o = t;
31
+ export {
32
+ o as LocalizationProvider
33
+ };
@@ -0,0 +1,8 @@
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 s=require("./messages.js");class a{constructor(e){if(this.language=e,e===""&&process.env.NODE_ENV!=="production")throw"Language should not be an empty string"}toLanguageString(e,t){return this.language&&s.messages[this.language]&&s.messages[this.language].hasOwnProperty(e)?s.messages[this.language][e]:t}}exports.LocalizationService=a;
@@ -0,0 +1,31 @@
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";
9
+ import { messages as t } from "./messages.mjs";
10
+ class r {
11
+ constructor(e) {
12
+ if (this.language = e, e === "" && process.env.NODE_ENV !== "production")
13
+ throw "Language should not be an empty string";
14
+ }
15
+ /* eslint-disable max-len */
16
+ /**
17
+ * 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.
18
+ *
19
+ * @param key - The key which identifies the string for the current language.
20
+ * @param defaultValue - The default value which will be returned when no string
21
+ * for the current language is available under the key.
22
+ * @return - The string for the current language.
23
+ */
24
+ // tslint:enable:max-line-length
25
+ toLanguageString(e, a) {
26
+ return this.language && t[this.language] && t[this.language].hasOwnProperty(e) ? t[this.language][e] : a;
27
+ }
28
+ }
29
+ export {
30
+ r as LocalizationService
31
+ };
@@ -0,0 +1,8 @@
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 c=require("./messages.js"),r=(s,e,t)=>{for(const o in s)if(s.hasOwnProperty(o)){const n=[...t];if(n.push(o),typeof s[o]!="string")r(s[o],e,n);else{const u=s[o];Object.defineProperty(e,n.join("."),{value:u})}}};function a(s,e){let t=c.messages[e]=c.messages[e]||{};r(s,t,[])}exports.loadMessages=a;
@@ -0,0 +1,28 @@
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";
9
+ import { messages as c } from "./messages.mjs";
10
+ const r = (s, o, e) => {
11
+ for (const t in s)
12
+ if (s.hasOwnProperty(t)) {
13
+ const n = [...e];
14
+ if (n.push(t), typeof s[t] != "string")
15
+ r(s[t], o, n);
16
+ else {
17
+ const f = s[t];
18
+ Object.defineProperty(o, n.join("."), { value: f });
19
+ }
20
+ }
21
+ };
22
+ function i(s, o) {
23
+ let e = c[o] = c[o] || {};
24
+ r(s, e, []);
25
+ }
26
+ export {
27
+ i as loadMessages
28
+ };
@@ -0,0 +1,8 @@
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 e=Object.create({});exports.messages=e;
@@ -0,0 +1,12 @@
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";
9
+ const e = /* @__PURE__ */ Object.create({});
10
+ export {
11
+ e as messages
12
+ };
@@ -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
- (function(o,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("react"),require("@progress/kendo-intl"),require("@progress/kendo-react-common"),require("prop-types")):typeof define=="function"&&define.amd?define(["exports","react","@progress/kendo-intl","@progress/kendo-react-common","prop-types"],l):(o=typeof globalThis!="undefined"?globalThis:o||self,l(o.KendoReactIntl={},o.React,o.KendoIntl,o.KendoReactCommon,o.PropTypes))})(this,function(o,l,m,z,f){"use strict";"use client";function g(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,c.get?c:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const i=g(l),r=g(m),S={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 u{constructor(e){if(this.locale=e,z.validatePackage(S),e===""&&process.env.NODE_ENV!=="production")throw"Locale should not be empty string"}format(e,...n){return n.length===1&&Array.isArray(n[0])?r.format(e,n[0],this.locale):r.format(e,n,this.locale)}formatDate(e,n){return r.formatDate(e,n,this.locale)}toString(e,n){return r.toString(e,n,this.locale)}parseNumber(e,n){return r.parseNumber(e,this.locale,n)}parseDate(e,n){return r.parseDate(e,n,this.locale)}formatNumber(e,n){return r.formatNumber(e,n,this.locale)}dateFieldName(e){return r.dateFieldName(e,this.locale)}dateFormatNames(e){return r.dateFormatNames(this.locale,e)}splitDateFormat(e){return r.splitDateFormat(e,this.locale)}numberSymbols(){return r.numberSymbols(this.locale)}firstDay(){return r.firstDay(this.locale)}localeInfo(){return r.localeInfo(this.locale)}localeCurrency(){return r.localeCurrency(this.locale)}}const s=Object.create({});class d{constructor(e){if(this.language=e,e===""&&process.env.NODE_ENV!=="production")throw"Language should not be an empty string"}toLanguageString(e,n){return this.language&&s[this.language]&&s[this.language].hasOwnProperty(e)?s[this.language][e]:n}}const a=i.createContext({intl:new u("en"),localization:new d});class h extends i.Component{getIntlService(){return new u(this.props.locale)}render(){return i.createElement(a.Consumer,null,e=>i.createElement(a.Provider,{value:{...e,intl:this.getIntlService()}},this.props.children))}}h.propTypes={locale:f.string};const v=(t,e,n)=>{for(const c in t)if(t.hasOwnProperty(c)){const p=[...n];if(p.push(c),typeof t[c]!="string")v(t[c],e,p);else{const w=t[c];Object.defineProperty(e,p.join("."),{value:w})}}};function N(t,e){let n=s[e]=s[e]||{};v(t,n,[])}class y extends i.Component{getLocalizationService(){return new d(this.props.language)}render(){return i.createElement(a.Consumer,null,e=>i.createElement(a.Provider,{value:{...e,localization:this.getLocalizationService()}},this.props.children))}}y.propTypes={language:f.string};function b(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 u("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 d}function I(t){t.contextType=a}function O(t){t.contextType=a}const E=()=>i.useContext(a).intl,P=()=>i.useContext(a).localization;Object.defineProperty(o,"load",{enumerable:!0,get:()=>m.load}),o.GlobalizationContext=a,o.IntlProvider=h,o.IntlService=u,o.LocalizationProvider=y,o.LocalizationService=d,o.loadMessages=N,o.localizationMessages=s,o.provideIntlService=b,o.provideLocalizationService=D,o.registerForIntl=I,o.registerForLocalization=O,o.useInternationalization=E,o.useLocalization=P,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
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
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-intl"),require("@progress/kendo-react-common"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-intl","@progress/kendo-react-common","prop-types"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactIntl={},e.React,e.KendoIntl,e.KendoReactCommon,e.PropTypes)}(this,(function(e,t,n,o,r){"use strict";function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=a(t),l=a(n);const s={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 c{constructor(e){if(this.locale=e,o.validatePackage(s),""===e&&"production"!==process.env.NODE_ENV)throw"Locale should not be empty string"}format(e,...t){return 1===t.length&&Array.isArray(t[0])?l.format(e,t[0],this.locale):l.format(e,t,this.locale)}formatDate(e,t){return l.formatDate(e,t,this.locale)}toString(e,t){return l.toString(e,t,this.locale)}parseNumber(e,t){return l.parseNumber(e,this.locale,t)}parseDate(e,t){return l.parseDate(e,t,this.locale)}formatNumber(e,t){return l.formatNumber(e,t,this.locale)}dateFieldName(e){return l.dateFieldName(e,this.locale)}dateFormatNames(e){return l.dateFormatNames(this.locale,e)}splitDateFormat(e){return l.splitDateFormat(e,this.locale)}numberSymbols(){return l.numberSymbols(this.locale)}firstDay(){return l.firstDay(this.locale)}localeInfo(){return l.localeInfo(this.locale)}localeCurrency(){return l.localeCurrency(this.locale)}}const u=Object.create({});let p=class{constructor(e){if(this.language=e,""===e&&"production"!==process.env.NODE_ENV)throw"Language should not be an empty string"}toLanguageString(e,t){return this.language&&u[this.language]&&u[this.language].hasOwnProperty(e)?u[this.language][e]:t}};const d=i.createContext({intl:new c("en"),localization:new p});const m=class extends i.Component{getIntlService(){return new c(this.props.locale)}render(){return i.createElement(d.Consumer,null,(e=>i.createElement(d.Provider,{value:{...e,intl:this.getIntlService()}},this.props.children)))}};m.propTypes={locale:r.string};let f=m;const g=(e,t,n)=>{for(const o in e)if(e.hasOwnProperty(o)){const r=[...n];if(r.push(o),"string"!=typeof e[o])g(e[o],t,r);else{const n=e[o];Object.defineProperty(t,r.join("."),{value:n})}}};const h=class extends i.Component{getLocalizationService(){return new p(this.props.language)}render(){return i.createElement(d.Consumer,null,(e=>i.createElement(d.Provider,{value:{...e,localization:this.getLocalizationService()}},this.props.children)))}};h.propTypes={language:r.string};let y=h;Object.defineProperty(e,"load",{enumerable:!0,get:function(){return n.load}}),e.GlobalizationContext=d,e.IntlProvider=f,e.IntlService=c,e.LocalizationProvider=y,e.LocalizationService=p,e.loadMessages=function(e,t){let n=u[t]=u[t]||{};g(e,n,[])},e.localizationMessages=u,e.provideIntlService=function(e){if(!e&&"production"!==process.env.NODE_ENV)throw`Passed component - ${e} is invalid.`;const t=e.context;return t&&t.intl?t.intl:new c("en")},e.provideLocalizationService=function(e){if(!e&&"production"!==process.env.NODE_ENV)throw`Passed component - ${e} is invalid.`;const t=e.context;return t&&t.localization?t.localization:new p},e.registerForIntl=function(e){e.contextType=d},e.registerForLocalization=function(e){e.contextType=d},e.useInternationalization=()=>i.useContext(d).intl,e.useLocalization=()=>i.useContext(d).localization}));
@@ -0,0 +1,8 @@
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 c=require("react"),i=require("../Intl/IntlService.js"),r=require("../Localization/LocalizationService.js");function a(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const l=a(c),u=l.createContext({intl:new i.IntlService("en"),localization:new r.LocalizationService});exports.GlobalizationContext=u;
@@ -0,0 +1,18 @@
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";
9
+ import * as t from "react";
10
+ import { IntlService as o } from "../Intl/IntlService.mjs";
11
+ import { LocalizationService as e } from "../Localization/LocalizationService.mjs";
12
+ const r = t.createContext({
13
+ intl: new o("en"),
14
+ localization: new e()
15
+ });
16
+ export {
17
+ r as GlobalizationContext
18
+ };
@@ -0,0 +1,8 @@
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 a=require("react"),i=require("../globalization/GlobalizationContext.js");function r(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=r(a),l=()=>c.useContext(i.GlobalizationContext).intl;exports.useInternationalization=l;
@@ -0,0 +1,14 @@
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";
9
+ import * as t from "react";
10
+ import { GlobalizationContext as o } from "../globalization/GlobalizationContext.mjs";
11
+ const e = () => t.useContext(o).intl;
12
+ export {
13
+ e as useInternationalization
14
+ };
@@ -0,0 +1,8 @@
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 a=require("react"),c=require("../globalization/GlobalizationContext.js");function i(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const r=i(a),l=()=>r.useContext(c.GlobalizationContext).localization;exports.useLocalization=l;
@@ -0,0 +1,14 @@
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";
9
+ import * as o from "react";
10
+ import { GlobalizationContext as t } from "../globalization/GlobalizationContext.mjs";
11
+ const a = () => o.useContext(t).localization;
12
+ export {
13
+ a as useLocalization
14
+ };