@vuu-ui/vuu-table-extras 4.0.0-alpha.2 → 4.0.0-alpha.20
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/package.json +15 -13
- package/src/calculated-column/CalculatedColumnPanel.js +2 -2
- package/src/calculated-column/useEditCalculatedColumn.js +1 -1
- package/src/column-expression-input/useColumnExpressionSuggestionProvider.js +2 -2
- package/src/column-formatting-settings/ColumnFormattingPanel.js +12 -9
- package/src/column-formatting-settings/DateTimeFormattingSettings.js +107 -3
- package/src/column-formatting-settings/LongTypeFormattingSettings.js +8 -3
- package/src/column-picker/ColumnModel.js +14 -25
- package/src/column-picker/ColumnPicker.css.js +0 -86
- package/src/column-picker/ColumnPicker.js +12 -180
- package/src/column-picker/useColumnPicker.js +28 -22
- package/src/csv-export/export-utils.js +66 -19
- package/src/csv-export/index.js +1 -1
- package/src/csv-export/useCsvExport.js +9 -1
- package/src/csv-upload/CsvUpload.css.js +34 -0
- package/src/csv-upload/CsvUpload.js +107 -63
- package/src/csv-upload/parse/csv-errors.js +1 -1
- package/src/csv-upload/parse/csv-parse.js +1 -1
- package/src/csv-upload/parse/csv-schema-validation.js +46 -7
- package/src/csv-upload/useCsvUpload.js +12 -14
- package/src/tabbed-table-config-panel/TabbedTableConfigPanel.js +17 -8
- package/src/tabbed-table-config-panel/useTabbedTableConfigPanel.js +1 -1
- package/src/table-footer/TableFooter.js +3 -3
- package/types/calculated-column/CalculatedColumnPanel.d.ts +2 -2
- package/types/column-formatting-settings/DateTimeFormattingSettings.d.ts +1 -1
- package/types/column-picker/ColumnModel.d.ts +4 -3
- package/types/column-picker/ColumnPicker.d.ts +4 -6
- package/types/column-picker/useColumnPicker.d.ts +7 -10
- package/types/column-settings-panel/useColumnSettings.d.ts +3 -3
- package/types/csv-export/export-utils.d.ts +22 -9
- package/types/csv-export/index.d.ts +1 -1
- package/types/csv-export/useCsvExport.d.ts +5 -2
- package/types/csv-upload/CsvUpload.d.ts +1 -5
- package/types/csv-upload/parse/csv-errors.d.ts +1 -1
- package/types/csv-upload/parse/csv-schema-validation.d.ts +8 -2
- package/types/csv-upload/useCsvUpload.d.ts +2 -2
- package/types/index.d.ts +0 -1
- package/types/inline-add-row/useInlineAddRow.d.ts +2 -1
- package/types/tabbed-table-config-panel/useTabbedTableConfigPanel.d.ts +4 -3
- package/types/table-footer/TableFooter.d.ts +2 -2
|
@@ -46,7 +46,7 @@ export interface CsvUploadProps {
|
|
|
46
46
|
importSchema?: TableSchema;
|
|
47
47
|
/** Expected import table, used to validate the session table returned by the server. */
|
|
48
48
|
importTable?: VuuTable;
|
|
49
|
-
|
|
49
|
+
onImportSessionReady?: (dataSource: DataSource) => void;
|
|
50
50
|
onImportSessionEnded?: (result: CsvUploadSessionEndResult) => void;
|
|
51
51
|
onError?: (result: CsvUploadErrorResult | undefined) => void;
|
|
52
52
|
onImported?: (result: CsvUploadImportedResult) => void;
|
|
@@ -61,9 +61,5 @@ export interface CsvUploadProps {
|
|
|
61
61
|
importMode?: "direct" | "preview";
|
|
62
62
|
rowDefaults?: RowDefaultDataItemValues;
|
|
63
63
|
validators?: Record<string, CsvColumnValidator>;
|
|
64
|
-
/**
|
|
65
|
-
* Custom renderer for the error panel.
|
|
66
|
-
*/
|
|
67
|
-
renderError?: (error: CsvUploadErrorResult) => ReactNode;
|
|
68
64
|
}
|
|
69
65
|
export declare const CsvUpload: (props: CsvUploadProps) => import("react").JSX.Element;
|
|
@@ -11,7 +11,7 @@ export declare enum CsvValidationErrorEnum {
|
|
|
11
11
|
MISSING_KEY_COLUMN = "MISSING_KEY_COLUMN",
|
|
12
12
|
UNKNOWN_COLUMN = "UNKNOWN_COLUMN",
|
|
13
13
|
MAX_ROWS_EXCEEDED = "MAX_ROWS_EXCEEDED",
|
|
14
|
-
|
|
14
|
+
REQUIRED_FIELD_MISSING = "REQUIRED_FIELD_MISSING",
|
|
15
15
|
TYPE_MISMATCH = "TYPE_MISMATCH",
|
|
16
16
|
CUSTOM_VALIDATION = "CUSTOM_VALIDATION"
|
|
17
17
|
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import type { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
1
|
+
import type { TableSchema, SchemaColumn } from "@vuu-ui/vuu-data-types";
|
|
2
2
|
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
3
3
|
import type { CsvValidationError, CsvValidationErrorMap, CsvParseError } from "./csv-errors";
|
|
4
4
|
import type { CsvParseResult } from "./csv-parse";
|
|
5
5
|
export { CsvValidationErrorEnum, type CsvValidationError, type CsvValidationErrorMap, type CsvValidationErrorType, type CsvValidationStructuredError, } from "./csv-errors";
|
|
6
|
+
export interface ImportSchemaColumn extends SchemaColumn {
|
|
7
|
+
required?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ImportTableSchema extends Omit<TableSchema, "columns"> {
|
|
10
|
+
readonly columns: readonly ImportSchemaColumn[];
|
|
11
|
+
}
|
|
6
12
|
export type CsvColumnValidator = (value: string, columnName: string, row: Record<string, string>) => boolean | string;
|
|
7
13
|
export type CsvValidationResult = {
|
|
8
14
|
columns: string[];
|
|
@@ -15,4 +21,4 @@ export type CsvValidationOptions = {
|
|
|
15
21
|
maxRows?: number;
|
|
16
22
|
validators?: Record<string, CsvColumnValidator>;
|
|
17
23
|
};
|
|
18
|
-
export declare const validateCsvAgainstSchema: (parsed: CsvParseResult, tableSchema: TableSchema, options?: CsvValidationOptions) => CsvValidationResult;
|
|
24
|
+
export declare const validateCsvAgainstSchema: (parsed: CsvParseResult, tableSchema: TableSchema | ImportTableSchema, options?: CsvValidationOptions) => CsvValidationResult;
|
|
@@ -17,7 +17,7 @@ export interface CsvUploadHookProps {
|
|
|
17
17
|
importTable?: VuuTable;
|
|
18
18
|
maxRows?: number;
|
|
19
19
|
onImportSessionEnded?: (result: CsvUploadSessionEndResult) => void;
|
|
20
|
-
|
|
20
|
+
onImportSessionReady?: (dataSource: DataSource) => void;
|
|
21
21
|
onError?: (result: CsvUploadErrorResult | undefined) => void;
|
|
22
22
|
onImported?: (result: CsvUploadImportedResult) => void;
|
|
23
23
|
onPreview?: (result: CsvUploadPreviewResult) => void;
|
|
@@ -40,4 +40,4 @@ export type UseCsvUploadReturn = {
|
|
|
40
40
|
validation: CsvValidationResult | undefined;
|
|
41
41
|
error: CsvUploadErrorResult | undefined;
|
|
42
42
|
};
|
|
43
|
-
export declare const useCsvUpload: ({ dataSource, importMode, importSchema, importTable, onImportSessionEnded,
|
|
43
|
+
export declare const useCsvUpload: ({ dataSource, importMode, importSchema, importTable, onImportSessionEnded, onImportSessionReady, onError, onImported, onPreview, onProcessingStarted, maxRows, parseOptions, rowDefaults, validators, }: CsvUploadHookProps) => UseCsvUploadReturn;
|
package/types/index.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export { useColumnActions } from "./column-menu/useColumnActions";
|
|
|
11
11
|
export { ColumnChangeSource, ColumnModel, isColumnAdded, isColumnRemoved, isColumnsReordered, SelectedColumnChangeType, type ColumnEvents, type ColumnsChangeHandler, } from "./column-picker/ColumnModel";
|
|
12
12
|
export { ColumnPicker, type ColumnPickerProps, } from "./column-picker/ColumnPicker";
|
|
13
13
|
export { ColumnPickerAction } from "./column-picker/ColumnPickerAction";
|
|
14
|
-
export type { SelectedColumnsChangeHandler } from "./column-picker/useColumnPicker";
|
|
15
14
|
export { useTableColumnPicker } from "./column-picker/useTableColumnPicker";
|
|
16
15
|
export { ColumnSettingsPanel } from "./column-settings-panel/ColumnSettingsPanel";
|
|
17
16
|
export { useColumnSettings } from "./column-settings-panel/useColumnSettings";
|
|
@@ -16,7 +16,8 @@ export declare const useInlineAddRow: ({ columns }: UseInlineAddRowProps) => {
|
|
|
16
16
|
allowColumnHeaderMenu?: false;
|
|
17
17
|
colHeaderContentRenderer?: string;
|
|
18
18
|
colHeaderLabelRenderer?: string;
|
|
19
|
-
|
|
19
|
+
exportable?: boolean;
|
|
20
|
+
exportFormatter?: (value: unknown, row: import("@vuu-ui/vuu-table-types").RowAccessor) => string;
|
|
20
21
|
getIcon?: (row: DataRow) => string | undefined;
|
|
21
22
|
groupable?: boolean;
|
|
22
23
|
hidden?: boolean;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
2
2
|
import { TableProps } from "@vuu-ui/vuu-table";
|
|
3
3
|
import { ColumnPickerProps } from "../column-picker/ColumnPicker";
|
|
4
|
-
import {
|
|
5
|
-
export interface TabbedTableConfigPanelHookProps extends Pick<ColumnPickerProps, "
|
|
4
|
+
import { TableSettingsPanelProps } from "../table-settings-panel/TableSettingsPanel";
|
|
5
|
+
export interface TabbedTableConfigPanelHookProps extends Pick<ColumnPickerProps, "columnModel">, Pick<TableSettingsPanelProps, "onDisplayAttributeChange">, Pick<TableProps, "config"> {
|
|
6
6
|
/**
|
|
7
7
|
* only required for calculated columns
|
|
8
8
|
*/
|
|
9
9
|
vuuTable?: VuuTable;
|
|
10
|
+
allowCreateCalculatedColumn?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare const useTabbedTableConfigPanel: ({ allowCreateCalculatedColumn, columnModel, config, onDisplayAttributeChange, vuuTable, }: TabbedTableConfigPanelHookProps) => {
|
|
12
13
|
showTabbedTableConfigPanel: (title?: string) => void;
|
|
@@ -3,8 +3,8 @@ export interface TableFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
3
3
|
onInvokeAction?: (action: string) => void;
|
|
4
4
|
tooltrayActions?: ReactNode;
|
|
5
5
|
}
|
|
6
|
-
export declare const TableFooterTray: ({ children, position }: {
|
|
6
|
+
export declare const TableFooterTray: ({ children, position, }: {
|
|
7
7
|
children: ReactNode;
|
|
8
|
-
position?:
|
|
8
|
+
position?: "center" | "end";
|
|
9
9
|
}) => import("react").JSX.Element;
|
|
10
10
|
export declare const TableFooter: ({ children, className, onInvokeAction, tooltrayActions, ...htmlAttributes }: TableFooterProps) => import("react").JSX.Element;
|