@iobroker/adapter-react-v5 7.6.12 → 7.6.14
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/build/Components/DeviceType/DeviceTypeIcon.js +3 -23
- package/build/Components/DeviceType/DeviceTypeIcon.js.map +1 -1
- package/build/Components/DeviceType/DeviceTypeSelector.js +2 -22
- package/build/Components/DeviceType/DeviceTypeSelector.js.map +1 -1
- package/build/Components/DeviceType/deviceTypeTranslations.d.ts +1 -0
- package/build/Components/DeviceType/deviceTypeTranslations.js +26 -0
- package/build/Components/DeviceType/deviceTypeTranslations.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -16,6 +16,7 @@ import { Icon } from '../Icon';
|
|
|
16
16
|
import { Cleaner as TypeIconVacuumCleaner, Humidity as TypeIconHumidity, Jalousie as TypeIconBlinds, PushButton as TypeIconButton, DoorOpened as TypeIconDoor, FireOn as TypeIconFireAlarm, FloodOn as TypeIconFloodAlarm, Gate as TypeIconGate, MotionOn as TypeIconMotion, RGB as TypeIconRGB, Socket as TypeIconSocket, Thermometer as TypeIconTemperature, Thermostat as TypeIconThermostat,
|
|
17
17
|
// HeatValve as TypeIconValve,
|
|
18
18
|
WindowOpened as TypeIconWindow, WindowTilted as TypeIconWindowTilt, } from './icons';
|
|
19
|
+
import { extendDeviceTypeTranslation } from './deviceTypeTranslations';
|
|
19
20
|
const TYPE_ICONS = {
|
|
20
21
|
[Types.airCondition]: TypeIconAC,
|
|
21
22
|
[Types.blind]: TypeIconBlinds,
|
|
@@ -40,7 +41,7 @@ const TYPE_ICONS = {
|
|
|
40
41
|
[Types.light]: TypeIconLight,
|
|
41
42
|
[Types.lock]: TypeIconLock,
|
|
42
43
|
[Types.location]: TypeIconLocation,
|
|
43
|
-
[Types.
|
|
44
|
+
[Types.locationOne]: TypeIconLocationOne,
|
|
44
45
|
[Types.media]: TypeIconMedia,
|
|
45
46
|
[Types.motion]: TypeIconMotion,
|
|
46
47
|
[Types.ct]: TypeIconCT,
|
|
@@ -71,16 +72,6 @@ const TYPE_ICONS = {
|
|
|
71
72
|
hub5: TypeIconHub5,
|
|
72
73
|
controller: TypeIconController,
|
|
73
74
|
};
|
|
74
|
-
import enLang from './i18n/en.json';
|
|
75
|
-
import deLang from './i18n/de.json';
|
|
76
|
-
import ruLang from './i18n/ru.json';
|
|
77
|
-
import ptLang from './i18n/pt.json';
|
|
78
|
-
import plLang from './i18n/pl.json';
|
|
79
|
-
import frLang from './i18n/fr.json';
|
|
80
|
-
import itLang from './i18n/it.json';
|
|
81
|
-
import nlLang from './i18n/nl.json';
|
|
82
|
-
import ukLang from './i18n/uk.json';
|
|
83
|
-
import zhLang from './i18n/zh-cn.json';
|
|
84
75
|
const defaultStyle = {
|
|
85
76
|
width: 32,
|
|
86
77
|
height: 32,
|
|
@@ -89,18 +80,7 @@ export function DeviceTypeIcon(props) {
|
|
|
89
80
|
const [loaded, setLoaded] = React.useState(false);
|
|
90
81
|
useEffect(() => {
|
|
91
82
|
if (props.title && !loaded) {
|
|
92
|
-
|
|
93
|
-
en: enLang,
|
|
94
|
-
de: deLang,
|
|
95
|
-
ru: ruLang,
|
|
96
|
-
pt: ptLang,
|
|
97
|
-
pl: plLang,
|
|
98
|
-
fr: frLang,
|
|
99
|
-
it: itLang,
|
|
100
|
-
nl: nlLang,
|
|
101
|
-
uk: ukLang,
|
|
102
|
-
'zh-cn': zhLang,
|
|
103
|
-
});
|
|
83
|
+
extendDeviceTypeTranslation();
|
|
104
84
|
setLoaded(true);
|
|
105
85
|
}
|
|
106
86
|
}, [props.title]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceTypeIcon.js","sourceRoot":"./src/","sources":["Components/DeviceType/DeviceTypeIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO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AG,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC,EAAE,IAAG,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAQ,CAClG,CAAC,CAAC,CAAC,IAAI,CAAC;IACb,CAAC;IAED,MAAM,IAAI,GAAG,CACT,oBAAC,QAAQ,IACL,KAAK,EAAE,EAAE,GAAG,YAAY,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC,EAAE,EACzD,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,EAAE,EAAE,KAAK,CAAC,EAAE,GACd,CACL,CAAC;IAEF,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,OAAO,CACH,oBAAC,OAAO,IACJ,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,EACxD,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;YAElE,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAG,IAAI,CAAO,CACvC,CACb,CAAC;IACN,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import React, { useEffect } from 'react';\n\nimport { Box, Tooltip } from '@mui/material';\n\nimport { AiOutlineLineChart as TypeIconChart } from 'react-icons/ai';\nimport { GoDeviceCameraVideo as TypeIconCamera } from 'react-icons/go';\n\nimport {\n // FaExternalLinkSquareAlt as TypeIconURL,\n FaImage as TypeIconImage,\n FaRegLightbulb as TypeIconDimmer,\n FaInfoCircle as TypeIconInfo,\n FaLightbulb as TypeIconLight,\n FaLock as TypeIconLock,\n FaStreetView as TypeIconLocation,\n FaStepForward as TypeIconMedia,\n FaSlidersH as TypeIconSlider,\n FaVolumeDown as TypeIconVolume,\n FaVolumeUp as TypeIconVolumeGroup,\n FaFan as TypeIconAC,\n FaWrench as TypeIconInstance,\n} from 'react-icons/fa';\n\nimport {\n MdFormatColorFill as TypeIconHUE,\n MdFormatColorFill as TypeIconCT,\n MdWarning as TypeIconWarning,\n MdQuestionMark as TypeIconUnknown,\n MdOutlineMyLocation as TypeIconLocationOne,\n MdDeviceHub as TypeIconHub3,\n MdPolyline as TypeIconNode,\n MdHub as TypeIconHub5,\n MdControlCamera as TypeIconController,\n} from 'react-icons/md';\nimport { WiCloudy as TypeIconWeather } from 'react-icons/wi';\nimport { IoIosRadioButtonOn as TypeIconButtonSensor } from 'react-icons/io';\nimport { TbSunElectricity as TypeIconIlluminance } from 'react-icons/tb';\nimport { PiPaletteDuotone as TypeIconRGBWSingle } from 'react-icons/pi';\n\nimport { Types } from '@iobroker/type-detector';\n\nimport { I18n } from '../../i18n';\nimport { Icon } from '../Icon';\n\nimport {\n Cleaner as TypeIconVacuumCleaner,\n Humidity as TypeIconHumidity,\n Jalousie as TypeIconBlinds,\n PushButton as TypeIconButton,\n DoorOpened as TypeIconDoor,\n FireOn as TypeIconFireAlarm,\n FloodOn as TypeIconFloodAlarm,\n Gate as TypeIconGate,\n MotionOn as TypeIconMotion,\n RGB as TypeIconRGB,\n Socket as TypeIconSocket,\n Thermometer as TypeIconTemperature,\n Thermostat as TypeIconThermostat,\n // HeatValve as TypeIconValve,\n WindowOpened as TypeIconWindow,\n WindowTilted as TypeIconWindowTilt,\n type IconPropsSVG,\n} from './icons';\n\nexport type TypesExtended = Types | 'invalid' | 'hub3' | 'node' | 'hub5' | 'controller';\n\nconst TYPE_ICONS: Record<TypesExtended, React.FC<IconPropsSVG>> = {\n [Types.airCondition]: TypeIconAC,\n [Types.blind]: TypeIconBlinds,\n [Types.blindButtons]: TypeIconBlinds,\n [Types.button]: TypeIconButton,\n [Types.buttonSensor]: TypeIconButtonSensor,\n [Types.camera]: TypeIconCamera,\n [Types.chart]: TypeIconChart,\n // [Types.url]: TypeIconURL,\n [Types.image]: TypeIconImage,\n [Types.dimmer]: TypeIconDimmer,\n [Types.door]: TypeIconDoor,\n [Types.fireAlarm]: TypeIconFireAlarm,\n // @ts-expect-error special case\n 'sensor.alarm.fire': TypeIconFireAlarm,\n [Types.floodAlarm]: TypeIconFloodAlarm,\n 'sensor.alarm.flood': TypeIconFloodAlarm,\n [Types.gate]: TypeIconGate,\n [Types.humidity]: TypeIconHumidity,\n [Types.illuminance]: TypeIconIlluminance,\n [Types.info]: TypeIconInfo,\n [Types.light]: TypeIconLight,\n [Types.lock]: TypeIconLock,\n [Types.location]: TypeIconLocation,\n [Types.location_one]: TypeIconLocationOne,\n [Types.media]: TypeIconMedia,\n [Types.motion]: TypeIconMotion,\n [Types.ct]: TypeIconCT,\n [Types.rgb]: TypeIconRGB,\n [Types.rgbSingle]: TypeIconRGB,\n [Types.rgbwSingle]: TypeIconRGBWSingle,\n [Types.hue]: TypeIconHUE,\n [Types.cie]: TypeIconRGB,\n [Types.slider]: TypeIconSlider,\n [Types.socket]: TypeIconSocket,\n [Types.temperature]: TypeIconTemperature,\n [Types.thermostat]: TypeIconThermostat,\n // [Types.valve]: TypeIconValve,\n [Types.vacuumCleaner]: TypeIconVacuumCleaner,\n [Types.volume]: TypeIconVolume,\n [Types.volumeGroup]: TypeIconVolumeGroup,\n [Types.window]: TypeIconWindow,\n [Types.windowTilt]: TypeIconWindowTilt,\n [Types.weatherCurrent]: TypeIconWeather,\n [Types.weatherForecast]: TypeIconWeather,\n [Types.warning]: TypeIconWarning,\n\n [Types.unknown]: TypeIconUnknown,\n [Types.instance]: TypeIconInstance,\n\n // Special matter types\n invalid: TypeIconWarning,\n hub3: TypeIconHub3,\n node: TypeIconNode,\n hub5: TypeIconHub5,\n controller: TypeIconController,\n};\n\nimport enLang from './i18n/en.json';\nimport deLang from './i18n/de.json';\nimport ruLang from './i18n/ru.json';\nimport ptLang from './i18n/pt.json';\nimport plLang from './i18n/pl.json';\nimport frLang from './i18n/fr.json';\nimport itLang from './i18n/it.json';\nimport nlLang from './i18n/nl.json';\nimport ukLang from './i18n/uk.json';\nimport zhLang from './i18n/zh-cn.json';\n\nconst defaultStyle: React.CSSProperties = {\n width: 32,\n height: 32,\n};\n\nexport interface IconProps {\n /** URL, UTF-8 character, or svg code (data:image/svg...) */\n src?: string | React.JSX.Element | null | undefined;\n /** Class name */\n className?: string;\n /** Style for image */\n style?: React.CSSProperties;\n /** Styles for mui */\n sx?: Record<string, any>;\n /** Tooltip */\n title?: string | true;\n /** Styles for utf-8 characters */\n styleUTF8?: React.CSSProperties;\n /** On error handler */\n onError?: React.ReactEventHandler<HTMLImageElement>;\n /** Reference to image */\n ref?: React.RefObject<HTMLImageElement>;\n /** Alternative text for image */\n alt?: string;\n /** On click handler */\n onClick?: React.MouseEventHandler<any>;\n}\n\nexport type TypeIconProps = IconProps & { type?: TypesExtended };\n\nexport function DeviceTypeIcon(props: TypeIconProps): React.JSX.Element | null {\n const [loaded, setLoaded] = React.useState(false);\n\n useEffect(() => {\n if (props.title && !loaded) {\n I18n.extendTranslations({\n en: enLang,\n de: deLang,\n ru: ruLang,\n pt: ptLang,\n pl: plLang,\n fr: frLang,\n it: itLang,\n nl: nlLang,\n uk: ukLang,\n 'zh-cn': zhLang,\n });\n setLoaded(true);\n }\n }, [props.title]);\n\n if (!loaded && props.title) {\n return (\n <Box\n style={{ ...defaultStyle, ...(props.style || undefined) }}\n className={props.className}\n sx={props.sx}\n />\n );\n }\n // src could contain a device type too, so detect if it is a type\n const type: TypesExtended | undefined =\n props.type || (props.src ? (Object.keys(TYPE_ICONS).find(type => props.src === type) as TypesExtended) : undefined);\n\n if (!type && props.src) {\n return (\n <Icon\n style={defaultStyle}\n {...props}\n title={props.title === true ? undefined : props.title}\n src={props.src}\n />\n );\n }\n\n const TypeIcon = type && TYPE_ICONS[type];\n if (!TypeIcon) {\n // Show the first letter of a type\n return type ? (\n <span style={{ ...defaultStyle, ...(props.style || undefined) }}>{type[0].toUpperCase()}</span>\n ) : null;\n }\n\n const icon = (\n <TypeIcon\n style={{ ...defaultStyle, ...(props.style || undefined) }}\n onClick={props.onClick}\n className={props.className}\n sx={props.sx}\n />\n );\n\n if (props.title) {\n return (\n <Tooltip\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n title={props.title === true ? I18n.t(`type-${type}`) : props.title}\n >\n <div style={{ display: 'flex' }}>{icon}</div>\n </Tooltip>\n );\n }\n\n return icon;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DeviceTypeIcon.js","sourceRoot":"./src/","sources":["Components/DeviceType/DeviceTypeIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,kBAAkB,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,mBAAmB,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEvE,OAAO;AACH,0CAA0C;AAC1C,OAAO,IAAI,aAAa,EACxB,cAAc,IAAI,cAAc,EAChC,YAAY,IAAI,YAAY,EAC5B,WAAW,IAAI,aAAa,EAC5B,MAAM,IAAI,YAAY,EACtB,YAAY,IAAI,gBAAgB,EAChC,aAAa,IAAI,aAAa,EAC9B,UAAU,IAAI,cAAc,EAC5B,YAAY,IAAI,cAAc,EAC9B,UAAU,IAAI,mBAAmB,EACjC,KAAK,IAAI,UAAU,EACnB,QAAQ,IAAI,gBAAgB,GAC/B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,iBAAiB,IAAI,WAAW,EAChC,iBAAiB,IAAI,UAAU,EAC/B,SAAS,IAAI,eAAe,EAC5B,cAAc,IAAI,eAAe,EACjC,mBAAmB,IAAI,mBAAmB,EAC1C,WAAW,IAAI,YAAY,EAC3B,UAAU,IAAI,YAAY,EAC1B,KAAK,IAAI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AC,CAAC,CAAC,IAAI,CAAC;IACb,CAAC;IAED,MAAM,IAAI,GAAG,CACT,oBAAC,QAAQ,IACL,KAAK,EAAE,EAAE,GAAG,YAAY,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC,EAAE,EACzD,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,EAAE,EAAE,KAAK,CAAC,EAAE,GACd,CACL,CAAC;IAEF,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,OAAO,CACH,oBAAC,OAAO,IACJ,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE,EACxD,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;YAElE,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAG,IAAI,CAAO,CACvC,CACb,CAAC;IACN,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import React, { useEffect } from 'react';\n\nimport { Box, Tooltip } from '@mui/material';\n\nimport { AiOutlineLineChart as TypeIconChart } from 'react-icons/ai';\nimport { GoDeviceCameraVideo as TypeIconCamera } from 'react-icons/go';\n\nimport {\n // FaExternalLinkSquareAlt as TypeIconURL,\n FaImage as TypeIconImage,\n FaRegLightbulb as TypeIconDimmer,\n FaInfoCircle as TypeIconInfo,\n FaLightbulb as TypeIconLight,\n FaLock as TypeIconLock,\n FaStreetView as TypeIconLocation,\n FaStepForward as TypeIconMedia,\n FaSlidersH as TypeIconSlider,\n FaVolumeDown as TypeIconVolume,\n FaVolumeUp as TypeIconVolumeGroup,\n FaFan as TypeIconAC,\n FaWrench as TypeIconInstance,\n} from 'react-icons/fa';\n\nimport {\n MdFormatColorFill as TypeIconHUE,\n MdFormatColorFill as TypeIconCT,\n MdWarning as TypeIconWarning,\n MdQuestionMark as TypeIconUnknown,\n MdOutlineMyLocation as TypeIconLocationOne,\n MdDeviceHub as TypeIconHub3,\n MdPolyline as TypeIconNode,\n MdHub as TypeIconHub5,\n MdControlCamera as TypeIconController,\n} from 'react-icons/md';\nimport { WiCloudy as TypeIconWeather } from 'react-icons/wi';\nimport { IoIosRadioButtonOn as TypeIconButtonSensor } from 'react-icons/io';\nimport { TbSunElectricity as TypeIconIlluminance } from 'react-icons/tb';\nimport { PiPaletteDuotone as TypeIconRGBWSingle } from 'react-icons/pi';\n\nimport { Types } from '@iobroker/type-detector';\n\nimport { I18n } from '../../i18n';\nimport { Icon } from '../Icon';\n\nimport {\n Cleaner as TypeIconVacuumCleaner,\n Humidity as TypeIconHumidity,\n Jalousie as TypeIconBlinds,\n PushButton as TypeIconButton,\n DoorOpened as TypeIconDoor,\n FireOn as TypeIconFireAlarm,\n FloodOn as TypeIconFloodAlarm,\n Gate as TypeIconGate,\n MotionOn as TypeIconMotion,\n RGB as TypeIconRGB,\n Socket as TypeIconSocket,\n Thermometer as TypeIconTemperature,\n Thermostat as TypeIconThermostat,\n // HeatValve as TypeIconValve,\n WindowOpened as TypeIconWindow,\n WindowTilted as TypeIconWindowTilt,\n type IconPropsSVG,\n} from './icons';\nimport { extendDeviceTypeTranslation } from './deviceTypeTranslations';\n\nexport type TypesExtended = Types | 'invalid' | 'hub3' | 'node' | 'hub5' | 'controller';\n\nconst TYPE_ICONS: Record<TypesExtended, React.FC<IconPropsSVG>> = {\n [Types.airCondition]: TypeIconAC,\n [Types.blind]: TypeIconBlinds,\n [Types.blindButtons]: TypeIconBlinds,\n [Types.button]: TypeIconButton,\n [Types.buttonSensor]: TypeIconButtonSensor,\n [Types.camera]: TypeIconCamera,\n [Types.chart]: TypeIconChart,\n // [Types.url]: TypeIconURL,\n [Types.image]: TypeIconImage,\n [Types.dimmer]: TypeIconDimmer,\n [Types.door]: TypeIconDoor,\n [Types.fireAlarm]: TypeIconFireAlarm,\n // @ts-expect-error special case\n 'sensor.alarm.fire': TypeIconFireAlarm,\n [Types.floodAlarm]: TypeIconFloodAlarm,\n 'sensor.alarm.flood': TypeIconFloodAlarm,\n [Types.gate]: TypeIconGate,\n [Types.humidity]: TypeIconHumidity,\n [Types.illuminance]: TypeIconIlluminance,\n [Types.info]: TypeIconInfo,\n [Types.light]: TypeIconLight,\n [Types.lock]: TypeIconLock,\n [Types.location]: TypeIconLocation,\n [Types.locationOne]: TypeIconLocationOne,\n [Types.media]: TypeIconMedia,\n [Types.motion]: TypeIconMotion,\n [Types.ct]: TypeIconCT,\n [Types.rgb]: TypeIconRGB,\n [Types.rgbSingle]: TypeIconRGB,\n [Types.rgbwSingle]: TypeIconRGBWSingle,\n [Types.hue]: TypeIconHUE,\n [Types.cie]: TypeIconRGB,\n [Types.slider]: TypeIconSlider,\n [Types.socket]: TypeIconSocket,\n [Types.temperature]: TypeIconTemperature,\n [Types.thermostat]: TypeIconThermostat,\n // [Types.valve]: TypeIconValve,\n [Types.vacuumCleaner]: TypeIconVacuumCleaner,\n [Types.volume]: TypeIconVolume,\n [Types.volumeGroup]: TypeIconVolumeGroup,\n [Types.window]: TypeIconWindow,\n [Types.windowTilt]: TypeIconWindowTilt,\n [Types.weatherCurrent]: TypeIconWeather,\n [Types.weatherForecast]: TypeIconWeather,\n [Types.warning]: TypeIconWarning,\n\n [Types.unknown]: TypeIconUnknown,\n [Types.instance]: TypeIconInstance,\n\n // Special matter types\n invalid: TypeIconWarning,\n hub3: TypeIconHub3,\n node: TypeIconNode,\n hub5: TypeIconHub5,\n controller: TypeIconController,\n};\n\nconst defaultStyle: React.CSSProperties = {\n width: 32,\n height: 32,\n};\n\nexport interface IconProps {\n /** URL, UTF-8 character, or svg code (data:image/svg...) */\n src?: string | React.JSX.Element | null | undefined;\n /** Class name */\n className?: string;\n /** Style for image */\n style?: React.CSSProperties;\n /** Styles for mui */\n sx?: Record<string, any>;\n /** Tooltip */\n title?: string | true;\n /** Styles for utf-8 characters */\n styleUTF8?: React.CSSProperties;\n /** On error handler */\n onError?: React.ReactEventHandler<HTMLImageElement>;\n /** Reference to image */\n ref?: React.RefObject<HTMLImageElement>;\n /** Alternative text for image */\n alt?: string;\n /** On click handler */\n onClick?: React.MouseEventHandler<any>;\n}\n\nexport type TypeIconProps = IconProps & { type?: TypesExtended };\n\nexport function DeviceTypeIcon(props: TypeIconProps): React.JSX.Element | null {\n const [loaded, setLoaded] = React.useState(false);\n\n useEffect(() => {\n if (props.title && !loaded) {\n extendDeviceTypeTranslation();\n setLoaded(true);\n }\n }, [props.title]);\n\n if (!loaded && props.title) {\n return (\n <Box\n style={{ ...defaultStyle, ...(props.style || undefined) }}\n className={props.className}\n sx={props.sx}\n />\n );\n }\n // src could contain a device type too, so detect if it is a type\n const type: TypesExtended | undefined =\n props.type || (props.src ? (Object.keys(TYPE_ICONS).find(type => props.src === type) as TypesExtended) : undefined);\n\n if (!type && props.src) {\n return (\n <Icon\n style={defaultStyle}\n {...props}\n title={props.title === true ? undefined : props.title}\n src={props.src}\n />\n );\n }\n\n const TypeIcon = type && TYPE_ICONS[type];\n if (!TypeIcon) {\n // Show the first letter of a type\n return type ? (\n <span style={{ ...defaultStyle, ...(props.style || undefined) }}>{type[0].toUpperCase()}</span>\n ) : null;\n }\n\n const icon = (\n <TypeIcon\n style={{ ...defaultStyle, ...(props.style || undefined) }}\n onClick={props.onClick}\n className={props.className}\n sx={props.sx}\n />\n );\n\n if (props.title) {\n return (\n <Tooltip\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n title={props.title === true ? I18n.t(`type-${type}`) : props.title}\n >\n <div style={{ display: 'flex' }}>{icon}</div>\n </Tooltip>\n );\n }\n\n return icon;\n}\n"]}
|
|
@@ -4,16 +4,7 @@ import { Types } from '@iobroker/type-detector';
|
|
|
4
4
|
import { I18n } from '../../i18n';
|
|
5
5
|
import { Icon } from '../Icon';
|
|
6
6
|
import { DeviceTypeIcon } from './DeviceTypeIcon';
|
|
7
|
-
import
|
|
8
|
-
import deLang from './i18n/de.json';
|
|
9
|
-
import ruLang from './i18n/ru.json';
|
|
10
|
-
import ptLang from './i18n/pt.json';
|
|
11
|
-
import plLang from './i18n/pl.json';
|
|
12
|
-
import frLang from './i18n/fr.json';
|
|
13
|
-
import itLang from './i18n/it.json';
|
|
14
|
-
import nlLang from './i18n/nl.json';
|
|
15
|
-
import ukLang from './i18n/uk.json';
|
|
16
|
-
import zhLang from './i18n/zh-cn.json';
|
|
7
|
+
import { extendDeviceTypeTranslation } from './deviceTypeTranslations';
|
|
17
8
|
const styles = {
|
|
18
9
|
itemChildrenWrapper: {
|
|
19
10
|
display: 'flex',
|
|
@@ -63,18 +54,7 @@ export function DeviceTypeSelector(props) {
|
|
|
63
54
|
}
|
|
64
55
|
return _typesWords[a].localeCompare(_typesWords[b], 'de');
|
|
65
56
|
});
|
|
66
|
-
|
|
67
|
-
en: enLang,
|
|
68
|
-
de: deLang,
|
|
69
|
-
ru: ruLang,
|
|
70
|
-
pt: ptLang,
|
|
71
|
-
pl: plLang,
|
|
72
|
-
fr: frLang,
|
|
73
|
-
it: itLang,
|
|
74
|
-
nl: nlLang,
|
|
75
|
-
uk: ukLang,
|
|
76
|
-
'zh-cn': zhLang,
|
|
77
|
-
});
|
|
57
|
+
extendDeviceTypeTranslation();
|
|
78
58
|
setTypes(_types);
|
|
79
59
|
setTypesWords(_typesWords);
|
|
80
60
|
}, [props.supportedDevices, props.unsupportedDevices]);
|
|
@@ -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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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';\n\nimport enLang from './i18n/en.json';\nimport deLang from './i18n/de.json';\nimport ruLang from './i18n/ru.json';\nimport ptLang from './i18n/pt.json';\nimport plLang from './i18n/pl.json';\nimport frLang from './i18n/fr.json';\nimport itLang from './i18n/it.json';\nimport nlLang from './i18n/nl.json';\nimport ukLang from './i18n/uk.json';\nimport zhLang from './i18n/zh-cn.json';\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 => props.supportedDevices?.includes(id as Types) && !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 as Types] === _typesWords[b as Types]) {\n return 0;\n }\n return _typesWords[a as Types]!.localeCompare(_typesWords[b as Types]!, 'de');\n });\n\n I18n.extendTranslations({\n en: enLang,\n de: deLang,\n ru: ruLang,\n pt: ptLang,\n pl: plLang,\n fr: frLang,\n it: itLang,\n nl: nlLang,\n uk: ukLang,\n 'zh-cn': zhLang,\n });\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,O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AG,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 => props.supportedDevices?.includes(id as Types) && !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 as Types] === _typesWords[b as Types]) {\n return 0;\n }\n return _typesWords[a as Types]!.localeCompare(_typesWords[b as Types]!, '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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function extendDeviceTypeTranslation(): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { I18n } from '../../i18n';
|
|
2
|
+
import enLang from './i18n/en.json';
|
|
3
|
+
import deLang from './i18n/de.json';
|
|
4
|
+
import ruLang from './i18n/ru.json';
|
|
5
|
+
import ptLang from './i18n/pt.json';
|
|
6
|
+
import plLang from './i18n/pl.json';
|
|
7
|
+
import frLang from './i18n/fr.json';
|
|
8
|
+
import itLang from './i18n/it.json';
|
|
9
|
+
import nlLang from './i18n/nl.json';
|
|
10
|
+
import ukLang from './i18n/uk.json';
|
|
11
|
+
import zhLang from './i18n/zh-cn.json';
|
|
12
|
+
export function extendDeviceTypeTranslation() {
|
|
13
|
+
I18n.extendTranslations({
|
|
14
|
+
en: enLang,
|
|
15
|
+
de: deLang,
|
|
16
|
+
ru: ruLang,
|
|
17
|
+
pt: ptLang,
|
|
18
|
+
pl: plLang,
|
|
19
|
+
fr: frLang,
|
|
20
|
+
it: itLang,
|
|
21
|
+
nl: nlLang,
|
|
22
|
+
uk: ukLang,
|
|
23
|
+
'zh-cn': zhLang,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=deviceTypeTranslations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceTypeTranslations.js","sourceRoot":"./src/","sources":["Components/DeviceType/deviceTypeTranslations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,UAAU,2BAA2B;IACvC,IAAI,CAAC,kBAAkB,CAAC;QACpB,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,OAAO,EAAE,MAAM;KAClB,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { I18n } from '../../i18n';\nimport enLang from './i18n/en.json';\nimport deLang from './i18n/de.json';\nimport ruLang from './i18n/ru.json';\nimport ptLang from './i18n/pt.json';\nimport plLang from './i18n/pl.json';\nimport frLang from './i18n/fr.json';\nimport itLang from './i18n/it.json';\nimport nlLang from './i18n/nl.json';\nimport ukLang from './i18n/uk.json';\nimport zhLang from './i18n/zh-cn.json';\n\nexport function extendDeviceTypeTranslation() {\n I18n.extendTranslations({\n en: enLang,\n de: deLang,\n ru: ruLang,\n pt: ptLang,\n pl: plLang,\n fr: frLang,\n it: itLang,\n nl: nlLang,\n uk: ukLang,\n 'zh-cn': zhLang,\n });\n}\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { Image } from './Components/Image';
|
|
|
15
15
|
export { DeviceTypeSelector } from './Components/DeviceType/DeviceTypeSelector';
|
|
16
16
|
export { DeviceTypeIcon } from './Components/DeviceType/DeviceTypeIcon';
|
|
17
17
|
export { STATES_NAME_ICONS } from './Components/DeviceType/DeviceTypeOptions';
|
|
18
|
+
export { extendDeviceTypeTranslation } from './Components/DeviceType/deviceTypeTranslations';
|
|
18
19
|
export { Loader } from './Components/Loader';
|
|
19
20
|
export { Logo } from './Components/Logo';
|
|
20
21
|
export { MDUtils } from './Components/MDUtils';
|
package/build/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { Image } from './Components/Image';
|
|
|
15
15
|
export { DeviceTypeSelector } from './Components/DeviceType/DeviceTypeSelector';
|
|
16
16
|
export { DeviceTypeIcon } from './Components/DeviceType/DeviceTypeIcon';
|
|
17
17
|
export { STATES_NAME_ICONS } from './Components/DeviceType/DeviceTypeOptions';
|
|
18
|
+
export { extendDeviceTypeTranslation } from './Components/DeviceType/deviceTypeTranslations';
|
|
18
19
|
export { Loader } from './Components/Loader';
|
|
19
20
|
export { Logo } from './Components/Logo';
|
|
20
21
|
export { MDUtils } from './Components/MDUtils';
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"./src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACH,WAAW,EA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AE,MAAM,sBAAsB,CAAC,CAAC,aAAa;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,IAAI,SAAS,EAAE,MAAM,qBAAqB,CAAC,CAAC,aAAa;AACjF,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACH,gBAAgB,EAMhB,aAAa,GAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAIH,eAAe,EACf,eAAe,EACf,cAAc,EACd,WAAW,EACX,UAAU,GACb,MAAM,qBAAqB,CAAC;AAgB7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC","sourcesContent":["export { Theme } from './Theme';\nexport { GenericApp } from './GenericApp';\nexport { I18n } from './i18n';\nexport { printPrompt } from './Prompt';\nexport { ColorPicker } from './Components/ColorPicker';\nexport { ComplexCron } from './Components/ComplexCron';\nexport { copy } from './Components/CopyToClipboard';\nexport { CustomModal } from './Components/CustomModal';\nexport {\n FileBrowser,\n type MetaACL,\n type MetaObject,\n type FileBrowserProps,\n type FolderOrFileItem,\n type Folders,\n FileBrowserClass,\n} from './Components/FileBrowser';\nexport {\n EXTENSIONS,\n FileViewer,\n FileViewerClass,\n type FileViewerProps,\n type FileViewerState,\n} from './Components/FileViewer';\nexport { getSystemIcon, getSelectIdIcon, Icon } from './Components/Icon';\nexport { IconPicker } from './Components/IconPicker';\nexport { IconSelector } from './Components/IconSelector';\nexport { Image } from './Components/Image';\nexport { DeviceTypeSelector } from './Components/DeviceType/DeviceTypeSelector';\nexport { DeviceTypeIcon } from './Components/DeviceType/DeviceTypeIcon';\nexport { STATES_NAME_ICONS } from './Components/DeviceType/DeviceTypeOptions';\nexport { Loader } from './Components/Loader';\nexport { Logo } from './Components/Logo';\nexport { MDUtils } from './Components/MDUtils';\nexport {\n type TreeItemData,\n type TreeItem,\n type ObjectBrowserFilter,\n type ObjectBrowserCustomFilter,\n type ObjectBrowserColumn,\n type ObjectBrowserProps,\n ObjectBrowserClass,\n ObjectBrowser,\n getSelectIdIconFromObjects,\n ITEM_IMAGES,\n} from './Components/ObjectBrowser';\nexport { InfoBox } from './Components/InfoBox';\nexport { Router } from './Components/Router';\nexport { SaveCloseButtons } from './Components/SaveCloseButtons';\nexport { Schedule, type ScheduleConfig } from './Components/Schedule';\nexport { SelectWithIcon } from './Components/SelectWithIcon';\nexport { TabContainer } from './Components/TabContainer';\nexport { TabContent } from './Components/TabContent';\nexport { TabHeader } from './Components/TabHeader';\nexport { TableResize } from './Components/TableResize';\nexport { TextWithIcon } from './Components/TextWithIcon';\nexport { ToggleThemeMenu } from './Components/ToggleThemeMenu';\nexport { TreeTable } from './Components/TreeTable';\nexport { UploadImage } from './Components/UploadImage';\nexport { Utils } from './Components/Utils';\nexport { withWidth } from './Components/withWidth';\nexport { cron2state, SimpleCron } from './Components/SimpleCron';\nexport { convertCronToText } from './Components/SimpleCron/cronText';\nexport { LoaderVendor } from './Components/Loaders/Vendor';\nexport { LoaderPT } from './Components/Loaders/PT';\nexport { LoaderMV } from './Components/Loaders/MV';\nexport { type IconProps } from './Components/Icon';\nexport { type IconsIconProps } from './icons/types';\nexport { IconAdapter } from './icons/IconAdapter';\nexport { IconAlias } from './icons/IconAlias';\nexport { IconButtonImage } from './icons/IconButtonImage';\nexport { IconChannel } from './icons/IconChannel';\nexport { IconClearFilter } from './icons/IconClearFilter';\nexport { IconClosed } from './icons/IconClosed';\nexport { IconCopy } from './icons/IconCopy';\nexport { IconDevice } from './icons/IconDevice';\nexport { IconDocument } from './icons/IconDocument';\nexport { IconDocumentReadOnly } from './icons/IconDocumentReadOnly';\nexport { IconExpert } from './icons/IconExpert';\nexport { IconFx } from './icons/IconFx';\nexport { IconInstance } from './icons/IconInstance';\nexport { IconLogout } from './icons/IconLogout';\nexport { IconNoIcon } from './icons/IconNoIcon';\nexport { IconOpen } from './icons/IconOpen';\nexport { IconState } from './icons/IconState';\nexport { IconVacuum } from './icons/IconVacuum';\nexport { DialogComplexCron } from './Dialogs/ComplexCron';\nexport { DialogComplexCron as ComplexCronDialog } from './Dialogs/ComplexCron'; // deprecated\nexport { DialogConfirm } from './Dialogs/Confirm';\nexport { DialogConfirm as Confirm } from './Dialogs/Confirm'; // deprecated\nexport { DialogCron } from './Dialogs/Cron';\nexport { DialogCron as Cron } from './Dialogs/Cron'; // deprecated\nexport { DialogError } from './Dialogs/Error';\nexport { DialogError as Error } from './Dialogs/Error'; // deprecated\nexport { DialogMessage } from './Dialogs/Message';\nexport { DialogMessage as Message } from './Dialogs/Message'; // deprecated\nexport { DialogSelectID } from './Dialogs/SelectID';\nexport { DialogSelectID as SelectID } from './Dialogs/SelectID'; // deprecated\nexport { DialogSelectFile } from './Dialogs/SelectFile';\nexport { DialogSelectFile as SelectFile } from './Dialogs/SelectFile'; // deprecated\nexport { DialogSimpleCron } from './Dialogs/SimpleCron';\nexport { DialogSimpleCron as SimpleCronDialog } from './Dialogs/SimpleCron'; // deprecated\nexport { DialogTextInput } from './Dialogs/TextInput';\nexport { DialogTextInput as TextInput } from './Dialogs/TextInput'; // deprecated\nexport { Connection, PROGRESS, ERRORS, PERMISSION_ERROR } from './Connection';\nexport { AdminConnection } from './AdminConnection';\nexport { dictionary } from './dictionary';\nexport {\n LegacyConnection,\n type ConnectOptions,\n type CompactSystemRepositoryEntry,\n type CompactSystemRepository,\n type SocketClient,\n type BinaryStateChangeHandler,\n pattern2RegEx,\n} from './LegacyConnection';\n\nexport {\n type IobUri,\n type IobUriType,\n type IobUriParsed,\n getAttrInObject,\n setAttrInObject,\n iobUriToString,\n iobUriParse,\n iobUriRead,\n} from './Components/IobUri';\n\nexport type {\n Translate,\n ConnectionProps,\n OldObject,\n ObjectChangeHandler,\n ThemeName,\n ThemeType,\n GenericAppProps,\n GenericAppSettings,\n IobTheme,\n Width,\n GenericAppState,\n} from './types';\n\nexport { moduleFederationShared } from './modulefederation.admin.config';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"./src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACH,WAAW,EAMX,gBAAgB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,UAAU,EACV,UAAU,EACV,eAAe,GAGlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,m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Theme';\nexport { GenericApp } from './GenericApp';\nexport { I18n } from './i18n';\nexport { printPrompt } from './Prompt';\nexport { ColorPicker } from './Components/ColorPicker';\nexport { ComplexCron } from './Components/ComplexCron';\nexport { copy } from './Components/CopyToClipboard';\nexport { CustomModal } from './Components/CustomModal';\nexport {\n FileBrowser,\n type MetaACL,\n type MetaObject,\n type FileBrowserProps,\n type FolderOrFileItem,\n type Folders,\n FileBrowserClass,\n} from './Components/FileBrowser';\nexport {\n EXTENSIONS,\n FileViewer,\n FileViewerClass,\n type FileViewerProps,\n type FileViewerState,\n} from './Components/FileViewer';\nexport { getSystemIcon, getSelectIdIcon, Icon } from './Components/Icon';\nexport { IconPicker } from './Components/IconPicker';\nexport { IconSelector } from './Components/IconSelector';\nexport { Image } from './Components/Image';\nexport { DeviceTypeSelector } from './Components/DeviceType/DeviceTypeSelector';\nexport { DeviceTypeIcon } from './Components/DeviceType/DeviceTypeIcon';\nexport { STATES_NAME_ICONS } from './Components/DeviceType/DeviceTypeOptions';\nexport { extendDeviceTypeTranslation } from './Components/DeviceType/deviceTypeTranslations';\nexport { Loader } from './Components/Loader';\nexport { Logo } from './Components/Logo';\nexport { MDUtils } from './Components/MDUtils';\nexport {\n type TreeItemData,\n type TreeItem,\n type ObjectBrowserFilter,\n type ObjectBrowserCustomFilter,\n type ObjectBrowserColumn,\n type ObjectBrowserProps,\n ObjectBrowserClass,\n ObjectBrowser,\n getSelectIdIconFromObjects,\n ITEM_IMAGES,\n} from './Components/ObjectBrowser';\nexport { InfoBox } from './Components/InfoBox';\nexport { Router } from './Components/Router';\nexport { SaveCloseButtons } from './Components/SaveCloseButtons';\nexport { Schedule, type ScheduleConfig } from './Components/Schedule';\nexport { SelectWithIcon } from './Components/SelectWithIcon';\nexport { TabContainer } from './Components/TabContainer';\nexport { TabContent } from './Components/TabContent';\nexport { TabHeader } from './Components/TabHeader';\nexport { TableResize } from './Components/TableResize';\nexport { TextWithIcon } from './Components/TextWithIcon';\nexport { ToggleThemeMenu } from './Components/ToggleThemeMenu';\nexport { TreeTable } from './Components/TreeTable';\nexport { UploadImage } from './Components/UploadImage';\nexport { Utils } from './Components/Utils';\nexport { withWidth } from './Components/withWidth';\nexport { cron2state, SimpleCron } from './Components/SimpleCron';\nexport { convertCronToText } from './Components/SimpleCron/cronText';\nexport { LoaderVendor } from './Components/Loaders/Vendor';\nexport { LoaderPT } from './Components/Loaders/PT';\nexport { LoaderMV } from './Components/Loaders/MV';\nexport { type IconProps } from './Components/Icon';\nexport { type IconsIconProps } from './icons/types';\nexport { IconAdapter } from './icons/IconAdapter';\nexport { IconAlias } from './icons/IconAlias';\nexport { IconButtonImage } from './icons/IconButtonImage';\nexport { IconChannel } from './icons/IconChannel';\nexport { IconClearFilter } from './icons/IconClearFilter';\nexport { IconClosed } from './icons/IconClosed';\nexport { IconCopy } from './icons/IconCopy';\nexport { IconDevice } from './icons/IconDevice';\nexport { IconDocument } from './icons/IconDocument';\nexport { IconDocumentReadOnly } from './icons/IconDocumentReadOnly';\nexport { IconExpert } from './icons/IconExpert';\nexport { IconFx } from './icons/IconFx';\nexport { IconInstance } from './icons/IconInstance';\nexport { IconLogout } from './icons/IconLogout';\nexport { IconNoIcon } from './icons/IconNoIcon';\nexport { IconOpen } from './icons/IconOpen';\nexport { IconState } from './icons/IconState';\nexport { IconVacuum } from './icons/IconVacuum';\nexport { DialogComplexCron } from './Dialogs/ComplexCron';\nexport { DialogComplexCron as ComplexCronDialog } from './Dialogs/ComplexCron'; // deprecated\nexport { DialogConfirm } from './Dialogs/Confirm';\nexport { DialogConfirm as Confirm } from './Dialogs/Confirm'; // deprecated\nexport { DialogCron } from './Dialogs/Cron';\nexport { DialogCron as Cron } from './Dialogs/Cron'; // deprecated\nexport { DialogError } from './Dialogs/Error';\nexport { DialogError as Error } from './Dialogs/Error'; // deprecated\nexport { DialogMessage } from './Dialogs/Message';\nexport { DialogMessage as Message } from './Dialogs/Message'; // deprecated\nexport { DialogSelectID } from './Dialogs/SelectID';\nexport { DialogSelectID as SelectID } from './Dialogs/SelectID'; // deprecated\nexport { DialogSelectFile } from './Dialogs/SelectFile';\nexport { DialogSelectFile as SelectFile } from './Dialogs/SelectFile'; // deprecated\nexport { DialogSimpleCron } from './Dialogs/SimpleCron';\nexport { DialogSimpleCron as SimpleCronDialog } from './Dialogs/SimpleCron'; // deprecated\nexport { DialogTextInput } from './Dialogs/TextInput';\nexport { DialogTextInput as TextInput } from './Dialogs/TextInput'; // deprecated\nexport { Connection, PROGRESS, ERRORS, PERMISSION_ERROR } from './Connection';\nexport { AdminConnection } from './AdminConnection';\nexport { dictionary } from './dictionary';\nexport {\n LegacyConnection,\n type ConnectOptions,\n type CompactSystemRepositoryEntry,\n type CompactSystemRepository,\n type SocketClient,\n type BinaryStateChangeHandler,\n pattern2RegEx,\n} from './LegacyConnection';\n\nexport {\n type IobUri,\n type IobUriType,\n type IobUriParsed,\n getAttrInObject,\n setAttrInObject,\n iobUriToString,\n iobUriParse,\n iobUriRead,\n} from './Components/IobUri';\n\nexport type {\n Translate,\n ConnectionProps,\n OldObject,\n ObjectChangeHandler,\n ThemeName,\n ThemeType,\n GenericAppProps,\n GenericAppSettings,\n IobTheme,\n Width,\n GenericAppState,\n} from './types';\n\nexport { moduleFederationShared } from './modulefederation.admin.config';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/adapter-react-v5",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.14",
|
|
4
4
|
"description": "React components to develop ioBroker interfaces with react.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "bluefox",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@iobroker/js-controller-common": "^7.0.7",
|
|
59
59
|
"@iobroker/js-controller-common-db": "^7.0.7",
|
|
60
60
|
"@iobroker/socket-client": "4.1.2",
|
|
61
|
-
"@iobroker/type-detector": "^4.3.
|
|
61
|
+
"@iobroker/type-detector": "^4.3.1",
|
|
62
62
|
"@iobroker/types": "^7.0.7",
|
|
63
63
|
"@mui/icons-material": "^6.4.10",
|
|
64
64
|
"@mui/material": "^6.4.10",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"ts-node": "^10.9.2",
|
|
82
82
|
"typescript": "~5.8.3"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "f3a663a75ebaf4c7fad8655eb32f83cc0cbd61fd"
|
|
85
85
|
}
|