@iobroker/json-config 8.1.7 → 8.1.9
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/README.md
CHANGED
|
@@ -1677,7 +1677,7 @@ The schema is used here: https://github.com/SchemaStore/schemastore/blob/6da29cd
|
|
|
1677
1677
|
### **WORK IN PROGRESS**
|
|
1678
1678
|
-->
|
|
1679
1679
|
## Changelog
|
|
1680
|
-
### 8.1.
|
|
1680
|
+
### 8.1.9 (2026-02-10)
|
|
1681
1681
|
- (@GermanBluefox) Hiding the whole line in the table if shown as card and the line is empty
|
|
1682
1682
|
- (@GermanBluefox) Added the header to table in the card mode
|
|
1683
1683
|
|
|
@@ -20,8 +20,9 @@ interface ConfigTableState extends ConfigGenericState {
|
|
|
20
20
|
icon: boolean;
|
|
21
21
|
width: number;
|
|
22
22
|
tableErrors: Record<number, Record<string, string>>;
|
|
23
|
+
collapsed: number[];
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
export default class ConfigTable extends ConfigGeneric<ConfigTableProps, ConfigTableState> {
|
|
25
26
|
private readonly filterRefs;
|
|
26
27
|
private typingTimer;
|
|
27
28
|
private resizeTimeout;
|
|
@@ -85,4 +86,4 @@ declare class ConfigTable extends ConfigGeneric<ConfigTableProps, ConfigTableSta
|
|
|
85
86
|
getCurrentBreakpoint(): 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
86
87
|
renderItem(): JSX.Element | null;
|
|
87
88
|
}
|
|
88
|
-
export
|
|
89
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { createRef } from 'react';
|
|
2
2
|
import Dropzone from 'react-dropzone';
|
|
3
|
-
import { Accordion, AccordionDetails, AccordionSummary, Button, Card, Dialog, DialogActions, DialogContent, DialogTitle, Grid2, IconButton, InputAdornment, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TableSortLabel, TextField, Toolbar, Tooltip, Typography, FormHelperText, Box, } from '@mui/material';
|
|
3
|
+
import { Accordion, AccordionDetails, AccordionSummary, Button, Card, Collapse, Dialog, DialogActions, DialogContent, DialogTitle, Grid2, IconButton, InputAdornment, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TableSortLabel, TextField, Toolbar, Tooltip, Typography, FormHelperText, Box, } from '@mui/material';
|
|
4
4
|
import { Add as AddIcon, Delete as DeleteIcon, Close as CloseIcon, ArrowUpward as UpIcon, ArrowDownward as DownIcon, FilterAlt as IconFilterOn, FilterAltOff as IconFilterOff, ContentCopy as CopyContentIcon, Download as ExportIcon, Warning as ErrorIcon, UploadFile as ImportIcon, Close as IconClose, ExpandMore as ExpandMoreIcon, } from '@mui/icons-material';
|
|
5
5
|
import { I18n } from '@iobroker/adapter-react-v5';
|
|
6
6
|
import ConfigGeneric from './ConfigGeneric';
|
|
@@ -146,9 +146,12 @@ const styles = {
|
|
|
146
146
|
color: theme.palette.mode === 'light' ? theme.palette.secondary.main : theme.palette.text.primary,
|
|
147
147
|
height: '100%',
|
|
148
148
|
fontWeight: 'bold',
|
|
149
|
-
fontSize:
|
|
149
|
+
fontSize: 20,
|
|
150
150
|
fontStyle: 'italic',
|
|
151
|
+
padding: '4px 16px',
|
|
151
152
|
backgroundColor: theme.palette.primary.main,
|
|
153
|
+
display: 'flex',
|
|
154
|
+
justifyContent: 'space-between',
|
|
152
155
|
}),
|
|
153
156
|
};
|
|
154
157
|
function objectToArray(object, nameOfFirstAttr, nameOfSecondAttr) {
|
|
@@ -199,7 +202,7 @@ function decrypt(secret, value) {
|
|
|
199
202
|
}
|
|
200
203
|
return result;
|
|
201
204
|
}
|
|
202
|
-
class ConfigTable extends ConfigGeneric {
|
|
205
|
+
export default class ConfigTable extends ConfigGeneric {
|
|
203
206
|
filterRefs;
|
|
204
207
|
typingTimer = null;
|
|
205
208
|
resizeTimeout = null;
|
|
@@ -210,7 +213,7 @@ class ConfigTable extends ConfigGeneric {
|
|
|
210
213
|
constructor(props) {
|
|
211
214
|
super(props);
|
|
212
215
|
this.filterRefs = {};
|
|
213
|
-
this.props.schema.items
|
|
216
|
+
this.props.schema.items ||= [];
|
|
214
217
|
this.props.schema.items.forEach((el) => {
|
|
215
218
|
if (el.filter) {
|
|
216
219
|
this.filterRefs[el.attr] = createRef();
|
|
@@ -246,6 +249,16 @@ class ConfigTable extends ConfigGeneric {
|
|
|
246
249
|
});
|
|
247
250
|
});
|
|
248
251
|
}
|
|
252
|
+
const collapsedStr = window.localStorage.getItem(`table.collapsed.${this.props.oContext.instance}.${this.props.attr}`);
|
|
253
|
+
let collapsed = [];
|
|
254
|
+
if (collapsedStr) {
|
|
255
|
+
try {
|
|
256
|
+
collapsed = JSON.parse(collapsedStr);
|
|
257
|
+
}
|
|
258
|
+
catch {
|
|
259
|
+
// ignore
|
|
260
|
+
}
|
|
261
|
+
}
|
|
249
262
|
this.setState({
|
|
250
263
|
value,
|
|
251
264
|
visibleValue: null,
|
|
@@ -255,6 +268,7 @@ class ConfigTable extends ConfigGeneric {
|
|
|
255
268
|
filterOn: [],
|
|
256
269
|
width: 0,
|
|
257
270
|
tableErrors: {},
|
|
271
|
+
collapsed,
|
|
258
272
|
}, () => this.validateUniqueProps());
|
|
259
273
|
}
|
|
260
274
|
componentWillUnmount() {
|
|
@@ -924,33 +938,70 @@ class ConfigTable extends ConfigGeneric {
|
|
|
924
938
|
} },
|
|
925
939
|
React.createElement(Card, null,
|
|
926
940
|
React.createElement(Paper, { style: styles.paper },
|
|
927
|
-
this.props.schema.titleAttribute ? (React.createElement(Box, { sx: styles.cardHeader },
|
|
928
|
-
|
|
929
|
-
React.createElement(
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
React.createElement(
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
941
|
+
this.props.schema.titleAttribute ? (React.createElement(Box, { sx: styles.cardHeader },
|
|
942
|
+
React.createElement("div", null, this.state.value[idx][this.props.schema.titleAttribute]),
|
|
943
|
+
React.createElement("div", null,
|
|
944
|
+
!doAnyFilterSet && !this.state.orderBy ? (React.createElement(Tooltip, { title: I18n.t('ra_Move up'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
945
|
+
React.createElement("span", null,
|
|
946
|
+
React.createElement(IconButton, { size: "small", onClick: () => this.onMoveUp(idx), disabled: i === 0 },
|
|
947
|
+
React.createElement(UpIcon, null))))) : null,
|
|
948
|
+
!doAnyFilterSet && !this.state.orderBy ? (React.createElement(Tooltip, { title: I18n.t('ra_Move down'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
949
|
+
React.createElement("span", null,
|
|
950
|
+
React.createElement(IconButton, { size: "small", onClick: () => this.onMoveDown(idx), disabled: i === visibleValue.length - 1 },
|
|
951
|
+
React.createElement(DownIcon, null))))) : null,
|
|
952
|
+
React.createElement(Tooltip, { title: I18n.t('ra_Delete current row'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
953
|
+
React.createElement(IconButton, { size: "small", onClick: this.onDelete(idx) },
|
|
954
|
+
React.createElement(DeleteIcon, null))),
|
|
955
|
+
this.props.schema.clone ? (React.createElement(Tooltip, { title: I18n.t('ra_Clone current row'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
956
|
+
React.createElement(IconButton, { size: "small", onClick: this.onClone(idx) },
|
|
957
|
+
React.createElement(CopyContentIcon, null)))) : null,
|
|
958
|
+
React.createElement(Tooltip, { title: I18n.t('ra_Expand/Collapse card'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
959
|
+
React.createElement(IconButton, { size: "small", onClick: () => {
|
|
960
|
+
const collapsed = [...this.state.collapsed];
|
|
961
|
+
const pos = collapsed.indexOf(idx);
|
|
962
|
+
if (pos === -1) {
|
|
963
|
+
collapsed.push(idx);
|
|
964
|
+
}
|
|
965
|
+
else {
|
|
966
|
+
collapsed.splice(pos, 1);
|
|
967
|
+
}
|
|
968
|
+
window.localStorage.setItem(`table.collapsed.${this.props.oContext.instance}.${this.props.attr}`, JSON.stringify(collapsed));
|
|
969
|
+
this.setState({ collapsed });
|
|
970
|
+
} },
|
|
971
|
+
React.createElement(ExpandMoreIcon, { style: {
|
|
972
|
+
rotate: this.state.collapsed?.includes(idx)
|
|
973
|
+
? '0deg'
|
|
974
|
+
: '180deg',
|
|
975
|
+
transition: '0.3s',
|
|
976
|
+
transitionProperty: 'rotate',
|
|
977
|
+
} })))))) : null,
|
|
978
|
+
React.createElement(Collapse, { in: !this.state.collapsed?.includes(idx), timeout: "auto", unmountOnExit: true },
|
|
979
|
+
React.createElement(Table, null,
|
|
980
|
+
React.createElement(TableBody, null,
|
|
981
|
+
schema.items?.map((headCell) => {
|
|
982
|
+
const hidden = this.listOfHiddenElements?.[idx]?.includes(headCell.attr);
|
|
983
|
+
return (React.createElement(TableRow, { key: `${headCell.attr}_${idx}` },
|
|
984
|
+
React.createElement(TableCell, { align: "left", style: hidden ? tdStyleHidden : tdStyle }, hidden ? null : (React.createElement("span", { style: styles.headerText }, this.getText(headCell.title)))),
|
|
985
|
+
React.createElement(TableCell, { align: "left", style: hidden ? tdStyleHidden : tdStyle }, this.itemTable(headCell.attr, this.state.value[idx], idx, true))));
|
|
986
|
+
}),
|
|
987
|
+
!this.props.schema.titleAttribute && !schema.noDelete && (React.createElement(TableRow, null,
|
|
988
|
+
React.createElement(TableCell, { align: "left", style: tdStyle },
|
|
989
|
+
React.createElement("span", { style: styles.headerText }, this.getText('Actions'))),
|
|
990
|
+
React.createElement(TableCell, { align: "left", style: tdStyle },
|
|
991
|
+
!doAnyFilterSet && !this.state.orderBy ? (React.createElement(Tooltip, { title: I18n.t('ra_Move up'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
992
|
+
React.createElement("span", null,
|
|
993
|
+
React.createElement(IconButton, { size: "small", onClick: () => this.onMoveUp(idx), disabled: i === 0 },
|
|
994
|
+
React.createElement(UpIcon, null))))) : null,
|
|
995
|
+
!doAnyFilterSet && !this.state.orderBy ? (React.createElement(Tooltip, { title: I18n.t('ra_Move down'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
996
|
+
React.createElement("span", null,
|
|
997
|
+
React.createElement(IconButton, { size: "small", onClick: () => this.onMoveDown(idx), disabled: i === visibleValue.length - 1 },
|
|
998
|
+
React.createElement(DownIcon, null))))) : null,
|
|
999
|
+
React.createElement(Tooltip, { title: I18n.t('ra_Delete current row'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
1000
|
+
React.createElement(IconButton, { size: "small", onClick: this.onDelete(idx) },
|
|
1001
|
+
React.createElement(DeleteIcon, null))),
|
|
1002
|
+
this.props.schema.clone ? (React.createElement(Tooltip, { title: I18n.t('ra_Clone current row'), slotProps: { popper: { sx: styles.tooltip } } },
|
|
1003
|
+
React.createElement(IconButton, { size: "small", onClick: this.onClone(idx) },
|
|
1004
|
+
React.createElement(CopyContentIcon, null)))) : null))))))))))),
|
|
954
1005
|
this.enhancedBottomCard()));
|
|
955
1006
|
}
|
|
956
1007
|
renderTable() {
|
|
@@ -1044,5 +1095,4 @@ class ConfigTable extends ConfigGeneric {
|
|
|
1044
1095
|
return (React.createElement("div", { ref: this.refDiv, style: { width: '100%' } }, content));
|
|
1045
1096
|
}
|
|
1046
1097
|
}
|
|
1047
|
-
export default ConfigTable;
|
|
1048
1098
|
//# sourceMappingURL=ConfigTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigTable.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAA4B,MAAM,OAAO,CAAC;AACnE,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EACH,SAAS,EACT,gBAAgB,EAChB,g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AK,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACxD,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;QACtD,IAAI,OAA0B,CAAC;QAE/B,IAAI,iBAAiB,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACjF,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,CAAC;aAAM,CAAC;YACJ,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,CAAC;QAED,OAAO,CACH,6BACI,GAAG,EAAE,IAAI,CAAC,MAAM,EAChB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAEvB,OAAO,CACN,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,WAAW,CAAC","sourcesContent":["import React, { createRef, type JSX, type RefObject } from 'react';\nimport Dropzone from 'react-dropzone';\n\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Button,\n Card,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Grid2,\n IconButton,\n InputAdornment,\n Paper,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n TableSortLabel,\n TextField,\n Toolbar,\n Tooltip,\n Typography,\n FormHelperText,\n Box,\n} from '@mui/material';\n\nimport {\n Add as AddIcon,\n Delete as DeleteIcon,\n Close as CloseIcon,\n ArrowUpward as UpIcon,\n ArrowDownward as DownIcon,\n FilterAlt as IconFilterOn,\n FilterAltOff as IconFilterOff,\n ContentCopy as CopyContentIcon,\n Download as ExportIcon,\n Warning as ErrorIcon,\n UploadFile as ImportIcon,\n Close as IconClose,\n ExpandMore as ExpandMoreIcon,\n} from '@mui/icons-material';\n\nimport { I18n, type IobTheme } from '@iobroker/adapter-react-v5';\n\nimport type { ConfigItemTableIndexed, ConfigItemPanel, ConfigItemTable } from '../types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\nimport ConfigPanel from './ConfigPanel';\n\nconst MAX_SIZE = 1024 * 1024; // 1MB\n\nconst styles: Record<string, any> = {\n fullWidth: {\n width: '100%',\n },\n root: {\n width: '100%',\n },\n paper: {\n width: '100%',\n marginBottom: 16,\n backgroundColor: 'rgba(255, 255, 255, 0.1)',\n },\n headerText: {\n width: '100%',\n },\n table: {\n minWidth: 750,\n },\n visuallyHidden: {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: 1,\n margin: -1,\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n top: 20,\n width: 1,\n },\n label: {\n display: 'flex',\n justifyContent: 'space-between',\n },\n // highlight: (theme: IobTheme): React.CSSProperties => (theme.palette.mode === 'light'\n // ? {\n // color: theme.palette.secondary.main,\n // // backgroundColor: lighten(theme.palette.secondary.light, 0.85),\n // }\n // : {\n // color: theme.palette.text.primary,\n // backgroundColor: theme.palette.secondary.dark,\n // }),\n title: {\n flex: '1 1 100%',\n },\n rootTool: {\n paddingLeft: 16,\n paddingRight: 8,\n },\n silver: {\n opacity: 0.2,\n },\n flex: {\n display: 'flex',\n alignItems: 'baseline',\n },\n filteredOut: {\n padding: 10,\n display: 'flex',\n textAlign: 'center',\n },\n buttonEmpty: {\n width: 34,\n display: 'inline-block',\n },\n buttonCell: {\n whiteSpace: 'nowrap',\n },\n\n dropZone: {\n width: '100%',\n height: 100,\n position: 'relative',\n },\n dropZoneEmpty: {},\n uploadDiv: {\n position: 'relative',\n width: '100%',\n minHeight: 300,\n opacity: 0.9,\n marginTop: 30,\n cursor: 'pointer',\n outline: 'none',\n },\n uploadDivDragging: {\n opacity: 1,\n background: 'rgba(128,255,128,0.1)',\n },\n image: {\n objectFit: 'contain',\n margin: 'auto',\n display: 'flex',\n width: '100%',\n height: '100%',\n },\n uploadCenterDiv: {\n margin: 5,\n border: '3px dashed grey',\n borderRadius: 5,\n width: 'calc(100% - 10px)',\n height: 'calc(100% - 10px)',\n minHeight: 300,\n position: 'relative',\n display: 'flex',\n },\n uploadCenterIcon: {\n paddingTop: 10,\n width: 48,\n height: 48,\n },\n uploadCenterText: {\n fontSize: 16,\n },\n uploadCenterTextAndIcon: {\n textAlign: 'center',\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n buttonRemoveWrapper: {\n position: 'absolute',\n zIndex: 222,\n right: 0,\n },\n error: {\n border: '2px solid red',\n boxSizing: 'border-box',\n },\n tooltip: {\n pointerEvents: 'none',\n },\n cardHeader: (theme: IobTheme): any => ({\n color: theme.palette.mode === 'light' ? theme.palette.secondary.main : theme.palette.text.primary,\n height: '100%',\n fontWeight: 'bold',\n fontSize: 'larger',\n fontStyle: 'italic',\n backgroundColor: theme.palette.primary.main,\n }),\n};\n\nfunction objectToArray(\n object: Record<string, any>,\n nameOfFirstAttr: string,\n nameOfSecondAttr?: string,\n): Record<string, any>[] {\n nameOfFirstAttr = nameOfFirstAttr || 'key';\n\n const array: Record<string, any>[] = [];\n Object.keys(object).forEach(key => {\n const item: Record<string, any> = {};\n item[nameOfFirstAttr] = key;\n\n if (nameOfSecondAttr) {\n item[nameOfSecondAttr] = object[key];\n array.push(item);\n } else {\n array.push(Object.assign(item, object[key]));\n }\n });\n\n return array;\n}\n\nfunction arrayToObject(\n array: Record<string, any>[],\n nameOfFirstAttr: string,\n nameOfSecondAttr?: string,\n): Record<string, any> {\n nameOfFirstAttr = nameOfFirstAttr || 'key';\n\n const object: Record<string, any> = {};\n\n array.forEach((row: Record<string, any>) => {\n let key = row[nameOfFirstAttr];\n if (key === null || key === undefined) {\n key = '';\n }\n delete row[nameOfFirstAttr];\n\n if (nameOfSecondAttr) {\n object[key] = row[nameOfSecondAttr];\n } else {\n object[key] = row;\n }\n });\n\n return object;\n}\n\ninterface ConfigTableProps extends ConfigGenericProps {\n schema: ConfigItemTable;\n}\n\ninterface ConfigTableState extends ConfigGenericState {\n value: Record<string, any>[];\n visibleValue: number[] | null;\n orderBy: string;\n order: 'asc' | 'desc';\n iteration: number;\n filterOn: string[];\n errorMessage: string;\n showImportDialog: boolean;\n showTypeOfImportDialog: Record<string, any>[] | false;\n instanceObj: ioBroker.InstanceObject;\n customObj: Record<string, any>;\n uploadFile: boolean | 'dragging';\n icon: boolean;\n width: number;\n tableErrors: Record<number, Record<string, string>>;\n}\n\nfunction encrypt(secret: string, value: string): string {\n let result = '';\n for (let i = 0; i < value.length; i++) {\n result += String.fromCharCode(secret[i % secret.length].charCodeAt(0) ^ value.charCodeAt(i));\n }\n return result;\n}\n\nfunction decrypt(secret: string, value: string): string {\n let result = '';\n for (let i = 0; i < value.length; i++) {\n result += String.fromCharCode(secret[i % secret.length].charCodeAt(0) ^ value.charCodeAt(i));\n }\n return result;\n}\n\nclass ConfigTable extends ConfigGeneric<ConfigTableProps, ConfigTableState> {\n private readonly filterRefs: Record<string, RefObject<HTMLInputElement>>;\n\n private typingTimer: ReturnType<typeof setTimeout> | null = null;\n\n private resizeTimeout: ReturnType<typeof setTimeout> | null = null;\n\n private secret: string = 'Zgfr56gFe87jJOM';\n\n private readonly refDiv: React.RefObject<HTMLDivElement>;\n\n private readonly listOfHiddenElements: string[][] = [];\n\n private refreshBecauseOfHiddenElements: ReturnType<typeof setTimeout> | null = null;\n\n constructor(props: ConfigTableProps) {\n super(props);\n this.filterRefs = {};\n this.props.schema.items = this.props.schema.items || [];\n this.props.schema.items.forEach((el: ConfigItemTableIndexed) => {\n if (el.filter) {\n this.filterRefs[el.attr] = createRef();\n }\n });\n\n this.refDiv = React.createRef();\n }\n\n /**\n * React lifecycle hook, called once as component is mounted\n */\n async componentDidMount(): Promise<void> {\n super.componentDidMount();\n const _value: Record<string, any>[] | Record<string, any> =\n ConfigGeneric.getValue(this.props.data, this.props.attr) || [];\n let value: Record<string, any>[];\n\n // if the list is given as an object\n if (this.props.schema.objKeyName) {\n value = objectToArray(\n _value as Record<string, any>,\n this.props.schema.objKeyName,\n this.props.schema.objValueName,\n );\n } else {\n value = _value as Record<string, any>[];\n }\n\n if (!Array.isArray(value)) {\n value = [];\n }\n\n if (this.props.schema.encryptedAttributes) {\n const systemConfig = await this.props.oContext.socket.getCompactSystemConfig();\n this.secret = systemConfig?.native.secret || this.secret;\n\n _value.forEach((el: Record<string, any>) => {\n this.props.schema.encryptedAttributes.forEach((attr: string) => {\n if (el[attr]) {\n el[attr] = decrypt(this.secret, el[attr]);\n }\n });\n });\n }\n\n this.setState(\n {\n value,\n visibleValue: null,\n orderBy: /* this.props.schema.items.length ? this.props.schema.items[0].attr : */ '',\n order: 'asc',\n iteration: 0,\n filterOn: [],\n width: 0,\n tableErrors: {},\n },\n () => this.validateUniqueProps(),\n );\n }\n\n componentWillUnmount(): void {\n if (this.typingTimer) {\n clearTimeout(this.typingTimer);\n this.typingTimer = null;\n }\n if (this.resizeTimeout) {\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = null;\n }\n if (this.refreshBecauseOfHiddenElements) {\n clearTimeout(this.refreshBecauseOfHiddenElements);\n this.refreshBecauseOfHiddenElements = null;\n }\n super.componentWillUnmount();\n }\n\n itemTable(attrItem: string, data: Record<string, any>, idx: number, asCard: boolean): JSX.Element | null {\n const { schema } = this.props;\n const schemaForAttribute = schema.items?.find((el: ConfigItemTableIndexed) => el.attr === attrItem);\n\n if (!schemaForAttribute) {\n return null;\n }\n\n const schemaItem = {\n items: {\n [attrItem]: schemaForAttribute,\n },\n };\n\n return (\n <ConfigPanel\n oContext={this.props.oContext}\n alive={this.props.alive}\n arrayIndex={idx}\n changed={this.props.changed}\n common={this.props.common}\n expertMode={this.props.expertMode}\n custom\n data={data}\n globalData={this.props.data}\n index={idx + this.state.iteration}\n onChange={(attr: string, valueChange: any) => {\n const newObj: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n newObj[idx][attr] = valueChange;\n this.setState({ value: newObj }, () => {\n this.validateUniqueProps();\n this.onChangeWrapper(newObj, true);\n });\n }}\n onError={this.onTableRowError(idx)}\n originalData={this.props.originalData}\n schema={schemaItem as ConfigItemPanel}\n table\n themeName={this.props.themeName}\n onHiddenChanged={\n asCard\n ? (attr: string, hidden: boolean): void => {\n // if element is hidden, so hide\n if (hidden) {\n this.listOfHiddenElements[idx] ||= [];\n if (!this.listOfHiddenElements[idx].includes(attr)) {\n this.listOfHiddenElements[idx].push(attr);\n\n if (this.refreshBecauseOfHiddenElements) {\n clearTimeout(this.refreshBecauseOfHiddenElements);\n }\n this.refreshBecauseOfHiddenElements = setTimeout(() => {\n this.forceUpdate();\n }, 100);\n }\n } else if (this.listOfHiddenElements[idx]) {\n const pos = this.listOfHiddenElements[idx].indexOf(attr);\n if (pos !== -1) {\n this.listOfHiddenElements[idx].splice(pos, 1);\n if (this.refreshBecauseOfHiddenElements) {\n clearTimeout(this.refreshBecauseOfHiddenElements);\n }\n this.refreshBecauseOfHiddenElements = setTimeout(() => {\n this.forceUpdate();\n }, 100);\n }\n }\n }\n : undefined\n }\n />\n );\n }\n\n /**\n * Validate that columns configured in `uniqueColumns` have unique values\n */\n validateUniqueProps(): void {\n if (!this.props.schema.uniqueColumns) {\n return;\n }\n\n let firstErrorColumn: string | null = null;\n let firstErrorValue: string | number | null = null;\n\n // Validate all columns and collect errors\n for (const uniqueCol of this.props.schema.uniqueColumns) {\n const allVals: (string | number)[] = [];\n const found = this.state.value.find(entry => {\n const val = entry[uniqueCol];\n if (allVals.includes(val)) {\n // Store the first error we encounter\n if (!firstErrorColumn) {\n firstErrorColumn = uniqueCol;\n firstErrorValue = val;\n }\n this.onError(uniqueCol, 'is not unique');\n return true;\n }\n allVals.push(val);\n return false;\n });\n\n // Clear error for this column if no duplicates found\n if (!found) {\n this.onError(uniqueCol, null);\n }\n }\n\n // Set error message based on the first error found (or clear if no errors)\n if (firstErrorColumn) {\n this.setState({\n errorMessage: I18n.t(\n 'Non-allowed duplicate entry \"%s\" in column \"%s\"',\n firstErrorValue,\n firstErrorColumn,\n ),\n });\n } else {\n this.setState({ errorMessage: '' });\n }\n }\n\n /**\n * Handle errors from table row components\n */\n onTableRowError =\n (rowIndex: number) =>\n (attr: string, error?: string): void => {\n const newTableErrors = { ...this.state.tableErrors };\n\n if (!newTableErrors[rowIndex]) {\n newTableErrors[rowIndex] = {};\n }\n\n if (!error) {\n delete newTableErrors[rowIndex][attr];\n // Clean up empty row error objects\n if (Object.keys(newTableErrors[rowIndex]).length === 0) {\n delete newTableErrors[rowIndex];\n }\n } else {\n newTableErrors[rowIndex][attr] = error;\n }\n\n this.setState({ tableErrors: newTableErrors });\n\n // Forward error to parent component\n this.props.onError(attr, error);\n };\n\n static descendingComparator(a: Record<string, any>, b: Record<string, any>, orderBy: string): number {\n if (b[orderBy] < a[orderBy]) {\n return -1;\n }\n if (b[orderBy] > a[orderBy]) {\n return 1;\n }\n return 0;\n }\n\n static getComparator(\n order: 'desc' | 'asc',\n orderBy: string,\n ): (a: Record<string, any>, b: Record<string, any>) => number {\n return order === 'desc'\n ? (a: Record<string, any>, b: Record<string, any>) => ConfigTable.descendingComparator(a, b, orderBy)\n : (a: Record<string, any>, b: Record<string, any>) => -ConfigTable.descendingComparator(a, b, orderBy);\n }\n\n static getFilterValue(el: React.RefObject<HTMLInputElement>): string {\n return (el?.current?.children[0]?.children[0] as HTMLInputElement)?.value;\n }\n\n static setFilterValue(el: React.RefObject<HTMLInputElement>, filterValue: string): string {\n return ((el.current.children[0].children[0] as HTMLInputElement).value = filterValue);\n }\n\n handleRequestSort = (property: string, orderCheck: boolean = false): void => {\n const { order, orderBy } = this.state;\n //if (orderBy || 'asc') {\n const isAsc = orderBy === property && order === 'asc';\n const newOrder = orderCheck ? order : isAsc ? 'desc' : 'asc';\n const newValue = this.stableSort(newOrder, property);\n // update only if value is really changed\n if (JSON.stringify(newValue) !== JSON.stringify(this.state.value)) {\n this.setState(\n { value: newValue, order: newOrder, orderBy: property, iteration: this.state.iteration + 10000 },\n () => this.applyFilter(false, newValue),\n );\n }\n //}\n };\n\n stableSort = (order: 'desc' | 'asc', orderBy: string): Record<string, any>[] => {\n const { value } = this.state;\n const comparator = ConfigTable.getComparator(order, orderBy);\n const stabilizedThis = value.map((el, index) => ({ el, index }));\n\n stabilizedThis.sort((a, b) => {\n const order_ = comparator(a.el, b.el);\n if (order_ !== 0) {\n return order_;\n }\n return a.index - b.index;\n });\n\n return stabilizedThis.map(el => el.el);\n };\n\n renderShowHideFilter(headCell: ConfigItemTableIndexed): React.JSX.Element | null {\n if (!headCell.filter) {\n return null;\n }\n return (\n <IconButton\n title={I18n.t('ra_Show/hide filter input')}\n size=\"small\"\n onClick={() => {\n const filterOn = [...this.state.filterOn];\n const pos = this.state.filterOn.indexOf(headCell.attr);\n if (pos === -1) {\n filterOn.push(headCell.attr);\n } else {\n filterOn.splice(pos, 1);\n }\n this.setState({ filterOn }, () => {\n if (pos && ConfigTable.getFilterValue(this.filterRefs[headCell.attr])) {\n ConfigTable.setFilterValue(this.filterRefs[headCell.attr], '');\n this.applyFilter();\n }\n });\n }}\n >\n {this.state.filterOn.includes(headCell.attr) ? <IconFilterOff /> : <IconFilterOn />}\n </IconButton>\n );\n }\n\n renderImportExportButtons(schema: ConfigItemTable): React.JSX.Element {\n return (\n <>\n {!schema.noDelete && schema.import ? (\n <Tooltip\n title={I18n.t('ra_Import data from %s file', 'CSV')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={() => this.setState({ showImportDialog: true })}\n >\n <ImportIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n {schema.export ? (\n <Tooltip\n title={I18n.t('ra_Export data to %s file', 'CSV')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={() => this.onExport()}\n >\n <ExportIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n {schema.noDelete ? null : (\n <IconButton\n disabled\n size=\"small\"\n >\n <DeleteIcon />\n </IconButton>\n )}\n </>\n );\n }\n\n renderAddButton(doAnyFilterSet: boolean): React.JSX.Element {\n return (\n <Tooltip\n title={doAnyFilterSet ? I18n.t('ra_Cannot add items with set filter') : I18n.t('ra_Add row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <span>\n <IconButton\n size=\"small\"\n color=\"primary\"\n disabled={!!doAnyFilterSet && !this.props.schema.allowAddByFilter}\n onClick={this.onAdd}\n >\n <AddIcon />\n </IconButton>\n </span>\n </Tooltip>\n );\n }\n\n enhancedTableHead(buttonsWidth: number, doAnyFilterSet: boolean): JSX.Element {\n const { schema } = this.props;\n const { order, orderBy } = this.state;\n return (\n <TableHead>\n <TableRow>\n {schema.items?.map((headCell: ConfigItemTableIndexed, i: number) =>\n this.renderOneFilter({\n schema,\n style: { width: headCell.width },\n showAddButton: !i && !schema.noDelete,\n headCell,\n order,\n orderBy,\n index: i,\n doAnyFilterSet,\n }),\n )}\n {!schema.noDelete && (\n <TableCell\n style={{\n paddingLeft: 20,\n paddingRight: 20,\n width: buttonsWidth,\n textAlign: 'right',\n }}\n padding=\"checkbox\"\n >\n {this.renderImportExportButtons(schema)}\n </TableCell>\n )}\n </TableRow>\n </TableHead>\n );\n }\n\n onDelete = (index: number) => (): void => {\n const newValue: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n newValue.splice(index, 1);\n\n // Clear errors for deleted row and shift remaining error indices\n const newTableErrors = { ...this.state.tableErrors };\n\n // Clear errors for the deleted row\n if (newTableErrors[index]) {\n // Clear all errors for this row from parent\n Object.keys(newTableErrors[index]).forEach(attr => {\n this.props.onError(attr, undefined);\n });\n delete newTableErrors[index];\n }\n\n // Shift error indices for rows after the deleted one\n const shiftedErrors: Record<number, Record<string, string>> = {};\n Object.keys(newTableErrors).forEach(rowIndexStr => {\n const rowIndex = parseInt(rowIndexStr, 10);\n if (rowIndex > index) {\n // Move errors from rowIndex to rowIndex - 1\n shiftedErrors[rowIndex - 1] = newTableErrors[rowIndex];\n } else {\n // Keep errors at same index for rows before deleted row\n shiftedErrors[rowIndex] = newTableErrors[rowIndex];\n }\n });\n\n this.setState(\n {\n value: newValue,\n iteration: this.state.iteration + 10_000,\n tableErrors: shiftedErrors,\n },\n () => this.applyFilter(false, null, () => this.onChangeWrapper(newValue)),\n );\n };\n\n onExport(): void {\n const { schema } = this.props;\n const { value } = this.state;\n const cols = schema.items.map((it: ConfigItemTableIndexed) => it.attr);\n const lines = [cols.join(';')];\n value.forEach(row => {\n const line: string[] = [];\n schema.items.forEach((it: ConfigItemTableIndexed) => {\n if (row[it.attr] && typeof row[it.attr] === 'string' && row[it.attr].includes(';')) {\n line.push(`\"${row[it.attr]}\"`);\n } else {\n line.push(row[it.attr] === undefined || row[it.attr] === null ? '' : row[it.attr]);\n }\n });\n lines.push(line.join(';'));\n });\n const el = document.createElement('a');\n el.setAttribute('href', `data:text/csv;charset=utf-8,${encodeURIComponent(lines.join('\\n'))}`);\n const now = new Date();\n el.setAttribute(\n 'download',\n `${now.getFullYear()}_${(now.getMonth() + 1).toString().padStart(2, '0')}_${now.getDate().toString().padStart(2, '0')}_${this.props.oContext.adapterName}.${this.props.oContext.instance}_${this.props.attr}.csv`,\n );\n\n el.style.display = 'none';\n document.body.appendChild(el);\n\n el.click();\n\n document.body.removeChild(el);\n }\n\n onImport(text: string): void {\n const lines = text.split('\\n').map((line: string) => line.replace('\\r', '').trim());\n // the first line is header\n const { schema } = this.props;\n\n const header = lines\n .shift()\n .split(';')\n .filter(it => it && schema.items.find((it2: ConfigItemTableIndexed) => it2.attr === it));\n\n const values: Record<string, any>[] = [];\n lines.forEach((line: string) => {\n const parts: string[] = line.split(';');\n const obj: Record<string, string | number | boolean> = {};\n for (let p = 0; p < parts.length; p++) {\n let value = parts[p];\n if (value.startsWith('\"')) {\n value = value.substring(1);\n while (p < parts.length && !value.endsWith('\"')) {\n value += `;${parts[++p]}`;\n }\n value = value.substring(0, value.length - 1);\n }\n\n let val: string | number | boolean = value;\n\n if (value === 'true') {\n val = true;\n } else if (value === 'false') {\n val = false;\n } else if (window.isFinite(value as any as number)) {\n const attr = this.props.schema.items.find((it: ConfigItemTableIndexed) => it.attr === header[p]);\n if (attr && attr.type === 'number') {\n // if a type of attribute is a \"number\"\n val = parseFloat(value);\n } else {\n val = value;\n }\n } else {\n val = value;\n }\n\n obj[header[p]] = val;\n }\n values.push(obj);\n });\n\n if (values.length) {\n if (this.state.value?.length) {\n this.setState({ showTypeOfImportDialog: values, showImportDialog: false });\n } else {\n this.setState({ value: values, showImportDialog: false });\n }\n } else {\n window.alert('ra_No data found in file');\n }\n }\n\n onClone = (index: number) => (): void => {\n const newValue: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n const cloned: Record<string, any> = JSON.parse(JSON.stringify(newValue[index]));\n if (typeof this.props.schema.clone === 'string' && typeof cloned[this.props.schema.clone] === 'string') {\n let i = 1;\n let text = cloned[this.props.schema.clone];\n const pattern = text.match(/(\\d+)$/);\n if (pattern) {\n text = text.replace(pattern[0], '');\n i = parseInt(pattern[0], 10) + 1;\n } else {\n text += '_';\n }\n while (\n newValue.find(\n (it: Record<string, any>) => it[this.props.schema.clone as string] === text + i.toString(),\n )\n ) {\n i++;\n }\n cloned[this.props.schema.clone] = `${cloned[this.props.schema.clone]}_${i}`;\n }\n\n newValue.splice(index, 0, cloned);\n\n this.setState({ value: newValue, iteration: this.state.iteration + 10000 }, () =>\n this.applyFilter(false, null, () => this.onChangeWrapper(newValue)),\n );\n };\n\n onChangeWrapper = (newValue: Record<string, any>[], updateVisible?: boolean): void => {\n if (this.typingTimer) {\n clearTimeout(this.typingTimer);\n }\n\n this.typingTimer = setTimeout(\n (value, _updateVisible) => {\n this.typingTimer = null;\n\n let mayBePromise: Promise<void> | void;\n if (this.props.schema.encryptedAttributes) {\n const _value = JSON.parse(JSON.stringify(value));\n _value.forEach((el: Record<string, any>) => {\n this.props.schema.encryptedAttributes.forEach((attr: string) => {\n if (el[attr]) {\n el[attr] = encrypt(this.secret, el[attr]);\n }\n });\n });\n\n if (this.props.schema.objKeyName) {\n const objValue = arrayToObject(\n _value,\n this.props.schema.objKeyName,\n this.props.schema.objValueName,\n );\n mayBePromise = this.onChange(this.props.attr, objValue);\n } else {\n mayBePromise = this.onChange(this.props.attr, _value);\n }\n } else if (this.props.schema.objKeyName) {\n const objValue = arrayToObject(\n JSON.parse(JSON.stringify(value)),\n this.props.schema.objKeyName,\n this.props.schema.objValueName,\n );\n mayBePromise = this.onChange(this.props.attr, objValue);\n } else {\n mayBePromise = this.onChange(this.props.attr, value);\n }\n if (mayBePromise instanceof Promise) {\n mayBePromise.catch(e => console.error(`Cannot save: ${e}`));\n }\n if (_updateVisible) {\n this.applyFilter(false, value);\n this.handleRequestSort(this.state.orderBy, true);\n }\n },\n 300,\n newValue,\n updateVisible,\n );\n };\n\n onAdd = (): void => {\n const { schema } = this.props;\n const newValue: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n const newItem = schema.items?.reduce(\n (accumulator: Record<string, any>, currentValue: ConfigItemTableIndexed) => {\n let defaultValue;\n if (currentValue.defaultFunc) {\n if (this.props.custom) {\n defaultValue = currentValue.defaultFunc\n ? this.executeCustom(\n currentValue.defaultFunc,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n newValue.length,\n this.props.data,\n )\n : this.props.schema.default;\n } else {\n defaultValue = currentValue.defaultFunc\n ? this.execute(\n currentValue.defaultFunc,\n this.props.schema.default,\n this.props.data,\n newValue.length,\n this.props.data,\n )\n : this.props.schema.default;\n }\n } else {\n defaultValue = currentValue.default === undefined ? null : currentValue.default;\n }\n\n accumulator[currentValue.attr] = defaultValue;\n return accumulator;\n },\n {},\n );\n\n newValue.push(newItem);\n\n this.setState({ value: newValue }, () => this.applyFilter(false, null, () => this.onChangeWrapper(newValue)));\n };\n\n isAnyFilterSet(): boolean {\n return !!Object.keys(this.filterRefs).find(attr => ConfigTable.getFilterValue(this.filterRefs[attr]));\n }\n\n applyFilter = (clear?: boolean, value?: Record<string, any>[], cb?: () => void): void => {\n value = value || this.state.value;\n let visibleValue = value.map((_, i) => i);\n Object.keys(this.filterRefs).forEach(attr => {\n let valueInputRef = ConfigTable.getFilterValue(this.filterRefs[attr]);\n if (!clear && valueInputRef) {\n valueInputRef = valueInputRef.toLowerCase();\n visibleValue = visibleValue.filter(\n idx => value[idx] && value[idx][attr] && value[idx][attr].toLowerCase().includes(valueInputRef),\n );\n } else if (this.filterRefs[attr].current) {\n ConfigTable.setFilterValue(this.filterRefs[attr], '');\n }\n });\n\n if (visibleValue.length === value.length) {\n visibleValue = null;\n }\n\n if (visibleValue === null && this.state.visibleValue === null) {\n if (cb) {\n cb();\n }\n return;\n }\n\n if (JSON.stringify(visibleValue) !== JSON.stringify(this.state.visibleValue)) {\n this.setState({ visibleValue }, () => cb && cb());\n } else if (cb) {\n cb();\n }\n };\n\n onMoveUp(idx: number): void {\n const newValue: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n const item = newValue[idx];\n newValue.splice(idx, 1);\n newValue.splice(idx - 1, 0, item);\n this.setState({ value: newValue, iteration: this.state.iteration + 10000 }, () =>\n this.applyFilter(false, null, () => this.onChangeWrapper(newValue)),\n );\n }\n\n onMoveDown(idx: number): void {\n const newValue: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n const item = newValue[idx];\n newValue.splice(idx, 1);\n newValue.splice(idx + 1, 0, item);\n this.setState({ value: newValue, iteration: this.state.iteration + 10000 }, () =>\n this.applyFilter(false, null, () => this.onChangeWrapper(newValue)),\n );\n }\n\n onDrop(acceptedFiles: File[]): void {\n const file = acceptedFiles[0];\n const reader = new FileReader();\n\n reader.onabort = () => console.log('file reading was aborted');\n reader.onerror = () => console.log('file reading has failed');\n reader.onload = () => {\n if (file.size > MAX_SIZE) {\n window.alert(I18n.t('ra_File is too big. Max %sk allowed. Try use SVG.', Math.round(MAX_SIZE / 1024)));\n return;\n }\n const text = new Uint8Array(reader.result as ArrayBufferLike).reduce(\n (data, byte) => data + String.fromCharCode(byte),\n '',\n );\n\n this.onImport(text);\n };\n reader.readAsArrayBuffer(file);\n }\n\n showTypeOfImportDialog(): JSX.Element | null {\n if (!this.state.showTypeOfImportDialog) {\n return null;\n }\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showTypeOfImportDialog: false })}\n maxWidth=\"md\"\n >\n <DialogTitle>{I18n.t('ra_Append or replace?')}</DialogTitle>\n <DialogContent>\n {I18n.t('ra_Append %s entries or replace existing?', this.state.showTypeOfImportDialog.length)}\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n autoFocus\n onClick={() => {\n const value: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n\n (this.state.showTypeOfImportDialog as Record<string, any>[]).forEach(\n (obj: Record<string, any>) => value.push(obj),\n );\n\n this.setState(\n {\n value,\n iteration: this.state.iteration + 10000,\n showTypeOfImportDialog: false,\n },\n () => this.applyFilter(false, null, () => this.onChangeWrapper(value)),\n );\n }}\n >\n {I18n.t('ra_Append')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n autoFocus\n onClick={() => {\n const value: Record<string, any>[] = this.state.showTypeOfImportDialog as Record<\n string,\n any\n >[];\n this.setState(\n {\n value,\n iteration: this.state.iteration + 10000,\n showTypeOfImportDialog: false,\n },\n () => this.applyFilter(false, null, () => this.onChangeWrapper(value)),\n );\n }}\n >\n {I18n.t('ra_Replace')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n showImportDialog(): JSX.Element | null {\n if (!this.state.showImportDialog) {\n return null;\n }\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showImportDialog: false })}\n sx={{\n '& .MuiDialog-paper': {\n minHeight: 500,\n },\n }}\n maxWidth=\"md\"\n fullWidth\n >\n <DialogTitle>{I18n.t('ra_Import from %s', 'CSV')}</DialogTitle>\n <DialogContent>\n <Dropzone\n multiple={false}\n accept={{ 'text/csv': ['.csv'] }}\n maxSize={MAX_SIZE}\n onDragEnter={() => this.setState({ uploadFile: 'dragging' })}\n onDragLeave={() => this.setState({ uploadFile: true })}\n onDrop={(acceptedFiles, errors) => {\n this.setState({ uploadFile: false });\n if (!acceptedFiles.length) {\n window.alert(\n (errors &&\n errors[0] &&\n errors[0].errors &&\n errors[0].errors[0] &&\n errors[0].errors[0].message) ||\n I18n.t('ra_Cannot upload'),\n );\n } else {\n this.onDrop(acceptedFiles);\n }\n }}\n >\n {({ getRootProps, getInputProps }) => (\n <div\n style={{\n ...styles.uploadDiv,\n ...(this.state.uploadFile === 'dragging' ? styles.uploadDivDragging : undefined),\n ...styles.dropZone,\n ...(!this.state.icon ? styles.dropZoneEmpty : undefined),\n }}\n {...getRootProps()}\n >\n <input {...getInputProps()} />\n <div style={styles.uploadCenterDiv}>\n <div style={styles.uploadCenterTextAndIcon}>\n <ImportIcon style={styles.uploadCenterIcon} />\n <div style={styles.uploadCenterText}>\n {this.state.uploadFile === 'dragging'\n ? I18n.t('ra_Drop file here')\n : I18n.t(\n 'ra_Place your files here or click here to open the browse dialog',\n )}\n </div>\n </div>\n </div>\n </div>\n )}\n </Dropzone>\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n onClick={() => this.setState({ showImportDialog: false })}\n color=\"primary\"\n startIcon={<IconClose />}\n >\n {I18n.t('Cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderOneFilter(props: {\n schema: ConfigItemTable;\n doAnyFilterSet: boolean;\n headCell: ConfigItemTableIndexed;\n index: number;\n orderBy: string;\n order: 'asc' | 'desc';\n showAddButton: boolean;\n style: React.CSSProperties;\n }): React.JSX.Element {\n return (\n <TableCell\n key={`${props.headCell.attr}_${props.index}`}\n style={props.style}\n align=\"left\"\n sortDirection={props.orderBy === props.headCell.attr ? props.order : false}\n >\n <div\n style={{\n ...styles.flex,\n ...(props.schema.showFirstAddOnTop ? { flexDirection: 'column' } : undefined),\n }}\n >\n {props.showAddButton ? this.renderAddButton(props.doAnyFilterSet) : null}\n {props.headCell.sort && (\n <TableSortLabel\n active\n style={props.orderBy !== props.headCell.attr ? styles.silver : undefined}\n direction={props.orderBy === props.headCell.attr ? props.order : 'asc'}\n onClick={() => this.handleRequestSort(props.headCell.attr)}\n />\n )}\n {props.headCell.filter && this.state.filterOn.includes(props.headCell.attr) ? (\n <TextField\n variant=\"standard\"\n ref={this.filterRefs[props.headCell.attr]}\n onChange={() => this.applyFilter()}\n title={I18n.t('ra_You can filter entries by entering here some text')}\n slotProps={{\n input: {\n endAdornment: ConfigTable.getFilterValue(this.filterRefs[props.headCell.attr]) && (\n <InputAdornment position=\"end\">\n <IconButton\n size=\"small\"\n tabIndex={-1}\n onClick={() => {\n ConfigTable.setFilterValue(\n this.filterRefs[props.headCell.attr],\n '',\n );\n this.applyFilter();\n }}\n >\n <CloseIcon />\n </IconButton>\n </InputAdornment>\n ),\n },\n }}\n fullWidth\n placeholder={this.getText(props.headCell.title)}\n />\n ) : (\n <span style={styles.headerText}>{this.getText(props.headCell.title)}</span>\n )}\n {this.renderShowHideFilter(props.headCell)}\n </div>\n </TableCell>\n );\n }\n\n enhancedFilterCard(): JSX.Element {\n const { schema } = this.props;\n const { order, orderBy } = this.state;\n let tdStyle: React.CSSProperties | undefined;\n if (this.props.schema.compact) {\n tdStyle = { paddingTop: 1, paddingBottom: 1 };\n }\n\n const importExportVisible = (!schema.noDelete && schema.import) || schema.export;\n\n if (importExportVisible || schema.items.find(item => item.sort || item.filter)) {\n return (\n <Grid2\n size={{\n xs: schema.xs || 12, // if xs is not defined, take the full width\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n >\n <Card>\n <Paper style={styles.paper}>\n <Accordion style={styles.paper}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>{I18n.t('ra_Filter and Data Actions')}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Table>\n <TableBody>\n {schema.items?.find(item => item.sort || item.filter) &&\n schema.items.map(\n (\n headCell: ConfigItemTableIndexed,\n i: number,\n ): React.JSX.Element => (\n <TableRow key={`${headCell.attr}_${i}`}>\n {this.renderOneFilter({\n schema,\n style: tdStyle,\n showAddButton: false,\n headCell,\n order,\n orderBy,\n index: i,\n doAnyFilterSet: false,\n })}\n </TableRow>\n ),\n )}\n {importExportVisible ? (\n <TableRow>\n <TableCell\n align=\"left\"\n style={tdStyle}\n >\n <span style={styles.headerText}>{I18n.t('ra_Actions')}</span>\n </TableCell>\n <TableCell style={tdStyle}>\n {this.renderImportExportButtons(schema)}\n </TableCell>\n </TableRow>\n ) : null}\n </TableBody>\n </Table>\n </AccordionDetails>\n </Accordion>\n </Paper>\n </Card>\n </Grid2>\n );\n }\n\n return null;\n }\n\n enhancedBottomCard(): JSX.Element {\n const { schema } = this.props;\n let tdStyle: React.CSSProperties | undefined;\n if (this.props.schema.compact) {\n tdStyle = { paddingTop: 1, paddingBottom: 1 };\n }\n const doAnyFilterSet = this.isAnyFilterSet();\n return (\n <Grid2\n size={{\n xs: schema.xs || 12, // if xs is not defined, take the full width\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n >\n <Card>\n <Paper style={styles.paper}>\n <Table>\n <TableBody>\n <TableRow>\n <TableCell\n colSpan={schema.items.length + 1}\n style={tdStyle}\n >\n {this.renderAddButton(doAnyFilterSet)}\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </Paper>\n </Card>\n </Grid2>\n );\n }\n\n renderCards(): JSX.Element | null {\n const { schema } = this.props;\n let { visibleValue } = this.state;\n let tdStyle: React.CSSProperties | undefined;\n if (this.props.schema.compact) {\n tdStyle = { paddingTop: 1, paddingBottom: 1 };\n }\n const tdStyleHidden = { padding: 0, borderBottom: 'none' };\n visibleValue ||= this.state.value.map((_, i) => i);\n\n const doAnyFilterSet = this.isAnyFilterSet();\n\n return (\n <Grid2 container>\n {this.showImportDialog()}\n {this.showTypeOfImportDialog()}\n {this.enhancedFilterCard()}\n {visibleValue.map((idx, i) => (\n <Grid2\n key={`${idx}_${i}`}\n size={{\n xs: schema.xs || 12, // if xs is not defined, take the full width\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n >\n <Card>\n <Paper style={styles.paper}>\n {this.props.schema.titleAttribute ? (\n <Box sx={styles.cardHeader}>\n {this.state.value[idx][this.props.schema.titleAttribute]}\n </Box>\n ) : null}\n <Table>\n <TableBody>\n {schema.items?.map((headCell: ConfigItemTableIndexed) => {\n const hidden = this.listOfHiddenElements?.[idx]?.includes(headCell.attr);\n return (\n <TableRow key={`${headCell.attr}_${idx}`}>\n <TableCell\n align=\"left\"\n style={hidden ? tdStyleHidden : tdStyle}\n >\n {hidden ? null : (\n <span style={styles.headerText}>\n {this.getText(headCell.title)}\n </span>\n )}\n </TableCell>\n <TableCell\n align=\"left\"\n style={hidden ? tdStyleHidden : tdStyle}\n >\n {this.itemTable(\n headCell.attr,\n this.state.value[idx],\n idx,\n true,\n )}\n </TableCell>\n </TableRow>\n );\n })}\n {!schema.noDelete && (\n <TableRow>\n <TableCell\n align=\"left\"\n style={tdStyle}\n >\n <span style={styles.headerText}>{this.getText('Actions')}</span>\n </TableCell>\n <TableCell\n align=\"left\"\n style={tdStyle}\n >\n {!doAnyFilterSet && !this.state.orderBy ? (\n <Tooltip\n title={I18n.t('ra_Move up')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <span>\n <IconButton\n size=\"small\"\n onClick={() => this.onMoveUp(idx)}\n disabled={i === 0}\n >\n <UpIcon />\n </IconButton>\n </span>\n </Tooltip>\n ) : null}\n {!doAnyFilterSet && !this.state.orderBy ? (\n <Tooltip\n title={I18n.t('ra_Move down')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <span>\n <IconButton\n size=\"small\"\n onClick={() => this.onMoveDown(idx)}\n disabled={i === visibleValue.length - 1}\n >\n <DownIcon />\n </IconButton>\n </span>\n </Tooltip>\n ) : null}\n <Tooltip\n title={I18n.t('ra_Delete current row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={this.onDelete(idx)}\n >\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n {this.props.schema.clone ? (\n <Tooltip\n title={I18n.t('ra_Clone current row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={this.onClone(idx)}\n >\n <CopyContentIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </Paper>\n </Card>\n </Grid2>\n ))}\n {this.enhancedBottomCard()}\n </Grid2>\n );\n }\n\n renderTable(): JSX.Element | null {\n const { schema } = this.props;\n let { visibleValue } = this.state;\n\n visibleValue = visibleValue || this.state.value.map((_, i) => i);\n\n const doAnyFilterSet = this.isAnyFilterSet();\n\n let tdStyle: React.CSSProperties | undefined;\n if (this.props.schema.compact) {\n tdStyle = { paddingTop: 1, paddingBottom: 1 };\n }\n\n return (\n <Paper style={styles.paper}>\n {this.showImportDialog()}\n {this.showTypeOfImportDialog()}\n {schema.label ? (\n <div style={styles.label}>\n <Toolbar\n variant=\"dense\"\n style={styles.rootTool}\n >\n <Typography\n style={styles.title}\n variant=\"h6\"\n id=\"tableTitle\"\n component=\"div\"\n >\n {this.getText(schema.label)}\n </Typography>\n </Toolbar>\n </div>\n ) : null}\n <TableContainer>\n <Table\n style={styles.table}\n size=\"small\"\n >\n {this.enhancedTableHead(!doAnyFilterSet && !this.state.orderBy ? 120 : 64, doAnyFilterSet)}\n <TableBody>\n {visibleValue.map((idx, i) => (\n <TableRow\n hover\n key={`${idx}_${i}`}\n >\n {schema.items?.map((headCell: ConfigItemTableIndexed) => (\n <TableCell\n key={`${headCell.attr}_${idx}`}\n align=\"left\"\n style={tdStyle}\n >\n {this.itemTable(headCell.attr, this.state.value[idx], idx, false)}\n </TableCell>\n ))}\n {!schema.noDelete && (\n <TableCell\n align=\"left\"\n style={{ ...tdStyle, ...styles.buttonCell }}\n >\n {!doAnyFilterSet && !this.state.orderBy ? (\n i ? (\n <Tooltip\n title={I18n.t('ra_Move up')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={() => this.onMoveUp(idx)}\n >\n <UpIcon />\n </IconButton>\n </Tooltip>\n ) : (\n <div style={styles.buttonEmpty} />\n )\n ) : null}\n {!doAnyFilterSet && !this.state.orderBy ? (\n i < visibleValue.length - 1 ? (\n <Tooltip\n title={I18n.t('ra_Move down')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={() => this.onMoveDown(idx)}\n >\n <DownIcon />\n </IconButton>\n </Tooltip>\n ) : (\n <div style={styles.buttonEmpty} />\n )\n ) : null}\n <Tooltip\n title={I18n.t('ra_Delete current row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={this.onDelete(idx)}\n >\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n {this.props.schema.clone ? (\n <Tooltip\n title={I18n.t('ra_Clone current row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={this.onClone(idx)}\n >\n <CopyContentIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n </TableCell>\n )}\n </TableRow>\n ))}\n {!schema.noDelete && visibleValue.length >= (schema.showSecondAddAt || 5) ? (\n <TableRow>\n <TableCell\n colSpan={schema.items.length + 1}\n style={{ ...tdStyle }}\n >\n {this.renderAddButton(doAnyFilterSet)}\n </TableCell>\n </TableRow>\n ) : null}\n </TableBody>\n </Table>\n {!visibleValue.length && this.state.value.length ? (\n <div style={styles.filteredOut}>\n <Typography\n style={styles.title}\n variant=\"h6\"\n id=\"tableTitle\"\n component=\"div\"\n >\n {I18n.t('ra_All items are filtered out')}\n <IconButton\n size=\"small\"\n onClick={() => this.applyFilter(true)}\n >\n <CloseIcon />\n </IconButton>\n </Typography>\n </div>\n ) : null}\n </TableContainer>\n {schema.help ? (\n <FormHelperText style={{ paddingLeft: 16 }}>\n {this.renderHelp(\n this.props.schema.help,\n this.props.schema.helpLink,\n this.props.schema.noTranslation,\n )}\n </FormHelperText>\n ) : null}\n {this.state.errorMessage ? (\n <div style={{ display: 'flex', padding: '5px' }}>\n <ErrorIcon color=\"error\" />\n <span style={{ color: 'red', alignSelf: 'center' }}>{this.state.errorMessage}</span>\n </div>\n ) : null}\n </Paper>\n );\n }\n\n componentDidUpdate(): void {\n if (this.refDiv.current?.clientWidth && this.refDiv.current.clientWidth !== this.state.width) {\n if (this.resizeTimeout) {\n clearTimeout(this.resizeTimeout);\n }\n this.resizeTimeout = setTimeout(() => {\n this.resizeTimeout = null;\n this.setState({ width: this.refDiv.current?.clientWidth });\n }, 50);\n }\n }\n\n getCurrentBreakpoint(): 'xs' | 'sm' | 'md' | 'lg' | 'xl' {\n if (!this.state.width) {\n return 'md';\n }\n if (this.state.width < 600) {\n return 'xs';\n }\n if (this.state.width < 900) {\n return 'sm';\n }\n if (this.state.width < 1200) {\n return 'md';\n }\n if (this.state.width < 1536) {\n return 'lg';\n }\n return 'xl';\n }\n\n renderItem(/* error, disabled, defaultValue */): JSX.Element | null {\n const { schema } = this.props;\n\n if (!this.state.value || !Array.isArray(this.state.value)) {\n return null;\n }\n\n const currentBreakpoint = this.getCurrentBreakpoint();\n let content: React.JSX.Element;\n\n if (currentBreakpoint && (schema.useCardFor || ['xs']).includes(currentBreakpoint)) {\n content = this.renderCards();\n } else {\n content = this.renderTable();\n }\n\n return (\n <div\n ref={this.refDiv}\n style={{ width: '100%' }}\n >\n {content}\n </div>\n );\n }\n}\n\nexport default ConfigTable;\n"]}
|
|
1
|
+
{"version":3,"file":"ConfigTable.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigTable.tsx"],"names":[],"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AAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;QACtD,IAAI,OAA0B,CAAC;QAE/B,IAAI,iBAAiB,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACjF,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,CAAC;aAAM,CAAC;YACJ,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,CAAC;QAED,OAAO,CACH,6BACI,GAAG,EAAE,IAAI,CAAC,MAAM,EAChB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAEvB,OAAO,CACN,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, { createRef, type JSX, type RefObject } from 'react';\nimport Dropzone from 'react-dropzone';\n\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Button,\n Card,\n Collapse,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Grid2,\n IconButton,\n InputAdornment,\n Paper,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n TableSortLabel,\n TextField,\n Toolbar,\n Tooltip,\n Typography,\n FormHelperText,\n Box,\n} from '@mui/material';\n\nimport {\n Add as AddIcon,\n Delete as DeleteIcon,\n Close as CloseIcon,\n ArrowUpward as UpIcon,\n ArrowDownward as DownIcon,\n FilterAlt as IconFilterOn,\n FilterAltOff as IconFilterOff,\n ContentCopy as CopyContentIcon,\n Download as ExportIcon,\n Warning as ErrorIcon,\n UploadFile as ImportIcon,\n Close as IconClose,\n ExpandMore as ExpandMoreIcon,\n} from '@mui/icons-material';\n\nimport { I18n, type IobTheme } from '@iobroker/adapter-react-v5';\n\nimport type { ConfigItemTableIndexed, ConfigItemPanel, ConfigItemTable } from '../types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\nimport ConfigPanel from './ConfigPanel';\n\nconst MAX_SIZE = 1024 * 1024; // 1MB\n\nconst styles: Record<string, any> = {\n fullWidth: {\n width: '100%',\n },\n root: {\n width: '100%',\n },\n paper: {\n width: '100%',\n marginBottom: 16,\n backgroundColor: 'rgba(255, 255, 255, 0.1)',\n },\n headerText: {\n width: '100%',\n },\n table: {\n minWidth: 750,\n },\n visuallyHidden: {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: 1,\n margin: -1,\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n top: 20,\n width: 1,\n },\n label: {\n display: 'flex',\n justifyContent: 'space-between',\n },\n // highlight: (theme: IobTheme): React.CSSProperties => (theme.palette.mode === 'light'\n // ? {\n // color: theme.palette.secondary.main,\n // // backgroundColor: lighten(theme.palette.secondary.light, 0.85),\n // }\n // : {\n // color: theme.palette.text.primary,\n // backgroundColor: theme.palette.secondary.dark,\n // }),\n title: {\n flex: '1 1 100%',\n },\n rootTool: {\n paddingLeft: 16,\n paddingRight: 8,\n },\n silver: {\n opacity: 0.2,\n },\n flex: {\n display: 'flex',\n alignItems: 'baseline',\n },\n filteredOut: {\n padding: 10,\n display: 'flex',\n textAlign: 'center',\n },\n buttonEmpty: {\n width: 34,\n display: 'inline-block',\n },\n buttonCell: {\n whiteSpace: 'nowrap',\n },\n\n dropZone: {\n width: '100%',\n height: 100,\n position: 'relative',\n },\n dropZoneEmpty: {},\n uploadDiv: {\n position: 'relative',\n width: '100%',\n minHeight: 300,\n opacity: 0.9,\n marginTop: 30,\n cursor: 'pointer',\n outline: 'none',\n },\n uploadDivDragging: {\n opacity: 1,\n background: 'rgba(128,255,128,0.1)',\n },\n image: {\n objectFit: 'contain',\n margin: 'auto',\n display: 'flex',\n width: '100%',\n height: '100%',\n },\n uploadCenterDiv: {\n margin: 5,\n border: '3px dashed grey',\n borderRadius: 5,\n width: 'calc(100% - 10px)',\n height: 'calc(100% - 10px)',\n minHeight: 300,\n position: 'relative',\n display: 'flex',\n },\n uploadCenterIcon: {\n paddingTop: 10,\n width: 48,\n height: 48,\n },\n uploadCenterText: {\n fontSize: 16,\n },\n uploadCenterTextAndIcon: {\n textAlign: 'center',\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n buttonRemoveWrapper: {\n position: 'absolute',\n zIndex: 222,\n right: 0,\n },\n error: {\n border: '2px solid red',\n boxSizing: 'border-box',\n },\n tooltip: {\n pointerEvents: 'none',\n },\n cardHeader: (theme: IobTheme): any => ({\n color: theme.palette.mode === 'light' ? theme.palette.secondary.main : theme.palette.text.primary,\n height: '100%',\n fontWeight: 'bold',\n fontSize: 20,\n fontStyle: 'italic',\n padding: '4px 16px',\n backgroundColor: theme.palette.primary.main,\n display: 'flex',\n justifyContent: 'space-between',\n }),\n};\n\nfunction objectToArray(\n object: Record<string, any>,\n nameOfFirstAttr: string,\n nameOfSecondAttr?: string,\n): Record<string, any>[] {\n nameOfFirstAttr = nameOfFirstAttr || 'key';\n\n const array: Record<string, any>[] = [];\n Object.keys(object).forEach(key => {\n const item: Record<string, any> = {};\n item[nameOfFirstAttr] = key;\n\n if (nameOfSecondAttr) {\n item[nameOfSecondAttr] = object[key];\n array.push(item);\n } else {\n array.push(Object.assign(item, object[key]));\n }\n });\n\n return array;\n}\n\nfunction arrayToObject(\n array: Record<string, any>[],\n nameOfFirstAttr: string,\n nameOfSecondAttr?: string,\n): Record<string, any> {\n nameOfFirstAttr = nameOfFirstAttr || 'key';\n\n const object: Record<string, any> = {};\n\n array.forEach((row: Record<string, any>) => {\n let key = row[nameOfFirstAttr];\n if (key === null || key === undefined) {\n key = '';\n }\n delete row[nameOfFirstAttr];\n\n if (nameOfSecondAttr) {\n object[key] = row[nameOfSecondAttr];\n } else {\n object[key] = row;\n }\n });\n\n return object;\n}\n\ninterface ConfigTableProps extends ConfigGenericProps {\n schema: ConfigItemTable;\n}\n\ninterface ConfigTableState extends ConfigGenericState {\n value: Record<string, any>[];\n visibleValue: number[] | null;\n orderBy: string;\n order: 'asc' | 'desc';\n iteration: number;\n filterOn: string[];\n errorMessage: string;\n showImportDialog: boolean;\n showTypeOfImportDialog: Record<string, any>[] | false;\n instanceObj: ioBroker.InstanceObject;\n customObj: Record<string, any>;\n uploadFile: boolean | 'dragging';\n icon: boolean;\n width: number;\n tableErrors: Record<number, Record<string, string>>;\n collapsed: number[];\n}\n\nfunction encrypt(secret: string, value: string): string {\n let result = '';\n for (let i = 0; i < value.length; i++) {\n result += String.fromCharCode(secret[i % secret.length].charCodeAt(0) ^ value.charCodeAt(i));\n }\n return result;\n}\n\nfunction decrypt(secret: string, value: string): string {\n let result = '';\n for (let i = 0; i < value.length; i++) {\n result += String.fromCharCode(secret[i % secret.length].charCodeAt(0) ^ value.charCodeAt(i));\n }\n return result;\n}\n\nexport default class ConfigTable extends ConfigGeneric<ConfigTableProps, ConfigTableState> {\n private readonly filterRefs: Record<string, RefObject<HTMLInputElement>>;\n\n private typingTimer: ReturnType<typeof setTimeout> | null = null;\n\n private resizeTimeout: ReturnType<typeof setTimeout> | null = null;\n\n private secret: string = 'Zgfr56gFe87jJOM';\n\n private readonly refDiv: React.RefObject<HTMLDivElement>;\n\n private readonly listOfHiddenElements: string[][] = [];\n\n private refreshBecauseOfHiddenElements: ReturnType<typeof setTimeout> | null = null;\n\n constructor(props: ConfigTableProps) {\n super(props);\n this.filterRefs = {};\n this.props.schema.items ||= [];\n this.props.schema.items.forEach((el: ConfigItemTableIndexed) => {\n if (el.filter) {\n this.filterRefs[el.attr] = createRef();\n }\n });\n\n this.refDiv = React.createRef();\n }\n\n /**\n * React lifecycle hook, called once as component is mounted\n */\n async componentDidMount(): Promise<void> {\n super.componentDidMount();\n const _value: Record<string, any>[] | Record<string, any> =\n ConfigGeneric.getValue(this.props.data, this.props.attr) || [];\n let value: Record<string, any>[];\n\n // if the list is given as an object\n if (this.props.schema.objKeyName) {\n value = objectToArray(\n _value as Record<string, any>,\n this.props.schema.objKeyName,\n this.props.schema.objValueName,\n );\n } else {\n value = _value as Record<string, any>[];\n }\n\n if (!Array.isArray(value)) {\n value = [];\n }\n\n if (this.props.schema.encryptedAttributes) {\n const systemConfig = await this.props.oContext.socket.getCompactSystemConfig();\n this.secret = systemConfig?.native.secret || this.secret;\n\n _value.forEach((el: Record<string, any>) => {\n this.props.schema.encryptedAttributes.forEach((attr: string) => {\n if (el[attr]) {\n el[attr] = decrypt(this.secret, el[attr]);\n }\n });\n });\n }\n\n const collapsedStr = window.localStorage.getItem(\n `table.collapsed.${this.props.oContext.instance}.${this.props.attr}`,\n );\n let collapsed: number[] = [];\n if (collapsedStr) {\n try {\n collapsed = JSON.parse(collapsedStr);\n } catch {\n // ignore\n }\n }\n\n this.setState(\n {\n value,\n visibleValue: null,\n orderBy: /* this.props.schema.items.length ? this.props.schema.items[0].attr : */ '',\n order: 'asc',\n iteration: 0,\n filterOn: [],\n width: 0,\n tableErrors: {},\n collapsed,\n },\n () => this.validateUniqueProps(),\n );\n }\n\n componentWillUnmount(): void {\n if (this.typingTimer) {\n clearTimeout(this.typingTimer);\n this.typingTimer = null;\n }\n if (this.resizeTimeout) {\n clearTimeout(this.resizeTimeout);\n this.resizeTimeout = null;\n }\n if (this.refreshBecauseOfHiddenElements) {\n clearTimeout(this.refreshBecauseOfHiddenElements);\n this.refreshBecauseOfHiddenElements = null;\n }\n super.componentWillUnmount();\n }\n\n itemTable(attrItem: string, data: Record<string, any>, idx: number, asCard: boolean): JSX.Element | null {\n const { schema } = this.props;\n const schemaForAttribute = schema.items?.find((el: ConfigItemTableIndexed) => el.attr === attrItem);\n\n if (!schemaForAttribute) {\n return null;\n }\n\n const schemaItem = {\n items: {\n [attrItem]: schemaForAttribute,\n },\n };\n\n return (\n <ConfigPanel\n oContext={this.props.oContext}\n alive={this.props.alive}\n arrayIndex={idx}\n changed={this.props.changed}\n common={this.props.common}\n expertMode={this.props.expertMode}\n custom\n data={data}\n globalData={this.props.data}\n index={idx + this.state.iteration}\n onChange={(attr: string, valueChange: any) => {\n const newObj: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n newObj[idx][attr] = valueChange;\n this.setState({ value: newObj }, () => {\n this.validateUniqueProps();\n this.onChangeWrapper(newObj, true);\n });\n }}\n onError={this.onTableRowError(idx)}\n originalData={this.props.originalData}\n schema={schemaItem as ConfigItemPanel}\n table\n themeName={this.props.themeName}\n onHiddenChanged={\n asCard\n ? (attr: string, hidden: boolean): void => {\n // if element is hidden, so hide\n if (hidden) {\n this.listOfHiddenElements[idx] ||= [];\n if (!this.listOfHiddenElements[idx].includes(attr)) {\n this.listOfHiddenElements[idx].push(attr);\n\n if (this.refreshBecauseOfHiddenElements) {\n clearTimeout(this.refreshBecauseOfHiddenElements);\n }\n this.refreshBecauseOfHiddenElements = setTimeout(() => {\n this.forceUpdate();\n }, 100);\n }\n } else if (this.listOfHiddenElements[idx]) {\n const pos = this.listOfHiddenElements[idx].indexOf(attr);\n if (pos !== -1) {\n this.listOfHiddenElements[idx].splice(pos, 1);\n if (this.refreshBecauseOfHiddenElements) {\n clearTimeout(this.refreshBecauseOfHiddenElements);\n }\n this.refreshBecauseOfHiddenElements = setTimeout(() => {\n this.forceUpdate();\n }, 100);\n }\n }\n }\n : undefined\n }\n />\n );\n }\n\n /**\n * Validate that columns configured in `uniqueColumns` have unique values\n */\n validateUniqueProps(): void {\n if (!this.props.schema.uniqueColumns) {\n return;\n }\n\n let firstErrorColumn: string | null = null;\n let firstErrorValue: string | number | null = null;\n\n // Validate all columns and collect errors\n for (const uniqueCol of this.props.schema.uniqueColumns) {\n const allVals: (string | number)[] = [];\n const found = this.state.value.find(entry => {\n const val = entry[uniqueCol];\n if (allVals.includes(val)) {\n // Store the first error we encounter\n if (!firstErrorColumn) {\n firstErrorColumn = uniqueCol;\n firstErrorValue = val;\n }\n this.onError(uniqueCol, 'is not unique');\n return true;\n }\n allVals.push(val);\n return false;\n });\n\n // Clear error for this column if no duplicates found\n if (!found) {\n this.onError(uniqueCol, null);\n }\n }\n\n // Set error message based on the first error found (or clear if no errors)\n if (firstErrorColumn) {\n this.setState({\n errorMessage: I18n.t(\n 'Non-allowed duplicate entry \"%s\" in column \"%s\"',\n firstErrorValue,\n firstErrorColumn,\n ),\n });\n } else {\n this.setState({ errorMessage: '' });\n }\n }\n\n /**\n * Handle errors from table row components\n */\n onTableRowError =\n (rowIndex: number) =>\n (attr: string, error?: string): void => {\n const newTableErrors = { ...this.state.tableErrors };\n\n if (!newTableErrors[rowIndex]) {\n newTableErrors[rowIndex] = {};\n }\n\n if (!error) {\n delete newTableErrors[rowIndex][attr];\n // Clean up empty row error objects\n if (Object.keys(newTableErrors[rowIndex]).length === 0) {\n delete newTableErrors[rowIndex];\n }\n } else {\n newTableErrors[rowIndex][attr] = error;\n }\n\n this.setState({ tableErrors: newTableErrors });\n\n // Forward error to parent component\n this.props.onError(attr, error);\n };\n\n static descendingComparator(a: Record<string, any>, b: Record<string, any>, orderBy: string): number {\n if (b[orderBy] < a[orderBy]) {\n return -1;\n }\n if (b[orderBy] > a[orderBy]) {\n return 1;\n }\n return 0;\n }\n\n static getComparator(\n order: 'desc' | 'asc',\n orderBy: string,\n ): (a: Record<string, any>, b: Record<string, any>) => number {\n return order === 'desc'\n ? (a: Record<string, any>, b: Record<string, any>) => ConfigTable.descendingComparator(a, b, orderBy)\n : (a: Record<string, any>, b: Record<string, any>) => -ConfigTable.descendingComparator(a, b, orderBy);\n }\n\n static getFilterValue(el: React.RefObject<HTMLInputElement>): string {\n return (el?.current?.children[0]?.children[0] as HTMLInputElement)?.value;\n }\n\n static setFilterValue(el: React.RefObject<HTMLInputElement>, filterValue: string): string {\n return ((el.current.children[0].children[0] as HTMLInputElement).value = filterValue);\n }\n\n handleRequestSort = (property: string, orderCheck: boolean = false): void => {\n const { order, orderBy } = this.state;\n //if (orderBy || 'asc') {\n const isAsc = orderBy === property && order === 'asc';\n const newOrder = orderCheck ? order : isAsc ? 'desc' : 'asc';\n const newValue = this.stableSort(newOrder, property);\n // update only if value is really changed\n if (JSON.stringify(newValue) !== JSON.stringify(this.state.value)) {\n this.setState(\n { value: newValue, order: newOrder, orderBy: property, iteration: this.state.iteration + 10000 },\n () => this.applyFilter(false, newValue),\n );\n }\n //}\n };\n\n stableSort = (order: 'desc' | 'asc', orderBy: string): Record<string, any>[] => {\n const { value } = this.state;\n const comparator = ConfigTable.getComparator(order, orderBy);\n const stabilizedThis = value.map((el, index) => ({ el, index }));\n\n stabilizedThis.sort((a, b) => {\n const order_ = comparator(a.el, b.el);\n if (order_ !== 0) {\n return order_;\n }\n return a.index - b.index;\n });\n\n return stabilizedThis.map(el => el.el);\n };\n\n renderShowHideFilter(headCell: ConfigItemTableIndexed): React.JSX.Element | null {\n if (!headCell.filter) {\n return null;\n }\n return (\n <IconButton\n title={I18n.t('ra_Show/hide filter input')}\n size=\"small\"\n onClick={() => {\n const filterOn = [...this.state.filterOn];\n const pos = this.state.filterOn.indexOf(headCell.attr);\n if (pos === -1) {\n filterOn.push(headCell.attr);\n } else {\n filterOn.splice(pos, 1);\n }\n this.setState({ filterOn }, () => {\n if (pos && ConfigTable.getFilterValue(this.filterRefs[headCell.attr])) {\n ConfigTable.setFilterValue(this.filterRefs[headCell.attr], '');\n this.applyFilter();\n }\n });\n }}\n >\n {this.state.filterOn.includes(headCell.attr) ? <IconFilterOff /> : <IconFilterOn />}\n </IconButton>\n );\n }\n\n renderImportExportButtons(schema: ConfigItemTable): React.JSX.Element {\n return (\n <>\n {!schema.noDelete && schema.import ? (\n <Tooltip\n title={I18n.t('ra_Import data from %s file', 'CSV')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={() => this.setState({ showImportDialog: true })}\n >\n <ImportIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n {schema.export ? (\n <Tooltip\n title={I18n.t('ra_Export data to %s file', 'CSV')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={() => this.onExport()}\n >\n <ExportIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n {schema.noDelete ? null : (\n <IconButton\n disabled\n size=\"small\"\n >\n <DeleteIcon />\n </IconButton>\n )}\n </>\n );\n }\n\n renderAddButton(doAnyFilterSet: boolean): React.JSX.Element {\n return (\n <Tooltip\n title={doAnyFilterSet ? I18n.t('ra_Cannot add items with set filter') : I18n.t('ra_Add row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <span>\n <IconButton\n size=\"small\"\n color=\"primary\"\n disabled={!!doAnyFilterSet && !this.props.schema.allowAddByFilter}\n onClick={this.onAdd}\n >\n <AddIcon />\n </IconButton>\n </span>\n </Tooltip>\n );\n }\n\n enhancedTableHead(buttonsWidth: number, doAnyFilterSet: boolean): JSX.Element {\n const { schema } = this.props;\n const { order, orderBy } = this.state;\n return (\n <TableHead>\n <TableRow>\n {schema.items?.map((headCell: ConfigItemTableIndexed, i: number) =>\n this.renderOneFilter({\n schema,\n style: { width: headCell.width },\n showAddButton: !i && !schema.noDelete,\n headCell,\n order,\n orderBy,\n index: i,\n doAnyFilterSet,\n }),\n )}\n {!schema.noDelete && (\n <TableCell\n style={{\n paddingLeft: 20,\n paddingRight: 20,\n width: buttonsWidth,\n textAlign: 'right',\n }}\n padding=\"checkbox\"\n >\n {this.renderImportExportButtons(schema)}\n </TableCell>\n )}\n </TableRow>\n </TableHead>\n );\n }\n\n onDelete = (index: number) => (): void => {\n const newValue: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n newValue.splice(index, 1);\n\n // Clear errors for deleted row and shift remaining error indices\n const newTableErrors = { ...this.state.tableErrors };\n\n // Clear errors for the deleted row\n if (newTableErrors[index]) {\n // Clear all errors for this row from parent\n Object.keys(newTableErrors[index]).forEach(attr => {\n this.props.onError(attr, undefined);\n });\n delete newTableErrors[index];\n }\n\n // Shift error indices for rows after the deleted one\n const shiftedErrors: Record<number, Record<string, string>> = {};\n Object.keys(newTableErrors).forEach(rowIndexStr => {\n const rowIndex = parseInt(rowIndexStr, 10);\n if (rowIndex > index) {\n // Move errors from rowIndex to rowIndex - 1\n shiftedErrors[rowIndex - 1] = newTableErrors[rowIndex];\n } else {\n // Keep errors at same index for rows before deleted row\n shiftedErrors[rowIndex] = newTableErrors[rowIndex];\n }\n });\n\n this.setState(\n {\n value: newValue,\n iteration: this.state.iteration + 10_000,\n tableErrors: shiftedErrors,\n },\n () => this.applyFilter(false, null, () => this.onChangeWrapper(newValue)),\n );\n };\n\n onExport(): void {\n const { schema } = this.props;\n const { value } = this.state;\n const cols = schema.items.map((it: ConfigItemTableIndexed) => it.attr);\n const lines = [cols.join(';')];\n value.forEach(row => {\n const line: string[] = [];\n schema.items.forEach((it: ConfigItemTableIndexed) => {\n if (row[it.attr] && typeof row[it.attr] === 'string' && row[it.attr].includes(';')) {\n line.push(`\"${row[it.attr]}\"`);\n } else {\n line.push(row[it.attr] === undefined || row[it.attr] === null ? '' : row[it.attr]);\n }\n });\n lines.push(line.join(';'));\n });\n const el = document.createElement('a');\n el.setAttribute('href', `data:text/csv;charset=utf-8,${encodeURIComponent(lines.join('\\n'))}`);\n const now = new Date();\n el.setAttribute(\n 'download',\n `${now.getFullYear()}_${(now.getMonth() + 1).toString().padStart(2, '0')}_${now.getDate().toString().padStart(2, '0')}_${this.props.oContext.adapterName}.${this.props.oContext.instance}_${this.props.attr}.csv`,\n );\n\n el.style.display = 'none';\n document.body.appendChild(el);\n\n el.click();\n\n document.body.removeChild(el);\n }\n\n onImport(text: string): void {\n const lines = text.split('\\n').map((line: string) => line.replace('\\r', '').trim());\n // the first line is header\n const { schema } = this.props;\n\n const header = lines\n .shift()\n .split(';')\n .filter(it => it && schema.items.find((it2: ConfigItemTableIndexed) => it2.attr === it));\n\n const values: Record<string, any>[] = [];\n lines.forEach((line: string) => {\n const parts: string[] = line.split(';');\n const obj: Record<string, string | number | boolean> = {};\n for (let p = 0; p < parts.length; p++) {\n let value = parts[p];\n if (value.startsWith('\"')) {\n value = value.substring(1);\n while (p < parts.length && !value.endsWith('\"')) {\n value += `;${parts[++p]}`;\n }\n value = value.substring(0, value.length - 1);\n }\n\n let val: string | number | boolean = value;\n\n if (value === 'true') {\n val = true;\n } else if (value === 'false') {\n val = false;\n } else if (window.isFinite(value as any as number)) {\n const attr = this.props.schema.items.find((it: ConfigItemTableIndexed) => it.attr === header[p]);\n if (attr && attr.type === 'number') {\n // if a type of attribute is a \"number\"\n val = parseFloat(value);\n } else {\n val = value;\n }\n } else {\n val = value;\n }\n\n obj[header[p]] = val;\n }\n values.push(obj);\n });\n\n if (values.length) {\n if (this.state.value?.length) {\n this.setState({ showTypeOfImportDialog: values, showImportDialog: false });\n } else {\n this.setState({ value: values, showImportDialog: false });\n }\n } else {\n window.alert('ra_No data found in file');\n }\n }\n\n onClone = (index: number) => (): void => {\n const newValue: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n const cloned: Record<string, any> = JSON.parse(JSON.stringify(newValue[index]));\n if (typeof this.props.schema.clone === 'string' && typeof cloned[this.props.schema.clone] === 'string') {\n let i = 1;\n let text = cloned[this.props.schema.clone];\n const pattern = text.match(/(\\d+)$/);\n if (pattern) {\n text = text.replace(pattern[0], '');\n i = parseInt(pattern[0], 10) + 1;\n } else {\n text += '_';\n }\n while (\n newValue.find(\n (it: Record<string, any>) => it[this.props.schema.clone as string] === text + i.toString(),\n )\n ) {\n i++;\n }\n cloned[this.props.schema.clone] = `${cloned[this.props.schema.clone]}_${i}`;\n }\n\n newValue.splice(index, 0, cloned);\n\n this.setState({ value: newValue, iteration: this.state.iteration + 10000 }, () =>\n this.applyFilter(false, null, () => this.onChangeWrapper(newValue)),\n );\n };\n\n onChangeWrapper = (newValue: Record<string, any>[], updateVisible?: boolean): void => {\n if (this.typingTimer) {\n clearTimeout(this.typingTimer);\n }\n\n this.typingTimer = setTimeout(\n (value, _updateVisible) => {\n this.typingTimer = null;\n\n let mayBePromise: Promise<void> | void;\n if (this.props.schema.encryptedAttributes) {\n const _value = JSON.parse(JSON.stringify(value));\n _value.forEach((el: Record<string, any>) => {\n this.props.schema.encryptedAttributes.forEach((attr: string) => {\n if (el[attr]) {\n el[attr] = encrypt(this.secret, el[attr]);\n }\n });\n });\n\n if (this.props.schema.objKeyName) {\n const objValue = arrayToObject(\n _value,\n this.props.schema.objKeyName,\n this.props.schema.objValueName,\n );\n mayBePromise = this.onChange(this.props.attr, objValue);\n } else {\n mayBePromise = this.onChange(this.props.attr, _value);\n }\n } else if (this.props.schema.objKeyName) {\n const objValue = arrayToObject(\n JSON.parse(JSON.stringify(value)),\n this.props.schema.objKeyName,\n this.props.schema.objValueName,\n );\n mayBePromise = this.onChange(this.props.attr, objValue);\n } else {\n mayBePromise = this.onChange(this.props.attr, value);\n }\n if (mayBePromise instanceof Promise) {\n mayBePromise.catch(e => console.error(`Cannot save: ${e}`));\n }\n if (_updateVisible) {\n this.applyFilter(false, value);\n this.handleRequestSort(this.state.orderBy, true);\n }\n },\n 300,\n newValue,\n updateVisible,\n );\n };\n\n onAdd = (): void => {\n const { schema } = this.props;\n const newValue: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n const newItem = schema.items?.reduce(\n (accumulator: Record<string, any>, currentValue: ConfigItemTableIndexed) => {\n let defaultValue;\n if (currentValue.defaultFunc) {\n if (this.props.custom) {\n defaultValue = currentValue.defaultFunc\n ? this.executeCustom(\n currentValue.defaultFunc,\n this.props.data,\n this.props.customObj,\n this.props.oContext.instanceObj,\n newValue.length,\n this.props.data,\n )\n : this.props.schema.default;\n } else {\n defaultValue = currentValue.defaultFunc\n ? this.execute(\n currentValue.defaultFunc,\n this.props.schema.default,\n this.props.data,\n newValue.length,\n this.props.data,\n )\n : this.props.schema.default;\n }\n } else {\n defaultValue = currentValue.default === undefined ? null : currentValue.default;\n }\n\n accumulator[currentValue.attr] = defaultValue;\n return accumulator;\n },\n {},\n );\n\n newValue.push(newItem);\n\n this.setState({ value: newValue }, () => this.applyFilter(false, null, () => this.onChangeWrapper(newValue)));\n };\n\n isAnyFilterSet(): boolean {\n return !!Object.keys(this.filterRefs).find(attr => ConfigTable.getFilterValue(this.filterRefs[attr]));\n }\n\n applyFilter = (clear?: boolean, value?: Record<string, any>[], cb?: () => void): void => {\n value = value || this.state.value;\n let visibleValue = value.map((_, i) => i);\n Object.keys(this.filterRefs).forEach(attr => {\n let valueInputRef = ConfigTable.getFilterValue(this.filterRefs[attr]);\n if (!clear && valueInputRef) {\n valueInputRef = valueInputRef.toLowerCase();\n visibleValue = visibleValue.filter(\n idx => value[idx] && value[idx][attr] && value[idx][attr].toLowerCase().includes(valueInputRef),\n );\n } else if (this.filterRefs[attr].current) {\n ConfigTable.setFilterValue(this.filterRefs[attr], '');\n }\n });\n\n if (visibleValue.length === value.length) {\n visibleValue = null;\n }\n\n if (visibleValue === null && this.state.visibleValue === null) {\n if (cb) {\n cb();\n }\n return;\n }\n\n if (JSON.stringify(visibleValue) !== JSON.stringify(this.state.visibleValue)) {\n this.setState({ visibleValue }, () => cb && cb());\n } else if (cb) {\n cb();\n }\n };\n\n onMoveUp(idx: number): void {\n const newValue: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n const item = newValue[idx];\n newValue.splice(idx, 1);\n newValue.splice(idx - 1, 0, item);\n this.setState({ value: newValue, iteration: this.state.iteration + 10000 }, () =>\n this.applyFilter(false, null, () => this.onChangeWrapper(newValue)),\n );\n }\n\n onMoveDown(idx: number): void {\n const newValue: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n const item = newValue[idx];\n newValue.splice(idx, 1);\n newValue.splice(idx + 1, 0, item);\n this.setState({ value: newValue, iteration: this.state.iteration + 10000 }, () =>\n this.applyFilter(false, null, () => this.onChangeWrapper(newValue)),\n );\n }\n\n onDrop(acceptedFiles: File[]): void {\n const file = acceptedFiles[0];\n const reader = new FileReader();\n\n reader.onabort = () => console.log('file reading was aborted');\n reader.onerror = () => console.log('file reading has failed');\n reader.onload = () => {\n if (file.size > MAX_SIZE) {\n window.alert(I18n.t('ra_File is too big. Max %sk allowed. Try use SVG.', Math.round(MAX_SIZE / 1024)));\n return;\n }\n const text = new Uint8Array(reader.result as ArrayBufferLike).reduce(\n (data, byte) => data + String.fromCharCode(byte),\n '',\n );\n\n this.onImport(text);\n };\n reader.readAsArrayBuffer(file);\n }\n\n showTypeOfImportDialog(): JSX.Element | null {\n if (!this.state.showTypeOfImportDialog) {\n return null;\n }\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showTypeOfImportDialog: false })}\n maxWidth=\"md\"\n >\n <DialogTitle>{I18n.t('ra_Append or replace?')}</DialogTitle>\n <DialogContent>\n {I18n.t('ra_Append %s entries or replace existing?', this.state.showTypeOfImportDialog.length)}\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n autoFocus\n onClick={() => {\n const value: Record<string, any>[] = JSON.parse(JSON.stringify(this.state.value));\n\n (this.state.showTypeOfImportDialog as Record<string, any>[]).forEach(\n (obj: Record<string, any>) => value.push(obj),\n );\n\n this.setState(\n {\n value,\n iteration: this.state.iteration + 10000,\n showTypeOfImportDialog: false,\n },\n () => this.applyFilter(false, null, () => this.onChangeWrapper(value)),\n );\n }}\n >\n {I18n.t('ra_Append')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n autoFocus\n onClick={() => {\n const value: Record<string, any>[] = this.state.showTypeOfImportDialog as Record<\n string,\n any\n >[];\n this.setState(\n {\n value,\n iteration: this.state.iteration + 10000,\n showTypeOfImportDialog: false,\n },\n () => this.applyFilter(false, null, () => this.onChangeWrapper(value)),\n );\n }}\n >\n {I18n.t('ra_Replace')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n showImportDialog(): JSX.Element | null {\n if (!this.state.showImportDialog) {\n return null;\n }\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showImportDialog: false })}\n sx={{\n '& .MuiDialog-paper': {\n minHeight: 500,\n },\n }}\n maxWidth=\"md\"\n fullWidth\n >\n <DialogTitle>{I18n.t('ra_Import from %s', 'CSV')}</DialogTitle>\n <DialogContent>\n <Dropzone\n multiple={false}\n accept={{ 'text/csv': ['.csv'] }}\n maxSize={MAX_SIZE}\n onDragEnter={() => this.setState({ uploadFile: 'dragging' })}\n onDragLeave={() => this.setState({ uploadFile: true })}\n onDrop={(acceptedFiles, errors) => {\n this.setState({ uploadFile: false });\n if (!acceptedFiles.length) {\n window.alert(\n (errors &&\n errors[0] &&\n errors[0].errors &&\n errors[0].errors[0] &&\n errors[0].errors[0].message) ||\n I18n.t('ra_Cannot upload'),\n );\n } else {\n this.onDrop(acceptedFiles);\n }\n }}\n >\n {({ getRootProps, getInputProps }) => (\n <div\n style={{\n ...styles.uploadDiv,\n ...(this.state.uploadFile === 'dragging' ? styles.uploadDivDragging : undefined),\n ...styles.dropZone,\n ...(!this.state.icon ? styles.dropZoneEmpty : undefined),\n }}\n {...getRootProps()}\n >\n <input {...getInputProps()} />\n <div style={styles.uploadCenterDiv}>\n <div style={styles.uploadCenterTextAndIcon}>\n <ImportIcon style={styles.uploadCenterIcon} />\n <div style={styles.uploadCenterText}>\n {this.state.uploadFile === 'dragging'\n ? I18n.t('ra_Drop file here')\n : I18n.t(\n 'ra_Place your files here or click here to open the browse dialog',\n )}\n </div>\n </div>\n </div>\n </div>\n )}\n </Dropzone>\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n onClick={() => this.setState({ showImportDialog: false })}\n color=\"primary\"\n startIcon={<IconClose />}\n >\n {I18n.t('Cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderOneFilter(props: {\n schema: ConfigItemTable;\n doAnyFilterSet: boolean;\n headCell: ConfigItemTableIndexed;\n index: number;\n orderBy: string;\n order: 'asc' | 'desc';\n showAddButton: boolean;\n style: React.CSSProperties;\n }): React.JSX.Element {\n return (\n <TableCell\n key={`${props.headCell.attr}_${props.index}`}\n style={props.style}\n align=\"left\"\n sortDirection={props.orderBy === props.headCell.attr ? props.order : false}\n >\n <div\n style={{\n ...styles.flex,\n ...(props.schema.showFirstAddOnTop ? { flexDirection: 'column' } : undefined),\n }}\n >\n {props.showAddButton ? this.renderAddButton(props.doAnyFilterSet) : null}\n {props.headCell.sort && (\n <TableSortLabel\n active\n style={props.orderBy !== props.headCell.attr ? styles.silver : undefined}\n direction={props.orderBy === props.headCell.attr ? props.order : 'asc'}\n onClick={() => this.handleRequestSort(props.headCell.attr)}\n />\n )}\n {props.headCell.filter && this.state.filterOn.includes(props.headCell.attr) ? (\n <TextField\n variant=\"standard\"\n ref={this.filterRefs[props.headCell.attr]}\n onChange={() => this.applyFilter()}\n title={I18n.t('ra_You can filter entries by entering here some text')}\n slotProps={{\n input: {\n endAdornment: ConfigTable.getFilterValue(this.filterRefs[props.headCell.attr]) && (\n <InputAdornment position=\"end\">\n <IconButton\n size=\"small\"\n tabIndex={-1}\n onClick={() => {\n ConfigTable.setFilterValue(\n this.filterRefs[props.headCell.attr],\n '',\n );\n this.applyFilter();\n }}\n >\n <CloseIcon />\n </IconButton>\n </InputAdornment>\n ),\n },\n }}\n fullWidth\n placeholder={this.getText(props.headCell.title)}\n />\n ) : (\n <span style={styles.headerText}>{this.getText(props.headCell.title)}</span>\n )}\n {this.renderShowHideFilter(props.headCell)}\n </div>\n </TableCell>\n );\n }\n\n enhancedFilterCard(): JSX.Element {\n const { schema } = this.props;\n const { order, orderBy } = this.state;\n let tdStyle: React.CSSProperties | undefined;\n if (this.props.schema.compact) {\n tdStyle = { paddingTop: 1, paddingBottom: 1 };\n }\n\n const importExportVisible = (!schema.noDelete && schema.import) || schema.export;\n\n if (importExportVisible || schema.items.find(item => item.sort || item.filter)) {\n return (\n <Grid2\n size={{\n xs: schema.xs || 12, // if xs is not defined, take the full width\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n >\n <Card>\n <Paper style={styles.paper}>\n <Accordion style={styles.paper}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>{I18n.t('ra_Filter and Data Actions')}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Table>\n <TableBody>\n {schema.items?.find(item => item.sort || item.filter) &&\n schema.items.map(\n (\n headCell: ConfigItemTableIndexed,\n i: number,\n ): React.JSX.Element => (\n <TableRow key={`${headCell.attr}_${i}`}>\n {this.renderOneFilter({\n schema,\n style: tdStyle,\n showAddButton: false,\n headCell,\n order,\n orderBy,\n index: i,\n doAnyFilterSet: false,\n })}\n </TableRow>\n ),\n )}\n {importExportVisible ? (\n <TableRow>\n <TableCell\n align=\"left\"\n style={tdStyle}\n >\n <span style={styles.headerText}>{I18n.t('ra_Actions')}</span>\n </TableCell>\n <TableCell style={tdStyle}>\n {this.renderImportExportButtons(schema)}\n </TableCell>\n </TableRow>\n ) : null}\n </TableBody>\n </Table>\n </AccordionDetails>\n </Accordion>\n </Paper>\n </Card>\n </Grid2>\n );\n }\n\n return null;\n }\n\n enhancedBottomCard(): JSX.Element {\n const { schema } = this.props;\n let tdStyle: React.CSSProperties | undefined;\n if (this.props.schema.compact) {\n tdStyle = { paddingTop: 1, paddingBottom: 1 };\n }\n const doAnyFilterSet = this.isAnyFilterSet();\n return (\n <Grid2\n size={{\n xs: schema.xs || 12, // if xs is not defined, take the full width\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n >\n <Card>\n <Paper style={styles.paper}>\n <Table>\n <TableBody>\n <TableRow>\n <TableCell\n colSpan={schema.items.length + 1}\n style={tdStyle}\n >\n {this.renderAddButton(doAnyFilterSet)}\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </Paper>\n </Card>\n </Grid2>\n );\n }\n\n renderCards(): JSX.Element | null {\n const { schema } = this.props;\n let { visibleValue } = this.state;\n let tdStyle: React.CSSProperties | undefined;\n if (this.props.schema.compact) {\n tdStyle = { paddingTop: 1, paddingBottom: 1 };\n }\n const tdStyleHidden = { padding: 0, borderBottom: 'none' };\n visibleValue ||= this.state.value.map((_, i) => i);\n\n const doAnyFilterSet = this.isAnyFilterSet();\n\n return (\n <Grid2 container>\n {this.showImportDialog()}\n {this.showTypeOfImportDialog()}\n {this.enhancedFilterCard()}\n {visibleValue.map((idx, i) => (\n <Grid2\n key={`${idx}_${i}`}\n size={{\n xs: schema.xs || 12, // if xs is not defined, take the full width\n sm: schema.sm || undefined,\n md: schema.md || undefined,\n lg: schema.lg || undefined,\n xl: schema.xl || undefined,\n }}\n >\n <Card>\n <Paper style={styles.paper}>\n {this.props.schema.titleAttribute ? (\n <Box sx={styles.cardHeader}>\n <div>{this.state.value[idx][this.props.schema.titleAttribute]}</div>\n <div>\n {!doAnyFilterSet && !this.state.orderBy ? (\n <Tooltip\n title={I18n.t('ra_Move up')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <span>\n <IconButton\n size=\"small\"\n onClick={() => this.onMoveUp(idx)}\n disabled={i === 0}\n >\n <UpIcon />\n </IconButton>\n </span>\n </Tooltip>\n ) : null}\n {!doAnyFilterSet && !this.state.orderBy ? (\n <Tooltip\n title={I18n.t('ra_Move down')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <span>\n <IconButton\n size=\"small\"\n onClick={() => this.onMoveDown(idx)}\n disabled={i === visibleValue.length - 1}\n >\n <DownIcon />\n </IconButton>\n </span>\n </Tooltip>\n ) : null}\n <Tooltip\n title={I18n.t('ra_Delete current row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={this.onDelete(idx)}\n >\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n {this.props.schema.clone ? (\n <Tooltip\n title={I18n.t('ra_Clone current row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={this.onClone(idx)}\n >\n <CopyContentIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n <Tooltip\n title={I18n.t('ra_Expand/Collapse card')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={() => {\n const collapsed = [...this.state.collapsed];\n const pos = collapsed.indexOf(idx);\n if (pos === -1) {\n collapsed.push(idx);\n } else {\n collapsed.splice(pos, 1);\n }\n window.localStorage.setItem(\n `table.collapsed.${this.props.oContext.instance}.${this.props.attr}`,\n JSON.stringify(collapsed),\n );\n this.setState({ collapsed });\n }}\n >\n <ExpandMoreIcon\n style={{\n rotate: this.state.collapsed?.includes(idx)\n ? '0deg'\n : '180deg',\n transition: '0.3s',\n transitionProperty: 'rotate',\n }}\n />\n </IconButton>\n </Tooltip>\n </div>\n </Box>\n ) : null}\n <Collapse\n in={!this.state.collapsed?.includes(idx)}\n timeout=\"auto\"\n unmountOnExit\n >\n <Table>\n <TableBody>\n {schema.items?.map((headCell: ConfigItemTableIndexed) => {\n const hidden = this.listOfHiddenElements?.[idx]?.includes(\n headCell.attr,\n );\n return (\n <TableRow key={`${headCell.attr}_${idx}`}>\n <TableCell\n align=\"left\"\n style={hidden ? tdStyleHidden : tdStyle}\n >\n {hidden ? null : (\n <span style={styles.headerText}>\n {this.getText(headCell.title)}\n </span>\n )}\n </TableCell>\n <TableCell\n align=\"left\"\n style={hidden ? tdStyleHidden : tdStyle}\n >\n {this.itemTable(\n headCell.attr,\n this.state.value[idx],\n idx,\n true,\n )}\n </TableCell>\n </TableRow>\n );\n })}\n {!this.props.schema.titleAttribute && !schema.noDelete && (\n <TableRow>\n <TableCell\n align=\"left\"\n style={tdStyle}\n >\n <span style={styles.headerText}>{this.getText('Actions')}</span>\n </TableCell>\n <TableCell\n align=\"left\"\n style={tdStyle}\n >\n {!doAnyFilterSet && !this.state.orderBy ? (\n <Tooltip\n title={I18n.t('ra_Move up')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <span>\n <IconButton\n size=\"small\"\n onClick={() => this.onMoveUp(idx)}\n disabled={i === 0}\n >\n <UpIcon />\n </IconButton>\n </span>\n </Tooltip>\n ) : null}\n {!doAnyFilterSet && !this.state.orderBy ? (\n <Tooltip\n title={I18n.t('ra_Move down')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <span>\n <IconButton\n size=\"small\"\n onClick={() => this.onMoveDown(idx)}\n disabled={i === visibleValue.length - 1}\n >\n <DownIcon />\n </IconButton>\n </span>\n </Tooltip>\n ) : null}\n <Tooltip\n title={I18n.t('ra_Delete current row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={this.onDelete(idx)}\n >\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n {this.props.schema.clone ? (\n <Tooltip\n title={I18n.t('ra_Clone current row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={this.onClone(idx)}\n >\n <CopyContentIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </Collapse>\n </Paper>\n </Card>\n </Grid2>\n ))}\n {this.enhancedBottomCard()}\n </Grid2>\n );\n }\n\n renderTable(): JSX.Element | null {\n const { schema } = this.props;\n let { visibleValue } = this.state;\n\n visibleValue = visibleValue || this.state.value.map((_, i) => i);\n\n const doAnyFilterSet = this.isAnyFilterSet();\n\n let tdStyle: React.CSSProperties | undefined;\n if (this.props.schema.compact) {\n tdStyle = { paddingTop: 1, paddingBottom: 1 };\n }\n\n return (\n <Paper style={styles.paper}>\n {this.showImportDialog()}\n {this.showTypeOfImportDialog()}\n {schema.label ? (\n <div style={styles.label}>\n <Toolbar\n variant=\"dense\"\n style={styles.rootTool}\n >\n <Typography\n style={styles.title}\n variant=\"h6\"\n id=\"tableTitle\"\n component=\"div\"\n >\n {this.getText(schema.label)}\n </Typography>\n </Toolbar>\n </div>\n ) : null}\n <TableContainer>\n <Table\n style={styles.table}\n size=\"small\"\n >\n {this.enhancedTableHead(!doAnyFilterSet && !this.state.orderBy ? 120 : 64, doAnyFilterSet)}\n <TableBody>\n {visibleValue.map((idx, i) => (\n <TableRow\n hover\n key={`${idx}_${i}`}\n >\n {schema.items?.map((headCell: ConfigItemTableIndexed) => (\n <TableCell\n key={`${headCell.attr}_${idx}`}\n align=\"left\"\n style={tdStyle}\n >\n {this.itemTable(headCell.attr, this.state.value[idx], idx, false)}\n </TableCell>\n ))}\n {!schema.noDelete && (\n <TableCell\n align=\"left\"\n style={{ ...tdStyle, ...styles.buttonCell }}\n >\n {!doAnyFilterSet && !this.state.orderBy ? (\n i ? (\n <Tooltip\n title={I18n.t('ra_Move up')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={() => this.onMoveUp(idx)}\n >\n <UpIcon />\n </IconButton>\n </Tooltip>\n ) : (\n <div style={styles.buttonEmpty} />\n )\n ) : null}\n {!doAnyFilterSet && !this.state.orderBy ? (\n i < visibleValue.length - 1 ? (\n <Tooltip\n title={I18n.t('ra_Move down')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={() => this.onMoveDown(idx)}\n >\n <DownIcon />\n </IconButton>\n </Tooltip>\n ) : (\n <div style={styles.buttonEmpty} />\n )\n ) : null}\n <Tooltip\n title={I18n.t('ra_Delete current row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={this.onDelete(idx)}\n >\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n {this.props.schema.clone ? (\n <Tooltip\n title={I18n.t('ra_Clone current row')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <IconButton\n size=\"small\"\n onClick={this.onClone(idx)}\n >\n <CopyContentIcon />\n </IconButton>\n </Tooltip>\n ) : null}\n </TableCell>\n )}\n </TableRow>\n ))}\n {!schema.noDelete && visibleValue.length >= (schema.showSecondAddAt || 5) ? (\n <TableRow>\n <TableCell\n colSpan={schema.items.length + 1}\n style={{ ...tdStyle }}\n >\n {this.renderAddButton(doAnyFilterSet)}\n </TableCell>\n </TableRow>\n ) : null}\n </TableBody>\n </Table>\n {!visibleValue.length && this.state.value.length ? (\n <div style={styles.filteredOut}>\n <Typography\n style={styles.title}\n variant=\"h6\"\n id=\"tableTitle\"\n component=\"div\"\n >\n {I18n.t('ra_All items are filtered out')}\n <IconButton\n size=\"small\"\n onClick={() => this.applyFilter(true)}\n >\n <CloseIcon />\n </IconButton>\n </Typography>\n </div>\n ) : null}\n </TableContainer>\n {schema.help ? (\n <FormHelperText style={{ paddingLeft: 16 }}>\n {this.renderHelp(\n this.props.schema.help,\n this.props.schema.helpLink,\n this.props.schema.noTranslation,\n )}\n </FormHelperText>\n ) : null}\n {this.state.errorMessage ? (\n <div style={{ display: 'flex', padding: '5px' }}>\n <ErrorIcon color=\"error\" />\n <span style={{ color: 'red', alignSelf: 'center' }}>{this.state.errorMessage}</span>\n </div>\n ) : null}\n </Paper>\n );\n }\n\n componentDidUpdate(): void {\n if (this.refDiv.current?.clientWidth && this.refDiv.current.clientWidth !== this.state.width) {\n if (this.resizeTimeout) {\n clearTimeout(this.resizeTimeout);\n }\n this.resizeTimeout = setTimeout(() => {\n this.resizeTimeout = null;\n this.setState({ width: this.refDiv.current?.clientWidth });\n }, 50);\n }\n }\n\n getCurrentBreakpoint(): 'xs' | 'sm' | 'md' | 'lg' | 'xl' {\n if (!this.state.width) {\n return 'md';\n }\n if (this.state.width < 600) {\n return 'xs';\n }\n if (this.state.width < 900) {\n return 'sm';\n }\n if (this.state.width < 1200) {\n return 'md';\n }\n if (this.state.width < 1536) {\n return 'lg';\n }\n return 'xl';\n }\n\n renderItem(/* error, disabled, defaultValue */): JSX.Element | null {\n const { schema } = this.props;\n\n if (!this.state.value || !Array.isArray(this.state.value)) {\n return null;\n }\n\n const currentBreakpoint = this.getCurrentBreakpoint();\n let content: React.JSX.Element;\n\n if (currentBreakpoint && (schema.useCardFor || ['xs']).includes(currentBreakpoint)) {\n content = this.renderCards();\n } else {\n content = this.renderTable();\n }\n\n return (\n <div\n ref={this.refDiv}\n style={{ width: '100%' }}\n >\n {content}\n </div>\n );\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/json-config",
|
|
3
3
|
"description": "This package contains the ioBroker JSON config UI components",
|
|
4
|
-
"version": "8.1.
|
|
4
|
+
"version": "8.1.9",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "bluefox",
|
|
7
7
|
"email": "dogafox@gmail.com"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@iobroker/adapter-react-v5": "^8.0.
|
|
38
|
+
"@iobroker/adapter-react-v5": "^8.0.21",
|
|
39
39
|
"@module-federation/runtime": "^2.0.0",
|
|
40
40
|
"@mui/x-date-pickers": "^7.29.4",
|
|
41
41
|
"crypto-js": "^4.2.0",
|