2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-steps {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-list {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
list-style-type: none;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
flex: 1 1 auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item.p-disabled,
|
|
|
|
.p-steps-item.p-disabled * {
|
|
|
|
opacity: 1;
|
|
|
|
pointer-events: auto;
|
|
|
|
user-select: auto;
|
|
|
|
cursor: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item:before {
|
|
|
|
content: " ";
|
2024-05-04 17:06:51 +00:00
|
|
|
border-top: 2px solid ${dt('steps.separator.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
width: 100%;
|
|
|
|
top: 50%;
|
|
|
|
left: 0;
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
margin-top: -1rem;
|
|
|
|
margin-top: calc(-1rem + 1px);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item:first-child::before {
|
|
|
|
width: calc(50% + 1rem);
|
|
|
|
transform: translateX(100%);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item:last-child::before {
|
|
|
|
width: 50%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item-link {
|
|
|
|
display: inline-flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
overflow: hidden;
|
|
|
|
text-decoration: none;
|
|
|
|
transition: outline-color ${dt('transition.duration')};
|
2024-05-06 21:18:22 +00:00
|
|
|
border-radius: ${dt('border.radius.md')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item-link:not(.p-disabled):focus-visible {
|
|
|
|
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
|
|
|
|
outline-offset: ${dt('focus.ring.offset')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item-label {
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
max-width: 100%;
|
|
|
|
margin-top: 0.5rem;
|
2024-05-04 17:06:51 +00:00
|
|
|
color: ${dt('steps.item.label.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
display: block;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item-number {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2024-05-04 17:06:51 +00:00
|
|
|
color: ${dt('steps.item.number.color')};
|
|
|
|
border: 2px solid ${dt('steps.item.number.border.color')};
|
|
|
|
background: ${dt('steps.item.number.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
min-width: 2rem;
|
|
|
|
height: 2rem;
|
|
|
|
line-height: 2rem;
|
|
|
|
font-size: 1.143rem;
|
|
|
|
z-index: 1;
|
|
|
|
border-radius: 50%;
|
|
|
|
position: relative;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item-number::after {
|
|
|
|
content: " ";
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
border-radius: 50%;
|
|
|
|
box-shadow: 0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps:not(.p-readonly) .p-steps-item {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item-active .p-steps-item-number {
|
2024-05-04 17:06:51 +00:00
|
|
|
background: ${dt('steps.item.number.active.background')};
|
|
|
|
color: ${dt('steps.item.number.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-steps-item-active .p-steps-item-label {
|
|
|
|
font-weight: 500;
|
2024-05-04 17:06:51 +00:00
|
|
|
color: ${dt('steps.item.label.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => ['p-steps p-component', { 'p-readonly': props.readonly }],
|
2024-04-30 13:03:20 +00:00
|
|
|
list: 'p-steps-list',
|
|
|
|
item: ({ instance, item, index }) => [
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-steps-item',
|
|
|
|
{
|
2024-04-09 13:54:12 +00:00
|
|
|
'p-steps-item-active': instance.isActive(index),
|
2023-11-08 12:52:43 +00:00
|
|
|
'p-disabled': instance.isItemDisabled(item, index)
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-30 13:03:20 +00:00
|
|
|
itemLink: 'p-steps-item-link',
|
|
|
|
itemNumber: 'p-steps-item-number',
|
|
|
|
itemLabel: 'p-steps-item-label'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'steps',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|