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-timeline {
|
|
|
|
display: flex;
|
|
|
|
flex-grow: 1;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-left .p-timeline-event-opposite {
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-left .p-timeline-event-content {
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-right .p-timeline-event {
|
|
|
|
flex-direction: row-reverse;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-right .p-timeline-event-opposite {
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-right .p-timeline-event-content {
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) {
|
|
|
|
flex-direction: row-reverse;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-opposite {
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-content {
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-opposite {
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-content {
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-vertical .p-timeline-event-opposite,
|
|
|
|
.p-timeline-vertical .p-timeline-event-content {
|
|
|
|
padding: 0 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-vertical .p-timeline-event-connector {
|
|
|
|
width: 2px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event {
|
|
|
|
display: flex;
|
|
|
|
position: relative;
|
|
|
|
min-height: 70px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event:last-child {
|
|
|
|
min-height: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event-opposite {
|
|
|
|
flex: 1;
|
|
|
|
padding: 0 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event-content {
|
|
|
|
flex: 1;
|
|
|
|
padding: 0 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event-separator {
|
|
|
|
flex: 0;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event-marker {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
position: relative;
|
|
|
|
align-self: baseline;
|
2024-05-04 21:57:50 +00:00
|
|
|
border: 2px solid ${dt('timeline.event.marker.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border-radius: 50%;
|
|
|
|
width: 1.125rem;
|
|
|
|
height: 1.125rem;
|
2024-05-04 21:57:50 +00:00
|
|
|
background-color: ${dt('timeline.event.marker.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event-marker::before {
|
|
|
|
content: " ";
|
|
|
|
border-radius: 50%;
|
|
|
|
width: 0.375rem;
|
|
|
|
height: 0.375rem;
|
2024-05-04 21:57:50 +00:00
|
|
|
background: ${dt('timeline.event.marker.content.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event-marker::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-timeline-event-connector {
|
|
|
|
flex-grow: 1;
|
2024-05-04 21:57:50 +00:00
|
|
|
background-color: ${dt('timeline.event.connector.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-horizontal {
|
|
|
|
flex-direction: row;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-horizontal .p-timeline-event {
|
|
|
|
flex-direction: column;
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-horizontal .p-timeline-event:last-child {
|
|
|
|
flex: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-horizontal .p-timeline-event-separator {
|
|
|
|
flex-direction: row;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-horizontal .p-timeline-event-connector {
|
|
|
|
width: 100%;
|
|
|
|
height: 2px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-horizontal .p-timeline-event-opposite,
|
|
|
|
.p-timeline-horizontal .p-timeline-event-content {
|
|
|
|
padding: 1rem 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-horizontal.p-timeline-alternate .p-timeline-event:nth-child(even) {
|
|
|
|
flex-direction: column-reverse;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-bottom .p-timeline-event {
|
|
|
|
flex-direction: column-reverse;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => ['p-timeline p-component', 'p-timeline-' + props.align, 'p-timeline-' + props.layout],
|
|
|
|
event: 'p-timeline-event',
|
2024-05-02 06:27:51 +00:00
|
|
|
eventOpposite: 'p-timeline-event-opposite',
|
|
|
|
eventSeparator: 'p-timeline-event-separator',
|
|
|
|
eventMarker: 'p-timeline-event-marker',
|
|
|
|
eventConnector: 'p-timeline-event-connector',
|
|
|
|
eventContent: 'p-timeline-event-content'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'timeline',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|