@etsoo/materialui 1.0.75 → 1.0.78

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.
@@ -6,6 +6,10 @@ import { GridData, GridLoader } from '@etsoo/react';
6
6
  * ListMoreDisplay props
7
7
  */
8
8
  export interface ListMoreDisplayProps<T extends object, F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate> extends Omit<CardProps, 'children'>, GridLoader<T> {
9
+ /**
10
+ * Batch size to load
11
+ */
12
+ batchSize?: number;
9
13
  /**
10
14
  * Children to display the list
11
15
  */
@@ -10,7 +10,7 @@ import { globalApp } from './app/ReactApp';
10
10
  */
11
11
  export function ListMoreDisplay(props) {
12
12
  // Destruct
13
- const { children, defaultOrderBy, headerRenderer, autoLoad = headerRenderer == null, headerTitle, loadBatchSize, loadData, moreLabel = typeof globalApp === 'undefined'
13
+ const { batchSize = 6, 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
@@ -20,7 +20,7 @@ export function ListMoreDisplay(props) {
20
20
  hasNextPage: true,
21
21
  isNextPageLoading: false,
22
22
  orderBy: defaultOrderBy,
23
- batchSize: 10,
23
+ batchSize,
24
24
  loadedItems: 0,
25
25
  selectedItems: [],
26
26
  idCache: {}
@@ -10,5 +10,7 @@ export function MoneyText(props) {
10
10
  // Destruct
11
11
  const { currency, isInteger = false, locale, options = {}, value, ...rest } = props;
12
12
  // Layout
13
- return (React.createElement(Typography, { component: "span", fontSize: "inherit", ...rest }, NumberUtils.formatMoney(value, currency, locale, isInteger, options)));
13
+ return (React.createElement(Typography, { component: "span", fontSize: "inherit", ...rest }, value == null
14
+ ? ''
15
+ : NumberUtils.formatMoney(value, currency, locale, isInteger, options)));
14
16
  }
@@ -15,7 +15,7 @@ export interface NumberTextProps extends TypographyProps {
15
15
  /**
16
16
  * Value
17
17
  */
18
- value?: number | bigint;
18
+ value?: number | bigint | null;
19
19
  }
20
20
  /**
21
21
  * Number text
@@ -10,5 +10,5 @@ export function NumberText(props) {
10
10
  // Destruct
11
11
  const { locale, options = {}, value, ...rest } = props;
12
12
  // Layout
13
- return (React.createElement(Typography, { component: "span", fontSize: "inherit", ...rest }, NumberUtils.format(value, locale, options)));
13
+ return (React.createElement(Typography, { component: "span", fontSize: "inherit", ...rest }, value == null ? '' : NumberUtils.format(value, locale, options)));
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.0.75",
3
+ "version": "1.0.78",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -51,10 +51,10 @@
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.30",
55
- "@etsoo/notificationbase": "^1.1.14",
56
- "@etsoo/react": "^1.6.24",
57
- "@etsoo/shared": "^1.1.75",
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
58
  "@mui/icons-material": "^5.10.9",
59
59
  "@mui/material": "^5.10.13",
60
60
  "@types/pica": "^9.0.1",
@@ -26,6 +26,11 @@ export interface ListMoreDisplayProps<
26
26
  F extends DataTypes.BasicTemplate = DataTypes.BasicTemplate
27
27
  > extends Omit<CardProps, 'children'>,
28
28
  GridLoader<T> {
29
+ /**
30
+ * Batch size to load
31
+ */
32
+ batchSize?: number;
33
+
29
34
  /**
30
35
  * Children to display the list
31
36
  */
@@ -68,6 +73,7 @@ export function ListMoreDisplay<
68
73
  >(props: ListMoreDisplayProps<T, F>) {
69
74
  // Destruct
70
75
  const {
76
+ batchSize = 6,
71
77
  children,
72
78
  defaultOrderBy,
73
79
  headerRenderer,
@@ -90,7 +96,7 @@ export function ListMoreDisplay<
90
96
  hasNextPage: true,
91
97
  isNextPageLoading: false,
92
98
  orderBy: defaultOrderBy,
93
- batchSize: 10,
99
+ batchSize,
94
100
  loadedItems: 0,
95
101
  selectedItems: [],
96
102
  idCache: {}
@@ -37,13 +37,15 @@ export function MoneyText(props: MoneyTextProps) {
37
37
  // Layout
38
38
  return (
39
39
  <Typography component="span" fontSize="inherit" {...rest}>
40
- {NumberUtils.formatMoney(
41
- value,
42
- currency,
43
- locale,
44
- isInteger,
45
- options
46
- )}
40
+ {value == null
41
+ ? ''
42
+ : NumberUtils.formatMoney(
43
+ value,
44
+ currency,
45
+ locale,
46
+ isInteger,
47
+ options
48
+ )}
47
49
  </Typography>
48
50
  );
49
51
  }
@@ -19,7 +19,7 @@ export interface NumberTextProps extends TypographyProps {
19
19
  /**
20
20
  * Value
21
21
  */
22
- value?: number | bigint;
22
+ value?: number | bigint | null;
23
23
  }
24
24
 
25
25
  /**
@@ -34,7 +34,7 @@ export function NumberText(props: NumberTextProps) {
34
34
  // Layout
35
35
  return (
36
36
  <Typography component="span" fontSize="inherit" {...rest}>
37
- {NumberUtils.format(value, locale, options)}
37
+ {value == null ? '' : NumberUtils.format(value, locale, options)}
38
38
  </Typography>
39
39
  );
40
40
  }