@etsoo/react 1.4.90 → 1.4.94

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,7 +10,7 @@ import { LoadingButton } from './LoadingButton';
10
10
  */
11
11
  export function ListMoreDisplay(props) {
12
12
  // Destruct
13
- const { autoLoad = true, children, defaultOrderBy, headerRenderer, headerTitle, loadBatchSize, loadData, moreLabel = typeof globalApp === 'undefined'
13
+ const { children, defaultOrderBy, headerRenderer, autoLoad = headerRenderer == null, headerTitle, loadBatchSize, loadData, moreLabel = typeof globalApp === 'undefined'
14
14
  ? undefined
15
15
  : globalApp.get('more') + '...', fieldTemplate, threshold, ...rest } = props;
16
16
  // Refs
@@ -73,7 +73,7 @@ export function ListMoreDisplay(props) {
73
73
  ref.currentPage = 0;
74
74
  ref.hasNextPage = true;
75
75
  // Load data
76
- loadDataLocal();
76
+ loadDataLocal(true);
77
77
  };
78
78
  React.useEffect(() => {
79
79
  if (autoLoad)
@@ -84,9 +84,6 @@ export function ListMoreDisplay(props) {
84
84
  ref.isMounted = false;
85
85
  };
86
86
  }, []);
87
- // Loading
88
- if (states.items == null)
89
- return React.createElement(CircularProgress, { size: 20 });
90
87
  return (React.createElement(React.Fragment, null,
91
88
  headerRenderer && headerRenderer(reset),
92
89
  React.createElement(Card, { ...rest },
@@ -94,7 +91,7 @@ export function ListMoreDisplay(props) {
94
91
  React.createElement(CardContent, { sx: {
95
92
  paddingTop: 0,
96
93
  paddingBottom: states.completed ? 0 : 'inherit'
97
- } }, states.items.map((item, index) => children(item, index))),
94
+ } }, states.items == null ? (React.createElement(CircularProgress, { size: 20 })) : (states.items.map((item, index) => children(item, index)))),
98
95
  !states.completed && (React.createElement(CardActions, { sx: { justifyContent: 'flex-end' } },
99
96
  React.createElement(LoadingButton, { onClick: async () => await loadDataLocal() }, moreLabel))))));
100
97
  }
@@ -267,5 +267,9 @@ export function SearchBar(props) {
267
267
  if (form)
268
268
  state.moreForm = form;
269
269
  } },
270
- React.createElement(Stack, { direction: "column", alignItems: "stretch", spacing: 2, padding: 2 }, moreItems))))));
270
+ React.createElement(Stack, { direction: "column", alignItems: "stretch", spacing: 2, padding: 2, sx: {
271
+ '& > :not(style)': {
272
+ minWidth: '100px'
273
+ }
274
+ } }, moreItems))))));
271
275
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.4.90",
3
+ "version": "1.4.94",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "@emotion/react": "^11.7.1",
51
51
  "@emotion/style": "^0.8.0",
52
52
  "@emotion/styled": "^11.6.0",
53
- "@etsoo/appscript": "^1.2.37",
53
+ "@etsoo/appscript": "^1.2.38",
54
54
  "@etsoo/notificationbase": "^1.1.1",
55
55
  "@etsoo/shared": "^1.1.10",
56
56
  "@mui/icons-material": "^5.3.1",
@@ -68,10 +68,10 @@ export function ListMoreDisplay<
68
68
  >(props: ListMoreDisplayProps<T, F>) {
69
69
  // Destruct
70
70
  const {
71
- autoLoad = true,
72
71
  children,
73
72
  defaultOrderBy,
74
73
  headerRenderer,
74
+ autoLoad = headerRenderer == null,
75
75
  headerTitle,
76
76
  loadBatchSize,
77
77
  loadData,
@@ -157,7 +157,7 @@ export function ListMoreDisplay<
157
157
  ref.hasNextPage = true;
158
158
 
159
159
  // Load data
160
- loadDataLocal();
160
+ loadDataLocal(true);
161
161
  };
162
162
 
163
163
  React.useEffect(() => {
@@ -170,9 +170,6 @@ export function ListMoreDisplay<
170
170
  };
171
171
  }, []);
172
172
 
173
- // Loading
174
- if (states.items == null) return <CircularProgress size={20} />;
175
-
176
173
  return (
177
174
  <React.Fragment>
178
175
  {headerRenderer && headerRenderer(reset)}
@@ -184,7 +181,11 @@ export function ListMoreDisplay<
184
181
  paddingBottom: states.completed ? 0 : 'inherit'
185
182
  }}
186
183
  >
187
- {states.items.map((item, index) => children(item, index))}
184
+ {states.items == null ? (
185
+ <CircularProgress size={20} />
186
+ ) : (
187
+ states.items.map((item, index) => children(item, index))
188
+ )}
188
189
  </CardContent>
189
190
  {!states.completed && (
190
191
  <CardActions sx={{ justifyContent: 'flex-end' }}>
@@ -397,6 +397,11 @@ export function SearchBar(props: SearchBarProps) {
397
397
  alignItems="stretch"
398
398
  spacing={2}
399
399
  padding={2}
400
+ sx={{
401
+ '& > :not(style)': {
402
+ minWidth: '100px'
403
+ }
404
+ }}
400
405
  >
401
406
  {moreItems}
402
407
  </Stack>