@etsoo/materialui 1.5.13 → 1.5.15

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/' ADDED
File without changes
@@ -59,7 +59,7 @@ function ResponsibleContainer(props) {
59
59
  return loadData(GridUtils_1.GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
60
60
  };
61
61
  // Search data
62
- const searchData = GridUtils_1.GridUtils.getSearchData(cacheKey);
62
+ const searchData = (0, react_2.useSearchParamsWithCache)(cacheKey);
63
63
  // On submit callback
64
64
  const onSubmit = (data, _reset) => {
65
65
  if (data == null || state.ref == null)
@@ -177,7 +177,7 @@ function ResponsibleContainer(props) {
177
177
  rect?.width == null ||
178
178
  rect.width < 20)
179
179
  return;
180
- const f = typeof fields == "function" ? fields(searchData ?? {}) : fields;
180
+ const f = typeof fields == "function" ? fields(searchData) : fields;
181
181
  return ((0, jsx_runtime_1.jsx)(SearchBar_1.SearchBar, { fields: f, onSubmit: onSubmit, className: `searchBar${showDataGrid ? "Grid" : "List"}`, width: rect.width, top: searchBarTop }));
182
182
  }, [showDataGrid, hasFields, searchBarHeight, rect?.width]);
183
183
  // Pull container
