@vuu-ui/vuu-table-extras 3.3.8 → 3.3.10

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 (88) hide show
  1. package/package.json +12 -12
  2. package/src/csv-upload/CsvUpload.js +9 -6
  3. package/types/csv-upload/data-upload-preview/useDataUploadPreview.d.ts +1 -1
  4. package/types/src/calculated-column/CalculatedColumnPanel.d.ts +12 -0
  5. package/types/src/calculated-column/useCalculatedColumnPanel.d.ts +10 -0
  6. package/types/src/calculated-column/useEditCalculatedColumn.d.ts +13 -0
  7. package/types/src/cell-edit-validators/CaseValidator.d.ts +2 -0
  8. package/types/src/cell-edit-validators/PatternValidator.d.ts +2 -0
  9. package/types/src/cell-edit-validators/index.d.ts +2 -0
  10. package/types/src/cell-renderers/background-cell/BackgroundCell.d.ts +2 -0
  11. package/types/src/cell-renderers/background-cell/BackgroundCellConfigurationEditor.d.ts +2 -0
  12. package/types/src/cell-renderers/background-cell/index.d.ts +2 -0
  13. package/types/src/cell-renderers/background-cell/useDirection.d.ts +3 -0
  14. package/types/src/cell-renderers/button-cell/IconButtonCell.d.ts +6 -0
  15. package/types/src/cell-renderers/dropdown-cell/DropdownCell.d.ts +2 -0
  16. package/types/src/cell-renderers/dropdown-cell/index.d.ts +1 -0
  17. package/types/src/cell-renderers/index.d.ts +6 -0
  18. package/types/src/cell-renderers/lookup-cell/LookupCell.d.ts +2 -0
  19. package/types/src/cell-renderers/lookup-cell/index.d.ts +1 -0
  20. package/types/src/cell-renderers/pct-progress-cell/PctProgressCell.d.ts +2 -0
  21. package/types/src/cell-renderers/pct-progress-cell/index.d.ts +1 -0
  22. package/types/src/cell-renderers/progress-cell/ProgressCell.d.ts +1 -0
  23. package/types/src/cell-renderers/progress-cell/index.d.ts +1 -0
  24. package/types/src/column-expression-input/ColumnExpressionInput.d.ts +10 -0
  25. package/types/src/column-expression-input/column-function-descriptors.d.ts +15 -0
  26. package/types/src/column-expression-input/column-language-parser/ColumnExpressionLanguage.d.ts +2 -0
  27. package/types/src/column-expression-input/column-language-parser/ColumnExpressionTreeWalker.d.ts +57 -0
  28. package/types/src/column-expression-input/column-language-parser/column-expression-parse-utils.d.ts +5 -0
  29. package/types/src/column-expression-input/column-language-parser/generated/column-parser.d.ts +2 -0
  30. package/types/src/column-expression-input/column-language-parser/generated/column-parser.terms.d.ts +1 -0
  31. package/types/src/column-expression-input/column-language-parser/index.d.ts +3 -0
  32. package/types/src/column-expression-input/column-language-parser/test.d.mts +1 -0
  33. package/types/src/column-expression-input/functionDocInfo.d.ts +2 -0
  34. package/types/src/column-expression-input/highlighting.d.ts +1 -0
  35. package/types/src/column-expression-input/index.d.ts +4 -0
  36. package/types/src/column-expression-input/theme.d.ts +1 -0
  37. package/types/src/column-expression-input/useColumnAutoComplete.d.ts +6 -0
  38. package/types/src/column-expression-input/useColumnExpressionEditor.d.ts +25 -0
  39. package/types/src/column-expression-input/useColumnExpressionSuggestionProvider.d.ts +8 -0
  40. package/types/src/column-formatting-settings/BaseNumericFormattingSettings.d.ts +2 -0
  41. package/types/src/column-formatting-settings/ColumnFormattingPanel.d.ts +9 -0
  42. package/types/src/column-formatting-settings/DateTimeFormattingSettings.d.ts +3 -0
  43. package/types/src/column-formatting-settings/LongTypeFormattingSettings.d.ts +3 -0
  44. package/types/src/column-formatting-settings/index.d.ts +3 -0
  45. package/types/src/column-menu/ColumnMenu.d.ts +10 -0
  46. package/types/src/column-menu/column-action-types.d.ts +11 -0
  47. package/types/src/column-menu/column-menu-utils.d.ts +19 -0
  48. package/types/src/column-menu/useColumnActions.d.ts +16 -0
  49. package/types/src/column-picker/ColumnModel.d.ts +81 -0
  50. package/types/src/column-picker/ColumnPicker.d.ts +10 -0
  51. package/types/src/column-picker/ColumnPickerAction.d.ts +5 -0
  52. package/types/src/column-picker/useColumnPicker.d.ts +16 -0
  53. package/types/src/column-picker/useTableColumnPicker.d.ts +7 -0
  54. package/types/src/column-picker/useTableColumnPickerDeprecated.d.ts +14 -0
  55. package/types/src/column-settings-panel/ColumnNameLabel.d.ts +7 -0
  56. package/types/src/column-settings-panel/ColumnSettingsPanel.d.ts +5 -0
  57. package/types/src/column-settings-panel/useColumnSettings.d.ts +30 -0
  58. package/types/src/csv-export/export-utils.d.ts +42 -0
  59. package/types/src/csv-export/index.d.ts +2 -0
  60. package/types/src/csv-export/useCsvExport.d.ts +14 -0
  61. package/types/src/csv-upload/CsvUpload.d.ts +68 -0
  62. package/types/src/csv-upload/data-upload-preview/DataUploadPreview.d.ts +10 -0
  63. package/types/src/csv-upload/data-upload-preview/useDataUploadPreview.d.ts +17 -0
  64. package/types/src/csv-upload/index.d.ts +7 -0
  65. package/types/src/csv-upload/parse/csv-constants.d.ts +3 -0
  66. package/types/src/csv-upload/parse/csv-errors.d.ts +46 -0
  67. package/types/src/csv-upload/parse/csv-parse.d.ts +11 -0
  68. package/types/src/csv-upload/parse/csv-schema-validation.d.ts +16 -0
  69. package/types/src/csv-upload/parse/csv-upload-utils.d.ts +21 -0
  70. package/types/src/csv-upload/parse/index.d.ts +5 -0
  71. package/types/src/csv-upload/useCsvUpload.d.ts +42 -0
  72. package/types/src/datasource-stats/DatasourceStats.d.ts +17 -0
  73. package/types/src/datasource-stats/useDatasourceStats.d.ts +15 -0
  74. package/types/src/freeze-control/FreezeControl.d.ts +15 -0
  75. package/types/src/freeze-control/FrozenBanner.d.ts +6 -0
  76. package/types/src/freeze-control/freezeControlBadge.d.ts +11 -0
  77. package/types/src/freeze-control/useFreezeControl.d.ts +10 -0
  78. package/types/src/index.d.ts +26 -0
  79. package/types/src/inline-add-row/InlineAddRow.d.ts +3 -0
  80. package/types/src/inline-add-row/index.d.ts +2 -0
  81. package/types/src/inline-add-row/useInlineAddRow.d.ts +59 -0
  82. package/types/src/tabbed-table-config-panel/TabbedTableConfigPanel.d.ts +17 -0
  83. package/types/src/tabbed-table-config-panel/TabbedTableSettingsAction.d.ts +7 -0
  84. package/types/src/tabbed-table-config-panel/useTabbedTableConfigPanel.d.ts +13 -0
  85. package/types/src/table-footer/TableFooter.d.ts +10 -0
  86. package/types/src/table-provider/TableProvider.d.ts +18 -0
  87. package/types/src/table-settings-panel/TableSettingsPanel.d.ts +22 -0
  88. package/types/src/table-settings-panel/useTableSettings.d.ts +14 -0
