mario-education 2.4.564-feedback → 2.4.565-feedback

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.
package/dist/index.js CHANGED
@@ -35017,23 +35017,6 @@ var BarChart = function BarChart(_ref) {
35017
35017
  if (!chartEl) return;
35018
35018
  var barEls = chartEl.querySelectorAll(".apexcharts-bar-series path");
35019
35019
  if (!barEls.length) return;
35020
-
35021
- if (selectedBarRef.current === dataPointIndex) {
35022
- selectedBarRef.current = null;
35023
- barEls[dataPointIndex].setAttribute("fill", "#C4D4F3");
35024
- setTooltipData(null);
35025
- return;
35026
- }
35027
-
35028
- if (selectedBarRef.current !== null) {
35029
- var prevIndex = selectedBarRef.current;
35030
- var prevBar = barEls[prevIndex];
35031
-
35032
- if (prevBar) {
35033
- prevBar.setAttribute("fill", "#C4D4F3");
35034
- }
35035
- }
35036
-
35037
35020
  var newBar = barEls[dataPointIndex];
35038
35021
 
35039
35022
  if (newBar) {
@@ -35046,16 +35029,22 @@ var BarChart = function BarChart(_ref) {
35046
35029
  dataPointMouseEnter: function dataPointMouseEnter(_event, _chartContext, config) {
35047
35030
  var dataPointIndex = config === null || config === void 0 ? void 0 : config.dataPointIndex;
35048
35031
  var currentTooltip = tooltipDataRef.current;
35032
+ var chartEl = document.querySelector("#apexchartsmy-bar-chart");
35033
+ if (!chartEl) return;
35034
+ var barEls = chartEl.querySelectorAll(".apexcharts-bar-series path");
35035
+ if (!barEls.length) return;
35049
35036
 
35050
35037
  if (dataPointIndex != undefined && dataPointIndex !== (currentTooltip === null || currentTooltip === void 0 ? void 0 : currentTooltip.dataPointIndex) && !(currentTooltip !== null && currentTooltip !== void 0 && currentTooltip.isSelect)) {
35051
- dataPointIndex == -1 ? setTooltipData(null) : showTooltipAtIndex(dataPointIndex);
35052
- }
35053
- },
35054
- dataPointMouseLeave: function dataPointMouseLeave(_event, _chartContext, config) {
35055
- var currentTooltip = tooltipDataRef.current;
35056
-
35057
- if ((currentTooltip === null || currentTooltip === void 0 ? void 0 : currentTooltip.dataPointIndex) == config.dataPointIndex && !(currentTooltip !== null && currentTooltip !== void 0 && currentTooltip.isSelect)) {
35058
- setTooltipData(null);
35038
+ if (dataPointIndex != -1) {
35039
+ showTooltipAtIndex(dataPointIndex);
35040
+ barEls.forEach(function (bar, i) {
35041
+ if (i === dataPointIndex) {
35042
+ bar.setAttribute("fill", "#316CD9");
35043
+ } else {
35044
+ bar.setAttribute("fill", "#C4D4F3");
35045
+ }
35046
+ });
35047
+ }
35059
35048
  }
35060
35049
  }
35061
35050
  }
@@ -35152,29 +35141,6 @@ var BarChart = function BarChart(_ref) {
35152
35141
  React.useEffect(function () {
35153
35142
  tooltipDataRef.current = tooltipData;
35154
35143
  }, [tooltipData]);
35155
- React.useEffect(function () {
35156
- var handleClickOutside = function handleClickOutside(e) {
35157
- if (open) return;
35158
- var chartEl = document.querySelector("#apexchartsmy-bar-chart");
35159
- if (!chartEl) return;
35160
-
35161
- if (!chartEl.contains(e.target)) {
35162
- var barEls = chartEl.querySelectorAll(".apexcharts-bar-series path");
35163
- var selectedIndex = selectedBarRef.current;
35164
-
35165
- if (selectedIndex !== null && barEls[selectedIndex]) {
35166
- barEls[selectedIndex].setAttribute("fill", "#C4D4F3");
35167
- selectedBarRef.current = null;
35168
- setTooltipData(null);
35169
- }
35170
- }
35171
- };
35172
-
35173
- document.addEventListener("click", handleClickOutside);
35174
- return function () {
35175
- document.removeEventListener("click", handleClickOutside);
35176
- };
35177
- }, [open]);
35178
35144
  return React__default.createElement("div", null, React__default.createElement("div", {
35179
35145
  ref: chartWrapperRef,
35180
35146
  style: {