@devtable/dashboard 4.1.0 → 4.1.2

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.
Files changed (185) hide show
  1. package/dist/api-caller/index.d.ts +1 -1
  2. package/dist/api-caller/request.d.ts +1 -1
  3. package/dist/contexts/layout-state-context.d.ts +0 -1
  4. package/dist/contexts/model-context.d.ts +1444 -1444
  5. package/dist/contexts/panel-context.d.ts +1 -1
  6. package/dist/dashboard.es.js +11033 -8417
  7. package/dist/dashboard.umd.js +26 -26
  8. package/dist/definition-editor/query-editor/form.d.ts +1 -0
  9. package/dist/definition-editor/query-editor/index.d.ts +1 -4
  10. package/dist/definition-editor/select-data-source.d.ts +14 -0
  11. package/dist/definition-editor/sql-snippet-editor/editor.d.ts +2 -5
  12. package/dist/definition-editor/sql-snippet-editor/index.d.ts +1 -4
  13. package/dist/filter/filter-checkbox/render.d.ts +3 -3
  14. package/dist/filter/filter-date-range/render.d.ts +2 -2
  15. package/dist/filter/filter-multi-select/render.d.ts +2 -2
  16. package/dist/filter/filter-query-field/index.d.ts +2 -2
  17. package/dist/filter/filter-select/render.d.ts +2 -2
  18. package/dist/filter/filter-settings/filter-settings.d.ts +2 -5
  19. package/dist/filter/filter-text-input/render.d.ts +2 -2
  20. package/dist/filter/filter.d.ts +2 -2
  21. package/dist/filter/index.d.ts +2 -5
  22. package/dist/global.d.ts +2 -0
  23. package/dist/interactions/attachment-instance-manager.d.ts +14 -0
  24. package/dist/interactions/components/interaction-settings.d.ts +13 -0
  25. package/dist/interactions/components/operation-select.d.ts +11 -0
  26. package/dist/interactions/components/trigger-config-model.d.ts +18 -0
  27. package/dist/interactions/components/trigger-select.d.ts +8 -0
  28. package/dist/interactions/components/variable-list.d.ts +7 -0
  29. package/dist/interactions/hooks/use-current-interaction-manager.d.ts +6 -0
  30. package/dist/interactions/hooks/use-watch-triggers.d.ts +2 -0
  31. package/dist/interactions/interaction-manager.d.ts +14 -0
  32. package/dist/interactions/operation/operation-manager-impl.d.ts +13 -0
  33. package/dist/interactions/operation/operations/console-log.d.ts +5 -0
  34. package/dist/interactions/operation/operations/index.d.ts +2 -0
  35. package/dist/interactions/operation/operations/open-link.d.ts +6 -0
  36. package/dist/interactions/trigger/trigger-manager-impl.d.ts +18 -0
  37. package/dist/layout/read-only.d.ts +2 -2
  38. package/dist/main/actions.d.ts +1 -1
  39. package/dist/main/main.d.ts +1 -1
  40. package/dist/main/view-schema-modal.d.ts +1 -1
  41. package/dist/model/context.d.ts +3 -3
  42. package/dist/model/dashboard.d.ts +956 -956
  43. package/dist/model/filters/filter/common.d.ts +2 -1
  44. package/dist/model/filters/filter/index.d.ts +10 -10
  45. package/dist/model/filters/filter/multi-select.d.ts +5 -4
  46. package/dist/model/filters/filter/select.d.ts +5 -4
  47. package/dist/model/filters/index.d.ts +227 -227
  48. package/dist/model/queries/index.d.ts +3 -3
  49. package/dist/model/queries/query.d.ts +1 -1
  50. package/dist/panel/error-boundary.d.ts +2 -2
  51. package/dist/panel/panel-description.d.ts +1 -4
  52. package/dist/panel/settings/common/data-field-selector.d.ts +2 -1
  53. package/dist/panel/settings/common/numbro-format-selector.d.ts +1 -0
  54. package/dist/panel/settings/panel-config/index.d.ts +1 -4
  55. package/dist/panel/settings/pick-query/index.d.ts +1 -4
  56. package/dist/panel/settings/viz-config/index.d.ts +1 -4
  57. package/dist/panel/settings/viz-config/preview-viz.d.ts +1 -4
  58. package/dist/panel/title-bar.d.ts +1 -4
  59. package/dist/panel/viz/index.d.ts +1 -1
  60. package/dist/plugins/color-manager/color-manager.d.ts +7 -0
  61. package/dist/plugins/color-manager/impl.d.ts +10 -0
  62. package/dist/plugins/color-manager/index.d.ts +2 -0
  63. package/dist/plugins/hooks/use-storage-data.d.ts +1 -1
  64. package/dist/plugins/index.d.ts +1 -0
  65. package/dist/plugins/json-plugin-storage.d.ts +4 -4
  66. package/dist/plugins/message-channels.d.ts +1 -1
  67. package/dist/plugins/plugin-context.d.ts +3 -1
  68. package/dist/plugins/plugin-data-migrator/index.d.ts +1 -0
  69. package/dist/plugins/plugin-data-migrator/plugin-data-migrator.d.ts +3 -3
  70. package/dist/plugins/plugin-data-migrator/version-based-migrator.d.ts +18 -0
  71. package/dist/plugins/plugin-manager.d.ts +1 -2
  72. package/dist/plugins/sub-tree-json-plugin-storage.d.ts +10 -0
  73. package/dist/plugins/viz-components/bar-3d-chart/index.d.ts +2 -0
  74. package/dist/plugins/viz-components/bar-3d-chart/type.d.ts +13 -0
  75. package/dist/plugins/viz-components/bar-3d-chart/viz-bar-3d-chart-panel.d.ts +3 -0
  76. package/dist/plugins/viz-components/bar-3d-chart/viz-bar-3d-chart.d.ts +3 -0
  77. package/dist/plugins/viz-components/boxplot-chart/index.d.ts +2 -0
  78. package/dist/plugins/viz-components/boxplot-chart/reference-lines/index.d.ts +9 -0
  79. package/dist/plugins/viz-components/boxplot-chart/reference-lines/reference-line.d.ts +14 -0
  80. package/dist/plugins/viz-components/boxplot-chart/type.d.ts +20 -0
  81. package/dist/plugins/viz-components/boxplot-chart/variables/index.d.ts +10 -0
  82. package/dist/plugins/viz-components/boxplot-chart/variables/variable.d.ts +11 -0
  83. package/dist/plugins/viz-components/boxplot-chart/viz-boxplot-chart-panel.d.ts +3 -0
  84. package/dist/plugins/viz-components/boxplot-chart/viz-boxplot-chart.d.ts +3 -0
  85. package/dist/plugins/viz-components/cartesian/index.d.ts +2 -0
  86. package/dist/plugins/viz-components/cartesian/option/grid.d.ts +5 -0
  87. package/dist/plugins/viz-components/cartesian/option/index.d.ts +2 -0
  88. package/dist/{panel/viz → plugins/viz-components}/cartesian/option/regression.d.ts +2 -2
  89. package/dist/plugins/viz-components/cartesian/option/series.d.ts +2 -0
  90. package/dist/plugins/viz-components/cartesian/option/tooltip.d.ts +5 -0
  91. package/dist/plugins/viz-components/cartesian/option/x-axis.d.ts +2 -0
  92. package/dist/plugins/viz-components/cartesian/option/y-axis.d.ts +15 -0
  93. package/dist/plugins/viz-components/cartesian/panel/regressions/index.d.ts +10 -0
  94. package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/regressions/regression-item.d.ts +2 -2
  95. package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/fields.bar.d.ts +1 -1
  96. package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/fields.line.d.ts +1 -1
  97. package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/fields.scatter.d.ts +1 -1
  98. package/dist/plugins/viz-components/cartesian/panel/series/index.d.ts +10 -0
  99. package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/series/series-item.d.ts +2 -2
  100. package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/stats/index.d.ts +2 -2
  101. package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/stats/variable.d.ts +2 -2
  102. package/dist/{panel/viz → plugins/viz-components}/cartesian/panel/y-axes.d.ts +1 -1
  103. package/dist/{panel/viz → plugins/viz-components}/cartesian/type.d.ts +5 -7
  104. package/dist/plugins/viz-components/cartesian/viz-cartesian-chart.d.ts +3 -0
  105. package/dist/plugins/viz-components/cartesian/viz-cartesian-panel.d.ts +3 -0
  106. package/dist/plugins/viz-components/pie-chart/index.d.ts +2 -0
  107. package/dist/plugins/viz-components/pie-chart/type.d.ts +5 -0
  108. package/dist/plugins/viz-components/pie-chart/viz-pie-chart-panel.d.ts +3 -0
  109. package/dist/plugins/viz-components/pie-chart/viz-pie-chart.d.ts +3 -0
  110. package/dist/plugins/viz-components/radar-chart/index.d.ts +2 -0
  111. package/dist/plugins/viz-components/radar-chart/option/index.d.ts +26 -0
  112. package/dist/plugins/viz-components/radar-chart/panel/dimensions.d.ts +10 -0
  113. package/dist/plugins/viz-components/radar-chart/type.d.ts +11 -0
  114. package/dist/plugins/viz-components/radar-chart/viz-radar-chart-panel.d.ts +3 -0
  115. package/dist/plugins/viz-components/radar-chart/viz-radar-chart.d.ts +3 -0
  116. package/dist/plugins/viz-components/regression-chart/index.d.ts +2 -0
  117. package/dist/plugins/viz-components/regression-chart/option/index.d.ts +2 -0
  118. package/dist/plugins/viz-components/regression-chart/option/regression-expression.d.ts +15 -0
  119. package/dist/plugins/viz-components/regression-chart/option/regression-series.d.ts +14 -0
  120. package/dist/plugins/viz-components/regression-chart/regression-item.d.ts +14 -0
  121. package/dist/plugins/viz-components/regression-chart/type.d.ts +12 -0
  122. package/dist/plugins/viz-components/regression-chart/viz-regression-chart-panel.d.ts +3 -0
  123. package/dist/plugins/viz-components/regression-chart/viz-regression-chart.d.ts +3 -0
  124. package/dist/plugins/viz-components/rich-text/hooks.d.ts +8 -0
  125. package/dist/plugins/viz-components/rich-text/index.d.ts +2 -0
  126. package/dist/plugins/viz-components/rich-text/type.d.ts +4 -0
  127. package/dist/plugins/viz-components/rich-text/viz-rich-text-panel.d.ts +3 -0
  128. package/dist/plugins/viz-components/rich-text/viz-rich-text.d.ts +3 -0
  129. package/dist/plugins/viz-components/stats/index.d.ts +2 -0
  130. package/dist/{panel/viz → plugins/viz-components}/stats/panel/variable.d.ts +3 -3
  131. package/dist/{panel/viz → plugins/viz-components}/stats/panel/variables.d.ts +3 -3
  132. package/dist/{panel/viz/stats/types.d.ts → plugins/viz-components/stats/type.d.ts} +2 -1
  133. package/dist/plugins/viz-components/stats/update/index.d.ts +5 -0
  134. package/dist/plugins/viz-components/stats/viz-stats-panel.d.ts +3 -0
  135. package/dist/plugins/viz-components/stats/viz-stats.d.ts +3 -0
  136. package/dist/plugins/viz-components/sunburst/index.d.ts +2 -0
  137. package/dist/plugins/viz-components/sunburst/type.d.ts +5 -0
  138. package/dist/plugins/viz-components/sunburst/viz-sunburst-panel.d.ts +3 -0
  139. package/dist/plugins/viz-components/sunburst/viz-sunburst.d.ts +3 -0
  140. package/dist/plugins/viz-components/table/index.d.ts +1 -1
  141. package/dist/plugins/viz-components/table/triggers/click-cell-content.d.ts +11 -0
  142. package/dist/plugins/viz-components/table/triggers/index.d.ts +1 -0
  143. package/dist/plugins/viz-components/table/value.d.ts +3 -2
  144. package/dist/plugins/viz-components/table/viz-table-panel.d.ts +1 -1
  145. package/dist/plugins/viz-components/table/viz-table.d.ts +2 -2
  146. package/dist/plugins/viz-manager/components.d.ts +5 -5
  147. package/dist/plugins/viz-manager/impl.d.ts +3 -3
  148. package/dist/plugins/viz-manager/types.d.ts +3 -7
  149. package/dist/types/dashboard.d.ts +2 -2
  150. package/dist/types/index.d.ts +1 -0
  151. package/dist/types/plugin/index.d.ts +94 -8
  152. package/dist/types/utils.d.ts +4 -0
  153. package/dist/types/viz-panel.d.ts +1 -1
  154. package/dist/utils/aggregation.d.ts +9 -1
  155. package/dist/utils/download.d.ts +2 -2
  156. package/dist/utils/sql.d.ts +1 -1
  157. package/dist/utils/template/editor/index.d.ts +3 -0
  158. package/dist/utils/template/editor/template-input.d.ts +8 -0
  159. package/dist/utils/template/editor/utils.d.ts +2 -0
  160. package/dist/utils/template/editor/variable-field.d.ts +10 -0
  161. package/dist/utils/template/editor/variable-style.d.ts +8 -0
  162. package/dist/utils/template/index.d.ts +4 -0
  163. package/dist/utils/template/render/index.d.ts +2 -0
  164. package/dist/utils/template/{render.d.ts → render/render-jsx.d.ts} +1 -1
  165. package/dist/utils/template/render/render-string.d.ts +2 -0
  166. package/dist/utils/template/utils.d.ts +4 -0
  167. package/package.json +1 -1
  168. package/dist/filter/filter-query-field/select-data-source.d.ts +0 -8
  169. package/dist/panel/viz/bar-3d/index.d.ts +0 -9
  170. package/dist/panel/viz/bar-3d/panel.d.ts +0 -3
  171. package/dist/panel/viz/cartesian/index.d.ts +0 -10
  172. package/dist/panel/viz/cartesian/panel/index.d.ts +0 -3
  173. package/dist/panel/viz/cartesian/panel/regressions/index.d.ts +0 -11
  174. package/dist/panel/viz/cartesian/panel/series/index.d.ts +0 -11
  175. package/dist/panel/viz/pie/index.d.ts +0 -9
  176. package/dist/panel/viz/pie/panel.d.ts +0 -3
  177. package/dist/panel/viz/rich-text/index.d.ts +0 -10
  178. package/dist/panel/viz/rich-text/panel.d.ts +0 -3
  179. package/dist/panel/viz/rich-text/type.d.ts +0 -8
  180. package/dist/panel/viz/stats/index.d.ts +0 -10
  181. package/dist/panel/viz/stats/panel/index.d.ts +0 -10
  182. package/dist/panel/viz/stats/update/index.d.ts +0 -15
  183. package/dist/panel/viz/sunburst/index.d.ts +0 -9
  184. package/dist/panel/viz/sunburst/panel.d.ts +0 -3
  185. package/dist/utils/template/editor.d.ts +0 -16
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizConfigProps } from '~/types/plugin';
3
+ export declare function VizCartesianPanel({ context }: VizConfigProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { VizComponent } from '~/types/plugin';
2
+ export declare const PieChartVizComponent: VizComponent;
@@ -0,0 +1,5 @@
1
+ export interface IPieChartConf {
2
+ label_field: string;
3
+ value_field: string;
4
+ }
5
+ export declare const DEFAULT_CONFIG: IPieChartConf;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizConfigProps } from '~/types/plugin';
3
+ export declare function VizPieChartPanel({ context }: VizConfigProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizViewProps } from '~/types/plugin';
3
+ export declare function VizPieChart({ context }: VizViewProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { VizComponent } from '~/types/plugin';
2
+ export declare const RadarChartVizComponent: VizComponent;
@@ -0,0 +1,26 @@
1
+ import { IRadarChartConf } from '../type';
2
+ export declare function getOption(conf: IRadarChartConf, data: $TSFixMe[]): {
3
+ legend: {
4
+ show: boolean;
5
+ bottom: number;
6
+ left: number;
7
+ };
8
+ tooltip: {
9
+ trigger: string;
10
+ };
11
+ } & {
12
+ radar: {
13
+ indicator: {
14
+ name: string;
15
+ max: number;
16
+ color: string | undefined;
17
+ }[];
18
+ };
19
+ series: {
20
+ type: string;
21
+ data: {
22
+ value: any[];
23
+ name: any;
24
+ }[];
25
+ };
26
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { Control, UseFormWatch } from 'react-hook-form';
3
+ import { IRadarChartConf } from '../type';
4
+ interface IDimensionsField {
5
+ control: Control<IRadarChartConf, $TSFixMe>;
6
+ watch: UseFormWatch<IRadarChartConf>;
7
+ data: $TSFixMe[];
8
+ }
9
+ export declare function DimensionsField({ control, watch, data }: IDimensionsField): JSX.Element;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ export interface IRadarChartDimension {
2
+ name: string;
3
+ data_key: string;
4
+ max: number;
5
+ color?: string;
6
+ }
7
+ export interface IRadarChartConf {
8
+ series_name_key: string;
9
+ dimensions: IRadarChartDimension[];
10
+ }
11
+ export declare const DEFAULT_CONFIG: IRadarChartConf;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizConfigProps } from '~/types/plugin';
3
+ export declare function VizRadarChartPanel({ context }: VizConfigProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizViewProps } from '~/types/plugin';
3
+ export declare function VizRadarChart({ context }: VizViewProps): JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { VizComponent } from '~/types/plugin';
2
+ export declare const RegressionChartVizComponent: VizComponent;
@@ -0,0 +1,2 @@
1
+ import { IRegressionChartConf } from '../type';
2
+ export declare function getOption(conf: IRegressionChartConf, data: $TSFixMe[]): any;
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { IRegressionChartConf } from '../type';
3
+ export declare function getRegressionDescription(data: $TSFixMe[], conf?: IRegressionChartConf): {
4
+ expression: JSX.Element;
5
+ rSquared: any;
6
+ adjustedRSquared: number;
7
+ } | {
8
+ expression: string;
9
+ rSquared: any;
10
+ adjustedRSquared: number;
11
+ } | {
12
+ expression: string;
13
+ rSquared: number;
14
+ adjustedRSquared?: undefined;
15
+ };
@@ -0,0 +1,14 @@
1
+ import { IRegressionLineConf } from '../../cartesian/type';
2
+ import { IRegressionChartConf } from '../type';
3
+ interface IRegressionSeriesItem extends IRegressionLineConf {
4
+ data: number[][];
5
+ name: string;
6
+ showSymbol: boolean;
7
+ tooltip: Record<string, $TSFixMe>;
8
+ smooth: boolean;
9
+ }
10
+ export declare function getRegressionConf({ regression }: IRegressionChartConf, data: number[][]): {
11
+ regressionSeries: IRegressionSeriesItem[];
12
+ regressionXAxes: Record<string, any>[];
13
+ };
14
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * NOTE: this file is almost a duplicate of cartesian/panel/regressions/regression-item.tsx
3
+ * FIXME: extract common input widgets & configs, then improve this file
4
+ */
5
+ /// <reference types="react" />
6
+ import { Control, UseFormWatch } from 'react-hook-form';
7
+ import { IRegressionChartConf } from './type';
8
+ interface IRegressionField {
9
+ control: Control<IRegressionChartConf, $TSFixMe>;
10
+ watch: UseFormWatch<IRegressionChartConf>;
11
+ data: $TSFixMe[];
12
+ }
13
+ export declare function RegressionField({ control, watch, data }: IRegressionField): JSX.Element;
14
+ export {};
@@ -0,0 +1,12 @@
1
+ import { IRegressionConf } from '../cartesian/type';
2
+ export interface IRegressionChartConf {
3
+ x_axis: {
4
+ name: string;
5
+ data_key: string;
6
+ };
7
+ y_axis: {
8
+ name: string;
9
+ };
10
+ regression: IRegressionConf;
11
+ }
12
+ export declare const DEFAULT_CONFIG: IRegressionChartConf;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizConfigProps } from '~/types/plugin';
3
+ export declare function VizRegressionChartPanel({ context }: VizConfigProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizViewProps } from '~/types/plugin';
3
+ export declare function VizRegressionChart({ context }: VizViewProps): JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { Editor } from '@mantine/rte';
3
+ /**
4
+ * Sync external changes to the editor
5
+ * see also https://github.com/mantinedev/mantine/issues/1625#issuecomment-1154506482
6
+ * @param content
7
+ */
8
+ export declare function useSyncEditorContent(content?: string): import("react").RefObject<Editor>;
@@ -0,0 +1,2 @@
1
+ import { VizComponent } from '~/types/plugin';
2
+ export declare const RichTextVizComponent: VizComponent;
@@ -0,0 +1,4 @@
1
+ export interface IRichTextConf {
2
+ content: '';
3
+ }
4
+ export declare const DEFAULT_CONFIG: IRichTextConf;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizConfigProps } from '~/types/plugin';
3
+ export declare function VizRichTextPanel({ context }: VizConfigProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizViewProps } from '~/types/plugin';
3
+ export declare function VizRichText({ context }: VizViewProps): JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { VizComponent } from '~/types/plugin';
2
+ export declare const StatsVizComponent: VizComponent;
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { Control, UseFieldArrayRemove } from 'react-hook-form';
3
- import { IVizStatsConf } from '../types';
3
+ import { IVizStatsConf } from '../type';
4
4
  interface VariableField {
5
- control: Control<IVizStatsConf, any>;
5
+ control: Control<IVizStatsConf, $TSFixMe>;
6
6
  index: number;
7
7
  remove: UseFieldArrayRemove;
8
- data: any[];
8
+ data: $TSFixMe[];
9
9
  }
