@lgsm/modules 1.6.20-beta.6 → 1.6.20-beta.7
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 +185 -140
- package/dist/main.d.ts +5 -21
- package/dist/main.js +8 -32340
- package/dist/setupBaseURL.d.ts +2 -0
- package/package.json +89 -100
- package/dist/assets/main.css +0 -1
- package/dist/components/ui/alert-dialog.d.ts +0 -14
- package/dist/components/ui/badge.d.ts +0 -9
- package/dist/components/ui/button.d.ts +0 -10
- package/dist/components/ui/calendar.d.ts +0 -8
- package/dist/components/ui/card.d.ts +0 -11
- package/dist/components/ui/checkbox.d.ts +0 -4
- package/dist/components/ui/command.d.ts +0 -18
- package/dist/components/ui/dialog.d.ts +0 -21
- package/dist/components/ui/dropdown-menu.d.ts +0 -27
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/label.d.ts +0 -4
- package/dist/components/ui/popover.d.ts +0 -7
- package/dist/components/ui/select.d.ts +0 -13
- package/dist/components/ui/separator.d.ts +0 -4
- package/dist/components/ui/skeleton.d.ts +0 -2
- package/dist/components/ui/sonner.d.ts +0 -4
- package/dist/components/ui/switch.d.ts +0 -4
- package/dist/components/ui/table.d.ts +0 -10
- package/dist/components/ui/textarea.d.ts +0 -3
- package/dist/components/ui/tooltip.d.ts +0 -7
- package/dist/lib/utils.d.ts +0 -2
- package/dist/shared-function/jwtDecodeFunc.d.ts +0 -1
- package/dist/shared-function/loginRedirect.d.ts +0 -1
- package/dist/shared-service/apiService.d.ts +0 -8
- package/dist/shared-service/axiosInstance.d.ts +0 -5
- package/dist/shared-ui/Button/index.d.ts +0 -9
- package/dist/shared-ui/DataTable/components/customFilterControl.d.ts +0 -8
- package/dist/shared-ui/DataTable/components/dataTable.d.ts +0 -3
- package/dist/shared-ui/DataTable/components/dataTableBody.d.ts +0 -7
- package/dist/shared-ui/DataTable/components/dataTablePagination.d.ts +0 -2
- package/dist/shared-ui/DataTable/components/dataTableToolbar.d.ts +0 -2
- package/dist/shared-ui/DataTable/components/detailTableCard.d.ts +0 -2
- package/dist/shared-ui/DataTable/components/dropdownCell.d.ts +0 -13
- package/dist/shared-ui/DataTable/components/editableCell.d.ts +0 -2
- package/dist/shared-ui/DataTable/components/errorWrapper.d.ts +0 -2
- package/dist/shared-ui/DataTable/components/filterPanel.d.ts +0 -2
- package/dist/shared-ui/DataTable/components/memoRow.d.ts +0 -16
- package/dist/shared-ui/DataTable/components/multiSelectCell.d.ts +0 -11
- package/dist/shared-ui/DataTable/components/pageInput.d.ts +0 -2
- package/dist/shared-ui/DataTable/components/saveConfirmDialog.d.ts +0 -2
- package/dist/shared-ui/DataTable/components/serverTable.d.ts +0 -34
- package/dist/shared-ui/DataTable/components/sortableHeader.d.ts +0 -7
- package/dist/shared-ui/DataTable/components/uploadAssetImage.d.ts +0 -2
- package/dist/shared-ui/DataTable/hooks/hooks.d.ts +0 -79
- package/dist/shared-ui/DataTable/hooks/useColumnDefinitions.d.ts +0 -6
- package/dist/shared-ui/DataTable/hooks/useEditing.d.ts +0 -21
- package/dist/shared-ui/DataTable/hooks/useFilterPanel.d.ts +0 -13
- package/dist/shared-ui/DataTable/hooks/usePageInput.d.ts +0 -6
- package/dist/shared-ui/DataTable/hooks/useRowIdentity.d.ts +0 -5
- package/dist/shared-ui/DataTable/hooks/useSelection.d.ts +0 -6
- package/dist/shared-ui/DataTable/hooks/useTableData.d.ts +0 -9
- package/dist/shared-ui/DataTable/hooks/useTableStatus.d.ts +0 -17
- package/dist/shared-ui/DataTable/index.d.ts +0 -25
- package/dist/shared-ui/DataTable/types/button.d.ts +0 -12
- package/dist/shared-ui/DataTable/types/column/actionColumn.d.ts +0 -4
- package/dist/shared-ui/DataTable/types/column/baseColumn.d.ts +0 -7
- package/dist/shared-ui/DataTable/types/column/columnConfig.d.ts +0 -13
- package/dist/shared-ui/DataTable/types/column/columnDefinitions.d.ts +0 -35
- package/dist/shared-ui/DataTable/types/column/columnLayout.d.ts +0 -5
- package/dist/shared-ui/DataTable/types/column/columnType.d.ts +0 -1
- package/dist/shared-ui/DataTable/types/column/editableCell.d.ts +0 -4
- package/dist/shared-ui/DataTable/types/column/editableColumn.d.ts +0 -5
- package/dist/shared-ui/DataTable/types/column/optionColumn.d.ts +0 -9
- package/dist/shared-ui/DataTable/types/column/renderColumn.d.ts +0 -6
- package/dist/shared-ui/DataTable/types/column/treeColumn.d.ts +0 -3
- package/dist/shared-ui/DataTable/types/column/validateColumn.d.ts +0 -4
- package/dist/shared-ui/DataTable/types/column/visibilityColumn.d.ts +0 -6
- package/dist/shared-ui/DataTable/types/filtering.d.ts +0 -43
- package/dist/shared-ui/DataTable/types/hooks/useEditingProps.d.ts +0 -8
- package/dist/shared-ui/DataTable/types/hooks/useFilterPanel.d.ts +0 -7
- package/dist/shared-ui/DataTable/types/pagination.d.ts +0 -5
- package/dist/shared-ui/DataTable/types/sorting.d.ts +0 -5
- package/dist/shared-ui/DataTable/types/table/baseDataTable.d.ts +0 -5
- package/dist/shared-ui/DataTable/types/table/crudOptions.d.ts +0 -12
- package/dist/shared-ui/DataTable/types/table/dataTable.d.ts +0 -46
- package/dist/shared-ui/DataTable/types/table/dataTableBodyProps.d.ts +0 -23
- package/dist/shared-ui/DataTable/types/table/dataTablePaginationProps.d.ts +0 -13
- package/dist/shared-ui/DataTable/types/table/dataTableToolbarProps.d.ts +0 -46
- package/dist/shared-ui/DataTable/types/table/errorWrapper.d.ts +0 -4
- package/dist/shared-ui/DataTable/types/table/importExportOptions.d.ts +0 -12
- package/dist/shared-ui/DataTable/types/table/saveConfirmDialog.d.ts +0 -11
- package/dist/shared-ui/DataTable/types/table/serverSideConfig.d.ts +0 -38
- package/dist/shared-ui/DataTable/types/table/statusConfig.d.ts +0 -15
- package/dist/shared-ui/DataTable/types/table/tableMeta.d.ts +0 -3
- package/dist/shared-ui/DataTable/types/table/tablePermissions.d.ts +0 -6
- package/dist/shared-ui/DataTable/types/table/treeOptions.d.ts +0 -7
- package/dist/shared-ui/DataTable/types/table-panel/detailTableCard.d.ts +0 -12
- package/dist/shared-ui/DataTable/utils/column.d.ts +0 -11
- package/dist/shared-ui/DataTable/utils/compare.d.ts +0 -2
- package/dist/shared-ui/DataTable/utils/filter.d.ts +0 -2
- package/dist/shared-ui/DataTable/utils/image.d.ts +0 -4
- package/dist/shared-ui/DataTable/utils/index.d.ts +0 -6
- package/dist/shared-ui/DataTable/utils/row.d.ts +0 -2
- package/dist/shared-ui/DataTable/utils/search.d.ts +0 -4
- package/dist/shared-ui/DataTable/utils/status.d.ts +0 -18
- package/dist/shared-ui/DataTable/utils/tree.d.ts +0 -3
- package/dist/shared-ui/Dropdown/index.d.ts +0 -16
- package/dist/shared-ui/Modal/index.d.ts +0 -12
- package/dist/shared-ui/MyCounter/index.d.ts +0 -8
- package/dist/shared-ui/MyTitle/index.d.ts +0 -6
- package/dist/shared-ui/Notification/NotificationContainer.d.ts +0 -1
- package/dist/shared-ui/Notification/index.d.ts +0 -9
- package/dist/shared-ui/Sonner/index.d.ts +0 -1
- package/dist/shared-ui/ThreeDotsLoader/index.d.ts +0 -1
- package/dist/shared-ui/sonnerHelper.d.ts +0 -3
- package/dist/shared-ui/ui/alert.d.ts +0 -8
- package/dist/shared-ui/ui/button.d.ts +0 -11
- package/dist/shared-ui/ui/sonner.d.ts +0 -4
- package/dist/usage-example/example-apiService.d.ts +0 -1
- package/dist/usage-example/example-components.d.ts +0 -1
- package/dist/utils/date.d.ts +0 -1
- package/dist/utils/excel.d.ts +0 -1
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export { DataTable } from './components/dataTable';
|
|
2
|
-
export { ServerTable } from './components/serverTable';
|
|
3
|
-
export { SortableHeader } from './components/sortableHeader';
|
|
4
|
-
export { DetailTableCard } from './components/detailTableCard';
|
|
5
|
-
export { EditableCell } from './components/editableCell';
|
|
6
|
-
export { DataTableToolbar } from './components/dataTableToolbar';
|
|
7
|
-
export { DataTablePagination } from './components/dataTablePagination';
|
|
8
|
-
export { DataTableBody, MemoizedTableBody } from './components/dataTableBody';
|
|
9
|
-
export { SaveConfirmDialog } from './components/saveConfirmDialog';
|
|
10
|
-
export { CustomFilterControl } from './components/customFilterControl';
|
|
11
|
-
export { exportToExcel } from '../../utils/excel';
|
|
12
|
-
export { useDataTableState } from './hooks/hooks';
|
|
13
|
-
export type { DataTable as DataTableProps } from './types/table/dataTable';
|
|
14
|
-
export type { ServerTableProps } from './components/serverTable';
|
|
15
|
-
export type { ServerSideConfig, ServerFetchParams, ServerTableConfig, } from './types/table/serverSideConfig';
|
|
16
|
-
export type { ColumnConfig } from './types/column/columnConfig';
|
|
17
|
-
export type { ColumnType } from './types/column/columnType';
|
|
18
|
-
export type { ButtonSet, TableButton } from './types/button';
|
|
19
|
-
export type { ImportOption } from './types/table/importExportOptions';
|
|
20
|
-
export type { StatusConfig } from './types/table/statusConfig';
|
|
21
|
-
export type { CustomFilter } from './types/filtering';
|
|
22
|
-
export type { SortField, SortDirection } from './types/sorting';
|
|
23
|
-
export type { TableMeta } from './types/table/tableMeta';
|
|
24
|
-
export type { CellContext, ColumnDef, PaginationState, SortingState, ExpandedState, Row, } from '@tanstack/react-table';
|
|
25
|
-
export type { TablePermissions } from './types/table/tablePermissions';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CellContext } from '@tanstack/react-table';
|
|
2
|
-
export interface ButtonSet {
|
|
3
|
-
value: boolean;
|
|
4
|
-
label?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface TableButton {
|
|
7
|
-
key: string;
|
|
8
|
-
label?: string;
|
|
9
|
-
action: (row?: any, ctx?: CellContext<any, any>) => void;
|
|
10
|
-
icons?: React.ReactNode | ((row: any) => React.ReactNode);
|
|
11
|
-
disabled?: boolean | ((row: any) => boolean);
|
|
12
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FilterableColumn } from '../filtering';
|
|
2
|
-
import { SortableColumn } from '../sorting';
|
|
3
|
-
import { ActionColumn } from './actionColumn';
|
|
4
|
-
import { BaseColumn } from './baseColumn';
|
|
5
|
-
import { ColumnLayout } from './columnLayout';
|
|
6
|
-
import { EditableColumn } from './editableColumn';
|
|
7
|
-
import { OptionColumn } from './optionColumn';
|
|
8
|
-
import { RenderColumn } from './renderColumn';
|
|
9
|
-
import { TreeColumn } from './treeColumn';
|
|
10
|
-
import { ValidateColumn } from './validateColumn';
|
|
11
|
-
import { VisibilityColumn } from './visibilityColumn';
|
|
12
|
-
export interface ColumnConfig extends BaseColumn, ColumnLayout, FilterableColumn, ActionColumn, TreeColumn, SortableColumn, OptionColumn, RenderColumn, ValidateColumn, EditableColumn, VisibilityColumn {
|
|
13
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { StatusConfig } from '../table/statusConfig';
|
|
2
|
-
import { ColumnConfig } from './columnConfig';
|
|
3
|
-
import { TablePermissions } from '../table/tablePermissions';
|
|
4
|
-
export interface UseColumnDefinitionsOptions {
|
|
5
|
-
permissions?: TablePermissions;
|
|
6
|
-
columnConfig: ColumnConfig[];
|
|
7
|
-
showStatusColumn: boolean;
|
|
8
|
-
statusKey: string;
|
|
9
|
-
enableExpand: boolean;
|
|
10
|
-
statusConfig?: StatusConfig;
|
|
11
|
-
editingRows: Set<string>;
|
|
12
|
-
newRowIds: Set<string>;
|
|
13
|
-
editedRows: Set<string>;
|
|
14
|
-
rowsToDisable: Set<string>;
|
|
15
|
-
rowsToEnable: Set<string>;
|
|
16
|
-
rowsToDelete: Set<string>;
|
|
17
|
-
selectedRows: Set<string>;
|
|
18
|
-
errors: Map<string, Map<string, string>>;
|
|
19
|
-
getRowId: (row: any) => string;
|
|
20
|
-
updateData: (rowId: string, columnId: string, value: any) => void;
|
|
21
|
-
setSelectedRows: React.Dispatch<React.SetStateAction<Set<string>>>;
|
|
22
|
-
cancelEdit: (id: string | Set<string>) => void;
|
|
23
|
-
cancelNewRow?: (id: string) => void;
|
|
24
|
-
cancelDeletion: (id: string) => void;
|
|
25
|
-
cancelHardDelete: (id: string) => void;
|
|
26
|
-
canPerformAction: (row: any, actionKey: string, statusConfig?: StatusConfig, permissions?: {
|
|
27
|
-
canCreate?: boolean;
|
|
28
|
-
canModify?: boolean;
|
|
29
|
-
canDelete?: boolean;
|
|
30
|
-
}) => boolean;
|
|
31
|
-
onImageUpload?: (row: any, file: File) => Promise<string>;
|
|
32
|
-
defaultMinWidth?: string;
|
|
33
|
-
nonSortableKeys?: string[];
|
|
34
|
-
onRowClick?: (row: any) => void;
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ColumnType = "text" | "number" | "dropdown" | "checkbox" | "textarea" | "index" | "button" | "status" | "multi-select" | "image" | "error" | "date" | "switch";
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { StatusConfig } from './table/statusConfig';
|
|
2
|
-
export interface FilterableColumn {
|
|
3
|
-
filterable?: boolean;
|
|
4
|
-
searchable?: boolean;
|
|
5
|
-
filterPlaceholder?: string;
|
|
6
|
-
}
|
|
7
|
-
export type CustomFilter = {
|
|
8
|
-
key: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
options: {
|
|
11
|
-
label: string;
|
|
12
|
-
value: string;
|
|
13
|
-
}[];
|
|
14
|
-
defaultValue?: string | string[];
|
|
15
|
-
isMulti?: boolean;
|
|
16
|
-
searchable?: boolean;
|
|
17
|
-
multiMatchMode?: "all" | "any";
|
|
18
|
-
};
|
|
19
|
-
export interface FilterField {
|
|
20
|
-
key: string;
|
|
21
|
-
label: string;
|
|
22
|
-
control: "text" | "dropdown";
|
|
23
|
-
placeholder?: string;
|
|
24
|
-
options?: {
|
|
25
|
-
label: string;
|
|
26
|
-
value: string;
|
|
27
|
-
}[];
|
|
28
|
-
}
|
|
29
|
-
export interface FilterPanelProps {
|
|
30
|
-
fields: FilterField[];
|
|
31
|
-
draft: Record<string, string>;
|
|
32
|
-
onChange: (key: string, value: string) => void;
|
|
33
|
-
onApply: () => void;
|
|
34
|
-
onReset: () => void;
|
|
35
|
-
}
|
|
36
|
-
export interface FilterRowsByStatusOptions {
|
|
37
|
-
statusFilter?: string;
|
|
38
|
-
statusConfig?: StatusConfig;
|
|
39
|
-
subRowsKey: string;
|
|
40
|
-
getRowId: (row: any) => string;
|
|
41
|
-
editedRows: Set<string>;
|
|
42
|
-
originalData: Map<string, any>;
|
|
43
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface UseEditingProps {
|
|
2
|
-
setTableData: React.Dispatch<React.SetStateAction<any[]>>;
|
|
3
|
-
originalData: Map<string, any>;
|
|
4
|
-
getRowId: (row: any) => string;
|
|
5
|
-
subRowsKey: string;
|
|
6
|
-
rowsToDisable: Set<string>;
|
|
7
|
-
setSelectedRows: React.Dispatch<React.SetStateAction<Set<string>>>;
|
|
8
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PaginationState } from '@tanstack/react-table';
|
|
2
|
-
import { ColumnConfig } from '../column/columnConfig';
|
|
3
|
-
export interface UseFilterPanelOptions {
|
|
4
|
-
columnConfig: ColumnConfig[];
|
|
5
|
-
setFilterValues: (values: Record<string, string>) => void;
|
|
6
|
-
setPagination: React.Dispatch<React.SetStateAction<PaginationState>>;
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface DataTableChanges {
|
|
2
|
-
added: any[];
|
|
3
|
-
updated: any[];
|
|
4
|
-
deleted: any[];
|
|
5
|
-
enabled: string[];
|
|
6
|
-
disabled: string[];
|
|
7
|
-
}
|
|
8
|
-
export interface CRUDOptions {
|
|
9
|
-
onSave?: (changes: DataTableChanges) => Promise<void> | void | Promise<boolean> | boolean;
|
|
10
|
-
hardDelete?: boolean;
|
|
11
|
-
isRowDeletable?: (row: any) => boolean;
|
|
12
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { StatusConfig } from './statusConfig';
|
|
2
|
-
import { BaseDataTable } from './baseDataTable';
|
|
3
|
-
import { CRUDOptions } from './crudOptions';
|
|
4
|
-
import { TreeOptions } from './treeOptions';
|
|
5
|
-
import { ImportExportOptions } from './importExportOptions';
|
|
6
|
-
import { ServerSideConfig } from './serverSideConfig';
|
|
7
|
-
import { ColumnDef } from '@tanstack/react-table';
|
|
8
|
-
import { TablePermissions } from './tablePermissions';
|
|
9
|
-
export interface DataTable<TData = any> extends Partial<BaseDataTable>, CRUDOptions, TreeOptions, ImportExportOptions {
|
|
10
|
-
data: TData[];
|
|
11
|
-
/** Access flags supplied by the consuming app. Omission makes the table read-only. */
|
|
12
|
-
permissions?: TablePermissions;
|
|
13
|
-
/** Raw TanStack ColumnDef[] to bypass ColumnConfig conversion */
|
|
14
|
-
columnDefs?: ColumnDef<TData>[];
|
|
15
|
-
/** Server-side pagination, sorting, and totalCount configuration */
|
|
16
|
-
serverSide?: ServerSideConfig;
|
|
17
|
-
/** Loading state flag (renders skeleton rows) */
|
|
18
|
-
loading?: boolean;
|
|
19
|
-
/** Custom header action buttons slot (e.g. Add Request, Export) rendered next to title */
|
|
20
|
-
headerActions?: React.ReactNode;
|
|
21
|
-
/** Custom filter components slot rendered above the table */
|
|
22
|
-
filters?: React.ReactNode;
|
|
23
|
-
title?: string;
|
|
24
|
-
getRowId?: (row: any) => string | undefined;
|
|
25
|
-
onRowClick?: (row: any) => void;
|
|
26
|
-
activeRowId?: string;
|
|
27
|
-
showStatusColumn?: boolean;
|
|
28
|
-
showPagination?: boolean;
|
|
29
|
-
showStatusFilter?: boolean;
|
|
30
|
-
nonSortableKeys?: string[];
|
|
31
|
-
searchPlaceholder?: string;
|
|
32
|
-
searchKeys?: string[];
|
|
33
|
-
searchPriorityKey?: string;
|
|
34
|
-
onImageUpload?: (row: any, file: File) => Promise<string>;
|
|
35
|
-
statusKey?: string;
|
|
36
|
-
statusConfig?: StatusConfig;
|
|
37
|
-
rowsPerPageOptions?: number[];
|
|
38
|
-
defaultRowsPerPage?: number;
|
|
39
|
-
defaultMinWidth?: string;
|
|
40
|
-
customFilters?: any[];
|
|
41
|
-
onAdd?: () => void;
|
|
42
|
-
filterSwitchKey?: string;
|
|
43
|
-
onSelectionChange?: (ids: string[]) => void;
|
|
44
|
-
onQueryChange?: (query: string) => void;
|
|
45
|
-
onDeleteMulti?: (selectedIds: string[]) => void;
|
|
46
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Table as TanStackTable } from '@tanstack/react-table';
|
|
2
|
-
import { ColumnConfig } from '../column/columnConfig';
|
|
3
|
-
import { TablePermissions } from './tablePermissions';
|
|
4
|
-
export interface DataTableBodyProps {
|
|
5
|
-
permissions?: TablePermissions;
|
|
6
|
-
table: TanStackTable<any>;
|
|
7
|
-
columnsCount: number;
|
|
8
|
-
columnConfig?: ColumnConfig[];
|
|
9
|
-
loading?: boolean;
|
|
10
|
-
newRowIds: Set<string>;
|
|
11
|
-
editingRows: Set<string>;
|
|
12
|
-
editedRows: Set<string>;
|
|
13
|
-
rowsToDisable: Set<string>;
|
|
14
|
-
rowsToEnable: Set<string>;
|
|
15
|
-
rowsToDelete: Set<string>;
|
|
16
|
-
selectedRows: Set<string>;
|
|
17
|
-
errors: Map<string, Map<string, string>>;
|
|
18
|
-
getRowId: (row: any) => string;
|
|
19
|
-
onRowClick?: (row: any) => void;
|
|
20
|
-
activeRowId?: string;
|
|
21
|
-
statusKey: string;
|
|
22
|
-
defaultMinWidth?: string;
|
|
23
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface DataTablePaginationProps {
|
|
2
|
-
pageIndex: number;
|
|
3
|
-
pageSize: number;
|
|
4
|
-
pageCount: number;
|
|
5
|
-
totalRows: number;
|
|
6
|
-
canPreviousPage: boolean;
|
|
7
|
-
canNextPage: boolean;
|
|
8
|
-
setPageSize: (size: number) => void;
|
|
9
|
-
previousPage: () => void;
|
|
10
|
-
nextPage: () => void;
|
|
11
|
-
setPageIndex: (index: number) => void;
|
|
12
|
-
rowsPerPageOptions?: number[];
|
|
13
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { StatusConfig } from './statusConfig';
|
|
2
|
-
import { ImportOption } from './importExportOptions';
|
|
3
|
-
export interface DataTableToolbarProps {
|
|
4
|
-
globalFilter: string;
|
|
5
|
-
setQuery: (q: string) => void;
|
|
6
|
-
searchPlaceholder: string;
|
|
7
|
-
hasFilters: boolean;
|
|
8
|
-
showFilterPanel: boolean;
|
|
9
|
-
setShowFilterPanel: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
|
-
showStatusFilter?: boolean;
|
|
11
|
-
setStatusFilter?: (v: string) => void;
|
|
12
|
-
switchKey?: string;
|
|
13
|
-
displayFilter?: "all" | "yes" | "no";
|
|
14
|
-
setDisplayFilter?: (v: "all" | "yes" | "no") => void;
|
|
15
|
-
setPagination?: React.Dispatch<React.SetStateAction<any>>;
|
|
16
|
-
customFilters?: any[];
|
|
17
|
-
activeFilters?: Record<string, any>;
|
|
18
|
-
setActiveFilters?: React.Dispatch<React.SetStateAction<Record<string, any>>>;
|
|
19
|
-
onResetFilters?: () => void;
|
|
20
|
-
hasActiveCustomFilters?: boolean;
|
|
21
|
-
exportAction?: (selectedIds?: any) => void;
|
|
22
|
-
enableExport?: boolean;
|
|
23
|
-
handleExport: () => void;
|
|
24
|
-
importAction?: (() => void) | ImportOption[];
|
|
25
|
-
importOptions?: ImportOption[];
|
|
26
|
-
canPerformGlobalAction: (actionKey: string, statusConfig?: StatusConfig) => boolean;
|
|
27
|
-
statusConfig?: StatusConfig;
|
|
28
|
-
statusFilter: string;
|
|
29
|
-
onAdd?: () => void;
|
|
30
|
-
addNewRow: () => void;
|
|
31
|
-
handleEdit?: (id: Set<string>) => void;
|
|
32
|
-
markDisabled: () => void;
|
|
33
|
-
markEnabled: () => void;
|
|
34
|
-
markDeleted: () => void;
|
|
35
|
-
onDeleteMulti?: (selectedIds: string[]) => void;
|
|
36
|
-
selectedRow: Set<string>;
|
|
37
|
-
selectedRowCount: number;
|
|
38
|
-
noneEligibleForDisable: boolean;
|
|
39
|
-
noneEligibleForEnable: boolean;
|
|
40
|
-
canDeleteSelection: boolean;
|
|
41
|
-
saving: boolean;
|
|
42
|
-
hasEditableRows?: boolean;
|
|
43
|
-
hasChanges: () => boolean;
|
|
44
|
-
hasValidationErrors: () => boolean;
|
|
45
|
-
setShowSaveDialog: (show: boolean) => void;
|
|
46
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface ImportOption {
|
|
2
|
-
label: string;
|
|
3
|
-
onClick: () => void;
|
|
4
|
-
icon?: React.ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export interface ImportExportOptions {
|
|
7
|
-
exportAction?: (selectedIds?: any) => void;
|
|
8
|
-
importAction?: (() => void) | ImportOption[];
|
|
9
|
-
importOptions?: ImportOption[];
|
|
10
|
-
enableExport?: boolean;
|
|
11
|
-
exportFileName?: string;
|
|
12
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface SaveConfirmDialogProps {
|
|
2
|
-
open: boolean;
|
|
3
|
-
onOpenChange: (open: boolean) => void;
|
|
4
|
-
onConfirm: () => void;
|
|
5
|
-
saving: boolean;
|
|
6
|
-
newRowCount: number;
|
|
7
|
-
editedRowCount: number;
|
|
8
|
-
disableCount: number;
|
|
9
|
-
enableCount: number;
|
|
10
|
-
deleteCount: number;
|
|
11
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface ServerFetchParams {
|
|
2
|
-
page: number;
|
|
3
|
-
size: number;
|
|
4
|
-
sortBy: string;
|
|
5
|
-
desc: boolean;
|
|
6
|
-
filter: Record<string, any>;
|
|
7
|
-
}
|
|
8
|
-
export interface ServerTableConfig {
|
|
9
|
-
fetchParams: ServerFetchParams;
|
|
10
|
-
onFetchParamsChange: (params: ServerFetchParams) => void;
|
|
11
|
-
totalCount: number;
|
|
12
|
-
loading?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface ServerSideConfig {
|
|
15
|
-
/** Total count of items matching filter from the backend API */
|
|
16
|
-
totalCount: number;
|
|
17
|
-
/** Whether the query is currently loading */
|
|
18
|
-
loading?: boolean;
|
|
19
|
-
/** Controlled 0-based page index */
|
|
20
|
-
pageIndex: number;
|
|
21
|
-
/** Controlled page size */
|
|
22
|
-
pageSize: number;
|
|
23
|
-
/** Handler when page index or size changes */
|
|
24
|
-
onPaginationChange: (pagination: {
|
|
25
|
-
pageIndex: number;
|
|
26
|
-
pageSize: number;
|
|
27
|
-
}) => void;
|
|
28
|
-
/** Controlled sorting state */
|
|
29
|
-
sorting?: {
|
|
30
|
-
id: string;
|
|
31
|
-
desc: boolean;
|
|
32
|
-
}[];
|
|
33
|
-
/** Handler when sorting changes */
|
|
34
|
-
onSortingChange?: (sorting: {
|
|
35
|
-
id: string;
|
|
36
|
-
desc: boolean;
|
|
37
|
-
}[]) => void;
|
|
38
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ButtonSet } from '../button';
|
|
2
|
-
export type StatusConfig<T extends string | boolean = string | boolean> = {
|
|
3
|
-
key: string;
|
|
4
|
-
mapping: Record<string, {
|
|
5
|
-
label: string;
|
|
6
|
-
value: T;
|
|
7
|
-
style?: string;
|
|
8
|
-
color?: string;
|
|
9
|
-
}>;
|
|
10
|
-
buttonRules: Record<string, Record<string, ButtonSet>>;
|
|
11
|
-
normalize?: (value: any) => string;
|
|
12
|
-
switchOnValue?: T;
|
|
13
|
-
switchOffValue?: T;
|
|
14
|
-
defaultStatus?: string;
|
|
15
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ColumnConfig } from '../column/columnConfig';
|
|
2
|
-
export interface DetailTableCardProps {
|
|
3
|
-
title: string;
|
|
4
|
-
highlight?: string;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
columns: ColumnConfig[];
|
|
7
|
-
data: any[];
|
|
8
|
-
loading?: boolean;
|
|
9
|
-
icon?: React.ReactNode;
|
|
10
|
-
closeLabel?: string;
|
|
11
|
-
searchPlaceholder?: string;
|
|
12
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ColumnConfig } from '../types/column/columnConfig';
|
|
2
|
-
export declare function getDropdownOption(value: any, options?: {
|
|
3
|
-
label: string;
|
|
4
|
-
value: string | number;
|
|
5
|
-
}[]): {
|
|
6
|
-
label: string;
|
|
7
|
-
value: string | number;
|
|
8
|
-
} | undefined;
|
|
9
|
-
export declare const getDefaultMinWidth: (type: ColumnConfig["type"], defaultWidth?: string) => string;
|
|
10
|
-
export declare const isColumnVisible: (col: ColumnConfig, isEditing: boolean, isAdding: boolean) => boolean;
|
|
11
|
-
export declare const isEmptyByType: (val: any, col: ColumnConfig) => boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { FilterFn } from '@tanstack/react-table';
|
|
2
|
-
import { ColumnConfig } from '../types/column/columnConfig';
|
|
3
|
-
export declare function getSearchPriority(value: unknown, query: string): number;
|
|
4
|
-
export declare function createGlobalFilter(columns: ColumnConfig[], searchKeys?: string[]): FilterFn<any>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { StatusConfig } from '../types/table/statusConfig';
|
|
2
|
-
export declare function normalizeRowStatus(row: any, statusConfig: StatusConfig): string;
|
|
3
|
-
export declare function getStatusOptions(statusConfig?: StatusConfig): [string, {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string | boolean;
|
|
6
|
-
style?: string;
|
|
7
|
-
color?: string;
|
|
8
|
-
}][];
|
|
9
|
-
export declare function canPerformAction(row: any, actionKey: string, statusConfig?: StatusConfig, permissions?: {
|
|
10
|
-
canCreate?: boolean;
|
|
11
|
-
canModify?: boolean;
|
|
12
|
-
canDelete?: boolean;
|
|
13
|
-
}): boolean;
|
|
14
|
-
export declare function canPerformGlobalAction(actionKey: string, statusFilter?: string, statusConfig?: StatusConfig, permissions?: {
|
|
15
|
-
canCreate?: boolean;
|
|
16
|
-
canModify?: boolean;
|
|
17
|
-
canDelete?: boolean;
|
|
18
|
-
}): boolean;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface DropdownProps {
|
|
2
|
-
open: boolean;
|
|
3
|
-
toggleOpen: () => void;
|
|
4
|
-
triggerIcon: string;
|
|
5
|
-
iconShape?: "circle";
|
|
6
|
-
flow: "vertical" | "horizontal";
|
|
7
|
-
button: "text" | "icon" | "smallerIcon";
|
|
8
|
-
menu?: MenuProps[];
|
|
9
|
-
}
|
|
10
|
-
interface MenuProps {
|
|
11
|
-
title: string;
|
|
12
|
-
action: () => void;
|
|
13
|
-
icon?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const Dropdown: React.FC<DropdownProps>;
|
|
16
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
interface ModalProps {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
title: ReactNode;
|
|
5
|
-
action?: () => void;
|
|
6
|
-
isDialogOpen: boolean;
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
isDisabled?: boolean;
|
|
9
|
-
buttonText: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const Modal: ({ children, title, action, isDialogOpen, onClose, buttonText }: ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
interface CounterProps extends React.ComponentProps<'button'> {
|
|
2
|
-
initialValue?: number;
|
|
3
|
-
step?: number;
|
|
4
|
-
min?: number;
|
|
5
|
-
max?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function MyCounter({ initialValue, step, min, max, }: CounterProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function NotificationContainer(): import("react/jsx-runtime").JSX.Element | null;
|