oolib 2.174.1 → 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.
@@ -1,8 +1,9 @@
1
- export function getEmptyStatesConfig({ preset, title, contentTypeTitle, commaSeparatedTags }: {
1
+ export function getEmptyStatesConfig({ preset, title, contentTypeTitle, commaSeparatedTags, localize }: {
2
2
  preset: any;
3
3
  title: any;
4
4
  contentTypeTitle: any;
5
5
  commaSeparatedTags: any;
6
+ localize: any;
6
7
  }): {
7
8
  align: string;
8
9
  image: {
@@ -13,7 +14,7 @@ export function getEmptyStatesConfig({ preset, title, contentTypeTitle, commaSep
13
14
  };
14
15
  };
15
16
  title: string;
16
- subtitle: string;
17
+ subtitle: any;
17
18
  imageSize?: undefined;
18
19
  button?: undefined;
19
20
  link?: undefined;
@@ -28,7 +29,7 @@ export function getEmptyStatesConfig({ preset, title, contentTypeTitle, commaSep
28
29
  };
29
30
  imageSize: number;
30
31
  title: string;
31
- subtitle: string;
32
+ subtitle: any;
32
33
  button?: undefined;
33
34
  link?: undefined;
34
35
  } | {
@@ -78,7 +79,7 @@ export function getEmptyStatesConfig({ preset, title, contentTypeTitle, commaSep
78
79
  height?: undefined;
79
80
  };
80
81
  };
81
- title: string;
82
+ title: any;
82
83
  subtitle: string;
83
84
  link: {
84
85
  text: string;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getEmptyStatesConfig = void 0;
4
4
  var getEmptyStatesConfig = function (_a) {
5
- var preset = _a.preset, title = _a.title, contentTypeTitle = _a.contentTypeTitle, commaSeparatedTags = _a.commaSeparatedTags;
5
+ var preset = _a.preset, title = _a.title, contentTypeTitle = _a.contentTypeTitle, commaSeparatedTags = _a.commaSeparatedTags, localize = _a.localize;
6
6
  switch (preset) {
7
7
  case "multipleCollectionsListing":
8
8
  return {
@@ -15,7 +15,7 @@ var getEmptyStatesConfig = function (_a) {
15
15
  },
16
16
  },
17
17
  title: "No tags added",
18
- subtitle: "Publishing under ".concat(commaSeparatedTags, " shows all tagged content here, You can edit published content in future, when required."),
18
+ subtitle: localize("Publishing under <word1 : ".concat(commaSeparatedTags, "> shows all tagged content here, You can edit published content in future, when required.")),
19
19
  };
20
20
  case "multiplePublishingListing":
21
21
  return {
@@ -41,7 +41,7 @@ var getEmptyStatesConfig = function (_a) {
41
41
  },
42
42
  },
43
43
  title: "No ".concat(contentTypeTitle === null || contentTypeTitle === void 0 ? void 0 : contentTypeTitle.toLowerCase(), " Added"),
44
- subtitle: "Publishing under ".concat(contentTypeTitle === null || contentTypeTitle === void 0 ? void 0 : contentTypeTitle.toLowerCase(), " shows your content here, You can edit published content in future, when required."),
44
+ subtitle: localize("Publishing under <word1 : ".concat(contentTypeTitle === null || contentTypeTitle === void 0 ? void 0 : contentTypeTitle.toLowerCase(), "> shows your content here, You can edit published content in future, when required.")),
45
45
  };
46
46
  case "singleCollectionsListing":
47
47
  return {
@@ -55,7 +55,7 @@ var getEmptyStatesConfig = function (_a) {
55
55
  },
56
56
  imageSize: 80,
57
57
  title: "No ".concat(contentTypeTitle === null || contentTypeTitle === void 0 ? void 0 : contentTypeTitle.toLowerCase(), " Added"),
58
- subtitle: "Publishing under ".concat(contentTypeTitle === null || contentTypeTitle === void 0 ? void 0 : contentTypeTitle.toLowerCase(), " shows your content here, You can edit published content in future, when required."),
58
+ subtitle: localize("Publishing under <word1 : ".concat(contentTypeTitle === null || contentTypeTitle === void 0 ? void 0 : contentTypeTitle.toLowerCase(), "> shows your content here, You can edit published content in future, when required.")),
59
59
  };
60
60
  case "profileListing":
61
61
  return {
@@ -202,7 +202,7 @@ var getEmptyStatesConfig = function (_a) {
202
202
  opacity: 0.6,
203
203
  },
204
204
  },
205
- title: "Cant find any content for ".concat(contentTypeTitle),
205
+ title: localize("Cant find any content for <word1 : ".concat(contentTypeTitle, ">")),
206
206
  subtitle: "Sorry we couldn’t find any matches for this. Please make sure the words are spelled correctly",
207
207
  link: {
208
208
  // onClick: action,
@@ -7,14 +7,17 @@ exports.EmptyStates = void 0;
7
7
  var react_1 = __importDefault(require("react"));
8
8
  var EmptyStatesRenderer_1 = require("./comps/EmptyStatesRenderer");
9
9
  var config_1 = require("./config");
10
+ var utilsOolib_1 = require("../../utilsOolib");
10
11
  var EmptyStates = function (_a) {
11
12
  var _b = _a.preset, preset = _b === void 0 ? "multiplePublishingListing" : _b, contentTypeTitle = _a.contentTypeTitle, titleProp = _a.title, tags = _a.tags, onClick = _a.onClick;
12
13
  var commaSeparatedTags = tags === null || tags === void 0 ? void 0 : tags.map(function (item) { return item.toLowerCase(); }).join(",");
14
+ var localize = (0, utilsOolib_1.useLocale)();
13
15
  var _c = (0, config_1.getEmptyStatesConfig)({
14
16
  preset: preset,
15
17
  contentTypeTitle: contentTypeTitle,
16
18
  commaSeparatedTags: commaSeparatedTags,
17
- title: titleProp
19
+ title: titleProp,
20
+ localize: localize
18
21
  }), image = _c.image, title = _c.title, subtitle = _c.subtitle, link = _c.link, button = _c.button, align = _c.align;
19
22
  return (react_1.default.createElement(EmptyStatesRenderer_1.EmptyStatesRenderer, { image: image, align: align, title: title, subtitle: subtitle, link: link, button: button, onClick: onClick, preset: preset }));
20
23
  };
@@ -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.174.1",
3
+ "version": "2.175.1",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",