@bsol-oss/react-datatable5 12.0.0-beta.7 → 12.0.0-beta.70

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.
Files changed (52) hide show
  1. package/README.md +192 -0
  2. package/dist/index.d.ts +277 -83
  3. package/dist/index.js +1577 -469
  4. package/dist/index.mjs +1585 -477
  5. package/dist/types/components/DataTable/DataTable.d.ts +3 -1
  6. package/dist/types/components/DataTable/DataTableServer.d.ts +6 -4
  7. package/dist/types/components/DataTable/DefaultTable.d.ts +6 -9
  8. package/dist/types/components/DataTable/context/DataTableContext.d.ts +21 -3
  9. package/dist/types/components/DataTable/context/useDataTableContext.d.ts +2 -2
  10. package/dist/types/components/DataTable/controls/ReloadButton.d.ts +1 -2
  11. package/dist/types/components/DataTable/controls/ResetFilteringButton.d.ts +1 -4
  12. package/dist/types/components/DataTable/controls/ResetSelectionButton.d.ts +1 -4
  13. package/dist/types/components/DataTable/controls/ResetSortingButton.d.ts +1 -4
  14. package/dist/types/components/DataTable/controls/TableControls.d.ts +10 -2
  15. package/dist/types/components/DataTable/display/TableBody.d.ts +1 -2
  16. package/dist/types/components/DataTable/display/TableCardContainer.d.ts +6 -3
  17. package/dist/types/components/DataTable/display/TableDataDisplay.d.ts +6 -1
  18. package/dist/types/components/DataTable/display/TableFooter.d.ts +1 -5
  19. package/dist/types/components/DataTable/display/TableHeader.d.ts +46 -8
  20. package/dist/types/components/DataTable/useDataTableServer.d.ts +55 -3
  21. package/dist/types/components/DatePicker/DatePicker.d.ts +23 -0
  22. package/dist/types/components/DatePicker/DateTimePicker.d.ts +11 -0
  23. package/dist/types/components/DatePicker/DurationPicker.d.ts +12 -0
  24. package/dist/types/components/DatePicker/IsoTimePicker.d.ts +16 -0
  25. package/dist/types/components/DatePicker/PickerDemo.d.ts +1 -0
  26. package/dist/types/components/DatePicker/UniversalPicker.d.ts +9 -0
  27. package/dist/types/components/DatePicker/index.d.ts +7 -0
  28. package/dist/types/components/Filter/TagFilter.d.ts +5 -1
  29. package/dist/types/components/Form/SchemaFormContext.d.ts +8 -1
  30. package/dist/types/components/Form/components/core/DefaultForm.d.ts +1 -0
  31. package/dist/types/components/Form/components/core/FormRoot.d.ts +9 -2
  32. package/dist/types/components/Form/components/fields/CustomInput.d.ts +8 -0
  33. package/dist/types/components/Form/components/fields/DatePicker.d.ts +2 -7
  34. package/dist/types/components/Form/components/fields/DateTimePicker.d.ts +2 -0
  35. package/dist/types/components/Form/components/fields/EnumPicker.d.ts +2 -1
  36. package/dist/types/components/Form/components/fields/FilePicker.d.ts +2 -5
  37. package/dist/types/components/Form/components/fields/StringInputField.d.ts +19 -5
  38. package/dist/types/components/Form/components/fields/TextAreaInput.d.ts +12 -0
  39. package/dist/types/components/Form/components/fields/TimePicker.d.ts +7 -0
  40. package/dist/types/components/Form/components/fields/types.d.ts +6 -0
  41. package/dist/types/components/Form/components/types/CustomJSONSchema7.d.ts +19 -1
  42. package/dist/types/components/Form/components/viewers/CustomViewer.d.ts +8 -0
  43. package/dist/types/components/Form/components/viewers/DateTimeViewer.d.ts +7 -0
  44. package/dist/types/components/Form/components/viewers/TextAreaViewer.d.ts +12 -0
  45. package/dist/types/components/Form/components/viewers/TimeViewer.d.ts +7 -0
  46. package/dist/types/components/Form/utils/translateWrapper.d.ts +6 -0
  47. package/dist/types/components/Form/utils/validateData.d.ts +9 -0
  48. package/dist/types/components/Form/utils/validation.d.ts +104 -0
  49. package/dist/types/components/TextArea/TextArea.d.ts +22 -0
  50. package/dist/types/components/TimePicker/TimePicker.d.ts +21 -0
  51. package/dist/types/index.d.ts +17 -2
  52. package/package.json +9 -2
