@etsoo/materialui 1.3.34 → 1.3.35

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/DataGridEx.js CHANGED
@@ -84,7 +84,7 @@ export function DataGridEx(props) {
84
84
  sortLabel = headerCellRenderer({
85
85
  cellProps,
86
86
  column,
87
- columnIndex: checkable ? index - 1 : index,
87
+ columnIndex: checkable ? index - 1 : index, // Ignore the checkbox case,
88
88
  states
89
89
  });
90
90
  }
@@ -113,7 +113,7 @@ export function DataGridEx(props) {
113
113
  const cell = footerItemRenderer
114
114
  ? footerItemRenderer(rows, {
115
115
  column,
116
- index: checkable ? index - 1 : index,
116
+ index: checkable ? index - 1 : index, // Ignore the checkbox case
117
117
  states,
118
118
  cellProps,
119
119
  checkable
@@ -127,7 +127,7 @@ export function DataGridEx(props) {
127
127
  const { alternatingColors = [theme.palette.grey[100], undefined], borderRowsCount, bottomHeight = 53, checkable = false, className, columns, defaultOrderBy, height, headerHeight = 56, headerRenderer = defaultHeaderRenderer, footerRenderer = defaultFooterRenderer, footerItemRenderer = DataGridRenderers.defaultFooterItemRenderer, hideFooter = false, hoverColor = "#f6f9fb", idField = "id", mRef = React.createRef(), onClick, onDoubleClick, selectable = true, selectedColor = "#edf4fb", width, ...rest } = props;
128
128
  if (checkable) {
129
129
  const cbColumn = {
130
- field: "selected",
130
+ field: "selected", // Avoid validation from data model
131
131
  header: "",
132
132
  sortable: false,
133
133
  width: 50,
@@ -37,7 +37,7 @@ export interface ViewPageField<T extends object> extends GridProps {
37
37
  /**
38
38
  * Label field
39
39
  */
40
- label?: string | (() => React.ReactNode);
40
+ label?: string | ((item: T) => React.ReactNode);
41
41
  /**
42
42
  * Display as single row
43
43
  */
@@ -86,7 +86,7 @@ function getItemField(field, data) {
86
86
  // Field label
87
87
  itemLabel =
88
88
  typeof fieldLabel === "function"
89
- ? fieldLabel()
89
+ ? fieldLabel(data)
90
90
  : fieldLabel != null
91
91
  ? (_b = globalApp === null || globalApp === void 0 ? void 0 : globalApp.get(fieldLabel)) !== null && _b !== void 0 ? _b : fieldLabel
92
92
  : fieldLabel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.3.34",
3
+ "version": "1.3.35",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -54,14 +54,14 @@
54
54
  "@etsoo/notificationbase": "^1.1.32",
55
55
  "@etsoo/react": "^1.7.24",
56
56
  "@etsoo/shared": "^1.2.22",
57
- "@mui/icons-material": "^5.14.18",
58
- "@mui/material": "^5.14.18",
59
- "@mui/x-data-grid": "^6.18.1",
57
+ "@mui/icons-material": "^5.14.19",
58
+ "@mui/material": "^5.14.19",
59
+ "@mui/x-data-grid": "^6.18.2",
60
60
  "@types/pica": "^9.0.4",
61
61
  "@types/pulltorefreshjs": "^0.1.7",
62
- "@types/react": "^18.2.37",
62
+ "@types/react": "^18.2.40",
63
63
  "@types/react-avatar-editor": "^13.0.2",
64
- "@types/react-dom": "^18.2.15",
64
+ "@types/react-dom": "^18.2.17",
65
65
  "@types/react-input-mask": "^3.0.5",
66
66
  "chart.js": "^4.4.0",
67
67
  "chartjs-plugin-datalabels": "^2.2.0",
@@ -75,20 +75,20 @@
75
75
  "react-imask": "6.6.3"
76
76
  },
77
77
  "devDependencies": {
78
- "@babel/cli": "^7.23.0",
79
- "@babel/core": "^7.23.3",
80
- "@babel/plugin-transform-runtime": "^7.23.3",
81
- "@babel/preset-env": "^7.23.3",
78
+ "@babel/cli": "^7.23.4",
79
+ "@babel/core": "^7.23.5",
80
+ "@babel/plugin-transform-runtime": "^7.23.4",
81
+ "@babel/preset-env": "^7.23.5",
82
82
  "@babel/preset-react": "^7.23.3",
83
83
  "@babel/preset-typescript": "^7.23.3",
84
- "@babel/runtime-corejs3": "^7.23.2",
85
- "@testing-library/jest-dom": "^6.1.4",
86
- "@testing-library/react": "^14.1.0",
87
- "@types/jest": "^29.5.8",
88
- "@typescript-eslint/eslint-plugin": "^6.11.0",
89
- "@typescript-eslint/parser": "^6.11.0",
84
+ "@babel/runtime-corejs3": "^7.23.5",
85
+ "@testing-library/jest-dom": "^6.1.5",
86
+ "@testing-library/react": "^14.1.2",
87
+ "@types/jest": "^29.5.10",
88
+ "@typescript-eslint/eslint-plugin": "^6.13.1",
89
+ "@typescript-eslint/parser": "^6.13.1",
90
90
  "jest": "^29.7.0",
91
91
  "jest-environment-jsdom": "^29.7.0",
92
- "typescript": "^5.2.2"
92
+ "typescript": "^5.3.2"
93
93
  }
94
94
  }
@@ -89,7 +89,7 @@ export interface ViewPageField<T extends object> extends GridProps {
89
89
  /**
90
90
  * Label field
91
91
  */
92
- label?: string | (() => React.ReactNode);
92
+ label?: string | ((item: T) => React.ReactNode);
93
93
 
94
94
  /**
95
95
  * Display as single row
@@ -235,7 +235,7 @@ function getItemField<T extends object>(
235
235
  // Field label
236
236
  itemLabel =
237
237
  typeof fieldLabel === "function"
238
- ? fieldLabel()
238
+ ? fieldLabel(data)
239
239
  : fieldLabel != null
240
240
  ? globalApp?.get<string>(fieldLabel) ?? fieldLabel
241
241
  : fieldLabel;