@iobroker/json-config 8.1.8 → 8.1.10

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
@@ -143,7 +143,7 @@ You can install it via GitHub icon in admin by entering `iobroker.jsonconfig-dem
143
143
  - [**`checkLicense`:**](#checklicense) Very special component to check the license online
144
144
  - [**`chips`:**](#chips) User can enter words that are added to an array
145
145
  - [**`color`:**](#color) Color picker
146
- - [**`coordinates`:**](#coordinates) Determines current location and used `system.config` coordinates if not possible in form "latitude,longitude"
146
+ - [**`coordinates`:**](#coordinates) Determines current location and used `system.config` coordinates if not possible in form `latitude,longitude`
147
147
  - [**`cron`:**](#cron) Configures cron expressions for scheduling tasks
148
148
  - [**`custom`:**](#custom) Integrates custom components for specific functionalities (Admin 6 only)
149
149
  - [**`datePicker`:**](#datepicker) Allows users to select a date
@@ -572,7 +572,7 @@ object ID: show it with name, color and icon
572
572
 
573
573
  `{common: {custom: '_dataSources'}}`
574
574
 
575
- ##### show only objects of custom settings for specific adapter (all instances)
575
+ ##### show only objects of custom settings for a specific adapter (all instances)
576
576
 
577
577
  `{common: {custom: 'adapterName.'}}`
578
578
 
@@ -648,7 +648,7 @@ Just text: Instance is running, Instance is not running
648
648
 
649
649
  ### `pattern`
650
650
 
651
- read-only field with pattern like 'https://${data.ip}:${data.port}' (will not be saved in config)
651
+ The read-only field with a pattern like 'https://${data.ip}:${data.port}' (will not be saved in config)
652
652
  Text input with the read-only flag, that shows a pattern.
653
653
 
654
654
  | Property | Description |
@@ -658,7 +658,7 @@ Text input with the read-only flag, that shows a pattern.
658
658
 
659
659
  ### `sendTo`
660
660
 
661
- button that sends request to instance (<https://github.com/iobroker-community-adapters/ioBroker.email/blob/master/admin/index_m.html#L128>)
661
+ Button that sends a request to the current instance (<https://github.com/iobroker-community-adapters/ioBroker.email/blob/master/admin/index_m.html#L128>)
662
662
 
663
663
  | Property | Description |
664
664
  |-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -876,7 +876,7 @@ Shows CRON settings. You have 3 options:
876
876
  | `simple` | show simple CRON settings |
877
877
 
878
878
  ### `fileSelector`
879
- Select a file from one folder as drop down menu. And if you want you can upload a new file to this folder.
879
+ Select a file from one folder as a drop-down menu. And if you want, you can upload a new file to this folder.
880
880
 
881
881
  only Admin6
882
882
 
@@ -1079,7 +1079,7 @@ Shows autocomplete control with the given from the instance values.
1079
1079
  | `alsoDependsOn` | by change of which attributes, the command must be resent |
1080
1080
  | `maxLength` | max length of the text in field |
1081
1081
 
1082
- To use this option, your adapter must implement message handler:
1082
+ To use this option, your adapter must implement a message handler:
1083
1083
 
1084
1084
  The result of command must be an array in form `["value1", {"value": "value2", "label": "Value2"}, ...]` (keys and names (values) must be unique)
1085
1085
  See `selectSendTo` for handler example
@@ -1104,7 +1104,7 @@ The result of command must be a string or object with the following parameters:
1104
1104
  {
1105
1105
  text: "text to show", // mandatory
1106
1106
  style: { color: "red" }, // optional
1107
- icon: "search", // optional. It could be base64 or link to image in the same folder as jsonConfig.json file
1107
+ icon: "search", // optional. It could be base64 or link to an image in the same folder as jsonConfig.json file
1108
1108
  // possible predefined names: edit, rename, delete, refresh, add, search, unpair, pair, identify, play, stop, pause, forward, backward, next, previous, lamp, backlight, dimmer, socket, settings, group, user, qrcode, connection, no-connection, visible
1109
1109
  iconStyle: { width: 30 }, // optional
1110
1110
  }
@@ -1153,7 +1153,7 @@ adapter.on("message", (obj) => {
1153
1153
 
1154
1154
  ### `coordinates`
1155
1155
 
1156
- Determines current location and used `system.config` coordinates if not possible in form "latitude,longitude"
1156
+ Determines current location and used `system.config` coordinates if not possible in form `latitude,longitude`
1157
1157
 
1158
1158
  | Property | Description |
1159
1159
  |-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -1174,7 +1174,7 @@ Select the interface of the host, where the instance runs
1174
1174
 
1175
1175
  ### `license`
1176
1176
 
1177
- shows the license information if not already accepted. One of attributes `texts` or `licenseUrl` must be defined. When the license is accepted, the defined configuration attribute will be set to `true`.
1177
+ It shows the license information if not already accepted. One of attributes `texts` or `licenseUrl` must be defined. When the license is accepted, the defined configuration attribute will be set to `true`.
1178
1178
 
1179
1179
  | Property | Description |
1180
1180
  |--------------|------------------------------------------------------------------------------------------------------------|
@@ -1209,7 +1209,7 @@ Show iobroker UUID
1209
1209
 
1210
1210
  ### `port`
1211
1211
 
1212
- Special input for ports. It checks automatically if port is used by other instances and shows a warning
1212
+ Special input for ports. It checks automatically if the port is used by other instances and shows a warning
1213
1213
 
1214
1214
  | Property | Description |
1215
1215
  |----------|-------------------------------------------------------------------------------------------------------------------------------|
@@ -1290,7 +1290,7 @@ Shows closable static text with optional title and icon. (From admin >= 7.6.19)
1290
1290
 
1291
1291
  show device manager. For that, the adapter must support device manager protocol. See iobroker/dm-utils.
1292
1292
 
1293
- Here is an example of how to show device manager in a tab:
1293
+ Here is an example of how to show the device manager in a tab:
1294
1294
 
1295
1295
  ```json5
