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