Theming API: Added theme:load and theme:[data-primevue-style-id]:load emits to ThemeService

This commit is contained in:
mertsincan 2024-04-16 11:15:21 +01:00
parent 7055387be4
commit 9303e9c3ab
3 changed files with 36 additions and 4 deletions

View file

@ -40,7 +40,9 @@ export default {
return css ? useStyle(ObjectUtils.minifyCSS(css), { name: this.name, ...options }) : {};
},
loadTheme(theme, options = {}) {
return theme ? useStyle(ObjectUtils.minifyCSS(theme), { name: this.name, ...options }) : {};
const callbacks = { onMounted: (name) => Theme.onStyleMounted(name), onUpdated: (name) => Theme.onStyleUpdated(name), onLoad: (event, options) => Theme.onStyleLoaded(event, options) };
return theme ? useStyle(ObjectUtils.minifyCSS(theme), { name: this.name, ...options, ...callbacks }) : {};
},
getCommonThemeCSS(params) {
return Theme.getCommonCSS(this.name, params);