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 }) => `
|
|
|
|
.p-stepper-list {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
list-style-type: none;
|
|
|
|
overflow-x: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-item {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex: 1 1 auto;
|
|
|
|
align-items: center;
|
2024-05-11 20:33:50 +00:00
|
|
|
gap: ${dt('stepper.item.gap')};
|
|
|
|
padding: ${dt('stepper.item.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-item:last-of-type {
|
|
|
|
flex: initial;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-item-header {
|
|
|
|
border: 0 none;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
text-decoration: none;
|
|
|
|
cursor: pointer;
|
2024-05-25 08:18:55 +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-05-11 20:33:50 +00:00
|
|
|
border-radius: ${dt('stepper.item.header.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
|
|
|
background: transparent;
|
2024-05-11 20:33:50 +00:00
|
|
|
padding: ${dt('stepper.item.header.padding')};
|
|
|
|
gap: ${dt('stepper.item.header.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-11 20:33:50 +00:00
|
|
|
.p-stepper-item-header:focus-visible {
|
|
|
|
box-shadow: ${dt('stepper.item.header.focus.ring.shadow')};
|
|
|
|
outline: ${dt('stepper.item.header.focus.ring.width')} ${dt('stepper.item.header.focus.ring.style')} ${dt('stepper.item.header.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('stepper.item.header.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper.p-stepper-readonly .p-stepper-item {
|
|
|
|
cursor: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-item-title {
|
|
|
|
display: block;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
max-width: 100%;
|
2024-05-04 11:47:06 +00:00
|
|
|
color: ${dt('stepper.item.title.color')};
|
2024-05-11 20:33:50 +00:00
|
|
|
font-weight: ${dt('stepper.item.title.font.weight')};
|
2024-05-25 08:18:55 +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
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-item-number {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2024-05-04 11:47:06 +00:00
|
|
|
color: ${dt('stepper.item.number.color')};
|
2024-05-11 20:33:50 +00:00
|
|
|
border: 2px solid ${dt('stepper.item.number.border.color')};
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('stepper.item.number.background')};
|
2024-05-11 20:33:50 +00:00
|
|
|
min-width: ${dt('stepper.item.number.size')};
|
|
|
|
height: ${dt('stepper.item.number.size')};
|
|
|
|
line-height: ${dt('stepper.item.number.size')};
|
|
|
|
font-size: ${dt('stepper.item.number.font.size')};
|
|
|
|
z-index: 1;
|
|
|
|
border-radius: ${dt('stepper.item.number.border.radius')};
|
|
|
|
position: relative;
|
|
|
|
font-weight: ${dt('stepper.item.number.font.weight')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-item-number::after {
|
|
|
|
content: " ";
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2024-05-11 20:33:50 +00:00
|
|
|
border-radius: ${dt('stepper.item.number.border.radius')};
|
|
|
|
box-shadow: ${dt('stepper.item.number.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-item-active .p-stepper-item-header {
|
|
|
|
cursor: default;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-item-active .p-stepper-item-number {
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('stepper.item.number.active.background')};
|
2024-05-25 10:13:17 +00:00
|
|
|
border-color: ${dt('stepper.item.number.active.border.color')};
|
2024-05-04 11:47:06 +00:00
|
|
|
color: ${dt('stepper.item.number.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-item-active .p-stepper-item-title {
|
2024-05-04 11:47:06 +00:00
|
|
|
color: ${dt('stepper.item.title.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-item: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-stepper-item:has(~ .p-stepper-item-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-25 08:18:55 +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
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-panels {
|
2024-05-11 20:33:50 +00:00
|
|
|
padding: ${dt('stepper.panel.content.orientation.horizontal.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-04 11:47:06 +00:00
|
|
|
.p-stepper-panel-content {
|
|
|
|
background: ${dt('stepper.panel.content.background')};
|
|
|
|
color: ${dt('stepper.panel.content.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-stepper-vertical .p-stepper-list {
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-vertical {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-vertical .p-stepper-panel-content-container {
|
|
|
|
display: flex;
|
|
|
|
flex: 1 1 auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-vertical .p-stepper-panel {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex: initial;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-vertical .p-stepper-panel.p-stepper-panel-active {
|
|
|
|
flex: 1 1 auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-vertical .p-stepper-panel .p-stepper-item {
|
|
|
|
flex: initial;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-vertical .p-stepper-panel .p-stepper-panel-content {
|
|
|
|
width: 100%;
|
2024-05-11 20:33:50 +00:00
|
|
|
padding: ${dt('stepper.panel.content.orientation.vertical.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-vertical .p-stepper-panel .p-stepper-separator {
|
|
|
|
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-05-11 20:33:50 +00:00
|
|
|
margin: ${dt('stepper.separator.orientation.vertical.margin')};
|
|
|
|
position: relative;
|
|
|
|
left: calc(-1 * ${dt('stepper.separator.size')} / 2);
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-vertical .p-stepper-panel:has(~ .p-stepper-panel-active) .p-stepper-separator {
|
|
|
|
background: ${dt('stepper.connector.active.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-stepper-vertical .p-stepper-panel:last-of-type .p-stepper-panel-content {
|
2024-05-11 20:33:50 +00:00
|
|
|
padding: ${dt('stepper.panel.content.orientation.vertical.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-stepper-horizontal': props.orientation === 'horizontal',
|
|
|
|
'p-stepper-vertical': props.orientation === 'vertical',
|
|
|
|
'p-readonly': props.linear
|
|
|
|
}
|
|
|
|
],
|
2024-04-30 14:09:49 +00:00
|
|
|
list: 'p-stepper-list',
|
2024-02-13 06:22:45 +00:00
|
|
|
stepper: {
|
2024-04-30 14:09:49 +00:00
|
|
|
item: ({ instance, step, index }) => [
|
2024-04-09 08:53:22 +00:00
|
|
|
'p-stepper-item',
|
2024-02-13 06:22:45 +00:00
|
|
|
{
|
2024-04-09 08:53:22 +00:00
|
|
|
'p-stepper-item-active': instance.isStepActive(index),
|
2024-02-21 08:44:30 +00:00
|
|
|
'p-disabled': instance.isItemDisabled(index)
|
2024-02-13 06:22:45 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-30 14:09:49 +00:00
|
|
|
itemHeader: 'p-stepper-item-header',
|
|
|
|
itemNumber: 'p-stepper-item-number',
|
|
|
|
itemTitle: 'p-stepper-item-title',
|
2024-02-13 06:22:45 +00:00
|
|
|
separator: 'p-stepper-separator',
|
2024-04-30 14:09:49 +00:00
|
|
|
panelContentContainer: 'p-stepper-panel-content-container',
|
|
|
|
panelContent: 'p-stepper-panel-content'
|
2024-02-13 06:22:45 +00:00
|
|
|
},
|
2024-04-30 14:09:49 +00:00
|
|
|
panels: 'p-stepper-panels',
|
2024-02-13 06:22:45 +00:00
|
|
|
panel: ({ instance, props, index }) => [
|
|
|
|
'p-stepper-panel',
|
|
|
|
{
|
|
|
|
'p-stepper-panel-active': props.orientation === 'vertical' && instance.isStepActive(index)
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'stepper',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2024-02-13 06:22:45 +00:00
|
|
|
classes
|
|
|
|
});
|