@etsoo/materialui 1.4.22 → 1.4.23

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.
Files changed (92) hide show
  1. package/README.md +2 -1
  2. package/babel.config.json +12 -12
  3. package/lib/AddresSelector.d.ts +8 -2
  4. package/lib/AddresSelector.js +1 -1
  5. package/lib/AuditDisplay.d.ts +1 -1
  6. package/lib/BackButton.d.ts +1 -1
  7. package/lib/BackButton.js +5 -5
  8. package/lib/CountryList.d.ts +5 -4
  9. package/lib/CountryList.js +3 -3
  10. package/lib/CustomFabProps.d.ts +3 -3
  11. package/lib/DataGridEx.js +3 -6
  12. package/lib/DataGridRenderers.d.ts +3 -3
  13. package/lib/DataGridRenderers.js +17 -17
  14. package/lib/DataTable.d.ts +1 -7
  15. package/lib/DataTable.js +3 -13
  16. package/lib/DialogButton.d.ts +2 -2
  17. package/lib/DialogButton.js +4 -4
  18. package/lib/EmailInput.d.ts +2 -2
  19. package/lib/EmailInput.js +2 -2
  20. package/lib/FlexBox.d.ts +3 -3
  21. package/lib/FlexBox.js +1 -1
  22. package/lib/GridDataFormat.d.ts +2 -2
  23. package/lib/GridDataFormat.js +7 -7
  24. package/lib/GridUtils.js +2 -1
  25. package/lib/ListItemRightIcon.d.ts +1 -1
  26. package/lib/ListItemRightIcon.js +2 -2
  27. package/lib/LoadingButton.d.ts +1 -1
  28. package/lib/LoadingButton.js +2 -2
  29. package/lib/MUGlobal.d.ts +6 -6
  30. package/lib/MUGlobal.js +20 -22
  31. package/lib/MobileListItemRenderer.d.ts +3 -3
  32. package/lib/MobileListItemRenderer.js +8 -10
  33. package/lib/PList.js +1 -1
  34. package/lib/ProgressCount.js +12 -12
  35. package/lib/RegionsRQ.d.ts +22 -0
  36. package/lib/RegionsRQ.js +1 -0
  37. package/lib/SearchField.d.ts +1 -1
  38. package/lib/SearchField.js +4 -4
  39. package/lib/SearchOptionGroup.d.ts +2 -2
  40. package/lib/SearchOptionGroup.js +3 -3
  41. package/lib/Switch.d.ts +3 -3
  42. package/lib/Switch.js +5 -5
  43. package/lib/TabBox.d.ts +5 -5
  44. package/lib/TabBox.js +5 -5
  45. package/lib/TableEx.js +4 -7
  46. package/lib/TooltipClick.d.ts +3 -3
  47. package/lib/TooltipClick.js +3 -3
  48. package/lib/TwoFieldInput.d.ts +2 -2
  49. package/lib/TwoFieldInput.js +13 -13
  50. package/lib/app/IServicePage.d.ts +1 -1
  51. package/lib/app/Labels.d.ts +1 -1
  52. package/lib/app/Labels.js +31 -31
  53. package/lib/index.d.ts +1 -0
  54. package/lib/index.js +1 -0
  55. package/lib/texts/MoneyText.d.ts +1 -1
  56. package/lib/texts/MoneyText.js +3 -3
  57. package/lib/texts/NumberText.d.ts +1 -1
  58. package/lib/texts/NumberText.js +3 -3
  59. package/package.json +20 -20
  60. package/src/AddresSelector.tsx +31 -4
  61. package/src/AuditDisplay.tsx +1 -1
  62. package/src/BackButton.tsx +39 -39
  63. package/src/CountryList.tsx +49 -48
  64. package/src/CustomFabProps.ts +19 -19
  65. package/src/DataGridEx.tsx +2 -7
  66. package/src/DataGridRenderers.tsx +119 -119
  67. package/src/DataTable.tsx +2 -31
  68. package/src/DialogButton.tsx +149 -151
  69. package/src/EmailInput.tsx +9 -11
  70. package/src/FlexBox.tsx +6 -6
  71. package/src/GridDataFormat.tsx +58 -58
  72. package/src/GridUtils.ts +2 -1
  73. package/src/ListItemRightIcon.tsx +3 -3
  74. package/src/LoadingButton.tsx +53 -53
  75. package/src/MUGlobal.ts +196 -203
  76. package/src/MobileListItemRenderer.tsx +63 -65
  77. package/src/NotifierPromptProps.ts +16 -16
  78. package/src/PList.tsx +14 -14
  79. package/src/ProgressCount.tsx +144 -148
  80. package/src/RegionsRQ.ts +26 -0
  81. package/src/SearchField.tsx +59 -59
  82. package/src/SearchOptionGroup.tsx +20 -20
  83. package/src/Switch.tsx +72 -72
  84. package/src/TabBox.tsx +87 -89
  85. package/src/TableEx.tsx +5 -8
  86. package/src/TooltipClick.tsx +62 -64
  87. package/src/TwoFieldInput.tsx +104 -104
  88. package/src/app/IServicePage.ts +1 -1
  89. package/src/app/Labels.ts +67 -67
  90. package/src/index.ts +1 -0
  91. package/src/texts/MoneyText.tsx +29 -35
  92. package/src/texts/NumberText.tsx +23 -23
