@iobroker/adapter-react-v5 8.2.12 → 8.3.0

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
@@ -690,12 +690,18 @@ You can find the migration instructions:
690
690
  -->
691
691
 
692
692
  ## Changelog
693
+ ### 8.3.0 (2026-07-11)
694
+ - (@GermanBluefox) Used strict types
695
+
696
+ ### 8.2.13 (2026-06-21)
697
+ - (@GermanBluefox) Updated socket-client package to support web-socket-only mode
698
+
693
699
  ### 8.2.12 (2026-06-20)
694
- - (@GermanBluefox) Correcetd InfoBox color
700
+ - (@GermanBluefox) Corrected InfoBox color
695
701
 
696
702
  ### 8.2.11 (2026-06-19)
697
703
  - (@GermanBluefox) Correcting background of state if overloaded
698
- - (@GermanBluefox) Moved translations for json-config to other package
704
+ - (@GermanBluefox) Moved translations for json-config to another package
699
705
 
700
706
  ### 8.2.10 (2026-06-16)
701
707
  - (@GermanBluefox) Corrected the folder creation
@@ -53,7 +53,7 @@ export function DeviceTypeSelector(props) {
53
53
  if (_typesWords[a] === _typesWords[b]) {
54
54
  return 0;
55
55
  }
56
- return _typesWords[a].localeCompare(_typesWords[b], 'de');
56
+ return _typesWords[a]?.localeCompare(_typesWords[b] || '', 'de') || 0;
57
57
  });
58
58
  extendDeviceTypeTranslation();
59
59
  setTypes(_types);
@@ -78,6 +78,6 @@ export function DeviceTypeSelector(props) {
78
78
  color: props.themeType === 'dark' ? '#FFFFFF' : '#000',
79
79
  } }),
80
80
  React.createElement("span", { style: styles.selectText }, typesWords[typeId])),
81
- props.showApplications?.TYPE_OPTIONS[typeId] ? (React.createElement("div", { style: styles.iconWrapper }, Object.keys(props.showApplications.TYPE_OPTIONS[typeId]).map(key => props.showApplications.TYPE_OPTIONS[typeId][key] ? (React.createElement(Icon, { key: key, style: styles.iconStyle, src: props.showApplications.ICONS_TYPE[key] })) : (React.createElement("div", { key: key, style: styles.emptyIcon }))))) : null)))))));
81
+ props.showApplications?.TYPE_OPTIONS[typeId] ? (React.createElement("div", { style: styles.iconWrapper }, Object.keys(props.showApplications.TYPE_OPTIONS[typeId]).map(key => props.showApplications?.TYPE_OPTIONS[typeId]?.[key] ? (React.createElement(Icon, { key: key, style: styles.iconStyle, src: props.showApplications.ICONS_TYPE[key] })) : (React.createElement("div", { key: key, style: styles.emptyIcon }))))) : null)))))));
82
82
  }
