@bsol-oss/react-datatable5 12.0.0-beta.91 → 12.0.0-beta.92
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 +11 -5
- package/dist/index.js +345 -273
- package/dist/index.mjs +345 -274
- package/dist/types/components/DataTable/display/RecordDisplay.d.ts +2 -2
- package/dist/types/components/Form/SchemaFormContext.d.ts +2 -1
- package/dist/types/components/Form/components/core/FormRoot.d.ts +3 -4
- package/dist/types/components/Form/components/fields/ArrayRenderer.d.ts +1 -1
- package/dist/types/components/Form/components/fields/StringInputField.d.ts +0 -1
- package/dist/types/components/Form/components/fields/TextAreaInput.d.ts +0 -5
- package/dist/types/components/Form/components/types/CustomJSONSchema7.d.ts +8 -0
- package/dist/types/components/Form/components/viewers/ArrayViewer.d.ts +1 -1
- package/dist/types/components/Form/components/viewers/BooleanViewer.d.ts +1 -1
- package/dist/types/components/Form/components/viewers/DateTimeViewer.d.ts +1 -1
- package/dist/types/components/Form/components/viewers/DateViewer.d.ts +1 -1
- package/dist/types/components/Form/components/viewers/IdViewer.d.ts +1 -1
- package/dist/types/components/Form/components/viewers/ObjectViewer.d.ts +1 -1
- package/dist/types/components/Form/components/viewers/RecordViewer.d.ts +2 -2
- package/dist/types/components/Form/components/viewers/StringViewer.d.ts +1 -6
- package/dist/types/components/Form/components/viewers/TextAreaViewer.d.ts +1 -6
- package/dist/types/components/Form/components/viewers/TimeViewer.d.ts +1 -1
- package/dist/types/components/Form/utils/useFormI18n.d.ts +5 -3
- package/dist/types/components/ui/pagination.d.ts +10 -7
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BoxProps } from
|
|
2
|
-
import { UseTranslationResponse } from
|
|
1
|
+
import { BoxProps } from '@chakra-ui/react';
|
|
2
|
+
import { UseTranslationResponse } from 'react-i18next';
|
|
3
3
|
export interface RecordDisplayProps {
|
|
4
4
|
object: object | null;
|
|
5
5
|
boxProps?: BoxProps;
|
|
@@ -3,7 +3,7 @@ import { JSONSchema7 } from 'json-schema';
|
|
|
3
3
|
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
4
4
|
import { FieldValues, Resolver } from 'react-hook-form';
|
|
5
5
|
import { UseTranslationResponse } from 'react-i18next';
|
|
6
|
-
import { DateTimePickerLabels, IdPickerLabels, EnumPickerLabels, FilePickerLabels } from './components/types/CustomJSONSchema7';
|
|
6
|
+
import { DateTimePickerLabels, IdPickerLabels, EnumPickerLabels, FilePickerLabels, FormButtonLabels } from './components/types/CustomJSONSchema7';
|
|
7
7
|
export interface SchemaFormContext<TData extends FieldValues> {
|
|
8
8
|
schema: JSONSchema7;
|
|
9
9
|
serverUrl: string;
|
|
@@ -44,6 +44,7 @@ export interface SchemaFormContext<TData extends FieldValues> {
|
|
|
44
44
|
idPickerLabels?: IdPickerLabels;
|
|
45
45
|
enumPickerLabels?: EnumPickerLabels;
|
|
46
46
|
filePickerLabels?: FilePickerLabels;
|
|
47
|
+
formButtonLabels?: FormButtonLabels;
|
|
47
48
|
ajvResolver: Resolver<FieldValues>;
|
|
48
49
|
insideDialog?: boolean;
|
|
49
50
|
}
|
|
@@ -4,7 +4,7 @@ import { JSONSchema7 } from 'json-schema';
|
|
|
4
4
|
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
5
5
|
import { FieldValues, SubmitHandler, UseFormReturn } from 'react-hook-form';
|
|
6
6
|
import { UseTranslationResponse } from 'react-i18next';
|
|
7
|
-
import { CustomJSONSchema7, DateTimePickerLabels, IdPickerLabels, EnumPickerLabels, FilePickerLabels } from '../types/CustomJSONSchema7';
|
|
7
|
+
import { CustomJSONSchema7, DateTimePickerLabels, IdPickerLabels, EnumPickerLabels, FilePickerLabels, FormButtonLabels } from '../types/CustomJSONSchema7';
|
|
8
8
|
export interface FormRootProps<TData extends FieldValues> {
|
|
9
9
|
schema: CustomJSONSchema7;
|
|
10
10
|
serverUrl: string;
|
|
@@ -33,13 +33,13 @@ export interface FormRootProps<TData extends FieldValues> {
|
|
|
33
33
|
idPickerLabels?: IdPickerLabels;
|
|
34
34
|
enumPickerLabels?: EnumPickerLabels;
|
|
35
35
|
filePickerLabels?: FilePickerLabels;
|
|
36
|
+
formButtonLabels?: FormButtonLabels;
|
|
36
37
|
insideDialog?: boolean;
|
|
37
38
|
}
|
|
38
39
|
export interface CustomJSONSchema7Definition extends JSONSchema7 {
|
|
39
40
|
variant: string;
|
|
40
41
|
in_table: string;
|
|
41
42
|
column_ref: string;
|
|
42
|
-
display_column: string;
|
|
43
43
|
gridColumn: string;
|
|
44
44
|
gridRow: string;
|
|
45
45
|
foreign_key: ForeignKeyProps;
|
|
@@ -48,6 +48,5 @@ export interface CustomJSONSchema7Definition extends JSONSchema7 {
|
|
|
48
48
|
export declare const idPickerSanityCheck: (column: string, foreign_key?: {
|
|
49
49
|
table?: string | undefined;
|
|
50
50
|
column?: string | undefined;
|
|
51
|
-
display_column?: string | undefined;
|
|
52
51
|
} | undefined) => void;
|
|
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;
|
|
52
|
+
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, formButtonLabels, insideDialog, }: FormRootProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,7 +24,6 @@ export type CustomQueryFn = (params: CustomQueryFnParams) => Promise<CustomQuery
|
|
|
24
24
|
export interface ForeignKeyProps {
|
|
25
25
|
column: string;
|
|
26
26
|
table: string;
|
|
27
|
-
display_column: string;
|
|
28
27
|
customQueryFn?: CustomQueryFn;
|
|
29
28
|
}
|
|
30
29
|
export declare const StringInputField: ({ column, schema, prefix, }: StringInputFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,9 +4,4 @@ export interface TextAreaInputProps {
|
|
|
4
4
|
schema: CustomJSONSchema7;
|
|
5
5
|
prefix: string;
|
|
6
6
|
}
|
|
7
|
-
export interface ForeignKeyProps {
|
|
8
|
-
column: string;
|
|
9
|
-
table: string;
|
|
10
|
-
display_column: string;
|
|
11
|
-
}
|
|
12
7
|
export declare const TextAreaInput: ({ column, schema, prefix, }: TextAreaInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -44,6 +44,13 @@ export interface FilePickerLabels {
|
|
|
44
44
|
uploading?: string;
|
|
45
45
|
uploadFailed?: string;
|
|
46
46
|
}
|
|
47
|
+
export interface FormButtonLabels {
|
|
48
|
+
submit?: string;
|
|
49
|
+
reset?: string;
|
|
50
|
+
cancel?: string;
|
|
51
|
+
confirm?: string;
|
|
52
|
+
submitAgain?: string;
|
|
53
|
+
}
|
|
47
54
|
export interface CustomJSONSchema7 extends JSONSchema7 {
|
|
48
55
|
gridColumn?: string;
|
|
49
56
|
gridRow?: string;
|
|
@@ -72,6 +79,7 @@ export interface CustomJSONSchema7 extends JSONSchema7 {
|
|
|
72
79
|
errorMessages?: Partial<Record<ValidationErrorType | string, string>>;
|
|
73
80
|
filePicker?: FilePickerProps;
|
|
74
81
|
}
|
|
82
|
+
export declare const defaultRenderDisplay: (item: unknown) => ReactNode;
|
|
75
83
|
export interface TagPickerProps {
|
|
76
84
|
column: string;
|
|
77
85
|
schema: CustomJSONSchema7;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from
|
|
1
|
+
import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
|
|
2
2
|
export interface DatePickerProps {
|
|
3
3
|
schema: CustomJSONSchema7;
|
|
4
4
|
column: string;
|
|
5
5
|
prefix: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const RecordViewer: ({ column, schema, prefix }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from
|
|
1
|
+
import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
|
|
2
2
|
export interface StringInputFieldProps {
|
|
3
3
|
column: string;
|
|
4
4
|
schema: CustomJSONSchema7;
|
|
5
5
|
prefix: string;
|
|
6
6
|
}
|
|
7
|
-
export interface ForeignKeyProps {
|
|
8
|
-
column: string;
|
|
9
|
-
table: string;
|
|
10
|
-
display_column: string;
|
|
11
|
-
}
|
|
12
7
|
export declare const StringViewer: ({ column, schema, prefix, }: StringInputFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { CustomJSONSchema7 } from
|
|
1
|
+
import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
|
|
2
2
|
export interface TextAreaViewerProps {
|
|
3
3
|
column: string;
|
|
4
4
|
schema: CustomJSONSchema7;
|
|
5
5
|
prefix: string;
|
|
6
6
|
}
|
|
7
|
-
export interface ForeignKeyProps {
|
|
8
|
-
column: string;
|
|
9
|
-
table: string;
|
|
10
|
-
display_column: string;
|
|
11
|
-
}
|
|
12
7
|
export declare const TextAreaViewer: ({ column, schema, prefix, }: TextAreaViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -23,14 +23,16 @@
|
|
|
23
23
|
* const colLabel = formI18n.colLabel;
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
export declare const useFormI18n: (column: string, prefix?: string
|
|
26
|
+
export declare const useFormI18n: (column: string, prefix?: string, schema?: {
|
|
27
|
+
title?: string;
|
|
28
|
+
}) => {
|
|
27
29
|
/**
|
|
28
30
|
* The constructed column label (prefix + column)
|
|
29
31
|
*/
|
|
30
32
|
colLabel: string;
|
|
31
33
|
/**
|
|
32
|
-
* Get the field label translation
|
|
33
|
-
*
|
|
34
|
+
* Get the field label from schema title prop, or fall back to translation
|
|
35
|
+
* Uses schema.title if available, otherwise: translate.t(removeIndex(`${colLabel}.field_label`))
|
|
34
36
|
*/
|
|
35
37
|
label: (options?: any) => string;
|
|
36
38
|
/**
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import type { ButtonProps, TextProps } from
|
|
2
|
-
import { Pagination as ChakraPagination } from
|
|
3
|
-
import * as React from
|
|
4
|
-
type PaginationVariant =
|
|
5
|
-
export interface PaginationRootProps extends Omit<ChakraPagination.RootProps,
|
|
6
|
-
size?: ButtonProps[
|
|
1
|
+
import type { ButtonProps, TextProps } from '@chakra-ui/react';
|
|
2
|
+
import { Pagination as ChakraPagination } from '@chakra-ui/react';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
type PaginationVariant = 'outline' | 'solid' | 'subtle';
|
|
5
|
+
export interface PaginationRootProps extends Omit<ChakraPagination.RootProps, 'type'> {
|
|
6
|
+
size?: ButtonProps['size'];
|
|
7
7
|
variant?: PaginationVariant;
|
|
8
8
|
getHref?: (page: number) => string;
|
|
9
|
+
siblingCount?: number;
|
|
10
|
+
minSiblingCount?: number;
|
|
11
|
+
maxSiblingCount?: number;
|
|
9
12
|
}
|
|
10
13
|
export declare const PaginationRoot: React.ForwardRefExoticComponent<PaginationRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
14
|
export declare const PaginationEllipsis: React.ForwardRefExoticComponent<ChakraPagination.EllipsisProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -14,7 +17,7 @@ export declare const PaginationPrevTrigger: React.ForwardRefExoticComponent<Chak
|
|
|
14
17
|
export declare const PaginationNextTrigger: React.ForwardRefExoticComponent<ChakraPagination.NextTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
18
|
export declare const PaginationItems: (props: React.HTMLAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
|
|
16
19
|
interface PageTextProps extends TextProps {
|
|
17
|
-
format?:
|
|
20
|
+
format?: 'short' | 'compact' | 'long';
|
|
18
21
|
}
|
|
19
22
|
export declare const PaginationPageText: React.ForwardRefExoticComponent<PageTextProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
20
23
|
export {};
|
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.92",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -53,13 +53,14 @@
|
|
|
53
53
|
"react": "^19.0.0",
|
|
54
54
|
"react-dom": "^19.0.0",
|
|
55
55
|
"react-hook-form": "^7.54.2",
|
|
56
|
-
"react-i18next": "^
|
|
56
|
+
"react-i18next": "^16.3.5",
|
|
57
57
|
"react-icons": "^5.4.0",
|
|
58
58
|
"tiny-invariant": "^1.3.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@rollup/plugin-alias": "^5.1.1",
|
|
62
62
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
63
|
+
"@storybook/addon-docs": "^10.0.7",
|
|
63
64
|
"@storybook/addon-onboarding": "^10.0.7",
|
|
64
65
|
"@storybook/react-vite": "^10.0.7",
|
|
65
66
|
"@types/ajv-errors": "^2.0.0",
|
|
@@ -83,8 +84,7 @@
|
|
|
83
84
|
"rollup-plugin-dts": "^6.1.0",
|
|
84
85
|
"storybook": "^10.0.7",
|
|
85
86
|
"typescript": "^5.2.2",
|
|
86
|
-
"vite": "^5.2.0"
|
|
87
|
-
"@storybook/addon-docs": "^10.0.7"
|
|
87
|
+
"vite": "^5.2.0"
|
|
88
88
|
},
|
|
89
89
|
"lint-staged": {
|
|
90
90
|
"*.{ts,js,json,md,tsx}": [
|