@iobroker/adapter-react-v5 7.6.8 → 7.6.9
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/InfoBox.d.ts +1 -1
- package/build/Components/InfoBox.js +1 -1
- package/build/Components/InfoBox.js.map +1 -1
- package/build/Components/SelectWithIcon.d.ts +0 -1
- package/build/Components/SelectWithIcon.js +3 -3
- package/build/Components/SelectWithIcon.js.map +1 -1
- package/build/Components/TextWithIcon.d.ts +0 -1
- package/build/Components/TextWithIcon.js +3 -3
- package/build/Components/TextWithIcon.js.map +1 -1
- package/build/Components/TypeSelector/TypeIcon.d.ts +29 -0
- package/build/Components/TypeSelector/TypeIcon.js +111 -0
- package/build/Components/TypeSelector/TypeIcon.js.map +1 -0
- package/build/Components/TypeSelector/TypeOptions.d.ts +8 -0
- package/build/Components/TypeSelector/TypeOptions.js +125 -0
- package/build/Components/TypeSelector/TypeOptions.js.map +1 -0
- package/build/Components/TypeSelector/TypeSelector.d.ts +22 -0
- package/build/Components/TypeSelector/TypeSelector.js +92 -0
- package/build/Components/TypeSelector/TypeSelector.js.map +1 -0
- package/build/Components/TypeSelector/icons/Cleaner.d.ts +3 -0
- package/build/Components/TypeSelector/icons/Cleaner.js +14 -0
- package/build/Components/TypeSelector/icons/Cleaner.js.map +1 -0
- package/build/Components/TypeSelector/icons/DoorClosed.d.ts +3 -0
- package/build/Components/TypeSelector/icons/DoorClosed.js +7 -0
- package/build/Components/TypeSelector/icons/DoorClosed.js.map +1 -0
- package/build/Components/TypeSelector/icons/DoorOpened.d.ts +3 -0
- package/build/Components/TypeSelector/icons/DoorOpened.js +7 -0
- package/build/Components/TypeSelector/icons/DoorOpened.js.map +1 -0
- package/build/Components/TypeSelector/icons/FireOff.d.ts +3 -0
- package/build/Components/TypeSelector/icons/FireOff.js +8 -0
- package/build/Components/TypeSelector/icons/FireOff.js.map +1 -0
- package/build/Components/TypeSelector/icons/FireOn.d.ts +3 -0
- package/build/Components/TypeSelector/icons/FireOn.js +14 -0
- package/build/Components/TypeSelector/icons/FireOn.js.map +1 -0
- package/build/Components/TypeSelector/icons/FloodOff.d.ts +3 -0
- package/build/Components/TypeSelector/icons/FloodOff.js +11 -0
- package/build/Components/TypeSelector/icons/FloodOff.js.map +1 -0
- package/build/Components/TypeSelector/icons/FloodOn.d.ts +3 -0
- package/build/Components/TypeSelector/icons/FloodOn.js +18 -0
- package/build/Components/TypeSelector/icons/FloodOn.js.map +1 -0
- package/build/Components/TypeSelector/icons/Gate.d.ts +3 -0
- package/build/Components/TypeSelector/icons/Gate.js +8 -0
- package/build/Components/TypeSelector/icons/Gate.js.map +1 -0
- package/build/Components/TypeSelector/icons/HeatValve.d.ts +3 -0
- package/build/Components/TypeSelector/icons/HeatValve.js +6 -0
- package/build/Components/TypeSelector/icons/HeatValve.js.map +1 -0
- package/build/Components/TypeSelector/icons/Home.d.ts +3 -0
- package/build/Components/TypeSelector/icons/Home.js +6 -0
- package/build/Components/TypeSelector/icons/Home.js.map +1 -0
- package/build/Components/TypeSelector/icons/Humidity.d.ts +3 -0
- package/build/Components/TypeSelector/icons/Humidity.js +8 -0
- package/build/Components/TypeSelector/icons/Humidity.js.map +1 -0
- package/build/Components/TypeSelector/icons/IconHome.d.ts +5 -0
- package/build/Components/TypeSelector/icons/IconHome.js +21 -0
- package/build/Components/TypeSelector/icons/IconHome.js.map +1 -0
- package/build/Components/TypeSelector/icons/Jalousie.d.ts +3 -0
- package/build/Components/TypeSelector/icons/Jalousie.js +7 -0
- package/build/Components/TypeSelector/icons/Jalousie.js.map +1 -0
- package/build/Components/TypeSelector/icons/Material.d.ts +3 -0
- package/build/Components/TypeSelector/icons/Material.js +8 -0
- package/build/Components/TypeSelector/icons/Material.js.map +1 -0
- package/build/Components/TypeSelector/icons/MotionOff.d.ts +3 -0
- package/build/Components/TypeSelector/icons/MotionOff.js +11 -0
- package/build/Components/TypeSelector/icons/MotionOff.js.map +1 -0
- package/build/Components/TypeSelector/icons/MotionOn.d.ts +3 -0
- package/build/Components/TypeSelector/icons/MotionOn.js +7 -0
- package/build/Components/TypeSelector/icons/MotionOn.js.map +1 -0
- package/build/Components/TypeSelector/icons/PushButton.d.ts +3 -0
- package/build/Components/TypeSelector/icons/PushButton.js +9 -0
- package/build/Components/TypeSelector/icons/PushButton.js.map +1 -0
- package/build/Components/TypeSelector/icons/RGB.d.ts +3 -0
- package/build/Components/TypeSelector/icons/RGB.js +43 -0
- package/build/Components/TypeSelector/icons/RGB.js.map +1 -0
- package/build/Components/TypeSelector/icons/RepairExpert.d.ts +3 -0
- package/build/Components/TypeSelector/icons/RepairExpert.js +6 -0
- package/build/Components/TypeSelector/icons/RepairExpert.js.map +1 -0
- package/build/Components/TypeSelector/icons/Socket.d.ts +3 -0
- package/build/Components/TypeSelector/icons/Socket.js +8 -0
- package/build/Components/TypeSelector/icons/Socket.js.map +1 -0
- package/build/Components/TypeSelector/icons/Thermometer.d.ts +3 -0
- package/build/Components/TypeSelector/icons/Thermometer.js +7 -0
- package/build/Components/TypeSelector/icons/Thermometer.js.map +1 -0
- package/build/Components/TypeSelector/icons/ThermometerSimple.d.ts +3 -0
- package/build/Components/TypeSelector/icons/ThermometerSimple.js +8 -0
- package/build/Components/TypeSelector/icons/ThermometerSimple.js.map +1 -0
- package/build/Components/TypeSelector/icons/Thermostat.d.ts +3 -0
- package/build/Components/TypeSelector/icons/Thermostat.js +9 -0
- package/build/Components/TypeSelector/icons/Thermostat.js.map +1 -0
- package/build/Components/TypeSelector/icons/Valve.d.ts +3 -0
- package/build/Components/TypeSelector/icons/Valve.js +7 -0
- package/build/Components/TypeSelector/icons/Valve.js.map +1 -0
- package/build/Components/TypeSelector/icons/WindowClosed.d.ts +3 -0
- package/build/Components/TypeSelector/icons/WindowClosed.js +8 -0
- package/build/Components/TypeSelector/icons/WindowClosed.js.map +1 -0
- package/build/Components/TypeSelector/icons/WindowOpened.d.ts +3 -0
- package/build/Components/TypeSelector/icons/WindowOpened.js +9 -0
- package/build/Components/TypeSelector/icons/WindowOpened.js.map +1 -0
- package/build/Components/TypeSelector/icons/WindowTilted.d.ts +3 -0
- package/build/Components/TypeSelector/icons/WindowTilted.js +8 -0
- package/build/Components/TypeSelector/icons/WindowTilted.js.map +1 -0
- package/build/Components/TypeSelector/icons/index.d.ts +28 -0
- package/build/Components/TypeSelector/icons/index.js +28 -0
- package/build/Components/TypeSelector/icons/index.js.map +1 -0
- package/build/Dialogs/TextInput.d.ts +1 -1
- package/build/icons/IconAdapter.d.ts +2 -2
- package/build/icons/IconAdapter.js +4 -2
- package/build/icons/IconAdapter.js.map +1 -1
- package/build/icons/IconAlias.d.ts +2 -2
- package/build/icons/IconAlias.js +4 -2
- package/build/icons/IconAlias.js.map +1 -1
- package/build/icons/IconButtonImage.d.ts +2 -2
- package/build/icons/IconButtonImage.js +6 -4
- package/build/icons/IconButtonImage.js.map +1 -1
- package/build/icons/IconChannel.d.ts +2 -2
- package/build/icons/IconChannel.js +8 -6
- package/build/icons/IconChannel.js.map +1 -1
- package/build/icons/IconClearFilter.d.ts +2 -2
- package/build/icons/IconClearFilter.js +4 -2
- package/build/icons/IconClearFilter.js.map +1 -1
- package/build/icons/IconClosed.d.ts +2 -2
- package/build/icons/IconClosed.js +4 -2
- package/build/icons/IconClosed.js.map +1 -1
- package/build/icons/IconCopy.d.ts +2 -2
- package/build/icons/IconCopy.js +4 -2
- package/build/icons/IconCopy.js.map +1 -1
- package/build/icons/IconDevice.d.ts +2 -2
- package/build/icons/IconDevice.js +14 -12
- package/build/icons/IconDevice.js.map +1 -1
- package/build/icons/IconDocument.d.ts +2 -2
- package/build/icons/IconDocument.js +4 -2
- package/build/icons/IconDocument.js.map +1 -1
- package/build/icons/IconDocumentReadOnly.d.ts +2 -2
- package/build/icons/IconDocumentReadOnly.js +5 -3
- package/build/icons/IconDocumentReadOnly.js.map +1 -1
- package/build/icons/IconExpert.d.ts +2 -2
- package/build/icons/IconExpert.js +5 -3
- package/build/icons/IconExpert.js.map +1 -1
- package/build/icons/IconFx.d.ts +2 -2
- package/build/icons/IconFx.js +4 -2
- package/build/icons/IconFx.js.map +1 -1
- package/build/icons/IconInstance.d.ts +2 -2
- package/build/icons/IconInstance.js +4 -2
- package/build/icons/IconInstance.js.map +1 -1
- package/build/icons/IconLogout.d.ts +2 -2
- package/build/icons/IconLogout.js +5 -3
- package/build/icons/IconLogout.js.map +1 -1
- package/build/icons/IconNoIcon.d.ts +2 -2
- package/build/icons/IconNoIcon.js +4 -2
- package/build/icons/IconNoIcon.js.map +1 -1
- package/build/icons/IconOpen.d.ts +2 -2
- package/build/icons/IconOpen.js +4 -2
- package/build/icons/IconOpen.js.map +1 -1
- package/build/icons/IconState.d.ts +2 -2
- package/build/icons/IconState.js +5 -3
- package/build/icons/IconState.js.map +1 -1
- package/build/icons/IconVacuum.d.ts +2 -2
- package/build/icons/IconVacuum.js +10 -8
- package/build/icons/IconVacuum.js.map +1 -1
- package/build/index.d.ts +5 -2
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/package.json +8 -6
- package/build/Components/IconDeviceType.d.ts +0 -8
- package/build/Components/IconDeviceType.js +0 -212
- package/build/Components/IconDeviceType.js.map +0 -1
- package/build/icons/IconProps.d.ts +0 -15
- package/build/icons/IconProps.js +0 -2
- package/build/icons/IconProps.js.map +0 -1
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AcUnit, Air, Blinds, BlindsClosed, ColorLens, ControlCamera, DeviceHub, DirectionsRun, DoorSliding, Gradient, Hub, Image, Info, Lightbulb, LocationOn, Lock, Palette, PlayArrowRounded, Polyline, Power, QuestionMark, SensorDoor, Thermostat, Timeline, TipsAndUpdates, Tune, Videocam, VolumeUp, Warning, Water, WaterDrop, WbIridescent, WbSunny, Whatshot, Window, } from '@mui/icons-material';
|
|
3
|
-
import { Icon } from './Icon';
|
|
4
|
-
import { Utils } from './Utils';
|
|
5
|
-
import { IconButtonImage } from '../icons/IconButtonImage';
|
|
6
|
-
import { IconVacuum } from '../icons/IconVacuum';
|
|
7
|
-
import { IconInstance } from '../icons/IconInstance';
|
|
8
|
-
// Taken from type detector: https://github.com/ioBroker/ioBroker.type-detector/blob/master/src/types.ts#L27
|
|
9
|
-
const deviceTypes = [
|
|
10
|
-
'unknown',
|
|
11
|
-
'airCondition',
|
|
12
|
-
'blind',
|
|
13
|
-
'blindButtons',
|
|
14
|
-
'button',
|
|
15
|
-
'buttonSensor',
|
|
16
|
-
'camera',
|
|
17
|
-
'chart',
|
|
18
|
-
'cie',
|
|
19
|
-
'ct',
|
|
20
|
-
'dimmer',
|
|
21
|
-
'door',
|
|
22
|
-
'fireAlarm',
|
|
23
|
-
'floodAlarm',
|
|
24
|
-
'gate',
|
|
25
|
-
'hue',
|
|
26
|
-
'humidity',
|
|
27
|
-
'illuminance',
|
|
28
|
-
'image',
|
|
29
|
-
'info',
|
|
30
|
-
'instance',
|
|
31
|
-
'invalid',
|
|
32
|
-
'light',
|
|
33
|
-
'location',
|
|
34
|
-
'lock',
|
|
35
|
-
'media',
|
|
36
|
-
'motion',
|
|
37
|
-
'rgb',
|
|
38
|
-
'rgbSingle',
|
|
39
|
-
'rgbwSingle',
|
|
40
|
-
'slider',
|
|
41
|
-
'socket',
|
|
42
|
-
'temperature',
|
|
43
|
-
'thermostat',
|
|
44
|
-
'vacuumCleaner',
|
|
45
|
-
'volume',
|
|
46
|
-
'volumeGroup',
|
|
47
|
-
'warning',
|
|
48
|
-
'weatherCurrent',
|
|
49
|
-
'weatherForecast',
|
|
50
|
-
'window',
|
|
51
|
-
'windowTilt',
|
|
52
|
-
'hub3',
|
|
53
|
-
'node',
|
|
54
|
-
'controller',
|
|
55
|
-
'hub5',
|
|
56
|
-
];
|
|
57
|
-
export function isDeviceIcon(icon) {
|
|
58
|
-
if (deviceTypes.includes(icon)) {
|
|
59
|
-
return icon;
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
export function getDeviceIcon(type, props) {
|
|
64
|
-
let SvgComponent;
|
|
65
|
-
if (type === 'hub3') {
|
|
66
|
-
SvgComponent = DeviceHub;
|
|
67
|
-
}
|
|
68
|
-
if (type === 'node') {
|
|
69
|
-
SvgComponent = Polyline;
|
|
70
|
-
}
|
|
71
|
-
if (type === 'hub5') {
|
|
72
|
-
SvgComponent = Hub;
|
|
73
|
-
}
|
|
74
|
-
if (type === 'controller') {
|
|
75
|
-
SvgComponent = ControlCamera;
|
|
76
|
-
}
|
|
77
|
-
if (type === 'airCondition') {
|
|
78
|
-
SvgComponent = AcUnit;
|
|
79
|
-
}
|
|
80
|
-
if (type === 'blind') {
|
|
81
|
-
SvgComponent = Blinds;
|
|
82
|
-
}
|
|
83
|
-
if (type === 'camera') {
|
|
84
|
-
SvgComponent = Videocam;
|
|
85
|
-
}
|
|
86
|
-
if (type === 'chart') {
|
|
87
|
-
SvgComponent = Timeline;
|
|
88
|
-
}
|
|
89
|
-
if (type === 'ct') {
|
|
90
|
-
SvgComponent = Gradient;
|
|
91
|
-
}
|
|
92
|
-
if (type === 'dimmer') {
|
|
93
|
-
SvgComponent = TipsAndUpdates;
|
|
94
|
-
}
|
|
95
|
-
if (type === 'door') {
|
|
96
|
-
SvgComponent = SensorDoor;
|
|
97
|
-
}
|
|
98
|
-
if (type === 'fireAlarm') {
|
|
99
|
-
SvgComponent = Whatshot;
|
|
100
|
-
}
|
|
101
|
-
if (type === 'floodAlarm') {
|
|
102
|
-
SvgComponent = Water;
|
|
103
|
-
}
|
|
104
|
-
if (type === 'humidity') {
|
|
105
|
-
SvgComponent = WaterDrop;
|
|
106
|
-
}
|
|
107
|
-
if (type === 'illuminance') {
|
|
108
|
-
SvgComponent = WbIridescent;
|
|
109
|
-
}
|
|
110
|
-
if (type === 'image') {
|
|
111
|
-
SvgComponent = Image;
|
|
112
|
-
}
|
|
113
|
-
if (type === 'light') {
|
|
114
|
-
SvgComponent = Lightbulb;
|
|
115
|
-
}
|
|
116
|
-
if (type === 'lock') {
|
|
117
|
-
SvgComponent = Lock;
|
|
118
|
-
}
|
|
119
|
-
if (type === 'location') {
|
|
120
|
-
SvgComponent = LocationOn;
|
|
121
|
-
}
|
|
122
|
-
if (type === 'media') {
|
|
123
|
-
SvgComponent = PlayArrowRounded;
|
|
124
|
-
}
|
|
125
|
-
if (type === 'motion') {
|
|
126
|
-
SvgComponent = DirectionsRun;
|
|
127
|
-
}
|
|
128
|
-
if (type === 'rgb') {
|
|
129
|
-
SvgComponent = Palette;
|
|
130
|
-
}
|
|
131
|
-
if (type === 'rgbSingle') {
|
|
132
|
-
SvgComponent = Palette;
|
|
133
|
-
}
|
|
134
|
-
if (type === 'rgbwSingle') {
|
|
135
|
-
SvgComponent = Palette;
|
|
136
|
-
}
|
|
137
|
-
if (type === 'slider') {
|
|
138
|
-
SvgComponent = Tune;
|
|
139
|
-
}
|
|
140
|
-
if (type === 'socket') {
|
|
141
|
-
SvgComponent = Power;
|
|
142
|
-
}
|
|
143
|
-
if (type === 'temperature') {
|
|
144
|
-
SvgComponent = Thermostat;
|
|
145
|
-
}
|
|
146
|
-
if (type === 'thermostat') {
|
|
147
|
-
SvgComponent = Thermostat;
|
|
148
|
-
}
|
|
149
|
-
if (type === 'volume') {
|
|
150
|
-
SvgComponent = VolumeUp;
|
|
151
|
-
}
|
|
152
|
-
if (type === 'volumeGroup') {
|
|
153
|
-
SvgComponent = VolumeUp;
|
|
154
|
-
}
|
|
155
|
-
if (type === 'weatherCurrent') {
|
|
156
|
-
SvgComponent = Air;
|
|
157
|
-
}
|
|
158
|
-
if (type === 'weatherForecast') {
|
|
159
|
-
SvgComponent = WbSunny;
|
|
160
|
-
}
|
|
161
|
-
if (type === 'window') {
|
|
162
|
-
SvgComponent = Window;
|
|
163
|
-
}
|
|
164
|
-
if (type === 'windowTilt') {
|
|
165
|
-
SvgComponent = Window;
|
|
166
|
-
}
|
|
167
|
-
if (type === 'blindButtons') {
|
|
168
|
-
SvgComponent = BlindsClosed;
|
|
169
|
-
}
|
|
170
|
-
if (type === 'button') {
|
|
171
|
-
SvgComponent = IconButtonImage;
|
|
172
|
-
}
|
|
173
|
-
if (type === 'buttonSensor') {
|
|
174
|
-
SvgComponent = IconButtonImage;
|
|
175
|
-
}
|
|
176
|
-
if (type === 'cie') {
|
|
177
|
-
SvgComponent = ColorLens;
|
|
178
|
-
}
|
|
179
|
-
if (type === 'gate') {
|
|
180
|
-
SvgComponent = DoorSliding;
|
|
181
|
-
}
|
|
182
|
-
if (type === 'hue') {
|
|
183
|
-
SvgComponent = ColorLens;
|
|
184
|
-
}
|
|
185
|
-
if (type === 'info') {
|
|
186
|
-
SvgComponent = Info;
|
|
187
|
-
}
|
|
188
|
-
if (type === 'instance') {
|
|
189
|
-
SvgComponent = IconInstance;
|
|
190
|
-
}
|
|
191
|
-
if (type === 'unknown') {
|
|
192
|
-
SvgComponent = QuestionMark;
|
|
193
|
-
}
|
|
194
|
-
if (type === 'vacuumCleaner') {
|
|
195
|
-
SvgComponent = IconVacuum;
|
|
196
|
-
}
|
|
197
|
-
if (type === 'warning' || type === 'invalid') {
|
|
198
|
-
SvgComponent = Warning;
|
|
199
|
-
}
|
|
200
|
-
if (SvgComponent) {
|
|
201
|
-
return (React.createElement(SvgComponent, { style: props?.style || undefined, className: Utils.clsx(props?.className, 'iconOwn') }));
|
|
202
|
-
}
|
|
203
|
-
return null;
|
|
204
|
-
}
|
|
205
|
-
export function IconDeviceType(props) {
|
|
206
|
-
const icon = getDeviceIcon(props.src, props);
|
|
207
|
-
if (icon) {
|
|
208
|
-
return icon;
|
|
209
|
-
}
|
|
210
|
-
return React.createElement(Icon, { ...props });
|
|
211
|
-
}
|
|
212
|
-
//# sourceMappingURL=IconDeviceType.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconDeviceType.js","sourceRoot":"./src/","sources":["Components/IconDeviceType.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACH,MAAM,EACN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AG,IAAI,CAAC;IACxB,CAAC;IACD,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACtB,YAAY,GAAG,YAAgC,CAAC;IACpD,CAAC;IACD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACrB,YAAY,GAAG,YAAY,CAAC;IAChC,CAAC;IACD,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;QAC3B,YAAY,GAAG,UAA8B,CAAC;IAClD,CAAC;IACD,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QAC3C,YAAY,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACf,OAAO,CACH,oBAAC,YAAY,IACT,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,SAAS,EAChC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,GACpD,CACL,CAAC;IACN,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAgB;IAC3C,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,GAAiB,EAAE,KAAK,CAAC,CAAC;IAC3D,IAAI,IAAI,EAAE,CAAC;QACP,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,oBAAC,IAAI,OAAK,KAAK,GAAI,CAAC;AAC/B,CAAC","sourcesContent":["import React from 'react';\nimport {\n AcUnit,\n Air,\n Blinds,\n BlindsClosed,\n ColorLens,\n ControlCamera,\n DeviceHub,\n DirectionsRun,\n DoorSliding,\n Gradient,\n Hub,\n Image,\n Info,\n Lightbulb,\n LocationOn,\n Lock,\n Palette,\n PlayArrowRounded,\n Polyline,\n Power,\n QuestionMark,\n SensorDoor,\n type SvgIconComponent,\n Thermostat,\n Timeline,\n TipsAndUpdates,\n Tune,\n Videocam,\n VolumeUp,\n Warning,\n Water,\n WaterDrop,\n WbIridescent,\n WbSunny,\n Whatshot,\n Window,\n} from '@mui/icons-material';\nimport { Icon, type IconProps } from './Icon';\nimport { Utils } from './Utils';\nimport { IconButtonImage } from '../icons/IconButtonImage';\nimport { IconVacuum } from '../icons/IconVacuum';\nimport { IconInstance } from '../icons/IconInstance';\n\n// Taken from type detector: https://github.com/ioBroker/ioBroker.type-detector/blob/master/src/types.ts#L27\nconst deviceTypes = [\n 'unknown',\n 'airCondition',\n 'blind',\n 'blindButtons',\n 'button',\n 'buttonSensor',\n 'camera',\n 'chart',\n 'cie',\n 'ct',\n 'dimmer',\n 'door',\n 'fireAlarm',\n 'floodAlarm',\n 'gate',\n 'hue',\n 'humidity',\n 'illuminance',\n 'image',\n 'info',\n 'instance',\n 'invalid',\n 'light',\n 'location',\n 'lock',\n 'media',\n 'motion',\n 'rgb',\n 'rgbSingle',\n 'rgbwSingle',\n 'slider',\n 'socket',\n 'temperature',\n 'thermostat',\n 'vacuumCleaner',\n 'volume',\n 'volumeGroup',\n 'warning',\n 'weatherCurrent',\n 'weatherForecast',\n 'window',\n 'windowTilt',\n 'hub3',\n 'node',\n 'controller',\n 'hub5',\n] as const;\n\nexport type DeviceType = (typeof deviceTypes)[number];\n\nexport function isDeviceIcon(icon: string): DeviceType | null {\n if (deviceTypes.includes(icon as DeviceType)) {\n return icon as DeviceType;\n }\n return null;\n}\n\nexport function getDeviceIcon(type: DeviceType, props?: IconProps): React.JSX.Element | null {\n let SvgComponent: SvgIconComponent | undefined;\n if (type === 'hub3') {\n SvgComponent = DeviceHub;\n }\n if (type === 'node') {\n SvgComponent = Polyline;\n }\n if (type === 'hub5') {\n SvgComponent = Hub;\n }\n if (type === 'controller') {\n SvgComponent = ControlCamera;\n }\n if (type === 'airCondition') {\n SvgComponent = AcUnit;\n }\n if (type === 'blind') {\n SvgComponent = Blinds;\n }\n if (type === 'camera') {\n SvgComponent = Videocam;\n }\n if (type === 'chart') {\n SvgComponent = Timeline;\n }\n if (type === 'ct') {\n SvgComponent = Gradient;\n }\n if (type === 'dimmer') {\n SvgComponent = TipsAndUpdates;\n }\n if (type === 'door') {\n SvgComponent = SensorDoor;\n }\n if (type === 'fireAlarm') {\n SvgComponent = Whatshot;\n }\n if (type === 'floodAlarm') {\n SvgComponent = Water;\n }\n if (type === 'humidity') {\n SvgComponent = WaterDrop;\n }\n if (type === 'illuminance') {\n SvgComponent = WbIridescent;\n }\n if (type === 'image') {\n SvgComponent = Image;\n }\n if (type === 'light') {\n SvgComponent = Lightbulb;\n }\n if (type === 'lock') {\n SvgComponent = Lock;\n }\n if (type === 'location') {\n SvgComponent = LocationOn;\n }\n if (type === 'media') {\n SvgComponent = PlayArrowRounded;\n }\n if (type === 'motion') {\n SvgComponent = DirectionsRun;\n }\n if (type === 'rgb') {\n SvgComponent = Palette;\n }\n if (type === 'rgbSingle') {\n SvgComponent = Palette;\n }\n if (type === 'rgbwSingle') {\n SvgComponent = Palette;\n }\n if (type === 'slider') {\n SvgComponent = Tune;\n }\n if (type === 'socket') {\n SvgComponent = Power;\n }\n if (type === 'temperature') {\n SvgComponent = Thermostat;\n }\n if (type === 'thermostat') {\n SvgComponent = Thermostat;\n }\n if (type === 'volume') {\n SvgComponent = VolumeUp;\n }\n if (type === 'volumeGroup') {\n SvgComponent = VolumeUp;\n }\n if (type === 'weatherCurrent') {\n SvgComponent = Air;\n }\n if (type === 'weatherForecast') {\n SvgComponent = WbSunny;\n }\n if (type === 'window') {\n SvgComponent = Window;\n }\n if (type === 'windowTilt') {\n SvgComponent = Window;\n }\n if (type === 'blindButtons') {\n SvgComponent = BlindsClosed;\n }\n if (type === 'button') {\n SvgComponent = IconButtonImage as SvgIconComponent;\n }\n if (type === 'buttonSensor') {\n SvgComponent = IconButtonImage as SvgIconComponent;\n }\n if (type === 'cie') {\n SvgComponent = ColorLens;\n }\n if (type === 'gate') {\n SvgComponent = DoorSliding;\n }\n if (type === 'hue') {\n SvgComponent = ColorLens;\n }\n if (type === 'info') {\n SvgComponent = Info;\n }\n if (type === 'instance') {\n SvgComponent = IconInstance as SvgIconComponent;\n }\n if (type === 'unknown') {\n SvgComponent = QuestionMark;\n }\n if (type === 'vacuumCleaner') {\n SvgComponent = IconVacuum as SvgIconComponent;\n }\n if (type === 'warning' || type === 'invalid') {\n SvgComponent = Warning;\n }\n\n if (SvgComponent) {\n return (\n <SvgComponent\n style={props?.style || undefined}\n className={Utils.clsx(props?.className, 'iconOwn')}\n />\n );\n }\n return null;\n}\n\nexport function IconDeviceType(props: IconProps): React.JSX.Element | null {\n const icon = getDeviceIcon(props.src as DeviceType, props);\n if (icon) {\n return icon;\n }\n\n return <Icon {...props} />;\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, MouseEvent } from 'react';
|
|
2
|
-
export interface IconProps {
|
|
3
|
-
/** The width in pixels or percentage of the icon. */
|
|
4
|
-
width?: number | string;
|
|
5
|
-
/** The height in pixels or percentage of the icon. */
|
|
6
|
-
height?: number | string;
|
|
7
|
-
/** Click handler. */
|
|
8
|
-
onClick?: (e: MouseEvent) => void;
|
|
9
|
-
/** The class name for the SVG element. */
|
|
10
|
-
className?: string;
|
|
11
|
-
/** Styles for the SVG element. */
|
|
12
|
-
style?: CSSProperties;
|
|
13
|
-
/** The font size of the icon. */
|
|
14
|
-
fontSize?: 'small';
|
|
15
|
-
}
|
package/build/icons/IconProps.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconProps.js","sourceRoot":"./src/","sources":["icons/IconProps.tsx"],"names":[],"mappings":"","sourcesContent":["import type { CSSProperties, MouseEvent } from 'react';\n\nexport interface IconProps {\n /** The width in pixels or percentage of the icon. */\n width?: number | string;\n /** The height in pixels or percentage of the icon. */\n height?: number | string;\n /** Click handler. */\n onClick?: (e: MouseEvent) => void;\n /** The class name for the SVG element. */\n className?: string;\n /** Styles for the SVG element. */\n style?: CSSProperties;\n /** The font size of the icon. */\n fontSize?: 'small';\n}\n"]}
|