@iobroker/adapter-react-v5 7.0.1 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/Components/404.d.ts +3 -2
  2. package/Components/404.js +16 -15
  3. package/Components/ColorPicker.d.ts +22 -8
  4. package/Components/ColorPicker.js +34 -17
  5. package/Components/ComplexCron.js +24 -24
  6. package/Components/CopyToClipboard.d.ts +10 -1
  7. package/Components/CopyToClipboard.js +17 -8
  8. package/Components/CustomModal.d.ts +1 -1
  9. package/Components/CustomModal.js +8 -8
  10. package/Components/FileBrowser.d.ts +11 -11
  11. package/Components/FileBrowser.js +173 -164
  12. package/Components/FileViewer.js +34 -23
  13. package/Components/Icon.d.ts +16 -2
  14. package/Components/Icon.js +19 -8
  15. package/Components/IconPicker.js +10 -14
  16. package/Components/IconSelector.d.ts +1 -1
  17. package/Components/IconSelector.js +64 -74
  18. package/Components/Image.d.ts +8 -4
  19. package/Components/Image.js +13 -32
  20. package/Components/Loader.d.ts +2 -2
  21. package/Components/Loader.js +244 -241
  22. package/Components/Loaders/MV.d.ts +6 -1
  23. package/Components/Loaders/MV.js +23 -7
  24. package/Components/Loaders/PT.d.ts +7 -2
  25. package/Components/Loaders/PT.js +123 -110
  26. package/Components/Loaders/Vendor.d.ts +2 -2
  27. package/Components/Loaders/Vendor.js +22 -14
  28. package/Components/Logo.js +16 -18
  29. package/Components/MDUtils.d.ts +1 -1
  30. package/Components/MDUtils.js +8 -4
  31. package/Components/ObjectBrowser.d.ts +49 -38
  32. package/Components/ObjectBrowser.js +757 -494
  33. package/Components/Router.d.ts +1 -3
  34. package/Components/Router.js +3 -1
  35. package/Components/SaveCloseButtons.d.ts +3 -3
  36. package/Components/SaveCloseButtons.js +3 -3
  37. package/Components/Schedule.d.ts +15 -15
  38. package/Components/Schedule.js +177 -154
  39. package/Components/SelectWithIcon.d.ts +2 -2
  40. package/Components/SelectWithIcon.js +45 -34
  41. package/Components/SimpleCron/index.js +83 -43
  42. package/Components/TabContainer.js +2 -2
  43. package/Components/TabContent.js +1 -1
  44. package/Components/TabHeader.js +1 -1
  45. package/Components/TableResize.d.ts +2 -2
  46. package/Components/TableResize.js +5 -5
  47. package/Components/TextWithIcon.d.ts +1 -1
  48. package/Components/TextWithIcon.js +10 -8
  49. package/Components/ToggleThemeMenu.d.ts +2 -2
  50. package/Components/ToggleThemeMenu.js +3 -3
  51. package/Components/TreeTable.d.ts +18 -18
  52. package/Components/TreeTable.js +76 -72
  53. package/Components/UploadImage.d.ts +2 -2
  54. package/Components/UploadImage.js +330 -326
  55. package/Components/Utils.d.ts +42 -22
  56. package/Components/Utils.js +66 -65
  57. package/Components/withWidth.d.ts +2 -2
  58. package/Components/withWidth.js +10 -6
  59. package/Dialogs/ComplexCron.d.ts +2 -2
  60. package/Dialogs/ComplexCron.js +3 -3
  61. package/Dialogs/Confirm.d.ts +4 -4
  62. package/Dialogs/Confirm.js +18 -8
  63. package/Dialogs/Cron.d.ts +3 -3
  64. package/Dialogs/Cron.js +21 -17
  65. package/Dialogs/Error.d.ts +3 -3
  66. package/Dialogs/Error.js +6 -4
  67. package/Dialogs/Message.d.ts +3 -3
  68. package/Dialogs/Message.js +6 -4
  69. package/Dialogs/SelectFile.d.ts +4 -4
  70. package/Dialogs/SelectFile.js +6 -4
  71. package/Dialogs/SelectID.d.ts +12 -10
  72. package/Dialogs/SelectID.js +12 -8
  73. package/Dialogs/SimpleCron.d.ts +2 -2
  74. package/Dialogs/SimpleCron.js +2 -2
  75. package/Dialogs/TextInput.d.ts +2 -2
  76. package/Dialogs/TextInput.js +3 -3
  77. package/GenericApp.d.ts +19 -13
  78. package/GenericApp.js +177 -134
  79. package/LICENSE +22 -22
  80. package/LegacyConnection.d.ts +240 -248
  81. package/LegacyConnection.js +500 -525
  82. package/Prompt.js +7 -7
  83. package/README.md +1239 -1166
  84. package/Theme.d.ts +1 -1
  85. package/Theme.js +9 -12
  86. package/assets/devices.json +1 -0
  87. package/assets/lamp_ceiling.svg +8 -8
  88. package/assets/lamp_table.svg +7 -7
  89. package/assets/no_icon.svg +9 -9
  90. package/assets/rooms.json +1 -0
  91. package/craco-module-federation.js +62 -71
  92. package/i18n/de.json +434 -431
  93. package/i18n/en.json +434 -431
  94. package/i18n/es.json +434 -431
  95. package/i18n/fr.json +434 -431
  96. package/i18n/it.json +434 -431
  97. package/i18n/nl.json +434 -431
  98. package/i18n/pl.json +434 -431
  99. package/i18n/pt.json +434 -431
  100. package/i18n/ru.json +434 -431
  101. package/i18n/uk.json +434 -431
  102. package/i18n/zh-cn.json +434 -431
  103. package/i18n.d.ts +26 -19
  104. package/i18n.js +28 -22
  105. package/icons/IconAdapter.js +2 -2
  106. package/icons/IconAlias.js +2 -2
  107. package/icons/IconChannel.js +2 -2
  108. package/icons/IconClearFilter.js +2 -2
  109. package/icons/IconClosed.js +2 -2
  110. package/icons/IconCopy.js +2 -2
  111. package/icons/IconDevice.js +2 -2
  112. package/icons/IconDocument.js +2 -2
  113. package/icons/IconDocumentReadOnly.js +2 -2
  114. package/icons/IconExpert.js +2 -2
  115. package/icons/IconFx.js +2 -2
  116. package/icons/IconInstance.js +2 -2
  117. package/icons/IconLogout.js +2 -2
  118. package/icons/IconNoIcon.js +2 -2
  119. package/icons/IconOpen.d.ts +2 -2
  120. package/icons/IconOpen.js +2 -2
  121. package/icons/IconProps.d.ts +4 -3
  122. package/icons/IconState.d.ts +2 -2
  123. package/icons/IconState.js +2 -2
  124. package/index.css +56 -55
  125. package/modulefederation.admin.config.js +31 -31
  126. package/package.json +5 -5
  127. package/src/AdminConnection.tsx +3 -3
  128. package/src/Components/404.tsx +122 -121
  129. package/src/Components/ColorPicker.tsx +343 -315
  130. package/src/Components/ComplexCron.tsx +544 -507
  131. package/src/Components/CopyToClipboard.tsx +178 -165
  132. package/src/Components/CustomModal.tsx +170 -163
  133. package/src/Components/FileBrowser.tsx +2550 -2414
  134. package/src/Components/FileViewer.tsx +412 -393
  135. package/src/Components/Icon.tsx +238 -210
  136. package/src/Components/IconPicker.tsx +165 -149
  137. package/src/Components/IconSelector.tsx +2220 -2202
  138. package/src/Components/Image.tsx +193 -176
  139. package/src/Components/Loader.tsx +328 -304
  140. package/src/Components/Logo.tsx +176 -166
  141. package/src/Components/MDUtils.tsx +104 -100
  142. package/src/Components/ObjectBrowser.tsx +8935 -8032
  143. package/src/Components/Router.tsx +90 -90
  144. package/src/Components/SaveCloseButtons.tsx +117 -113
  145. package/src/Components/Schedule.tsx +1962 -1724
  146. package/src/Components/SelectWithIcon.tsx +239 -197
  147. package/src/Components/TabContainer.tsx +57 -55
  148. package/src/Components/TabContent.tsx +38 -37
  149. package/src/Components/TabHeader.tsx +20 -19
  150. package/src/Components/TableResize.tsx +274 -259
  151. package/src/Components/TextWithIcon.tsx +159 -148
  152. package/src/Components/ToggleThemeMenu.tsx +52 -34
  153. package/src/Components/TreeTable.tsx +1002 -919
  154. package/src/Components/UploadImage.tsx +631 -599
  155. package/src/Components/Utils.tsx +1802 -1794
  156. package/src/Components/loader.css +231 -222
  157. package/src/Components/withWidth.tsx +32 -21
  158. package/src/Connection.tsx +5 -7
  159. package/src/Dialogs/ComplexCron.tsx +123 -129
  160. package/src/Dialogs/Confirm.tsx +185 -162
  161. package/src/Dialogs/Cron.tsx +192 -182
  162. package/src/Dialogs/Error.tsx +67 -72
  163. package/src/Dialogs/Message.tsx +73 -71
  164. package/src/Dialogs/SelectFile.tsx +280 -270
  165. package/src/Dialogs/SelectID.tsx +310 -298
  166. package/src/Dialogs/SimpleCron.tsx +100 -100
  167. package/src/Dialogs/TextInput.tsx +99 -107
  168. package/src/GenericApp.tsx +1076 -976
  169. package/src/LegacyConnection.tsx +3719 -3589
  170. package/src/Prompt.tsx +22 -20
  171. package/src/Theme.tsx +472 -479
  172. package/src/icons/IconAdapter.tsx +22 -20
  173. package/src/icons/IconAlias.tsx +22 -20
  174. package/src/icons/IconChannel.tsx +60 -21
  175. package/src/icons/IconClearFilter.tsx +24 -22
  176. package/src/icons/IconClosed.tsx +22 -17
  177. package/src/icons/IconCopy.tsx +21 -16
  178. package/src/icons/IconDevice.tsx +126 -27
  179. package/src/icons/IconDocument.tsx +22 -17
  180. package/src/icons/IconDocumentReadOnly.tsx +27 -18
  181. package/src/icons/IconExpert.tsx +26 -18
  182. package/src/icons/IconFx.tsx +38 -36
  183. package/src/icons/IconInstance.tsx +22 -20
  184. package/src/icons/IconLogout.tsx +32 -30
  185. package/src/icons/IconNoIcon.tsx +21 -19
  186. package/src/icons/IconOpen.tsx +22 -17
  187. package/src/icons/IconProps.tsx +16 -15
  188. package/src/icons/IconState.tsx +38 -17
  189. package/src/index.css +56 -55
  190. package/tasks.js +91 -0
  191. package/types.d.ts +141 -134
  192. package/Components/Loaders/PT.css +0 -109
  193. package/Components/Loaders/Vendor.css +0 -13
  194. package/Components/loader.css +0 -222
  195. package/Components/types.d.ts +0 -82
  196. package/assets/devices/Alarm Systems.svg +0 -19
  197. package/assets/devices/Amplifier.svg +0 -22
  198. package/assets/devices/Awnings.svg +0 -5
  199. package/assets/devices/Battery Status.svg +0 -5
  200. package/assets/devices/Ceiling Spotlights.svg +0 -16
  201. package/assets/devices/Chandelier.svg +0 -7
  202. package/assets/devices/Climate.svg +0 -12
  203. package/assets/devices/Coffee Makers.svg +0 -6
  204. package/assets/devices/Cold Water.svg +0 -31
  205. package/assets/devices/Computer.svg +0 -21
  206. package/assets/devices/Consumption.svg +0 -8
  207. package/assets/devices/Curtains.svg +0 -43
  208. package/assets/devices/Dishwashers.svg +0 -12
  209. package/assets/devices/Doors.svg +0 -6
  210. package/assets/devices/Doorstep.svg +0 -35
  211. package/assets/devices/Dryer.svg +0 -14
  212. package/assets/devices/Fan.svg +0 -20
  213. package/assets/devices/Floor Lamps.svg +0 -5
  214. package/assets/devices/Garage Doors.svg +0 -9
  215. package/assets/devices/Gates.svg +0 -32
  216. package/assets/devices/Hairdryer.svg +0 -23
  217. package/assets/devices/Handle.svg +0 -6
  218. package/assets/devices/Hanging Lamps.svg +0 -9
  219. package/assets/devices/Heater.svg +0 -44
  220. package/assets/devices/Hoods.svg +0 -12
  221. package/assets/devices/Hot Water.svg +0 -10
  222. package/assets/devices/Humidity.svg +0 -41
  223. package/assets/devices/Iron.svg +0 -5
  224. package/assets/devices/Irrigation.svg +0 -23
  225. package/assets/devices/Led Strip.svg +0 -31
  226. package/assets/devices/Light.svg +0 -30
  227. package/assets/devices/Lightings.svg +0 -46
  228. package/assets/devices/Lock.svg +0 -19
  229. package/assets/devices/Louvre.svg +0 -7
  230. package/assets/devices/Mowing Machine.svg +0 -9
  231. package/assets/devices/Music.svg +0 -13
  232. package/assets/devices/Outdoor Blinds.svg +0 -7
  233. package/assets/devices/People.svg +0 -19
  234. package/assets/devices/Pool.svg +0 -8
  235. package/assets/devices/Power Consumption.svg +0 -13
  236. package/assets/devices/Printer.svg +0 -10
  237. package/assets/devices/Pump.svg +0 -10
  238. package/assets/devices/Receiver.svg +0 -19
  239. package/assets/devices/Sconces.svg +0 -10
  240. package/assets/devices/Security.svg +0 -34
  241. package/assets/devices/Shading.svg +0 -5
  242. package/assets/devices/Shutters.svg +0 -11
  243. package/assets/devices/SmokeDetector.svg +0 -13
  244. package/assets/devices/Sockets.svg +0 -13
  245. package/assets/devices/Speaker.svg +0 -35
  246. package/assets/devices/Stove.svg +0 -12
  247. package/assets/devices/Table Lamps.svg +0 -12
  248. package/assets/devices/Temperature Sensors.svg +0 -28
  249. package/assets/devices/Tv.svg +0 -8
  250. package/assets/devices/Vacuum Cleaner.svg +0 -16
  251. package/assets/devices/Ventilation.svg +0 -12
  252. package/assets/devices/Washing Machines.svg +0 -16
  253. package/assets/devices/Water Consumption.svg +0 -6
  254. package/assets/devices/Water Heater.svg +0 -8
  255. package/assets/devices/Water.svg +0 -40
  256. package/assets/devices/Weather.svg +0 -28
  257. package/assets/devices/Window.svg +0 -8
  258. package/assets/rooms/Anteroom.svg +0 -53
  259. package/assets/rooms/Attic.svg +0 -21
  260. package/assets/rooms/Balcony.svg +0 -13
  261. package/assets/rooms/Barn.svg +0 -6
  262. package/assets/rooms/Basement.svg +0 -5
  263. package/assets/rooms/Bathroom.svg +0 -38
  264. package/assets/rooms/Bedroom.svg +0 -5
  265. package/assets/rooms/Boiler Room.svg +0 -13
  266. package/assets/rooms/Carport.svg +0 -17
  267. package/assets/rooms/Cellar.svg +0 -89
  268. package/assets/rooms/Chamber.svg +0 -9
  269. package/assets/rooms/Corridor.svg +0 -53
  270. package/assets/rooms/Dining Area.svg +0 -37
  271. package/assets/rooms/Dining Room.svg +0 -37
  272. package/assets/rooms/Dining.svg +0 -37
  273. package/assets/rooms/Dressing Room.svg +0 -5
  274. package/assets/rooms/Driveway.svg +0 -15
  275. package/assets/rooms/Entrance.svg +0 -44
  276. package/assets/rooms/Equipment Room.svg +0 -15
  277. package/assets/rooms/Front Yard.svg +0 -64
  278. package/assets/rooms/Gallery.svg +0 -14
  279. package/assets/rooms/Garage.svg +0 -20
  280. package/assets/rooms/Garden.svg +0 -13
  281. package/assets/rooms/Ground Floor.svg +0 -95
  282. package/assets/rooms/Guest Bathroom.svg +0 -33
  283. package/assets/rooms/Guest Room.svg +0 -5
  284. package/assets/rooms/Gym.svg +0 -5
  285. package/assets/rooms/Hall.svg +0 -19
  286. package/assets/rooms/Home Theater.svg +0 -8
  287. package/assets/rooms/Kitchen.svg +0 -18
  288. package/assets/rooms/Laundry Room.svg +0 -12
  289. package/assets/rooms/Living Area.svg +0 -11
  290. package/assets/rooms/Living Room.svg +0 -10
  291. package/assets/rooms/Locker Room.svg +0 -17
  292. package/assets/rooms/Nursery.svg +0 -5
  293. package/assets/rooms/Office.svg +0 -8
  294. package/assets/rooms/Outdoors.svg +0 -7
  295. package/assets/rooms/Playroom.svg +0 -6
  296. package/assets/rooms/Pool.svg +0 -8
  297. package/assets/rooms/Rear Wall.svg +0 -30
  298. package/assets/rooms/Second Floor.svg +0 -95
  299. package/assets/rooms/Shed.svg +0 -16
  300. package/assets/rooms/Sleeping Area.svg +0 -22
  301. package/assets/rooms/Stairway.svg +0 -5
  302. package/assets/rooms/Stairwell.svg +0 -15
  303. package/assets/rooms/Storeroom.svg +0 -5
  304. package/assets/rooms/Summer House.svg +0 -27
  305. package/assets/rooms/Swimming Pool.svg +0 -21
  306. package/assets/rooms/Terrace.svg +0 -7
  307. package/assets/rooms/Toilet.svg +0 -10
  308. package/assets/rooms/Upstairs.svg +0 -6
  309. package/assets/rooms/Wardrobe.svg +0 -60
  310. package/assets/rooms/Washroom.svg +0 -20
  311. package/assets/rooms/Wc.svg +0 -10
  312. package/assets/rooms/Windscreen.svg +0 -60
  313. package/assets/rooms/Workshop.svg +0 -23
  314. package/assets/rooms/Workspace.svg +0 -8
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * MIT License
5
5
  *
