oolib 2.175.0 → 2.175.1

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.
@@ -62,7 +62,11 @@ var BarChart = function (args) {
62
62
  };
63
63
  return (react_1.default.createElement("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "20px" } },
64
64
  react_1.default.createElement("div", null,
65
- react_1.default.createElement(BarChart_1.BarChart, { data: [
65
+ react_1.default.createElement(BarChart_1.BarChart
66
+ // showPercent={false}
67
+ , {
68
+ // showPercent={false}
69
+ data: [
66
70
  {
67
71
  display: "Logged In Once",
68
72
  // stack1: 60,
@@ -71,6 +75,7 @@ var BarChart = function (args) {
71
75
  stack4: 10,
72
76
  stack5: 40,
73
77
  stack6: 10,
78
+ stack2Display: 'Labels Path Stack 2 Display'
74
79
  },
75
80
  {
76
81
  display: "Registered Users",
@@ -21,6 +21,7 @@ export interface BarChartProps {
21
21
  tooltipLabelsMapping: {
22
22
  [key: string]: string;
23
23
  };
24
+ tooltipLabelsPath: string | string[];
24
25
  labelPath: string;
25
26
  onClick?: (name: string) => void;
26
27
  valueSuffix?: string;
@@ -65,7 +65,7 @@ var CustomizedLabel_1 = require("./comps/CustomizedLabel");
65
65
  var colors_1 = require("../../themes/colors");
66
66
  var CustomTooltip_1 = __importDefault(require("./comps/CustomTooltip"));
67
67
  var usePrepareData = function (_a) {
68
- var _data = _a._data, labelPath = _a.labelPath, valuePath = _a.valuePath, tooltipLabelsMapping = _a.tooltipLabelsMapping, isBreakdown = _a.isBreakdown, showPercent = _a.showPercent;
68
+ var _data = _a._data, labelPath = _a.labelPath, valuePath = _a.valuePath, tooltipLabelsMapping = _a.tooltipLabelsMapping, tooltipLabelsPath = _a.tooltipLabelsPath, isBreakdown = _a.isBreakdown, showPercent = _a.showPercent;
69
69
  return (0, react_1.useMemo)(function () {
70
70
  var finalData = __spreadArray([], _data, true);
71
71
  var totalCount = !isBreakdown
@@ -90,7 +90,9 @@ var usePrepareData = function (_a) {
90
90
  return {
91
91
  labels: __assign(__assign({}, (showPercent
92
92
  ? { percentage: (0, _EXPORTS_1.getPercentage)(count, totalCount[index]) }
93
- : {})), { count: count, tooltipLabel: (tooltipLabelsMapping === null || tooltipLabelsMapping === void 0 ? void 0 : tooltipLabelsMapping[path]) || path, name: (0, _EXPORTS_1.getVal)(d, labelPath) }),
93
+ : {})), { count: count, tooltipLabel: tooltipLabelsPath
94
+ ? tooltipLabelsPath[i] ? ((0, _EXPORTS_1.getVal)(d, tooltipLabelsPath[i]) || tooltipLabelsPath[i]) : path
95
+ : ((tooltipLabelsMapping === null || tooltipLabelsMapping === void 0 ? void 0 : tooltipLabelsMapping[path]) || path), name: (0, _EXPORTS_1.getVal)(d, labelPath) }),
94
96
  };
95
97
  });
96
98
  });
@@ -192,13 +194,14 @@ var barConfigs = {
192
194
  },
193
195
  };
194
196
  var BarChart = function (_a) {
195
- var _data = _a.data, valuePath = _a.valuePath, tooltipLabelsMapping = _a.tooltipLabelsMapping, _b = _a.labelPath, labelPath = _b === void 0 ? "name" : _b, onClick = _a.onClick, _c = _a.breakdownDisplayType, breakdownDisplayType = _c === void 0 ? "grouped" : _c, _d = _a.showCount, showCount = _d === void 0 ? true : _d, _e = _a.showPercent, showPercent = _e === void 0 ? true : _e, _f = _a.colorIdx, colorIdx = _f === void 0 ? 0 : _f;
197
+ var _data = _a.data, valuePath = _a.valuePath, tooltipLabelsMapping = _a.tooltipLabelsMapping, tooltipLabelsPath = _a.tooltipLabelsPath, _b = _a.labelPath, labelPath = _b === void 0 ? "name" : _b, onClick = _a.onClick, _c = _a.breakdownDisplayType, breakdownDisplayType = _c === void 0 ? "grouped" : _c, _d = _a.showCount, showCount = _d === void 0 ? true : _d, _e = _a.showPercent, showPercent = _e === void 0 ? true : _e, _f = _a.colorIdx, colorIdx = _f === void 0 ? 0 : _f;
196
198
  var isBreakdown = Array.isArray(valuePath);
197
199
  var data = usePrepareData({
198
200
  _data: _data,
199
201
  labelPath: labelPath,
200
202
  valuePath: valuePath,
201
203
  tooltipLabelsMapping: tooltipLabelsMapping,
204
+ tooltipLabelsPath: tooltipLabelsPath,
202
205
  isBreakdown: isBreakdown,
203
206
  showPercent: showPercent,
204
207
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.175.0",
3
+ "version": "2.175.1",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",