mig-schema-table 4.0.6 → 4.0.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.
|
@@ -15989,7 +15989,7 @@ const UT = ({
|
|
|
15989
15989
|
async (V) => {
|
|
15990
15990
|
if (V.preventDefault(), V.stopPropagation(), !lt)
|
|
15991
15991
|
return;
|
|
15992
|
-
const { renderDataToExcel: we } = await import("./index-
|
|
15992
|
+
const { renderDataToExcel: we } = await import("./index-DOpIjWth.js");
|
|
15993
15993
|
we(lt);
|
|
15994
15994
|
},
|
|
15995
15995
|
[lt]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as $t, l as Ve } from "./index-
|
|
1
|
+
import { c as $t, l as Ve } from "./index-D0LyByZk.js";
|
|
2
2
|
function Fe(ye) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + ye + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,172 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { default as default_2 } from 'react';
|
|
3
|
+
import { Dispatch } from 'react';
|
|
4
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
5
|
+
import { oas31 } from 'openapi3-ts';
|
|
6
|
+
import { SetStateAction } from 'react';
|
|
7
|
+
import { VariableSizeGrid } from 'react-window';
|
|
8
|
+
import { VariableSizeListProps } from 'react-window';
|
|
9
|
+
|
|
10
|
+
export declare const DEFAULT_DATE_FORMAT = "dd MMM yyyy";
|
|
11
|
+
|
|
12
|
+
export declare const DEFAULT_DATE_TIME_FORMAT = "dd MMM yyyy HH:mm";
|
|
13
|
+
|
|
14
|
+
declare enum EColumnFilterStatus {
|
|
15
|
+
UNAVAILABLE = "UNAVAILABLE",
|
|
16
|
+
AVAILABLE = "AVAILABLE",
|
|
17
|
+
ACTIVE = "ACTIVE"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare enum ENumberColumnFilterOperation {
|
|
21
|
+
"GT" = "GT",
|
|
22
|
+
"LT" = "LT",
|
|
23
|
+
"EQ" = "EQ"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare interface IColumnConfig<T> {
|
|
27
|
+
FilterMenu?: default_2.ComponentType<IFilterMenuComponentProps>;
|
|
28
|
+
align?: "start" | "center" | "end";
|
|
29
|
+
dateFormat?: string;
|
|
30
|
+
defaultSortDesc?: boolean;
|
|
31
|
+
filter?: (rowData: T, columnFilterValue: TColumnFilterValue) => boolean;
|
|
32
|
+
hidden?: boolean;
|
|
33
|
+
hoverTitle?: string;
|
|
34
|
+
isFilterable?: boolean;
|
|
35
|
+
order?: number;
|
|
36
|
+
TdBody?: default_2.ComponentType<ITdBodyProps<T>>;
|
|
37
|
+
renderData?: (rowData: T, dataIndex: number) => string;
|
|
38
|
+
showTimezones?: false;
|
|
39
|
+
sort?: (a: T, b: T, sortAsc: boolean) => number;
|
|
40
|
+
sortByValue?: boolean;
|
|
41
|
+
isSortable?: boolean;
|
|
42
|
+
title?: string | default_2.ReactElement;
|
|
43
|
+
width?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare interface IColumnFilterMap {
|
|
47
|
+
[propName: string]: TColumnFilterValue;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare interface IDateColumnFilterValue {
|
|
51
|
+
from?: Date;
|
|
52
|
+
to?: Date;
|
|
53
|
+
filterEmpty?: true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare interface IFilterMenuComponentProps {
|
|
57
|
+
columnFilterValue: TColumnFilterValue;
|
|
58
|
+
onChange: (newValue: TColumnFilterValue | undefined, persistState?: boolean) => void;
|
|
59
|
+
onInputKeyDown: (e: default_2.KeyboardEvent<HTMLElement>) => void;
|
|
60
|
+
propIsRequired: boolean;
|
|
61
|
+
propName: string;
|
|
62
|
+
propSchema?: oas31.SchemaObject;
|
|
63
|
+
translate: (key: string, ...args: Array<string | number>) => string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare interface IGetDataProps {
|
|
67
|
+
searchQuery: string;
|
|
68
|
+
columnFilterMap: {
|
|
69
|
+
[propName: string]: TColumnFilterValue;
|
|
70
|
+
};
|
|
71
|
+
sortColumn?: string;
|
|
72
|
+
sortAsc: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare interface INumberColumnFilterValue {
|
|
76
|
+
[ENumberColumnFilterOperation.GT]: number;
|
|
77
|
+
[ENumberColumnFilterOperation.LT]: number;
|
|
78
|
+
[ENumberColumnFilterOperation.EQ]: number;
|
|
79
|
+
filterEmpty?: true;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare interface IRenderData {
|
|
83
|
+
_index: number;
|
|
84
|
+
[key: string]: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare interface ISchemaTableProps<T> {
|
|
88
|
+
Heading?: default_2.FC<VariableSizeListProps & {
|
|
89
|
+
setSortAsc: Dispatch<SetStateAction<boolean>>;
|
|
90
|
+
setSortColumn: Dispatch<SetStateAction<string>>;
|
|
91
|
+
sortAsc: boolean;
|
|
92
|
+
sortColumn: string;
|
|
93
|
+
sortedRenderData?: IRenderData[];
|
|
94
|
+
}>;
|
|
95
|
+
checkedIndexes?: number[];
|
|
96
|
+
config?: {
|
|
97
|
+
[propName: string]: IColumnConfig<T>;
|
|
98
|
+
};
|
|
99
|
+
customElement?: default_2.ReactNode;
|
|
100
|
+
data: T[] | ((getDataProps: IGetDataProps) => Promise<T[]>);
|
|
101
|
+
defaultColumnFilters?: IColumnFilterMap;
|
|
102
|
+
defaultSortAsc?: boolean;
|
|
103
|
+
defaultSortColumn?: keyof T;
|
|
104
|
+
disabledCheckedIndexes?: number[];
|
|
105
|
+
enableAutoFocus?: boolean;
|
|
106
|
+
enableRowCounter?: boolean;
|
|
107
|
+
getRowClassName?: (rowData: T, dataIndex: number, filteredSortedData: IRenderData[]) => string;
|
|
108
|
+
getRowSelected?: (rowData: T, dataIndex: number) => boolean;
|
|
109
|
+
isColumnFilterable?: boolean;
|
|
110
|
+
isExportable?: boolean;
|
|
111
|
+
isResizable?: boolean;
|
|
112
|
+
isSearchable?: boolean;
|
|
113
|
+
isSortable?: boolean;
|
|
114
|
+
maxHeight?: number;
|
|
115
|
+
onCheckedIndexesChange?: (dataIndex: number[]) => void;
|
|
116
|
+
onRowClick?: (rowData: T, dataIndex: number, event: default_2.MouseEvent) => void;
|
|
117
|
+
onRowDoubleClick?: (rowData: T, dataIndex: number, event: default_2.MouseEvent) => void;
|
|
118
|
+
onSearchEnter?: (searchQuery: string) => void;
|
|
119
|
+
rowHeight?: number;
|
|
120
|
+
schema: oas31.SchemaObject;
|
|
121
|
+
searchPlaceholder?: string;
|
|
122
|
+
settingsStorageKey?: string;
|
|
123
|
+
style?: default_2.CSSProperties;
|
|
124
|
+
translate?: (key: string, ...args: Array<string | number>) => string;
|
|
125
|
+
useFilterStateHash?: boolean;
|
|
126
|
+
width: number;
|
|
127
|
+
tableRef?: default_2.RefObject<VariableSizeGrid>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare interface ITdBodyProps<T = object> {
|
|
131
|
+
rowData: T;
|
|
132
|
+
dataIndex: number;
|
|
133
|
+
rowIndex: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
declare interface IThMenuConfig<T> {
|
|
137
|
+
referenceElement: HTMLElement;
|
|
138
|
+
propName: string;
|
|
139
|
+
propConfig?: IColumnConfig<T>;
|
|
140
|
+
propIsRequired: boolean;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
declare interface IThProps<T> {
|
|
144
|
+
columnFilterStatus: EColumnFilterStatus;
|
|
145
|
+
isAllChecked?: boolean;
|
|
146
|
+
isSortable: boolean;
|
|
147
|
+
numberOfSelectedRows?: number;
|
|
148
|
+
onColumnPositionChange?: (sourceColumnName: string, destinationColumnName: string) => void;
|
|
149
|
+
onSelectAllIndexesHandler?: (e: default_2.ChangeEvent<HTMLInputElement>) => void;
|
|
150
|
+
propConfig?: IColumnConfig<T>;
|
|
151
|
+
propIsRequired: boolean;
|
|
152
|
+
propName: string;
|
|
153
|
+
schema?: oas31.SchemaObject;
|
|
154
|
+
setMenuConfig: Dispatch<SetStateAction<IThMenuConfig<T> | undefined>>;
|
|
155
|
+
setSortAsc: Dispatch<SetStateAction<boolean>>;
|
|
156
|
+
setSortColumn: Dispatch<SetStateAction<string>>;
|
|
157
|
+
sortAsc?: boolean;
|
|
158
|
+
style: CSSProperties;
|
|
159
|
+
translate: (key: string, ...args: Array<string | number>) => string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export declare const MINIMUM_COLUMN_WIDTH = 25;
|
|
163
|
+
|
|
164
|
+
export declare const RESIZER_WIDTH = 3;
|
|
165
|
+
|
|
166
|
+
export declare const SchemaTable: <T>({ Heading, checkedIndexes, config, customElement, data, defaultColumnFilters, defaultSortAsc, defaultSortColumn, disabledCheckedIndexes, enableAutoFocus, enableRowCounter, getRowClassName, getRowSelected, isColumnFilterable, isExportable, isResizable, isSearchable, isSortable, maxHeight, onCheckedIndexesChange, onRowClick, onRowDoubleClick, onSearchEnter, rowHeight, schema, searchPlaceholder, settingsStorageKey, style, translate, useFilterStateHash, width, tableRef, }: ISchemaTableProps<T>) => JSX_2.Element;
|
|
167
|
+
|
|
168
|
+
declare type TColumnFilterValue = string | boolean | number | IDateColumnFilterValue | INumberColumnFilterValue;
|
|
169
|
+
|
|
170
|
+
export declare const Th: <T>({ columnFilterStatus, isAllChecked, isSortable, numberOfSelectedRows, onColumnPositionChange, onSelectAllIndexesHandler, propConfig, propIsRequired, propName, schema, setMenuConfig, setSortAsc, setSortColumn, sortAsc, style, translate, }: IThProps<T>) => JSX_2.Element;
|
|
171
|
+
|
|
172
|
+
export { }
|