react-semaphor 0.0.73 → 0.0.75
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 +89 -10
- package/dist/react-semaphor.js +8515 -8411
- package/dist/react-semaphor.umd.cjs +85 -85
- 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 = {
|
|
@@ -105,6 +110,11 @@ export declare type AuthToken = {
|
|
|
105
110
|
refreshToken: string;
|
|
106
111
|
};
|
|
107
112
|
|
|
113
|
+
declare type BaseCustomCard = {
|
|
114
|
+
cardId: string;
|
|
115
|
+
replaceDefault?: boolean;
|
|
116
|
+
};
|
|
117
|
+
|
|
108
118
|
declare type BaseFilter = {
|
|
109
119
|
filterId: TFilter['id'];
|
|
110
120
|
expression?: string;
|
|
@@ -120,17 +130,39 @@ export declare type Bookmark = {
|
|
|
120
130
|
filterValues?: TFilterValue[];
|
|
121
131
|
};
|
|
122
132
|
|
|
123
|
-
|
|
133
|
+
declare type CardWithContent = BaseCustomCard & {
|
|
134
|
+
content: React.FC<{
|
|
135
|
+
card: TCard;
|
|
136
|
+
}>;
|
|
137
|
+
footer?: React.FC<{
|
|
138
|
+
card: TCard;
|
|
139
|
+
}>;
|
|
140
|
+
};
|
|
124
141
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
142
|
+
declare type CardWithFooter = BaseCustomCard & {
|
|
143
|
+
content?: React.FC<{
|
|
144
|
+
card: TCard;
|
|
145
|
+
}>;
|
|
146
|
+
footer: React.FC<{
|
|
128
147
|
card: TCard;
|
|
129
148
|
}>;
|
|
130
149
|
};
|
|
131
150
|
|
|
151
|
+
export declare function cleanCard(card: TCard): TCard;
|
|
152
|
+
|
|
153
|
+
export declare type CustomCard = CardWithContent | CardWithFooter;
|
|
154
|
+
|
|
132
155
|
export declare function Dashboard(props: DashboardProps): JSX_2.Element;
|
|
133
156
|
|
|
157
|
+
export declare function DashboardCard({ card, footer, className, ...props }: DashboardCardProps): JSX_2.Element | null;
|
|
158
|
+
|
|
159
|
+
declare type DashboardCardProps = {
|
|
160
|
+
card: TCard;
|
|
161
|
+
footer?: React_2.ReactNode;
|
|
162
|
+
showControls?: boolean;
|
|
163
|
+
fetchCardData?: boolean;
|
|
164
|
+
} & React_2.HTMLAttributes<HTMLDivElement>;
|
|
165
|
+
|
|
134
166
|
export declare function DashboardPlus({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
|
|
135
167
|
|
|
136
168
|
declare type DashboardPlusProps = {
|
|
@@ -145,6 +177,7 @@ export declare type DashboardProps = {
|
|
|
145
177
|
currentTheme?: 'light' | 'dark' | 'system';
|
|
146
178
|
version?: string;
|
|
147
179
|
customCards?: CustomCard[];
|
|
180
|
+
onChartElementClicked?: (card: TCard, fieldValues: any) => void;
|
|
148
181
|
onEvent?: (event: TEvent) => void;
|
|
149
182
|
onSave?: (dashboard: TDashboard) => void;
|
|
150
183
|
LoadingComponent?: (props: LoadingProps) => React.ReactNode;
|
|
@@ -155,10 +188,11 @@ export declare function DashboardProvider({ children }: {
|
|
|
155
188
|
children: React.ReactNode;
|
|
156
189
|
}): JSX_2.Element;
|
|
157
190
|
|
|
158
|
-
declare type DashboardStore = {
|
|
191
|
+
export declare type DashboardStore = {
|
|
159
192
|
authToken?: AuthToken;
|
|
160
193
|
theme?: 'light' | 'dark' | 'system';
|
|
161
194
|
themeStyle?: StyleProps;
|
|
195
|
+
filteringCards?: TCard[];
|
|
162
196
|
bookmarkKey?: string;
|
|
163
197
|
dashboard: TDashboard;
|
|
164
198
|
selectedSheetId?: string | null | undefined;
|
|
@@ -399,6 +433,7 @@ export declare function useActions(): {
|
|
|
399
433
|
|
|
400
434
|
export declare function useCard(cardId: string): {
|
|
401
435
|
data: any;
|
|
436
|
+
card: TCard;
|
|
402
437
|
isError: boolean;
|
|
403
438
|
isLoading: boolean;
|
|
404
439
|
isFetching: boolean;
|
|
@@ -407,7 +442,7 @@ export declare function useCard(cardId: string): {
|
|
|
407
442
|
cfg: TChartConfiguration | undefined;
|
|
408
443
|
};
|
|
409
444
|
|
|
410
|
-
export declare function useDashboard({ id, version, authToken, customStyle, currentTheme, onSave, onEvent,
|
|
445
|
+
export declare function useDashboard({ id, version, authToken, customStyle, currentTheme, onSave, onEvent, }: UseDashboardProps): {
|
|
411
446
|
isLoading: boolean;
|
|
412
447
|
isError: boolean;
|
|
413
448
|
};
|
|
@@ -453,6 +488,33 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
453
488
|
options?: any;
|
|
454
489
|
} | undefined;
|
|
455
490
|
} | undefined;
|
|
491
|
+
filteringCards?: {
|
|
492
|
+
id: string;
|
|
493
|
+
title: string;
|
|
494
|
+
description?: string | undefined;
|
|
495
|
+
connectionId?: string | undefined;
|
|
496
|
+
type: TChartType;
|
|
497
|
+
sql?: string | undefined;
|
|
498
|
+
data?: any[] | undefined;
|
|
499
|
+
cfg?: any;
|
|
500
|
+
childCards?: any[] | undefined;
|
|
501
|
+
customCfg?: any;
|
|
502
|
+
preferences?: {
|
|
503
|
+
filterOnClick?: boolean | undefined;
|
|
504
|
+
filterOnClickField?: string | undefined;
|
|
505
|
+
formatNumber?: {
|
|
506
|
+
format?: string | undefined;
|
|
507
|
+
currency?: string | undefined;
|
|
508
|
+
locale?: string | undefined;
|
|
509
|
+
suffix?: string | undefined;
|
|
510
|
+
enabled?: string | boolean | undefined;
|
|
511
|
+
} | undefined;
|
|
512
|
+
} | undefined;
|
|
513
|
+
lastSelectedDatabase?: string | undefined;
|
|
514
|
+
lastSelectedSchema?: string | undefined;
|
|
515
|
+
lastSelectedTable?: string | undefined;
|
|
516
|
+
refreshInterval?: string | undefined;
|
|
517
|
+
}[] | undefined;
|
|
456
518
|
bookmarkKey?: string | undefined;
|
|
457
519
|
dashboard: {
|
|
458
520
|
id: string;
|
|
@@ -476,7 +538,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
476
538
|
static?: boolean | undefined;
|
|
477
539
|
isDraggable?: boolean | undefined;
|
|
478
540
|
isResizable?: boolean | undefined;
|
|
479
|
-
resizeHandles?: ("
|
|
541
|
+
resizeHandles?: ("s" | "w" | "e" | "n" | "sw" | "nw" | "se" | "ne")[] | undefined;
|
|
480
542
|
isBounded?: boolean | undefined;
|
|
481
543
|
}[] | undefined;
|
|
482
544
|
cards?: {
|
|
@@ -561,12 +623,25 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
561
623
|
database: string;
|
|
562
624
|
sql: string;
|
|
563
625
|
}[] | undefined;
|
|
564
|
-
customCards?: {
|
|
626
|
+
customCards?: ({
|
|
565
627
|
cardId: string;
|
|
566
|
-
|
|
628
|
+
replaceDefault?: boolean | undefined;
|
|
629
|
+
content: FC<{
|
|
567
630
|
card: TCard;
|
|
568
631
|
}>;
|
|
569
|
-
|
|
632
|
+
footer?: FC<{
|
|
633
|
+
card: TCard;
|
|
634
|
+
}> | undefined;
|
|
635
|
+
} | {
|
|
636
|
+
cardId: string;
|
|
637
|
+
replaceDefault?: boolean | undefined;
|
|
638
|
+
content?: FC<{
|
|
639
|
+
card: TCard;
|
|
640
|
+
}> | undefined;
|
|
641
|
+
footer: FC<{
|
|
642
|
+
card: TCard;
|
|
643
|
+
}>;
|
|
644
|
+
})[] | undefined;
|
|
570
645
|
};
|
|
571
646
|
selectedSheetId?: string | null | undefined;
|
|
572
647
|
selectedCardId?: string | null | undefined;
|
|
@@ -658,6 +733,8 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
658
733
|
onUpdateCard?: ((card: TCard, sheetId: string) => void) | undefined;
|
|
659
734
|
onRemoveCard?: ((card: TCard, sheetId: string) => void) | undefined;
|
|
660
735
|
actions: {
|
|
736
|
+
addFilteringCard: (card: TCard) => void;
|
|
737
|
+
removeFilteringCard: (card: TCard) => void;
|
|
661
738
|
setCustomCards: (customCards: CustomCard[]) => void;
|
|
662
739
|
setAuthToken: (authToken: AuthToken) => void;
|
|
663
740
|
setThemeStyle: (themeStyle: StyleProps) => void;
|
|
@@ -693,6 +770,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
693
770
|
setFilterValues: (filterValues: TFilterValue[] | undefined) => void;
|
|
694
771
|
addOrUpdateFilterValue: (filterValue: TFilterValue) => void;
|
|
695
772
|
removeFilterValue: (filterId: string) => void;
|
|
773
|
+
replaceFilterValue: (filterValue: TFilterValue) => void;
|
|
696
774
|
setStyle: (style: TStyle) => void;
|
|
697
775
|
getStyle: () => TStyle | undefined;
|
|
698
776
|
setOnSaveFunction: (onSaveFunction: (dashboard: TDashboard) => void) => void;
|
|
@@ -706,6 +784,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
706
784
|
getCard: (cardId: string) => TCard | undefined;
|
|
707
785
|
getSelectedCard: () => TCard | undefined;
|
|
708
786
|
getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
|
|
787
|
+
handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
|
|
709
788
|
};
|
|
710
789
|
}) => void), shouldReplace?: boolean | undefined): void;
|
|
711
790
|
}>;
|