@iobroker/adapter-react-v5 7.6.9 → 7.6.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/build/Components/{TypeSelector/TypeIcon.d.ts → DeviceType/DeviceTypeIcon.d.ts} +1 -1
- package/build/Components/{TypeSelector/TypeIcon.js → DeviceType/DeviceTypeIcon.js} +27 -11
- package/build/Components/DeviceType/DeviceTypeIcon.js.map +1 -0
- package/build/Components/DeviceType/DeviceTypeOptions.d.ts +2 -0
- package/build/Components/DeviceType/DeviceTypeOptions.js +69 -0
- package/build/Components/DeviceType/DeviceTypeOptions.js.map +1 -0
- package/build/Components/{TypeSelector/TypeSelector.d.ts → DeviceType/DeviceTypeSelector.d.ts} +6 -8
- package/build/Components/{TypeSelector/TypeSelector.js → DeviceType/DeviceTypeSelector.js} +32 -22
- package/build/Components/DeviceType/DeviceTypeSelector.js.map +1 -0
- package/build/Components/DeviceType/i18n/de.json +45 -0
- package/build/Components/DeviceType/i18n/en.json +45 -0
- package/build/Components/DeviceType/i18n/fr.json +45 -0
- package/build/Components/DeviceType/i18n/it.json +45 -0
- package/build/Components/DeviceType/i18n/nl.json +45 -0
- package/build/Components/DeviceType/i18n/pl.json +45 -0
- package/build/Components/DeviceType/i18n/pt.json +45 -0
- package/build/Components/DeviceType/i18n/ru.json +45 -0
- package/build/Components/DeviceType/i18n/uk.json +45 -0
- package/build/Components/DeviceType/i18n/zh-cn.json +45 -0
- package/build/Components/DeviceType/icons/Cleaner.js.map +1 -0
- package/build/Components/DeviceType/icons/DoorClosed.js.map +1 -0
- package/build/Components/DeviceType/icons/DoorOpened.js.map +1 -0
- package/build/Components/DeviceType/icons/FireOff.js.map +1 -0
- package/build/Components/DeviceType/icons/FireOn.js.map +1 -0
- package/build/Components/DeviceType/icons/FloodOff.js.map +1 -0
- package/build/Components/DeviceType/icons/FloodOn.js.map +1 -0
- package/build/Components/DeviceType/icons/Gate.js.map +1 -0
- package/build/Components/DeviceType/icons/HeatValve.js.map +1 -0
- package/build/Components/DeviceType/icons/Home.js.map +1 -0
- package/build/Components/DeviceType/icons/Humidity.js.map +1 -0
- package/build/Components/DeviceType/icons/IconHome.js.map +1 -0
- package/build/Components/DeviceType/icons/Jalousie.js.map +1 -0
- package/build/Components/DeviceType/icons/Material.js.map +1 -0
- package/build/Components/DeviceType/icons/MotionOff.js.map +1 -0
- package/build/Components/DeviceType/icons/MotionOn.js.map +1 -0
- package/build/Components/DeviceType/icons/PushButton.js.map +1 -0
- package/build/Components/DeviceType/icons/RGB.js.map +1 -0
- package/build/Components/DeviceType/icons/RepairExpert.js.map +1 -0
- package/build/Components/DeviceType/icons/Socket.js.map +1 -0
- package/build/Components/DeviceType/icons/Thermometer.js.map +1 -0
- package/build/Components/DeviceType/icons/ThermometerSimple.js.map +1 -0
- package/build/Components/DeviceType/icons/Thermostat.js.map +1 -0
- package/build/Components/DeviceType/icons/Valve.js.map +1 -0
- package/build/Components/DeviceType/icons/WindowClosed.js.map +1 -0
- package/build/Components/DeviceType/icons/WindowOpened.js.map +1 -0
- package/build/Components/DeviceType/icons/WindowTilted.js.map +1 -0
- package/build/Components/DeviceType/icons/index.js.map +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +3 -2
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/build/Components/TypeSelector/TypeIcon.js.map +0 -1
- package/build/Components/TypeSelector/TypeOptions.d.ts +0 -8
- package/build/Components/TypeSelector/TypeOptions.js +0 -125
- package/build/Components/TypeSelector/TypeOptions.js.map +0 -1
- package/build/Components/TypeSelector/TypeSelector.js.map +0 -1
- package/build/Components/TypeSelector/icons/Cleaner.js.map +0 -1
- package/build/Components/TypeSelector/icons/DoorClosed.js.map +0 -1
- package/build/Components/TypeSelector/icons/DoorOpened.js.map +0 -1
- package/build/Components/TypeSelector/icons/FireOff.js.map +0 -1
- package/build/Components/TypeSelector/icons/FireOn.js.map +0 -1
- package/build/Components/TypeSelector/icons/FloodOff.js.map +0 -1
- package/build/Components/TypeSelector/icons/FloodOn.js.map +0 -1
- package/build/Components/TypeSelector/icons/Gate.js.map +0 -1
- package/build/Components/TypeSelector/icons/HeatValve.js.map +0 -1
- package/build/Components/TypeSelector/icons/Home.js.map +0 -1
- package/build/Components/TypeSelector/icons/Humidity.js.map +0 -1
- package/build/Components/TypeSelector/icons/IconHome.js.map +0 -1
- package/build/Components/TypeSelector/icons/Jalousie.js.map +0 -1
- package/build/Components/TypeSelector/icons/Material.js.map +0 -1
- package/build/Components/TypeSelector/icons/MotionOff.js.map +0 -1
- package/build/Components/TypeSelector/icons/MotionOn.js.map +0 -1
- package/build/Components/TypeSelector/icons/PushButton.js.map +0 -1
- package/build/Components/TypeSelector/icons/RGB.js.map +0 -1
- package/build/Components/TypeSelector/icons/RepairExpert.js.map +0 -1
- package/build/Components/TypeSelector/icons/Socket.js.map +0 -1
- package/build/Components/TypeSelector/icons/Thermometer.js.map +0 -1
- package/build/Components/TypeSelector/icons/ThermometerSimple.js.map +0 -1
- package/build/Components/TypeSelector/icons/Thermostat.js.map +0 -1
- package/build/Components/TypeSelector/icons/Valve.js.map +0 -1
- package/build/Components/TypeSelector/icons/WindowClosed.js.map +0 -1
- package/build/Components/TypeSelector/icons/WindowOpened.js.map +0 -1
- package/build/Components/TypeSelector/icons/WindowTilted.js.map +0 -1
- package/build/Components/TypeSelector/icons/index.js.map +0 -1
- /package/build/Components/{TypeSelector → DeviceType}/icons/Cleaner.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Cleaner.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/DoorClosed.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/DoorClosed.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/DoorOpened.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/DoorOpened.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/FireOff.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/FireOff.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/FireOn.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/FireOn.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/FloodOff.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/FloodOff.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/FloodOn.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/FloodOn.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Gate.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Gate.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/HeatValve.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/HeatValve.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Home.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Home.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Humidity.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Humidity.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/IconHome.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/IconHome.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Jalousie.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Jalousie.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Material.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Material.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/MotionOff.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/MotionOff.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/MotionOn.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/MotionOn.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/PushButton.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/PushButton.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/RGB.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/RGB.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/RepairExpert.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/RepairExpert.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Socket.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Socket.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Thermometer.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Thermometer.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/ThermometerSimple.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/ThermometerSimple.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Thermostat.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Thermostat.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Valve.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/Valve.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/WindowClosed.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/WindowClosed.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/WindowOpened.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/WindowOpened.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/WindowTilted.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/WindowTilted.js +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/index.d.ts +0 -0
- /package/build/Components/{TypeSelector → DeviceType}/icons/index.js +0 -0
|
@@ -26,4 +26,4 @@ export interface IconProps {
|
|
|
26
26
|
export type TypeIconProps = IconProps & {
|
|
27
27
|
type?: TypesExtended;
|
|
28
28
|
};
|
|
29
|
-
export declare function
|
|
29
|
+
export declare function DeviceTypeIcon(props: TypeIconProps): React.JSX.Element | null;
|
|
@@ -71,23 +71,39 @@ const TYPE_ICONS = {
|
|
|
71
71
|
hub5: TypeIconHub5,
|
|
72
72
|
controller: TypeIconController,
|
|
73
73
|
};
|
|
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';
|
|
74
84
|
const defaultStyle = {
|
|
75
85
|
width: 32,
|
|
76
86
|
height: 32,
|
|
77
87
|
};
|
|
78
|
-
export function
|
|
79
|
-
const
|
|
80
|
-
const [loaded, setLoaded] = React.useState(window.iobTypeWordsLoaded === language);
|
|
88
|
+
export function DeviceTypeIcon(props) {
|
|
89
|
+
const [loaded, setLoaded] = React.useState(false);
|
|
81
90
|
useEffect(() => {
|
|
82
|
-
if (props.title &&
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
if (props.title && !loaded) {
|
|
92
|
+
I18n.extendTranslations({
|
|
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,
|
|
88
103
|
});
|
|
104
|
+
setLoaded(true);
|
|
89
105
|
}
|
|
90
|
-
}, [
|
|
106
|
+
}, [props.title]);
|
|
91
107
|
if (!loaded && props.title) {
|
|
92
108
|
return (React.createElement(Box, { style: { ...defaultStyle, ...(props.style || undefined) }, className: props.className, sx: props.sx }));
|
|
93
109
|
}
|
|
@@ -108,4 +124,4 @@ export function TypeIcon(props) {
|
|
|
108
124
|
}
|
|
109
125
|
return icon;
|
|
110
126
|
}
|
|
111
|
-
//# sourceMappingURL=
|
|
127
|
+
//# sourceMappingURL=DeviceTypeIcon.js.map
|
|
@@ -0,0 +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,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,KAA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AAK,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"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { FcElectricalSensor } from 'react-icons/fc';
|
|
2
|
+
import { SiBoost } from 'react-icons/si';
|
|
3
|
+
import { TiCogOutline as IconWorking } from 'react-icons/ti';
|
|
4
|
+
import { MdPermScanWifi as IconUnreach, MdPriorityHigh as IconMaintain, MdBatteryAlert as IconLowbat, MdError as IconError, MdDirections, MdGpsFixed, MdWork, MdDeveloperMode, } from 'react-icons/md';
|
|
5
|
+
import { AiOutlineAppstoreAdd, AiOutlineRadiusBottomleft, AiOutlineColumnHeight, AiOutlineColumnWidth, AiOutlineSwap, AiFillPauseCircle, AiOutlinePoweroff, } from 'react-icons/ai';
|
|
6
|
+
import { BiLastPage } from 'react-icons/bi';
|
|
7
|
+
import { FaCompressArrowsAlt, FaRunning, FaSun, FaCompress, FaVolumeMute, FaToggleOn, FaDoorOpen, } from 'react-icons/fa';
|
|
8
|
+
import { GiElectricalResistance, GiLaserPrecision, GiStopSign, GiNuclearWaste, GiMatterStates, GiTreeSwing, GiSpeedometer, GiElectric, GiLightningFrequency, } from 'react-icons/gi';
|
|
9
|
+
import { IoIosColorPalette, IoIosWater } from 'react-icons/io';
|
|
10
|
+
import { WiDaySunny, WiFire, WiHumidity, WiSmoke, WiThermometer } from 'react-icons/wi';
|
|
11
|
+
import { FiPower } from 'react-icons/fi';
|
|
12
|
+
import { HiOutlineLightBulb } from 'react-icons/hi';
|
|
13
|
+
import { ImPower } from 'react-icons/im';
|
|
14
|
+
import { WindowTilted } from './icons';
|
|
15
|
+
export const STATES_NAME_ICONS = {
|
|
16
|
+
SET: AiOutlineAppstoreAdd,
|
|
17
|
+
WORKING: MdWork,
|
|
18
|
+
UNREACH: IconUnreach,
|
|
19
|
+
LOWBAT: IconLowbat,
|
|
20
|
+
MAINTAIN: IconMaintain,
|
|
21
|
+
ERROR: IconError,
|
|
22
|
+
DIRECTION: MdDirections,
|
|
23
|
+
CONNECTED: IconUnreach,
|
|
24
|
+
ACTUAL: IconWorking,
|
|
25
|
+
SECOND: BiLastPage,
|
|
26
|
+
PRESS_LONG: FaCompressArrowsAlt,
|
|
27
|
+
PRESS: FaCompress,
|
|
28
|
+
MUTE: FaVolumeMute,
|
|
29
|
+
ACCURACY: GiLaserPrecision,
|
|
30
|
+
RADIUS: AiOutlineRadiusBottomleft,
|
|
31
|
+
ELEVATION: AiOutlineColumnHeight,
|
|
32
|
+
LATITUDE: AiOutlineColumnWidth,
|
|
33
|
+
LONGITUDE: AiOutlineSwap,
|
|
34
|
+
GPS: MdGpsFixed,
|
|
35
|
+
ON_ACTUAL: FaToggleOn,
|
|
36
|
+
ON_SET: FaToggleOn,
|
|
37
|
+
OPEN: FaDoorOpen,
|
|
38
|
+
STOP: GiStopSign,
|
|
39
|
+
WATER_ALARM: IoIosWater, // water
|
|
40
|
+
WASTE_ALARM: GiNuclearWaste,
|
|
41
|
+
PAUSE: AiFillPauseCircle,
|
|
42
|
+
STATE: GiMatterStates,
|
|
43
|
+
BATTERY: IconLowbat,
|
|
44
|
+
WASTE: GiNuclearWaste,
|
|
45
|
+
WATER: IoIosWater,
|
|
46
|
+
WORK_MODE: MdWork,
|
|
47
|
+
MODE: MdDeveloperMode,
|
|
48
|
+
POWER: AiOutlinePoweroff,
|
|
49
|
+
BOOST: SiBoost,
|
|
50
|
+
HUMIDITY: WiHumidity,
|
|
51
|
+
TEMPERATURE: WiThermometer,
|
|
52
|
+
BRIGHTNESS: WiDaySunny,
|
|
53
|
+
MOTION: FaRunning,
|
|
54
|
+
FIRE: WiFire,
|
|
55
|
+
WINDOW: WindowTilted,
|
|
56
|
+
SMOKE: WiSmoke,
|
|
57
|
+
SWING: GiTreeSwing,
|
|
58
|
+
SPEED: GiSpeedometer,
|
|
59
|
+
DIMMER: HiOutlineLightBulb,
|
|
60
|
+
ON: FiPower,
|
|
61
|
+
COLOR_TEMP: FaSun,
|
|
62
|
+
ELECTRIC_POWER: ImPower,
|
|
63
|
+
CURRENT: GiElectric,
|
|
64
|
+
VOLTAGE: GiElectricalResistance,
|
|
65
|
+
CONSUMPTION: FcElectricalSensor,
|
|
66
|
+
FREQUENCY: GiLightningFrequency,
|
|
67
|
+
HUE: IoIosColorPalette,
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=DeviceTypeOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceTypeOptions.js","sourceRoot":"./src/","sources":["Components/DeviceType/DeviceTypeOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,IAA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TiCogOutline as IconWorking } from 'react-icons/ti';\nimport {\n MdPermScanWifi as IconUnreach,\n MdPriorityHigh as IconMaintain,\n MdBatteryAlert as IconLowbat,\n MdError as IconError,\n MdDirections,\n MdGpsFixed,\n MdWork,\n MdDeveloperMode,\n} from 'react-icons/md';\nimport {\n AiOutlineAppstoreAdd,\n AiOutlineRadiusBottomleft,\n AiOutlineColumnHeight,\n AiOutlineColumnWidth,\n AiOutlineSwap,\n AiFillPauseCircle,\n AiOutlinePoweroff,\n} from 'react-icons/ai';\nimport { BiLastPage } from 'react-icons/bi';\nimport {\n FaCompressArrowsAlt,\n FaRunning,\n FaSun,\n FaCompress,\n FaVolumeMute,\n FaToggleOn,\n FaDoorOpen,\n} from 'react-icons/fa';\nimport {\n GiElectricalResistance,\n GiLaserPrecision,\n GiStopSign,\n GiNuclearWaste,\n GiMatterStates,\n GiTreeSwing,\n GiSpeedometer,\n GiElectric,\n GiLightningFrequency,\n} from 'react-icons/gi';\nimport { IoIosColorPalette, IoIosWater } from 'react-icons/io';\nimport { WiDaySunny, WiFire, WiHumidity, WiSmoke, WiThermometer } from 'react-icons/wi';\nimport { FiPower } from 'react-icons/fi';\nimport { HiOutlineLightBulb } from 'react-icons/hi';\nimport { ImPower } from 'react-icons/im';\nimport type { IconType } from 'react-icons';\n\nimport { WindowTilted } from './icons';\n\nexport const STATES_NAME_ICONS: Record<string, IconType> = {\n SET: AiOutlineAppstoreAdd,\n WORKING: MdWork,\n UNREACH: IconUnreach,\n LOWBAT: IconLowbat,\n MAINTAIN: IconMaintain,\n ERROR: IconError,\n DIRECTION: MdDirections,\n CONNECTED: IconUnreach,\n ACTUAL: IconWorking,\n SECOND: BiLastPage,\n PRESS_LONG: FaCompressArrowsAlt,\n PRESS: FaCompress,\n MUTE: FaVolumeMute,\n ACCURACY: GiLaserPrecision,\n RADIUS: AiOutlineRadiusBottomleft,\n ELEVATION: AiOutlineColumnHeight,\n LATITUDE: AiOutlineColumnWidth,\n LONGITUDE: AiOutlineSwap,\n GPS: MdGpsFixed,\n ON_ACTUAL: FaToggleOn,\n ON_SET: FaToggleOn,\n OPEN: FaDoorOpen,\n STOP: GiStopSign,\n WATER_ALARM: IoIosWater, // water\n WASTE_ALARM: GiNuclearWaste,\n PAUSE: AiFillPauseCircle,\n STATE: GiMatterStates,\n BATTERY: IconLowbat,\n WASTE: GiNuclearWaste,\n WATER: IoIosWater,\n WORK_MODE: MdWork,\n MODE: MdDeveloperMode,\n POWER: AiOutlinePoweroff,\n BOOST: SiBoost,\n HUMIDITY: WiHumidity,\n TEMPERATURE: WiThermometer,\n BRIGHTNESS: WiDaySunny,\n MOTION: FaRunning,\n FIRE: WiFire,\n WINDOW: WindowTilted,\n SMOKE: WiSmoke,\n SWING: GiTreeSwing,\n SPEED: GiSpeedometer,\n DIMMER: HiOutlineLightBulb,\n ON: FiPower,\n COLOR_TEMP: FaSun,\n ELECTRIC_POWER: ImPower,\n CURRENT: GiElectric,\n VOLTAGE: GiElectricalResistance,\n CONSUMPTION: FcElectricalSensor,\n FREQUENCY: GiLightningFrequency,\n HUE: IoIosColorPalette,\n};\n"]}
|
package/build/Components/{TypeSelector/TypeSelector.d.ts → DeviceType/DeviceTypeSelector.d.ts}
RENAMED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Types } from '@iobroker/type-detector';
|
|
3
3
|
import type { ThemeType } from '../../types';
|
|
4
|
-
declare
|
|
5
|
-
interface Window {
|
|
6
|
-
iobTypeWordsLoaded: undefined | ioBroker.Languages;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export declare function TypeSelector(props: {
|
|
4
|
+
export declare function DeviceTypeSelector(props: {
|
|
10
5
|
themeType: ThemeType;
|
|
11
6
|
supportedDevices?: Types[];
|
|
12
7
|
unsupportedDevices?: Types[];
|
|
@@ -17,6 +12,9 @@ export declare function TypeSelector(props: {
|
|
|
17
12
|
sx?: Record<string, any>;
|
|
18
13
|
disabled?: boolean;
|
|
19
14
|
error?: boolean;
|
|
20
|
-
/** Show icons for applications: google, amazon, material, alias */
|
|
21
|
-
showApplications?:
|
|
15
|
+
/** Show icons for applications: google, amazon, material, alias. Used in devices */
|
|
16
|
+
showApplications?: {
|
|
17
|
+
TYPE_OPTIONS: Partial<Record<Types, Record<string, boolean>>>;
|
|
18
|
+
ICONS_TYPE: Record<string, React.JSX.Element>;
|
|
19
|
+
};
|
|
22
20
|
}): React.JSX.Element;
|
|
@@ -3,8 +3,17 @@ import { Box, FormControl, InputLabel, MenuItem, Select } from '@mui/material';
|
|
|
3
3
|
import { Types } from '@iobroker/type-detector';
|
|
4
4
|
import { I18n } from '../../i18n';
|
|
5
5
|
import { Icon } from '../Icon';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import { DeviceTypeIcon } from './DeviceTypeIcon';
|
|
7
|
+
import enLang from './i18n/en.json';
|
|
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';
|
|
8
17
|
const styles = {
|
|
9
18
|
itemChildrenWrapper: {
|
|
10
19
|
display: 'flex',
|
|
@@ -38,36 +47,37 @@ const styles = {
|
|
|
38
47
|
margin: '0 3px',
|
|
39
48
|
},
|
|
40
49
|
};
|
|
41
|
-
export function
|
|
50
|
+
export function DeviceTypeSelector(props) {
|
|
42
51
|
const [typesWords, setTypesWords] = React.useState({});
|
|
43
52
|
const [types, setTypes] = React.useState([]);
|
|
44
|
-
const language = I18n.getLanguage();
|
|
45
53
|
useEffect(() => {
|
|
46
54
|
const _typesWords = {};
|
|
47
55
|
Object.keys(Types)
|
|
48
56
|
.filter(id => props.supportedDevices?.includes(id) && !props.unsupportedDevices?.includes(id))
|
|
49
57
|
.forEach(typeId => (_typesWords[typeId] = I18n.t(`type-${Types[typeId]}`)));
|
|
50
58
|
// sort types by ABC in the current language
|
|
51
|
-
const _types = Object.keys(_typesWords)
|
|
59
|
+
const _types = Object.keys(_typesWords);
|
|
60
|
+
_types.sort((a, b) => {
|
|
52
61
|
if (_typesWords[a] === _typesWords[b]) {
|
|
53
62
|
return 0;
|
|
54
63
|
}
|
|
55
64
|
return _typesWords[a].localeCompare(_typesWords[b], 'de');
|
|
56
65
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
I18n.extendTranslations({
|
|
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
|
+
});
|
|
78
|
+
setTypes(_types);
|
|
79
|
+
setTypesWords(_typesWords);
|
|
80
|
+
}, [props.supportedDevices, props.unsupportedDevices]);
|
|
71
81
|
if (!types) {
|
|
72
82
|
return (React.createElement(Box, { style: {
|
|
73
83
|
...styles.type,
|
|
@@ -82,11 +92,11 @@ export function TypeSelector(props) {
|
|
|
82
92
|
React.createElement(Select, { variant: "standard", disabled: !!props.disabled, value: props.value, onChange: e => props.onChange(e.target.value) }, types.map(typeId => (React.createElement(MenuItem, { key: Types[typeId], value: Types[typeId] },
|
|
83
93
|
React.createElement("div", { style: styles.itemChildrenWrapper },
|
|
84
94
|
React.createElement("div", null,
|
|
85
|
-
React.createElement(
|
|
95
|
+
React.createElement(DeviceTypeIcon, { type: Types[typeId], style: {
|
|
86
96
|
...styles.selectIcon,
|
|
87
97
|
color: props.themeType === 'dark' ? '#FFFFFF' : '#000',
|
|
88
98
|
} }),
|
|
89
99
|
React.createElement("span", { style: styles.selectText }, typesWords[typeId])),
|
|
90
|
-
props.showApplications
|
|
100
|
+
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)))))));
|
|
91
101
|
}
|
|
92
|
-
//# sourceMappingURL=
|
|
102
|
+
//# sourceMappingURL=DeviceTypeSelector.js.map
|
|
@@ -0,0 +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;AAElD,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,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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"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type-Device type": "Gerätetyp",
|
|
3
|
+
"type-airCondition": "Klimaanlage",
|
|
4
|
+
"type-blind": "Jalousien",
|
|
5
|
+
"type-blindButtons": "Jalousie über Tasten gesteuert",
|
|
6
|
+
"type-button": "Taste",
|
|
7
|
+
"type-buttonSensor": "Taste mit Rückmeldung",
|
|
8
|
+
"type-camera": "Kamera",
|
|
9
|
+
"type-chart": "Diagramm",
|
|
10
|
+
"type-cie": "CIE Farblicht",
|
|
11
|
+
"type-ct": "Farbtemperatur",
|
|
12
|
+
"type-dimmer": "Dimmer",
|
|
13
|
+
"type-door": "Türsensor",
|
|
14
|
+
"type-fireAlarm": "Feueralarm",
|
|
15
|
+
"type-floodAlarm": "Wasseralarm",
|
|
16
|
+
"type-gate": "Tor-Steuerung",
|
|
17
|
+
"type-hue": "HUE-Licht",
|
|
18
|
+
"type-humidity": "Feuchtigkeit",
|
|
19
|
+
"type-illuminance": "Beleuchtungsstärke",
|
|
20
|
+
"type-image": "Bild",
|
|
21
|
+
"type-info": "Information",
|
|
22
|
+
"type-instance": "Instanz",
|
|
23
|
+
"type-light": "Licht",
|
|
24
|
+
"type-location": "Position",
|
|
25
|
+
"type-lock": "Schloss",
|
|
26
|
+
"type-media": "Mediaplayer",
|
|
27
|
+
"type-motion": "Bewegungssensor",
|
|
28
|
+
"type-rgb": "RGB-Licht",
|
|
29
|
+
"type-rgbSingle": "R,G,B-Licht Einzelwerte",
|
|
30
|
+
"type-rgbwSingle": "R,G,B,W-Licht Einzelwerte",
|
|
31
|
+
"type-slider": "Schieberegler",
|
|
32
|
+
"type-socket": "Steckdose",
|
|
33
|
+
"type-temperature": "Temperatur",
|
|
34
|
+
"type-thermostat": "Thermostat",
|
|
35
|
+
"type-url": "URL",
|
|
36
|
+
"type-vacuumCleaner": "Staubsauger",
|
|
37
|
+
"type-valve": "Ventil",
|
|
38
|
+
"type-volume": "Lautstärke",
|
|
39
|
+
"type-volumeGroup": "Lautstärke-Gruppe",
|
|
40
|
+
"type-warning": "Warnung",
|
|
41
|
+
"type-weatherCurrent": "Aktuelle Wetterlage",
|
|
42
|
+
"type-weatherForecast": "Wettervorhersage",
|
|
43
|
+
"type-window": "Fenstersensor",
|
|
44
|
+
"type-windowTilt": "Fensterkippung-Sensor"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type-Device type": "Device type",
|
|
3
|
+
"type-airCondition": "Air conditioner",
|
|
4
|
+
"type-blind": "Blinds",
|
|
5
|
+
"type-blindButtons": "Blind controlled by buttons",
|
|
6
|
+
"type-button": "Button",
|
|
7
|
+
"type-buttonSensor": "Button with feedback",
|
|
8
|
+
"type-camera": "Camera",
|
|
9
|
+
"type-chart": "Chart",
|
|
10
|
+
"type-cie": "CIE color light",
|
|
11
|
+
"type-ct": "Color temperature",
|
|
12
|
+
"type-dimmer": "Dimmer",
|
|
13
|
+
"type-door": "Door",
|
|
14
|
+
"type-fireAlarm": "Fire alarm",
|
|
15
|
+
"type-floodAlarm": "Flood alarm",
|
|
16
|
+
"type-gate": "Gate",
|
|
17
|
+
"type-hue": "HUE light",
|
|
18
|
+
"type-humidity": "Humidity",
|
|
19
|
+
"type-illuminance": "Illuminance",
|
|
20
|
+
"type-image": "Image",
|
|
21
|
+
"type-info": "Information",
|
|
22
|
+
"type-instance": "Instance",
|
|
23
|
+
"type-light": "Light",
|
|
24
|
+
"type-location": "Position",
|
|
25
|
+
"type-lock": "Lock",
|
|
26
|
+
"type-media": "Media-player",
|
|
27
|
+
"type-motion": "Motion sensor",
|
|
28
|
+
"type-rgb": "RGB light",
|
|
29
|
+
"type-rgbSingle": "R,G,B light - single states",
|
|
30
|
+
"type-rgbwSingle": "R,G,B,W light - single states",
|
|
31
|
+
"type-slider": "Slider",
|
|
32
|
+
"type-socket": "Socket",
|
|
33
|
+
"type-temperature": "Temperature",
|
|
34
|
+
"type-thermostat": "Thermostat",
|
|
35
|
+
"type-url": "URL",
|
|
36
|
+
"type-vacuumCleaner": "Vacuum cleaner",
|
|
37
|
+
"type-valve": "Valve",
|
|
38
|
+
"type-volume": "Volume",
|
|
39
|
+
"type-volumeGroup": "Volume group",
|
|
40
|
+
"type-warning": "Warning",
|
|
41
|
+
"type-weatherCurrent": "Current weather",
|
|
42
|
+
"type-weatherForecast": "Weather forecast",
|
|
43
|
+
"type-window": "Window sensor",
|
|
44
|
+
"type-windowTilt": "Window tilt sensor"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type-Device type": "Type d'appareil",
|
|
3
|
+
"type-airCondition": "Climatiseur",
|
|
4
|
+
"type-blind": "stores",
|
|
5
|
+
"type-blindButtons": "Store commandé par boutons",
|
|
6
|
+
"type-button": "bouton",
|
|
7
|
+
"type-buttonSensor": "Capteur de bouton",
|
|
8
|
+
"type-camera": "caméra",
|
|
9
|
+
"type-chart": "Graphique",
|
|
10
|
+
"type-cie": "lumière colorée CIE",
|
|
11
|
+
"type-ct": "Température de couleur",
|
|
12
|
+
"type-dimmer": "variateur",
|
|
13
|
+
"type-door": "porte",
|
|
14
|
+
"type-fireAlarm": "alarme incendie",
|
|
15
|
+
"type-floodAlarm": "alarme d'inondation",
|
|
16
|
+
"type-gate": "grille",
|
|
17
|
+
"type-hue": "Lumière HUE",
|
|
18
|
+
"type-humidity": "humidité",
|
|
19
|
+
"type-illuminance": "Éclairement",
|
|
20
|
+
"type-image": "image",
|
|
21
|
+
"type-info": "informations",
|
|
22
|
+
"type-instance": "exemple",
|
|
23
|
+
"type-light": "lumière",
|
|
24
|
+
"type-location": "emplacement",
|
|
25
|
+
"type-lock": "verrouillage",
|
|
26
|
+
"type-media": "médias",
|
|
27
|
+
"type-motion": "mouvement",
|
|
28
|
+
"type-rgb": "lumière RVB",
|
|
29
|
+
"type-rgbSingle": "Lumière RVB simple",
|
|
30
|
+
"type-rgbwSingle": "RGBW comme valeur unique",
|
|
31
|
+
"type-slider": "curseur",
|
|
32
|
+
"type-socket": "douille",
|
|
33
|
+
"type-temperature": "température",
|
|
34
|
+
"type-thermostat": "thermostat",
|
|
35
|
+
"type-url": "URL",
|
|
36
|
+
"type-vacuumCleaner": "Aspirateur",
|
|
37
|
+
"type-valve": "soupape",
|
|
38
|
+
"type-volume": "volume",
|
|
39
|
+
"type-volumeGroup": "groupe de volumes",
|
|
40
|
+
"type-warning": "avertissement",
|
|
41
|
+
"type-weatherCurrent": "météo actuelle",
|
|
42
|
+
"type-weatherForecast": "prévisions météorologiques",
|
|
43
|
+
"type-window": "fenêtre",
|
|
44
|
+
"type-windowTilt": "inclinaison de la fenêtre"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type-Device type": "Tipo di dispositivo",
|
|
3
|
+
"type-airCondition": "Condizionatore d'aria",
|
|
4
|
+
"type-blind": "tende",
|
|
5
|
+
"type-blindButtons": "Tenda controllata da pulsanti",
|
|
6
|
+
"type-button": "pulsante",
|
|
7
|
+
"type-buttonSensor": "Sensore del pulsante",
|
|
8
|
+
"type-camera": "telecamera",
|
|
9
|
+
"type-chart": "Grafico",
|
|
10
|
+
"type-cie": "Luce colorata CIE",
|
|
11
|
+
"type-ct": "Temperatura del colore",
|
|
12
|
+
"type-dimmer": "dimmer",
|
|
13
|
+
"type-door": "porta",
|
|
14
|
+
"type-fireAlarm": "allarme antincendio",
|
|
15
|
+
"type-floodAlarm": "allarme allagamento",
|
|
16
|
+
"type-gate": "cancello",
|
|
17
|
+
"type-hue": "Luce HUE",
|
|
18
|
+
"type-humidity": "umidità",
|
|
19
|
+
"type-illuminance": "Illuminamento",
|
|
20
|
+
"type-image": "immagine",
|
|
21
|
+
"type-info": "informazioni",
|
|
22
|
+
"type-instance": "esempio",
|
|
23
|
+
"type-light": "leggero",
|
|
24
|
+
"type-location": "posizione",
|
|
25
|
+
"type-lock": "serratura",
|
|
26
|
+
"type-media": "media",
|
|
27
|
+
"type-motion": "movimento",
|
|
28
|
+
"type-rgb": "luce RGB",
|
|
29
|
+
"type-rgbSingle": "Luce RGB singola",
|
|
30
|
+
"type-rgbwSingle": "RGBW come valore singolo",
|
|
31
|
+
"type-slider": "cursore",
|
|
32
|
+
"type-socket": "PRESA",
|
|
33
|
+
"type-temperature": "temperatura",
|
|
34
|
+
"type-thermostat": "termostato",
|
|
35
|
+
"type-url": "URL",
|
|
36
|
+
"type-vacuumCleaner": "Aspirapolvere",
|
|
37
|
+
"type-valve": "valvola",
|
|
38
|
+
"type-volume": "volume",
|
|
39
|
+
"type-volumeGroup": "gruppo di volumi",
|
|
40
|
+
"type-warning": "avvertimento",
|
|
41
|
+
"type-weatherCurrent": "meteo attuale",
|
|
42
|
+
"type-weatherForecast": "previsioni del tempo",
|
|
43
|
+
"type-window": "finestra",
|
|
44
|
+
"type-windowTilt": "inclinazione della finestra"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type-Device type": "Apparaattype",
|
|
3
|
+
"type-airCondition": "Airconditioner",
|
|
4
|
+
"type-blind": "jaloezieën",
|
|
5
|
+
"type-blindButtons": "Jaloezie bediend door knoppen",
|
|
6
|
+
"type-button": "knop",
|
|
7
|
+
"type-buttonSensor": "Knopsensor",
|
|
8
|
+
"type-camera": "camera",
|
|
9
|
+
"type-chart": "Grafiek",
|
|
10
|
+
"type-cie": "CIE-kleurenlicht",
|
|
11
|
+
"type-ct": "Kleurtemperatuur",
|
|
12
|
+
"type-dimmer": "dimmer",
|
|
13
|
+
"type-door": "deur",
|
|
14
|
+
"type-fireAlarm": "brandalarm",
|
|
15
|
+
"type-floodAlarm": "overstromingsalarm",
|
|
16
|
+
"type-gate": "hek",
|
|
17
|
+
"type-hue": "HUE-licht",
|
|
18
|
+
"type-humidity": "vochtigheid",
|
|
19
|
+
"type-illuminance": "Verlichtingssterkte",
|
|
20
|
+
"type-image": "afbeelding",
|
|
21
|
+
"type-info": "informatie",
|
|
22
|
+
"type-instance": "aanleg",
|
|
23
|
+
"type-light": "licht",
|
|
24
|
+
"type-location": "locatie",
|
|
25
|
+
"type-lock": "slot",
|
|
26
|
+
"type-media": "media",
|
|
27
|
+
"type-motion": "beweging",
|
|
28
|
+
"type-rgb": "RGB-licht",
|
|
29
|
+
"type-rgbSingle": "RGB-licht enkel",
|
|
30
|
+
"type-rgbwSingle": "RGBW als enkele waarde",
|
|
31
|
+
"type-slider": "schuifregelaar",
|
|
32
|
+
"type-socket": "stopcontact",
|
|
33
|
+
"type-temperature": "temperatuur",
|
|
34
|
+
"type-thermostat": "thermostaat",
|
|
35
|
+
"type-url": "URL",
|
|
36
|
+
"type-vacuumCleaner": "Stofzuiger",
|
|
37
|
+
"type-valve": "ventiel",
|
|
38
|
+
"type-volume": "volume",
|
|
39
|
+
"type-volumeGroup": "volumegroep",
|
|
40
|
+
"type-warning": "waarschuwing",
|
|
41
|
+
"type-weatherCurrent": "huidige weersomstandigheden",
|
|
42
|
+
"type-weatherForecast": "weersvoorspelling",
|
|
43
|
+
"type-window": "raam",
|
|
44
|
+
"type-windowTilt": "raamkanteling"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type-Device type": "Typ urządzenia",
|
|
3
|
+
"type-airCondition": "Klimatyzator",
|
|
4
|
+
"type-blind": "żaluzje",
|
|
5
|
+
"type-blindButtons": "Roleta sterowana przyciskami",
|
|
6
|
+
"type-button": "przycisk",
|
|
7
|
+
"type-buttonSensor": "Czujnik przycisku",
|
|
8
|
+
"type-camera": "kamera",
|
|
9
|
+
"type-chart": "Wykres",
|
|
10
|
+
"type-cie": "Światło kolorowe CIE",
|
|
11
|
+
"type-ct": "Temperatura barwowa",
|
|
12
|
+
"type-dimmer": "opornik",
|
|
13
|
+
"type-door": "drzwi",
|
|
14
|
+
"type-fireAlarm": "alarm pożarowy",
|
|
15
|
+
"type-floodAlarm": "alarm przeciwpowodziowy",
|
|
16
|
+
"type-gate": "brama",
|
|
17
|
+
"type-hue": "Światło HUE",
|
|
18
|
+
"type-humidity": "wilgotność",
|
|
19
|
+
"type-illuminance": "Natężenie oświetlenia",
|
|
20
|
+
"type-image": "obraz",
|
|
21
|
+
"type-info": "Informacje",
|
|
22
|
+
"type-instance": "przykład",
|
|
23
|
+
"type-light": "światło",
|
|
24
|
+
"type-location": "lokalizacja",
|
|
25
|
+
"type-lock": "zamek",
|
|
26
|
+
"type-media": "głoska bezdźwięczna",
|
|
27
|
+
"type-motion": "ruch",
|
|
28
|
+
"type-rgb": "Światło RGB",
|
|
29
|
+
"type-rgbSingle": "Pojedyncze światło RGB",
|
|
30
|
+
"type-rgbwSingle": "RGBW jako pojedyncza wartość",
|
|
31
|
+
"type-slider": "suwak",
|
|
32
|
+
"type-socket": "gniazdo",
|
|
33
|
+
"type-temperature": "temperatura",
|
|
34
|
+
"type-thermostat": "termostat",
|
|
35
|
+
"type-url": "Adres URL",
|
|
36
|
+
"type-vacuumCleaner": "Odkurzacz",
|
|
37
|
+
"type-valve": "zawór",
|
|
38
|
+
"type-volume": "tom",
|
|
39
|
+
"type-volumeGroup": "grupa woluminów",
|
|
40
|
+
"type-warning": "ostrzeżenie",
|
|
41
|
+
"type-weatherCurrent": "aktualna pogoda",
|
|
42
|
+
"type-weatherForecast": "prognoza pogody",
|
|
43
|
+
"type-window": "okno",
|
|
44
|
+
"type-windowTilt": "pochylenie okna"
|
|
45
|
+
}
|