@vuu-ui/vuu-table-extras 0.13.4 → 0.13.5

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.
Files changed (57) hide show
  1. package/package.json +17 -14
  2. package/types/cell-edit-validators/CaseValidator.d.ts +2 -0
  3. package/types/cell-edit-validators/PatternValidator.d.ts +2 -0
  4. package/types/cell-edit-validators/index.d.ts +2 -0
  5. package/types/cell-renderers/background-cell/BackgroundCell.d.ts +2 -0
  6. package/types/cell-renderers/background-cell/BackgroundCellConfigurationEditor.d.ts +2 -0
  7. package/types/cell-renderers/background-cell/index.d.ts +2 -0
  8. package/types/cell-renderers/background-cell/useDirection.d.ts +3 -0
  9. package/types/cell-renderers/dropdown-cell/DropdownCell.d.ts +2 -0
  10. package/types/cell-renderers/dropdown-cell/index.d.ts +1 -0
  11. package/types/cell-renderers/index.d.ts +5 -0
  12. package/types/cell-renderers/lookup-cell/LookupCell.d.ts +2 -0
  13. package/types/cell-renderers/lookup-cell/index.d.ts +1 -0
  14. package/types/cell-renderers/pct-progress-cell/PctProgressCell.d.ts +2 -0
  15. package/types/cell-renderers/pct-progress-cell/index.d.ts +1 -0
  16. package/types/cell-renderers/progress-cell/ProgressCell.d.ts +1 -0
  17. package/types/cell-renderers/progress-cell/index.d.ts +1 -0
  18. package/types/column-expression-input/ColumnExpressionInput.d.ts +10 -0
  19. package/types/column-expression-input/column-function-descriptors.d.ts +15 -0
  20. package/types/column-expression-input/column-language-parser/ColumnExpressionLanguage.d.ts +2 -0
  21. package/types/column-expression-input/column-language-parser/ColumnExpressionTreeWalker.d.ts +58 -0
  22. package/types/column-expression-input/column-language-parser/column-expression-parse-utils.d.ts +5 -0
  23. package/types/column-expression-input/column-language-parser/generated/column-parser.d.ts +2 -0
  24. package/types/column-expression-input/column-language-parser/generated/column-parser.terms.d.ts +24 -0
  25. package/types/column-expression-input/column-language-parser/index.d.ts +3 -0
  26. package/types/column-expression-input/column-language-parser/test.d.mts +1 -0
  27. package/types/column-expression-input/functionDocInfo.d.ts +2 -0
  28. package/types/column-expression-input/highlighting.d.ts +1 -0
  29. package/types/column-expression-input/index.d.ts +4 -0
  30. package/types/column-expression-input/theme.d.ts +1 -0
  31. package/types/column-expression-input/useColumnAutoComplete.d.ts +6 -0
  32. package/types/column-expression-input/useColumnExpressionEditor.d.ts +25 -0
  33. package/types/column-expression-input/useColumnExpressionSuggestionProvider.d.ts +8 -0
  34. package/types/column-expression-panel/ColumnExpressionPanel.d.ts +13 -0
  35. package/types/column-expression-panel/index.d.ts +1 -0
  36. package/types/column-expression-panel/useColumnExpression.d.ts +10 -0
  37. package/types/column-formatting-settings/BaseNumericFormattingSettings.d.ts +2 -0
  38. package/types/column-formatting-settings/ColumnFormattingPanel.d.ts +9 -0
  39. package/types/column-formatting-settings/DateTimeFormattingSettings.d.ts +4 -0
  40. package/types/column-formatting-settings/LongTypeFormattingSettings.d.ts +2 -0
  41. package/types/column-formatting-settings/index.d.ts +3 -0
  42. package/types/column-list/ColumnList.d.ts +12 -0
  43. package/types/column-list/index.d.ts +1 -0
  44. package/types/column-menu/ColumnMenu.d.ts +10 -0
  45. package/types/column-menu/column-action-types.d.ts +24 -0
  46. package/types/column-menu/column-menu-utils.d.ts +21 -0
  47. package/types/column-menu/useColumnActions.d.ts +18 -0
  48. package/types/datasource-stats/DatasourceStats.d.ts +7 -0
  49. package/types/datasource-stats/index.d.ts +1 -0
  50. package/types/index.d.ts +16 -0
  51. package/types/table-column-settings/ColumnNameLabel.d.ts +7 -0
  52. package/types/table-column-settings/ColumnSettingsPanel.d.ts +2 -0
  53. package/types/table-column-settings/TableSettingsPanel.d.ts +8 -0
  54. package/types/table-column-settings/useColumnSettings.d.ts +23 -0
  55. package/types/table-column-settings/useTableAndColumnSettings.d.ts +18 -0
  56. package/types/table-column-settings/useTableSettings.d.ts +21 -0
  57. package/types/table-provider/TableProvider.d.ts +17 -0
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
- "version": "0.13.4",
2
+ "version": "0.13.5",
3
3
  "author": "heswell",
