211 lines
3.6 KiB
JavaScript
211 lines
3.6 KiB
JavaScript
import BaseStyle from 'primevue/base/style';
|
|
import { useStyle } from 'primevue/usestyle';
|
|
|
|
const buttonCSS = `
|
|
.p-button {
|
|
display: inline-flex;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
align-items: center;
|
|
vertical-align: bottom;
|
|
text-align: center;
|
|
overflow: hidden;
|
|
position: relative;
|
|
}
|
|
|
|
.p-button-label {
|
|
flex: 1 1 auto;
|
|
}
|
|
|
|
.p-button-icon-right {
|
|
order: 1;
|
|
}
|
|
|
|
.p-button:disabled {
|
|
cursor: default;
|
|
}
|
|
|
|
.p-button-icon-only {
|
|
justify-content: center;
|
|
}
|
|
|
|
.p-button-icon-only .p-button-label {
|
|
visibility: hidden;
|
|
width: 0;
|
|
flex: 0 0 auto;
|
|
}
|
|
|
|
.p-button-vertical {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.p-button-icon-bottom {
|
|
order: 2;
|
|
}
|
|
|
|
.p-buttonset .p-button {
|
|
margin: 0;
|
|
}
|
|
|
|
.p-buttonset .p-button:not(:last-child), .p-buttonset .p-button:not(:last-child):hover {
|
|
border-right: 0 none;
|
|
}
|
|
|
|
.p-buttonset .p-button:not(:first-of-type):not(:last-of-type) {
|
|
border-radius: 0;
|
|
}
|
|
|
|
.p-buttonset .p-button:first-of-type:not(:only-of-type) {
|
|
border-top-right-radius: 0;
|
|
border-bottom-right-radius: 0;
|
|
}
|
|
|
|
.p-buttonset .p-button:last-of-type:not(:only-of-type) {
|
|
border-top-left-radius: 0;
|
|
border-bottom-left-radius: 0;
|
|
}
|
|
|
|
.p-buttonset .p-button:focus {
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
`;
|
|
|
|
const inputTextCSS = `
|
|
.p-fluid .p-inputtext {
|
|
width: 100%;
|
|
}
|
|
`;
|
|
|
|
const css = `
|
|
@layer primevue {
|
|
.p-component, .p-component * {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.p-hidden-space {
|
|
visibility: hidden;
|
|
}
|
|
|
|
.p-reset {
|
|
margin: 0;
|
|
padding: 0;
|
|
border: 0;
|
|
outline: 0;
|
|
text-decoration: none;
|
|
font-size: 100%;
|
|
list-style: none;
|
|
}
|
|
|
|
.p-disabled, .p-disabled * {
|
|
cursor: default;
|
|
pointer-events: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.p-component-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.p-unselectable-text {
|
|
user-select: none;
|
|
}
|
|
|
|
.p-sr-only {
|
|
border: 0;
|
|
clip: rect(1px, 1px, 1px, 1px);
|
|
clip-path: inset(50%);
|
|
height: 1px;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
padding: 0;
|
|
position: absolute;
|
|
width: 1px;
|
|
word-wrap: normal;
|
|
}
|
|
|
|
.p-link {
|
|
text-align: left;
|
|
background-color: transparent;
|
|
margin: 0;
|
|
padding: 0;
|
|
border: none;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
|
|
.p-link:disabled {
|
|
cursor: default;
|
|
}
|
|
|
|
/* Non vue overlay animations */
|
|
.p-connected-overlay {
|
|
opacity: 0;
|
|
transform: scaleY(0.8);
|
|
transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);
|
|
}
|
|
|
|
.p-connected-overlay-visible {
|
|
opacity: 1;
|
|
transform: scaleY(1);
|
|
}
|
|
|
|
.p-connected-overlay-hidden {
|
|
opacity: 0;
|
|
transform: scaleY(1);
|
|
transition: opacity .1s linear;
|
|
}
|
|
|
|
/* Vue based overlay animations */
|
|
.p-connected-overlay-enter-from {
|
|
opacity: 0;
|
|
transform: scaleY(0.8);
|
|
}
|
|
|
|
.p-connected-overlay-leave-to {
|
|
opacity: 0;
|
|
}
|
|
|
|
.p-connected-overlay-enter-active {
|
|
transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);
|
|
}
|
|
|
|
.p-connected-overlay-leave-active {
|
|
transition: opacity .1s linear;
|
|
}
|
|
|
|
/* Toggleable Content */
|
|
.p-toggleable-content-enter-from,
|
|
.p-toggleable-content-leave-to {
|
|
max-height: 0;
|
|
}
|
|
|
|
.p-toggleable-content-enter-to,
|
|
.p-toggleable-content-leave-from {
|
|
max-height: 1000px;
|
|
}
|
|
|
|
.p-toggleable-content-leave-active {
|
|
overflow: hidden;
|
|
transition: max-height 0.45s cubic-bezier(0, 1, 0, 1);
|
|
}
|
|
|
|
.p-toggleable-content-enter-active {
|
|
overflow: hidden;
|
|
transition: max-height 1s ease-in-out;
|
|
}
|
|
${buttonCSS}
|
|
${inputTextCSS}
|
|
}
|
|
`;
|
|
|
|
export default BaseStyle.extend({
|
|
name: 'common',
|
|
css,
|
|
loadGlobalStyle: (globalCSS, options = {}) => useStyle(globalCSS, { name: 'global', ...options })
|
|
});
|