package/dist/index.d.ts CHANGED
@@ -3,17 +3,17 @@ import { Row, RowData, OnChangeFn, Updater, FilterFn, ColumnDef, RowSelectionSta
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';
6
- import { ImageProps, TableHeaderProps as TableHeaderProps$1, TableRootProps, GridProps, CardBodyProps, FlexProps, TextProps, BoxProps } from '@chakra-ui/react';
6
+ import { ImageProps, GridProps, TableRootProps, TableHeaderProps as TableHeaderProps$1, TableRowProps, BoxProps, FlexProps, CardBodyProps, TextProps } from '@chakra-ui/react';
7
7
  import { IconType } from 'react-icons';
8
8
  import * as react_i18next from 'react-i18next';
9
9
  import { UseTranslationResponse } from 'react-i18next';
10
10
  import { RankingInfo } from '@tanstack/match-sorter-utils';
11
11
  import { UseQueryResult } from '@tanstack/react-query';
12
12
  import { JSONSchema7 } from 'json-schema';
13
- import { ForeignKeyProps } from '@/components/Form/components/fields/StringInputField';
13
+ import { ForeignKeyProps as ForeignKeyProps$1 } from '@/components/Form/components/fields/StringInputField';
14
14
  import { AxiosRequestConfig } from 'axios';
15
15
  import * as react_hook_form from 'react-hook-form';
16
- import { FieldValues, UseFormReturn, SubmitHandler } from 'react-hook-form';
16
+ import { UseFormReturn, FieldValues, SubmitHandler } from 'react-hook-form';
17
17
  import { RenderProps, Props } from '@bsol-oss/dayzed-react19';
18
18
 
19
19
  interface DensityToggleButtonProps {
@@ -41,20 +41,11 @@ declare const PageSizeControl: ({ pageSizes, }: PageSizeControlProps) => react_j
41
41
 
42
42
  declare const Pagination: () => react_jsx_runtime.JSX.Element;
43
43
 
44
- interface ResetFilteringButtonProps {
45
- text?: string;
46
- }
47
- declare const ResetFilteringButton: ({ text, }: ResetFilteringButtonProps) => react_jsx_runtime.JSX.Element;
44
+ declare const ResetFilteringButton: () => react_jsx_runtime.JSX.Element;
48
45
 
49
- interface ResetSelectionButtonProps {
50
- text?: string;
51
- }
52
- declare const ResetSelectionButton: ({ text, }: ResetSelectionButtonProps) => react_jsx_runtime.JSX.Element;
46
+ declare const ResetSelectionButton: () => react_jsx_runtime.JSX.Element;
53
47
 
54
- interface ResetSortingButtonProps {
55
- text?: string;
56
- }
57
- declare const ResetSortingButton: ({ text, }: ResetSortingButtonProps) => react_jsx_runtime.JSX.Element;
48
+ declare const ResetSortingButton: () => react_jsx_runtime.JSX.Element;
58
49
 
59
50
  declare const RowCountText: () => react_jsx_runtime.JSX.Element;
60
51
 
@@ -153,6 +144,7 @@ interface DataTableProps<TData = unknown> {
153
144
  setDensity: OnChangeFn<DensityState>;
154
145
  setColumnVisibility: OnChangeFn<VisibilityState>;
155
146
  translate: UseTranslationResponse<any, any>;
147
+ tableLabel?: DataTableLabel;
156
148
  }
157
149
  /**
158
150
  * DataTable will create a context to hold all values to
@@ -164,18 +156,35 @@ interface DataTableProps<TData = unknown> {
164
156
  *
165
157
  * @link https://tanstack.com/table/latest/docs/guide/column-defs
166
158
  */
167
- declare function DataTable<TData = unknown>({ columns, data, enableRowSelection, enableMultiRowSelection, enableSubRowSelection, columnOrder, columnFilters, columnVisibility, density, globalFilter, pagination, sorting, rowSelection, setPagination, setSorting, setColumnFilters, setRowSelection, setGlobalFilter, setColumnOrder, setDensity, setColumnVisibility, translate, children, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
168
-
169
- interface DataTableContext<TData = unknown> extends DataTableProps {
159
+ declare function DataTable<TData = unknown>({ columns, data, enableRowSelection, enableMultiRowSelection, enableSubRowSelection, columnOrder, columnFilters, columnVisibility, density, globalFilter, pagination, sorting, rowSelection, setPagination, setSorting, setColumnFilters, setRowSelection, setGlobalFilter, setColumnOrder, setDensity, setColumnVisibility, translate, children, tableLabel, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
160
+
161
+ interface DataTableLabel {
162
+ view: string;
163
+ edit: string;
164
+ filterButtonText: string;
165
+ filterTitle: string;
166
+ filterReset: string;
167
+ filterClose: string;
168
+ reloadTooltip: string;
169
+ reloadButtonText: string;
170
+ resetSelection: string;
171
+ resetSorting: string;
172
+ rowCountText: string;
173
+ hasErrorText: string;
174
+ globalFilterPlaceholder: string;
175
+ trueLabel: string;
176
+ falseLabel: string;
177
+ }
178
+ interface DataTableContextProps<TData = unknown> extends DataTableProps {
170
179
  table: Table$1<TData>;
171
180
  globalFilter: string;
172
181
  setGlobalFilter: OnChangeFn<string>;
173
182
  type: "client" | "server";
174
- translate: UseTranslationResponse<any, any>;
183
+ translate: UseTranslationResponse<any, unknown>;
184
+ tableLabel: DataTableLabel;
175
185
  }
176
- declare const DataTableContext: React$1.Context<DataTableContext<unknown>>;
177
186
 
178
- declare const useDataTableContext: <TData>() => DataTableContext<TData>;
187
+ declare const useDataTableContext: <TData>() => DataTableContextProps<TData>;
179
188
 
180
189
  interface DataDisplayProps {
181
190
  variant?: "horizontal" | "stats" | "";
@@ -218,7 +227,7 @@ interface UseDataTableReturn {
218
227
  }
219
228
  declare const useDataTable: ({ default: { sorting: defaultSorting, pagination: defaultPagination, rowSelection: defaultRowSelection, columnFilters: defaultColumnFilters, columnOrder: defaultColumnOrder, columnVisibility: defaultColumnVisibility, globalFilter: defaultGlobalFilter, density: defaultDensity, }, keyPrefix, }?: UseDataTableProps) => UseDataTableReturn;
220
229
 
221
- interface UseDataTableServerProps extends UseDataTableProps {
230
+ interface UseDataTableServerProps<TData> extends UseDataTableProps {
222
231
  /**
223
232
  * Delay to send the request if the `refreshData` called multiple times
224
233
  *
@@ -231,7 +240,51 @@ interface UseDataTableServerProps extends UseDataTableProps {
231
240
  * default: `1000`
232
241
  */
233
242
  debounceDelay?: number;
234
- url: string;
243
+ /**
244
+ * The url to fetch the data from.
245
+ *
246
+ * Remark:
247
+ * it is the server responsibility to handle the params and return the data.
248
+ * especially the pagination and sorting.
249
+ *
250
+ * The response must be like this:
251
+ * ```ts
252
+ * {
253
+ * data: TData[],
254
+ * count: number,
255
+ * }
256
+ * ```
257
+ *
258
+ * Example:
259
+ * ```ts
260
+ * const url = "https://jsonplaceholder.typicode.com/posts";
261
+ * ```
262
+ *
263
+ * If not provided, the `queryFn` will be used.
264
+ *
265
+ * @default undefined
266
+ */
267
+ url?: string;
268
+ placeholderData?: DataResponse<TData>;
269
+ /**
270
+ * The query function to fetch the data from.
271
+ *
272
+ * Remark:
273
+ * it is the server responsibility to handle the params and return the data.
274
+ * especially the pagination and sorting.
275
+ *
276
+ * Example:
277
+ * ```ts
278
+ * const queryFn = (params: QueryParams) => {
279
+ * return axios.get<DataResponse<TData>>(url, { params });
280
+ * };
281
+ * ```
282
+ *
283
+ * If not provided, the `url` will be used.
284
+ *
285
+ * @default undefined
286
+ */
287
+ queryFn?: (params: QueryParams) => Promise<DataResponse<TData>>;
235
288
  }
236
289
  interface UseDataTableServerReturn<TData> extends UseDataTableReturn {
237
290
  query: UseQueryResult<DataResponse<TData>, Error>;
@@ -242,9 +295,16 @@ interface Result<T = unknown> {
242
295
  interface DataResponse<T = unknown> extends Result<T> {
243
296
  count: number;
244
297
  }
245
- declare const useDataTableServer: <TData>({ url, default: { sorting: defaultSorting, pagination: defaultPagination, rowSelection: defaultRowSelection, columnFilters: defaultColumnFilters, columnOrder: defaultColumnOrder, columnVisibility: defaultColumnVisibility, globalFilter: defaultGlobalFilter, density: defaultDensity, }, keyPrefix, }: UseDataTableServerProps) => UseDataTableServerReturn<TData>;
298
+ interface QueryParams {
299
+ offset: number;
300
+ limit: number;
301
+ sorting: SortingState;
302
+ where: ColumnFiltersState;
303
+ searching: string;
304
+ }
305
+ declare const useDataTableServer: <TData>(props: UseDataTableServerProps<TData>) => UseDataTableServerReturn<TData>;
246
306
 
247
- interface DataTableServerProps<TData extends DataResponse = DataResponse<unknown>> {
307
+ interface DataTableServerProps<TData = unknown> {
248
308
  children: ReactNode | ReactNode[];
249
309
  /**
250
310
  * Column definitions for the table.
@@ -273,9 +333,10 @@ interface DataTableServerProps<TData extends DataResponse = DataResponse<unknown
273
333
  setColumnOrder: OnChangeFn<ColumnOrderState>;
274
334
  setDensity: OnChangeFn<DensityState>;
275
335
  setColumnVisibility: OnChangeFn<VisibilityState>;
276
- query: UseQueryResult<TData>;
277
- url: string;
336
+ query: UseQueryResult<DataResponse<TData>>;
337
+ url?: string;
278
338
  translate: UseTranslationResponse<any, any>;
339
+ tableLabel?: DataTableLabel;
279
340
  }
280
341
  /**
281
342
  * DataTableServer will create a context to hold all values to
@@ -288,28 +349,7 @@ interface DataTableServerProps<TData extends DataResponse = DataResponse<unknown
288
349
  *
289
350
  * @link https://tanstack.com/table/latest/docs/guide/column-defs
290
351
  */
291
- declare function DataTableServer<TData extends DataResponse = DataResponse<unknown>>({ columns, enableRowSelection, enableMultiRowSelection, enableSubRowSelection, columnOrder, columnFilters, columnVisibility, density, globalFilter, pagination, sorting, rowSelection, setPagination, setSorting, setColumnFilters, setRowSelection, setGlobalFilter, setColumnOrder, setDensity, setColumnVisibility, query, url, translate, children, }: DataTableServerProps<TData>): react_jsx_runtime.JSX.Element;
292
-
293
- interface TableBodyProps {
294
- pinnedBgColor?: {
295
- light: string;
296
- dark: string;
297
- };
298
- showSelector?: boolean;
299
- alwaysShowSelector?: boolean;
300
- canResize?: boolean;
301
- }
302
- interface TableRowSelectorProps<TData> {
303
- index: number;
304
- row: Row<TData>;
305
- hoveredRow: number;
306
- pinnedBgColor?: {
307
- light: string;
308
- dark: string;
309
- };
310
- alwaysShowSelector?: boolean;
311
- }
312
- declare const TableBody: ({ pinnedBgColor, showSelector, alwaysShowSelector, canResize, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
352
+ declare function DataTableServer<TData = unknown>({ columns, enableRowSelection, enableMultiRowSelection, enableSubRowSelection, columnOrder, columnFilters, columnVisibility, density, globalFilter, pagination, sorting, rowSelection, setPagination, setSorting, setColumnFilters, setRowSelection, setGlobalFilter, setColumnOrder, setDensity, setColumnVisibility, query, url, translate, children, tableLabel, }: DataTableServerProps<TData>): react_jsx_runtime.JSX.Element;
313
353
 
314
354
  interface TableControlsProps {
315
355
  totalText?: string;
@@ -325,69 +365,130 @@ interface TableControlsProps {
325
365
  showPageSizeControl?: boolean;
326
366
  showPageCountText?: boolean;
327
367
  showView?: boolean;
328
- filterOptions?: string[];
368
+ filterTagsOptions?: {
369
+ column: string;
370
+ options: {
371
+ label: string;
372
+ value: string;
373
+ }[];
374
+ }[];
329
375
  extraItems?: ReactNode;
330
376
  loading?: boolean;
331
377
  hasError?: boolean;
378
+ gridProps?: GridProps;
332
379
  }
333
- declare const TableControls: ({ fitTableWidth, fitTableHeight, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, showPagination, showPageSizeControl, showPageCountText, showView, filterOptions, extraItems, loading, hasError, }: TableControlsProps) => react_jsx_runtime.JSX.Element;
380
+ declare const TableControls: ({ fitTableWidth, fitTableHeight, children, showGlobalFilter, showFilter, showFilterName, showFilterTags, showReload, showPagination, showPageSizeControl, showPageCountText, showView, filterTagsOptions, extraItems, loading, hasError, gridProps, }: TableControlsProps) => react_jsx_runtime.JSX.Element;
334
381
 
335
- interface TableFooterProps {
382
+ interface TableProps extends TableRootProps {
383
+ showLoading?: boolean;
384
+ loadingComponent?: ReactNode;
385
+ emptyComponent?: ReactNode;
386
+ canResize?: boolean;
387
+ children: ReactNode;
388
+ }
389
+ declare const Table: ({ children, emptyComponent, canResize, ...props }: TableProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null;
390
+
391
+ interface TableBodyProps {
336
392
  pinnedBgColor?: {
337
393
  light: string;
338
394
  dark: string;
339
395
  };
340
396
  showSelector?: boolean;
341
397
  alwaysShowSelector?: boolean;
342
- }
343
- declare const TableFooter: ({ pinnedBgColor, showSelector, alwaysShowSelector, }: TableFooterProps) => react_jsx_runtime.JSX.Element;
344
-
345
- interface TableHeaderProps {
346
398
  canResize?: boolean;
399
+ }
400
+ interface TableRowSelectorProps<TData> {
401
+ index: number;
402
+ row: Row<TData>;
403
+ hoveredRow: number;
347
404
  pinnedBgColor?: {
348
405
  light: string;
349
406
  dark: string;
350
407
  };
408
+ }
409
+ declare const TableBody: ({ showSelector, canResize, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
410
+
411
+ interface TableFooterProps {
351
412
  showSelector?: boolean;
352
- isSticky?: boolean;
353
413
  alwaysShowSelector?: boolean;
354
- tHeadProps?: TableHeaderProps$1;
355
414
  }
356
- declare const TableHeader: ({ canResize, pinnedBgColor, showSelector, isSticky, alwaysShowSelector, tHeadProps, }: TableHeaderProps) => react_jsx_runtime.JSX.Element;
415
+ declare const TableFooter: ({ showSelector, alwaysShowSelector, }: TableFooterProps) => react_jsx_runtime.JSX.Element;
357
416
 
358
- interface TableProps extends TableRootProps {
359
- showLoading?: boolean;
360
- loadingComponent?: ReactNode;
361
- emptyComponent?: ReactNode;
417
+ interface TableHeaderTexts {
418
+ pinColumn?: string;
419
+ cancelPin?: string;
420
+ sortAscending?: string;
421
+ sortDescending?: string;
422
+ clearSorting?: string;
423
+ }
424
+ interface TableHeaderProps {
362
425
  canResize?: boolean;
363
- children: ReactNode;
426
+ showSelector?: boolean;
427
+ isSticky?: boolean;
428
+ tableHeaderProps?: TableHeaderProps$1;
429
+ tableRowProps?: TableRowProps;
430
+ /**
431
+ * Default text configuration for all columns.
432
+ * Can be overridden per column via meta.headerTexts.
433
+ */
434
+ defaultTexts?: TableHeaderTexts;
364
435
  }
365
- declare const Table: ({ children, emptyComponent, canResize, ...props }: TableProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null;
436
+ /**
437
+ * TableHeader component with configurable text strings.
438
+ *
439
+ * @example
440
+ * // Using default texts
441
+ * <TableHeader />
442
+ *
443
+ * @example
444
+ * // Customizing default texts for all columns
445
+ * <TableHeader
446
+ * defaultTexts={{
447
+ * pinColumn: "Pin This Column",
448
+ * sortAscending: "Sort A-Z"
449
+ * }}
450
+ * />
451
+ *
452
+ * @example
453
+ * // Customizing texts per column via meta
454
+ * const columns = [
455
+ * columnHelper.accessor("name", {
456
+ * header: "Name",
457
+ * meta: {
458
+ * headerTexts: {
459
+ * pinColumn: "Pin Name Column",
460
+ * sortAscending: "Sort Names A-Z"
461
+ * }
462
+ * }
463
+ * })
464
+ * ];
465
+ */
466
+ declare const TableHeader: ({ canResize, showSelector, isSticky, tableHeaderProps, tableRowProps, defaultTexts, }: TableHeaderProps) => react_jsx_runtime.JSX.Element;
366
467
 
367
468
  interface DefaultTableProps {
368
469
  showFooter?: boolean;
369
- showSelector?: boolean;
370
470
  tableProps?: Omit<TableProps, "children">;
371
- tHeadProps?: TableHeaderProps$1;
372
- controlProps?: TableControlsProps;
373
- tableFooterProps?: TableFooterProps;
374
- tableBodyProps?: TableBodyProps;
375
471
  tableHeaderProps?: TableHeaderProps;
472
+ tableBodyProps?: TableBodyProps;
473
+ tableFooterProps?: TableFooterProps;
474
+ controlProps?: TableControlsProps;
376
475
  variant?: "" | "greedy";
377
476
  }
378
- declare const DefaultTable: ({ showFooter, tableProps, tableHeaderProps, tableBodyProps, controlProps, tableFooterProps, variant, }: DefaultTableProps) => react_jsx_runtime.JSX.Element;
477
+ declare const DefaultTable: ({ showFooter, tableProps, tableHeaderProps, tableBodyProps, tableFooterProps, controlProps, variant, }: DefaultTableProps) => react_jsx_runtime.JSX.Element;
379
478
 
380
479
  interface ReloadButtonProps {
381
- text?: string;
382
480
  variant?: string;
383
481
  }
384
- declare const ReloadButton: ({ text, variant, }: ReloadButtonProps) => react_jsx_runtime.JSX.Element;
482
+ declare const ReloadButton: ({ variant, }: ReloadButtonProps) => react_jsx_runtime.JSX.Element;
385
483
 
386
- interface TableCardContainerProps extends GridProps {
484
+ interface TableCardContainerProps extends BoxProps {
387
485
  children: ReactNode;
388
486
  variant?: "carousel" | "";
487
+ gap?: string;
488
+ gridTemplateColumns?: string;
489
+ direction?: FlexProps["direction"];
389
490
  }
390
- declare const TableCardContainer: ({ children, variant, ...props }: TableCardContainerProps) => react_jsx_runtime.JSX.Element;
491
+ declare const TableCardContainer: ({ children, variant, gap, gridTemplateColumns, direction, ...props }: TableCardContainerProps) => react_jsx_runtime.JSX.Element;
391
492
 
392
493
  interface TableCardsProps<TData> {
393
494
  isSelectable?: boolean;
@@ -441,15 +542,64 @@ interface GetColumnsConfigs<K extends RowData> {
441
542
  declare const widthSanityCheck: <K extends unknown>(widthList: number[], ignoreList: K[], properties: { [key in K as string]?: object | undefined; }) => void;
442
543
  declare const getColumns: <TData extends unknown>({ schema, include, ignore, width, meta, defaultWidth, translate, }: GetColumnsConfigs<TData>) => ColumnDef<TData>[];
443
544
 
444
- interface FilterOptionsProps {
445
- column: string;
545
+ interface TableDataDisplayProps {
546
+ colorPalette?: string;
547
+ emptyComponent?: ReactNode;
446
548
  }
447
- declare const FilterOptions: ({ column }: FilterOptionsProps) => react_jsx_runtime.JSX.Element;
549
+ declare const TableDataDisplay: ({ colorPalette, emptyComponent, }: TableDataDisplayProps) => react_jsx_runtime.JSX.Element;
448
550
 
449
551
  declare const GlobalFilter: () => react_jsx_runtime.JSX.Element;
450
552
 
553
+ interface CustomQueryFnResponse {
554
+ /**
555
+ * The data of the query
556
+ */
557
+ data: any;
558
+ /**
559
+ * The id map of the data
560
+ */
561
+ idMap: Record<string, any>;
562
+ }
563
+ interface CustomQueryFnParams {
564
+ searching: string;
565
+ limit: number;
566
+ offset: number;
567
+ }
568
+ type CustomQueryFn = (params: CustomQueryFnParams) => Promise<CustomQueryFnResponse>;
569
+ interface ForeignKeyProps {
570
+ column: string;
571
+ table: string;
572
+ display_column: string;
573
+ customQueryFn?: CustomQueryFn;
574
+ }
575
+
576
+ interface CustomJSONSchema7 extends JSONSchema7 {
577
+ gridColumn?: string;
578
+ gridRow?: string;
579
+ foreign_key?: ForeignKeyProps;
580
+ variant?: string;
581
+ renderDisplay?: (item: unknown) => ReactNode;
582
+ inputRender?: (props: {
583
+ column: string;
584
+ schema: CustomJSONSchema7;
585
+ prefix: string;
586
+ formContext: UseFormReturn;
587
+ }) => ReactNode;
588
+ inputViewerRender?: (props: {
589
+ column: string;
590
+ schema: CustomJSONSchema7;
591
+ prefix: string;
592
+ formContext: UseFormReturn;
593
+ }) => ReactNode;
594
+ dateFormat?: string;
595
+ displayDateFormat?: string;
596
+ timeFormat?: string;
597
+ displayTimeFormat?: string;
598
+ showLabel?: boolean;
599
+ }
600
+
451
601
  interface FormRootProps<TData extends FieldValues> {
452
- schema: JSONSchema7;
602
+ schema: CustomJSONSchema7;
453
603
  serverUrl: string;
454
604
  requestUrl?: string;
455
605
  idMap: Record<string, object>;
@@ -464,6 +614,12 @@ interface FormRootProps<TData extends FieldValues> {
464
614
  rowNumber?: number | string;
465
615
  requestOptions?: AxiosRequestConfig;
466
616
  getUpdatedData?: () => TData | Promise<TData> | void;
617
+ customErrorRenderer?: (error: unknown) => ReactNode;
618
+ displayConfig?: {
619
+ showSubmitButton?: boolean;
620
+ showResetButton?: boolean;
621
+ showTitle?: boolean;
622
+ };
467
623
  }
468
624
  interface CustomJSONSchema7Definition extends JSONSchema7 {
469
625
  variant: string;
@@ -472,7 +628,7 @@ interface CustomJSONSchema7Definition extends JSONSchema7 {
472
628
  display_column: string;
473
629
  gridColumn: string;
474
630
  gridRow: string;
475
- foreign_key: ForeignKeyProps;
631
+ foreign_key: ForeignKeyProps$1;
476
632
  children: ReactNode;
477
633
  }
478
634
  declare const idPickerSanityCheck: (column: string, foreign_key?: {
@@ -480,10 +636,11 @@ declare const idPickerSanityCheck: (column: string, foreign_key?: {
480
636
  column?: string | undefined;
481
637
  display_column?: string | undefined;
482
638
  } | undefined) => void;
483
- 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;
639
+ declare const FormRoot: <TData extends FieldValues>({ schema, idMap, setIdMap, form, serverUrl, translate, children, order, ignore, include, onSubmit, rowNumber, requestOptions, getUpdatedData, customErrorRenderer, displayConfig, }: FormRootProps<TData>) => react_jsx_runtime.JSX.Element;
484
640
 
485
641
  interface DefaultFormProps<TData extends FieldValues> {
486
642
  formConfig: Omit<FormRootProps<TData>, "children">;
643
+ showTitle?: boolean;
487
644
  }
488
645
  declare const DefaultForm: <TData extends FieldValues>({ formConfig, }: DefaultFormProps<TData>) => react_jsx_runtime.JSX.Element;
489
646
 
@@ -516,6 +673,29 @@ interface GetVariantProps {
516
673
  selectable: boolean;
517
674
  }
518
675
  interface DatePickerProps extends Props {
676
+ onDateSelected?: (obj: {
677
+ date: Date;
678
+ }) => void;
679
+ selected: Date | Date[];
680
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
681
+ showOutsideDays?: boolean;
682
+ date?: Date;
683
+ minDate?: Date;
684
+ maxDate?: Date;
685
+ monthsToDisplay?: number;
686
+ labels?: {
687
+ monthNamesShort: string[];
688
+ weekdayNamesShort: string[];
689
+ backButtonLabel?: string;
690
+ forwardButtonLabel?: string;
691
+ };
692
+ render?: (dayzedData: any) => React__default.ReactNode;
693
+ }
694
+ interface DatePickerLabels {
695
+ monthNamesShort: string[];
696
+ weekdayNamesShort: string[];
697
+ backButtonLabel?: string;
698
+ forwardButtonLabel?: string;
519
699
  }
520
700
 
521
701
  interface GetMultiDatesProps {
@@ -566,6 +746,17 @@ declare module "@tanstack/react-table" {
566
746
  * The display name of the column, used for rendering headers.
567
747
  */
568
748
  displayName?: string;
749
+ /**
750
+ * Text configuration for the column header menu items.
751
+ * These strings can be customized per column.
752
+ */
753
+ headerTexts?: {
754
+ pinColumn?: string;
755
+ cancelPin?: string;
756
+ sortAscending?: string;
757
+ sortDescending?: string;
758
+ clearSorting?: string;
759
+ };
569
760
  /**
570
761
  * Specifies the type of filter to be used for the column.
571
762
  *
@@ -586,7 +777,10 @@ declare module "@tanstack/react-table" {
586
777
  /**
587
778
  * Options for the select filter variant, if applicable.
588
779
  */
589
- filterOptions?: string[];
780
+ filterOptions?: {
781
+ label: string;
782
+ value: string;
783
+ }[];
590
784
  /**
591
785
  * Configuration for the range filter variant, if applicable.
592
786
  *
@@ -612,4 +806,4 @@ declare module "@tanstack/react-table" {
612
806
  }
613
807
  }
614
808
 
615
- 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, 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, 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 };
809
+ export { type CalendarProps, CardHeader, type CardHeaderProps, type CustomJSONSchema7Definition, DataDisplay, type DataDisplayProps, type DataResponse, DataTable, type DataTableDefaultState, type DataTableProps, DataTableServer, type DataTableServerProps, type DatePickerLabels, type DatePickerProps, DefaultCardTitle, DefaultForm, type DefaultFormProps, DefaultTable, type DefaultTableProps, DensityToggleButton, type DensityToggleButtonProps, type EditFilterButtonProps, EditSortingButton, type EditSortingButtonProps, type EditViewButtonProps, EmptyState, type EmptyStateProps, ErrorAlert, type ErrorAlertProps, FilterDialog, FormBody, FormRoot, type FormRootProps, FormTitle, type GetColumnsConfigs, type GetDateColorProps, type GetMultiDatesProps, type GetRangeDatesProps, type GetStyleProps, type GetVariantProps, GlobalFilter, PageSizeControl, type PageSizeControlProps, Pagination, type QueryParams, type RangeCalendarProps, type RangeDatePickerProps, RecordDisplay, type RecordDisplayProps, ReloadButton, type ReloadButtonProps, ResetFilteringButton, ResetSelectionButton, ResetSortingButton, type Result, RowCountText, Table, TableBody, type TableBodyProps, TableCardContainer, type TableCardContainerProps, TableCards, type TableCardsProps, TableComponent, TableControls, type TableControlsProps, TableDataDisplay, type TableDataDisplayProps, TableFilter, TableFilterTags, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, type TableHeaderTexts, TableLoadingComponent, type TableLoadingComponentProps, 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 };