@etsoo/materialui 1.3.18 → 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.
- package/lib/CultureDataTable.d.ts +2 -0
- package/lib/CultureDataTable.js +13 -2
- package/package.json +3 -3
- package/src/CultureDataTable.tsx +16 -1
package/lib/CultureDataTable.js
CHANGED
|
@@ -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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.3.
|
|
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,9 +76,9 @@
|
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@babel/cli": "^7.22.15",
|
|
79
|
-
"@babel/core": "^7.22.
|
|
79
|
+
"@babel/core": "^7.22.20",
|
|
80
80
|
"@babel/plugin-transform-runtime": "^7.22.15",
|
|
81
|
-
"@babel/preset-env": "^7.22.
|
|
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",
|
package/src/CultureDataTable.tsx
CHANGED
|
@@ -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
|
/>
|