semaphor 0.0.15 → 0.0.17
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 +217 -1
- package/dist/react-semaphor.js +10943 -10867
- package/dist/react-semaphor.umd.cjs +102 -102
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/react-semaphor.d.ts
CHANGED
|
@@ -31,12 +31,14 @@ declare type Actions = {
|
|
|
31
31
|
updateCard: (sheetId: string, card: TCard) => void;
|
|
32
32
|
removeCard: (sheetId: string, card: TCard) => void;
|
|
33
33
|
setIsDashboardEditing: (editing: boolean) => void;
|
|
34
|
+
setShowContext: (show: boolean) => void;
|
|
34
35
|
setShowDashboardJSON: (show: boolean) => void;
|
|
35
36
|
setIsVisualEditing: (editing: boolean) => void;
|
|
36
37
|
setShowFilters: (show: boolean) => void;
|
|
37
38
|
addFilter: (filter: TFilter) => void;
|
|
38
39
|
removeFilter: (filterId: string) => void;
|
|
39
40
|
updateFilter: (filter: TFilter) => void;
|
|
41
|
+
setFilterValues: (filterValues: TFilterValue[] | undefined) => void;
|
|
40
42
|
addOrUpdateFilterValue: (filterValue: TFilterValue) => void;
|
|
41
43
|
removeFilterValue: (filterId: string) => void;
|
|
42
44
|
setStyle: (style: TStyle) => void;
|
|
@@ -53,6 +55,40 @@ declare type Actions = {
|
|
|
53
55
|
getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
|
|
54
56
|
};
|
|
55
57
|
|
|
58
|
+
declare type Actions_2 = {
|
|
59
|
+
setCardRefreshInterval: (refreshInterval: string) => void;
|
|
60
|
+
setIsShowingVisual: (isShowingVisual: boolean) => void;
|
|
61
|
+
setRunSql: (runSql: boolean) => void;
|
|
62
|
+
setCardPreferences: (preferences: TCardPreferences) => void;
|
|
63
|
+
setFilterOnClickField: (field: string) => void;
|
|
64
|
+
setIsSqlRunning: (isSqlRunning: boolean) => void;
|
|
65
|
+
setCard: (card: TCard) => void;
|
|
66
|
+
setSqlGen: (sqlGen: SqlGen) => void;
|
|
67
|
+
setSqlGenMeasure: (name: string, calc: AggregateCalc) => void;
|
|
68
|
+
setSqlGenDimension: (dimension: string) => void;
|
|
69
|
+
setCardType: (type: TChartType) => void;
|
|
70
|
+
setCardSql: (sql: string) => void;
|
|
71
|
+
setCardData: (data: any[]) => void;
|
|
72
|
+
setCardCustomCfg: (cfg: any) => void;
|
|
73
|
+
setCardCfg: (cfg: any) => void;
|
|
74
|
+
setShowFilters: (showFilters: boolean) => void;
|
|
75
|
+
setApplyFilters: (applyFilters: boolean) => void;
|
|
76
|
+
setFilterValues: (filterValues: TFilterValue[]) => void;
|
|
77
|
+
setSelectedConnectionId: (connectionId: string) => void;
|
|
78
|
+
setSelectedDatabaseName: (databaseName: string) => void;
|
|
79
|
+
setSelectedSchemaName: (schemaName: string) => void;
|
|
80
|
+
setSelectedTableName: (tableName: string) => void;
|
|
81
|
+
setCurrentColumns: (columns: TDataColumn[]) => void;
|
|
82
|
+
setOnConnectionChange: (onConnectionChange: (connectionId: string) => void) => void;
|
|
83
|
+
setOnDatabaseChange: (onDatabaseChange: (databaseName: string) => void) => void;
|
|
84
|
+
setOnSchemaChange: (onSchemaChange: (schemaName: string) => void) => void;
|
|
85
|
+
setOnTableChange: (onTableChange: (tableNmae: string) => void) => void;
|
|
86
|
+
setOnSave: (onSave: (card: TCard) => void) => void;
|
|
87
|
+
setOnClose: (onClose: () => void) => void;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
declare type AggregateCalc = 'AVG' | 'MIN' | 'MAX' | 'SUM' | 'COUNT' | 'COUNT_DISTINCT';
|
|
91
|
+
|
|
56
92
|
export declare type AuthToken = {
|
|
57
93
|
accessToken: string;
|
|
58
94
|
refreshToken: string;
|
|
@@ -70,6 +106,7 @@ export declare type Bookmark = {
|
|
|
70
106
|
name: string;
|
|
71
107
|
default: boolean;
|
|
72
108
|
template: TDashboard;
|
|
109
|
+
filterValues?: TFilterValue[];
|
|
73
110
|
};
|
|
74
111
|
|
|
75
112
|
export declare function cleanCard(card: TCard): TCard;
|
|
@@ -105,6 +142,7 @@ declare type DashboardStore = {
|
|
|
105
142
|
selectedCard?: TCard | null;
|
|
106
143
|
isDashboardEditing: boolean;
|
|
107
144
|
isVisualEditing: boolean;
|
|
145
|
+
showContext: boolean;
|
|
108
146
|
showDashboardJSON: boolean;
|
|
109
147
|
showFilters: boolean;
|
|
110
148
|
filterValues?: TFilterValue[];
|
|
@@ -119,6 +157,29 @@ declare type DashboardStore = {
|
|
|
119
157
|
|
|
120
158
|
export declare const DashboardWC: CustomElementConstructor;
|
|
121
159
|
|
|
160
|
+
declare type EditorStore = {
|
|
161
|
+
isShowingVisual: boolean;
|
|
162
|
+
runSql: boolean;
|
|
163
|
+
isSqlRunning: boolean;
|
|
164
|
+
actions: Actions_2;
|
|
165
|
+
sqlGen: SqlGen;
|
|
166
|
+
card: TCard;
|
|
167
|
+
showFilters: boolean;
|
|
168
|
+
applyFilters: boolean;
|
|
169
|
+
filterValues?: TFilterValue[];
|
|
170
|
+
selectedConnectionId?: string;
|
|
171
|
+
selectedDatabaseName?: string;
|
|
172
|
+
selectedSchemaName?: string;
|
|
173
|
+
selectedTableName?: string;
|
|
174
|
+
currentColumns?: TDataColumn[];
|
|
175
|
+
onConnectionChange?: (connectionId: string) => void;
|
|
176
|
+
onDatabaseChange?: (databaseName: string) => void;
|
|
177
|
+
onTableChange?: (tableName: string) => void;
|
|
178
|
+
onSchemaChange?: (schemaName: string) => void;
|
|
179
|
+
onSave?: (card: TCard) => void;
|
|
180
|
+
onClose?: () => void;
|
|
181
|
+
};
|
|
182
|
+
|
|
122
183
|
export declare type ErrorProps = {
|
|
123
184
|
message?: string;
|
|
124
185
|
};
|
|
@@ -174,6 +235,14 @@ export declare type LoadingProps = {
|
|
|
174
235
|
message?: string;
|
|
175
236
|
};
|
|
176
237
|
|
|
238
|
+
declare type SqlGen = {
|
|
239
|
+
measures?: {
|
|
240
|
+
name: string;
|
|
241
|
+
calc: AggregateCalc;
|
|
242
|
+
}[];
|
|
243
|
+
dimensions?: string[];
|
|
244
|
+
};
|
|
245
|
+
|
|
177
246
|
/**
|
|
178
247
|
* Style propeerites for the dashboard
|
|
179
248
|
*/
|
|
@@ -219,6 +288,13 @@ export declare type TCard = {
|
|
|
219
288
|
refreshInterval?: string;
|
|
220
289
|
};
|
|
221
290
|
|
|
291
|
+
export declare type TCardContext = {
|
|
292
|
+
id: string;
|
|
293
|
+
name: string;
|
|
294
|
+
description: string;
|
|
295
|
+
sql: string;
|
|
296
|
+
};
|
|
297
|
+
|
|
222
298
|
export declare type TCardPreferences = {
|
|
223
299
|
filterOnClick?: boolean;
|
|
224
300
|
filterOnClickField?: string;
|
|
@@ -235,8 +311,14 @@ export declare type TDashboard = {
|
|
|
235
311
|
filters?: TFilter[];
|
|
236
312
|
};
|
|
237
313
|
|
|
314
|
+
declare type TDataColumn = {
|
|
315
|
+
column_name: string;
|
|
316
|
+
data_type: string;
|
|
317
|
+
is_nullable?: string;
|
|
318
|
+
};
|
|
319
|
+
|
|
238
320
|
export declare type TEvent = {
|
|
239
|
-
type:
|
|
321
|
+
type: 'success' | 'error' | 'info' | 'warning';
|
|
240
322
|
message: any;
|
|
241
323
|
};
|
|
242
324
|
|
|
@@ -431,6 +513,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
431
513
|
} | null | undefined;
|
|
432
514
|
isDashboardEditing: boolean;
|
|
433
515
|
isVisualEditing: boolean;
|
|
516
|
+
showContext: boolean;
|
|
434
517
|
showDashboardJSON: boolean;
|
|
435
518
|
showFilters: boolean;
|
|
436
519
|
filterValues?: ({
|
|
@@ -513,12 +596,14 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
513
596
|
updateCard: (sheetId: string, card: TCard) => void;
|
|
514
597
|
removeCard: (sheetId: string, card: TCard) => void;
|
|
515
598
|
setIsDashboardEditing: (editing: boolean) => void;
|
|
599
|
+
setShowContext: (show: boolean) => void;
|
|
516
600
|
setShowDashboardJSON: (show: boolean) => void;
|
|
517
601
|
setIsVisualEditing: (editing: boolean) => void;
|
|
518
602
|
setShowFilters: (show: boolean) => void;
|
|
519
603
|
addFilter: (filter: TFilter) => void;
|
|
520
604
|
removeFilter: (filterId: string) => void;
|
|
521
605
|
updateFilter: (filter: TFilter) => void;
|
|
606
|
+
setFilterValues: (filterValues: TFilterValue[] | undefined) => void;
|
|
522
607
|
addOrUpdateFilterValue: (filterValue: TFilterValue) => void;
|
|
523
608
|
removeFilterValue: (filterId: string) => void;
|
|
524
609
|
setStyle: (style: TStyle) => void;
|
|
@@ -537,4 +622,135 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
537
622
|
}) => void), shouldReplace?: boolean | undefined): void;
|
|
538
623
|
}>;
|
|
539
624
|
|
|
625
|
+
export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "setState"> & {
|
|
626
|
+
setState(nextStateOrUpdater: EditorStore | Partial<EditorStore> | ((state: {
|
|
627
|
+
isShowingVisual: boolean;
|
|
628
|
+
runSql: boolean;
|
|
629
|
+
isSqlRunning: boolean;
|
|
630
|
+
actions: {
|
|
631
|
+
setCardRefreshInterval: (refreshInterval: string) => void;
|
|
632
|
+
setIsShowingVisual: (isShowingVisual: boolean) => void;
|
|
633
|
+
setRunSql: (runSql: boolean) => void;
|
|
634
|
+
setCardPreferences: (preferences: TCardPreferences) => void;
|
|
635
|
+
setFilterOnClickField: (field: string) => void;
|
|
636
|
+
setIsSqlRunning: (isSqlRunning: boolean) => void;
|
|
637
|
+
setCard: (card: TCard) => void;
|
|
638
|
+
setSqlGen: (sqlGen: SqlGen) => void;
|
|
639
|
+
setSqlGenMeasure: (name: string, calc: AggregateCalc) => void;
|
|
640
|
+
setSqlGenDimension: (dimension: string) => void;
|
|
641
|
+
setCardType: (type: TChartType) => void;
|
|
642
|
+
setCardSql: (sql: string) => void;
|
|
643
|
+
setCardData: (data: any[]) => void;
|
|
644
|
+
setCardCustomCfg: (cfg: any) => void;
|
|
645
|
+
setCardCfg: (cfg: any) => void;
|
|
646
|
+
setShowFilters: (showFilters: boolean) => void;
|
|
647
|
+
setApplyFilters: (applyFilters: boolean) => void;
|
|
648
|
+
setFilterValues: (filterValues: TFilterValue[]) => void;
|
|
649
|
+
setSelectedConnectionId: (connectionId: string) => void;
|
|
650
|
+
setSelectedDatabaseName: (databaseName: string) => void;
|
|
651
|
+
setSelectedSchemaName: (schemaName: string) => void;
|
|
652
|
+
setSelectedTableName: (tableName: string) => void;
|
|
653
|
+
setCurrentColumns: (columns: TDataColumn[]) => void;
|
|
654
|
+
setOnConnectionChange: (onConnectionChange: (connectionId: string) => void) => void;
|
|
655
|
+
setOnDatabaseChange: (onDatabaseChange: (databaseName: string) => void) => void;
|
|
656
|
+
setOnSchemaChange: (onSchemaChange: (schemaName: string) => void) => void;
|
|
657
|
+
setOnTableChange: (onTableChange: (tableNmae: string) => void) => void;
|
|
658
|
+
setOnSave: (onSave: (card: TCard) => void) => void;
|
|
659
|
+
setOnClose: (onClose: () => void) => void;
|
|
660
|
+
};
|
|
661
|
+
sqlGen: {
|
|
662
|
+
measures?: {
|
|
663
|
+
name: string;
|
|
664
|
+
calc: AggregateCalc;
|
|
665
|
+
}[] | undefined;
|
|
666
|
+
dimensions?: string[] | undefined;
|
|
667
|
+
};
|
|
668
|
+
card: {
|
|
669
|
+
id: string;
|
|
670
|
+
title: string;
|
|
671
|
+
description?: string | undefined;
|
|
672
|
+
connectionId?: string | undefined;
|
|
673
|
+
type: TChartType;
|
|
674
|
+
sql?: string | undefined;
|
|
675
|
+
data?: any[] | undefined;
|
|
676
|
+
cfg?: any;
|
|
677
|
+
customCfg?: any;
|
|
678
|
+
preferences?: {
|
|
679
|
+
filterOnClick?: boolean | undefined;
|
|
680
|
+
filterOnClickField?: string | undefined;
|
|
681
|
+
} | undefined;
|
|
682
|
+
lastSelectedDatabase?: string | undefined;
|
|
683
|
+
lastSelectedSchema?: string | undefined;
|
|
684
|
+
lastSelectedTable?: string | undefined;
|
|
685
|
+
refreshInterval?: string | undefined;
|
|
686
|
+
};
|
|
687
|
+
showFilters: boolean;
|
|
688
|
+
applyFilters: boolean;
|
|
689
|
+
filterValues?: ({
|
|
690
|
+
filterId: string;
|
|
691
|
+
expression?: string | undefined;
|
|
692
|
+
name: string;
|
|
693
|
+
valueType: "string" | "number" | "boolean" | "date";
|
|
694
|
+
connectionType?: "database" | "api" | undefined;
|
|
695
|
+
operation: "like" | "not like";
|
|
696
|
+
values: [string];
|
|
697
|
+
} | {
|
|
698
|
+
filterId: string;
|
|
699
|
+
expression?: string | undefined;
|
|
700
|
+
name: string;
|
|
701
|
+
valueType: "string" | "number" | "boolean" | "date";
|
|
702
|
+
connectionType?: "database" | "api" | undefined;
|
|
703
|
+
operation: "=" | "!=" | "is null" | "is not null";
|
|
704
|
+
values: [string | number];
|
|
705
|
+
} | {
|
|
706
|
+
filterId: string;
|
|
707
|
+
expression?: string | undefined;
|
|
708
|
+
name: string;
|
|
709
|
+
valueType: "string" | "number" | "boolean" | "date";
|
|
710
|
+
connectionType?: "database" | "api" | undefined;
|
|
711
|
+
operation: ">" | "<" | ">=" | "<=";
|
|
712
|
+
values: [number];
|
|
713
|
+
} | {
|
|
714
|
+
filterId: string;
|
|
715
|
+
expression?: string | undefined;
|
|
716
|
+
name: string;
|
|
717
|
+
valueType: "string" | "number" | "boolean" | "date";
|
|
718
|
+
connectionType?: "database" | "api" | undefined;
|
|
719
|
+
operation: "between" | "not between";
|
|
720
|
+
values: [number, number];
|
|
721
|
+
} | {
|
|
722
|
+
filterId: string;
|
|
723
|
+
expression?: string | undefined;
|
|
724
|
+
name: string;
|
|
725
|
+
valueType: "string" | "number" | "boolean" | "date";
|
|
726
|
+
connectionType?: "database" | "api" | undefined;
|
|
727
|
+
operation: "between" | "not between";
|
|
728
|
+
values: [Date, Date];
|
|
729
|
+
} | {
|
|
730
|
+
filterId: string;
|
|
731
|
+
expression?: string | undefined;
|
|
732
|
+
name: string;
|
|
733
|
+
valueType: "string" | "number" | "boolean" | "date";
|
|
734
|
+
connectionType?: "database" | "api" | undefined;
|
|
735
|
+
operation: "in" | "not in";
|
|
736
|
+
values: (string | number)[];
|
|
737
|
+
})[] | undefined;
|
|
738
|
+
selectedConnectionId?: string | undefined;
|
|
739
|
+
selectedDatabaseName?: string | undefined;
|
|
740
|
+
selectedSchemaName?: string | undefined;
|
|
741
|
+
selectedTableName?: string | undefined;
|
|
742
|
+
currentColumns?: {
|
|
743
|
+
column_name: string;
|
|
744
|
+
data_type: string;
|
|
745
|
+
is_nullable?: string | undefined;
|
|
746
|
+
}[] | undefined;
|
|
747
|
+
onConnectionChange?: ((connectionId: string) => void) | undefined;
|
|
748
|
+
onDatabaseChange?: ((databaseName: string) => void) | undefined;
|
|
749
|
+
onTableChange?: ((tableName: string) => void) | undefined;
|
|
750
|
+
onSchemaChange?: ((schemaName: string) => void) | undefined;
|
|
751
|
+
onSave?: ((card: TCard) => void) | undefined;
|
|
752
|
+
onClose?: (() => void) | undefined;
|
|
753
|
+
}) => void), shouldReplace?: boolean | undefined): void;
|
|
754
|
+
}>;
|
|
755
|
+
|
|
540
756
|
export { }
|