@progress/kendo-vue-intl
Version:
65 lines (64 loc) • 1.63 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { defineComponent as n, createVNode as o, ref as i, provide as l } from "vue";
import { IntlService as t } from "./IntlService.mjs";
import { getDefaultSlots as a, validatePackage as c } from "@progress/kendo-vue-common";
import { packageMetadata as d } from "../package-metadata.mjs";
const S = /* @__PURE__ */ n({
props: {
locale: String
},
data() {
return this.getChildContext();
},
setup(e) {
const r = i(new t(e.locale));
l("kendoIntlService", r);
},
watch: {
locale: function(e) {
this.$data.kendoIntlService.locale = e;
}
},
provide: function() {
return {
kendoIntlService: this.$data.kendoIntlService
};
},
methods: {
/**
* Returns an internationalization service.
* The method is suitable for overriding when you
* implement custom internationalization behavior.
*/
getIntlService() {
return new t(this.$props.locale);
},
/**
* @hidden
*/
getChildContext() {
return {
kendoIntlService: this.getIntlService()
};
}
},
created: function() {
c(d);
},
/**
* @hidden
*/
render() {
const e = a(this);
return o("div", null, [e]);
}
});
export {
S as IntlProvider
};