@progress/kendo-vue-intl
Version:
61 lines (60 loc) • 1.57 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 i, createVNode as n, ref as a, provide as r } from "vue";
import { LocalizationService as t } from "./LocalizationService.mjs";
import { getDefaultSlots as c } from "@progress/kendo-vue-common";
const u = /* @__PURE__ */ i({
props: {
language: String
},
data() {
return this.getChildContext();
},
watch: {
language: function(e) {
this.$data.kendoLocalizationService.language = e;
}
},
setup(e) {
const o = a(new t(e.language));
r("kendoLocalizationService", o);
},
provide: function() {
return {
kendoLocalizationService: this.$data.kendoLocalizationService
};
},
methods: {
/**
* Returns a localization service.
* The method is suitable for overriding when you
* implement custom localization behavior.
*/
getLocalizationService() {
return new t(this.$props.language);
},
/**
* @hidden
*/
getChildContext() {
return {
kendoLocalizationService: this.getLocalizationService()
};
}
},
/**
* @hidden
*/
render() {
const e = c(this);
return n("div", null, [e]);
}
});
export {
u as LocalizationProvider
};