@etsoo/materialui 1.4.45 → 1.4.46

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.
@@ -10,9 +10,10 @@ export declare namespace GridUtils {
10
10
  * @param props Props
11
11
  * @param template Field template
12
12
  * @param cacheKey Cache key
13
+ * @param keepSource Keep source or not
13
14
  * @returns Request data
14
15
  */
15
- function createLoader<F extends DataTypes.BasicTemplate>(props: GridLoadDataProps, template?: F, cacheKey?: string): DataTypes.BasicTemplateType<F> & {
16
+ function createLoader(props: GridLoadDataProps, template?: object, cacheKey?: string, keepSource?: boolean): {
16
17
  queryPaging: import("@etsoo/appscript").QueryPagingData;
17
18
  };
18
19
  /**
@@ -27,7 +28,7 @@ export declare namespace GridUtils {
27
28
  * @param cacheKey Cache key
28
29
  * @returns Result
29
30
  */
30
- function getSearchData<F extends DataTypes.BasicTemplate>(cacheKey?: string): DataTypes.BasicTemplateType<F> | undefined;
31
+ function getSearchData(cacheKey?: string): any;
31
32
  /**
32
33
  * Get update rows handler
33
34
  * @param cacheKey Cache key
package/lib/GridUtils.js CHANGED
@@ -9,11 +9,12 @@ export var GridUtils;
9
9
  * @param props Props
10
10
  * @param template Field template
11
11
  * @param cacheKey Cache key
12
+ * @param keepSource Keep source or not
12
13
  * @returns Request data
13
14
  */
14
- function createLoader(props, template, cacheKey) {
15
+ function createLoader(props, template, cacheKey, keepSource) {
15
16
  const { data, ...rest } = props;
16
- const formData = GridDataGetData(data, template);
17
+ const formData = GridDataGetData(data, template, keepSource);
17
18
  if (cacheKey)
18
19
  sessionStorage.setItem(`${cacheKey}-searchbar`, JSON.stringify(formData));
19
20
  return { ...formData, ...rest };
@@ -1,11 +1,10 @@
1
- import { DataTypes } from "@etsoo/shared";
2
1
  import { CardProps } from "@mui/material";
3
2
  import React from "react";
4
3
  import { GridData, GridLoader } from "@etsoo/react";
5
4
  /**
6
5
  * ListMoreDisplay props
7
6
  */
8
- export interface ListMoreDisplayProps<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate> extends Omit<CardProps, "children">, GridLoader<T> {
7
+ export interface ListMoreDisplayProps<T extends object> extends Omit<CardProps, "children">, GridLoader<T> {
9
8
  /**
10
9
  * Batch size to load
11
10
  */
@@ -17,7 +16,7 @@ export interface ListMoreDisplayProps<T extends object, F extends DataTypes.Basi
17
16
  /**
18
17
  * Search field template
19
18
  */
20
- fieldTemplate?: F;
19
+ readonly fieldTemplate: object;
21
20
  /**
22
21
  * Header renderer
23
22
  */
@@ -36,4 +35,4 @@ export interface ListMoreDisplayProps<T extends object, F extends DataTypes.Basi
36
35
  * @param props Props
37
36
  * @returns Component
38
37
  */
39
- export declare function ListMoreDisplay<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ListMoreDisplayProps<T, F>): import("react/jsx-runtime").JSX.Element;
38
+ export declare function ListMoreDisplay<T extends object>(props: ListMoreDisplayProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,13 @@
1
- import { DataTypes } from "@etsoo/shared";
2
1
  import { SxProps, Theme } from "@mui/material";
3
2
  import React from "react";
4
3
  import { ListChildComponentProps } from "react-window";
5
- import { GridColumn, GridJsonData, GridMethodRef } from "@etsoo/react";
4
+ import { GridColumn, GridJsonData, GridMethodRef, GridTemplateType } from "@etsoo/react";
6
5
  import { DataGridExProps } from "./DataGridEx";
7
6
  import { ScrollerListExInnerItemRendererProps, ScrollerListExItemSize } from "./ScrollerListEx";
8
7
  /**
9
8
  * ResponsibleContainer props
10
9
  */
11
- export type ResponsibleContainerProps<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate> = Omit<DataGridExProps<T>, "height" | "itemKey" | "loadData" | "mRef" | "onScroll" | "onItemsRendered" | "onInitLoad" | "onUpdateRows"> & {
10
+ export type ResponsibleContainerProps<T extends object> = Omit<DataGridExProps<T>, "height" | "itemKey" | "loadData" | "mRef" | "onScroll" | "onItemsRendered" | "onInitLoad" | "onUpdateRows"> & {
12
11
  /**
13
12
  * Height will be deducted
14
13
  * @param height Current calcuated height
@@ -33,11 +32,11 @@ export type ResponsibleContainerProps<T extends object, F extends DataTypes.Basi
33
32
  /**
34
33
  * Search fields
35
34
  */
36
- fields?: React.ReactElement[] | ((data: DataTypes.BasicTemplateType<F>) => React.ReactElement[]);
35
+ fields?: React.ReactElement[] | ((data: GridTemplateType<ResponsibleContainerProps<T>["fieldTemplate"]>) => React.ReactElement[]);
37
36
  /**
38
37
  * Search field template
39
38
  */
40
- fieldTemplate?: F;
39
+ fieldTemplate: object;
41
40
  /**
42
41
  * Grid height
43
42
  */
@@ -57,7 +56,7 @@ export type ResponsibleContainerProps<T extends object, F extends DataTypes.Basi
57
56
  /**
58
57
  * Load data callback
59
58
  */
60
- loadData: (data: GridJsonData & DataTypes.BasicTemplateType<F>, lastItem?: T) => PromiseLike<T[] | null | undefined>;
59
+ loadData: (data: GridJsonData & GridTemplateType<ResponsibleContainerProps<T>["fieldTemplate"]>, lastItem?: T) => PromiseLike<T[] | null | undefined>;
61
60
  /**
62
61
  * Methods
63
62
  */
@@ -96,4 +95,4 @@ export type ResponsibleContainerProps<T extends object, F extends DataTypes.Basi
96
95
  * @param props Props
97
96
  * @returns Layout
98
97
  */
99
- export declare function ResponsibleContainer<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ResponsibleContainerProps<T, F>): import("react/jsx-runtime").JSX.Element;
98
+ export declare function ResponsibleContainer<T extends object>(props: ResponsibleContainerProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -48,7 +48,7 @@ export function ResponsibleContainer(props) {
48
48
  // Load data
49
49
  const localLoadData = (props, lastItem) => {
50
50
  state.mounted = true;
51
- return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey), lastItem);
51
+ return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
52
52
  };
53
53
  // Search data
54
54
  const searchData = GridUtils.getSearchData(cacheKey);
@@ -1,8 +1,7 @@
1
- import { DataTypes } from "@etsoo/shared";
2
1
  import type { DataGridPageProps } from "./DataGridPageProps";
3
2
  /**
4
3
  * DataGrid page
5
4
  * @param props Props
6
5
  * @returns Component
7
6
  */
8
- export declare function DataGridPage<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: DataGridPageProps<T, F>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function DataGridPage<T extends object>(props: DataGridPageProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -34,7 +34,7 @@ export function DataGridPage(props) {
34
34
  setStates({ data });
35
35
  };
36
36
  const localLoadData = (props, lastItem) => {
37
- return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey), lastItem);
37
+ return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
38
38
  };
39
39
  // Search data
40
40
  const searchData = GridUtils.getSearchData(cacheKey);
@@ -1,10 +1,9 @@
1
- import type { DataTypes } from "@etsoo/shared";
2
1
  import type { DataGridExProps } from "../DataGridEx";
3
2
  import type { SearchPageProps } from "./SearchPageProps";
4
3
  /**
5
4
  * DataGrid page props
6
5
  */
7
- export type DataGridPageProps<T extends object, F extends DataTypes.BasicTemplate> = SearchPageProps<T, F> & Omit<DataGridExProps<T>, "loadData"> & {
6
+ export type DataGridPageProps<T extends object> = SearchPageProps<T> & Omit<DataGridExProps<T>, "loadData"> & {
8
7
  /**
9
8
  * Height will be deducted
10
9
  * @param height Current calcuated height
@@ -1,11 +1,10 @@
1
- import { DataTypes } from "@etsoo/shared";
2
1
  import type { ListPageProps } from "./ListPage";
3
2
  /**
4
3
  * Fixed height list page
5
4
  * @param props Props
6
5
  * @returns Component
7
6
  */
8
- export declare function FixedListPage<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ListPageProps<T, F> & {
7
+ export declare function FixedListPage<T extends object>(props: ListPageProps<T> & {
9
8
  /**
10
9
  * Height will be deducted
11
10
  * @param height Current calcuated height
@@ -40,7 +40,7 @@ export function FixedListPage(props) {
40
40
  reset();
41
41
  };
42
42
  const localLoadData = (props, lastItem) => {
43
- return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey), lastItem);
43
+ return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
44
44
  };
45
45
  // Search data
46
46
  const searchData = GridUtils.getSearchData(cacheKey);
@@ -1,13 +1,12 @@
1
- import { DataTypes } from "@etsoo/shared";
2
1
  import { ScrollerListExProps } from "../ScrollerListEx";
3
2
  import type { SearchPageProps } from "./SearchPageProps";
4
3
  /**
5
4
  * List page props
6
5
  */
7
- export type ListPageProps<T extends object, F extends DataTypes.BasicTemplate> = SearchPageProps<T, F> & Omit<ScrollerListExProps<T>, "loadData">;
6
+ export type ListPageProps<T extends object> = SearchPageProps<T> & Omit<ScrollerListExProps<T>, "loadData">;
8
7
  /**
9
8
  * List page
10
9
  * @param props Props
11
10
  * @returns Component
12
11
  */
13
- export declare function ListPage<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate>(props: ListPageProps<T, F>): import("react/jsx-runtime").JSX.Element;
12
+ export declare function ListPage<T extends object>(props: ListPageProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -38,7 +38,7 @@ export function ListPage(props) {
38
38
  reset();
39
39
  };
40
40
  const localLoadData = (props, lastItem) => {
41
- return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey), lastItem);
41
+ return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
42
42
  };
43
43
  // Search data
44
44
  const searchData = GridUtils.getSearchData(cacheKey);
@@ -1,4 +1,3 @@
1
- import { DataTypes } from "@etsoo/shared";
2
1
  import React from "react";
3
2
  import type { DataGridPageProps } from "./DataGridPageProps";
4
3
  import type { ScrollerListExInnerItemRendererProps, ScrollerListExItemSize } from "../ScrollerListEx";
@@ -8,7 +7,7 @@ import type { OperationMessageHandlerAll } from "../messages/OperationMessageHan
8
7
  /**
9
8
  * Response page props
10
9
  */
11
- export type ResponsePageProps<T extends object, F extends DataTypes.BasicTemplate> = DataGridPageProps<T, F> & {
10
+ export type ResponsePageProps<T extends object> = DataGridPageProps<T> & {
12
11
  /**
13
12
  *
14
13
  * @param height Current height
@@ -54,4 +53,4 @@ export type ResponsePageProps<T extends object, F extends DataTypes.BasicTemplat
54
53
  * @param props Props
55
54
  * @returns Component
56
55
  */
57
- export declare function ResponsivePage<T extends object, F extends DataTypes.BasicTemplate = {}>(props: ResponsePageProps<T, F>): import("react/jsx-runtime").JSX.Element;
56
+ export declare function ResponsivePage<T extends object>(props: ResponsePageProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,9 @@
1
- import type { GridJsonData, GridLoader } from "@etsoo/react";
2
- import type { DataTypes } from "@etsoo/shared";
1
+ import type { GridJsonData, GridLoader, GridTemplateType } from "@etsoo/react";
3
2
  import type { CommonPageProps } from "./CommonPage";
4
3
  /**
5
4
  * Search page props
6
5
  */
7
- export type SearchPageProps<T extends object, F extends DataTypes.BasicTemplate> = Omit<GridLoader<T>, "loadData"> & {
6
+ export type SearchPageProps<T extends object> = Omit<GridLoader<T>, "loadData"> & {
8
7
  /**
9
8
  * Cache key
10
9
  */
@@ -16,15 +15,15 @@ export type SearchPageProps<T extends object, F extends DataTypes.BasicTemplate>
16
15
  /**
17
16
  * Search fields
18
17
  */
19
- fields: React.ReactElement[] | ((data: DataTypes.BasicTemplateType<F>) => React.ReactElement[]);
18
+ fields: React.ReactElement[] | ((data: GridTemplateType<SearchPageProps<T>["fieldTemplate"]>) => React.ReactElement[]);
20
19
  /**
21
20
  * Search field template
22
21
  */
23
- fieldTemplate?: F;
22
+ readonly fieldTemplate: object;
24
23
  /**
25
24
  * Load data callback
26
25
  */
27
- loadData: (data: GridJsonData & DataTypes.BasicTemplateType<F>, lastItem?: T) => PromiseLike<T[] | null | undefined>;
26
+ loadData: (data: GridJsonData & GridTemplateType<SearchPageProps<T>["fieldTemplate"]>, lastItem?: T) => PromiseLike<T[] | null | undefined>;
28
27
  /**
29
28
  * Page props
30
29
  */
@@ -4,10 +4,10 @@ import type { SearchPageProps } from "./SearchPageProps";
4
4
  /**
5
5
  * Table page props
6
6
  */
7
- export 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, D extends DataTypes.Keys<T>> = SearchPageProps<T> & Omit<TableExProps<T, D>, "loadData">;
8
8
  /**
9
9
  * Table page
10
10
  * @param props Props
11
11
  * @returns Component
12
12
  */
13
- export declare function TablePage<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate, D extends DataTypes.Keys<T> = IdDefaultType<T>>(props: TablePageProps<T, F, D>): import("react/jsx-runtime").JSX.Element;
13
+ export declare function TablePage<T extends object, D extends DataTypes.Keys<T> = IdDefaultType<T>>(props: TablePageProps<T, D>): import("react/jsx-runtime").JSX.Element;
@@ -37,7 +37,7 @@ export function TablePage(props) {
37
37
  reset();
38
38
  };
39
39
  const localLoadData = (props, lastItem) => {
40
- return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey), lastItem);
40
+ return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
41
41
  };
42
42
  // Search data
43
43
  const searchData = GridUtils.getSearchData(cacheKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.4.45",
3
+ "version": "1.4.46",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -30,18 +30,18 @@
30
30
  },
31
31
  "homepage": "https://github.com/ETSOO/ReactMU#readme",
32
32
  "dependencies": {
33
- "@dnd-kit/core": "^6.3.0",
33
+ "@dnd-kit/core": "^6.3.1",
34
34
  "@dnd-kit/sortable": "^10.0.0",
35
35
  "@emotion/css": "^11.13.5",
36
36
  "@emotion/react": "^11.13.5",
37
37
  "@emotion/styled": "^11.13.5",
38
38
  "@etsoo/appscript": "^1.5.78",
39
39
  "@etsoo/notificationbase": "^1.1.54",
40
- "@etsoo/react": "^1.8.9",
40
+ "@etsoo/react": "^1.8.10",
41
41
  "@etsoo/shared": "^1.2.55",
42
42
  "@mui/icons-material": "^6.1.10",
43
43
  "@mui/material": "^6.1.10",
44
- "@mui/x-data-grid": "^7.23.0",
44
+ "@mui/x-data-grid": "^7.23.1",
45
45
  "chart.js": "^4.4.7",
46
46
  "chartjs-plugin-datalabels": "^2.2.0",
47
47
  "eventemitter3": "^5.0.1",
@@ -55,14 +55,14 @@
55
55
  "react-imask": "7.6.1"
56
56
  },
57
57
  "devDependencies": {
58
- "@babel/cli": "^7.25.9",
58
+ "@babel/cli": "^7.26.4",
59
59
  "@babel/core": "^7.26.0",
60
60
  "@babel/plugin-transform-runtime": "^7.25.9",
61
61
  "@babel/preset-env": "^7.26.0",
62
62
  "@babel/preset-react": "^7.26.3",
63
63
  "@babel/preset-typescript": "^7.26.0",
64
64
  "@babel/runtime-corejs3": "^7.26.0",
65
- "@testing-library/react": "^16.0.1",
65
+ "@testing-library/react": "^16.1.0",
66
66
  "@types/pica": "^9.0.4",
67
67
  "@types/pulltorefreshjs": "^0.1.7",
68
68
  "@types/react": "^18.3.13",
package/src/GridUtils.ts CHANGED
@@ -15,15 +15,17 @@ export namespace GridUtils {
15
15
  * @param props Props
16
16
  * @param template Field template
17
17
  * @param cacheKey Cache key
18
+ * @param keepSource Keep source or not
18
19
  * @returns Request data
19
20
  */
20
- export function createLoader<F extends DataTypes.BasicTemplate>(
21
+ export function createLoader(
21
22
  props: GridLoadDataProps,
22
- template?: F,
23
- cacheKey?: string
23
+ template?: object,
24
+ cacheKey?: string,
25
+ keepSource?: boolean
24
26
  ) {
25
27
  const { data, ...rest } = props;
26
- const formData = GridDataGetData(data, template);
28
+ const formData = GridDataGetData(data, template, keepSource);
27
29
 
28
30
  if (cacheKey)
29
31
  sessionStorage.setItem(`${cacheKey}-searchbar`, JSON.stringify(formData));
@@ -55,13 +57,11 @@ export namespace GridUtils {
55
57
  * @param cacheKey Cache key
56
58
  * @returns Result
57
59
  */
58
- export function getSearchData<F extends DataTypes.BasicTemplate>(
59
- cacheKey?: string
60
- ) {
60
+ export function getSearchData(cacheKey?: string) {
61
61
  if (cacheKey) {
62
62
  const data = sessionStorage.getItem(`${cacheKey}-searchbar`);
63
63
  if (data) {
64
- return JSON.parse(data) as DataTypes.BasicTemplateType<F>;
64
+ return JSON.parse(data);
65
65
  }
66
66
  }
67
67
  }
@@ -21,10 +21,8 @@ import { globalApp } from "./app/ReactApp";
21
21
  /**
22
22
  * ListMoreDisplay props
23
23
  */
24
- export interface ListMoreDisplayProps<
25
- T extends object,
26
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
27
- > extends Omit<CardProps, "children">,
24
+ export interface ListMoreDisplayProps<T extends object>
25
+ extends Omit<CardProps, "children">,
28
26
  GridLoader<T> {
29
27
  /**
30
28
  * Batch size to load
@@ -39,7 +37,7 @@ export interface ListMoreDisplayProps<
39
37
  /**
40
38
  * Search field template
41
39
  */
42
- fieldTemplate?: F;
40
+ readonly fieldTemplate: object;
43
41
 
44
42
  /**
45
43
  * Header renderer
@@ -67,10 +65,9 @@ type states<T> = {
67
65
  * @param props Props
68
66
  * @returns Component
69
67
  */
70
- export function ListMoreDisplay<
71
- T extends object,
72
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
73
- >(props: ListMoreDisplayProps<T, F>) {
68
+ export function ListMoreDisplay<T extends object>(
69
+ props: ListMoreDisplayProps<T>
70
+ ) {
74
71
  // Destruct
75
72
  const {
76
73
  batchSize = 6,
@@ -1,4 +1,3 @@
1
- import { DataTypes } from "@etsoo/shared";
2
1
  import { Box, Stack, SxProps, Theme, useMediaQuery } from "@mui/material";
3
2
  import React from "react";
4
3
  import {
@@ -13,6 +12,7 @@ import {
13
12
  GridLoadDataProps,
14
13
  GridLoaderStates,
15
14
  GridMethodRef,
15
+ GridTemplateType,
16
16
  ReactUtils,
17
17
  ScrollerListRef,
18
18
  useCombinedRefs,
@@ -33,10 +33,7 @@ import { GridUtils } from "./GridUtils";
33
33
  /**
34
34
  * ResponsibleContainer props
35
35
  */
36
- export type ResponsibleContainerProps<
37
- T extends object,
38
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
39
- > = Omit<
36
+ export type ResponsibleContainerProps<T extends object> = Omit<
40
37
  DataGridExProps<T>,
41
38
  | "height"
42
39
  | "itemKey"
@@ -81,12 +78,14 @@ export type ResponsibleContainerProps<
81
78
  */
82
79
  fields?:
83
80
  | React.ReactElement[]
84
- | ((data: DataTypes.BasicTemplateType<F>) => React.ReactElement[]);
81
+ | ((
82
+ data: GridTemplateType<ResponsibleContainerProps<T>["fieldTemplate"]>
83
+ ) => React.ReactElement[]);
85
84
 
86
85
  /**
87
86
  * Search field template
88
87
  */
89
- fieldTemplate?: F;
88
+ fieldTemplate: object;
90
89
 
91
90
  /**
92
91
  * Grid height
@@ -114,7 +113,8 @@ export type ResponsibleContainerProps<
114
113
  * Load data callback
115
114
  */
116
115
  loadData: (
117
- data: GridJsonData & DataTypes.BasicTemplateType<F>,
116
+ data: GridJsonData &
117
+ GridTemplateType<ResponsibleContainerProps<T>["fieldTemplate"]>,
118
118
  lastItem?: T
119
119
  ) => PromiseLike<T[] | null | undefined>;
120
120
 
@@ -185,10 +185,9 @@ function defaultContainerBoxSx(
185
185
  * @param props Props
186
186
  * @returns Layout
187
187
  */
188
- export function ResponsibleContainer<
189
- T extends object,
190
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
191
- >(props: ResponsibleContainerProps<T, F>) {
188
+ export function ResponsibleContainer<T extends object>(
189
+ props: ResponsibleContainerProps<T>
190
+ ) {
192
191
  // Destruct
193
192
  const {
194
193
  adjustHeight,
@@ -241,13 +240,13 @@ export function ResponsibleContainer<
241
240
  const localLoadData = (props: GridLoadDataProps, lastItem?: T) => {
242
241
  state.mounted = true;
243
242
  return loadData(
244
- GridUtils.createLoader<F>(props, fieldTemplate, cacheKey),
243
+ GridUtils.createLoader(props, fieldTemplate, cacheKey, false),
245
244
  lastItem
246
245
  );
247
246
  };
248
247
 
249
248
  // Search data
250
- const searchData = GridUtils.getSearchData<F>(cacheKey);
249
+ const searchData = GridUtils.getSearchData(cacheKey);
251
250
 
252
251
  // On submit callback
253
252
  const onSubmit = (data: FormData, _reset: boolean) => {
@@ -7,7 +7,6 @@ import {
7
7
  useCombinedRefs,
8
8
  useDimensions
9
9
  } from "@etsoo/react";
10
- import { DataTypes } from "@etsoo/shared";
11
10
  import { Box, Stack } from "@mui/material";
12
11
  import React from "react";
13
12
  import { DataGridEx } from "../DataGridEx";
@@ -29,10 +28,7 @@ interface LocalStates<T> {
29
28
  * @param props Props
30
29
  * @returns Component
31
30
  */
32
- export function DataGridPage<
33
- T extends object,
34
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
35
- >(props: DataGridPageProps<T, F>) {
31
+ export function DataGridPage<T extends object>(props: DataGridPageProps<T>) {
36
32
  // Destruct
37
33
  const {
38
34
  adjustHeight,
@@ -78,13 +74,13 @@ export function DataGridPage<
78
74
 
79
75
  const localLoadData = (props: GridLoadDataProps, lastItem?: T) => {
80
76
  return loadData(
81
- GridUtils.createLoader<F>(props, fieldTemplate, cacheKey),
77
+ GridUtils.createLoader(props, fieldTemplate, cacheKey, false),
82
78
  lastItem
83
79
  );
84
80
  };
85
81
 
86
82
  // Search data
87
- const searchData = GridUtils.getSearchData<F>(cacheKey);
83
+ const searchData = GridUtils.getSearchData(cacheKey);
88
84
 
89
85
  const onInitLoad = (
90
86
  ref: VariableSizeGrid<T>
@@ -1,14 +1,10 @@
1
- import type { DataTypes } from "@etsoo/shared";
2
1
  import type { DataGridExProps } from "../DataGridEx";
3
2
  import type { SearchPageProps } from "./SearchPageProps";
4
3
 
5
4
  /**
6
5
  * DataGrid page props
7
6
  */
8
- export type DataGridPageProps<
9
- T extends object,
10
- F extends DataTypes.BasicTemplate
11
- > = SearchPageProps<T, F> &
7
+ export type DataGridPageProps<T extends object> = SearchPageProps<T> &
12
8
  Omit<DataGridExProps<T>, "loadData"> & {
13
9
  /**
14
10
  * Height will be deducted
@@ -7,7 +7,6 @@ import {
7
7
  useCombinedRefs,
8
8
  useDimensions
9
9
  } from "@etsoo/react";
10
- import { DataTypes } from "@etsoo/shared";
11
10
  import { Box, Stack } from "@mui/material";
12
11
  import React from "react";
13
12
  import { MUGlobal } from "../MUGlobal";
@@ -22,11 +21,8 @@ import type { ListPageProps } from "./ListPage";
22
21
  * @param props Props
23
22
  * @returns Component
24
23
  */
25
- export function FixedListPage<
26
- T extends object,
27
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
28
- >(
29
- props: ListPageProps<T, F> & {
24
+ export function FixedListPage<T extends object>(
25
+ props: ListPageProps<T> & {
30
26
  /**
31
27
  * Height will be deducted
32
28
  * @param height Current calcuated height
@@ -90,13 +86,13 @@ export function FixedListPage<
90
86
 
91
87
  const localLoadData = (props: GridLoadDataProps, lastItem?: T) => {
92
88
  return loadData(
93
- GridUtils.createLoader<F>(props, fieldTemplate, cacheKey),
89
+ GridUtils.createLoader(props, fieldTemplate, cacheKey, false),
94
90
  lastItem
95
91
  );
96
92
  };
97
93
 
98
94
  // Search data
99
- const searchData = GridUtils.getSearchData<F>(cacheKey);
95
+ const searchData = GridUtils.getSearchData(cacheKey);
100
96
 
101
97
  const onInitLoad = (
102
98
  ref: ScrollerListRef
@@ -6,7 +6,6 @@ import {
6
6
  ScrollerListRef,
7
7
  useCombinedRefs
8
8
  } from "@etsoo/react";
9
- import { DataTypes } from "@etsoo/shared";
10
9
  import { Box, Stack } from "@mui/material";
11
10
  import React from "react";
12
11
  import { MUGlobal } from "../MUGlobal";
@@ -19,20 +18,15 @@ import type { SearchPageProps } from "./SearchPageProps";
19
18
  /**
20
19
  * List page props
21
20
  */
22
- export type ListPageProps<
23
- T extends object,
24
- F extends DataTypes.BasicTemplate
25
- > = SearchPageProps<T, F> & Omit<ScrollerListExProps<T>, "loadData">;
21
+ export type ListPageProps<T extends object> = SearchPageProps<T> &
22
+ Omit<ScrollerListExProps<T>, "loadData">;
26
23
 
27
24
  /**
28
25
  * List page
29
26
  * @param props Props
30
27
  * @returns Component
31
28
  */
32
- export function ListPage<
33
- T extends object,
34
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
35
- >(props: ListPageProps<T, F>) {
29
+ export function ListPage<T extends object>(props: ListPageProps<T>) {
36
30
  // Destruct
37
31
  const {
38
32
  fields,
@@ -78,13 +72,13 @@ export function ListPage<
78
72
 
79
73
  const localLoadData = (props: GridLoadDataProps, lastItem?: T) => {
80
74
  return loadData(
81
- GridUtils.createLoader<F>(props, fieldTemplate, cacheKey),
75
+ GridUtils.createLoader(props, fieldTemplate, cacheKey, false),
82
76
  lastItem
83
77
  );
84
78
  };
85
79
 
86
80
  // Search data
87
- const searchData = GridUtils.getSearchData<F>(cacheKey);
81
+ const searchData = GridUtils.getSearchData(cacheKey);
88
82
 
89
83
  const onInitLoad = (
90
84
  ref: ScrollerListRef
@@ -1,4 +1,3 @@
1
- import { DataTypes } from "@etsoo/shared";
2
1
  import React from "react";
3
2
  import { MUGlobal } from "../MUGlobal";
4
3
  import { ResponsibleContainer } from "../ResponsibleContainer";
@@ -16,10 +15,7 @@ import type { OperationMessageHandlerAll } from "../messages/OperationMessageHan
16
15
  /**
17
16
  * Response page props
18
17
  */
19
- export type ResponsePageProps<
20
- T extends object,
21
- F extends DataTypes.BasicTemplate
22
- > = DataGridPageProps<T, F> & {
18
+ export type ResponsePageProps<T extends object> = DataGridPageProps<T> & {
23
19
  /**
24
20
  *
25
21
  * @param height Current height
@@ -76,10 +72,7 @@ export type ResponsePageProps<
76
72
  * @param props Props
77
73
  * @returns Component
78
74
  */
79
- export function ResponsivePage<
80
- T extends object,
81
- F extends DataTypes.BasicTemplate = {}
82
- >(props: ResponsePageProps<T, F>) {
75
+ export function ResponsivePage<T extends object>(props: ResponsePageProps<T>) {
83
76
  // Destruct
84
77
  const { pageProps = {}, operationMessageHandler, ...rest } = props;
85
78
 
@@ -101,7 +94,7 @@ export function ResponsivePage<
101
94
  {operationMessageHandler && (
102
95
  <OperationMessageContainer handler={operationMessageHandler} />
103
96
  )}
104
- <ResponsibleContainer<T, F>
97
+ <ResponsibleContainer<T>
105
98
  paddings={paddings}
106
99
  containerBoxSx={(paddings, hasField, _dataGrid) => {
107
100
  // Half
@@ -1,14 +1,13 @@
1
- import type { GridJsonData, GridLoader } from "@etsoo/react";
2
- import type { DataTypes } from "@etsoo/shared";
1
+ import type { GridJsonData, GridLoader, GridTemplateType } from "@etsoo/react";
3
2
  import type { CommonPageProps } from "./CommonPage";
4
3
 
5
4
  /**
6
5
  * Search page props
7
6
  */
8
- export type SearchPageProps<
9
- T extends object,
10
- F extends DataTypes.BasicTemplate
11
- > = Omit<GridLoader<T>, "loadData"> & {
7
+ export type SearchPageProps<T extends object> = Omit<
8
+ GridLoader<T>,
9
+ "loadData"
10
+ > & {
12
11
  /**
13
12
  * Cache key
14
13
  */
@@ -24,18 +23,20 @@ export type SearchPageProps<
24
23
  */
25
24
  fields:
26
25
  | React.ReactElement[]
27
- | ((data: DataTypes.BasicTemplateType<F>) => React.ReactElement[]);
26
+ | ((
27
+ data: GridTemplateType<SearchPageProps<T>["fieldTemplate"]>
28
+ ) => React.ReactElement[]);
28
29
 
29
30
  /**
30
31
  * Search field template
31
32
  */
32
- fieldTemplate?: F;
33
+ readonly fieldTemplate: object;
33
34
 
34
35
  /**
35
36
  * Load data callback
36
37
  */
37
38
  loadData: (
38
- data: GridJsonData & DataTypes.BasicTemplateType<F>,
39
+ data: GridJsonData & GridTemplateType<SearchPageProps<T>["fieldTemplate"]>,
39
40
  lastItem?: T
40
41
  ) => PromiseLike<T[] | null | undefined>;
41
42
 
@@ -23,9 +23,8 @@ import type { SearchPageProps } from "./SearchPageProps";
23
23
  */
24
24
  export type TablePageProps<
25
25
  T extends object,
26
- F extends DataTypes.BasicTemplate,
27
26
  D extends DataTypes.Keys<T>
28
- > = SearchPageProps<T, F> & Omit<TableExProps<T, D>, "loadData">;
27
+ > = SearchPageProps<T> & Omit<TableExProps<T, D>, "loadData">;
29
28
 
30
29
  /**
31
30
  * Table page
@@ -34,9 +33,8 @@ export type TablePageProps<
34
33
  */
35
34
  export function TablePage<
36
35
  T extends object,
37
- F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate,
38
36
  D extends DataTypes.Keys<T> = IdDefaultType<T>
39
- >(props: TablePageProps<T, F, D>) {
37
+ >(props: TablePageProps<T, D>) {
40
38
  // Destruct
41
39
  const {
42
40
  columns,
@@ -85,13 +83,13 @@ export function TablePage<
85
83
 
86
84
  const localLoadData = (props: GridLoadDataProps, lastItem?: T) => {
87
85
  return loadData(
88
- GridUtils.createLoader<F>(props, fieldTemplate, cacheKey),
86
+ GridUtils.createLoader(props, fieldTemplate, cacheKey, false),
89
87
  lastItem
90
88
  );
91
89
  };
92
90
 
93
91
  // Search data
94
- const searchData = GridUtils.getSearchData<F>(cacheKey);
92
+ const searchData = GridUtils.getSearchData(cacheKey);
95
93
 
96
94
  // Total width
97
95
  const totalWidth = React.useMemo(