@bsol-oss/react-datatable5 12.0.0-beta.73 → 12.0.0-beta.75
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/dist/index.d.ts +133 -124
- package/dist/index.js +651 -306
- package/dist/index.mjs +653 -309
- package/dist/types/components/Form/SchemaFormContext.d.ts +5 -2
- package/dist/types/components/Form/components/core/FormRoot.d.ts +2 -1
- 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/DateTimePicker.d.ts +1 -1
- package/dist/types/components/Form/components/fields/FilePicker.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/StringInputField.d.ts +1 -1
- package/dist/types/components/Form/components/fields/TextAreaInput.d.ts +1 -1
- package/dist/types/components/Form/components/fields/TimePicker.d.ts +1 -1
- package/dist/types/components/Form/components/types/CustomJSONSchema7.d.ts +4 -0
- package/dist/types/components/Form/components/viewers/NumberViewer.d.ts +1 -1
- package/dist/types/components/Form/useForm.d.ts +4 -2
- package/dist/types/components/Form/utils/ajvResolver.d.ts +13 -0
- package/dist/types/components/Form/utils/buildErrorMessages.d.ts +5 -1
- package/dist/types/components/Form/utils/getFieldError.d.ts +6 -0
- package/dist/types/components/Form/utils/useFormI18n.d.ts +1 -1
- package/dist/types/components/Form/utils/validateData.d.ts +2 -2
- package/dist/types/components/ui/field.d.ts +3 -3
- package/package.json +1 -1
- 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/DatePicker.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/Form/utils/translateWrapper.d.ts +0 -6
- package/dist/types/components/Form/utils/validation.d.ts +0 -104
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ForeignKeyProps } from "@/components/Form/components/fields/StringInputField";
|
|
2
|
-
import { AxiosRequestConfig } from "axios";
|
|
3
|
-
import { JSONSchema7 } from "json-schema";
|
|
4
|
-
import { Dispatch, SetStateAction } from "react";
|
|
5
|
-
import { FieldValues, SubmitHandler, UseFormReturn } from "react-hook-form";
|
|
6
|
-
import { UseTranslationResponse } from "react-i18next";
|
|
7
|
-
export interface FormProps<TData extends FieldValues> {
|
|
8
|
-
schema: JSONSchema7;
|
|
9
|
-
serverUrl: string;
|
|
10
|
-
requestUrl?: string;
|
|
11
|
-
idMap: Record<string, object>;
|
|
12
|
-
setIdMap: Dispatch<SetStateAction<Record<string, object>>>;
|
|
13
|
-
form: UseFormReturn;
|
|
14
|
-
translate: UseTranslationResponse<any, any>;
|
|
15
|
-
order?: string[];
|
|
16
|
-
ignore?: string[];
|
|
17
|
-
include?: string[];
|
|
18
|
-
onSubmit?: SubmitHandler<TData>;
|
|
19
|
-
rowNumber?: number | string;
|
|
20
|
-
requestOptions?: AxiosRequestConfig;
|
|
21
|
-
}
|
|
22
|
-
export interface CustomJSONSchema7Definition extends JSONSchema7 {
|
|
23
|
-
variant: string;
|
|
24
|
-
in_table: string;
|
|
25
|
-
column_ref: string;
|
|
26
|
-
display_column: string;
|
|
27
|
-
gridColumn: string;
|
|
28
|
-
gridRow: string;
|
|
29
|
-
foreign_key: ForeignKeyProps;
|
|
30
|
-
}
|
|
31
|
-
export declare const idPickerSanityCheck: (column: string, foreign_key?: {
|
|
32
|
-
table?: string | undefined;
|
|
33
|
-
column?: string | undefined;
|
|
34
|
-
display_column?: string | undefined;
|
|
35
|
-
} | undefined) => void;
|
|
36
|
-
export declare const Form: <TData extends FieldValues>({ schema, idMap, setIdMap, form, serverUrl, translate, order, ignore, include, onSubmit, rowNumber, requestOptions, }: FormProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface ArrayRendererProps {
|
|
3
|
-
column: string;
|
|
4
|
-
schema: CustomJSONSchema7;
|
|
5
|
-
prefix: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const ArrayRenderer: ({ schema, column, prefix, }: ArrayRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface DatePickerProps {
|
|
3
|
-
column: string;
|
|
4
|
-
schema: CustomJSONSchema7;
|
|
5
|
-
prefix: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const BooleanPicker: ({ schema, column, prefix }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface ColumnRendererProps {
|
|
3
|
-
column: string;
|
|
4
|
-
properties: Record<string, CustomJSONSchema7>;
|
|
5
|
-
prefix: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const ColumnRenderer: ({ column, properties, prefix, }: ColumnRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface DatePickerProps {
|
|
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,8 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface IdPickerProps {
|
|
3
|
-
column: string;
|
|
4
|
-
isMultiple?: boolean;
|
|
5
|
-
schema: CustomJSONSchema7;
|
|
6
|
-
prefix: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const EnumPicker: ({ column, isMultiple, schema, prefix, }: IdPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface IdPickerProps {
|
|
3
|
-
column: string;
|
|
4
|
-
schema: CustomJSONSchema7;
|
|
5
|
-
prefix: string;
|
|
6
|
-
isMultiple?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const IdPicker: ({ column, schema, prefix, isMultiple, }: IdPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface NumberInputFieldProps {
|
|
3
|
-
column: string;
|
|
4
|
-
schema: CustomJSONSchema7;
|
|
5
|
-
prefix: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const NumberInputField: ({ schema, column, prefix, }: NumberInputFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface ObjectInputProps {
|
|
3
|
-
schema: CustomJSONSchema7;
|
|
4
|
-
column: string;
|
|
5
|
-
prefix: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const ObjectInput: ({ schema, column, prefix }: ObjectInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface DatePickerProps {
|
|
3
|
-
schema: CustomJSONSchema7;
|
|
4
|
-
column: string;
|
|
5
|
-
prefix: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const RecordInput: ({ column, schema, prefix }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface SchemaRendererProps {
|
|
3
|
-
column: string;
|
|
4
|
-
schema: CustomJSONSchema7;
|
|
5
|
-
prefix: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const SchemaRenderer: ({ schema, prefix, column, }: SchemaRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { JSONSchema7 } from "json-schema";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
export interface StringInputFieldProps {
|
|
4
|
-
column: string;
|
|
5
|
-
schema: CustomJSONSchema7;
|
|
6
|
-
prefix: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ForeignKeyProps {
|
|
9
|
-
column: string;
|
|
10
|
-
table: string;
|
|
11
|
-
display_column: string;
|
|
12
|
-
}
|
|
13
|
-
export interface CustomJSONSchema7 extends JSONSchema7 {
|
|
14
|
-
gridColumn?: string;
|
|
15
|
-
gridRow?: string;
|
|
16
|
-
foreign_key?: ForeignKeyProps;
|
|
17
|
-
variant?: string;
|
|
18
|
-
renderDisplay: (item: unknown) => ReactNode;
|
|
19
|
-
}
|
|
20
|
-
export declare const StringInputField: ({ column, schema, prefix, }: StringInputFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from "./StringInputField";
|
|
2
|
-
export interface TagPickerProps {
|
|
3
|
-
column: string;
|
|
4
|
-
schema: CustomJSONSchema7;
|
|
5
|
-
prefix: string;
|
|
6
|
-
}
|
|
7
|
-
export interface Tag {
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
comment: string | null;
|
|
11
|
-
extra_info: string | null;
|
|
12
|
-
created_at: string;
|
|
13
|
-
updated_at: string;
|
|
14
|
-
table_id: string | null;
|
|
15
|
-
parent_id: string;
|
|
16
|
-
}
|
|
17
|
-
export interface AllTags {
|
|
18
|
-
[tagName: string]: Tag;
|
|
19
|
-
}
|
|
20
|
-
export interface TagData {
|
|
21
|
-
table_name: string;
|
|
22
|
-
parent_tag_name: string;
|
|
23
|
-
parent_tag_id: string;
|
|
24
|
-
all_tags: AllTags;
|
|
25
|
-
is_mutually_exclusive: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface TagResponse {
|
|
28
|
-
data: TagData[];
|
|
29
|
-
}
|
|
30
|
-
export declare const TagPicker: ({ column, schema, prefix }: TagPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { JSONSchema7 } from "json-schema";
|
|
2
|
-
declare const errorMessages: {
|
|
3
|
-
en: {
|
|
4
|
-
required: (field: string) => string;
|
|
5
|
-
format: (format: string) => string;
|
|
6
|
-
type: (expectedType: string, actualType: string) => string;
|
|
7
|
-
minLength: (limit: number) => string;
|
|
8
|
-
maxLength: (limit: number) => string;
|
|
9
|
-
minimum: (limit: number) => string;
|
|
10
|
-
maximum: (limit: number) => string;
|
|
11
|
-
pattern: () => string;
|
|
12
|
-
enum: (allowedValues: string[]) => string;
|
|
13
|
-
default: () => string;
|
|
14
|
-
};
|
|
15
|
-
'zh-HK': {
|
|
16
|
-
required: (field: string) => string;
|
|
17
|
-
format: (format: string) => string;
|
|
18
|
-
type: (expectedType: string, actualType: string) => string;
|
|
19
|
-
minLength: (limit: number) => string;
|
|
20
|
-
maxLength: (limit: number) => string;
|
|
21
|
-
minimum: (limit: number) => string;
|
|
22
|
-
maximum: (limit: number) => string;
|
|
23
|
-
pattern: () => string;
|
|
24
|
-
enum: (allowedValues: string[]) => string;
|
|
25
|
-
default: () => string;
|
|
26
|
-
};
|
|
27
|
-
'zh-TW': {
|
|
28
|
-
required: (field: string) => string;
|
|
29
|
-
format: (format: string) => string;
|
|
30
|
-
type: (expectedType: string, actualType: string) => string;
|
|
31
|
-
minLength: (limit: number) => string;
|
|
32
|
-
maxLength: (limit: number) => string;
|
|
33
|
-
minimum: (limit: number) => string;
|
|
34
|
-
maximum: (limit: number) => string;
|
|
35
|
-
pattern: () => string;
|
|
36
|
-
enum: (allowedValues: string[]) => string;
|
|
37
|
-
default: () => string;
|
|
38
|
-
};
|
|
39
|
-
'zh-CN': {
|
|
40
|
-
required: (field: string) => string;
|
|
41
|
-
format: (format: string) => string;
|
|
42
|
-
type: (expectedType: string, actualType: string) => string;
|
|
43
|
-
minLength: (limit: number) => string;
|
|
44
|
-
maxLength: (limit: number) => string;
|
|
45
|
-
minimum: (limit: number) => string;
|
|
46
|
-
maximum: (limit: number) => string;
|
|
47
|
-
pattern: () => string;
|
|
48
|
-
enum: (allowedValues: string[]) => string;
|
|
49
|
-
default: () => string;
|
|
50
|
-
};
|
|
51
|
-
zh: {
|
|
52
|
-
required: (field: string) => string;
|
|
53
|
-
format: (format: string) => string;
|
|
54
|
-
type: (expectedType: string, actualType: string) => string;
|
|
55
|
-
minLength: (limit: number) => string;
|
|
56
|
-
maxLength: (limit: number) => string;
|
|
57
|
-
minimum: (limit: number) => string;
|
|
58
|
-
maximum: (limit: number) => string;
|
|
59
|
-
pattern: () => string;
|
|
60
|
-
enum: (allowedValues: string[]) => string;
|
|
61
|
-
default: () => string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
export type SupportedLocale = keyof typeof errorMessages;
|
|
65
|
-
export interface ValidationError {
|
|
66
|
-
field: string;
|
|
67
|
-
message: string;
|
|
68
|
-
value?: unknown;
|
|
69
|
-
schemaPath?: string;
|
|
70
|
-
}
|
|
71
|
-
export interface ValidationResult {
|
|
72
|
-
isValid: boolean;
|
|
73
|
-
errors: ValidationError[];
|
|
74
|
-
}
|
|
75
|
-
export interface ValidationOptions {
|
|
76
|
-
locale?: SupportedLocale;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Validates data against a JSON Schema using AJV with i18n support
|
|
80
|
-
* @param data - The data to validate
|
|
81
|
-
* @param schema - The JSON Schema to validate against
|
|
82
|
-
* @param options - Validation options including locale
|
|
83
|
-
* @returns ValidationResult containing validation status and errors
|
|
84
|
-
*/
|
|
85
|
-
export declare const validateData: (data: unknown, schema: JSONSchema7, options?: ValidationOptions) => ValidationResult;
|
|
86
|
-
/**
|
|
87
|
-
* Creates a reusable validator function for a specific schema with i18n support
|
|
88
|
-
* @param schema - The JSON Schema to create validator for
|
|
89
|
-
* @param locale - The locale to use for error messages
|
|
90
|
-
* @returns A function that validates data against the schema
|
|
91
|
-
*/
|
|
92
|
-
export declare const createSchemaValidator: (schema: JSONSchema7, locale?: SupportedLocale) => (data: unknown) => ValidationResult;
|
|
93
|
-
/**
|
|
94
|
-
* Get available locales for validation error messages
|
|
95
|
-
* @returns Array of supported locale codes
|
|
96
|
-
*/
|
|
97
|
-
export declare const getSupportedLocales: () => SupportedLocale[];
|
|
98
|
-
/**
|
|
99
|
-
* Check if a locale is supported
|
|
100
|
-
* @param locale - The locale to check
|
|
101
|
-
* @returns Boolean indicating if the locale is supported
|
|
102
|
-
*/
|
|
103
|
-
export declare const isLocaleSupported: (locale: string) => locale is "en" | "zh-HK" | "zh-TW" | "zh-CN" | "zh";
|
|
104
|
-
export {};
|