@devtable/dashboard 8.61.1 → 8.62.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.
@@ -1,8 +1,8 @@
1
1
  import _ from 'lodash';
2
2
  import { Edge } from 'reactflow';
3
- import { DashboardModelInstance } from '~/model';
3
+ import { ContentModelInstance } from '~/model/content';
4
4
  import { TFlowNode } from './types';
5
- export declare function makeEdges(model: DashboardModelInstance, staticNodeMap: _.Dictionary<TFlowNode>): {
5
+ export declare function makeEdges(model: ContentModelInstance, staticNodeMap: _.Dictionary<TFlowNode>): {
6
6
  edges: Edge<any>[];
7
7
  edgeNodes: never[];
8
8
  };
@@ -1,5 +1,5 @@
1
- import { DashboardModelInstance } from '~/model';
2
- export declare function makeNodesAndEdges(model: DashboardModelInstance): {
1
+ import { ContentModelInstance } from '~/model';
2
+ export declare function makeNodesAndEdges(model: ContentModelInstance): {
3
3
  nodes: import("./types").TFlowNode[];
4
4
  edges: import("reactflow").Edge<any>[];
5
5
  };
@@ -1,3 +1,3 @@
1
- import { DashboardModelInstance } from '~/model';
1
+ import { ContentModelInstance } from '~/model';
2
2
  import { TFlowNode } from './types';
3
- export declare function makeNodes(model: DashboardModelInstance): TFlowNode[];
3
+ export declare function makeNodes(model: ContentModelInstance): TFlowNode[];
@@ -1,2 +1,2 @@
1
- import { DashboardModelInstance } from '..';
2
- export declare function useInteractionOperationHacks(model: DashboardModelInstance, inEditMode: boolean): void;
1
+ import { ContentModelInstance } from '..';
2
+ export declare function useInteractionOperationHacks(model: ContentModelInstance, inEditMode: boolean): void;
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from './react';
2
+ interface IProps {
3
+ headerMenuItems?: ReactNode;
4
+ }
5
+ export declare const HeaderMenu: (({ headerMenuItems }: IProps) => JSX.Element) & {
6
+ displayName: string;
7
+ };
8
+ export {};
@@ -1,9 +1,9 @@
1
- import { ReactNode } from './react';
2
- interface IDashboardEditorHeader {
3
- saveDashboardChanges: () => void;
4
- headerSlot?: ReactNode;
1
+ /// <reference types="react" />
2
+ import { IDashbaordEditorHeaderMain } from './main-header';
3
+ interface IDashboardEditorHeader extends IDashbaordEditorHeaderMain {
4
+ [key: string]: any;
5
5
  }
6
- export declare const DashboardEditorHeader: (({ saveDashboardChanges, headerSlot }: IDashboardEditorHeader) => JSX.Element) & {
6
+ export declare const DashboardEditorHeader: ((props: IDashboardEditorHeader) => JSX.Element) & {
7
7
  displayName: string;
8
8
  };
9
9
  export {};
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from './react';
2
+ import { ISaveChangesOrMore } from './save-changes-or-more';
3
+ export interface IDashbaordEditorHeaderMain extends ISaveChangesOrMore {
4
+ headerSlot?: ReactNode;
5
+ headerMenuItems?: ReactNode;
6
+ }
7
+ export declare const MainHeader: (({ saveDashboardChanges, headerSlot, headerMenuItems }: IDashbaordEditorHeaderMain) => JSX.Element) & {
8
+ displayName: string;
9
+ };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export interface ISaveChangesOrMore {
3
+ saveDashboardChanges: () => void;
4
+ }
5
+ export declare const SaveChangesOrMore: (({ saveDashboardChanges }: ISaveChangesOrMore) => JSX.Element) & {
6
+ displayName: string;
7
+ };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const SubHeader: (() => JSX.Element) & {
3
+ displayName: string;
4
+ };
@@ -1,18 +1,21 @@
1
1
  import React, { ReactNode } from './react';
2
2
  import { ContextInfoType } from '~/model';
3
- import { IDashboard } from '../../types/dashboard';
3
+ import { DashboardContentDBType, IDashboard } from '../../types/dashboard';
4
4
  interface IDashboardProps {
5
5
  context: ContextInfoType;
6
6
  dashboard: IDashboard;
7
+ content: DashboardContentDBType;
7
8
  className?: string;
8
- update: (dashboard: IDashboard) => Promise<void>;
9
+ update: (d: IDashboard, c: DashboardContentDBType) => Promise<void>;
9
10
  config: IDashboardConfig;
10
11
  onChange?: (dashboard: IDashboard) => void;
11
12
  headerSlot?: ReactNode;
13
+ headerMenuItems?: ReactNode;
12
14
  }
13
15
  export interface IDashboardModel {
14
16
  readonly json: IDashboard;
15
- updateCurrent: (dashboard: IDashboard) => void;
17
+ updateCurrent: (dashboard: IDashboard, content: DashboardContentDBType) => void;
18
+ updateCurrentContent: (content: DashboardContentDBType) => void;
16
19
  }
17
- export declare const Dashboard: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<IDashboardProps & React.RefAttributes<IDashboardModel>, "ref"> & React.RefAttributes<IDashboardModel>>>;
20
+ export declare const DashboardEditor: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<IDashboardProps & React.RefAttributes<IDashboardModel>, "ref"> & React.RefAttributes<IDashboardModel>>>;
18
21
  export {};
@@ -1,2 +1,2 @@
1
- import React from './react';
2
- export declare const PickQuery: React.FunctionComponent<object>;
1
+ /// <reference types="react" />
2
+ export declare const PickQuery: import('./react').FunctionComponent<object>;
@@ -1,8 +1,8 @@
1
+ /// <reference types="react" />
1
2
  import { Sx } from '@mantine/core';
2
- import React from './react';
3
3
  interface IGlobalVariablesGuide {
4
4
  showSQLSnippets?: boolean;
5
5
  sx?: Sx;
6
6
  }
7
- export declare const GlobalVariablesGuide: React.FunctionComponent<IGlobalVariablesGuide>;
7
+ export declare const GlobalVariablesGuide: import('./react').FunctionComponent<IGlobalVariablesGuide>;
8
8
  export {};
@@ -1,15 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  import { ContextInfoType } from '../../model/context';
3
- import { IDashboard } from '../../types/dashboard';
3
+ import { DashboardContentDBType, IDashboard } from '../../types/dashboard';
4
4
  interface IReadOnlyDashboard {
5
5
  context: ContextInfoType;
6
6
  dashboard: IDashboard;
7
+ content: DashboardContentDBType;
7
8
  className?: string;
8
9
  config: IDashboardConfig;
9
10
  fullScreenPanelID: string;
10
11
  setFullScreenPanelID: (v: string) => void;
11
12
  }
12
- export declare const ReadOnlyDashboard: (({ context, dashboard, className, config, fullScreenPanelID, setFullScreenPanelID, }: IReadOnlyDashboard) => JSX.Element) & {
13
+ export declare const ReadOnlyDashboard: (({ context, dashboard, content, className, config, fullScreenPanelID, setFullScreenPanelID, }: IReadOnlyDashboard) => JSX.Element) & {
13
14
  displayName: string;
14
15
  };
15
16
  export {};
@@ -5,3 +5,4 @@ export * from './context';
5
5
  export * from './dashboard';
6
6
  export * from './views';
7
7
  export * from './panels';
8
+ export * from './content';
@@ -69,10 +69,22 @@ export interface IDashboard {
69
69
  id: string;
70
70
  name: string;
71
71
  group: string;
72
+ content_id: string;
73
+ }
74
+ export interface TDashboardContent {
72
75
  definition: IDashboardDefinition;
73
76
  views: IDashboardView[];
74
77
  panels: IDashboardPanel[];
75
78
  filters: FilterModelSnapshotOut[];
76
79
  version: string;
77
80
  }
81
+ export declare type DashboardContentDBType = {
82
+ id: string;
83
+ dashboard_id: string;
84
+ name: string;
85
+ content: TDashboardContent | null;
86
+ create_time: string;
87
+ update_time: string;
88
+ };
89
+ export declare const initialDashboardContent: TDashboardContent;
78
90
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtable/dashboard",
3
- "version": "8.61.1",
3
+ "version": "8.62.0",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public",