2023-10-02 10:46:09 +00:00
|
|
|
import { useStyle } from 'primevue/usestyle';
|
|
|
|
|
|
|
|
const css = `
|
|
|
|
.p-hidden-accessible {
|
|
|
|
border: 0;
|
|
|
|
clip: rect(0 0 0 0);
|
|
|
|
height: 1px;
|
|
|
|
margin: -1px;
|
|
|
|
overflow: hidden;
|
|
|
|
padding: 0;
|
|
|
|
position: absolute;
|
|
|
|
width: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-hidden-accessible input,
|
|
|
|
.p-hidden-accessible select {
|
|
|
|
transform: scale(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-overflow-hidden {
|
|
|
|
overflow: hidden;
|
|
|
|
padding-right: var(--scrollbar-width);
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const classes = {};
|
|
|
|
|
|
|
|
const inlineStyles = {};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'base',
|
|
|
|
css,
|
|
|
|
classes,
|
|
|
|
inlineStyles,
|
|
|
|
loadStyle(options = {}) {
|
2023-10-04 09:20:15 +00:00
|
|
|
return this.css ? useStyle(this.css, { name: this.name, ...options }) : {};
|
2023-10-02 10:46:09 +00:00
|
|
|
},
|
|
|
|
getStyleSheet(extendedCSS = '', props = {}) {
|
2023-10-04 09:20:15 +00:00
|
|
|
if (this.css) {
|
|
|
|
const _props = Object.entries(props)
|
|
|
|
.reduce((acc, [k, v]) => acc.push(`${k}="${v}"`) && acc, [])
|
|
|
|
.join(' ');
|
2023-10-02 10:46:09 +00:00
|
|
|
|
2023-10-04 09:20:15 +00:00
|
|
|
return `<style type="text/css" data-primevue-style-id="${this.name}" ${_props}>${this.css}${extendedCSS}</style>`;
|
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
2023-10-02 10:46:09 +00:00
|
|
|
},
|
|
|
|
extend(style) {
|
2023-10-04 09:20:15 +00:00
|
|
|
return { ...this, css: undefined, ...style };
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
};
|