1296
1296
  {
@@ -1331,7 +1331,7 @@ These options are used to define the width of elements on different screen sizes
1331
1331
 
1332
1332
  Valid numbers are 1 to 12.
1333
1333
 
1334
- If you specify a number, for example 6, then the width of the element will be 6/12 (50%) of the screen width or for example 3, then the width of the element will be 3/12 (25%) of the screen width.
1334
+ If you specify a number, for example, 6, then the width of the element will be 6/12 (50%) of the screen width or, for example, 3, then the width of the element will be 3/12 (25%) of the screen width.
1335
1335
  Assign numbers to the different layout options specify the width of the element for the different screen sizes.
1336
1336
 
1337
1337
  | option | description |
@@ -1442,7 +1442,7 @@ Example:
1442
1442
  In this case input must be text, where shown `__different__`, with the autocomplete option of three possible values.
1443
1443
  Users can select from dropdown 1000, 2000 or 3000 or input their own new value, e.g., 500.
1444
1444
 
1445
- Boolean must support indeterminate if value is [false, true]
1445
+ Boolean must support indeterminate if a value is [false, true]
1446
1446
 
1447
1447
  For non changed `__different__` the value different must be returned:
1448
1448
 
@@ -1520,7 +1520,7 @@ If the `alive` status changes, so all fields must be updated, validated, disable
1520
1520
 
1521
1521
  The following variables are available in JS function in adapter settings:
1522
1522
 
1523
- - `data` - native settings for this instance or current line in the table (to access all settings use globalData)
1523
+ - `data` - native settings for this instance or current line in the table (to access all settings, use globalData)
1524
1524
  - `_system` - system configuration
1525
1525
  - `_alive` - is instance being alive
1526
1526
  - `_common` - common settings for this instance
@@ -1560,7 +1560,7 @@ const isValid = func(
1560
1560
 
1561
1561
  The following variables are available in JS function in custom settings:
1562
1562
 
1563
- - `data` - current custom settings or current line in the table (to access all settings use globalData)
1563
+ - `data` - current custom settings or current line in the table (to access all settings, use globalData)
1564
1564
  - `originalData` - Unchanged data
1565
1565
  - `_system` - system configuration
1566
1566
  - `instanceObj` - adapter instance object
@@ -1677,12 +1677,15 @@ 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.8 (2026-02-10)
1680
+ ### 8.1.10 (2026-02-12)
1681
+ - (@GermanBluefox) Added the copy-to-clipboard dialog for `sendTo`
1682
+
1683
+ ### 8.1.9 (2026-02-10)
1681
1684
  - (@GermanBluefox) Hiding the whole line in the table if shown as card and the line is empty
1682
- - (@GermanBluefox) Added the header to table in the card mode
1685
+ - (@GermanBluefox) Added the header to the table in the card mode
1683
1686
 
1684
1687
  ### 8.1.3 (2026-02-09)
1685
- - (@GermanBluefox) Added component `yamlEditor` for editing yaml files in admin
1688
+ - (@GermanBluefox) Added component `yamlEditor` for editing YAML files in admin
1686
1689
 
1687
1690
  ### 8.1.1 (2026-02-06)
1688
1691
  - (@GermanBluefox) Added `iframe` and `iframeSendTo` components
@@ -7,15 +7,21 @@ interface ConfigSendToProps extends ConfigGenericProps {
7
7
  interface ConfigSendToState extends ConfigGenericState {
8
8
  _error: string;
9
9
  _message: string;
10
+ _copyDialog: {
11
+ text: string;
12
+ title?: ioBroker.StringOrTranslated;
13
+ type?: 'json' | 'css' | 'html' | 'json5' | 'yaml';
14
+ };
10
15
  hostname: string;
11
16
  running?: boolean;
12
17
  }
13
- declare class ConfigSendto extends ConfigGeneric<ConfigSendToProps, ConfigSendToState> {
18
+ export default class ConfigSendto extends ConfigGeneric<ConfigSendToProps, ConfigSendToState> {
14
19
  componentDidMount(): Promise<void>;
15
20
  renderErrorDialog(): JSX.Element | null;
16
21
  renderMessageDialog(): JSX.Element | null;
22
+ renderCopyDialog(): JSX.Element | null;
17
23
  _onClick(): void;
18
24
  renderDialogConfirm(): JSX.Element | null;
19
25
  renderItem(error: Error | undefined, disabled: boolean): JSX.Element;
20
26
  }
21
- export default ConfigSendto;
27
+ export {};
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import { Button, CircularProgress } from '@mui/material';
3
3
  import { Warning as IconWarning, Error as IconError, Info as IconInfo } from '@mui/icons-material';
4
- import { DialogConfirm, DialogError, DialogMessage, I18n } from '@iobroker/adapter-react-v5';
4
+ import { DialogConfirm, DialogError, DialogMessage, I18n, copy } from '@iobroker/adapter-react-v5';
5
5
  import ConfigGeneric from './ConfigGeneric';
6
+ import Editor from './wrapper/Components/Editor';
7
+ import CustomModal from './wrapper/Components/CustomModal';
6
8
  const styles = {
7
9
  fullWidth: {
8
10
  width: '100%',
@@ -110,7 +112,7 @@ function findNetworkAddressOfHost(obj, localIp) {
110
112
  }
111
113
  return hostIp;
112
114
  }
113
- class ConfigSendto extends ConfigGeneric {
115
+ export default class ConfigSendto extends ConfigGeneric {
114
116
  async componentDidMount() {
115
117
  super.componentDidMount();
116
118
  let hostname = window.location.hostname;
@@ -151,6 +153,21 @@ class ConfigSendto extends ConfigGeneric {
151
153
  }
152
154
  return null;
153
155
  }
156
+ renderCopyDialog() {
157
+ if (this.state._copyDialog) {
158
+ return (React.createElement(CustomModal, { title: this.getText(this.state._copyDialog.title || I18n.t('ra_Result')), overflowHidden: true, onClose: () => {
159
+ this.setState({ _copyDialog: null });
160
+ }, onApply: () => {
161
+ // Copy to clipboard
162
+ copy(this.state._copyDialog.text);
163
+ window.alert(I18n.t('ra_Copied to clipboard'));
164
+ this.setState({ _copyDialog: null });
165
+ } },
166
+ React.createElement("div", { style: { width: 'calc(100vw - 40px)', height: 'calc(100vh - 188px)' } },
167
+ React.createElement(Editor, { mode: this.state._copyDialog.type, value: this.state._copyDialog.text, name: "CopyDialog", themeType: this.props.oContext.themeType }))));
168
+ }
169
+ return null;
170
+ }
154
171
  _onClick() {
155
172
  this.props.oContext.onCommandRunning(true);
156
173
  this.setState({ running: true });
@@ -194,7 +211,7 @@ class ConfigSendto extends ConfigGeneric {
194
211
  timeout = undefined;
195
212
  }
196
213
  if (response?.error) {
197
- if (this.props.schema.error && this.props.schema.error[response.error]) {
214
+ if (this.props.schema.error?.[response.error]) {
198
215
  let error = this.getText(this.props.schema.error[response.error]);
199
216
  response.args?.forEach((arg) => (error = error.replace('%s', arg)));
200
217
  this.setState({ _error: error });
@@ -235,6 +252,9 @@ class ConfigSendto extends ConfigGeneric {
235
252
  else if (response?.result) {
236
253
  window.alert(typeof response.result === 'object' ? JSON.stringify(response.result) : response.result);
237
254
  }
255
+ else if (response?.copyDialog) {
256
+ this.setState({ _copyDialog: response.copyDialog });
257
+ }
238
258
  else {
239
259
  window.alert(I18n.t('ra_Ok'));
240
260
  }
@@ -289,8 +309,8 @@ class ConfigSendto extends ConfigGeneric {
289
309
  this.props.schema.showProcess && this.state.running ? (React.createElement(CircularProgress, { size: 20, style: { marginRight: 8 } })) : null,
290
310
  this.getText(this.props.schema.label, this.props.schema.noTranslation)),
291
311
  this.renderErrorDialog(),
292
- this.renderMessageDialog()));
312
+ this.renderMessageDialog(),
313
+ this.renderCopyDialog()));
293
314
  }
294
315
  }
295
- export default ConfigSendto;
296
316
  //# sourceMappingURL=ConfigSendto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigSendto.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigSendto.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAm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AS,EAAE,IAAI,EACf,KAAK,EACD,IAAI,CAAC,KAAK,CAAC,KAAK;oBACZ,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;oBAC7C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,EAE5C,OAAO,EAAE,GAAG,EAAE;oBACV,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBAC5B,IAAI,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC3C,CAAC;yBAAM,CAAC;wBACJ,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACpB,CAAC;gBACL,CAAC;gBAEA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CACnD,oBAAC,gBAAgB,IACb,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,GAC3B,CACL,CAAC,CAAC,CAAC,IAAI;gBACP,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAClE;YACR,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,mBAAmB,EAAE,CACzB,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,YAAY,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { Button, CircularProgress } from '@mui/material';\n\nimport { Warning as IconWarning, Error as IconError, Info as IconInfo } from '@mui/icons-material';\n\nimport { DialogConfirm, DialogError, DialogMessage, I18n } from '@iobroker/adapter-react-v5';\n\nimport type { ConfigItemSendTo } from '../types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\n\nconst styles: Record<string, React.CSSProperties> = {\n fullWidth: {\n width: '100%',\n },\n};\n\nfunction ip2int(ip: string): number {\n return ip.split('.').reduce((ipInt, octet) => (ipInt << 8) + parseInt(octet, 10), 0) >>> 0;\n}\n\n// copied from iobroker.admin/src-rx/src/Utils.js\nfunction findNetworkAddressOfHost(obj: Record<string, any>, localIp: string): string {\n const networkInterfaces = obj?.native?.hardware?.networkInterfaces;\n if (!networkInterfaces) {\n return null;\n }\n\n let hostIp: string | undefined;\n\n // check ipv4 addresses\n Object.keys(networkInterfaces).forEach(inter =>\n networkInterfaces[inter].forEach((ip: Record<string, any>) => {\n if (ip.internal) {\n return;\n }\n if (localIp.includes(':') && ip.family !== 'IPv6') {\n return;\n }\n if (localIp.includes('.') && !localIp.match(/[^.\\d]/) && ip.family !== 'IPv4') {\n return;\n }\n // if ip4 and not docker or wsl\n if (\n ip.family === 'IPv4' &&\n !ip.address.startsWith('172') &&\n (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\\d]/))\n ) {\n // if DNS name\n hostIp = ip.address;\n } else if (!hostIp) {\n if (\n ip.family === 'IPv4' &&\n localIp.includes('.') &&\n (ip2int(localIp) & ip2int(ip.netmask)) === (ip2int(ip.address) & ip2int(ip.netmask))\n ) {\n hostIp = ip.address;\n } else {\n hostIp = ip.address;\n }\n }\n }),\n );\n\n // check ipv6 addresses\n if (!hostIp) {\n Object.keys(networkInterfaces).forEach(inter =>\n networkInterfaces[inter].forEach((ip: Record<string, any>) => {\n if (ip.internal) {\n return;\n }\n if (localIp.includes(':') && ip.family !== 'IPv6') {\n return;\n }\n if (localIp.includes('.') && !localIp.match(/[^.\\d]/) && ip.family !== 'IPv4') {\n return;\n }\n if (\n ip.family === 'IPv6' &&\n (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\\d]/))\n ) {\n // if DNS name\n hostIp = ip.address;\n } else if (!hostIp) {\n if (\n ip.family === 'IPv4' &&\n localIp.includes('.') &&\n (ip2int(localIp) & ip2int(ip.netmask)) === (ip2int(ip.address) & ip2int(ip.netmask))\n ) {\n hostIp = ip.address;\n } else {\n hostIp = ip.address;\n }\n }\n }),\n );\n }\n\n if (!hostIp) {\n Object.keys(networkInterfaces).forEach(inter => {\n networkInterfaces[inter].forEach((ip: Record<string, any>) => {\n if (ip.internal) {\n return;\n }\n if (localIp.includes(':') && ip.family !== 'IPv6') {\n return;\n }\n if (localIp.includes('.') && !localIp.match(/[^.\\d]/) && ip.family !== 'IPv4') {\n return;\n }\n if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\\d]/)) {\n // if DNS name\n hostIp = ip.address;\n } else {\n hostIp = ip.address;\n }\n });\n });\n }\n\n if (!hostIp) {\n Object.keys(networkInterfaces).forEach(inter => {\n networkInterfaces[inter].forEach((ip: Record<string, any>) => {\n if (ip.internal) {\n return;\n }\n hostIp = ip.address;\n });\n });\n }\n\n return hostIp;\n}\n\ninterface ConfigSendToProps extends ConfigGenericProps {\n schema: ConfigItemSendTo;\n}\n\ninterface ConfigSendToState extends ConfigGenericState {\n _error: string;\n _message: string;\n hostname: string;\n running?: boolean;\n}\n\nclass ConfigSendto extends ConfigGeneric<ConfigSendToProps, ConfigSendToState> {\n async componentDidMount(): Promise<void> {\n super.componentDidMount();\n\n let hostname = window.location.hostname;\n if (this.props.schema.openUrl) {\n // read admin host\n const adminInstance = await this.props.oContext.socket.getCurrentInstance();\n const instanceObj = await this.props.oContext.socket.getObject(\n `system.adapter.${adminInstance}` as ioBroker.ObjectIDs.Instance,\n );\n\n if (instanceObj) {\n const hostObj = await this.props.oContext.socket.getObject(`system.host.${instanceObj?.common?.host}`);\n if (hostObj) {\n const ip = findNetworkAddressOfHost(hostObj, window.location.hostname);\n if (ip) {\n hostname = `${ip}:${window.location.port}`;\n } else {\n console.warn(\n `Cannot find suitable IP in host ${instanceObj.common.host} for ${instanceObj._id}`,\n );\n return;\n }\n }\n }\n }\n\n await new Promise<void>(resolve => {\n this.setState({ _error: '', _message: '', hostname }, resolve);\n });\n\n if (this.props.schema.onLoaded) {\n this._onClick();\n }\n }\n\n renderErrorDialog(): JSX.Element | null {\n if (this.state._error) {\n return (\n <DialogError\n text={this.state._error}\n onClose={() => this.setState({ _error: '' })}\n />\n );\n }\n return null;\n }\n\n renderMessageDialog(): JSX.Element | null {\n if (this.state._message) {\n return (\n <DialogMessage\n text={this.state._message}\n onClose={() => this.setState({ _message: '' })}\n />\n );\n }\n return null;\n }\n\n _onClick(): void {\n this.props.oContext.onCommandRunning(true);\n this.setState({ running: true });\n\n const _origin = `${window.location.protocol}//${window.location.host}${window.location.pathname.replace(/\\/index\\.html$/, '')}`;\n const _originIp = `${window.location.protocol}//${this.state.hostname.split(':').length > 3 ? `[${this.state.hostname}]` : this.state.hostname}${window.location.pathname.replace(/\\/index\\.html$/, '')}`;\n\n let data: Record<string, any> = this.props.schema.data;\n if (data === undefined && this.props.schema.jsonData) {\n const dataStr = this.getPattern(\n this.props.schema.jsonData,\n {\n _origin,\n _originIp,\n ...this.props.data,\n },\n true,\n );\n\n try {\n data = JSON.parse(dataStr);\n } catch {\n console.error(`Cannot parse json data: ${dataStr}`);\n }\n }\n if (data === undefined) {\n data = null;\n }\n if (this.props.schema.openUrl && !data) {\n data = {\n _origin,\n _originIp,\n };\n }\n let timeout: ReturnType<typeof setTimeout> | undefined;\n if (this.props.schema.timeout) {\n timeout = setTimeout(\n () => {\n this.props.oContext.onCommandRunning(false);\n this.setState({ _error: I18n.t('ra_Request timed out'), running: false });\n },\n parseInt(this.props.schema.timeout as any as string, 10) || 10000,\n );\n }\n\n void this.props.oContext.socket\n .sendTo(\n `${this.props.oContext.adapterName}.${this.props.oContext.instance}`,\n this.props.schema.command || 'send',\n data,\n )\n .then(async (response: Record<string, any>) => {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n if (response?.error) {\n if (this.props.schema.error && this.props.schema.error[response.error]) {\n let error = this.getText(this.props.schema.error[response.error]);\n response.args?.forEach((arg: string) => (error = error.replace('%s', arg)));\n this.setState({ _error: error });\n } else {\n this.setState({\n _error: response.error\n ? typeof response.error === 'string'\n ? I18n.t(response.error)\n : JSON.stringify(response.error)\n : I18n.t('ra_Error'),\n });\n }\n } else {\n if (response?.command) {\n // If backend requested to refresh the config\n this.props.oContext.onBackEndCommand?.(response.command);\n return;\n }\n if (response?.reloadBrowser && this.props.schema.reloadBrowser) {\n window.location.reload();\n } else if (response?.openUrl && this.props.schema.openUrl) {\n window.open(response.openUrl, response.window || this.props.schema.window || '_blank');\n } else if (response?.result && this.props.schema.result?.[response.result]) {\n let text = this.getText(this.props.schema.result[response.result]);\n response.args?.forEach((arg: string) => (text = text.replace('%s', arg)));\n window.alert(text);\n }\n\n if (response?.native && this.props.schema.useNative) {\n for (const [attr, val] of Object.entries(response.native)) {\n await this.onChangeAsync(attr, val);\n }\n\n setTimeout(\n () => this.props.oContext.forceUpdate(Object.keys(response.native), this.props.data),\n 300,\n );\n } else if (response?.result) {\n window.alert(\n typeof response.result === 'object' ? JSON.stringify(response.result) : response.result,\n );\n } else {\n window.alert(I18n.t('ra_Ok'));\n }\n\n if (response?.saveConfig) {\n this.props.onChange(null, null, null, true);\n }\n }\n })\n .catch((e: any) => {\n if (this.props.schema.error && this.props.schema.error[e.toString()]) {\n this.setState({ _error: this.getText(this.props.schema.error[e.toString()]) });\n } else {\n this.setState({ _error: I18n.t(e.toString()) || I18n.t('ra_Error') });\n }\n })\n .then(() => {\n this.props.oContext.onCommandRunning(false);\n this.setState({ running: false });\n });\n }\n\n renderDialogConfirm(): JSX.Element | null {\n if (!this.state.confirmDialog) {\n return null;\n }\n const confirm = this.state.confirmData || this.props.schema.confirm;\n let icon = null;\n if (confirm.type === 'warning') {\n icon = <IconWarning />;\n } else if (confirm.type === 'error') {\n icon = <IconError />;\n } else if (confirm.type === 'info') {\n icon = <IconInfo />;\n }\n\n return (\n <DialogConfirm\n title={this.getText(confirm.title) || I18n.t('ra_Please confirm')}\n text={this.getText(confirm.text)}\n ok={this.getText(confirm.ok) || I18n.t('ra_Ok')}\n cancel={this.getText(confirm.cancel) || I18n.t('ra_Cancel')}\n icon={icon || undefined}\n onClose={isOk => this.setState({ confirmDialog: false }, () => isOk && this._onClick())}\n />\n );\n }\n\n renderItem(error: Error | undefined, disabled: boolean): JSX.Element {\n const icon = this.getIcon();\n\n return (\n <div style={styles.fullWidth}>\n <Button\n variant={this.props.schema.variant || undefined}\n color={this.props.schema.color || 'grey'}\n style={{ ...styles.fullWidth, ...(this.props.schema.controlStyle || undefined) }}\n disabled={disabled || !this.props.alive}\n startIcon={icon}\n title={\n this.props.alive\n ? this.getText(this.props.schema.title) || ''\n : I18n.t('ra_Instance is not alive')\n }\n onClick={() => {\n if (this.props.schema.confirm) {\n this.setState({ confirmDialog: true });\n } else {\n this._onClick();\n }\n }}\n >\n {this.props.schema.showProcess && this.state.running ? (\n <CircularProgress\n size={20}\n style={{ marginRight: 8 }}\n />\n ) : null}\n {this.getText(this.props.schema.label, this.props.schema.noTranslation)}\n </Button>\n {this.renderErrorDialog()}\n {this.renderMessageDialog()}\n </div>\n );\n }\n}\n\nexport default ConfigSendto;\n"]}
1
+ {"version":3,"file":"ConfigSendto.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigSendto.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,KAAK,IAAI,SAAS,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEnG,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAGnG,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAClG,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAE3D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AAM,CAAC;wBACJ,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACpB,CAAC;gBACL,CAAC;gBAEA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CACnD,oBAAC,gBAAgB,IACb,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,GAC3B,CACL,CAAC,CAAC,CAAC,IAAI;gBACP,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAClE;YACR,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,mBAAmB,EAAE;YAC1B,IAAI,CAAC,gBAAgB,EAAE,CACtB,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { Button, CircularProgress } from '@mui/material';\n\nimport { Warning as IconWarning, Error as IconError, Info as IconInfo } from '@mui/icons-material';\n\nimport { DialogConfirm, DialogError, DialogMessage, I18n, copy } from '@iobroker/adapter-react-v5';\n\nimport type { BackEndCommand, ConfigItemSendTo } from '../types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\nimport Editor from './wrapper/Components/Editor';\nimport CustomModal from './wrapper/Components/CustomModal';\n\nconst styles: Record<string, React.CSSProperties> = {\n fullWidth: {\n width: '100%',\n },\n};\n\nfunction ip2int(ip: string): number {\n return ip.split('.').reduce((ipInt, octet) => (ipInt << 8) + parseInt(octet, 10), 0) >>> 0;\n}\n\n// copied from iobroker.admin/src-rx/src/Utils.js\nfunction findNetworkAddressOfHost(obj: Record<string, any>, localIp: string): string {\n const networkInterfaces = obj?.native?.hardware?.networkInterfaces;\n if (!networkInterfaces) {\n return null;\n }\n\n let hostIp: string | undefined;\n\n // check ipv4 addresses\n Object.keys(networkInterfaces).forEach(inter =>\n networkInterfaces[inter].forEach((ip: Record<string, any>) => {\n if (ip.internal) {\n return;\n }\n if (localIp.includes(':') && ip.family !== 'IPv6') {\n return;\n }\n if (localIp.includes('.') && !localIp.match(/[^.\\d]/) && ip.family !== 'IPv4') {\n return;\n }\n // if ip4 and not docker or wsl\n if (\n ip.family === 'IPv4' &&\n !ip.address.startsWith('172') &&\n (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\\d]/))\n ) {\n // if DNS name\n hostIp = ip.address;\n } else if (!hostIp) {\n if (\n ip.family === 'IPv4' &&\n localIp.includes('.') &&\n (ip2int(localIp) & ip2int(ip.netmask)) === (ip2int(ip.address) & ip2int(ip.netmask))\n ) {\n hostIp = ip.address;\n } else {\n hostIp = ip.address;\n }\n }\n }),\n );\n\n // check ipv6 addresses\n if (!hostIp) {\n Object.keys(networkInterfaces).forEach(inter =>\n networkInterfaces[inter].forEach((ip: Record<string, any>) => {\n if (ip.internal) {\n return;\n }\n if (localIp.includes(':') && ip.family !== 'IPv6') {\n return;\n }\n if (localIp.includes('.') && !localIp.match(/[^.\\d]/) && ip.family !== 'IPv4') {\n return;\n }\n if (\n ip.family === 'IPv6' &&\n (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\\d]/))\n ) {\n // if DNS name\n hostIp = ip.address;\n } else if (!hostIp) {\n if (\n ip.family === 'IPv4' &&\n localIp.includes('.') &&\n (ip2int(localIp) & ip2int(ip.netmask)) === (ip2int(ip.address) & ip2int(ip.netmask))\n ) {\n hostIp = ip.address;\n } else {\n hostIp = ip.address;\n }\n }\n }),\n );\n }\n\n if (!hostIp) {\n Object.keys(networkInterfaces).forEach(inter => {\n networkInterfaces[inter].forEach((ip: Record<string, any>) => {\n if (ip.internal) {\n return;\n }\n if (localIp.includes(':') && ip.family !== 'IPv6') {\n return;\n }\n if (localIp.includes('.') && !localIp.match(/[^.\\d]/) && ip.family !== 'IPv4') {\n return;\n }\n if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\\d]/)) {\n // if DNS name\n hostIp = ip.address;\n } else {\n hostIp = ip.address;\n }\n });\n });\n }\n\n if (!hostIp) {\n Object.keys(networkInterfaces).forEach(inter => {\n networkInterfaces[inter].forEach((ip: Record<string, any>) => {\n if (ip.internal) {\n return;\n }\n hostIp = ip.address;\n });\n });\n }\n\n return hostIp;\n}\n\ninterface ConfigSendToProps extends ConfigGenericProps {\n schema: ConfigItemSendTo;\n}\n\ninterface ConfigSendToState extends ConfigGenericState {\n _error: string;\n _message: string;\n _copyDialog: {\n text: string;\n title?: ioBroker.StringOrTranslated;\n type?: 'json' | 'css' | 'html' | 'json5' | 'yaml';\n };\n hostname: string;\n running?: boolean;\n}\n\nexport default class ConfigSendto extends ConfigGeneric<ConfigSendToProps, ConfigSendToState> {\n async componentDidMount(): Promise<void> {\n super.componentDidMount();\n\n let hostname = window.location.hostname;\n if (this.props.schema.openUrl) {\n // read admin host\n const adminInstance = await this.props.oContext.socket.getCurrentInstance();\n const instanceObj = await this.props.oContext.socket.getObject(\n `system.adapter.${adminInstance}` as ioBroker.ObjectIDs.Instance,\n );\n\n if (instanceObj) {\n const hostObj = await this.props.oContext.socket.getObject(`system.host.${instanceObj?.common?.host}`);\n if (hostObj) {\n const ip = findNetworkAddressOfHost(hostObj, window.location.hostname);\n if (ip) {\n hostname = `${ip}:${window.location.port}`;\n } else {\n console.warn(\n `Cannot find suitable IP in host ${instanceObj.common.host} for ${instanceObj._id}`,\n );\n return;\n }\n }\n }\n }\n\n await new Promise<void>(resolve => {\n this.setState({ _error: '', _message: '', hostname }, resolve);\n });\n\n if (this.props.schema.onLoaded) {\n this._onClick();\n }\n }\n\n renderErrorDialog(): JSX.Element | null {\n if (this.state._error) {\n return (\n <DialogError\n text={this.state._error}\n onClose={() => this.setState({ _error: '' })}\n />\n );\n }\n return null;\n }\n\n renderMessageDialog(): JSX.Element | null {\n if (this.state._message) {\n return (\n <DialogMessage\n text={this.state._message}\n onClose={() => this.setState({ _message: '' })}\n />\n );\n }\n return null;\n }\n\n renderCopyDialog(): JSX.Element | null {\n if (this.state._copyDialog) {\n return (\n <CustomModal\n title={this.getText(this.state._copyDialog.title || I18n.t('ra_Result'))}\n overflowHidden\n onClose={() => {\n this.setState({ _copyDialog: null });\n }}\n onApply={() => {\n // Copy to clipboard\n copy(this.state._copyDialog.text);\n window.alert(I18n.t('ra_Copied to clipboard'));\n this.setState({ _copyDialog: null });\n }}\n >\n <div style={{ width: 'calc(100vw - 40px)', height: 'calc(100vh - 188px)' }}>\n <Editor\n mode={this.state._copyDialog.type}\n value={this.state._copyDialog.text}\n name=\"CopyDialog\"\n themeType={this.props.oContext.themeType}\n />\n </div>\n </CustomModal>\n );\n }\n return null;\n }\n\n _onClick(): void {\n this.props.oContext.onCommandRunning(true);\n this.setState({ running: true });\n\n const _origin = `${window.location.protocol}//${window.location.host}${window.location.pathname.replace(/\\/index\\.html$/, '')}`;\n const _originIp = `${window.location.protocol}//${this.state.hostname.split(':').length > 3 ? `[${this.state.hostname}]` : this.state.hostname}${window.location.pathname.replace(/\\/index\\.html$/, '')}`;\n\n let data: Record<string, any> = this.props.schema.data;\n if (data === undefined && this.props.schema.jsonData) {\n const dataStr = this.getPattern(\n this.props.schema.jsonData,\n {\n _origin,\n _originIp,\n ...this.props.data,\n },\n true,\n );\n\n try {\n data = JSON.parse(dataStr);\n } catch {\n console.error(`Cannot parse json data: ${dataStr}`);\n }\n }\n if (data === undefined) {\n data = null;\n }\n if (this.props.schema.openUrl && !data) {\n data = {\n _origin,\n _originIp,\n };\n }\n let timeout: ReturnType<typeof setTimeout> | undefined;\n if (this.props.schema.timeout) {\n timeout = setTimeout(\n () => {\n this.props.oContext.onCommandRunning(false);\n this.setState({ _error: I18n.t('ra_Request timed out'), running: false });\n },\n parseInt(this.props.schema.timeout as any as string, 10) || 10000,\n );\n }\n\n void this.props.oContext.socket\n .sendTo(\n `${this.props.oContext.adapterName}.${this.props.oContext.instance}`,\n this.props.schema.command || 'send',\n data,\n )\n .then(\n async (response: {\n error?: string;\n args?: string[];\n command?: BackEndCommand;\n reloadBrowser?: boolean;\n openUrl?: string;\n window?: string;\n result?: string;\n native?: Record<string, any>;\n saveConfig?: boolean;\n /** Title for copy dialog */\n copyDialog?: {\n title?: ioBroker.StringOrTranslated;\n text: string;\n type?: 'json' | 'css' | 'html' | 'json5' | 'yaml';\n };\n }) => {\n if (timeout) {\n clearTimeout(timeout);\n timeout = undefined;\n }\n if (response?.error) {\n if (this.props.schema.error?.[response.error]) {\n let error = this.getText(this.props.schema.error[response.error]);\n response.args?.forEach((arg: string) => (error = error.replace('%s', arg)));\n this.setState({ _error: error });\n } else {\n this.setState({\n _error: response.error\n ? typeof response.error === 'string'\n ? I18n.t(response.error)\n : JSON.stringify(response.error)\n : I18n.t('ra_Error'),\n });\n }\n } else {\n if (response?.command) {\n // If backend requested to refresh the config\n this.props.oContext.onBackEndCommand?.(response.command);\n return;\n }\n if (response?.reloadBrowser && this.props.schema.reloadBrowser) {\n window.location.reload();\n } else if (response?.openUrl && this.props.schema.openUrl) {\n window.open(response.openUrl, response.window || this.props.schema.window || '_blank');\n } else if (response?.result && this.props.schema.result?.[response.result]) {\n let text = this.getText(this.props.schema.result[response.result]);\n response.args?.forEach((arg: string) => (text = text.replace('%s', arg)));\n window.alert(text);\n }\n\n if (response?.native && this.props.schema.useNative) {\n for (const [attr, val] of Object.entries(response.native)) {\n await this.onChangeAsync(attr, val);\n }\n\n setTimeout(\n () => this.props.oContext.forceUpdate(Object.keys(response.native), this.props.data),\n 300,\n );\n } else if (response?.result) {\n window.alert(\n typeof response.result === 'object' ? JSON.stringify(response.result) : response.result,\n );\n } else if (response?.copyDialog) {\n this.setState({ _copyDialog: response.copyDialog });\n } else {\n window.alert(I18n.t('ra_Ok'));\n }\n\n if (response?.saveConfig) {\n this.props.onChange(null, null, null, true);\n }\n }\n },\n )\n .catch((e: any) => {\n if (this.props.schema.error && this.props.schema.error[e.toString()]) {\n this.setState({ _error: this.getText(this.props.schema.error[e.toString()]) });\n } else {\n this.setState({ _error: I18n.t(e.toString()) || I18n.t('ra_Error') });\n }\n })\n .then(() => {\n this.props.oContext.onCommandRunning(false);\n this.setState({ running: false });\n });\n }\n\n renderDialogConfirm(): JSX.Element | null {\n if (!this.state.confirmDialog) {\n return null;\n }\n const confirm = this.state.confirmData || this.props.schema.confirm;\n let icon = null;\n if (confirm.type === 'warning') {\n icon = <IconWarning />;\n } else if (confirm.type === 'error') {\n icon = <IconError />;\n } else if (confirm.type === 'info') {\n icon = <IconInfo />;\n }\n\n return (\n <DialogConfirm\n title={this.getText(confirm.title) || I18n.t('ra_Please confirm')}\n text={this.getText(confirm.text)}\n ok={this.getText(confirm.ok) || I18n.t('ra_Ok')}\n cancel={this.getText(confirm.cancel) || I18n.t('ra_Cancel')}\n icon={icon || undefined}\n onClose={isOk => this.setState({ confirmDialog: false }, () => isOk && this._onClick())}\n />\n );\n }\n\n renderItem(error: Error | undefined, disabled: boolean): JSX.Element {\n const icon = this.getIcon();\n\n return (\n <div style={styles.fullWidth}>\n <Button\n variant={this.props.schema.variant || undefined}\n color={this.props.schema.color || 'grey'}\n style={{ ...styles.fullWidth, ...(this.props.schema.controlStyle || undefined) }}\n disabled={disabled || !this.props.alive}\n startIcon={icon}\n title={\n this.props.alive\n ? this.getText(this.props.schema.title) || ''\n : I18n.t('ra_Instance is not alive')\n }\n onClick={() => {\n if (this.props.schema.confirm) {\n this.setState({ confirmDialog: true });\n } else {\n this._onClick();\n }\n }}\n >\n {this.props.schema.showProcess && this.state.running ? (\n <CircularProgress\n size={20}\n style={{ marginRight: 8 }}\n />\n ) : null}\n {this.getText(this.props.schema.label, this.props.schema.noTranslation)}\n </Button>\n {this.renderErrorDialog()}\n {this.renderMessageDialog()}\n {this.renderCopyDialog()}\n </div>\n );\n }\n}\n"]}
@@ -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';
@@ -939,7 +939,7 @@ export default class ConfigTable extends ConfigGeneric {
939
939
  React.createElement(Card, null,
940
940
  React.createElement(Paper, { style: styles.paper },
941
941
  this.props.schema.titleAttribute ? (React.createElement(Box, { sx: styles.cardHeader },
942
- this.state.value[idx][this.props.schema.titleAttribute],
942
+ React.createElement("div", null, this.state.value[idx][this.props.schema.titleAttribute]),
943
943
  React.createElement("div", null,
944
944
  !doAnyFilterSet && !this.state.orderBy ? (React.createElement(Tooltip, { title: I18n.t('ra_Move up'), slotProps: { popper: { sx: styles.tooltip } } },
945
945
  React.createElement("span", null,
@@ -970,35 +970,38 @@ export default class ConfigTable extends ConfigGeneric {
970
970
  } },
971
971
  React.createElement(ExpandMoreIcon, { style: {
972
972
  rotate: this.state.collapsed?.includes(idx)
973
- ? '90deg'
974
- : '0deg',
973
+ ? '0deg'
974
+ : '180deg',
975
+ transition: '0.3s',
976
+ transitionProperty: 'rotate',
975
977
  } })))))) : null,
976
- React.createElement(Table, null,
977
- React.createElement(TableBody, null,
978
- schema.items?.map((headCell) => {
979
- const hidden = this.listOfHiddenElements?.[idx]?.includes(headCell.attr);
980
- return (React.createElement(TableRow, { key: `${headCell.attr}_${idx}` },
981
- React.createElement(TableCell, { align: "left", style: hidden ? tdStyleHidden : tdStyle }, hidden ? null : (React.createElement("span", { style: styles.headerText }, this.getText(headCell.title)))),
982
- React.createElement(TableCell, { align: "left", style: hidden ? tdStyleHidden : tdStyle }, this.itemTable(headCell.attr, this.state.value[idx], idx, true))));
983
- }),
984
- !this.props.schema.titleAttribute && !schema.noDelete && (React.createElement(TableRow, null,
985
- React.createElement(TableCell, { align: "left", style: tdStyle },
986
- React.createElement("span", { style: styles.headerText }, this.getText('Actions'))),
987
- React.createElement(TableCell, { align: "left", style: tdStyle },
988
- !doAnyFilterSet && !this.state.orderBy ? (React.createElement(Tooltip, { title: I18n.t('ra_Move up'), slotProps: { popper: { sx: styles.tooltip } } },
989
- React.createElement("span", null,
990
- React.createElement(IconButton, { size: "small", onClick: () => this.onMoveUp(idx), disabled: i === 0 },
991
- React.createElement(UpIcon, null))))) : null,
992
- !doAnyFilterSet && !this.state.orderBy ? (React.createElement(Tooltip, { title: I18n.t('ra_Move down'), slotProps: { popper: { sx: styles.tooltip } } },
993
- React.createElement("span", null,
994
- React.createElement(IconButton, { size: "small", onClick: () => this.onMoveDown(idx), disabled: i === visibleValue.length - 1 },
995
- React.createElement(DownIcon, null))))) : null,
996
- React.createElement(Tooltip, { title: I18n.t('ra_Delete current row'), slotProps: { popper: { sx: styles.tooltip } } },
997
- React.createElement(IconButton, { size: "small", onClick: this.onDelete(idx) },
998
- React.createElement(DeleteIcon, null))),
999
- this.props.schema.clone ? (React.createElement(Tooltip, { title: I18n.t('ra_Clone current row'), slotProps: { popper: { sx: styles.tooltip } } },
1000
- React.createElement(IconButton, { size: "small", onClick: this.onClone(idx) },
1001
- React.createElement(CopyContentIcon, null)))) : 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))))))))))),
1002
1005
  this.enhancedBottomCard()));
