@vuu-ui/vuu-utils 0.8.76 → 0.8.77
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/cjs/ShellContext.js +13 -0
- package/cjs/ShellContext.js.map +1 -0
- package/cjs/ThemeProvider.js +6 -6
- package/cjs/component-registry.js +0 -9
- package/cjs/component-registry.js.map +1 -1
- package/cjs/context-definitions/WorkspaceContext.js +20 -0
- package/cjs/context-definitions/WorkspaceContext.js.map +1 -0
- package/cjs/index.js +6 -0
- package/cjs/index.js.map +1 -1
- package/cjs/react-utils.js +4 -4
- package/cjs/useId.js +2 -2
- package/cjs/useLayoutEffectSkipFirst.js +3 -3
- package/esm/ShellContext.js +10 -0
- package/esm/ShellContext.js.map +1 -0
- package/esm/component-registry.js +0 -9
- package/esm/component-registry.js.map +1 -1
- package/esm/context-definitions/WorkspaceContext.js +17 -0
- package/esm/context-definitions/WorkspaceContext.js.map +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -1
- package/package.json +6 -6
- package/types/vuu-shell/src/ShellContextProvider.d.ts +10 -0
- package/types/vuu-shell/src/app-header/AppHeader.d.ts +6 -0
- package/types/vuu-shell/src/app-header/index.d.ts +1 -0
- package/types/vuu-shell/src/application-provider/ApplicationContext.d.ts +12 -0
- package/types/vuu-shell/src/application-provider/ApplicationProvider.d.ts +19 -0
- package/types/vuu-shell/src/application-provider/index.d.ts +1 -0
- package/types/vuu-shell/src/connection-status/ConnectionStatusIndicator.d.ts +10 -0
- package/types/vuu-shell/src/connection-status/index.d.ts +1 -0
- package/types/vuu-shell/src/datasource-provider/DataSourceProvider.d.ts +21 -0
- package/types/vuu-shell/src/datasource-provider/index.d.ts +1 -0
- package/types/vuu-shell/src/feature/Feature.d.ts +26 -0
- package/types/vuu-shell/src/feature/FeatureErrorBoundary.d.ts +13 -0
- package/types/vuu-shell/src/feature/Loader.d.ts +2 -0
- package/types/vuu-shell/src/feature/index.d.ts +1 -0
- package/types/vuu-shell/src/feature-list/FeatureList.d.ts +7 -0
- package/types/vuu-shell/src/feature-list/index.d.ts +1 -0
- package/types/vuu-shell/src/feature-provider/FeatureProvider.d.ts +14 -0
- package/types/vuu-shell/src/feature-provider/index.d.ts +2 -0
- package/types/vuu-shell/src/feature-provider/useVuuFeatures.d.ts +9 -0
- package/types/vuu-shell/src/index.d.ts +16 -0
- package/types/vuu-shell/src/left-nav/LeftNav.d.ts +18 -0
- package/types/vuu-shell/src/left-nav/index.d.ts +1 -0
- package/types/vuu-shell/src/login/LoginPanel.d.ts +7 -0
- package/types/vuu-shell/src/login/VuuLogo.d.ts +2 -0
- package/types/vuu-shell/src/login/index.d.ts +2 -0
- package/types/vuu-shell/src/login/login-utils.d.ts +4 -0
- package/types/vuu-shell/src/persistence-manager/LocalPersistenceManager.d.ts +21 -0
- package/types/vuu-shell/src/persistence-manager/PersistenceManager.d.ts +66 -0
- package/types/vuu-shell/src/persistence-manager/PersistenceProvider.d.ts +11 -0
- package/types/vuu-shell/src/persistence-manager/RemotePersistenceManager.d.ts +23 -0
- package/types/vuu-shell/src/persistence-manager/StaticPersistenceManager.d.ts +21 -0
- package/types/vuu-shell/src/persistence-manager/index.d.ts +5 -0
- package/types/vuu-shell/src/shell-layout-templates/context-panel/ContextPanel.d.ts +11 -0
- package/types/vuu-shell/src/shell-layout-templates/context-panel/index.d.ts +1 -0
- package/types/vuu-shell/src/shell-layout-templates/full-height-left-panel/useFullHeightLeftPanel.d.ts +2 -0
- package/types/vuu-shell/src/shell-layout-templates/index.d.ts +3 -0
- package/types/vuu-shell/src/shell-layout-templates/inlay-left-panel/useInlayLeftPanel.d.ts +2 -0
- package/types/vuu-shell/src/shell-layout-templates/side-panel/SidePanel.d.ts +8 -0
- package/types/vuu-shell/src/shell-layout-templates/side-panel/index.d.ts +1 -0
- package/types/vuu-shell/src/shell-layout-templates/simple-content-pane/useSimpleContentPane.d.ts +2 -0
- package/types/vuu-shell/src/shell-layout-templates/useShellLayout.d.ts +41 -0
- package/types/vuu-shell/src/shell.d.ts +15 -0
- package/types/vuu-shell/src/theme-switch/ThemeSwitch.d.ts +8 -0
- package/types/vuu-shell/src/theme-switch/index.d.ts +1 -0
- package/types/vuu-shell/src/user-settings/SettingsForm.d.ts +47 -0
- package/types/vuu-shell/src/user-settings/UserSettingsPanel.d.ts +3 -0
- package/types/vuu-shell/src/user-settings/index.d.ts +2 -0
- package/types/vuu-shell/src/workspace-management/LayoutList.d.ts +2 -0
- package/types/vuu-shell/src/workspace-management/LayoutTile.d.ts +7 -0
- package/types/vuu-shell/src/workspace-management/SaveLayoutPanel.d.ts +10 -0
- package/types/vuu-shell/src/workspace-management/WorkspaceProvider.d.ts +53 -0
- package/types/vuu-shell/src/workspace-management/defaultWorkspaceJSON.d.ts +9 -0
- package/types/vuu-shell/src/workspace-management/index.d.ts +5 -0
- package/types/vuu-shell/src/workspace-management/screenshot-utils.d.ts +6 -0
- package/types/vuu-shell/src/workspace-management/useWorkspaceContextMenuItems.d.ts +5 -0
- package/types/vuu-utils/src/ShellContext.d.ts +12 -0
- package/types/vuu-utils/src/context-definitions/WorkspaceContext.d.ts +17 -0
- package/types/{index.d.ts → vuu-utils/src/index.d.ts} +4 -0
- package/types/{json-types.d.ts → vuu-utils/src/json-types.d.ts} +1 -1
- package/types/vuu-utils/src/layout-types.d.ts +19 -0
- /package/types/{DataWindow.d.ts → vuu-utils/src/DataWindow.d.ts} +0 -0
- /package/types/{ThemeProvider.d.ts → vuu-utils/src/ThemeProvider.d.ts} +0 -0
- /package/types/{array-utils.d.ts → vuu-utils/src/array-utils.d.ts} +0 -0
- /package/types/{box-utils.d.ts → vuu-utils/src/box-utils.d.ts} +0 -0
- /package/types/{broadcast-channel.d.ts → vuu-utils/src/broadcast-channel.d.ts} +0 -0
- /package/types/{column-utils.d.ts → vuu-utils/src/column-utils.d.ts} +0 -0
- /package/types/{common-types.d.ts → vuu-utils/src/common-types.d.ts} +0 -0
- /package/types/{component-registry.d.ts → vuu-utils/src/component-registry.d.ts} +0 -0
- /package/types/{cookie-utils.d.ts → vuu-utils/src/cookie-utils.d.ts} +0 -0
- /package/types/{css-utils.d.ts → vuu-utils/src/css-utils.d.ts} +0 -0
- /package/types/{data-utils.d.ts → vuu-utils/src/data-utils.d.ts} +0 -0
- /package/types/{datasource-action-utils.d.ts → vuu-utils/src/datasource-action-utils.d.ts} +0 -0
- /package/types/{datasource-utils.d.ts → vuu-utils/src/datasource-utils.d.ts} +0 -0
- /package/types/{date → vuu-utils/src/date}/date-utils.d.ts +0 -0
- /package/types/{date → vuu-utils/src/date}/dateTimePattern.d.ts +0 -0
- /package/types/{date → vuu-utils/src/date}/formatter.d.ts +0 -0
- /package/types/{date → vuu-utils/src/date}/index.d.ts +0 -0
- /package/types/{date → vuu-utils/src/date}/types.d.ts +0 -0
- /package/types/{debug-utils.d.ts → vuu-utils/src/debug-utils.d.ts} +0 -0
- /package/types/{event-emitter.d.ts → vuu-utils/src/event-emitter.d.ts} +0 -0
- /package/types/{feature-utils.d.ts → vuu-utils/src/feature-utils.d.ts} +0 -0
- /package/types/{filters → vuu-utils/src/filters}/filterAsQuery.d.ts +0 -0
- /package/types/{filters → vuu-utils/src/filters}/index.d.ts +0 -0
- /package/types/{filters → vuu-utils/src/filters}/utils.d.ts +0 -0
- /package/types/{form-utils.d.ts → vuu-utils/src/form-utils.d.ts} +0 -0
- /package/types/{formatting-utils.d.ts → vuu-utils/src/formatting-utils.d.ts} +0 -0
- /package/types/{getUniqueId.d.ts → vuu-utils/src/getUniqueId.d.ts} +0 -0
- /package/types/{group-utils.d.ts → vuu-utils/src/group-utils.d.ts} +0 -0
- /package/types/{html-utils.d.ts → vuu-utils/src/html-utils.d.ts} +0 -0
- /package/types/{input-utils.d.ts → vuu-utils/src/input-utils.d.ts} +0 -0
- /package/types/{invariant.d.ts → vuu-utils/src/invariant.d.ts} +0 -0
- /package/types/{itemToString.d.ts → vuu-utils/src/itemToString.d.ts} +0 -0
- /package/types/{json-utils.d.ts → vuu-utils/src/json-utils.d.ts} +0 -0
- /package/types/{keyboard-utils.d.ts → vuu-utils/src/keyboard-utils.d.ts} +0 -0
- /package/types/{keyset.d.ts → vuu-utils/src/keyset.d.ts} +0 -0
- /package/types/{list-utils.d.ts → vuu-utils/src/list-utils.d.ts} +0 -0
- /package/types/{local-storage-utils.d.ts → vuu-utils/src/local-storage-utils.d.ts} +0 -0
- /package/types/{logging-utils.d.ts → vuu-utils/src/logging-utils.d.ts} +0 -0
- /package/types/{menu-utils.d.ts → vuu-utils/src/menu-utils.d.ts} +0 -0
- /package/types/{module-utils.d.ts → vuu-utils/src/module-utils.d.ts} +0 -0
- /package/types/{nanoid → vuu-utils/src/nanoid}/index.d.ts +0 -0
- /package/types/{perf-utils.d.ts → vuu-utils/src/perf-utils.d.ts} +0 -0
- /package/types/{protocol-message-utils.d.ts → vuu-utils/src/protocol-message-utils.d.ts} +0 -0
- /package/types/{range-utils.d.ts → vuu-utils/src/range-utils.d.ts} +0 -0
- /package/types/{react-utils.d.ts → vuu-utils/src/react-utils.d.ts} +0 -0
- /package/types/{round-decimal.d.ts → vuu-utils/src/round-decimal.d.ts} +0 -0
- /package/types/{row-utils.d.ts → vuu-utils/src/row-utils.d.ts} +0 -0
- /package/types/{selection-utils.d.ts → vuu-utils/src/selection-utils.d.ts} +0 -0
- /package/types/{shell-layout-types.d.ts → vuu-utils/src/shell-layout-types.d.ts} +0 -0
- /package/types/{sort-utils.d.ts → vuu-utils/src/sort-utils.d.ts} +0 -0
- /package/types/{table-schema-utils.d.ts → vuu-utils/src/table-schema-utils.d.ts} +0 -0
- /package/types/{text-utils.d.ts → vuu-utils/src/text-utils.d.ts} +0 -0
- /package/types/{ts-utils.d.ts → vuu-utils/src/ts-utils.d.ts} +0 -0
- /package/types/{url-utils.d.ts → vuu-utils/src/url-utils.d.ts} +0 -0
- /package/types/{useId.d.ts → vuu-utils/src/useId.d.ts} +0 -0
- /package/types/{useLayoutEffectSkipFirst.d.ts → vuu-utils/src/useLayoutEffectSkipFirst.d.ts} +0 -0
- /package/types/{user-types.d.ts → vuu-utils/src/user-types.d.ts} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Features, FilterTableFeatureProps } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { FeatureProps } from "../feature/Feature";
|
|
3
|
+
export interface FeaturesHookProps {
|
|
4
|
+
features: Features;
|
|
5
|
+
}
|
|
6
|
+
export declare const useVuuFeatures: ({ features, }: FeaturesHookProps) => [
|
|
7
|
+
FeatureProps[],
|
|
8
|
+
FeatureProps<FilterTableFeatureProps>[]
|
|
9
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./application-provider";
|
|
2
|
+
export * from "./app-header";
|
|
3
|
+
export * from "./connection-status";
|
|
4
|
+
export * from "./datasource-provider";
|
|
5
|
+
export * from "./feature";
|
|
6
|
+
export * from "./feature-provider";
|
|
7
|
+
export * from "./left-nav";
|
|
8
|
+
export * from "./login";
|
|
9
|
+
export * from "./persistence-manager";
|
|
10
|
+
export * from "./shell";
|
|
11
|
+
export * from "./shell-layout-templates";
|
|
12
|
+
export * from "./ShellContextProvider";
|
|
13
|
+
export * from "./feature-list";
|
|
14
|
+
export * from "./theme-switch";
|
|
15
|
+
export * from "./user-settings";
|
|
16
|
+
export * from "./workspace-management";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FilterTableFeatureProps } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
import { FeatureProps } from "../feature";
|
|
4
|
+
export type NavDisplayStatus = "menu-full" | "menu-icons" | "menu-full-content" | "menu-icons-content";
|
|
5
|
+
export type NavDisplayStatusHandler = (navDisplayStatus: NavDisplayStatus) => void;
|
|
6
|
+
export interface LeftNavProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
"data-path"?: string;
|
|
8
|
+
defaultActiveTabIndex?: number;
|
|
9
|
+
defaultExpanded?: boolean;
|
|
10
|
+
features?: FeatureProps[];
|
|
11
|
+
onActiveChange?: (activeTabIndex: number) => void;
|
|
12
|
+
onTogglePrimaryMenu?: (expanded: boolean) => void;
|
|
13
|
+
sizeCollapsed?: number;
|
|
14
|
+
sizeContent?: number;
|
|
15
|
+
sizeExpanded?: number;
|
|
16
|
+
tableFeatures?: FeatureProps<FilterTableFeatureProps>[];
|
|
17
|
+
}
|
|
18
|
+
export declare const LeftNav: (props: LeftNavProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LeftNav";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export interface LoginPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSubmit"> {
|
|
3
|
+
appName?: string;
|
|
4
|
+
onSubmit: (username: string, password?: string) => void;
|
|
5
|
+
requirePassword?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const LoginPanel: ({ appName, className, requirePassword, onSubmit, ...htmlAttributes }: LoginPanelProps) => JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApplicationJSON, LayoutJSON, Settings, Layout, LayoutMetadata, LayoutMetadataDto } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { IPersistenceManager } from "./PersistenceManager";
|
|
3
|
+
export declare class LocalPersistenceManager implements IPersistenceManager {
|
|
4
|
+
#private;
|
|
5
|
+
metadataSaveLocation: string;
|
|
6
|
+
layoutsSaveLocation: string;
|
|
7
|
+
constructor(urlKey?: string);
|
|
8
|
+
createLayout(metadata: LayoutMetadataDto, layout: LayoutJSON): Promise<LayoutMetadata>;
|
|
9
|
+
updateLayout(id: string, newMetadata: LayoutMetadataDto, newLayout: LayoutJSON): Promise<void>;
|
|
10
|
+
deleteLayout(id: string): Promise<void>;
|
|
11
|
+
loadLayout(id: string): Promise<LayoutJSON>;
|
|
12
|
+
loadMetadata(): Promise<LayoutMetadata[]>;
|
|
13
|
+
loadApplicationJSON(): Promise<ApplicationJSON | undefined>;
|
|
14
|
+
saveApplicationJSON(applicationJSON: ApplicationJSON): Promise<void>;
|
|
15
|
+
loadLayouts: () => Promise<Layout[]>;
|
|
16
|
+
saveLayoutsWithMetadata: (layouts: Layout[], metadata: LayoutMetadata[]) => void;
|
|
17
|
+
validateIds: (id: string) => Promise<void>;
|
|
18
|
+
validateId: (id: string, dataType: "metadata" | "layout") => Promise<void>;
|
|
19
|
+
getUserSettings(): Promise<Settings>;
|
|
20
|
+
saveUserSettings(userSettings: Settings): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ApplicationJSON, LayoutJSON, LayoutMetadata, LayoutMetadataDto, Settings } from "@vuu-ui/vuu-utils";
|
|
2
|
+
export interface IPersistenceManager {
|
|
3
|
+
/**
|
|
4
|
+
* Saves a new layout and its corresponding metadata
|
|
5
|
+
*
|
|
6
|
+
* @param metadata - Metadata about the layout to be saved
|
|
7
|
+
* @param layout - Full JSON representation of the layout to be saved
|
|
8
|
+
*
|
|
9
|
+
* @returns Unique identifier assigned to the saved layout
|
|
10
|
+
*/
|
|
11
|
+
createLayout: (metadata: LayoutMetadataDto, layout: LayoutJSON) => Promise<LayoutMetadata>;
|
|
12
|
+
/**
|
|
13
|
+
* Overwrites an existing layout and its corresponding metadata with the provided information
|
|
14
|
+
*
|
|
15
|
+
* @param id - Unique identifier of the existing layout to be updated
|
|
16
|
+
* @param metadata - Metadata describing the new layout to overwrite with
|
|
17
|
+
* @param layout - Full JSON representation of the new layout to overwrite with
|
|
18
|
+
*/
|
|
19
|
+
updateLayout: (id: string, metadata: LayoutMetadataDto, layout: LayoutJSON) => Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Deletes an existing layout and its corresponding metadata
|
|
22
|
+
*
|
|
23
|
+
* @param id - Unique identifier of the existing layout to be deleted
|
|
24
|
+
*/
|
|
25
|
+
deleteLayout: (id: string) => Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves an existing layout
|
|
28
|
+
*
|
|
29
|
+
* @param id - Unique identifier of the existing layout to be retrieved
|
|
30
|
+
*
|
|
31
|
+
* @returns Full JSON representation of the layout corresponding to the provided ID
|
|
32
|
+
*/
|
|
33
|
+
loadLayout: (id: string) => Promise<LayoutJSON>;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves metadata for all existing layouts
|
|
36
|
+
*
|
|
37
|
+
* @returns an array of all persisted layout metadata
|
|
38
|
+
*/
|
|
39
|
+
loadMetadata: () => Promise<LayoutMetadata[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves the application JSON. This includes the application layout,
|
|
42
|
+
* which describes all layouts on screen
|
|
43
|
+
*
|
|
44
|
+
* @returns Full JSON representation of the application json
|
|
45
|
+
*/
|
|
46
|
+
loadApplicationJSON: () => Promise<ApplicationJSON | undefined>;
|
|
47
|
+
/**
|
|
48
|
+
* Saves the application JSON. This includes the application layout,
|
|
49
|
+
* which describes all layouts on screen
|
|
50
|
+
*
|
|
51
|
+
* @param layout - Full JSON representation of the application layout to be saved
|
|
52
|
+
*/
|
|
53
|
+
saveApplicationJSON: (layout: ApplicationJSON) => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Save user settings. These get saved within the Application JSON.
|
|
56
|
+
*
|
|
57
|
+
* @param userSettings
|
|
58
|
+
*/
|
|
59
|
+
saveUserSettings: (userSettings: Settings) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Get the user settings. These are stored within Application JSON.
|
|
62
|
+
*
|
|
63
|
+
* @returns userSettings
|
|
64
|
+
*/
|
|
65
|
+
getUserSettings: () => Promise<Settings>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
import { IPersistenceManager } from ".";
|
|
3
|
+
export interface PersistenceContextProps {
|
|
4
|
+
persistenceManager?: IPersistenceManager;
|
|
5
|
+
}
|
|
6
|
+
export declare const PersistenceContext: import("react").Context<PersistenceContextProps>;
|
|
7
|
+
export interface PersistenceProviderProps extends PersistenceContextProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const PersistenceProvider: ({ children, persistenceManager, }: PersistenceProviderProps) => ReactElement;
|
|
11
|
+
export declare const usePersistenceManager: () => IPersistenceManager | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ApplicationJSON, LayoutJSON, LayoutMetadata, LayoutMetadataDto, Settings } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { IPersistenceManager } from "./PersistenceManager";
|
|
3
|
+
export type CreateLayoutResponseDto = {
|
|
4
|
+
metadata: LayoutMetadata;
|
|
5
|
+
};
|
|
6
|
+
export type GetLayoutResponseDto = {
|
|
7
|
+
definition: LayoutJSON;
|
|
8
|
+
};
|
|
9
|
+
export type GetApplicationResponseDto = {
|
|
10
|
+
definition: ApplicationJSON;
|
|
11
|
+
};
|
|
12
|
+
export declare class RemotePersistenceManager implements IPersistenceManager {
|
|
13
|
+
username: string;
|
|
14
|
+
createLayout(metadata: LayoutMetadataDto, layout: LayoutJSON): Promise<LayoutMetadata>;
|
|
15
|
+
updateLayout(id: string, metadata: LayoutMetadataDto, newLayoutJson: LayoutJSON): Promise<void>;
|
|
16
|
+
deleteLayout(id: string): Promise<void>;
|
|
17
|
+
loadLayout(id: string): Promise<LayoutJSON>;
|
|
18
|
+
loadMetadata(): Promise<LayoutMetadata[]>;
|
|
19
|
+
saveApplicationJSON(applicationJSON: ApplicationJSON): Promise<void>;
|
|
20
|
+
loadApplicationJSON(): Promise<ApplicationJSON>;
|
|
21
|
+
getUserSettings(): Promise<{}>;
|
|
22
|
+
saveUserSettings(userSettings: Settings): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApplicationJSON, LayoutJSON, LayoutMetadata, Settings } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { IPersistenceManager } from "./PersistenceManager";
|
|
3
|
+
export declare class StaticPersistenceManager implements IPersistenceManager {
|
|
4
|
+
#private;
|
|
5
|
+
constructor({ applicationJSON, applicationLoadDelay, layoutMetadata, }: {
|
|
6
|
+
applicationJSON?: ApplicationJSON;
|
|
7
|
+
applicationLoadDelay?: number;
|
|
8
|
+
layoutMetadata?: LayoutMetadata[];
|
|
9
|
+
});
|
|
10
|
+
createLayout(): Promise<LayoutMetadata>;
|
|
11
|
+
updateLayout(): Promise<void>;
|
|
12
|
+
deleteLayout(): Promise<void>;
|
|
13
|
+
loadLayout(id: string): Promise<LayoutJSON<{
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}>>;
|
|
16
|
+
loadMetadata(): Promise<LayoutMetadata[]>;
|
|
17
|
+
loadApplicationJSON(): Promise<ApplicationJSON | undefined>;
|
|
18
|
+
saveApplicationJSON(applicationJson: ApplicationJSON): Promise<void>;
|
|
19
|
+
getUserSettings(): Promise<Settings>;
|
|
20
|
+
saveUserSettings(userSettings: Settings): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
3
|
+
export interface ContextPanelProps {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
className?: string;
|
|
6
|
+
content?: LayoutJSON;
|
|
7
|
+
expanded?: boolean;
|
|
8
|
+
id?: string;
|
|
9
|
+
overlay?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const ContextPanel: ({ className: classNameProp, expanded, content: contentProp, id, overlay, title, }: ContextPanelProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ContextPanel";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export interface SidePanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
path?: string;
|
|
5
|
+
sizeOpen?: number;
|
|
6
|
+
sizeClosed?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const SidePanel: ({ children, open, sizeClosed, sizeOpen, style: styleProp, ...htmlAttributes }: SidePanelProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SidePanel";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { SidePanelProps } from "./side-panel";
|
|
3
|
+
declare const LayoutHook: {
|
|
4
|
+
"full-height": ShellLayoutTemplateHook;
|
|
5
|
+
inlay: ShellLayoutTemplateHook;
|
|
6
|
+
"simple-content-pane": ShellLayoutTemplateHook;
|
|
7
|
+
};
|
|
8
|
+
export type LayoutTemplateId = keyof typeof LayoutHook;
|
|
9
|
+
export type ShellLayoutTemplateProps = Omit<ShellLayoutProps, "layoutTemplateId">;
|
|
10
|
+
export type ShellLayoutTemplateHook = (props: ShellLayoutTemplateProps) => ReactElement;
|
|
11
|
+
/**
|
|
12
|
+
* The Shell Layout is the outermost 'chrome' of the appliciation,
|
|
13
|
+
* enclosing the main content area. It will be rendered by one of
|
|
14
|
+
* two available templates, determined by the layoutTemplateId,
|
|
15
|
+
*/
|
|
16
|
+
export interface ShellLayoutProps {
|
|
17
|
+
/**
|
|
18
|
+
* App Header will be rendered in position determined by layout-template
|
|
19
|
+
*/
|
|
20
|
+
appHeader?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* HTML attributes that will be applied to root div.
|
|
23
|
+
*/
|
|
24
|
+
htmlAttributes?: HTMLAttributes<HTMLDivElement>;
|
|
25
|
+
/**
|
|
26
|
+
* identifier for shell layout template to be used. Default template
|
|
27
|
+
* will be "inlay"
|
|
28
|
+
*/
|
|
29
|
+
layoutTemplateId?: LayoutTemplateId;
|
|
30
|
+
/**
|
|
31
|
+
* If template renders SidePanel, these props will be provided
|
|
32
|
+
*/
|
|
33
|
+
LeftSidePanelProps?: SidePanelProps;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* This hook acts as a stub for the actual shell layout
|
|
37
|
+
* template hooks. It will delegate to the appropriate shell
|
|
38
|
+
* layout hook, based on the value of layoutTemplateId.
|
|
39
|
+
*/
|
|
40
|
+
export declare const useShellLayout: ({ layoutTemplateId, ...props }: ShellLayoutProps) => ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VuuUser } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
3
|
+
import { ShellLayoutProps } from "./shell-layout-templates";
|
|
4
|
+
import { WorkspaceProps } from "./workspace-management";
|
|
5
|
+
export type LayoutTemplateName = "full-height" | "inlay";
|
|
6
|
+
export interface ShellProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
shellLayoutProps?: ShellLayoutProps;
|
|
8
|
+
workspaceProps?: WorkspaceProps;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
loginUrl?: string;
|
|
11
|
+
saveUrl?: string;
|
|
12
|
+
serverUrl?: string;
|
|
13
|
+
user: VuuUser;
|
|
14
|
+
}
|
|
15
|
+
export declare const Shell: ({ loginUrl, user, workspaceProps, ...props }: ShellProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { ThemeMode } from "@vuu-ui/vuu-utils";
|
|
3
|
+
export interface ThemeSwitchProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
4
|
+
defaultMode?: ThemeMode;
|
|
5
|
+
mode?: ThemeMode;
|
|
6
|
+
onChange: (mode: ThemeMode) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const ThemeSwitch: ({ className: classNameProp, defaultMode: defaultModeProp, mode: modeProp, onChange, ...htmlAttributes }: ThemeSwitchProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ThemeSwitch";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import { Settings } from "@vuu-ui/vuu-utils";
|
|
3
|
+
import { DropdownProps, Option } from "@salt-ds/core";
|
|
4
|
+
import { FormEventHandler, HTMLAttributes } from "react";
|
|
5
|
+
export interface SettingsSchema {
|
|
6
|
+
properties: SettingsProperty[];
|
|
7
|
+
}
|
|
8
|
+
export interface SettingsProps {
|
|
9
|
+
settingsSchema: SettingsSchema;
|
|
10
|
+
settings: Settings;
|
|
11
|
+
onSettingChanged: (propertyName: string, value: string | number | boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export type Option<T> = {
|
|
14
|
+
label: string;
|
|
15
|
+
value: T;
|
|
16
|
+
};
|
|
17
|
+
export declare const isOption: (value: Option<number | string> | number | string) => value is Option<string | number>;
|
|
18
|
+
export interface BaseProperty {
|
|
19
|
+
name: string;
|
|
20
|
+
label: string;
|
|
21
|
+
}
|
|
22
|
+
export interface StringProperty extends BaseProperty {
|
|
23
|
+
values?: string[] | Option<string>[];
|
|
24
|
+
defaultValue?: string;
|
|
25
|
+
type: "string";
|
|
26
|
+
}
|
|
27
|
+
export interface NumericProperty extends BaseProperty {
|
|
28
|
+
values?: number[] | Option<number>[];
|
|
29
|
+
defaultValue?: number;
|
|
30
|
+
type: "number";
|
|
31
|
+
}
|
|
32
|
+
export interface BooleanProperty extends BaseProperty {
|
|
33
|
+
defaultValue?: boolean;
|
|
34
|
+
type: "boolean";
|
|
35
|
+
}
|
|
36
|
+
export type SettingsProperty = StringProperty | NumericProperty | BooleanProperty;
|
|
37
|
+
export declare const isBooleanProperty: (property: SettingsProperty) => property is BooleanProperty;
|
|
38
|
+
export declare const isStringOrNumber: (value: unknown) => value is string | number;
|
|
39
|
+
export declare function FormControl({ property, changeHandler, selectHandler, inputHandler, currentValue, }: {
|
|
40
|
+
property: SettingsProperty;
|
|
41
|
+
changeHandler: FormEventHandler;
|
|
42
|
+
selectHandler: DropdownProps["onSelectionChange"];
|
|
43
|
+
inputHandler: FormEventHandler;
|
|
44
|
+
currentValue: VuuRowDataItemType;
|
|
45
|
+
}): JSX.Element | null;
|
|
46
|
+
export type SettingsFormProps = SettingsProps & HTMLAttributes<HTMLDivElement>;
|
|
47
|
+
export declare const SettingsForm: ({ settingsSchema, settings, onSettingChanged, ...htmlAttributes }: SettingsFormProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LayoutMetadata } from "@vuu-ui/vuu-utils";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
export interface LayoutTileProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
metadata: LayoutMetadata;
|
|
5
|
+
onLoadLayout: (layoutId?: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const LayoutTile: ({ metadata, onLoadLayout, ...htmlAttributes }: LayoutTileProps) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LayoutMetadataDto } from "@vuu-ui/vuu-utils";
|
|
3
|
+
type SaveLayoutPanelProps = {
|
|
4
|
+
componentId?: string;
|
|
5
|
+
defaultTitle?: string;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
onSave: (layoutMetadata: LayoutMetadataDto) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const SaveLayoutPanel: (props: SaveLayoutPanelProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LayoutMetadata, LayoutMetadataDto, type ApplicationSetting, type ApplicationSettings, type LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
3
|
+
import { type WorkspaceStackProps } from "./defaultWorkspaceJSON";
|
|
4
|
+
export type WorkspaceProps = WorkspaceStackProps & {
|
|
5
|
+
layoutPlaceholderJSON?: LayoutJSON;
|
|
6
|
+
/**
|
|
7
|
+
* layoutJSON defines the default layout to render on first load and until such time as
|
|
8
|
+
* layout state has been persisted. After that, the persisted state will be rendered.
|
|
9
|
+
*/
|
|
10
|
+
layoutJSON?: LayoutJSON;
|
|
11
|
+
/**
|
|
12
|
+
* The Vuu workspace is the container into which layouts are loaded. By default, it will be
|
|
13
|
+
* a Tabbed Panel (Stack + Tabstrip), showing a tab per Layout.
|
|
14
|
+
*/
|
|
15
|
+
workspaceJSON?: LayoutJSON;
|
|
16
|
+
};
|
|
17
|
+
export interface WorkspaceProviderProps extends WorkspaceProps {
|
|
18
|
+
children: JSX.Element | JSX.Element[];
|
|
19
|
+
/**
|
|
20
|
+
* layoutPlaceholderJSON defines the layout to render when a new workspace layout is created.
|
|
21
|
+
*/
|
|
22
|
+
layoutPlaceholderJSON?: LayoutJSON;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* LayoutManagementProvider supplies an API for loading and saving layout documents.
|
|
26
|
+
* Initial layout is automatically loaded on startup. Because this hook is responsible
|
|
27
|
+
* only for loading and saving layouts, it only triggers a render when content is loaded.
|
|
28
|
+
*
|
|
29
|
+
* Initial layout displays a loading state
|
|
30
|
+
* User may supply a default layout. This will not be displayed until call has been made to
|
|
31
|
+
* persistenceManager to retrieve stored layout state. If no stored state is returned, the
|
|
32
|
+
* default layout provided by user will be set as current state (and hence rendered). If no
|
|
33
|
+
* default layout has been provided by user, the sysem default will be used (simple PlaceHolder)
|
|
34
|
+
* If saved layout state has been returned, that will be set as current state (and rendered)
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export declare const WorkspaceProvider: ({ TabstripProps, children, layoutJSON, layoutPlaceholderJSON, showTabs, workspaceJSON: customWorkspaceJSON, }: WorkspaceProviderProps) => JSX.Element;
|
|
38
|
+
export declare const useWorkspace: () => {
|
|
39
|
+
workspaceJSON: LayoutJSON<{
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}>;
|
|
42
|
+
layoutMetadata: LayoutMetadata[];
|
|
43
|
+
layoutPlaceholderJSON?: LayoutJSON<{
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
}> | undefined;
|
|
46
|
+
getApplicationSettings: (key?: keyof ApplicationSettings | undefined) => ApplicationSettings | ApplicationSetting;
|
|
47
|
+
loadLayoutById: (id: string) => void;
|
|
48
|
+
saveApplicationSettings: (settings: ApplicationSettings | ApplicationSetting, key?: keyof ApplicationSettings | undefined) => void;
|
|
49
|
+
saveLayout: (n: LayoutMetadataDto) => void;
|
|
50
|
+
saveApplicationLayout: (layout: LayoutJSON<{
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
}>) => void;
|
|
53
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StackProps } from "@vuu-ui/vuu-layout";
|
|
2
|
+
import { LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
3
|
+
export type WorkspaceStackProps = Pick<StackProps, "showTabs" | "TabstripProps">;
|
|
4
|
+
export declare const warningLayout: LayoutJSON;
|
|
5
|
+
export declare const loadingJSON: Readonly<LayoutJSON>;
|
|
6
|
+
export declare const stackWorkspaceJSON: LayoutJSON<StackProps & {
|
|
7
|
+
preserve: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const getWorkspaceWithLayoutJSON: (customWorkspaceJSON?: LayoutJSON, layoutJSON?: LayoutJSON | LayoutJSON[], stackProps?: WorkspaceStackProps) => LayoutJSON;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RpcResponseHandler } from "packages/vuu-data-types";
|
|
3
|
+
import { LookupTableProvider } from "packages/vuu-shell/src";
|
|
4
|
+
import { DefaultColumnConfiguration, DefaultTableConfiguration } from "packages/vuu-table-types";
|
|
5
|
+
export interface ShellContextProps {
|
|
6
|
+
getDefaultColumnConfig?: DefaultColumnConfiguration;
|
|
7
|
+
getDefaultTableConfig?: DefaultTableConfiguration;
|
|
8
|
+
getLookupValues?: LookupTableProvider;
|
|
9
|
+
handleRpcResponse?: RpcResponseHandler;
|
|
10
|
+
}
|
|
11
|
+
export declare const ShellContext: import("react").Context<ShellContextProps>;
|
|
12
|
+
export declare const useShellContext: () => ShellContextProps;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ApplicationSetting, ApplicationSettings, LayoutJSON } from "../json-types";
|
|
3
|
+
import { LayoutMetadata, LayoutMetadataDto } from "../layout-types";
|
|
4
|
+
export interface WorkspaceContextProps {
|
|
5
|
+
layoutMetadata: LayoutMetadata[];
|
|
6
|
+
layoutPlaceholderJSON?: LayoutJSON;
|
|
7
|
+
getApplicationSettings: (key?: keyof ApplicationSettings) => ApplicationSettings | ApplicationSetting | undefined;
|
|
8
|
+
loadLayoutById: (id: string) => void;
|
|
9
|
+
saveApplicationSettings: (settings: ApplicationSettings | ApplicationSetting, key?: keyof ApplicationSettings) => void;
|
|
10
|
+
saveLayout: (n: LayoutMetadataDto) => void;
|
|
11
|
+
saveApplicationLayout: (layout: LayoutJSON) => void;
|
|
12
|
+
workspaceJSON?: LayoutJSON;
|
|
13
|
+
}
|
|
14
|
+
export declare const WorkspaceContext: React.Context<WorkspaceContextProps>;
|
|
15
|
+
export declare const usePlaceholderJSON: () => LayoutJSON<{
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}> | undefined;
|
|
@@ -27,6 +27,7 @@ export * from "./json-types";
|
|
|
27
27
|
export * from "./json-utils";
|
|
28
28
|
export * from "./keyboard-utils";
|
|
29
29
|
export * from "./keyset";
|
|
30
|
+
export * from "./layout-types";
|
|
30
31
|
export * from "./list-utils";
|
|
31
32
|
export * from "./local-storage-utils";
|
|
32
33
|
export * from "./logging-utils";
|
|
@@ -50,3 +51,6 @@ export * from "./url-utils";
|
|
|
50
51
|
export * from "./useId";
|
|
51
52
|
export * from "./user-types";
|
|
52
53
|
export * from "./useLayoutEffectSkipFirst";
|
|
54
|
+
/** Context declarations hosted in utils to minimize intra package dependencies */
|
|
55
|
+
export * from "./ShellContext";
|
|
56
|
+
export * from "./context-definitions/WorkspaceContext";
|
|
@@ -40,7 +40,7 @@ export interface WithType {
|
|
|
40
40
|
}
|
|
41
41
|
export type LayoutModel = LayoutRoot | ReactElement | WithType;
|
|
42
42
|
export interface LayoutJSON<T extends object = {
|
|
43
|
-
[key: string]:
|
|
43
|
+
[key: string]: any;
|
|
44
44
|
}> extends WithType {
|
|
45
45
|
active?: number;
|
|
46
46
|
children?: LayoutJSON[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LayoutJSON } from "@vuu-ui/vuu-utils";
|
|
2
|
+
export interface WithId {
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
export interface LayoutMetadata extends WithId {
|
|
6
|
+
name: string;
|
|
7
|
+
group: string;
|
|
8
|
+
screenshot: string;
|
|
9
|
+
user: string;
|
|
10
|
+
created: string;
|
|
11
|
+
}
|
|
12
|
+
export type LayoutMetadataDto = Omit<LayoutMetadata, "id" | "created">;
|
|
13
|
+
export interface Layout extends WithId {
|
|
14
|
+
json: LayoutJSON;
|
|
15
|
+
}
|
|
16
|
+
export type ApplicationLayout = {
|
|
17
|
+
username: string;
|
|
18
|
+
definition: LayoutJSON;
|
|
19
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|