@ammarkhalidfarooq/dashboard-package 0.6.36 → 0.6.37

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
@@ -8,49 +8,6 @@ import Box$1 from '@mui/material/Box';
8
8
  import Typography$1 from '@mui/material/Typography';
9
9
  import ReactApexChart from 'react-apexcharts';
10
10
 
11
- var theme = createTheme({
12
- cssVariables: true,
13
- // Enable CSS variables for better SSR support
14
- typography: {
15
- fontFamily: ["var(--font-league-spartan)", "var(--font-noto-sans-arabic)",
16
- // Added as a fallback for Arabic text
17
- "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica Neue", "Arial", "sans-serif", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"].join(",")
18
- },
19
- palette: {
20
- primary: {
21
- main: "#6363E6",
22
- mainLight: "#F7F7FF",
23
- light: "#FFFFFF",
24
- gray: "#A1A1A8",
25
- lightGreen: "#E1FBF2",
26
- green: "#0CAB72",
27
- red: "#E61D1D",
28
- lightRed: "#FFEDED",
29
- lightGray: "#E9E9EB",
30
- darkGray: "#606062",
31
- dark: "#090909"
32
- },
33
- text: {
34
- primary: "#666666"
35
- },
36
- secondary: {
37
- main: "#E0C2FF",
38
- light: "#F5EBFF",
39
- // dark: will be calculated from palette.secondary.main,
40
- contrastText: "#47008F"
41
- },
42
- white: {
43
- main: "#FFFFFF",
44
- light: "#F8F8F8"
45
- },
46
- gradients: {
47
- primary: "linear-gradient(90deg, #6363E6 0.05%, #59C9F9 99.96%)",
48
- secondary: "linear-gradient(180deg, #E9E9FF 0%, #C9EEFF 100%)"
49
- // You can add more gradients if needed
50
- }
51
- }
52
- });
53
-
54
11
  function _arrayLikeToArray(r, a) {
55
12
  (null == a || a > r.length) && (a = r.length);
56
13
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
@@ -297,6 +254,49 @@ function _unsupportedIterableToArray(r, a) {
297
254
  }
298
255
  }
299
256
 
257
+ var theme = createTheme({
258
+ cssVariables: true,
259
+ // Enable CSS variables for better SSR support
260
+ typography: {
261
+ fontFamily: ["var(--font-league-spartan)", "var(--font-noto-sans-arabic)",
262
+ // Added as a fallback for Arabic text
263
+ "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica Neue", "Arial", "sans-serif", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"].join(",")
264
+ },
265
+ palette: {
266
+ primary: {
267
+ main: "#6363E6",
268
+ mainLight: "#F7F7FF",
269
+ light: "#FFFFFF",
270
+ gray: "#A1A1A8",
271
+ lightGreen: "#E1FBF2",
272
+ green: "#0CAB72",
273
+ red: "#E61D1D",
274
+ lightRed: "#FFEDED",
275
+ lightGray: "#E9E9EB",
276
+ darkGray: "#606062",
277
+ dark: "#090909"
278
+ },
279
+ text: {
280
+ primary: "#666666"
281
+ },
282
+ secondary: {
283
+ main: "#E0C2FF",
284
+ light: "#F5EBFF",
285
+ // dark: will be calculated from palette.secondary.main,
286
+ contrastText: "#47008F"
287
+ },
288
+ white: {
289
+ main: "#FFFFFF",
290
+ light: "#F8F8F8"
291
+ },
292
+ gradients: {
293
+ primary: "linear-gradient(90deg, #6363E6 0.05%, #59C9F9 99.96%)",
294
+ secondary: "linear-gradient(180deg, #E9E9FF 0%, #C9EEFF 100%)"
295
+ // You can add more gradients if needed
296
+ }
297
+ }
298
+ });
299
+
300
300
  var MetricSelector = function MetricSelector(_ref) {
301
301
  var metric = _ref.metric,
302
302
  onMetricChange = _ref.onMetricChange,
@@ -932,6 +932,12 @@ var Dashboard = function Dashboard(_ref) {
932
932
  numberOfDays = _ref$numberOfDays === void 0 ? 1 : _ref$numberOfDays,
933
933
  _ref$activeFilters = _ref.activeFilters,
934
934
  activeFilters = _ref$activeFilters === void 0 ? [] : _ref$activeFilters;
935
+ console.log("[Dashboard] activeFilters prop:", {
936
+ value: activeFilters,
937
+ type: _typeof(activeFilters),
938
+ isArray: Array.isArray(activeFilters),
939
+ length: Array.isArray(activeFilters) ? activeFilters.length : undefined
940
+ });
935
941
  return /*#__PURE__*/jsx(ThemeProvider, {
936
942
  theme: theme,
937
943
  children: /*#__PURE__*/jsx(Suspense, {
@@ -2227,6 +2233,13 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref1, ref) {
2227
2233
  return "";
2228
2234
  };
2229
2235
  var formattedActiveFilters = _normalizeFiltersText(activeFilters);
2236
+ console.log("[ExportPdfLayout] activeFilters prop received:", {
2237
+ value: activeFilters,
2238
+ type: _typeof(activeFilters),
2239
+ isArray: Array.isArray(activeFilters),
2240
+ length: Array.isArray(activeFilters) ? activeFilters.length : undefined
2241
+ });
2242
+ console.log("[ExportPdfLayout] formattedActiveFilters:", formattedActiveFilters);
2230
2243
  var report = buildReportData(apiData, dateName);
2231
2244
  var hero = report.hero,
2232
2245
  metrics = report.metrics,
@@ -3211,6 +3224,14 @@ var NewOverview = function NewOverview(_ref) {
3211
3224
  exportFiltersSnapshot = _useState8[0],
3212
3225
  setExportFiltersSnapshot = _useState8[1];
3213
3226
  var exportLayoutRef = useRef(null);
3227
+ useEffect(function () {
3228
+ console.log("[NewOverview] activeFilters prop changed:", {
3229
+ value: activeFilters,
3230
+ type: _typeof(activeFilters),
3231
+ isArray: Array.isArray(activeFilters),
3232
+ length: Array.isArray(activeFilters) ? activeFilters.length : undefined
3233
+ });
3234
+ }, [activeFilters]);
3214
3235
  useEffect(function () {
3215
3236
  if (activeSectionProp) {
3216
3237
  var capitalized = activeSectionProp.charAt(0).toUpperCase() + activeSectionProp.slice(1).toLowerCase();
@@ -3221,10 +3242,25 @@ var NewOverview = function NewOverview(_ref) {
3221
3242
  // Step 1 – mount the off-screen export layout whenever the trigger fires
3222
3243
  useEffect(function () {
3223
3244
  if (exportTrigger > 0) {
3245
+ console.log("[NewOverview] exportTrigger received:", exportTrigger);
3246
+ console.log("[NewOverview] snapshotting filters for export:", {
3247
+ value: activeFilters,
3248
+ type: _typeof(activeFilters),
3249
+ isArray: Array.isArray(activeFilters),
3250
+ length: Array.isArray(activeFilters) ? activeFilters.length : undefined
3251
+ });
3224
3252
  setExportFiltersSnapshot(activeFilters);
3225
3253
  setShowExportLayout(true);
3226
3254
  }
3227
3255
  }, [exportTrigger, activeFilters]);
3256
+ useEffect(function () {
3257
+ console.log("[NewOverview] exportFiltersSnapshot updated:", {
3258
+ value: exportFiltersSnapshot,
3259
+ type: _typeof(exportFiltersSnapshot),
3260
+ isArray: Array.isArray(exportFiltersSnapshot),
3261
+ length: Array.isArray(exportFiltersSnapshot) ? exportFiltersSnapshot.length : undefined
3262
+ });
3263
+ }, [exportFiltersSnapshot]);
3228
3264
 
3229
3265
  // Step 2 – once the layout is in the DOM, capture each page and build the PDF
3230
3266
  useEffect(function () {
@@ -3236,6 +3272,8 @@ var NewOverview = function NewOverview(_ref) {
3236
3272
  while (1) switch (_context.p = _context.n) {
3237
3273
  case 0:
3238
3274
  _context.p = 0;
3275
+ console.log("[NewOverview] starting PDF export with snapshot:", exportFiltersSnapshot);
3276
+ // Allow SVG layout to paint before capture
3239
3277
  _context.n = 1;
3240
3278
  return new Promise(function (r) {
3241
3279
  return requestAnimationFrame(function () {
@@ -3259,6 +3297,7 @@ var NewOverview = function NewOverview(_ref) {
3259
3297
  _context.n = 4;
3260
3298
  return exportReportPdf(container, "DashboardOverview_report_".concat(safeDate, ".pdf"));
3261
3299
  case 4:
3300
+ console.log("[NewOverview] PDF export completed");
3262
3301
  _context.n = 6;
3263
3302
  break;
3264
3303
  case 5:
@@ -3279,7 +3318,7 @@ var NewOverview = function NewOverview(_ref) {
3279
3318
  };
3280
3319
  }();
3281
3320
  doPdfExport();
3282
- }, [showExportLayout]);
3321
+ }, [showExportLayout, exportFiltersSnapshot]);
3283
3322
  var currentData = metric === "Revenue" ? revenueData : donationsData;
3284
3323
  var oneTimeData = (apiData === null || apiData === void 0 ? void 0 : apiData.oneTimeDonations) || [];
3285
3324
  var oneTimeValues = oneTimeData.length > 0 ? oneTimeData.map(function (item) {