package/lib/app/Labels.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Utils } from '@etsoo/shared';
1
+ import { Utils } from "@etsoo/shared";
2
2
  /**
3
3
  * Labels
4
4
  */
@@ -8,46 +8,46 @@ export var Labels;
8
8
  * Common page labels
9
9
  */
10
10
  Labels.CommonPage = {
11
- add: 'Add',
12
- back: 'Back',
13
- delete: 'Delete',
14
- more: 'More',
15
- pullToRefresh: 'Pull down to refresh',
16
- refresh: 'Refresh',
17
- refreshing: 'Refreshing',
18
- releaseToRefresh: 'Release to refresh',
19
- reset: 'Reset',
20
- save: 'Save',
21
- scrollTop: 'Scroll to top',
22
- submit: 'Submit'
11
+ add: "Add",
12
+ back: "Back",
13
+ delete: "Delete",
14
+ more: "More",
15
+ pullToRefresh: "Pull down to refresh",
16
+ refresh: "Refresh",
17
+ refreshing: "Refreshing",
18
+ releaseToRefresh: "Release to refresh",
19
+ reset: "Reset",
20
+ save: "Save",
21
+ scrollTop: "Scroll to top",
22
+ submit: "Submit"
23
23
  };
24
24
  /**
25
25
  * Notification MU labels
26
26
  */
27
27
  Labels.NotificationMU = {
28
- alertTitle: 'Warning',
29
- alertOK: 'OK',
30
- confirmTitle: 'Confirm',
31
- confirmYes: 'OK',
32
- confirmNo: 'Cancel',
33
- promptTitle: 'Input',
34
- promptCancel: 'Cancel',
35
- promptOK: 'OK',
36
- loading: 'Loading',
37
- success: 'Success',
38
- warning: 'Warning',
39
- info: 'Information'
28
+ alertTitle: "Warning",
29
+ alertOK: "OK",
30
+ confirmTitle: "Confirm",
31
+ confirmYes: "OK",
32
+ confirmNo: "Cancel",
33
+ promptTitle: "Input",
34
+ promptCancel: "Cancel",
35
+ promptOK: "OK",
36
+ loading: "Loading",
37
+ success: "Success",
38
+ warning: "Warning",
39
+ info: "Information"
40
40
  };
41
41
  /**
42
42
  * UserAvatarEditor labels
43
43
  */
