@gobolt/genesis 0.4.12 → 0.4.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,2 @@
1
+ import { InfiniteScrollTableProps } from './types';
2
+ export declare const InfiniteScrollTable: <T>({ instanceId, columns: initialColumns, fetchService, title, scrollHeight, scrollWidth, }: InfiniteScrollTableProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ interface ResizableTitleProps {
3
+ onResize?: (newWidth: number) => void;
4
+ width?: number;
5
+ style?: React.CSSProperties;
6
+ children: React.ReactNode;
7
+ [key: string]: any;
8
+ }
9
+ export declare const ResizableTitle: React.FC<ResizableTitleProps>;
10
+ export {};
@@ -4,15 +4,28 @@ import { ActionEvent } from '../../types/events';
4
4
  import * as React from "react";
5
5
  export type Change = (actionEvent: ActionEvent) => void;
6
6
  export type SelectionType = "checkbox" | "radio";
7
- export interface MaterializedViewConfig<T = any> {
8
- height?: number | string | "dynamic";
9
- onLoadMore?: (offset: number, limit: number) => Promise<T[]> | T[];
10
- loadMoreThreshold?: number;
11
- initialLoadSize?: number;
12
- hasMore?: boolean;
13
- loading?: boolean;
14
- maxHeight?: number | string;
15
- minHeight?: number | string;
7
+ export interface InfiniteScrollConfig<T = any> {
8
+ instanceId: string;
9
+ fetchService: {
10
+ fetchData: (params: {
11
+ pageParam: number;
12
+ }) => Promise<{
13
+ docs: T[];
14
+ totalDocs: number;
15
+ limit: number;
16
+ page: number;
17
+ totalPages: number;
18
+ pagingCounter: number;
19
+ hasPrevPage: boolean;
20
+ hasNextPage: boolean;
21
+ prevPage?: number;
22
+ nextPage?: number;
23
+ }>;
24
+ queryKey: string[];
25
+ };
26
+ title: string;
27
+ scrollHeight?: number;
28
+ scrollWidth?: number;
16
29
  }
17
30
  export interface TableProps<T extends Record<string, any>> {
18
31
  dataSource: T[];
@@ -44,8 +57,8 @@ export interface TableProps<T extends Record<string, any>> {
44
57
  };
45
58
  [key: string]: any;
46
59
  isMainContentCell?: boolean;
47
- isMaterializedView?: boolean;
48
- materializedViewConfig?: MaterializedViewConfig<T>;
60
+ isInfiniteScroll?: boolean;
61
+ infiniteScrollConfig?: InfiniteScrollConfig<T>;
49
62
  enableRowKeyValidation?: boolean;
50
63
  onRowKeyError?: (error: {
51
64
  record: T;
@@ -66,5 +79,5 @@ export type SorterResult<T> = {
66
79
  field?: keyof T | string | React.Key | readonly React.Key[];
67
80
  columnKey?: React.Key;
68
81
  };
69
- declare function Table<T extends Record<string, any>>({ columns, dataSource, rowKey, size, onChange, rowSelection, onRowClick, pagination, isMainContentCell, isMaterializedView, materializedViewConfig, enableRowKeyValidation, onRowKeyError, ...rest }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
82
+ declare function Table<T extends Record<string, any>>({ columns, dataSource, rowKey, size, onChange, rowSelection, onRowClick, pagination, isMainContentCell, isInfiniteScroll, infiniteScrollConfig, enableRowKeyValidation, onRowKeyError, ...rest }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
70
83
  export default Table;
@@ -0,0 +1,3 @@
1
+ import { AppointmentWithSimpleAddress } from './table-mocks';
2
+ export declare const generateLargeDataset: (count: number) => AppointmentWithSimpleAddress[];
3
+ export declare const staticTableData: AppointmentWithSimpleAddress[];
@@ -7,7 +7,10 @@ export type UseTableConfig = {
7
7
  fetchOptions?: RequestInit;
8
8
  selectionType?: SelectionType;
9
9
  simulateDelay?: number;
10
- disableRowSelection?: (record: any) => unknown;
10
+ disableRowSelection?: (record: any) => {
11
+ disabled?: boolean;
12
+ name?: string;
13
+ };
11
14
  hasSettings?: boolean;
12
15
  hasFilter?: boolean;
13
16
  disableAutoFetch?: boolean;
@@ -20,7 +23,10 @@ export declare const useTable: <T extends Record<string, any>>(useTableConfig: a
20
23
  type: SelectionType;
21
24
  selectedRowKeys: import('react').Key[];
22
25
  onChange: (newSelectedRowKeys: React.Key[], newSelectedRows: T[]) => void;
23
- getCheckboxProps: (record: any) => unknown;
26
+ getCheckboxProps: (record: any) => {
27
+ disabled?: boolean;
28
+ name?: string;
29
+ };
24
30
  };
25
31
  selectedRows: T[];
26
32
  selectedRowKeys: import('react').Key[];
@@ -2,11 +2,18 @@ import { default as React } from 'react';
2
2
  import { TableProps } from '../Table';
3
3
  import { TableControlsData } from '../Table/TableControls/TableControls';
4
4
  import { ActionEvent, TableEventPayload } from '../../types/events';
5
+ import { InfiniteScrollConfig } from '../Table/Table';
6
+ import { PaginationStyle } from '../Table/TableControls/CustomPagination';
7
+ export type TableType = "table" | "pagination" | "infiniteScroll";
5
8
  export interface TableWithControlsProps {
6
9
  tableControlsData: TableControlsData;
7
10
  tableData: TableProps<Record<string, any>>;
8
11
  onChange: (event: ActionEvent<TableEventPayload>) => void;
12
+ tableType?: TableType;
13
+ isInfiniteScroll?: boolean;
14
+ infiniteScrollConfig?: InfiniteScrollConfig<Record<string, any>>;
15
+ paginationStyle?: PaginationStyle;
9
16
  onRowClick?: (record: Record<string, any>, index: number, event: React.MouseEvent) => void;
10
17
  }
11
- declare const TableWithControls: ({ tableData, tableControlsData, onChange, onRowClick, }: TableWithControlsProps) => import("react/jsx-runtime").JSX.Element;
18
+ declare const TableWithControls: ({ tableData, tableControlsData, onChange, onRowClick, tableType, isInfiniteScroll, infiniteScrollConfig, paginationStyle, }: TableWithControlsProps) => import("react/jsx-runtime").JSX.Element;
12
19
  export default TableWithControls;
@@ -26,7 +26,10 @@ export declare const useTableWithControls: (tableConfig: UseTableConfig) => {
26
26
  type: import('../Table/Table').SelectionType;
27
27
  selectedRowKeys: import('react').Key[];
28
28
  onChange: (newSelectedRowKeys: React.Key[], newSelectedRows: Record<string, any>[]) => void;
29
- getCheckboxProps: (record: any) => unknown;
29
+ getCheckboxProps: (record: any) => {
30
+ disabled?: boolean;
31
+ name?: string;
32
+ };
30
33
  };
31
34
  selectedRows: Record<string, any>[];
32
35
  selectedRowKeys: import('react').Key[];