diff --git a/components/lib/basecomponent/BaseComponent.vue b/components/lib/basecomponent/BaseComponent.vue
index 627db1196..b7ec02fc5 100644
--- a/components/lib/basecomponent/BaseComponent.vue
+++ b/components/lib/basecomponent/BaseComponent.vue
@@ -27,6 +27,19 @@ export default {
default: undefined
}
},
+ inject: {
+ $parentInstance: {
+ default: undefined
+ }
+ },
+ watch: {
+ isUnstyled: {
+ immediate: true,
+ handler(newValue) {
+ !newValue && this.$options.css && this.$css.loadStyle();
+ }
+ }
+ },
methods: {
_getOptionValue(options, key = '', params = {}) {
const fKeys = ObjectUtils.convertToFlatCase(key).split('.');
@@ -61,16 +74,12 @@ export default {
return this._getPTValue(obj, key, params);
},
cx(key = '', params = {}) {
- return !this.isUnstyled ? this._getOptionValue(this.$options.css && this.$options.css.classes, key, { instance: this, props: this.$props, state: this.$data, ...params }) : undefined;
- },
- cxo(obj = {}, key = '', params = {}) {
- // @todo
- return !this.isUnstyled ? this._getOptionValue(obj.css && obj.css.classes, key, { instance: obj, props: obj && obj.props, state: obj && obj.data, ...params }) : undefined;
+ return !this.isUnstyled ? this._getOptionValue(this.$css.classes, key, { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance, ...params }) : undefined;
},
sx(key = '', when = true, params = {}) {
if (when) {
- const self = this._getOptionValue(this.$options.css && this.$options.css.inlineStyles, key, { instance: this, props: this.$props, state: this.$data, ...params });
- const base = this._getOptionValue(inlineStyles, key, { instance: this, props: this.$props, state: this.$data, ...params });
+ const self = this._getOptionValue(this.$css.inlineStyles, key, { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance, ...params });
+ const base = this._getOptionValue(inlineStyles, key, { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance, ...params });
return [base, self];
}
@@ -80,13 +89,13 @@ export default {
},
computed: {
defaultPT() {
- return this._getOptionValue(this.$primevue.config.pt, this.$.type.name, this.defaultsParams);
- },
- defaultsParams() {
- return { instance: this };
+ return this._getOptionValue(this.$primevue.config.pt, this.$.type.name, { instance: this });
},
isUnstyled() {
return this.unstyled !== undefined ? this.unstyled : this.$primevue.config.unstyled;
+ },
+ $css() {
+ return { classes: undefined, inlineStyles: undefined, loadStyle: () => {}, ...(this.$parentInstance || {}).$css, ...this.$options.css };
}
}
};
diff --git a/components/lib/breadcrumb/BaseBreadcrumb.vue b/components/lib/breadcrumb/BaseBreadcrumb.vue
index 87cf9f38b..c9d72908f 100644
--- a/components/lib/breadcrumb/BaseBreadcrumb.vue
+++ b/components/lib/breadcrumb/BaseBreadcrumb.vue
@@ -41,19 +41,19 @@ const classes = {
menu: 'p-breadcrumb-list',
home: 'p-breadcrumb-home',
separator: 'p-menuitem-separator',
- menuitem: ({ context }) => ['p-menuitem', { 'p-disabled': context.disabled() }],
- action: ({ context, isActive, isExactActive }) => [
+ menuitem: ({ instance }) => ['p-menuitem', { 'p-disabled': instance.disabled() }],
+ action: ({ instance, isActive, isExactActive }) => [
'p-menuitem-link',
{
'router-link-active': isActive,
- 'router-link-active-exact': context.exact && isExactActive
+ 'router-link-active-exact': instance.exact && isExactActive
}
],
icon: 'p-menuitem-icon',
label: 'p-menuitem-text'
};
-const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_breadcrumb_style', manual: true });
+const { load: loadStyle } = useStyle(styles, { id: 'primevue_breadcrumb_style', manual: true });
export default {
name: 'BaseBreadcrumb',
@@ -73,15 +73,13 @@ export default {
}
},
css: {
- classes
+ classes,
+ loadStyle
},
- watch: {
- isUnstyled: {
- immediate: true,
- handler(newValue) {
- !newValue && loadStyle();
- }
- }
+ provide() {
+ return {
+ $parentInstance: this
+ };
}
};
diff --git a/components/lib/breadcrumb/BreadcrumbItem.vue b/components/lib/breadcrumb/BreadcrumbItem.vue
index acdaf09eb..bae64ad74 100755
--- a/components/lib/breadcrumb/BreadcrumbItem.vue
+++ b/components/lib/breadcrumb/BreadcrumbItem.vue
@@ -1,17 +1,17 @@
-
+
-
-
-
- {{ label() }}
+
+
+
+ {{ label() }}
-
-
-
- {{ label() }}
+
+
+
+ {{ label() }}
@@ -19,11 +19,11 @@
diff --git a/components/lib/cascadeselect/CascadeSelectSub.vue b/components/lib/cascadeselect/CascadeSelectSub.vue
index 969f22bf2..87fb71048 100644
--- a/components/lib/cascadeselect/CascadeSelectSub.vue
+++ b/components/lib/cascadeselect/CascadeSelectSub.vue
@@ -3,7 +3,7 @@
diff --git a/components/lib/toast/ToastMessage.vue b/components/lib/toast/ToastMessage.vue
index 0590e2247..cbabd9978 100755
--- a/components/lib/toast/ToastMessage.vue
+++ b/components/lib/toast/ToastMessage.vue
@@ -19,13 +19,13 @@