@etsoo/react 1.5.77 → 1.5.78
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/lib/app/CommonApp.d.ts +2 -2
- package/lib/app/Labels.d.ts +1 -1
- package/lib/app/ServiceApp.d.ts +2 -2
- package/lib/components/GridColumn.d.ts +10 -10
- package/lib/components/GridLoader.d.ts +7 -8
- package/lib/components/ScrollerGrid.d.ts +5 -6
- package/lib/components/ScrollerList.d.ts +2 -2
- package/lib/mu/AutocompleteExtendedProps.d.ts +8 -6
- package/lib/mu/ComboBox.d.ts +9 -7
- package/lib/mu/DataGridEx.d.ts +5 -5
- package/lib/mu/DataGridRenderers.d.ts +1 -1
- package/lib/mu/DnDList.d.ts +2 -2
- package/lib/mu/ListMoreDisplay.d.ts +2 -2
- package/lib/mu/MUGlobal.d.ts +5 -5
- package/lib/mu/OptionGroup.d.ts +15 -11
- package/lib/mu/ResponsibleContainer.d.ts +5 -5
- package/lib/mu/ScrollerListEx.d.ts +10 -9
- package/lib/mu/SearchOptionGroup.d.ts +1 -1
- package/lib/mu/SelectEx.d.ts +15 -11
- package/lib/mu/TableEx.d.ts +9 -7
- package/lib/mu/Tiplist.d.ts +3 -3
- package/lib/mu/Tiplist.js +1 -3
- package/lib/mu/pages/CommonPageProps.d.ts +1 -1
- package/lib/mu/pages/DataGridPage.d.ts +1 -1
- package/lib/mu/pages/DataGridPageProps.d.ts +2 -2
- package/lib/mu/pages/FixedListPage.d.ts +1 -1
- package/lib/mu/pages/ListPage.d.ts +1 -1
- package/lib/mu/pages/ListPageProps.d.ts +1 -2
- package/lib/mu/pages/ResponsivePage.d.ts +1 -1
- package/lib/mu/pages/ResponsivePageProps.d.ts +2 -2
- package/lib/mu/pages/SearchPageProps.d.ts +2 -2
- package/lib/mu/pages/TablePage.d.ts +1 -1
- package/lib/mu/pages/TablePageProps.d.ts +1 -2
- package/lib/mu/pages/ViewPage.d.ts +5 -4
- package/lib/states/IState.d.ts +1 -1
- package/lib/uses/useCombinedRefs.d.ts +1 -1
- package/package.json +9 -9
- package/src/app/CommonApp.ts +2 -2
- package/src/app/Labels.ts +1 -1
- package/src/app/ServiceApp.ts +2 -2
- package/src/components/GridColumn.ts +10 -11
- package/src/components/GridLoader.ts +7 -7
- package/src/components/ScrollerGrid.tsx +64 -60
- package/src/components/ScrollerList.tsx +2 -2
- package/src/mu/AutocompleteExtendedProps.ts +13 -12
- package/src/mu/ComboBox.tsx +12 -11
- package/src/mu/DataGridEx.tsx +12 -12
- package/src/mu/DataGridRenderers.tsx +1 -1
- package/src/mu/DnDList.tsx +2 -2
- package/src/mu/ListMoreDisplay.tsx +2 -2
- package/src/mu/MUGlobal.ts +5 -5
- package/src/mu/OptionGroup.tsx +18 -15
- package/src/mu/ResponsibleContainer.tsx +12 -17
- package/src/mu/ScrollerListEx.tsx +18 -17
- package/src/mu/SearchOptionGroup.tsx +1 -1
- package/src/mu/SelectEx.tsx +18 -17
- package/src/mu/TableEx.tsx +51 -50
- package/src/mu/Tiplist.tsx +9 -8
- package/src/mu/pages/CommonPageProps.ts +1 -1
- package/src/mu/pages/DataGridPage.tsx +14 -10
- package/src/mu/pages/DataGridPageProps.ts +16 -13
- package/src/mu/pages/FixedListPage.tsx +1 -1
- package/src/mu/pages/ListPage.tsx +1 -1
- package/src/mu/pages/ListPageProps.ts +4 -3
- package/src/mu/pages/ResponsivePage.tsx +5 -4
- package/src/mu/pages/ResponsivePageProps.ts +9 -6
- package/src/mu/pages/SearchPageProps.ts +5 -3
- package/src/mu/pages/TablePage.tsx +1 -1
- package/src/mu/pages/TablePageProps.ts +4 -3
- package/src/mu/pages/ViewPage.tsx +8 -6
- package/src/states/IState.ts +1 -1
- package/src/states/UserState.ts +1 -1
- package/src/uses/useCombinedRefs.ts +3 -3
package/lib/app/CommonApp.d.ts
CHANGED
|
@@ -28,12 +28,12 @@ export declare abstract class CommonApp<U extends IUser = IUser, P extends IPage
|
|
|
28
28
|
* Refresh token
|
|
29
29
|
* @param props Props
|
|
30
30
|
*/
|
|
31
|
-
refreshToken<D = RefreshTokenRQ>(props?: RefreshTokenProps<D>): Promise<boolean>;
|
|
31
|
+
refreshToken<D extends object = RefreshTokenRQ>(props?: RefreshTokenProps<D>): Promise<boolean>;
|
|
32
32
|
/**
|
|
33
33
|
* Try login
|
|
34
34
|
* @param data Additional data
|
|
35
35
|
* @param showLoading Show loading bar or not
|
|
36
36
|
* @returns Result
|
|
37
37
|
*/
|
|
38
|
-
tryLogin<D = RefreshTokenRQ>(data?: D, showLoading?: boolean): Promise<boolean>;
|
|
38
|
+
tryLogin<D extends object = RefreshTokenRQ>(data?: D, showLoading?: boolean): Promise<boolean>;
|
|
39
39
|
}
|
package/lib/app/Labels.d.ts
CHANGED
|
@@ -61,5 +61,5 @@ export declare namespace Labels {
|
|
|
61
61
|
* @param labels Labels
|
|
62
62
|
* @param reference Key reference
|
|
63
63
|
*/
|
|
64
|
-
const setLabels: (labels:
|
|
64
|
+
const setLabels: (labels: DataTypes.StringRecord, reference?: setLabelsReference) => void;
|
|
65
65
|
}
|
package/lib/app/ServiceApp.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, P extends
|
|
|
45
45
|
* Refresh token
|
|
46
46
|
* @param props Props
|
|
47
47
|
*/
|
|
48
|
-
refreshToken<D = RefreshTokenRQ>(props?: RefreshTokenProps<D>): Promise<boolean>;
|
|
48
|
+
refreshToken<D extends object = RefreshTokenRQ>(props?: RefreshTokenProps<D>): Promise<boolean>;
|
|
49
49
|
/**
|
|
50
50
|
* Service decrypt message
|
|
51
51
|
* @param messageEncrypted Encrypted message
|
|
@@ -67,7 +67,7 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, P extends
|
|
|
67
67
|
* @param showLoading Show loading bar or not
|
|
68
68
|
* @returns Result
|
|
69
69
|
*/
|
|
70
|
-
tryLogin<D extends
|
|
70
|
+
tryLogin<D extends object = {}>(data?: D, showLoading?: boolean): Promise<boolean>;
|
|
71
71
|
/**
|
|
72
72
|
* User login extended
|
|
73
73
|
* @param user Core system user
|
|
@@ -23,7 +23,7 @@ export declare type GridCellValueType = string | number | Date | boolean | undef
|
|
|
23
23
|
/**
|
|
24
24
|
* Grid cell formatter props
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export declare type GridCellFormatterProps<T> = {
|
|
27
27
|
/**
|
|
28
28
|
* Current data
|
|
29
29
|
*/
|
|
@@ -40,11 +40,11 @@ export interface GridCellFormatterProps<T> {
|
|
|
40
40
|
* Column index
|
|
41
41
|
*/
|
|
42
42
|
columnIndex: number;
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
44
|
/**
|
|
45
45
|
* Grid cell renderer props
|
|
46
46
|
*/
|
|
47
|
-
export
|
|
47
|
+
export declare type GridCellRendererProps<T, P = any> = GridCellFormatterProps<T> & {
|
|
48
48
|
/**
|
|
49
49
|
* Cell props
|
|
50
50
|
*/
|
|
@@ -65,11 +65,11 @@ export interface GridCellRendererProps<T, P = any> extends GridCellFormatterProp
|
|
|
65
65
|
* Render props
|
|
66
66
|
*/
|
|
67
67
|
renderProps?: GridColumnRenderProps;
|
|
68
|
-
}
|
|
68
|
+
};
|
|
69
69
|
/**
|
|
70
70
|
* Grid header cell renderer props
|
|
71
71
|
*/
|
|
72
|
-
export
|
|
72
|
+
export declare type GridHeaderCellRendererProps<T, P = any> = {
|
|
73
73
|
/**
|
|
74
74
|
* Cell props
|
|
75
75
|
*/
|
|
@@ -86,11 +86,11 @@ export interface GridHeaderCellRendererProps<T, P = any> {
|
|
|
86
86
|
* States
|
|
87
87
|
*/
|
|
88
88
|
states: GridLoaderStates<T>;
|
|
89
|
-
}
|
|
89
|
+
};
|
|
90
90
|
/**
|
|
91
91
|
* Grid column render props
|
|
92
92
|
*/
|
|
93
|
-
export
|
|
93
|
+
export declare type GridColumnRenderProps = {
|
|
94
94
|
/**
|
|
95
95
|
* Culture, like zh-CN
|
|
96
96
|
*/
|
|
@@ -115,11 +115,11 @@ export interface GridColumnRenderProps {
|
|
|
115
115
|
* Additional data
|
|
116
116
|
*/
|
|
117
117
|
readonly data?: Readonly<Record<string, any>>;
|
|
118
|
-
}
|
|
118
|
+
};
|
|
119
119
|
/**
|
|
120
120
|
* Grid column
|
|
121
121
|
*/
|
|
122
|
-
export
|
|
122
|
+
export declare type GridColumn<T> = {
|
|
123
123
|
/**
|
|
124
124
|
* The column identifier. It's used to map with row data
|
|
125
125
|
*/
|
|
@@ -169,4 +169,4 @@ export interface GridColumn<T> {
|
|
|
169
169
|
* Header cell renderer
|
|
170
170
|
*/
|
|
171
171
|
headerCellRenderer?: (props: GridHeaderCellRendererProps<T>) => React.ReactNode;
|
|
172
|
-
}
|
|
172
|
+
};
|
|
@@ -22,12 +22,11 @@ export declare function GridDataGet<F extends DataTypes.BasicTemplate>(props: Gr
|
|
|
22
22
|
/**
|
|
23
23
|
* Grid Json data
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
26
|
-
}
|
|
25
|
+
export declare type GridJsonData = Omit<GridLoadDataProps, 'data'>;
|
|
27
26
|
/**
|
|
28
27
|
* Grid data load props
|
|
29
28
|
*/
|
|
30
|
-
export
|
|
29
|
+
export declare type GridLoadDataProps = {
|
|
31
30
|
/**
|
|
32
31
|
* Current page
|
|
33
32
|
*/
|
|
@@ -48,11 +47,11 @@ export interface GridLoadDataProps {
|
|
|
48
47
|
* Data related
|
|
49
48
|
*/
|
|
50
49
|
data?: GridData;
|
|
51
|
-
}
|
|
50
|
+
};
|
|
52
51
|
/**
|
|
53
52
|
* Grid data loader
|
|
54
53
|
*/
|
|
55
|
-
export
|
|
54
|
+
export declare type GridLoader<T extends object> = {
|
|
56
55
|
/**
|
|
57
56
|
* Auto load data, otherwise call reset
|
|
58
57
|
* @default true
|
|
@@ -74,11 +73,11 @@ export interface GridLoader<T> {
|
|
|
74
73
|
* Threshold at which to pre-fetch data; default is half of loadBatchSize
|
|
75
74
|
*/
|
|
76
75
|
threshold?: number | undefined;
|
|
77
|
-
}
|
|
76
|
+
};
|
|
78
77
|
/**
|
|
79
78
|
* Grid loader states
|
|
80
79
|
*/
|
|
81
|
-
export
|
|
80
|
+
export declare type GridLoaderStates<T> = GridLoadDataProps & {
|
|
82
81
|
/**
|
|
83
82
|
* Auto load data, otherwise call reset
|
|
84
83
|
* @default true
|
|
@@ -108,4 +107,4 @@ export interface GridLoaderStates<T> extends GridLoadDataProps {
|
|
|
108
107
|
* Selected items of id
|
|
109
108
|
*/
|
|
110
109
|
selectedItems: T[];
|
|
111
|
-
}
|
|
110
|
+
};
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { Align, GridChildComponentProps, VariableSizeGridProps } from 'react-window';
|
|
4
4
|
import { GridMethodRef } from '../mu/GridMethodRef';
|
|
5
5
|
import { GridLoader, GridLoaderStates } from './GridLoader';
|
|
6
|
-
export
|
|
6
|
+
export declare type ScrollerGridItemRendererProps<T> = Omit<GridChildComponentProps<T>, 'data'> & {
|
|
7
7
|
/**
|
|
8
8
|
* Selected items
|
|
9
9
|
*/
|
|
@@ -12,11 +12,11 @@ export interface ScrollerGridItemRendererProps<T> extends Omit<GridChildComponen
|
|
|
12
12
|
* Data
|
|
13
13
|
*/
|
|
14
14
|
data?: T;
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
/**
|
|
17
17
|
* Scroller vertical grid props
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export declare type ScrollerGridProps<T extends object, D extends DataTypes.Keys<T> = DataTypes.Keys<T>> = GridLoader<T> & Omit<VariableSizeGridProps<T>, 'children' | 'rowCount' | 'rowHeight' | 'ref'> & {
|
|
20
20
|
/**
|
|
21
21
|
* Default order by asc
|
|
22
22
|
* @default true
|
|
@@ -32,7 +32,6 @@ export interface ScrollerGridProps<T extends {}, D extends DataTypes.Keys<T> = D
|
|
|
32
32
|
headerRenderer?: (states: GridLoaderStates<T>) => React.ReactNode;
|
|
33
33
|
/**
|
|
34
34
|
* Id field
|
|
35
|
-
* @default id
|
|
36
35
|
*/
|
|
37
36
|
idField?: D;
|
|
38
37
|
/**
|
|
@@ -51,7 +50,7 @@ export interface ScrollerGridProps<T extends {}, D extends DataTypes.Keys<T> = D
|
|
|
51
50
|
* Returns the height of the specified row.
|
|
52
51
|
*/
|
|
53
52
|
rowHeight?: ((index: number) => number) | number;
|
|
54
|
-
}
|
|
53
|
+
};
|
|
55
54
|
/**
|
|
56
55
|
* Scroller grid forward ref
|
|
57
56
|
*/
|
|
@@ -110,4 +109,4 @@ export interface ScrollerGridForwardRef extends GridMethodRef {
|
|
|
110
109
|
* @param props Props
|
|
111
110
|
* @returns Component
|
|
112
111
|
*/
|
|
113
|
-
export declare const ScrollerGrid: <T extends
|
|
112
|
+
export declare const ScrollerGrid: <T extends object, D extends DataTypes.Keys<T, string | number> = DataTypes.Keys<T, string | number>>(props: ScrollerGridProps<T, D>) => JSX.Element;
|
|
@@ -5,7 +5,7 @@ import { GridLoader } from './GridLoader';
|
|
|
5
5
|
/**
|
|
6
6
|
* Scroller vertical list props
|
|
7
7
|
*/
|
|
8
|
-
export interface ScrollerListProps<T> extends GridLoader<T>, Omit<ListProps<T>, 'ref' | 'outerRef' | 'height' | 'width' | 'children' | 'itemCount'> {
|
|
8
|
+
export interface ScrollerListProps<T extends object> extends GridLoader<T>, Omit<ListProps<T>, 'ref' | 'outerRef' | 'height' | 'width' | 'children' | 'itemCount'> {
|
|
9
9
|
/**
|
|
10
10
|
* Default order by asc/desc
|
|
11
11
|
*/
|
|
@@ -59,5 +59,5 @@ export interface ScrollerListForwardRef extends GridMethodRef, ScrollerListRef {
|
|
|
59
59
|
* @param props Props
|
|
60
60
|
* @returns Component
|
|
61
61
|
*/
|
|
62
|
-
export declare const ScrollerList: <T extends
|
|
62
|
+
export declare const ScrollerList: <T extends object>(props: ScrollerListProps<T>) => JSX.Element;
|
|
63
63
|
export {};
|
|
@@ -4,11 +4,7 @@ import { ChangeEventHandler } from 'react';
|
|
|
4
4
|
/**
|
|
5
5
|
* Autocomplete extended props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
/**
|
|
9
|
-
* Id field, default is id
|
|
10
|
-
*/
|
|
11
|
-
idField: T extends DataTypes.IdLabelItem ? D | undefined : D;
|
|
7
|
+
export declare type AutocompleteExtendedProps<T extends object, D extends DataTypes.Keys<T>> = Omit<AutocompleteProps<T, undefined, false, false>, 'renderInput' | 'options'> & {
|
|
12
8
|
/**
|
|
13
9
|
* Id value
|
|
14
10
|
*/
|
|
@@ -61,4 +57,10 @@ export interface AutocompleteExtendedProps<T extends {}, D extends DataTypes.Key
|
|
|
61
57
|
* Is search field?
|
|
62
58
|
*/
|
|
63
59
|
search?: boolean;
|
|
64
|
-
}
|
|
60
|
+
} & (T extends {
|
|
61
|
+
id: DataTypes.IdType;
|
|
62
|
+
} ? {
|
|
63
|
+
idField?: D;
|
|
64
|
+
} : {
|
|
65
|
+
idField: D;
|
|
66
|
+
});
|
package/lib/mu/ComboBox.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { AutocompleteExtendedProps } from './AutocompleteExtendedProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* ComboBox props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare type ComboBoxProps<T extends object, D extends DataTypes.Keys<T> = DataTypes.Keys<T>> = AutocompleteExtendedProps<T, D> & {
|
|
8
8
|
/**
|
|
9
9
|
* Auto add blank item
|
|
10
10
|
*/
|
|
@@ -13,10 +13,6 @@ export interface ComboBoxProps<T extends {}, D extends DataTypes.Keys<T> = DataT
|
|
|
13
13
|
* Data readonly
|
|
14
14
|
*/
|
|
15
15
|
dataReadonly?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Label field
|
|
18
|
-
*/
|
|
19
|
-
labelField: T extends DataTypes.IdLabelItem ? D | undefined : D;
|
|
20
16
|
/**
|
|
21
17
|
* Load data callback
|
|
22
18
|
*/
|
|
@@ -29,10 +25,16 @@ export interface ComboBoxProps<T extends {}, D extends DataTypes.Keys<T> = DataT
|
|
|
29
25
|
* Array of options.
|
|
30
26
|
*/
|
|
31
27
|
options?: ReadonlyArray<T>;
|
|
32
|
-
}
|
|
28
|
+
} & (T extends {
|
|
29
|
+
label: string;
|
|
30
|
+
} ? {
|
|
31
|
+
labelField?: D;
|
|
32
|
+
} : {
|
|
33
|
+
labelField: D;
|
|
34
|
+
});
|
|
33
35
|
/**
|
|
34
36
|
* ComboBox
|
|
35
37
|
* @param props Props
|
|
36
38
|
* @returns Component
|
|
37
39
|
*/
|
|
38
|
-
export declare function ComboBox<T extends
|
|
40
|
+
export declare function ComboBox<T extends object = DataTypes.IdLabelItem, D extends DataTypes.Keys<T> = DataTypes.Keys<T>>(props: ComboBoxProps<T, D>): JSX.Element;
|
package/lib/mu/DataGridEx.d.ts
CHANGED
|
@@ -7,17 +7,17 @@ import { MouseEventWithDataHandler } from './MUGlobal';
|
|
|
7
7
|
/**
|
|
8
8
|
* Footer item renderer props
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export declare type DataGridExFooterItemRendererProps<T extends object> = {
|
|
11
11
|
column: GridColumn<T>;
|
|
12
12
|
index: number;
|
|
13
13
|
states: GridLoaderStates<T>;
|
|
14
14
|
cellProps: any;
|
|
15
15
|
checkable: boolean;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
/**
|
|
18
18
|
* Extended DataGrid with VariableSizeGrid props
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export declare type DataGridExProps<T extends object, D extends DataTypes.Keys<T> = DataTypes.Keys<T>> = Omit<ScrollerGridProps<T, D>, 'itemRenderer' | 'columnCount' | 'columnWidth' | 'width'> & {
|
|
21
21
|
/**
|
|
22
22
|
* Alternating colors for odd/even rows
|
|
23
23
|
*/
|
|
@@ -78,7 +78,7 @@ export interface DataGridExProps<T extends {}, D extends DataTypes.Keys<T> = Dat
|
|
|
78
78
|
* Width
|
|
79
79
|
*/
|
|
80
80
|
width?: number;
|
|
81
|
-
}
|
|
81
|
+
};
|
|
82
82
|
/**
|
|
83
83
|
* Extended datagrid columns calculation
|
|
84
84
|
* @param columns
|
|
@@ -93,4 +93,4 @@ export declare function DataGridExCalColumns<T>(columns: GridColumn<T>[]): {
|
|
|
93
93
|
* @param props Props
|
|
94
94
|
* @returns Component
|
|
95
95
|
*/
|
|
96
|
-
export declare function DataGridEx<T extends
|
|
96
|
+
export declare function DataGridEx<T extends object, D extends DataTypes.Keys<T> = DataTypes.Keys<T>>(props: DataGridExProps<T, D>): JSX.Element;
|
|
@@ -18,5 +18,5 @@ export declare namespace DataGridRenderers {
|
|
|
18
18
|
* @param location Renderer location (column index)
|
|
19
19
|
* @returns Component
|
|
20
20
|
*/
|
|
21
|
-
function defaultFooterItemRenderer<T>(_rows: T[], { index, states, checkable }: DataGridExFooterItemRendererProps<T>, location?: number): string | undefined;
|
|
21
|
+
function defaultFooterItemRenderer<T extends object>(_rows: T[], { index, states, checkable }: DataGridExFooterItemRendererProps<T>, location?: number): string | undefined;
|
|
22
22
|
}
|
package/lib/mu/DnDList.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare const DnDItemStyle: (index: number, isDragging: boolean, theme: T
|
|
|
17
17
|
/**
|
|
18
18
|
* DnD list forward ref
|
|
19
19
|
*/
|
|
20
|
-
export interface DnDListRef<D extends
|
|
20
|
+
export interface DnDListRef<D extends object> {
|
|
21
21
|
/**
|
|
22
22
|
* Add item
|
|
23
23
|
* @param item New item
|
|
@@ -43,7 +43,7 @@ export interface DnDListRef<D extends {}> {
|
|
|
43
43
|
/**
|
|
44
44
|
* DnD sortable list properties
|
|
45
45
|
*/
|
|
46
|
-
export interface DnDListPros<D extends
|
|
46
|
+
export interface DnDListPros<D extends object, K extends DataTypes.Keys<D>> {
|
|
47
47
|
/**
|
|
48
48
|
* Get list item style callback
|
|
49
49
|
*/
|
|
@@ -5,7 +5,7 @@ import { GridData, GridLoader } from '../components/GridLoader';
|
|
|
5
5
|
/**
|
|
6
6
|
* ListMoreDisplay props
|
|
7
7
|
*/
|
|
8
|
-
export interface ListMoreDisplayProps<T, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate> extends Omit<CardProps, 'children'>, GridLoader<T> {
|
|
8
|
+
export interface ListMoreDisplayProps<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate> extends Omit<CardProps, 'children'>, GridLoader<T> {
|
|
9
9
|
/**
|
|
10
10
|
* Children to display the list
|
|
11
11
|
*/
|
|
@@ -32,4 +32,4 @@ export interface ListMoreDisplayProps<T, F extends DataTypes.BasicTemplate = Dat
|
|
|
32
32
|
* @param props Props
|
|
33
33
|
* @returns Component
|
|
34
34
|
*/
|
|
35
|
-
export declare function ListMoreDisplay<T extends
|
|
35
|
+
export declare function ListMoreDisplay<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ListMoreDisplayProps<T, F>): JSX.Element;
|
package/lib/mu/MUGlobal.d.ts
CHANGED
|
@@ -55,13 +55,13 @@ export declare class MUGlobal {
|
|
|
55
55
|
* @param input Input object
|
|
56
56
|
* @returns Updated object
|
|
57
57
|
*/
|
|
58
|
-
static half(input:
|
|
58
|
+
static half(input: object): {};
|
|
59
59
|
/**
|
|
60
60
|
* Reverse object number properties, like 5 to -5
|
|
61
61
|
* @param input Input object
|
|
62
62
|
* @returns Updated object
|
|
63
63
|
*/
|
|
64
|
-
static reverse(input:
|
|
64
|
+
static reverse(input: object): {};
|
|
65
65
|
/**
|
|
66
66
|
* Update object number properties with adjustment
|
|
67
67
|
* @param input Input object
|
|
@@ -69,7 +69,7 @@ export declare class MUGlobal {
|
|
|
69
69
|
* @param field Specific field
|
|
70
70
|
* @returns Updated object
|
|
71
71
|
*/
|
|
72
|
-
static increase(input:
|
|
72
|
+
static increase(input: object, adjust: number | object, field?: string): {};
|
|
73
73
|
/**
|
|
74
74
|
* Adjust size with theme update
|
|
75
75
|
* @param size Base size
|
|
@@ -77,7 +77,7 @@ export declare class MUGlobal {
|
|
|
77
77
|
* @param updateFunc Theme update function
|
|
78
78
|
* @returns Updated object
|
|
79
79
|
*/
|
|
80
|
-
static adjustWithTheme(size: number, adjust:
|
|
80
|
+
static adjustWithTheme(size: number, adjust: object, updateFunc: (value: number) => string): {};
|
|
81
81
|
/**
|
|
82
82
|
* Break points defined
|
|
83
83
|
*/
|
|
@@ -91,7 +91,7 @@ export declare class MUGlobal {
|
|
|
91
91
|
* @param theme Theme
|
|
92
92
|
* @returns Result
|
|
93
93
|
*/
|
|
94
|
-
static getSpace(spaces:
|
|
94
|
+
static getSpace(spaces: object, theme: Theme): number;
|
|
95
95
|
/**
|
|
96
96
|
* Update object number properties with theme
|
|
97
97
|
* @param input Input object
|
package/lib/mu/OptionGroup.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { FormControlProps } from '@mui/material';
|
|
|
4
4
|
/**
|
|
5
5
|
* OptionGroup props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare type OptionGroupProps<T extends object = DataTypes.IdLabelItem, D extends DataTypes.Keys<T> = DataTypes.Keys<T>> = Omit<FormControlProps<'fieldset'>, 'defaultValue'> & {
|
|
8
8
|
/**
|
|
9
9
|
* Default value
|
|
10
10
|
*/
|
|
@@ -13,18 +13,10 @@ export interface OptionGroupProps<T extends {} = DataTypes.IdLabelItem, D extend
|
|
|
13
13
|
* Get option label function
|
|
14
14
|
*/
|
|
15
15
|
getOptionLabel?: (option: T) => string;
|
|
16
|
-
/**
|
|
17
|
-
* Id field, default is id
|
|
18
|
-
*/
|
|
19
|
-
idField: T extends DataTypes.IdLabelItem ? D | undefined : D;
|
|
20
16
|
/**
|
|
21
17
|
* Label
|
|
22
18
|
*/
|
|
23
19
|
label?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Label field, default is label
|
|
26
|
-
*/
|
|
27
|
-
labelField: T extends DataTypes.IdLabelItem ? D | undefined : D;
|
|
28
20
|
/**
|
|
29
21
|
* Multiple choose item
|
|
30
22
|
*/
|
|
@@ -49,10 +41,22 @@ export interface OptionGroupProps<T extends {} = DataTypes.IdLabelItem, D extend
|
|
|
49
41
|
* Display group of elements in a compact row
|
|
50
42
|
*/
|
|
51
43
|
row?: boolean;
|
|
52
|
-
}
|
|
44
|
+
} & (T extends {
|
|
45
|
+
id: DataTypes.IdType;
|
|
46
|
+
} ? {
|
|
47
|
+
idField?: D;
|
|
48
|
+
} : {
|
|
49
|
+
idField: D;
|
|
50
|
+
}) & (T extends {
|
|
51
|
+
label: string;
|
|
52
|
+
} ? {
|
|
53
|
+
labelField?: D;
|
|
54
|
+
} : {
|
|
55
|
+
labelField: D;
|
|
56
|
+
});
|
|
53
57
|
/**
|
|
54
58
|
* OptionGroup
|
|
55
59
|
* @param props Props
|
|
56
60
|
* @returns Component
|
|
57
61
|
*/
|
|
58
|
-
export declare function OptionGroup<T extends
|
|
62
|
+
export declare function OptionGroup<T extends object = DataTypes.IdLabelItem, D extends DataTypes.Keys<T> = DataTypes.Keys<T>>(props: OptionGroupProps<T, D>): JSX.Element;
|
|
@@ -10,7 +10,7 @@ import { ScrollerListExInnerItemRendererProps, ScrollerListExItemSize } from './
|
|
|
10
10
|
/**
|
|
11
11
|
* ResponsibleContainer props
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare type ResponsibleContainerProps<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate, D extends DataTypes.Keys<T> = DataTypes.Keys<T>> = Omit<DataGridExProps<T, D>, 'height' | 'itemKey' | 'loadData' | 'mRef' | 'onScroll' | 'onItemsRendered'> & {
|
|
14
14
|
/**
|
|
15
15
|
* Height will be deducted
|
|
16
16
|
* @param height Current calcuated height
|
|
@@ -23,7 +23,7 @@ export interface ResponsibleContainerProps<T extends {}, F extends DataTypes.Bas
|
|
|
23
23
|
/**
|
|
24
24
|
* Container box SX (dataGrid determines the case)
|
|
25
25
|
*/
|
|
26
|
-
containerBoxSx?: (paddings:
|
|
26
|
+
containerBoxSx?: (paddings: Record<string, string | number>, hasFields: boolean, dataGrid?: boolean) => SxProps<Theme>;
|
|
27
27
|
/**
|
|
28
28
|
* Min width to show Datagrid
|
|
29
29
|
*/
|
|
@@ -67,7 +67,7 @@ export interface ResponsibleContainerProps<T extends {}, F extends DataTypes.Bas
|
|
|
67
67
|
/**
|
|
68
68
|
* Paddings
|
|
69
69
|
*/
|
|
70
|
-
paddings?:
|
|
70
|
+
paddings?: Record<string, string | number>;
|
|
71
71
|
/**
|
|
72
72
|
* Pull to refresh data
|
|
73
73
|
*/
|
|
@@ -80,10 +80,10 @@ export interface ResponsibleContainerProps<T extends {}, F extends DataTypes.Bas
|
|
|
80
80
|
* Size ready to read miliseconds span
|
|
81
81
|
*/
|
|
82
82
|
sizeReadyMiliseconds?: number;
|
|
83
|
-
}
|
|
83
|
+
};
|
|
84
84
|
/**
|
|
85
85
|
* Responsible container
|
|
86
86
|
* @param props Props
|
|
87
87
|
* @returns Layout
|
|
88
88
|
*/
|
|
89
|
-
export declare function ResponsibleContainer<T extends
|
|
89
|
+
export declare function ResponsibleContainer<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate, D extends DataTypes.Keys<T> = DataTypes.Keys<T>>(props: ResponsibleContainerProps<T, F, D>): JSX.Element;
|
|
@@ -22,7 +22,7 @@ export interface ScrollerListExInnerItemRendererProps<T> extends ListChildCompon
|
|
|
22
22
|
/**
|
|
23
23
|
* Default margins
|
|
24
24
|
*/
|
|
25
|
-
margins:
|
|
25
|
+
margins: object;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Extended ScrollerList ItemSize type
|
|
@@ -30,19 +30,15 @@ export interface ScrollerListExInnerItemRendererProps<T> extends ListChildCompon
|
|
|
30
30
|
* 2. Static sets
|
|
31
31
|
* 3. Dynamic calculation
|
|
32
32
|
*/
|
|
33
|
-
export declare type ScrollerListExItemSize = ((index: number) => [number, number] | [number, number,
|
|
33
|
+
export declare type ScrollerListExItemSize = ((index: number) => [number, number] | [number, number, object]) | [number, number] | [number, object, boolean?];
|
|
34
34
|
/**
|
|
35
35
|
* Extended ScrollerList Props
|
|
36
36
|
*/
|
|
37
|
-
export
|
|
37
|
+
export declare type ScrollerListExProps<T extends object, D extends DataTypes.Keys<T> = DataTypes.Keys<T>> = Omit<ScrollerListProps<T>, 'itemRenderer' | 'itemSize'> & {
|
|
38
38
|
/**
|
|
39
39
|
* Alternating colors for odd/even rows
|
|
40
40
|
*/
|
|
41
41
|
alternatingColors?: [string?, string?];
|
|
42
|
-
/**
|
|
43
|
-
* Id field
|
|
44
|
-
*/
|
|
45
|
-
idField?: D;
|
|
46
42
|
/**
|
|
47
43
|
* Inner item renderer
|
|
48
44
|
*/
|
|
@@ -51,6 +47,11 @@ export interface ScrollerListExProps<T extends {}, D extends DataTypes.Keys<T> =
|
|
|
51
47
|
* Item renderer
|
|
52
48
|
*/
|
|
53
49
|
itemRenderer?: (props: ListChildComponentProps<T>) => React.ReactElement;
|
|
50
|
+
/**
|
|
51
|
+
* Id field
|
|
52
|
+
* Failed: D extends { id: DataTypes.IdType } ? { idField?: D } : { idField: D }
|
|
53
|
+
*/
|
|
54
|
+
idField?: D;
|
|
54
55
|
/**
|
|
55
56
|
* Item size, a function indicates its a variable size list
|
|
56
57
|
*/
|
|
@@ -71,10 +72,10 @@ export interface ScrollerListExProps<T extends {}, D extends DataTypes.Keys<T> =
|
|
|
71
72
|
* Selected color
|
|
72
73
|
*/
|
|
73
74
|
selectedColor?: string;
|
|
74
|
-
}
|
|
75
|
+
};
|
|
75
76
|
/**
|
|
76
77
|
* Extended ScrollerList
|
|
77
78
|
* @param props Props
|
|
78
79
|
* @returns Component
|
|
79
80
|
*/
|
|
80
|
-
export declare function ScrollerListEx<T extends
|
|
81
|
+
export declare function ScrollerListEx<T extends object, D extends DataTypes.Keys<T> = DataTypes.Keys<T>>(props: ScrollerListExProps<T, D>): JSX.Element;
|
|
@@ -6,4 +6,4 @@ import { OptionGroupProps } from './OptionGroup';
|
|
|
6
6
|
* @param props Props
|
|
7
7
|
* @returns Component
|
|
8
8
|
*/
|
|
9
|
-
export declare function SearchOptionGroup<T extends
|
|
9
|
+
export declare function SearchOptionGroup<T extends object = DataTypes.IdLabelItem, D extends DataTypes.Keys<T> = DataTypes.Keys<T>>(props: OptionGroupProps<T, D>): JSX.Element;
|
package/lib/mu/SelectEx.d.ts
CHANGED
|
@@ -4,23 +4,15 @@ import { DataTypes } from '@etsoo/shared';
|
|
|
4
4
|
/**
|
|
5
5
|
* Extended select component props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare type SelectExProps<T extends object, D extends DataTypes.Keys<T> = DataTypes.Keys<T>> = Omit<SelectProps, 'labelId' | 'input' | 'native'> & {
|
|
8
8
|
/**
|
|
9
9
|
* Auto add blank item
|
|
10
10
|
*/
|
|
11
11
|
autoAddBlankItem?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Id field
|
|
14
|
-
*/
|
|
15
|
-
idField: T extends DataTypes.IdLabelItem ? D | undefined : D;
|
|
16
12
|
/**
|
|
17
13
|
* Item icon renderer
|
|
18
14
|
*/
|
|
19
15
|
itemIconRenderer?: (id: unknown) => React.ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* Label field
|
|
22
|
-
*/
|
|
23
|
-
labelField: ((option: T) => string) | (T extends DataTypes.IdLabelItem ? D | undefined : D);
|
|
24
16
|
/**
|
|
25
17
|
* Load data callback
|
|
26
18
|
*/
|
|
@@ -41,10 +33,22 @@ export interface SelectExProps<T extends {}, D extends DataTypes.Keys<T> = DataT
|
|
|
41
33
|
* Is search case?
|
|
42
34
|
*/
|
|
43
35
|
search?: boolean;
|
|
44
|
-
}
|
|
36
|
+
} & (T extends {
|
|
37
|
+
id: DataTypes.IdType;
|
|
38
|
+
} ? {
|
|
39
|
+
idField?: D;
|
|
40
|
+
} : {
|
|
41
|
+
idField: D;
|
|
42
|
+
}) & (T extends {
|
|
43
|
+
label: string;
|
|
44
|
+
} ? {
|
|
45
|
+
labelField?: ((option: T) => string) | D;
|
|
46
|
+
} : {
|
|
47
|
+
labelField: ((option: T) => string) | D;
|
|
48
|
+
});
|
|
45
49
|
/**
|
|
46
50
|
* Extended select component
|
|
47
51
|
* @param props Props
|
|
48
52
|
* @returns Component
|
|
49
53
|
*/
|
|
50
|
-
export declare function SelectEx<T extends
|
|
54
|
+
export declare function SelectEx<T extends object = DataTypes.IdLabelItem, D extends DataTypes.Keys<T> = DataTypes.Keys<T>>(props: SelectExProps<T, D>): JSX.Element;
|
package/lib/mu/TableEx.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface TableExMethodRef extends GridMethodRef {
|
|
|
20
20
|
/**
|
|
21
21
|
* Extended table props
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export declare type TableExProps<T extends object, D extends DataTypes.Keys<T> = DataTypes.Keys<T>> = TableProps & GridLoader<T> & {
|
|
24
24
|
/**
|
|
25
25
|
* Alternating colors for odd/even rows
|
|
26
26
|
*/
|
|
@@ -33,10 +33,6 @@ export interface TableExProps<T extends {}, D extends DataTypes.Keys<T> = DataTy
|
|
|
33
33
|
* Header cells background color and font color
|
|
34
34
|
*/
|
|
35
35
|
headerColors?: [string?, string?];
|
|
36
|
-
/**
|
|
37
|
-
* Id field
|
|
38
|
-
*/
|
|
39
|
-
idField?: D;
|
|
40
36
|
/**
|
|
41
37
|
* Max height
|
|
42
38
|
*/
|
|
@@ -57,10 +53,16 @@ export interface TableExProps<T extends {}, D extends DataTypes.Keys<T> = DataTy
|
|
|
57
53
|
* Header and bottom height
|
|
58
54
|
*/
|
|
59
55
|
otherHeight?: number;
|
|
60
|
-
}
|
|
56
|
+
} & (T extends {
|
|
57
|
+
id: DataTypes.IdType;
|
|
58
|
+
} ? {
|
|
59
|
+
idField?: D;
|
|
60
|
+
} : {
|
|
61
|
+
idField: D;
|
|
62
|
+
});
|
|
61
63
|
/**
|
|
62
64
|
* Extended Table
|
|
63
65
|
* @param props Props
|
|
64
66
|
* @returns Component
|
|
65
67
|
*/
|
|
66
|
-
export declare function TableEx<T extends
|
|
68
|
+
export declare function TableEx<T extends object, D extends DataTypes.Keys<T> = DataTypes.Keys<T>>(props: TableExProps<T, D>): JSX.Element;
|