@iobroker/json-config 7.4.21 → 7.4.22

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.
Files changed (68) hide show
  1. package/README.md +19 -17
  2. package/build/JsonConfig.js +1 -1
  3. package/build/JsonConfig.js.map +1 -1
  4. package/build/JsonConfigComponent/ChipInput.js +2 -2
  5. package/build/JsonConfigComponent/ChipInput.js.map +1 -1
  6. package/build/JsonConfigComponent/ConfigAccordion.js.map +1 -1
  7. package/build/JsonConfigComponent/ConfigAlive.js.map +1 -1
  8. package/build/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
  9. package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
  10. package/build/JsonConfigComponent/ConfigCertCollection.js.map +1 -1
  11. package/build/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
  12. package/build/JsonConfigComponent/ConfigCertificates.js.map +1 -1
  13. package/build/JsonConfigComponent/ConfigCheckLicense.js.map +1 -1
  14. package/build/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
  15. package/build/JsonConfigComponent/ConfigChip.js.map +1 -1
  16. package/build/JsonConfigComponent/ConfigColor.js.map +1 -1
  17. package/build/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
  18. package/build/JsonConfigComponent/ConfigCustom.js +3 -1
  19. package/build/JsonConfigComponent/ConfigCustom.js.map +1 -1
  20. package/build/JsonConfigComponent/ConfigDeviceManager.js.map +1 -1
  21. package/build/JsonConfigComponent/ConfigFile.js.map +1 -1
  22. package/build/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
  23. package/build/JsonConfigComponent/ConfigFunc.js.map +1 -1
  24. package/build/JsonConfigComponent/ConfigGeneric.js +2 -2
  25. package/build/JsonConfigComponent/ConfigGeneric.js.map +1 -1
  26. package/build/JsonConfigComponent/ConfigIP.js.map +1 -1
  27. package/build/JsonConfigComponent/ConfigImageSendTo.js.map +1 -1
  28. package/build/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
  29. package/build/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
  30. package/build/JsonConfigComponent/ConfigInterface.js.map +1 -1
  31. package/build/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
  32. package/build/JsonConfigComponent/ConfigLanguage.js.map +1 -1
  33. package/build/JsonConfigComponent/ConfigLicense.js.map +1 -1
  34. package/build/JsonConfigComponent/ConfigNumber.js.map +1 -1
  35. package/build/JsonConfigComponent/ConfigObjectId.js.map +1 -1
  36. package/build/JsonConfigComponent/ConfigPanel.js +1 -1
  37. package/build/JsonConfigComponent/ConfigPanel.js.map +1 -1
  38. package/build/JsonConfigComponent/ConfigPassword.js.map +1 -1
  39. package/build/JsonConfigComponent/ConfigPort.js.map +1 -1
  40. package/build/JsonConfigComponent/ConfigQrCode.js.map +1 -1
  41. package/build/JsonConfigComponent/ConfigRoom.js.map +1 -1
  42. package/build/JsonConfigComponent/ConfigSelect.js.map +1 -1
  43. package/build/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
  44. package/build/JsonConfigComponent/ConfigSendto.js.map +1 -1
  45. package/build/JsonConfigComponent/ConfigSetState.js.map +1 -1
  46. package/build/JsonConfigComponent/ConfigSlider.js.map +1 -1
  47. package/build/JsonConfigComponent/ConfigState.d.ts +1 -1
  48. package/build/JsonConfigComponent/ConfigState.js +67 -38
  49. package/build/JsonConfigComponent/ConfigState.js.map +1 -1
  50. package/build/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
  51. package/build/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
  52. package/build/JsonConfigComponent/ConfigStaticInfo.js.map +1 -1
  53. package/build/JsonConfigComponent/ConfigStaticText.js.map +1 -1
  54. package/build/JsonConfigComponent/ConfigTable.d.ts +1 -1
  55. package/build/JsonConfigComponent/ConfigTable.js +4 -4
  56. package/build/JsonConfigComponent/ConfigTable.js.map +1 -1
  57. package/build/JsonConfigComponent/ConfigTabs.js.map +1 -1
  58. package/build/JsonConfigComponent/ConfigText.js.map +1 -1
  59. package/build/JsonConfigComponent/ConfigTextSendTo.js.map +1 -1
  60. package/build/JsonConfigComponent/ConfigTimePicker.js.map +1 -1
  61. package/build/JsonConfigComponent/ConfigTopic.js.map +1 -1
  62. package/build/JsonConfigComponent/ConfigUser.js.map +1 -1
  63. package/build/JsonConfigComponent/Icons.js.map +1 -1
  64. package/build/JsonConfigComponent/index.d.ts +1 -1
  65. package/build/JsonConfigComponent/index.js.map +1 -1
  66. package/build/JsonConfigComponent/wrapper/Components/CustomModal.js.map +1 -1
  67. package/build/types.d.ts +5 -1
  68. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigStaticText.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigStaticText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAiB,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAElG,MAAM,MAAM,GAAwB;IAChC,SAAS,EAAE;QACP,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KAChB;IACD,IAAI,EAAE,CAAC,KAAe,EAAuB,EAAE,CAAC,CAAC;QAC7C,cAAc,EAAE,WAAW;QAC3B,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC5D,MAAM,EAAE,SAAS;KACpB,CAAC;CACL,CAAC;AAEF,6EAA6E;AAC7E,SAAS,MAAM,CAAC,IAAY,EAAE,MAAmC,EAAE,UAAkB;IACjF,IAAI,OAAO,CAAC;IACZ,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,CAAC,IAAI,EAAE;QACP,GAAG,GAAG,yBAAyB,UAAU,EAAE,CAAC;QAC5C,OAAO,GAAG,MA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AC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,CACvE,CAAC;yBACL;qBACJ;gBACL,CAAC;gBACH,CAAC,CAAC,IAAI,IAGb,IAAI,CACH,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,gBAAgB,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { Box, Button } from '@mui/material';\n\nimport { type IobTheme, Utils } from '@iobroker/adapter-react-v5';\n\nimport type { ConfigItemStaticText } from '#JC/types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\n\nconst styles: Record<string, any> = {\n fullWidth: {\n height: '100%',\n width: '100%',\n },\n link: (theme: IobTheme): React.CSSProperties => ({\n textDecoration: 'underline',\n color: theme.palette.mode === 'dark' ? '#4dabf5' : '#254e72',\n cursor: 'pointer',\n }),\n};\n\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nfunction onLink(href: string, target: '_blank' | '_self' | string, instanceId: string): void {\n let _target;\n let url = '';\n if (!href) {\n url = `#tab-instances/config/${instanceId}`;\n _target = target || '_self';\n } else if (href.toString().startsWith('#')) {\n _target = target || '_self';\n url = href;\n } else if (href.toString().startsWith('/')) {\n _target = target || '_self';\n url = href;\n } else if (href.startsWith('http://') || href.startsWith('https://')) {\n _target = target || '_blank';\n url = href;\n } else {\n url = `#tab-instances/config/${instanceId}/${href}`;\n _target = target || '_self';\n }\n if (_target === '_self') {\n // close dialog\n setTimeout(\n (_url: string) => {\n if (_url.startsWith('#')) {\n window.location.hash = _url;\n } else if (_url.startsWith('/')) {\n url = `${window.location.protocol}:${window.location.host}${url}`;\n } else if (_url.startsWith('http://') || _url.startsWith('https://')) {\n window.location.href = _url;\n }\n },\n 100,\n url,\n );\n } else {\n if (url.startsWith('#')) {\n url = `${window.location.protocol}:${window.location.host}${window.location.pathname}${url}`;\n } else if (url.startsWith('/')) {\n url = `${window.location.protocol}:${window.location.host}${url}`;\n }\n\n window.open(url, _target);\n }\n}\n\ninterface ConfigStaticTextProps extends ConfigGenericProps {\n schema: ConfigItemStaticText;\n}\n\nclass ConfigStaticText extends ConfigGeneric<ConfigStaticTextProps, ConfigGenericState> {\n renderItem(_error: string, disabled: boolean /* , defaultValue */): JSX.Element {\n if (this.props.schema.button) {\n const icon = this.getIcon();\n return (\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}\n startIcon={icon}\n onClick={\n this.props.schema.href\n ? () => {\n // calculate one more time just before call\n const href = this.props.schema.href\n ? this.getText(this.props.schema.href, true)\n : null;\n if (href) {\n if (this.props.oContext.onBackEndCommand) {\n this.props.oContext.onBackEndCommand({\n command: 'link',\n url: href,\n target: this.props.schema.target,\n close: this.props.schema.close,\n });\n } else {\n onLink(\n href,\n this.props.schema.target,\n `${this.props.oContext.adapterName}.${this.props.oContext.instance}`,\n );\n }\n }\n }\n : null\n }\n >\n {this.getText(this.props.schema.text || this.props.schema.label, this.props.schema.noTranslation)}\n </Button>\n );\n }\n let text: string | JSX.Element | JSX.Element[] = this.getText(\n this.props.schema.text || this.props.schema.label,\n this.props.schema.noTranslation,\n );\n if (text && (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))) {\n text = Utils.renderTextWithA(text);\n }\n\n return (\n <Box\n component=\"span\"\n style={{ ...(this.props.schema.controlStyle || undefined) }}\n sx={this.props.schema.href ? styles.link : undefined}\n onClick={\n this.props.schema.href\n ? () => {\n // calculate one more time just before call\n const href = this.props.schema.href ? this.getText(this.props.schema.href, true) : null;\n if (href) {\n if (this.props.oContext.onBackEndCommand) {\n this.props.oContext.onBackEndCommand({\n command: 'link',\n url: href,\n target: this.props.schema.target || '_blank',\n close: this.props.schema.close,\n });\n } else {\n onLink(\n href,\n this.props.schema.target || '_blank',\n `${this.props.oContext.adapterName}.${this.props.oContext.instance}`,\n );\n }\n }\n }\n : null\n }\n >\n {text}\n </Box>\n );\n }\n}\n\nexport default ConfigStaticText;\n"]}
