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 {
|
2024-05-12 21:05:27 +00:00
|
|
|
padding: ${dt('timeline.vertical.event.content.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-vertical .p-timeline-event-connector {
|
2024-05-12 21:05:27 +00:00
|
|
|
width: ${dt('timeline.event.connector.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event {
|
|
|
|
display: flex;
|
|
|
|
position: relative;
|
2024-05-12 21:05:27 +00:00
|
|
|
min-height: ${dt('timeline.event.min.height')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event:last-child {
|
|
|
|
min-height: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event-opposite {
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event-content {
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.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-12 21:05:27 +00:00
|
|
|
border-width: ${dt('timeline.event.marker.border.width')};
|
|
|
|
border-style: solid;
|
|
|
|
border-color: ${dt('timeline.event.marker.border.color')};
|
|
|
|
border-radius: ${dt('timeline.event.marker.border.radius')};
|
|
|
|
width: ${dt('timeline.event.marker.size')};
|
|
|
|
height: ${dt('timeline.event.marker.size')};
|
|
|
|
background: ${dt('timeline.event.marker.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event-marker::before {
|
|
|
|
content: " ";
|
2024-05-12 21:05:27 +00:00
|
|
|
border-radius: ${dt('timeline.event.marker.content.border.radius')};
|
|
|
|
width: ${dt('timeline.event.marker.content.size')};
|
|
|
|
height:${dt('timeline.event.marker.content.size')};
|
|
|
|
background: ${dt('timeline.event.marker.content.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-event-marker::after {
|
|
|
|
content: " ";
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2024-05-12 21:05:27 +00:00
|
|
|
border-radius: ${dt('timeline.event.marker.border.radius')};
|
|
|
|
box-shadow: ${dt('timeline.event.marker.content.inset.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.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%;
|
2024-05-12 21:05:27 +00:00
|
|
|
height: ${dt('timeline.event.connector.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-timeline-horizontal .p-timeline-event-opposite,
|
|
|
|
.p-timeline-horizontal .p-timeline-event-content {
|
2024-05-12 21:05:27 +00:00
|
|
|
padding: ${dt('timeline.horizontal.event.content.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.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
|
|
|
|
});
|