4
4
  "license": "Apache-2.0",
5
5
  "devDependencies": {
6
- "@vuu-ui/vuu-filter-types": "0.13.4",
7
- "@vuu-ui/vuu-protocol-types": "0.13.4"
6
+ "@vuu-ui/vuu-filter-types": "0.13.5",
7
+ "@vuu-ui/vuu-protocol-types": "0.13.5"
8
8
  },
9
9
  "dependencies": {
10
- "@vuu-ui/vuu-codemirror": "0.13.4",
11
- "@vuu-ui/vuu-data-react": "0.13.4",
12
- "@vuu-ui/vuu-data-types": "0.13.4",
13
- "@vuu-ui/vuu-table-types": "0.13.4",
14
- "@vuu-ui/vuu-popups": "0.13.4",
15
- "@vuu-ui/vuu-table": "0.13.4",
16
- "@vuu-ui/vuu-utils": "0.13.4",
17
- "@vuu-ui/vuu-ui-controls": "0.13.4",
10
+ "@vuu-ui/vuu-codemirror": "0.13.5",
11
+ "@vuu-ui/vuu-data-react": "0.13.5",
12
+ "@vuu-ui/vuu-data-types": "0.13.5",
13
+ "@vuu-ui/vuu-table-types": "0.13.5",
14
+ "@vuu-ui/vuu-popups": "0.13.5",
15
+ "@vuu-ui/vuu-table": "0.13.5",
16
+ "@vuu-ui/vuu-utils": "0.13.5",
17
+ "@vuu-ui/vuu-ui-controls": "0.13.5",
18
18
  "@lezer/lr": "1.4.2",
19
19
  "@salt-ds/core": "1.43.0",
20
20
  "@salt-ds/styles": "0.2.1",
@@ -31,15 +31,18 @@
31
31
  "files": [
32
32
  "README.md",
33
33
  "esm",
34
- "cjs"
34
+ "cjs",
35
+ "/types"
35
36
  ],
36
37
  "exports": {
37
38
  ".": {
38
39
  "require": "./cjs/index.js",
39
- "import": "./esm/index.js"
40
+ "import": "./esm/index.js",
41
+ "types": "./types/index.d.ts"
40
42
  }
41
43
  },
42
44
  "main": "cjs/index.js",
43
45
  "module": "esm/index.js",
44
- "name": "@vuu-ui/vuu-table-extras"
46
+ "name": "@vuu-ui/vuu-table-extras",
47
+ "types": "types/index.d.ts"
45
48
  }
