diff --git a/components/lib/accordion/Accordion.vue b/components/lib/accordion/Accordion.vue index ad7ed2954..8d5af609a 100755 --- a/components/lib/accordion/Accordion.vue +++ b/components/lib/accordion/Accordion.vue @@ -52,6 +52,7 @@ import ChevronDownIcon from 'primevue/icons/chevrondown'; import ChevronRightIcon from 'primevue/icons/chevronright'; import Ripple from 'primevue/ripple'; import { DomHandler, UniqueComponentId } from 'primevue/utils'; +import { mergeProps } from 'vue'; import BaseAccordion from './BaseAccordion.vue'; export default { @@ -111,7 +112,7 @@ export default { } }; - return { ...this.ptm(`tab.${key}`, { tab: tabMetaData }), ...this.ptmo(this.getTabProp(tab, 'pt'), key, tabMetaData) }; + return mergeProps(this.ptm(`tab.${key}`, { tab: tabMetaData }), this.ptm(`accordiontab.${key}`, tabMetaData), this.ptmo(this.getTabProp(tab, 'pt'), key, tabMetaData)); }, onTabClick(event, tab, index) { this.changeActiveIndex(event, tab, index); diff --git a/components/lib/basecomponent/BaseComponent.vue b/components/lib/basecomponent/BaseComponent.vue index 26845f831..3be22191b 100644 --- a/components/lib/basecomponent/BaseComponent.vue +++ b/components/lib/basecomponent/BaseComponent.vue @@ -455,7 +455,7 @@ export default { const datasetPrefix = 'data-pc-'; const self = getValue(obj, key, params); - const globalPT = searchInDefaultPT ? getValue(this.defaultPT, key, params) : undefined; + const globalPT = searchInDefaultPT ? getValue(this.defaultPT, key, params) || (/./g.test(key) && !!params[key.split('.')[0]] ? getValue(this.globalPT, key, params) : undefined) : undefined; const merged = mergeProps(self, globalPT, { ...(key === 'root' && { [`${datasetPrefix}name`]: ObjectUtils.toFlatCase(this.$.type.name) }), [`${datasetPrefix}section`]: ObjectUtils.toFlatCase(key) @@ -489,8 +489,11 @@ export default { } }, computed: { + globalPT() { + return ObjectUtils.getItemValue(this.$primevue.config.pt, { instance: this }); + }, defaultPT() { - return this._getOptionValue(this.$primevue.config.pt, this.$options.hostName || this.$.type.name, { instance: this }); + return this._getOptionValue(this.$primevue.config.pt, this.$options.hostName || this.$.type.name, { instance: this }) || this.globalPT; }, isUnstyled() { return this.unstyled !== undefined ? this.unstyled : this.$primevue.config.unstyled; diff --git a/components/lib/datatable/BodyCell.vue b/components/lib/datatable/BodyCell.vue index 666f173ea..61617b452 100755 --- a/components/lib/datatable/BodyCell.vue +++ b/components/lib/datatable/BodyCell.vue @@ -86,6 +86,7 @@ import TimesIcon from 'primevue/icons/times'; import OverlayEventBus from 'primevue/overlayeventbus'; import Ripple from 'primevue/ripple'; import { DomHandler, ObjectUtils } from 'primevue/utils'; +import { mergeProps } from 'vue'; import RowCheckbox from './RowCheckbox.vue'; import RowRadioButton from './RowRadioButton.vue'; @@ -217,7 +218,7 @@ export default { } }; - return { ...this.ptm(`column.${key}`, { column: columnMetaData }), ...this.ptmo(this.getColumnProp(), key, columnMetaData) }; + return mergeProps(this.ptm(`column.${key}`, { column: columnMetaData }), this.ptm(`column.${key}`, columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); }, getColumnProp() { return this.column.props && this.column.props.pt ? this.column.props.pt : undefined; diff --git a/components/lib/datatable/FooterCell.vue b/components/lib/datatable/FooterCell.vue index 7c2ac29c0..934235b7e 100644 --- a/components/lib/datatable/FooterCell.vue +++ b/components/lib/datatable/FooterCell.vue @@ -8,6 +8,7 @@