44
44
  Labels.UserAvatarEditor = {
45
- done: 'Done',
46
- reset: 'Reset',
47
- rotateLeft: 'Rotate left 90°',
48
- rotateRight: 'Rotate right 90°',
49
- upload: 'Upload',
50
- zoom: 'Zoom'
45
+ done: "Done",
46
+ reset: "Reset",
47
+ rotateLeft: "Rotate left 90°",
48
+ rotateRight: "Rotate right 90°",
49
+ upload: "Upload",
50
+ zoom: "Zoom"
51
51
  };
52
52
  /**
53
53
  * Set components' labels
package/lib/index.d.ts CHANGED
@@ -89,6 +89,7 @@ export * from "./PList";
89
89
  export * from "./ProgressCount";
90
90
  export * from "./PullToRefreshUI";
91
91
  export * from "./QuickList";
92
+ export * from "./RegionsRQ";
92
93
  export * from "./ResponsibleContainer";
93
94
  export * from "./ResponsiveStyleValue";
94
95
  export * from "./ScrollerListEx";
package/lib/index.js CHANGED
@@ -89,6 +89,7 @@ export * from "./PList";
89
89
  export * from "./ProgressCount";
90
90
  export * from "./PullToRefreshUI";
91
91
  export * from "./QuickList";
92
+ export * from "./RegionsRQ";
92
93
  export * from "./ResponsibleContainer";
93
94
  export * from "./ResponsiveStyleValue";
94
95
  export * from "./ScrollerListEx";
@@ -1,4 +1,4 @@
1
- import { NumberTextProps } from './NumberText';
1
+ import { NumberTextProps } from "./NumberText";
2
2
  /**
3
3
  * Money text props
4
4
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { NumberUtils } from '@etsoo/shared';
3
- import { Typography } from '@mui/material';
2
+ import { NumberUtils } from "@etsoo/shared";
3
+ import { Typography } from "@mui/material";
4
4
  /**
5
5
  * Money text
6
6
  * @param props Props
@@ -11,6 +11,6 @@ export function MoneyText(props) {
11
11
  const { currency, isInteger = false, locale, options = {}, value, ...rest } = props;
12
12
  // Layout
13
13
  return (_jsx(Typography, { component: "span", fontSize: "inherit", ...rest, children: value == null
14
- ? ''
14
+ ? ""
15
15
  : NumberUtils.formatMoney(value, currency, locale, isInteger, options) }));
16
16
  }
@@ -1,4 +1,4 @@
1
- import { TypographyProps } from '@mui/material';
1
+ import { TypographyProps } from "@mui/material";
2
2
  /**
3
3
  * Number text props
4
4
  */
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { NumberUtils } from '@etsoo/shared';
3
- import { Typography } from '@mui/material';
2
+ import { NumberUtils } from "@etsoo/shared";
3
+ import { Typography } from "@mui/material";
4
4
  /**
5
5
  * Number text
6
6
  * @param props Props
@@ -10,5 +10,5 @@ export function NumberText(props) {
10
10
  // Destruct
11
11
  const { locale, options = {}, value, ...rest } = props;
12
12
  // Layout
13
- return (_jsx(Typography, { component: "span", fontSize: "inherit", ...rest, children: value == null ? '' : NumberUtils.format(value, locale, options) }));
13
+ return (_jsx(Typography, { component: "span", fontSize: "inherit", ...rest, children: 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.4.22",
3
+ "version": "1.4.23",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -47,17 +47,17 @@
47
47
  "dependencies": {
48
48
  "@dnd-kit/core": "^6.1.0",
49
49
  "@dnd-kit/sortable": "^8.0.0",
50
- "@emotion/css": "^11.13.4",
51
- "@emotion/react": "^11.13.3",
52
- "@emotion/styled": "^11.13.0",
53
- "@etsoo/appscript": "^1.5.62",
54
- "@etsoo/notificationbase": "^1.1.52",
55
- "@etsoo/react": "^1.7.93",
56
- "@etsoo/shared": "^1.2.51",
57
- "@mui/icons-material": "^6.1.5",
58
- "@mui/material": "^6.1.5",
59
- "@mui/x-data-grid": "^7.21.0",
60
- "chart.js": "^4.4.5",
50
+ "@emotion/css": "^11.13.5",
51
+ "@emotion/react": "^11.13.5",
52
+ "@emotion/styled": "^11.13.5",
53
+ "@etsoo/appscript": "^1.5.64",
54
+ "@etsoo/notificationbase": "^1.1.53",
55
+ "@etsoo/react": "^1.7.96",
56
+ "@etsoo/shared": "^1.2.54",
57
+ "@mui/icons-material": "^6.1.8",
58
+ "@mui/material": "^6.1.8",
59
+ "@mui/x-data-grid": "^7.22.3",
60
+ "chart.js": "^4.4.6",
61
61
  "chartjs-plugin-datalabels": "^2.2.0",
62
62
  "eventemitter3": "^5.0.1",
63
63
  "pica": "^9.0.1",
@@ -71,13 +71,13 @@
71
71
  },
72
72
  "devDependencies": {
73
73
  "@babel/cli": "^7.25.9",
74
- "@babel/core": "^7.25.9",
74
+ "@babel/core": "^7.26.0",
75
75
  "@babel/plugin-transform-runtime": "^7.25.9",
76
- "@babel/preset-env": "^7.25.9",
76
+ "@babel/preset-env": "^7.26.0",
77
77
  "@babel/preset-react": "^7.25.9",
78
- "@babel/preset-typescript": "^7.25.9",
79
- "@babel/runtime-corejs3": "^7.25.9",
80
- "@testing-library/jest-dom": "^6.6.2",
78
+ "@babel/preset-typescript": "^7.26.0",
79
+ "@babel/runtime-corejs3": "^7.26.0",
80
+ "@testing-library/jest-dom": "^6.6.3",
81
81
  "@testing-library/react": "^16.0.1",
82
82
  "@types/jest": "^29.5.14",
83
83
  "@types/pica": "^9.0.4",
@@ -85,10 +85,10 @@
85
85
  "@types/react": "^18.3.12",
86
86
  "@types/react-avatar-editor": "^13.0.3",
87
87
  "@types/react-dom": "^18.3.1",
88
- "@types/react-input-mask": "^3.0.5",
88
+ "@types/react-input-mask": "^3.0.6",
89
89
  "@types/react-window": "^1.8.8",
90
- "@typescript-eslint/eslint-plugin": "^8.11.0",
91
- "@typescript-eslint/parser": "^8.11.0",
90
+ "@typescript-eslint/eslint-plugin": "^8.15.0",
91
+ "@typescript-eslint/parser": "^8.15.0",
92
92
  "jest": "^29.7.0",
93
93
  "jest-environment-jsdom": "^29.7.0",
94
94
  "typescript": "^5.6.3"
@@ -1,9 +1,9 @@
1
1
  import {
2
- AddressApi,
3
2
  AddressCity,
4
3
  AddressDistrict,
5
4
  AddressRegionDb,
6
- AddressState
5
+ AddressState,
6
+ IApiPayload
7
7
  } from "@etsoo/appscript";
8
8
  import { FormLabel, Grid2, GridSize } from "@mui/material";
9
9
  import React from "react";
@@ -11,6 +11,7 @@ import { globalApp } from "./app/ReactApp";
11
11
  import { ComboBox } from "./ComboBox";
12
12
  import { Tiplist } from "./Tiplist";
13
13
  import { ResponsiveStyleValue } from "./ResponsiveStyleValue";
14
+ import { RegionsRQ } from "./RegionsRQ";
14
15
 
15
16
  /**
16
17
  * Address field
@@ -43,7 +44,33 @@ export type AddressSelectorProps = {
43
44
  /**
44
45
  * Address API
45
46
  */
