@gobolt/genesis 0.4.13 → 0.4.17
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/components/Table/InfiniteScrollTable/InfiniteScrollTable.d.ts +2 -1
- package/dist/components/Table/InfiniteScrollTable/index.d.ts +2 -0
- package/dist/components/Table/InfiniteScrollTable/useInfiniteQuery.d.ts +21 -0
- package/dist/components/Table/TableControls/SecondaryTableControlsRow.d.ts +3 -1
- package/dist/components/Table/__mocks__/TableWithControlsData.d.ts +3 -0
- package/dist/components/Table/__mocks__/table-mocks.d.ts +31 -0
- package/dist/components/Table/useTable.d.ts +8 -2
- package/dist/components/TableWithControls/TableWithControls.d.ts +8 -1
- package/dist/components/TableWithControls/useTableWithControls.d.ts +4 -1
- package/dist/index.cjs +1080 -1775
- package/dist/index.js +1080 -1775
- package/package.json +1 -2
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { InfiniteScrollTableProps } from './types';
|
|
2
|
-
|
|
2
|
+
declare const InfiniteScrollTable: <T>({ columns: initialColumns, fetchService, scrollHeight, scrollWidth, onChange, }: InfiniteScrollTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default InfiniteScrollTable;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApiResponse } from './types';
|
|
2
|
+
interface UseInfiniteQueryOptions<T> {
|
|
3
|
+
queryKey: string[];
|
|
4
|
+
queryFn: (params: {
|
|
5
|
+
pageParam: number;
|
|
6
|
+
}) => Promise<ApiResponse<T>>;
|
|
7
|
+
initialPageParam: number;
|
|
8
|
+
getNextPageParam: (lastPage: ApiResponse<T>) => number | undefined;
|
|
9
|
+
}
|
|
10
|
+
interface UseInfiniteQueryResult<T> {
|
|
11
|
+
data: {
|
|
12
|
+
pages: ApiResponse<T>[];
|
|
13
|
+
} | undefined;
|
|
14
|
+
error: Error | null;
|
|
15
|
+
fetchNextPage: () => void;
|
|
16
|
+
hasNextPage: boolean;
|
|
17
|
+
isFetchingNextPage: boolean;
|
|
18
|
+
status: "pending" | "error" | "success";
|
|
19
|
+
}
|
|
20
|
+
export declare const useInfiniteQuery: <T>({ queryKey, queryFn, initialPageParam, getNextPageParam, }: UseInfiniteQueryOptions<T>) => UseInfiniteQueryResult<T>;
|
|
21
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Change } from '../Table';
|
|
2
|
+
import { InfiniteScrollChangeEvent } from '../InfiniteScrollTable/types';
|
|
2
3
|
export type Groups = {
|
|
3
4
|
[key: string]: string[];
|
|
4
5
|
};
|
|
@@ -6,6 +7,7 @@ export interface SecondaryTableControlsRowProps {
|
|
|
6
7
|
groups: Groups | null;
|
|
7
8
|
totalRecords: number | null;
|
|
8
9
|
onChange?: Change;
|
|
10
|
+
infiniteScrollData?: InfiniteScrollChangeEvent;
|
|
9
11
|
}
|
|
10
|
-
declare const SecondaryTableControlsRow: ({ groups, totalRecords, onChange, }: SecondaryTableControlsRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const SecondaryTableControlsRow: ({ groups, totalRecords, onChange, infiniteScrollData, }: SecondaryTableControlsRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export default SecondaryTableControlsRow;
|
|
@@ -7,6 +7,12 @@ export interface AppointmentWithSimpleAddress {
|
|
|
7
7
|
address: {
|
|
8
8
|
nickname: string;
|
|
9
9
|
address: string;
|
|
10
|
+
} | {
|
|
11
|
+
nickname: string;
|
|
12
|
+
street: string;
|
|
13
|
+
city: string;
|
|
14
|
+
state: string;
|
|
15
|
+
zip: string;
|
|
10
16
|
};
|
|
11
17
|
job_subtype: "delivery" | "pickup";
|
|
12
18
|
progress?: {
|
|
@@ -20,6 +26,31 @@ export interface AppointmentWithSimpleAddress {
|
|
|
20
26
|
status: string;
|
|
21
27
|
value: number;
|
|
22
28
|
};
|
|
29
|
+
} | {
|
|
30
|
+
currentStep: number;
|
|
31
|
+
totalSteps: number;
|
|
32
|
+
steps: {
|
|
33
|
+
pickup: {
|
|
34
|
+
text: string;
|
|
35
|
+
status: string;
|
|
36
|
+
value: number;
|
|
37
|
+
};
|
|
38
|
+
transit: {
|
|
39
|
+
text: string;
|
|
40
|
+
status: string;
|
|
41
|
+
value: number;
|
|
42
|
+
};
|
|
43
|
+
delivery: {
|
|
44
|
+
text: string;
|
|
45
|
+
status: string;
|
|
46
|
+
value: number;
|
|
47
|
+
};
|
|
48
|
+
quality: {
|
|
49
|
+
text: string;
|
|
50
|
+
status: string;
|
|
51
|
+
value: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
23
54
|
};
|
|
24
55
|
}
|
|
25
56
|
export interface MockDataSource {
|
|
@@ -7,7 +7,10 @@ export type UseTableConfig = {
|
|
|
7
7
|
fetchOptions?: RequestInit;
|
|
8
8
|
selectionType?: SelectionType;
|
|
9
9
|
simulateDelay?: number;
|
|
10
|
-
disableRowSelection?: (record: any) =>
|
|
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) =>
|
|
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) =>
|
|
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[];
|