@@ -44,7 +44,7 @@ function DataGridPage(props) {
44
44
  return loadData(GridUtils_1.GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
45
45
  };
46
46
  // Search data
47
- const searchData = GridUtils_1.GridUtils.getSearchData(cacheKey);
47
+ const searchData = (0, react_1.useSearchParamsWithCache)(cacheKey);
48
48
  const onInitLoad = (ref) => {
49
49
  // Avoid repeatedly load from cache
50
50
  if (initLoadedRef.current || !cacheKey)
@@ -50,7 +50,7 @@ function FixedListPage(props) {
50
50
  return loadData(GridUtils_1.GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
51
51
  };
52
52
  // Search data
53
- const searchData = GridUtils_1.GridUtils.getSearchData(cacheKey);
53
+ const searchData = (0, react_1.useSearchParamsWithCache)(cacheKey);
54
54
  const onInitLoad = (ref) => {
55
55
  // Avoid repeatedly load from cache
56
56
  if (initLoadedRef.current || !cacheKey)
@@ -51,7 +51,7 @@ function ListPage(props) {
51
51
  const { dimensions } = (0, react_1.useDimensions)(1, undefined, sizeReadyMiliseconds);
52
52
  const rect = dimensions[0][2];
53
53
  // Search data
54
- const searchData = GridUtils_1.GridUtils.getSearchData(cacheKey);
54
+ const searchData = (0, react_1.useSearchParamsWithCache)(cacheKey);
55
55
  const onInitLoad = (ref) => {
56
56
  // Avoid repeatedly load from cache
57
57
  if (initLoadedRef.current || !cacheKey)
@@ -47,7 +47,7 @@ function TablePage(props) {
47
47
  return loadData(GridUtils_1.GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
48
48
  };
49
49
  // Search data
50
- const searchData = GridUtils_1.GridUtils.getSearchData(cacheKey);
50
+ const searchData = (0, react_1.useSearchParamsWithCache)(cacheKey);
51
51
  // Total width
52
52
  const totalWidth = react_2.default.useMemo(() => columns.reduce((previousValue, { width, minWidth }) => {
53
53
  return previousValue + (width ?? minWidth ?? TableEx_1.TableExMinWidth);
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
- import { ReactUtils, useCombinedRefs, useDimensions } from "@etsoo/react";
3
+ import { ReactUtils, useCombinedRefs, useDimensions, useSearchParamsWithCache } from "@etsoo/react";
4
4
  import { DataGridEx } from "./DataGridEx";
5
5
  import { MUGlobal } from "./MUGlobal";
6
6
  import { PullToRefreshUI } from "./PullToRefreshUI";
@@ -53,7 +53,7 @@ export function ResponsibleContainer(props) {
53
53
  return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
54
54
  };
55
55
  // Search data
56
- const searchData = GridUtils.getSearchData(cacheKey);
56
+ const searchData = useSearchParamsWithCache(cacheKey);
57
57
  // On submit callback
58
58
  const onSubmit = (data, _reset) => {
59
59
  if (data == null || state.ref == null)
@@ -171,7 +171,7 @@ export function ResponsibleContainer(props) {
171
171
  rect?.width == null ||
172
172
  rect.width < 20)
173
173
  return;
174
- const f = typeof fields == "function" ? fields(searchData ?? {}) : fields;
174
+ const f = typeof fields == "function" ? fields(searchData) : fields;
175
175
  return (_jsx(SearchBar, { fields: f, onSubmit: onSubmit, className: `searchBar${showDataGrid ? "Grid" : "List"}`, width: rect.width, top: searchBarTop }));
176
176
  }, [showDataGrid, hasFields, searchBarHeight, rect?.width]);
177
177
  // Pull container
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCombinedRefs, useDimensions } from "@etsoo/react";
2
+ import { useCombinedRefs, useDimensions, useSearchParamsWithCache } from "@etsoo/react";
3
3
  import React from "react";
4
4
  import { DataGridEx } from "../DataGridEx";
5
5
  import { MUGlobal } from "../MUGlobal";
@@ -38,7 +38,7 @@ export function DataGridPage(props) {
38
38
  return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
39
39
  };
40
40
  // Search data
41
- const searchData = GridUtils.getSearchData(cacheKey);
41
+ const searchData = useSearchParamsWithCache(cacheKey);
42
42
  const onInitLoad = (ref) => {
43
43
  // Avoid repeatedly load from cache
44
44
  if (initLoadedRef.current || !cacheKey)
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCombinedRefs, useDimensions } from "@etsoo/react";
2
+ import { useCombinedRefs, useDimensions, useSearchParamsWithCache } from "@etsoo/react";
3
3
  import React from "react";
4
4
  import { MUGlobal } from "../MUGlobal";
5
5
  import { ScrollerListEx } from "../ScrollerListEx";
@@ -44,7 +44,7 @@ export function FixedListPage(props) {
44
44
  return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
45
45
  };
46
46
  // Search data
47
- const searchData = GridUtils.getSearchData(cacheKey);
47
+ const searchData = useSearchParamsWithCache(cacheKey);
48
48
  const onInitLoad = (ref) => {
49
49
  // Avoid repeatedly load from cache
50
50
  if (initLoadedRef.current || !cacheKey)
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCombinedRefs, useDimensions } from "@etsoo/react";
2
+ import { useCombinedRefs, useDimensions, useSearchParamsWithCache } from "@etsoo/react";
3
3
  import React from "react";
4
4
  import { MUGlobal } from "../MUGlobal";
5
5
  import { ScrollerListEx } from "../ScrollerListEx";
@@ -45,7 +45,7 @@ export function ListPage(props) {
45
45
  const { dimensions } = useDimensions(1, undefined, sizeReadyMiliseconds);
46
46
  const rect = dimensions[0][2];
47
47
  // Search data
48
- const searchData = GridUtils.getSearchData(cacheKey);
48
+ const searchData = useSearchParamsWithCache(cacheKey);
49
49
  const onInitLoad = (ref) => {
50
50
  // Avoid repeatedly load from cache
51
51
  if (initLoadedRef.current || !cacheKey)
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCombinedRefs, useDimensions } from "@etsoo/react";
2
+ import { useCombinedRefs, useDimensions, useSearchParamsWithCache } from "@etsoo/react";
3
3
  import React from "react";
4
4
  import { MUGlobal } from "../MUGlobal";
5
5
  import { SearchBar } from "../SearchBar";
@@ -41,7 +41,7 @@ export function TablePage(props) {
41
41
  return loadData(GridUtils.createLoader(props, fieldTemplate, cacheKey, false), lastItem);
42
42
  };
43
43
  // Search data
44
- const searchData = GridUtils.getSearchData(cacheKey);
44
+ const searchData = useSearchParamsWithCache(cacheKey);
45
45
  // Total width
46
46
  const totalWidth = React.useMemo(() => columns.reduce((previousValue, { width, minWidth }) => {
47
47
  return previousValue + (width ?? minWidth ?? TableExMinWidth);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.5.13",
3
+ "version": "1.5.15",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -42,7 +42,7 @@
42
42
  "@emotion/styled": "^11.14.0",
43
43
  "@etsoo/appscript": "^1.6.21",
44
44
  "@etsoo/notificationbase": "^1.1.60",
45
- "@etsoo/react": "^1.8.35",
45
+ "@etsoo/react": "^1.8.37",
46
46
  "@etsoo/shared": "^1.2.66",
47
47
  "@mui/icons-material": "^7.0.1",
48
48
  "@mui/material": "^7.0.1",
@@ -15,7 +15,8 @@ import {
15
15
  ReactUtils,
16
16
  ScrollerListRef,
17
17
  useCombinedRefs,
18
- useDimensions
18
+ useDimensions,
19
+ useSearchParamsWithCache
19
20
  } from "@etsoo/react";
20
21
  import { DataGridEx, DataGridExProps } from "./DataGridEx";
21
22
  import { MUGlobal } from "./MUGlobal";
@@ -252,7 +253,7 @@ export function ResponsibleContainer<T extends object, F>(
252
253
  };
253
254
 
254
255
  // Search data
255
- const searchData = GridUtils.getSearchData(cacheKey);
256
+ const searchData = useSearchParamsWithCache(cacheKey);
256
257
 
257
258
  // On submit callback
258
259
  const onSubmit = (data: FormData, _reset: boolean) => {
@@ -437,7 +438,7 @@ export function ResponsibleContainer<T extends object, F>(
437
438
  )
438
439
  return;
439
440
 
440
- const f = typeof fields == "function" ? fields(searchData ?? {}) : fields;
441
+ const f = typeof fields == "function" ? fields(searchData) : fields;
441
442
 
442
443
  return (
443
444
  <SearchBar
@@ -5,7 +5,8 @@ import {
5
5
  ScrollerGridForwardRef,
6
6
  VariableSizeGrid,
7
7
  useCombinedRefs,
8
- useDimensions
8
+ useDimensions,
9
+ useSearchParamsWithCache
9
10
  } from "@etsoo/react";
10
11
  import React from "react";
11
12
  import { DataGridEx } from "../DataGridEx";
@@ -84,7 +85,7 @@ export function DataGridPage<T extends object, F>(
84
85
  };
85
86
 
86
87
  // Search data
87
- const searchData = GridUtils.getSearchData(cacheKey);
88
+ const searchData = useSearchParamsWithCache(cacheKey);
88
89
 
89
90
  const onInitLoad = (
90
91
  ref: VariableSizeGrid<T>
@@ -5,7 +5,8 @@ import {
5
5
  ScrollerListForwardRef,
6
6
  ScrollerListRef,
7
7
  useCombinedRefs,
8
- useDimensions
8
+ useDimensions,
9
+ useSearchParamsWithCache
9
10
  } from "@etsoo/react";
10
11
  import React from "react";
11
12
  import { MUGlobal } from "../MUGlobal";
@@ -94,7 +95,7 @@ export function FixedListPage<T extends object, F>(
94
95
  };
95
96
 
96
97
  // Search data
97
- const searchData = GridUtils.getSearchData(cacheKey);
98
+ const searchData = useSearchParamsWithCache(cacheKey);
98
99
 
99
100
  const onInitLoad = (
100
101
  ref: ScrollerListRef
@@ -5,7 +5,8 @@ import {
5
5
  ScrollerListForwardRef,
6
6
  ScrollerListRef,
7
7
  useCombinedRefs,
8
- useDimensions
8
+ useDimensions,
9
+ useSearchParamsWithCache
9
10
  } from "@etsoo/react";
10
11
  import React from "react";
11
12
  import { MUGlobal } from "../MUGlobal";
@@ -86,7 +87,7 @@ export function ListPage<T extends object, F>(props: ListPageProps<T, F>) {
86
87
  const rect = dimensions[0][2];
87
88
 
88
89
  // Search data
89
- const searchData = GridUtils.getSearchData(cacheKey);
90
+ const searchData = useSearchParamsWithCache(cacheKey);
90
91
 
91
92
  const onInitLoad = (
92
93
  ref: ScrollerListRef
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  GridLoadDataProps,
3
3
  useCombinedRefs,
4
- useDimensions
4
+ useDimensions,
5
+ useSearchParamsWithCache
5
6
  } from "@etsoo/react";
6
7
  import { DataTypes, IdDefaultType } from "@etsoo/shared";
7
8
  import React from "react";
@@ -93,7 +94,7 @@ export function TablePage<
93
94
  };
94
95
 
95
96
  // Search data
96
- const searchData = GridUtils.getSearchData(cacheKey);
97
+ const searchData = useSearchParamsWithCache(cacheKey);
97
98
 
98
99
  // Total width
99
100
  const totalWidth = React.useMemo(