1003
1006
  }
1004
1007
  renderTable() {
@@ -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,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,MAAM,EACN,aAAa,EACb,aAAa,EACb,WAAW,EACX,KAAK,EACL,UAAU,EACV,cAAc,EACd,KAAK,EACL,KAAK,EACL,SAAS,EACT,SAAS,EACT,cAAc,EACd,SAAS,EACT,QAAQ,EACR,cAAc,EACd,SAAS,EACT,OAAO,EACP,OAAO,EACP,UAAU,EACV,cAAc,EACd,GAAG,GACN,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,GAAG,IAAI,OAAO,EACd,MAAM,IAAI,UAAU,EACpB,KAAK,IAAI,SAAS,EAClB,WAAW,IAAI,MAAM,EACrB,aAAa,IAAI,QAAQ,EACzB,SAAS,IAAI,YAAY,EACzB,YAAY,IAAI,aAAa,EAC7B,WAAW,IAAI,eAAe,EAC9B,QAAQ,IAAI,UAAU,EACtB,OAAO,IAAI,SAAS,EACpB,UAAU,IAAI,UAAU,EACxB,KAAK,IAAI,SAAS,EAClB,UAAU,IAAI,cAAc,GAC/B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAiB,MAAM,4BAA4B,CAAC;AAGjE,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAClG,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,MAAM;AAEpC,MAAM,MAAM,GAAwB;IA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,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 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 {this.state.value[idx][this.props.schema.titleAttribute]}\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 ? '90deg'\n : '0deg',\n }}\n />\n </IconButton>\n </Tooltip>\n </div>\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 {!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 </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"]}
1
+ {"version":3,"file":"ConfigTable.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA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AAoB,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/build/types.d.ts CHANGED
@@ -737,8 +737,10 @@ export interface ConfigItemSendTo extends Omit<ConfigItem, 'data'> {
737
737
  command?: string;
738
738
  jsonData?: string;
739
739
  data?: Record<string, any>;
740
- result?: string;
741
- error?: string;
740
+ /** Translations for possible result codes. E.g. `{"RESULT_OK": "Operation successful"}`. The translation must exist in i18n files. */
741
+ result?: Record<string, ioBroker.StringOrTranslated>;
742
+ /** Translations for possible error codes. E.g. `{"ERR_NO_OBJECT": "Object not found"}`. The translation must exist in i18n files. */
743
+ error?: Record<string, ioBroker.StringOrTranslated>;
742
744
  variant?: 'contained' | 'outlined';
743
745
  openUrl?: boolean;
744
746
  reloadBrowser?: boolean;
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.8",
4
+ "version": "8.1.10",
5
5
  "author": {
6
6
  "name": "bluefox",
7
7
  "email": "dogafox@gmail.com"