@etsoo/materialui 1.0.78 → 1.0.79
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/AutocompleteExtendedProps.d.ts +1 -1
- package/lib/ButtonLink.d.ts +1 -1
- package/lib/ComboBox.d.ts +1 -1
- package/lib/ComboBox.js +2 -1
- package/lib/CountdownButton.d.ts +1 -1
- package/lib/CustomFabProps.d.ts +1 -1
- package/lib/DataGridEx.d.ts +2 -2
- package/lib/DataSteps.d.ts +2 -2
- package/lib/EmailInput.d.ts +1 -1
- package/lib/FabBox.d.ts +1 -1
- package/lib/HiSelector.d.ts +1 -1
- package/lib/IconButtonLink.d.ts +1 -1
- package/lib/InputField.d.ts +1 -1
- package/lib/ListChooser.d.ts +2 -2
- package/lib/LoadingButton.d.ts +1 -1
- package/lib/MUGlobal.d.ts +1 -1
- package/lib/MaskInput.d.ts +1 -1
- package/lib/NotifierPromptProps.d.ts +1 -1
- package/lib/OptionGroup.d.ts +1 -1
- package/lib/ResponsibleContainer.d.ts +1 -1
- package/lib/ScrollerListEx.d.ts +2 -2
- package/lib/SearchField.d.ts +1 -1
- package/lib/SelectBool.d.ts +1 -1
- package/lib/SelectEx.d.ts +1 -1
- package/lib/TableEx.d.ts +1 -1
- package/lib/TextFieldEx.d.ts +1 -1
- package/lib/Tiplist.d.ts +1 -1
- package/lib/Tiplist.js +1 -1
- package/lib/TwoFieldInput.d.ts +2 -2
- package/lib/app/IServiceUser.d.ts +1 -1
- package/lib/app/ISmartERPUser.d.ts +1 -1
- package/lib/app/ReactApp.d.ts +1 -1
- package/lib/app/ReactApp.js +22 -16
- package/lib/app/ServiceApp.js +9 -9
- package/lib/pages/DataGridPageProps.d.ts +1 -1
- package/lib/pages/ListPageProps.d.ts +1 -1
- package/lib/pages/ResponsivePageProps.d.ts +1 -1
- package/lib/pages/SearchPageProps.d.ts +1 -1
- package/lib/pages/TablePageProps.d.ts +1 -1
- package/lib/pages/ViewPage.d.ts +3 -3
- package/package.json +14 -14
- package/src/ComboBox.tsx +1 -1
- package/src/ListChooser.tsx +1 -1
- package/src/Tiplist.tsx +1 -1
- package/src/app/ReactApp.ts +9 -5
|
@@ -4,7 +4,7 @@ import { ChangeEventHandler } from 'react';
|
|
|
4
4
|
/**
|
|
5
5
|
* Autocomplete extended props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type AutocompleteExtendedProps<T extends object, D extends DataTypes.Keys<T>> = Omit<AutocompleteProps<T, undefined, false, false>, 'renderInput' | 'options' | 'multiple'> & {
|
|
8
8
|
/**
|
|
9
9
|
* Id field
|
|
10
10
|
*/
|
package/lib/ButtonLink.d.ts
CHANGED
package/lib/ComboBox.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { AutocompleteExtendedProps } from './AutocompleteExtendedProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* ComboBox props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type ComboBoxProps<T extends object, D extends DataTypes.Keys<T>, L extends DataTypes.Keys<T, string>> = AutocompleteExtendedProps<T, D> & {
|
|
8
8
|
/**
|
|
9
9
|
* Auto add blank item
|
|
10
10
|
*/
|
package/lib/ComboBox.js
CHANGED
|
@@ -12,7 +12,8 @@ import { ReactUtils } from '@etsoo/react';
|
|
|
12
12
|
*/
|
|
13
13
|
export function ComboBox(props) {
|
|
14
14
|
// Destruct
|
|
15
|
-
const { search = false, autoAddBlankItem = search, idField = 'id', idValue, inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputVariant, defaultValue, label, labelField = 'label', loadData, onLoadData, name, inputAutoComplete = '
|
|
15
|
+
const { search = false, autoAddBlankItem = search, idField = 'id', idValue, inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputVariant, defaultValue, label, labelField = 'label', loadData, onLoadData, name, inputAutoComplete = 'new-password', // disable autocomplete and autofill, 'off' does not work
|
|
16
|
+
options, dataReadonly = true, readOnly, onChange, openOnFocus = true, value, getOptionLabel = (option) => `${option[labelField]}`, sx = { minWidth: '150px' }, ...rest } = props;
|
|
16
17
|
// Value input ref
|
|
17
18
|
const inputRef = React.createRef();
|
|
18
19
|
// Options state
|
package/lib/CountdownButton.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface CountdownButtonAction {
|
|
|
9
9
|
/**
|
|
10
10
|
* Countdown button props
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type CountdownButtonProps = Omit<ButtonProps, 'endIcon' | 'disabled'> & {
|
|
13
13
|
/**
|
|
14
14
|
* Action, required
|
|
15
15
|
*/
|
package/lib/CustomFabProps.d.ts
CHANGED
package/lib/DataGridEx.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { MouseEventWithDataHandler } from './MUGlobal';
|
|
|
5
5
|
/**
|
|
6
6
|
* Footer item renderer props
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type DataGridExFooterItemRendererProps<T extends object> = {
|
|
9
9
|
column: GridColumn<T>;
|
|
10
10
|
index: number;
|
|
11
11
|
states: GridLoaderStates<T>;
|
|
@@ -15,7 +15,7 @@ export declare type DataGridExFooterItemRendererProps<T extends object> = {
|
|
|
15
15
|
/**
|
|
16
16
|
* Extended DataGrid with VariableSizeGrid props
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type DataGridExProps<T extends object, D extends DataTypes.Keys<T>> = Omit<ScrollerGridProps<T, D>, 'itemRenderer' | 'columnCount' | 'columnWidth' | 'width'> & {
|
|
19
19
|
/**
|
|
20
20
|
* Alternating colors for odd/even rows
|
|
21
21
|
*/
|
package/lib/DataSteps.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { InputDialogProps } from '@etsoo/react';
|
|
|
4
4
|
/**
|
|
5
5
|
* Data step
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type DataStep = Omit<InputDialogProps, 'callback'> & {
|
|
8
8
|
/**
|
|
9
9
|
* Callback
|
|
10
10
|
*/
|
|
@@ -13,7 +13,7 @@ export declare type DataStep = Omit<InputDialogProps, 'callback'> & {
|
|
|
13
13
|
/**
|
|
14
14
|
* Data collecting steps component props
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type DataStepsProps<T extends object> = Omit<TextFieldProps, 'InputProps' | 'onClick'> & {
|
|
17
17
|
/**
|
|
18
18
|
* JSON value
|
|
19
19
|
*/
|
package/lib/EmailInput.d.ts
CHANGED
package/lib/FabBox.d.ts
CHANGED
package/lib/HiSelector.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
/**
|
|
5
5
|
* Hierarchy selector props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type HiSelectorProps<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>> = {
|
|
8
8
|
/**
|
|
9
9
|
* Id field
|
|
10
10
|
*/
|
package/lib/IconButtonLink.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { IconButtonProps } from '@mui/material';
|
|
|
3
3
|
/**
|
|
4
4
|
* IconButtonLink props
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type IconButtonLinkProps = Omit<IconButtonProps, 'href' | 'onClick'> & {
|
|
7
7
|
/**
|
|
8
8
|
* To href
|
|
9
9
|
*/
|
package/lib/InputField.d.ts
CHANGED
package/lib/ListChooser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataTypes, DelayedExecutorType, IdDefaultType } from '@etsoo/shared';
|
|
2
2
|
import { ListItemButtonProps, ListProps } from '@mui/material';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
|
|
4
|
+
type QueryData = {
|
|
5
5
|
title?: string;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
@@ -13,7 +13,7 @@ export interface ListChooserButtonProps<T extends object, D extends DataTypes.Ke
|
|
|
13
13
|
/**
|
|
14
14
|
* List chooser props
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type ListChooserProps<T extends object, D extends DataTypes.Keys<T>, Q extends object> = ListProps & {
|
|
17
17
|
/**
|
|
18
18
|
* Condition renderer
|
|
19
19
|
*/
|
package/lib/LoadingButton.d.ts
CHANGED
package/lib/MUGlobal.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ListItemButtonProps, Theme } from '@mui/material';
|
|
|
3
3
|
/**
|
|
4
4
|
* Mouse event handler with data
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type MouseEventWithDataHandler<T> = (event: React.MouseEvent<HTMLDivElement>, data: T) => void;
|
|
7
7
|
/**
|
|
8
8
|
* MUGlobal for global configurations
|
|
9
9
|
*/
|
package/lib/MaskInput.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TextFieldProps } from '@mui/material';
|
|
|
3
3
|
/**
|
|
4
4
|
* Mask input props
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type MaskInputProps<T extends IMask.AnyMaskedOptions> = TextFieldProps & {
|
|
7
7
|
/**
|
|
8
8
|
* Mask props
|
|
9
9
|
*/
|
package/lib/OptionGroup.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface OptionGroupRef {
|
|
|
14
14
|
/**
|
|
15
15
|
* OptionGroup props
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type OptionGroupProps<T extends object, D extends DataTypes.Keys<T>, L extends DataTypes.Keys<T, string>> = Omit<FormControlProps<'fieldset'>, 'defaultValue'> & {
|
|
18
18
|
/**
|
|
19
19
|
* Default value
|
|
20
20
|
*/
|
|
@@ -8,7 +8,7 @@ import { ScrollerListExInnerItemRendererProps, ScrollerListExItemSize } from './
|
|
|
8
8
|
/**
|
|
9
9
|
* ResponsibleContainer props
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type ResponsibleContainerProps<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate, D extends DataTypes.Keys<T> = IdDefaultType<T>> = Omit<DataGridExProps<T, D>, 'height' | 'itemKey' | 'loadData' | 'mRef' | 'onScroll' | 'onItemsRendered'> & {
|
|
12
12
|
/**
|
|
13
13
|
* Height will be deducted
|
|
14
14
|
* @param height Current calcuated height
|
package/lib/ScrollerListEx.d.ts
CHANGED
|
@@ -30,11 +30,11 @@ export interface ScrollerListExInnerItemRendererProps<T> extends ListChildCompon
|
|
|
30
30
|
* 2. Static sets
|
|
31
31
|
* 3. Dynamic calculation
|
|
32
32
|
*/
|
|
33
|
-
export
|
|
33
|
+
export 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 type ScrollerListExProps<T extends object, D extends DataTypes.Keys<T>> = Omit<ScrollerListProps<T, D>, 'itemRenderer' | 'itemSize'> & {
|
|
38
38
|
/**
|
|
39
39
|
* Alternating colors for odd/even rows
|
|
40
40
|
*/
|
package/lib/SearchField.d.ts
CHANGED
package/lib/SelectBool.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { SelectExProps } from './SelectEx';
|
|
|
4
4
|
/**
|
|
5
5
|
* SelectBool props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type SelectBoolProps = Omit<SelectExProps<ListType1>, 'options' | 'loadData'>;
|
|
8
8
|
/**
|
|
9
9
|
* SelectBool (yes/no)
|
|
10
10
|
* @param props Props
|
package/lib/SelectEx.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { DataTypes, IdDefaultType, LabelDefaultType, ListType } from '@etsoo/sha
|
|
|
4
4
|
/**
|
|
5
5
|
* Extended select component props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type SelectExProps<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>> = Omit<SelectProps, 'labelId' | 'input' | 'native'> & {
|
|
8
8
|
/**
|
|
9
9
|
* Auto add blank item
|
|
10
10
|
*/
|
package/lib/TableEx.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface TableExMethodRef<T> extends GridMethodRef<T> {
|
|
|
19
19
|
/**
|
|
20
20
|
* Extended table props
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export type TableExProps<T extends object, D extends DataTypes.Keys<T>> = TableProps & GridLoader<T> & {
|
|
23
23
|
/**
|
|
24
24
|
* Alternating colors for odd/even rows
|
|
25
25
|
*/
|
package/lib/TextFieldEx.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TextFieldProps } from '@mui/material';
|
|
|
3
3
|
/**
|
|
4
4
|
* Extended text field props
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type TextFieldExProps = TextFieldProps & {
|
|
7
7
|
/**
|
|
8
8
|
* Change delay (ms) to avoid repeatly dispatch onChange
|
|
9
9
|
*/
|
package/lib/Tiplist.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { AutocompleteExtendedProps } from './AutocompleteExtendedProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* Tiplist props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type TiplistProps<T extends object, D extends DataTypes.Keys<T>> = Omit<AutocompleteExtendedProps<T, D>, 'open'> & {
|
|
8
8
|
/**
|
|
9
9
|
* Load data callback
|
|
10
10
|
*/
|
package/lib/Tiplist.js
CHANGED
|
@@ -11,7 +11,7 @@ import { SearchField } from './SearchField';
|
|
|
11
11
|
*/
|
|
12
12
|
export function Tiplist(props) {
|
|
13
13
|
// Destruct
|
|
14
|
-
const { search = false, idField = 'id', idValue, inputAutoComplete = '
|
|
14
|
+
const { search = false, idField = 'id', idValue, inputAutoComplete = 'new-password', inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputVariant, label, loadData, defaultValue, value, name, readOnly, onChange, openOnFocus = true, sx = { minWidth: '180px' }, ...rest } = props;
|
|
15
15
|
// Value input ref
|
|
16
16
|
const inputRef = React.createRef();
|
|
17
17
|
// Local value
|
package/lib/TwoFieldInput.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputFieldProps } from './InputField';
|
|
3
|
-
|
|
3
|
+
type ValueType = string | number | Date | null | undefined;
|
|
4
4
|
/**
|
|
5
5
|
* TwoField Input props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type TwoFieldInputProps = Omit<InputFieldProps, 'InputProps' | 'value'> & {
|
|
8
8
|
/**
|
|
9
9
|
* Values
|
|
10
10
|
*/
|
|
@@ -11,4 +11,4 @@ export interface IServiceUser extends IUser {
|
|
|
11
11
|
/**
|
|
12
12
|
* Service user login result
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type ServiceLoginResult<U extends IServiceUser = IServiceUser> = IActionResult<U>;
|
package/lib/app/ReactApp.d.ts
CHANGED
package/lib/app/ReactApp.js
CHANGED
|
@@ -51,6 +51,17 @@ export function ReactAppStateDetector(props) {
|
|
|
51
51
|
* React application
|
|
52
52
|
*/
|
|
53
53
|
export class ReactApp extends CoreApp {
|
|
54
|
+
/**
|
|
55
|
+
* Get notifier provider
|
|
56
|
+
*/
|
|
57
|
+
static get notifierProvider() {
|
|
58
|
+
return this._notifierProvider;
|
|
59
|
+
}
|
|
60
|
+
static createNotifier() {
|
|
61
|
+
// Notifier
|
|
62
|
+
ReactApp._notifierProvider = NotifierMU.setup();
|
|
63
|
+
return NotifierMU.instance;
|
|
64
|
+
}
|
|
54
65
|
/**
|
|
55
66
|
* Constructor
|
|
56
67
|
* @param settings Settings
|
|
@@ -71,17 +82,6 @@ export class ReactApp extends CoreApp {
|
|
|
71
82
|
this.pageState = new PageState();
|
|
72
83
|
globalApp = this;
|
|
73
84
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Get notifier provider
|
|
76
|
-
*/
|
|
77
|
-
static get notifierProvider() {
|
|
78
|
-
return this._notifierProvider;
|
|
79
|
-
}
|
|
80
|
-
static createNotifier() {
|
|
81
|
-
// Notifier
|
|
82
|
-
ReactApp._notifierProvider = NotifierMU.setup();
|
|
83
|
-
return NotifierMU.instance;
|
|
84
|
-
}
|
|
85
85
|
/**
|
|
86
86
|
* Override alert action result
|
|
87
87
|
* @param result Action result
|
|
@@ -106,7 +106,7 @@ export class ReactApp extends CoreApp {
|
|
|
106
106
|
* @param culture New culture definition
|
|
107
107
|
*/
|
|
108
108
|
changeCulture(culture) {
|
|
109
|
-
var _a, _b
|
|
109
|
+
var _a, _b;
|
|
110
110
|
// Super call to update cultrue
|
|
111
111
|
super.changeCulture(culture);
|
|
112
112
|
// Update component labels
|
|
@@ -122,12 +122,18 @@ export class ReactApp extends CoreApp {
|
|
|
122
122
|
promptOK: 'ok'
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
|
-
// Notify host
|
|
126
|
-
(_a = BridgeUtils.host) === null || _a === void 0 ? void 0 : _a.changeCulture(culture.name);
|
|
127
125
|
// Document title
|
|
128
126
|
// Default is servier name's label or appName label
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
const title = (_b = (_a = this.get(this.name)) !== null && _a !== void 0 ? _a : this.get('appName')) !== null && _b !== void 0 ? _b : this.name;
|
|
128
|
+
const host = BridgeUtils.host;
|
|
129
|
+
if (host) {
|
|
130
|
+
// Notify host
|
|
131
|
+
host.changeCulture(culture.name);
|
|
132
|
+
host.setTitle(title);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
document.title = title;
|
|
136
|
+
}
|
|
131
137
|
}
|
|
132
138
|
/**
|
|
133
139
|
* Change culture extended
|
package/lib/app/ServiceApp.js
CHANGED
|
@@ -9,6 +9,15 @@ import { ReactApp } from './ReactApp';
|
|
|
9
9
|
* Use the new acess token and refresh token to login
|
|
10
10
|
*/
|
|
11
11
|
export class ServiceApp extends ReactApp {
|
|
12
|
+
/**
|
|
13
|
+
* Service user
|
|
14
|
+
*/
|
|
15
|
+
get serviceUser() {
|
|
16
|
+
return this._serviceUser;
|
|
17
|
+
}
|
|
18
|
+
set serviceUser(value) {
|
|
19
|
+
this._serviceUser = value;
|
|
20
|
+
}
|
|
12
21
|
/**
|
|
13
22
|
* Constructor
|
|
14
23
|
* @param settings Settings
|
|
@@ -31,15 +40,6 @@ export class ServiceApp extends ReactApp {
|
|
|
31
40
|
api.baseUrl = settings.serviceEndpoint;
|
|
32
41
|
this.serviceApi = api;
|
|
33
42
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Service user
|
|
36
|
-
*/
|
|
37
|
-
get serviceUser() {
|
|
38
|
-
return this._serviceUser;
|
|
39
|
-
}
|
|
40
|
-
set serviceUser(value) {
|
|
41
|
-
this._serviceUser = value;
|
|
42
|
-
}
|
|
43
43
|
/**
|
|
44
44
|
* Load SmartERP core
|
|
45
45
|
*/
|
|
@@ -4,7 +4,7 @@ import { SearchPageProps } from './SearchPageProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* DataGrid page props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type DataGridPageProps<T extends object, F extends DataTypes.BasicTemplate, D extends DataTypes.Keys<T> = IdDefaultType<T>> = SearchPageProps<T, F> & Omit<DataGridExProps<T, D>, 'loadData' | 'height'> & {
|
|
8
8
|
/**
|
|
9
9
|
* Height will be deducted
|
|
10
10
|
* @param height Current calcuated height
|
|
@@ -4,4 +4,4 @@ import { SearchPageProps } from './SearchPageProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* List page props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type ListPageProps<T extends object, F extends DataTypes.BasicTemplate, D extends DataTypes.Keys<T>> = SearchPageProps<T, F> & Omit<ScrollerListExProps<T, D>, 'loadData'>;
|
|
@@ -7,7 +7,7 @@ import { DataGridPageProps } from './DataGridPageProps';
|
|
|
7
7
|
/**
|
|
8
8
|
* Response page props
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type ResponsePageProps<T extends object, F extends DataTypes.BasicTemplate, D extends DataTypes.Keys<T> = IdDefaultType<T>> = Omit<DataGridPageProps<T, F, D>, 'mRef' | 'itemKey' | 'onScroll' | 'onItemsRendered'> & {
|
|
11
11
|
/**
|
|
12
12
|
* Min width to show Datagrid
|
|
13
13
|
*/
|
|
@@ -5,7 +5,7 @@ import { CommonPageProps } from './CommonPageProps';
|
|
|
5
5
|
/**
|
|
6
6
|
* Search page props
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type SearchPageProps<T extends object, F extends DataTypes.BasicTemplate> = Omit<GridLoader<T>, 'loadData'> & {
|
|
9
9
|
/**
|
|
10
10
|
* Search fields
|
|
11
11
|
*/
|
|
@@ -4,4 +4,4 @@ import { SearchPageProps } from './SearchPageProps';
|
|
|
4
4
|
/**
|
|
5
5
|
* Table page props
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type TablePageProps<T extends object, F extends DataTypes.BasicTemplate, D extends DataTypes.Keys<T>> = SearchPageProps<T, F> & Omit<TableExProps<T, D>, 'loadData'>;
|
package/lib/pages/ViewPage.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { CommonPageProps } from './CommonPageProps';
|
|
|
6
6
|
/**
|
|
7
7
|
* View page row width type
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type ViewPageRowType = boolean | 'default' | 'small' | object;
|
|
10
10
|
/**
|
|
11
11
|
* View page display field
|
|
12
12
|
*/
|
|
@@ -32,11 +32,11 @@ export interface ViewPageField<T extends object> extends GridProps {
|
|
|
32
32
|
*/
|
|
33
33
|
renderProps?: GridColumnRenderProps;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
type ViewPageFieldTypeNarrow<T extends object> = (string & keyof T) | [string & keyof T, GridDataType, GridColumnRenderProps?, ViewPageRowType?] | ViewPageField<T>;
|
|
36
36
|
/**
|
|
37
37
|
* View page field type
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export type ViewPageFieldType<T extends object> = ViewPageFieldTypeNarrow<T> | ((data: T) => React.ReactNode);
|
|
40
40
|
/**
|
|
41
41
|
* View page props
|
|
42
42
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.79",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
"@emotion/css": "^11.10.5",
|
|
52
52
|
"@emotion/react": "^11.10.5",
|
|
53
53
|
"@emotion/styled": "^11.10.5",
|
|
54
|
-
"@etsoo/appscript": "^1.3.
|
|
55
|
-
"@etsoo/notificationbase": "^1.1.
|
|
56
|
-
"@etsoo/react": "^1.6.
|
|
57
|
-
"@etsoo/shared": "^1.1.
|
|
58
|
-
"@mui/icons-material": "^5.10.
|
|
59
|
-
"@mui/material": "^5.10.
|
|
54
|
+
"@etsoo/appscript": "^1.3.37",
|
|
55
|
+
"@etsoo/notificationbase": "^1.1.18",
|
|
56
|
+
"@etsoo/react": "^1.6.28",
|
|
57
|
+
"@etsoo/shared": "^1.1.78",
|
|
58
|
+
"@mui/icons-material": "^5.10.14",
|
|
59
|
+
"@mui/material": "^5.10.14",
|
|
60
60
|
"@types/pica": "^9.0.1",
|
|
61
61
|
"@types/pulltorefreshjs": "^0.1.5",
|
|
62
62
|
"@types/react": "^18.0.25",
|
|
63
63
|
"@types/react-avatar-editor": "^13.0.0",
|
|
64
|
-
"@types/react-dom": "^18.0.
|
|
64
|
+
"@types/react-dom": "^18.0.9",
|
|
65
65
|
"@types/react-input-mask": "^3.0.2",
|
|
66
66
|
"@types/react-window": "^1.8.5",
|
|
67
67
|
"pica": "^9.0.1",
|
|
@@ -82,16 +82,16 @@
|
|
|
82
82
|
"@babel/runtime-corejs3": "^7.20.1",
|
|
83
83
|
"@testing-library/jest-dom": "^5.16.5",
|
|
84
84
|
"@testing-library/react": "^13.4.0",
|
|
85
|
-
"@types/jest": "^29.2.
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
87
|
-
"@typescript-eslint/parser": "^5.
|
|
88
|
-
"eslint": "^8.
|
|
85
|
+
"@types/jest": "^29.2.3",
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^5.43.0",
|
|
87
|
+
"@typescript-eslint/parser": "^5.43.0",
|
|
88
|
+
"eslint": "^8.28.0",
|
|
89
89
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
90
90
|
"eslint-plugin-import": "^2.26.0",
|
|
91
|
-
"eslint-plugin-react": "^7.31.
|
|
91
|
+
"eslint-plugin-react": "^7.31.11",
|
|
92
92
|
"jest": "^29.3.1",
|
|
93
93
|
"jest-environment-jsdom": "^29.3.1",
|
|
94
94
|
"ts-jest": "^29.0.3",
|
|
95
|
-
"typescript": "^4.
|
|
95
|
+
"typescript": "^4.9.3"
|
|
96
96
|
}
|
|
97
97
|
}
|
package/src/ComboBox.tsx
CHANGED
package/src/ListChooser.tsx
CHANGED
|
@@ -130,7 +130,7 @@ export function ListChooser<
|
|
|
130
130
|
const label =
|
|
131
131
|
typeof labelField === 'function'
|
|
132
132
|
? labelField(item)
|
|
133
|
-
: Reflect.get(item, labelField);
|
|
133
|
+
: (Reflect.get(item, labelField) as React.ReactNode);
|
|
134
134
|
|
|
135
135
|
return (
|
|
136
136
|
<ListItem disableGutters key={`${id}`}>
|
package/src/Tiplist.tsx
CHANGED
package/src/app/ReactApp.ts
CHANGED
|
@@ -331,13 +331,17 @@ export class ReactApp<
|
|
|
331
331
|
}
|
|
332
332
|
});
|
|
333
333
|
|
|
334
|
-
// Notify host
|
|
335
|
-
BridgeUtils.host?.changeCulture(culture.name);
|
|
336
|
-
|
|
337
334
|
// Document title
|
|
338
335
|
// Default is servier name's label or appName label
|
|
339
|
-
|
|
340
|
-
|
|
336
|
+
const title = this.get(this.name) ?? this.get('appName') ?? this.name;
|
|
337
|
+
const host = BridgeUtils.host;
|
|
338
|
+
if (host) {
|
|
339
|
+
// Notify host
|
|
340
|
+
host.changeCulture(culture.name);
|
|
341
|
+
host.setTitle(title);
|
|
342
|
+
} else {
|
|
343
|
+
document.title = title;
|
|
344
|
+
}
|
|
341
345
|
}
|
|
342
346
|
|
|
343
347
|
/**
|