@vuu-ui/vuu-data-react 0.8.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/LICENSE +201 -0
- package/cjs/index.js +2 -0
- package/cjs/index.js.map +7 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +7 -0
- package/package.json +29 -0
- package/types/hooks/index.d.ts +6 -0
- package/types/hooks/useDataSource.d.ts +24 -0
- package/types/hooks/useServerConnectionQuality.d.ts +1 -0
- package/types/hooks/useServerConnectionStatus.d.ts +1 -0
- package/types/hooks/useTypeaheadSuggestions.d.ts +4 -0
- package/types/hooks/useVuuMenuActions.d.ts +48 -0
- package/types/hooks/useVuuTables.d.ts +2 -0
- package/types/index.d.ts +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vuu-ui/vuu-data-react",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"author": "heswell",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@vuu-ui/vuu-datagrid-types": "0.8.0",
|
|
8
|
+
"@vuu-ui/vuu-filter-types": "0.8.0",
|
|
9
|
+
"@vuu-ui/vuu-protocol-types": "0.8.0"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@vuu-ui/vuu-data": "0.8.0",
|
|
13
|
+
"@vuu-ui/vuu-data-types": "0.8.0",
|
|
14
|
+
"@vuu-ui/vuu-filters": "0.8.0",
|
|
15
|
+
"@vuu-ui/vuu-popups": "0.8.0",
|
|
16
|
+
"@vuu-ui/vuu-utils": "0.8.0"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"react": "^17.0.2"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"cjs",
|
|
23
|
+
"esm",
|
|
24
|
+
"/types"
|
|
25
|
+
],
|
|
26
|
+
"module": "esm/index.js",
|
|
27
|
+
"main": "cjs/index.js",
|
|
28
|
+
"types": "types/index.d.ts"
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DataSource } from "@vuu-ui/vuu-data";
|
|
2
|
+
import { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
3
|
+
import { VuuRange } from "@vuu-ui/vuu-protocol-types";
|
|
4
|
+
export interface DataSourceHookProps {
|
|
5
|
+
dataSource: DataSource;
|
|
6
|
+
renderBufferSize?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function useDataSource({ dataSource, renderBufferSize, }: DataSourceHookProps): [
|
|
9
|
+
DataSourceRow[],
|
|
10
|
+
number,
|
|
11
|
+
VuuRange,
|
|
12
|
+
(range: VuuRange) => void
|
|
13
|
+
];
|
|
14
|
+
export declare class MovingWindow {
|
|
15
|
+
data: DataSourceRow[];
|
|
16
|
+
rowCount: number;
|
|
17
|
+
private range;
|
|
18
|
+
constructor({ from, to }: VuuRange);
|
|
19
|
+
setRowCount: (rowCount: number) => void;
|
|
20
|
+
add(data: DataSourceRow): void;
|
|
21
|
+
getAtIndex(index: number): DataSourceRow | undefined;
|
|
22
|
+
isWithinRange(index: number): boolean;
|
|
23
|
+
setRange(from: number, to: number): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useServerConnectionQuality: () => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useServerConnectionStatus: () => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TypeaheadParams, VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
export type SuggestionFetcher = (params: TypeaheadParams) => Promise<string[]>;
|
|
3
|
+
export declare const getTypeaheadParams: (table: VuuTable, column: string, text?: string, selectedValues?: string[]) => TypeaheadParams;
|
|
4
|
+
export declare const useTypeaheadSuggestions: () => SuggestionFetcher;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DataSource, DataSourceMenusMessage, DataSourceVisualLinkCreatedMessage, DataSourceVisualLinkRemovedMessage, DataSourceVisualLinksMessage, MenuRpcResponse, VuuFeatureInvocationMessage, VuuFeatureMessage, VuuUIMessageInRPCEditReject, VuuUIMessageInRPCEditResponse } from "@vuu-ui/vuu-data";
|
|
2
|
+
import { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
3
|
+
import { GridAction } from "@vuu-ui/vuu-datagrid-types";
|
|
4
|
+
import { MenuBuilder } from "@vuu-ui/vuu-popups";
|
|
5
|
+
import { LinkDescriptorWithLabel, VuuMenu, VuuMenuItem, VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
6
|
+
import { ColumnMap } from "@vuu-ui/vuu-utils";
|
|
7
|
+
export declare const addRowsFromInstruments = "addRowsFromInstruments";
|
|
8
|
+
export interface VuuCellMenuItem extends VuuMenuItem {
|
|
9
|
+
rowKey: string;
|
|
10
|
+
field: string;
|
|
11
|
+
value: VuuRowDataItemType;
|
|
12
|
+
}
|
|
13
|
+
export interface VuuRowMenuItem extends VuuMenuItem {
|
|
14
|
+
rowKey: string;
|
|
15
|
+
row: {
|
|
16
|
+
[key: string]: VuuRowDataItemType;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare const isVisualLinksAction: (action: GridAction) => action is DataSourceVisualLinksMessage;
|
|
20
|
+
export declare const isVisualLinkCreatedAction: (action: GridAction) => action is DataSourceVisualLinkCreatedMessage;
|
|
21
|
+
export declare const isVisualLinkRemovedAction: (action: GridAction) => action is DataSourceVisualLinkRemovedMessage;
|
|
22
|
+
export declare const isViewportMenusAction: (action: GridAction) => action is DataSourceMenusMessage;
|
|
23
|
+
export declare const isVuuFeatureAction: (action: GridAction) => action is VuuFeatureMessage;
|
|
24
|
+
export declare const isVuuFeatureInvocation: (action: GridAction) => action is VuuFeatureInvocationMessage;
|
|
25
|
+
export interface ViewServerHookResult {
|
|
26
|
+
buildViewserverMenuOptions: MenuBuilder<TableMenuLocation, VuuServerMenuOptions>;
|
|
27
|
+
handleMenuAction: (type: string, options: unknown) => boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface MenuActionConfig {
|
|
30
|
+
vuuMenu?: VuuMenu;
|
|
31
|
+
visualLink?: DataSourceVisualLinkCreatedMessage;
|
|
32
|
+
visualLinks?: LinkDescriptorWithLabel[];
|
|
33
|
+
}
|
|
34
|
+
export interface VuuMenuActionHookProps {
|
|
35
|
+
dataSource: DataSource;
|
|
36
|
+
menuActionConfig?: MenuActionConfig;
|
|
37
|
+
onRpcResponse?: (response: MenuRpcResponse | VuuUIMessageInRPCEditReject | VuuUIMessageInRPCEditResponse) => void;
|
|
38
|
+
}
|
|
39
|
+
type TableMenuLocation = "grid" | "header" | "filter";
|
|
40
|
+
export type VuuServerMenuOptions = {
|
|
41
|
+
columnMap: ColumnMap;
|
|
42
|
+
columnName: string;
|
|
43
|
+
row: DataSourceRow;
|
|
44
|
+
selectedRows: DataSourceRow[];
|
|
45
|
+
viewport: string;
|
|
46
|
+
};
|
|
47
|
+
export declare const useVuuMenuActions: ({ dataSource, menuActionConfig, onRpcResponse, }: VuuMenuActionHookProps) => ViewServerHookResult;
|
|
48
|
+
export {};
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./hooks";
|