10
10
  export declare function VariableField({ control, index, remove, data }: VariableField): JSX.Element;
11
11
  export {};
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { Control, UseFormWatch } from 'react-hook-form';
3
- import { IVizStatsConf } from '../types';
3
+ import { IVizStatsConf } from '../type';
4
4
  interface IVariablesField {
5
- control: Control<IVizStatsConf, any>;
5
+ control: Control<IVizStatsConf, $TSFixMe>;
6
6
  watch: UseFormWatch<IVizStatsConf>;
7
- data: any[];
7
+ data: $TSFixMe[];
8
8
  }
9
9
  export declare function VariablesField({ control, watch, data }: IVariablesField): JSX.Element;
10
10
  export {};
@@ -1,4 +1,5 @@
1
- import { ITemplateVariable } from '../../../utils/template/types';
1
+ import { ITemplateVariable } from '~/utils/template';
2
+ export declare const DEFAULT_CONFIG: IVizStatsConf;
2
3
  export interface IVizStatsConf {
3
4
  align: 'center';
4
5
  template: string;
@@ -0,0 +1,5 @@
1
+ import { VersionBasedMigrator } from '~/plugins/plugin-data-migrator';
2
+ export declare class VizStatsMigrator extends VersionBasedMigrator {
3
+ readonly VERSION = 1;
4
+ configVersions(): void;
5
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizConfigProps } from '~/types/plugin';
3
+ export declare function VizStatsPanel({ context }: VizConfigProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizViewProps } from '~/types/plugin';
3
+ export declare function VizStats({ context }: VizViewProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { VizComponent } from '~/types/plugin';
2
+ export declare const SunburstVizComponent: VizComponent;
@@ -0,0 +1,5 @@
1
+ export interface ISunburstConf {
2
+ label_field: string;
3
+ value_field: string;
4
+ }
5
+ export declare const DEFAULT_CONFIG: ISunburstConf;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizConfigProps } from '~/types/plugin';
3
+ export declare function VizSunburstPanel({ context }: VizConfigProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizViewProps } from '~/types/plugin';
3
+ export declare function VizSunburst({ context }: VizViewProps): JSX.Element;
@@ -1,2 +1,2 @@
1
- import { VizComponent } from '../../../types/plugin';
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';
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ValueType } from './type';
3
3
  interface ICellValue {
4
- value: any;
4
+ value: $TSFixMe;
5
5
  type: ValueType;
6
+ onContentClick?: () => void;
6
7
  }
