master-components-react-ts 2.2.6 → 2.2.8
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/assets/Icons/IconColumnConfig.d.ts +1 -0
- package/dist/assets/Icons/IconDragandDrop.d.ts +1 -0
- package/dist/assets/Icons/IconFilterLines.d.ts +1 -0
- package/dist/components/FilterWithTags/FilterWithTags.d.ts +2 -1
- package/dist/components/FilterWithTags/FilterWithTags.types.d.ts +10 -0
- package/dist/components/MainButton/MainButton.types.d.ts +1 -1
- package/dist/components/Popup/Popup.d.ts +2 -2
- package/dist/components/Popup/Popup.types.d.ts +1 -6
- package/dist/components/Table/RowsPerPageDropdown.d.ts +7 -0
- package/dist/components/Table/Table.d.ts +2 -0
- package/dist/components/Table/Table.types.d.ts +39 -0
- package/dist/components/Table/mockDevExpressApi.d.ts +34 -0
- package/dist/components/Table/useColumnResizer.d.ts +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2289 -1694
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IconColumnConfig: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IconDragandDrop: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IconFilterLines: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { FilterWithTagsProps } from './FilterWithTags.types';
|
|
2
|
+
declare const FilterWithTags: ({ filterOptions, customOpenPopup, withSearch, onSearchChange, mainButtonProps, popupProps }: FilterWithTagsProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
3
|
export default FilterWithTags;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps } from '../MainButton/MainButton.types';
|
|
2
|
+
import { PopupProps } from '../Popup/Popup.types';
|
|
3
|
+
export interface FilterWithTagsProps {
|
|
4
|
+
filterOptions: any[];
|
|
5
|
+
customOpenPopup?: boolean;
|
|
6
|
+
withSearch?: boolean;
|
|
7
|
+
onSearchChange?: (value: string) => void;
|
|
8
|
+
mainButtonProps?: ButtonProps;
|
|
9
|
+
popupProps?: PopupProps;
|
|
10
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PopupProps } from './Popup.types';
|
|
2
2
|
declare const Popup: {
|
|
3
|
-
({ visible, template,
|
|
4
|
-
propKeys: readonly ["visible", "template", "
|
|
3
|
+
({ visible, template, mode, children, onClickOutside, onClose, widthType, modalOverlayStyle, popupContainerStyle, templateWrapperStyle, popupHeaderStyle, popupTitleStyle, closeButtonStyle, }: PopupProps): false | import("react/jsx-runtime").JSX.Element | undefined;
|
|
4
|
+
propKeys: readonly ["visible", "template", "mode", "children", "onClickOutside", "onClose", "widthType", "modalOverlayStyle", "popupContainerStyle", "templateWrapperStyle", "popupHeaderStyle", "popupTitleStyle", "closeButtonStyle"];
|
|
5
5
|
displayName: string;
|
|
6
6
|
description: string;
|
|
7
7
|
};
|
|
@@ -3,12 +3,7 @@ import { CSSProperties } from 'react';
|
|
|
3
3
|
export interface PopupProps {
|
|
4
4
|
visible?: boolean;
|
|
5
5
|
template?: React.ReactNode;
|
|
6
|
-
|
|
7
|
-
title: string;
|
|
8
|
-
description: string;
|
|
9
|
-
type: 'success' | 'error' | 'unsaved' | 'info';
|
|
10
|
-
mode: 'drawer' | 'modal';
|
|
11
|
-
};
|
|
6
|
+
mode?: 'drawer' | 'modal';
|
|
12
7
|
children?: React.ReactNode;
|
|
13
8
|
onClickOutside?: () => void;
|
|
14
9
|
onClose?: () => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface RowsPerPageDropdownProps {
|
|
2
|
+
currentValue: number;
|
|
3
|
+
options: number[];
|
|
4
|
+
onChange: (value: number) => void;
|
|
5
|
+
}
|
|
6
|
+
export default function RowsPerPageDropdown({ currentValue, options, onChange }: RowsPerPageDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { TableProps } from './Table.types';
|
|
2
|
+
export default function Table({ columns, data, onRowClick, onHeaderClick, sort, selectedRows, onSelectionChange, withSelectAll, actionButtonText, actionButtonIcon, onActionButtonClick, actionButtons, withColumnConfiguration, headerSlot, onColumnOrderChange, onColumnVisibilityChange, currentPage, totalPages, onPageChange, showPagination, rowsPerPage, rowsPerPageOptions, onRowsPerPageChange, totalItems, startItem, endItem, onRowEdit, onRowDelete, rowActions, }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type ColumnType = {
|
|
2
|
+
key?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
render?: (row: any) => React.ReactNode;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
/**Table Component Props */
|
|
9
|
+
export interface TableProps {
|
|
10
|
+
columns?: ColumnType[];
|
|
11
|
+
data?: any[];
|
|
12
|
+
onRowClick?: (row: any, rowIndex: number) => void;
|
|
13
|
+
onHeaderClick?: (key: string | number) => void;
|
|
14
|
+
sort?: any[];
|
|
15
|
+
selectedRows?: any[];
|
|
16
|
+
onSelectionChange?: (selectedRows: any[]) => void;
|
|
17
|
+
withSelectAll?: boolean;
|
|
18
|
+
actionButtonText?: string;
|
|
19
|
+
actionButtonIcon?: React.ReactNode;
|
|
20
|
+
onActionButtonClick?: (row: any) => void;
|
|
21
|
+
actionButtons?: any[];
|
|
22
|
+
withColumnConfiguration?: boolean;
|
|
23
|
+
headerSlot?: React.ReactNode;
|
|
24
|
+
onColumnOrderChange?: (newColumns: ColumnType[]) => void;
|
|
25
|
+
onColumnVisibilityChange?: (newColumns: ColumnType[]) => void;
|
|
26
|
+
currentPage?: number;
|
|
27
|
+
totalPages?: number;
|
|
28
|
+
onPageChange?: (page: number) => void;
|
|
29
|
+
showPagination?: boolean;
|
|
30
|
+
rowsPerPage?: number;
|
|
31
|
+
rowsPerPageOptions?: number[];
|
|
32
|
+
onRowsPerPageChange?: (rowsPerPage: number) => void;
|
|
33
|
+
totalItems?: number;
|
|
34
|
+
startItem?: number;
|
|
35
|
+
endItem?: number;
|
|
36
|
+
onRowEdit?: (row: any, rowIndex: number) => void;
|
|
37
|
+
onRowDelete?: (row: any, rowIndex: number) => void;
|
|
38
|
+
rowActions?: any[];
|
|
39
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type Department = "Engineering" | "HR" | "Marketing" | "Sales";
|
|
2
|
+
type Status = "active" | "inactive" | "pending";
|
|
3
|
+
type Role = "Admin" | "User" | "Manager" | "Guest";
|
|
4
|
+
export interface UserData {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
email: string;
|
|
8
|
+
department: Department;
|
|
9
|
+
status: Status;
|
|
10
|
+
role: Role;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SortConfig {
|
|
15
|
+
selector: keyof UserData;
|
|
16
|
+
desc: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface FilterConfig {
|
|
19
|
+
key: keyof UserData;
|
|
20
|
+
operator: "contains" | "equals" | "startsWith";
|
|
21
|
+
value: string;
|
|
22
|
+
}
|
|
23
|
+
export interface FetchDataParams {
|
|
24
|
+
skip?: number;
|
|
25
|
+
take?: number;
|
|
26
|
+
sort?: SortConfig[];
|
|
27
|
+
filter?: FilterConfig[];
|
|
28
|
+
}
|
|
29
|
+
export interface FetchDataResponse {
|
|
30
|
+
data: UserData[];
|
|
31
|
+
totalCount: number;
|
|
32
|
+
}
|
|
33
|
+
export declare function fetchDataDevExpressLike({ skip, take, sort, filter, }: FetchDataParams): Promise<FetchDataResponse>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColumnType } from './Table.types';
|
|
2
|
+
export declare const useColumnResizer: (columns: ColumnType[], initialColumnWidths?: {
|
|
3
|
+
[key: string]: number;
|
|
4
|
+
}) => {
|
|
5
|
+
columnWidths: {
|
|
6
|
+
[key: string]: number;
|
|
7
|
+
};
|
|
8
|
+
isResizing: boolean;
|
|
9
|
+
resizeColumn: string | null;
|
|
10
|
+
handleResizeStart: (e: MouseEvent, columnKey: string) => void;
|
|
11
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -17,3 +17,4 @@ export { default as InlineLoading } from './components/InlineLoading/InlineLoadi
|
|
|
17
17
|
export { default as Slider } from './components/Slider/Slider';
|
|
18
18
|
export { default as TreeNode } from './components/TreeNode/TreeNode';
|
|
19
19
|
export { default as FilterWithTags } from './components/FilterWithTags/FilterWithTags';
|
|
20
|
+
export { default as Table } from './components/Table/Table';
|