@@ -0,0 +1,2 @@
1
+ import { EditRuleValidator } from "@vuu-ui/vuu-data-types";
2
+ export declare const CaseValidator: EditRuleValidator;
@@ -0,0 +1,2 @@
1
+ import { EditRuleValidator } from "@vuu-ui/vuu-data-types";
2
+ export declare const PatternValidator: EditRuleValidator;
@@ -0,0 +1,2 @@
1
+ export * from "./CaseValidator";
2
+ export * from "./PatternValidator";
@@ -0,0 +1,2 @@
1
+ import { TableCellRendererProps } from "@vuu-ui/vuu-table-types";
2
+ export declare const BackgroundCell: import("react").NamedExoticComponent<TableCellRendererProps>;
@@ -0,0 +1,2 @@
1
+ import { ConfigurationEditorProps } from "@vuu-ui/vuu-utils";
2
+ export declare const BackgroundCellConfigurationEditor: ({ column, onChangeRendering, }: ConfigurationEditorProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from "./BackgroundCell";
2
+ export * from "./BackgroundCellConfigurationEditor";
@@ -0,0 +1,3 @@
1
+ import { RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
+ import { valueChangeDirection } from "@vuu-ui/vuu-utils";
3
+ export declare function useDirection(key: string, value: unknown, column: RuntimeColumnDescriptor): valueChangeDirection;
@@ -0,0 +1,2 @@
1
+ import { TableCellRendererProps } from "@vuu-ui/vuu-table-types";
2
+ export declare const DropdownCell: import("react").NamedExoticComponent<TableCellRendererProps>;
@@ -0,0 +1 @@
1
+ export * from "./DropdownCell";
@@ -0,0 +1,5 @@
1
+ export * from "./background-cell";
2
+ export * from "./dropdown-cell";
3
+ export * from "./lookup-cell";
4
+ export * from "./pct-progress-cell";
5
+ export * from "./progress-cell";
@@ -0,0 +1,2 @@
1
+ import { TableCellRendererProps } from "@vuu-ui/vuu-table-types";
2
+ export declare const LookupCell: import("react").NamedExoticComponent<TableCellRendererProps>;
@@ -0,0 +1 @@
1
+ export * from "./LookupCell";
@@ -0,0 +1,2 @@
1
+ import { TableCellProps } from "@vuu-ui/vuu-table-types";
2
+ export declare const PctProgressCell: ({ column, columnMap, row }: TableCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./PctProgressCell";
@@ -0,0 +1 @@
1
+ export * from "./ProgressCell";
@@ -0,0 +1,10 @@
1
+ import { HTMLAttributes } from "react";
2
+ import { ColumnDefinitionExpression } from "./column-language-parser";
3
+ import { ExpressionSuggestionConsumer } from "./useColumnExpressionEditor";
4
+ export type ColumnExpressionSubmitHandler = (source: string, expression: ColumnDefinitionExpression | undefined) => void;
5
+ export interface ColumnExpressionInputProps extends ExpressionSuggestionConsumer, Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
6
+ onChange?: (source: string) => void;
7
+ onSubmitExpression?: ColumnExpressionSubmitHandler;
8
+ source?: string;
9
+ }
10
+ export declare const ColumnExpressionInput: import("react").MemoExoticComponent<({ onChange, onSubmitExpression, source, suggestionProvider, }: ColumnExpressionInputProps) => import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,15 @@
1
+ export type ColumnFunctionDescriptor = {
2
+ accepts: "string" | "number" | "boolean" | "any" | Array<"string" | "number" | "boolean">;
3
+ description: string;
4
+ example: {
5
+ expression: string;
6
+ result: string;
7
+ };
8
+ name: string;
9
+ params: {
10
+ count?: number;
11
+ description: string;
12
+ };
13
+ type: "string" | "number" | "boolean" | "variable";
14
+ };
15
+ export declare const columnFunctionDescriptors: ColumnFunctionDescriptor[];
@@ -0,0 +1,2 @@
1
+ import { LanguageSupport } from "@vuu-ui/vuu-codemirror";
2
+ export declare const columnExpressionLanguageSupport: () => LanguageSupport;
@@ -0,0 +1,58 @@
1
+ import { Tree } from "@vuu-ui/vuu-codemirror";
2
+ import { RelationalExpression } from "./generated/column-parser.terms";
3
+ type expressionType = "arithmeticExpression" | "booleanCondition" | "booleanLiteralExpression" | "callExpression" | "colExpression" | "conditionalExpression" | "numericLiteralExpression" | "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 {};
@@ -0,0 +1,5 @@
1
+ import type { SyntaxNode } from "@vuu-ui/vuu-codemirror";
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;
@@ -0,0 +1,2 @@
1
+ export const parser: LRParser;
2
+ import { LRParser } from "@lezer/lr";
@@ -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,3 @@
1
+ export * from "./ColumnExpressionLanguage";
2
+ export * from "./ColumnExpressionTreeWalker";
3
+ export * from "./column-expression-parse-utils";
@@ -0,0 +1 @@
1
+ export function walkTree(tree: any, source: any): void;
@@ -0,0 +1,2 @@
1
+ import { ColumnFunctionDescriptor } from "./column-function-descriptors";
2
+ export declare const functionDocInfo: ({ name, description, example, params, type, }: ColumnFunctionDescriptor) => HTMLElement;
@@ -0,0 +1 @@
1
+ export declare const vuuHighlighting: import("@codemirror/state").Extension;
@@ -0,0 +1,4 @@
1
+ export * from "./ColumnExpressionInput";
2
+ export * from "./column-language-parser";
3
+ export * from "./useColumnExpressionEditor";
4
+ export * from "./useColumnExpressionSuggestionProvider";
@@ -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,25 @@
1
+ import { Completion } from "@vuu-ui/vuu-codemirror";
2
+ import { FocusEventHandler } from "react";
3
+ import { ColumnExpressionInputProps } from "./ColumnExpressionInput";
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 declare const useColumnExpressionEditor: ({ onChange, onSubmitExpression, source, suggestionProvider, }: ColumnExpressionInputProps) => {
22
+ editorRef: import("react").RefObject<HTMLDivElement | null>;
23
+ clearInput: () => void;
24
+ onBlur: FocusEventHandler;
25
+ };
@@ -0,0 +1,8 @@
1
+ import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
+ import { VuuTable } from "@vuu-ui/vuu-protocol-types";
3
+ import { IExpressionSuggestionProvider } from "./useColumnExpressionEditor";
4
+ export interface SuggestionProviderHookProps {
5
+ columns: ColumnDescriptor[];
6
+ table: VuuTable;
7
+ }
8
+ export declare const useColumnExpressionSuggestionProvider: ({ columns, table, }: SuggestionProviderHookProps) => IExpressionSuggestionProvider;
@@ -0,0 +1,13 @@
1
+ import { VuuColumnDataType } from "@vuu-ui/vuu-protocol-types";
2
+ import { ColumnDescriptor, ColumnSettingsProps } from "@vuu-ui/vuu-table-types";
3
+ import { HTMLAttributes } from "react";
4
+ export interface ColumnExpressionPanelProps extends HTMLAttributes<HTMLDivElement>, Pick<ColumnSettingsProps, "tableConfig" | "vuuTable"> {
5
+ column: ColumnDescriptor;
6
+ /**
7
+ * Callback prop, invoked on every change to calculated column definition
8
+ * @param calculatedColumnName the full calculated column name
9
+ */
10
+ onChangeName?: (name: string) => void;
11
+ onChangeServerDataType?: (name: VuuColumnDataType) => void;
12
+ }
13
+ export declare const ColumnExpressionPanel: ({ column: columnProp, onChangeName: onChangeNameProp, onChangeServerDataType: onChangeServerDataTypeProp, tableConfig, vuuTable, }: ColumnExpressionPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./ColumnExpressionPanel";
@@ -0,0 +1,10 @@
1
+ import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
+ import { FormEventHandler, SyntheticEvent } from "react";
3
+ import { ColumnExpressionPanelProps } from "./ColumnExpressionPanel";
4
+ export type ColumnExpressionHookProps = Pick<ColumnExpressionPanelProps, "column" | "onChangeName" | "onChangeServerDataType">;
5
+ export declare const useColumnExpression: ({ column: columnProp, onChangeName: onChangeNameProp, onChangeServerDataType: onChangeServerDataTypeProp, }: ColumnExpressionHookProps) => {
6
+ column: ColumnDescriptor;
7
+ onChangeExpression: (value: string) => void;
8
+ onChangeName: FormEventHandler;
9
+ onChangeServerDataType: (_e: SyntheticEvent, [serverDataType]: string[]) => void;
10
+ };
@@ -0,0 +1,2 @@
1
+ import { FormattingSettingsProps } from "@vuu-ui/vuu-table-types";
2
+ export declare const BaseNumericFormattingSettings: ({ column, onChangeFormatting: onChange, }: FormattingSettingsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ColumnDescriptor, ColumnTypeRendering, FormattingSettingsProps } from "@vuu-ui/vuu-table-types";
2
+ import { CellRendererDescriptor } from "@vuu-ui/vuu-utils";
3
+ import { HTMLAttributes } from "react";
4
+ export interface ColumnFormattingPanelProps extends HTMLAttributes<HTMLDivElement>, FormattingSettingsProps {
5
+ availableRenderers: CellRendererDescriptor[];
6
+ column: ColumnDescriptor;
7
+ onChangeRendering: (renderProps: ColumnTypeRendering) => void;
8
+ }
9
+ export declare const ColumnFormattingPanel: ({ availableRenderers, className, column, onChangeFormatting, onChangeColumnType, onChangeRendering, ...htmlAttributes }: ColumnFormattingPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { DateTimeDataValueDescriptor } from "@vuu-ui/vuu-data-types";
2
+ import { FormattingSettingsProps } from "@vuu-ui/vuu-table-types";
3
+ import React from "react";
4
+ export declare const DateTimeFormattingSettings: React.FC<FormattingSettingsProps<DateTimeDataValueDescriptor>>;
@@ -0,0 +1,2 @@
1
+ import { FormattingSettingsProps } from "@vuu-ui/vuu-table-types";
2
+ export declare const LongTypeFormattingSettings: (props: FormattingSettingsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from "./ColumnFormattingPanel";
2
+ export * from "./BaseNumericFormattingSettings";
3
+ export * from "./DateTimeFormattingSettings";
@@ -0,0 +1,12 @@
1
+ import { ColumnDescriptor, ColumnListPermissions } from "@vuu-ui/vuu-table-types";
2
+ import { HTMLAttributes } from "react";
3
+ import { ColumnItem } from "../table-column-settings/useTableSettings";
4
+ export type ColumnChangeHandler = (columnName: string, propertyName: keyof ColumnDescriptor | "subscribed", value: string | number | boolean) => void;
5
+ export interface ColumnListProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
6
+ columnItems: ColumnItem[];
7
+ onChange: ColumnChangeHandler;
8
+ onNavigateToColumn?: (columnName: string) => void;
9
+ onReorderColumnItems?: (columnItems: ColumnItem[]) => void;
10
+ permissions?: ColumnListPermissions;
11
+ }
12
+ export declare const ColumnList: ({ className, columnItems, onChange, onNavigateToColumn, onReorderColumnItems, permissions, ...htmlAttributes }: ColumnListProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./ColumnList";
@@ -0,0 +1,10 @@
1
+ import { ColumnDescriptor, ColumnMenuPermissions } from "@vuu-ui/vuu-table-types";
2
+ import { HTMLAttributes } from "react";
3
+ import { ColumnMenuActionType } from "./column-menu-utils";
4
+ import { MenuActionHandler } from "@vuu-ui/vuu-context-menu";
5
+ export interface ColumnMenuProps extends HTMLAttributes<HTMLSpanElement> {
6
+ column: ColumnDescriptor;
7
+ menuActionHandler?: MenuActionHandler<ColumnMenuActionType, ColumnDescriptor>;
8
+ menuPermissions?: ColumnMenuPermissions;
9
+ }
10
+ export declare const ColumnMenu: ({ className, column, menuActionHandler: menuActionHandlerProp, menuPermissions: { allowSort, allowGroup, allowAggregation, allowHide, allowPin, allowColumnSettings, allowTableSettings, }, }: ColumnMenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { VuuTable } from "@vuu-ui/vuu-protocol-types";
2
+ import { ColumnDescriptor, PinLocation } from "@vuu-ui/vuu-table-types";
3
+ export interface ColumnPinAction {
4
+ type: "pinColumn";
5
+ column: ColumnDescriptor;
6
+ pin: PinLocation | false;
7
+ }
8
+ export interface ColumnHideAction {
9
+ type: "hideColumn";
10
+ column: ColumnDescriptor;
11
+ }
12
+ export type ColumnDisplayAction = ColumnPinAction | ColumnHideAction;
13
+ export type ColumnDisplayActionHandler = (action: ColumnDisplayAction) => void;
14
+ export type DisplayTableSettingsAction = {
15
+ type: "table-settings";
16
+ };
17
+ export type DisplayColumnSettingsAction = {
18
+ type: "column-settings";
19
+ column: ColumnDescriptor;
20
+ /** only for calculated columnn */
21
+ vuuTable?: VuuTable;
22
+ };
23
+ export type DisplaySettingsAction = DisplayTableSettingsAction | DisplayColumnSettingsAction;
24
+ export type TableSettingsActionHandler = (action: DisplaySettingsAction) => void;
@@ -0,0 +1,21 @@
1
+ import { Menu, MenuItem, MenuItemProps, MenuProps } from "@salt-ds/core";
2
+ import { DataSource } from "@vuu-ui/vuu-data-types";
3
+ import { ColumnDescriptor, TableSettingsPermissions } from "@vuu-ui/vuu-table-types";
4
+ import { MouseEventHandler, ReactElement } from "react";
5
+ type MenuElement = ReactElement<MenuProps, typeof Menu>;
6
+ type MenuItemElement = ReactElement<MenuItemProps, typeof MenuItem>;
7
+ type MenuElements = Array<MenuElement | MenuItemElement>;
8
+ export type MenuItemClickHandler = MouseEventHandler<HTMLDivElement>;
9
+ export type DataSourceColumnMenuActionType = "agg-count" | "agg-distinct" | "agg-sum" | "agg-avg" | "agg-high" | "agg-low" | "sort-asc" | "sort-dsc" | "sort-add-asc" | "sort-add-dsc" | "remove-sort" | "group-column" | "remove-group" | "add-to-group" | "remove-from-group" | "remove-column";
10
+ export type ColumnDisplayColumnMenuActionType = "pin-column-left" | "pin-column-right" | "pin-column-floating" | "unpin-column" | "hide-column";
11
+ export type TableSettingsActionType = "column-settings" | "table-settings";
12
+ export type ColumnMenuActionType = DataSourceColumnMenuActionType | ColumnDisplayColumnMenuActionType | TableSettingsActionType;
13
+ export declare const isColumnMenuActionType: (value?: string) => value is ColumnMenuActionType;
14
+ export declare const getColumnMenuActionType: (target: EventTarget | HTMLElement) => ColumnMenuActionType;
15
+ export declare function buildSortMenu(column: ColumnDescriptor, dataSource: DataSource, menuActionClickHandler: MenuItemClickHandler, isAllowed?: boolean): MenuElement | null;
16
+ export declare function buildGroupMenu(column: ColumnDescriptor, dataSource: DataSource, menuActionClickHandler: MenuItemClickHandler, isAllowed?: boolean): MenuElement | null;
17
+ export declare const buildVisibilityMenuItems: (column: ColumnDescriptor, menuActionClickHandler: MenuItemClickHandler, isAllowed?: boolean) => MenuElements | null;
18
+ export declare const buildPinMenuItems: (column: ColumnDescriptor, menuActionClickHandler: MenuItemClickHandler, isAllowed?: boolean) => MenuElements;
19
+ export declare const buildSettingsMenuItems: (_: ColumnDescriptor, menuActionClickHandler: MenuItemClickHandler, allowColumnSettings?: boolean, allowTableSettings?: boolean | TableSettingsPermissions) => MenuElements | null;
20
+ export declare function buildAggregationMenuItems(column: ColumnDescriptor, dataSource: DataSource, menuActionClickHandler: MenuItemClickHandler, isAllowed?: boolean): MenuElements | null;
21
+ export {};
@@ -0,0 +1,18 @@
1
+ import { MenuActionHandler } from "@vuu-ui/vuu-context-menu";
2
+ import { Filter } from "@vuu-ui/vuu-filter-types";
3
+ import { VuuFilter } from "@vuu-ui/vuu-protocol-types";
4
+ import { ColumnDescriptor, RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
5
+ import { ColumnMenuActionType } from "./column-menu-utils";
6
+ import { ColumnDisplayAction, DisplaySettingsAction } from "./column-action-types";
7
+ import { DataSource } from "@vuu-ui/vuu-data-types";
8
+ export interface ContextMenuOptions {
9
+ column?: RuntimeColumnDescriptor;
10
+ filter?: Filter;
11
+ sort?: VuuFilter;
12
+ }
13
+ export interface ContextMenuHookProps {
14
+ dataSource: DataSource;
15
+ onColumnDisplayAction?: (action: ColumnDisplayAction) => void;
16
+ onDisplaySettingsAction?: (action: DisplaySettingsAction) => void;
17
+ }
18
+ export declare const useColumnActions: ({ dataSource, onColumnDisplayAction, onDisplaySettingsAction, }: ContextMenuHookProps) => MenuActionHandler<ColumnMenuActionType, ColumnDescriptor>;
@@ -0,0 +1,7 @@
1
+ import { DataSource } from "@vuu-ui/vuu-data-types";
2
+ import { HTMLAttributes } from "react";
3
+ interface DataSourceStatsProps extends HTMLAttributes<HTMLSpanElement> {
4
+ dataSource: DataSource;
5
+ }
6
+ export declare const DataSourceStats: ({ className: classNameProp, dataSource, }: DataSourceStatsProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./DatasourceStats";
@@ -0,0 +1,16 @@
1
+ export * from "./cell-edit-validators";
2
+ export * from "./cell-renderers";
3
+ export * from "./column-list";
4
+ export { ColumnMenu } from "./column-menu/ColumnMenu";
5
+ export { useColumnActions } from "./column-menu/useColumnActions";
6
+ export type { ColumnDisplayActionHandler, TableSettingsActionHandler, } from "./column-menu/column-action-types";
7
+ export { ColumnSettingsPanel } from "./table-column-settings/ColumnSettingsPanel";
8
+ export { useColumnSettings } from "./table-column-settings/useColumnSettings";
9
+ export { defaultTableSettingsPermissions, TableSettingsPanel, } from "./table-column-settings/TableSettingsPanel";
10
+ export { type ColumnItem, useTableSettings, } from "./table-column-settings/useTableSettings";
11
+ export { columnSettingsFromColumnMenuPermissions, tableSettingsFromColumnMenuPermissions, useTableAndColumnSettings, } from "./table-column-settings/useTableAndColumnSettings";
12
+ export * from "./column-expression-input";
13
+ export * from "./column-expression-panel";
14
+ export * from "./column-formatting-settings";
15
+ export * from "./datasource-stats";
16
+ export { TableProvider, useTableContext } from "./table-provider/TableProvider";
@@ -0,0 +1,7 @@
1
+ import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
+ import { MouseEventHandler } from "react";
3
+ export interface ColumnNameLabelProps {
4
+ column: ColumnDescriptor;
5
+ onClick: MouseEventHandler;
6
+ }
7
+ export declare const ColumnNameLabel: ({ column, onClick }: ColumnNameLabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ColumnSettingsProps } from "@vuu-ui/vuu-table-types";
2
+ export declare const ColumnSettingsPanel: ({ column: columnProp, onCancelCreateColumn, onConfigChange, onCreateCalculatedColumn, tableConfig, vuuTable, }: ColumnSettingsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { TableSettingsPermissions, TableSettingsProps } from "@vuu-ui/vuu-table-types";
2
+ export declare const defaultTableSettingsPermissions: Readonly<TableSettingsPermissions>;
3
+ /**
4
+ The TableSettingsPanel assumes 'ownership' of the tableSettings.
5
+ It updates the settings in state locally and notifies caller of
6
+ every change via onChange callback
7
+ */
8
+ export declare const TableSettingsPanel: ({ availableColumns, onAddCalculatedColumn, onConfigChange, onDataSourceConfigChange, onNavigateToColumn, tableConfig: tableConfigProp, permissions, }: TableSettingsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { ColumnDescriptor, ColumnTypeFormatting, ColumnSettingsProps } from "@vuu-ui/vuu-table-types";
2
+ import { CellRendererDescriptor, ColumnRenderPropsChangeHandler } from "@vuu-ui/vuu-utils";
3
+ import { VuuColumnDataType } from "@vuu-ui/vuu-protocol-types";
4
+ import { FormEventHandler } from "react";
5
+ import { DataValueTypeSimple } from "@vuu-ui/vuu-data-types";
6
+ export declare const useColumnSettings: ({ column: columnProp, onCancelCreateColumn, onConfigChange, onCreateCalculatedColumn, tableConfig, }: Omit<ColumnSettingsProps, "vuuTable">) => {
7
+ availableRenderers: CellRendererDescriptor[];
8
+ editCalculatedColumn: boolean;
9
+ column: ColumnDescriptor;
10
+ navigateNextColumn: () => void;
11
+ navigatePrevColumn: () => void;
12
+ onCancel: () => void;
13
+ onChange: FormEventHandler;
14
+ onChangeCalculatedColumnName: (name: string) => void;
15
+ onChangeFormatting: (formatting: ColumnTypeFormatting) => void;
16
+ onChangeRendering: ColumnRenderPropsChangeHandler;
17
+ onChangeServerDataType: (serverDataType: VuuColumnDataType) => void;
18
+ onChangeToggleButton: FormEventHandler;
19
+ onChangeType: (type: DataValueTypeSimple) => void;
20
+ onEditCalculatedColumn: () => void;
21
+ onInputCommit: () => void;
22
+ onSave: () => void;
23
+ };
@@ -0,0 +1,18 @@
1
+ import { DataSourceConfig, SchemaColumn } from "@vuu-ui/vuu-data-types";
2
+ import { ColumnDescriptor, ColumnMenuPermissions, SettingsPermissions, TableConfig } from "@vuu-ui/vuu-table-types";
3
+ import { DisplayColumnSettingsAction } from "@vuu-ui/vuu-table-extras/src/column-menu/column-action-types";
4
+ export interface TableAndColumnSettingsHookProps {
5
+ availableColumns: SchemaColumn[];
6
+ onAvailableColumnsChange?: (columns: SchemaColumn[]) => void;
7
+ onConfigChange: (config: TableConfig) => void;
8
+ onCreateCalculatedColumn: (column: ColumnDescriptor) => void;
9
+ onDataSourceConfigChange: (dataSourceConfig: DataSourceConfig) => void;
10
+ settingsPermissions?: SettingsPermissions;
11
+ tableConfig: TableConfig;
12
+ }
13
+ export declare const columnSettingsFromColumnMenuPermissions: (settings?: boolean | ColumnMenuPermissions) => boolean;
14
+ export declare const tableSettingsFromColumnMenuPermissions: (settings?: boolean | ColumnMenuPermissions) => boolean | Readonly<import("@vuu-ui/vuu-table-types").TableSettingsPermissions>;
15
+ export declare const useTableAndColumnSettings: ({ availableColumns: availableColumnsProps, settingsPermissions, onAvailableColumnsChange, onConfigChange, onCreateCalculatedColumn, onDataSourceConfigChange, tableConfig, }: TableAndColumnSettingsHookProps) => {
16
+ showColumnSettingsPanel: (action: DisplayColumnSettingsAction) => void;
17
+ showTableSettingsPanel: () => void;
18
+ };
@@ -0,0 +1,21 @@
1
+ import { ColumnDescriptor, TableConfig, TableSettingsProps } from "@vuu-ui/vuu-table-types";
2
+ import { CommitHandler } from "@vuu-ui/vuu-utils";
3
+ import { MouseEvent, SyntheticEvent } from "react";
4
+ import { ColumnChangeHandler } from "../column-list";
5
+ export type ColumnLike = {
6
+ name: string;
7
+ };
8
+ export type ColumnItem = Pick<ColumnDescriptor, "hidden" | "label" | "name" | "serverDataType"> & {
9
+ isCalculated: boolean;
10
+ subscribed: boolean;
11
+ };
12
+ export declare const useTableSettings: ({ availableColumns: availableColumnsProp, onConfigChange, onDataSourceConfigChange, tableConfig: tableConfigProp, }: Omit<TableSettingsProps, "onAddCalculatedColumn">) => {
13
+ columnItems: ColumnItem[];
14
+ columnLabelsValue: number;
15
+ onChangeColumnLabels: (evt: SyntheticEvent) => void;
16
+ onChangeTableAttribute: (evt: MouseEvent<HTMLButtonElement>) => void;
17
+ onColumnChange: ColumnChangeHandler;
18
+ onCommitColumnWidth: CommitHandler;
19
+ onReorderColumnItems: (columnItems: ColumnItem[]) => void;
20
+ tableConfig: TableConfig;
21
+ };
@@ -0,0 +1,17 @@
1
+ import { MenuActionHandler } from "@vuu-ui/vuu-context-menu";
2
+ import { DataSource } from "@vuu-ui/vuu-data-types";
3
+ import { ReactNode } from "react";
4
+ import { ColumnMenuActionType } from "../column-menu/column-menu-utils";
5
+ import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
6
+ export interface TableContextProps {
7
+ dataSource: DataSource;
8
+ menuActionHandler: MenuActionHandler<ColumnMenuActionType, ColumnDescriptor>;
9
+ }
10
+ export declare const TableContext: import("react").Context<TableContextProps>;
11
+ export declare const TableProvider: ({ children, dataSource, menuActionHandler, }: TableContextProps & {
12
+ children: ReactNode;
13
+ }) => import("react/jsx-runtime").JSX.Element;
14
+ export declare function useTableContext(throwIfNoDataSource?: boolean): {
15
+ dataSource: DataSource;
16
+ menuActionHandler: MenuActionHandler<ColumnMenuActionType, ColumnDescriptor>;
17
+ };