@bsol-oss/react-datatable5 8.1.1 → 9.0.0
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 +13 -23
- package/dist/index.js +199 -207
- package/dist/index.mjs +197 -205
- package/dist/types/components/DataTable/TableControls.d.ts +4 -1
- package/dist/types/components/Form/Form.d.ts +8 -20
- package/dist/types/components/Form/SchemaFormContext.d.ts +2 -2
- package/dist/types/components/Form/components/IdViewer.d.ts +1 -3
- package/dist/types/components/Form/useForm.d.ts +12 -0
- package/dist/types/components/Form/useSchemaContext.d.ts +1 -1
- package/dist/types/components/ui/hover-card.d.ts +11 -0
- package/package.json +3 -2
|
@@ -10,9 +10,12 @@ export interface TableControlsProps {
|
|
|
10
10
|
showFilterName?: boolean;
|
|
11
11
|
showFilterTags?: boolean;
|
|
12
12
|
showReload?: boolean;
|
|
13
|
+
showPagination?: boolean;
|
|
14
|
+
showPageSizeControl?: boolean;
|
|
15
|
+
showPageCountText?: boolean;
|
|
13
16
|
filterOptions?: string[];
|
|
14
17
|
extraItems?: ReactNode;
|
|
15
18
|
loading?: boolean;
|
|
16
19
|
hasError?: boolean;
|
|
17
20
|
}
|
|
18
|
-
export declare const TableControls: ({ totalText, fitTableWidth, fitTableHeight, isMobile, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, filterOptions, extraItems, loading, hasError, }: TableControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const TableControls: ({ totalText, fitTableWidth, fitTableHeight, isMobile, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, showPagination, showPageSizeControl, showPageCountText, filterOptions, extraItems, loading, hasError, }: TableControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
import { ForeignKeyProps } from "@/components/Form/components/StringInputField";
|
|
2
2
|
import { JSONSchema7 } from "json-schema";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
addNew?: string;
|
|
7
|
-
submit?: string;
|
|
8
|
-
confirm?: string;
|
|
9
|
-
save?: string;
|
|
10
|
-
empty?: string;
|
|
11
|
-
cancel?: string;
|
|
12
|
-
submitSuccess?: string;
|
|
13
|
-
submitAgain?: string;
|
|
14
|
-
fieldRequired?: string;
|
|
15
|
-
total: string;
|
|
16
|
-
showing: string;
|
|
17
|
-
close: string;
|
|
18
|
-
typeToSearch: string;
|
|
19
|
-
showMore: string;
|
|
20
|
-
}
|
|
3
|
+
import { Dispatch, SetStateAction } from "react";
|
|
4
|
+
import { FieldValues, SubmitHandler, UseFormReturn } from "react-hook-form";
|
|
5
|
+
import { UseTranslationResponse } from "react-i18next";
|
|
21
6
|
export interface FormProps<TData extends FieldValues> {
|
|
22
7
|
schema: JSONSchema7;
|
|
23
8
|
serverUrl: string;
|
|
9
|
+
idMap: Record<string, object>;
|
|
10
|
+
setIdMap: Dispatch<SetStateAction<Record<string, object>>>;
|
|
11
|
+
form: UseFormReturn;
|
|
12
|
+
translate: UseTranslationResponse<any, any>;
|
|
24
13
|
order?: string[];
|
|
25
14
|
ignore?: string[];
|
|
26
15
|
onSubmit?: SubmitHandler<TData>;
|
|
27
16
|
preLoadedValues?: object;
|
|
28
17
|
rowNumber?: number | string;
|
|
29
|
-
displayText?: Partial<DisplayTextProps>;
|
|
30
18
|
}
|
|
31
19
|
export interface CustomJSONSchema7Definition extends JSONSchema7 {
|
|
32
20
|
variant: string;
|
|
@@ -37,4 +25,4 @@ export interface CustomJSONSchema7Definition extends JSONSchema7 {
|
|
|
37
25
|
gridRow: string;
|
|
38
26
|
foreign_key: ForeignKeyProps;
|
|
39
27
|
}
|
|
40
|
-
export declare const Form: <TData extends FieldValues>({ schema, serverUrl, order, ignore, onSubmit, preLoadedValues, rowNumber,
|
|
28
|
+
export declare const Form: <TData extends FieldValues>({ schema, idMap, setIdMap, form, serverUrl, translate, order, ignore, onSubmit, preLoadedValues, rowNumber, }: FormProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { JSONSchema7 } from "json-schema";
|
|
2
2
|
import { Dispatch, SetStateAction } from "react";
|
|
3
3
|
import { FieldValues } from "react-hook-form";
|
|
4
|
-
import {
|
|
4
|
+
import { UseTranslationResponse } from "react-i18next";
|
|
5
5
|
export interface SchemaFormContext<TData extends FieldValues> {
|
|
6
6
|
schema: JSONSchema7;
|
|
7
7
|
serverUrl: string;
|
|
8
8
|
order: string[];
|
|
9
9
|
ignore: string[];
|
|
10
|
-
displayText: Partial<DisplayTextProps>;
|
|
11
10
|
onSubmit?: (data: TData) => Promise<void>;
|
|
12
11
|
rowNumber?: number | string;
|
|
13
12
|
idMap: Record<string, object>;
|
|
14
13
|
setIdMap: Dispatch<SetStateAction<Record<string, object>>>;
|
|
14
|
+
translate: UseTranslationResponse<any, any>;
|
|
15
15
|
}
|
|
16
16
|
export declare const SchemaFormContext: import("react").Context<SchemaFormContext<unknown>>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { DataListItemProps } from "@chakra-ui/react";
|
|
2
1
|
export interface IdViewerProps {
|
|
3
2
|
value: string | undefined;
|
|
4
3
|
column: string;
|
|
5
|
-
dataListItemProps?: DataListItemProps;
|
|
6
4
|
}
|
|
7
|
-
export declare const IdViewer: ({ value, column
|
|
5
|
+
export declare const IdViewer: ({ value, column }: IdViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldValues } from "react-hook-form";
|
|
3
|
+
export interface UseFormProps {
|
|
4
|
+
preLoadedValues?: FieldValues | undefined;
|
|
5
|
+
keyPrefix?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const useForm: ({ preLoadedValues, keyPrefix }: UseFormProps) => {
|
|
8
|
+
form: import("react-hook-form").UseFormReturn<FieldValues, any, undefined>;
|
|
9
|
+
idMap: Record<string, object>;
|
|
10
|
+
setIdMap: import("react").Dispatch<import("react").SetStateAction<Record<string, object>>>;
|
|
11
|
+
translate: import("react-i18next").UseTranslationResponse<"", string>;
|
|
12
|
+
};
|
|
@@ -6,7 +6,7 @@ export declare const useSchemaContext: () => {
|
|
|
6
6
|
ignore: string[];
|
|
7
7
|
onSubmit: ((data: unknown) => Promise<void>) | undefined;
|
|
8
8
|
rowNumber: string | number | undefined;
|
|
9
|
-
displayText: Partial<import("./Form").DisplayTextProps>;
|
|
10
9
|
idMap: Record<string, object>;
|
|
11
10
|
setIdMap: import("react").Dispatch<import("react").SetStateAction<Record<string, object>>>;
|
|
11
|
+
translate: import("react-i18next").UseTranslationResponse<any, any>;
|
|
12
12
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HoverCard } from "@chakra-ui/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface HoverCardContentProps extends HoverCard.ContentProps {
|
|
4
|
+
portalled?: boolean;
|
|
5
|
+
portalRef?: React.RefObject<HTMLElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const HoverCardContent: React.ForwardRefExoticComponent<HoverCardContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const HoverCardArrow: React.ForwardRefExoticComponent<HoverCard.ArrowProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const HoverCardRoot: React.FC<HoverCard.RootProps>;
|
|
10
|
+
export declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCard.TriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsol-oss/react-datatable5",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"react-dom": "^19.0.0",
|
|
51
51
|
"react-hook-form": "^7.54.2",
|
|
52
52
|
"react-icons": "^5.4.0",
|
|
53
|
-
"tiny-invariant": "^1.3.3"
|
|
53
|
+
"tiny-invariant": "^1.3.3",
|
|
54
|
+
"react-i18next": "^15.4.1"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@chromatic-com/storybook": "^3.2.3",
|