46
- api: AddressApi;
47
+ api: {
48
+ regions(
49
+ rq: RegionsRQ,
50
+ payload?: IApiPayload<AddressRegionDb[]>
51
+ ): Promise<AddressRegionDb[] | undefined>;
52
+
53
+ states(
54
+ regionId: string,
55
+ favoredIds?: string[],
56
+ payload?: IApiPayload<AddressState[]>,
57
+ culture?: string
58
+ ): Promise<AddressState[] | undefined>;
59
+
60
+ cities(
61
+ stateId: string,
62
+ favoredIds?: number[],
63
+ payload?: IApiPayload<AddressCity[]>,
64
+ culture?: string
65
+ ): Promise<AddressCity[] | undefined>;
66
+
67
+ districts(
68
+ cityId: number,
69
+ favoredIds?: number[],
70
+ payload?: IApiPayload<AddressDistrict[]>,
71
+ culture?: string
72
+ ): Promise<AddressDistrict[] | undefined>;
73
+ };
47
74
 
48
75
  /**
49
76
  * Break points
@@ -305,7 +332,7 @@ export function AddressSelector(props: AddressSelectorProps) {
305
332
  fullWidth
306
333
  idValue={regionState}
307
334
  loadData={(keyword, id, items) =>
308
- api.getRegions({
335
+ api.regions({
309
336
  keyword,
310
337
  id,
311
338
  items,
@@ -1,10 +1,10 @@
1
- import { AuditLineDto } from "@etsoo/appscript";
2
1
  import { Utils } from "@etsoo/shared";
3
2
  import { Button, Divider, Theme, Typography, useTheme } from "@mui/material";
4
3
  import React, { CSSProperties } from "react";
5
4
  import { globalApp } from "./app/ReactApp";
6
5
  import { ListMoreDisplay, ListMoreDisplayProps } from "./ListMoreDisplay";
7
6
  import { ShowDataComparison } from "./ShowDataComparison";
7
+ import { AuditLineDto } from "@etsoo/appscript";
8
8
 
9
9
  /**
10
10
  * Audit display props
@@ -1,7 +1,7 @@
1
- import { IconButton, IconButtonProps, useTheme } from '@mui/material';
2
- import ArrowBackIcon from '@mui/icons-material/ArrowBack';
3
- import React from 'react';
4
- import { useNavigate } from 'react-router-dom';
1
+ import { IconButton, IconButtonProps, useTheme } from "@mui/material";
2
+ import ArrowBackIcon from "@mui/icons-material/ArrowBack";
3
+ import React from "react";
4
+ import { useNavigate } from "react-router-dom";
5
5
 
6
6
  /**
7
7
  * BackButton props
@@ -14,42 +14,42 @@ export interface BackButtonProps extends IconButtonProps {}
14
14
  * @returns Component
15
15
  */