1
+ {"version":3,"file":"ConfigStaticText.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigStaticText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAiB,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAElG,MAAM,MAAM,GAAwB;IAChC,SAAS,EAAE;QACP,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KAChB;IACD,IAAI,EAAE,CAAC,KAAe,EAAuB,EAAE,CAAC,CAAC;QAC7C,cAAc,EAAE,WAAW;QAC3B,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC5D,MAAM,EAAE,SAAS;KACpB,CAAC;CACL,CAAC;AAEF,6EAA6E;AAC7E,SAAS,MAAM,CAAC,IAAY,EAAE,MAAmC,EAAE,UAAkB;IACjF,IAAI,OAAO,CAAC;IACZ,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,GAAG,GAAG,yBAAyB,UAAU,EAAE,CAAC;QAC5C,OAAO,GAAG,MAAM,IAAI,OAAO,CAAC;IAChC,CAAC;SAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,GAAG,MAAM,IAAI,OAAO,CAAC;QAC5B,GAAG,GAAG,IAAI,CAAC;IACf,CAAC;SAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,GAAG,MAAM,IAAI,OAAO,CAAC;QAC5B,GAAG,GAAG,IAAI,CAAC;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H,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,gBAAgB,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { Box, Button } from '@mui/material';\n\nimport { type IobTheme, Utils } from '@iobroker/adapter-react-v5';\n\nimport type { ConfigItemStaticText } from '#JC/types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\n\nconst styles: Record<string, any> = {\n fullWidth: {\n height: '100%',\n width: '100%',\n },\n link: (theme: IobTheme): React.CSSProperties => ({\n textDecoration: 'underline',\n color: theme.palette.mode === 'dark' ? '#4dabf5' : '#254e72',\n cursor: 'pointer',\n }),\n};\n\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nfunction onLink(href: string, target: '_blank' | '_self' | string, instanceId: string): void {\n let _target;\n let url = '';\n if (!href) {\n url = `#tab-instances/config/${instanceId}`;\n _target = target || '_self';\n } else if (href.toString().startsWith('#')) {\n _target = target || '_self';\n url = href;\n } else if (href.toString().startsWith('/')) {\n _target = target || '_self';\n url = href;\n } else if (href.startsWith('http://') || href.startsWith('https://')) {\n _target = target || '_blank';\n url = href;\n } else {\n url = `#tab-instances/config/${instanceId}/${href}`;\n _target = target || '_self';\n }\n if (_target === '_self') {\n // close dialog\n setTimeout(\n (_url: string) => {\n if (_url.startsWith('#')) {\n window.location.hash = _url;\n } else if (_url.startsWith('/')) {\n url = `${window.location.protocol}:${window.location.host}${url}`;\n } else if (_url.startsWith('http://') || _url.startsWith('https://')) {\n window.location.href = _url;\n }\n },\n 100,\n url,\n );\n } else {\n if (url.startsWith('#')) {\n url = `${window.location.protocol}:${window.location.host}${window.location.pathname}${url}`;\n } else if (url.startsWith('/')) {\n url = `${window.location.protocol}:${window.location.host}${url}`;\n }\n\n window.open(url, _target);\n }\n}\n\ninterface ConfigStaticTextProps extends ConfigGenericProps {\n schema: ConfigItemStaticText;\n}\n\nclass ConfigStaticText extends ConfigGeneric<ConfigStaticTextProps, ConfigGenericState> {\n renderItem(_error: string, disabled: boolean /* , defaultValue */): JSX.Element {\n if (this.props.schema.button) {\n const icon = this.getIcon();\n return (\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}\n startIcon={icon}\n onClick={\n this.props.schema.href\n ? () => {\n // calculate one more time just before call\n const href = this.props.schema.href\n ? this.getText(this.props.schema.href, true)\n : null;\n if (href) {\n if (this.props.oContext.onBackEndCommand) {\n this.props.oContext.onBackEndCommand({\n command: 'link',\n url: href,\n target: this.props.schema.target,\n close: this.props.schema.close,\n });\n } else {\n onLink(\n href,\n this.props.schema.target,\n `${this.props.oContext.adapterName}.${this.props.oContext.instance}`,\n );\n }\n }\n }\n : null\n }\n >\n {this.getText(this.props.schema.text || this.props.schema.label, this.props.schema.noTranslation)}\n </Button>\n );\n }\n let text: string | JSX.Element | JSX.Element[] = this.getText(\n this.props.schema.text || this.props.schema.label,\n this.props.schema.noTranslation,\n );\n if (text && (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))) {\n text = Utils.renderTextWithA(text);\n }\n\n return (\n <Box\n component=\"span\"\n style={{ ...(this.props.schema.controlStyle || undefined) }}\n sx={this.props.schema.href ? styles.link : undefined}\n onClick={\n this.props.schema.href\n ? () => {\n // calculate one more time just before call\n const href = this.props.schema.href ? this.getText(this.props.schema.href, true) : null;\n if (href) {\n if (this.props.oContext.onBackEndCommand) {\n this.props.oContext.onBackEndCommand({\n command: 'link',\n url: href,\n target: this.props.schema.target || '_blank',\n close: this.props.schema.close,\n });\n } else {\n onLink(\n href,\n this.props.schema.target || '_blank',\n `${this.props.oContext.adapterName}.${this.props.oContext.instance}`,\n );\n }\n }\n }\n : null\n }\n >\n {text}\n </Box>\n );\n }\n}\n\nexport default ConfigStaticText;\n"]}
@@ -42,7 +42,7 @@ declare class ConfigTable extends ConfigGeneric<ConfigTableProps, ConfigTableSta
42
42
  static getFilterValue(el: React.RefObject<HTMLInputElement>): string;
