@devtable/dashboard 4.1.0 → 4.1.1
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/api-caller/index.d.ts +1 -1
- package/dist/contexts/layout-state-context.d.ts +0 -1
- package/dist/contexts/model-context.d.ts +1384 -1384
- package/dist/dashboard.es.js +9871 -7245
- package/dist/dashboard.umd.js +17 -17
- package/dist/definition-editor/query-editor/form.d.ts +1 -0
- package/dist/definition-editor/select-data-source.d.ts +14 -0
- package/dist/filter/filter-query-field/index.d.ts +2 -2
- package/dist/interactions/attachment-instance-manager.d.ts +14 -0
- package/dist/interactions/components/interaction-settings.d.ts +13 -0
- package/dist/interactions/components/operation-select.d.ts +11 -0
- package/dist/interactions/components/trigger-config-model.d.ts +18 -0
- package/dist/interactions/components/trigger-select.d.ts +8 -0
- package/dist/interactions/components/variable-list.d.ts +7 -0
- package/dist/interactions/hooks/use-current-interaction-manager.d.ts +6 -0
- package/dist/interactions/hooks/use-watch-triggers.d.ts +2 -0
- package/dist/interactions/interaction-manager.d.ts +14 -0
- package/dist/interactions/operation/operation-manager-impl.d.ts +13 -0
- package/dist/interactions/operation/operations/console-log.d.ts +5 -0
- package/dist/interactions/operation/operations/index.d.ts +2 -0
- package/dist/interactions/operation/operations/open-link.d.ts +6 -0
- package/dist/interactions/trigger/trigger-manager-impl.d.ts +18 -0
- package/dist/model/dashboard.d.ts +916 -916
- package/dist/model/filters/filter/common.d.ts +2 -1
- package/dist/model/filters/filter/index.d.ts +10 -10
- package/dist/model/filters/filter/multi-select.d.ts +5 -4
- package/dist/model/filters/filter/select.d.ts +5 -4
- package/dist/model/filters/index.d.ts +224 -224
- package/dist/panel/settings/common/data-field-selector.d.ts +1 -0
- package/dist/panel/settings/common/numbro-format-selector.d.ts +1 -0
- package/dist/plugins/color-manager/color-manager.d.ts +7 -0
- package/dist/plugins/color-manager/impl.d.ts +10 -0
- package/dist/plugins/color-manager/index.d.ts +2 -0
- package/dist/plugins/hooks/use-storage-data.d.ts +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/json-plugin-storage.d.ts +2 -2
- package/dist/plugins/message-channels.d.ts +1 -1
- package/dist/plugins/plugin-context.d.ts +3 -1
- package/dist/plugins/plugin-data-migrator/index.d.ts +1 -0
- package/dist/plugins/plugin-data-migrator/version-based-migrator.d.ts +18 -0
- package/dist/plugins/plugin-manager.d.ts +1 -2
- package/dist/plugins/sub-tree-json-plugin-storage.d.ts +10 -0
- package/dist/plugins/viz-components/bar-3d-chart/index.d.ts +2 -0
- package/dist/plugins/viz-components/bar-3d-chart/type.d.ts +13 -0
- package/dist/plugins/viz-components/bar-3d-chart/viz-bar-3d-chart-panel.d.ts +3 -0
- package/dist/plugins/viz-components/bar-3d-chart/viz-bar-3d-chart.d.ts +3 -0
- package/dist/plugins/viz-components/boxplot-chart/index.d.ts +2 -0
- package/dist/plugins/viz-components/boxplot-chart/reference-lines/index.d.ts +9 -0
- package/dist/plugins/viz-components/boxplot-chart/reference-lines/reference-line.d.ts +14 -0
- package/dist/plugins/viz-components/boxplot-chart/type.d.ts +20 -0
- package/dist/plugins/viz-components/boxplot-chart/variables/index.d.ts +10 -0
- package/dist/plugins/viz-components/boxplot-chart/variables/variable.d.ts +11 -0
- package/dist/plugins/viz-components/boxplot-chart/viz-boxplot-chart-panel.d.ts +3 -0
- package/dist/plugins/viz-components/boxplot-chart/viz-boxplot-chart.d.ts +3 -0
- package/dist/plugins/viz-components/cartesian/index.d.ts +2 -0
- package/dist/plugins/viz-components/cartesian/option/grid.d.ts +5 -0
- package/dist/plugins/viz-components/cartesian/option/index.d.ts +2 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/option/regression.d.ts +0 -0
- package/dist/plugins/viz-components/cartesian/option/series.d.ts +2 -0
- package/dist/plugins/viz-components/cartesian/option/tooltip.d.ts +5 -0
- package/dist/plugins/viz-components/cartesian/option/x-axis.d.ts +2 -0
- package/dist/plugins/viz-components/cartesian/option/y-axis.d.ts +15 -0
- package/dist/plugins/viz-components/cartesian/panel/regressions/index.d.ts +10 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/regressions/regression-item.d.ts +0 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/fields.bar.d.ts +0 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/fields.line.d.ts +0 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/fields.scatter.d.ts +0 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/index.d.ts +2 -3
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/series-item.d.ts +0 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/stats/index.d.ts +0 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/stats/variable.d.ts +0 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/y-axes.d.ts +0 -0
- package/dist/{panel/viz → plugins/viz-components}/cartesian/type.d.ts +5 -7
- package/dist/plugins/viz-components/cartesian/viz-cartesian-chart.d.ts +3 -0
- package/dist/plugins/viz-components/cartesian/viz-cartesian-panel.d.ts +3 -0
- package/dist/plugins/viz-components/pie-chart/index.d.ts +2 -0
- package/dist/plugins/viz-components/pie-chart/type.d.ts +5 -0
- package/dist/plugins/viz-components/pie-chart/viz-pie-chart-panel.d.ts +3 -0
- package/dist/plugins/viz-components/pie-chart/viz-pie-chart.d.ts +3 -0
- package/dist/plugins/viz-components/radar-chart/index.d.ts +2 -0
- package/dist/plugins/viz-components/radar-chart/option/index.d.ts +26 -0
- package/dist/plugins/viz-components/radar-chart/panel/dimensions.d.ts +10 -0
- package/dist/plugins/viz-components/radar-chart/type.d.ts +11 -0
- package/dist/plugins/viz-components/radar-chart/viz-radar-chart-panel.d.ts +3 -0
- package/dist/plugins/viz-components/radar-chart/viz-radar-chart.d.ts +3 -0
- package/dist/plugins/viz-components/regression-chart/index.d.ts +2 -0
- package/dist/plugins/viz-components/regression-chart/option/index.d.ts +2 -0
- package/dist/plugins/viz-components/regression-chart/option/regression-expression.d.ts +15 -0
- package/dist/plugins/viz-components/regression-chart/option/regression-series.d.ts +14 -0
- package/dist/plugins/viz-components/regression-chart/regression-item.d.ts +14 -0
- package/dist/plugins/viz-components/regression-chart/type.d.ts +12 -0
- package/dist/plugins/viz-components/regression-chart/viz-regression-chart-panel.d.ts +3 -0
- package/dist/plugins/viz-components/regression-chart/viz-regression-chart.d.ts +3 -0
- package/dist/plugins/viz-components/rich-text/hooks.d.ts +8 -0
- package/dist/plugins/viz-components/rich-text/index.d.ts +2 -0
- package/dist/plugins/viz-components/rich-text/type.d.ts +4 -0
- package/dist/plugins/viz-components/rich-text/viz-rich-text-panel.d.ts +3 -0
- package/dist/plugins/viz-components/rich-text/viz-rich-text.d.ts +3 -0
- package/dist/plugins/viz-components/stats/index.d.ts +2 -0
- package/dist/{panel/viz → plugins/viz-components}/stats/panel/variable.d.ts +1 -1
- package/dist/{panel/viz → plugins/viz-components}/stats/panel/variables.d.ts +1 -1
- package/dist/{panel/viz/stats/types.d.ts → plugins/viz-components/stats/type.d.ts} +2 -1
- package/dist/plugins/viz-components/stats/update/index.d.ts +5 -0
- package/dist/plugins/viz-components/stats/viz-stats-panel.d.ts +3 -0
- package/dist/plugins/viz-components/stats/viz-stats.d.ts +3 -0
- package/dist/plugins/viz-components/sunburst/index.d.ts +2 -0
- package/dist/plugins/viz-components/sunburst/type.d.ts +5 -0
- package/dist/plugins/viz-components/sunburst/viz-sunburst-panel.d.ts +3 -0
- package/dist/plugins/viz-components/sunburst/viz-sunburst.d.ts +3 -0
- package/dist/plugins/viz-components/table/index.d.ts +1 -1
- package/dist/plugins/viz-components/table/triggers/click-cell-content.d.ts +11 -0
- package/dist/plugins/viz-components/table/triggers/index.d.ts +1 -0
- package/dist/plugins/viz-components/table/value.d.ts +2 -1
- package/dist/plugins/viz-components/table/viz-table-panel.d.ts +1 -1
- package/dist/plugins/viz-components/table/viz-table.d.ts +2 -2
- package/dist/plugins/viz-manager/components.d.ts +3 -3
- package/dist/plugins/viz-manager/impl.d.ts +3 -3
- package/dist/plugins/viz-manager/types.d.ts +3 -7
- package/dist/types/dashboard.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/plugin/index.d.ts +94 -8
- package/dist/types/utils.d.ts +4 -0
- package/dist/utils/aggregation.d.ts +9 -1
- package/dist/utils/template/editor/index.d.ts +3 -0
- package/dist/utils/template/editor/template-input.d.ts +8 -0
- package/dist/utils/template/editor/utils.d.ts +2 -0
- package/dist/utils/template/editor/variable-field.d.ts +10 -0
- package/dist/utils/template/editor/variable-style.d.ts +8 -0
- package/dist/utils/template/index.d.ts +4 -0
- package/dist/utils/template/render/index.d.ts +2 -0
- package/dist/utils/template/{render.d.ts → render/render-jsx.d.ts} +1 -1
- package/dist/utils/template/render/render-string.d.ts +2 -0
- package/dist/utils/template/utils.d.ts +4 -0
- package/package.json +1 -1
- package/dist/filter/filter-query-field/select-data-source.d.ts +0 -8
- package/dist/panel/viz/bar-3d/index.d.ts +0 -9
- package/dist/panel/viz/bar-3d/panel.d.ts +0 -3
- package/dist/panel/viz/cartesian/index.d.ts +0 -10
- package/dist/panel/viz/cartesian/panel/index.d.ts +0 -3
- package/dist/panel/viz/cartesian/panel/regressions/index.d.ts +0 -11
- package/dist/panel/viz/pie/index.d.ts +0 -9
- package/dist/panel/viz/pie/panel.d.ts +0 -3
- package/dist/panel/viz/rich-text/index.d.ts +0 -10
- package/dist/panel/viz/rich-text/panel.d.ts +0 -3
- package/dist/panel/viz/rich-text/type.d.ts +0 -8
- package/dist/panel/viz/stats/index.d.ts +0 -10
- package/dist/panel/viz/stats/panel/index.d.ts +0 -10
- package/dist/panel/viz/stats/update/index.d.ts +0 -15
- package/dist/panel/viz/sunburst/index.d.ts +0 -9
- package/dist/panel/viz/sunburst/panel.d.ts +0 -3
- package/dist/utils/template/editor.d.ts +0 -16
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VizComponent } from '
|
|
1
|
+
import { VizComponent } from '~/types/plugin';
|
|
2
2
|
export declare const TableVizComponent: VizComponent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ITriggerConfigProps, ITriggerSchema } from '~/types/plugin';
|
|
3
|
+
export declare const ClickCellContent: ITriggerSchema;
|
|
4
|
+
export interface IClickCellContentConfig {
|
|
5
|
+
/**
|
|
6
|
+
* string for the field name,
|
|
7
|
+
* number for the column index
|
|
8
|
+
*/
|
|
9
|
+
column: string | number;
|
|
10
|
+
}
|
|
11
|
+
export declare function ClickCellContentSettings(props: ITriggerConfigProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClickCellContent } from './click-cell-content';
|
|
@@ -3,6 +3,7 @@ import { ValueType } from './type';
|
|
|
3
3
|
interface ICellValue {
|
|
4
4
|
value: any;
|
|
5
5
|
type: ValueType;
|
|
6
|
+
onContentClick?: () => void;
|
|
6
7
|
}
|
|
7
|
-
export declare function CellValue(
|
|
8
|
+
export declare function CellValue(props: ICellValue): JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { VizViewProps } from '
|
|
3
|
-
export declare function VizTable({ context }: VizViewProps): JSX.Element;
|
|
2
|
+
import { VizViewProps } from '~/types/plugin';
|
|
3
|
+
export declare function VizTable({ context, instance }: VizViewProps): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IPanelInfoEditor } from '
|
|
2
|
+
import { IPanelInfoEditor } from '~/types/plugin';
|
|
3
3
|
import { IPanelInfo, IVizManager } from './types';
|
|
4
4
|
export declare type IViewPanelInfo = IPanelInfo & {
|
|
5
5
|
layout: {
|
|
@@ -7,13 +7,13 @@ export declare type IViewPanelInfo = IPanelInfo & {
|
|
|
7
7
|
h: number;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export declare type IViewComponentProps<TDebug =
|
|
10
|
+
export declare type IViewComponentProps<TDebug = Record<string, unknown>> = {
|
|
11
11
|
panel: IViewPanelInfo;
|
|
12
12
|
data: any;
|
|
13
13
|
vizManager: IVizManager;
|
|
14
14
|
} & TDebug;
|
|
15
15
|
export declare const VizViewComponent: <T>(props: IViewComponentProps<T>) => JSX.Element;
|
|
16
|
-
export declare type IConfigComponentProps<TDebug =
|
|
16
|
+
export declare type IConfigComponentProps<TDebug = Record<string, unknown>> = {
|
|
17
17
|
panel: IPanelInfo;
|
|
18
18
|
panelInfoEditor: IPanelInfoEditor;
|
|
19
19
|
vizManager: IVizManager;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IPluginManager, VizComponent } from '
|
|
2
|
-
import { IPanelInfo, IVizManager
|
|
1
|
+
import { IPluginManager, VizComponent, VizInstance } from '~/types/plugin';
|
|
2
|
+
import { IPanelInfo, IVizManager } from './types';
|
|
3
3
|
export declare class VizManager implements IVizManager {
|
|
4
4
|
private pluginManager;
|
|
5
5
|
private instances;
|
|
6
6
|
constructor(pluginManager: IPluginManager);
|
|
7
7
|
get availableVizList(): VizComponent[];
|
|
8
8
|
resolveComponent(name: string): VizComponent;
|
|
9
|
-
getOrCreateInstance(panel: IPanelInfo):
|
|
9
|
+
getOrCreateInstance(panel: IPanelInfo): VizInstance;
|
|
10
10
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { IDashboardPanel } from '
|
|
2
|
-
import {
|
|
1
|
+
import { IDashboardPanel } from '~/types';
|
|
2
|
+
import { VizComponent, VizInstance } from '~/types/plugin';
|
|
3
3
|
export declare type IPanelInfo = Omit<IDashboardPanel, 'layout'>;
|
|
4
4
|
export interface IVizManager {
|
|
5
5
|
readonly availableVizList: VizComponent[];
|
|
6
6
|
resolveComponent(type: string): VizComponent;
|
|
7
|
-
getOrCreateInstance(panel: IPanelInfo):
|
|
8
|
-
}
|
|
9
|
-
export interface VizInstanceInfo extends VizInstance {
|
|
10
|
-
messageChannels: IMessageChannels;
|
|
11
|
-
instanceData: PluginStorage;
|
|
7
|
+
getOrCreateInstance(panel: IPanelInfo): VizInstance;
|
|
12
8
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { AnyObject } from '~/types/utils';
|
|
1
2
|
import { FilterModelInstance } from '../model';
|
|
2
3
|
import { QueryModelInstance } from '../model/queries';
|
|
3
4
|
import { SQLSnippetModelInstance } from '../model/sql-snippets';
|
|
4
5
|
export interface IVizConfig {
|
|
5
6
|
type: string;
|
|
6
|
-
conf:
|
|
7
|
+
conf: AnyObject;
|
|
7
8
|
}
|
|
8
9
|
export interface IDashboardPanel {
|
|
9
10
|
id: string;
|
|
@@ -22,7 +23,6 @@ export interface IDashboardPanel {
|
|
|
22
23
|
}
|
|
23
24
|
export declare enum DashboardMode {
|
|
24
25
|
Use = "use",
|
|
25
|
-
Layout = "layout",
|
|
26
26
|
Edit = "edit"
|
|
27
27
|
}
|
|
28
28
|
export interface IDashboardDefinition {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import EventEmitter2 from 'eventemitter2';
|
|
1
|
+
import { EventEmitter2 } from 'eventemitter2';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { IVizManager } from '~/plugins';
|
|
4
|
+
import { AnyObject } from '~/types';
|
|
3
5
|
/**
|
|
4
6
|
* Basic information of a viz component instance
|
|
5
7
|
*/
|
|
@@ -7,6 +9,8 @@ export interface VizInstance {
|
|
|
7
9
|
id: string;
|
|
8
10
|
name: string;
|
|
9
11
|
type: string;
|
|
12
|
+
messageChannels: IMessageChannels;
|
|
13
|
+
instanceData: PluginStorage;
|
|
10
14
|
}
|
|
11
15
|
/**
|
|
12
16
|
* Props to render the view of viz component
|
|
@@ -15,27 +19,30 @@ export interface VizViewProps {
|
|
|
15
19
|
instance: VizInstance;
|
|
16
20
|
context: VizViewContext;
|
|
17
21
|
}
|
|
22
|
+
export interface IWatchOptions {
|
|
23
|
+
fireImmediately?: boolean;
|
|
24
|
+
}
|
|
18
25
|
export interface PluginStorage {
|
|
19
26
|
getItem<T>(key: string | null): Promise<T>;
|
|
20
27
|
setItem<T>(key: string | null, item: T): Promise<T>;
|
|
21
28
|
deleteItem(key: string): Promise<void>;
|
|
22
|
-
watchItem<T>(key: string | null, callback: (value: T, previous?: T) => void): () => void;
|
|
29
|
+
watchItem<T>(key: string | null, callback: (value: T, previous?: T) => void, options?: IWatchOptions): () => void;
|
|
23
30
|
}
|
|
24
|
-
export interface
|
|
31
|
+
export interface IColorPaletteItem {
|
|
25
32
|
name: string;
|
|
26
33
|
type: string;
|
|
27
34
|
category: string;
|
|
28
35
|
}
|
|
29
|
-
export interface
|
|
36
|
+
export interface ISingleColor extends IColorPaletteItem {
|
|
30
37
|
type: 'single';
|
|
31
38
|
value: string;
|
|
32
39
|
}
|
|
33
|
-
export interface ColorInterpolation extends
|
|
40
|
+
export interface ColorInterpolation extends IColorPaletteItem {
|
|
34
41
|
type: 'interpolation';
|
|
35
42
|
interpolation: (value: number) => string;
|
|
36
43
|
}
|
|
37
44
|
export interface ColorPalette {
|
|
38
|
-
getColor(colorInfo:
|
|
45
|
+
getColor(colorInfo: IColorPaletteItem): (value: unknown) => string;
|
|
39
46
|
}
|
|
40
47
|
export interface IMessageChannels {
|
|
41
48
|
globalChannel: EventEmitter2;
|
|
@@ -48,8 +55,9 @@ export interface VizContext {
|
|
|
48
55
|
locale: string;
|
|
49
56
|
msgChannels: IMessageChannels;
|
|
50
57
|
data: unknown;
|
|
58
|
+
vizManager: IVizManager;
|
|
51
59
|
}
|
|
52
|
-
declare type Setter<T> = (val:
|
|
60
|
+
declare type Setter<T> = (val: T) => void;
|
|
53
61
|
export interface IPanelInfoEditor {
|
|
54
62
|
setTitle: Setter<string>;
|
|
55
63
|
setDescription: Setter<string>;
|
|
@@ -77,6 +85,8 @@ export interface VizComponent {
|
|
|
77
85
|
viewRender: React.ComponentType<VizViewProps>;
|
|
78
86
|
configRender: React.ComponentType<VizConfigProps>;
|
|
79
87
|
migrator: IVizComponentMigrator;
|
|
88
|
+
createConfig: () => AnyObject;
|
|
89
|
+
triggers?: ITriggerSchema[];
|
|
80
90
|
}
|
|
81
91
|
export interface IVizComponentMigrator {
|
|
82
92
|
needMigration(ctx: VizComponentMigrationContext): Promise<boolean>;
|
|
@@ -84,7 +94,7 @@ export interface IVizComponentMigrator {
|
|
|
84
94
|
}
|
|
85
95
|
export interface IPluginManifest {
|
|
86
96
|
viz: VizComponent[];
|
|
87
|
-
color:
|
|
97
|
+
color: IColorPaletteItem[];
|
|
88
98
|
}
|
|
89
99
|
export interface IDashboardPlugin {
|
|
90
100
|
id: string;
|
|
@@ -98,4 +108,80 @@ export interface IPluginManager {
|
|
|
98
108
|
viz: (name: string) => VizComponent;
|
|
99
109
|
};
|
|
100
110
|
}
|
|
111
|
+
export interface IPayloadVariableSchema {
|
|
112
|
+
name: string;
|
|
113
|
+
description: string;
|
|
114
|
+
valueType: 'string' | 'number' | 'object';
|
|
115
|
+
}
|
|
116
|
+
export interface IInteractionConfigProps {
|
|
117
|
+
instance: VizInstance;
|
|
118
|
+
}
|
|
119
|
+
export interface ITriggerConfigProps extends IInteractionConfigProps {
|
|
120
|
+
trigger: ITrigger;
|
|
121
|
+
sampleData: Record<string, unknown>[];
|
|
122
|
+
}
|
|
123
|
+
export interface IOperationConfigProps extends IInteractionConfigProps {
|
|
124
|
+
operation: IDashboardOperation;
|
|
125
|
+
variables: IPayloadVariableSchema[];
|
|
126
|
+
}
|
|
127
|
+
export interface ITriggerSchema {
|
|
128
|
+
id: string;
|
|
129
|
+
displayName: string;
|
|
130
|
+
payload: IPayloadVariableSchema[];
|
|
131
|
+
configRender: React.ComponentType<ITriggerConfigProps>;
|
|
132
|
+
nameRender: React.ComponentType<Omit<ITriggerConfigProps, 'sampleData'>>;
|
|
133
|
+
}
|
|
134
|
+
export interface ITrigger {
|
|
135
|
+
id: string;
|
|
136
|
+
schemaRef: string;
|
|
137
|
+
triggerData: PluginStorage;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* A readonly snapshot of a trigger
|
|
141
|
+
*/
|
|
142
|
+
export interface ITriggerSnapshot<TConfig> {
|
|
143
|
+
id: string;
|
|
144
|
+
schemaRef: string;
|
|
145
|
+
config: TConfig;
|
|
146
|
+
}
|
|
147
|
+
export interface IVizTriggerManager {
|
|
148
|
+
getTriggerSchemaList(): ITriggerSchema[];
|
|
149
|
+
getTriggerList(): Promise<ITrigger[]>;
|
|
150
|
+
removeTrigger(triggerId: string): Promise<void>;
|
|
151
|
+
createOrGetTrigger(id: string, schema: ITriggerSchema): Promise<ITrigger>;
|
|
152
|
+
retrieveTrigger(id: string): Promise<ITrigger | undefined>;
|
|
153
|
+
watchTriggerSnapshotList(callback: (triggerList: ITriggerSnapshot<AnyObject>[]) => void): () => void;
|
|
154
|
+
}
|
|
155
|
+
export interface IDashboardOperationSchema {
|
|
156
|
+
id: string;
|
|
157
|
+
displayName: string;
|
|
158
|
+
configRender: React.ComponentType<IOperationConfigProps>;
|
|
159
|
+
run: (payload: Record<string, unknown>, operation: IDashboardOperation) => Promise<void>;
|
|
160
|
+
}
|
|
161
|
+
export interface IDashboardOperation {
|
|
162
|
+
id: string;
|
|
163
|
+
schemaRef: string;
|
|
164
|
+
operationData: PluginStorage;
|
|
165
|
+
}
|
|
166
|
+
export interface IVizOperationManager {
|
|
167
|
+
getOperationSchemaList(): IDashboardOperationSchema[];
|
|
168
|
+
getOperationList(): Promise<IDashboardOperation[]>;
|
|
169
|
+
removeOperation(operationId: string): Promise<void>;
|
|
170
|
+
createOrGetOperation(id: string, schema: IDashboardOperationSchema): Promise<IDashboardOperation>;
|
|
171
|
+
runOperation(operationId: string, payload: Record<string, unknown>): Promise<void>;
|
|
172
|
+
retrieveTrigger(operationId: string): Promise<IDashboardOperation | undefined>;
|
|
173
|
+
}
|
|
174
|
+
export interface IVizInteraction {
|
|
175
|
+
id: string;
|
|
176
|
+
triggerRef: string;
|
|
177
|
+
operationRef: string;
|
|
178
|
+
}
|
|
179
|
+
export interface IVizInteractionManager {
|
|
180
|
+
triggerManager: IVizTriggerManager;
|
|
181
|
+
operationManager: IVizOperationManager;
|
|
182
|
+
getInteractionList(): Promise<IVizInteraction[]>;
|
|
183
|
+
addInteraction(trigger: ITrigger, operation: IDashboardOperation): Promise<void>;
|
|
184
|
+
removeInteraction(interactionId: string): Promise<void>;
|
|
185
|
+
runInteraction(triggerId: string, payload: Record<string, unknown>): Promise<void>;
|
|
186
|
+
}
|
|
101
187
|
export {};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
export declare type AggregationType =
|
|
1
|
+
export declare type AggregationType = {
|
|
2
|
+
type: 'none' | 'sum' | 'mean' | 'median' | 'max' | 'min';
|
|
3
|
+
config: Record<any, never>;
|
|
4
|
+
} | {
|
|
5
|
+
type: 'quantile';
|
|
6
|
+
config: {
|
|
7
|
+
p: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
2
10
|
export declare function aggregateValue(data: Record<string, number>[], data_field: string, aggregation: AggregationType): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TextInputProps } from '@mantine/core';
|
|
2
|
+
import { ChangeEventHandler } from 'react';
|
|
3
|
+
interface ITemplateInput extends Omit<TextInputProps, 'value' | 'onChange'> {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const TemplateInput: import("react").ForwardRefExoticComponent<ITemplateInput & import("react").RefAttributes<unknown>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ITemplateVariable } from '../types';
|
|
3
|
+
interface ITemplateVariableField {
|
|
4
|
+
value: ITemplateVariable;
|
|
5
|
+
onChange: (v: ITemplateVariable) => void;
|
|
6
|
+
data: any[];
|
|
7
|
+
withStyle?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const TemplateVariableField: React.ForwardRefExoticComponent<ITemplateVariableField & React.RefAttributes<unknown>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ITemplateVariable } from '../types';
|
|
3
|
+
interface ITemplateVariableStyleField {
|
|
4
|
+
value: ITemplateVariable;
|
|
5
|
+
onChange: (v: ITemplateVariable) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const TemplateVariableStyleField: React.ForwardRefExoticComponent<ITemplateVariableStyleField & React.RefAttributes<unknown>>;
|
|
8
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ITemplateVariable } from '
|
|
2
|
+
import { ITemplateVariable } from '../types';
|
|
3
3
|
export declare function templateToJSX(template: string, variables: ITemplateVariable[], data: Record<string, number>[]): (JSX.Element | import("react").ReactNode[])[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ITemplateVariable } from './types';
|
|
2
|
+
export declare function getNonStatsDataText(data: any): any;
|
|
3
|
+
export declare function getAggregatedValue({ data_field, aggregation }: ITemplateVariable, data: Record<string, number>[]): number;
|
|
4
|
+
export declare function formatAggregatedValue({ formatter }: ITemplateVariable, value: number | string): any;
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IFilterOptionQuery } from '../../model/filters/filter/common';
|
|
3
|
-
interface ISelectDataSource {
|
|
4
|
-
value: IFilterOptionQuery;
|
|
5
|
-
onChange: (v: IFilterOptionQuery) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const SelectDataSource: React.FunctionComponent<ISelectDataSource>;
|
|
8
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ICartesianChartConf } from './type';
|
|
3
|
-
interface ICartesianChart {
|
|
4
|
-
conf: ICartesianChartConf;
|
|
5
|
-
data: any[];
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function VizCartesianChart({ conf, data, width, height }: ICartesianChart): JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Control, UseFormGetValues, UseFormWatch } from 'react-hook-form';
|
|
3
|
-
import { ICartesianChartConf } from '../../type';
|
|
4
|
-
interface IRegressionsField {
|
|
5
|
-
control: Control<ICartesianChartConf, any>;
|
|
6
|
-
watch: UseFormWatch<ICartesianChartConf>;
|
|
7
|
-
getValues: UseFormGetValues<ICartesianChartConf>;
|
|
8
|
-
data: any[];
|
|
9
|
-
}
|
|
10
|
-
export declare function RegressionsField({ control, watch, getValues, data }: IRegressionsField): JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IRichTextConf } from './type';
|
|
3
|
-
interface IRichText {
|
|
4
|
-
conf: IRichTextConf;
|
|
5
|
-
data: any[];
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function VizRichText({ conf, width, height }: IRichText): JSX.Element | null;
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IVizStatsConf } from './types';
|
|
3
|
-
interface IVizStats {
|
|
4
|
-
conf: IVizStatsConf;
|
|
5
|
-
data: any;
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function VizStats({ conf: { template, variables, align }, data }: IVizStats): JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IVizPanelProps } from '../../../../types/viz-panel';
|
|
3
|
-
import { IVizStatsConf } from '../types';
|
|
4
|
-
import { ILegacyStatsConf } from '../update';
|
|
5
|
-
interface IVizStatsPanel extends Omit<IVizPanelProps, 'conf' | 'setConf'> {
|
|
6
|
-
conf: IVizStatsConf | ILegacyStatsConf;
|
|
7
|
-
setConf: (conf: IVizStatsConf) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare function VizStatsPanel({ conf, setConf, data }: IVizStatsPanel): JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TNumbroFormat } from '../../../settings/common/numbro-format-selector';
|
|
2
|
-
import { IVizStatsConf } from '../types';
|
|
3
|
-
export interface ILegacyStatsConf {
|
|
4
|
-
align: 'center';
|
|
5
|
-
size: string;
|
|
6
|
-
weight: string;
|
|
7
|
-
color: any;
|
|
8
|
-
content: {
|
|
9
|
-
prefix: string;
|
|
10
|
-
data_field: string;
|
|
11
|
-
formatter: TNumbroFormat;
|
|
12
|
-
postfix: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare function updateSchema(legacyConf: IVizStatsConf | ILegacyStatsConf): IVizStatsConf;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TextInputProps } from '@mantine/core';
|
|
2
|
-
import React, { ChangeEventHandler } from 'react';
|
|
3
|
-
import { ITemplateVariable } from './types';
|
|
4
|
-
export declare function getANewVariable(): ITemplateVariable;
|
|
5
|
-
interface ITemplateInput extends Omit<TextInputProps, 'value' | 'onChange'> {
|
|
6
|
-
value: string;
|
|
7
|
-
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
8
|
-
}
|
|
9
|
-
export declare const TemplateInput: React.ForwardRefExoticComponent<ITemplateInput & React.RefAttributes<unknown>>;
|
|
10
|
-
interface ITemplateVariableField {
|
|
11
|
-
value: ITemplateVariable;
|
|
12
|
-
onChange: (v: ITemplateVariable) => void;
|
|
13
|
-
data: any[];
|
|
14
|
-
}
|
|
15
|
-
export declare const TemplateVariableField: React.ForwardRefExoticComponent<ITemplateVariableField & React.RefAttributes<unknown>>;
|
|
16
|
-
export {};
|