diff --git a/components/lib/basecomponent/BaseComponent.vue b/components/lib/basecomponent/BaseComponent.vue index ea592db41..08cf52ba6 100644 --- a/components/lib/basecomponent/BaseComponent.vue +++ b/components/lib/basecomponent/BaseComponent.vue @@ -15,11 +15,18 @@ export default { return obj[Object.keys(obj).find((k) => ObjectUtils.convertToFlatCase(k) === fKey) || '']; }, + getPTValue(obj = {}, key = '', params = {}) { + const self = ObjectUtils.getItemValue(this.getPTItem(obj, key), params); + const globalComponentPT = this.getPTItem(this.$primevue.config.pt, this.$.type.name); + const global = ObjectUtils.getItemValue(this.getPTItem(globalComponentPT, key), params); + + return { ...global, ...self }; + }, ptm(key = '', params = {}) { - return ObjectUtils.getItemValue(this.getPTItem(this.pt, key), { props: this.$props, state: this.$data, ...params }); + return this.getPTValue(this.pt, key, { props: this.$props, state: this.$data, ...params }); }, ptmo(obj = {}, key = '', params = {}) { - return ObjectUtils.getItemValue(this.getPTItem(obj, key), params); + return this.getPTValue(obj, key, params); } } }; diff --git a/components/lib/config/PrimeVue.d.ts b/components/lib/config/PrimeVue.d.ts index 74450cf0d..a2f177e56 100644 --- a/components/lib/config/PrimeVue.d.ts +++ b/components/lib/config/PrimeVue.d.ts @@ -1,4 +1,6 @@ import { Plugin } from 'vue'; +import { CardPassThroughOptions } from '../card'; +import { PanelPassThroughOptions } from '../panel'; interface PrimeVueConfiguration { ripple?: boolean; @@ -6,6 +8,7 @@ interface PrimeVueConfiguration { locale?: PrimeVueLocaleOptions; filterMatchModeOptions?: any; zIndex?: PrimeVueZIndexOptions; + pt?: PrimeVuePTOptions; } interface PrimeVueZIndexOptions { @@ -15,6 +18,11 @@ interface PrimeVueZIndexOptions { tooltip?: number; } +interface PrimeVuePTOptions { + panel?: PanelPassThroughOptions; + card?: CardPassThroughOptions; +} + interface PrimeVueLocaleAriaOptions { trueLabel?: string; falseLabel?: string; diff --git a/components/lib/config/PrimeVue.js b/components/lib/config/PrimeVue.js index 6f2b2e0a7..06b137fd1 100644 --- a/components/lib/config/PrimeVue.js +++ b/components/lib/config/PrimeVue.js @@ -130,7 +130,8 @@ const defaultOptions = { overlay: 1000, menu: 1000, tooltip: 1100 - } + }, + pt: undefined }; const PrimeVueSymbol = Symbol();