7
- export declare function CellValue({ value, type }: ICellValue): JSX.Element;
8
+ export declare function CellValue(props: ICellValue): JSX.Element;
8
9
  export {};
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { VizConfigProps } from '../../../types/plugin';
2
+ import { VizConfigProps } from '~/types/plugin';
3
3
  export declare function VizTablePanel({ context }: VizConfigProps): JSX.Element;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { VizViewProps } from '../../../types/plugin';
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 '../../types/plugin';
2
+ import { IPanelInfoEditor } from '~/types/plugin';
3
3
  import { IPanelInfo, IVizManager } from './types';
4
4
  export declare type IViewPanelInfo = IPanelInfo & {
5
5
  layout: {
@@ -7,16 +7,16 @@ 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
- data: any;
12
+ data: $TSFixMe;
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;
20
- data: any;
20
+ data: $TSFixMe;
21
21
  } & TDebug;
22
22
  export declare const VizConfigComponent: <T>(props: IConfigComponentProps<T>) => JSX.Element;
@@ -1,10 +1,10 @@
1
- import { IPluginManager, VizComponent } from '../../types/plugin';
2
- import { IPanelInfo, IVizManager, VizInstanceInfo } from './types';
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): VizInstanceInfo;
9
+ getOrCreateInstance(panel: IPanelInfo): VizInstance;
10
10
  }
