@etsoo/materialui 1.1.54 → 1.1.56

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.
@@ -133,10 +133,11 @@ export interface IReactAppBase {
133
133
  setPageData(data: IPageData): void;
134
134
 
135
135
  /**
136
- * Set page title and data
137
- * @param key Page title resource key
136
+ * Set page title and subtitle
137
+ * @param title Page title
138
+ * @param subtitle Page subtitle
138
139
  */
139
- setPageKey(key: string): void;
140
+ setPageTitle(title: string, subtitle?: string): void;
140
141
 
141
142
  /**
142
143
  * Set page title and data
@@ -425,12 +426,13 @@ export class ReactApp<
425
426
  }
426
427
 
427
428
  /**
428
- * Set page title and data
429
+ * Set page title and subtitle
429
430
  * @param title Page title
431
+ * @param subtitle Page subtitle
430
432
  */
431
- setPageTitle(title: string): void {
433
+ setPageTitle(title: string, subtitle?: string): void {
432
434
  // Data
433
- const data = { title } as P;
435
+ const data = { title, subtitle } as P;
434
436
 
435
437
  // Dispatch the change
436
438
  if (this.pageStateDispatch != null) {
@@ -1,9 +1,9 @@
1
- import { DataTypes, IdDefaultType } from '@etsoo/shared';
2
- import React from 'react';
3
- import { MUGlobal } from '../MUGlobal';
4
- import { ResponsibleContainer } from '../ResponsibleContainer';
5
- import { CommonPage } from './CommonPage';
6
- import { ResponsePageProps } from './ResponsivePageProps';
1
+ import { DataTypes, IdDefaultType } from "@etsoo/shared";
2
+ import React from "react";
3
+ import { MUGlobal } from "../MUGlobal";
4
+ import { ResponsibleContainer } from "../ResponsibleContainer";
5
+ import { CommonPage } from "./CommonPage";
6
+ import { ResponsePageProps } from "./ResponsivePageProps";
7
7
 
8
8
  /**
9
9
  * Fixed height list page
@@ -11,58 +11,58 @@ import { ResponsePageProps } from './ResponsivePageProps';
11
11
  * @returns Component
12
12
  */
13
13
  export function ResponsivePage<
14
- T extends object,
15
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate,
16
- D extends DataTypes.Keys<T> = IdDefaultType<T>
14
+ T extends object,
15
+ F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate,
16
+ D extends DataTypes.Keys<T> = IdDefaultType<T>
17
17
  >(props: ResponsePageProps<T, F, D>) {
18
- // Destruct
19
- const { pageProps = {}, ...rest } = props;
18
+ // Destruct
19
+ const { pageProps = {}, ...rest } = props;
20
20
 
21
- pageProps.paddings ??= MUGlobal.pagePaddings;
22
- const { paddings, fabColumnDirection, ...pageRest } = pageProps;
21
+ pageProps.paddings ??= MUGlobal.pagePaddings;
22
+ const { paddings, fabColumnDirection, ...pageRest } = pageProps;
23
23
 
24
- // State
25
- const [scrollContainer, setScrollContainer] = React.useState<HTMLElement>();
26
- const [direction, setDirection] = React.useState(fabColumnDirection);
24
+ // State
25
+ const [scrollContainer, setScrollContainer] = React.useState<HTMLElement>();
26
+ const [direction, setDirection] = React.useState(fabColumnDirection);
27
27
 
28
- // Layout
29
- return (
30
- <CommonPage
31
- {...pageRest}
32
- paddings={{}}
33
- scrollContainer={scrollContainer}
34
- fabColumnDirection={direction}
35
- >
36
- <ResponsibleContainer<T, F, D>
37
- paddings={paddings}
38
- containerBoxSx={(paddings, hasField, _dataGrid) => {
39
- // Half
40
- const half = MUGlobal.half(paddings);
28
+ // Layout
29
+ return (
30
+ <CommonPage
31
+ {...pageRest}
32
+ paddings={{}}
33
+ scrollContainer={scrollContainer}
34
+ fabColumnDirection={direction}
35
+ >
36
+ <ResponsibleContainer<T, F, D>
37
+ paddings={paddings}
38
+ containerBoxSx={(paddings, hasField, _dataGrid) => {
39
+ // Half
40
+ const half = MUGlobal.half(paddings);
41
41
 
42
- // .SearchBox keep the same to avoid flick when switching between DataGrid and List
43
- return {
44
- paddingTop: paddings,
45
- '& .SearchBox': {
46
- marginLeft: paddings,
47
- marginRight: paddings,
48
- marginBottom: hasField ? half : 0
49
- },
50
- '& .ListBox': {
51
- marginBottom: paddings
52
- },
53
- '& .DataGridBox': {
54
- marginLeft: paddings,
55
- marginRight: paddings,
56
- marginBottom: paddings
57
- }
58
- };
59
- }}
60
- elementReady={(element, isDataGrid) => {
61
- setDirection(!isDataGrid);
62
- setScrollContainer(element);
63
- }}
64
- {...rest}
65
- />
66
- </CommonPage>
67
- );
42
+ // .SearchBox keep the same to avoid flick when switching between DataGrid and List
43
+ return {
44
+ paddingTop: paddings,
45
+ "& .SearchBox": {
46
+ marginLeft: paddings,
47
+ marginRight: paddings,
48
+ marginBottom: hasField ? half : 0
49
+ },
50
+ "& .ListBox": {
51
+ marginBottom: paddings
52
+ },
53
+ "& .DataGridBox": {
54
+ marginLeft: paddings,
55
+ marginRight: paddings,
56
+ marginBottom: paddings
57
+ }
58
+ };
59
+ }}
60
+ elementReady={(element, isDataGrid) => {
61
+ setDirection(!isDataGrid);
62
+ setScrollContainer(element);
63
+ }}
64
+ {...rest}
65
+ />
66
+ </CommonPage>
67
+ );
68
68
  }
@@ -1,39 +1,49 @@
1
- import { GridJsonData, GridLoader } from '@etsoo/react';
2
- import { DataTypes } from '@etsoo/shared';
3
- import { CommonPageProps } from './CommonPageProps';
1
+ import { GridJsonData, GridLoader } from "@etsoo/react";
2
+ import { DataTypes } from "@etsoo/shared";
3
+ import { CommonPageProps } from "./CommonPageProps";
4
4
 
5
5
  /**
6
6
  * Search page props
7
7
  */
8
8
  export type SearchPageProps<
9
- T extends object,
10
- F extends DataTypes.BasicTemplate
11
- > = Omit<GridLoader<T>, 'loadData'> & {
12
- /**
13
- * Search fields
14
- */
15
- fields: React.ReactElement[];
9
+ T extends object,
10
+ F extends DataTypes.BasicTemplate
11
+ > = Omit<GridLoader<T>, "loadData"> & {
12
+ /**
13
+ * Search fields
14
+ */
15
+ fields: React.ReactElement[];
16
16
 
17
- /**
18
- * Search field template
19
- */
20
- fieldTemplate?: F;
17
+ /**
18
+ * Search field template
19
+ */
20
+ fieldTemplate?: F;
21
21
 
22
- /**
23
- * Load data callback
24
- */
25
- loadData: (
26
- data: GridJsonData & DataTypes.BasicTemplateType<F>
27
- ) => PromiseLike<T[] | null | undefined>;
22
+ /**
23
+ * Load data callback
24
+ */
25
+ loadData: (
26
+ data: GridJsonData & DataTypes.BasicTemplateType<F>
27
+ ) => PromiseLike<T[] | null | undefined>;
28
28
 
29
- /**
30
- * Page props
31
- */
32
- pageProps?: CommonPageProps;
29
+ /**
30
+ * Page props
31
+ */
32
+ pageProps?: CommonPageProps;
33
33
 
34
- /**
35
- * Size ready to read miliseconds span
36
- * @default 100
37
- */
38
- sizeReadyMiliseconds?: number;
34
+ /**
35
+ * Size ready to read miliseconds span
36
+ * @default 100
37
+ */
38
+ sizeReadyMiliseconds?: number;
39
+
40
+ /**
41
+ * Top height
42
+ */
43
+ topHeight?: number;
44
+
45
+ /**
46
+ * SearchBar height
47
+ */
48
+ searchBarHeight?: number;
39
49
  };