Fixed #3902 - Add global pt option to PrimeVue config
parent
2b40ff3dd2
commit
bd97a3e733
|
@ -15,11 +15,18 @@ export default {
|
||||||
|
|
||||||
return obj[Object.keys(obj).find((k) => ObjectUtils.convertToFlatCase(k) === fKey) || ''];
|
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 = {}) {
|
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 = {}) {
|
ptmo(obj = {}, key = '', params = {}) {
|
||||||
return ObjectUtils.getItemValue(this.getPTItem(obj, key), params);
|
return this.getPTValue(obj, key, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import { Plugin } from 'vue';
|
import { Plugin } from 'vue';
|
||||||
|
import { CardPassThroughOptions } from '../card';
|
||||||
|
import { PanelPassThroughOptions } from '../panel';
|
||||||
|
|
||||||
interface PrimeVueConfiguration {
|
interface PrimeVueConfiguration {
|
||||||
ripple?: boolean;
|
ripple?: boolean;
|
||||||
|
@ -6,6 +8,7 @@ interface PrimeVueConfiguration {
|
||||||
locale?: PrimeVueLocaleOptions;
|
locale?: PrimeVueLocaleOptions;
|
||||||
filterMatchModeOptions?: any;
|
filterMatchModeOptions?: any;
|
||||||
zIndex?: PrimeVueZIndexOptions;
|
zIndex?: PrimeVueZIndexOptions;
|
||||||
|
pt?: PrimeVuePTOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PrimeVueZIndexOptions {
|
interface PrimeVueZIndexOptions {
|
||||||
|
@ -15,6 +18,11 @@ interface PrimeVueZIndexOptions {
|
||||||
tooltip?: number;
|
tooltip?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface PrimeVuePTOptions {
|
||||||
|
panel?: PanelPassThroughOptions;
|
||||||
|
card?: CardPassThroughOptions;
|
||||||
|
}
|
||||||
|
|
||||||
interface PrimeVueLocaleAriaOptions {
|
interface PrimeVueLocaleAriaOptions {
|
||||||
trueLabel?: string;
|
trueLabel?: string;
|
||||||
falseLabel?: string;
|
falseLabel?: string;
|
||||||
|
|
|
@ -130,7 +130,8 @@ const defaultOptions = {
|
||||||
overlay: 1000,
|
overlay: 1000,
|
||||||
menu: 1000,
|
menu: 1000,
|
||||||
tooltip: 1100
|
tooltip: 1100
|
||||||
}
|
},
|
||||||
|
pt: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
const PrimeVueSymbol = Symbol();
|
const PrimeVueSymbol = Symbol();
|
||||||
|
|
Loading…
Reference in New Issue