@bsol-oss/react-datatable5 12.0.0-beta.8 → 12.0.0-beta.81
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/README.md +224 -5
- package/dist/index.d.ts +780 -258
- package/dist/index.js +3431 -1184
- package/dist/index.mjs +3328 -1086
- package/dist/types/components/DataTable/DataTable.d.ts +12 -7
- package/dist/types/components/DataTable/DataTableServer.d.ts +6 -4
- package/dist/types/components/DataTable/DefaultTable.d.ts +12 -14
- package/dist/types/components/DataTable/DefaultTableServer.d.ts +23 -0
- package/dist/types/components/DataTable/context/DataTableContext.d.ts +21 -3
- package/dist/types/components/DataTable/context/useDataTableContext.d.ts +2 -2
- package/dist/types/components/DataTable/controls/ReloadButton.d.ts +1 -2
- package/dist/types/components/DataTable/controls/ResetFilteringButton.d.ts +1 -4
- package/dist/types/components/DataTable/controls/ResetSelectionButton.d.ts +1 -4
- package/dist/types/components/DataTable/controls/ResetSortingButton.d.ts +1 -4
- package/dist/types/components/DataTable/controls/TableControls.d.ts +10 -2
- package/dist/types/components/DataTable/display/Table.d.ts +4 -3
- package/dist/types/components/DataTable/display/TableBody.d.ts +1 -2
- package/dist/types/components/DataTable/display/TableBodySkeleton.d.ts +5 -0
- package/dist/types/components/DataTable/display/TableCardContainer.d.ts +6 -3
- package/dist/types/components/DataTable/display/TableDataDisplay.d.ts +6 -1
- package/dist/types/components/DataTable/display/TableFooter.d.ts +1 -5
- package/dist/types/components/DataTable/display/TableHeader.d.ts +46 -8
- package/dist/types/components/DataTable/hooks/useResponsiveColumnVisibility.d.ts +13 -0
- package/dist/types/components/DataTable/useDataTableServer.d.ts +55 -3
- package/dist/types/components/DatePicker/DatePicker.d.ts +23 -0
- package/dist/types/components/DatePicker/DateTimePicker.d.ts +11 -0
- package/dist/types/components/DatePicker/DurationPicker.d.ts +12 -0
- package/dist/types/components/DatePicker/IsoTimePicker.d.ts +16 -0
- package/dist/types/components/DatePicker/PickerDemo.d.ts +1 -0
- package/dist/types/components/DatePicker/UniversalPicker.d.ts +9 -0
- package/dist/types/components/DatePicker/index.d.ts +7 -0
- package/dist/types/components/Filter/TagFilter.d.ts +5 -1
- package/dist/types/components/Form/SchemaFormContext.d.ts +22 -6
- package/dist/types/components/Form/components/FileDropzone.d.ts +2 -2
- package/dist/types/components/Form/components/core/DefaultForm.d.ts +1 -0
- package/dist/types/components/Form/components/core/FormBody.d.ts +2 -1
- package/dist/types/components/Form/components/core/FormRoot.d.ts +21 -8
- package/dist/types/components/Form/components/fields/BooleanPicker.d.ts +1 -1
- package/dist/types/components/Form/components/fields/ColumnRenderer.d.ts +3 -2
- package/dist/types/components/Form/components/fields/CustomInput.d.ts +8 -0
- package/dist/types/components/Form/components/fields/DatePicker.d.ts +2 -7
- package/dist/types/components/Form/components/fields/DateRangePicker.d.ts +2 -0
- package/dist/types/components/Form/components/fields/DateTimePicker.d.ts +2 -0
- package/dist/types/components/Form/components/fields/EnumPicker.d.ts +3 -2
- package/dist/types/components/Form/components/fields/FilePicker.d.ts +2 -5
- package/dist/types/components/Form/components/fields/IdPicker.d.ts +1 -1
- package/dist/types/components/Form/components/fields/NumberInputField.d.ts +1 -1
- package/dist/types/components/Form/components/fields/ObjectInput.d.ts +1 -1
- package/dist/types/components/Form/components/fields/RecordInput.d.ts +1 -1
- package/dist/types/components/Form/components/fields/SchemaRenderer.d.ts +1 -1
- package/dist/types/components/Form/components/fields/StringInputField.d.ts +23 -5
- package/dist/types/components/Form/components/fields/TextAreaInput.d.ts +12 -0
- package/dist/types/components/Form/components/{DatePicker.d.ts → fields/TimePicker.d.ts} +2 -2
- package/dist/types/components/Form/components/fields/types.d.ts +6 -0
- package/dist/types/components/Form/components/types/CustomJSONSchema7.d.ts +77 -4
- package/dist/types/components/Form/components/viewers/CustomViewer.d.ts +8 -0
- package/dist/types/components/Form/components/viewers/DateTimeViewer.d.ts +7 -0
- package/dist/types/components/Form/components/viewers/NumberViewer.d.ts +1 -1
- package/dist/types/components/Form/components/viewers/TextAreaViewer.d.ts +12 -0
- package/dist/types/components/Form/components/viewers/TimeViewer.d.ts +7 -0
- package/dist/types/components/Form/useForm.d.ts +6 -3
- package/dist/types/components/Form/utils/ajvResolver.d.ts +13 -0
- package/dist/types/components/Form/utils/buildErrorMessages.d.ts +223 -0
- package/dist/types/components/Form/utils/formatBytes.d.ts +6 -0
- package/dist/types/components/Form/utils/getFieldError.d.ts +6 -0
- package/dist/types/components/Form/utils/useFormI18n.d.ts +53 -0
- package/dist/types/components/Form/utils/validateData.d.ts +9 -0
- package/dist/types/components/TextArea/TextArea.d.ts +22 -0
- package/dist/types/components/TimePicker/TimePicker.d.ts +21 -0
- package/dist/types/components/ui/field.d.ts +3 -3
- package/dist/types/index.d.ts +79 -55
- package/package.json +18 -3
- package/dist/types/components/Controls/DensityFeature.d.ts +0 -23
- package/dist/types/components/Controls/DensityToggleButton.d.ts +0 -6
- package/dist/types/components/Controls/EditFilterButton.d.ts +0 -9
- package/dist/types/components/Controls/EditOrderButton.d.ts +0 -7
- package/dist/types/components/Controls/EditSortingButton.d.ts +0 -7
- package/dist/types/components/Controls/EditViewButton.d.ts +0 -7
- package/dist/types/components/Controls/FilterDialog.d.ts +0 -5
- package/dist/types/components/Controls/PageSizeControl.d.ts +0 -4
- package/dist/types/components/Controls/Pagination.d.ts +0 -1
- package/dist/types/components/Controls/ResetFilteringButton.d.ts +0 -4
- package/dist/types/components/Controls/ResetSelectionButton.d.ts +0 -4
- package/dist/types/components/Controls/ResetSortingButton.d.ts +0 -4
- package/dist/types/components/Controls/RowCountText.d.ts +0 -1
- package/dist/types/components/Controls/SelectAllRowsToggle.d.ts +0 -8
- package/dist/types/components/Controls/TablePagination.d.ts +0 -1
- package/dist/types/components/Controls/ViewDialog.d.ts +0 -5
- package/dist/types/components/DataTable/CardHeader.d.ts +0 -13
- package/dist/types/components/DataTable/DataDisplay.d.ts +0 -6
- package/dist/types/components/DataTable/ReloadButton.d.ts +0 -5
- package/dist/types/components/DataTable/Table.d.ts +0 -10
- package/dist/types/components/DataTable/TableBody.d.ts +0 -21
- package/dist/types/components/DataTable/TableCardContainer.d.ts +0 -7
- package/dist/types/components/DataTable/TableCards.d.ts +0 -11
- package/dist/types/components/DataTable/TableComponent.d.ts +0 -6
- package/dist/types/components/DataTable/TableControls.d.ts +0 -21
- package/dist/types/components/DataTable/TableFilter.d.ts +0 -1
- package/dist/types/components/DataTable/TableFilterTags.d.ts +0 -1
- package/dist/types/components/DataTable/TableFilters.d.ts +0 -1
- package/dist/types/components/DataTable/TableFooter.d.ts +0 -9
- package/dist/types/components/DataTable/TableHeader.d.ts +0 -13
- package/dist/types/components/DataTable/TableLoadingComponent.d.ts +0 -5
- package/dist/types/components/DataTable/TableOrderer.d.ts +0 -1
- package/dist/types/components/DataTable/TableSelector.d.ts +0 -1
- package/dist/types/components/DataTable/TableSorter.d.ts +0 -1
- package/dist/types/components/DataTable/TableViewer.d.ts +0 -1
- package/dist/types/components/DataTable/TextCell.d.ts +0 -10
- package/dist/types/components/DataTable/components/EmptyState.d.ts +0 -5
- package/dist/types/components/DataTable/components/ErrorAlert.d.ts +0 -4
- package/dist/types/components/DataTable/components/RecordDisplay.d.ts +0 -9
- package/dist/types/components/DataTable/components/TextCell.d.ts +0 -10
- package/dist/types/components/Filter/DateRangeFilter.d.ts +0 -9
- package/dist/types/components/Filter/FilterOptions.d.ts +0 -4
- package/dist/types/components/Form/Form.d.ts +0 -36
- package/dist/types/components/Form/components/ArrayRenderer.d.ts +0 -7
- package/dist/types/components/Form/components/BooleanPicker.d.ts +0 -7
- package/dist/types/components/Form/components/ColumnRenderer.d.ts +0 -7
- package/dist/types/components/Form/components/EnumPicker.d.ts +0 -8
- package/dist/types/components/Form/components/FilePicker.d.ts +0 -5
- package/dist/types/components/Form/components/IdPicker.d.ts +0 -8
- package/dist/types/components/Form/components/IdViewer.d.ts +0 -5
- package/dist/types/components/Form/components/NumberInputField.d.ts +0 -7
- package/dist/types/components/Form/components/ObjectInput.d.ts +0 -7
- package/dist/types/components/Form/components/RecordInput.d.ts +0 -7
- package/dist/types/components/Form/components/SchemaRenderer.d.ts +0 -7
- package/dist/types/components/Form/components/StringInputField.d.ts +0 -20
- package/dist/types/components/Form/components/TagPicker.d.ts +0 -30
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to simplify i18n translation for form fields.
|
|
3
|
+
* Automatically handles colLabel construction and removeIndex logic.
|
|
4
|
+
*
|
|
5
|
+
* @param column - The column name
|
|
6
|
+
* @param prefix - The prefix for the field (usually empty string or parent path)
|
|
7
|
+
* @returns Object with translation helper functions
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const formI18n = useFormI18n(column, prefix);
|
|
12
|
+
*
|
|
13
|
+
* // Get field label
|
|
14
|
+
* <Field label={formI18n.label()} />
|
|
15
|
+
*
|
|
16
|
+
* // Get error message
|
|
17
|
+
* <Text>{formI18n.required()}</Text>
|
|
18
|
+
*
|
|
19
|
+
* // Get custom translation key
|
|
20
|
+
* <Text>{formI18n.t('add_more')}</Text>
|
|
21
|
+
*
|
|
22
|
+
* // Access the raw colLabel
|
|
23
|
+
* const colLabel = formI18n.colLabel;
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const useFormI18n: (column: string, prefix?: string) => {
|
|
27
|
+
/**
|
|
28
|
+
* The constructed column label (prefix + column)
|
|
29
|
+
*/
|
|
30
|
+
colLabel: string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the field label translation
|
|
33
|
+
* Equivalent to: translate.t(removeIndex(`${colLabel}.field_label`))
|
|
34
|
+
*/
|
|
35
|
+
label: (options?: any) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the required error message translation
|
|
38
|
+
* Equivalent to: translate.t(removeIndex(`${colLabel}.field_required`))
|
|
39
|
+
*/
|
|
40
|
+
required: (options?: any) => string;
|
|
41
|
+
/**
|
|
42
|
+
* Get a translation for any custom key relative to the field
|
|
43
|
+
* Equivalent to: translate.t(removeIndex(`${colLabel}.${key}`))
|
|
44
|
+
*
|
|
45
|
+
* @param key - The translation key suffix (e.g., 'add_more', 'total', etc.)
|
|
46
|
+
* @param options - Optional translation options (e.g., defaultValue, interpolation variables)
|
|
47
|
+
*/
|
|
48
|
+
t: (key: string, options?: any) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Access to the original translate object for edge cases
|
|
51
|
+
*/
|
|
52
|
+
translate: import("react-i18next").UseTranslationResponse<string, string>;
|
|
53
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ErrorObject, ValidateFunction } from 'ajv';
|
|
2
|
+
import { JSONSchema7 } from 'json-schema';
|
|
3
|
+
type ValidateDataResult = {
|
|
4
|
+
isValid: boolean;
|
|
5
|
+
validate: ValidateFunction;
|
|
6
|
+
errors: ErrorObject<string, Record<string, any>, unknown>[] | null | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const validateData: (data: unknown, schema: JSONSchema7) => ValidateDataResult;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
interface CustomTextareaProps {
|
|
3
|
+
value?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
onFocus?: () => void;
|
|
8
|
+
onBlur?: () => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
rows?: number;
|
|
13
|
+
maxLength?: number;
|
|
14
|
+
autoFocus?: boolean;
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
label?: string;
|
|
18
|
+
helperText?: string;
|
|
19
|
+
errorText?: string;
|
|
20
|
+
}
|
|
21
|
+
declare const Textarea: React.ForwardRefExoticComponent<CustomTextareaProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export { Textarea };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
interface TimePickerProps {
|
|
3
|
+
hour: number | null;
|
|
4
|
+
setHour: Dispatch<SetStateAction<number | null>>;
|
|
5
|
+
minute: number | null;
|
|
6
|
+
setMinute: Dispatch<SetStateAction<number | null>>;
|
|
7
|
+
meridiem: "am" | "pm" | null;
|
|
8
|
+
setMeridiem: Dispatch<SetStateAction<"am" | "pm" | null>>;
|
|
9
|
+
onChange?: (newValue: {
|
|
10
|
+
hour: number | null;
|
|
11
|
+
minute: number | null;
|
|
12
|
+
meridiem: "am" | "pm" | null;
|
|
13
|
+
}) => void;
|
|
14
|
+
meridiemLabel?: {
|
|
15
|
+
am: string;
|
|
16
|
+
pm: string;
|
|
17
|
+
};
|
|
18
|
+
timezone?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function TimePicker({ hour, setHour, minute, setMinute, meridiem, setMeridiem, meridiemLabel, onChange, timezone, }: TimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Field as ChakraField } from
|
|
2
|
-
import * as React from
|
|
3
|
-
export interface FieldProps extends Omit<ChakraField.RootProps,
|
|
1
|
+
import { Field as ChakraField } from '@chakra-ui/react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface FieldProps extends Omit<ChakraField.RootProps, 'label'> {
|
|
4
4
|
label?: React.ReactNode;
|
|
5
5
|
helperText?: React.ReactNode;
|
|
6
6
|
errorText?: React.ReactNode;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Column, RowData } from
|
|
2
|
-
import { ReactNode } from
|
|
3
|
-
declare module
|
|
1
|
+
import { Column, RowData } from '@tanstack/react-table';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare module '@tanstack/react-table' {
|
|
4
4
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
5
5
|
/**
|
|
6
6
|
* If `showCustomDisplay` is `true`, it will use the cell render to render the value.
|
|
@@ -12,6 +12,17 @@ declare module "@tanstack/react-table" {
|
|
|
12
12
|
* The display name of the column, used for rendering headers.
|
|
13
13
|
*/
|
|
14
14
|
displayName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Text configuration for the column header menu items.
|
|
17
|
+
* These strings can be customized per column.
|
|
18
|
+
*/
|
|
19
|
+
headerTexts?: {
|
|
20
|
+
pinColumn?: string;
|
|
21
|
+
cancelPin?: string;
|
|
22
|
+
sortAscending?: string;
|
|
23
|
+
sortDescending?: string;
|
|
24
|
+
clearSorting?: string;
|
|
25
|
+
};
|
|
15
26
|
/**
|
|
16
27
|
* Specifies the type of filter to be used for the column.
|
|
17
28
|
*
|
|
@@ -28,11 +39,14 @@ declare module "@tanstack/react-table" {
|
|
|
28
39
|
* - "dateRange": A date range filter.
|
|
29
40
|
* - "custom": A custom filter function.
|
|
30
41
|
*/
|
|
31
|
-
filterVariant?:
|
|
42
|
+
filterVariant?: 'text' | 'range' | 'select' | 'tag' | 'boolean' | 'dateRange' | 'custom';
|
|
32
43
|
/**
|
|
33
44
|
* Options for the select filter variant, if applicable.
|
|
34
45
|
*/
|
|
35
|
-
filterOptions?:
|
|
46
|
+
filterOptions?: {
|
|
47
|
+
label: string;
|
|
48
|
+
value: string;
|
|
49
|
+
}[];
|
|
36
50
|
/**
|
|
37
51
|
* Configuration for the range filter variant, if applicable.
|
|
38
52
|
*
|
|
@@ -55,55 +69,65 @@ declare module "@tanstack/react-table" {
|
|
|
55
69
|
* @returns A JSX element representing the filter UI.
|
|
56
70
|
*/
|
|
57
71
|
renderFilter?: (column: Column<TData>) => ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Priority for responsive column hiding when table width is too narrow.
|
|
74
|
+
* Lower priority numbers = hide first (e.g., priority 1 hides before priority 10).
|
|
75
|
+
* Columns without priority default to Infinity (highest priority, never auto-hide).
|
|
76
|
+
* Only applies when canResize={false}.
|
|
77
|
+
*/
|
|
78
|
+
responsivePriority?: number;
|
|
58
79
|
}
|
|
59
80
|
}
|
|
60
|
-
export
|
|
61
|
-
export * from
|
|
62
|
-
export * from
|
|
63
|
-
export * from
|
|
64
|
-
export * from
|
|
65
|
-
export * from
|
|
66
|
-
export * from
|
|
67
|
-
export * from
|
|
68
|
-
export * from
|
|
69
|
-
export * from
|
|
70
|
-
export * from
|
|
71
|
-
export * from
|
|
72
|
-
export * from
|
|
73
|
-
export * from
|
|
74
|
-
export * from
|
|
75
|
-
export * from
|
|
76
|
-
export * from
|
|
77
|
-
export * from
|
|
78
|
-
export * from
|
|
79
|
-
export * from
|
|
80
|
-
export * from
|
|
81
|
-
export * from
|
|
82
|
-
export * from
|
|
83
|
-
export * from
|
|
84
|
-
export * from
|
|
85
|
-
export * from
|
|
86
|
-
export * from
|
|
87
|
-
export * from
|
|
88
|
-
export * from
|
|
89
|
-
export * from
|
|
90
|
-
export * from
|
|
91
|
-
export * from
|
|
92
|
-
export * from
|
|
93
|
-
export * from
|
|
94
|
-
export * from
|
|
95
|
-
export * from
|
|
96
|
-
export * from
|
|
97
|
-
export * from
|
|
98
|
-
export * from
|
|
99
|
-
export * from
|
|
100
|
-
export * from
|
|
101
|
-
export * from
|
|
102
|
-
export * from
|
|
103
|
-
export * from
|
|
104
|
-
export * from
|
|
105
|
-
export * from
|
|
106
|
-
export * from
|
|
107
|
-
export * from
|
|
108
|
-
export * from
|
|
109
|
-
export * from
|
|
81
|
+
export type { TableHeaderTexts } from './components/DataTable/display/TableHeader';
|
|
82
|
+
export * from './components/DataTable/controls/DensityToggleButton';
|
|
83
|
+
export * from './components/DataTable/controls/EditSortingButton';
|
|
84
|
+
export * from './components/DataTable/controls/FilterDialog';
|
|
85
|
+
export * from './components/DataTable/controls/PageSizeControl';
|
|
86
|
+
export * from './components/DataTable/controls/Pagination';
|
|
87
|
+
export * from './components/DataTable/controls/ResetFilteringButton';
|
|
88
|
+
export * from './components/DataTable/controls/ResetSelectionButton';
|
|
89
|
+
export * from './components/DataTable/controls/ResetSortingButton';
|
|
90
|
+
export * from './components/DataTable/controls/RowCountText';
|
|
91
|
+
export * from './components/DataTable/controls/ViewDialog';
|
|
92
|
+
export * from './components/DataTable/controls/ReloadButton';
|
|
93
|
+
export * from './components/Filter/GlobalFilter';
|
|
94
|
+
export * from './components/DataTable/controls/TableSelector';
|
|
95
|
+
export * from './components/DataTable/controls/TableSorter';
|
|
96
|
+
export * from './components/DataTable/controls/TableViewer';
|
|
97
|
+
export * from './components/DataTable/controls/TableControls';
|
|
98
|
+
export * from './components/DataTable/controls/TableFilters';
|
|
99
|
+
export * from './components/DataTable/controls/TableFilterTags';
|
|
100
|
+
export * from './components/DataTable/display/Table';
|
|
101
|
+
export * from './components/DataTable/display/TableBody';
|
|
102
|
+
export * from './components/DataTable/display/TableCardContainer';
|
|
103
|
+
export * from './components/DataTable/display/TableCards';
|
|
104
|
+
export * from './components/DataTable/display/TableComponent';
|
|
105
|
+
export * from './components/DataTable/display/TableFooter';
|
|
106
|
+
export * from './components/DataTable/display/TableHeader';
|
|
107
|
+
export * from './components/DataTable/display/TableLoadingComponent';
|
|
108
|
+
export * from './components/DataTable/display/TextCell';
|
|
109
|
+
export * from './components/DataTable/display/CardHeader';
|
|
110
|
+
export * from './components/DataTable/display/EmptyState';
|
|
111
|
+
export * from './components/DataTable/display/ErrorAlert';
|
|
112
|
+
export * from './components/DataTable/useDataTable';
|
|
113
|
+
export * from './components/DataTable/useDataTableServer';
|
|
114
|
+
export * from './components/DataTable/context/useDataTableContext';
|
|
115
|
+
export * from './components/DataTable/utils/getColumns';
|
|
116
|
+
export * from './components/Form/components/core/DefaultForm';
|
|
117
|
+
export * from './components/Form/components/core/FormRoot';
|
|
118
|
+
export * from './components/Form/components/core/FormTitle';
|
|
119
|
+
export * from './components/Form/components/core/FormBody';
|
|
120
|
+
export * from './components/Form/components/types/CustomJSONSchema7';
|
|
121
|
+
export * from './components/Form/useForm';
|
|
122
|
+
export * from './components/Form/utils/buildErrorMessages';
|
|
123
|
+
export * from './components/DatePicker/DatePicker';
|
|
124
|
+
export * from './components/DatePicker/getMultiDates';
|
|
125
|
+
export * from './components/DatePicker/getRangeDates';
|
|
126
|
+
export * from './components/DatePicker/RangeDatePicker';
|
|
127
|
+
export * from './components/DataTable/display/RecordDisplay';
|
|
128
|
+
export * from './components/DataTable/display/TableDataDisplay';
|
|
129
|
+
export * from './components/DataTable/DefaultTable';
|
|
130
|
+
export * from './components/DataTable/DefaultTableServer';
|
|
131
|
+
export * from './components/DataTable/display/DataDisplay';
|
|
132
|
+
export * from './components/DataTable/DataTable';
|
|
133
|
+
export * from './components/DataTable/DataTableServer';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsol-oss/react-datatable5",
|
|
3
|
-
"version": "12.0.0-beta.
|
|
3
|
+
"version": "12.0.0-beta.81",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -32,17 +32,21 @@
|
|
|
32
32
|
"preview": "vite preview",
|
|
33
33
|
"storybook": "storybook dev -p 6006",
|
|
34
34
|
"build-storybook": "storybook build",
|
|
35
|
-
"format": "prettier --ignore-unknown '**/*'"
|
|
35
|
+
"format": "prettier --ignore-unknown '**/*'",
|
|
36
|
+
"prepare": "husky"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
|
|
39
40
|
"@bsol-oss/dayzed-react19": "^0.0.4",
|
|
40
|
-
"@chakra-ui/react": "^3.
|
|
41
|
+
"@chakra-ui/react": "^3.19.1",
|
|
41
42
|
"@emotion/react": "^11.13.5",
|
|
42
43
|
"@tanstack/match-sorter-utils": "^8.15.1",
|
|
43
44
|
"@tanstack/react-query": "^5.66.9",
|
|
44
45
|
"@tanstack/react-table": "^8.21.2",
|
|
45
46
|
"@uidotdev/usehooks": "^2.4.1",
|
|
47
|
+
"ajv": "^8.12.0",
|
|
48
|
+
"ajv-errors": "^3.0.0",
|
|
49
|
+
"ajv-formats": "^3.0.1",
|
|
46
50
|
"axios": "^1.7.9",
|
|
47
51
|
"dayjs": "^1.11.13",
|
|
48
52
|
"next-themes": "^0.4.4",
|
|
@@ -63,6 +67,7 @@
|
|
|
63
67
|
"@storybook/react": "^8.4.7",
|
|
64
68
|
"@storybook/react-vite": "^8.4.7",
|
|
65
69
|
"@storybook/test": "^8.4.7",
|
|
70
|
+
"@types/ajv-errors": "^2.0.0",
|
|
66
71
|
"@types/json-schema": "^7.0.15",
|
|
67
72
|
"@types/react": "19.0.2",
|
|
68
73
|
"@types/react-beautiful-dnd": "^13.1.8",
|
|
@@ -70,14 +75,24 @@
|
|
|
70
75
|
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
71
76
|
"@typescript-eslint/parser": "^7.2.0",
|
|
72
77
|
"@vitejs/plugin-react": "^4.2.1",
|
|
78
|
+
"ajv": "^8.12.0",
|
|
79
|
+
"ajv-errors": "^3.0.0",
|
|
80
|
+
"ajv-formats": "^3.0.1",
|
|
73
81
|
"eslint": "^8.57.0",
|
|
74
82
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
75
83
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
76
84
|
"eslint-plugin-storybook": "^0.8.0",
|
|
85
|
+
"husky": "^9.1.7",
|
|
86
|
+
"lint-staged": "^16.2.5",
|
|
77
87
|
"prettier": "3.2.5",
|
|
78
88
|
"rollup-plugin-dts": "^6.1.0",
|
|
79
89
|
"storybook": "^8.4.7",
|
|
80
90
|
"typescript": "^5.2.2",
|
|
81
91
|
"vite": "^5.2.0"
|
|
92
|
+
},
|
|
93
|
+
"lint-staged": {
|
|
94
|
+
"*.{ts,js,json,md,tsx}": [
|
|
95
|
+
"prettier --config ./.prettierrc --write"
|
|
96
|
+
]
|
|
82
97
|
}
|
|
83
98
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { OnChangeFn, Updater, RowData, TableFeature } from "@tanstack/react-table";
|
|
2
|
-
export type DensityState = "sm" | "md" | "lg";
|
|
3
|
-
export interface DensityTableState {
|
|
4
|
-
density: DensityState;
|
|
5
|
-
}
|
|
6
|
-
export interface DensityOptions {
|
|
7
|
-
enableDensity?: boolean;
|
|
8
|
-
onDensityChange?: OnChangeFn<DensityState>;
|
|
9
|
-
}
|
|
10
|
-
export interface DensityInstance {
|
|
11
|
-
setDensity: (updater: Updater<DensityState>) => void;
|
|
12
|
-
toggleDensity: (value?: DensityState) => void;
|
|
13
|
-
getDensityValue: (value?: DensityState) => number;
|
|
14
|
-
}
|
|
15
|
-
declare module "@tanstack/react-table" {
|
|
16
|
-
interface TableState extends DensityTableState {
|
|
17
|
-
}
|
|
18
|
-
interface TableOptionsResolved<TData extends RowData> extends DensityOptions {
|
|
19
|
-
}
|
|
20
|
-
interface Table<TData extends RowData> extends DensityInstance {
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export declare const DensityFeature: TableFeature<any>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface EditFilterButtonProps {
|
|
3
|
-
text?: string;
|
|
4
|
-
title?: string;
|
|
5
|
-
closeText?: string;
|
|
6
|
-
resetText?: string;
|
|
7
|
-
icon?: React.ReactElement;
|
|
8
|
-
}
|
|
9
|
-
export declare const EditFilterButton: ({ text, title, closeText, resetText, icon, }: EditFilterButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface EditSortingButtonProps {
|
|
3
|
-
title?: string;
|
|
4
|
-
icon?: React.ReactElement;
|
|
5
|
-
text?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const EditSortingButton: ({ text, icon, title, }: EditSortingButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Pagination: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const RowCountText: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface SelectAllRowsToggleProps {
|
|
3
|
-
selectAllIcon?: React.ReactElement;
|
|
4
|
-
clearAllIcon?: React.ReactElement;
|
|
5
|
-
selectAllText?: string;
|
|
6
|
-
clearAllText?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const SelectAllRowsToggle: ({ selectAllIcon, clearAllIcon, selectAllText, clearAllText, }: SelectAllRowsToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const TablePagination: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ImageProps } from "@chakra-ui/react";
|
|
2
|
-
import { Row } from "@tanstack/react-table";
|
|
3
|
-
import { IconType } from "react-icons";
|
|
4
|
-
export interface CardHeaderProps<TData> {
|
|
5
|
-
row: Row<TData>;
|
|
6
|
-
imageColumnId?: keyof TData;
|
|
7
|
-
titleColumnId?: keyof TData;
|
|
8
|
-
tagColumnId?: keyof TData;
|
|
9
|
-
tagIcon?: IconType;
|
|
10
|
-
showTag?: boolean;
|
|
11
|
-
imageProps?: ImageProps;
|
|
12
|
-
}
|
|
13
|
-
export declare const CardHeader: <TData>({ row, imageColumnId, titleColumnId, tagColumnId, tagIcon, showTag, imageProps, }: CardHeaderProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { UseTranslationResponse } from "react-i18next";
|
|
2
|
-
export interface DataDisplayProps {
|
|
3
|
-
variant?: "horizontal" | "stats" | "";
|
|
4
|
-
translate?: UseTranslationResponse<any, any>;
|
|
5
|
-
}
|
|
6
|
-
export declare const DataDisplay: ({ variant }: DataDisplayProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TableRootProps } from "@chakra-ui/react";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
export interface TableProps extends TableRootProps {
|
|
4
|
-
showLoading?: boolean;
|
|
5
|
-
loadingComponent?: ReactNode;
|
|
6
|
-
emptyComponent?: ReactNode;
|
|
7
|
-
canResize?: boolean;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare const Table: ({ children, emptyComponent, canResize, ...props }: TableProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Row } from "@tanstack/react-table";
|
|
2
|
-
export interface TableBodyProps {
|
|
3
|
-
pinnedBgColor?: {
|
|
4
|
-
light: string;
|
|
5
|
-
dark: string;
|
|
6
|
-
};
|
|
7
|
-
showSelector?: boolean;
|
|
8
|
-
alwaysShowSelector?: boolean;
|
|
9
|
-
canResize?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface TableRowSelectorProps<TData> {
|
|
12
|
-
index: number;
|
|
13
|
-
row: Row<TData>;
|
|
14
|
-
hoveredRow: number;
|
|
15
|
-
pinnedBgColor?: {
|
|
16
|
-
light: string;
|
|
17
|
-
dark: string;
|
|
18
|
-
};
|
|
19
|
-
alwaysShowSelector?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare const TableBody: ({ pinnedBgColor, showSelector, alwaysShowSelector, canResize, }: TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GridProps } from "@chakra-ui/react";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
export interface TableCardContainerProps extends GridProps {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
variant?: "carousel" | "";
|
|
6
|
-
}
|
|
7
|
-
export declare const TableCardContainer: ({ children, variant, ...props }: TableCardContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CardBodyProps } from "@chakra-ui/react";
|
|
2
|
-
import { Row } from "@tanstack/react-table";
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
export interface TableCardsProps<TData> {
|
|
5
|
-
isSelectable?: boolean;
|
|
6
|
-
showDisplayNameOnly?: boolean;
|
|
7
|
-
renderTitle?: (row: Row<TData>) => ReactNode | undefined;
|
|
8
|
-
cardBodyProps?: CardBodyProps;
|
|
9
|
-
}
|
|
10
|
-
export declare const DefaultCardTitle: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export declare const TableCards: <TData>({ isSelectable, showDisplayNameOnly, renderTitle, cardBodyProps, }: TableCardsProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Table } from "@tanstack/react-table";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export interface TableRendererProps<TData> {
|
|
4
|
-
render: (render: Table<TData>) => React.ReactElement;
|
|
5
|
-
}
|
|
6
|
-
export declare const TableComponent: <TData>({ render, }: TableRendererProps<TData>) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
export interface TableControlsProps {
|
|
3
|
-
totalText?: string;
|
|
4
|
-
fitTableWidth?: boolean;
|
|
5
|
-
fitTableHeight?: boolean;
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
showGlobalFilter?: boolean;
|
|
8
|
-
showFilter?: boolean;
|
|
9
|
-
showFilterName?: boolean;
|
|
10
|
-
showFilterTags?: boolean;
|
|
11
|
-
showReload?: boolean;
|
|
12
|
-
showPagination?: boolean;
|
|
13
|
-
showPageSizeControl?: boolean;
|
|
14
|
-
showPageCountText?: boolean;
|
|
15
|
-
showView?: boolean;
|
|
16
|
-
filterOptions?: string[];
|
|
17
|
-
extraItems?: ReactNode;
|
|
18
|
-
loading?: boolean;
|
|
19
|
-
hasError?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare const TableControls: ({ fitTableWidth, fitTableHeight, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, showPagination, showPageSizeControl, showPageCountText, showView, filterOptions, extraItems, loading, hasError, }: TableControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const TableFilter: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const TableFilterTags: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const TableFilter: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface TableFooterProps {
|
|
2
|
-
pinnedBgColor?: {
|
|
3
|
-
light: string;
|
|
4
|
-
dark: string;
|
|
5
|
-
};
|
|
6
|
-
showSelector?: boolean;
|
|
7
|
-
alwaysShowSelector?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const TableFooter: ({ pinnedBgColor, showSelector, alwaysShowSelector, }: TableFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { TableHeaderProps as ChakraTableHeaderProps } from "@chakra-ui/react";
|
|
2
|
-
export interface TableHeaderProps {
|
|
3
|
-
canResize?: boolean;
|
|
4
|
-
pinnedBgColor?: {
|
|
5
|
-
light: string;
|
|
6
|
-
dark: string;
|
|
7
|
-
};
|
|
8
|
-
showSelector?: boolean;
|
|
9
|
-
isSticky?: boolean;
|
|
10
|
-
alwaysShowSelector?: boolean;
|
|
11
|
-
tHeadProps?: ChakraTableHeaderProps;
|
|
12
|
-
}
|
|
13
|
-
export declare const TableHeader: ({ canResize, pinnedBgColor, showSelector, isSticky, alwaysShowSelector, tHeadProps, }: TableHeaderProps) => import("react/jsx-runtime").JSX.Element;
|