2024-01-11 13:42:20 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-metergroup {
|
|
|
|
display: flex;
|
2024-05-09 19:44:43 +00:00
|
|
|
gap: ${dt('metergroup.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-meters {
|
|
|
|
display: flex;
|
|
|
|
background: ${dt('metergroup.meters.background')};
|
2024-05-09 19:44:43 +00:00
|
|
|
border-radius: ${dt('metergroup.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-label-list {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
list-style-type: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-label {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
2024-05-09 19:44:43 +00:00
|
|
|
gap: ${dt('metergroup.label.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-label-marker {
|
|
|
|
display: inline-flex;
|
2024-05-09 19:44:43 +00:00
|
|
|
width: ${dt('metergroup.label.marker.size')};
|
|
|
|
height: ${dt('metergroup.label.marker.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border-radius: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-label-icon {
|
2024-05-09 19:45:50 +00:00
|
|
|
font-size: ${dt('metergroup.label.icon.size')};
|
|
|
|
width: ${dt('metergroup.label.icon.size')};
|
|
|
|
height: ${dt('metergroup.label.icon.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-horizontal {
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-label-list-horizontal {
|
2024-05-09 19:44:43 +00:00
|
|
|
gap: ${dt('metergroup.label.list.horizontal.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-horizontal .p-metergroup-meters {
|
2024-05-09 19:44:43 +00:00
|
|
|
height: ${dt('metergroup.meters.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-horizontal .p-metergroup-meter:first-of-type {
|
2024-05-09 19:44:43 +00:00
|
|
|
border-top-left-radius: ${dt('metergroup.border.radius')};
|
|
|
|
border-bottom-left-radius: ${dt('metergroup.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
2024-05-09 19:45:50 +00:00
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-metergroup-horizontal .p-metergroup-meter:last-of-type {
|
2024-05-09 19:44:43 +00:00
|
|
|
border-top-right-radius: ${dt('metergroup.border.radius')};
|
|
|
|
border-bottom-right-radius: ${dt('metergroup.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-vertical {
|
|
|
|
flex-direction: row;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-label-list-vertical {
|
|
|
|
flex-direction: column;
|
2024-05-09 19:44:43 +00:00
|
|
|
gap: ${dt('metergroup.label.list.vertical.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-vertical .p-metergroup-meters {
|
|
|
|
flex-direction: column;
|
2024-05-09 19:44:43 +00:00
|
|
|
width: ${dt('metergroup.meters.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-vertical .p-metergroup-label-list {
|
|
|
|
align-items: start;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-metergroup-vertical .p-metergroup-meter:first-of-type {
|
2024-05-09 19:44:43 +00:00
|
|
|
border-top-left-radius: ${dt('metergroup.border.radius')};
|
|
|
|
border-top-right-radius: ${dt('metergroup.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
.p-metergroup-vertical .p-metergroup-meter:last-of-type {
|
2024-05-09 19:44:43 +00:00
|
|
|
border-bottom-left-radius: ${dt('metergroup.border.radius')};
|
|
|
|
border-bottom-right-radius: ${dt('metergroup.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2024-01-11 13:42:20 +00:00
|
|
|
const classes = {
|
2024-01-18 12:53:33 +00:00
|
|
|
root: ({ props }) => [
|
2024-01-11 13:42:20 +00:00
|
|
|
'p-metergroup p-component',
|
|
|
|
{
|
2024-01-18 12:53:33 +00:00
|
|
|
'p-metergroup-horizontal': props.orientation === 'horizontal',
|
|
|
|
'p-metergroup-vertical': props.orientation === 'vertical'
|
2024-01-11 13:42:20 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-30 06:54:48 +00:00
|
|
|
meters: 'p-metergroup-meters',
|
2024-01-11 13:42:20 +00:00
|
|
|
meter: 'p-metergroup-meter',
|
2024-04-30 06:54:48 +00:00
|
|
|
labelList: ({ props }) => [
|
2024-04-08 11:13:22 +00:00
|
|
|
'p-metergroup-label-list',
|
2024-01-11 13:42:20 +00:00
|
|
|
{
|
2024-04-08 11:13:22 +00:00
|
|
|
'p-metergroup-label-list-vertical': props.labelOrientation === 'vertical',
|
|
|
|
'p-metergroup-label-list-horizontal': props.labelOrientation === 'horizontal'
|
2024-01-11 13:42:20 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-30 06:54:48 +00:00
|
|
|
label: 'p-metergroup-label',
|
|
|
|
labelIcon: 'p-metergroup-label-icon',
|
|
|
|
labelMarker: 'p-metergroup-label-marker',
|
|
|
|
labelText: 'p-metergroup-label-text'
|
2024-01-11 13:42:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'metergroup',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2024-01-11 13:42:20 +00:00
|
|
|
classes
|
|
|
|
});
|