@bsol-oss/react-datatable5 12.0.0-beta.2 → 12.0.0-beta.3
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 +47 -35
- package/dist/index.js +412 -383
- package/dist/index.mjs +410 -384
- package/dist/types/components/Form/SchemaFormContext.d.ts +13 -0
- package/dist/types/components/Form/components/core/DefaultForm.d.ts +6 -0
- package/dist/types/components/Form/components/core/FormBody.d.ts +1 -0
- package/dist/types/components/Form/components/core/FormRoot.d.ts +39 -0
- package/dist/types/components/Form/components/core/FormTitle.d.ts +1 -0
- package/dist/types/components/Form/components/core/SubmitButton.d.ts +1 -0
- package/dist/types/index.d.ts +10 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Row,
|
|
2
|
+
import { Row, Table as Table$1, OnChangeFn, RowData, Updater, FilterFn, ColumnDef, RowSelectionState, ColumnOrderState, ColumnFiltersState, PaginationState, SortingState, VisibilityState, Column } from '@tanstack/react-table';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default, { ReactNode, Dispatch, SetStateAction } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -22,11 +22,6 @@ interface DensityToggleButtonProps {
|
|
|
22
22
|
}
|
|
23
23
|
declare const DensityToggleButton: ({ text, icon, }: DensityToggleButtonProps) => react_jsx_runtime.JSX.Element;
|
|
24
24
|
|
|
25
|
-
interface EditFilterButtonProps {
|
|
26
|
-
icon?: React.ReactElement;
|
|
27
|
-
}
|
|
28
|
-
declare const FilterDialog: ({ icon, }: EditFilterButtonProps) => react_jsx_runtime.JSX.Element;
|
|
29
|
-
|
|
30
25
|
interface EditOrderButtonProps {
|
|
31
26
|
title?: string;
|
|
32
27
|
icon?: React__default.ReactElement;
|
|
@@ -41,16 +36,18 @@ interface EditSortingButtonProps {
|
|
|
41
36
|
}
|
|
42
37
|
declare const EditSortingButton: ({ text, icon, title, }: EditSortingButtonProps) => react_jsx_runtime.JSX.Element;
|
|
43
38
|
|
|
44
|
-
interface
|
|
45
|
-
icon?:
|
|
39
|
+
interface EditFilterButtonProps {
|
|
40
|
+
icon?: React.ReactElement;
|
|
46
41
|
}
|
|
47
|
-
declare const
|
|
42
|
+
declare const FilterDialog: ({ icon, }: EditFilterButtonProps) => react_jsx_runtime.JSX.Element;
|
|
48
43
|
|
|
49
44
|
interface PageSizeControlProps {
|
|
50
45
|
pageSizes?: number[];
|
|
51
46
|
}
|
|
52
47
|
declare const PageSizeControl: ({ pageSizes, }: PageSizeControlProps) => react_jsx_runtime.JSX.Element;
|
|
53
48
|
|
|
49
|
+
declare const Pagination: () => react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
54
51
|
interface ResetFilteringButtonProps {
|
|
55
52
|
text?: string;
|
|
56
53
|
}
|
|
@@ -68,7 +65,10 @@ declare const ResetSortingButton: ({ text, }: ResetSortingButtonProps) => react_
|
|
|
68
65
|
|
|
69
66
|
declare const RowCountText: () => react_jsx_runtime.JSX.Element;
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
interface EditViewButtonProps {
|
|
69
|
+
icon?: React__default.ReactElement;
|
|
70
|
+
}
|
|
71
|
+
declare const ViewDialog: ({ icon }: EditViewButtonProps) => react_jsx_runtime.JSX.Element;
|
|
72
72
|
|
|
73
73
|
interface CardHeaderProps<TData> {
|
|
74
74
|
row: Row<TData>;
|
|
@@ -81,6 +81,28 @@ interface CardHeaderProps<TData> {
|
|
|
81
81
|
}
|
|
82
82
|
declare const CardHeader: <TData>({ row, imageColumnId, titleColumnId, tagColumnId, tagIcon, showTag, imageProps, }: CardHeaderProps<TData>) => react_jsx_runtime.JSX.Element;
|
|
83
83
|
|
|
84
|
+
interface EmptyStateProps {
|
|
85
|
+
title?: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
}
|
|
88
|
+
declare const EmptyState: ({ title, description, }: EmptyStateProps) => react_jsx_runtime.JSX.Element;
|
|
89
|
+
|
|
90
|
+
interface ErrorAlertProps {
|
|
91
|
+
showMessage?: boolean;
|
|
92
|
+
}
|
|
93
|
+
declare const ErrorAlert: ({ showMessage }: ErrorAlertProps) => react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
95
|
+
interface DataTableContext<TData = unknown> {
|
|
96
|
+
table: Table$1<TData>;
|
|
97
|
+
globalFilter: string;
|
|
98
|
+
setGlobalFilter: OnChangeFn<string>;
|
|
99
|
+
type: "client" | "server";
|
|
100
|
+
translate: UseTranslationResponse<any, any>;
|
|
101
|
+
}
|
|
102
|
+
declare const DataTableContext: React$1.Context<DataTableContext<unknown>>;
|
|
103
|
+
|
|
104
|
+
declare const useDataTableContext: <TData>() => DataTableContext<TData>;
|
|
105
|
+
|
|
84
106
|
interface DataDisplayProps {
|
|
85
107
|
variant?: "horizontal" | "stats" | "";
|
|
86
108
|
translate?: UseTranslationResponse<any, any>;
|
|
@@ -414,17 +436,6 @@ interface TextCellProps {
|
|
|
414
436
|
}
|
|
415
437
|
declare const TextCell: ({ label, containerProps, textProps, children, }: TextCellProps) => react_jsx_runtime.JSX.Element;
|
|
416
438
|
|
|
417
|
-
interface DataTableContext<TData = unknown> {
|
|
418
|
-
table: Table$1<TData>;
|
|
419
|
-
globalFilter: string;
|
|
420
|
-
setGlobalFilter: OnChangeFn<string>;
|
|
421
|
-
type: "client" | "server";
|
|
422
|
-
translate: UseTranslationResponse<any, any>;
|
|
423
|
-
}
|
|
424
|
-
declare const DataTableContext: React$1.Context<DataTableContext<unknown>>;
|
|
425
|
-
|
|
426
|
-
declare const useDataTableContext: <TData>() => DataTableContext<TData>;
|
|
427
|
-
|
|
428
439
|
interface GetColumnsConfigs<K extends RowData> {
|
|
429
440
|
schema: JSONSchema7;
|
|
430
441
|
include?: K[];
|
|
@@ -439,17 +450,6 @@ interface GetColumnsConfigs<K extends RowData> {
|
|
|
439
450
|
declare const widthSanityCheck: <K extends unknown>(widthList: number[], ignoreList: K[], properties: { [key in K as string]?: object | undefined; }) => void;
|
|
440
451
|
declare const getColumns: <TData extends unknown>({ schema, include, ignore, width, meta, defaultWidth, translate, }: GetColumnsConfigs<TData>) => ColumnDef<TData>[];
|
|
441
452
|
|
|
442
|
-
interface EmptyStateProps {
|
|
443
|
-
title?: string;
|
|
444
|
-
description?: string;
|
|
445
|
-
}
|
|
446
|
-
declare const EmptyState: ({ title, description, }: EmptyStateProps) => react_jsx_runtime.JSX.Element;
|
|
447
|
-
|
|
448
|
-
interface ErrorAlertProps {
|
|
449
|
-
showMessage?: boolean;
|
|
450
|
-
}
|
|
451
|
-
declare const ErrorAlert: ({ showMessage }: ErrorAlertProps) => react_jsx_runtime.JSX.Element;
|
|
452
|
-
|
|
453
453
|
interface FilterOptionsProps {
|
|
454
454
|
column: string;
|
|
455
455
|
}
|
|
@@ -457,7 +457,7 @@ declare const FilterOptions: ({ column }: FilterOptionsProps) => react_jsx_runti
|
|
|
457
457
|
|
|
458
458
|
declare const GlobalFilter: () => react_jsx_runtime.JSX.Element;
|
|
459
459
|
|
|
460
|
-
interface
|
|
460
|
+
interface FormRootProps<TData extends FieldValues> {
|
|
461
461
|
schema: JSONSchema7;
|
|
462
462
|
serverUrl: string;
|
|
463
463
|
requestUrl?: string;
|
|
@@ -465,12 +465,14 @@ interface FormProps<TData extends FieldValues> {
|
|
|
465
465
|
setIdMap: Dispatch<SetStateAction<Record<string, object>>>;
|
|
466
466
|
form: UseFormReturn;
|
|
467
467
|
translate: UseTranslationResponse<any, any>;
|
|
468
|
+
children: ReactNode;
|
|
468
469
|
order?: string[];
|
|
469
470
|
ignore?: string[];
|
|
470
471
|
include?: string[];
|
|
471
472
|
onSubmit?: SubmitHandler<TData>;
|
|
472
473
|
rowNumber?: number | string;
|
|
473
474
|
requestOptions?: AxiosRequestConfig;
|
|
475
|
+
getUpdatedData?: () => TData | Promise<TData> | void;
|
|
474
476
|
}
|
|
475
477
|
interface CustomJSONSchema7Definition extends JSONSchema7 {
|
|
476
478
|
variant: string;
|
|
@@ -480,13 +482,23 @@ interface CustomJSONSchema7Definition extends JSONSchema7 {
|
|
|
480
482
|
gridColumn: string;
|
|
481
483
|
gridRow: string;
|
|
482
484
|
foreign_key: ForeignKeyProps;
|
|
485
|
+
children: ReactNode;
|
|
483
486
|
}
|
|
484
487
|
declare const idPickerSanityCheck: (column: string, foreign_key?: {
|
|
485
488
|
table?: string | undefined;
|
|
486
489
|
column?: string | undefined;
|
|
487
490
|
display_column?: string | undefined;
|
|
488
491
|
} | undefined) => void;
|
|
489
|
-
declare const
|
|
492
|
+
declare const FormRoot: <TData extends FieldValues>({ schema, idMap, setIdMap, form, serverUrl, translate, children, order, ignore, include, onSubmit, rowNumber, requestOptions, getUpdatedData, }: FormRootProps<TData>) => react_jsx_runtime.JSX.Element;
|
|
493
|
+
|
|
494
|
+
interface DefaultFormProps<TData extends FieldValues> {
|
|
495
|
+
formConfig: Omit<FormRootProps<TData>, "children">;
|
|
496
|
+
}
|
|
497
|
+
declare const DefaultForm: <TData extends FieldValues>({ formConfig, }: DefaultFormProps<TData>) => react_jsx_runtime.JSX.Element;
|
|
498
|
+
|
|
499
|
+
declare const FormTitle: () => react_jsx_runtime.JSX.Element;
|
|
500
|
+
|
|
501
|
+
declare const FormBody: <TData extends object>() => react_jsx_runtime.JSX.Element;
|
|
490
502
|
|
|
491
503
|
interface UseFormProps {
|
|
492
504
|
preLoadedValues?: FieldValues | undefined;
|
|
@@ -609,4 +621,4 @@ declare module "@tanstack/react-table" {
|
|
|
609
621
|
}
|
|
610
622
|
}
|
|
611
623
|
|
|
612
|
-
export { type CalendarProps, CardHeader, type CardHeaderProps, type CustomJSONSchema7Definition, DataDisplay, type DataDisplayProps, type DataResponse, DataTable, type DataTableDefaultState, type DataTableProps, DataTableServer, type DataTableServerProps, type DatePickerProps, DefaultCardTitle, DefaultTable, type DefaultTableProps, DensityToggleButton, type DensityToggleButtonProps, type EditFilterButtonProps, EditOrderButton, type EditOrderButtonProps, EditSortingButton, type EditSortingButtonProps, type EditViewButtonProps, EmptyState, type EmptyStateProps, ErrorAlert, type ErrorAlertProps, FilterDialog, FilterOptions, type FilterOptionsProps,
|
|
624
|
+
export { type CalendarProps, CardHeader, type CardHeaderProps, type CustomJSONSchema7Definition, DataDisplay, type DataDisplayProps, type DataResponse, DataTable, type DataTableDefaultState, type DataTableProps, DataTableServer, type DataTableServerProps, type DatePickerProps, DefaultCardTitle, DefaultForm, type DefaultFormProps, DefaultTable, type DefaultTableProps, DensityToggleButton, type DensityToggleButtonProps, type EditFilterButtonProps, EditOrderButton, type EditOrderButtonProps, EditSortingButton, type EditSortingButtonProps, type EditViewButtonProps, EmptyState, type EmptyStateProps, ErrorAlert, type ErrorAlertProps, FilterDialog, FilterOptions, type FilterOptionsProps, FormBody, FormRoot, type FormRootProps, FormTitle, type GetColumnsConfigs, type GetDateColorProps, type GetMultiDatesProps, type GetRangeDatesProps, type GetStyleProps, type GetVariantProps, GlobalFilter, PageSizeControl, type PageSizeControlProps, Pagination, type RangeCalendarProps, type RangeDatePickerProps, RecordDisplay, type RecordDisplayProps, ReloadButton, type ReloadButtonProps, ResetFilteringButton, type ResetFilteringButtonProps, ResetSelectionButton, type ResetSelectionButtonProps, ResetSortingButton, type ResetSortingButtonProps, type Result, RowCountText, Table, TableBody, type TableBodyProps, TableCardContainer, type TableCardContainerProps, TableCards, type TableCardsProps, TableComponent, TableControls, type TableControlsProps, TableFilter, TableFilterTags, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLoadingComponent, type TableLoadingComponentProps, TableOrderer, type TableProps, type TableRendererProps, type TableRowSelectorProps, TableSelector, TableSorter, TableViewer, TextCell, type TextCellProps, type UseDataTableProps, type UseDataTableReturn, type UseDataTableServerProps, type UseDataTableServerReturn, type UseFormProps, ViewDialog, getColumns, getMultiDates, getRangeDates, idPickerSanityCheck, useDataTable, useDataTableContext, useDataTableServer, useForm, widthSanityCheck };
|