gantri-components 2.34.0-beta.13 → 2.34.0-beta.14

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.
@@ -0,0 +1 @@
1
+ export * from './use-move-row';
@@ -0,0 +1,4 @@
1
+ import { UseMoveRowProps } from './use-move-row.types';
2
+ export declare const useMoveRow: (props: UseMoveRowProps) => {
3
+ moveRow: (startIndex: number, endIndex: number) => void;
4
+ };
@@ -0,0 +1,5 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ import { BaseTableDataType } from '../../table.types';
3
+ export interface UseMoveRowProps {
4
+ setData: Dispatch<SetStateAction<BaseTableDataType[]>>;
5
+ }
@@ -0,0 +1 @@
1
+ export * from './use-track-sticky-cells';
@@ -0,0 +1,3 @@
1
+ import { UseTrackStickyCellsProps } from './use-track-sticky-cells.types';
2
+ /** Mark table if header and/or first column cells are sticky. */
3
+ export declare const useTrackStickyCells: (props: UseTrackStickyCellsProps) => void;
@@ -0,0 +1,7 @@
1
+ import { ColumnDef } from '@tanstack/react-table';
2
+ export interface UseTrackStickyCellsProps {
3
+ columns: ColumnDef<any, any>[];
4
+ /** The containing element that the child will intersect with. */
5
+ root: Element | null;
6
+ stickyFirstColumn: boolean | undefined;
7
+ }
@@ -14,17 +14,19 @@ export interface TableProps<DataType extends BaseTableDataType> extends Partial<
14
14
  * To create collapsable rows, optionally provide the index with a `subRows` key. It should be an array of objects matching the expected data type.
15
15
  */
16
16
  data: DataType[];
17
- enableReordering?: boolean;
18
17
  filters?: FiltersProps;
19
18
  getCellProps?: GetCellProps<DataType>;
20
19
  getHeaderCellProps?: GetHeaderCellProps<DataType>;
21
20
  /** Include `status` in the returned value to set the row status color. */
22
21
  getRowProps?: GetRowProps<DataType>;
23
- onReorder?: (data: DataType[]) => Promise<void>;
24
22
  onRowClick?: OnRowClick<DataType>;
25
23
  /** Any options provided are passed to `useReactTable` and may override default values. */
26
24
  options?: Partial<TableOptions<DataType>>;
27
25
  paging?: PagingProps;
26
+ reordering?: {
27
+ enable: boolean;
28
+ onReorder: (data: DataType[]) => Promise<void>;
29
+ };
28
30
  search?: SearchProps;
29
31
  sorting?: SortProps;
30
32
  }
@@ -7,12 +7,14 @@ import { MarkStickyElementsArgs } from './mark-sticky-elements.types';
7
7
  * const elementsToObserve = Array.from(
8
8
  * document.querySelectorAll('tr td:first-child'),
9
9
  * );
10
+ * const root = [document.querySelector('[data-table-container]')];
10
11
  * const stickyTo = 'left';
11
12
  *
12
13
  * const { cleanupUseEffect } = markStickyElements({
13
14
  * attrToApply: `${dataAttrIsSticky}-${stickyTo}`,
14
15
  * elementsToMark,
15
16
  * elementsToObserve,
17
+ * root,
16
18
  * stickyTo,
17
19
  * });
18
20
  *
@@ -16,7 +16,7 @@ export interface StickyElementsDetails {
16
16
  */
17
17
  elementsToObserve: Element[];
18
18
  /**
19
- * Value passed to IntersectionObserver options.
19
+ * The containing element that the child will intersect with. Value is passed to IntersectionObserver options.
20
20
  *
21
21
  * https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/root
22
22
  * */