@etsoo/materialui 1.3.14 → 1.3.16
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/lib/GridUtils.js +1 -0
- package/lib/IntInputField.d.ts +1 -1
- package/lib/IntInputField.js +1 -1
- package/lib/MoneyInputField.d.ts +1 -1
- package/lib/MoneyInputField.js +1 -1
- package/lib/NumberInputField.d.ts +29 -0
- package/lib/NumberInputField.js +17 -0
- package/lib/ResponsibleContainer.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/pages/DataGridPage.js +1 -1
- package/lib/pages/FixedListPage.js +1 -1
- package/lib/pages/ListPage.js +1 -1
- package/lib/pages/TablePage.js +1 -1
- package/package.json +5 -5
- package/src/GridUtils.ts +1 -0
- package/src/IntInputField.tsx +1 -1
- package/src/MoneyInputField.tsx +1 -1
- package/src/NumberInputField.tsx +58 -0
- package/src/ResponsibleContainer.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/pages/DataGridPage.tsx +1 -1
- package/src/pages/FixedListPage.tsx +1 -1
- package/src/pages/ListPage.tsx +1 -1
- package/src/pages/TablePage.tsx +1 -1
package/lib/GridUtils.js
CHANGED
|
@@ -30,6 +30,7 @@ export var GridUtils;
|
|
|
30
30
|
if (cacheSource) {
|
|
31
31
|
const cacheData = JSON.parse(cacheSource);
|
|
32
32
|
if (new Date().valueOf() - cacheData.creation > cacheMinutes * 60000) {
|
|
33
|
+
sessionStorage.removeItem(`${cacheKey}-searchbar`);
|
|
33
34
|
sessionStorage.removeItem(cacheKey);
|
|
34
35
|
return;
|
|
35
36
|
}
|
package/lib/IntInputField.d.ts
CHANGED
|
@@ -50,6 +50,6 @@ export type IntInputFieldProps = Omit<InputFieldProps, "type" | "inputProps" | "
|
|
|
50
50
|
boxProps?: BoxProps;
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
53
|
-
* Integer input field
|
|
53
|
+
* Integer input field (controlled)
|
|
54
54
|
*/
|
|
55
55
|
export declare const IntInputField: React.ForwardRefExoticComponent<Omit<IntInputFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/lib/IntInputField.js
CHANGED
|
@@ -5,7 +5,7 @@ import React from "react";
|
|
|
5
5
|
import { NumberUtils } from "@etsoo/shared";
|
|
6
6
|
import { InputField } from "./InputField";
|
|
7
7
|
/**
|
|
8
|
-
* Integer input field
|
|
8
|
+
* Integer input field (controlled)
|
|
9
9
|
*/
|
|
10
10
|
export const IntInputField = React.forwardRef((props, ref) => {
|
|
11
11
|
// Destruct
|
package/lib/MoneyInputField.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ import { IntInputFieldProps } from "./IntInputField";
|
|
|
5
5
|
*/
|
|
6
6
|
export type MoneyInputFieldProps = IntInputFieldProps & {};
|
|
7
7
|
/**
|
|
8
|
-
* Money input field
|
|
8
|
+
* Money input field (controlled)
|
|
9
9
|
*/
|
|
10
10
|
export declare const MoneyInputField: React.ForwardRefExoticComponent<Omit<MoneyInputFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/lib/MoneyInputField.js
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputFieldProps } from "./InputField";
|
|
3
|
+
/**
|
|
4
|
+
* Number input field properties
|
|
5
|
+
*/
|
|
6
|
+
export type NumberInputFieldProps = Omit<InputFieldProps, "type" | "inputProps"> & {
|
|
7
|
+
/**
|
|
8
|
+
* Input field style
|
|
9
|
+
*/
|
|
10
|
+
inputStyle?: React.CSSProperties;
|
|
11
|
+
/**
|
|
12
|
+
* Minimum value
|
|
13
|
+
*/
|
|
14
|
+
min?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Maximum value
|
|
17
|
+
*/
|
|
18
|
+
max?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Step value
|
|
21
|
+
*/
|
|
22
|
+
step?: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Number input field, for controlled only components, please see IntInputField and MoneyInputField
|
|
26
|
+
* @param props Props
|
|
27
|
+
* @returns Component
|
|
28
|
+
*/
|
|
29
|
+
export declare function NumberInputField(props: NumberInputFieldProps): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputField } from "./InputField";
|
|
3
|
+
/**
|
|
4
|
+
* Number input field, for controlled only components, please see IntInputField and MoneyInputField
|
|
5
|
+
* @param props Props
|
|
6
|
+
* @returns Component
|
|
7
|
+
*/
|
|
8
|
+
export function NumberInputField(props) {
|
|
9
|
+
const { inputStyle = { textAlign: "right" }, min = 0, step = 1, max = 9999999, ...rest } = props;
|
|
10
|
+
return (React.createElement(InputField, { inputProps: {
|
|
11
|
+
min,
|
|
12
|
+
step,
|
|
13
|
+
max,
|
|
14
|
+
style: inputStyle,
|
|
15
|
+
inputMode: "numeric"
|
|
16
|
+
}, ...rest }));
|
|
17
|
+
}
|
|
@@ -23,7 +23,7 @@ function defaultContainerBoxSx(paddings, hasField, _dataGrid) {
|
|
|
23
23
|
*/
|
|
24
24
|
export function ResponsibleContainer(props) {
|
|
25
25
|
// Destruct
|
|
26
|
-
const { adjustHeight, adjustFabHeight, cacheKey, cacheMinutes =
|
|
26
|
+
const { adjustHeight, adjustFabHeight, cacheKey, cacheMinutes = 15, columns, containerBoxSx = defaultContainerBoxSx, dataGridMinWidth = Math.max(576, DataGridExCalColumns(columns).total), elementReady, fields, fieldTemplate, height, loadData, mRef, paddings = MUGlobal.pagePaddings, pullToRefresh = true, quickAction, sizeReadyMiliseconds = 0, searchBarHeight = 45.6, ...rest } = props;
|
|
27
27
|
// Labels
|
|
28
28
|
const labels = Labels.CommonPage;
|
|
29
29
|
// Refs
|
package/lib/index.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ export * from "./MUGlobal";
|
|
|
79
79
|
export * from "./MUUtils";
|
|
80
80
|
export * from "./NotifierMU";
|
|
81
81
|
export * from "./NotifierPopupProps";
|
|
82
|
+
export * from "./NumberInputField";
|
|
82
83
|
export * from "./OptionBool";
|
|
83
84
|
export * from "./OptionGroup";
|
|
84
85
|
export * from "./PercentCircularProgress";
|
package/lib/index.js
CHANGED
|
@@ -79,6 +79,7 @@ export * from "./MUGlobal";
|
|
|
79
79
|
export * from "./MUUtils";
|
|
80
80
|
export * from "./NotifierMU";
|
|
81
81
|
export * from "./NotifierPopupProps";
|
|
82
|
+
export * from "./NumberInputField";
|
|
82
83
|
export * from "./OptionBool";
|
|
83
84
|
export * from "./OptionGroup";
|
|
84
85
|
export * from "./PercentCircularProgress";
|
|
@@ -14,7 +14,7 @@ import { GridUtils } from "../GridUtils";
|
|
|
14
14
|
export function DataGridPage(props) {
|
|
15
15
|
var _a;
|
|
16
16
|
// Destruct
|
|
17
|
-
const { adjustHeight, fields, fieldTemplate, height, loadData, mRef, sizeReadyMiliseconds = 100, pageProps = {}, cacheKey, cacheMinutes =
|
|
17
|
+
const { adjustHeight, fields, fieldTemplate, height, loadData, mRef, sizeReadyMiliseconds = 100, pageProps = {}, cacheKey, cacheMinutes = 15, ...rest } = props;
|
|
18
18
|
(_a = pageProps.paddings) !== null && _a !== void 0 ? _a : (pageProps.paddings = MUGlobal.pagePaddings);
|
|
19
19
|
// States
|
|
20
20
|
const [states, setStates] = React.useReducer((currentState, newState) => {
|
|
@@ -14,7 +14,7 @@ import { GridUtils } from "../GridUtils";
|
|
|
14
14
|
export function FixedListPage(props) {
|
|
15
15
|
var _a;
|
|
16
16
|
// Destruct
|
|
17
|
-
const { adjustHeight, fields, fieldTemplate, loadData, mRef, sizeReadyMiliseconds = 0, pageProps = {}, cacheKey, cacheMinutes =
|
|
17
|
+
const { adjustHeight, fields, fieldTemplate, loadData, mRef, sizeReadyMiliseconds = 0, pageProps = {}, cacheKey, cacheMinutes = 15, ...rest } = props;
|
|
18
18
|
(_a = pageProps.paddings) !== null && _a !== void 0 ? _a : (pageProps.paddings = MUGlobal.pagePaddings);
|
|
19
19
|
// States
|
|
20
20
|
const [states] = React.useState({});
|
package/lib/pages/ListPage.js
CHANGED
|
@@ -14,7 +14,7 @@ import { GridUtils } from "../GridUtils";
|
|
|
14
14
|
export function ListPage(props) {
|
|
15
15
|
var _a;
|
|
16
16
|
// Destruct
|
|
17
|
-
const { fields, fieldTemplate, loadData, mRef, pageProps = {}, cacheKey, cacheMinutes =
|
|
17
|
+
const { fields, fieldTemplate, loadData, mRef, pageProps = {}, cacheKey, cacheMinutes = 15, ...rest } = props;
|
|
18
18
|
(_a = pageProps.paddings) !== null && _a !== void 0 ? _a : (pageProps.paddings = MUGlobal.pagePaddings);
|
|
19
19
|
// States
|
|
20
20
|
const [states] = React.useState({});
|
package/lib/pages/TablePage.js
CHANGED
|
@@ -14,7 +14,7 @@ import { GridUtils } from "../GridUtils";
|
|
|
14
14
|
export function TablePage(props) {
|
|
15
15
|
var _a;
|
|
16
16
|
// Destruct
|
|
17
|
-
const { columns, fields, fieldTemplate, loadData, mRef, sizeReadyMiliseconds = 0, pageProps = {}, cacheKey, cacheMinutes =
|
|
17
|
+
const { columns, fields, fieldTemplate, loadData, mRef, sizeReadyMiliseconds = 0, pageProps = {}, cacheKey, cacheMinutes = 15, ...rest } = props;
|
|
18
18
|
(_a = pageProps.paddings) !== null && _a !== void 0 ? _a : (pageProps.paddings = MUGlobal.pagePaddings);
|
|
19
19
|
// States
|
|
20
20
|
const [states] = React.useState({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"@emotion/css": "^11.11.2",
|
|
51
51
|
"@emotion/react": "^11.11.1",
|
|
52
52
|
"@emotion/styled": "^11.11.0",
|
|
53
|
-
"@etsoo/appscript": "^1.4.
|
|
53
|
+
"@etsoo/appscript": "^1.4.53",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.28",
|
|
55
|
-
"@etsoo/react": "^1.7.
|
|
55
|
+
"@etsoo/react": "^1.7.10",
|
|
56
56
|
"@etsoo/shared": "^1.2.12",
|
|
57
57
|
"@mui/icons-material": "^5.14.9",
|
|
58
58
|
"@mui/material": "^5.14.9",
|
|
59
|
-
"@mui/x-data-grid": "^6.
|
|
59
|
+
"@mui/x-data-grid": "^6.14.0",
|
|
60
60
|
"@types/pica": "^9.0.1",
|
|
61
61
|
"@types/pulltorefreshjs": "^0.1.5",
|
|
62
62
|
"@types/react": "^18.2.21",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@babel/cli": "^7.22.15",
|
|
79
|
-
"@babel/core": "^7.22.
|
|
79
|
+
"@babel/core": "^7.22.19",
|
|
80
80
|
"@babel/plugin-transform-runtime": "^7.22.15",
|
|
81
81
|
"@babel/preset-env": "^7.22.15",
|
|
82
82
|
"@babel/preset-react": "^7.22.15",
|
package/src/GridUtils.ts
CHANGED
|
@@ -42,6 +42,7 @@ export namespace GridUtils {
|
|
|
42
42
|
if (cacheSource) {
|
|
43
43
|
const cacheData = JSON.parse(cacheSource) as GridDataCacheType<T>;
|
|
44
44
|
if (new Date().valueOf() - cacheData.creation > cacheMinutes * 60000) {
|
|
45
|
+
sessionStorage.removeItem(`${cacheKey}-searchbar`);
|
|
45
46
|
sessionStorage.removeItem(cacheKey);
|
|
46
47
|
return;
|
|
47
48
|
}
|
package/src/IntInputField.tsx
CHANGED
package/src/MoneyInputField.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { IntInputField, IntInputFieldProps } from "./IntInputField";
|
|
|
7
7
|
export type MoneyInputFieldProps = IntInputFieldProps & {};
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Money input field
|
|
10
|
+
* Money input field (controlled)
|
|
11
11
|
*/
|
|
12
12
|
export const MoneyInputField = React.forwardRef<
|
|
13
13
|
HTMLDivElement,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputField, InputFieldProps } from "./InputField";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Number input field properties
|
|
6
|
+
*/
|
|
7
|
+
export type NumberInputFieldProps = Omit<
|
|
8
|
+
InputFieldProps,
|
|
9
|
+
"type" | "inputProps"
|
|
10
|
+
> & {
|
|
11
|
+
/**
|
|
12
|
+
* Input field style
|
|
13
|
+
*/
|
|
14
|
+
inputStyle?: React.CSSProperties;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Minimum value
|
|
18
|
+
*/
|
|
19
|
+
min?: number;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Maximum value
|
|
23
|
+
*/
|
|
24
|
+
max?: number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Step value
|
|
28
|
+
*/
|
|
29
|
+
step?: number;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Number input field, for controlled only components, please see IntInputField and MoneyInputField
|
|
34
|
+
* @param props Props
|
|
35
|
+
* @returns Component
|
|
36
|
+
*/
|
|
37
|
+
export function NumberInputField(props: NumberInputFieldProps) {
|
|
38
|
+
const {
|
|
39
|
+
inputStyle = { textAlign: "right" },
|
|
40
|
+
min = 0,
|
|
41
|
+
step = 1,
|
|
42
|
+
max = 9999999,
|
|
43
|
+
...rest
|
|
44
|
+
} = props;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<InputField
|
|
48
|
+
inputProps={{
|
|
49
|
+
min,
|
|
50
|
+
step,
|
|
51
|
+
max,
|
|
52
|
+
style: inputStyle,
|
|
53
|
+
inputMode: "numeric"
|
|
54
|
+
}}
|
|
55
|
+
{...rest}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -198,7 +198,7 @@ export function ResponsibleContainer<
|
|
|
198
198
|
adjustHeight,
|
|
199
199
|
adjustFabHeight,
|
|
200
200
|
cacheKey,
|
|
201
|
-
cacheMinutes =
|
|
201
|
+
cacheMinutes = 15,
|
|
202
202
|
columns,
|
|
203
203
|
containerBoxSx = defaultContainerBoxSx,
|
|
204
204
|
dataGridMinWidth = Math.max(576, DataGridExCalColumns(columns).total),
|
package/src/index.ts
CHANGED
|
@@ -83,6 +83,7 @@ export * from "./MUGlobal";
|
|
|
83
83
|
export * from "./MUUtils";
|
|
84
84
|
export * from "./NotifierMU";
|
|
85
85
|
export * from "./NotifierPopupProps";
|
|
86
|
+
export * from "./NumberInputField";
|
|
86
87
|
export * from "./OptionBool";
|
|
87
88
|
export * from "./OptionGroup";
|
|
88
89
|
export * from "./PercentCircularProgress";
|
package/src/pages/ListPage.tsx
CHANGED