@vuu-ui/vuu-filters 0.8.5-debug → 0.8.6-debug
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/index.js +16825 -3858
- package/cjs/index.js.map +4 -4
- package/esm/index.js +17079 -3918
- package/esm/index.js.map +4 -4
- package/index.css +2157 -11
- package/index.css.map +3 -3
- package/package.json +7 -7
- package/types/vuu-data/src/array-data-source/array-data-source.d.ts +65 -0
- package/types/vuu-data/src/array-data-source/group-utils.d.ts +10 -0
- package/types/vuu-data/src/array-data-source/sort-utils.d.ts +4 -0
- package/types/vuu-data/src/authenticate.d.ts +1 -0
- package/types/vuu-data/src/connection-manager.d.ts +46 -0
- package/types/vuu-data/src/connectionTypes.d.ts +5 -0
- package/types/vuu-data/src/constants.d.ts +41 -0
- package/types/vuu-data/src/data-source.d.ts +172 -0
- package/types/vuu-data/src/index.d.ts +10 -0
- package/types/vuu-data/src/inlined-worker.d.ts +1 -0
- package/types/vuu-data/src/json-data-source.d.ts +53 -0
- package/types/vuu-data/src/message-utils.d.ts +26 -0
- package/types/vuu-data/src/remote-data-source.d.ts +56 -0
- package/types/vuu-data/src/server-proxy/messages.d.ts +43 -0
- package/types/vuu-data/src/vuuUIMessageTypes.d.ts +202 -0
- package/types/vuu-data/src/websocket-connection.d.ts +25 -0
- package/types/vuu-data-react/src/hooks/index.d.ts +6 -0
- package/types/vuu-data-react/src/hooks/useDataSource.d.ts +24 -0
- package/types/vuu-data-react/src/hooks/useServerConnectionQuality.d.ts +1 -0
- package/types/vuu-data-react/src/hooks/useServerConnectionStatus.d.ts +1 -0
- package/types/vuu-data-react/src/hooks/useTypeaheadSuggestions.d.ts +4 -0
- package/types/vuu-data-react/src/hooks/useVuuMenuActions.d.ts +57 -0
- package/types/vuu-data-react/src/hooks/useVuuTables.d.ts +2 -0
- package/types/vuu-data-react/src/index.d.ts +1 -0
- package/types/vuu-filters/src/filter-bar/FilterBar.d.ts +9 -0
- package/types/vuu-filters/src/filter-bar/index.d.ts +1 -0
- package/types/vuu-filters/src/filter-clause/ExpandoCombobox.d.ts +6 -0
- package/types/vuu-filters/src/filter-clause/FilterClauseEditor.d.ts +13 -0
- package/types/vuu-filters/src/filter-clause/FilterMenu.d.ts +11 -0
- package/types/vuu-filters/src/filter-clause/FilterMenuOptions.d.ts +6 -0
- package/types/vuu-filters/src/filter-clause/NumericInput.d.ts +10 -0
- package/types/vuu-filters/src/filter-clause/TextInput.d.ts +11 -0
- package/types/vuu-filters/src/filter-clause/filterClauseTypes.d.ts +8 -0
- package/types/vuu-filters/src/filter-clause/index.d.ts +2 -0
- package/types/vuu-filters/src/filter-clause/operator-utils.d.ts +2 -0
- package/types/vuu-filters/src/filter-pill/FilterPill.d.ts +8 -0
- package/types/vuu-filters/src/filter-pill/index.d.ts +1 -0
- package/types/vuu-filters/src/filter-pill-menu/FilterPillMenu.d.ts +12 -0
- package/types/vuu-filters/src/filter-pill-menu/FilterPillMenuOptions.d.ts +10 -0
- package/types/vuu-filters/src/filter-pill-menu/index.d.ts +1 -0
- package/types/{filter-utils.d.ts → vuu-filters/src/filter-utils.d.ts} +2 -3
- package/types/{index.d.ts → vuu-filters/src/index.d.ts} +2 -1
- package/types/vuu-popups/src/dialog/Dialog.d.ts +7 -0
- package/types/vuu-popups/src/dialog/index.d.ts +1 -0
- package/types/vuu-popups/src/index.d.ts +5 -0
- package/types/vuu-popups/src/menu/ContextMenu.d.ts +15 -0
- package/types/vuu-popups/src/menu/MenuList.d.ts +43 -0
- package/types/vuu-popups/src/menu/context-menu-provider.d.ts +10 -0
- package/types/vuu-popups/src/menu/index.d.ts +4 -0
- package/types/vuu-popups/src/menu/key-code.d.ts +12 -0
- package/types/vuu-popups/src/menu/list-dom-utils.d.ts +4 -0
- package/types/vuu-popups/src/menu/use-cascade.d.ts +25 -0
- package/types/vuu-popups/src/menu/use-items-with-ids-next.d.ts +13 -0
- package/types/vuu-popups/src/menu/use-keyboard-navigation.d.ts +26 -0
- package/types/vuu-popups/src/menu/useContextMenu.d.ts +13 -0
- package/types/vuu-popups/src/menu/utils.d.ts +2 -0
- package/types/vuu-popups/src/popup/index.d.ts +1 -0
- package/types/vuu-popups/src/popup/popup-service.d.ts +55 -0
- package/types/vuu-popups/src/popup-menu/PopupMenu.d.ts +14 -0
- package/types/vuu-popups/src/popup-menu/index.d.ts +1 -0
- package/types/vuu-popups/src/portal/Portal.d.ts +8 -0
- package/types/vuu-popups/src/portal/index.d.ts +3 -0
- package/types/vuu-popups/src/portal/portal-utils.d.ts +1 -0
- package/types/vuu-popups/src/portal/render-portal.d.ts +10 -0
- package/types/filter-clause/FilterClause.d.ts +0 -13
- package/types/filter-clause/NumericInput.d.ts +0 -10
- package/types/filter-clause/TextInput.d.ts +0 -12
- package/types/filter-clause/index.d.ts +0 -1
- package/types/filter-toolbar/FilterDropdown.d.ts +0 -8
- package/types/filter-toolbar/FilterDropdownMultiSelect.d.ts +0 -8
- package/types/filter-toolbar/FilterToolbar.d.ts +0 -9
- package/types/filter-toolbar/index.d.ts +0 -1
- package/types/filter-toolbar/useFilterToolbar.d.ts +0 -7
- package/types/operator-utils.d.ts +0 -21
- /package/types/{column-filter → vuu-filters/src/column-filter}/utils.d.ts +0 -0
- /package/types/{filter-clause → vuu-filters/src/filter-clause}/CloseButton.d.ts +0 -0
- /package/types/{filter-input → vuu-filters/src/filter-input}/FilterInput.d.ts +0 -0
- /package/types/{filter-input → vuu-filters/src/filter-input}/FilterLanguage.d.ts +0 -0
- /package/types/{filter-input → vuu-filters/src/filter-input}/filterInfo.d.ts +0 -0
- /package/types/{filter-input → vuu-filters/src/filter-input}/highlighting.d.ts +0 -0
- /package/types/{filter-input → vuu-filters/src/filter-input}/index.d.ts +0 -0
- /package/types/{filter-input → vuu-filters/src/filter-input}/theme.d.ts +0 -0
- /package/types/{filter-input → vuu-filters/src/filter-input}/useCodeMirrorEditor.d.ts +0 -0
- /package/types/{filter-input → vuu-filters/src/filter-input}/useFilterAutoComplete.d.ts +0 -0
- /package/types/{filter-input → vuu-filters/src/filter-input}/useFilterSuggestionProvider.d.ts +0 -0
- /package/types/{local-config.d.ts → vuu-filters/src/local-config.d.ts} +0 -0
- /package/types/{use-filter-config.d.ts → vuu-filters/src/use-filter-config.d.ts} +0 -0
- /package/types/{use-rest-config.d.ts → vuu-filters/src/use-rest-config.d.ts} +0 -0
|
@@ -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,57 @@
|
|
|
1
|
+
import { DataSource, DataSourceMenusMessage, DataSourceVisualLinkCreatedMessage, DataSourceVisualLinkRemovedMessage, DataSourceVisualLinksMessage, MenuRpcResponse, VuuFeatureInvocationMessage, VuuFeatureMessage, VuuUIMessageInRPCEditReject, VuuUIMessageInRPCEditResponse } from "@vuu-ui/vuu-data";
|
|
2
|
+
import { DataSourceRow, MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-data-types";
|
|
3
|
+
import { GridAction } from "@vuu-ui/vuu-datagrid-types";
|
|
4
|
+
import { LinkDescriptorWithLabel, VuuMenu, VuuMenuItem, VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
5
|
+
import { ColumnMap } from "@vuu-ui/vuu-utils";
|
|
6
|
+
export declare const addRowsFromInstruments = "addRowsFromInstruments";
|
|
7
|
+
export interface VuuCellMenuItem extends VuuMenuItem {
|
|
8
|
+
rowKey: string;
|
|
9
|
+
field: string;
|
|
10
|
+
value: VuuRowDataItemType;
|
|
11
|
+
}
|
|
12
|
+
export interface VuuRowMenuItem extends VuuMenuItem {
|
|
13
|
+
rowKey: string;
|
|
14
|
+
row: {
|
|
15
|
+
[key: string]: VuuRowDataItemType;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare const isVisualLinksAction: (action: GridAction) => action is DataSourceVisualLinksMessage;
|
|
19
|
+
export declare const isVisualLinkCreatedAction: (action: GridAction) => action is DataSourceVisualLinkCreatedMessage;
|
|
20
|
+
export declare const isVisualLinkRemovedAction: (action: GridAction) => action is DataSourceVisualLinkRemovedMessage;
|
|
21
|
+
export declare const isViewportMenusAction: (action: GridAction) => action is DataSourceMenusMessage;
|
|
22
|
+
export declare const isVuuFeatureAction: (action: GridAction) => action is VuuFeatureMessage;
|
|
23
|
+
export declare const isVuuFeatureInvocation: (action: GridAction) => action is VuuFeatureInvocationMessage;
|
|
24
|
+
export type VuuMenuActionHandler = (type: string, options: unknown) => boolean;
|
|
25
|
+
export interface ViewServerHookResult {
|
|
26
|
+
buildViewserverMenuOptions: MenuBuilder;
|
|
27
|
+
handleMenuAction: MenuActionHandler;
|
|
28
|
+
}
|
|
29
|
+
export interface MenuActionConfig {
|
|
30
|
+
vuuMenu?: VuuMenu;
|
|
31
|
+
visualLink?: DataSourceVisualLinkCreatedMessage;
|
|
32
|
+
visualLinks?: LinkDescriptorWithLabel[];
|
|
33
|
+
}
|
|
34
|
+
export type RpcResponseHandler = (response: MenuRpcResponse | VuuUIMessageInRPCEditReject | VuuUIMessageInRPCEditResponse) => void;
|
|
35
|
+
export interface VuuMenuActionHookProps {
|
|
36
|
+
/**
|
|
37
|
+
* By default, vuuMenuActions will be handled automatically. When activated, a
|
|
38
|
+
* message will be sent to server and response will be handled here too.
|
|
39
|
+
* This prop allows client to provide a custom handler for a menu Item. This will
|
|
40
|
+
* take priority and if handler returns true, no further processing for the menu
|
|
41
|
+
* item will be handled by Vuu. This can also be used to prevent an item from being
|
|
42
|
+
* actioned, even when no custom handling is intended. If the handler returns false,
|
|
43
|
+
* Vuu will process the menuItem.
|
|
44
|
+
*/
|
|
45
|
+
clientSideMenuActionHandler?: VuuMenuActionHandler;
|
|
46
|
+
dataSource: DataSource;
|
|
47
|
+
menuActionConfig?: MenuActionConfig;
|
|
48
|
+
onRpcResponse?: RpcResponseHandler;
|
|
49
|
+
}
|
|
50
|
+
export type VuuServerMenuOptions = {
|
|
51
|
+
columnMap: ColumnMap;
|
|
52
|
+
columnName: string;
|
|
53
|
+
row: DataSourceRow;
|
|
54
|
+
selectedRows: DataSourceRow[];
|
|
55
|
+
viewport: string;
|
|
56
|
+
};
|
|
57
|
+
export declare const useVuuMenuActions: ({ clientSideMenuActionHandler, dataSource, menuActionConfig, onRpcResponse, }: VuuMenuActionHookProps) => ViewServerHookResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./hooks";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NamedFilter } from "@vuu-ui/vuu-filter-types";
|
|
2
|
+
import { TableSchema } from "packages/vuu-data/src";
|
|
3
|
+
import { HTMLAttributes } from "react";
|
|
4
|
+
import "./FilterBar.css";
|
|
5
|
+
export interface FilterbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
filters: NamedFilter[];
|
|
7
|
+
tableSchema: TableSchema;
|
|
8
|
+
}
|
|
9
|
+
export declare const FilterBar: ({ className: classNameProp, filters, tableSchema, ...htmlAttributes }: FilterbarProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FilterBar";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComboBoxProps, SelectionStrategy } from "@salt-ds/lab";
|
|
2
|
+
import { ForwardedRef, ReactElement } from "react";
|
|
3
|
+
import "./ExpandoCombobox.css";
|
|
4
|
+
export declare const ExpandoCombobox: <Item, Selection_1 extends SelectionStrategy = "default">(props: ComboBoxProps<Item, Selection_1> & {
|
|
5
|
+
ref?: ForwardedRef<HTMLDivElement> | undefined;
|
|
6
|
+
}) => ReactElement<ComboBoxProps<Item, Selection_1>, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableSchema } from "@vuu-ui/vuu-data";
|
|
2
|
+
import { FilterClause } from "@vuu-ui/vuu-filter-types";
|
|
3
|
+
import { HTMLAttributes } from "react";
|
|
4
|
+
import "./FilterClauseEditor.css";
|
|
5
|
+
import { SuggestionFetcher } from "packages/vuu-data-react/src";
|
|
6
|
+
export interface FilterClauseEditorProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
7
|
+
filterClause: Partial<FilterClause>;
|
|
8
|
+
onChange: (filterClause: Partial<FilterClause>) => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
suggestionProvider?: () => SuggestionFetcher;
|
|
11
|
+
tableSchema: TableSchema;
|
|
12
|
+
}
|
|
13
|
+
export declare const FilterClauseEditor: ({ onChange, onClose, filterClause, suggestionProvider, tableSchema, ...htmlAttributes }: FilterClauseEditorProps) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuActionHandler } from "packages/vuu-data-types";
|
|
3
|
+
import "./FilterMenu.css";
|
|
4
|
+
export interface FilterMenuProps {
|
|
5
|
+
allowAnd?: boolean;
|
|
6
|
+
allowOr?: boolean;
|
|
7
|
+
onMenuAction: MenuActionHandler;
|
|
8
|
+
onMenuClose?: () => void;
|
|
9
|
+
index: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const FilterMenu: ({ allowAnd, allowOr, onMenuAction, onMenuClose, index, }: FilterMenuProps) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ContextMenuItemDescriptor } from "packages/vuu-data-types";
|
|
2
|
+
export type MenuOptions = {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
export declare const andCommand: (options?: MenuOptions) => ContextMenuItemDescriptor;
|
|
6
|
+
export declare const orCommand: (options?: MenuOptions) => ContextMenuItemDescriptor;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes, RefObject } from "react";
|
|
2
|
+
import { FilterClauseValueEditor } from "./filterClauseTypes";
|
|
3
|
+
export interface NumericInputProps extends FilterClauseValueEditor, HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
operatorInputRef?: RefObject<HTMLInputElement>;
|
|
5
|
+
onValueChange: (value: number) => void;
|
|
6
|
+
operator: string;
|
|
7
|
+
ref: RefObject<HTMLDivElement>;
|
|
8
|
+
value?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const NumericInput: ({ className, column, onValueChange, value, }: NumericInputProps) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes, RefObject } from "react";
|
|
2
|
+
import { SuggestionFetcher } from "@vuu-ui/vuu-data-react";
|
|
3
|
+
import { FilterClauseValueEditor } from "./filterClauseTypes";
|
|
4
|
+
export interface TextInputProps extends FilterClauseValueEditor, HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
ref: RefObject<HTMLDivElement>;
|
|
6
|
+
operator: string;
|
|
7
|
+
onValueChange: (value: string) => void;
|
|
8
|
+
suggestionProvider?: () => SuggestionFetcher;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColumnDescriptor } from "packages/vuu-datagrid-types";
|
|
2
|
+
import { FilterClause } from "packages/vuu-filter-types";
|
|
3
|
+
import { VuuTable } from "packages/vuu-protocol-types";
|
|
4
|
+
export interface FilterClauseValueEditor {
|
|
5
|
+
filterClause: Partial<FilterClause>;
|
|
6
|
+
column: ColumnDescriptor;
|
|
7
|
+
table?: VuuTable;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NamedFilter } from "packages/vuu-filter-types";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
import "./FilterPill.css";
|
|
4
|
+
export interface FilterPillProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
filter: NamedFilter;
|
|
6
|
+
index?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const FilterPill: ({ filter, className: classNameProp, index, ...htmlAttributes }: FilterPillProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FilterPill";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuActionHandler } from "packages/vuu-data-types";
|
|
3
|
+
import "./FilterPillMenu.css";
|
|
4
|
+
export interface FilterPillMenuProps {
|
|
5
|
+
allowClose?: boolean;
|
|
6
|
+
allowRename?: boolean;
|
|
7
|
+
location?: string;
|
|
8
|
+
onMenuAction: MenuActionHandler;
|
|
9
|
+
onMenuClose?: () => void;
|
|
10
|
+
index: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const FilterPillMenu: ({ allowClose, allowRename, location, onMenuAction, onMenuClose, index, }: FilterPillMenuProps) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ContextMenuItemDescriptor } from "packages/vuu-data-types";
|
|
2
|
+
export type MenuOptions = {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
export interface FilterPillMenuOptions {
|
|
6
|
+
tabIndex: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const isFilterPillMenuOptions: (options: unknown) => options is FilterPillMenuOptions;
|
|
9
|
+
export declare const closeCommand: (options?: MenuOptions) => ContextMenuItemDescriptor;
|
|
10
|
+
export declare const renameCommand: (options?: MenuOptions) => ContextMenuItemDescriptor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FilterPillMenu";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
|
|
2
|
-
import { Filter, FilterClause, FilterCombinatorOp } from "@vuu-ui/vuu-filter-types";
|
|
3
|
-
import { NumericOperator } from "./operator-utils";
|
|
2
|
+
import { Filter, FilterClause, FilterCombinatorOp, NumericFilterClauseOp } from "@vuu-ui/vuu-filter-types";
|
|
4
3
|
export declare const AND = "and";
|
|
5
4
|
export declare const EQUALS = "=";
|
|
6
5
|
export declare const GREATER_THAN = ">";
|
|
@@ -39,5 +38,5 @@ export declare const filterIncludesColumn: (filter: Filter, column: ColumnDescri
|
|
|
39
38
|
export declare const filterEquals: (f1?: Filter, f2?: Filter, strict?: boolean) => boolean;
|
|
40
39
|
export declare const updateFilter: (filter: Filter | undefined, newFilter: Filter | undefined, mode: "add" | "replace") => Filter | undefined;
|
|
41
40
|
export declare const getTypeaheadFilter: (column: string, filterValues: string[], isStartsWithFilter?: boolean) => Filter | undefined;
|
|
42
|
-
export declare const getNumericFilter: (column: string,
|
|
41
|
+
export declare const getNumericFilter: (column: string, op?: NumericFilterClauseOp, value?: number) => FilterClause | undefined;
|
|
43
42
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import "./Dialog.css";
|
|
3
|
+
export interface DialogProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const Dialog: ({ children, className, isOpen, onClose, title, ...props }: DialogProps) => JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Dialog";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuListProps } from "./MenuList";
|
|
3
|
+
import { PopupCloseCallback } from "../popup";
|
|
4
|
+
export interface ContextMenuProps extends Omit<MenuListProps, "onCloseMenu"> {
|
|
5
|
+
onClose?: PopupCloseCallback;
|
|
6
|
+
position?: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
withPortal?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const ContextMenu: {
|
|
13
|
+
({ activatedByKeyboard, children: childrenProp, className, id: idProp, onClose, position, style, ...menuListProps }: ContextMenuProps): JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { FC, HTMLAttributes, ReactElement, ReactNode } from "react";
|
|
2
|
+
import "./MenuList.css";
|
|
3
|
+
export declare const Separator: () => JSX.Element;
|
|
4
|
+
export interface MenuItemGroupProps {
|
|
5
|
+
children: ReactElement<MenuItemProps>[] | [ReactElement<MenuItemLabelProps>, ...ReactElement<MenuItemProps>[]];
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface MenuItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
action?: string;
|
|
10
|
+
idx?: number;
|
|
11
|
+
options?: unknown;
|
|
12
|
+
}
|
|
13
|
+
export declare const MenuItemGroup: FC<MenuItemGroupProps>;
|
|
14
|
+
export declare const MenuItem: {
|
|
15
|
+
({ children, idx, ...props }: MenuItemProps): JSX.Element;
|
|
16
|
+
Label: {
|
|
17
|
+
({ children }: {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}): JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export interface MenuItemLabelProps {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare const isMenuItemLabel: (item: ReactNode) => item is React.ReactElement<MenuItemLabelProps, string | React.JSXElementConstructor<any>>;
|
|
27
|
+
export interface MenuListProps extends HTMLAttributes<HTMLDivElement> {
|
|
28
|
+
activatedByKeyboard?: boolean;
|
|
29
|
+
children: ReactElement[];
|
|
30
|
+
childMenuShowing?: string;
|
|
31
|
+
highlightedIdx?: number;
|
|
32
|
+
isRoot?: boolean;
|
|
33
|
+
listItemProps?: Partial<MenuItemProps>;
|
|
34
|
+
onActivate?: (menuId: string) => void;
|
|
35
|
+
onCloseMenu: (idx: number) => void;
|
|
36
|
+
onOpenMenu?: (menuItemEl: HTMLElement) => void;
|
|
37
|
+
onHighlightMenuItem?: (idx: number) => void;
|
|
38
|
+
}
|
|
39
|
+
declare const MenuList: {
|
|
40
|
+
({ activatedByKeyboard, childMenuShowing, children, className, highlightedIdx: highlightedIdxProp, id: idProp, isRoot, listItemProps, onHighlightMenuItem, onActivate, onCloseMenu, onOpenMenu, ...props }: MenuListProps): JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
43
|
+
export default MenuList;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ContextMenuContextType, MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export declare const ContextMenuContext: import("react").Context<ContextMenuContextType | null>;
|
|
4
|
+
export interface ContextMenuProviderProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
label?: string;
|
|
7
|
+
menuActionHandler?: MenuActionHandler;
|
|
8
|
+
menuBuilder: MenuBuilder;
|
|
9
|
+
}
|
|
10
|
+
export declare const ContextMenuProvider: ({ children, label, menuActionHandler, menuBuilder, }: ContextMenuProviderProps) => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const ArrowUp = "ArrowUp";
|
|
2
|
+
export declare const ArrowDown = "ArrowDown";
|
|
3
|
+
export declare const ArrowLeft = "ArrowLeft";
|
|
4
|
+
export declare const Backspace = "Backspace";
|
|
5
|
+
export declare const ArrowRight = "ArrowRight";
|
|
6
|
+
export declare const Enter = "Enter";
|
|
7
|
+
export declare const Escape = "Escape";
|
|
8
|
+
export declare const Delete = "Delete";
|
|
9
|
+
export declare const isCharacterKey: (evt: KeyboardEvent) => boolean | undefined;
|
|
10
|
+
export declare const isNavigationKey: ({ key }: {
|
|
11
|
+
key: string;
|
|
12
|
+
}, orientation?: string) => boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function listItemIndex(listItemEl: HTMLElement): number | undefined;
|
|
2
|
+
export declare const closestListItem: (el: HTMLElement | null | undefined) => HTMLElement;
|
|
3
|
+
export declare const closestListItemId: (el: HTMLElement) => string | undefined;
|
|
4
|
+
export declare const closestListItemIndex: (el: HTMLElement) => number | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MouseEvent } from "react";
|
|
2
|
+
import { MenuItemProps } from "./MenuList";
|
|
3
|
+
export type RuntimeMenuDescriptor = {
|
|
4
|
+
id: string;
|
|
5
|
+
left: number;
|
|
6
|
+
top: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const getHostMenuId: (id: string, rootId: string) => string;
|
|
9
|
+
export interface CascadeHookProps {
|
|
10
|
+
id: string;
|
|
11
|
+
onActivate: (menuId: string) => void;
|
|
12
|
+
onMouseEnterItem: (evt: MouseEvent, itemId: string) => void;
|
|
13
|
+
position: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface CascadeHooksResult {
|
|
19
|
+
closeMenu: () => void;
|
|
20
|
+
handleRender: () => void;
|
|
21
|
+
listItemProps: Partial<MenuItemProps>;
|
|
22
|
+
openMenu: (menuItemEl: HTMLElement) => void;
|
|
23
|
+
openMenus: RuntimeMenuDescriptor[];
|
|
24
|
+
}
|
|
25
|
+
export declare const useCascade: ({ id: rootId, onActivate, onMouseEnterItem, position: { x: posX, y: posY }, }: CascadeHookProps) => CascadeHooksResult;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
export declare const isMenuItemGroup: (child: ReactElement) => boolean;
|
|
3
|
+
type Menus = {
|
|
4
|
+
[key: string]: ReactElement[];
|
|
5
|
+
};
|
|
6
|
+
type Actions = {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
action: string;
|
|
9
|
+
options?: unknown;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const useItemsWithIdsNext: (childrenProp: ReactElement[], rootId: string) => [Menus, Actions];
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FocusEvent, KeyboardEvent } from "react";
|
|
2
|
+
export interface KeyboardNavigationProps {
|
|
3
|
+
autoHighlightFirstItem?: boolean;
|
|
4
|
+
count: number;
|
|
5
|
+
highlightedIndex?: number;
|
|
6
|
+
onActivate: (idx: number) => void;
|
|
7
|
+
onHighlight?: (idx: number) => void;
|
|
8
|
+
onCloseMenu: (idx: number) => void;
|
|
9
|
+
onOpenMenu?: (menuItemEl: HTMLElement) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface KeyboardHookListProps {
|
|
12
|
+
onFocus: (evt: FocusEvent) => void;
|
|
13
|
+
onKeyDown: (evt: KeyboardEvent) => void;
|
|
14
|
+
onMouseDownCapture: () => void;
|
|
15
|
+
onMouseMove: () => void;
|
|
16
|
+
onMouseLeave: () => void;
|
|
17
|
+
}
|
|
18
|
+
export interface NavigationHookResult {
|
|
19
|
+
focusVisible: number;
|
|
20
|
+
controlledHighlighting: boolean;
|
|
21
|
+
highlightedIndex: number;
|
|
22
|
+
setHighlightedIndex: (idx: number) => void;
|
|
23
|
+
listProps: KeyboardHookListProps;
|
|
24
|
+
setIgnoreFocus: (ignoreFocus: boolean) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const useKeyboardNavigation: ({ autoHighlightFirstItem, count, highlightedIndex: highlightedIndexProp, onActivate, onHighlight, onCloseMenu, onOpenMenu, }: KeyboardNavigationProps) => NavigationHookResult;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MouseEvent } from "react";
|
|
2
|
+
import { MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-data-types";
|
|
3
|
+
import { ContextMenuProps } from "./ContextMenu";
|
|
4
|
+
export type ContextMenuOptions = {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
contextMenu?: JSX.Element;
|
|
7
|
+
ContextMenuProps?: Partial<ContextMenuProps> & {
|
|
8
|
+
className?: string;
|
|
9
|
+
"data-mode"?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type ShowContextMenu = (e: MouseEvent<HTMLElement>, location: string, options: ContextMenuOptions) => void;
|
|
13
|
+
export declare const useContextMenu: (menuBuilder?: MenuBuilder, menuActionHandler?: MenuActionHandler) => [ShowContextMenu, () => void];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./popup-service";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import { ContextMenuOptions } from "../menu";
|
|
3
|
+
import "./popup-service.css";
|
|
4
|
+
export type PopupCloseCallback = (reason?: PopupCloseReason) => void;
|
|
5
|
+
export type ClickAwayClosePopup = {
|
|
6
|
+
type: "click-away";
|
|
7
|
+
mouseEvt: MouseEvent;
|
|
8
|
+
};
|
|
9
|
+
export type MenuActionClosePopup = {
|
|
10
|
+
menuId: string;
|
|
11
|
+
options: ContextMenuOptions;
|
|
12
|
+
type: "menu-action";
|
|
13
|
+
};
|
|
14
|
+
export type PopupCloseReason = ClickAwayClosePopup | MenuActionClosePopup;
|
|
15
|
+
export declare const reasonIsMenuAction: (reason?: PopupCloseReason) => reason is MenuActionClosePopup;
|
|
16
|
+
export declare const reasonIsClickAway: (reason?: PopupCloseReason) => reason is ClickAwayClosePopup;
|
|
17
|
+
export interface ShowPopupProps {
|
|
18
|
+
depth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* if true, focus will be invoked on first focusable element
|
|
21
|
+
*/
|
|
22
|
+
focus?: boolean;
|
|
23
|
+
name?: string;
|
|
24
|
+
group?: string;
|
|
25
|
+
position?: "above" | "below" | "";
|
|
26
|
+
left?: number;
|
|
27
|
+
right?: "auto" | number;
|
|
28
|
+
top?: number;
|
|
29
|
+
component: ReactElement;
|
|
30
|
+
width?: number | "auto";
|
|
31
|
+
}
|
|
32
|
+
export declare class PopupService {
|
|
33
|
+
static onClose: PopupCloseCallback | undefined;
|
|
34
|
+
static showPopup({ group, name, left, position, right, top, width, component, }: ShowPopupProps): void;
|
|
35
|
+
static escapeKeyListener(evt: KeyboardEvent): void;
|
|
36
|
+
static hidePopup(reason?: PopupCloseReason, name?: string, group?: string): void;
|
|
37
|
+
static keepWithinThePage(el: HTMLElement, right?: number | "auto"): void;
|
|
38
|
+
}
|
|
39
|
+
export declare class DialogService {
|
|
40
|
+
static showDialog(dialog: ReactElement): void;
|
|
41
|
+
static closeDialog(): void;
|
|
42
|
+
}
|
|
43
|
+
export interface PopupProps {
|
|
44
|
+
children: ReactElement;
|
|
45
|
+
close?: boolean;
|
|
46
|
+
depth: number;
|
|
47
|
+
group?: string;
|
|
48
|
+
name: string;
|
|
49
|
+
position?: "above" | "below" | "";
|
|
50
|
+
width: number;
|
|
51
|
+
}
|
|
52
|
+
export declare const Popup: (props: PopupProps) => React.DetailedReactHTMLElement<{
|
|
53
|
+
className: string;
|
|
54
|
+
ref: React.RefObject<HTMLElement>;
|
|
55
|
+
}, HTMLElement>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import "./PopupMenu.css";
|
|
3
|
+
import { MenuActionHandler, MenuBuilder } from "@vuu-ui/vuu-data-types";
|
|
4
|
+
export interface PopupMenuProps extends HTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
icon?: string;
|
|
6
|
+
menuActionHandler?: MenuActionHandler;
|
|
7
|
+
menuBuilder?: MenuBuilder;
|
|
8
|
+
menuLocation?: string;
|
|
9
|
+
menuOptions?: {
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
onMenuClose?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const PopupMenu: ({ className, icon, id: idProp, menuActionHandler, menuBuilder, menuLocation, menuOptions, onMenuClose, tabIndex, ...htmlAttributes }: PopupMenuProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PopupMenu";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const installTheme: (themeId: string) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
export interface HTMLContainerProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
dataMode?: string;
|
|
5
|
+
x?: number;
|
|
6
|
+
y?: number;
|
|
7
|
+
win?: typeof globalThis;
|
|
8
|
+
}
|
|
9
|
+
export declare const createContainer: (props: HTMLContainerProps) => HTMLDivElement;
|
|
10
|
+
export declare const renderPortal: (component: ReactElement, container: HTMLElement, x: number, y: number, onRender?: () => void) => void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
2
|
-
import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
|
|
3
|
-
import { Filter, FilterClause as FilterClauseType } from "@vuu-ui/vuu-filter-types";
|
|
4
|
-
import { VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
5
|
-
import "./FilterClause.css";
|
|
6
|
-
export type FilterClauseProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & {
|
|
7
|
-
table: VuuTable;
|
|
8
|
-
onChange: (filter?: Filter) => void;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
columns: ColumnDescriptor[];
|
|
11
|
-
defaultFilter?: FilterClauseType;
|
|
12
|
-
};
|
|
13
|
-
export declare const FilterClause: ({ table, onChange, onClose, columns, defaultFilter, ...htmlAttributes }: FilterClauseProps) => JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, RefObject } from "react";
|
|
2
|
-
import { Filter, FilterClause } from "@vuu-ui/vuu-filter-types";
|
|
3
|
-
type NumericInputProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
-
column: string;
|
|
5
|
-
operatorInputRef: RefObject<HTMLInputElement>;
|
|
6
|
-
onFilterChange: (filter?: Filter) => void;
|
|
7
|
-
defaultFilter?: FilterClause;
|
|
8
|
-
};
|
|
9
|
-
export declare const NumericInput: ({ column, operatorInputRef, onFilterChange, defaultFilter, className, }: NumericInputProps) => JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, RefObject } from "react";
|
|
2
|
-
import { Filter, FilterClause } from "@vuu-ui/vuu-filter-types";
|
|
3
|
-
import { VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
4
|
-
type TextInputProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
|
-
table: VuuTable;
|
|
6
|
-
column: string;
|
|
7
|
-
operatorInputRef: RefObject<HTMLInputElement>;
|
|
8
|
-
onFilterChange: (filter?: Filter) => void;
|
|
9
|
-
defaultFilter?: FilterClause;
|
|
10
|
-
};
|
|
11
|
-
export declare const TextInput: ({ table, column, operatorInputRef, onFilterChange, defaultFilter, className, }: TextInputProps) => JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./FilterClause";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DropdownProps } from "@heswell/salt-lab";
|
|
3
|
-
import { IFilterSuggestionProvider } from "../filter-input";
|
|
4
|
-
export interface FilterDropdownProps extends DropdownProps {
|
|
5
|
-
column: string;
|
|
6
|
-
suggestionProvider: IFilterSuggestionProvider;
|
|
7
|
-
}
|
|
8
|
-
export declare const FilterDropdown: ({ column, selected: selectedProp, suggestionProvider, ...props }: FilterDropdownProps) => JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DropdownProps } from "@heswell/salt-lab";
|
|
3
|
-
import { IFilterSuggestionProvider } from "../filter-input";
|
|
4
|
-
export interface FilterDropdownProps extends DropdownProps<string, "multiple"> {
|
|
5
|
-
column: string;
|
|
6
|
-
suggestionProvider: IFilterSuggestionProvider;
|
|
7
|
-
}
|
|
8
|
-
export declare const FilterDropdownMultiSelect: ({ column, selected: selectedProp, suggestionProvider, ...props }: FilterDropdownProps) => JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Filter } from "@vuu-ui/vuu-filter-types";
|
|
3
|
-
import { ToolbarProps } from "@heswell/salt-lab";
|
|
4
|
-
import { SuggestionConsumer } from "../filter-input";
|
|
5
|
-
import "./FilterToolbar.css";
|
|
6
|
-
export interface FilterToolbarProps extends SuggestionConsumer, ToolbarProps {
|
|
7
|
-
filter?: Filter;
|
|
8
|
-
}
|
|
9
|
-
export declare const FilterToolbar: ({ className, filter, suggestionProvider, ...props }: FilterToolbarProps) => JSX.Element;
|