2024-02-13 06:22:45 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-steplist {
|
2024-05-01 08:26:48 +00:00
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
list-style-type: none;
|
|
|
|
overflow-x: auto;
|
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step {
|
2024-05-01 08:26:48 +00:00
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex: 1 1 auto;
|
|
|
|
align-items: center;
|
2024-06-04 06:23:00 +00:00
|
|
|
gap: ${dt('stepper.step.gap')};
|
|
|
|
padding: ${dt('stepper.step.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step:last-of-type {
|
2024-05-01 08:26:48 +00:00
|
|
|
flex: initial;
|
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step-header {
|
2024-05-01 08:26:48 +00:00
|
|
|
border: 0 none;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
text-decoration: none;
|
|
|
|
cursor: pointer;
|
2024-05-26 21:38:39 +00:00
|
|
|
transition: background ${dt('stepper.transition.duration')}, color ${dt('stepper.transition.duration')}, border-color ${dt('stepper.transition.duration')}, outline-color ${dt('stepper.transition.duration')}, box-shadow ${dt(
|
|
|
|
'stepper.transition.duration'
|
|
|
|
)};
|
2024-06-04 06:23:00 +00:00
|
|
|
border-radius: ${dt('stepper.step.header.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
|
|
|
background: transparent;
|
2024-06-04 06:23:00 +00:00
|
|
|
padding: ${dt('stepper.step.header.padding')};
|
|
|
|
gap: ${dt('stepper.step.header.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step-header:focus-visible {
|
|
|
|
box-shadow: ${dt('stepper.step.header.focus.ring.shadow')};
|
|
|
|
outline: ${dt('stepper.step.header.focus.ring.width')} ${dt('stepper.step.header.focus.ring.style')} ${dt('stepper.step.header.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('stepper.step.header.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-stepper.p-stepper-readonly .p-step {
|
2024-05-01 08:26:48 +00:00
|
|
|
cursor: auto;
|
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step-title {
|
2024-05-01 08:26:48 +00:00
|
|
|
display: block;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
max-width: 100%;
|
2024-06-04 06:23:00 +00:00
|
|
|
color: ${dt('stepper.step.title.color')};
|
|
|
|
font-weight: ${dt('stepper.step.title.font.weight')};
|
2024-05-26 21:38:39 +00:00
|
|
|
transition: background ${dt('stepper.transition.duration')}, color ${dt('stepper.transition.duration')}, border-color ${dt('stepper.transition.duration')}, box-shadow ${dt('stepper.transition.duration')}, outline-color ${dt(
|
|
|
|
'stepper.transition.duration'
|
|
|
|
)};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step-number {
|
2024-05-01 08:26:48 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2024-06-04 06:23:00 +00:00
|
|
|
color: ${dt('stepper.step.number.color')};
|
|
|
|
border: 2px solid ${dt('stepper.step.number.border.color')};
|
|
|
|
background: ${dt('stepper.step.number.background')};
|
|
|
|
min-width: ${dt('stepper.step.number.size')};
|
|
|
|
height: ${dt('stepper.step.number.size')};
|
|
|
|
line-height: ${dt('stepper.step.number.size')};
|
|
|
|
font-size: ${dt('stepper.step.number.font.size')};
|
2024-05-11 20:33:50 +00:00
|
|
|
z-index: 1;
|
2024-06-04 06:23:00 +00:00
|
|
|
border-radius: ${dt('stepper.step.number.border.radius')};
|
2024-05-11 20:33:50 +00:00
|
|
|
position: relative;
|
2024-06-04 06:23:00 +00:00
|
|
|
font-weight: ${dt('stepper.step.number.font.weight')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step-number::after {
|
2024-05-01 08:26:48 +00:00
|
|
|
content: " ";
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2024-06-04 06:23:00 +00:00
|
|
|
border-radius: ${dt('stepper.step.number.border.radius')};
|
|
|
|
box-shadow: ${dt('stepper.step.number.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step-active .p-step-header {
|
2024-05-01 08:26:48 +00:00
|
|
|
cursor: default;
|
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step-active .p-step-number {
|
|
|
|
background: ${dt('stepper.step.number.active.background')};
|
|
|
|
border-color: ${dt('stepper.step.number.active.border.color')};
|
|
|
|
color: ${dt('stepper.step.number.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step-active .p-step-title {
|
|
|
|
color: ${dt('stepper.step.title.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step:not(.p-disabled):focus-visible {
|
2024-05-01 08:26:48 +00:00
|
|
|
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
|
|
|
|
outline-offset: ${dt('focus.ring.offset')};
|
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-step:has(~ .p-step-active) .p-stepper-separator {
|
|
|
|
background: ${dt('stepper.separator.active.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-step:has(~ .p-step-active) .p-stepper-separator {
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('stepper.separator.active.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-separator {
|
|
|
|
flex: 1 1 0;
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('stepper.separator.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
width: 100%;
|
2024-05-11 20:33:50 +00:00
|
|
|
height: ${dt('stepper.separator.size')};
|
2024-05-26 21:38:39 +00:00
|
|
|
transition: background ${dt('stepper.transition.duration')}, color ${dt('stepper.transition.duration')}, border-color ${dt('stepper.transition.duration')}, box-shadow ${dt('stepper.transition.duration')}, outline-color ${dt(
|
|
|
|
'stepper.transition.duration'
|
|
|
|
)};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-steppanels {
|
|
|
|
padding: ${dt('stepper.steppanels.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-steppanel {
|
|
|
|
background: ${dt('stepper.steppanel.content.background')};
|
|
|
|
color: ${dt('stepper.steppanel.content.color')};
|
2024-05-04 11:47:06 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-stepper:has(.p-stepitem) {
|
2024-05-01 08:26:48 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-stepitem {
|
2024-05-01 08:26:48 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex: initial;
|
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-stepitem.p-stepitem-active {
|
2024-05-01 08:26:48 +00:00
|
|
|
flex: 1 1 auto;
|
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-stepitem .p-step {
|
2024-05-01 08:26:48 +00:00
|
|
|
flex: initial;
|
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-stepitem .p-steppanel-content {
|
2024-05-01 08:26:48 +00:00
|
|
|
width: 100%;
|
2024-06-04 06:23:00 +00:00
|
|
|
padding: ${dt('stepper.steppanel.padding')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepitem .p-steppanel {
|
|
|
|
display: flex;
|
|
|
|
flex: 1 1 auto;
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-stepitem .p-stepper-separator {
|
2024-05-01 08:26:48 +00:00
|
|
|
flex: 0 0 auto;
|
2024-05-11 20:33:50 +00:00
|
|
|
width: ${dt('stepper.separator.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
height: auto;
|
2024-06-04 06:23:00 +00:00
|
|
|
margin: ${dt('stepper.separator.margin')};
|
2024-05-11 20:33:50 +00:00
|
|
|
position: relative;
|
2024-06-04 06:23:00 +00:00
|
|
|
left: calc(-1 * ${dt('stepper.separator.size')});
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-stepitem:has(~ .p-stepitem-active) .p-stepper-separator {
|
|
|
|
background: ${dt('stepper.separator.active.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 06:23:00 +00:00
|
|
|
.p-stepitem:last-of-type .p-steppanel {
|
|
|
|
padding: ${dt('stepper.steppanel.last.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2024-02-13 06:22:45 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => [
|
|
|
|
'p-stepper p-component',
|
|
|
|
{
|
|
|
|
'p-readonly': props.linear
|
|
|
|
}
|
|
|
|
],
|
2024-06-04 06:23:00 +00:00
|
|
|
separator: 'p-stepper-separator'
|
2024-02-13 06:22:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'stepper',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2024-02-13 06:22:45 +00:00
|
|
|
classes
|
|
|
|
});
|