16
16
  export function BackButton(props: BackButtonProps) {
17
- // Destruct
18
- const { color = 'primary', size = 'small', onClick, ...rest } = props;
17
+ // Destruct
18
+ const { color = "primary", size = "small", onClick, ...rest } = props;
19
19
 
20
- // Theme
21
- const theme = useTheme();
20
+ // Theme
21
+ const theme = useTheme();
22
+
23
+ // Navigate
24
+ const navigate = useNavigate();
25
+
26
+ // Color
27
+ const pColor =
28
+ color != "inherit" && color != "default" && color in theme.palette
29
+ ? theme.palette[color]
30
+ : theme.palette.primary;
31
+
32
+ // Click handler
33
+ const onClickLocal = async (event: React.MouseEvent<HTMLButtonElement>) => {
34
+ if (onClick) onClick(event);
22
35
 
23
36
  // Navigate
24
- const navigate = useNavigate();
25
-
26
- // Color
27
- const pColor =
28
- color != 'inherit' && color != 'default' && color in theme.palette
29
- ? theme.palette[color]
30
- : theme.palette.primary;
31
-
32
- // Click handler
33
- const onClickLocal = async (event: React.MouseEvent<HTMLButtonElement>) => {
34
- if (onClick) onClick(event);
35
-
36
- // Navigate
37
- navigate(-1);
38
- };
39
-
40
- return (
41
- <IconButton
42
- aria-label="Back"
43
- color={color}
44
- size={size}
45
- onClick={onClickLocal}
46
- sx={{
47
- backgroundColor: pColor.contrastText,
48
- border: `1px solid ${pColor.light}`
49
- }}
50
- {...rest}
51
- >
52
- <ArrowBackIcon />
53
- </IconButton>
54
- );
37
+ navigate(-1);
38
+ };
39
+
40
+ return (
41
+ <IconButton
42
+ aria-label="Back"
43
+ color={color}
44
+ size={size}
45
+ onClick={onClickLocal}
46
+ sx={{
47
+ backgroundColor: pColor.contrastText,
48
+ border: `1px solid ${pColor.light}`
49
+ }}
50
+ {...rest}
51
+ >
52
+ <ArrowBackIcon />
53
+ </IconButton>
54
+ );
55
55
  }
