semaphor 0.0.25 → 0.0.27
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 +98 -37
- package/dist/react-semaphor.js +12177 -11995
- package/dist/react-semaphor.umd.cjs +108 -108
- package/package.json +1 -1
package/dist/react-semaphor.d.ts
CHANGED
|
@@ -21,26 +21,23 @@ declare type Actions = {
|
|
|
21
21
|
setCustomCards: (customCards: CustomCard[]) => void;
|
|
22
22
|
setAuthToken: (authToken: AuthToken) => void;
|
|
23
23
|
setThemeStyle: (themeStyle: StyleProps) => void;
|
|
24
|
-
setIsEditorSaveEvent: (isEditorSaveEvent: boolean) => void;
|
|
25
24
|
setBookmarkKey: (bookmarkKey: string) => void;
|
|
26
25
|
setDashboard: (dashboard: TDashboard) => void;
|
|
27
26
|
setDashboardTheme: (theme: 'light' | 'dark' | 'system') => void;
|
|
28
|
-
setDashboardTitle: (title: string) => void;
|
|
29
|
-
setDashboardDescription: (description: string) => void;
|
|
30
27
|
setSheets: (sheets: TSheet[]) => void;
|
|
31
|
-
setSheetTitle: (sheetId: string, title: string) => void;
|
|
32
|
-
setSheetDescription: (sheetId: string, description: string) => void;
|
|
33
28
|
setSelectedSheetId: (sheetId: string | null) => void;
|
|
34
29
|
setSheetLayout: (sheetId: string, layout: ReactGridLayout.Layout[]) => void;
|
|
35
|
-
setCards: (sheetId: string, cards: TCard[]) => void;
|
|
36
30
|
setSelectedCardId: (sheetId: string, cardId: string | null) => void;
|
|
37
|
-
|
|
31
|
+
setSelectedFrameId: (frameId: string) => void;
|
|
38
32
|
setCardTitle: (sheetId: string, cardId: string, title: string) => void;
|
|
39
33
|
setCardSql: (sheetId: string, cardId: string, sql: string) => void;
|
|
40
34
|
setCardDescription: (sheetId: string, cardId: string, description: string) => void;
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
setFrameCardData: (sheetId: string, cardId: string, data: any[]) => void;
|
|
36
|
+
addFrame: (sheetId: string, frame: TFrame) => void;
|
|
37
|
+
updateFrame: (sheetId: string, frame: TFrame) => void;
|
|
43
38
|
updateCard: (sheetId: string, card: TCard) => void;
|
|
39
|
+
updateFrameCard?: (sheetId: string, frameId: string, card: TCard) => void;
|
|
40
|
+
removeFrame: (sheetId: string, frameId: string) => void;
|
|
44
41
|
removeCard: (sheetId: string, card: TCard) => void;
|
|
45
42
|
setIsDashboardEditing: (editing: boolean) => void;
|
|
46
43
|
setShowContext: (show: boolean) => void;
|
|
@@ -63,9 +60,8 @@ declare type Actions = {
|
|
|
63
60
|
setOnEvent: (onEvent: (event: TEvent) => void) => void;
|
|
64
61
|
getDashboard: () => TDashboard | undefined;
|
|
65
62
|
getSelectedSheet: () => TSheet | undefined;
|
|
66
|
-
getSelectedSheetCards: () => TCard[] | undefined;
|
|
67
63
|
getCard: (cardId: string) => TCard | undefined;
|
|
68
|
-
|
|
64
|
+
getSelectedFrame: () => TFrame | undefined;
|
|
69
65
|
getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
|
|
70
66
|
handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
|
|
71
67
|
};
|
|
@@ -79,6 +75,7 @@ declare type Actions_2 = {
|
|
|
79
75
|
setFilterOnClickField: (field: string) => void;
|
|
80
76
|
setIsSqlRunning: (isSqlRunning: boolean) => void;
|
|
81
77
|
setCard: (card: TCard) => void;
|
|
78
|
+
setFrame: (frame: TFrame) => void;
|
|
82
79
|
setSqlGen: (sqlGen: SqlGen) => void;
|
|
83
80
|
setSqlGenMeasure: (name: string, calc: AggregateCalc) => void;
|
|
84
81
|
setSqlGenDimension: (dimension: string) => void;
|
|
@@ -99,7 +96,7 @@ declare type Actions_2 = {
|
|
|
99
96
|
setOnDatabaseChange: (onDatabaseChange: (databaseName: string) => void) => void;
|
|
100
97
|
setOnSchemaChange: (onSchemaChange: (schemaName: string) => void) => void;
|
|
101
98
|
setOnTableChange: (onTableChange: (tableNmae: string) => void) => void;
|
|
102
|
-
setOnSave: (onSave: (card:
|
|
99
|
+
setOnSave: (onSave: (card: TFrame) => void) => void;
|
|
103
100
|
setOnClose: (onClose: () => void) => void;
|
|
104
101
|
};
|
|
105
102
|
|
|
@@ -200,6 +197,7 @@ export declare type DashboardStore = {
|
|
|
200
197
|
bookmarkKey?: string;
|
|
201
198
|
dashboard: TDashboard;
|
|
202
199
|
selectedSheetId?: string | null | undefined;
|
|
200
|
+
selectedFrameId?: string | null;
|
|
203
201
|
selectedCardId?: string | null;
|
|
204
202
|
selectedCard?: TCard | null;
|
|
205
203
|
isDashboardEditing: boolean;
|
|
@@ -208,10 +206,9 @@ export declare type DashboardStore = {
|
|
|
208
206
|
showDashboardJSON: boolean;
|
|
209
207
|
showFilters: boolean;
|
|
210
208
|
filterValues?: TFilterValue[];
|
|
211
|
-
isEditorSaveEvent: boolean;
|
|
212
209
|
onEvent?: (event: TEvent) => void;
|
|
213
210
|
onSaveFunction?: (dashboard: TDashboard) => void;
|
|
214
|
-
|
|
211
|
+
onAddFrame?: (card: TFrame, sheetId: string) => void;
|
|
215
212
|
onUpdateCard?: (card: TCard, sheetId: string) => void;
|
|
216
213
|
onRemoveCard?: (card: TCard, sheetId: string) => void;
|
|
217
214
|
actions: Actions;
|
|
@@ -227,6 +224,7 @@ declare type EditorStore = {
|
|
|
227
224
|
isSqlRunning: boolean;
|
|
228
225
|
actions: Actions_2;
|
|
229
226
|
sqlGen: SqlGen;
|
|
227
|
+
frame: TFrame;
|
|
230
228
|
card: TCard;
|
|
231
229
|
showFilters: boolean;
|
|
232
230
|
applyFilters: boolean;
|
|
@@ -240,7 +238,7 @@ declare type EditorStore = {
|
|
|
240
238
|
onDatabaseChange?: (databaseName: string) => void;
|
|
241
239
|
onTableChange?: (tableName: string) => void;
|
|
242
240
|
onSchemaChange?: (schemaName: string) => void;
|
|
243
|
-
onSave?: (card:
|
|
241
|
+
onSave?: (card: TFrame) => void;
|
|
244
242
|
onClose?: () => void;
|
|
245
243
|
};
|
|
246
244
|
|
|
@@ -286,11 +284,16 @@ export declare function getColumnDataType(column: TDataColumn): string;
|
|
|
286
284
|
|
|
287
285
|
export declare function getDashbaordStateWithoutData(dashboardState: TDashboard): {
|
|
288
286
|
sheets: {
|
|
289
|
-
|
|
287
|
+
frames: {
|
|
288
|
+
cards: TCard[];
|
|
289
|
+
id: string;
|
|
290
|
+
activeCardId: string;
|
|
291
|
+
}[] | undefined;
|
|
290
292
|
id: string;
|
|
291
293
|
title?: string | undefined;
|
|
292
294
|
description?: string | undefined;
|
|
293
295
|
layout?: Layout[] | undefined;
|
|
296
|
+
cards?: TCard[] | undefined;
|
|
294
297
|
}[] | undefined;
|
|
295
298
|
id: string;
|
|
296
299
|
title?: string | undefined;
|
|
@@ -379,7 +382,6 @@ export declare type TCard = {
|
|
|
379
382
|
sql?: string;
|
|
380
383
|
data?: any[];
|
|
381
384
|
cfg?: any;
|
|
382
|
-
childCards?: any[];
|
|
383
385
|
customCfg?: any;
|
|
384
386
|
preferences?: TCardPreferences;
|
|
385
387
|
lastSelectedDatabase?: string;
|
|
@@ -447,12 +449,19 @@ declare type TFilter = {
|
|
|
447
449
|
|
|
448
450
|
declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForDate;
|
|
449
451
|
|
|
452
|
+
export declare type TFrame = {
|
|
453
|
+
id: string;
|
|
454
|
+
cards: TCard[];
|
|
455
|
+
activeCardId: string;
|
|
456
|
+
};
|
|
457
|
+
|
|
450
458
|
export declare type TSheet = {
|
|
451
459
|
id: string;
|
|
452
460
|
title?: string;
|
|
453
461
|
description?: string;
|
|
454
462
|
layout?: ReactGridLayout.Layout[];
|
|
455
463
|
cards?: TCard[];
|
|
464
|
+
frames?: TFrame[];
|
|
456
465
|
};
|
|
457
466
|
|
|
458
467
|
/**
|
|
@@ -464,7 +473,6 @@ export declare type TStyle = {
|
|
|
464
473
|
};
|
|
465
474
|
|
|
466
475
|
export declare function useActions(): {
|
|
467
|
-
setDashboardTitle: (title: string) => void;
|
|
468
476
|
getStyle: () => TStyle | undefined;
|
|
469
477
|
getDashboard: () => TDashboard | undefined;
|
|
470
478
|
setOnSaveFunction: (onSaveFunction: (dashboard: TDashboard) => void) => void;
|
|
@@ -539,7 +547,6 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
539
547
|
sql?: string | undefined;
|
|
540
548
|
data?: any[] | undefined;
|
|
541
549
|
cfg?: any;
|
|
542
|
-
childCards?: any[] | undefined;
|
|
543
550
|
customCfg?: any;
|
|
544
551
|
preferences?: {
|
|
545
552
|
filterOnClick?: boolean | undefined;
|
|
@@ -592,7 +599,6 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
592
599
|
sql?: string | undefined;
|
|
593
600
|
data?: any[] | undefined;
|
|
594
601
|
cfg?: any;
|
|
595
|
-
childCards?: any[] | undefined;
|
|
596
602
|
customCfg?: any;
|
|
597
603
|
preferences?: {
|
|
598
604
|
filterOnClick?: boolean | undefined;
|
|
@@ -610,6 +616,36 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
610
616
|
lastSelectedTable?: string | undefined;
|
|
611
617
|
refreshInterval?: string | undefined;
|
|
612
618
|
}[] | undefined;
|
|
619
|
+
frames?: {
|
|
620
|
+
id: string;
|
|
621
|
+
cards: {
|
|
622
|
+
id: string;
|
|
623
|
+
title: string;
|
|
624
|
+
description?: string | undefined;
|
|
625
|
+
connectionId?: string | undefined;
|
|
626
|
+
type: TChartType;
|
|
627
|
+
sql?: string | undefined;
|
|
628
|
+
data?: any[] | undefined;
|
|
629
|
+
cfg?: any;
|
|
630
|
+
customCfg?: any;
|
|
631
|
+
preferences?: {
|
|
632
|
+
filterOnClick?: boolean | undefined;
|
|
633
|
+
filterOnClickField?: string | undefined;
|
|
634
|
+
formatNumber?: {
|
|
635
|
+
format?: string | undefined;
|
|
636
|
+
currency?: string | undefined;
|
|
637
|
+
locale?: string | undefined;
|
|
638
|
+
suffix?: string | undefined;
|
|
639
|
+
enabled?: string | boolean | undefined;
|
|
640
|
+
} | undefined;
|
|
641
|
+
} | undefined;
|
|
642
|
+
lastSelectedDatabase?: string | undefined;
|
|
643
|
+
lastSelectedSchema?: string | undefined;
|
|
644
|
+
lastSelectedTable?: string | undefined;
|
|
645
|
+
refreshInterval?: string | undefined;
|
|
646
|
+
}[];
|
|
647
|
+
activeCardId: string;
|
|
648
|
+
}[] | undefined;
|
|
613
649
|
}[] | undefined;
|
|
614
650
|
style?: {
|
|
615
651
|
default: {
|
|
@@ -686,6 +722,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
686
722
|
})[] | undefined;
|
|
687
723
|
};
|
|
688
724
|
selectedSheetId?: string | null | undefined;
|
|
725
|
+
selectedFrameId?: string | null | undefined;
|
|
689
726
|
selectedCardId?: string | null | undefined;
|
|
690
727
|
selectedCard?: {
|
|
691
728
|
id: string;
|
|
@@ -696,7 +733,6 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
696
733
|
sql?: string | undefined;
|
|
697
734
|
data?: any[] | undefined;
|
|
698
735
|
cfg?: any;
|
|
699
|
-
childCards?: any[] | undefined;
|
|
700
736
|
customCfg?: any;
|
|
701
737
|
preferences?: {
|
|
702
738
|
filterOnClick?: boolean | undefined;
|
|
@@ -768,10 +804,9 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
768
804
|
operation: "in" | "not in";
|
|
769
805
|
values: (string | number)[];
|
|
770
806
|
})[] | undefined;
|
|
771
|
-
isEditorSaveEvent: boolean;
|
|
772
807
|
onEvent?: ((event: TEvent) => void) | undefined;
|
|
773
808
|
onSaveFunction?: ((dashboard: TDashboard) => void) | undefined;
|
|
774
|
-
|
|
809
|
+
onAddFrame?: ((card: TFrame, sheetId: string) => void) | undefined;
|
|
775
810
|
onUpdateCard?: ((card: TCard, sheetId: string) => void) | undefined;
|
|
776
811
|
onRemoveCard?: ((card: TCard, sheetId: string) => void) | undefined;
|
|
777
812
|
actions: {
|
|
@@ -780,26 +815,23 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
780
815
|
setCustomCards: (customCards: CustomCard[]) => void;
|
|
781
816
|
setAuthToken: (authToken: AuthToken) => void;
|
|
782
817
|
setThemeStyle: (themeStyle: StyleProps) => void;
|
|
783
|
-
setIsEditorSaveEvent: (isEditorSaveEvent: boolean) => void;
|
|
784
818
|
setBookmarkKey: (bookmarkKey: string) => void;
|
|
785
819
|
setDashboard: (dashboard: TDashboard) => void;
|
|
786
820
|
setDashboardTheme: (theme: 'light' | 'dark' | 'system') => void;
|
|
787
|
-
setDashboardTitle: (title: string) => void;
|
|
788
|
-
setDashboardDescription: (description: string) => void;
|
|
789
821
|
setSheets: (sheets: TSheet[]) => void;
|
|
790
|
-
setSheetTitle: (sheetId: string, title: string) => void;
|
|
791
|
-
setSheetDescription: (sheetId: string, description: string) => void;
|
|
792
822
|
setSelectedSheetId: (sheetId: string | null) => void;
|
|
793
823
|
setSheetLayout: (sheetId: string, layout: ReactGridLayout.Layout[]) => void;
|
|
794
|
-
setCards: (sheetId: string, cards: TCard[]) => void;
|
|
795
824
|
setSelectedCardId: (sheetId: string, cardId: string | null) => void;
|
|
796
|
-
|
|
825
|
+
setSelectedFrameId: (frameId: string) => void;
|
|
797
826
|
setCardTitle: (sheetId: string, cardId: string, title: string) => void;
|
|
798
827
|
setCardSql: (sheetId: string, cardId: string, sql: string) => void;
|
|
799
828
|
setCardDescription: (sheetId: string, cardId: string, description: string) => void;
|
|
800
|
-
|
|
801
|
-
|
|
829
|
+
setFrameCardData: (sheetId: string, cardId: string, data: any[]) => void;
|
|
830
|
+
addFrame: (sheetId: string, frame: TFrame) => void;
|
|
831
|
+
updateFrame: (sheetId: string, frame: TFrame) => void;
|
|
802
832
|
updateCard: (sheetId: string, card: TCard) => void;
|
|
833
|
+
updateFrameCard?: ((sheetId: string, frameId: string, card: TCard) => void) | undefined;
|
|
834
|
+
removeFrame: (sheetId: string, frameId: string) => void;
|
|
803
835
|
removeCard: (sheetId: string, card: TCard) => void;
|
|
804
836
|
setIsDashboardEditing: (editing: boolean) => void;
|
|
805
837
|
setShowContext: (show: boolean) => void;
|
|
@@ -822,9 +854,8 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
822
854
|
setOnEvent: (onEvent: (event: TEvent) => void) => void;
|
|
823
855
|
getDashboard: () => TDashboard | undefined;
|
|
824
856
|
getSelectedSheet: () => TSheet | undefined;
|
|
825
|
-
getSelectedSheetCards: () => TCard[] | undefined;
|
|
826
857
|
getCard: (cardId: string) => TCard | undefined;
|
|
827
|
-
|
|
858
|
+
getSelectedFrame: () => TFrame | undefined;
|
|
828
859
|
getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
|
|
829
860
|
handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
|
|
830
861
|
};
|
|
@@ -871,6 +902,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
871
902
|
setFilterOnClickField: (field: string) => void;
|
|
872
903
|
setIsSqlRunning: (isSqlRunning: boolean) => void;
|
|
873
904
|
setCard: (card: TCard) => void;
|
|
905
|
+
setFrame: (frame: TFrame) => void;
|
|
874
906
|
setSqlGen: (sqlGen: SqlGen) => void;
|
|
875
907
|
setSqlGenMeasure: (name: string, calc: AggregateCalc) => void;
|
|
876
908
|
setSqlGenDimension: (dimension: string) => void;
|
|
@@ -891,7 +923,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
891
923
|
setOnDatabaseChange: (onDatabaseChange: (databaseName: string) => void) => void;
|
|
892
924
|
setOnSchemaChange: (onSchemaChange: (schemaName: string) => void) => void;
|
|
893
925
|
setOnTableChange: (onTableChange: (tableNmae: string) => void) => void;
|
|
894
|
-
setOnSave: (onSave: (card:
|
|
926
|
+
setOnSave: (onSave: (card: TFrame) => void) => void;
|
|
895
927
|
setOnClose: (onClose: () => void) => void;
|
|
896
928
|
};
|
|
897
929
|
sqlGen: {
|
|
@@ -901,6 +933,36 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
901
933
|
}[] | undefined;
|
|
902
934
|
dimensions?: string[] | undefined;
|
|
903
935
|
};
|
|
936
|
+
frame: {
|
|
937
|
+
id: string;
|
|
938
|
+
cards: {
|
|
939
|
+
id: string;
|
|
940
|
+
title: string;
|
|
941
|
+
description?: string | undefined;
|
|
942
|
+
connectionId?: string | undefined;
|
|
943
|
+
type: TChartType;
|
|
944
|
+
sql?: string | undefined;
|
|
945
|
+
data?: any[] | undefined;
|
|
946
|
+
cfg?: any;
|
|
947
|
+
customCfg?: any;
|
|
948
|
+
preferences?: {
|
|
949
|
+
filterOnClick?: boolean | undefined;
|
|
950
|
+
filterOnClickField?: string | undefined;
|
|
951
|
+
formatNumber?: {
|
|
952
|
+
format?: string | undefined;
|
|
953
|
+
currency?: string | undefined;
|
|
954
|
+
locale?: string | undefined;
|
|
955
|
+
suffix?: string | undefined;
|
|
956
|
+
enabled?: string | boolean | undefined;
|
|
957
|
+
} | undefined;
|
|
958
|
+
} | undefined;
|
|
959
|
+
lastSelectedDatabase?: string | undefined;
|
|
960
|
+
lastSelectedSchema?: string | undefined;
|
|
961
|
+
lastSelectedTable?: string | undefined;
|
|
962
|
+
refreshInterval?: string | undefined;
|
|
963
|
+
}[];
|
|
964
|
+
activeCardId: string;
|
|
965
|
+
};
|
|
904
966
|
card: {
|
|
905
967
|
id: string;
|
|
906
968
|
title: string;
|
|
@@ -910,7 +972,6 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
910
972
|
sql?: string | undefined;
|
|
911
973
|
data?: any[] | undefined;
|
|
912
974
|
cfg?: any;
|
|
913
|
-
childCards?: any[] | undefined;
|
|
914
975
|
customCfg?: any;
|
|
915
976
|
preferences?: {
|
|
916
977
|
filterOnClick?: boolean | undefined;
|
|
@@ -992,7 +1053,7 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
992
1053
|
onDatabaseChange?: ((databaseName: string) => void) | undefined;
|
|
993
1054
|
onTableChange?: ((tableName: string) => void) | undefined;
|
|
994
1055
|
onSchemaChange?: ((schemaName: string) => void) | undefined;
|
|
995
|
-
onSave?: ((card:
|
|
1056
|
+
onSave?: ((card: TFrame) => void) | undefined;
|
|
996
1057
|
onClose?: (() => void) | undefined;
|
|
997
1058
|
}) => void), shouldReplace?: boolean | undefined): void;
|
|
998
1059
|
}>;
|