@rebasepro/plugin-insights 0.2.4 → 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 +5 -8
- package/dist/core/src/components/LoginView/LoginView.d.ts +9 -1
- package/dist/core/src/hooks/data/useCollectionFetch.d.ts +12 -1
- package/dist/index.es.js +215 -164
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +215 -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 +2 -2
- package/dist/types/src/controllers/client.d.ts +25 -40
- package/dist/types/src/controllers/data.d.ts +4 -0
- package/dist/types/src/controllers/data_driver.d.ts +5 -0
- package/dist/types/src/types/auth_adapter.d.ts +3 -56
- 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/properties.d.ts +7 -5
- package/dist/types/src/types/user_management_delegate.d.ts +16 -53
- package/dist/types/src/users/index.d.ts +0 -1
- package/dist/types/src/users/user.d.ts +0 -1
- package/package.json +4 -4
- package/src/components/InsightWidget.tsx +33 -4
- package/src/components/InsightWidgetSkeleton.tsx +7 -1
- package/src/components/InsightsScorecardView.tsx +4 -1
- package/dist/types/src/users/roles.d.ts +0 -14
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { PostgresCollection } from "@rebasepro/types";
|
|
1
|
+
import type { PostgresCollection } from "@rebasepro/types";
|
|
2
2
|
/**
|
|
3
|
-
* Default users collection
|
|
3
|
+
* Default users collection.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* (Map keyed by slug, last-write-wins) so that developer-defined
|
|
9
|
-
* collections with the same slug override this default — no hardcoded
|
|
10
|
-
* string checks required.
|
|
5
|
+
* Prepended to the developer's collections array by the admin and server.
|
|
6
|
+
* Slug-based dedup (Map keyed by slug, last-write-wins) lets developers
|
|
7
|
+
* override by defining their own collection with `slug: "users"`.
|
|
11
8
|
*/
|
|
12
9
|
export declare const defaultUsersCollection: PostgresCollection;
|
|
@@ -92,10 +92,18 @@ export interface LoginViewProps {
|
|
|
92
92
|
* If not set, derived from `authController.capabilities.registration`.
|
|
93
93
|
*/
|
|
94
94
|
registrationEnabled?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Pre-fill the email field (e.g. for demo or testing environments).
|
|
97
|
+
*/
|
|
98
|
+
defaultEmail?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Pre-fill the password field (e.g. for demo or testing environments).
|
|
101
|
+
*/
|
|
102
|
+
defaultPassword?: string;
|
|
95
103
|
}
|
|
96
104
|
/**
|
|
97
105
|
* Generic login view component that works with any AuthControllerExtended.
|
|
98
106
|
* Feature-detects capabilities to show/hide login methods.
|
|
99
107
|
* @group Core
|
|
100
108
|
*/
|
|
101
|
-
export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, githubClientId, linkedinClientId, title, subtitle, needsSetup, registrationEnabled, additionalComponent }: LoginViewProps): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, githubClientId, linkedinClientId, title, subtitle, needsSetup, registrationEnabled, additionalComponent, defaultEmail, defaultPassword }: LoginViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,6 +16,14 @@ export interface CollectionFetchProps<M extends Record<string, any>> {
|
|
|
16
16
|
* Number of entities to fetch
|
|
17
17
|
*/
|
|
18
18
|
itemCount?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Number of items to skip
|
|
21
|
+
*/
|
|
22
|
+
offset?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Page number (1-indexed), alternative to offset
|
|
25
|
+
*/
|
|
26
|
+
page?: number;
|
|
19
27
|
/**
|
|
20
28
|
* Filter the fetched data by the property
|
|
21
29
|
*/
|
|
@@ -37,6 +45,7 @@ export interface CollectionFetchResult<M extends Record<string, any>> {
|
|
|
37
45
|
dataLoading: boolean;
|
|
38
46
|
noMoreToLoad: boolean;
|
|
39
47
|
dataLoadingError?: Error;
|
|
48
|
+
totalCount?: number;
|
|
40
49
|
}
|
|
41
50
|
/**
|
|
42
51
|
* This hook is used to fetch collections using a given collection
|
|
@@ -45,7 +54,9 @@ export interface CollectionFetchResult<M extends Record<string, any>> {
|
|
|
45
54
|
* @param filterValues
|
|
46
55
|
* @param sortBy
|
|
47
56
|
* @param itemCount
|
|
57
|
+
* @param offset
|
|
58
|
+
* @param page
|
|
48
59
|
* @param searchString
|
|
49
60
|
* @group Hooks and utilities
|
|
50
61
|
*/
|
|
51
|
-
export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path, collection, filterValues, sortBy, itemCount, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
|
|
62
|
+
export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path, collection, filterValues, sortBy, itemCount, offset, page, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
|
package/dist/index.es.js
CHANGED
|
@@ -215,13 +215,14 @@ function formatNumber(value, format) {
|
|
|
215
215
|
return formatted;
|
|
216
216
|
}
|
|
217
217
|
function InsightsScorecardView(t0) {
|
|
218
|
-
const $ = c(
|
|
218
|
+
const $ = c(59);
|
|
219
219
|
const {
|
|
220
220
|
config,
|
|
221
221
|
data,
|
|
222
222
|
title,
|
|
223
223
|
compact: t1,
|
|
224
|
-
embedded: t2
|
|
224
|
+
embedded: t2,
|
|
225
|
+
fixedHeight
|
|
225
226
|
} = t0;
|
|
226
227
|
const compact = t1 === void 0 ? false : t1;
|
|
227
228
|
const embedded = t2 === void 0 ? false : t2;
|
|
@@ -381,113 +382,117 @@ function InsightsScorecardView(t0) {
|
|
|
381
382
|
}
|
|
382
383
|
const baseClass = t7;
|
|
383
384
|
let t8;
|
|
384
|
-
if ($[28] !== embedded || $[29] !== isSmall) {
|
|
385
|
-
t8 = embedded ? void 0 : {
|
|
385
|
+
if ($[28] !== embedded || $[29] !== fixedHeight || $[30] !== isSmall) {
|
|
386
|
+
t8 = embedded ? void 0 : fixedHeight ? {
|
|
387
|
+
height: fixedHeight
|
|
388
|
+
} : {
|
|
386
389
|
minHeight: isSmall ? 68 : 92
|
|
387
390
|
};
|
|
388
391
|
$[28] = embedded;
|
|
389
|
-
$[29] =
|
|
390
|
-
$[30] =
|
|
392
|
+
$[29] = fixedHeight;
|
|
393
|
+
$[30] = isSmall;
|
|
394
|
+
$[31] = t8;
|
|
391
395
|
} else {
|
|
392
|
-
t8 = $[
|
|
396
|
+
t8 = $[31];
|
|
393
397
|
}
|
|
394
398
|
const t9 = `flex items-center justify-between ${isSmall ? "mb-1" : "mb-2"}`;
|
|
395
399
|
const t10 = `font-medium leading-snug truncate text-surface-500 dark:text-surface-400 ${isSmall ? "text-[11px]" : "text-xs"}`;
|
|
396
400
|
let t11;
|
|
397
|
-
if ($[
|
|
401
|
+
if ($[32] !== t10 || $[33] !== title) {
|
|
398
402
|
t11 = /* @__PURE__ */ jsx("span", { className: t10, children: title });
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
403
|
+
$[32] = t10;
|
|
404
|
+
$[33] = title;
|
|
405
|
+
$[34] = t11;
|
|
402
406
|
} else {
|
|
403
|
-
t11 = $[
|
|
407
|
+
t11 = $[34];
|
|
404
408
|
}
|
|
405
409
|
let t12;
|
|
406
|
-
if ($[
|
|
410
|
+
if ($[35] !== config.dateRange || $[36] !== isSmall) {
|
|
407
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 });
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
412
|
+
$[35] = config.dateRange;
|
|
413
|
+
$[36] = isSmall;
|
|
414
|
+
$[37] = t12;
|
|
411
415
|
} else {
|
|
412
|
-
t12 = $[
|
|
416
|
+
t12 = $[37];
|
|
413
417
|
}
|
|
414
418
|
let t13;
|
|
415
|
-
if ($[
|
|
419
|
+
if ($[38] !== t11 || $[39] !== t12) {
|
|
416
420
|
t13 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
417
421
|
t11,
|
|
418
422
|
t12
|
|
419
423
|
] });
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
$[
|
|
424
|
+
$[38] = t11;
|
|
425
|
+
$[39] = t12;
|
|
426
|
+
$[40] = t13;
|
|
423
427
|
} else {
|
|
424
|
-
t13 = $[
|
|
428
|
+
t13 = $[40];
|
|
425
429
|
}
|
|
426
430
|
let t14;
|
|
427
|
-
if ($[
|
|
431
|
+
if ($[41] !== iconElement) {
|
|
428
432
|
t14 = iconElement && /* @__PURE__ */ jsx("span", { className: "ml-2 shrink-0", children: iconElement });
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
433
|
+
$[41] = iconElement;
|
|
434
|
+
$[42] = t14;
|
|
431
435
|
} else {
|
|
432
|
-
t14 = $[
|
|
436
|
+
t14 = $[42];
|
|
433
437
|
}
|
|
434
438
|
let t15;
|
|
435
|
-
if ($[
|
|
439
|
+
if ($[43] !== t13 || $[44] !== t14 || $[45] !== t9) {
|
|
436
440
|
t15 = /* @__PURE__ */ jsxs("div", { className: t9, children: [
|
|
437
441
|
t13,
|
|
438
442
|
t14
|
|
439
443
|
] });
|
|
440
|
-
$[
|
|
441
|
-
$[
|
|
442
|
-
$[
|
|
443
|
-
$[
|
|
444
|
+
$[43] = t13;
|
|
445
|
+
$[44] = t14;
|
|
446
|
+
$[45] = t9;
|
|
447
|
+
$[46] = t15;
|
|
444
448
|
} else {
|
|
445
|
-
t15 = $[
|
|
449
|
+
t15 = $[46];
|
|
446
450
|
}
|
|
447
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"}`;
|
|
448
452
|
let t17;
|
|
449
|
-
if ($[
|
|
453
|
+
if ($[47] !== formattedValue || $[48] !== t16) {
|
|
450
454
|
t17 = /* @__PURE__ */ jsx("div", { className: t16, children: formattedValue });
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
455
|
+
$[47] = formattedValue;
|
|
456
|
+
$[48] = t16;
|
|
457
|
+
$[49] = t17;
|
|
454
458
|
} else {
|
|
455
|
-
t17 = $[
|
|
459
|
+
t17 = $[49];
|
|
456
460
|
}
|
|
457
461
|
let t18;
|
|
458
|
-
if ($[
|
|
462
|
+
if ($[50] !== comparisonElement || $[51] !== isSmall) {
|
|
459
463
|
t18 = comparisonElement && /* @__PURE__ */ jsx("div", { className: isSmall ? "mt-0.5" : "mt-1", children: comparisonElement });
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
464
|
+
$[50] = comparisonElement;
|
|
465
|
+
$[51] = isSmall;
|
|
466
|
+
$[52] = t18;
|
|
463
467
|
} else {
|
|
464
|
-
t18 = $[
|
|
468
|
+
t18 = $[52];
|
|
465
469
|
}
|
|
466
470
|
let t19;
|
|
467
|
-
if ($[
|
|
471
|
+
if ($[53] !== baseClass || $[54] !== t15 || $[55] !== t17 || $[56] !== t18 || $[57] !== t8) {
|
|
468
472
|
t19 = /* @__PURE__ */ jsxs("div", { ref: containerRef, className: baseClass, style: t8, children: [
|
|
469
473
|
t15,
|
|
470
474
|
t17,
|
|
471
475
|
t18
|
|
472
476
|
] });
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
477
|
+
$[53] = baseClass;
|
|
478
|
+
$[54] = t15;
|
|
479
|
+
$[55] = t17;
|
|
480
|
+
$[56] = t18;
|
|
481
|
+
$[57] = t8;
|
|
482
|
+
$[58] = t19;
|
|
479
483
|
} else {
|
|
480
|
-
t19 = $[
|
|
484
|
+
t19 = $[58];
|
|
481
485
|
}
|
|
482
486
|
return t19;
|
|
483
487
|
}
|
|
484
488
|
InsightsScorecardView.displayName = "InsightsScorecardView";
|
|
485
489
|
function InsightWidgetSkeleton(t0) {
|
|
486
|
-
const $ = c(
|
|
490
|
+
const $ = c(18);
|
|
487
491
|
const {
|
|
488
492
|
config,
|
|
489
493
|
compact: t1,
|
|
490
|
-
embedded: t2
|
|
494
|
+
embedded: t2,
|
|
495
|
+
fixedHeight
|
|
491
496
|
} = t0;
|
|
492
497
|
const compact = t1 === void 0 ? false : t1;
|
|
493
498
|
const embedded = t2 === void 0 ? false : t2;
|
|
@@ -563,25 +568,27 @@ function InsightWidgetSkeleton(t0) {
|
|
|
563
568
|
return t10;
|
|
564
569
|
}
|
|
565
570
|
let t3;
|
|
566
|
-
if ($[12] !== embedded || $[13] !==
|
|
567
|
-
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 });
|
|
568
573
|
$[12] = embedded;
|
|
569
|
-
$[13] =
|
|
570
|
-
$[14] =
|
|
571
|
-
$[15] =
|
|
572
|
-
$[16] =
|
|
574
|
+
$[13] = fixedHeight;
|
|
575
|
+
$[14] = hasComparison;
|
|
576
|
+
$[15] = hasDateRange;
|
|
577
|
+
$[16] = hasIcon;
|
|
578
|
+
$[17] = t3;
|
|
573
579
|
} else {
|
|
574
|
-
t3 = $[
|
|
580
|
+
t3 = $[17];
|
|
575
581
|
}
|
|
576
582
|
return t3;
|
|
577
583
|
}
|
|
578
584
|
function StandardSkeleton(t0) {
|
|
579
|
-
const $ = c(
|
|
585
|
+
const $ = c(37);
|
|
580
586
|
const {
|
|
581
587
|
hasComparison,
|
|
582
588
|
hasIcon,
|
|
583
589
|
hasDateRange,
|
|
584
|
-
embedded
|
|
590
|
+
embedded,
|
|
591
|
+
fixedHeight
|
|
585
592
|
} = t0;
|
|
586
593
|
const containerRef = useRef(null);
|
|
587
594
|
const [containerWidth, setContainerWidth] = useState(null);
|
|
@@ -628,122 +635,131 @@ function StandardSkeleton(t0) {
|
|
|
628
635
|
t4 = $[5];
|
|
629
636
|
}
|
|
630
637
|
let t5;
|
|
631
|
-
if ($[6] !== embedded || $[7] !== isSmall) {
|
|
632
|
-
t5 = embedded ? void 0 : {
|
|
638
|
+
if ($[6] !== embedded || $[7] !== fixedHeight || $[8] !== isSmall) {
|
|
639
|
+
t5 = embedded ? void 0 : fixedHeight ? {
|
|
640
|
+
height: fixedHeight
|
|
641
|
+
} : {
|
|
633
642
|
minHeight: isSmall ? 68 : 92
|
|
634
643
|
};
|
|
635
644
|
$[6] = embedded;
|
|
636
|
-
$[7] =
|
|
637
|
-
$[8] =
|
|
645
|
+
$[7] = fixedHeight;
|
|
646
|
+
$[8] = isSmall;
|
|
647
|
+
$[9] = t5;
|
|
638
648
|
} else {
|
|
639
|
-
t5 = $[
|
|
649
|
+
t5 = $[9];
|
|
640
650
|
}
|
|
641
651
|
const t6 = `flex items-center justify-between ${isSmall ? "mb-1" : "mb-2"}`;
|
|
642
652
|
let t7;
|
|
643
|
-
if ($[
|
|
653
|
+
if ($[10] !== titleHeight) {
|
|
644
654
|
t7 = /* @__PURE__ */ jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded", style: {
|
|
645
655
|
height: titleHeight,
|
|
646
656
|
width: "60%"
|
|
647
657
|
} });
|
|
648
|
-
$[
|
|
649
|
-
$[
|
|
658
|
+
$[10] = titleHeight;
|
|
659
|
+
$[11] = t7;
|
|
650
660
|
} else {
|
|
651
|
-
t7 = $[
|
|
661
|
+
t7 = $[11];
|
|
652
662
|
}
|
|
653
663
|
let t8;
|
|
654
|
-
if ($[
|
|
664
|
+
if ($[12] !== hasDateRange || $[13] !== isSmall) {
|
|
655
665
|
t8 = hasDateRange && !isSmall && /* @__PURE__ */ jsx("div", { className: "bg-surface-200/60 dark:bg-surface-700/60 rounded mt-0.5", style: {
|
|
656
666
|
height: 14,
|
|
657
667
|
width: "40%"
|
|
658
668
|
} });
|
|
659
|
-
$[
|
|
660
|
-
$[
|
|
661
|
-
$[
|
|
669
|
+
$[12] = hasDateRange;
|
|
670
|
+
$[13] = isSmall;
|
|
671
|
+
$[14] = t8;
|
|
662
672
|
} else {
|
|
663
|
-
t8 = $[
|
|
673
|
+
t8 = $[14];
|
|
664
674
|
}
|
|
665
675
|
let t9;
|
|
666
|
-
if ($[
|
|
676
|
+
if ($[15] !== t7 || $[16] !== t8) {
|
|
667
677
|
t9 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
668
678
|
t7,
|
|
669
679
|
t8
|
|
670
680
|
] });
|
|
671
|
-
$[
|
|
672
|
-
$[
|
|
673
|
-
$[
|
|
681
|
+
$[15] = t7;
|
|
682
|
+
$[16] = t8;
|
|
683
|
+
$[17] = t9;
|
|
674
684
|
} else {
|
|
675
|
-
t9 = $[
|
|
685
|
+
t9 = $[17];
|
|
676
686
|
}
|
|
677
687
|
let t10;
|
|
678
|
-
if ($[
|
|
688
|
+
if ($[18] !== hasIcon || $[19] !== iconSize) {
|
|
679
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: {
|
|
680
690
|
height: iconSize,
|
|
681
691
|
width: iconSize
|
|
682
692
|
} }) });
|
|
683
|
-
$[
|
|
684
|
-
$[
|
|
685
|
-
$[
|
|
693
|
+
$[18] = hasIcon;
|
|
694
|
+
$[19] = iconSize;
|
|
695
|
+
$[20] = t10;
|
|
686
696
|
} else {
|
|
687
|
-
t10 = $[
|
|
697
|
+
t10 = $[20];
|
|
688
698
|
}
|
|
689
699
|
let t11;
|
|
690
|
-
if ($[
|
|
700
|
+
if ($[21] !== t10 || $[22] !== t6 || $[23] !== t9) {
|
|
691
701
|
t11 = /* @__PURE__ */ jsxs("div", { className: t6, children: [
|
|
692
702
|
t9,
|
|
693
703
|
t10
|
|
694
704
|
] });
|
|
695
|
-
$[
|
|
696
|
-
$[
|
|
697
|
-
$[
|
|
698
|
-
$[
|
|
705
|
+
$[21] = t10;
|
|
706
|
+
$[22] = t6;
|
|
707
|
+
$[23] = t9;
|
|
708
|
+
$[24] = t11;
|
|
699
709
|
} else {
|
|
700
|
-
t11 = $[
|
|
710
|
+
t11 = $[24];
|
|
701
711
|
}
|
|
702
712
|
let t12;
|
|
703
|
-
if ($[
|
|
713
|
+
if ($[25] !== valueHeight) {
|
|
704
714
|
t12 = /* @__PURE__ */ jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded", style: {
|
|
705
715
|
height: valueHeight,
|
|
706
716
|
width: "40%"
|
|
707
717
|
} });
|
|
708
|
-
$[
|
|
709
|
-
$[
|
|
718
|
+
$[25] = valueHeight;
|
|
719
|
+
$[26] = t12;
|
|
710
720
|
} else {
|
|
711
|
-
t12 = $[
|
|
721
|
+
t12 = $[26];
|
|
712
722
|
}
|
|
713
723
|
let t13;
|
|
714
|
-
if ($[
|
|
724
|
+
if ($[27] !== hasComparison || $[28] !== isSmall) {
|
|
715
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: {
|
|
716
726
|
height: 16,
|
|
717
727
|
width: "25%"
|
|
718
728
|
} }) });
|
|
719
|
-
$[
|
|
720
|
-
$[
|
|
721
|
-
$[
|
|
729
|
+
$[27] = hasComparison;
|
|
730
|
+
$[28] = isSmall;
|
|
731
|
+
$[29] = t13;
|
|
722
732
|
} else {
|
|
723
|
-
t13 = $[
|
|
733
|
+
t13 = $[29];
|
|
724
734
|
}
|
|
725
735
|
let t14;
|
|
726
|
-
if ($[
|
|
736
|
+
if ($[30] !== t11 || $[31] !== t12 || $[32] !== t13 || $[33] !== t3 || $[34] !== t4 || $[35] !== t5) {
|
|
727
737
|
t14 = /* @__PURE__ */ jsxs("div", { ref: t3, className: t4, style: t5, children: [
|
|
728
738
|
t11,
|
|
729
739
|
t12,
|
|
730
740
|
t13
|
|
731
741
|
] });
|
|
732
|
-
$[
|
|
733
|
-
$[
|
|
734
|
-
$[
|
|
735
|
-
$[
|
|
736
|
-
$[
|
|
737
|
-
$[
|
|
738
|
-
$[
|
|
742
|
+
$[30] = t11;
|
|
743
|
+
$[31] = t12;
|
|
744
|
+
$[32] = t13;
|
|
745
|
+
$[33] = t3;
|
|
746
|
+
$[34] = t4;
|
|
747
|
+
$[35] = t5;
|
|
748
|
+
$[36] = t14;
|
|
739
749
|
} else {
|
|
740
|
-
t14 = $[
|
|
750
|
+
t14 = $[36];
|
|
741
751
|
}
|
|
742
752
|
return t14;
|
|
743
753
|
}
|
|
744
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
|
+
}
|
|
745
761
|
function InsightWidget(t0) {
|
|
746
|
-
const $ = c(
|
|
762
|
+
const $ = c(37);
|
|
747
763
|
const {
|
|
748
764
|
definition,
|
|
749
765
|
collectionSlug,
|
|
@@ -773,82 +789,117 @@ function InsightWidget(t0) {
|
|
|
773
789
|
loading,
|
|
774
790
|
error
|
|
775
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;
|
|
776
803
|
if (loading) {
|
|
777
|
-
let
|
|
778
|
-
if ($[
|
|
779
|
-
|
|
780
|
-
$[
|
|
781
|
-
$[
|
|
782
|
-
$[
|
|
783
|
-
$[
|
|
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;
|
|
784
812
|
} else {
|
|
785
|
-
|
|
813
|
+
t52 = $[12];
|
|
786
814
|
}
|
|
787
|
-
return
|
|
815
|
+
return t52;
|
|
788
816
|
}
|
|
789
817
|
if (error) {
|
|
790
|
-
const
|
|
791
|
-
let
|
|
792
|
-
if ($[
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
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;
|
|
796
826
|
} else {
|
|
797
|
-
|
|
827
|
+
t62 = $[14];
|
|
798
828
|
}
|
|
799
|
-
let
|
|
800
|
-
if ($[
|
|
801
|
-
|
|
802
|
-
$[
|
|
803
|
-
$[
|
|
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;
|
|
804
834
|
} else {
|
|
805
|
-
|
|
835
|
+
t7 = $[16];
|
|
806
836
|
}
|
|
807
|
-
let
|
|
808
|
-
if ($[
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
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
|
|
812
850
|
] });
|
|
813
|
-
$[
|
|
814
|
-
$[
|
|
815
|
-
$[
|
|
816
|
-
$[
|
|
851
|
+
$[19] = t52;
|
|
852
|
+
$[20] = t62;
|
|
853
|
+
$[21] = t7;
|
|
854
|
+
$[22] = t8;
|
|
855
|
+
$[23] = t9;
|
|
817
856
|
} else {
|
|
818
|
-
|
|
857
|
+
t9 = $[23];
|
|
819
858
|
}
|
|
820
|
-
return
|
|
859
|
+
return t9;
|
|
821
860
|
}
|
|
822
861
|
if (!data || data.rows.length === 0) {
|
|
823
|
-
const
|
|
824
|
-
let
|
|
825
|
-
if ($[
|
|
826
|
-
|
|
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: [
|
|
827
876
|
definition.title,
|
|
828
877
|
" — No data"
|
|
829
878
|
] });
|
|
830
|
-
$[
|
|
831
|
-
$[
|
|
832
|
-
$[
|
|
879
|
+
$[26] = definition.title;
|
|
880
|
+
$[27] = t52;
|
|
881
|
+
$[28] = t62;
|
|
882
|
+
$[29] = t7;
|
|
833
883
|
} else {
|
|
834
|
-
|
|
884
|
+
t7 = $[29];
|
|
835
885
|
}
|
|
836
|
-
return
|
|
886
|
+
return t7;
|
|
837
887
|
}
|
|
838
|
-
const
|
|
839
|
-
let
|
|
840
|
-
if ($[
|
|
841
|
-
|
|
842
|
-
$[
|
|
843
|
-
$[
|
|
844
|
-
$[
|
|
845
|
-
$[
|
|
846
|
-
$[
|
|
847
|
-
$[
|
|
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;
|
|
848
899
|
} else {
|
|
849
|
-
|
|
900
|
+
t6 = $[36];
|
|
850
901
|
}
|
|
851
|
-
return
|
|
902
|
+
return t6;
|
|
852
903
|
}
|
|
853
904
|
InsightWidget.displayName = "InsightWidget";
|
|
854
905
|
function HomeCardInsightSlot(t0) {
|