@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.
Files changed (45) hide show
  1. package/lib/AutocompleteExtendedProps.d.ts +1 -1
  2. package/lib/ButtonLink.d.ts +1 -1
  3. package/lib/ComboBox.d.ts +1 -1
  4. package/lib/ComboBox.js +2 -1
  5. package/lib/CountdownButton.d.ts +1 -1
  6. package/lib/CustomFabProps.d.ts +1 -1
  7. package/lib/DataGridEx.d.ts +2 -2
  8. package/lib/DataSteps.d.ts +2 -2
  9. package/lib/EmailInput.d.ts +1 -1
  10. package/lib/FabBox.d.ts +1 -1
  11. package/lib/HiSelector.d.ts +1 -1
  12. package/lib/IconButtonLink.d.ts +1 -1
  13. package/lib/InputField.d.ts +1 -1
  14. package/lib/ListChooser.d.ts +2 -2
  15. package/lib/LoadingButton.d.ts +1 -1
  16. package/lib/MUGlobal.d.ts +1 -1
  17. package/lib/MaskInput.d.ts +1 -1
  18. package/lib/NotifierPromptProps.d.ts +1 -1
  19. package/lib/OptionGroup.d.ts +1 -1
  20. package/lib/ResponsibleContainer.d.ts +1 -1
  21. package/lib/ScrollerListEx.d.ts +2 -2
  22. package/lib/SearchField.d.ts +1 -1
  23. package/lib/SelectBool.d.ts +1 -1
  24. package/lib/SelectEx.d.ts +1 -1
  25. package/lib/TableEx.d.ts +1 -1
  26. package/lib/TextFieldEx.d.ts +1 -1
  27. package/lib/Tiplist.d.ts +1 -1
  28. package/lib/Tiplist.js +1 -1
  29. package/lib/TwoFieldInput.d.ts +2 -2
  30. package/lib/app/IServiceUser.d.ts +1 -1
  31. package/lib/app/ISmartERPUser.d.ts +1 -1
  32. package/lib/app/ReactApp.d.ts +1 -1
  33. package/lib/app/ReactApp.js +22 -16
  34. package/lib/app/ServiceApp.js +9 -9
  35. package/lib/pages/DataGridPageProps.d.ts +1 -1
  36. package/lib/pages/ListPageProps.d.ts +1 -1
  37. package/lib/pages/ResponsivePageProps.d.ts +1 -1
  38. package/lib/pages/SearchPageProps.d.ts +1 -1
  39. package/lib/pages/TablePageProps.d.ts +1 -1
  40. package/lib/pages/ViewPage.d.ts +3 -3
  41. package/package.json +14 -14
  42. package/src/ComboBox.tsx +1 -1
  43. package/src/ListChooser.tsx +1 -1
  44. package/src/Tiplist.tsx +1 -1
  45. 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 declare type AutocompleteExtendedProps<T extends object, D extends DataTypes.Keys<T>> = Omit<AutocompleteProps<T, undefined, false, false>, 'renderInput' | 'options' | 'multiple'> & {
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
  */
@@ -3,7 +3,7 @@ import { ButtonProps } from '@mui/material';
3
3
  /**
4
4
  * ButtonLink props
5
5
  */
6
- export declare type ButtonLinkProps = Omit<ButtonProps, 'href' | 'onClick'> & {
6
+ export type ButtonLinkProps = Omit<ButtonProps, 'href' | 'onClick'> & {
7
7
  /**
8
8
  * To href
9
9
  */
package/lib/ComboBox.d.ts CHANGED
@@ -4,7 +4,7 @@ import { AutocompleteExtendedProps } from './AutocompleteExtendedProps';
4
4
  /**
5
5
  * ComboBox props
6
6
  */
7
- export declare type ComboBoxProps<T extends object, D extends DataTypes.Keys<T>, L extends DataTypes.Keys<T, string>> = AutocompleteExtendedProps<T, D> & {
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 = 'off', options, dataReadonly = true, readOnly, onChange, openOnFocus = true, value, getOptionLabel = (option) => `${option[labelField]}`, sx = { minWidth: '150px' }, ...rest } = props;
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
@@ -9,7 +9,7 @@ export interface CountdownButtonAction {
9
9
  /**
10
10
  * Countdown button props
11
11
  */
12
- export declare type CountdownButtonProps = Omit<ButtonProps, 'endIcon' | 'disabled'> & {
12
+ export type CountdownButtonProps = Omit<ButtonProps, 'endIcon' | 'disabled'> & {
13
13
  /**
14
14
  * Action, required
15
15
  */
@@ -3,7 +3,7 @@ import { OverridableStringUnion } from '@mui/types';
3
3
  /**
4
4
  * Custom fab size
5
5
  */
6
- export declare type CustomFabSize = 'small' | 'medium' | 'large';
6
+ export type CustomFabSize = 'small' | 'medium' | 'large';
7
7
  /**
8
8
  * Custom fab props
9
9
  */
@@ -5,7 +5,7 @@ import { MouseEventWithDataHandler } from './MUGlobal';
5
5
  /**
6
6
  * Footer item renderer props
7
7
  */
8
- export declare type DataGridExFooterItemRendererProps<T extends object> = {
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 declare type DataGridExProps<T extends object, D extends DataTypes.Keys<T>> = Omit<ScrollerGridProps<T, D>, 'itemRenderer' | 'columnCount' | 'columnWidth' | 'width'> & {
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
  */
@@ -4,7 +4,7 @@ import { InputDialogProps } from '@etsoo/react';
4
4
  /**
5
5
  * Data step
6
6
  */
7
- export declare type DataStep = Omit<InputDialogProps, 'callback'> & {
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 declare type DataStepsProps<T extends object> = Omit<TextFieldProps, 'InputProps' | 'onClick'> & {
16
+ export type DataStepsProps<T extends object> = Omit<TextFieldProps, 'InputProps' | 'onClick'> & {
17
17
  /**
18
18
  * JSON value
19
19
  */
@@ -3,7 +3,7 @@ import { TextFieldProps } from '@mui/material';
3
3
  /**
4
4
  * Email input props
5
5
  */
6
- export declare type EmailInputProps = Omit<TextFieldProps, 'type'> & {};
6
+ export type EmailInputProps = Omit<TextFieldProps, 'type'> & {};
7
7
  /**
8
8
  * Email input
9
9
  * @param props Props
package/lib/FabBox.d.ts CHANGED
@@ -3,7 +3,7 @@ import { BoxProps } from '@mui/material';
3
3
  /**
4
4
  * Fabs container box props
5
5
  */
6
- export declare type FabBoxProps = BoxProps & {
6
+ export type FabBoxProps = BoxProps & {
7
7
  /**
8
8
  * Item gap
9
9
  */
@@ -4,7 +4,7 @@ import React from 'react';
4
4
  /**
5
5
  * Hierarchy selector props
6
6
  */
7
- export declare type HiSelectorProps<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>, L extends DataTypes.Keys<T, string> = LabelDefaultType<T>> = {
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
  */
@@ -3,7 +3,7 @@ import { IconButtonProps } from '@mui/material';
3
3
  /**
4
4
  * IconButtonLink props
5
5
  */
6
- export declare type IconButtonLinkProps = Omit<IconButtonProps, 'href' | 'onClick'> & {
6
+ export type IconButtonLinkProps = Omit<IconButtonProps, 'href' | 'onClick'> & {
7
7
  /**
8
8
  * To href
9
9
  */
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  /**
4
4
  * Input field props
5
5
  */
6
- export declare type InputFieldProps = TextFieldProps & {
6
+ export type InputFieldProps = TextFieldProps & {
7
7
  /**
8
8
  * Change delay (ms) to avoid repeatly dispatch onChange
9
9
  */
@@ -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
- declare type QueryData = {
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 declare type ListChooserProps<T extends object, D extends DataTypes.Keys<T>, Q extends object> = ListProps & {
16
+ export type ListChooserProps<T extends object, D extends DataTypes.Keys<T>, Q extends object> = ListProps & {
17
17
  /**
18
18
  * Condition renderer
19
19
  */
@@ -3,7 +3,7 @@ import { ButtonProps, CircularProgressProps } from '@mui/material';
3
3
  /**
4
4
  * Loading button props
5
5
  */
6
- export declare type LoadingButtonProps = ButtonProps & {
6
+ export type LoadingButtonProps = ButtonProps & {
7
7
  /**
8
8
  * Loading icon props
9
9
  */
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 declare type MouseEventWithDataHandler<T> = (event: React.MouseEvent<HTMLDivElement>, data: T) => void;
6
+ export type MouseEventWithDataHandler<T> = (event: React.MouseEvent<HTMLDivElement>, data: T) => void;
7
7
  /**
8
8
  * MUGlobal for global configurations
9
9
  */
@@ -3,7 +3,7 @@ import { TextFieldProps } from '@mui/material';
3
3
  /**
4
4
  * Mask input props
5
5
  */
6
- export declare type MaskInputProps<T extends IMask.AnyMaskedOptions> = TextFieldProps & {
6
+ export type MaskInputProps<T extends IMask.AnyMaskedOptions> = TextFieldProps & {
7
7
  /**
8
8
  * Mask props
9
9
  */
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Notifier prompt props
4
4
  */
5
- export declare type NotifierPromptProps = Record<string, any> & {
5
+ export type NotifierPromptProps = Record<string, any> & {
6
6
  /**
7
7
  * Cancel label
8
8
  */
@@ -14,7 +14,7 @@ export interface OptionGroupRef {
14
14
  /**
15
15
  * OptionGroup props
16
16
  */
17
- export declare type OptionGroupProps<T extends object, D extends DataTypes.Keys<T>, L extends DataTypes.Keys<T, string>> = Omit<FormControlProps<'fieldset'>, 'defaultValue'> & {
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 declare 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'> & {
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
@@ -30,11 +30,11 @@ 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, object]) | [number, number] | [number, object, boolean?];
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 declare type ScrollerListExProps<T extends object, D extends DataTypes.Keys<T>> = Omit<ScrollerListProps<T, D>, 'itemRenderer' | 'itemSize'> & {
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
  */
@@ -3,7 +3,7 @@ import { TextFieldProps } from '@mui/material';
3
3
  /**
4
4
  * Search field props
5
5
  */
6
- export declare type SearchFieldProps = TextFieldProps & {
6
+ export type SearchFieldProps = TextFieldProps & {
7
7
  /**
8
8
  * Change delay (ms) to avoid repeatly dispatch onChange
9
9
  */
@@ -4,7 +4,7 @@ import { SelectExProps } from './SelectEx';
4
4
  /**
5
5
  * SelectBool props
6
6
  */
7
- export declare type SelectBoolProps = Omit<SelectExProps<ListType1>, 'options' | 'loadData'>;
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 declare 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'> & {
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 declare type TableExProps<T extends object, D extends DataTypes.Keys<T>> = TableProps & GridLoader<T> & {
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
  */
@@ -3,7 +3,7 @@ import { TextFieldProps } from '@mui/material';
3
3
  /**
4
4
  * Extended text field props
5
5
  */
6
- export declare type TextFieldExProps = TextFieldProps & {
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 declare type TiplistProps<T extends object, D extends DataTypes.Keys<T>> = Omit<AutocompleteExtendedProps<T, D>, 'open'> & {
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 = 'off', inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputVariant, label, loadData, defaultValue, value, name, readOnly, onChange, openOnFocus = true, sx = { minWidth: '180px' }, ...rest } = props;
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
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { InputFieldProps } from './InputField';
3
- declare type ValueType = string | number | Date | null | undefined;
3
+ type ValueType = string | number | Date | null | undefined;
4
4
  /**
5
5
  * TwoField Input props
6
6
  */
7
- export declare type TwoFieldInputProps = Omit<InputFieldProps, 'InputProps' | 'value'> & {
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 declare type ServiceLoginResult<U extends IServiceUser = IServiceUser> = IActionResult<U>;
14
+ export type ServiceLoginResult<U extends IServiceUser = IServiceUser> = IActionResult<U>;
@@ -11,4 +11,4 @@ export interface ISmartERPUser extends IUser {
11
11
  /**
12
12
  * SmartERP user login result
13
13
  */
14
- export declare type SmartERPLoginResult = IActionResult<ISmartERPUser>;
14
+ export type SmartERPLoginResult = IActionResult<ISmartERPUser>;
@@ -7,7 +7,7 @@ import { NavigateFunction, NavigateOptions } from 'react-router-dom';
7
7
  /**
8
8
  * React Application Type
9
9
  */
10
- export declare type ReactAppType = IApp & IReactAppBase;
10
+ export type ReactAppType = IApp & IReactAppBase;
11
11
  /**
12
12
  * Global application
13
13
  */
@@ -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, _c;
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
- document.title =
130
- (_c = (_b = this.get(this.name)) !== null && _b !== void 0 ? _b : this.get('appName')) !== null && _c !== void 0 ? _c : this.name;
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
@@ -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 declare 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'> & {
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 declare type ListPageProps<T extends object, F extends DataTypes.BasicTemplate, D extends DataTypes.Keys<T>> = SearchPageProps<T, F> & Omit<ScrollerListExProps<T, D>, 'loadData'>;
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 declare 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'> & {
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 declare type SearchPageProps<T extends object, F extends DataTypes.BasicTemplate> = Omit<GridLoader<T>, 'loadData'> & {
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 declare type TablePageProps<T extends object, F extends DataTypes.BasicTemplate, D extends DataTypes.Keys<T>> = SearchPageProps<T, F> & Omit<TableExProps<T, D>, 'loadData'>;
7
+ export type TablePageProps<T extends object, F extends DataTypes.BasicTemplate, D extends DataTypes.Keys<T>> = SearchPageProps<T, F> & Omit<TableExProps<T, D>, 'loadData'>;
@@ -6,7 +6,7 @@ import { CommonPageProps } from './CommonPageProps';
6
6
  /**
7
7
  * View page row width type
8
8
  */
9
- export declare type ViewPageRowType = boolean | 'default' | 'small' | object;
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
- declare type ViewPageFieldTypeNarrow<T extends object> = (string & keyof T) | [string & keyof T, GridDataType, GridColumnRenderProps?, ViewPageRowType?] | ViewPageField<T>;
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 declare type ViewPageFieldType<T extends object> = ViewPageFieldTypeNarrow<T> | ((data: T) => React.ReactNode);
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.78",
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.33",
55
- "@etsoo/notificationbase": "^1.1.16",
56
- "@etsoo/react": "^1.6.26",
57
- "@etsoo/shared": "^1.1.77",
58
- "@mui/icons-material": "^5.10.9",
59
- "@mui/material": "^5.10.13",
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.8",
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.2",
86
- "@typescript-eslint/eslint-plugin": "^5.42.1",
87
- "@typescript-eslint/parser": "^5.42.1",
88
- "eslint": "^8.27.0",
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.10",
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.8.4"
95
+ "typescript": "^4.9.3"
96
96
  }
97
97
  }
package/src/ComboBox.tsx CHANGED
@@ -80,7 +80,7 @@ export function ComboBox<
80
80
  loadData,
81
81
  onLoadData,
82
82
  name,
83
- inputAutoComplete = 'off',
83
+ inputAutoComplete = 'new-password', // disable autocomplete and autofill, 'off' does not work
84
84
  options,
85
85
  dataReadonly = true,
86
86
  readOnly,
@@ -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
@@ -44,7 +44,7 @@ export function Tiplist<
44
44
  search = false,
45
45
  idField = 'id' as D,
46
46
  idValue,
47
- inputAutoComplete = 'off',
47
+ inputAutoComplete = 'new-password',
48
48
  inputError,
49
49
  inputHelperText,
50
50
  inputMargin,
@@ -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
- document.title =
340
- this.get(this.name) ?? this.get('appName') ?? this.name;
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
  /**