Skip to content

Commit

Permalink
Refactor #3965 - For Calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed May 19, 2023
1 parent 9e1f1b5 commit b13d188
Show file tree
Hide file tree
Showing 5 changed files with 643 additions and 505 deletions.
28 changes: 27 additions & 1 deletion components/lib/basecomponent/BaseComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
import { ObjectUtils } from 'primevue/utils';
import { mergeProps } from 'vue';
const inlineStyles = {
hiddenAccessible: {
border: '0',
clip: 'rect(0 0 0 0)',
height: '1px',
margin: '-1px',
overflow: 'hidden',
padding: '0',
position: 'absolute',
width: '1px'
}
};
export default {
name: 'BaseComponent',
props: {
Expand Down Expand Up @@ -37,14 +50,27 @@ export default {
},
ptmo(obj = {}, key = '', params = {}) {
return this.getPTValue(obj, key, params);
},
css(key = '', params = {}) {
return !this.isUnstyled ? ObjectUtils.getItemValue(this.getOption(this.$options.style && this.$options.style.classes, key), { instance: this, props: this.$props, state: this.$data, ...params }) : undefined;
},
style(key = '', when = true, params = {}) {
if (when) {
const self = ObjectUtils.getItemValue(this.getOption(this.$options.style && this.$options.style.inlineStyles, key), { instance: this, props: this.$props, state: this.$data, ...params });
const base = ObjectUtils.getItemValue(this.getOption(inlineStyles, key), { instance: this, props: this.$props, state: this.$data, ...params });
return [base, self];
}
return undefined;
}
},
computed: {
defaultPT() {
return ObjectUtils.getItemValue(this.getOption(this.$primevue.config.pt, this.$.type.name), this.defaultsParams);
},
defaultsParams() {
return { instance: this.$ };
return { instance: this };
},
isUnstyled() {
return this.unstyled !== undefined ? this.unstyled : this.$primevue.config.unstyled;
Expand Down
Loading

0 comments on commit b13d188

Please sign in to comment.