@etsoo/materialui 1.3.17 → 1.3.19

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.
@@ -9,6 +9,8 @@ export type CultureDataTableProps = Omit<DataTableProps, "columns"> & {
9
9
  cultureLabel?: string;
10
10
  editable?: boolean;
11
11
  titleLabel?: string;
12
+ hasDescription?: boolean;
13
+ descriptionLabel?: string;
12
14
  };
13
15
  /**
14
16
  * Culture DataTable
@@ -8,7 +8,7 @@ import { globalApp } from "./app/ReactApp";
8
8
  */
9
9
  export function CultureDataTable(props) {
10
10
  // Destruct
11
- const { cultures, cultureLabel = globalApp === null || globalApp === void 0 ? void 0 : globalApp.get("culture"), editable = true, titleLabel, ...rest } = props;
11
+ const { cultures, cultureLabel = globalApp === null || globalApp === void 0 ? void 0 : globalApp.get("culture"), editable = true, titleLabel, hasDescription = false, descriptionLabel = globalApp === null || globalApp === void 0 ? void 0 : globalApp.get("description"), ...rest } = props;
12
12
  const getCultureLabel = React.useCallback((value) => { var _a, _b; return (_b = (_a = cultures.find((c) => c.id == value.id)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : `${value.value}`; }, [cultures]);
13
13
  return (React.createElement(DataTable, { columns: [
14
14
  {
@@ -25,6 +25,17 @@ export function CultureDataTable(props) {
25
25
  flex: 1,
26
26
  editable,
27
27
  sortable: false
28
- }
28
+ },
29
+ ...(hasDescription
30
+ ? [
31
+ {
32
+ field: "description",
33
+ headerName: descriptionLabel,
34
+ flex: 1,
35
+ editable,
36
+ sortable: false
37
+ }
38
+ ]
39
+ : [])
29
40
  ], ...rest }));
30
41
  }
@@ -112,5 +112,5 @@ export function OptionGroup(props) {
112
112
  }
113
113
  } })),
114
114
  React.createElement(Box, { paddingLeft: 2, paddingY: "7px", position: outlined ? "absolute" : undefined }, group)),
115
- helperText && React.createElement(FormHelperText, null, helperText)));
115
+ helperText && (React.createElement(FormHelperText, { sx: { marginLeft: 2, marginRight: 2 } }, helperText))));
116
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.3.17",
3
+ "version": "1.3.19",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -76,15 +76,15 @@
76
76
  },
77
77
  "devDependencies": {
78
78
  "@babel/cli": "^7.22.15",
79
- "@babel/core": "^7.22.19",
79
+ "@babel/core": "^7.22.20",
80
80
  "@babel/plugin-transform-runtime": "^7.22.15",
81
- "@babel/preset-env": "^7.22.15",
81
+ "@babel/preset-env": "^7.22.20",
82
82
  "@babel/preset-react": "^7.22.15",
83
83
  "@babel/preset-typescript": "^7.22.15",
84
84
  "@babel/runtime-corejs3": "^7.22.15",
85
85
  "@testing-library/jest-dom": "^6.1.3",
86
86
  "@testing-library/react": "^14.0.0",
87
- "@types/jest": "^29.5.4",
87
+ "@types/jest": "^29.5.5",
88
88
  "@typescript-eslint/eslint-plugin": "^6.7.0",
89
89
  "@typescript-eslint/parser": "^6.7.0",
90
90
  "jest": "^29.7.0",
@@ -12,6 +12,8 @@ export type CultureDataTableProps = Omit<DataTableProps, "columns"> & {
12
12
  cultureLabel?: string;
13
13
  editable?: boolean;
14
14
  titleLabel?: string;
15
+ hasDescription?: boolean;
16
+ descriptionLabel?: string;
15
17
  };
16
18
 
17
19
  /**
@@ -26,6 +28,8 @@ export function CultureDataTable(props: CultureDataTableProps) {
26
28
  cultureLabel = globalApp?.get("culture"),
27
29
  editable = true,
28
30
  titleLabel,
31
+ hasDescription = false,
32
+ descriptionLabel = globalApp?.get("description"),
29
33
  ...rest
30
34
  } = props;
31
35
 
@@ -52,7 +56,18 @@ export function CultureDataTable(props: CultureDataTableProps) {
52
56
  flex: 1,
53
57
  editable,
54
58
  sortable: false
55
- }
59
+ },
60
+ ...(hasDescription
61
+ ? [
62
+ {
63
+ field: "description",
64
+ headerName: descriptionLabel,
65
+ flex: 1,
66
+ editable,
67
+ sortable: false
68
+ }
69
+ ]
70
+ : [])
56
71
  ]}
57
72
  {...rest}
58
73
  />
@@ -320,7 +320,11 @@ export function OptionGroup<
320
320
  {group}
321
321
  </Box>
322
322
  </FormControl>
323
- {helperText && <FormHelperText>{helperText}</FormHelperText>}
323
+ {helperText && (
324
+ <FormHelperText sx={{ marginLeft: 2, marginRight: 2 }}>
325
+ {helperText}
326
+ </FormHelperText>
327
+ )}
324
328
  </React.Fragment>
325
329
  );
326
330
  }