react-semaphor 0.0.73 → 0.0.74
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/react-semaphor.d.ts +60 -5
- package/dist/react-semaphor.js +8858 -8758
- package/dist/react-semaphor.umd.cjs +90 -90
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/react-semaphor.d.ts
CHANGED
|
@@ -11,10 +11,13 @@ import { FontSpec } from 'chart.js';
|
|
|
11
11
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
12
12
|
import { Layout } from 'react-grid-layout';
|
|
13
13
|
import { Point } from 'chart.js';
|
|
14
|
+
import { default as React_2 } from 'react';
|
|
14
15
|
import { StoreApi } from 'zustand';
|
|
15
16
|
import { UseBoundStore } from 'zustand';
|
|
16
17
|
|
|
17
18
|
declare type Actions = {
|
|
19
|
+
addFilteringCard: (card: TCard) => void;
|
|
20
|
+
removeFilteringCard: (card: TCard) => void;
|
|
18
21
|
setCustomCards: (customCards: CustomCard[]) => void;
|
|
19
22
|
setAuthToken: (authToken: AuthToken) => void;
|
|
20
23
|
setThemeStyle: (themeStyle: StyleProps) => void;
|
|
@@ -50,6 +53,7 @@ declare type Actions = {
|
|
|
50
53
|
setFilterValues: (filterValues: TFilterValue[] | undefined) => void;
|
|
51
54
|
addOrUpdateFilterValue: (filterValue: TFilterValue) => void;
|
|
52
55
|
removeFilterValue: (filterId: string) => void;
|
|
56
|
+
replaceFilterValue: (filterValue: TFilterValue) => void;
|
|
53
57
|
setStyle: (style: TStyle) => void;
|
|
54
58
|
getStyle: () => TStyle | undefined;
|
|
55
59
|
setOnSaveFunction: (onSaveFunction: (dashboard: TDashboard) => void) => void;
|
|
@@ -63,6 +67,7 @@ declare type Actions = {
|
|
|
63
67
|
getCard: (cardId: string) => TCard | undefined;
|
|
64
68
|
getSelectedCard: () => TCard | undefined;
|
|
65
69
|
getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
|
|
70
|
+
handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
|
|
66
71
|
};
|
|
67
72
|
|
|
68
73
|
declare type Actions_2 = {
|
|
@@ -124,13 +129,26 @@ export declare function cleanCard(card: TCard): TCard;
|
|
|
124
129
|
|
|
125
130
|
export declare type CustomCard = {
|
|
126
131
|
cardId: string;
|
|
127
|
-
|
|
132
|
+
content: React.FC<{
|
|
128
133
|
card: TCard;
|
|
129
134
|
}>;
|
|
135
|
+
footer?: React.FC<{
|
|
136
|
+
card: TCard;
|
|
137
|
+
}>;
|
|
138
|
+
replaceDefault?: boolean;
|
|
130
139
|
};
|
|
131
140
|
|
|
132
141
|
export declare function Dashboard(props: DashboardProps): JSX_2.Element;
|
|
133
142
|
|
|
143
|
+
export declare function DashboardCard({ card, footer, className, ...props }: DashboardCardProps): JSX_2.Element | null;
|
|
144
|
+
|
|
145
|
+
declare type DashboardCardProps = {
|
|
146
|
+
card: TCard;
|
|
147
|
+
footer?: React_2.ReactNode;
|
|
148
|
+
showControls?: boolean;
|
|
149
|
+
fetchCardData?: boolean;
|
|
150
|
+
} & React_2.HTMLAttributes<HTMLDivElement>;
|
|
151
|
+
|
|
134
152
|
export declare function DashboardPlus({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
|
|
135
153
|
|
|
136
154
|
declare type DashboardPlusProps = {
|
|
@@ -155,10 +173,11 @@ export declare function DashboardProvider({ children }: {
|
|
|
155
173
|
children: React.ReactNode;
|
|
156
174
|
}): JSX_2.Element;
|
|
157
175
|
|
|
158
|
-
declare type DashboardStore = {
|
|
176
|
+
export declare type DashboardStore = {
|
|
159
177
|
authToken?: AuthToken;
|
|
160
178
|
theme?: 'light' | 'dark' | 'system';
|
|
161
179
|
themeStyle?: StyleProps;
|
|
180
|
+
filteringCards?: TCard[];
|
|
162
181
|
bookmarkKey?: string;
|
|
163
182
|
dashboard: TDashboard;
|
|
164
183
|
selectedSheetId?: string | null | undefined;
|
|
@@ -399,6 +418,7 @@ export declare function useActions(): {
|
|
|
399
418
|
|
|
400
419
|
export declare function useCard(cardId: string): {
|
|
401
420
|
data: any;
|
|
421
|
+
card: TCard;
|
|
402
422
|
isError: boolean;
|
|
403
423
|
isLoading: boolean;
|
|
404
424
|
isFetching: boolean;
|
|
@@ -407,7 +427,7 @@ export declare function useCard(cardId: string): {
|
|
|
407
427
|
cfg: TChartConfiguration | undefined;
|
|
408
428
|
};
|
|
409
429
|
|
|
410
|
-
export declare function useDashboard({ id, version, authToken, customStyle, currentTheme, onSave, onEvent,
|
|
430
|
+
export declare function useDashboard({ id, version, authToken, customStyle, currentTheme, onSave, onEvent, }: UseDashboardProps): {
|
|
411
431
|
isLoading: boolean;
|
|
412
432
|
isError: boolean;
|
|
413
433
|
};
|
|
@@ -453,6 +473,33 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
453
473
|
options?: any;
|
|
454
474
|
} | undefined;
|
|
455
475
|
} | undefined;
|
|
476
|
+
filteringCards?: {
|
|
477
|
+
id: string;
|
|
478
|
+
title: string;
|
|
479
|
+
description?: string | undefined;
|
|
480
|
+
connectionId?: string | undefined;
|
|
481
|
+
type: TChartType;
|
|
482
|
+
sql?: string | undefined;
|
|
483
|
+
data?: any[] | undefined;
|
|
484
|
+
cfg?: any;
|
|
485
|
+
childCards?: any[] | undefined;
|
|
486
|
+
customCfg?: any;
|
|
487
|
+
preferences?: {
|
|
488
|
+
filterOnClick?: boolean | undefined;
|
|
489
|
+
filterOnClickField?: string | undefined;
|
|
490
|
+
formatNumber?: {
|
|
491
|
+
format?: string | undefined;
|
|
492
|
+
currency?: string | undefined;
|
|
493
|
+
locale?: string | undefined;
|
|
494
|
+
suffix?: string | undefined;
|
|
495
|
+
enabled?: string | boolean | undefined;
|
|
496
|
+
} | undefined;
|
|
497
|
+
} | undefined;
|
|
498
|
+
lastSelectedDatabase?: string | undefined;
|
|
499
|
+
lastSelectedSchema?: string | undefined;
|
|
500
|
+
lastSelectedTable?: string | undefined;
|
|
501
|
+
refreshInterval?: string | undefined;
|
|
502
|
+
}[] | undefined;
|
|
456
503
|
bookmarkKey?: string | undefined;
|
|
457
504
|
dashboard: {
|
|
458
505
|
id: string;
|
|
@@ -476,7 +523,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
476
523
|
static?: boolean | undefined;
|
|
477
524
|
isDraggable?: boolean | undefined;
|
|
478
525
|
isResizable?: boolean | undefined;
|
|
479
|
-
resizeHandles?: ("
|
|
526
|
+
resizeHandles?: ("s" | "w" | "e" | "n" | "sw" | "nw" | "se" | "ne")[] | undefined;
|
|
480
527
|
isBounded?: boolean | undefined;
|
|
481
528
|
}[] | undefined;
|
|
482
529
|
cards?: {
|
|
@@ -563,9 +610,13 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
563
610
|
}[] | undefined;
|
|
564
611
|
customCards?: {
|
|
565
612
|
cardId: string;
|
|
566
|
-
|
|
613
|
+
content: FC<{
|
|
567
614
|
card: TCard;
|
|
568
615
|
}>;
|
|
616
|
+
footer?: FC<{
|
|
617
|
+
card: TCard;
|
|
618
|
+
}> | undefined;
|
|
619
|
+
replaceDefault?: boolean | undefined;
|
|
569
620
|
}[] | undefined;
|
|
570
621
|
};
|
|
571
622
|
selectedSheetId?: string | null | undefined;
|
|
@@ -658,6 +709,8 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
658
709
|
onUpdateCard?: ((card: TCard, sheetId: string) => void) | undefined;
|
|
659
710
|
onRemoveCard?: ((card: TCard, sheetId: string) => void) | undefined;
|
|
660
711
|
actions: {
|
|
712
|
+
addFilteringCard: (card: TCard) => void;
|
|
713
|
+
removeFilteringCard: (card: TCard) => void;
|
|
661
714
|
setCustomCards: (customCards: CustomCard[]) => void;
|
|
662
715
|
setAuthToken: (authToken: AuthToken) => void;
|
|
663
716
|
setThemeStyle: (themeStyle: StyleProps) => void;
|
|
@@ -693,6 +746,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
693
746
|
setFilterValues: (filterValues: TFilterValue[] | undefined) => void;
|
|
694
747
|
addOrUpdateFilterValue: (filterValue: TFilterValue) => void;
|
|
695
748
|
removeFilterValue: (filterId: string) => void;
|
|
749
|
+
replaceFilterValue: (filterValue: TFilterValue) => void;
|
|
696
750
|
setStyle: (style: TStyle) => void;
|
|
697
751
|
getStyle: () => TStyle | undefined;
|
|
698
752
|
setOnSaveFunction: (onSaveFunction: (dashboard: TDashboard) => void) => void;
|
|
@@ -706,6 +760,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
706
760
|
getCard: (cardId: string) => TCard | undefined;
|
|
707
761
|
getSelectedCard: () => TCard | undefined;
|
|
708
762
|
getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
|
|
763
|
+
handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
|
|
709
764
|
};
|
|
710
765
|
}) => void), shouldReplace?: boolean | undefined): void;
|
|
711
766
|
}>;
|