@bsol-oss/react-datatable5 12.0.0-beta.9 → 12.0.0-beta.91
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 +225 -5
- package/dist/index.d.ts +896 -258
- package/dist/index.js +5157 -1630
- package/dist/index.mjs +5147 -1628
- 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/DensityFeature.d.ts +3 -3
- 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/SelectAllRowsToggle.d.ts +1 -1
- package/dist/types/components/DataTable/controls/TableControls.d.ts +10 -2
- package/dist/types/components/DataTable/display/DataDisplay.d.ts +2 -2
- package/dist/types/components/DataTable/display/Table.d.ts +4 -3
- package/dist/types/components/DataTable/display/TableBody.d.ts +2 -3
- 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/TableCards.d.ts +3 -3
- package/dist/types/components/DataTable/display/TableDataDisplay.d.ts +3 -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/display/TextCell.d.ts +11 -4
- package/dist/types/components/DataTable/display/TextWithCopy.d.ts +8 -0
- 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/DataTable/utils/selectors.d.ts +53 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +23 -0
- package/dist/types/components/DatePicker/DatePickerInput.d.ts +18 -0
- package/dist/types/components/DatePicker/DateTimePicker.d.ts +15 -0
- package/dist/types/components/DatePicker/DurationPicker.d.ts +12 -0
- package/dist/types/components/DatePicker/IsoTimePicker.d.ts +20 -0
- package/dist/types/components/DatePicker/PickerDemo.d.ts +1 -0
- package/dist/types/components/DatePicker/RangeDatePicker.d.ts +61 -5
- package/dist/types/components/DatePicker/UniversalPicker.d.ts +9 -0
- package/dist/types/components/DatePicker/index.d.ts +8 -0
- package/dist/types/components/Filter/TagFilter.d.ts +6 -2
- package/dist/types/components/Form/SchemaFormContext.d.ts +23 -6
- package/dist/types/components/Form/components/FileDropzone.d.ts +2 -2
- package/dist/types/components/Form/components/MediaLibraryBrowser.d.ts +22 -0
- 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 +22 -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 +18 -5
- package/dist/types/components/Form/components/fields/FormMediaLibraryBrowser.d.ts +2 -0
- 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 +83 -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/SchemaViewer.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 +24 -0
- package/dist/types/components/ui/field.d.ts +3 -3
- package/dist/types/index.d.ts +82 -55
- package/package.json +24 -13
- 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
- package/dist/types/components/ui/popover.d.ts +0 -17
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DatePickerLabels } from './DatePicker';
|
|
2
|
+
interface DateTimePickerProps {
|
|
3
|
+
value?: string;
|
|
4
|
+
onChange?: (date?: string) => void;
|
|
5
|
+
format?: 'date-time' | 'iso-date-time';
|
|
6
|
+
showSeconds?: boolean;
|
|
7
|
+
labels?: DatePickerLabels;
|
|
8
|
+
timezone?: string;
|
|
9
|
+
startTime?: string;
|
|
10
|
+
minDate?: Date;
|
|
11
|
+
maxDate?: Date;
|
|
12
|
+
portalled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function DateTimePicker({ value, onChange, format, showSeconds, labels, timezone, startTime, minDate, maxDate, portalled, }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface DurationPickerProps {
|
|
2
|
+
value?: string | null;
|
|
3
|
+
onChange?: (duration: string | null) => void;
|
|
4
|
+
showYears?: boolean;
|
|
5
|
+
showMonths?: boolean;
|
|
6
|
+
showDays?: boolean;
|
|
7
|
+
showHours?: boolean;
|
|
8
|
+
showMinutes?: boolean;
|
|
9
|
+
showSeconds?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function DurationPicker({ value, onChange, showYears, showMonths, showDays, showHours, showMinutes, showSeconds, }: DurationPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
interface IsoTimePickerProps {
|
|
3
|
+
hour: number | null;
|
|
4
|
+
setHour: Dispatch<SetStateAction<number | null>>;
|
|
5
|
+
minute: number | null;
|
|
6
|
+
setMinute: Dispatch<SetStateAction<number | null>>;
|
|
7
|
+
second: number | null;
|
|
8
|
+
setSecond: Dispatch<SetStateAction<number | null>>;
|
|
9
|
+
onChange?: (newValue: {
|
|
10
|
+
hour: number | null;
|
|
11
|
+
minute: number | null;
|
|
12
|
+
second: number | null;
|
|
13
|
+
}) => void;
|
|
14
|
+
startTime?: string;
|
|
15
|
+
selectedDate?: string;
|
|
16
|
+
timezone?: string;
|
|
17
|
+
portalled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function IsoTimePicker({ hour, setHour, minute, setMinute, second, setSecond, onChange, startTime, selectedDate, timezone, portalled, }: IsoTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PickerDemo(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Props, RenderProps } from
|
|
2
|
-
import React from
|
|
1
|
+
import { Props, RenderProps } from '@bsol-oss/dayzed-react19';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
export interface RangeCalendarProps extends RenderProps {
|
|
4
4
|
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
selected?: Date[];
|
|
@@ -10,9 +10,65 @@ export interface GetStyleProps {
|
|
|
10
10
|
unavailable: boolean;
|
|
11
11
|
isInRange: boolean;
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
13
|
+
export interface RangeDatePickerLabels {
|
|
14
|
+
monthNamesFull: string[];
|
|
15
|
+
weekdayNamesShort: string[];
|
|
16
|
+
backButtonLabel?: string;
|
|
17
|
+
forwardButtonLabel?: string;
|
|
14
18
|
}
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
export interface RangeDatePickerProps extends Props {
|
|
20
|
+
onDateSelected?: (obj: {
|
|
21
|
+
selected: Date[];
|
|
22
|
+
selectable: boolean;
|
|
23
|
+
date: Date;
|
|
24
|
+
}) => void;
|
|
25
|
+
selected?: Date[];
|
|
26
|
+
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
27
|
+
showOutsideDays?: boolean;
|
|
28
|
+
date?: Date;
|
|
29
|
+
minDate?: Date;
|
|
30
|
+
maxDate?: Date;
|
|
31
|
+
monthsToDisplay?: number;
|
|
32
|
+
labels?: RangeDatePickerLabels;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to render the calendar in a popover with a trigger button.
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
withPopover?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Controlled open state for the popover.
|
|
40
|
+
*/
|
|
41
|
+
open?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Callback when the popover open state changes.
|
|
44
|
+
*/
|
|
45
|
+
onOpenChange?: (details: {
|
|
46
|
+
open: boolean;
|
|
47
|
+
}) => void;
|
|
48
|
+
/**
|
|
49
|
+
* The trigger button element. If not provided, a default button will be rendered.
|
|
50
|
+
*/
|
|
51
|
+
trigger?: React.ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Format string for displaying the selected date range in the trigger button.
|
|
54
|
+
* @default "YYYY-MM-DD"
|
|
55
|
+
*/
|
|
56
|
+
displayFormat?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Placeholder text for the trigger button when no dates are selected.
|
|
59
|
+
*/
|
|
60
|
+
placeholder?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Whether to close the popover when clicking outside.
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
closeOnInteractOutside?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Whether to portal the popover content.
|
|
68
|
+
* @default true
|
|
69
|
+
*/
|
|
70
|
+
portalled?: boolean;
|
|
71
|
+
render?: (dayzedData: RenderProps) => React.ReactNode;
|
|
17
72
|
}
|
|
73
|
+
declare const RangeDatePicker: React.FC<RangeDatePickerProps>;
|
|
18
74
|
export default RangeDatePicker;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type FormatType = "date" | "time" | "date-time" | "iso-time" | "iso-date-time" | "duration";
|
|
2
|
+
interface UniversalPickerProps {
|
|
3
|
+
format: FormatType;
|
|
4
|
+
value?: string | null;
|
|
5
|
+
onChange?: (value: string | null) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function UniversalPicker({ format, value, onChange, placeholder, }: UniversalPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as DatePicker } from './DatePicker';
|
|
2
|
+
export { TimePicker } from '../TimePicker/TimePicker';
|
|
3
|
+
export { IsoTimePicker } from './IsoTimePicker';
|
|
4
|
+
export { DateTimePicker } from './DateTimePicker';
|
|
5
|
+
export { DurationPicker } from './DurationPicker';
|
|
6
|
+
export { UniversalPicker } from './UniversalPicker';
|
|
7
|
+
export { DatePickerInput } from './DatePickerInput';
|
|
8
|
+
export type { DatePickerProps, CalendarProps, GetDateColorProps, GetVariantProps, } from './DatePicker';
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
2
|
interface TagFilterProps {
|
|
3
|
-
availableTags:
|
|
3
|
+
availableTags: {
|
|
4
|
+
label?: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}[];
|
|
4
7
|
selectedTags: string[];
|
|
8
|
+
selectOne?: boolean;
|
|
5
9
|
onTagChange: (tags: string[]) => void;
|
|
6
10
|
}
|
|
7
11
|
export declare const TagFilter: React.FC<TagFilterProps>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from
|
|
2
|
-
import { JSONSchema7 } from
|
|
3
|
-
import { Dispatch, SetStateAction } from
|
|
4
|
-
import { FieldValues } from
|
|
5
|
-
import { UseTranslationResponse } from
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { JSONSchema7 } from 'json-schema';
|
|
3
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
4
|
+
import { FieldValues, Resolver } from 'react-hook-form';
|
|
5
|
+
import { UseTranslationResponse } from 'react-i18next';
|
|
6
|
+
import { DateTimePickerLabels, IdPickerLabels, EnumPickerLabels, FilePickerLabels } from './components/types/CustomJSONSchema7';
|
|
6
7
|
export interface SchemaFormContext<TData extends FieldValues> {
|
|
7
8
|
schema: JSONSchema7;
|
|
8
9
|
serverUrl: string;
|
|
@@ -14,7 +15,7 @@ export interface SchemaFormContext<TData extends FieldValues> {
|
|
|
14
15
|
rowNumber?: number | string;
|
|
15
16
|
idMap: Record<string, object>;
|
|
16
17
|
setIdMap: Dispatch<SetStateAction<Record<string, object>>>;
|
|
17
|
-
translate: UseTranslationResponse<
|
|
18
|
+
translate: UseTranslationResponse<string, string>;
|
|
18
19
|
requestOptions: AxiosRequestConfig;
|
|
19
20
|
isSuccess: boolean;
|
|
20
21
|
setIsSuccess: Dispatch<SetStateAction<boolean>>;
|
|
@@ -29,5 +30,21 @@ export interface SchemaFormContext<TData extends FieldValues> {
|
|
|
29
30
|
error: unknown;
|
|
30
31
|
setError: Dispatch<SetStateAction<unknown>>;
|
|
31
32
|
getUpdatedData: () => TData | Promise<TData>;
|
|
33
|
+
customErrorRenderer?: (error: unknown) => ReactNode;
|
|
34
|
+
customSuccessRenderer?: (resetHandler: () => void | Promise<void>) => ReactNode;
|
|
35
|
+
timezone?: string;
|
|
36
|
+
displayConfig: {
|
|
37
|
+
showSubmitButton?: boolean;
|
|
38
|
+
showResetButton?: boolean;
|
|
39
|
+
showTitle?: boolean;
|
|
40
|
+
};
|
|
41
|
+
requireConfirmation: boolean;
|
|
42
|
+
onFormSubmit: (data: TData) => Promise<void>;
|
|
43
|
+
dateTimePickerLabels?: DateTimePickerLabels;
|
|
44
|
+
idPickerLabels?: IdPickerLabels;
|
|
45
|
+
enumPickerLabels?: EnumPickerLabels;
|
|
46
|
+
filePickerLabels?: FilePickerLabels;
|
|
47
|
+
ajvResolver: Resolver<FieldValues>;
|
|
48
|
+
insideDialog?: boolean;
|
|
32
49
|
}
|
|
33
50
|
export declare const SchemaFormContext: import("react").Context<SchemaFormContext<unknown>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FilePickerMediaFile, FilePickerLabels } from './types/CustomJSONSchema7';
|
|
2
|
+
type MediaLibraryBrowserPropsBase = {
|
|
3
|
+
onFetchFiles?: (search: string) => Promise<FilePickerMediaFile[]>;
|
|
4
|
+
filterImageOnly?: boolean;
|
|
5
|
+
labels?: FilePickerLabels;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type MediaLibraryBrowserPropsSingle = MediaLibraryBrowserPropsBase & {
|
|
9
|
+
multiple?: false;
|
|
10
|
+
onFileSelect?: (file: FilePickerMediaFile) => void;
|
|
11
|
+
selectedFile?: FilePickerMediaFile;
|
|
12
|
+
onSelectedFileChange?: (file: FilePickerMediaFile | undefined) => void;
|
|
13
|
+
};
|
|
14
|
+
type MediaLibraryBrowserPropsMultiple = MediaLibraryBrowserPropsBase & {
|
|
15
|
+
multiple: true;
|
|
16
|
+
onFileSelect?: (files: FilePickerMediaFile[]) => void;
|
|
17
|
+
selectedFile?: FilePickerMediaFile[];
|
|
18
|
+
onSelectedFileChange?: (files: FilePickerMediaFile[]) => void;
|
|
19
|
+
};
|
|
20
|
+
export type MediaLibraryBrowserProps = MediaLibraryBrowserPropsSingle | MediaLibraryBrowserPropsMultiple;
|
|
21
|
+
export declare const MediaLibraryBrowser: ({ onFetchFiles, filterImageOnly, labels, enabled, multiple, onFileSelect, selectedFile: controlledSelectedFile, onSelectedFileChange, }: MediaLibraryBrowserProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
+
export {};
|
|
@@ -2,5 +2,6 @@ import { FormRootProps } from "./FormRoot";
|
|
|
2
2
|
import { FieldValues } from "react-hook-form";
|
|
3
3
|
export interface DefaultFormProps<TData extends FieldValues> {
|
|
4
4
|
formConfig: Omit<FormRootProps<TData>, "children">;
|
|
5
|
+
showTitle?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare const DefaultForm: <TData extends FieldValues>({ formConfig, }: DefaultFormProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const FormBody: <TData extends object>() => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ForeignKeyProps } from
|
|
2
|
-
import { AxiosRequestConfig } from
|
|
3
|
-
import { JSONSchema7 } from
|
|
4
|
-
import { Dispatch, ReactNode, SetStateAction } from
|
|
5
|
-
import { FieldValues, SubmitHandler, UseFormReturn } from
|
|
6
|
-
import { UseTranslationResponse } from
|
|
1
|
+
import { ForeignKeyProps } from '@/components/Form/components/fields/StringInputField';
|
|
2
|
+
import { AxiosRequestConfig } from 'axios';
|
|
3
|
+
import { JSONSchema7 } from 'json-schema';
|
|
4
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
5
|
+
import { FieldValues, SubmitHandler, UseFormReturn } from 'react-hook-form';
|
|
6
|
+
import { UseTranslationResponse } from 'react-i18next';
|
|
7
|
+
import { CustomJSONSchema7, DateTimePickerLabels, IdPickerLabels, EnumPickerLabels, FilePickerLabels } from '../types/CustomJSONSchema7';
|
|
7
8
|
export interface FormRootProps<TData extends FieldValues> {
|
|
8
|
-
schema:
|
|
9
|
+
schema: CustomJSONSchema7;
|
|
9
10
|
serverUrl: string;
|
|
10
11
|
requestUrl?: string;
|
|
11
12
|
idMap: Record<string, object>;
|
|
@@ -20,6 +21,19 @@ export interface FormRootProps<TData extends FieldValues> {
|
|
|
20
21
|
rowNumber?: number | string;
|
|
21
22
|
requestOptions?: AxiosRequestConfig;
|
|
22
23
|
getUpdatedData?: () => TData | Promise<TData> | void;
|
|
24
|
+
customErrorRenderer?: (error: unknown) => ReactNode;
|
|
25
|
+
customSuccessRenderer?: (resetHandler: () => void | Promise<void>) => ReactNode;
|
|
26
|
+
displayConfig?: {
|
|
27
|
+
showSubmitButton?: boolean;
|
|
28
|
+
showResetButton?: boolean;
|
|
29
|
+
showTitle?: boolean;
|
|
30
|
+
};
|
|
31
|
+
requireConfirmation?: boolean;
|
|
32
|
+
dateTimePickerLabels?: DateTimePickerLabels;
|
|
33
|
+
idPickerLabels?: IdPickerLabels;
|
|
34
|
+
enumPickerLabels?: EnumPickerLabels;
|
|
35
|
+
filePickerLabels?: FilePickerLabels;
|
|
36
|
+
insideDialog?: boolean;
|
|
23
37
|
}
|
|
24
38
|
export interface CustomJSONSchema7Definition extends JSONSchema7 {
|
|
25
39
|
variant: string;
|
|
@@ -36,4 +50,4 @@ export declare const idPickerSanityCheck: (column: string, foreign_key?: {
|
|
|
36
50
|
column?: string | undefined;
|
|
37
51
|
display_column?: string | undefined;
|
|
38
52
|
} | undefined) => void;
|
|
39
|
-
export declare const FormRoot: <TData extends FieldValues>({ schema, idMap, setIdMap, form, serverUrl, translate, children, order, ignore, include, onSubmit, rowNumber, requestOptions, getUpdatedData, }: FormRootProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare const FormRoot: <TData extends FieldValues>({ schema, idMap, setIdMap, form, serverUrl, translate, children, order, ignore, include, onSubmit, rowNumber, requestOptions, getUpdatedData, customErrorRenderer, customSuccessRenderer, displayConfig, requireConfirmation, dateTimePickerLabels, idPickerLabels, enumPickerLabels, filePickerLabels, insideDialog, }: FormRootProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from
|
|
1
|
+
import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
|
|
2
2
|
export interface ColumnRendererProps {
|
|
3
3
|
column: string;
|
|
4
4
|
properties: Record<string, CustomJSONSchema7>;
|
|
5
5
|
prefix: string;
|
|
6
|
+
parentRequired?: string[];
|
|
6
7
|
}
|
|
7
|
-
export declare const ColumnRenderer: ({ column, properties, prefix, }: ColumnRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const ColumnRenderer: ({ column, properties, prefix, parentRequired, }: ColumnRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
|
|
3
|
+
export interface DatePickerProps {
|
|
4
|
+
column: string;
|
|
5
|
+
schema: CustomJSONSchema7;
|
|
6
|
+
prefix: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const CustomInput: ({ column, schema, prefix }: DatePickerProps) => import("react").ReactNode;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
column: string;
|
|
4
|
-
schema: CustomJSONSchema7;
|
|
5
|
-
prefix: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const DatePicker: ({ column, schema, prefix }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { InputDefaultProps } from './types';
|
|
2
|
+
export declare const DatePicker: ({ column, schema, prefix }: InputDefaultProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from
|
|
1
|
+
import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
|
|
2
2
|
export interface IdPickerProps {
|
|
3
3
|
column: string;
|
|
4
4
|
isMultiple?: boolean;
|
|
5
5
|
schema: CustomJSONSchema7;
|
|
6
6
|
prefix: string;
|
|
7
|
+
showTotalAndLimit?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const EnumPicker: ({ column, isMultiple, schema, prefix, }: IdPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const EnumPicker: ({ column, isMultiple, schema, prefix, showTotalAndLimit, }: IdPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { FilePickerMediaFile, FilePickerLabels } from '../types/CustomJSONSchema7';
|
|
2
|
+
import { InputDefaultProps } from './types';
|
|
3
|
+
interface MediaBrowserDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onSelect: (file: FilePickerMediaFile) => void;
|
|
7
|
+
title: string;
|
|
8
|
+
filterImageOnly?: boolean;
|
|
9
|
+
onFetchFiles?: (search: string) => Promise<FilePickerMediaFile[]>;
|
|
10
|
+
onUploadFile?: (file: File) => Promise<string>;
|
|
11
|
+
enableUpload?: boolean;
|
|
12
|
+
labels?: FilePickerLabels;
|
|
13
|
+
translate: (key: string) => string;
|
|
14
|
+
colLabel: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function MediaBrowserDialog({ open, onClose, onSelect, title, filterImageOnly, onFetchFiles, onUploadFile, enableUpload, labels, translate, colLabel, }: MediaBrowserDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export declare const FilePicker: ({ column, schema, prefix }: InputDefaultProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1,12 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface StringInputFieldProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { InputDefaultProps } from './types';
|
|
2
|
+
export interface StringInputFieldProps extends InputDefaultProps {
|
|
3
|
+
}
|
|
4
|
+
export interface CustomQueryFnResponse {
|
|
5
|
+
/**
|
|
6
|
+
* The data of the query
|
|
7
|
+
*/
|
|
8
|
+
data: any;
|
|
9
|
+
/**
|
|
10
|
+
* The id map of the data
|
|
11
|
+
*/
|
|
12
|
+
idMap: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
export interface CustomQueryFnParams {
|
|
15
|
+
searching: string;
|
|
16
|
+
limit: number;
|
|
17
|
+
offset: number;
|
|
18
|
+
where?: Array<{
|
|
19
|
+
id: string;
|
|
20
|
+
value: string | string[];
|
|
21
|
+
}>;
|
|
6
22
|
}
|
|
23
|
+
export type CustomQueryFn = (params: CustomQueryFnParams) => Promise<CustomQueryFnResponse>;
|
|
7
24
|
export interface ForeignKeyProps {
|
|
8
25
|
column: string;
|
|
9
26
|
table: string;
|
|
10
27
|
display_column: string;
|
|
28
|
+
customQueryFn?: CustomQueryFn;
|
|
11
29
|
}
|
|
12
30
|
export declare const StringInputField: ({ column, schema, prefix, }: StringInputFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
|
|
2
|
+
export interface TextAreaInputProps {
|
|
3
|
+
column: string;
|
|
4
|
+
schema: CustomJSONSchema7;
|
|
5
|
+
prefix: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ForeignKeyProps {
|
|
8
|
+
column: string;
|
|
9
|
+
table: string;
|
|
10
|
+
display_column: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const TextAreaInput: ({ column, schema, prefix, }: TextAreaInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from
|
|
1
|
+
import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
|
|
2
2
|
export interface DatePickerProps {
|
|
3
3
|
column: string;
|
|
4
4
|
schema: CustomJSONSchema7;
|
|
5
5
|
prefix: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const TimePicker: ({ column, schema, prefix }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,94 @@
|
|
|
1
|
-
import { JSONSchema7 } from
|
|
2
|
-
import { ReactNode } from
|
|
3
|
-
import { ForeignKeyProps } from
|
|
1
|
+
import { JSONSchema7 } from 'json-schema';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { ForeignKeyProps } from '../fields/StringInputField';
|
|
4
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
5
|
+
import { ValidationErrorType } from '../../utils/buildErrorMessages';
|
|
6
|
+
export interface DateTimePickerLabels {
|
|
7
|
+
monthNamesShort?: string[];
|
|
8
|
+
weekdayNamesShort?: string[];
|
|
9
|
+
backButtonLabel?: string;
|
|
10
|
+
forwardButtonLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IdPickerLabels {
|
|
13
|
+
undefined?: string;
|
|
14
|
+
addMore?: string;
|
|
15
|
+
typeToSearch?: string;
|
|
16
|
+
total?: string;
|
|
17
|
+
showing?: string;
|
|
18
|
+
perPage?: string;
|
|
19
|
+
emptySearchResult?: string;
|
|
20
|
+
initialResults?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface EnumPickerLabels {
|
|
23
|
+
undefined?: string;
|
|
24
|
+
addMore?: string;
|
|
25
|
+
typeToSearch?: string;
|
|
26
|
+
total?: string;
|
|
27
|
+
showing?: string;
|
|
28
|
+
perPage?: string;
|
|
29
|
+
emptySearchResult?: string;
|
|
30
|
+
initialResults?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface FilePickerLabels {
|
|
33
|
+
fileDropzone?: string;
|
|
34
|
+
browseLibrary?: string;
|
|
35
|
+
dialogTitle?: string;
|
|
36
|
+
searchPlaceholder?: string;
|
|
37
|
+
loading?: string;
|
|
38
|
+
loadingFailed?: string;
|
|
39
|
+
noFilesFound?: string;
|
|
40
|
+
cancel?: string;
|
|
41
|
+
select?: string;
|
|
42
|
+
uploadTab?: string;
|
|
43
|
+
browseTab?: string;
|
|
44
|
+
uploading?: string;
|
|
45
|
+
uploadFailed?: string;
|
|
46
|
+
}
|
|
4
47
|
export interface CustomJSONSchema7 extends JSONSchema7 {
|
|
5
48
|
gridColumn?: string;
|
|
6
49
|
gridRow?: string;
|
|
7
50
|
foreign_key?: ForeignKeyProps;
|
|
8
51
|
variant?: string;
|
|
9
|
-
renderDisplay
|
|
52
|
+
renderDisplay?: (item: unknown) => ReactNode;
|
|
53
|
+
inputRender?: (props: {
|
|
54
|
+
column: string;
|
|
55
|
+
schema: CustomJSONSchema7;
|
|
56
|
+
prefix: string;
|
|
57
|
+
formContext: UseFormReturn;
|
|
58
|
+
}) => ReactNode;
|
|
59
|
+
inputViewerRender?: (props: {
|
|
60
|
+
column: string;
|
|
61
|
+
schema: CustomJSONSchema7;
|
|
62
|
+
prefix: string;
|
|
63
|
+
formContext: UseFormReturn;
|
|
64
|
+
}) => ReactNode;
|
|
65
|
+
dateFormat?: string;
|
|
66
|
+
displayDateFormat?: string;
|
|
67
|
+
timeFormat?: string;
|
|
68
|
+
displayTimeFormat?: string;
|
|
69
|
+
showLabel?: boolean;
|
|
70
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
71
|
+
numberStorageType?: 'string' | 'number';
|
|
72
|
+
errorMessages?: Partial<Record<ValidationErrorType | string, string>>;
|
|
73
|
+
filePicker?: FilePickerProps;
|
|
10
74
|
}
|
|
11
75
|
export interface TagPickerProps {
|
|
12
76
|
column: string;
|
|
13
77
|
schema: CustomJSONSchema7;
|
|
14
78
|
prefix: string;
|
|
15
79
|
}
|
|
80
|
+
export interface FilePickerMediaFile {
|
|
81
|
+
id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
url?: string;
|
|
84
|
+
size?: string | number;
|
|
85
|
+
comment?: string;
|
|
86
|
+
type?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface FilePickerProps {
|
|
89
|
+
onFetchFiles?: (search: string) => Promise<FilePickerMediaFile[]>;
|
|
90
|
+
enableMediaLibrary?: boolean;
|
|
91
|
+
filterImageOnly?: boolean;
|
|
92
|
+
enableUpload?: boolean;
|
|
93
|
+
onUploadFile?: (file: File) => Promise<string>;
|
|
94
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
|
|
3
|
+
export interface DatePickerProps {
|
|
4
|
+
column: string;
|
|
5
|
+
schema: CustomJSONSchema7;
|
|
6
|
+
prefix: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const CustomViewer: ({ column, schema, prefix }: DatePickerProps) => import("react").ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
|
|
2
|
+
export interface DateViewerProps {
|
|
3
|
+
column: string;
|
|
4
|
+
schema: CustomJSONSchema7;
|
|
5
|
+
prefix: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const DateTimeViewer: ({ column, schema, prefix }: DateViewerProps) => import("react/jsx-runtime").JSX.Element;
|