@devtable/dashboard 11.0.2 → 11.2.0

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.
@@ -2,6 +2,7 @@ import React, { ReactNode } from './react';
2
2
  import { ContextRecordType } from '../model';
3
3
  import { DashboardContentDBType, IDashboard } from '../types/dashboard';
4
4
  import { IDashboardConfig } from '..';
5
+ import { OnExitCallback } from '../dashboard-editor/ui/header/main-header';
5
6
  interface IDashboardProps {
6
7
  context: ContextRecordType;
7
8
  dashboard: IDashboard;
@@ -12,6 +13,7 @@ interface IDashboardProps {
12
13
  onChange?: (dashboard: IDashboard) => void;
13
14
  headerSlot?: ReactNode;
14
15
  onFilterValuesChange?: (filterValues: Record<string, any>) => void;
16
+ onExit: OnExitCallback;
15
17
  }
16
18
  export interface IDashboardModel {
17
19
  readonly json: IDashboard;
@@ -19,4 +21,4 @@ export interface IDashboardModel {
19
21
  updateCurrentContent: (content: DashboardContentDBType) => void;
20
22
  }
21
23
  export declare const DashboardEditor: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<IDashboardProps & React.RefAttributes<IDashboardModel>, "ref"> & React.RefAttributes<IDashboardModel>>>;
22
- export {};
24
+ export type { OnExitCallback, OnExitParams } from './ui';
@@ -5,4 +5,4 @@ interface IDashboardEditorHeader extends IDashbaordEditorHeaderMain {
5
5
  export declare const DashboardEditorHeader: ((props: IDashboardEditorHeader) => import('./react/jsx-runtime').JSX.Element) & {
6
6
  displayName: string;
7
7
  };
8
- export {};
8
+ export type { OnExitParams, OnExitCallback } from './main-header';
@@ -1,8 +1,14 @@
1
1
  import { ReactNode } from './react';
2
2
  import { ISaveChangesOrMore } from './save-changes-or-more';
3
+ export type OnExitParams = {
4
+ hasChanges: boolean;
5
+ dashboardId: string;
6
+ };
7
+ export type OnExitCallback = (params: OnExitParams) => void;
3
8
  export interface IDashbaordEditorHeaderMain extends ISaveChangesOrMore {
4
9
  headerSlot?: ReactNode;
10
+ onExit: OnExitCallback;
5
11
  }
6
- export declare const MainHeader: (({ saveDashboardChanges, headerSlot }: IDashbaordEditorHeaderMain) => import('./react/jsx-runtime').JSX.Element) & {
12
+ export declare const MainHeader: (({ saveDashboardChanges, onExit, headerSlot }: IDashbaordEditorHeaderMain) => import('./react/jsx-runtime').JSX.Element) & {
7
13
  displayName: string;
8
14
  };