@@ -1,32 +1,33 @@
1
- import { AddressRegionDb, RegionsRQ } from '@etsoo/appscript';
2
- import { DataTypes } from '@etsoo/shared';
3
- import React from 'react';
4
- import { Tiplist, TiplistProps } from './Tiplist';
1
+ import { AddressRegionDb } from "@etsoo/appscript";
2
+ import { DataTypes } from "@etsoo/shared";
3
+ import React from "react";
4
+ import { Tiplist, TiplistProps } from "./Tiplist";
5
+ import { RegionsRQ } from "./RegionsRQ";
5
6
 
6
7
  /**
7
8
  * Country list props
8
9
  */
9
10
  export type CountryListProps = Omit<
10
- DataTypes.Optional<TiplistProps<AddressRegionDb, 'id'>, 'name'>,
11
- 'loadData'
11
+ DataTypes.Optional<TiplistProps<AddressRegionDb, "id">, "name">,
12
+ "loadData"
12
13
  > & {
13
- /**
14
- * Load data
15
- * @param rq Request data
16
- * @returns Result
17
- */
18
- loadData: (rq: RegionsRQ) => Promise<AddressRegionDb[] | undefined>;
14
+ /**
15
+ * Load data
16
+ * @param rq Request data
17
+ * @returns Result
18
+ */
19
+ loadData: (rq: RegionsRQ) => Promise<AddressRegionDb[] | undefined>;
19
20
 
20
- /**
21
- * Load favored country ids
22
- * @returns Result
23
- */
24
- loadFavoredIds?: () => Promise<string[]>;
21
+ /**
22
+ * Load favored country ids
23
+ * @returns Result
24
+ */
25
+ loadFavoredIds?: () => Promise<string[]>;
25
26
 
26
- /**
27
- * Max items to display
28
- */
29
- items?: number;
27
+ /**
28
+ * Max items to display
29
+ */
30
+ items?: number;
30
31
  };
31
32
 
32
33
  /**
@@ -35,34 +36,34 @@ export type CountryListProps = Omit<
35
36
  * @returns Component
36
37
  */
37
38
  export function CountryList(props: CountryListProps) {
38
- // Destruct
39
- const {
40
- items = 16,
41
- loadData,
42
- loadFavoredIds,
43
- name = 'countryId',
44
- ...rest
45
- } = props;
39
+ // Destruct
40
+ const {
41
+ items = 16,
42
+ loadData,
43
+ loadFavoredIds,
44
+ name = "countryId",
45
+ ...rest
46
+ } = props;
46
47
 
47
- // Ref
48
- const favoredIds = React.useRef<string[]>([]);
48
+ // Ref
49
+ const favoredIds = React.useRef<string[]>([]);
49
50
 
50
- // Ready
51
- React.useEffect(() => {
52
- if (loadFavoredIds && favoredIds.current.length === 0)
53
- loadFavoredIds().then((ids) => {
54
- favoredIds.current = ids;
55
- });
56
- }, [loadFavoredIds]);
51
+ // Ready
52
+ React.useEffect(() => {
53
+ if (loadFavoredIds && favoredIds.current.length === 0)
54
+ loadFavoredIds().then((ids) => {
55
+ favoredIds.current = ids;
56
+ });
57
+ }, [loadFavoredIds]);
57
58
 
58
- // Layout
59
- return (
60
- <Tiplist<AddressRegionDb, 'id'>
61
- name={name}
62
- loadData={(keyword, id) =>
63
- loadData({ id, keyword, favoredIds: favoredIds.current, items })
64
- }
65
- {...rest}
66
- />
67
- );
59
+ // Layout
60
+ return (
61
+ <Tiplist<AddressRegionDb, "id">
62
+ name={name}
63
+ loadData={(keyword, id) =>
64
+ loadData({ id, keyword, favoredIds: favoredIds.current, items })
65
+ }
66
+ {...rest}
67
+ />
68
+ );
68
69
  }