6
- * */
6
+ */
7
7
  import React from 'react';
8
- import { IobTheme, ThemeName, ThemeType } from '../types';
8
+ import type { IobTheme, ThemeName, ThemeType } from '../types';
9
9
  type SmartName = null | false | string | ({
10
10
  [lang in ioBroker.Languages]?: string;
11
11
  } & {
@@ -77,7 +77,13 @@ declare class Utils {
77
77
  icon?: string;
78
78
  color?: string;
79
79
  language?: ioBroker.Languages;
80
- }, defaultEnabling?: boolean): any;
80
+ }, defaultEnabling?: boolean): {
81
+ name: string;
82
+ enabled?: boolean;
83
+ useCustom?: boolean;
84
+ icon?: string;
85
+ color?: string;
86
+ };
81
87
  /**
82
88
  Sets smartName settings for the given object.
83
89
  */
@@ -162,6 +168,7 @@ declare class Utils {
162
168
  static copyToClipboard(text: string, e?: Event): boolean;
163
169
  /**
164
170
  * Gets the extension of a file name.
171
+ *
165
172
  * @param fileName the file name.
166
173
  * @returns The extension in lower case.
167
174
  */
@@ -169,52 +176,52 @@ declare class Utils {
169
176
  /**
170
177
  * Format number of bytes as a string with B, KB, MB or GB.
171
178
  * The base for all calculations is 1024.
179
+ *
180
+ * @param bytes The number of bytes.
172
181
  * @returns The formatted string (e.g. '723.5 KB')
173
182
  */
174
- static formatBytes(
175
- /** The number of bytes. */
176
- bytes: number): string;
183
+ static formatBytes(bytes: number): string;
177
184
  /**
178
185
  * Invert the given color according to a theme type to get the inverted text color for background
186
+ *
187
+ * @param color Color in the format '#rrggbb' or '#rgb' (or without a hash)
188
+ * @param themeType 'light' or 'dark'
189
+ * @param invert If true, the dark theme has a light color in the control, or the dark theme has a light color in the control
179
190
  */
180
- static getInvertedColor(
181
- /** Color in the format '#rrggbb' or '#rgb' (or without a hash) */
182
- color: string, themeType: ThemeType,
183
- /** dark theme has light color in control, or light theme has light color in control */
184
- invert?: boolean): string | undefined;
191
+ static getInvertedColor(color: string, themeType: ThemeType, invert?: boolean): string | undefined;
185
192
  /**
186
193
  * Invert the given color
187
- * @param hex Color in the format '#rrggbb' or '#rgb' (or without hash)
194
+ *
195
+ * @param hex Color in the format '#rrggbb' or '#rgb' (or without a hash)
188
196
  * @param bw Set to black or white.
189
197
  */
190
198
  static invertColor(hex: string, bw?: boolean): string;
191
199
  /**
192
200
  * Convert RGB to array [r, g, b]
201
+ *
193
202
  * @param hex Color in the format '#rrggbb' or '#rgb' (or without hash) or rgb(r,g,b) or rgba(r,g,b,a)
194
203
  * @returns Array with 3 elements [r, g, b]
195
204
  */
196
205
  static color2rgb(hex: string): false | [number, number, number] | '';
197
206
  /**
198
207
  * Convert RGB to LAB
199
- * @param {Array<number>} rgb color in format [r,g,b]
200
- * @returns {Array<number>} lab color in format [l,a,b]
208
+ *
209
+ * @param rgb color in format [r,g,b]
210
+ * @returns lab color in format [l,a,b]
201
211
  */
202
212
  static rgb2lab(rgb: [number, number, number]): [number, number, number];
203
213
  /**
204
214
  * Calculate the distance between two colors in LAB color space in the range 0-100^2
205
- * If distance is less than 1000, the colors are similar
215
+ * If the distance is less than 1000, the colors are similar
216
+ *
206
217
  * @param color1 Color in the format '#rrggbb' or '#rgb' (or without hash) or rgb(r,g,b) or rgba(r,g,b,a)
207
218
  * @param color2 Color in the format '#rrggbb' or '#rgb' (or without hash) or rgb(r,g,b) or rgba(r,g,b,a)
208
219
  * @returns distance in the range 0-100^2
209
220
  */
210
221
  static colorDistance(color1: string, color2: string): number;
211
- /**
212
- * @private
213
- */
214
- static _toVal(mix: ClassValue): string;
222
+ private static _toVal;
215
223
  /**
216
224
  * Convert any object to a string with its values.
217
- * @returns {string}
218
225
  */
219
226
  static clsx(...inputs: ClassValue[]): string;
220
227
  /**
@@ -231,11 +238,13 @@ declare class Utils {
231
238
  static setThemeName(themeName: ThemeName): void;
232
239
  /**
233
240
  * Toggle the theme name between 'dark' and 'colored'.
241
+ *
234
242
  * @returns the new theme name.
235
243
  */
236
244
  static toggleTheme(themeName?: ThemeName | null): ThemeName;
237
245
  /**
238
246
  * Get the list of themes
247
+ *
239
248
  * @returns list of possible themes
240
249
  */
241
250
  static getThemeNames(): ThemeName[];
@@ -245,12 +254,19 @@ declare class Utils {
245
254
  static parseQuery(query: string): Record<string, string | number | boolean>;
246
255
  /**
247
256
  * Returns parent ID.
257
+ *
248
258
  * @returns parent ID or null if no parent
249
259
  */
250
260
  static getParentId(id: string): string | null;
251
261
  static formatDate(dateObj: Date, dateFormat: string): string;
262
+ /**
263
+ * Format seconds to string like 'h:mm:ss' or 'd.hh:mm:ss'
264
+ */
252
265
  static formatTime(seconds: number): string;
253
266
  static MDtext2link(text: string): string;
267
+ /**
268
+ * Open url link in the new target window
269
+ */
254
270
  static openLink(url: string, target?: string): void;
255
271
  static MDgetTitle(text: string): string;
256
272
  static MDextractHeader(text: string): {
@@ -266,6 +282,7 @@ declare class Utils {
266
282
  json: Record<string, any>): void;
267
283
  /**
268
284
  * Convert quality code into text
285
+ *
269
286
  * @returns lines that decode quality
270
287
  */
271
288
  static quality2text(quality: ioBroker.STATE_QUALITY[keyof ioBroker.STATE_QUALITY]): string[];
@@ -275,18 +292,21 @@ declare class Utils {
275
292
  static clone(object: Record<string, any>): Record<string, any>;
276
293
  /**
277
294
  * Get states of object
295
+ *
278
296
  * @returns states as an object in form {"value1": "label1", "value2": "label2"} or null
279
297
  */
280
298
  static getStates(obj: ioBroker.StateObject | null | undefined): Record<string, string> | null;
281
299
  /**
282
300
  * Get svg file as text
301
+ *
283
302
  * @param url URL of SVG file
284
303
  * @returns Promise with "data:image..."
285
304
  */
286
305
  static getSvg(url: string): Promise<string>;
287
306
  /**
288
- * Detect file extension by its content
289
- * @returns Detected extension, like 'jpg'
307
+ * Detect a file extension by its content
308
+ *
309
+ * @returns The detected extension, like 'jpg'
290
310
  */
291
311
  static detectMimeType(
292
312
  /** Base64 encoded binary file */
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  *
9
9
  * MIT License
10
10
  *
11
- * */
11
+ */
12
12
  const react_1 = __importDefault(require("react"));
13
13
  const CopyToClipboard_1 = __importDefault(require("./CopyToClipboard"));
14
14
  const i18n_1 = __importDefault(require("../i18n"));
@@ -365,10 +365,10 @@ class Utils {
365
365
  return react_1.default.createElement("span", { style: style || {} }, settings.icon);
366
366
  }
367
367
  if (settings.icon.startsWith('data:image')) {
368
- return react_1.default.createElement("img", { alt: settings.name, src: settings.icon, style: style || {} });
368
+ return (react_1.default.createElement("img", { alt: settings.name, src: settings.icon, style: style || {} }));
369
369
  }
370
370
  // maybe later some changes for a second type
371
- return react_1.default.createElement("img", { alt: settings.name, src: (settings.prefix || '') + settings.icon, style: style });
371
+ return (react_1.default.createElement("img", { alt: settings.name, src: (settings.prefix || '') + settings.icon, style: style }));
372
372
  }
373
373
  return null;
374
374
  }
@@ -499,7 +499,9 @@ class Utils {
499
499
  return '--:--';
500
500
  }
501
501
  const hours = Math.floor(seconds / 3600);
502
- const minutes = Math.floor((seconds % 3600) / 60).toString().padStart(2, '0');
502
+ const minutes = Math.floor((seconds % 3600) / 60)
503
+ .toString()
504
+ .padStart(2, '0');
503
505
  const secs = (seconds % 60).toString().padStart(2, '0');
504
506
  if (hours) {
505
507
  return `${hours}:${minutes}:${secs}`;
@@ -672,8 +674,9 @@ class Utils {
672
674
  const target = m[0].match(/target="([^"]+)"/) || m[0].match(/target='([^']+)'/);
673
675
  const rel = m[0].match(/rel="([^"]+)"/) || m[0].match(/rel='([^']+)'/);
674
676
  const title = m[0].match(/>([^<]*)</);
675
- // eslint-disable-next-line
676
- result.push(react_1.default.createElement("a", { key: `a${key++}`, href: href ? href[1] : '', target: target ? target[1] : '_blank', rel: rel ? rel[1] : '', style: { color: 'inherit' } }, title ? title[1] : ''));
677
+ result.push(
678
+ // eslint-disable-next-line react/jsx-no-target-blank
679
+ react_1.default.createElement("a", { key: `a${key++}`, href: href ? href[1] : '', target: target ? target[1] : '_blank', rel: rel ? rel[1] : 'noreferrer', style: { color: 'inherit' } }, title ? title[1] : ''));
677
680
  }
678
681
  m = text ? text.match(/<a [^<]+<\/a>|<br\/?>|<b>[^<]+<\/b>|<i>[^<]+<\/i>/) : null;
679
682
  if (!m) {
@@ -703,15 +706,17 @@ class Utils {
703
706
  return states.smartName;
704
707
  }
705
708
  const obj = states;
706
- return ((_a = obj === null || obj === void 0 ? void 0 : obj.common) === null || _a === void 0 ? void 0 : _a.custom) && obj.common.custom[instanceId] ?
707
- obj.common.custom[instanceId].smartName : undefined;
709
+ return ((_a = obj === null || obj === void 0 ? void 0 : obj.common) === null || _a === void 0 ? void 0 : _a.custom) && obj.common.custom[instanceId]
710
+ ? obj.common.custom[instanceId].smartName
711
+ : undefined;
708
712
  }
709
713
  if (!noCommon) {
710
714
  return states[id].common.smartName;
711
715
  }
712
716
  const obj = states[id];
713
- return ((_b = obj === null || obj === void 0 ? void 0 : obj.common) === null || _b === void 0 ? void 0 : _b.custom) && obj.common.custom[instanceId] ?
714
- obj.common.custom[instanceId].smartName || null : null;
717
+ return ((_b = obj === null || obj === void 0 ? void 0 : obj.common) === null || _b === void 0 ? void 0 : _b.custom) && obj.common.custom[instanceId]
718
+ ? obj.common.custom[instanceId].smartName || null
719
+ : null;
715
720
  }
716
721
  /**
717
722
  * Get the smart name from a state.
@@ -913,6 +918,7 @@ class Utils {
913
918
  }
914
919
  /**
915
920
  * Gets the extension of a file name.
921
+ *
916
922
  * @param fileName the file name.
917
923
  * @returns The extension in lower case.
918
924
  */
@@ -926,11 +932,11 @@ class Utils {
926
932
  /**
927
933
  * Format number of bytes as a string with B, KB, MB or GB.
928
934
  * The base for all calculations is 1024.
935
+ *
936
+ * @param bytes The number of bytes.
929
937
  * @returns The formatted string (e.g. '723.5 KB')
930
938
  */
931
- static formatBytes(
932
- /** The number of bytes. */
933
- bytes) {
939
+ static formatBytes(bytes) {
934
940
  if (Math.abs(bytes) < 1024) {
935
941
  return `${bytes} B`;
936
942
  }
@@ -945,12 +951,12 @@ class Utils {
945
951
  }
946
952
  /**
947
953
  * Invert the given color according to a theme type to get the inverted text color for background
954
+ *
955
+ * @param color Color in the format '#rrggbb' or '#rgb' (or without a hash)
956
+ * @param themeType 'light' or 'dark'
957
+ * @param invert If true, the dark theme has a light color in the control, or the dark theme has a light color in the control
948
958
  */
949
- static getInvertedColor(
950
- /** Color in the format '#rrggbb' or '#rgb' (or without a hash) */
951
- color, themeType,
952
- /** dark theme has light color in control, or light theme has light color in control */
953
- invert) {
959
+ static getInvertedColor(color, themeType, invert) {
954
960
  if (!color) {
955
961
  return undefined;
956
962
  }
@@ -966,7 +972,8 @@ class Utils {
966
972
  // Big thanks to: https://stackoverflow.com/questions/35969656/how-can-i-generate-the-opposite-color-according-to-current-color
967
973
  /**
968
974
  * Invert the given color
969
- * @param hex Color in the format '#rrggbb' or '#rgb' (or without hash)
975
+ *
976
+ * @param hex Color in the format '#rrggbb' or '#rgb' (or without a hash)
970
977
  * @param bw Set to black or white.
971
978
  */
972
979
  static invertColor(hex, bw) {
@@ -1012,9 +1019,7 @@ class Utils {
1012
1019
  const b = parseInt(hex.slice(4, 6), 16);
1013
1020
  if (bw) {
1014
1021
  // http://stackoverflow.com/a/3943023/112731
1015
- return r * 0.299 + g * 0.587 + b * 0.114 > 186
1016
- ? `#000000${alfa || ''}`
1017
- : `#FFFFFF${alfa || ''}`;
1022
+ return r * 0.299 + g * 0.587 + b * 0.114 > 186 ? `#000000${alfa || ''}` : `#FFFFFF${alfa || ''}`;
1018
1023
  }
1019
1024
  // invert color components
1020
1025
  const rs = (255 - r).toString(16);
@@ -1025,6 +1030,7 @@ class Utils {
1025
1030
  }
1026
1031
  /**
1027
1032
  * Convert RGB to array [r, g, b]
1033
+ *
1028
1034
  * @param hex Color in the format '#rrggbb' or '#rgb' (or without hash) or rgb(r,g,b) or rgba(r,g,b,a)
1029
1035
  * @returns Array with 3 elements [r, g, b]
1030
1036
  */
@@ -1061,17 +1067,14 @@ class Utils {
1061
1067
  console.warn(`Cannot invert color: ${hex}`);
1062
1068
  return false;
1063
1069
  }
1064
- return [
1065
- parseInt(hex.slice(0, 2), 16),
1066
- parseInt(hex.slice(2, 4), 16),
1067
- parseInt(hex.slice(4, 6), 16),
1068
- ];
1070
+ return [parseInt(hex.slice(0, 2), 16), parseInt(hex.slice(2, 4), 16), parseInt(hex.slice(4, 6), 16)];
1069
1071
  }
1070
1072
  // Big thanks to: https://github.com/antimatter15/rgb-lab
1071
1073
  /**
1072
1074
  * Convert RGB to LAB
1073
- * @param {Array<number>} rgb color in format [r,g,b]
1074
- * @returns {Array<number>} lab color in format [l,a,b]
1075
+ *
1076
+ * @param rgb color in format [r,g,b]
1077
+ * @returns lab color in format [l,a,b]
1075
1078
  */
1076
1079
  static rgb2lab(rgb) {
1077
1080
  let r = rgb[0] / 255;
@@ -1090,7 +1093,8 @@ class Utils {
1090
1093
  }
1091
1094
  /**
1092
1095
  * Calculate the distance between two colors in LAB color space in the range 0-100^2
1093
- * If distance is less than 1000, the colors are similar
1096
+ * If the distance is less than 1000, the colors are similar
1097
+ *
1094
1098
  * @param color1 Color in the format '#rrggbb' or '#rgb' (or without hash) or rgb(r,g,b) or rgba(r,g,b,a)
1095
1099
  * @param color2 Color in the format '#rrggbb' or '#rgb' (or without hash) or rgb(r,g,b) or rgba(r,g,b,a)
1096
1100
  * @returns distance in the range 0-100^2
@@ -1122,9 +1126,6 @@ class Utils {
1122
1126
  // https://github.com/lukeed/clsx/blob/master/src/index.js
1123
1127
  // License
1124
1128
  // MIT © Luke Edwards
1125
- /**
1126
- * @private
1127
- */
1128
1129
  static _toVal(mix) {
1129
1130
  let y;
1130
1131
  let str = '';
@@ -1159,7 +1160,6 @@ class Utils {
1159
1160
  // MIT © Luke Edwards
1160
1161
  /**
1161
1162
  * Convert any object to a string with its values.
1162
- * @returns {string}
1163
1163
  */
1164
1164
  static clsx(...inputs) {
1165
1165
  let i = 0;
@@ -1167,7 +1167,6 @@ class Utils {
1167
1167
  let x;
1168
1168
  let str = '';
1169
1169
  while (i < inputs.length) {
1170
- // eslint-disable-next-line prefer-rest-params
1171
1170
  tmp = inputs[i++];
1172
1171
  if (tmp) {
1173
1172
  x = Utils._toVal(tmp);
@@ -1183,7 +1182,9 @@ class Utils {
1183
1182
  * Get the current theme name (either from local storage or the browser settings).
1184
1183
  */
1185
1184
  static getThemeName(themeName) {
1186
- if (window.vendorPrefix && window.vendorPrefix !== '@@vendorPrefix@@' && window.vendorPrefix !== 'MV') {
1185
+ if (window.vendorPrefix &&
1186
+ window.vendorPrefix !== '@@vendorPrefix@@' &&
1187
+ window.vendorPrefix !== 'MV') {
1187
1188
  return window.vendorPrefix;
1188
1189
  }
1189
1190
  themeName = (window._localStorage || window.localStorage).getItem('App.themeName');
@@ -1215,13 +1216,17 @@ class Utils {
1215
1216
  }
1216
1217
  /**
1217
1218
  * Toggle the theme name between 'dark' and 'colored'.
1219
+ *
1218
1220
  * @returns the new theme name.
1219
1221
  */
1220
1222
  static toggleTheme(themeName) {
1221
- if (window.vendorPrefix && window.vendorPrefix !== '@@vendorPrefix@@' && window.vendorPrefix !== 'MV') {
1223
+ if (window.vendorPrefix &&
1224
+ window.vendorPrefix !== '@@vendorPrefix@@' &&
1225
+ window.vendorPrefix !== 'MV') {
1222
1226
  return window.vendorPrefix;
1223
1227
  }
1224
- themeName = themeName || (window._localStorage || window.localStorage).getItem('App.themeName') || 'light';
1228
+ themeName =
1229
+ themeName || (window._localStorage || window.localStorage).getItem('App.themeName') || 'light';
1225
1230
  // dark => blue => colored => light => dark
1226
1231
  const themes = Utils.getThemeNames();
1227
1232
  const pos = themeName ? themes.indexOf(themeName) : -1;
@@ -1237,13 +1242,16 @@ class Utils {
1237
1242
  }
1238
1243
  /**
1239
1244
  * Get the list of themes
1245
+ *
1240
1246
  * @returns list of possible themes
1241
1247
  */
1242
1248
  static getThemeNames() {
1243
- if (window.vendorPrefix && window.vendorPrefix !== '@@vendorPrefix@@' && window.vendorPrefix !== 'MV') {
1249
+ if (window.vendorPrefix &&
1250
+ window.vendorPrefix !== '@@vendorPrefix@@' &&
1251
+ window.vendorPrefix !== 'MV') {
1244
1252
  return [window.vendorPrefix];
1245
1253
  }
1246
- return ['light', 'dark', 'blue', 'colored'];
1254
+ return ['light', 'dark'];
1247
1255
  }
1248
1256
  /**
1249
1257
  * Parse a query string into its parts.
@@ -1283,6 +1291,7 @@ class Utils {
1283
1291
  }
1284
1292
  /**
1285
1293
  * Returns parent ID.
1294
+ *
1286
1295
  * @returns parent ID or null if no parent
1287
1296
  */
1288
1297
  static getParentId(id) {
@@ -1311,9 +1320,9 @@ class Utils {
1311
1320
  text += ` ${dateObj.getHours().toString().padStart(2, '0')}:${dateObj.getMinutes().toString().padStart(2, '0')}:${dateObj.getSeconds().toString().padStart(2, '0')}.${dateObj.getMilliseconds().toString().padStart(3, '0')}`;
1312
1321
  return text;
1313
1322
  }
1314
- /*
1315
- Format seconds to string like 'h:mm:ss' or 'd.hh:mm:ss'
1316
- */
1323
+ /**
1324
+ * Format seconds to string like 'h:mm:ss' or 'd.hh:mm:ss'
1325
+ */
1317
1326
  static formatTime(seconds) {
1318
1327
  if (seconds) {
1319
1328
  seconds = Math.round(seconds);
@@ -1342,8 +1351,8 @@ class Utils {
1342
1351
  .replace(/\s/g, '')
1343
1352
  .toLowerCase();
1344
1353
  }
1345
- /*
1346
- Open url link in the new target window
1354
+ /**
1355
+ * Open url link in the new target window
1347
1356
  */
1348
1357
  static openLink(url, target) {
1349
1358
  // replace IPv6 Address with [ipv6]:port
@@ -1435,31 +1444,26 @@ class Utils {
1435
1444
  }
1436
1445
  /**
1437
1446
  * Convert quality code into text
1447
+ *
1438
1448
  * @returns lines that decode quality
1439
1449
  */
1440
1450
  static quality2text(quality) {
1441
- // eslint-disable-next-line no-bitwise
1442
- const custom = quality & 0xFFFF0000;
1451
+ const custom = quality & 0xffff0000;
1443
1452
  const text = QUALITY_BITS[quality];
1444
1453
  let result;
1445
1454
  if (text) {
1446
1455
  result = [text];
1447
- // eslint-disable-next-line no-bitwise
1448
1456
  }
1449
1457
  else if (quality & 0x01) {
1450
- // eslint-disable-next-line no-bitwise
1451
- result = [QUALITY_BITS[0x01], `0x${(quality & (0xFFFF & ~1)).toString(16)}`];
1452
- // eslint-disable-next-line no-bitwise
1458
+ result = [QUALITY_BITS[0x01], `0x${(quality & (0xffff & ~1)).toString(16)}`];
1453
1459
  }
1454
1460
  else if (quality & 0x02) {
1455
- // eslint-disable-next-line no-bitwise
1456
- result = [QUALITY_BITS[0x02], `0x${(quality & (0xFFFF & ~2)).toString(16)}`];
1461
+ result = [QUALITY_BITS[0x02], `0x${(quality & (0xffff & ~2)).toString(16)}`];
1457
1462
  }
1458
1463
  else {
1459
1464
  result = [`0x${quality.toString(16)}`];
1460
1465
  }
1461
1466
  if (custom) {
1462
- // eslint-disable-next-line no-bitwise
1463
1467
  result.push(`0x${(custom >> 16).toString(16).toUpperCase()}`);
1464
1468
  }
1465
1469
  return result;
@@ -1472,6 +1476,7 @@ class Utils {
1472
1476
  }
1473
1477
  /**
1474
1478
  * Get states of object
1479
+ *
1475
1480
  * @returns states as an object in form {"value1": "label1", "value2": "label2"} or null
1476
1481
  */
1477
1482
  static getStates(obj) {
@@ -1483,7 +1488,7 @@ class Utils {
1483
1488
  try {
1484
1489
  result = JSON.parse(states);
1485
1490
  }
1486
- catch (ex) {
1491
+ catch (_b) {
1487
1492
  console.error(`Cannot parse states: ${states}`);
1488
1493
  result = null;
1489
1494
  }
@@ -1518,6 +1523,7 @@ class Utils {
1518
1523
  }
1519
1524
  /**
1520
1525
  * Get svg file as text
1526
+ *
1521
1527
  * @param url URL of SVG file
1522
1528
  * @returns Promise with "data:image..."
1523
1529
  */
@@ -1526,7 +1532,6 @@ class Utils {
1526
1532
  const blob = await response.blob();
1527
1533
  return new Promise(resolve => {
1528
1534
  const reader = new FileReader();
1529
- // eslint-disable-next-line func-names
1530
1535
  reader.onload = function () {
1531
1536
  var _a;
1532
1537
  resolve(((_a = this.result) === null || _a === void 0 ? void 0 : _a.toString()) || '');
@@ -1535,8 +1540,9 @@ class Utils {
1535
1540
  });
1536
1541
  }
1537
1542
  /**
1538
- * Detect file extension by its content
1539
- * @returns Detected extension, like 'jpg'
1543
+ * Detect a file extension by its content
1544
+ *
1545
+ * @returns The detected extension, like 'jpg'
1540
1546
  */
1541
1547
  static detectMimeType(
1542
1548
  /** Base64 encoded binary file */
@@ -1550,12 +1556,8 @@ class Utils {
1550
1556
  static isStableRepository(
1551
1557
  /** current configured repository or multi repository */
1552
1558
  activeRepo) {
1553
- return !!((typeof activeRepo === 'string' &&
1554
- activeRepo.toLowerCase().startsWith('stable'))
1555
- ||
1556
- (activeRepo &&
1557
- typeof activeRepo !== 'string' &&
1558
- activeRepo.find(r => r.toLowerCase().startsWith('stable'))));
1559
+ return !!((typeof activeRepo === 'string' && activeRepo.toLowerCase().startsWith('stable')) ||
1560
+ (activeRepo && typeof activeRepo !== 'string' && activeRepo.find(r => r.toLowerCase().startsWith('stable'))));
1559
1561
  }
1560
1562
  /**
1561
1563
  * Check if a given string is an integer
@@ -1570,7 +1572,6 @@ class Utils {
1570
1572
  * Check if the date is valid
1571
1573
  */
1572
1574
  static isValidDate(date) {
1573
- // eslint-disable-next-line no-restricted-globals
1574
1575
  return date instanceof Date && !isNaN(date);
1575
1576
  }
1576
1577
  static getStyle(theme, ...args) {
@@ -1,3 +1,3 @@
1
- import React, { JSXElementConstructor } from 'react';
2
- declare const withWidth: () => (WrappedComponent: JSXElementConstructor<any>) => (props: Record<string, any>) => React.JSX.Element;
1
+ import { type JSXElementConstructor, type JSX } from 'react';
2
+ declare function withWidth(): (WrappedComponent: JSXElementConstructor<any>) => (props: Record<string, any>) => JSX.Element;
3
3
  export default withWidth;
@@ -9,15 +9,19 @@ const material_1 = require("@mui/material");
9
9
  function useWidth() {
10
10
  const theme = (0, styles_1.useTheme)();
11
11
  const keys = [...theme.breakpoints.keys].reverse();
12
- return keys.reduce((output, key) => {
12
+ return (keys.reduce((output, key) => {
13
13
  // eslint-disable-next-line react-hooks/rules-of-hooks
14
14
  const matches = (0, material_1.useMediaQuery)(theme.breakpoints.up(key));
15
15
  return !output && matches ? key : output;
16
- }, null) || 'xs';
16
+ }, null) || 'xs');
17
17
  }
18
18
  // FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
19
- const withWidth = () => (WrappedComponent) => (props) => {
20
- const width = useWidth();
21
- return react_1.default.createElement(WrappedComponent, Object.assign({}, props, { width: width }));
22
- };
19
+ function withWidth() {
20
+ return (WrappedComponent) => {
21
+ return function AnyComponent(props) {
22
+ const width = useWidth();
23
+ return (react_1.default.createElement(WrappedComponent, Object.assign({}, props, { width: width })));
24
+ };
25
+ };
26
+ }
23
27
  exports.default = withWidth;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { type JSX } from 'react';
2
2
  interface DialogCronProps {
3
3
  onClose: () => void;
4
4
  onOk: (cron: string | false) => void;
@@ -17,6 +17,6 @@ declare class DialogComplexCron extends React.Component<DialogCronProps, DialogC
17
17
  handleCancel(): void;
18
18
  handleOk(): void;
19
19
  handleClear(): void;
20
- render(): React.JSX.Element;
20
+ render(): JSX.Element;
21
21
  }
22
22
  export default DialogComplexCron;
@@ -50,14 +50,14 @@ class DialogComplexCron extends react_1.default.Component {
50
50
  this.props.onClose();
51
51
  }
52
52
  render() {
53
- return react_1.default.createElement(material_1.Dialog, { onClose: () => { }, maxWidth: "md", fullWidth: true, sx: { '& .MuiDialog-paper': styles.dialogPaper }, open: !0, "aria-labelledby": "cron-dialog-title" },
53
+ return (react_1.default.createElement(material_1.Dialog, { onClose: () => { }, maxWidth: "md", fullWidth: true, sx: { '& .MuiDialog-paper': styles.dialogPaper }, open: !0, "aria-labelledby": "cron-dialog-title" },
54
54
  react_1.default.createElement(material_1.DialogTitle, { id: "cron-dialog-title" }, this.props.title || i18n_1.default.t('ra_Define schedule...')),
55
55
  react_1.default.createElement(material_1.DialogContent, { style: { height: '100%', overflow: 'hidden' } },
56
56
  react_1.default.createElement(ComplexCron_1.default, { cronExpression: this.state.cron, onChange: cron => this.setState({ cron }), language: i18n_1.default.getLanguage() })),
57
57
  react_1.default.createElement(material_1.DialogActions, null,
58
- !!this.props.clearButton && react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.handleClear(), startIcon: react_1.default.createElement(icons_material_1.Delete, null) }, this.props.clear || i18n_1.default.t('ra_Clear')),
58
+ !!this.props.clearButton && (react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.handleClear(), startIcon: react_1.default.createElement(icons_material_1.Delete, null) }, this.props.clear || i18n_1.default.t('ra_Clear'))),
59
59
  react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleOk(), color: "primary", startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.ok || i18n_1.default.t('ra_Ok')),
60
- react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
60
+ react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel')))));
61
61
  }
62
62
  }
63
63
  exports.default = DialogComplexCron;
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright 2019-2023 Denis Haev (bluefox) <dogafox@gmail.com>
2
+ * Copyright 2019-2024 Denis Haev (bluefox) <dogafox@gmail.com>
3
3
  *
4
4
  * MIT License
5
5
  *
6
- * */
7
- import React, { Component } from 'react';
6
+ */
7
+ import React, { Component, type JSX } from 'react';
8
8
  interface DialogConfirmProps {
9
9
  /** The dialog title; default: Are you sure? (translated) */
10
10
  title?: string;
@@ -34,6 +34,6 @@ declare class DialogConfirm extends Component<DialogConfirmProps, DialogConfirmS
34
34
  constructor(props: DialogConfirmProps);
35
35
  handleOk(): void;
36
36
  handleCancel(): void;
37
- render(): React.JSX.Element;
37
+ render(): JSX.Element | null;
38
38
  }
39
39
  export default DialogConfirm;