@ammarkhalidfarooq/dashboard-package 0.6.32 → 0.6.33

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.es.js CHANGED
@@ -2120,7 +2120,7 @@ var PageHeader = function PageHeader(_ref9) {
2120
2120
  },
2121
2121
  children: ["Page ", page, " of 2"]
2122
2122
  })]
2123
- }), activeFilters && /*#__PURE__*/jsxs("div", {
2123
+ }), !!"".concat(activeFilters || "").trim() && /*#__PURE__*/jsxs("div", {
2124
2124
  style: {
2125
2125
  marginTop: 7,
2126
2126
  display: "inline-flex",
@@ -2191,11 +2191,26 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2191
2191
  minute: "2-digit"
2192
2192
  }) + " GMT";
2193
2193
  var dateLabel = dateName;
2194
- var formattedActiveFilters = Array.isArray(activeFilters) ? activeFilters.filter(function (item) {
2195
- return item && item.value !== undefined && item.value !== null && "".concat(item.value).trim();
2196
- }).map(function (item) {
2197
- return "".concat(item.label || item.id, ": ").concat(item.value);
2198
- }).join(" | ") : "";
2194
+ var normalizeFiltersText = function normalizeFiltersText(filtersInput) {
2195
+ if (Array.isArray(filtersInput)) {
2196
+ var fromObjects = filtersInput.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 || "Filter", ": ").concat(item.value);
2200
+ }).join(" | ").trim();
2201
+ if (fromObjects) return fromObjects;
2202
+ var fromStrings = filtersInput.map(function (item) {
2203
+ return typeof item === "string" ? item.trim() : "";
2204
+ }).filter(Boolean).join(" | ").trim();
2205
+ if (fromStrings) return fromStrings;
2206
+ }
2207
+ if (typeof filtersInput === "string") {
2208
+ var str = filtersInput.trim();
2209
+ if (str) return str;
2210
+ }
2211
+ return "";
2212
+ };
2213
+ var formattedActiveFilters = normalizeFiltersText(activeFilters) || normalizeFiltersText(getActiveFilterChips(apiData));
2199
2214
  var report = buildReportData(apiData, dateName);
2200
2215
  var hero = report.hero,
2201
2216
  metrics = report.metrics,