@ammarkhalidfarooq/dashboard-package 0.6.32 → 0.6.34

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.cjs.js CHANGED
@@ -934,6 +934,7 @@ var Dashboard = function Dashboard(_ref) {
934
934
  numberOfDays = _ref$numberOfDays === void 0 ? 1 : _ref$numberOfDays,
935
935
  _ref$activeFilters = _ref.activeFilters,
936
936
  activeFilters = _ref$activeFilters === void 0 ? [] : _ref$activeFilters;
937
+ console.log("activeFilters chart", activeFilters);
937
938
  return /*#__PURE__*/jsxRuntime.jsx(material.ThemeProvider, {
938
939
  theme: theme,
939
940
  children: /*#__PURE__*/jsxRuntime.jsx(React.Suspense, {
@@ -2122,7 +2123,7 @@ var PageHeader = function PageHeader(_ref9) {
2122
2123
  },
2123
2124
  children: ["Page ", page, " of 2"]
2124
2125
  })]
2125
- }), activeFilters && /*#__PURE__*/jsxRuntime.jsxs("div", {
2126
+ }), !!"".concat(activeFilters || "").trim() && /*#__PURE__*/jsxRuntime.jsxs("div", {
2126
2127
  style: {
2127
2128
  marginTop: 7,
2128
2129
  display: "inline-flex",
@@ -2193,11 +2194,26 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2193
2194
  minute: "2-digit"
2194
2195
  }) + " GMT";
2195
2196
  var dateLabel = dateName;
2196
- var formattedActiveFilters = Array.isArray(activeFilters) ? activeFilters.filter(function (item) {
2197
- return item && item.value !== undefined && item.value !== null && "".concat(item.value).trim();
2198
- }).map(function (item) {
2199
- return "".concat(item.label || item.id, ": ").concat(item.value);
2200
- }).join(" | ") : "";
2197
+ var normalizeFiltersText = function normalizeFiltersText(filtersInput) {
2198
+ if (Array.isArray(filtersInput)) {
2199
+ var fromObjects = filtersInput.filter(function (item) {
2200
+ return item && item.value !== undefined && item.value !== null && "".concat(item.value).trim();
2201
+ }).map(function (item) {
2202
+ return "".concat(item.label || item.id || "Filter", ": ").concat(item.value);
2203
+ }).join(" | ").trim();
2204
+ if (fromObjects) return fromObjects;
2205
+ var fromStrings = filtersInput.map(function (item) {
2206
+ return typeof item === "string" ? item.trim() : "";
2207
+ }).filter(Boolean).join(" | ").trim();
2208
+ if (fromStrings) return fromStrings;
2209
+ }
2210
+ if (typeof filtersInput === "string") {
2211
+ var str = filtersInput.trim();
2212
+ if (str) return str;
2213
+ }
2214
+ return "";
2215
+ };
2216
+ var formattedActiveFilters = normalizeFiltersText(activeFilters) || normalizeFiltersText(getActiveFilterChips(apiData));
2201
2217
  var report = buildReportData(apiData, dateName);
2202
2218
  var hero = report.hero,
2203
2219
  metrics = report.metrics,