@@ -0,0 +1,14 @@
1
+ import type { DataSource } from "@vuu-ui/vuu-data-types";
2
+ import { ColumnDescriptor, TableConfigChangeHandler } from "@vuu-ui/vuu-table-types";
3
+ export type TableColumnChangeHandler = (columns: ColumnDescriptor[], change: unknown) => void;
4
+ export interface ColumnPickerHookProps {
5
+ readonly availableColumns: ColumnDescriptor[];
6
+ dataSource: DataSource;
7
+ readonly selectedColumns: ColumnDescriptor[];
8
+ onTableColumnChange?: TableColumnChangeHandler;
9
+ }
10
+ export declare const useTableColumnPickerDeprecated: ({ availableColumns, dataSource, onTableColumnChange, selectedColumns: initialSelectedColumns, }: ColumnPickerHookProps) => {
11
+ onTableConfigChange: TableConfigChangeHandler;
12
+ showColumnPicker: (title?: string) => void;
13
+ selectedColumns: ColumnDescriptor[];
14
+ };
@@ -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.Element;
@@ -0,0 +1,5 @@
1
+ import { ColumnSettingsProps } from "./useColumnSettings";
2
+ export interface ColumnSettinsPanelProps extends ColumnSettingsProps {
3
+ onClickEditCalculatedColumn?: () => void;
4
+ }
5
+ export declare const ColumnSettingsPanel: ({ column: columnProp, columnModel, onClickEditCalculatedColumn, onConfigChange, }: ColumnSettinsPanelProps) => import("react").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { ColumnDescriptor, TableConfig, ColumnTypeFormatting } from "@vuu-ui/vuu-table-types";
2
+ import { CellRendererDescriptor, ColumnRenderPropsChangeHandler } from "@vuu-ui/vuu-utils";
3
+ import { VuuColumnDataType, VuuTable } from "@vuu-ui/vuu-protocol-types";
4
+ import { FormEventHandler } from "react";
5
+ import { DataValueTypeSimple } from "@vuu-ui/vuu-data-types";
6
+ import { ColumnModel } from "../column-picker/ColumnModel";
7
+ /**
8
+ * Describes the props for a Column Configuration Editor, for which
9
+ * an implementation is provided in vuu-table-extras
10
+ */
11
+ export interface ColumnSettingsProps {
12
+ column: ColumnDescriptor;
13
+ columnModel: ColumnModel;
14
+ onConfigChange?: (config: TableConfig) => void;
15
+ vuuTable?: VuuTable;
16
+ }
17
+ export declare const useColumnSettings: ({ column: columnProp, columnModel, }: Omit<ColumnSettingsProps, "vuuTable">) => {
18
+ availableRenderers: CellRendererDescriptor[];
19
+ column: ColumnDescriptor;
20
+ navigateNextColumn: () => void;
21
+ navigatePrevColumn: () => void;
22
+ onChange: FormEventHandler;
23
+ onChangeCalculatedColumnName: (name: string) => void;
24
+ onChangeFormatting: (formatting: ColumnTypeFormatting) => void;
25
+ onChangeRendering: ColumnRenderPropsChangeHandler;
26
+ onChangeServerDataType: (serverDataType: VuuColumnDataType) => void;
27
+ onChangeToggleButton: FormEventHandler;
28
+ onChangeType: (type: DataValueTypeSimple) => void;
29
+ onInputCommit: () => void;
30
+ };
@@ -0,0 +1,42 @@
1
+ import type { CopyOption, DataSource, SessionDataSourceOverrides } from "@vuu-ui/vuu-data-types";
2
+ export type ExportColumnDescriptor<TName extends string = string> = {
3
+ name: TName;
4
+ /** Override the column name used as the CSV header label. */
5
+ label?: string;
6
+ exportFormatter?: (value: unknown) => string;
7
+ };
8
+ export interface ExportToCsvOptions<TName extends string = string> {
9
+ filename?: string;
10
+ copyOption?: CopyOption;
11
+ excludeColumns?: string[];
12
+ maxRows?: number;
13
+ columnDescriptors?: ExportColumnDescriptor<TName>[];
14
+ overrides?: SessionDataSourceOverrides;
15
+ /** Timeout in milliseconds before the export times out. Default: 30_000ms (0 to disable). */
16
+ timeout?: number;
17
+ onError?: (error: Error) => void;
18
+ onSuccess?: () => void;
19
+ }
20
+ export interface ExportCsvTemplateOptions {
21
+ filename?: string;
22
+ excludeColumns?: string[];
23
+ columns?: string[];
24
+ overrides?: SessionDataSourceOverrides;
25
+ /** Timeout in milliseconds before template generation times out. Default: 10_000ms (0 to disable). */
26
+ timeout?: number;
27
+ onError?: (error: Error) => void;
28
+ onSuccess?: () => void;
29
+ }
30
+ /** Downloads a single-row CSV containing only the column headers, for use as an import template. */
31
+ export declare const exportCsvTemplate: (dataSource: DataSource, options?: ExportCsvTemplateOptions) => Promise<void>;
32
+ /**
33
+ * Subscribes to `dataSource` (creating an export session data source if a view data source is passed),
34
+ * collects all rows in memory in index order, serialises them to CSV (excluding internal session columns),
35
+ * then triggers a browser download. The session data source is unsubscribed automatically once the download
36
+ * is initiated.
37
+ */
38
+ export declare const exportSessionTableToCsv: <TName extends string = string>(dataSource: DataSource, options?: ExportToCsvOptions<TName>) => Promise<void>;
39
+ /**
40
+ * Creates an export session table from `dataSource`, collects all rows in memory, then triggers a CSV download.
41
+ */
42
+ export declare const exportToCsv: <TName extends string = string>(dataSource: DataSource, options?: ExportToCsvOptions<TName>) => Promise<void>;
@@ -0,0 +1,2 @@
1
+ export { exportCsvTemplate, exportSessionTableToCsv, exportToCsv, type ExportColumnDescriptor, type ExportCsvTemplateOptions, type ExportToCsvOptions, } from "./export-utils";
2
+ export { useCsvExport, type UseCsvExportProps, type UseCsvExportResult, } from "./useCsvExport";
@@ -0,0 +1,14 @@
1
+ import type { DataSource } from "@vuu-ui/vuu-data-types";
2
+ import { type ExportCsvTemplateOptions, type ExportToCsvOptions } from "./export-utils";
3
+ export interface UseCsvExportProps {
4
+ dataSource?: DataSource;
5
+ onError?: (error: Error) => void;
6
+ onSuccess?: () => void;
7
+ }
8
+ export interface UseCsvExportResult {
9
+ isExporting: boolean;
10
+ error: Error | null;
11
+ exportCsv: <TName extends string = string>(options?: ExportToCsvOptions<TName>, overrideDataSource?: DataSource) => Promise<void>;
12
+ exportTemplate: (options?: ExportCsvTemplateOptions, overrideDataSource?: DataSource) => Promise<void>;
13
+ }
14
+ export declare function useCsvExport(propsOrDataSource?: DataSource | UseCsvExportProps): UseCsvExportResult;
@@ -0,0 +1,68 @@
1
+ import { type ReactNode } from "react";
2
+ import type { RowDefaultDataItemValues, EditSession } from "@vuu-ui/vuu-data-editing";
3
+ import type { CsvParseError, CsvParseOptions } from "./parse/csv-parse";
4
+ import type { CsvValidationStructuredError } from "./parse/csv-schema-validation";
5
+ import type { DataSource, TableSchema } from "@vuu-ui/vuu-data-types";
6
+ import type { VuuTable } from "@vuu-ui/vuu-protocol-types";
7
+ import type { CsvUploadTableData } from "./parse/csv-upload-utils";
8
+ export type CsvUploadImportedResult = {
9
+ tableData: CsvUploadTableData;
10
+ };
11
+ export type CsvUploadPreviewResult = {
12
+ dataSource: DataSource;
13
+ editSession: EditSession;
14
+ tableData: CsvUploadTableData;
15
+ };
16
+ export type CsvUploadErrors = {
17
+ schemaError?: CsvUploadError;
18
+ validationError?: CsvUploadError;
19
+ importError?: CsvUploadError;
20
+ };
21
+ export type CsvUploadError = {
22
+ message: string;
23
+ parseError?: CsvParseError;
24
+ validationError?: CsvValidationStructuredError;
25
+ source: "schema" | "validation" | "import";
26
+ };
27
+ export type CsvUploadErrorResult = {
28
+ errors: CsvUploadErrors;
29
+ };
30
+ export type CsvUploadSessionTable = VuuTable;
31
+ export type CsvUploadSessionEndReason = "saved" | "discarded" | "failed";
32
+ export type CsvUploadSessionEndResult = {
33
+ reason: CsvUploadSessionEndReason;
34
+ sessionTable?: CsvUploadSessionTable;
35
+ };
36
+ export type CsvUploadPhase = "idle" | "processing" | "preview-ready" | "importing" | "imported" | "failed";
37
+ export interface CsvUploadProps {
38
+ children?: ReactNode;
39
+ dataSource: DataSource;
40
+ embedded?: boolean;
41
+ /**
42
+ * Schema of the import table, where it differs from the target table. Used to validate
43
+ * the CSV and to determine the session datasource columns. If omitted and importTable is
44
+ * provided, the schema is fetched via getTableSchema. Pass a stable reference.
45
+ */
46
+ importSchema?: TableSchema;
47
+ /** Expected import table, used to validate the session table returned by the server. */
48
+ importTable?: VuuTable;
49
+ onImportSessionStarted?: (dataSource: DataSource) => void;
50
+ onImportSessionEnded?: (result: CsvUploadSessionEndResult) => void;
51
+ onError?: (result: CsvUploadErrorResult | undefined) => void;
52
+ onImported?: (result: CsvUploadImportedResult) => void;
53
+ onPreview?: (result: CsvUploadPreviewResult) => void;
54
+ onProcessingStarted?: () => void;
55
+ dialogTitle?: string;
56
+ maxRows?: number;
57
+ onCancel?: () => void;
58
+ onClose?: () => void;
59
+ open?: boolean;
60
+ parseOptions?: CsvParseOptions;
61
+ importMode?: "direct" | "preview";
62
+ rowDefaults?: RowDefaultDataItemValues;
63
+ /**
64
+ * Custom renderer for the error panel.
65
+ */
66
+ renderError?: (error: CsvUploadErrorResult) => ReactNode;
67
+ }
68
+ export declare const CsvUpload: (props: CsvUploadProps) => import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { TableSchema } from "@vuu-ui/vuu-data-types";
2
+ import { type EditSession } from "@vuu-ui/vuu-data-editing";
3
+ import type { HTMLAttributes } from "react";
4
+ export interface DataUploadPreviewProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
5
+ editSession: EditSession;
6
+ onClose: () => void;
7
+ saveLabel?: string;
8
+ tableSchema: TableSchema;
9
+ }
10
+ export declare const DataUploadPreview: ({ className, editSession, onClose, saveLabel, tableSchema, ...htmlAttributes }: DataUploadPreviewProps) => import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { DataSource } from "@vuu-ui/vuu-data-types";
2
+ import type { EditSession } from "@vuu-ui/vuu-data-editing";
3
+ export interface UseDataUploadPreviewProps {
4
+ dataSource: DataSource;
5
+ editSession: EditSession;
6
+ onClose: () => void;
7
+ }
8
+ export declare const getSessionDataSource: (editSession: EditSession) => DataSource;
9
+ export declare const useDataUploadPreview: ({ dataSource, editSession, onClose, }: UseDataUploadPreviewProps) => {
10
+ canCancel: boolean;
11
+ canSave: boolean;
12
+ hasSelection: boolean;
13
+ onCancel: () => Promise<void>;
14
+ onDelete: () => Promise<import("@vuu-ui/vuu-protocol-types").RpcResult>;
15
+ onSave: (force?: boolean) => Promise<void>;
16
+ sessionError: string | undefined;
17
+ };
@@ -0,0 +1,7 @@
1
+ export { CsvUpload, type CsvUploadError, type CsvUploadProps, type CsvUploadErrorResult, type CsvUploadErrors, type CsvUploadPhase, type CsvUploadImportedResult, type CsvUploadPreviewResult, type CsvUploadSessionEndReason, type CsvUploadSessionEndResult, type CsvUploadSessionTable, } from "./CsvUpload";
2
+ export { useCsvUpload, type CsvUploadHookProps, type UseCsvUploadReturn, } from "./useCsvUpload";
3
+ export { DataUploadPreview, type DataUploadPreviewProps, } from "./data-upload-preview/DataUploadPreview";
4
+ export { validateCsvAgainstSchema, type CsvValidationOptions, type CsvValidationResult, } from "./parse/csv-schema-validation";
5
+ export { parseCsv, type CsvParseOptions, type CsvParseResult, } from "./parse/csv-parse";
6
+ export { CsvValidationErrorEnum, CsvParseErrorEnum, type CsvError, type CsvErrorMap, type CsvStructuredError, type CsvValidationError, type CsvValidationErrorMap, type CsvValidationErrorType, type CsvValidationStructuredError, type CsvParseError, type CsvParseErrorMap, } from "./parse/csv-errors";
7
+ export { CSV_FIRST_DATA_ROW_NUMBER, CSV_HEADER_ROW_NUMBER, } from "./parse/csv-constants";
@@ -0,0 +1,3 @@
1
+ export declare const CSV_HEADER_ROW_NUMBER = 1;
2
+ export declare const CSV_FIRST_DATA_ROW_NUMBER = 2;
3
+ export declare const MAX_ROWS_IN_CSV = 10000;
@@ -0,0 +1,46 @@
1
+ export declare enum CsvParseErrorEnum {
2
+ EMPTY_FILE = "EMPTY_FILE",
3
+ INVALID_SEPARATOR = "INVALID_SEPARATOR",
4
+ INVALID_FORMAT = "INVALID_FORMAT",
5
+ UNQUOTED_VALUE = "UNQUOTED_VALUE",
6
+ EMPTY_HEADER_COLUMN = "EMPTY_HEADER_COLUMN",
7
+ DUPLICATE_HEADER_COLUMN = "DUPLICATE_HEADER_COLUMN",
8
+ ROW_COLUMN_COUNT_MISMATCH = "ROW_COLUMN_COUNT_MISMATCH"
9
+ }
10
+ export declare enum CsvValidationErrorEnum {
11
+ MISSING_KEY_COLUMN = "MISSING_KEY_COLUMN",
12
+ UNKNOWN_COLUMN = "UNKNOWN_COLUMN",
13
+ MAX_ROWS_EXCEEDED = "MAX_ROWS_EXCEEDED",
14
+ EMPTY_NON_STRING_VALUE = "EMPTY_NON_STRING_VALUE",
15
+ TYPE_MISMATCH = "TYPE_MISMATCH"
16
+ }
17
+ export type CsvErrorMap<TError extends string> = {
18
+ rowErrors: Record<number, Record<string, TError[]>>;
19
+ fileErrors: Record<string, TError[]>;
20
+ };
21
+ export type CsvStructuredError<TError extends string> = {
22
+ rowNum: number;
23
+ column: string;
24
+ value: string;
25
+ message: string;
26
+ errorEnum: TError;
27
+ };
28
+ export type CsvError<TError extends string> = {
29
+ errorMap: CsvErrorMap<TError>;
30
+ errors: CsvStructuredError<TError>[];
31
+ message: string;
32
+ };
33
+ export type CsvErrorState<TError extends string> = {
34
+ errorMap: CsvErrorMap<TError>;
35
+ errors: CsvStructuredError<TError>[];
36
+ };
37
+ export declare const createCsvErrorState: <TError extends string>() => CsvErrorState<TError>;
38
+ export declare const addCsvFileError: <TError extends string>(state: CsvErrorState<TError>, columnName: string, error: TError, message: string, value?: string) => void;
39
+ export declare const addCsvRowError: <TError extends string>(state: CsvErrorState<TError>, rowNum: number, columnName: string, error: TError, message: string, value?: string) => void;
40
+ export declare const hasCsvErrors: <TError extends string>(errorMap: CsvErrorMap<TError>) => boolean;
41
+ export type CsvParseErrorMap = CsvErrorMap<CsvParseErrorEnum>;
42
+ export type CsvParseError = CsvError<CsvParseErrorEnum>;
43
+ export type CsvValidationErrorType = CsvValidationErrorEnum | CsvParseErrorEnum;
44
+ export type CsvValidationErrorMap = CsvErrorMap<CsvValidationErrorEnum>;
45
+ export type CsvValidationStructuredError = CsvError<CsvValidationErrorType>;
46
+ export type CsvValidationError = CsvStructuredError<CsvValidationErrorType>;
@@ -0,0 +1,11 @@
1
+ import { type CsvParseError } from "./csv-errors";
2
+ export { CsvParseErrorEnum, type CsvError, type CsvErrorMap, type CsvStructuredError, type CsvParseError, type CsvParseErrorMap, } from "./csv-errors";
3
+ export type CsvParseResult = {
4
+ error?: CsvParseError;
5
+ header: string[];
6
+ rows: string[][];
7
+ };
8
+ export type CsvParseOptions = {
9
+ requireQuotedValues?: boolean;
10
+ };
11
+ export declare const parseCsv: (csvText: string, options?: CsvParseOptions) => CsvParseResult;
@@ -0,0 +1,16 @@
1
+ import type { TableSchema } from "@vuu-ui/vuu-data-types";
2
+ import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
3
+ import type { CsvValidationError, CsvValidationErrorMap, CsvParseError } from "./csv-errors";
4
+ import type { CsvParseResult } from "./csv-parse";
5
+ export { CsvValidationErrorEnum, type CsvValidationError, type CsvValidationErrorMap, type CsvValidationErrorType, type CsvValidationStructuredError, } from "./csv-errors";
6
+ export type CsvValidationResult = {
7
+ columns: string[];
8
+ errorMap: CsvValidationErrorMap;
9
+ errors: CsvValidationError[];
10
+ parseRowError?: CsvParseError;
11
+ rows: Record<string, VuuRowDataItemType>[];
12
+ };
13
+ export type CsvValidationOptions = {
14
+ maxRows?: number;
15
+ };
16
+ export declare const validateCsvAgainstSchema: (parsed: CsvParseResult, tableSchema: TableSchema, options?: CsvValidationOptions) => CsvValidationResult;
@@ -0,0 +1,21 @@
1
+ import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
2
+ import type { CsvUploadError } from "../CsvUpload";
3
+ import type { CsvParseError } from "./csv-parse";
4
+ import type { CsvValidationError, CsvValidationResult } from "./csv-schema-validation";
5
+ export type CsvUploadTableData = {
6
+ columns: string[];
7
+ rows: VuuRowDataItemType[][];
8
+ };
9
+ export declare const toErrorMessage: (error: unknown) => string;
10
+ export declare const isCsvParseError: (value: unknown) => value is CsvParseError;
11
+ export declare const hasFileParseErrors: (parseError: CsvParseError) => boolean;
12
+ export declare const createUploadError: (source: CsvUploadError["source"], message: string, parseError?: CsvParseError, validationError?: CsvUploadError["validationError"]) => CsvUploadError;
13
+ export declare const mergeValidationWithParseErrors: (schemaValidation: CsvValidationResult, parseError: CsvParseError | undefined) => CsvValidationResult;
14
+ export declare const buildRowErrorMessage: (prefix: string, rowErrors: string[]) => string;
15
+ export declare const toValidationErrorsFromParseRowErrors: (parseError: CsvParseError) => CsvValidationError[];
16
+ export declare const normalizeTableData: (value: unknown, fallback: CsvUploadTableData) => CsvUploadTableData;
17
+ export type RpcBatchResult = {
18
+ errors: string[];
19
+ results: unknown[];
20
+ };
21
+ export declare const executeBatchRpcCalls: <T>(items: T[], executor: (item: T) => Promise<unknown>, errorFormatter: (item: T, error: string) => string) => Promise<RpcBatchResult>;
@@ -0,0 +1,5 @@
1
+ export { CSV_FIRST_DATA_ROW_NUMBER, CSV_HEADER_ROW_NUMBER, } from "./csv-constants";
2
+ export { CsvParseErrorEnum, CsvValidationErrorEnum, type CsvError, type CsvErrorMap, type CsvErrorState, type CsvParseError, type CsvParseErrorMap, type CsvStructuredError, type CsvValidationError, type CsvValidationErrorMap, type CsvValidationErrorType, type CsvValidationStructuredError, addCsvFileError, addCsvRowError, createCsvErrorState, hasCsvErrors, } from "./csv-errors";
3
+ export { parseCsv, type CsvParseOptions, type CsvParseResult, } from "./csv-parse";
4
+ export { validateCsvAgainstSchema, type CsvValidationOptions, type CsvValidationResult, } from "./csv-schema-validation";
5
+ export { buildRowErrorMessage, executeBatchRpcCalls, hasFileParseErrors, isCsvParseError, mergeValidationWithParseErrors, normalizeTableData, toErrorMessage, toValidationErrorsFromParseRowErrors, type CsvUploadTableData, type RpcBatchResult, } from "./csv-upload-utils";
@@ -0,0 +1,42 @@
1
+ import type { DataSource, TableSchema } from "@vuu-ui/vuu-data-types";
2
+ import { type RowDefaultDataItemValues } from "@vuu-ui/vuu-data-editing";
3
+ import type { VuuTable } from "@vuu-ui/vuu-protocol-types";
4
+ import { type CsvParseOptions } from "./parse/csv-parse";
5
+ import { type CsvValidationResult } from "./parse/csv-schema-validation";
6
+ import type { CsvUploadErrorResult, CsvUploadImportedResult, CsvUploadPreviewResult, CsvUploadSessionEndResult, CsvUploadSessionTable } from "./CsvUpload";
7
+ export interface CsvUploadHookProps {
8
+ dataSource: DataSource;
9
+ importMode?: "direct" | "preview";
10
+ /**
11
+ * Schema of the import table, where it differs from the target table. Used to validate
12
+ * the CSV and to determine the session datasource columns. If omitted and importTable is
13
+ * provided, the schema is fetched via getTableSchema. Pass a stable reference.
14
+ */
15
+ importSchema?: TableSchema;
16
+ /** Expected import table, used to validate the session table returned by the server. */
17
+ importTable?: VuuTable;
18
+ maxRows?: number;
19
+ onImportSessionEnded?: (result: CsvUploadSessionEndResult) => void;
20
+ onImportSessionStarted?: (dataSource: DataSource) => void;
21
+ onError?: (result: CsvUploadErrorResult | undefined) => void;
22
+ onImported?: (result: CsvUploadImportedResult) => void;
23
+ onPreview?: (result: CsvUploadPreviewResult) => void;
24
+ onProcessingStarted?: () => void;
25
+ parseOptions?: CsvParseOptions;
26
+ /** Default column values applied to every addRow call. Pass a stable reference — a new object triggers EditSession recreation. */
27
+ rowDefaults?: RowDefaultDataItemValues;
28
+ }
29
+ export type UseCsvUploadReturn = {
30
+ canImport: boolean;
31
+ cancelImport: () => Promise<void>;
32
+ importData: () => Promise<boolean>;
33
+ isImporting: boolean;
34
+ isProcessingFile: boolean;
35
+ onDrop: (_event: React.DragEvent<HTMLDivElement>, files: File[]) => void;
36
+ onTriggerChange: (_event: React.ChangeEvent<HTMLInputElement>, files: File[]) => void;
37
+ sessionTable: CsvUploadSessionTable | undefined;
38
+ schema: TableSchema | undefined;
39
+ validation: CsvValidationResult | undefined;
40
+ error: CsvUploadErrorResult | undefined;
41
+ };
42
+ export declare const useCsvUpload: ({ dataSource, importMode, importSchema, importTable, onImportSessionEnded, onImportSessionStarted, onError, onImported, onPreview, onProcessingStarted, maxRows, parseOptions, rowDefaults, }: CsvUploadHookProps) => UseCsvUploadReturn;
@@ -0,0 +1,17 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ import { DatasourceStatsHookProps } from "./useDatasourceStats";
3
+ export type ItemLabel = string | {
4
+ singlular: string;
5
+ plural: string;
6
+ };
7
+ export interface DataSourceStatsProps extends DatasourceStatsHookProps, Omit<HTMLAttributes<HTMLDivElement>, "children"> {
8
+ /**
9
+ * children will be displayed when selection present. Intended
10
+ * use case is display of action button(s) that will operate on
11
+ * selected rows.
12
+ */
13
+ children?: ReactNode;
14
+ selectionActions?: ReactNode;
15
+ tooltrayActions?: ReactNode;
16
+ }
17
+ export declare const DataSourceStats: ({ children, className, dataSource, showRowStats, tooltrayActions, ...htmlAttributes }: DataSourceStatsProps) => import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { DataSource } from "@vuu-ui/vuu-data-types";
2
+ import { Range } from "@vuu-ui/vuu-utils";
3
+ export interface DatasourceStatsHookProps {
4
+ dataSource: DataSource;
5
+ showFreezeStatus?: boolean;
6
+ showRowStats?: boolean;
7
+ showSelectionStats?: boolean;
8
+ }
9
+ export declare const useDatasourceStats: ({ dataSource, }: DatasourceStatsHookProps) => {
10
+ range: Range;
11
+ selectedCount: number;
12
+ size: number;
13
+ freezeTime: string | undefined;
14
+ maxScroll: number;
15
+ };
@@ -0,0 +1,15 @@
1
+ import { type FreezeProps } from "./useFreezeControl";
2
+ import { HTMLAttributes } from "react";
3
+ export interface FreezeControlProps extends HTMLAttributes<HTMLDivElement>, FreezeProps {
4
+ /**
5
+ * Label shown when the table is frozen next to the new record badge.
6
+ * @default "New Orders"
7
+ */
8
+ newItemsLabel?: string;
9
+ /**
10
+ * Duration of the flash animation for the badge (in seconds).
11
+ * @default 0.25
12
+ */
13
+ flashDuration?: number;
14
+ }
15
+ export declare const FreezeControl: ({ dataSource, className, newItemsLabel, flashDuration, ...htmlAttributes }: FreezeControlProps) => import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { HTMLAttributes } from "react";
2
+ import { DataSource } from "@vuu-ui/vuu-data-types";
3
+ export interface FrozenBannerProps extends HTMLAttributes<HTMLDivElement> {
4
+ dataSource: DataSource;
5
+ }
6
+ export declare const FrozenBanner: ({ dataSource, className, ...htmlAttributes }: FrozenBannerProps) => import("react").JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Calculates the badge value and overflow state for FreezeControl
3
+ * It should max at 99, and when this is exceeded show 99+
4
+ *
5
+ * @param newRecordCount - int of new records
6
+ * @returns An object with `badgeValue` (the displayed number, max 99) and `isOverflow` (whether count exceeds 99)
7
+ */
8
+ export declare const calculateBadgeState: (newRecordCount: number) => {
9
+ badgeValue: number;
10
+ isOverflow: boolean;
11
+ };
@@ -0,0 +1,10 @@
1
+ import { DataSource } from "@vuu-ui/vuu-data-types";
2
+ import { SyntheticEvent } from "react";
3
+ export interface FreezeProps {
4
+ dataSource: DataSource;
5
+ }
6
+ export declare const useFreezeControl: ({ dataSource }: FreezeProps) => {
7
+ isFrozen: boolean;
8
+ newRecordCount: number;
9
+ onToggleChange: (evt: SyntheticEvent<HTMLButtonElement>) => void;
10
+ };
@@ -0,0 +1,26 @@
1
+ export { CalculatedColumnPanel } from "./calculated-column/CalculatedColumnPanel";
2
+ export * from "./csv-export";
3
+ export * from "./csv-upload";
4
+ export * from "./cell-edit-validators";
5
+ export * from "./cell-renderers";
6
+ export * from "./column-expression-input";
7
+ export * from "./column-formatting-settings";
8
+ export type { ColumnDisplayActionHandler, TableSettingsActionHandler, } from "./column-menu/column-action-types";
9
+ export { ColumnMenu } from "./column-menu/ColumnMenu";
10
+ export { useColumnActions } from "./column-menu/useColumnActions";
11
+ export { ColumnChangeSource, ColumnModel, isColumnAdded, isColumnRemoved, isColumnsReordered, SelectedColumnChangeType, type ColumnEvents, type ColumnsChangeHandler, } from "./column-picker/ColumnModel";
12
+ export { ColumnPicker, type ColumnPickerProps, } from "./column-picker/ColumnPicker";
13
+ export { ColumnPickerAction } from "./column-picker/ColumnPickerAction";
14
+ export type { SelectedColumnsChangeHandler } from "./column-picker/useColumnPicker";
15
+ export { useTableColumnPicker } from "./column-picker/useTableColumnPicker";
16
+ export { ColumnSettingsPanel } from "./column-settings-panel/ColumnSettingsPanel";
17
+ export { useColumnSettings } from "./column-settings-panel/useColumnSettings";
18
+ export { DataSourceStats, type DataSourceStatsProps, } from "./datasource-stats/DatasourceStats";
19
+ export { FreezeControl } from "./freeze-control/FreezeControl";
20
+ export { FrozenBanner } from "./freeze-control/FrozenBanner";
21
+ export * from "./inline-add-row";
22
+ export { TabbedTableConfigPanel } from "./tabbed-table-config-panel/TabbedTableConfigPanel";
23
+ export { TabbedTableSettingsAction } from "./tabbed-table-config-panel/TabbedTableSettingsAction";
24
+ export { TableFooter, TableFooterTray } from "./table-footer/TableFooter";
25
+ export { TableProvider, useTableContext } from "./table-provider/TableProvider";
26
+ export { defaultTableSettingsPermissions, TableSettingsPanel, type TableDisplayAttributeChangeHandler, } from "./table-settings-panel/TableSettingsPanel";
@@ -0,0 +1,3 @@
1
+ import type { BaseRowProps } from "@vuu-ui/vuu-table-types";
2
+ export type InlineAddRowProps = BaseRowProps;
3
+ export declare const InlineAddRow: ({ ariaRowIndex, className, columns, style, }: InlineAddRowProps) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { InlineAddRow, type InlineAddRowProps } from "./InlineAddRow";
2
+ export { useInlineAddRow, type UseInlineAddRowProps } from "./useInlineAddRow";
@@ -0,0 +1,59 @@
1
+ import type { DataRow, RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
+ export interface UseInlineAddRowProps {
3
+ columns: RuntimeColumnDescriptor[];
4
+ }
5
+ export declare const useInlineAddRow: ({ columns }: UseInlineAddRowProps) => {
6
+ containerRef: import("react").RefObject<HTMLDivElement | null>;
7
+ dataRow: DataRow;
8
+ draftRevision: number;
9
+ inlineAddColumns: {
10
+ editableBulk?: import("@vuu-ui/vuu-data-types").BulkEdit;
11
+ name: string;
12
+ required?: boolean;
13
+ serverDataType?: import("@vuu-ui/vuu-protocol-types").VuuColumnDataType;
14
+ type?: import("@vuu-ui/vuu-data-types").DataValueType;
15
+ aggregate?: import("@vuu-ui/vuu-protocol-types").VuuAggType;
16
+ allowColumnHeaderMenu?: false;
17
+ colHeaderContentRenderer?: string;
18
+ colHeaderLabelRenderer?: string;
19
+ exportFormatter?: (value: unknown) => string;
20
+ getIcon?: (row: DataRow) => string | undefined;
21
+ groupable?: boolean;
22
+ hidden?: boolean;
23
+ locked?: Exclude<import("@vuu-ui/vuu-table-types").PinLocation, "left"> | false;
24
+ maxWidth?: number;
25
+ minWidth?: number;
26
+ pin?: import("@vuu-ui/vuu-table-types").PinLocation | false;
27
+ removeable?: boolean;
28
+ selected?: boolean;
29
+ source?: "client" | "server";
30
+ status?: import("@salt-ds/core").ValidationStatus;
31
+ align?: "left" | "right";
32
+ ariaColIndex: number;
33
+ HeaderCellContentRenderer?: import("react").FunctionComponent<Omit<import("@vuu-ui/vuu-table-types").HeaderCellProps, "id" | "index">>;
34
+ HeaderCellLabelRenderer?: import("react").FunctionComponent<Omit<import("@vuu-ui/vuu-table-types").HeaderCellProps, "id" | "index">>;
35
+ canStretch?: boolean;
36
+ className?: string;
37
+ clientSideEditValidationCheck?: import("@vuu-ui/vuu-data-types").DataValueValidationChecker;
38
+ draggable?: boolean;
39
+ filter?: import("@vuu-ui/vuu-filter-types").Filter;
40
+ flex?: number;
41
+ heading?: [...string[]];
42
+ isGroup?: boolean;
43
+ isSystemColumn?: boolean;
44
+ label: string;
45
+ marginLeft?: number;
46
+ moving?: boolean;
47
+ originalIdx?: number;
48
+ pinnedOffset?: number;
49
+ pinnedWidth?: number;
50
+ resizeable?: boolean;
51
+ resizing?: boolean;
52
+ sortable?: boolean;
53
+ sorted?: import("@vuu-ui/vuu-table-types").ColumnSort;
54
+ valueFormatter: import("@vuu-ui/vuu-table-types").ValueFormatter;
55
+ width: number;
56
+ editable: boolean;
57
+ CellRenderer: import("react").FunctionComponent<import("@vuu-ui/vuu-table-types").TableCellRendererProps> | undefined;
58
+ }[];
59
+ };
@@ -0,0 +1,17 @@
1
+ import { VuuTable } from "@vuu-ui/vuu-protocol-types";
2
+ import type { TableProps } from "@vuu-ui/vuu-table";
3
+ import { HTMLAttributes } from "react";
4
+ import { ColumnPickerProps } from "../column-picker/ColumnPicker";
5
+ import { TableSettingsPanelProps } from "../table-settings-panel/TableSettingsPanel";
6
+ declare const TabLabels: {
7
+ readonly "table-settings": "Table";
8
+ readonly "table-columns": "Columns";
9
+ };
10
+ type TabName = keyof typeof TabLabels;
11
+ export interface TabbedTableConfigPanelProps extends ColumnPickerProps, Pick<TableSettingsPanelProps, "onDisplayAttributeChange">, Pick<TableProps, "config">, HTMLAttributes<HTMLDivElement> {
12
+ allowCreateCalculatedColumn?: boolean;
13
+ selectedTab?: TabName;
14
+ vuuTable?: VuuTable;
15
+ }
16
+ export declare const TabbedTableConfigPanel: ({ allowCreateCalculatedColumn, className, columnModel, config, onDisplayAttributeChange, selectedTab, vuuTable, ...htmlAttributes }: TabbedTableConfigPanelProps) => import("react").JSX.Element;
17
+ export {};
@@ -0,0 +1,7 @@
1
+ import { IconButtonProps } from "@vuu-ui/vuu-ui-controls";
2
+ import { TabbedTableConfigPanelHookProps } from "./useTabbedTableConfigPanel";
3
+ import { TableDisplayAttributeChangeHandler } from "../table-settings-panel/TableSettingsPanel";
4
+ export interface TabbedTableSettingsActionProps extends Partial<IconButtonProps>, TabbedTableConfigPanelHookProps {
5
+ onDisplayAttributeChange: TableDisplayAttributeChangeHandler;
6
+ }
7
+ export declare const TabbedTableSettingsAction: ({ allowCreateCalculatedColumn, appearance, columnModel, config, icon, onDisplayAttributeChange, sentiment, vuuTable, ...IconButtonProps }: TabbedTableSettingsActionProps) => import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { TableSettingsPanelProps } from "../table-settings-panel/TableSettingsPanel";
2
+ import { TableProps } from "@vuu-ui/vuu-table";
3
+ import { ColumnPickerProps } from "../column-picker/ColumnPicker";
4
+ import { VuuTable } from "@vuu-ui/vuu-protocol-types";
5
+ export interface TabbedTableConfigPanelHookProps extends Pick<ColumnPickerProps, "allowCreateCalculatedColumn" | "columnModel">, Pick<TableSettingsPanelProps, "onDisplayAttributeChange">, Pick<TableProps, "config"> {
6
+ /**
7
+ * only required for calculated columns
8
+ */
9
+ vuuTable?: VuuTable;
10
+ }
11
+ export declare const useTabbedTableConfigPanel: ({ allowCreateCalculatedColumn, columnModel, config, onDisplayAttributeChange, vuuTable, }: TabbedTableConfigPanelHookProps) => {
12
+ showTabbedTableConfigPanel: (title?: string) => void;
13
+ };
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export interface TableFooterProps extends HTMLAttributes<HTMLDivElement> {
3
+ onInvokeAction?: (action: string) => void;
4
+ tooltrayActions?: ReactNode;
5
+ }
6
+ export declare const TableFooterTray: ({ children, position }: {
7
+ children: ReactNode;
8
+ position?: 'center' | 'end';
9
+ }) => import("react").JSX.Element;
10
+ export declare const TableFooter: ({ children, className, onInvokeAction, tooltrayActions, ...htmlAttributes }: TableFooterProps) => import("react").JSX.Element;