pull/4546/head
mertsincan 2023-10-04 10:20:15 +01:00
parent 4ec4952b97
commit 877d6c07df
13 changed files with 22 additions and 30 deletions

View File

@ -33,16 +33,20 @@ export default {
classes,
inlineStyles,
loadStyle(options = {}) {
return useStyle(this.css, { name: this.name, ...options });
return this.css ? useStyle(this.css, { name: this.name, ...options }) : {};
},
getStyleSheet(extendedCSS = '', props = {}) {
const _props = Object.entries(props)
.reduce((acc, [k, v]) => acc.push(`${k}="${v}"`) && acc, [])
.join(' ');
if (this.css) {
const _props = Object.entries(props)
.reduce((acc, [k, v]) => acc.push(`${k}="${v}"`) && acc, [])
.join(' ');
return `<style type="text/css" data-primevue-style-id="${this.name}" ${_props}>${this.css}${extendedCSS}</style>`;
return `<style type="text/css" data-primevue-style-id="${this.name}" ${_props}>${this.css}${extendedCSS}</style>`;
}
return '';
},
extend(style) {
return { ...this, ...style };
return { ...this, css: undefined, ...style };
}
};

View File

@ -35,6 +35,5 @@ const classes = {
export default BaseStyle.extend({
name: 'button',
classes,
loadStyle: () => {}
classes
});

View File

@ -12,6 +12,5 @@ const classes = {
export default BaseStyle.extend({
name: 'card',
classes,
loadStyle: () => {}
classes
});

View File

@ -22,6 +22,5 @@ const classes = {
export default BaseStyle.extend({
name: 'checkbox',
classes,
loadStyle: () => {}
classes
});

View File

@ -10,6 +10,5 @@ const classes = {
export default BaseStyle.extend({
name: 'confirmdialog',
classes,
loadStyle: () => {}
classes
});

View File

@ -19,6 +19,5 @@ const classes = {
export default BaseStyle.extend({
name: 'dataview',
classes,
loadStyle: () => {}
classes
});

View File

@ -18,6 +18,5 @@ const classes = {
export default BaseStyle.extend({
name: 'dataviewlayoutoptions',
classes,
loadStyle: () => {}
classes
});

View File

@ -11,6 +11,5 @@ const classes = {
export default BaseStyle.extend({
name: 'inputmask',
classes,
loadStyle: () => {}
classes
});

View File

@ -13,6 +13,5 @@ const classes = {
export default BaseStyle.extend({
name: 'inputtext',
classes,
loadStyle: () => {}
classes
});

View File

@ -22,6 +22,5 @@ const classes = {
export default BaseStyle.extend({
name: 'radiobutton',
classes,
loadStyle: () => {}
classes
});

View File

@ -14,6 +14,5 @@ const classes = {
export default BaseStyle.extend({
name: 'selectbutton',
classes,
loadStyle: () => {}
classes
});

View File

@ -22,6 +22,5 @@ const classes = {
export default BaseStyle.extend({
name: 'accordion',
classes,
loadStyle: () => {}
classes
});

View File

@ -24,6 +24,5 @@ const classes = {
export default BaseStyle.extend({
name: 'tristatecheckbox',
classes,
loadStyle: () => {}
classes
});