83
83
  //# sourceMappingURL=DeviceTypeSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceTypeSelector.js","sourceRoot":"./src/","sources":["Components/DeviceType/DeviceTypeSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,MAAM,MAAM,GAGR;IACA,mBAAmB,EAAE;QACjB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,MAAM;QACb,cAAc,EAAE,eAAe;KAClC;IACD,IAAI,EAAE;QACF,SAAS,EAAE,EAAE;KAChB;IACD,UAAU,EAAE;QACR,YAAY,EAAE,CAAC;QACf,aAAa,EAAE,QAAQ;QACvB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;KACb;IACD,UAAU,EAAE;QACR,aAAa,EAAE,QAAQ;KAC1B;IACD,WAAW,EAAE;QACT,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;KACvB;IACD,SAAS,EAAE;QACP,KAAK,EAAE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MAAM,CAAC,EACnB,KAAK,EAAE;4BACH,GAAG,MAAM,CAAC,UAAU;4BACpB,KAAK,EAAE,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;yBACzD,GACH;oBACF,8BAAM,KAAK,EAAE,MAAM,CAAC,UAAU,IAAG,UAAU,CAAC,MAAM,CAAC,CAAQ,CACzD;gBACL,KAAK,CAAC,gBAAgB,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAC5C,6BAAK,KAAK,EAAE,MAAM,CAAC,WAAW,IACzB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAChE,KAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAC/C,oBAAC,IAAI,IACD,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,CAAC,SAAS,EACvB,GAAG,EAAE,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,GAC7C,CACL,CAAC,CAAC,CAAC,CACA,6BACI,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,CAAC,SAAS,GACzB,CACL,CACJ,CACC,CACT,CAAC,CAAC,CAAC,IAAI,CACN,CACC,CACd,CAAC,CACG,CACC,CACjB,CAAC;AACN,CAAC","sourcesContent":["import React, { useEffect } from 'react';\nimport { Box, FormControl, InputLabel, MenuItem, Select } from '@mui/material';\n\nimport { Types } from '@iobroker/type-detector';\n\nimport { I18n } from '../../i18n';\nimport { Icon } from '../Icon';\nimport type { ThemeType } from '../../types';\n\nimport { DeviceTypeIcon } from './DeviceTypeIcon';\nimport { extendDeviceTypeTranslation } from './deviceTypeTranslations';\n\nconst styles: Record<\n 'itemChildrenWrapper' | 'type' | 'selectIcon' | 'selectText' | 'iconWrapper' | 'iconStyle' | 'emptyIcon',\n React.CSSProperties\n> = {\n itemChildrenWrapper: {\n display: 'flex',\n width: '100%',\n justifyContent: 'space-between',\n },\n type: {\n marginTop: 10,\n },\n selectIcon: {\n paddingRight: 8,\n verticalAlign: 'middle',\n width: 20,\n height: 20,\n },\n selectText: {\n verticalAlign: 'middle',\n },\n iconWrapper: {\n display: 'flex',\n alignItems: 'center',\n },\n iconStyle: {\n width: 16,\n height: 16,\n margin: '0 3px',\n },\n emptyIcon: {\n width: 16,\n height: 16,\n margin: '0 3px',\n },\n};\n\nexport function DeviceTypeSelector(props: {\n themeType: ThemeType;\n supportedDevices?: Types[];\n unsupportedDevices?: Types[];\n value?: Types | '';\n onChange: (value: Types) => void;\n label?: string;\n style?: React.CSSProperties;\n sx?: Record<string, any>;\n disabled?: boolean;\n error?: boolean;\n /** Show icons for applications: google, amazon, material, alias. Used in devices */\n showApplications?: {\n TYPE_OPTIONS: Partial<Record<Types, Record<string, boolean>>>;\n ICONS_TYPE: Record<string, React.JSX.Element>;\n };\n}): React.JSX.Element {\n const [typesWords, setTypesWords] = React.useState<Partial<Record<Types, string>>>({});\n const [types, setTypes] = React.useState<Types[] | null>([]);\n\n useEffect(() => {\n const _typesWords: Partial<Record<Types, string>> = {};\n Object.keys(Types)\n .filter(\n id =>\n (!props.supportedDevices || props.supportedDevices?.includes(id as Types)) &&\n !props.unsupportedDevices?.includes(id as Types),\n )\n .forEach(typeId => (_typesWords[typeId as Types] = I18n.t(`type-${Types[typeId as Types]}`)));\n\n // sort types by ABC in the current language\n const _types: Types[] = Object.keys(_typesWords) as Types[];\n\n _types.sort((a, b) => {\n if (_typesWords[a] === _typesWords[b]) {\n return 0;\n }\n return _typesWords[a].localeCompare(_typesWords[b], 'de');\n });\n\n extendDeviceTypeTranslation();\n\n setTypes(_types);\n setTypesWords(_typesWords);\n }, [props.supportedDevices, props.unsupportedDevices]);\n\n if (!types) {\n return (\n <Box\n style={{\n ...styles.type,\n ...props.style,\n }}\n sx={props.sx}\n />\n );\n }\n\n return (\n <FormControl\n style={{\n ...styles.type,\n ...props.style,\n }}\n sx={props.sx}\n variant=\"standard\"\n error={!!props.error}\n >\n <InputLabel>{props.label || I18n.t('type-Device type')}</InputLabel>\n <Select\n variant=\"standard\"\n disabled={!!props.disabled}\n value={props.value}\n onChange={e => props.onChange(e.target.value as Types)}\n >\n {types.map(typeId => (\n <MenuItem\n key={Types[typeId]}\n value={Types[typeId]}\n >\n <div style={styles.itemChildrenWrapper}>\n <div>\n <DeviceTypeIcon\n type={Types[typeId]}\n style={{\n ...styles.selectIcon,\n color: props.themeType === 'dark' ? '#FFFFFF' : '#000',\n }}\n />\n <span style={styles.selectText}>{typesWords[typeId]}</span>\n </div>\n {props.showApplications?.TYPE_OPTIONS[typeId] ? (\n <div style={styles.iconWrapper}>\n {Object.keys(props.showApplications.TYPE_OPTIONS[typeId]).map(key =>\n props.showApplications.TYPE_OPTIONS[typeId][key] ? (\n <Icon\n key={key}\n style={styles.iconStyle}\n src={props.showApplications.ICONS_TYPE[key]}\n />\n ) : (\n <div\n key={key}\n style={styles.emptyIcon}\n />\n ),\n )}\n </div>\n ) : null}\n </div>\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n}\n"]}
