@bsol-oss/react-datatable5 12.0.0-beta.44 → 12.0.0-beta.46

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 CHANGED
@@ -3,7 +3,7 @@ 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, GridProps, TableRootProps, TableHeaderProps as TableHeaderProps$1, TableRowProps, 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';
@@ -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
 
@@ -172,6 +163,20 @@ interface DataTableContext<TData = unknown> extends DataTableProps {
172
163
  setGlobalFilter: OnChangeFn<string>;
173
164
  type: "client" | "server";
174
165
  translate: UseTranslationResponse<any, unknown>;
166
+ tableLabel: {
167
+ view: string;
168
+ edit: string;
169
+ filterButtonText: string;
170
+ filterTitle: string;
171
+ filterReset: string;
172
+ filterClose: string;
173
+ reloadTooltip: string;
174
+ reloadButtonText: string;
175
+ resetSelection: string;
176
+ resetSorting: string;
177
+ rowCountText: string;
178
+ hasErrorText: string;
179
+ };
175
180
  }
176
181
  declare const DataTableContext: React$1.Context<DataTableContext<unknown>>;
177
182
 
@@ -304,7 +309,10 @@ interface TableControlsProps {
304
309
  showPageSizeControl?: boolean;
305
310
  showPageCountText?: boolean;
306
311
  showView?: boolean;
307
- filterOptions?: string[];
312
+ filterOptions?: {
313
+ label: string;
314
+ value: string;
315
+ }[];
308
316
  extraItems?: ReactNode;
309
317
  loading?: boolean;
310
318
  hasError?: boolean;
@@ -338,9 +346,8 @@ interface TableRowSelectorProps<TData> {
338
346
  light: string;
339
347
  dark: string;
340
348
  };
341
- alwaysShowSelector?: boolean;
342
349
  }
343
- declare const TableBody: ({ showSelector, alwaysShowSelector, canResize, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
350
+ declare const TableBody: ({ showSelector, canResize, }: TableBodyProps) => react_jsx_runtime.JSX.Element;
344
351
 
345
352
  interface TableFooterProps {
346
353
  showSelector?: boolean;
@@ -348,14 +355,56 @@ interface TableFooterProps {
348
355
  }
349
356
  declare const TableFooter: ({ showSelector, alwaysShowSelector, }: TableFooterProps) => react_jsx_runtime.JSX.Element;
350
357
 
358
+ interface TableHeaderTexts {
359
+ pinColumn?: string;
360
+ cancelPin?: string;
361
+ sortAscending?: string;
362
+ sortDescending?: string;
363
+ clearSorting?: string;
364
+ }
351
365
  interface TableHeaderProps {
352
366
  canResize?: boolean;
353
367
  showSelector?: boolean;
354
368
  isSticky?: boolean;
355
369
  tableHeaderProps?: TableHeaderProps$1;
356
370
  tableRowProps?: TableRowProps;
371
+ /**
372
+ * Default text configuration for all columns.
373
+ * Can be overridden per column via meta.headerTexts.
374
+ */
375
+ defaultTexts?: TableHeaderTexts;
357
376
  }
358
- declare const TableHeader: ({ canResize, showSelector, isSticky, tableHeaderProps, tableRowProps, }: TableHeaderProps) => react_jsx_runtime.JSX.Element;
377
+ /**
378
+ * TableHeader component with configurable text strings.
379
+ *
380
+ * @example
381
+ * // Using default texts
382
+ * <TableHeader />
383
+ *
384
+ * @example
385
+ * // Customizing default texts for all columns
386
+ * <TableHeader
387
+ * defaultTexts={{
388
+ * pinColumn: "Pin This Column",
389
+ * sortAscending: "Sort A-Z"
390
+ * }}
391
+ * />
392
+ *
393
+ * @example
394
+ * // Customizing texts per column via meta
395
+ * const columns = [
396
+ * columnHelper.accessor("name", {
397
+ * header: "Name",
398
+ * meta: {
399
+ * headerTexts: {
400
+ * pinColumn: "Pin Name Column",
401
+ * sortAscending: "Sort Names A-Z"
402
+ * }
403
+ * }
404
+ * })
405
+ * ];
406
+ */
407
+ declare const TableHeader: ({ canResize, showSelector, isSticky, tableHeaderProps, tableRowProps, defaultTexts, }: TableHeaderProps) => react_jsx_runtime.JSX.Element;
359
408
 
360
409
  interface DefaultTableProps {
361
410
  showFooter?: boolean;
@@ -369,16 +418,18 @@ interface DefaultTableProps {
369
418
  declare const DefaultTable: ({ showFooter, tableProps, tableHeaderProps, tableBodyProps, tableFooterProps, controlProps, variant, }: DefaultTableProps) => react_jsx_runtime.JSX.Element;
370
419
 
371
420
  interface ReloadButtonProps {
372
- text?: string;
373
421
  variant?: string;
374
422
  }
375
- declare const ReloadButton: ({ text, variant, }: ReloadButtonProps) => react_jsx_runtime.JSX.Element;
423
+ declare const ReloadButton: ({ variant, }: ReloadButtonProps) => react_jsx_runtime.JSX.Element;
376
424
 
377
- interface TableCardContainerProps extends GridProps {
425
+ interface TableCardContainerProps extends BoxProps {
378
426
  children: ReactNode;
379
427
  variant?: "carousel" | "";
428
+ gap?: string;
429
+ gridTemplateColumns?: string;
430
+ direction?: FlexProps["direction"];
380
431
  }
381
- declare const TableCardContainer: ({ children, variant, ...props }: TableCardContainerProps) => react_jsx_runtime.JSX.Element;
432
+ declare const TableCardContainer: ({ children, variant, gap, gridTemplateColumns, direction, ...props }: TableCardContainerProps) => react_jsx_runtime.JSX.Element;
382
433
 
383
434
  interface TableCardsProps<TData> {
384
435
  isSelectable?: boolean;
@@ -473,7 +524,7 @@ interface CustomJSONSchema7 extends JSONSchema7 {
473
524
  displayDateFormat?: string;
474
525
  timeFormat?: string;
475
526
  displayTimeFormat?: string;
476
- showTitle?: boolean;
527
+ showLabel?: boolean;
477
528
  }
478
529
 
479
530
  interface FormRootProps<TData extends FieldValues> {
@@ -595,6 +646,17 @@ declare module "@tanstack/react-table" {
595
646
  * The display name of the column, used for rendering headers.
596
647
  */
597
648
  displayName?: string;
649
+ /**
650
+ * Text configuration for the column header menu items.
651
+ * These strings can be customized per column.
652
+ */
653
+ headerTexts?: {
654
+ pinColumn?: string;
655
+ cancelPin?: string;
656
+ sortAscending?: string;
657
+ sortDescending?: string;
658
+ clearSorting?: string;
659
+ };
598
660
  /**
599
661
  * Specifies the type of filter to be used for the column.
600
662
  *
@@ -615,7 +677,10 @@ declare module "@tanstack/react-table" {
615
677
  /**
616
678
  * Options for the select filter variant, if applicable.
617
679
  */
618
- filterOptions?: string[];
680
+ filterOptions?: {
681
+ label: string;
682
+ value: string;
683
+ }[];
619
684
  /**
620
685
  * Configuration for the range filter variant, if applicable.
621
686
  *
@@ -641,4 +706,4 @@ declare module "@tanstack/react-table" {
641
706
  }
642
707
  }
643
708
 
644
- 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, TableDataDisplay, type TableDataDisplayProps, 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 };
709
+ 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, 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 };