@etsoo/react 1.2.32 → 1.2.36
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/.github/workflows/main.yml +1 -1
- package/__tests__/tsconfig.json +1 -1
- package/lib/app/Labels.d.ts +4 -4
- package/lib/components/GridColumn.d.ts +2 -2
- package/lib/components/GridColumn.js +1 -1
- package/lib/components/GridLoader.d.ts +5 -4
- package/lib/components/GridLoader.js +17 -9
- package/lib/mu/pages/DataGridPage.d.ts +2 -1
- package/lib/mu/pages/DataGridPage.js +4 -4
- package/lib/mu/pages/DataGridPageProps.d.ts +2 -1
- package/lib/mu/pages/FixedListPage.d.ts +2 -1
- package/lib/mu/pages/FixedListPage.js +4 -4
- package/lib/mu/pages/ListPage.d.ts +2 -1
- package/lib/mu/pages/ListPage.js +4 -4
- package/lib/mu/pages/ListPageProps.d.ts +2 -1
- package/lib/mu/pages/ResponsivePage.d.ts +2 -1
- package/lib/mu/pages/ResponsivePage.js +4 -4
- package/lib/mu/pages/ResponsivePageProps.d.ts +2 -2
- package/lib/mu/pages/SearchPageProps.d.ts +8 -3
- package/lib/mu/pages/TablePage.d.ts +2 -1
- package/lib/mu/pages/TablePage.js +4 -4
- package/lib/mu/pages/TablePageProps.d.ts +2 -1
- package/lib/states/CultureState.d.ts +1 -1
- package/lib/states/RouterProps.d.ts +1 -1
- package/lib/uses/useCombinedRefs.d.ts +1 -1
- package/lib/uses/useCombinedRefs.js +1 -1
- package/package.json +11 -11
- package/src/app/Labels.ts +4 -4
- package/src/app/ReactApp.ts +0 -1
- package/src/components/GridColumn.ts +1 -1
- package/src/components/GridLoader.ts +26 -15
- package/src/mu/pages/DataGridPage.tsx +8 -4
- package/src/mu/pages/DataGridPageProps.ts +3 -2
- package/src/mu/pages/FixedListPage.tsx +7 -5
- package/src/mu/pages/ListPage.tsx +15 -5
- package/src/mu/pages/ListPageProps.ts +3 -2
- package/src/mu/pages/ResponsivePage.tsx +8 -4
- package/src/mu/pages/ResponsivePageProps.ts +6 -7
- package/src/mu/pages/SearchPageProps.ts +12 -3
- package/src/mu/pages/TablePage.tsx +8 -4
- package/src/mu/pages/TablePageProps.ts +3 -2
- package/src/states/CultureState.ts +2 -2
- package/src/states/RouterProps.ts +1 -1
- package/src/uses/useCombinedRefs.ts +3 -3
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
# Setup .npmrc file to publish to npm
|
|
29
29
|
- uses: actions/setup-node@v1
|
|
30
30
|
with:
|
|
31
|
-
node-version: '14.
|
|
31
|
+
node-version: '14.18'
|
|
32
32
|
registry-url: 'https://registry.npmjs.org'
|
|
33
33
|
|
|
34
34
|
# Named after Continuous Integration, installs dependencies directly from package-lock.json
|
package/__tests__/tsconfig.json
CHANGED
package/lib/app/Labels.d.ts
CHANGED
|
@@ -50,14 +50,14 @@ export declare namespace Labels {
|
|
|
50
50
|
* setLabelReference key reference
|
|
51
51
|
*/
|
|
52
52
|
interface setLabelsReference {
|
|
53
|
-
commonPage?: DataTypes.
|
|
54
|
-
notificationMU?: DataTypes.
|
|
55
|
-
userAvatarEditor?: DataTypes.
|
|
53
|
+
commonPage?: DataTypes.StringDictionary;
|
|
54
|
+
notificationMU?: DataTypes.StringDictionary;
|
|
55
|
+
userAvatarEditor?: DataTypes.StringDictionary;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Set components' labels
|
|
59
59
|
* @param labels Labels
|
|
60
60
|
* @param reference Key reference
|
|
61
61
|
*/
|
|
62
|
-
const setLabels: (labels:
|
|
62
|
+
const setLabels: (labels: {}, reference?: setLabelsReference) => void;
|
|
63
63
|
}
|
|
@@ -4,7 +4,7 @@ import { GridLoaderStates } from './GridLoader';
|
|
|
4
4
|
/**
|
|
5
5
|
* Grid data type
|
|
6
6
|
*/
|
|
7
|
-
import GridDataType = DataTypes.
|
|
7
|
+
import GridDataType = DataTypes.CombinedEnum;
|
|
8
8
|
export { GridDataType };
|
|
9
9
|
/**
|
|
10
10
|
* Grid align
|
|
@@ -15,7 +15,7 @@ export declare type GridAlign = 'center' | 'inherit' | 'justify' | 'left' | 'rig
|
|
|
15
15
|
* @param align Align
|
|
16
16
|
* @param type Data type
|
|
17
17
|
*/
|
|
18
|
-
export declare const GridAlignGet: (align?: GridAlign | undefined, type?: DataTypes.
|
|
18
|
+
export declare const GridAlignGet: (align?: GridAlign | undefined, type?: DataTypes.CombinedEnum | undefined) => GridAlign | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Grid cell value type
|
|
21
21
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
/**
|
|
2
3
|
* Grid size
|
|
3
4
|
*/
|
|
@@ -11,17 +12,17 @@ export declare const GridSizeGet: (size: GridSize, input: number) => number;
|
|
|
11
12
|
/**
|
|
12
13
|
* Grid data type
|
|
13
14
|
*/
|
|
14
|
-
export declare type GridData = FormData |
|
|
15
|
+
export declare type GridData = FormData | DataTypes.StringRecord;
|
|
15
16
|
/**
|
|
16
|
-
* Grid data get
|
|
17
|
+
* Grid data get with format
|
|
17
18
|
* @param data Data
|
|
18
19
|
* @returns Json data
|
|
19
20
|
*/
|
|
20
|
-
export declare
|
|
21
|
+
export declare function GridDataGet<F extends DataTypes.BasicTemplate>(props: GridLoadDataProps, template?: F): GridJsonData & DataTypes.BasicTemplateType<F>;
|
|
21
22
|
/**
|
|
22
23
|
* Grid Json data
|
|
23
24
|
*/
|
|
24
|
-
export interface GridJsonData extends Omit<GridLoadDataProps, 'data'
|
|
25
|
+
export interface GridJsonData extends Omit<GridLoadDataProps, 'data'> {
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
28
|
* Grid data load props
|
|
@@ -10,16 +10,24 @@ export const GridSizeGet = (size, input) => {
|
|
|
10
10
|
return size;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* Grid data get
|
|
13
|
+
* Grid data get with format
|
|
14
14
|
* @param data Data
|
|
15
15
|
* @returns Json data
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
export function GridDataGet(props, template) {
|
|
18
|
+
// Destruct
|
|
19
|
+
const { data, ...rest } = props;
|
|
20
|
+
// Conditions
|
|
21
|
+
let conditions = {};
|
|
22
|
+
// Cast data
|
|
23
|
+
if (data != null && template != null) {
|
|
24
|
+
if (data instanceof FormData) {
|
|
25
|
+
// Clear empty value
|
|
26
|
+
DomUtils.clearFormData(data);
|
|
27
|
+
}
|
|
28
|
+
// Set keepSource to true to hold form data, even they are invisible from the conditions
|
|
29
|
+
conditions = DomUtils.dataAs(data, template, true);
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
};
|
|
31
|
+
// DomUtils.dataAs(data, template);
|
|
32
|
+
return { ...conditions, ...rest };
|
|
33
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DataTypes } from '@etsoo/shared';
|
|
2
3
|
import { DataGridPageProps } from './DataGridPageProps';
|
|
3
4
|
/**
|
|
4
5
|
* DataGrid page
|
|
5
6
|
* @param props Props
|
|
6
7
|
* @returns Component
|
|
7
8
|
*/
|
|
8
|
-
export declare function DataGridPage<T>(props: DataGridPageProps<T>): JSX.Element;
|
|
9
|
+
export declare function DataGridPage<T, F extends DataTypes.BasicTemplate>(props: DataGridPageProps<T, F>): JSX.Element;
|
|
@@ -15,7 +15,7 @@ import { CommonPage } from './CommonPage';
|
|
|
15
15
|
export function DataGridPage(props) {
|
|
16
16
|
var _a, _b;
|
|
17
17
|
// Destruct
|
|
18
|
-
const { adjustHeight, fields, height, loadData, mRef, sizeReadyMiliseconds = 100, pageProps = {}, ...rest } = props;
|
|
18
|
+
const { adjustHeight, fields, fieldTemplate, height, loadData, mRef, sizeReadyMiliseconds = 100, pageProps = {}, ...rest } = props;
|
|
19
19
|
(_a = pageProps.paddings) !== null && _a !== void 0 ? _a : (pageProps.paddings = MUGlobal.pagePaddings);
|
|
20
20
|
// States
|
|
21
21
|
const [states, setStates] = React.useReducer((currentState, newState) => {
|
|
@@ -33,9 +33,9 @@ export function DataGridPage(props) {
|
|
|
33
33
|
const onSubmit = (data, _reset) => {
|
|
34
34
|
setStates({ data });
|
|
35
35
|
};
|
|
36
|
-
const localLoadData = (
|
|
37
|
-
const
|
|
38
|
-
return loadData(
|
|
36
|
+
const localLoadData = (props) => {
|
|
37
|
+
const data = GridDataGet(props, fieldTemplate);
|
|
38
|
+
return loadData(data);
|
|
39
39
|
};
|
|
40
40
|
// Watch container
|
|
41
41
|
const { dimensions } = useDimensions(1, undefined, sizeReadyMiliseconds);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { DataGridExProps } from '../DataGridEx';
|
|
2
3
|
import { SearchPageProps } from './SearchPageProps';
|
|
3
4
|
/**
|
|
4
5
|
* DataGrid page props
|
|
5
6
|
*/
|
|
6
|
-
export interface DataGridPageProps<T> extends SearchPageProps<T>, Omit<DataGridExProps<T>, 'loadData' | 'height'> {
|
|
7
|
+
export interface DataGridPageProps<T, F extends DataTypes.BasicTemplate> extends SearchPageProps<T, F>, Omit<DataGridExProps<T>, 'loadData' | 'height'> {
|
|
7
8
|
/**
|
|
8
9
|
* Height will be deducted
|
|
9
10
|
* @param height Current calcuated height
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DataTypes } from '@etsoo/shared';
|
|
2
3
|
import { ListPageProps } from './ListPageProps';
|
|
3
4
|
/**
|
|
4
5
|
* Fixed height list page
|
|
5
6
|
* @param props Props
|
|
6
7
|
* @returns Component
|
|
7
8
|
*/
|
|
8
|
-
export declare function FixedListPage<T>(props: ListPageProps<T> & {
|
|
9
|
+
export declare function FixedListPage<T, F extends DataTypes.BasicTemplate>(props: ListPageProps<T, F> & {
|
|
9
10
|
/**
|
|
10
11
|
* Height will be deducted
|
|
11
12
|
* @param height Current calcuated height
|
|
@@ -15,7 +15,7 @@ import { CommonPage } from './CommonPage';
|
|
|
15
15
|
export function FixedListPage(props) {
|
|
16
16
|
var _a;
|
|
17
17
|
// Destruct
|
|
18
|
-
const { adjustHeight, fields, loadData, mRef, sizeReadyMiliseconds = 100, pageProps = {}, ...rest } = props;
|
|
18
|
+
const { adjustHeight, fields, fieldTemplate, loadData, mRef, sizeReadyMiliseconds = 100, pageProps = {}, ...rest } = props;
|
|
19
19
|
(_a = pageProps.paddings) !== null && _a !== void 0 ? _a : (pageProps.paddings = MUGlobal.pagePaddings);
|
|
20
20
|
// States
|
|
21
21
|
const [states] = React.useState({});
|
|
@@ -39,9 +39,9 @@ export function FixedListPage(props) {
|
|
|
39
39
|
states.data = data;
|
|
40
40
|
reset();
|
|
41
41
|
};
|
|
42
|
-
const localLoadData = (
|
|
43
|
-
const
|
|
44
|
-
return loadData(
|
|
42
|
+
const localLoadData = (props) => {
|
|
43
|
+
const data = GridDataGet(props, fieldTemplate);
|
|
44
|
+
return loadData(data);
|
|
45
45
|
};
|
|
46
46
|
// Watch container
|
|
47
47
|
const { dimensions } = useDimensions(1, undefined, sizeReadyMiliseconds);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DataTypes } from '@etsoo/shared';
|
|
2
3
|
import { ListPageProps } from './ListPageProps';
|
|
3
4
|
/**
|
|
4
5
|
* List page
|
|
5
6
|
* @param props Props
|
|
6
7
|
* @returns Component
|
|
7
8
|
*/
|
|
8
|
-
export declare function ListPage<T>(props: ListPageProps<T>): JSX.Element;
|
|
9
|
+
export declare function ListPage<T, F extends DataTypes.BasicTemplate>(props: ListPageProps<T, F>): JSX.Element;
|
package/lib/mu/pages/ListPage.js
CHANGED
|
@@ -14,7 +14,7 @@ import { CommonPage, CommonPagePullContainer, CommonPageScrollContainer } from '
|
|
|
14
14
|
export function ListPage(props) {
|
|
15
15
|
var _a;
|
|
16
16
|
// Destruct
|
|
17
|
-
const { fields, loadData, mRef, pageProps = {}, ...rest } = props;
|
|
17
|
+
const { fields, fieldTemplate, loadData, mRef, pageProps = {}, ...rest } = props;
|
|
18
18
|
(_a = pageProps.paddings) !== null && _a !== void 0 ? _a : (pageProps.paddings = MUGlobal.pagePaddings);
|
|
19
19
|
// States
|
|
20
20
|
const [states] = React.useState({});
|
|
@@ -36,9 +36,9 @@ export function ListPage(props) {
|
|
|
36
36
|
states.data = data;
|
|
37
37
|
reset();
|
|
38
38
|
};
|
|
39
|
-
const localLoadData = (
|
|
40
|
-
const
|
|
41
|
-
return loadData(
|
|
39
|
+
const localLoadData = (props) => {
|
|
40
|
+
const data = GridDataGet(props, fieldTemplate);
|
|
41
|
+
return loadData(data);
|
|
42
42
|
};
|
|
43
43
|
// Layout
|
|
44
44
|
return (React.createElement(CommonPage, { ...pageProps, scrollContainer: CommonPageScrollContainer, pullContainer: CommonPagePullContainer },
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { ScrollerListExProps } from '../ScrollerListEx';
|
|
2
3
|
import { SearchPageProps } from './SearchPageProps';
|
|
3
4
|
/**
|
|
4
5
|
* List page props
|
|
5
6
|
*/
|
|
6
|
-
export interface ListPageProps<T> extends SearchPageProps<T>, Omit<ScrollerListExProps<T>, 'loadData'> {
|
|
7
|
+
export interface ListPageProps<T, F extends DataTypes.BasicTemplate> extends SearchPageProps<T, F>, Omit<ScrollerListExProps<T>, 'loadData'> {
|
|
7
8
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DataTypes } from '@etsoo/shared';
|
|
2
3
|
import { ResponsePageProps } from './ResponsivePageProps';
|
|
3
4
|
/**
|
|
4
5
|
* Fixed height list page
|
|
5
6
|
* @param props Props
|
|
6
7
|
* @returns Component
|
|
7
8
|
*/
|
|
8
|
-
export declare function ResponsivePage<T>(props: ResponsePageProps<T>): JSX.Element;
|
|
9
|
+
export declare function ResponsivePage<T, F extends DataTypes.BasicTemplate>(props: ResponsePageProps<T, F>): JSX.Element;
|
|
@@ -16,7 +16,7 @@ import { CommonPage } from './CommonPage';
|
|
|
16
16
|
export function ResponsivePage(props) {
|
|
17
17
|
var _a, _b;
|
|
18
18
|
// Destruct
|
|
19
|
-
const { adjustHeight, columns, dataGridMinWidth = DataGridExCalColumns(columns).total, fields, height, loadData, innerItemRenderer, itemSize, mRef, sizeReadyMiliseconds = 100, pageProps = {}, ...rest } = props;
|
|
19
|
+
const { adjustHeight, columns, dataGridMinWidth = DataGridExCalColumns(columns).total, fields, fieldTemplate, height, loadData, innerItemRenderer, itemSize, mRef, sizeReadyMiliseconds = 100, pageProps = {}, ...rest } = props;
|
|
20
20
|
(_a = pageProps.paddings) !== null && _a !== void 0 ? _a : (pageProps.paddings = MUGlobal.pagePaddings);
|
|
21
21
|
// States
|
|
22
22
|
const [states, setStates] = React.useReducer((currentState, newState) => {
|
|
@@ -24,9 +24,9 @@ export function ResponsivePage(props) {
|
|
|
24
24
|
}, {
|
|
25
25
|
height
|
|
26
26
|
});
|
|
27
|
-
const localLoadData = (
|
|
28
|
-
const
|
|
29
|
-
return loadData(
|
|
27
|
+
const localLoadData = (props) => {
|
|
28
|
+
const data = GridDataGet(props, fieldTemplate);
|
|
29
|
+
return loadData(data);
|
|
30
30
|
};
|
|
31
31
|
const refs = useCombinedRefs(mRef, (ref) => {
|
|
32
32
|
if (ref == null)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DataTypes } from '@etsoo/shared';
|
|
2
3
|
import { ListChildComponentProps } from 'react-window';
|
|
3
4
|
import { GridMethodRef } from '../GridMethodRef';
|
|
4
5
|
import { ScrollerListExInnerItemRendererProps } from '../ScrollerListEx';
|
|
5
6
|
import { DataGridPageProps } from './DataGridPageProps';
|
|
6
|
-
import { SearchPageProps } from './SearchPageProps';
|
|
7
7
|
/**
|
|
8
8
|
* Response page props
|
|
9
9
|
*/
|
|
10
|
-
export interface ResponsePageProps<T> extends
|
|
10
|
+
export interface ResponsePageProps<T, F extends DataTypes.BasicTemplate> extends Omit<DataGridPageProps<T, F>, 'mRef' | 'itemKey' | 'onScroll' | 'onItemsRendered'> {
|
|
11
11
|
/**
|
|
12
12
|
* Min width to show Datagrid
|
|
13
13
|
*/
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DataTypes } from '@etsoo/shared';
|
|
2
3
|
import { GridJsonData, GridLoader } from '../../components/GridLoader';
|
|
3
4
|
import { CommonPageProps } from './CommonPageProps';
|
|
4
5
|
/**
|
|
5
6
|
* Search page props
|
|
6
7
|
*/
|
|
7
|
-
export interface SearchPageProps<T> extends Omit<GridLoader<T>, 'loadData'> {
|
|
8
|
+
export interface SearchPageProps<T, F extends DataTypes.BasicTemplate> extends Omit<GridLoader<T>, 'loadData'> {
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* Search fields
|
|
10
11
|
*/
|
|
11
12
|
fields: React.ReactElement[];
|
|
13
|
+
/**
|
|
14
|
+
* Search field template
|
|
15
|
+
*/
|
|
16
|
+
fieldTemplate?: F;
|
|
12
17
|
/**
|
|
13
18
|
* Load data callback
|
|
14
19
|
*/
|
|
15
|
-
loadData: (data: GridJsonData) => PromiseLike<T[] | null | undefined>;
|
|
20
|
+
loadData: (data: GridJsonData & DataTypes.BasicTemplateType<F>) => PromiseLike<T[] | null | undefined>;
|
|
16
21
|
/**
|
|
17
22
|
* Page props
|
|
18
23
|
*/
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DataTypes } from '@etsoo/shared';
|
|
2
3
|
import { TablePageProps } from './TablePageProps';
|
|
3
4
|
/**
|
|
4
5
|
* Table page
|
|
5
6
|
* @param props Props
|
|
6
7
|
* @returns Component
|
|
7
8
|
*/
|
|
8
|
-
export declare function TablePage<T>(props: TablePageProps<T>): JSX.Element;
|
|
9
|
+
export declare function TablePage<T, F extends DataTypes.BasicTemplate>(props: TablePageProps<T, F>): JSX.Element;
|
|
@@ -15,7 +15,7 @@ import { CommonPage, CommonPagePullContainer, CommonPageScrollContainer } from '
|
|
|
15
15
|
export function TablePage(props) {
|
|
16
16
|
var _a;
|
|
17
17
|
// Destruct
|
|
18
|
-
const { columns, fields, loadData, mRef, sizeReadyMiliseconds = 100, pageProps = {}, ...rest } = props;
|
|
18
|
+
const { columns, fields, fieldTemplate, loadData, mRef, sizeReadyMiliseconds = 100, pageProps = {}, ...rest } = props;
|
|
19
19
|
(_a = pageProps.paddings) !== null && _a !== void 0 ? _a : (pageProps.paddings = MUGlobal.pagePaddings);
|
|
20
20
|
// States
|
|
21
21
|
const [states] = React.useState({});
|
|
@@ -37,9 +37,9 @@ export function TablePage(props) {
|
|
|
37
37
|
states.data = data;
|
|
38
38
|
reset();
|
|
39
39
|
};
|
|
40
|
-
const localLoadData = (
|
|
41
|
-
const
|
|
42
|
-
return loadData(
|
|
40
|
+
const localLoadData = (props) => {
|
|
41
|
+
const data = GridDataGet(props, fieldTemplate);
|
|
42
|
+
return loadData(data);
|
|
43
43
|
};
|
|
44
44
|
// Total width
|
|
45
45
|
const totalWidth = React.useMemo(() => columns.reduce((previousValue, { width, minWidth }) => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { TableExProps } from '../TableEx';
|
|
2
3
|
import { SearchPageProps } from './SearchPageProps';
|
|
3
4
|
/**
|
|
4
5
|
* Table page props
|
|
5
6
|
*/
|
|
6
|
-
export interface TablePageProps<T> extends SearchPageProps<T>, Omit<TableExProps<T>, 'loadData'> {
|
|
7
|
+
export interface TablePageProps<T, F extends DataTypes.BasicTemplate> extends SearchPageProps<T, F>, Omit<TableExProps<T>, 'loadData'> {
|
|
7
8
|
}
|
|
@@ -15,7 +15,7 @@ export interface CultureCalls extends IUpdate<ICulture, CultureAction> {
|
|
|
15
15
|
* Key value
|
|
16
16
|
* @param key Item key
|
|
17
17
|
*/
|
|
18
|
-
get<T
|
|
18
|
+
get<T = string>(key: string): T | undefined;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Culture provider props
|
|
@@ -15,7 +15,7 @@ export declare type IdStateRouterProps<T extends DataTypes.IdType = number> = St
|
|
|
15
15
|
/**
|
|
16
16
|
* State router props, include data in location.state
|
|
17
17
|
*/
|
|
18
|
-
export declare type StateRouterProps<T extends Readonly<
|
|
18
|
+
export declare type StateRouterProps<T extends Readonly<DataTypes.StringRecord>> = RouteComponentProps<{
|
|
19
19
|
location: {
|
|
20
20
|
state: T;
|
|
21
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.36",
|
|
4
4
|
"description": "TypeScript ReactJs framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
"@emotion/react": "^11.4.1",
|
|
45
45
|
"@emotion/style": "^0.8.0",
|
|
46
46
|
"@emotion/styled": "^11.3.0",
|
|
47
|
-
"@etsoo/appscript": "^1.1.
|
|
48
|
-
"@etsoo/notificationbase": "^1.0.
|
|
49
|
-
"@etsoo/shared": "^1.0.
|
|
50
|
-
"@mui/icons-material": "^5.0.
|
|
51
|
-
"@mui/material": "^5.0.
|
|
47
|
+
"@etsoo/appscript": "^1.1.9",
|
|
48
|
+
"@etsoo/notificationbase": "^1.0.84",
|
|
49
|
+
"@etsoo/shared": "^1.0.51",
|
|
50
|
+
"@mui/icons-material": "^5.0.4",
|
|
51
|
+
"@mui/material": "^5.0.4",
|
|
52
52
|
"@reach/router": "^1.3.4",
|
|
53
53
|
"@types/pica": "^5.1.3",
|
|
54
54
|
"@types/pulltorefreshjs": "^0.1.5",
|
|
55
55
|
"@types/reach__router": "^1.3.9",
|
|
56
|
-
"@types/react": "^17.0.
|
|
56
|
+
"@types/react": "^17.0.30",
|
|
57
57
|
"@types/react-avatar-editor": "^10.3.6",
|
|
58
58
|
"@types/react-dom": "^17.0.9",
|
|
59
59
|
"@types/react-input-mask": "^3.0.1",
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
"@types/react-test-renderer": "^17.0.1",
|
|
78
78
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
79
79
|
"@typescript-eslint/parser": "^5.0.0",
|
|
80
|
-
"eslint": "^8.0.
|
|
80
|
+
"eslint": "^8.0.1",
|
|
81
81
|
"eslint-config-airbnb-base": "^14.2.1",
|
|
82
|
-
"eslint-plugin-import": "^2.25.
|
|
82
|
+
"eslint-plugin-import": "^2.25.2",
|
|
83
83
|
"eslint-plugin-react": "^7.26.1",
|
|
84
84
|
"jest": "^27.2.5",
|
|
85
85
|
"react-test-renderer": "^17.0.2",
|
|
86
|
-
"ts-jest": "^27.0.
|
|
87
|
-
"typescript": "^4.4.
|
|
86
|
+
"ts-jest": "^27.0.6",
|
|
87
|
+
"typescript": "^4.4.4"
|
|
88
88
|
}
|
|
89
89
|
}
|
package/src/app/Labels.ts
CHANGED
|
@@ -54,9 +54,9 @@ export namespace Labels {
|
|
|
54
54
|
* setLabelReference key reference
|
|
55
55
|
*/
|
|
56
56
|
export interface setLabelsReference {
|
|
57
|
-
commonPage?: DataTypes.
|
|
58
|
-
notificationMU?: DataTypes.
|
|
59
|
-
userAvatarEditor?: DataTypes.
|
|
57
|
+
commonPage?: DataTypes.StringDictionary;
|
|
58
|
+
notificationMU?: DataTypes.StringDictionary;
|
|
59
|
+
userAvatarEditor?: DataTypes.StringDictionary;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -65,7 +65,7 @@ export namespace Labels {
|
|
|
65
65
|
* @param reference Key reference
|
|
66
66
|
*/
|
|
67
67
|
export const setLabels = (
|
|
68
|
-
labels:
|
|
68
|
+
labels: {},
|
|
69
69
|
reference: setLabelsReference = {}
|
|
70
70
|
) => {
|
|
71
71
|
Utils.setLabels(CommonPage, labels, reference.commonPage);
|
package/src/app/ReactApp.ts
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
} from '@etsoo/appscript';
|
|
8
8
|
import { DataTypes } from '@etsoo/shared';
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import { NotifierPromptProps } from '../mu/NotifierPromptProps';
|
|
11
10
|
import { NotificationReactCallProps } from '../notifier/Notifier';
|
|
12
11
|
import { CultureAction } from '../states/CultureState';
|
|
13
12
|
import { IStateProps } from '../states/IState';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DomUtils } from '@etsoo/shared';
|
|
1
|
+
import { DataTypes, DomUtils } from '@etsoo/shared';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Grid size
|
|
@@ -18,31 +18,42 @@ export const GridSizeGet = (size: GridSize, input: number) => {
|
|
|
18
18
|
/**
|
|
19
19
|
* Grid data type
|
|
20
20
|
*/
|
|
21
|
-
export type GridData = FormData |
|
|
21
|
+
export type GridData = FormData | DataTypes.StringRecord;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Grid data get
|
|
24
|
+
* Grid data get with format
|
|
25
25
|
* @param data Data
|
|
26
26
|
* @returns Json data
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
export function GridDataGet<F extends DataTypes.BasicTemplate>(
|
|
29
|
+
props: GridLoadDataProps,
|
|
30
|
+
template?: F
|
|
31
|
+
): GridJsonData & DataTypes.BasicTemplateType<F> {
|
|
32
|
+
// Destruct
|
|
33
|
+
const { data, ...rest } = props;
|
|
34
|
+
|
|
35
|
+
// Conditions
|
|
36
|
+
let conditions: DataTypes.BasicTemplateType<F> = {};
|
|
37
|
+
|
|
38
|
+
// Cast data
|
|
39
|
+
if (data != null && template != null) {
|
|
40
|
+
if (data instanceof FormData) {
|
|
41
|
+
// Clear empty value
|
|
42
|
+
DomUtils.clearFormData(data);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Set keepSource to true to hold form data, even they are invisible from the conditions
|
|
46
|
+
conditions = DomUtils.dataAs(data, template, true);
|
|
35
47
|
}
|
|
36
48
|
|
|
37
|
-
|
|
38
|
-
};
|
|
49
|
+
// DomUtils.dataAs(data, template);
|
|
50
|
+
return { ...conditions, ...rest };
|
|
51
|
+
}
|
|
39
52
|
|
|
40
53
|
/**
|
|
41
54
|
* Grid Json data
|
|
42
55
|
*/
|
|
43
|
-
export interface GridJsonData
|
|
44
|
-
extends Omit<GridLoadDataProps, 'data'>,
|
|
45
|
-
Record<string, any> {}
|
|
56
|
+
export interface GridJsonData extends Omit<GridLoadDataProps, 'data'> {}
|
|
46
57
|
|
|
47
58
|
/**
|
|
48
59
|
* Grid data load props
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { Box, Stack } from '@mui/material';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { GridDataGet, GridLoadDataProps } from '../../components/GridLoader';
|
|
@@ -22,11 +23,14 @@ interface LocalStates {
|
|
|
22
23
|
* @param props Props
|
|
23
24
|
* @returns Component
|
|
24
25
|
*/
|
|
25
|
-
export function DataGridPage<T>(
|
|
26
|
+
export function DataGridPage<T, F extends DataTypes.BasicTemplate>(
|
|
27
|
+
props: DataGridPageProps<T, F>
|
|
28
|
+
) {
|
|
26
29
|
// Destruct
|
|
27
30
|
const {
|
|
28
31
|
adjustHeight,
|
|
29
32
|
fields,
|
|
33
|
+
fieldTemplate,
|
|
30
34
|
height,
|
|
31
35
|
loadData,
|
|
32
36
|
mRef,
|
|
@@ -58,9 +62,9 @@ export function DataGridPage<T>(props: DataGridPageProps<T>) {
|
|
|
58
62
|
setStates({ data });
|
|
59
63
|
};
|
|
60
64
|
|
|
61
|
-
const localLoadData = (
|
|
62
|
-
const
|
|
63
|
-
return loadData(
|
|
65
|
+
const localLoadData = (props: GridLoadDataProps) => {
|
|
66
|
+
const data = GridDataGet(props, fieldTemplate);
|
|
67
|
+
return loadData(data);
|
|
64
68
|
};
|
|
65
69
|
|
|
66
70
|
// Watch container
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { DataGridExProps } from '../DataGridEx';
|
|
2
3
|
import { SearchPageProps } from './SearchPageProps';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* DataGrid page props
|
|
6
7
|
*/
|
|
7
|
-
export interface DataGridPageProps<T>
|
|
8
|
-
extends SearchPageProps<T>,
|
|
8
|
+
export interface DataGridPageProps<T, F extends DataTypes.BasicTemplate>
|
|
9
|
+
extends SearchPageProps<T, F>,
|
|
9
10
|
Omit<DataGridExProps<T>, 'loadData' | 'height'> {
|
|
10
11
|
/**
|
|
11
12
|
* Height will be deducted
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { Box, Stack } from '@mui/material';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { GridDataGet, GridLoadDataProps } from '../../components/GridLoader';
|
|
@@ -15,8 +16,8 @@ import { ListPageProps } from './ListPageProps';
|
|
|
15
16
|
* @param props Props
|
|
16
17
|
* @returns Component
|
|
17
18
|
*/
|
|
18
|
-
export function FixedListPage<T>(
|
|
19
|
-
props: ListPageProps<T> & {
|
|
19
|
+
export function FixedListPage<T, F extends DataTypes.BasicTemplate>(
|
|
20
|
+
props: ListPageProps<T, F> & {
|
|
20
21
|
/**
|
|
21
22
|
* Height will be deducted
|
|
22
23
|
* @param height Current calcuated height
|
|
@@ -28,6 +29,7 @@ export function FixedListPage<T>(
|
|
|
28
29
|
const {
|
|
29
30
|
adjustHeight,
|
|
30
31
|
fields,
|
|
32
|
+
fieldTemplate,
|
|
31
33
|
loadData,
|
|
32
34
|
mRef,
|
|
33
35
|
sizeReadyMiliseconds = 100,
|
|
@@ -69,9 +71,9 @@ export function FixedListPage<T>(
|
|
|
69
71
|
reset();
|
|
70
72
|
};
|
|
71
73
|
|
|
72
|
-
const localLoadData = (
|
|
73
|
-
const
|
|
74
|
-
return loadData(
|
|
74
|
+
const localLoadData = (props: GridLoadDataProps) => {
|
|
75
|
+
const data = GridDataGet(props, fieldTemplate);
|
|
76
|
+
return loadData(data);
|
|
75
77
|
};
|
|
76
78
|
|
|
77
79
|
// Watch container
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { Box, Stack } from '@mui/material';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { GridDataGet, GridLoadDataProps } from '../../components/GridLoader';
|
|
@@ -18,9 +19,18 @@ import { ListPageProps } from './ListPageProps';
|
|
|
18
19
|
* @param props Props
|
|
19
20
|
* @returns Component
|
|
20
21
|
*/
|
|
21
|
-
export function ListPage<T>(
|
|
22
|
+
export function ListPage<T, F extends DataTypes.BasicTemplate>(
|
|
23
|
+
props: ListPageProps<T, F>
|
|
24
|
+
) {
|
|
22
25
|
// Destruct
|
|
23
|
-
const {
|
|
26
|
+
const {
|
|
27
|
+
fields,
|
|
28
|
+
fieldTemplate,
|
|
29
|
+
loadData,
|
|
30
|
+
mRef,
|
|
31
|
+
pageProps = {},
|
|
32
|
+
...rest
|
|
33
|
+
} = props;
|
|
24
34
|
|
|
25
35
|
pageProps.paddings ??= MUGlobal.pagePaddings;
|
|
26
36
|
|
|
@@ -51,9 +61,9 @@ export function ListPage<T>(props: ListPageProps<T>) {
|
|
|
51
61
|
reset();
|
|
52
62
|
};
|
|
53
63
|
|
|
54
|
-
const localLoadData = (
|
|
55
|
-
const
|
|
56
|
-
return loadData(
|
|
64
|
+
const localLoadData = (props: GridLoadDataProps) => {
|
|
65
|
+
const data = GridDataGet(props, fieldTemplate);
|
|
66
|
+
return loadData(data);
|
|
57
67
|
};
|
|
58
68
|
|
|
59
69
|
// Layout
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { ScrollerListExProps } from '../ScrollerListEx';
|
|
2
3
|
import { SearchPageProps } from './SearchPageProps';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* List page props
|
|
6
7
|
*/
|
|
7
|
-
export interface ListPageProps<T>
|
|
8
|
-
extends SearchPageProps<T>,
|
|
8
|
+
export interface ListPageProps<T, F extends DataTypes.BasicTemplate>
|
|
9
|
+
extends SearchPageProps<T, F>,
|
|
9
10
|
Omit<ScrollerListExProps<T>, 'loadData'> {}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { Box, Stack } from '@mui/material';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { GridDataGet, GridLoadDataProps } from '../../components/GridLoader';
|
|
@@ -23,13 +24,16 @@ interface LocalStates {
|
|
|
23
24
|
* @param props Props
|
|
24
25
|
* @returns Component
|
|
25
26
|
*/
|
|
26
|
-
export function ResponsivePage<T>(
|
|
27
|
+
export function ResponsivePage<T, F extends DataTypes.BasicTemplate>(
|
|
28
|
+
props: ResponsePageProps<T, F>
|
|
29
|
+
) {
|
|
27
30
|
// Destruct
|
|
28
31
|
const {
|
|
29
32
|
adjustHeight,
|
|
30
33
|
columns,
|
|
31
34
|
dataGridMinWidth = DataGridExCalColumns(columns).total,
|
|
32
35
|
fields,
|
|
36
|
+
fieldTemplate,
|
|
33
37
|
height,
|
|
34
38
|
loadData,
|
|
35
39
|
innerItemRenderer,
|
|
@@ -52,9 +56,9 @@ export function ResponsivePage<T>(props: ResponsePageProps<T>) {
|
|
|
52
56
|
}
|
|
53
57
|
);
|
|
54
58
|
|
|
55
|
-
const localLoadData = (
|
|
56
|
-
const
|
|
57
|
-
return loadData(
|
|
59
|
+
const localLoadData = (props: GridLoadDataProps) => {
|
|
60
|
+
const data = GridDataGet(props, fieldTemplate);
|
|
61
|
+
return loadData(data);
|
|
58
62
|
};
|
|
59
63
|
|
|
60
64
|
const refs = useCombinedRefs(mRef, (ref: GridMethodRef) => {
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { ListChildComponentProps } from 'react-window';
|
|
2
3
|
import { GridMethodRef } from '../GridMethodRef';
|
|
3
4
|
import { ScrollerListExInnerItemRendererProps } from '../ScrollerListEx';
|
|
4
5
|
import { DataGridPageProps } from './DataGridPageProps';
|
|
5
|
-
import { SearchPageProps } from './SearchPageProps';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Response page props
|
|
9
9
|
*/
|
|
10
|
-
export interface ResponsePageProps<T>
|
|
11
|
-
extends
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
> {
|
|
10
|
+
export interface ResponsePageProps<T, F extends DataTypes.BasicTemplate>
|
|
11
|
+
extends Omit<
|
|
12
|
+
DataGridPageProps<T, F>,
|
|
13
|
+
'mRef' | 'itemKey' | 'onScroll' | 'onItemsRendered'
|
|
14
|
+
> {
|
|
16
15
|
/**
|
|
17
16
|
* Min width to show Datagrid
|
|
18
17
|
*/
|
|
@@ -1,19 +1,28 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { GridJsonData, GridLoader } from '../../components/GridLoader';
|
|
2
3
|
import { CommonPageProps } from './CommonPageProps';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Search page props
|
|
6
7
|
*/
|
|
7
|
-
export interface SearchPageProps<T
|
|
8
|
+
export interface SearchPageProps<T, F extends DataTypes.BasicTemplate>
|
|
9
|
+
extends Omit<GridLoader<T>, 'loadData'> {
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
11
|
+
* Search fields
|
|
10
12
|
*/
|
|
11
13
|
fields: React.ReactElement[];
|
|
12
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Search field template
|
|
17
|
+
*/
|
|
18
|
+
fieldTemplate?: F;
|
|
19
|
+
|
|
13
20
|
/**
|
|
14
21
|
* Load data callback
|
|
15
22
|
*/
|
|
16
|
-
loadData: (
|
|
23
|
+
loadData: (
|
|
24
|
+
data: GridJsonData & DataTypes.BasicTemplateType<F>
|
|
25
|
+
) => PromiseLike<T[] | null | undefined>;
|
|
17
26
|
|
|
18
27
|
/**
|
|
19
28
|
* Page props
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { Box, Stack } from '@mui/material';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { GridDataGet, GridLoadDataProps } from '../../components/GridLoader';
|
|
@@ -18,11 +19,14 @@ import { TablePageProps } from './TablePageProps';
|
|
|
18
19
|
* @param props Props
|
|
19
20
|
* @returns Component
|
|
20
21
|
*/
|
|
21
|
-
export function TablePage<T>(
|
|
22
|
+
export function TablePage<T, F extends DataTypes.BasicTemplate>(
|
|
23
|
+
props: TablePageProps<T, F>
|
|
24
|
+
) {
|
|
22
25
|
// Destruct
|
|
23
26
|
const {
|
|
24
27
|
columns,
|
|
25
28
|
fields,
|
|
29
|
+
fieldTemplate,
|
|
26
30
|
loadData,
|
|
27
31
|
mRef,
|
|
28
32
|
sizeReadyMiliseconds = 100,
|
|
@@ -59,9 +63,9 @@ export function TablePage<T>(props: TablePageProps<T>) {
|
|
|
59
63
|
reset();
|
|
60
64
|
};
|
|
61
65
|
|
|
62
|
-
const localLoadData = (
|
|
63
|
-
const
|
|
64
|
-
return loadData(
|
|
66
|
+
const localLoadData = (props: GridLoadDataProps) => {
|
|
67
|
+
const data = GridDataGet(props, fieldTemplate);
|
|
68
|
+
return loadData(data);
|
|
65
69
|
};
|
|
66
70
|
|
|
67
71
|
// Total width
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { DataTypes } from '@etsoo/shared';
|
|
1
2
|
import { TableExProps } from '../TableEx';
|
|
2
3
|
import { SearchPageProps } from './SearchPageProps';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Table page props
|
|
6
7
|
*/
|
|
7
|
-
export interface TablePageProps<T>
|
|
8
|
-
extends SearchPageProps<T>,
|
|
8
|
+
export interface TablePageProps<T, F extends DataTypes.BasicTemplate>
|
|
9
|
+
extends SearchPageProps<T, F>,
|
|
9
10
|
Omit<TableExProps<T>, 'loadData'> {}
|
|
@@ -16,7 +16,7 @@ export interface CultureCalls extends IUpdate<ICulture, CultureAction> {
|
|
|
16
16
|
* Key value
|
|
17
17
|
* @param key Item key
|
|
18
18
|
*/
|
|
19
|
-
get<T
|
|
19
|
+
get<T = string>(key: string): T | undefined;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -30,7 +30,7 @@ const calls = {
|
|
|
30
30
|
* Key value
|
|
31
31
|
* @param key Item key
|
|
32
32
|
*/
|
|
33
|
-
get<T
|
|
33
|
+
get<T = string>(key: string) {
|
|
34
34
|
const value = this.state.resources[key];
|
|
35
35
|
if (value == null) return undefined;
|
|
36
36
|
return value as T;
|
|
@@ -16,7 +16,7 @@ export type IdStateRouterProps<T extends DataTypes.IdType = number> =
|
|
|
16
16
|
/**
|
|
17
17
|
* State router props, include data in location.state
|
|
18
18
|
*/
|
|
19
|
-
export type StateRouterProps<T extends Readonly<
|
|
19
|
+
export type StateRouterProps<T extends Readonly<DataTypes.StringRecord>> =
|
|
20
20
|
RouteComponentProps<{
|
|
21
21
|
location: { state: T };
|
|
22
22
|
}>;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @returns Callback
|
|
5
5
|
*/
|
|
6
6
|
export default function useCombinedRefs(
|
|
7
|
-
...refs: (React.Ref<
|
|
7
|
+
...refs: (React.Ref<unknown> | undefined)[]
|
|
8
8
|
) {
|
|
9
|
-
return (target:
|
|
9
|
+
return (target: unknown) => {
|
|
10
10
|
// Ignore null reference
|
|
11
11
|
if (target == null) return;
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ export default function useCombinedRefs(
|
|
|
20
20
|
ref(target);
|
|
21
21
|
} else {
|
|
22
22
|
// as any to update readonly property
|
|
23
|
-
(ref
|
|
23
|
+
Reflect.set(ref, 'current', target);
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
};
|