@@ -1,32 +1,32 @@
1
- import { FabPropsColorOverrides, PropTypes } from '@mui/material';
2
- import { OverridableStringUnion } from '@mui/types';
1
+ import { FabPropsColorOverrides, PropTypes } from "@mui/material";
2
+ import { OverridableStringUnion } from "@mui/types";
3
3
 
4
4
  /**
5
5
  * Custom fab size
6
6
  */
7
- export type CustomFabSize = 'small' | 'medium' | 'large';
7
+ export type CustomFabSize = "small" | "medium" | "large";
8
8
 
9
9
  /**
10
10
  * Custom fab props
11
11
  */
12
12
  export interface CustomFabProps {
13
- /**
14
- * Color
15
- */
16
- color?: OverridableStringUnion<PropTypes.Color, FabPropsColorOverrides>;
13
+ /**
14
+ * Color
15
+ */
16
+ color?: OverridableStringUnion<PropTypes.Color, FabPropsColorOverrides>;
17
17
 
18
- /**
19
- * Fab size
20
- */
21
- size?: CustomFabSize;
18
+ /**
19
+ * Fab size
20
+ */
21
+ size?: CustomFabSize;
22
22
 
23
- /**
24
- * Scroll target
25
- */
26
- target?: any;
23
+ /**
24
+ * Scroll target
25
+ */
26
+ target?: any;
27
27
 
28
- /**
29
- * Fab title
30
- */
31
- title?: string;
28
+ /**
29
+ * Fab title
30
+ */
31
+ title?: string;
32
32
  }
@@ -258,7 +258,7 @@ export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
258
258
  states
259
259
  });
260
260
  } else if (sortable && field != null) {
261
- const active = orderBy === field;
261
+ const active = orderBy != null && orderBy[field] != null;
262
262
 
263
263
  sortLabel = (
264
264
  <TableSortLabel
@@ -438,7 +438,7 @@ export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
438
438
 
439
439
  // New sort
440
440
  const handleSort = (field: string, asc?: boolean) => {
441
- reset({ queryPaging: { orderBy: field, orderByAsc: asc } });
441
+ reset({ queryPaging: { orderBy: { [field]: asc ?? true } } });
442
442
  };
443
443
 
444
444
  // Reset
@@ -626,10 +626,6 @@ export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
626
626
 
627
627
  // Table
628
628
  const table = React.useMemo(() => {
629
- const defaultOrderByAsc = defaultOrderBy
630
- ? columns.find((column) => column.field === defaultOrderBy)?.sortAsc
631
- : undefined;
632
-
633
629
  return (
634
630
  <ScrollerGrid<T>
635
631
  className={Utils.mergeClasses(
@@ -641,7 +637,6 @@ export function DataGridEx<T extends object>(props: DataGridExProps<T>) {
641
637
  columnCount={columns.length}
642
638
  columnWidth={columnWidth}
643
639
  defaultOrderBy={defaultOrderBy}
644
- defaultOrderByAsc={defaultOrderByAsc}
645
640
  height={
646
641
  height -
647
642
  headerHeight -