@rebasepro/plugin-insights 0.2.3 → 0.2.5
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/common/src/collections/default-collections.d.ts +9 -0
- package/dist/common/src/collections/index.d.ts +1 -0
- package/dist/common/src/util/permissions.d.ts +1 -0
- package/dist/core/src/components/LoginView/LoginView.d.ts +25 -1
- package/dist/core/src/components/common/types.d.ts +10 -7
- package/dist/core/src/components/common/useDebouncedData.d.ts +1 -1
- package/dist/core/src/core/RebaseProps.d.ts +13 -2
- package/dist/core/src/core/RebaseRouter.d.ts +1 -1
- package/dist/core/src/hooks/data/useCollectionFetch.d.ts +12 -1
- package/dist/core/src/hooks/index.d.ts +0 -1
- package/dist/core/src/util/entity_cache.d.ts +0 -5
- package/dist/core/src/util/index.d.ts +0 -2
- package/dist/core/src/util/useStorageUploadController.d.ts +2 -2
- package/dist/formex/src/utils.d.ts +2 -2
- package/dist/index.es.js +216 -164
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +216 -164
- package/dist/index.umd.js.map +1 -1
- package/dist/plugin-insights/src/components/InsightWidget.d.ts +2 -2
- package/dist/plugin-insights/src/components/InsightWidgetSkeleton.d.ts +3 -1
- package/dist/plugin-insights/src/components/InsightsScorecardView.d.ts +3 -1
- package/dist/types/src/controllers/auth.d.ts +4 -26
- package/dist/types/src/controllers/client.d.ts +25 -43
- package/dist/types/src/controllers/collection_registry.d.ts +1 -1
- package/dist/types/src/controllers/data.d.ts +4 -0
- package/dist/types/src/controllers/data_driver.d.ts +23 -0
- package/dist/types/src/controllers/registry.d.ts +5 -4
- package/dist/types/src/rebase_context.d.ts +1 -1
- package/dist/types/src/types/auth_adapter.d.ts +5 -60
- package/dist/types/src/types/backend.d.ts +2 -2
- package/dist/types/src/types/backend_hooks.d.ts +2 -17
- package/dist/types/src/types/collections.d.ts +0 -4
- package/dist/types/src/types/component_ref.d.ts +1 -1
- package/dist/types/src/types/cron.d.ts +1 -1
- package/dist/types/src/types/entity_views.d.ts +1 -0
- package/dist/types/src/types/export_import.d.ts +1 -1
- package/dist/types/src/types/formex.d.ts +2 -2
- package/dist/types/src/types/properties.d.ts +9 -7
- package/dist/types/src/types/translations.d.ts +28 -12
- package/dist/types/src/types/user_management_delegate.d.ts +22 -57
- package/dist/types/src/users/index.d.ts +0 -1
- package/dist/types/src/users/user.d.ts +0 -1
- package/dist/ui/src/components/Button.d.ts +2 -2
- package/dist/ui/src/components/ErrorBoundary.d.ts +25 -3
- package/dist/ui/src/components/VirtualTable/VirtualTable.d.ts +1 -1
- package/dist/ui/src/components/VirtualTable/VirtualTableCell.d.ts +6 -6
- package/dist/ui/src/components/VirtualTable/VirtualTableHeader.d.ts +8 -8
- package/dist/ui/src/components/VirtualTable/VirtualTableHeaderRow.d.ts +1 -1
- package/dist/ui/src/components/VirtualTable/VirtualTableProps.d.ts +11 -11
- package/dist/ui/src/components/VirtualTable/VirtualTableRow.d.ts +1 -1
- package/dist/ui/src/components/VirtualTable/types.d.ts +9 -9
- package/dist/ui/src/hooks/useDebounceCallback.d.ts +1 -1
- package/dist/ui/src/util/debounce.d.ts +1 -1
- package/package.json +4 -3
- package/src/components/InsightWidget.tsx +33 -4
- package/src/components/InsightWidgetSkeleton.tsx +7 -1
- package/src/components/InsightsScorecardView.tsx +4 -1
- package/src/engine/InsightsCache.test.ts +56 -0
- package/src/engine/useInsightsData.ts +1 -0
- package/dist/core/src/hooks/useValidateAuthenticator.d.ts +0 -21
- package/dist/core/src/util/icon_synonyms.d.ts +0 -1
- package/dist/core/src/util/useTraceUpdate.d.ts +0 -2
- package/dist/types/src/users/roles.d.ts +0 -22
package/dist/index.es.js
CHANGED
|
@@ -144,6 +144,7 @@ function useInsightsData(definition, context) {
|
|
|
144
144
|
setData(result_0);
|
|
145
145
|
}
|
|
146
146
|
}).catch((err_0) => {
|
|
147
|
+
cache.invalidate(cacheKey);
|
|
147
148
|
if (!cancelled) {
|
|
148
149
|
setError(err_0 instanceof Error ? err_0 : new Error(String(err_0)));
|
|
149
150
|
}
|
|
@@ -214,13 +215,14 @@ function formatNumber(value, format) {
|
|
|
214
215
|
return formatted;
|
|
215
216
|
}
|
|
216
217
|
function InsightsScorecardView(t0) {
|
|
217
|
-
const $ = c(
|
|
218
|
+
const $ = c(59);
|
|
218
219
|
const {
|
|
219
220
|
config,
|
|
220
221
|
data,
|
|
221
222
|
title,
|
|
222
223
|
compact: t1,
|
|
223
|
-
embedded: t2
|
|
224
|
+
embedded: t2,
|
|
225
|
+
fixedHeight
|
|
224
226
|
} = t0;
|
|
225
227
|
const compact = t1 === void 0 ? false : t1;
|
|
226
228
|
const embedded = t2 === void 0 ? false : t2;
|
|
@@ -380,113 +382,117 @@ function InsightsScorecardView(t0) {
|
|
|
380
382
|
}
|
|
381
383
|
const baseClass = t7;
|
|
382
384
|
let t8;
|
|
383
|
-
if ($[28] !== embedded || $[29] !== isSmall) {
|
|
384
|
-
t8 = embedded ? void 0 : {
|
|
385
|
+
if ($[28] !== embedded || $[29] !== fixedHeight || $[30] !== isSmall) {
|
|
386
|
+
t8 = embedded ? void 0 : fixedHeight ? {
|
|
387
|
+
height: fixedHeight
|
|
388
|
+
} : {
|
|
385
389
|
minHeight: isSmall ? 68 : 92
|
|
386
390
|
};
|
|
387
391
|
$[28] = embedded;
|
|
388
|
-
$[29] =
|
|
389
|
-
$[30] =
|
|
392
|
+
$[29] = fixedHeight;
|
|
393
|
+
$[30] = isSmall;
|
|
394
|
+
$[31] = t8;
|
|
390
395
|
} else {
|
|
391
|
-
t8 = $[
|
|
396
|
+
t8 = $[31];
|
|
392
397
|
}
|
|
393
398
|
const t9 = `flex items-center justify-between ${isSmall ? "mb-1" : "mb-2"}`;
|
|
394
399
|
const t10 = `font-medium leading-snug truncate text-surface-500 dark:text-surface-400 ${isSmall ? "text-[11px]" : "text-xs"}`;
|
|
395
400
|
let t11;
|
|
396
|
-
if ($[
|
|
401
|
+
if ($[32] !== t10 || $[33] !== title) {
|
|
397
402
|
t11 = /* @__PURE__ */ jsx("span", { className: t10, children: title });
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
403
|
+
$[32] = t10;
|
|
404
|
+
$[33] = title;
|
|
405
|
+
$[34] = t11;
|
|
401
406
|
} else {
|
|
402
|
-
t11 = $[
|
|
407
|
+
t11 = $[34];
|
|
403
408
|
}
|
|
404
409
|
let t12;
|
|
405
|
-
if ($[
|
|
410
|
+
if ($[35] !== config.dateRange || $[36] !== isSmall) {
|
|
406
411
|
t12 = config.dateRange && !isSmall && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-surface-400 dark:text-surface-500 truncate mt-0.5", children: config.dateRange });
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
412
|
+
$[35] = config.dateRange;
|
|
413
|
+
$[36] = isSmall;
|
|
414
|
+
$[37] = t12;
|
|
410
415
|
} else {
|
|
411
|
-
t12 = $[
|
|
416
|
+
t12 = $[37];
|
|
412
417
|
}
|
|
413
418
|
let t13;
|
|
414
|
-
if ($[
|
|
419
|
+
if ($[38] !== t11 || $[39] !== t12) {
|
|
415
420
|
t13 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
416
421
|
t11,
|
|
417
422
|
t12
|
|
418
423
|
] });
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
424
|
+
$[38] = t11;
|
|
425
|
+
$[39] = t12;
|
|
426
|
+
$[40] = t13;
|
|
422
427
|
} else {
|
|
423
|
-
t13 = $[
|
|
428
|
+
t13 = $[40];
|
|
424
429
|
}
|
|
425
430
|
let t14;
|
|
426
|
-
if ($[
|
|
431
|
+
if ($[41] !== iconElement) {
|
|
427
432
|
t14 = iconElement && /* @__PURE__ */ jsx("span", { className: "ml-2 shrink-0", children: iconElement });
|
|
428
|
-
$[
|
|
429
|
-
$[
|
|
433
|
+
$[41] = iconElement;
|
|
434
|
+
$[42] = t14;
|
|
430
435
|
} else {
|
|
431
|
-
t14 = $[
|
|
436
|
+
t14 = $[42];
|
|
432
437
|
}
|
|
433
438
|
let t15;
|
|
434
|
-
if ($[
|
|
439
|
+
if ($[43] !== t13 || $[44] !== t14 || $[45] !== t9) {
|
|
435
440
|
t15 = /* @__PURE__ */ jsxs("div", { className: t9, children: [
|
|
436
441
|
t13,
|
|
437
442
|
t14
|
|
438
443
|
] });
|
|
439
|
-
$[
|
|
440
|
-
$[
|
|
441
|
-
$[
|
|
442
|
-
$[
|
|
444
|
+
$[43] = t13;
|
|
445
|
+
$[44] = t14;
|
|
446
|
+
$[45] = t9;
|
|
447
|
+
$[46] = t15;
|
|
443
448
|
} else {
|
|
444
|
-
t15 = $[
|
|
449
|
+
t15 = $[46];
|
|
445
450
|
}
|
|
446
451
|
const t16 = `font-semibold leading-tight tracking-tight break-all text-surface-800 dark:text-surface-100 ${isSmall ? "text-lg" : containerWidth !== null && containerWidth < 300 ? "text-xl" : "text-2xl"}`;
|
|
447
452
|
let t17;
|
|
448
|
-
if ($[
|
|
453
|
+
if ($[47] !== formattedValue || $[48] !== t16) {
|
|
449
454
|
t17 = /* @__PURE__ */ jsx("div", { className: t16, children: formattedValue });
|
|
450
|
-
$[
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
455
|
+
$[47] = formattedValue;
|
|
456
|
+
$[48] = t16;
|
|
457
|
+
$[49] = t17;
|
|
453
458
|
} else {
|
|
454
|
-
t17 = $[
|
|
459
|
+
t17 = $[49];
|
|
455
460
|
}
|
|
456
461
|
let t18;
|
|
457
|
-
if ($[
|
|
462
|
+
if ($[50] !== comparisonElement || $[51] !== isSmall) {
|
|
458
463
|
t18 = comparisonElement && /* @__PURE__ */ jsx("div", { className: isSmall ? "mt-0.5" : "mt-1", children: comparisonElement });
|
|
459
|
-
$[
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
464
|
+
$[50] = comparisonElement;
|
|
465
|
+
$[51] = isSmall;
|
|
466
|
+
$[52] = t18;
|
|
462
467
|
} else {
|
|
463
|
-
t18 = $[
|
|
468
|
+
t18 = $[52];
|
|
464
469
|
}
|
|
465
470
|
let t19;
|
|
466
|
-
if ($[
|
|
471
|
+
if ($[53] !== baseClass || $[54] !== t15 || $[55] !== t17 || $[56] !== t18 || $[57] !== t8) {
|
|
467
472
|
t19 = /* @__PURE__ */ jsxs("div", { ref: containerRef, className: baseClass, style: t8, children: [
|
|
468
473
|
t15,
|
|
469
474
|
t17,
|
|
470
475
|
t18
|
|
471
476
|
] });
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
477
|
+
$[53] = baseClass;
|
|
478
|
+
$[54] = t15;
|
|
479
|
+
$[55] = t17;
|
|
480
|
+
$[56] = t18;
|
|
481
|
+
$[57] = t8;
|
|
482
|
+
$[58] = t19;
|
|
478
483
|
} else {
|
|
479
|
-
t19 = $[
|
|
484
|
+
t19 = $[58];
|
|
480
485
|
}
|
|
481
486
|
return t19;
|
|
482
487
|
}
|
|
483
488
|
InsightsScorecardView.displayName = "InsightsScorecardView";
|
|
484
489
|
function InsightWidgetSkeleton(t0) {
|
|
485
|
-
const $ = c(
|
|
490
|
+
const $ = c(18);
|
|
486
491
|
const {
|
|
487
492
|
config,
|
|
488
493
|
compact: t1,
|
|
489
|
-
embedded: t2
|
|
494
|
+
embedded: t2,
|
|
495
|
+
fixedHeight
|
|
490
496
|
} = t0;
|
|
491
497
|
const compact = t1 === void 0 ? false : t1;
|
|
492
498
|
const embedded = t2 === void 0 ? false : t2;
|
|
@@ -562,25 +568,27 @@ function InsightWidgetSkeleton(t0) {
|
|
|
562
568
|
return t10;
|
|
563
569
|
}
|
|
564
570
|
let t3;
|
|
565
|
-
if ($[12] !== embedded || $[13] !==
|
|
566
|
-
t3 = /* @__PURE__ */ jsx(StandardSkeleton, { hasComparison, hasIcon, hasDateRange, embedded });
|
|
571
|
+
if ($[12] !== embedded || $[13] !== fixedHeight || $[14] !== hasComparison || $[15] !== hasDateRange || $[16] !== hasIcon) {
|
|
572
|
+
t3 = /* @__PURE__ */ jsx(StandardSkeleton, { hasComparison, hasIcon, hasDateRange, embedded, fixedHeight });
|
|
567
573
|
$[12] = embedded;
|
|
568
|
-
$[13] =
|
|
569
|
-
$[14] =
|
|
570
|
-
$[15] =
|
|
571
|
-
$[16] =
|
|
574
|
+
$[13] = fixedHeight;
|
|
575
|
+
$[14] = hasComparison;
|
|
576
|
+
$[15] = hasDateRange;
|
|
577
|
+
$[16] = hasIcon;
|
|
578
|
+
$[17] = t3;
|
|
572
579
|
} else {
|
|
573
|
-
t3 = $[
|
|
580
|
+
t3 = $[17];
|
|
574
581
|
}
|
|
575
582
|
return t3;
|
|
576
583
|
}
|
|
577
584
|
function StandardSkeleton(t0) {
|
|
578
|
-
const $ = c(
|
|
585
|
+
const $ = c(37);
|
|
579
586
|
const {
|
|
580
587
|
hasComparison,
|
|
581
588
|
hasIcon,
|
|
582
589
|
hasDateRange,
|
|
583
|
-
embedded
|
|
590
|
+
embedded,
|
|
591
|
+
fixedHeight
|
|
584
592
|
} = t0;
|
|
585
593
|
const containerRef = useRef(null);
|
|
586
594
|
const [containerWidth, setContainerWidth] = useState(null);
|
|
@@ -627,122 +635,131 @@ function StandardSkeleton(t0) {
|
|
|
627
635
|
t4 = $[5];
|
|
628
636
|
}
|
|
629
637
|
let t5;
|
|
630
|
-
if ($[6] !== embedded || $[7] !== isSmall) {
|
|
631
|
-
t5 = embedded ? void 0 : {
|
|
638
|
+
if ($[6] !== embedded || $[7] !== fixedHeight || $[8] !== isSmall) {
|
|
639
|
+
t5 = embedded ? void 0 : fixedHeight ? {
|
|
640
|
+
height: fixedHeight
|
|
641
|
+
} : {
|
|
632
642
|
minHeight: isSmall ? 68 : 92
|
|
633
643
|
};
|
|
634
644
|
$[6] = embedded;
|
|
635
|
-
$[7] =
|
|
636
|
-
$[8] =
|
|
645
|
+
$[7] = fixedHeight;
|
|
646
|
+
$[8] = isSmall;
|
|
647
|
+
$[9] = t5;
|
|
637
648
|
} else {
|
|
638
|
-
t5 = $[
|
|
649
|
+
t5 = $[9];
|
|
639
650
|
}
|
|
640
651
|
const t6 = `flex items-center justify-between ${isSmall ? "mb-1" : "mb-2"}`;
|
|
641
652
|
let t7;
|
|
642
|
-
if ($[
|
|
653
|
+
if ($[10] !== titleHeight) {
|
|
643
654
|
t7 = /* @__PURE__ */ jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded", style: {
|
|
644
655
|
height: titleHeight,
|
|
645
656
|
width: "60%"
|
|
646
657
|
} });
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
658
|
+
$[10] = titleHeight;
|
|
659
|
+
$[11] = t7;
|
|
649
660
|
} else {
|
|
650
|
-
t7 = $[
|
|
661
|
+
t7 = $[11];
|
|
651
662
|
}
|
|
652
663
|
let t8;
|
|
653
|
-
if ($[
|
|
664
|
+
if ($[12] !== hasDateRange || $[13] !== isSmall) {
|
|
654
665
|
t8 = hasDateRange && !isSmall && /* @__PURE__ */ jsx("div", { className: "bg-surface-200/60 dark:bg-surface-700/60 rounded mt-0.5", style: {
|
|
655
666
|
height: 14,
|
|
656
667
|
width: "40%"
|
|
657
668
|
} });
|
|
658
|
-
$[
|
|
659
|
-
$[
|
|
660
|
-
$[
|
|
669
|
+
$[12] = hasDateRange;
|
|
670
|
+
$[13] = isSmall;
|
|
671
|
+
$[14] = t8;
|
|
661
672
|
} else {
|
|
662
|
-
t8 = $[
|
|
673
|
+
t8 = $[14];
|
|
663
674
|
}
|
|
664
675
|
let t9;
|
|
665
|
-
if ($[
|
|
676
|
+
if ($[15] !== t7 || $[16] !== t8) {
|
|
666
677
|
t9 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
667
678
|
t7,
|
|
668
679
|
t8
|
|
669
680
|
] });
|
|
670
|
-
$[
|
|
671
|
-
$[
|
|
672
|
-
$[
|
|
681
|
+
$[15] = t7;
|
|
682
|
+
$[16] = t8;
|
|
683
|
+
$[17] = t9;
|
|
673
684
|
} else {
|
|
674
|
-
t9 = $[
|
|
685
|
+
t9 = $[17];
|
|
675
686
|
}
|
|
676
687
|
let t10;
|
|
677
|
-
if ($[
|
|
688
|
+
if ($[18] !== hasIcon || $[19] !== iconSize) {
|
|
678
689
|
t10 = hasIcon && /* @__PURE__ */ jsx("span", { className: "ml-2 shrink-0", children: /* @__PURE__ */ jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded", style: {
|
|
679
690
|
height: iconSize,
|
|
680
691
|
width: iconSize
|
|
681
692
|
} }) });
|
|
682
|
-
$[
|
|
683
|
-
$[
|
|
684
|
-
$[
|
|
693
|
+
$[18] = hasIcon;
|
|
694
|
+
$[19] = iconSize;
|
|
695
|
+
$[20] = t10;
|
|
685
696
|
} else {
|
|
686
|
-
t10 = $[
|
|
697
|
+
t10 = $[20];
|
|
687
698
|
}
|
|
688
699
|
let t11;
|
|
689
|
-
if ($[
|
|
700
|
+
if ($[21] !== t10 || $[22] !== t6 || $[23] !== t9) {
|
|
690
701
|
t11 = /* @__PURE__ */ jsxs("div", { className: t6, children: [
|
|
691
702
|
t9,
|
|
692
703
|
t10
|
|
693
704
|
] });
|
|
694
|
-
$[
|
|
695
|
-
$[
|
|
696
|
-
$[
|
|
697
|
-
$[
|
|
705
|
+
$[21] = t10;
|
|
706
|
+
$[22] = t6;
|
|
707
|
+
$[23] = t9;
|
|
708
|
+
$[24] = t11;
|
|
698
709
|
} else {
|
|
699
|
-
t11 = $[
|
|
710
|
+
t11 = $[24];
|
|
700
711
|
}
|
|
701
712
|
let t12;
|
|
702
|
-
if ($[
|
|
713
|
+
if ($[25] !== valueHeight) {
|
|
703
714
|
t12 = /* @__PURE__ */ jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded", style: {
|
|
704
715
|
height: valueHeight,
|
|
705
716
|
width: "40%"
|
|
706
717
|
} });
|
|
707
|
-
$[
|
|
708
|
-
$[
|
|
718
|
+
$[25] = valueHeight;
|
|
719
|
+
$[26] = t12;
|
|
709
720
|
} else {
|
|
710
|
-
t12 = $[
|
|
721
|
+
t12 = $[26];
|
|
711
722
|
}
|
|
712
723
|
let t13;
|
|
713
|
-
if ($[
|
|
724
|
+
if ($[27] !== hasComparison || $[28] !== isSmall) {
|
|
714
725
|
t13 = hasComparison && /* @__PURE__ */ jsx("div", { className: isSmall ? "mt-0.5" : "mt-1", children: /* @__PURE__ */ jsx("div", { className: "bg-surface-200/60 dark:bg-surface-700/60 rounded", style: {
|
|
715
726
|
height: 16,
|
|
716
727
|
width: "25%"
|
|
717
728
|
} }) });
|
|
718
|
-
$[
|
|
719
|
-
$[
|
|
720
|
-
$[
|
|
729
|
+
$[27] = hasComparison;
|
|
730
|
+
$[28] = isSmall;
|
|
731
|
+
$[29] = t13;
|
|
721
732
|
} else {
|
|
722
|
-
t13 = $[
|
|
733
|
+
t13 = $[29];
|
|
723
734
|
}
|
|
724
735
|
let t14;
|
|
725
|
-
if ($[
|
|
736
|
+
if ($[30] !== t11 || $[31] !== t12 || $[32] !== t13 || $[33] !== t3 || $[34] !== t4 || $[35] !== t5) {
|
|
726
737
|
t14 = /* @__PURE__ */ jsxs("div", { ref: t3, className: t4, style: t5, children: [
|
|
727
738
|
t11,
|
|
728
739
|
t12,
|
|
729
740
|
t13
|
|
730
741
|
] });
|
|
731
|
-
$[
|
|
732
|
-
$[
|
|
733
|
-
$[
|
|
734
|
-
$[
|
|
735
|
-
$[
|
|
736
|
-
$[
|
|
737
|
-
$[
|
|
742
|
+
$[30] = t11;
|
|
743
|
+
$[31] = t12;
|
|
744
|
+
$[32] = t13;
|
|
745
|
+
$[33] = t3;
|
|
746
|
+
$[34] = t4;
|
|
747
|
+
$[35] = t5;
|
|
748
|
+
$[36] = t14;
|
|
738
749
|
} else {
|
|
739
|
-
t14 = $[
|
|
750
|
+
t14 = $[36];
|
|
740
751
|
}
|
|
741
752
|
return t14;
|
|
742
753
|
}
|
|
743
754
|
InsightWidgetSkeleton.displayName = "InsightWidgetSkeleton";
|
|
755
|
+
function computeFixedHeight(config) {
|
|
756
|
+
let h = 86.5;
|
|
757
|
+
if (config.dateRange) h += 16;
|
|
758
|
+
if (config.comparison) h += 20;
|
|
759
|
+
return Math.ceil(h);
|
|
760
|
+
}
|
|
744
761
|
function InsightWidget(t0) {
|
|
745
|
-
const $ = c(
|
|
762
|
+
const $ = c(37);
|
|
746
763
|
const {
|
|
747
764
|
definition,
|
|
748
765
|
collectionSlug,
|
|
@@ -772,82 +789,117 @@ function InsightWidget(t0) {
|
|
|
772
789
|
loading,
|
|
773
790
|
error
|
|
774
791
|
} = useInsightsData(definition, t3);
|
|
792
|
+
let t4;
|
|
793
|
+
if ($[4] !== compact || $[5] !== definition.scorecard || $[6] !== embedded) {
|
|
794
|
+
t4 = !compact && !embedded ? computeFixedHeight(definition.scorecard) : void 0;
|
|
795
|
+
$[4] = compact;
|
|
796
|
+
$[5] = definition.scorecard;
|
|
797
|
+
$[6] = embedded;
|
|
798
|
+
$[7] = t4;
|
|
799
|
+
} else {
|
|
800
|
+
t4 = $[7];
|
|
801
|
+
}
|
|
802
|
+
const fixedHeight = t4;
|
|
775
803
|
if (loading) {
|
|
776
|
-
let
|
|
777
|
-
if ($[
|
|
778
|
-
|
|
779
|
-
$[
|
|
780
|
-
$[
|
|
781
|
-
$[
|
|
782
|
-
$[
|
|
804
|
+
let t52;
|
|
805
|
+
if ($[8] !== compact || $[9] !== definition.scorecard || $[10] !== embedded || $[11] !== fixedHeight) {
|
|
806
|
+
t52 = /* @__PURE__ */ jsx(InsightWidgetSkeleton, { config: definition.scorecard, compact, embedded, fixedHeight });
|
|
807
|
+
$[8] = compact;
|
|
808
|
+
$[9] = definition.scorecard;
|
|
809
|
+
$[10] = embedded;
|
|
810
|
+
$[11] = fixedHeight;
|
|
811
|
+
$[12] = t52;
|
|
783
812
|
} else {
|
|
784
|
-
|
|
813
|
+
t52 = $[12];
|
|
785
814
|
}
|
|
786
|
-
return
|
|
815
|
+
return t52;
|
|
787
816
|
}
|
|
788
817
|
if (error) {
|
|
789
|
-
const
|
|
790
|
-
let
|
|
791
|
-
if ($[
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
818
|
+
const t52 = `text-red-500/70 dark:text-red-400/70 text-[0.8125rem] ${embedded ? "px-5 py-4 h-full" : `rounded-lg bg-red-500/5 dark:bg-red-400/5 border border-red-500/10 dark:border-red-400/10 ${compact ? "px-3.5 py-3" : "px-5 py-4"}`}`;
|
|
819
|
+
let t62;
|
|
820
|
+
if ($[13] !== fixedHeight) {
|
|
821
|
+
t62 = fixedHeight ? {
|
|
822
|
+
height: fixedHeight
|
|
823
|
+
} : void 0;
|
|
824
|
+
$[13] = fixedHeight;
|
|
825
|
+
$[14] = t62;
|
|
795
826
|
} else {
|
|
796
|
-
|
|
827
|
+
t62 = $[14];
|
|
797
828
|
}
|
|
798
|
-
let
|
|
799
|
-
if ($[
|
|
800
|
-
|
|
801
|
-
$[
|
|
802
|
-
$[
|
|
829
|
+
let t7;
|
|
830
|
+
if ($[15] !== definition.title) {
|
|
831
|
+
t7 = /* @__PURE__ */ jsx("div", { className: "font-semibold mb-1", children: definition.title });
|
|
832
|
+
$[15] = definition.title;
|
|
833
|
+
$[16] = t7;
|
|
803
834
|
} else {
|
|
804
|
-
|
|
835
|
+
t7 = $[16];
|
|
805
836
|
}
|
|
806
|
-
let
|
|
807
|
-
if ($[
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
837
|
+
let t8;
|
|
838
|
+
if ($[17] !== error.message) {
|
|
839
|
+
t8 = /* @__PURE__ */ jsx("div", { children: error.message });
|
|
840
|
+
$[17] = error.message;
|
|
841
|
+
$[18] = t8;
|
|
842
|
+
} else {
|
|
843
|
+
t8 = $[18];
|
|
844
|
+
}
|
|
845
|
+
let t9;
|
|
846
|
+
if ($[19] !== t52 || $[20] !== t62 || $[21] !== t7 || $[22] !== t8) {
|
|
847
|
+
t9 = /* @__PURE__ */ jsxs("div", { className: t52, style: t62, children: [
|
|
848
|
+
t7,
|
|
849
|
+
t8
|
|
811
850
|
] });
|
|
812
|
-
$[
|
|
813
|
-
$[
|
|
814
|
-
$[
|
|
815
|
-
$[
|
|
851
|
+
$[19] = t52;
|
|
852
|
+
$[20] = t62;
|
|
853
|
+
$[21] = t7;
|
|
854
|
+
$[22] = t8;
|
|
855
|
+
$[23] = t9;
|
|
816
856
|
} else {
|
|
817
|
-
|
|
857
|
+
t9 = $[23];
|
|
818
858
|
}
|
|
819
|
-
return
|
|
859
|
+
return t9;
|
|
820
860
|
}
|
|
821
861
|
if (!data || data.rows.length === 0) {
|
|
822
|
-
const
|
|
823
|
-
let
|
|
824
|
-
if ($[
|
|
825
|
-
|
|
862
|
+
const t52 = `text-surface-400 dark:text-surface-500 text-[0.8125rem] ${embedded ? "px-5 py-4 h-full" : `rounded-lg bg-surface-100 dark:bg-surface-800 border border-surface-200 dark:border-surface-700 ${compact ? "px-3.5 py-3" : "px-5 py-4"}`}`;
|
|
863
|
+
let t62;
|
|
864
|
+
if ($[24] !== fixedHeight) {
|
|
865
|
+
t62 = fixedHeight ? {
|
|
866
|
+
height: fixedHeight
|
|
867
|
+
} : void 0;
|
|
868
|
+
$[24] = fixedHeight;
|
|
869
|
+
$[25] = t62;
|
|
870
|
+
} else {
|
|
871
|
+
t62 = $[25];
|
|
872
|
+
}
|
|
873
|
+
let t7;
|
|
874
|
+
if ($[26] !== definition.title || $[27] !== t52 || $[28] !== t62) {
|
|
875
|
+
t7 = /* @__PURE__ */ jsxs("div", { className: t52, style: t62, children: [
|
|
826
876
|
definition.title,
|
|
827
877
|
" — No data"
|
|
828
878
|
] });
|
|
829
|
-
$[
|
|
830
|
-
$[
|
|
831
|
-
$[
|
|
879
|
+
$[26] = definition.title;
|
|
880
|
+
$[27] = t52;
|
|
881
|
+
$[28] = t62;
|
|
882
|
+
$[29] = t7;
|
|
832
883
|
} else {
|
|
833
|
-
|
|
884
|
+
t7 = $[29];
|
|
834
885
|
}
|
|
835
|
-
return
|
|
886
|
+
return t7;
|
|
836
887
|
}
|
|
837
|
-
const
|
|
838
|
-
let
|
|
839
|
-
if ($[
|
|
840
|
-
|
|
841
|
-
$[
|
|
842
|
-
$[
|
|
843
|
-
$[
|
|
844
|
-
$[
|
|
845
|
-
$[
|
|
846
|
-
$[
|
|
888
|
+
const t5 = data.rows[0];
|
|
889
|
+
let t6;
|
|
890
|
+
if ($[30] !== compact || $[31] !== definition.scorecard || $[32] !== definition.title || $[33] !== embedded || $[34] !== fixedHeight || $[35] !== t5) {
|
|
891
|
+
t6 = /* @__PURE__ */ jsx(InsightsScorecardView, { config: definition.scorecard, data: t5, title: definition.title, compact, embedded, fixedHeight });
|
|
892
|
+
$[30] = compact;
|
|
893
|
+
$[31] = definition.scorecard;
|
|
894
|
+
$[32] = definition.title;
|
|
895
|
+
$[33] = embedded;
|
|
896
|
+
$[34] = fixedHeight;
|
|
897
|
+
$[35] = t5;
|
|
898
|
+
$[36] = t6;
|
|
847
899
|
} else {
|
|
848
|
-
|
|
900
|
+
t6 = $[36];
|
|
849
901
|
}
|
|
850
|
-
return
|
|
902
|
+
return t6;
|
|
851
903
|
}
|
|
852
904
|
InsightWidget.displayName = "InsightWidget";
|
|
853
905
|
function HomeCardInsightSlot(t0) {
|