2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:32:36 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-progressbar {
|
|
|
|
position: relative;
|
|
|
|
overflow: hidden;
|
2024-05-09 19:13:44 +00:00
|
|
|
height: ${dt('progressbar.height')};
|
2024-05-01 08:32:36 +00:00
|
|
|
background: ${dt('progressbar.background')};
|
2024-05-09 19:13:44 +00:00
|
|
|
border-radius: ${dt('progressbar.border.radius')};
|
2024-05-01 08:32:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-progressbar-value {
|
|
|
|
margin: 0;
|
|
|
|
background: ${dt('progressbar.value.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-progressbar-label {
|
|
|
|
color: ${dt('progressbar.label.color')};
|
2024-05-09 19:13:44 +00:00
|
|
|
font-size: ${dt('progressbar.label.font.size')};
|
|
|
|
font-weight: ${dt('progressbar.label.font.weight')};
|
2024-05-01 08:32:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-progressbar-determinate .p-progressbar-value {
|
|
|
|
height: 100%;
|
|
|
|
width: 0%;
|
|
|
|
position: absolute;
|
|
|
|
display: none;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
overflow: hidden;
|
|
|
|
transition: width 1s ease-in-out;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-progressbar-determinate .p-progressbar-label {
|
|
|
|
display: inline-flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-progressbar-indeterminate .p-progressbar-value::before {
|
|
|
|
content: "";
|
|
|
|
position: absolute;
|
2024-05-24 05:50:38 +00:00
|
|
|
background: inherit;
|
2024-05-01 08:32:36 +00:00
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
bottom: 0;
|
|
|
|
will-change: left, right;
|
|
|
|
animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-progressbar-indeterminate .p-progressbar-value::after {
|
|
|
|
content: "";
|
|
|
|
position: absolute;
|
2024-05-24 05:50:38 +00:00
|
|
|
background: inherit;
|
2024-05-01 08:32:36 +00:00
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
bottom: 0;
|
|
|
|
will-change: left, right;
|
|
|
|
animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
|
|
|
|
animation-delay: 1.15s;
|
|
|
|
}
|
|
|
|
|
|
|
|
@-webkit-keyframes p-progressbar-indeterminate-anim {
|
|
|
|
0% {
|
|
|
|
left: -35%;
|
|
|
|
right: 100%;
|
|
|
|
}
|
|
|
|
60% {
|
|
|
|
left: 100%;
|
|
|
|
right: -90%;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
left: 100%;
|
|
|
|
right: -90%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@keyframes p-progressbar-indeterminate-anim {
|
|
|
|
0% {
|
|
|
|
left: -35%;
|
|
|
|
right: 100%;
|
|
|
|
}
|
|
|
|
60% {
|
|
|
|
left: 100%;
|
|
|
|
right: -90%;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
left: 100%;
|
|
|
|
right: -90%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@-webkit-keyframes p-progressbar-indeterminate-anim-short {
|
|
|
|
0% {
|
|
|
|
left: -200%;
|
|
|
|
right: 100%;
|
|
|
|
}
|
|
|
|
60% {
|
|
|
|
left: 107%;
|
|
|
|
right: -8%;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
left: 107%;
|
|
|
|
right: -8%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@keyframes p-progressbar-indeterminate-anim-short {
|
|
|
|
0% {
|
|
|
|
left: -200%;
|
|
|
|
right: 100%;
|
|
|
|
}
|
|
|
|
60% {
|
|
|
|
left: 107%;
|
|
|
|
right: -8%;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
left: 107%;
|
|
|
|
right: -8%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ instance }) => [
|
|
|
|
'p-progressbar p-component',
|
|
|
|
{
|
|
|
|
'p-progressbar-determinate': instance.determinate,
|
|
|
|
'p-progressbar-indeterminate': instance.indeterminate
|
|
|
|
}
|
|
|
|
],
|
2024-04-30 06:54:48 +00:00
|
|
|
indeterminateContainer: 'p-progressbar-indeterminate-container',
|
2024-04-08 11:22:03 +00:00
|
|
|
value: 'p-progressbar-value',
|
2023-10-02 10:46:09 +00:00
|
|
|
label: 'p-progressbar-label'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'progressbar',
|
2024-05-01 08:32:36 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|