semaphor 0.0.27 → 0.0.29

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.
@@ -10,8 +10,9 @@ import { FC } from 'react';
10
10
  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
+ import { Layouts } from 'react-grid-layout';
13
14
  import { Point } from 'chart.js';
14
- import { default as React_2 } from 'react';
15
+ import { default as ReactGridLayout_2 } from 'react-grid-layout';
15
16
  import { StoreApi } from 'zustand';
16
17
  import { UseBoundStore } from 'zustand';
17
18
 
@@ -26,7 +27,8 @@ declare type Actions = {
26
27
  setDashboardTheme: (theme: 'light' | 'dark' | 'system') => void;
27
28
  setSheets: (sheets: TSheet[]) => void;
28
29
  setSelectedSheetId: (sheetId: string | null) => void;
29
- setSheetLayout: (sheetId: string, layout: ReactGridLayout.Layout[]) => void;
30
+ setSheetLayout: (sheetId: string, layout: ReactGridLayout_2.Layout[]) => void;
31
+ setSheetLayouts: (sheetId: string, layouts: ReactGridLayout_2.Layouts) => void;
30
32
  setSelectedCardId: (sheetId: string, cardId: string | null) => void;
31
33
  setSelectedFrameId: (frameId: string) => void;
32
34
  setCardTitle: (sheetId: string, cardId: string, title: string) => void;
@@ -62,7 +64,8 @@ declare type Actions = {
62
64
  getSelectedSheet: () => TSheet | undefined;
63
65
  getCard: (cardId: string) => TCard | undefined;
64
66
  getSelectedFrame: () => TFrame | undefined;
65
- getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
67
+ getSelectedSheetLayout: () => ReactGridLayout_2.Layout[] | undefined;
68
+ getSelectedSheetLayouts: () => ReactGridLayout_2.Layouts | undefined;
66
69
  handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
67
70
  };
68
71
 
@@ -149,21 +152,18 @@ declare type CardWithFooter = BaseCustomCard & {
149
152
 
150
153
  export declare function cleanCard(card: TCard): TCard;
151
154
 
155
+ export declare type ConnectionPolicy = {
156
+ connectionId?: string;
157
+ name: string;
158
+ params: Params;
159
+ };
160
+
152
161
  export declare function createSqlGenConfig(column: TDataColumn, preSqlGen: SqlGen, calc?: AggregateCalc): SqlGen;
153
162
 
154
163
  export declare type CustomCard = CardWithContent | CardWithFooter;
155
164
 
156
165
  export declare function Dashboard(props: DashboardProps): JSX_2.Element;
157
166
 
158
- export declare function DashboardCard({ card, footer, className, ...props }: DashboardCardProps): JSX_2.Element | null;
159
-
160
- declare type DashboardCardProps = {
161
- card: TCard;
162
- footer?: React_2.ReactNode;
163
- showControls?: boolean;
164
- fetchCardData?: boolean;
165
- } & React_2.HTMLAttributes<HTMLDivElement>;
166
-
167
167
  export declare function DashboardPlus({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
168
168
 
169
169
  declare type DashboardPlusProps = {
@@ -293,6 +293,7 @@ export declare function getDashbaordStateWithoutData(dashboardState: TDashboard)
293
293
  title?: string | undefined;
294
294
  description?: string | undefined;
295
295
  layout?: Layout[] | undefined;
296
+ layouts?: Layouts | undefined;
296
297
  cards?: TCard[] | undefined;
297
298
  }[] | undefined;
298
299
  id: string;
@@ -317,9 +318,13 @@ export declare type LoadingProps = {
317
318
 
318
319
  export declare const NUMBER_DATA_TYPES: string[];
319
320
 
321
+ declare type Params = {
322
+ [key: string]: string | number | string[] | number[];
323
+ };
324
+
320
325
  export declare const resolveDataType: (value: any) => string;
321
326
 
322
- export declare function SelectComponent({ title, items, value, isLoading, isError, onChange, }: SelectProps): JSX_2.Element;
327
+ export declare function SelectComponent({ title, items, value, isLoading, isError, onChange, className, showIcon, }: SelectProps): JSX_2.Element;
323
328
 
324
329
  declare type SelectProps = {
325
330
  title: string;
@@ -331,6 +336,8 @@ declare type SelectProps = {
331
336
  isLoading: boolean;
332
337
  isError: boolean;
333
338
  onChange?: (value: string) => void;
339
+ className?: string;
340
+ showIcon?: boolean;
334
341
  };
335
342
 
336
343
  export declare function SemaphorQueryClient({ children, }: {
@@ -460,6 +467,7 @@ export declare type TSheet = {
460
467
  title?: string;
461
468
  description?: string;
462
469
  layout?: ReactGridLayout.Layout[];
470
+ layouts?: ReactGridLayout.Layouts;
463
471
  cards?: TCard[];
464
472
  frames?: TFrame[];
465
473
  };
@@ -590,6 +598,25 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
590
598
  resizeHandles?: ("s" | "w" | "e" | "n" | "sw" | "nw" | "se" | "ne")[] | undefined;
591
599
  isBounded?: boolean | undefined;
592
600
  }[] | undefined;
601
+ layouts?: {
602
+ [x: string]: {
603
+ i: string;
604
+ x: number;
605
+ y: number;
606
+ w: number;
607
+ h: number;
608
+ minW?: number | undefined;
609
+ maxW?: number | undefined;
610
+ minH?: number | undefined;
611
+ maxH?: number | undefined;
612
+ moved?: boolean | undefined;
613
+ static?: boolean | undefined;
614
+ isDraggable?: boolean | undefined;
615
+ isResizable?: boolean | undefined;
616
+ resizeHandles?: ("s" | "w" | "e" | "n" | "sw" | "nw" | "se" | "ne")[] | undefined;
617
+ isBounded?: boolean | undefined;
618
+ }[];
619
+ } | undefined;
593
620
  cards?: {
594
621
  id: string;
595
622
  title: string;
@@ -820,7 +847,8 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
820
847
  setDashboardTheme: (theme: 'light' | 'dark' | 'system') => void;
821
848
  setSheets: (sheets: TSheet[]) => void;
822
849
  setSelectedSheetId: (sheetId: string | null) => void;
823
- setSheetLayout: (sheetId: string, layout: ReactGridLayout.Layout[]) => void;
850
+ setSheetLayout: (sheetId: string, layout: ReactGridLayout_2.Layout[]) => void;
851
+ setSheetLayouts: (sheetId: string, layouts: ReactGridLayout_2.Layouts) => void;
824
852
  setSelectedCardId: (sheetId: string, cardId: string | null) => void;
825
853
  setSelectedFrameId: (frameId: string) => void;
826
854
  setCardTitle: (sheetId: string, cardId: string, title: string) => void;
@@ -856,7 +884,8 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
856
884
  getSelectedSheet: () => TSheet | undefined;
857
885
  getCard: (cardId: string) => TCard | undefined;
858
886
  getSelectedFrame: () => TFrame | undefined;
859
- getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
887
+ getSelectedSheetLayout: () => ReactGridLayout_2.Layout[] | undefined;
888
+ getSelectedSheetLayouts: () => ReactGridLayout_2.Layouts | undefined;
860
889
  handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
861
890
  };
862
891
  }) => void), shouldReplace?: boolean | undefined): void;
@@ -881,7 +910,7 @@ export declare function useEditorAside(token?: AuthToken, connectionQueryKey?: s
881
910
  isColumnsLoadingOrFetching: boolean;
882
911
  isColumnsError: boolean;
883
912
  isAPIConnection: boolean;
884
- tableName: string;
913
+ tableName: any;
885
914
  schemaName: string;
886
915
  handleConnectionChange: (value: string) => void;
887
916
  handleDatabaseChange: (value: string) => void;