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, classes,
inlineStyles, inlineStyles,
loadStyle(options = {}) { loadStyle(options = {}) {
return useStyle(this.css, { name: this.name, ...options }); return this.css ? useStyle(this.css, { name: this.name, ...options }) : {};
}, },
getStyleSheet(extendedCSS = '', props = {}) { getStyleSheet(extendedCSS = '', props = {}) {
const _props = Object.entries(props) if (this.css) {
.reduce((acc, [k, v]) => acc.push(`${k}="${v}"`) && acc, []) const _props = Object.entries(props)
.join(' '); .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) { extend(style) {
return { ...this, ...style }; return { ...this, css: undefined, ...style };
} }
}; };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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