diff --git a/components/lib/metergroup/MeterGroup.d.ts b/components/lib/metergroup/MeterGroup.d.ts
index ddf934e7c..4f18ab53e 100644
--- a/components/lib/metergroup/MeterGroup.d.ts
+++ b/components/lib/metergroup/MeterGroup.d.ts
@@ -116,6 +116,10 @@ export interface MeterItemOptions {
* Current color of the meter item.
*/
color: string;
+ /**
+ * Current icon of the meter item.
+ */
+ icon: string;
/**
* Optional keys.
*/
@@ -187,7 +191,11 @@ export interface MeterGroupSlots {
/**
* Total percent of the metergroup items
*/
- totalPercent: string;
+ totalPercent: number;
+ /**
+ * Array of sequential sum of values of metergroup items
+ */
+ percentages: number[];
}): VNode[];
/**
* Custom meter template.
@@ -212,15 +220,11 @@ export interface MeterGroupSlots {
/**
* Current width of the meter item
*/
- width: string;
- /**
- * Current height of the meter item
- */
- height: string;
+ size: string;
/**
* Total percent of the metergroup items
*/
- totalPercent: string;
+ totalPercent: number;
}): VNode[];
/**
* Custom icon template.
@@ -246,7 +250,11 @@ export interface MeterGroupSlots {
/**
* Total percent of the metergroup items
*/
- totalPercent: string;
+ totalPercent: number;
+ /**
+ * Array of sequential sum of values of metergroup items
+ */
+ percentages: number[];
}): VNode[];
/**
* Custom end template.
@@ -259,7 +267,11 @@ export interface MeterGroupSlots {
/**
* Total percent of the metergroup items
*/
- totalPercent: string;
+ totalPercent: number;
+ /**
+ * Array of sequential sum of values of metergroup items
+ */
+ percentages: number[];
}): VNode[];
}
diff --git a/components/lib/metergroup/MeterGroup.vue b/components/lib/metergroup/MeterGroup.vue
index 47b95e5cb..6ddd51c94 100644
--- a/components/lib/metergroup/MeterGroup.vue
+++ b/components/lib/metergroup/MeterGroup.vue
@@ -1,51 +1,26 @@
-
-
- -
-
-
-
-
- {{ val.label }} ({{ percentValue(val.value) }})
-
-
+
+
- {{}}
+
-
-
+
+
-
-
-
- -
-
- {{ val.label }} ({{ percentValue(val.value) }})
-
-
+
+
+
diff --git a/components/lib/metergroup/MeterGroupLabel.vue b/components/lib/metergroup/MeterGroupLabel.vue
new file mode 100644
index 000000000..f48ca85e2
--- /dev/null
+++ b/components/lib/metergroup/MeterGroupLabel.vue
@@ -0,0 +1,36 @@
+
+
+ -
+
+
+
+
+ {{ val.label }} ({{ $parentInstance.percentValue(val.value) }})
+
+
+
+
+
diff --git a/components/lib/metergroup/style/MeterGroupStyle.js b/components/lib/metergroup/style/MeterGroupStyle.js
index ff7d5f1b0..a7abe3a76 100644
--- a/components/lib/metergroup/style/MeterGroupStyle.js
+++ b/components/lib/metergroup/style/MeterGroupStyle.js
@@ -50,22 +50,23 @@ const css = `
`;
const classes = {
- root: ({ instance }) => [
+ root: ({ props }) => [
'p-metergroup p-component',
{
- 'p-metergroup-horizontal': instance.orientation === 'horizontal',
- 'p-metergroup-vertical': instance.orientation === 'vertical'
+ 'p-metergroup-horizontal': props.orientation === 'horizontal',
+ 'p-metergroup-vertical': props.orientation === 'vertical'
}
],
metercontainer: 'p-metergroup-meter-container',
meter: 'p-metergroup-meter',
- labellist: ({ instance }) => [
+ labellist: ({ props }) => [
'p-metergroup-label-list',
+
{
- 'p-metergroup-label-list-start': instance.labelPosition === 'start',
- 'p-metergroup-label-list-end': instance.labelPosition === 'end',
- 'p-metergroup-label-list-vertical': instance.labelOrientation === 'vertical',
- 'p-metergroup-label-list-horizontal': instance.labelOrientation === 'horizontal'
+ 'p-metergroup-label-list-start': props.labelPosition === 'start',
+ 'p-metergroup-label-list-end': props.labelPosition === 'end',
+ 'p-metergroup-label-list-vertical': props.labelOrientation === 'vertical',
+ 'p-metergroup-label-list-horizontal': props.labelOrientation === 'horizontal'
}
],
labellistitem: 'p-metergroup-label-list-item',