@@ -1,12 +1,8 @@
1
- import { IDashboardPanel } from '../../types';
2
- import { IMessageChannels, PluginStorage, VizComponent, VizInstance } from '../../types/plugin';
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): VizInstanceInfo;
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: Record<string, any>;
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 {
@@ -1,3 +1,4 @@
1
1
  export * from './dashboard';
2
2
  export * from './filter';
3
3
  export * from './viz-panel';
4
+ export type { AnyObject, Ready } from './utils';
@@ -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 ColorPaletteItem {
31
+ export interface IColorPaletteItem {
25
32
  name: string;
26
33
  type: string;
27
34
  category: string;
28
35
  }
29
- export interface SingleColor extends ColorPaletteItem {
36
+ export interface ISingleColor extends IColorPaletteItem {
30
37
  type: 'single';
31
38
  value: string;
32
39
  }
33
- export interface ColorInterpolation extends ColorPaletteItem {
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: ColorPaletteItem): (value: unknown) => string;
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: string) => void;
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: ColorPaletteItem[];
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 {};
@@ -0,0 +1,4 @@
1
+ export declare type AnyObject = Record<string, $TSFixMe>;
2
+ export declare type Ready<T, TK extends keyof T> = T & {
3
+ [P in TK]-?: NonNullable<T[P]>;
4
+ };
@@ -2,5 +2,5 @@ import { IVizConfig } from './dashboard';
2
2
  export interface IVizPanelProps {
3
3
  conf: IVizConfig['conf'];
4
4
  setConf: (conf: IVizConfig['conf']) => void;
5
- data: any[];
5
+ data: $TSFixMe[];
6
6
  }
@@ -1,2 +1,10 @@
1
- export declare type AggregationType = 'none' | 'sum' | 'mean' | 'median' | 'max' | 'min';
1
+ export declare type AggregationType = {
2
+ type: 'none' | 'sum' | 'mean' | 'median' | 'max' | 'min';
3
+ config: Record<$TSFixMe, 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;
@@ -1,6 +1,6 @@
1
1
  export declare function downloadCSV(id: string, csv: string): void;
2
2
  export declare function downloadDataListAsZip(idDataList: Array<{
3
3
  id: string;
4
- data: any[];
4
+ data: $TSFixMe[];
5
5
  }>): void;
6
- export declare function makeCSV(data: any | any[]): string;
6
+ export declare function makeCSV(data: $TSFixMe | $TSFixMe[]): string;
@@ -2,7 +2,7 @@ import { FilterValuesType } from '../model';
2
2
  import { ContextInfoType } from '../model/context';
3
3
  import { SQLSnippetModelInstance } from '../model/sql-snippets';
4
4
  export declare function explainSQLSnippet(snippet: string, context: ContextInfoType): any;
5
- export declare function formatSQL(sql: string, params: Record<string, any>): any;
5
+ export declare function formatSQL(sql: string, params: Record<string, $TSFixMe>): any;
6
6
  export declare function getSQLParams(context: ContextInfoType, sqlSnippets: SQLSnippetModelInstance[], filterValues: FilterValuesType): Record<string, any> & ContextInfoType & {
7
7
  filters: FilterValuesType;
8
8
  };
@@ -0,0 +1,3 @@
1
+ export * from './template-input';
2
+ export * from './utils';
3
+ export * from './variable-field';