aefis-core-ui 2.1.8-rc2 → 2.1.8-rc4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15005,7 +15005,6 @@ const useStyles$4 = makeStyles(() => ({
15005
15005
  lineHeight: "30px",
15006
15006
  padding: 5,
15007
15007
  backgroundColor: "#ffffff",
15008
- border: "3px solid #eee",
15009
15008
  boxSizing: "content-box",
15010
15009
  borderRadius: 20,
15011
15010
  position: "relative"
@@ -15066,11 +15065,15 @@ const replaceDuplicateColor = data => {
15066
15065
  return data;
15067
15066
  }
15068
15067
  };
15069
- const addPercentValue = data => {
15068
+ const getOverallTotal = data => {
15070
15069
  let overallTotal = 0;
15071
- data.map(r => {
15070
+ data == null ? void 0 : data.map(r => {
15072
15071
  overallTotal = overallTotal + r.total;
15073
15072
  });
15073
+ return overallTotal;
15074
+ };
15075
+ const addPercentValue = data => {
15076
+ const overallTotal = getOverallTotal(data);
15074
15077
  const newRubricObj = [];
15075
15078
  data.map(r => {
15076
15079
  const total = percent(overallTotal, r.total);
@@ -15088,26 +15091,32 @@ const barContainerSize = size => {
15088
15091
  case "xsmall":
15089
15092
  struct.height = 15;
15090
15093
  struct.lineHeight = "15px";
15094
+ struct.border = "2px solid #eee";
15091
15095
  break;
15092
15096
  case "small":
15093
15097
  struct.height = 20;
15094
15098
  struct.lineHeight = "20px";
15099
+ struct.border = "3px solid #eee";
15095
15100
  break;
15096
15101
  case "medium":
15097
15102
  struct.height = 25;
15098
15103
  struct.lineHeight = "25px";
15104
+ struct.border = "3px solid #eee";
15099
15105
  break;
15100
15106
  case "large":
15101
15107
  struct.height = 30;
15102
15108
  struct.lineHeight = "30px";
15109
+ struct.border = "3px solid #eee";
15103
15110
  break;
15104
15111
  case "xlarge":
15105
15112
  struct.height = 35;
15106
15113
  struct.lineHeight = "35px";
15114
+ struct.border = "3px solid #eee";
15107
15115
  break;
15108
15116
  default:
15109
15117
  struct.height = 20;
15110
15118
  struct.lineHeight = "20px";
15119
+ struct.border = "3px solid #eee";
15111
15120
  }
15112
15121
  return struct;
15113
15122
  };
@@ -15121,9 +15130,7 @@ const RubricDistributionChart = props => {
15121
15130
  textTransform: "uppercase"
15122
15131
  };
15123
15132
  const a11yProps = {
15124
- "aria-label": props.title || "progress",
15125
- "aria-valuemax": 100,
15126
- role: "progressbar"
15133
+ "aria-label": props.title
15127
15134
  };
15128
15135
  const keyValue = useUID();
15129
15136
  const validatedData = replaceDuplicateColor(props.data);
@@ -15152,6 +15159,11 @@ const RubricDistributionChart = props => {
15152
15159
  sx: containerSize
15153
15160
  }), rubricsDataWithPercent == null ? void 0 : rubricsDataWithPercent.map((rubric, index) => /*#__PURE__*/jsx(Box$1, {
15154
15161
  className: classes.barProgress,
15162
+ "aria-label": rubric.name,
15163
+ "aria-valuemax": getOverallTotal(rubricsDataWithPercent),
15164
+ "aria-valuenow": rubric.total || 0,
15165
+ "aria-valuemin": 0,
15166
+ role: "progressbar",
15155
15167
  style: barStyle(rubric, index === 0, isLastItemInArray(rubricsDataWithPercent, index)),
15156
15168
  children: /*#__PURE__*/jsx(Typography, {
15157
15169
  sx: {
@@ -15163,9 +15175,18 @@ const RubricDistributionChart = props => {
15163
15175
  })
15164
15176
  }, `rubric-bar-chart-bar-${(rubric == null ? void 0 : rubric.id) || index}`))]
15165
15177
  }))
15166
- }), props.showLegend && /*#__PURE__*/jsx(Legend, {
15167
- data: validatedData,
15168
- size: props.size
15178
+ }), /*#__PURE__*/jsx(Collapse, {
15179
+ sx: {
15180
+ mt: 1,
15181
+ mb: 1
15182
+ },
15183
+ in: props.showLegend,
15184
+ timeout: "auto",
15185
+ unmountOnExit: true,
15186
+ children: /*#__PURE__*/jsx(Legend, {
15187
+ data: validatedData,
15188
+ size: props.size
15189
+ })
15169
15190
  })]
15170
15191
  });
15171
15192
  };