semaphor 0.0.39 → 0.0.41
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/2DAFLIRC-Rxxi508R.js +9088 -0
- package/dist/index-COuaROBc.js +56481 -0
- package/dist/{react-semaphor.d.ts → index.d.ts} +262 -8
- package/dist/react-semaphor.js +34 -53338
- package/dist/react-semaphor.umd.cjs +1258 -154
- package/dist/style.css +1 -1
- package/package.json +10 -6
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react-grid-layout" />
|
|
3
|
-
|
|
4
1
|
import { BubbleDataPoint } from 'chart.js';
|
|
5
|
-
import { Chart
|
|
2
|
+
import { Chart } from 'chart.js';
|
|
6
3
|
import { ChartConfiguration } from 'chart.js';
|
|
7
4
|
import { ChartTypeRegistry } from 'chart.js';
|
|
8
5
|
import { Draft } from 'immer';
|
|
@@ -12,6 +9,7 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
|
12
9
|
import { Layout } from 'react-grid-layout';
|
|
13
10
|
import { Layouts } from 'react-grid-layout';
|
|
14
11
|
import { Point } from 'chart.js';
|
|
12
|
+
import { default as React_2 } from 'react';
|
|
15
13
|
import { default as ReactGridLayout_2 } from 'react-grid-layout';
|
|
16
14
|
import { StoreApi } from 'zustand';
|
|
17
15
|
import { UseBoundStore } from 'zustand';
|
|
@@ -178,6 +176,15 @@ export declare type CustomCard = CardWithContent | CardWithFooter;
|
|
|
178
176
|
|
|
179
177
|
export declare function Dashboard(props: DashboardProps): JSX_2.Element;
|
|
180
178
|
|
|
179
|
+
export declare function DashboardCard({ card, footer, className, ...props }: DashboardCardProps): JSX_2.Element | null;
|
|
180
|
+
|
|
181
|
+
declare type DashboardCardProps = {
|
|
182
|
+
card: TCard;
|
|
183
|
+
footer?: React_2.ReactNode;
|
|
184
|
+
showControls?: boolean;
|
|
185
|
+
fetchCardData?: boolean;
|
|
186
|
+
} & React_2.HTMLAttributes<HTMLDivElement>;
|
|
187
|
+
|
|
181
188
|
export declare function DashboardPlus({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
|
|
182
189
|
|
|
183
190
|
declare type DashboardPlusProps = {
|
|
@@ -200,7 +207,7 @@ export declare type DashboardProps = {
|
|
|
200
207
|
};
|
|
201
208
|
|
|
202
209
|
export declare function DashboardProvider({ children }: {
|
|
203
|
-
children:
|
|
210
|
+
children: React_2.ReactNode;
|
|
204
211
|
}): JSX_2.Element;
|
|
205
212
|
|
|
206
213
|
export declare type DashboardStore = {
|
|
@@ -342,6 +349,8 @@ export declare type LoadingProps = {
|
|
|
342
349
|
|
|
343
350
|
export declare const NUMBER_DATA_TYPES: string[];
|
|
344
351
|
|
|
352
|
+
declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
|
|
353
|
+
|
|
345
354
|
declare type Params = {
|
|
346
355
|
[key: string]: string | number | string[] | number[];
|
|
347
356
|
};
|
|
@@ -350,7 +359,7 @@ export declare const PYTHON_DEFAULT_CODE = "import pandas as pd\ndf = pd.DataFra
|
|
|
350
359
|
|
|
351
360
|
export declare const resolveDataType: (value: any) => string;
|
|
352
361
|
|
|
353
|
-
export declare function SelectComponent({ title, items, value, isLoading, isError, onChange, className, showIcon, }: SelectProps): JSX_2.Element;
|
|
362
|
+
export declare function SelectComponent({ title, items, value, isLoading, isError, connectionTooltip, onChange, className, showIcon, }: SelectProps): JSX_2.Element;
|
|
354
363
|
|
|
355
364
|
declare type SelectProps = {
|
|
356
365
|
title: string;
|
|
@@ -364,6 +373,7 @@ declare type SelectProps = {
|
|
|
364
373
|
onChange?: (value: string) => void;
|
|
365
374
|
className?: string;
|
|
366
375
|
showIcon?: boolean;
|
|
376
|
+
connectionTooltip?: string;
|
|
367
377
|
};
|
|
368
378
|
|
|
369
379
|
export declare function SemaphorQueryClient({ children, }: {
|
|
@@ -451,10 +461,35 @@ export declare type TCardPreferences = {
|
|
|
451
461
|
suffix?: string;
|
|
452
462
|
enabled?: boolean | string;
|
|
453
463
|
};
|
|
464
|
+
datasetOptions?: TDatasetOptions[];
|
|
465
|
+
chartOptions?: TChartOptions;
|
|
454
466
|
};
|
|
455
467
|
|
|
456
468
|
declare type TChartConfiguration = ChartConfiguration;
|
|
457
469
|
|
|
470
|
+
export declare type TChartOptions = {
|
|
471
|
+
type?: TChartType;
|
|
472
|
+
scales?: {
|
|
473
|
+
y?: {
|
|
474
|
+
type: 'linear' | 'logarithmic';
|
|
475
|
+
min: number;
|
|
476
|
+
max: number;
|
|
477
|
+
ticks: {
|
|
478
|
+
stepSize: number;
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
x?: {
|
|
482
|
+
type: 'linear' | 'logarithmic';
|
|
483
|
+
min: number;
|
|
484
|
+
max: number;
|
|
485
|
+
ticks: {
|
|
486
|
+
stepSize: number;
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
indexAxis?: 'x' | 'y' | undefined;
|
|
491
|
+
};
|
|
492
|
+
|
|
458
493
|
declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'table' | 'kpi' | 'custom';
|
|
459
494
|
|
|
460
495
|
export declare type TDashboard = {
|
|
@@ -474,6 +509,19 @@ export declare type TDataColumn = {
|
|
|
474
509
|
is_nullable?: string;
|
|
475
510
|
};
|
|
476
511
|
|
|
512
|
+
export declare type TDatasetOptions = {
|
|
513
|
+
idx: number;
|
|
514
|
+
type?: 'bar' | 'line';
|
|
515
|
+
fill?: string | number;
|
|
516
|
+
datalabels?: {
|
|
517
|
+
display?: boolean;
|
|
518
|
+
align?: string;
|
|
519
|
+
anchor?: string;
|
|
520
|
+
clamp?: boolean;
|
|
521
|
+
color?: string;
|
|
522
|
+
};
|
|
523
|
+
};
|
|
524
|
+
|
|
477
525
|
export declare type TEvent = {
|
|
478
526
|
type: 'success' | 'error' | 'info' | 'warning';
|
|
479
527
|
message: any;
|
|
@@ -490,6 +538,7 @@ declare type TFilter = {
|
|
|
490
538
|
table: string;
|
|
491
539
|
database: string;
|
|
492
540
|
sql: string;
|
|
541
|
+
operation: Operation;
|
|
493
542
|
};
|
|
494
543
|
|
|
495
544
|
declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForDate;
|
|
@@ -534,7 +583,7 @@ export declare function useCard(cardId: string): {
|
|
|
534
583
|
isLoading: boolean;
|
|
535
584
|
isFetching: boolean;
|
|
536
585
|
visualKey: number;
|
|
537
|
-
handleDatapointClick: (chart:
|
|
586
|
+
handleDatapointClick: (chart: Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint | null)[], unknown>, datasetIndex: number, clickIndex: number, value: number) => void;
|
|
538
587
|
cfg: TChartConfiguration | undefined;
|
|
539
588
|
};
|
|
540
589
|
|
|
@@ -612,6 +661,40 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
612
661
|
suffix?: string | undefined;
|
|
613
662
|
enabled?: string | boolean | undefined;
|
|
614
663
|
} | undefined;
|
|
664
|
+
datasetOptions?: {
|
|
665
|
+
idx: number;
|
|
666
|
+
type?: "bar" | "line" | undefined;
|
|
667
|
+
fill?: string | number | undefined;
|
|
668
|
+
datalabels?: {
|
|
669
|
+
display?: boolean | undefined;
|
|
670
|
+
align?: string | undefined;
|
|
671
|
+
anchor?: string | undefined;
|
|
672
|
+
clamp?: boolean | undefined;
|
|
673
|
+
color?: string | undefined;
|
|
674
|
+
} | undefined;
|
|
675
|
+
}[] | undefined;
|
|
676
|
+
chartOptions?: {
|
|
677
|
+
type?: TChartType | undefined;
|
|
678
|
+
scales?: {
|
|
679
|
+
y?: {
|
|
680
|
+
type: "linear" | "logarithmic";
|
|
681
|
+
min: number;
|
|
682
|
+
max: number;
|
|
683
|
+
ticks: {
|
|
684
|
+
stepSize: number;
|
|
685
|
+
};
|
|
686
|
+
} | undefined;
|
|
687
|
+
x?: {
|
|
688
|
+
type: "linear" | "logarithmic";
|
|
689
|
+
min: number;
|
|
690
|
+
max: number;
|
|
691
|
+
ticks: {
|
|
692
|
+
stepSize: number;
|
|
693
|
+
};
|
|
694
|
+
} | undefined;
|
|
695
|
+
} | undefined;
|
|
696
|
+
indexAxis?: "x" | "y" | undefined;
|
|
697
|
+
} | undefined;
|
|
615
698
|
} | undefined;
|
|
616
699
|
lastSelectedDatabase?: string | undefined;
|
|
617
700
|
lastSelectedSchema?: string | undefined;
|
|
@@ -690,6 +773,40 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
690
773
|
suffix?: string | undefined;
|
|
691
774
|
enabled?: string | boolean | undefined;
|
|
692
775
|
} | undefined;
|
|
776
|
+
datasetOptions?: {
|
|
777
|
+
idx: number;
|
|
778
|
+
type?: "bar" | "line" | undefined;
|
|
779
|
+
fill?: string | number | undefined;
|
|
780
|
+
datalabels?: {
|
|
781
|
+
display?: boolean | undefined;
|
|
782
|
+
align?: string | undefined;
|
|
783
|
+
anchor?: string | undefined;
|
|
784
|
+
clamp?: boolean | undefined;
|
|
785
|
+
color?: string | undefined;
|
|
786
|
+
} | undefined;
|
|
787
|
+
}[] | undefined;
|
|
788
|
+
chartOptions?: {
|
|
789
|
+
type?: TChartType | undefined;
|
|
790
|
+
scales?: {
|
|
791
|
+
y?: {
|
|
792
|
+
type: "linear" | "logarithmic";
|
|
793
|
+
min: number;
|
|
794
|
+
max: number;
|
|
795
|
+
ticks: {
|
|
796
|
+
stepSize: number;
|
|
797
|
+
};
|
|
798
|
+
} | undefined;
|
|
799
|
+
x?: {
|
|
800
|
+
type: "linear" | "logarithmic";
|
|
801
|
+
min: number;
|
|
802
|
+
max: number;
|
|
803
|
+
ticks: {
|
|
804
|
+
stepSize: number;
|
|
805
|
+
};
|
|
806
|
+
} | undefined;
|
|
807
|
+
} | undefined;
|
|
808
|
+
indexAxis?: "x" | "y" | undefined;
|
|
809
|
+
} | undefined;
|
|
693
810
|
} | undefined;
|
|
694
811
|
lastSelectedDatabase?: string | undefined;
|
|
695
812
|
lastSelectedSchema?: string | undefined;
|
|
@@ -725,6 +842,40 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
725
842
|
suffix?: string | undefined;
|
|
726
843
|
enabled?: string | boolean | undefined;
|
|
727
844
|
} | undefined;
|
|
845
|
+
datasetOptions?: {
|
|
846
|
+
idx: number;
|
|
847
|
+
type?: "bar" | "line" | undefined;
|
|
848
|
+
fill?: string | number | undefined;
|
|
849
|
+
datalabels?: {
|
|
850
|
+
display?: boolean | undefined;
|
|
851
|
+
align?: string | undefined;
|
|
852
|
+
anchor?: string | undefined;
|
|
853
|
+
clamp?: boolean | undefined;
|
|
854
|
+
color?: string | undefined;
|
|
855
|
+
} | undefined;
|
|
856
|
+
}[] | undefined;
|
|
857
|
+
chartOptions?: {
|
|
858
|
+
type?: TChartType | undefined;
|
|
859
|
+
scales?: {
|
|
860
|
+
y?: {
|
|
861
|
+
type: "linear" | "logarithmic";
|
|
862
|
+
min: number;
|
|
863
|
+
max: number;
|
|
864
|
+
ticks: {
|
|
865
|
+
stepSize: number;
|
|
866
|
+
};
|
|
867
|
+
} | undefined;
|
|
868
|
+
x?: {
|
|
869
|
+
type: "linear" | "logarithmic";
|
|
870
|
+
min: number;
|
|
871
|
+
max: number;
|
|
872
|
+
ticks: {
|
|
873
|
+
stepSize: number;
|
|
874
|
+
};
|
|
875
|
+
} | undefined;
|
|
876
|
+
} | undefined;
|
|
877
|
+
indexAxis?: "x" | "y" | undefined;
|
|
878
|
+
} | undefined;
|
|
728
879
|
} | undefined;
|
|
729
880
|
lastSelectedDatabase?: string | undefined;
|
|
730
881
|
lastSelectedSchema?: string | undefined;
|
|
@@ -787,6 +938,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
787
938
|
table: string;
|
|
788
939
|
database: string;
|
|
789
940
|
sql: string;
|
|
941
|
+
operation: Operation;
|
|
790
942
|
}[] | undefined;
|
|
791
943
|
customCards?: ({
|
|
792
944
|
cardId: string;
|
|
@@ -844,6 +996,40 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
844
996
|
suffix?: string | undefined;
|
|
845
997
|
enabled?: string | boolean | undefined;
|
|
846
998
|
} | undefined;
|
|
999
|
+
datasetOptions?: {
|
|
1000
|
+
idx: number;
|
|
1001
|
+
type?: "bar" | "line" | undefined;
|
|
1002
|
+
fill?: string | number | undefined;
|
|
1003
|
+
datalabels?: {
|
|
1004
|
+
display?: boolean | undefined;
|
|
1005
|
+
align?: string | undefined;
|
|
1006
|
+
anchor?: string | undefined;
|
|
1007
|
+
clamp?: boolean | undefined;
|
|
1008
|
+
color?: string | undefined;
|
|
1009
|
+
} | undefined;
|
|
1010
|
+
}[] | undefined;
|
|
1011
|
+
chartOptions?: {
|
|
1012
|
+
type?: TChartType | undefined;
|
|
1013
|
+
scales?: {
|
|
1014
|
+
y?: {
|
|
1015
|
+
type: "linear" | "logarithmic";
|
|
1016
|
+
min: number;
|
|
1017
|
+
max: number;
|
|
1018
|
+
ticks: {
|
|
1019
|
+
stepSize: number;
|
|
1020
|
+
};
|
|
1021
|
+
} | undefined;
|
|
1022
|
+
x?: {
|
|
1023
|
+
type: "linear" | "logarithmic";
|
|
1024
|
+
min: number;
|
|
1025
|
+
max: number;
|
|
1026
|
+
ticks: {
|
|
1027
|
+
stepSize: number;
|
|
1028
|
+
};
|
|
1029
|
+
} | undefined;
|
|
1030
|
+
} | undefined;
|
|
1031
|
+
indexAxis?: "x" | "y" | undefined;
|
|
1032
|
+
} | undefined;
|
|
847
1033
|
} | undefined;
|
|
848
1034
|
lastSelectedDatabase?: string | undefined;
|
|
849
1035
|
lastSelectedSchema?: string | undefined;
|
|
@@ -973,7 +1159,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
|
|
|
973
1159
|
|
|
974
1160
|
export declare const useEditorActions: () => Actions_2;
|
|
975
1161
|
|
|
976
|
-
export declare function useEditorAside(token?: AuthToken,
|
|
1162
|
+
export declare function useEditorAside(token?: AuthToken, _connectionQueryKey?: string): {
|
|
977
1163
|
connectionItems: any;
|
|
978
1164
|
isConnectionsLoading: boolean;
|
|
979
1165
|
isConnectionsError: boolean;
|
|
@@ -1076,6 +1262,40 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
1076
1262
|
suffix?: string | undefined;
|
|
1077
1263
|
enabled?: string | boolean | undefined;
|
|
1078
1264
|
} | undefined;
|
|
1265
|
+
datasetOptions?: {
|
|
1266
|
+
idx: number;
|
|
1267
|
+
type?: "bar" | "line" | undefined;
|
|
1268
|
+
fill?: string | number | undefined;
|
|
1269
|
+
datalabels?: {
|
|
1270
|
+
display?: boolean | undefined;
|
|
1271
|
+
align?: string | undefined;
|
|
1272
|
+
anchor?: string | undefined;
|
|
1273
|
+
clamp?: boolean | undefined;
|
|
1274
|
+
color?: string | undefined;
|
|
1275
|
+
} | undefined;
|
|
1276
|
+
}[] | undefined;
|
|
1277
|
+
chartOptions?: {
|
|
1278
|
+
type?: TChartType | undefined;
|
|
1279
|
+
scales?: {
|
|
1280
|
+
y?: {
|
|
1281
|
+
type: "linear" | "logarithmic";
|
|
1282
|
+
min: number;
|
|
1283
|
+
max: number;
|
|
1284
|
+
ticks: {
|
|
1285
|
+
stepSize: number;
|
|
1286
|
+
};
|
|
1287
|
+
} | undefined;
|
|
1288
|
+
x?: {
|
|
1289
|
+
type: "linear" | "logarithmic";
|
|
1290
|
+
min: number;
|
|
1291
|
+
max: number;
|
|
1292
|
+
ticks: {
|
|
1293
|
+
stepSize: number;
|
|
1294
|
+
};
|
|
1295
|
+
} | undefined;
|
|
1296
|
+
} | undefined;
|
|
1297
|
+
indexAxis?: "x" | "y" | undefined;
|
|
1298
|
+
} | undefined;
|
|
1079
1299
|
} | undefined;
|
|
1080
1300
|
lastSelectedDatabase?: string | undefined;
|
|
1081
1301
|
lastSelectedSchema?: string | undefined;
|
|
@@ -1111,6 +1331,40 @@ export declare const useEditorStore: UseBoundStore<Omit<StoreApi<EditorStore>, "
|
|
|
1111
1331
|
suffix?: string | undefined;
|
|
1112
1332
|
enabled?: string | boolean | undefined;
|
|
1113
1333
|
} | undefined;
|
|
1334
|
+
datasetOptions?: {
|
|
1335
|
+
idx: number;
|
|
1336
|
+
type?: "bar" | "line" | undefined;
|
|
1337
|
+
fill?: string | number | undefined;
|
|
1338
|
+
datalabels?: {
|
|
1339
|
+
display?: boolean | undefined;
|
|
1340
|
+
align?: string | undefined;
|
|
1341
|
+
anchor?: string | undefined;
|
|
1342
|
+
clamp?: boolean | undefined;
|
|
1343
|
+
color?: string | undefined;
|
|
1344
|
+
} | undefined;
|
|
1345
|
+
}[] | undefined;
|
|
1346
|
+
chartOptions?: {
|
|
1347
|
+
type?: TChartType | undefined;
|
|
1348
|
+
scales?: {
|
|
1349
|
+
y?: {
|
|
1350
|
+
type: "linear" | "logarithmic";
|
|
1351
|
+
min: number;
|
|
1352
|
+
max: number;
|
|
1353
|
+
ticks: {
|
|
1354
|
+
stepSize: number;
|
|
1355
|
+
};
|
|
1356
|
+
} | undefined;
|
|
1357
|
+
x?: {
|
|
1358
|
+
type: "linear" | "logarithmic";
|
|
1359
|
+
min: number;
|
|
1360
|
+
max: number;
|
|
1361
|
+
ticks: {
|
|
1362
|
+
stepSize: number;
|
|
1363
|
+
};
|
|
1364
|
+
} | undefined;
|
|
1365
|
+
} | undefined;
|
|
1366
|
+
indexAxis?: "x" | "y" | undefined;
|
|
1367
|
+
} | undefined;
|
|
1114
1368
|
} | undefined;
|
|
1115
1369
|
lastSelectedDatabase?: string | undefined;
|
|
1116
1370
|
lastSelectedSchema?: string | undefined;
|