gantri-components 2.38.1 → 2.39.0-beta.10
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/checkbox/checkbox.styles.d.ts +1 -0
- package/dist/components/checkbox/checkbox.types.d.ts +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.styles.d.ts +3 -1
- package/dist/components/dropdown-menu/dropdown-menu.types.d.ts +2 -0
- package/dist/components/filter-button/filter-button.types.d.ts +3 -1
- package/dist/components/icon/generated/ui-control/ExlamationCircleFilled.d.ts +3 -0
- package/dist/components/icon/generated/ui-control/ExlamationCircleFilled24.d.ts +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/paging/__tests__/paging.test.d.ts +1 -0
- package/dist/components/paging/index.d.ts +1 -0
- package/dist/components/paging/paging.d.ts +5 -0
- package/dist/components/paging/paging.presets.d.ts +2 -0
- package/dist/components/paging/paging.styles.d.ts +3 -0
- package/dist/components/paging/paging.types.d.ts +13 -0
- package/dist/components/table/components/custom-columns-wrapper/components/user-preferences-toggle/components/user-preferences-modal/index.d.ts +1 -0
- package/dist/components/table/components/custom-columns-wrapper/components/user-preferences-toggle/components/user-preferences-modal/user-preferences-modal.d.ts +2 -0
- package/dist/components/table/components/custom-columns-wrapper/components/user-preferences-toggle/components/user-preferences-modal/user-preferences-modal.styles.d.ts +6 -0
- package/dist/components/table/components/custom-columns-wrapper/components/user-preferences-toggle/components/user-preferences-modal/user-preferences-modal.types.d.ts +7 -0
- package/dist/components/table/components/custom-columns-wrapper/components/user-preferences-toggle/index.d.ts +1 -0
- package/dist/components/table/components/custom-columns-wrapper/components/user-preferences-toggle/user-preferences-toggle.d.ts +3 -0
- package/dist/components/table/components/custom-columns-wrapper/components/user-preferences-toggle/user-preferences-toggle.styles.d.ts +4 -0
- package/dist/components/table/components/custom-columns-wrapper/components/user-preferences-toggle/user-preferences-toggle.types.d.ts +10 -0
- package/dist/components/table/components/custom-columns-wrapper/custom-columns-wrapper.d.ts +7 -0
- package/dist/components/table/components/custom-columns-wrapper/custom-columns-wrapper.styles.d.ts +3 -0
- package/dist/components/table/components/custom-columns-wrapper/custom-columns-wrapper.types.d.ts +19 -0
- package/dist/components/table/components/custom-columns-wrapper/helpers/get-custom-column-initial-visibility/get-custom-column-initial-visibility.d.ts +1 -0
- package/dist/components/table/components/custom-columns-wrapper/helpers/get-custom-column-initial-visibility/index.d.ts +1 -0
- package/dist/components/table/components/custom-columns-wrapper/helpers/get-custom-column-options/get-custom-column-options.d.ts +8 -0
- package/dist/components/table/components/custom-columns-wrapper/helpers/get-custom-column-options/get-custom-column-options.types.d.ts +6 -0
- package/dist/components/table/components/custom-columns-wrapper/helpers/get-custom-column-options/index.d.ts +1 -0
- package/dist/components/table/components/custom-columns-wrapper/hooks/use-detect-horizontal-scroll/index.d.ts +1 -0
- package/dist/components/table/components/custom-columns-wrapper/hooks/use-detect-horizontal-scroll/use-detect-horizontal-scroll.d.ts +6 -0
- package/dist/components/table/components/custom-columns-wrapper/index.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/__test__/table-actions-wrapper.test.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/components/search/__tests__/search.test.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/components/search/index.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/components/search/search.d.ts +5 -0
- package/dist/components/table/components/table-actions-wrapper/components/search/search.presets.d.ts +2 -0
- package/dist/components/table/components/table-actions-wrapper/components/search/search.styles.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/components/search/search.types.d.ts +12 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/helpers/get-sort-mapping/get-sort-mapping.d.ts +3 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/helpers/get-sort-mapping/get-sort-mapping.types.d.ts +2 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/helpers/get-sort-mapping/index.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/helpers/get-sort-options/__tests__/get-sort-options.test.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/helpers/get-sort-options/get-sort-options.d.ts +8 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/helpers/get-sort-options/get-sort-options.types.d.ts +2 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/helpers/get-sort-options/index.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/index.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/sort.d.ts +2 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/sort.styles.d.ts +2 -0
- package/dist/components/table/components/table-actions-wrapper/components/sort/sort.types.d.ts +29 -0
- package/dist/components/table/components/table-actions-wrapper/hooks/use-confirm-interaction/index.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/hooks/use-confirm-interaction/use-confirm-interaction.constants.d.ts +2 -0
- package/dist/components/table/components/table-actions-wrapper/hooks/use-confirm-interaction/use-confirm-interaction.d.ts +12 -0
- package/dist/components/table/components/table-actions-wrapper/hooks/use-confirm-interaction/use-confirm-interaction.types.d.ts +6 -0
- package/dist/components/table/components/table-actions-wrapper/index.d.ts +1 -0
- package/dist/components/table/components/table-actions-wrapper/table-actions-wrapper.d.ts +9 -0
- package/dist/components/table/components/table-actions-wrapper/table-actions-wrapper.types.d.ts +33 -0
- package/dist/components/table/components/table-footer/index.d.ts +1 -0
- package/dist/components/table/components/table-footer/table-footer.d.ts +7 -0
- package/dist/components/table/components/table-footer/table-footer.types.d.ts +4 -0
- package/dist/components/table/components/table-header/index.d.ts +1 -0
- package/dist/components/table/components/table-header/table-header.d.ts +7 -0
- package/dist/components/table/components/table-header/table-header.styles.d.ts +3 -0
- package/dist/components/table/components/table-header/table-header.types.d.ts +6 -0
- package/dist/components/table/components/table-row/hooks/use-drag-and-drop/index.d.ts +1 -0
- package/dist/components/table/components/table-row/hooks/use-drag-and-drop/use-drag-and-drop.d.ts +14 -0
- package/dist/components/table/components/table-row/hooks/use-drag-and-drop/use-drag-and-drop.types.d.ts +9 -0
- package/dist/components/table/components/table-row/index.d.ts +1 -0
- package/dist/components/table/components/table-row/table-row.constants.d.ts +10 -0
- package/dist/components/table/components/table-row/table-row.d.ts +7 -0
- package/dist/components/table/components/table-row/table-row.styles.d.ts +4 -0
- package/dist/components/table/components/table-row/table-row.types.d.ts +12 -0
- package/dist/components/table/helpers/add-missing-ids/add-missing-ids.d.ts +7 -0
- package/dist/components/table/helpers/add-missing-ids/index.d.ts +1 -0
- package/dist/components/table/helpers/hyphenate-column-id/hyphenate-column-id.d.ts +1 -0
- package/dist/components/table/helpers/hyphenate-column-id/index.d.ts +1 -0
- package/dist/components/table/hooks/use-move-row/index.d.ts +1 -0
- package/dist/components/table/hooks/use-move-row/use-move-row.d.ts +9 -0
- package/dist/components/table/hooks/use-move-row/use-move-row.types.d.ts +5 -0
- package/dist/components/table/hooks/use-track-sticky-cells/index.d.ts +1 -0
- package/dist/components/table/hooks/use-track-sticky-cells/use-track-sticky-cells.d.ts +3 -0
- package/dist/components/table/hooks/use-track-sticky-cells/use-track-sticky-cells.types.d.ts +7 -0
- package/dist/components/table/index.d.ts +4 -0
- package/dist/components/table/table.d.ts +10 -0
- package/dist/components/table/table.presets.d.ts +2 -0
- package/dist/components/table/table.styles.d.ts +4 -0
- package/dist/components/table/table.types.d.ts +46 -0
- package/dist/helpers/format-as-locale-number/format-as-locale-number.d.ts +6 -0
- package/dist/helpers/format-as-locale-number/format-as-locale-number.types.d.ts +3 -0
- package/dist/helpers/format-as-locale-number/index.d.ts +1 -0
- package/dist/helpers/mark-sticky-elements/__tests__/mark-sticky-elements.test.d.ts +1 -0
- package/dist/helpers/mark-sticky-elements/__tests__/setup.d.ts +8 -0
- package/dist/helpers/mark-sticky-elements/helpers/get-intersection-observer-callback/__tests__/get-intersection-observer-callback.test.d.ts +1 -0
- package/dist/helpers/mark-sticky-elements/helpers/get-intersection-observer-callback/get-intersection-observer-callback.d.ts +2 -0
- package/dist/helpers/mark-sticky-elements/helpers/get-intersection-observer-callback/get-intersection-observer-callback.types.d.ts +8 -0
- package/dist/helpers/mark-sticky-elements/helpers/get-intersection-observer-callback/index.d.ts +1 -0
- package/dist/helpers/mark-sticky-elements/index.d.ts +1 -0
- package/dist/helpers/mark-sticky-elements/mark-sticky-elements.constants.d.ts +2 -0
- package/dist/helpers/mark-sticky-elements/mark-sticky-elements.d.ts +28 -0
- package/dist/helpers/mark-sticky-elements/mark-sticky-elements.types.d.ts +28 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -7
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/setupTests.d.ts +9 -0
- package/package.json +7 -1
|
@@ -4,6 +4,7 @@ export declare const StyledCheckbox: import("styled-components").StyledComponent
|
|
|
4
4
|
$checked: boolean;
|
|
5
5
|
$variant?: CheckboxVariant | undefined;
|
|
6
6
|
}, never>;
|
|
7
|
+
export declare const StyledIndeterminateMarker: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
8
|
export declare const StyledCheckboxContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
8
9
|
disabled: boolean;
|
|
9
10
|
}, never>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Property } from 'csstype';
|
|
1
2
|
export declare const StyledContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
2
3
|
$hasHeader?: boolean | undefined;
|
|
3
4
|
$noShadow: boolean;
|
|
@@ -5,6 +6,7 @@ export declare const StyledContainer: import("styled-components").StyledComponen
|
|
|
5
6
|
export declare const StyledHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
6
7
|
export declare const StyledItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
7
8
|
$basic: boolean;
|
|
8
|
-
$disabled
|
|
9
|
+
$disabled: boolean | undefined;
|
|
10
|
+
$justifyContent: Property.JustifyContent | undefined;
|
|
9
11
|
$selected: boolean;
|
|
10
12
|
}, never>;
|
|
@@ -8,6 +8,8 @@ export interface DropdownMenuProps<T = Record<string, unknown>> {
|
|
|
8
8
|
idProperty?: keyof T;
|
|
9
9
|
/** Can optionally include `disabled: true` to any index to disable that item. */
|
|
10
10
|
items: T[];
|
|
11
|
+
/** Sets the alignment of the dropdown items. */
|
|
12
|
+
justifyContent?: Property.JustifyContent;
|
|
11
13
|
keyProperty?: (item?: T) => string;
|
|
12
14
|
labelProperty?: keyof T | ((item?: T) => string);
|
|
13
15
|
labelPropertyTx?: (item?: T) => string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
|
|
2
2
|
import { ButtonSize } from '../button/button.types';
|
|
3
|
+
import { OnConfirmInteraction } from '../table/components/table-actions-wrapper/hooks/use-confirm-interaction/use-confirm-interaction.types';
|
|
3
4
|
export interface FilterButtonProps {
|
|
4
5
|
Content?: JSX.Element;
|
|
5
6
|
applyButtonText?: string;
|
|
@@ -11,11 +12,12 @@ export interface FilterButtonProps {
|
|
|
11
12
|
modalTitleTx?: string;
|
|
12
13
|
onApply?: () => void;
|
|
13
14
|
onClose?: () => void;
|
|
15
|
+
onConfirmInteraction?: OnConfirmInteraction;
|
|
14
16
|
onOpen?: () => void;
|
|
15
17
|
onReset?: () => void;
|
|
16
18
|
recordsCount?: number;
|
|
17
19
|
resetButtonText?: string;
|
|
20
|
+
resetButtonTx?: string;
|
|
18
21
|
size?: ResolutionAwareProp<ButtonSize>;
|
|
19
22
|
variant?: 'primary' | 'secondary';
|
|
20
|
-
resetButtonTx?: string;
|
|
21
23
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Paging } from './paging';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledFlex: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../flex/flex.types").FlexProps & import("react").RefAttributes<import("../flex/flex.types").FlexProps>>, import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const StyledPagingButton: import("styled-components").StyledComponent<import("react").FC<import("../button/button.types").ButtonProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OnConfirmInteraction } from '../table/components/table-actions-wrapper/hooks/use-confirm-interaction/use-confirm-interaction.types';
|
|
2
|
+
export interface PagingProps {
|
|
3
|
+
currentPage: number;
|
|
4
|
+
onPageChange: (page: number) => void;
|
|
5
|
+
/** Total number of pages. */
|
|
6
|
+
pageCount: number;
|
|
7
|
+
/** Total number of returned results. */
|
|
8
|
+
total: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PagingComponentProps extends PagingProps {
|
|
11
|
+
confirmAllInteractions: boolean;
|
|
12
|
+
onConfirmInteraction: OnConfirmInteraction;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './user-preferences-modal';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledPreferencesPopUp: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const StyledHeading: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../../../../../grid/grid.types").GridProps & import("react").RefAttributes<import("../../../../../../../grid/grid.types").GridProps>>, import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const StyledClickableIcon: import("styled-components").StyledComponent<import("react").FC<import("../../../../../../../icon/icon.types").IconProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const StyledContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const StyledFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './user-preferences-toggle';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledButton: import("styled-components").StyledComponent<import("react").FC<import("../../../../../button/button.types").ButtonProps>, import("styled-components").DefaultTheme, {
|
|
3
|
+
'data-is-active': boolean;
|
|
4
|
+
}, never>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { CustomColumnOption } from '../../custom-columns-wrapper.types';
|
|
3
|
+
export interface UserPreferencesToggleProps {
|
|
4
|
+
checklistOptions: CustomColumnOption[];
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
modalHeading: string;
|
|
7
|
+
onClose: () => Promise<void>;
|
|
8
|
+
onReset: () => Promise<void>;
|
|
9
|
+
setIsActive: Dispatch<SetStateAction<boolean>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { CustomColumnsWrapperProps } from './custom-columns-wrapper.types';
|
|
3
|
+
export declare const CustomColumnsWrapper: <DataType extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(props: CustomColumnsWrapperProps<DataType>) => JSX.Element;
|
package/dist/components/table/components/custom-columns-wrapper/custom-columns-wrapper.types.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RowData, Table } from '@tanstack/react-table';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
export interface CustomColumnsProps<DataType extends RowData> {
|
|
4
|
+
disabledColumns: (keyof DataType | string)[];
|
|
5
|
+
hiddenColumns: (keyof DataType | string)[];
|
|
6
|
+
onUpdateHiddenColumns: (columnsToHide: string[]) => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export interface CustomColumnOption {
|
|
9
|
+
checked: boolean;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
label: string;
|
|
12
|
+
onChange: (event: unknown) => void;
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
export type CustomColumnsWrapperProps<DataType extends RowData> = PropsWithChildren<{
|
|
16
|
+
customColumns: CustomColumnsProps<DataType> | undefined;
|
|
17
|
+
table: Table<DataType>;
|
|
18
|
+
tableContainerEl: HTMLDivElement | null;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getCustomColumnInitialVisibility: (hiddenColumns: string[]) => {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-custom-column-initial-visibility';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { CustomColumnOption } from '../../custom-columns-wrapper.types';
|
|
3
|
+
import { GetCustomColumnOptionsArgs } from './get-custom-column-options.types';
|
|
4
|
+
export declare const getCustomColumnOptions: <DataType extends RowData<{
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
id: string | number;
|
|
7
|
+
subRows?: any[] | undefined;
|
|
8
|
+
}>>(args: GetCustomColumnOptionsArgs<DataType>) => CustomColumnOption[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RowData, Table } from '@tanstack/react-table';
|
|
2
|
+
import { CustomColumnsProps } from '../../custom-columns-wrapper.types';
|
|
3
|
+
export interface GetCustomColumnOptionsArgs<DataType extends RowData> {
|
|
4
|
+
customColumns: CustomColumnsProps<DataType> | undefined;
|
|
5
|
+
table: Table<DataType>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-custom-column-options';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-detect-horizontal-scroll';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './custom-columns-wrapper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './search';
|
package/dist/components/table/components/table-actions-wrapper/components/search/search.styles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledSearchInputWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
package/dist/components/table/components/table-actions-wrapper/components/search/search.types.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TextFieldProps } from '../../../../../text-field';
|
|
2
|
+
import { OnConfirmInteraction } from '../../hooks/use-confirm-interaction/use-confirm-interaction.types';
|
|
3
|
+
export interface SearchProps extends Partial<SearchDefaultProps> {
|
|
4
|
+
onChange: TextFieldProps['onTextChange'];
|
|
5
|
+
}
|
|
6
|
+
export interface SearchComponentProps extends SearchProps {
|
|
7
|
+
onConfirmInteraction: OnConfirmInteraction;
|
|
8
|
+
}
|
|
9
|
+
export interface SearchDefaultProps {
|
|
10
|
+
placeholder: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-sort-mapping';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SortInfo, TableSortField } from '../../sort.types';
|
|
2
|
+
interface MappedSortItem<SortingField = string> {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
value: SortInfo<SortingField>;
|
|
6
|
+
}
|
|
7
|
+
export declare const getSortOptions: <SortingField = string>(sortingOptions?: TableSortField<SortingField>[]) => MappedSortItem<SortingField>[];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-sort-options';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sort';
|
package/dist/components/table/components/table-actions-wrapper/components/sort/sort.types.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OnConfirmInteraction } from '../../hooks/use-confirm-interaction/use-confirm-interaction.types';
|
|
2
|
+
export interface SortProps {
|
|
3
|
+
current: SortInfo;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
fields: TableSortField<string>[];
|
|
6
|
+
onSort: (sortInfo: SortInfo) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface SortComponentProps extends SortProps {
|
|
9
|
+
confirmAllInteractions: boolean;
|
|
10
|
+
onConfirmInteraction: OnConfirmInteraction;
|
|
11
|
+
}
|
|
12
|
+
export interface SortInfo<SortingField = string> {
|
|
13
|
+
label?: string;
|
|
14
|
+
sortingField: SortingField;
|
|
15
|
+
sortingType?: SortingType;
|
|
16
|
+
}
|
|
17
|
+
export type SortingType = 'ASC' | 'DESC';
|
|
18
|
+
export type TableSortField<SortingField = string> = {
|
|
19
|
+
bidirectional?: never;
|
|
20
|
+
label: string;
|
|
21
|
+
sortingField: SortingField;
|
|
22
|
+
/** If not provided, defaults to 'DESC' */
|
|
23
|
+
sortingType?: SortingType;
|
|
24
|
+
} | {
|
|
25
|
+
bidirectional: true;
|
|
26
|
+
label: string;
|
|
27
|
+
sortingField: SortingField;
|
|
28
|
+
sortingType?: never;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-confirm-interaction';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { UseConfirmInteractionProps, OnConfirmInteraction } from './use-confirm-interaction.types';
|
|
3
|
+
export declare const useConfirmInteraction: <DataType extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(props: UseConfirmInteractionProps<DataType>) => {
|
|
8
|
+
/** Not necessary for `onConfirmInteraction`. Only provided in case additional logic is needed. */
|
|
9
|
+
confirmAllInteractions: boolean;
|
|
10
|
+
/** If applicable, renders a discard selections confirmation modal when called. */
|
|
11
|
+
onConfirmInteraction: OnConfirmInteraction;
|
|
12
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RowData, Table } from '@tanstack/react-table';
|
|
2
|
+
export type TableInteraction = 'FOCUS_SEARCH' | 'OPEN_FILTERS' | 'OPEN_SORT' | 'USE_PAGING' | 'CUSTOM_ACTION';
|
|
3
|
+
export interface UseConfirmInteractionProps<DataType extends RowData> {
|
|
4
|
+
table: Table<DataType>;
|
|
5
|
+
}
|
|
6
|
+
export type OnConfirmInteraction = (interaction: TableInteraction) => Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table-actions-wrapper';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { RowData } from '@tanstack/react-table';
|
|
3
|
+
import { TableActionsWrapperProps } from './table-actions-wrapper.types';
|
|
4
|
+
/** Wraps the table with relevant components for paging, filters, sort, and table actions. */
|
|
5
|
+
export declare const TableActionsWrapper: <DataType extends RowData<{
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
id: string | number;
|
|
8
|
+
subRows?: any[] | undefined;
|
|
9
|
+
}>>(props: React.PropsWithChildren<TableActionsWrapperProps<DataType>>) => JSX.Element;
|
package/dist/components/table/components/table-actions-wrapper/table-actions-wrapper.types.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { JSXElementConstructor } from 'react';
|
|
2
|
+
import { RowData, Table } from '@tanstack/react-table';
|
|
3
|
+
import { PagingProps } from '../../../paging/paging.types';
|
|
4
|
+
import { SortProps } from './components/sort/sort.types';
|
|
5
|
+
export type FiltersProps = {
|
|
6
|
+
count: number;
|
|
7
|
+
filtersContent: JSX.Element;
|
|
8
|
+
numActive: number;
|
|
9
|
+
onApply: () => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onReset: () => void;
|
|
12
|
+
};
|
|
13
|
+
export interface SearchProps {
|
|
14
|
+
onSearch: (value: string) => void;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CustomActionProps<DataType extends RowData> {
|
|
19
|
+
Component: JSXElementConstructor<{
|
|
20
|
+
onConfirmInteraction: () => Promise<boolean>;
|
|
21
|
+
table: Table<DataType>;
|
|
22
|
+
}>;
|
|
23
|
+
position?: 'left' | 'right' | 'bottom';
|
|
24
|
+
}
|
|
25
|
+
export interface TableActionsWrapperProps<DataType extends RowData> {
|
|
26
|
+
className: string | undefined;
|
|
27
|
+
customAction: CustomActionProps<DataType> | undefined;
|
|
28
|
+
filters: FiltersProps | undefined;
|
|
29
|
+
paging: PagingProps | undefined;
|
|
30
|
+
search: SearchProps | undefined;
|
|
31
|
+
sorting: SortProps | undefined;
|
|
32
|
+
table: Table<DataType>;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table-footer';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { TableFooterProps } from './table-footer.types';
|
|
3
|
+
export declare const TableFooter: <DataType extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(props: TableFooterProps<DataType>) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table-header';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { TableHeaderProps } from './table-header.types';
|
|
3
|
+
export declare const TableHeader: <DataType extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(props: TableHeaderProps<DataType>) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-drag-and-drop';
|
package/dist/components/table/components/table-row/hooks/use-drag-and-drop/use-drag-and-drop.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RowData } from '@tanstack/react-table';
|
|
3
|
+
import { UseDragAndDropProps } from './use-drag-and-drop.types';
|
|
4
|
+
export declare const useDragAndDrop: <DataType extends RowData<{
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
id: string | number;
|
|
7
|
+
subRows?: any[] | undefined;
|
|
8
|
+
}>>(props: UseDragAndDropProps<DataType>) => {
|
|
9
|
+
dragAndDropRef: import("react").RefObject<HTMLTableRowElement>;
|
|
10
|
+
isDragging: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
dragAndDropRef?: undefined;
|
|
13
|
+
isDragging?: undefined;
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Row, RowData } from '@tanstack/react-table';
|
|
2
|
+
export interface UseDragAndDropProps<DataType extends RowData> {
|
|
3
|
+
enableReordering: boolean;
|
|
4
|
+
handleOnReorder: () => Promise<void>;
|
|
5
|
+
index: number;
|
|
6
|
+
isSubRow: boolean;
|
|
7
|
+
moveRow: (startIndex: number, endIndex: number) => void;
|
|
8
|
+
row: Row<DataType>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table-row';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** See `RowStatusValue` type for possible values. */
|
|
2
|
+
export declare const dataAttrRowStatus: "data-row-status";
|
|
3
|
+
export declare const dataAttrRowIsClickable: "data-row-is-clickable";
|
|
4
|
+
export declare const dataAttrRowHighlightOnHover: "data-row-highlight-on-hover";
|
|
5
|
+
/** Applying this data attribute marks a row as active, applying a new background color. */
|
|
6
|
+
export declare const dataAttrActiveRow: "data-active-row";
|
|
7
|
+
/** Prefix added to table cell data attrs (like cell ID). */
|
|
8
|
+
export declare const dataAttrCellPrefix: "data-cell";
|
|
9
|
+
/** Applied when a sticky styled element is observed to have become sticky via `markStickyElements`. */
|
|
10
|
+
export declare const dataAttrIsSticky: "data-is-sticky";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { TableRowProps } from './table-row.types';
|
|
3
|
+
export declare const TableRow: <DataType extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(props: TableRowProps<DataType>) => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Row, RowData } from '@tanstack/react-table';
|
|
2
|
+
import { CustomRowProps, GetCellProps, OnRowClick } from '../../table.types';
|
|
3
|
+
export interface TableRowProps<DataType extends RowData> {
|
|
4
|
+
customRowProps: CustomRowProps;
|
|
5
|
+
enableReordering: boolean;
|
|
6
|
+
getCellProps: GetCellProps<DataType> | undefined;
|
|
7
|
+
handleOnReorder: () => Promise<void>;
|
|
8
|
+
index: number;
|
|
9
|
+
moveRow: (startIndex: number, endIndex: number) => void;
|
|
10
|
+
onRowClick?: OnRowClick<DataType>;
|
|
11
|
+
row: Row<DataType>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
/** If an index does not contain an `id` value, one is added using uuid. */
|
|
3
|
+
export declare const addMissingIds: <DataType extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(data: DataType[]) => DataType[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './add-missing-ids';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const hyphenateColumnId: ((id: string) => string) & import("lodash").MemoizedFunction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hyphenate-column-id';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-move-row';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RowData } from '@tanstack/react-table';
|
|
2
|
+
import { UseMoveRowProps } from './use-move-row.types';
|
|
3
|
+
export declare const useMoveRow: <TData extends RowData<{
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
id: string | number;
|
|
6
|
+
subRows?: any[] | undefined;
|
|
7
|
+
}>>(props: UseMoveRowProps<TData>) => {
|
|
8
|
+
moveRow: (startIndex: number, endIndex: number) => void;
|
|
9
|
+
};
|