@syook/react-tabulous 3.0.2 → 4.0.0-beta-0.1
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/README.md +206 -197
- package/lib/index.esm.js +19 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/lib/types/App.d.ts +4 -0
- package/lib/types/__tests__/reactTabulous/components/base/gridBody.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/base/gridFooterPlaceholder.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/bulkAction/bulkActions.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/cell/columnCell.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/columnBody/columnBody.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/columnHeaders/columnHeaderCheckbox.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/columnHeaders/columnHeaderItem.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/columnHeaders/columnHeaderMenu.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/columnHeaders/columnHeaders.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/containers/gridRoot.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/filter/index.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/filter/inputCategories.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/gridHeader.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/pagination/pagination.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/toolbar/gridToolbar.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/toolbar/gridToolbarColumns.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/toolbar/gridToolbarDensity.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/toolbar/gridToolbarExport.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/toolbar/gridToolbarFilter.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/toolbar/gridToolbarQuickFilter.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/button/button.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/checkbox.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/divider.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/icon.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/iconButton/iconButton.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/input/input.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/inputError/index.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/inputLabel/index.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/loader.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/menu.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/popup/popup.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/select/select.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/switch.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/components/widgets/typography.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/context/dataGridContextProvider.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/helpers/classnames.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/helpers/debounce.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/helpers/getColumnsAndSearchKeys.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/helpers/toCamelCase.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useDragHandler.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridColumn.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridColumnHeaders.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridDensity.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridExport.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridFilter.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridPagination.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridPin.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridResize.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridRootProps.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridRowSelection.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridSearch.test.d.ts +1 -0
- package/lib/types/__tests__/reactTabulous/hooks/useGridSort.test.d.ts +1 -0
- package/lib/types/data/index.d.ts +83 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/reactTabulous/components/base/gridBody.d.ts +2 -0
- package/lib/types/reactTabulous/components/base/gridFooterPlaceholder.d.ts +2 -0
- package/lib/types/reactTabulous/components/base/index.d.ts +2 -0
- package/lib/types/reactTabulous/components/bulkAction/index.d.ts +9 -0
- package/lib/types/reactTabulous/components/cell/columnCell.d.ts +12 -0
- package/lib/types/reactTabulous/components/cell/gridActionsCellItem.d.ts +10 -0
- package/lib/types/reactTabulous/components/columnBody/columnBody.d.ts +2 -0
- package/lib/types/reactTabulous/components/columnBody/index.d.ts +1 -0
- package/lib/types/reactTabulous/components/columnHeaders/columnHeaderCheckbox.d.ts +7 -0
- package/lib/types/reactTabulous/components/columnHeaders/columnHeaderItem.d.ts +31 -0
- package/lib/types/reactTabulous/components/columnHeaders/columnHeaderMenu.d.ts +18 -0
- package/lib/types/reactTabulous/components/columnHeaders/columnHeaders.d.ts +2 -0
- package/lib/types/reactTabulous/components/columnHeaders/index.d.ts +1 -0
- package/lib/types/reactTabulous/components/containers/gridRoot.d.ts +2 -0
- package/lib/types/reactTabulous/components/containers/index.d.ts +1 -0
- package/lib/types/reactTabulous/components/filter/index.d.ts +13 -0
- package/lib/types/reactTabulous/components/filter/inputCategories.d.ts +13 -0
- package/lib/types/reactTabulous/components/gridHeader.d.ts +2 -0
- package/lib/types/reactTabulous/components/index.d.ts +3 -0
- package/lib/types/reactTabulous/components/overlayWrapper/index.d.ts +1 -0
- package/lib/types/reactTabulous/components/overlayWrapper/overlayWrapper.d.ts +6 -0
- package/lib/types/reactTabulous/components/pagination/index.d.ts +1 -0
- package/lib/types/reactTabulous/components/pagination/pagination.d.ts +2 -0
- package/lib/types/reactTabulous/components/toolbar/gridToolbar.d.ts +6 -0
- package/lib/types/reactTabulous/components/toolbar/gridToolbarColumns.d.ts +2 -0
- package/lib/types/reactTabulous/components/toolbar/gridToolbarDensity.d.ts +2 -0
- package/lib/types/reactTabulous/components/toolbar/gridToolbarExport.d.ts +2 -0
- package/lib/types/reactTabulous/components/toolbar/gridToolbarFilter.d.ts +2 -0
- package/lib/types/reactTabulous/components/toolbar/gridToolbarQuickFilter.d.ts +2 -0
- package/lib/types/reactTabulous/components/toolbar/index.d.ts +6 -0
- package/lib/types/reactTabulous/components/widgets/button/buttonStyle.d.ts +5 -0
- package/lib/types/reactTabulous/components/widgets/button/index.d.ts +21 -0
- package/lib/types/reactTabulous/components/widgets/checkbox.d.ts +7 -0
- package/lib/types/reactTabulous/components/widgets/divider.d.ts +2 -0
- package/lib/types/reactTabulous/components/widgets/icon.d.ts +41 -0
- package/lib/types/reactTabulous/components/widgets/iconButton/index.d.ts +12 -0
- package/lib/types/reactTabulous/components/widgets/index.d.ts +12 -0
- package/lib/types/reactTabulous/components/widgets/input/index.d.ts +26 -0
- package/lib/types/reactTabulous/components/widgets/input/inputStyle.d.ts +5 -0
- package/lib/types/reactTabulous/components/widgets/inputError/index.d.ts +8 -0
- package/lib/types/reactTabulous/components/widgets/inputLabel/index.d.ts +13 -0
- package/lib/types/reactTabulous/components/widgets/loader.d.ts +1 -0
- package/lib/types/reactTabulous/components/widgets/menu.d.ts +16 -0
- package/lib/types/reactTabulous/components/widgets/popup/index.d.ts +12 -0
- package/lib/types/reactTabulous/components/widgets/select/index.d.ts +13 -0
- package/lib/types/reactTabulous/components/widgets/select/selectStyle.d.ts +5 -0
- package/lib/types/reactTabulous/components/widgets/switch.d.ts +8 -0
- package/lib/types/reactTabulous/components/widgets/typography.d.ts +28 -0
- package/lib/types/reactTabulous/constant/index.d.ts +10 -0
- package/lib/types/reactTabulous/constant/noRowsOverlay.d.ts +2 -0
- package/lib/types/reactTabulous/context/dataGridContextProvider.d.ts +6 -0
- package/lib/types/reactTabulous/context/dataGridRootPropsContext.d.ts +3 -0
- package/lib/types/reactTabulous/context/index.d.ts +1 -0
- package/lib/types/reactTabulous/context/test-utils.d.ts +5 -0
- package/lib/types/reactTabulous/helpers/classnames.d.ts +2 -0
- package/lib/types/reactTabulous/helpers/debounce.d.ts +1 -0
- package/lib/types/reactTabulous/helpers/getColumnsAndSearchKeys.d.ts +5 -0
- package/lib/types/reactTabulous/helpers/toCamelCase.d.ts +1 -0
- package/lib/types/reactTabulous/hooks/useClickAwayListener.d.ts +2 -0
- package/lib/types/reactTabulous/hooks/useDragHandler.d.ts +8 -0
- package/lib/types/reactTabulous/hooks/useGridColumn.d.ts +1 -0
- package/lib/types/reactTabulous/hooks/useGridColumnHeaders.d.ts +1 -0
- package/lib/types/reactTabulous/hooks/useGridDensity.d.ts +1 -0
- package/lib/types/reactTabulous/hooks/useGridExport.d.ts +3 -0
- package/lib/types/reactTabulous/hooks/useGridFilter.d.ts +6 -0
- package/lib/types/reactTabulous/hooks/useGridPagination.d.ts +1 -0
- package/lib/types/reactTabulous/hooks/useGridPin.d.ts +1 -0
- package/lib/types/reactTabulous/hooks/useGridResize.d.ts +1 -0
- package/lib/types/reactTabulous/hooks/useGridRootProps.d.ts +48 -0
- package/lib/types/reactTabulous/hooks/useGridRowSelection.d.ts +1 -0
- package/lib/types/reactTabulous/hooks/useGridSearch.d.ts +5 -0
- package/lib/types/reactTabulous/hooks/useGridSort.d.ts +4 -0
- package/lib/types/reactTabulous/index.d.ts +2 -0
- package/lib/types/reactTabulous/models/columnDef/columnDef.d.ts +72 -0
- package/lib/types/reactTabulous/models/columnDef/columnPin.d.ts +48 -0
- package/lib/types/reactTabulous/models/columnDef/columnType.d.ts +2 -0
- package/lib/types/reactTabulous/models/columnDef/index.d.ts +3 -0
- package/lib/types/reactTabulous/models/gridDensity.d.ts +4 -0
- package/lib/types/reactTabulous/models/gridFiltersModel.d.ts +9 -0
- package/lib/types/reactTabulous/models/gridRows.d.ts +2 -0
- package/lib/types/reactTabulous/models/gridSortModel.d.ts +1 -0
- package/lib/types/reactTabulous/models/index.d.ts +7 -0
- package/lib/types/reactTabulous/models/logger.d.ts +6 -0
- package/lib/types/reactTabulous/models/props/dataGridProps.d.ts +158 -0
- package/lib/types/reactTabulous/models/props/index.d.ts +1 -0
- package/lib/types/reactTabulous/reactTabulous/index.d.ts +1 -0
- package/lib/types/reactTabulous/reactTabulous/reactTabulous.d.ts +5 -0
- package/lib/types/reactTabulous/reactTabulous/reactTabulousStyle.d.ts +5 -0
- package/lib/types/setupTests.d.ts +1 -0
- package/package.json +107 -75
- package/CHANGELOG.md +0 -27
- package/lib/react-tabulous.min.js +0 -2
- package/lib/react-tabulous.min.js.LICENSE.txt +0 -20
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CustomInputProps {
|
|
3
|
+
label?: string;
|
|
4
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, value: string) => void;
|
|
5
|
+
startAdornment?: React.ReactNode;
|
|
6
|
+
endAdornment?: React.ReactNode;
|
|
7
|
+
labelClass?: string;
|
|
8
|
+
inputClass?: string;
|
|
9
|
+
startAdornmentClass?: string;
|
|
10
|
+
endAdornmentClass?: string;
|
|
11
|
+
helperTextClass?: string;
|
|
12
|
+
helperText?: string;
|
|
13
|
+
infoText?: string;
|
|
14
|
+
error?: boolean;
|
|
15
|
+
inline?: boolean;
|
|
16
|
+
isMultiLine?: boolean;
|
|
17
|
+
isSanitizeValue?: boolean;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
}
|
|
20
|
+
type InputProps = ((React.InputHTMLAttributes<HTMLInputElement> & {
|
|
21
|
+
as?: 'input';
|
|
22
|
+
}) | (React.TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
23
|
+
as?: 'textarea';
|
|
24
|
+
})) & CustomInputProps;
|
|
25
|
+
export declare const Input: React.FC<InputProps>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const InputStyle: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type variantsMapping } from '../typography';
|
|
3
|
+
declare const InputLabel: React.FC<{
|
|
4
|
+
label?: string;
|
|
5
|
+
htmlFor?: string;
|
|
6
|
+
infoText?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
labelClass?: string;
|
|
9
|
+
inline?: boolean;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
variant?: keyof typeof variantsMapping;
|
|
12
|
+
}>;
|
|
13
|
+
export default InputLabel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Loader: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type Icons } from './icon';
|
|
3
|
+
export declare const Menu: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any> | undefined;
|
|
6
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
7
|
+
type MenuItemProps = React.HTMLAttributes<HTMLLIElement> & {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
icon?: Icons;
|
|
10
|
+
iconClass?: string;
|
|
11
|
+
label: string;
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const MenuItem: React.FC<MenuItemProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FC, type ReactNode } from 'react';
|
|
2
|
+
import { type Placement } from '@popperjs/core';
|
|
3
|
+
type PopupProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
trigger: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
placement?: Placement;
|
|
8
|
+
noPadding?: boolean;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const Popup: FC<PopupProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type optionType = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
} | string | number;
|
|
6
|
+
interface SelectProps extends React.HTMLAttributes<HTMLSelectElement> {
|
|
7
|
+
options: optionType[];
|
|
8
|
+
value: string;
|
|
9
|
+
onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const Select: React.FC<SelectProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SelectStyle: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, {}>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const variantsMapping: {
|
|
3
|
+
h1: string;
|
|
4
|
+
h2: string;
|
|
5
|
+
h3: string;
|
|
6
|
+
h4: string;
|
|
7
|
+
h5: string;
|
|
8
|
+
h6: string;
|
|
9
|
+
subheading1: string;
|
|
10
|
+
subheading2: string;
|
|
11
|
+
subheading3: string;
|
|
12
|
+
subheading4: string;
|
|
13
|
+
bodyMedium: string;
|
|
14
|
+
bodySmall: string;
|
|
15
|
+
tooltip: string;
|
|
16
|
+
};
|
|
17
|
+
interface TypographyProps {
|
|
18
|
+
element?: keyof JSX.IntrinsicElements;
|
|
19
|
+
variant?: keyof typeof variantsMapping;
|
|
20
|
+
className?: string;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
align?: 'left' | 'center' | 'right';
|
|
23
|
+
htmlFor?: string;
|
|
24
|
+
color?: 'primary' | 'error';
|
|
25
|
+
style?: React.CSSProperties;
|
|
26
|
+
}
|
|
27
|
+
export declare const Typography: React.FC<TypographyProps>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dataGridContextProvider';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import { type RenderOptions } from '@testing-library/react';
|
|
3
|
+
declare const customRender: (ui: ReactElement, options?: Omit<RenderOptions, 'wrapper'>) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
4
|
+
export * from '@testing-library/react';
|
|
5
|
+
export { customRender };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const debounce: (callback: (searchString: string) => void, waitTime: number) => (...args: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toCamelCase(str: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type onDragUpdateType = (draggedField: string, dropTargetField: string) => void;
|
|
2
|
+
export declare const useDragHandler: (onDragUpdate: onDragUpdateType) => {
|
|
3
|
+
dropTargetField: string;
|
|
4
|
+
onDragStart: (e: any) => void;
|
|
5
|
+
onDragOver: (e: any) => any;
|
|
6
|
+
onDrop: (e: any) => void;
|
|
7
|
+
onDragEnter: (e: any) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGridColumn: () => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGridColumnHeaders: () => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGridDensity: () => any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type GridColDef } from '../models';
|
|
2
|
+
export declare const queryCondition: (columnValue: string, operator: string, value: string, type: string) => boolean;
|
|
3
|
+
export declare const getQueryValue: (rowObject: any, column: string, columnDef: GridColDef) => any;
|
|
4
|
+
export declare const filterData: (data: any, column: string, operator: string, value: string, type: string, columnDef: GridColDef) => any;
|
|
5
|
+
export declare const filterAllData: (filters: any, data: any, columns: GridColDef[]) => any;
|
|
6
|
+
export declare const useGridFilter: () => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGridPagination: () => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGridPin: () => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGridResize: () => any;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type DataGridPropsWithDefaultValues } from '../models';
|
|
2
|
+
export declare const DATA_GRID_PROPS_DEFAULT_VALUES: {
|
|
3
|
+
autoHeight: boolean;
|
|
4
|
+
density: string;
|
|
5
|
+
emptyPlaceholder: string;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
data: never[];
|
|
8
|
+
rootData: never[];
|
|
9
|
+
filteredAndSortedData: never[];
|
|
10
|
+
defaultPageSize: number;
|
|
11
|
+
pageSizeOptions: number[];
|
|
12
|
+
page: number;
|
|
13
|
+
hideFooter: boolean;
|
|
14
|
+
pagination: boolean;
|
|
15
|
+
hidePagination: boolean;
|
|
16
|
+
hideFooterRowCount: boolean;
|
|
17
|
+
sortField: string;
|
|
18
|
+
sortFieldType: string;
|
|
19
|
+
sortBy: string;
|
|
20
|
+
showColumnToolbar: boolean;
|
|
21
|
+
showFilterToolbar: boolean;
|
|
22
|
+
filters: never[];
|
|
23
|
+
searchText: string;
|
|
24
|
+
checkboxSelection: boolean;
|
|
25
|
+
selectedRows: never[];
|
|
26
|
+
paginatedSelectedRows: never[];
|
|
27
|
+
disableColumnFilter: boolean;
|
|
28
|
+
disableColumnMenu: boolean;
|
|
29
|
+
disableColumnPinning: boolean;
|
|
30
|
+
disableColumnReorder: boolean;
|
|
31
|
+
disableColumnResize: boolean;
|
|
32
|
+
disableColumnSelector: boolean;
|
|
33
|
+
disableDensitySelector: boolean;
|
|
34
|
+
disableMultipleColumnsSorting: boolean;
|
|
35
|
+
disableSearch: boolean;
|
|
36
|
+
disableColumnExport: boolean;
|
|
37
|
+
bulkActions: string[];
|
|
38
|
+
noRowsOverlay: import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
children: null;
|
|
40
|
+
onBulkActionClick: () => void;
|
|
41
|
+
fetchOnPageChange: null;
|
|
42
|
+
rowsCount: null;
|
|
43
|
+
customExport: null;
|
|
44
|
+
};
|
|
45
|
+
export declare const useGridRootProps: () => {
|
|
46
|
+
rootState: DataGridPropsWithDefaultValues;
|
|
47
|
+
updateState: any;
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGridRowSelection: () => any;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type GridColDef } from '../models';
|
|
2
|
+
export declare const getSearchObjValue: (row: any, searchKeys: string[], index: number, columnsWithValueGetter: any) => string;
|
|
3
|
+
export declare const searchObj: (row: any, searchText: string, searchKeys: string[], columnsWithValueGetter: any) => boolean;
|
|
4
|
+
export declare const getColumnsWithValueGetter: (columns: GridColDef[]) => any;
|
|
5
|
+
export declare const useGridSearch: () => any;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ColumnType, type GridSortDirection } from '../models';
|
|
2
|
+
export declare const getSortObjValue: (row: any, field: string, valueGetterOfField: any) => string;
|
|
3
|
+
export declare const sortRecords: (data: any, field: string, type: ColumnType, sortOrder: GridSortDirection, valueGetterOfField: any) => any;
|
|
4
|
+
export declare const useGridSort: () => any;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type ColumnType } from './columnType';
|
|
3
|
+
import { type GridValidRowModel } from '../gridRows';
|
|
4
|
+
import { type GridPinnedPosition } from './columnPin';
|
|
5
|
+
import { type GridActionsCellItemProps } from '../../components/cell/gridActionsCellItem';
|
|
6
|
+
export interface GridBaseColDef<R extends GridValidRowModel = GridValidRowModel, V = any, F = V> {
|
|
7
|
+
/**
|
|
8
|
+
* The column identifier. It's used to map with [[GridRowModel]] values.
|
|
9
|
+
*/
|
|
10
|
+
field: string;
|
|
11
|
+
/**
|
|
12
|
+
* The title of the column rendered in the column header cell.
|
|
13
|
+
*/
|
|
14
|
+
headerName: string;
|
|
15
|
+
/**
|
|
16
|
+
* Get the values to be displayed in the table cell.
|
|
17
|
+
*/
|
|
18
|
+
valueGetter?: (row: any, index?: number) => string | number;
|
|
19
|
+
/**
|
|
20
|
+
* The cell which has JSX will be displayed.
|
|
21
|
+
*/
|
|
22
|
+
renderCell?: HTMLElement | JSX.Element | Element | ((row: any, index: number) => JSX.Element);
|
|
23
|
+
/**
|
|
24
|
+
* The description of the column rendered as tooltip if the column header name is not fully displayed.
|
|
25
|
+
*/
|
|
26
|
+
description?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The column is visible or not.
|
|
29
|
+
*/
|
|
30
|
+
isVisible?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Type allows to merge this object with a default definition [[GridColDef]].
|
|
33
|
+
* @default 'string'
|
|
34
|
+
*/
|
|
35
|
+
type?: ColumnType;
|
|
36
|
+
/**
|
|
37
|
+
* Allows column to pin.
|
|
38
|
+
* @default null
|
|
39
|
+
*/
|
|
40
|
+
pinned?: GridPinnedPosition | null;
|
|
41
|
+
/**
|
|
42
|
+
* Allows column to set width.
|
|
43
|
+
* @default 'max-content'
|
|
44
|
+
*/
|
|
45
|
+
width?: number | string;
|
|
46
|
+
/**
|
|
47
|
+
* The column to search or not.
|
|
48
|
+
*/
|
|
49
|
+
isSearchable?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The column to sortable or not.
|
|
52
|
+
*/
|
|
53
|
+
isSortable?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* The column to sortable or not.
|
|
56
|
+
*/
|
|
57
|
+
isFilterable?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface GridActionsColDef<R extends GridValidRowModel = any, V = any, F = V> extends GridBaseColDef<R, V, F> {
|
|
60
|
+
/**
|
|
61
|
+
* Type allows to merge this object with a default definition [[GridColDef]].
|
|
62
|
+
* @default 'actions'
|
|
63
|
+
*/
|
|
64
|
+
type: 'actions';
|
|
65
|
+
/**
|
|
66
|
+
* Function that returns the actions to be shown.
|
|
67
|
+
* @param {GridRowParams} params The params for each row.
|
|
68
|
+
* @returns {React.ReactElement<GridActionsCellItemProps>[]} An array of [[GridActionsCell]] elements.
|
|
69
|
+
*/
|
|
70
|
+
getActions: () => Array<React.ReactElement<GridActionsCellItemProps>>;
|
|
71
|
+
}
|
|
72
|
+
export type GridColDef<R extends GridValidRowModel = any, V = any, F = V> = GridBaseColDef<R, V, F> | GridActionsColDef<R, V, F>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface GridPinnedColumns {
|
|
2
|
+
left?: string[];
|
|
3
|
+
right?: string[];
|
|
4
|
+
}
|
|
5
|
+
export type GridColumnPinningState = GridPinnedColumns;
|
|
6
|
+
declare enum GridPinnedPosition {
|
|
7
|
+
left = "left",
|
|
8
|
+
right = "right"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The column pinning API interface that is available in the grid [[apiRef]].
|
|
12
|
+
*/
|
|
13
|
+
export interface GridColumnPinningApi {
|
|
14
|
+
/**
|
|
15
|
+
* Pins a column to the left or right side of the grid.
|
|
16
|
+
* @param {string} field The column field to pin.
|
|
17
|
+
* @param {GridPinnedPosition} side Which side to pin the column.
|
|
18
|
+
*/
|
|
19
|
+
pinColumn: (field: string, side: GridPinnedPosition) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Unpins a column.
|
|
22
|
+
* @param {string} field The column field to unpin.
|
|
23
|
+
*/
|
|
24
|
+
unpinColumn: (field: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Returns which columns are pinned.
|
|
27
|
+
* @returns {GridPinnedColumns} An object containing the pinned columns.
|
|
28
|
+
*/
|
|
29
|
+
getPinnedColumns: () => GridPinnedColumns;
|
|
30
|
+
/**
|
|
31
|
+
* Changes the pinned columns.
|
|
32
|
+
* @param {GridPinnedColumns} pinnedColumns An object containing the columns to pin.
|
|
33
|
+
*/
|
|
34
|
+
setPinnedColumns: (pinnedColumns: GridPinnedColumns) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Returns which side a column is pinned to.
|
|
37
|
+
* @param {string} field The column field to check.
|
|
38
|
+
* @returns {string | false} Which side the column is pinned or `false` if not pinned.
|
|
39
|
+
*/
|
|
40
|
+
isColumnPinned: (field: string) => GridPinnedPosition | false;
|
|
41
|
+
}
|
|
42
|
+
export interface GridColumnPinningInternalCache {
|
|
43
|
+
/**
|
|
44
|
+
* Stores the fields in their original position, before being pinned.
|
|
45
|
+
*/
|
|
46
|
+
orderedFieldsBeforePinningColumns: string[] | null;
|
|
47
|
+
}
|
|
48
|
+
export { GridPinnedPosition };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type GridSortDirection = 'asc' | 'desc' | null | undefined;
|