@devtable/dashboard 2.6.0 → 3.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.
- package/README.md +25 -1
- package/dist/dashboard.es.js +7490 -7207
- package/dist/dashboard.umd.js +22 -22
- package/dist/panel/plugin-adaptor.d.ts +7 -0
- package/dist/panel/viz/index.d.ts +1 -1
- package/dist/plugins/hooks/index.d.ts +2 -0
- package/dist/plugins/hooks/use-channel-event.d.ts +2 -0
- package/dist/plugins/hooks/use-storage-data.d.ts +6 -0
- package/dist/plugins/index.d.ts +4 -0
- package/dist/plugins/json-plugin-storage.d.ts +8 -4
- package/dist/plugins/message-channels.d.ts +0 -1
- package/dist/plugins/plugin-data-migrator/index.d.ts +1 -0
- package/dist/plugins/plugin-data-migrator/plugin-data-migrator.d.ts +13 -0
- package/dist/plugins/viz-components/table/index.d.ts +2 -0
- package/dist/{panel/viz → plugins/viz-components}/table/type.d.ts +1 -0
- package/dist/{panel/viz → plugins/viz-components}/table/value-type-selector.d.ts +0 -0
- package/dist/{panel/viz → plugins/viz-components}/table/value.d.ts +0 -0
- package/dist/plugins/viz-components/table/viz-table-panel.d.ts +3 -0
- package/dist/plugins/viz-components/table/viz-table.d.ts +3 -0
- package/dist/plugins/viz-manager/components.d.ts +1 -2
- package/dist/plugins/viz-manager/index.d.ts +1 -0
- package/dist/types/plugin/index.d.ts +9 -5
- package/package.json +10 -4
- package/dist/panel/viz/table/index.d.ts +0 -10
- package/dist/panel/viz/table/panel.d.ts +0 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IConfigComponentProps, IViewComponentProps } from '../plugins/viz-manager/components';
|
|
3
|
+
import { IVizConfig } from '../types';
|
|
4
|
+
export declare function PluginVizConfigComponent({ setVizConf, ...props }: IConfigComponentProps & {
|
|
5
|
+
setVizConf: (val: React.SetStateAction<IVizConfig>) => void;
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
export declare function PluginVizViewComponent(props: IViewComponentProps): JSX.Element;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { PluginStorage } from '../types/plugin';
|
|
2
2
|
export declare class JsonPluginStorage implements PluginStorage {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
protected rootRef: {
|
|
4
|
+
current: Record<string, any>;
|
|
5
|
+
};
|
|
6
|
+
constructor(initValue: Record<string, any>);
|
|
5
7
|
deleteItem(key: string): Promise<void>;
|
|
6
|
-
getItem<T>(key: string): Promise<T>;
|
|
7
|
-
|
|
8
|
+
getItem<T>(key: string | null): Promise<T>;
|
|
9
|
+
private getValueFromRoot;
|
|
10
|
+
setItem<T>(key: string | null, item: T): Promise<T>;
|
|
11
|
+
watchItem<T>(key: string | null, callback: (value: T, previous?: T) => void): () => void;
|
|
8
12
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './plugin-data-migrator';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface IMigration {
|
|
2
|
+
version: number;
|
|
3
|
+
handler: (data: any) => any;
|
|
4
|
+
}
|
|
5
|
+
export declare class PluginDataMigrator {
|
|
6
|
+
protected migrations: IMigration[];
|
|
7
|
+
version(version: number, handler: (data: any) => any): PluginDataMigrator;
|
|
8
|
+
run(migrationTarget: {
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
}, val: any): any;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
@@ -13,11 +13,10 @@ export declare type IViewComponentProps<TDebug = {}> = {
|
|
|
13
13
|
vizManager: IVizManager;
|
|
14
14
|
} & TDebug;
|
|
15
15
|
export declare const VizViewComponent: <T>(props: IViewComponentProps<T>) => JSX.Element;
|
|
16
|
-
declare type IConfigComponentProps<TDebug = {}> = {
|
|
16
|
+
export declare type IConfigComponentProps<TDebug = {}> = {
|
|
17
17
|
panel: IPanelInfo;
|
|
18
18
|
panelInfoEditor: IPanelInfoEditor;
|
|
19
19
|
vizManager: IVizManager;
|
|
20
20
|
data: any;
|
|
21
21
|
} & TDebug;
|
|
22
22
|
export declare const VizConfigComponent: <T>(props: IConfigComponentProps<T>) => JSX.Element;
|
|
23
|
-
export {};
|
|
@@ -6,6 +6,7 @@ import React from 'react';
|
|
|
6
6
|
export interface VizInstance {
|
|
7
7
|
id: string;
|
|
8
8
|
name: string;
|
|
9
|
+
type: string;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Props to render the view of viz component
|
|
@@ -15,9 +16,10 @@ export interface VizViewProps {
|
|
|
15
16
|
context: VizViewContext;
|
|
16
17
|
}
|
|
17
18
|
export interface PluginStorage {
|
|
18
|
-
getItem<T>(key: string): Promise<T>;
|
|
19
|
-
setItem<T>(key: string, item: T): Promise<T>;
|
|
19
|
+
getItem<T>(key: string | null): Promise<T>;
|
|
20
|
+
setItem<T>(key: string | null, item: T): Promise<T>;
|
|
20
21
|
deleteItem(key: string): Promise<void>;
|
|
22
|
+
watchItem<T>(key: string | null, callback: (value: T, previous?: T) => void): () => void;
|
|
21
23
|
}
|
|
22
24
|
export interface ColorPaletteItem {
|
|
23
25
|
name: string;
|
|
@@ -38,7 +40,6 @@ export interface ColorPalette {
|
|
|
38
40
|
export interface IMessageChannels {
|
|
39
41
|
globalChannel: EventEmitter2;
|
|
40
42
|
getChannel(name: string): EventEmitter2;
|
|
41
|
-
close(name: string): void;
|
|
42
43
|
}
|
|
43
44
|
export interface VizContext {
|
|
44
45
|
pluginData: PluginStorage;
|
|
@@ -68,7 +69,6 @@ export interface VizConfigProps {
|
|
|
68
69
|
context: VizConfigContext;
|
|
69
70
|
}
|
|
70
71
|
export interface VizComponentMigrationContext {
|
|
71
|
-
pluginData: PluginStorage;
|
|
72
72
|
instanceData: PluginStorage;
|
|
73
73
|
}
|
|
74
74
|
export interface VizComponent {
|
|
@@ -76,7 +76,11 @@ export interface VizComponent {
|
|
|
76
76
|
displayName?: string;
|
|
77
77
|
viewRender: React.ComponentType<VizViewProps>;
|
|
78
78
|
configRender: React.ComponentType<VizConfigProps>;
|
|
79
|
-
|
|
79
|
+
migrator: IVizComponentMigrator;
|
|
80
|
+
}
|
|
81
|
+
export interface IVizComponentMigrator {
|
|
82
|
+
needMigration(ctx: VizComponentMigrationContext): Promise<boolean>;
|
|
83
|
+
migrate(ctx: VizComponentMigrationContext): Promise<void>;
|
|
80
84
|
}
|
|
81
85
|
export interface IPluginManifest {
|
|
82
86
|
viz: VizComponent[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devtable/dashboard",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"eventemitter2": "^6.4.6",
|
|
34
34
|
"file-saver": "2.0.5",
|
|
35
|
-
"stickybits": "3.7.11",
|
|
36
35
|
"jszip": "3.10.1",
|
|
37
|
-
"popmotion": "^11.0.3"
|
|
36
|
+
"popmotion": "^11.0.3",
|
|
37
|
+
"stickybits": "3.7.11"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@mantine/core": "^5.0.2",
|
|
@@ -45,10 +45,13 @@
|
|
|
45
45
|
"@mantine/notifications": "^5.0.2",
|
|
46
46
|
"@mantine/prism": "^5.0.2",
|
|
47
47
|
"@mantine/rte": "^5.0.2",
|
|
48
|
+
"@testing-library/cypress": "^8.0.3",
|
|
48
49
|
"@testing-library/jest-dom": "^5.16.4",
|
|
49
50
|
"@testing-library/react": "^13.3.0",
|
|
50
51
|
"@testing-library/react-hooks": "^8.0.1",
|
|
51
52
|
"@testing-library/user-event": "^14.3.0",
|
|
53
|
+
"@types/d3-array": "3.0.3",
|
|
54
|
+
"@types/eventemitter2": "^4.1.0",
|
|
52
55
|
"@types/file-saver": "2.0.5",
|
|
53
56
|
"@types/lodash": "^4.14.182",
|
|
54
57
|
"@types/react": "^18.0.0",
|
|
@@ -58,11 +61,13 @@
|
|
|
58
61
|
"@vitest/ui": "^0.19.1",
|
|
59
62
|
"ahooks": "^3.3.11",
|
|
60
63
|
"axios": "^0.27.2",
|
|
64
|
+
"cypress": "^10.6.0",
|
|
61
65
|
"echarts": "^5.3.2",
|
|
62
66
|
"echarts-for-react": "^3.0.2",
|
|
63
67
|
"echarts-gl": "^2.0.9",
|
|
64
68
|
"echarts-stat": "1.2.0",
|
|
65
69
|
"jsdom": "^20.0.0",
|
|
70
|
+
"jsdom-testing-mocks": "^1.5.0",
|
|
66
71
|
"lodash": "^4.17.21",
|
|
67
72
|
"numbro": "^2.3.6",
|
|
68
73
|
"react-grid-layout": "^1.3.4",
|
|
@@ -72,7 +77,7 @@
|
|
|
72
77
|
"typescript": "^4.6.3",
|
|
73
78
|
"vite": "^3.0.3",
|
|
74
79
|
"vite-plugin-dts": "^1.1.1",
|
|
75
|
-
"vitest": "^0.
|
|
80
|
+
"vitest": "^0.21.1"
|
|
76
81
|
},
|
|
77
82
|
"peerDependencies": {
|
|
78
83
|
"@emotion/react": "11.10.0",
|
|
@@ -86,6 +91,7 @@
|
|
|
86
91
|
"@mantine/rte": "^5.0.2",
|
|
87
92
|
"ahooks": "^3.3.11",
|
|
88
93
|
"axios": "^0.27.2",
|
|
94
|
+
"d3-array": "3.2.0",
|
|
89
95
|
"echarts": "^5.3.2",
|
|
90
96
|
"echarts-for-react": "^3.0.2",
|
|
91
97
|
"echarts-gl": "^2.0.9",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ITableConf } from './type';
|
|
3
|
-
interface IVizTable {
|
|
4
|
-
conf: ITableConf;
|
|
5
|
-
data: any;
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function VizTable({ conf, data, width, height }: IVizTable): JSX.Element;
|
|
10
|
-
export {};
|