@vuu-ui/vuu-table-extras 0.6.14-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/LICENSE +201 -0
- package/cjs/index.js +5749 -0
- package/cjs/index.js.map +7 -0
- package/esm/index.js +5779 -0
- package/esm/index.js.map +7 -0
- package/index.css +502 -0
- package/index.css.map +7 -0
- package/package.json +33 -0
- package/types/cell-renderers/background-cell/BackgroundCell.d.ts +2 -0
- package/types/cell-renderers/background-cell/index.d.ts +1 -0
- package/types/cell-renderers/background-cell/useDirection.d.ts +3 -0
- package/types/cell-renderers/index.d.ts +1 -0
- package/types/column-expression-input/ColumnExpressionInput.d.ts +9 -0
- package/types/column-expression-input/column-function-descriptors.d.ts +15 -0
- package/types/column-expression-input/column-language-parser/ColumnExpressionLanguage.d.ts +2 -0
- package/types/column-expression-input/column-language-parser/ColumnExpressionTreeWalker.d.ts +58 -0
- package/types/column-expression-input/column-language-parser/column-expression-parse-utils.d.ts +5 -0
- package/types/column-expression-input/column-language-parser/generated/column-parser.d.ts +2 -0
- package/types/column-expression-input/column-language-parser/generated/column-parser.terms.d.ts +24 -0
- package/types/column-expression-input/column-language-parser/index.d.ts +3 -0
- package/types/column-expression-input/column-language-parser/test.d.mts +1 -0
- package/types/column-expression-input/functionDocInfo.d.ts +2 -0
- package/types/column-expression-input/highlighting.d.ts +1 -0
- package/types/column-expression-input/index.d.ts +4 -0
- package/types/column-expression-input/theme.d.ts +1 -0
- package/types/column-expression-input/useColumnAutoComplete.d.ts +6 -0
- package/types/column-expression-input/useColumnExpressionEditor.d.ts +29 -0
- package/types/column-expression-input/useColumnExpressionSuggestionProvider.d.ts +8 -0
- package/types/datagrid-configuration-ui/calculated-column-panel/CalculatedColumnPanel.d.ts +11 -0
- package/types/datagrid-configuration-ui/calculated-column-panel/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/column-picker/ColumnListItem.d.ts +4 -0
- package/types/datagrid-configuration-ui/column-picker/ColumnPicker.d.ts +13 -0
- package/types/datagrid-configuration-ui/column-picker/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/column-settings-panel/ColumnSettingsPanel.d.ts +9 -0
- package/types/datagrid-configuration-ui/column-settings-panel/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/column-type-panel/ColumnTypePanel.d.ts +10 -0
- package/types/datagrid-configuration-ui/column-type-panel/NumericColumnPanel.d.ts +4 -0
- package/types/datagrid-configuration-ui/column-type-panel/StringColumnPanel.d.ts +4 -0
- package/types/datagrid-configuration-ui/column-type-panel/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/settings-panel/DatagridSettingsPanel.d.ts +10 -0
- package/types/datagrid-configuration-ui/settings-panel/GridSettingsPanel.d.ts +9 -0
- package/types/datagrid-configuration-ui/settings-panel/index.d.ts +1 -0
- package/types/datagrid-configuration-ui/settings-panel/useGridSettings.d.ts +59 -0
- package/types/datasource-stats/DatasourceStats.d.ts +8 -0
- package/types/datasource-stats/index.d.ts +1 -0
- package/types/index.d.ts +4 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Tree } from "@lezer/common";
|
|
2
|
+
import { RelationalExpression } from "./generated/column-parser.terms";
|
|
3
|
+
type expressionType = "arithmeticExpression" | "booleanCondition" | "booleanLiteralExpression" | "callExpression" | "colExpression" | "conditionalExpression" | "numberLiteralExpression" | "relationalExpression" | "stringLiteralExpression" | "unknown";
|
|
4
|
+
type arithmeticOp = "*" | "/" | "+" | "-" | "unknown";
|
|
5
|
+
type booleanOp = "and" | "or";
|
|
6
|
+
type relationalOp = "=" | "!=" | ">" | ">=" | "<" | "<=" | "unknown";
|
|
7
|
+
export interface Expression {
|
|
8
|
+
type: expressionType;
|
|
9
|
+
expressions?: Expression[];
|
|
10
|
+
toJSON?: () => unknown;
|
|
11
|
+
value?: string | number | boolean;
|
|
12
|
+
}
|
|
13
|
+
interface BooleanLiteralExpression {
|
|
14
|
+
type: "booleanLiteralExpression";
|
|
15
|
+
value: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface NumericLiteralExpression {
|
|
18
|
+
type: "numericLiteralExpression";
|
|
19
|
+
value: number;
|
|
20
|
+
}
|
|
21
|
+
interface StringLiteralExpression {
|
|
22
|
+
type: "stringLiteralExpression";
|
|
23
|
+
value: string;
|
|
24
|
+
}
|
|
25
|
+
interface ArithmeticExpression extends Expression {
|
|
26
|
+
expressions: [Expression, Expression];
|
|
27
|
+
op: arithmeticOp;
|
|
28
|
+
type: "arithmeticExpression";
|
|
29
|
+
}
|
|
30
|
+
interface BooleanCondition extends Expression {
|
|
31
|
+
expressions: Expression[];
|
|
32
|
+
op: booleanOp;
|
|
33
|
+
type: "booleanCondition";
|
|
34
|
+
}
|
|
35
|
+
interface RelationalExpression extends Expression {
|
|
36
|
+
expressions: Expression[];
|
|
37
|
+
op: relationalOp;
|
|
38
|
+
type: "relationalExpression";
|
|
39
|
+
}
|
|
40
|
+
interface ColExpression extends Expression {
|
|
41
|
+
column?: string;
|
|
42
|
+
type: "colExpression";
|
|
43
|
+
}
|
|
44
|
+
interface CallExpression extends Expression {
|
|
45
|
+
arguments: Expression[];
|
|
46
|
+
functionName?: string;
|
|
47
|
+
type: "callExpression";
|
|
48
|
+
}
|
|
49
|
+
type ConditionExpression = RelationalExpression | BooleanCondition;
|
|
50
|
+
interface ConditionalExpression extends Expression {
|
|
51
|
+
type: "conditionalExpression";
|
|
52
|
+
condition: ConditionExpression;
|
|
53
|
+
truthyExpression: Expression;
|
|
54
|
+
falsyExpression: Expression;
|
|
55
|
+
}
|
|
56
|
+
export type ColumnDefinitionExpression = ArithmeticExpression | BooleanLiteralExpression | CallExpression | ColExpression | ConditionalExpression | NumericLiteralExpression | StringLiteralExpression;
|
|
57
|
+
export declare const walkTree: (tree: Tree, source: string) => ColumnDefinitionExpression;
|
|
58
|
+
export {};
|
package/types/column-expression-input/column-language-parser/column-expression-parse-utils.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SyntaxNode } from "@lezer/common";
|
|
2
|
+
export declare const ColumnNamedTerms: readonly string[];
|
|
3
|
+
export declare const isCompleteExpression: (src: string) => boolean;
|
|
4
|
+
export declare const lastNamedChild: (node: SyntaxNode) => SyntaxNode | null;
|
|
5
|
+
export declare const isCompleteRelationalExpression: (node?: SyntaxNode) => boolean;
|
package/types/column-expression-input/column-language-parser/generated/column-parser.terms.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const ColumnDefinitionExpression: 1;
|
|
2
|
+
export const Column: 2;
|
|
3
|
+
export const Number: 3;
|
|
4
|
+
export const String: 4;
|
|
5
|
+
export const True: 5;
|
|
6
|
+
export const False: 6;
|
|
7
|
+
export const ParenthesizedExpression: 7;
|
|
8
|
+
export const OpenBrace: 8;
|
|
9
|
+
export const CloseBrace: 9;
|
|
10
|
+
export const ArithmeticExpression: 10;
|
|
11
|
+
export const Divide: 11;
|
|
12
|
+
export const Times: 12;
|
|
13
|
+
export const Plus: 13;
|
|
14
|
+
export const Minus: 14;
|
|
15
|
+
export const ConditionalExpression: 15;
|
|
16
|
+
export const If: 16;
|
|
17
|
+
export const RelationalExpression: 17;
|
|
18
|
+
export const RelationalOperator: 18;
|
|
19
|
+
export const AndCondition: 19;
|
|
20
|
+
export const OrCondition: 20;
|
|
21
|
+
export const Comma: 21;
|
|
22
|
+
export const CallExpression: 22;
|
|
23
|
+
export const Function: 23;
|
|
24
|
+
export const ArgList: 24;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function walkTree(tree: any, source: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const vuuHighlighting: import("@codemirror/state").Extension;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const vuuTheme: import("@codemirror/state").Extension;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CompletionSource } from "@vuu-ui/vuu-codemirror";
|
|
2
|
+
import { MutableRefObject } from "react";
|
|
3
|
+
import { IExpressionSuggestionProvider } from "./useColumnExpressionEditor";
|
|
4
|
+
export type ApplyCompletion = (mode?: "add" | "replace") => void;
|
|
5
|
+
export type Operator = "";
|
|
6
|
+
export declare const useColumnAutoComplete: (suggestionProvider: IExpressionSuggestionProvider, onSubmit: MutableRefObject<ApplyCompletion>) => CompletionSource;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Completion } from "@vuu-ui/vuu-codemirror";
|
|
3
|
+
import { ColumnDefinitionExpression } from "./column-language-parser/ColumnExpressionTreeWalker";
|
|
4
|
+
export type ColumnExpressionOperator = "Times" | "Divide" | "Minus" | "Plus";
|
|
5
|
+
export type ColumnExpressionSuggestionType = "column" | "columnValue" | "expression" | "condition-operator" | "operator" | "relational-operator";
|
|
6
|
+
export type ColumnExpressionSuggestionOptions = {
|
|
7
|
+
columnName?: string;
|
|
8
|
+
functionName?: string;
|
|
9
|
+
operator?: ColumnExpressionOperator;
|
|
10
|
+
prefix?: string;
|
|
11
|
+
startsWith?: string;
|
|
12
|
+
selection?: string[];
|
|
13
|
+
};
|
|
14
|
+
export interface IExpressionSuggestionProvider {
|
|
15
|
+
getSuggestions: (valueType: ColumnExpressionSuggestionType, options?: ColumnExpressionSuggestionOptions) => Promise<Completion[]>;
|
|
16
|
+
isPartialMatch: (valueType: ColumnExpressionSuggestionType, columnName?: string, text?: string | undefined) => Promise<boolean>;
|
|
17
|
+
}
|
|
18
|
+
export interface ExpressionSuggestionConsumer {
|
|
19
|
+
suggestionProvider: IExpressionSuggestionProvider;
|
|
20
|
+
}
|
|
21
|
+
export interface ColumnExpressionEditorProps {
|
|
22
|
+
onChange?: (source: string, expression: ColumnDefinitionExpression | undefined) => void;
|
|
23
|
+
onSubmitExpression?: (source: string, expression: ColumnDefinitionExpression | undefined) => void;
|
|
24
|
+
suggestionProvider: IExpressionSuggestionProvider;
|
|
25
|
+
}
|
|
26
|
+
export declare const useColumnExpressionEditor: ({ onChange, onSubmitExpression, suggestionProvider, }: ColumnExpressionEditorProps) => {
|
|
27
|
+
editorRef: import("react").RefObject<HTMLDivElement>;
|
|
28
|
+
clearInput: () => void;
|
|
29
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IExpressionSuggestionProvider } from "@vuu-ui/vuu-table-extras";
|
|
2
|
+
import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
|
|
3
|
+
import { VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
4
|
+
export interface SuggestionProviderHookProps {
|
|
5
|
+
columns: ColumnDescriptor[];
|
|
6
|
+
table: VuuTable;
|
|
7
|
+
}
|
|
8
|
+
export declare const useColumnExpressionSuggestionProvider: ({ columns, table, }: SuggestionProviderHookProps) => IExpressionSuggestionProvider;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
|
|
2
|
+
import { VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import { Dispatch, HTMLAttributes } from "react";
|
|
4
|
+
import { ColumnAction } from "../settings-panel/useGridSettings";
|
|
5
|
+
import "./CalculatedColumnPanel.css";
|
|
6
|
+
export interface CalculatedColumnPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
columns: ColumnDescriptor[];
|
|
8
|
+
dispatchColumnAction: Dispatch<ColumnAction>;
|
|
9
|
+
table: VuuTable;
|
|
10
|
+
}
|
|
11
|
+
export declare const CalculatedColumnPanel: ({ columns, dispatchColumnAction, table, }: CalculatedColumnPanelProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./CalculatedColumnPanel";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
|
|
2
|
+
import { Dispatch, HTMLAttributes } from "react";
|
|
3
|
+
import { ColumnAction } from "../settings-panel/useGridSettings";
|
|
4
|
+
import "./ColumnPicker.css";
|
|
5
|
+
export interface ColumnPickerProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
availableColumns: ColumnDescriptor[];
|
|
7
|
+
dispatchColumnAction: Dispatch<ColumnAction>;
|
|
8
|
+
onAddCalculatedColumnClick: () => void;
|
|
9
|
+
onSelectionChange?: (selected: ColumnDescriptor | null) => void;
|
|
10
|
+
chosenColumns: ColumnDescriptor[];
|
|
11
|
+
selectedColumn: ColumnDescriptor | null;
|
|
12
|
+
}
|
|
13
|
+
export declare const ColumnPicker: ({ availableColumns, id: idProp, dispatchColumnAction: dispatch, onAddCalculatedColumnClick, onSelectionChange, chosenColumns, selectedColumn, }: ColumnPickerProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ColumnPicker";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
|
|
2
|
+
import { Dispatch, HTMLAttributes } from "react";
|
|
3
|
+
import { ColumnAction } from "../settings-panel/useGridSettings";
|
|
4
|
+
import "./ColumnSettingsPanel.css";
|
|
5
|
+
export interface ColumnSettingsPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
column: ColumnDescriptor;
|
|
7
|
+
dispatchColumnAction: Dispatch<ColumnAction>;
|
|
8
|
+
}
|
|
9
|
+
export declare const ColumnSettingsPanel: ({ column, dispatchColumnAction, style: styleProp, ...props }: ColumnSettingsPanelProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ColumnSettingsPanel";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
|
|
2
|
+
import { PanelProps } from "@salt-ds/core";
|
|
3
|
+
import { Dispatch } from "react";
|
|
4
|
+
import { ColumnAction } from "../settings-panel/useGridSettings";
|
|
5
|
+
import "./ColumnTypePanel.css";
|
|
6
|
+
export interface ColumnTypePanelProps extends PanelProps {
|
|
7
|
+
column: ColumnDescriptor;
|
|
8
|
+
dispatchColumnAction: Dispatch<ColumnAction>;
|
|
9
|
+
}
|
|
10
|
+
export declare const ColumnTypePanel: ({ className, column, dispatchColumnAction, ...props }: ColumnTypePanelProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ColumnTypePanel";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./settings-panel";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColumnDescriptor, GridConfig } from "@vuu-ui/vuu-datagrid-types";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
import "./DatagridSettingsPanel.css";
|
|
4
|
+
export interface DatagridSettingsPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
availableColumns: ColumnDescriptor[];
|
|
6
|
+
gridConfig: Omit<GridConfig, "headings">;
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
onConfigChange?: (config: Omit<GridConfig, "headings">, closePanel?: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const DatagridSettingsPanel: ({ availableColumns, className, gridConfig, onCancel, onConfigChange, ...props }: DatagridSettingsPanelProps) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GridConfig } from "@vuu-ui/vuu-datagrid-types";
|
|
2
|
+
import { Dispatch, HTMLAttributes } from "react";
|
|
3
|
+
import "./GridSettingsPanel.css";
|
|
4
|
+
import { ColumnAction } from "./useGridSettings";
|
|
5
|
+
export interface GridSettingsPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
config: Omit<GridConfig, "headings">;
|
|
7
|
+
dispatchColumnAction: Dispatch<ColumnAction>;
|
|
8
|
+
}
|
|
9
|
+
export declare const GridSettingsPanel: ({ config, dispatchColumnAction, style: styleProp, ...props }: GridSettingsPanelProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DatagridSettingsPanel";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ColumnDescriptor, GridConfig } from "@vuu-ui/vuu-datagrid-types";
|
|
2
|
+
import { Reducer } from "react";
|
|
3
|
+
export type CalculatedColumnExpression = {
|
|
4
|
+
columName: string;
|
|
5
|
+
expression: string;
|
|
6
|
+
};
|
|
7
|
+
export interface ColumnActionAdd {
|
|
8
|
+
type: "addColumn";
|
|
9
|
+
columns?: ColumnDescriptor[];
|
|
10
|
+
column?: ColumnDescriptor;
|
|
11
|
+
index?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ColumnActionAddCalculatedColumn {
|
|
14
|
+
columnName: string;
|
|
15
|
+
columnType: "string" | "int" | "double" | "boolean";
|
|
16
|
+
expression: string;
|
|
17
|
+
type: "addCalculatedColumn";
|
|
18
|
+
}
|
|
19
|
+
export interface ColumnActionMove {
|
|
20
|
+
type: "moveColumn";
|
|
21
|
+
column?: ColumnDescriptor;
|
|
22
|
+
moveBy?: 1 | -1;
|
|
23
|
+
moveTo?: number;
|
|
24
|
+
moveFrom?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ColumnActionRemove {
|
|
27
|
+
type: "removeColumn";
|
|
28
|
+
column: ColumnDescriptor;
|
|
29
|
+
}
|
|
30
|
+
export interface ColumnActionUpdate {
|
|
31
|
+
type: "updateColumn";
|
|
32
|
+
column: ColumnDescriptor;
|
|
33
|
+
}
|
|
34
|
+
export interface ColumnActionUpdateProp {
|
|
35
|
+
align?: ColumnDescriptor["align"];
|
|
36
|
+
column: ColumnDescriptor;
|
|
37
|
+
hidden?: ColumnDescriptor["hidden"];
|
|
38
|
+
label?: ColumnDescriptor["label"];
|
|
39
|
+
type: "updateColumnProp";
|
|
40
|
+
width?: ColumnDescriptor["width"];
|
|
41
|
+
}
|
|
42
|
+
export interface ColumnActionUpdateGridSettings {
|
|
43
|
+
type: "updateGridSettings";
|
|
44
|
+
columnDefaultWidth?: number;
|
|
45
|
+
columnFormatHeader?: "capitalize" | "uppercase";
|
|
46
|
+
}
|
|
47
|
+
export interface ColumnActionUpdateTypeFormatting {
|
|
48
|
+
type: "updateColumnTypeFormatting";
|
|
49
|
+
column: ColumnDescriptor;
|
|
50
|
+
alignOnDecimals?: boolean;
|
|
51
|
+
decimals?: number;
|
|
52
|
+
zeroPad?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export type ColumnAction = ColumnActionAdd | ColumnActionAddCalculatedColumn | ColumnActionUpdateGridSettings | ColumnActionMove | ColumnActionRemove | ColumnActionUpdate | ColumnActionUpdateProp | ColumnActionUpdateTypeFormatting;
|
|
55
|
+
export type GridSettingsReducer = Reducer<Omit<GridConfig, "headings">, ColumnAction>;
|
|
56
|
+
export declare const useGridSettings: (config: Omit<GridConfig, "headings">) => {
|
|
57
|
+
gridSettings: Omit<GridConfig, "headings">;
|
|
58
|
+
dispatchColumnAction: import("react").Dispatch<ColumnAction>;
|
|
59
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RemoteDataSource } from "@vuu-ui/vuu-data";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
import "./DatasourceStats.css";
|
|
4
|
+
interface DataSourceStatsProps extends HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
dataSource: RemoteDataSource;
|
|
6
|
+
}
|
|
7
|
+
export declare const DataSourceStats: ({ className: classNameProp, dataSource, }: DataSourceStatsProps) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DatasourceStats";
|
package/types/index.d.ts
ADDED