1
+ {"version":3,"file":"DeviceTypeSelector.js","sourceRoot":"./src/","sources":["Components/DeviceType/DeviceTypeSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;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,CAAC,GAAG,CAAC,GAC7C,CACL,CAAC,CAAC,CAAC,CACA,6BACI,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,CAAC,SAAS,GACzB,CACL,CACJ,CACC,CACT,CAAC,CAAC,CAAC,IAAI,CACN,CACC,CACd,CAAC,CACG,CACC,CACjB,CAAC;AACN,CAAC","sourcesContent":["import React, { useEffect } from 'react';\nimport { Box, FormControl, InputLabel, MenuItem, Select } from '@mui/material';\n\nimport { Types } from '@iobroker/type-detector';\n\nimport { I18n } from '../../i18n';\nimport { Icon } from '../Icon';\nimport type { ThemeType } from '../../types';\n\nimport { DeviceTypeIcon } from './DeviceTypeIcon';\nimport { extendDeviceTypeTranslation } from './deviceTypeTranslations';\n\nconst styles: Record<\n 'itemChildrenWrapper' | 'type' | 'selectIcon' | 'selectText' | 'iconWrapper' | 'iconStyle' | 'emptyIcon',\n React.CSSProperties\n> = {\n itemChildrenWrapper: {\n display: 'flex',\n width: '100%',\n justifyContent: 'space-between',\n },\n type: {\n marginTop: 10,\n },\n selectIcon: {\n paddingRight: 8,\n verticalAlign: 'middle',\n width: 20,\n height: 20,\n },\n selectText: {\n verticalAlign: 'middle',\n },\n iconWrapper: {\n display: 'flex',\n alignItems: 'center',\n },\n iconStyle: {\n width: 16,\n height: 16,\n margin: '0 3px',\n },\n emptyIcon: {\n width: 16,\n height: 16,\n margin: '0 3px',\n },\n};\n\nexport function DeviceTypeSelector(props: {\n themeType: ThemeType;\n supportedDevices?: Types[];\n unsupportedDevices?: Types[];\n value?: Types | '';\n onChange: (value: Types) => void;\n label?: string;\n style?: React.CSSProperties;\n sx?: Record<string, any>;\n disabled?: boolean;\n error?: boolean;\n /** Show icons for applications: google, amazon, material, alias. Used in devices */\n showApplications?: {\n TYPE_OPTIONS: Partial<Record<Types, Record<string, boolean>>>;\n ICONS_TYPE: Record<string, React.JSX.Element>;\n };\n}): React.JSX.Element {\n const [typesWords, setTypesWords] = React.useState<Partial<Record<Types, string>>>({});\n const [types, setTypes] = React.useState<Types[] | null>([]);\n\n useEffect(() => {\n const _typesWords: Partial<Record<Types, string>> = {};\n Object.keys(Types)\n .filter(\n id =>\n (!props.supportedDevices || props.supportedDevices?.includes(id as Types)) &&\n !props.unsupportedDevices?.includes(id as Types),\n )\n .forEach(typeId => (_typesWords[typeId as Types] = I18n.t(`type-${Types[typeId as Types]}`)));\n\n // sort types by ABC in the current language\n const _types: Types[] = Object.keys(_typesWords) as Types[];\n\n _types.sort((a, b) => {\n if (_typesWords[a] === _typesWords[b]) {\n return 0;\n }\n return _typesWords[a]?.localeCompare(_typesWords[b] || '', 'de') || 0;\n });\n\n extendDeviceTypeTranslation();\n\n setTypes(_types);\n setTypesWords(_typesWords);\n }, [props.supportedDevices, props.unsupportedDevices]);\n\n if (!types) {\n return (\n <Box\n style={{\n ...styles.type,\n ...props.style,\n }}\n sx={props.sx}\n />\n );\n }\n\n return (\n <FormControl\n style={{\n ...styles.type,\n ...props.style,\n }}\n sx={props.sx}\n variant=\"standard\"\n error={!!props.error}\n >\n <InputLabel>{props.label || I18n.t('type-Device type')}</InputLabel>\n <Select\n variant=\"standard\"\n disabled={!!props.disabled}\n value={props.value}\n onChange={e => props.onChange(e.target.value as Types)}\n >\n {types.map(typeId => (\n <MenuItem\n key={Types[typeId]}\n value={Types[typeId]}\n >\n <div style={styles.itemChildrenWrapper}>\n <div>\n <DeviceTypeIcon\n type={Types[typeId]}\n style={{\n ...styles.selectIcon,\n color: props.themeType === 'dark' ? '#FFFFFF' : '#000',\n }}\n />\n <span style={styles.selectText}>{typesWords[typeId]}</span>\n </div>\n {props.showApplications?.TYPE_OPTIONS[typeId] ? (\n <div style={styles.iconWrapper}>\n {Object.keys(props.showApplications.TYPE_OPTIONS[typeId]).map(key =>\n props.showApplications?.TYPE_OPTIONS[typeId]?.[key] ? (\n <Icon\n key={key}\n style={styles.iconStyle}\n src={props.showApplications.ICONS_TYPE[key]}\n />\n ) : (\n <div\n key={key}\n style={styles.emptyIcon}\n />\n ),\n )}\n </div>\n ) : null}\n </div>\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n}\n"]}
@@ -1647,7 +1647,7 @@ export class FileBrowserClass extends Component {
1647
1647
  renderDeleteDialog() {
1648
1648
  if (this.state.deleteItem) {
1649
1649
  return (React.createElement(Dialog, { key: "deleteDialog", open: !0, onClose: () => this.setState({ deleteItem: '' }), "aria-labelledby": "ar_dialog_file_delete_title" },
1650
- React.createElement(DialogTitle, { id: "ar_dialog_file_delete_title" }, this.props.t('ra_Confirm deletion of %s', this.state.deleteItem.split('/').pop())),
1650
+ React.createElement(DialogTitle, { id: "ar_dialog_file_delete_title" }, this.props.t('ra_Confirm deletion of %s', this.state.deleteItem.split('/').pop() || '')),
1651
1651
  React.createElement(DialogContent, null,
1652
1652
  React.createElement(DialogContentText, null, this.props.t('ra_Are you sure?')),
1653
1653
  React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: this.state.suppressDeleteConfirm, onChange: () => {