semaphor 0.0.26 → 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.
@@ -1,11 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  /// <reference types="react-grid-layout" />
3
3
 
4
+ import { BubbleDataPoint } from 'chart.js';
5
+ import { Chart as Chart_2 } from 'chart.js';
6
+ import { ChartConfiguration } from 'chart.js';
7
+ import { ChartTypeRegistry } from 'chart.js';
4
8
  import { Draft } from 'immer';
5
9
  import { FC } from 'react';
6
10
  import { FontSpec } from 'chart.js';
7
11
  import { JSX as JSX_2 } from 'react/jsx-runtime';
8
12
  import { Layout } from 'react-grid-layout';
13
+ import { Point } from 'chart.js';
14
+ import { default as React_2 } from 'react';
9
15
  import { StoreApi } from 'zustand';
10
16
  import { UseBoundStore } from 'zustand';
11
17
 
@@ -149,6 +155,15 @@ export declare type CustomCard = CardWithContent | CardWithFooter;
149
155
 
150
156
  export declare function Dashboard(props: DashboardProps): JSX_2.Element;
151
157
 
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
+
152
167
  export declare function DashboardPlus({ showControls, showFooter, ...rest }: DashboardPlusProps): JSX_2.Element;
153
168
 
154
169
  declare type DashboardPlusProps = {
@@ -394,6 +409,8 @@ export declare type TCardPreferences = {
394
409
  };
395
410
  };
396
411
 
412
+ declare type TChartConfiguration = ChartConfiguration;
413
+
397
414
  declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'table' | 'kpi' | 'custom';
398
415
 
399
416
  export declare type TDashboard = {
@@ -464,6 +481,17 @@ export declare function useActions(): {
464
481
  setOnRemoveCard: (onRemoveCard: (card: TCard, sheetId: string) => void) => void;
465
482
  };
466
483
 
484
+ export declare function useCard(cardId: string): {
485
+ data: any;
486
+ card: TCard;
487
+ isError: boolean;
488
+ isLoading: boolean;
489
+ isFetching: boolean;
490
+ visualKey: number;
491
+ handleDatapointClick: (chart: Chart_2<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint | null)[], unknown>, datasetIndex: number, clickIndex: number, value: number) => void;
492
+ cfg: TChartConfiguration | undefined;
493
+ };
494
+
467
495
  export declare function useDashboard({ id, version, authToken, customStyle, currentTheme, onSave, onEvent, }: UseDashboardProps): {
468
496
  isLoading: boolean;
469
497
  isError: boolean;