43
43
  static setFilterValue(el: React.RefObject<HTMLInputElement>, filterValue: string): string;
44
44
  handleRequestSort: (property: string, orderCheck?: boolean) => void;
45
- stableSort: (order: 'desc' | 'asc', orderBy: string) => Record<string, any>[];
45
+ stableSort: (order: "desc" | "asc", orderBy: string) => Record<string, any>[];
46
46
  renderShowHideFilter(headCell: ConfigItemTableIndexed): React.JSX.Element | null;
47
47
  renderImportExportButtons(schema: ConfigItemTable): React.JSX.Element;
48
48
  renderAddButton(doAnyFilterSet: boolean): React.JSX.Element;
@@ -409,7 +409,7 @@ class ConfigTable extends ConfigGeneric {
409
409
  onDelete = (index) => () => {
410
410
  const newValue = JSON.parse(JSON.stringify(this.state.value));
411
411
  newValue.splice(index, 1);
412
- this.setState({ value: newValue, iteration: this.state.iteration + 10000 }, () => this.applyFilter(false, null, () => this.onChangeWrapper(newValue)));
412
+ this.setState({ value: newValue, iteration: this.state.iteration + 10_000 }, () => this.applyFilter(false, null, () => this.onChangeWrapper(newValue)));
413
413
  };
414
414
  onExport() {
415
415
  const { schema } = this.props;
@@ -737,7 +737,7 @@ class ConfigTable extends ConfigGeneric {
737
737
  tdStyle = { paddingTop: 1, paddingBottom: 1 };
738
738
  }
739
739
  return (React.createElement(Grid2, { size: {
740
- xs: schema.xs || 12,
740
+ xs: schema.xs || 12, // if xs is not defined, take the full width
741
741
  sm: schema.sm || undefined,
742
742
  md: schema.md || undefined,
743
743
  lg: schema.lg || undefined,
@@ -774,7 +774,7 @@ class ConfigTable extends ConfigGeneric {
774
774
  }
775
775
  const doAnyFilterSet = this.isAnyFilterSet();
776
776
  return (React.createElement(Grid2, { size: {
777
- xs: schema.xs || 12,
777
+ xs: schema.xs || 12, // if xs is not defined, take the full width
778
778
  sm: schema.sm || undefined,
779
779
  md: schema.md || undefined,
780
780
  lg: schema.lg || undefined,
@@ -801,7 +801,7 @@ class ConfigTable extends ConfigGeneric {
801
801
  this.showTypeOfImportDialog(),
802
802
  this.enhancedFilterCard(),
803
803
  visibleValue.map((idx, i) => (React.createElement(Grid2, { key: `${idx}_${i}`, size: {
804
- xs: schema.xs || 12,
804
+ xs: schema.xs || 12, // if xs is not defined, take the full width
805
805
  sm: schema.sm || undefined,
806
806
  md: schema.md || undefined,
807
807
  lg: schema.lg || undefined,