@iobroker/adapter-react-v5 7.0.2 → 7.1.1

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 (307) hide show
  1. package/Components/404.d.ts +3 -2
  2. package/Components/404.js +3 -2
  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 +135 -152
  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 +21 -18
  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 +20 -7
  26. package/Components/Loaders/Vendor.d.ts +2 -2
  27. package/Components/Loaders/Vendor.js +15 -7
  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 +40 -39
  32. package/Components/ObjectBrowser.js +550 -435
  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 +25 -21
  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 +128 -85
  79. package/LegacyConnection.d.ts +240 -248
  80. package/LegacyConnection.js +500 -525
  81. package/README.md +1264 -1171
  82. package/Theme.d.ts +1 -1
  83. package/Theme.js +9 -12
  84. package/assets/devices.json +1 -0
  85. package/assets/rooms.json +1 -0
  86. package/craco-module-federation.js +3 -12
  87. package/i18n/de.json +434 -434
  88. package/i18n/en.json +434 -434
  89. package/i18n/es.json +434 -434
  90. package/i18n/fr.json +434 -434
  91. package/i18n/it.json +434 -434
  92. package/i18n/nl.json +434 -434
  93. package/i18n/pl.json +434 -434
  94. package/i18n/pt.json +434 -434
  95. package/i18n/ru.json +434 -434
  96. package/i18n/uk.json +434 -434
  97. package/i18n/zh-cn.json +434 -434
  98. package/i18n.d.ts +26 -19
  99. package/i18n.js +28 -22
  100. package/icons/IconAdapter.js +2 -2
  101. package/icons/IconAlias.js +2 -2
  102. package/icons/IconChannel.js +2 -2
  103. package/icons/IconClearFilter.js +2 -2
  104. package/icons/IconClosed.js +2 -2
  105. package/icons/IconCopy.js +2 -2
  106. package/icons/IconDevice.js +2 -2
  107. package/icons/IconDocument.js +2 -2
  108. package/icons/IconDocumentReadOnly.js +2 -2
  109. package/icons/IconExpert.js +2 -2
  110. package/icons/IconFx.js +2 -2
  111. package/icons/IconInstance.js +2 -2
  112. package/icons/IconLogout.js +2 -2
  113. package/icons/IconNoIcon.js +2 -2
  114. package/icons/IconOpen.d.ts +2 -2
  115. package/icons/IconOpen.js +2 -2
  116. package/icons/IconProps.d.ts +4 -3
  117. package/icons/IconState.d.ts +2 -2
  118. package/icons/IconState.js +2 -2
  119. package/index.css +3 -2
  120. package/package.json +4 -4
  121. package/src/Components/404.tsx +32 -31
  122. package/src/Components/ColorPicker.tsx +142 -114
  123. package/src/Components/ComplexCron.tsx +174 -137
  124. package/src/Components/CopyToClipboard.tsx +22 -9
  125. package/src/Components/CustomModal.tsx +76 -69
  126. package/src/Components/FileBrowser.tsx +959 -852
  127. package/src/Components/FileViewer.tsx +146 -127
  128. package/src/Components/Icon.tsx +80 -52
  129. package/src/Components/IconPicker.tsx +83 -67
  130. package/src/Components/IconSelector.tsx +159 -141
  131. package/src/Components/Image.tsx +43 -26
  132. package/src/Components/Loader.tsx +56 -32
  133. package/src/Components/Logo.tsx +62 -52
  134. package/src/Components/MDUtils.tsx +10 -6
  135. package/src/Components/ObjectBrowser.tsx +3198 -2478
  136. package/src/Components/Router.tsx +11 -11
  137. package/src/Components/SaveCloseButtons.tsx +43 -39
  138. package/src/Components/Schedule.tsx +1091 -853
  139. package/src/Components/SelectWithIcon.tsx +135 -93
  140. package/src/Components/TabContainer.tsx +22 -20
  141. package/src/Components/TabContent.tsx +13 -12
  142. package/src/Components/TabHeader.tsx +10 -9
  143. package/src/Components/TableResize.tsx +52 -37
  144. package/src/Components/TextWithIcon.tsx +30 -19
  145. package/src/Components/ToggleThemeMenu.tsx +31 -13
  146. package/src/Components/TreeTable.tsx +468 -385
  147. package/src/Components/UploadImage.tsx +153 -121
  148. package/src/Components/Utils.tsx +135 -127
  149. package/src/Components/loader.css +40 -31
  150. package/src/Components/withWidth.tsx +23 -12
  151. package/src/Connection.tsx +1 -3
  152. package/src/Dialogs/ComplexCron.tsx +55 -61
  153. package/src/Dialogs/Confirm.tsx +88 -65
  154. package/src/Dialogs/Cron.tsx +122 -112
  155. package/src/Dialogs/Error.tsx +37 -42
  156. package/src/Dialogs/Message.tsx +39 -37
  157. package/src/Dialogs/SelectFile.tsx +95 -85
  158. package/src/Dialogs/SelectID.tsx +141 -129
  159. package/src/Dialogs/SimpleCron.tsx +44 -44
  160. package/src/Dialogs/TextInput.tsx +60 -68
  161. package/src/GenericApp.tsx +342 -242
  162. package/src/LegacyConnection.tsx +972 -842
  163. package/src/Prompt.tsx +3 -1
  164. package/src/Theme.tsx +19 -26
  165. package/src/icons/IconAdapter.tsx +16 -14
  166. package/src/icons/IconAlias.tsx +16 -14
  167. package/src/icons/IconChannel.tsx +55 -16
  168. package/src/icons/IconClearFilter.tsx +17 -15
  169. package/src/icons/IconClosed.tsx +16 -11
  170. package/src/icons/IconCopy.tsx +16 -11
  171. package/src/icons/IconDevice.tsx +121 -22
  172. package/src/icons/IconDocument.tsx +16 -11
  173. package/src/icons/IconDocumentReadOnly.tsx +21 -12
  174. package/src/icons/IconExpert.tsx +20 -12
  175. package/src/icons/IconFx.tsx +16 -14
  176. package/src/icons/IconInstance.tsx +16 -14
  177. package/src/icons/IconLogout.tsx +20 -18
  178. package/src/icons/IconNoIcon.tsx +16 -14
  179. package/src/icons/IconOpen.tsx +17 -12
  180. package/src/icons/IconProps.tsx +4 -3
  181. package/src/icons/IconState.tsx +34 -13
  182. package/src/index.css +3 -2
  183. package/tasks.js +91 -0
  184. package/types.d.ts +141 -0
  185. package/Components/Loaders/PT.css +0 -109
  186. package/Components/Loaders/Vendor.css +0 -13
  187. package/Components/loader.css +0 -222
  188. package/Components/types.d.ts +0 -82
  189. package/assets/devices/Alarm Systems.svg +0 -19
  190. package/assets/devices/Amplifier.svg +0 -22
  191. package/assets/devices/Awnings.svg +0 -5
  192. package/assets/devices/Battery Status.svg +0 -5
  193. package/assets/devices/Ceiling Spotlights.svg +0 -16
  194. package/assets/devices/Chandelier.svg +0 -7
  195. package/assets/devices/Climate.svg +0 -12
  196. package/assets/devices/Coffee Makers.svg +0 -6
  197. package/assets/devices/Cold Water.svg +0 -31
  198. package/assets/devices/Computer.svg +0 -21
  199. package/assets/devices/Consumption.svg +0 -8
  200. package/assets/devices/Curtains.svg +0 -43
  201. package/assets/devices/Dishwashers.svg +0 -12
  202. package/assets/devices/Doors.svg +0 -6
  203. package/assets/devices/Doorstep.svg +0 -35
  204. package/assets/devices/Dryer.svg +0 -14
  205. package/assets/devices/Fan.svg +0 -20
  206. package/assets/devices/Floor Lamps.svg +0 -5
  207. package/assets/devices/Garage Doors.svg +0 -9
  208. package/assets/devices/Gates.svg +0 -32
  209. package/assets/devices/Hairdryer.svg +0 -23
  210. package/assets/devices/Handle.svg +0 -6
  211. package/assets/devices/Hanging Lamps.svg +0 -9
  212. package/assets/devices/Heater.svg +0 -44
  213. package/assets/devices/Hoods.svg +0 -12
  214. package/assets/devices/Hot Water.svg +0 -10
  215. package/assets/devices/Humidity.svg +0 -41
  216. package/assets/devices/Iron.svg +0 -5
  217. package/assets/devices/Irrigation.svg +0 -23
  218. package/assets/devices/Led Strip.svg +0 -31
  219. package/assets/devices/Light.svg +0 -30
  220. package/assets/devices/Lightings.svg +0 -46
  221. package/assets/devices/Lock.svg +0 -19
  222. package/assets/devices/Louvre.svg +0 -7
  223. package/assets/devices/Mowing Machine.svg +0 -9
  224. package/assets/devices/Music.svg +0 -13
  225. package/assets/devices/Outdoor Blinds.svg +0 -7
  226. package/assets/devices/People.svg +0 -19
  227. package/assets/devices/Pool.svg +0 -8
  228. package/assets/devices/Power Consumption.svg +0 -13
  229. package/assets/devices/Printer.svg +0 -10
  230. package/assets/devices/Pump.svg +0 -10
  231. package/assets/devices/Receiver.svg +0 -19
  232. package/assets/devices/Sconces.svg +0 -10
  233. package/assets/devices/Security.svg +0 -34
  234. package/assets/devices/Shading.svg +0 -5
  235. package/assets/devices/Shutters.svg +0 -11
  236. package/assets/devices/SmokeDetector.svg +0 -13
  237. package/assets/devices/Sockets.svg +0 -13
  238. package/assets/devices/Speaker.svg +0 -35
  239. package/assets/devices/Stove.svg +0 -12
  240. package/assets/devices/Table Lamps.svg +0 -12
  241. package/assets/devices/Temperature Sensors.svg +0 -28
  242. package/assets/devices/Tv.svg +0 -8
  243. package/assets/devices/Vacuum Cleaner.svg +0 -16
  244. package/assets/devices/Ventilation.svg +0 -12
  245. package/assets/devices/Washing Machines.svg +0 -16
  246. package/assets/devices/Water Consumption.svg +0 -6
  247. package/assets/devices/Water Heater.svg +0 -8
  248. package/assets/devices/Water.svg +0 -40
  249. package/assets/devices/Weather.svg +0 -28
  250. package/assets/devices/Window.svg +0 -8
  251. package/assets/rooms/Anteroom.svg +0 -53
  252. package/assets/rooms/Attic.svg +0 -21
  253. package/assets/rooms/Balcony.svg +0 -13
  254. package/assets/rooms/Barn.svg +0 -6
  255. package/assets/rooms/Basement.svg +0 -5
  256. package/assets/rooms/Bathroom.svg +0 -38
  257. package/assets/rooms/Bedroom.svg +0 -5
  258. package/assets/rooms/Boiler Room.svg +0 -13
  259. package/assets/rooms/Carport.svg +0 -17
  260. package/assets/rooms/Cellar.svg +0 -89
  261. package/assets/rooms/Chamber.svg +0 -9
  262. package/assets/rooms/Corridor.svg +0 -53
  263. package/assets/rooms/Dining Area.svg +0 -37
  264. package/assets/rooms/Dining Room.svg +0 -37
  265. package/assets/rooms/Dining.svg +0 -37
  266. package/assets/rooms/Dressing Room.svg +0 -5
  267. package/assets/rooms/Driveway.svg +0 -15
  268. package/assets/rooms/Entrance.svg +0 -44
  269. package/assets/rooms/Equipment Room.svg +0 -15
  270. package/assets/rooms/Front Yard.svg +0 -64
  271. package/assets/rooms/Gallery.svg +0 -14
  272. package/assets/rooms/Garage.svg +0 -20
  273. package/assets/rooms/Garden.svg +0 -13
  274. package/assets/rooms/Ground Floor.svg +0 -95
  275. package/assets/rooms/Guest Bathroom.svg +0 -33
  276. package/assets/rooms/Guest Room.svg +0 -5
  277. package/assets/rooms/Gym.svg +0 -5
  278. package/assets/rooms/Hall.svg +0 -19
  279. package/assets/rooms/Home Theater.svg +0 -8
  280. package/assets/rooms/Kitchen.svg +0 -18
  281. package/assets/rooms/Laundry Room.svg +0 -12
  282. package/assets/rooms/Living Area.svg +0 -11
  283. package/assets/rooms/Living Room.svg +0 -10
  284. package/assets/rooms/Locker Room.svg +0 -17
  285. package/assets/rooms/Nursery.svg +0 -5
  286. package/assets/rooms/Office.svg +0 -8
  287. package/assets/rooms/Outdoors.svg +0 -7
  288. package/assets/rooms/Playroom.svg +0 -6
  289. package/assets/rooms/Pool.svg +0 -8
  290. package/assets/rooms/Rear Wall.svg +0 -30
  291. package/assets/rooms/Second Floor.svg +0 -95
  292. package/assets/rooms/Shed.svg +0 -16
  293. package/assets/rooms/Sleeping Area.svg +0 -22
  294. package/assets/rooms/Stairway.svg +0 -5
  295. package/assets/rooms/Stairwell.svg +0 -15
  296. package/assets/rooms/Storeroom.svg +0 -5
  297. package/assets/rooms/Summer House.svg +0 -27
  298. package/assets/rooms/Swimming Pool.svg +0 -21
  299. package/assets/rooms/Terrace.svg +0 -7
  300. package/assets/rooms/Toilet.svg +0 -10
  301. package/assets/rooms/Upstairs.svg +0 -6
  302. package/assets/rooms/Wardrobe.svg +0 -60
  303. package/assets/rooms/Washroom.svg +0 -20
  304. package/assets/rooms/Wc.svg +0 -10
  305. package/assets/rooms/Windscreen.svg +0 -60
  306. package/assets/rooms/Workshop.svg +0 -23
  307. package/assets/rooms/Workspace.svg +0 -8
package/README.md CHANGED
@@ -1,1339 +1,1432 @@
1
- # Help ReactJS classes for adapter config
2
- You can find demo on https://github.com/ioBroker/adapter-react-demo
3
-
4
- ## Getting started
5
- If you want to create the configuration page with ReactJS:
6
- 1. Create github repo for adapter.
7
- 2. execute `npx create-react-app src` . It will take a while.
8
- 3. `cd src`
9
- 4. Modify package.json file in src directory:
10
- - Change `name` from `src` to `ADAPTERNAME-admin` (Of course replace `ADAPTERNAME` with yours)
11
- - Add to devDependencies:
12
- ```
13
- "@iobroker/adapter-react": "^4.0.10",
14
- ```
15
- Versions can be higher.
16
- So your src/package.json should look like:
17
- ```
18
- {
19
- "name": "ADAPTERNAME-admin",
20
- "version": "0.1.0",
21
- "private": true,
22
- "dependencies": {
23
- "react": "^18.2.0",
24
- "react-dom": "^18.2.0",
25
- "react-icons": "^4.6.0",
26
- "react-scripts": "^5.0.1",
27
- "@iobroker/adapter-react-v5": "^3.2.7",
28
- "del": "^6.1.1",
29
- "gulp": "^4.0.2"
30
- },
31
- "scripts": {
32
- "start": "react-scripts start",
33
- "build": "react-scripts build",
34
- "test": "react-scripts test",
35
- "eject": "react-scripts eject"
36
- },
37
- "eslintConfig": {
38
- "extends": "react-app"
39
- },
40
- "homepage": ".",
41
- "browserslist": [
42
- ">0.2%",
43
- "not dead",
44
- "not ie <= 11",
45
- "not op_mini all"
46
- ]
47
- }
48
- ```
49
- 5. Call in `src`: `npm install`
50
- 6. Copy tasks.js into `src`: `cp node_modules/@iobroker/adapter-react/tasks.js tasks.js`
51
- 7. Start your dummy application `npm run start` for developing or build with `npm run build` and
52
- copy files in `build` directory to `www` or to `admin`. In the admin you must rename `index.html` to `index_m.html`.
53
- 8. You can do that with `gulp` tasks: `gulp build`, `gulp copy`, `gulp renameIndex` or `gulp renameTab`
54
-
55
- ## Development
56
- 1. Add `socket.io` to `public/index.html`.
57
- After
58
-
59
- ```
60
- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
61
- ```
62
-
63
- insert
64
-
65
- ```
66
- <script>
67
- var script = document.createElement('script');
68
- window.registerSocketOnLoad = function (cb) {
69
- window.socketLoadedHandler = cb;
70
- };
71
- const parts = (window.location.search || '').replace(/^\?/, '').split('&');
72
- const query = {};
73
- parts.forEach(item => {
74
- const [name, val] = item.split('=');
75
- query[decodeURIComponent(name)] = val !== undefined ? decodeURIComponent(val) : true;
76
- });
77
- script.onload = function () { typeof window.socketLoadedHandler === 'function' && window.socketLoadedHandler(); };
78
- script.src = window.location.port === '3000' ? window.location.protocol + '//' + (query.host || window.location.hostname) + ':' + (query.port || 8081) + '/lib/js/socket.io.js' : '%PUBLIC_URL%/../../lib/js/socket.io.js';
79
-
80
- document.head.appendChild(script);
81
- </script>
82
- ```
83
-
84
- 3. Add to App.js constructor initialization for I18n:
85
- ```
86
- class App extends GenericApp {
87
- constructor(props) {
88
- const extendedProps = {...props};
89
- extendedProps.encryptedFields = ['pass']; // this parameter will be encrypted and decrypted automatically
90
- extendedProps.translations = {
91
- 'en': require('./i18n/en'),
92
- 'de': require('./i18n/de'),
93
- 'ru': require('./i18n/ru'),
94
- 'pt': require('./i18n/pt'),
95
- 'nl': require('./i18n/nl'),
96
- 'fr': require('./i18n/fr'),
97
- 'it': require('./i18n/it'),
98
- 'es': require('./i18n/es'),
99
- 'pl': require('./i18n/pl'),
100
- 'uk': require('./i18n/uk'),
101
- 'zh-cn': require('./i18n/zh-cn'),
102
- };
103
- // get actual admin port
104
- extendedProps.socket = {port: parseInt(window.location.port, 10)};
105
-
106
- // Only if close, save buttons are not required at the bottom (e.g. if admin tab)
107
- // extendedProps.bottomButtons = false;
108
-
109
- // only for debug purposes
110
- if (extendedProps.socket.port === 3000) {
111
- extendedProps.socket.port = 8081;
112
- }
113
-
114
- // allow to manage GenericApp the sentry initialisation or do not set the sentryDSN if no sentry available
115
- extendedProps.sentryDSN = 'https://yyy@sentry.iobroker.net/xx';
116
-
117
- super(extendedProps);
118
- }
119
- ...
120
- }
121
- ```
122
-
123
- 4. Replace `index.js` with the following code to support themes:
124
- ```
125
- import React from 'react';
126
- import ReactDOM from 'react-dom';
127
- import { MuiThemeProvider} from '@material-ui/core/styles';
128
- import * as serviceWorker from './serviceWorker';
129
-
130
- import './index.css';
131
- import App from './App';
132
- import { version } from '../package.json';
133
-
134
- import theme from '@iobroker/adapter-react/Theme';
135
-
136
- console.log('iobroker.scenes@' + version);
137
- let themeName = window.localStorage ? window.localStorage.getItem('App.theme') || 'light' : 'light';
138
-
139
- function build() {
140
- return ReactDOM.render(<MuiThemeProvider theme={ theme(themeName) }>
141
- <App onThemeChange={_theme => {
142
- themeName = _theme;
143
- build();
144
- }}/>
145
- </MuiThemeProvider>, document.getElementById('root'));
146
- }
147
-
148
- build();
149
-
150
- // If you want your app to work offline and load faster, you can change
151
- // unregister() to register() below. Note this comes with some pitfalls.
152
- // Learn more about service workers: http://bit.ly/CRA-PWA
153
- serviceWorker.unregister();
154
- ```
155
-
156
- 5. Add to App.js encoding and decoding of values:
157
- ```
158
- class App extend GenericApp {
159
- ...
160
- onPrepareLoad(settings) {
161
- settings.pass = this.decode(settings.pass);
162
- }
163
- onPrepareSave(settings) {
164
- settings.pass = this.encode(settings.pass);
165
- }
166
- }
167
- ```
168
-
169
- 6. The optional step is to validate the data to be saved:
170
- ```
171
- onPrepareSave(settings) {
172
- super.onPrepareSave(settings);
173
- if (DATA_INVALID) {
174
- return false; // configuration will not be saved
175
- } else {
176
- return true;
177
- }
178
- }
179
- ```
180
-
181
- ## Components
182
-
183
- ### Connection.tsx
184
- This is a non-react class to provide the communication for socket connection with the server.
185
-
186
- ### GenericApp.tsx
187
-
188
- ### i18n.ts
189
-
190
- ### Theme.tsx
191
-
192
- ### Dialogs
193
- Some dialogs are predefined and could be used out of the box.
194
-
195
- #### Confirm.tsx
196
- <!-- TODO: Provide screenshot here -->
197
-
198
- Usage:
199
- ```
200
- import React from 'react';
201
- import ConfirmDialog from '@iobroker/adapter-react/Dialogs/Confirm'
202
- import I18n from '@iobroker/adapter-react/i18n';
203
-
204
- class ExportImportDialog extends React.Component {
205
- constructor(props) {
206
- super(props);
207
-
208
- this.state = {
209
- confirmDialog: false,
210
- };
211
- }
212
-
213
- renderConfirmDialog() {
214
- if (!this.state.confirmDialog) {
215
- return null;
216
- }
217
- return <ConfirmDialog
218
- title={ I18n.t('Scene will be overwritten.') }
219
- text={ I18n.t('All data will be lost. Confirm?') }
220
- ok={ I18n.t('Yes') }
221
- cancel={ I18n.t('Cancel') }
222
- suppressQuestionMinutes={5}
223
- dialogName="myConfirmDialogThatCouldBeSuppressed"
224
- suppressText={I18n.t('Suppress question for next %s minutes', 5)}
225
- onClose={isYes => {
226
- this.setState({ confirmDialog: false} );
227
- }}
228
- />;
229
- }
230
- render() {
231
- return <div>
232
- <Button onClick={ () => this.setState({confirmDialog: true}) }>Click</Button>
233
- { this.renderConfirmDialog() }
234
- </div>
235
- }
236
- }
237
-
238
- export default ExportImportDialog;
239
- ```
240
-
241
- #### Error.tsx
242
- <!-- TODO: Provide screenshot here -->
243
-
244
- #### Message.tsx
245
- <!-- TODO: Provide screenshot here -->
246
- ```
247
- renderMessage() {
248
- if (this.state.showMessage) {
249
- return <Message
250
- text={this.state.showMessage}
251
- onClose={() => this.setState({showMessage: false})}
252
- />;
253
- } else {
254
- return null;
255
- }
256
- }
257
- ```
258
-
259
- #### SelectID.tsx
260
- ![Logo](img/selectID.png)
261
- ```
262
- import DialogSelectID from '@iobroker/adapter-react/Dialogs/SelectID';
263
-
264
- class MyComponent extends Component {
265
- constructor(props) {
266
- super(props);
267
- this.state = {
268
- showSelectId: false,
269
- };
270
- }
271
-
272
- renderSelectIdDialog() {
273
- if (this.state.showSelectId) {
274
- return <DialogSelectID
275
- key="tableSelect"
276
- imagePrefix="../.."
277
- dialogName={this.props.adapterName}
278
- themeType={this.props.themeType}
279
- socket={this.props.socket}
280
- statesOnly={true}
281
- selected={this.state.selectIdValue}
282
- onClose={() => this.setState({showSelectId: false})}
283
- onOk={(selected, name) => {
284
- this.setState({showSelectId: false, selectIdValue: selected});
285
- }}
286
- />;
287
- } else {
288
- return null;
289
- }
290
- }
291
- render() {
292
- return renderSelectIdDialog();
293
- }
294
- }
295
- ```
296
-
297
- #### Cron
298
- Include `"react-text-mask": "^5.4.3",` in package.json.
299
-
300
- <!-- TODO: Provide screenshot here -->
301
-
302
- ```
303
- function renderCron() {
304
- if (!showCron) {
305
- return null;
306
- } else {
307
- return <DialogCron
308
- key="dialogCron1"
309
- cron={this.state.cronValue || '* * * * *'}
310
- onClose={() => this.setState({ showCron: false })}
311
- onOk={cronValue => {
312
- this.setState({ cronValue })
313
- }}
314
- />;
315
- }
316
- }
317
- ```
318
-
319
- ### Components
320
-
321
- #### Utils.tsx
322
- ##### getObjectNameFromObj
323
- `getObjectNameFromObj(obj, settings, options, isDesc)`
324
-
325
- Get object name from a single object.
326
-
327
- Usage: `Utils.getObjectNameFromObj(this.objects[id], null, {language: I18n.getLanguage()})`
328
-
329
- ##### getObjectIcon
330
- `getObjectIcon(id, obj)`
331
-
332
- Get icon from the object.
333
-
334
- Usage:
335
- ```
336
- const icon = Utils.getObjectIcon(id, this.objects[id]);
337
- return (<img src={icon}/>);
338
- ```
339
-
340
- ##### isUseBright
341
- `isUseBright(color, defaultValue)`
342
-
343
- Usage: `
344
-
345
- #### Loader.tsx
346
- ![Logo](img/loader.png)
347
-
348
- ```
349
- render() {
350
- if (!this.state.loaded) {
351
- return <MuiThemeProvider theme={this.state.theme}>
352
- <Loader theme={this.state.themeType}/>
353
- </MuiThemeProvider>;
354
- }
355
- // render loaded data
356
- }
357
-
358
- ```
359
-
360
- #### Logo.tsx
361
- ![Logo](img/logo.png)
362
-
363
- ```
364
- render() {
365
- return <form className={this.props.classes.tab}>
366
- <Logo
367
- instance={this.props.instance}
368
- common={this.props.common}
369
- native={this.props.native}
370
- onError={text => this.setState({errorText: text})}
371
- onLoad={this.props.onLoad}
372
- />
373
- ...
374
- </form>;
375
- }
376
- ```
377
-
378
- #### Router.tsx
379
-
380
- #### ObjectBrowser.js
381
- It is better to use `Dialog/SelectID`, but if you want:
382
-
383
- ![Logo](img/objectBrowser.png)
384
-
385
- ```
386
- <ObjectBrowser
387
- foldersFirst={this.props.foldersFirst}
388
- imagePrefix={this.props.imagePrefix || this.props.prefix} // prefix is for back compatibility
389
- defaultFilters={this.filters}
390
- dialogName={this.dialogName}
391
- showExpertButton={this.props.showExpertButton !== undefined ? this.props.showExpertButton : true}
392
- style={{ width: '100%', height: '100%' }}
393
- columns={this.props.columns || ['name', 'type', 'role', 'room', 'func', 'val']}
394
- types={this.props.types || ['state']}
395
- t={I18n.t}
396
- lang={this.props.lang || I18n.getLanguage()}
397
- socket={this.props.socket}
398
- selected={this.state.selected}
399
- multiSelect={this.props.multiSelect}
400
- notEditable={this.props.notEditable === undefined ? true : this.props.notEditable}
401
- name={this.state.name}
402
- themeName={this.props.themeName}
403
- themeType={this.props.themeType}
404
- customFilter={this.props.customFilter}
405
- onFilterChanged={filterConfig => {
406
- this.filters = filterConfig;
407
- window.localStorage.setItem(this.dialogName, JSON.stringify(filterConfig));
408
- }}
409
- onSelect={(selected, name, isDouble) => {
410
- if (JSON.stringify(selected) !== JSON.stringify(this.state.selected)) {
411
- this.setState({selected, name}, () =>
412
- isDouble && this.handleOk());
413
- } else if (isDouble) {
414
- this.handleOk();
415
- }
416
- }}
417
- />
418
- ```
419
-
420
- #### TreeTable.ts
421
- ![Logo](img/tableTree.png)
422
-
423
- ```
424
- // STYLES
425
- const styles = theme => ({
426
- tableDiv: {
427
- width: '100%',
428
- overflow: 'hidden',
429
- height: 'calc(100% - 48px)',
430
- },
431
- });
432
- class MyComponent extends Component {
433
- constructor(props) {
434
- super(props);
435
-
436
- this.state = {
437
- data: [
438
- {
439
- id: 'UniqueID1' // required
440
- fieldIdInData: 'Name1',
441
- myType: 'number',
442
- },
443
- {
444
- id: 'UniqueID2' // required
445
- fieldIdInData: 'Name12',
446
- myType: 'string',
447
- },
448
- ],
449
- };
450
-
451
- this.columns = [
452
- {
453
- title: 'Name of field', // required, else it will be "field"
454
- field: 'fieldIdInData', // required
455
- editable: false, // or true [default - true]
456
- cellStyle: { // CSS style - // optional
457
- maxWidth: '12rem',
458
- overflow: 'hidden',
459
- wordBreak: 'break-word',
460
- },
461
- lookup: { // optional => edit will be automatically "SELECT"
462
- 'value1': 'text1',
463
- 'value2': 'text2',
464
- }
465
- },
466
- {
467
- title: 'Type', // required, else it will be "field"
468
- field: 'myType', // required
469
- editable: true, // or true [default - true]
470
- lookup: { // optional => edit will be automatically "SELECT"
471
- 'number': 'Number',
472
- 'string': 'String',
473
- 'boolean': 'Boolean',
474
- },
475
- type: 'number/string/color/oid/icon/boolean', // oid=ObjectID,icon=base64-icon
476
- editComponent: props =>
477
- <div>Prefix&#123; <br/>
478
- <textarea
479
- rows={4}
480
- style={{width: '100%', resize: 'vertical'}}
481
- value={props.value}
482
- onChange={e => props.onChange(e.target.value)}
483
- />
484
- Suffix
485
- </div>,
486
- },
487
- ];
488
- }
489
- // renderTable
490
- render() {
491
- return <div className={this.props.classes.tableDiv}>
492
- <TreeTable
493
- columns={this.columns}
494
- data={this.state.data}
495
- onUpdate={(newData, oldData) => {
496
- const data = JSON.parse(JSON.stringify(this.state.data));
497
-
498
- // Added new line
499
- if (newData === true) {
500
- // find unique ID
501
- let i = 1;
502
- let id = 'line_' + i;
503
-
504
- // eslint-disable-next-line
505
- while(this.state.data.find(item => item.id === id)) {
506
- i++;
507
- id = 'line_' + i;
508
- }
509
-
510
- data.push({
511
- id,
512
- name: I18n.t('New resource') + '_' + i,
513
- color: '',
514
- icon: '',
515
- unit: '',
516
- price: 0,
517
- });
518
- } else {
519
- // existing line was modifed
520
- const pos = this.state.data.indexOf(oldData);
521
- if (pos !== -1) {
522
- Object.keys(newData).forEach(attr => data[pos][attr] = newData[attr]);
523
- }
524
- }
525
-
526
- this.setState({data});
527
- }}
528
- onDelete={oldData => {
529
- console.log('Delete: ' + JSON.stringify(oldData));
530
- const pos = this.state.data.indexOf(oldData);
531
- if (pos !== -1) {
532
- const data = JSON.parse(JSON.stringify(this.state.data));
533
- data.splice(pos, 1);
534
- this.setState({data});
535
- }
536
- }}
537
- />
538
- </div>;
539
- }
540
- }
541
- ```
542
-
543
- #### Toast
544
- <!-- TODO: Provide screenshot here -->
545
-
546
- Toast is not a part of `adapter-react` but it is an example how to use toast in application:
547
-
548
- ```
549
- import Snackbar from '@material-ui/core/Snackbar';
550
-
551
- class MyComponent {
552
- constructor(props) {
553
- super(props);
554
- this.state = {
555
- // ....
556
- toast: '',
557
- };
558
- }
559
- // ...
560
- renderToast() {
561
- if (!this.state.toast) {
562
- return null;
563
- }
564
- return <Snackbar
565
- anchorOrigin={{
566
- vertical: 'bottom',
567
- horizontal: 'left',
568
- }}
569
- open={true}
570
- autoHideDuration={6000}
571
- onClose={() => this.setState({toast: ''})}
572
- ContentProps={{'aria-describedby': 'message-id'}}
573
- message={<span id="message-id">{this.state.toast}</span>}
574
- action={[
575
- <IconButton
576
- key="close"
577
- aria-label="Close"
578
- color="inherit"
579
- className={this.props.classes.close}
580
- onClick={() => this.setState({toast: ''})}
581
- >
582
- <IconClose />
583
- </IconButton>,
584
- ]}
585
- />;
586
- }
587
- render() {
588
- return <div>
589
- {this.renderToast()}
590
- </div>;
591
- }
592
- }
593
- ```
594
-
595
- ## List of adapters that use adapter-react
596
- - Admin
597
- - Backitup
598
- - iot
599
- - echarts
600
- - text2command
601
- - scenes
602
- - javascript
603
- - devices
604
- - eventlist
605
- - cameras
606
- - web
607
- - vis-2
608
- - vis-2-widgets-xxx
609
- - fullcalendar
610
- - openweathermap
611
-
612
- ## Usability
613
- In dialogs, the OK button is first (on the left) and the cancel button is last (on the right)
614
-
615
- ## Used icons
616
- This project uses icons from [Flaticon](https://www.flaticon.com/).
617
-
618
- ioBroker GmbH has a valid license for all the used icons.
619
- The icons may not be reused in other projects without the proper flaticon license or flaticon subscription.
620
-
621
- ## Migration from adapter-react to adapter-react-v5
622
- ### In src/package.json => dependencies
623
- - `"@iobroker/adapter-react": "^2.0.22",` => `"@iobroker/adapter-react-v5": "^3.1.34",`
624
- - `"@material-ui/core": "^4.12.3",` => `"@mui/material": "^5.10.9",`
625
- - `"@material-ui/icons": "^4.11.2",` => `"@mui/icons-material": "^5.10.9",`
626
- - Add `"@mui/styles": "^5.10.9",`
627
- - Add `"babel-eslint": "^10.1.0",`
628
-
629
- ### In Source files
630
- - All `@iobroker/adapter-react/...` => `@iobroker/adapter-react-v5/...`
631
- - All `@material-ui/icons/...` => `@mui/icons-material/...`
632
- - Change `import { withStyles } from '@material-ui/core/styles';` => `import { withStyles } from '@mui/styles';`
633
- - Change `import { makeStyles } from '@mui/material/styles';` => `import { makeStyles } from '@mui/styles';`
634
- - Change `import withWidth from '@material-ui/core/withWidth';` => `import { withWidth } from '@iobroker/adapter-react-v5';`
635
- - All `@material-ui/core...` => `@mui/material...`
636
- - Change `import { MuiThemeProvider } from '@material-ui/core/styles';` => `import { ThemeProvider, StyledEngineProvider } from '@mui/material/styles';`
637
- - Change all `<MuiThemeProvider theme={this.state.theme}>` to `<StyledEngineProvider injectFirst><ThemeProvider theme={this.state.theme}>`
638
- - Rename in styles `theme.palette.type` => `theme.palette.mode`
639
- - Add to all `TextField`, `Select`, `FormControl` the property `variant="standard"`
640
- - Add to all `Button` that do not have `color` property: `color="grey"`
641
- - Replace by `TextField` the `readOnly` attribute (if exists) with `InputProps={{readOnly: true}}`
642
- - Remove px by all `theme.spacing`: `calc(100% - ${theme.spacing(4)}px)` => `calc(100% - ${theme.spacing(4)})`
643
- - Replace `this.selectTab(e.target.parentNode.dataset.name, index)` => `this.selectTab(e.target.dataset.name, index)`
644
-
645
- If you still have questions, try to find an answer [here](https://mui.com/guides/migration-v4/).
646
-
647
- ## Migration from adapter-react-v5@3.x to adapter-react-v5@4.x
648
- - Look for getObjectView socket requests and replace `socket.getObjectView('startKey', 'endKey', 'instance')` to `socket.getObjectViewSystem('instance', 'startKey', 'endKey')`
649
- - Look for calls of custom like
650
- ```
651
- this.props.socket._socket.emit('getObjectView', 'system', 'custom', {startKey: '', endKey:'\u9999'}, (err, objs) => {
652
- (objs?.rows || [])
653
- .forEach(item => console.log(item.id, item.value));
654
- });
655
- ```
656
- to
657
- ```
658
- socket.getObjectViewCustom('custom', 'state', 'startKey', 'endKey')
659
- .then(objects => {
660
- Object.keys(objects).forEach(obj => console.log(obj._id));
661
- });
662
- ```
663
- - Replace all `socket.log.error('text')` to `socket.log('text', 'error')`
664
- - Add to App.js `import { AdminConnection } from '@iobroker/adapter-react-v5';` and `super(props, { Connection: AdminConnection });` if run in admin
665
-
666
- ## Migration from adapter-react-v5@4.x to adapter-react-v5@5.x
667
- - `Theme` is renamed to IobTheme. It is an object with classes inside. `Theme` is still inside and it same as mui `createTheme`.
668
- - adapter-react-v5 has all types exported. So you can use `import { type IobTheme, Theme } from '@iobroker/adapter-react-v5';` and `const theme: IobTheme = Theme('light');`
669
- - Json-Config is now an external package and must be included as dependency separately.
670
- - Use type `Translate` for `t(word: string, ...args: any[]) => string`
671
- - All components for admin JsonConfig must be changed:
672
- Before `adapter-react-v5@5.x`:
673
-
674
- ```
675
- import { ConfigGeneric, I18n } from '@iobroker/adapter-react-v5';
676
- class JsonComponent extends ConfigGeneric {
677
- ...
678
- }
679
- ```
680
-
681
- With `adapter-react-v5@5.x`:
682
-
683
- ```
684
- import { I18n } from '@iobroker/adapter-react-v5';
685
- import { ConfigGeneric } from '@iobroker/json-config';
686
- class JsonComponent extends ConfigGeneric {
687
- ...
688
- }
689
- ```
690
- ## Migration from v5 to v6
691
- The main change is that the `withStyles` was removed. So you have to replace all `withStyles` with `sx` or `style` properties.
692
-
693
- You can read more about sx [here](https://mui.com/system/getting-started/the-sx-prop/).
694
- - Remove at start of the file `import { withStyles } from '@mui/styles';`
695
- - Replace it at the very end of the file `export default withStyles(styles)(MyComponent);` with `export default MyComponent;`
696
- - Modify `const styles`:
697
- Before:
698
- ```
699
- const styles: Record<string, any> = (theme: IobTheme) => ({
700
- dialog: {
701
- height: `calc(100% - ${theme.mixins.toolbar.minHeight}px)`,
702
- padding: theme.spacing(1),
703
- margin: theme.spacing(2),
704
- gap: 5,
705
- borderRadius: 5,
706
- marginLeft: 10, // marginTop, marginRight, marginBottom
707
- paddingLeft: 10, // paddingTop, paddingRight, paddingBottom
708
- },
709
- ...
710
- });
711
- ```
712
-
713
- After:
714
- ```
715
- const styles: Record<string, any> = {
716
- dialog: (theme: IobTheme) => ({
717
- height: `calc(100% - ${theme => theme.mixins.toolbar.minHeight}px)`,
718
- p: 1, // or 8px, padding is OK too
719
- m: '16px', // or 2, margin is OK too
720
- gap: '5px',
721
- borderRadius: '5px',
722
- ml: '10px', // mt, mr, mb, but marginLeft, marginRight, marginBottom is OK too
723
- pl: '10px', // pt, pr, pb, but paddingTop, paddingRight, paddingBottom is OK too
724
- }),
725
- };
726
- ```
727
-
728
- - Modify `className`:
729
- Before: `<div className={this.props.classes.box}>`
730
-
731
- After: `<Box sx={styles.box}>`
732
-
733
- Before: `<span className={Utils.clsx(this.props.classes.box1, condition && this.props.classes.box2)}>`
734
-
735
- After: `<Box component="span" sx={Utils.getStyle(this.props.theme, this.props.classes.box1, condition && this.props.classes.box2)}>`
736
- Or if no one style is a function: `<Box component="div" sx={{ ...this.props.classes.box1, ...(condition ? this.props.classes.box2 : undefined) }}>`
737
-
738
- Do not use `sx` if the style is not dynamic (not a function). Use `style` instead.
739
-
740
- Be aware, that all paddings and margins are now in `theme.spacing(1)` format.
741
- So you have to replace all `padding: 8` with `padding: 1` or with `padding: '8px'`.
742
-
743
- The best practice is to replace `padding` with `p` and `margin` with `m`, so you will see immediately that it is a padding or margin for `sx` property.
744
-
745
- - Modify `classes`:
746
- Before: `<Dialog classes={{ scrollPaper: this.props.classes.dialog, paper: this.props.classes.paper }}>`
747
- After: `<Dialog sx={{ '&.MuiDialog-scrollPaper': styles.dialog, '& .MuiDialog-paper': styles.paper }}>`,
748
-
749
- Before: `<Dialog classes={{ scrollPaper: this.props.classes.dialog, paper: this.props.classes.paper }}>`
750
- After: `<Dialog sx={{ '&.MuiDialog-scrollPaper': styles.dialog, '& .MuiDialog-paper': styles.paper }}>`
751
-
752
- Before: `<ListItem classes={{ root: this.props.classes.listItem }} >`,
753
- After: `<ListItem sx={{ '&.MuiListItem-root': styles.listItem }} >`
754
-
755
- Before: `<Typography component="h2" variant="h6" classes={{ root: this.props.classes.typography }}>`,
756
- After: `<Typography component="h2" variant="h6" sx={{ '&.MuiTypography-root': styles.typography }}>`
757
-
758
- Before: `<Badge classes={{ 'badge': this.props.classes.expertBadge }}>`,
759
- After: `<Badge sx={{ '& .MuiBadge-badge': styles.expertBadge }}>`
760
-
761
- Before: `<Tab classes={{ selected: this.props.classes..selected }} />`,
762
- After: `<Tab sx={{ '&.Mui-selected': styles.selected }} />`
763
-
764
- Before: `<Tabs classes={{ indicator: this.props.classes.indicator }} />`,
765
- After: `<Tabs sx={{ '& .MuiTabs-indicator': styles.indicator }} />`
766
-
767
- Before: `<Tooltip title={this.props.t('ra_Refresh tree')} classes={{ popper: this.props.classes.tooltip }}>`,
768
- After: `<Tooltip title={this.props.t('ra_Refresh tree')} componentsProps={{ popper: { sx: { pointerEvents: 'none' } } }}>`,
769
- Or: `<Tooltip title={this.props.t('ra_Refresh tree')} componentsProps={{ popper: { sx: styles.tooltip } }}>`
770
-
771
- Before. `<AccordionSummary classes={{ root: this.props.classes.rootStyle, content: this.props.classes.content }}>`,
772
- After. `<AccordionSummary sx={{ '&.MuiAccordionSummary-root': styles.rootStyle, '& .MuiAccordionSummary-content': styles.content }}>`
773
-
774
- Before. `<Drawer classes={{ paper: this.props.classes.paperStyle }}>`,
775
- After. `<Drawer sx={{ '& .MuiDrawer-paper': styles.paperStyle }}>`
776
-
777
- <!--
778
- Placeholder for the next version (at the beginning of the line):
779
- ### **WORK IN PROGRESS**
780
- -->
781
-
1
+ # Help ReactJS classes for adapter config
2
+
3
+ You can find demo on https://github.com/ioBroker/adapter-react-demo
4
+
5
+ ## Getting started
6
+
7
+ If you want to create the configuration page with ReactJS:
8
+
9
+ 1. Create github repo for adapter.
10
+ 2. execute `npx create-react-app src` . It will take a while.
11
+ 3. `cd src`
12
+ 4. Modify package.json file in src directory:
13
+ - Change `name` from `src` to `ADAPTERNAME-admin` (Of course replace `ADAPTERNAME` with yours)
14
+ - Add to devDependencies:
15
+ ```
16
+ "@iobroker/adapter-react-v5": "^7.1.1",
17
+ ```
18
+ Versions can be higher.
19
+ So your `src/package.json` should look like:
20
+
21
+ ```json
22
+ {
23
+ "name": "ADAPTERNAME-admin",
24
+ "version": "0.1.0",
25
+ "private": true,
26
+ "dependencies": {
27
+ "@iobroker/adapter-react-v5": "^7.1.1",
28
+ "@iobroker/build-tools": "^1.0.0",
29
+ "@iobroker/eslint-config": "^0.1.2",
30
+ "@mui/material": "^6.0.2",
31
+ "@mui/icons-material": "^6.0.2",
32
+ "@sentry/browser": "^8.28.0",
33
+ "babel-eslint": "^10.1.0",
34
+ "eslint": "^9.10.0",
35
+ "react": "^18.3.1",
36
+ "react-dom": "^18.3.1",
37
+ "react-scripts": "^5.0.1",
38
+ "react-icons": "^5.3.0"
39
+ },
40
+ "scripts": {
41
+ "start": "react-scripts start",
42
+ "build": "react-scripts build",
43
+ "test": "react-scripts test",
44
+ "eject": "react-scripts eject"
45
+ },
46
+ "eslintConfig": {
47
+ "extends": "react-app"
48
+ },
49
+ "homepage": ".",
50
+ "browserslist": [">0.2%", "not dead", "not ie <= 11", "not op_mini all"]
51
+ }
52
+ ```
53
+
54
+ 5. Call in `src`: `npm install`
55
+ 6. Copy `tasks.js` into `src`: `cp node_modules/@iobroker/adapter-react-v5/tasks.js tasks.js`
56
+ 7. Add scripts to your `package.json` `scripts` section:
57
+
58
+ ```json
59
+ "scripts": {
60
+ "0-clean": "node tasks --0-clean",
61
+ "1-npm": "node tasks --1-npm",
62
+ "2-build": "node tasks --2-build",
63
+ "3-copy": "node tasks --3-copy",
64
+ "4-patch": "node tasks --4-patch",
65
+ "build": "node tasks"
66
+ }
67
+ ```
68
+
69
+ 7. Start your dummy application `npm run start` for developing or build with `npm run build` and
70
+ copy files in `build` directory to `www` or to `admin`. In the admin you must rename `index.html` to `index_m.html`.
71
+ 8. You can do that with `npm` tasks: `npm run build`
72
+
73
+ ## Development
74
+
75
+ 1. Add `socket.io` to `public/index.html`.
76
+ After
77
+
78
+ ```html
79
+ <link
80
+ rel="manifest"
81
+ href="%PUBLIC_URL%/manifest.json"
82
+ />
83
+ ```
84
+
85
+ insert
86
+
87
+ ```html
88
+ <script>
89
+ const script = document.createElement('script');
90
+ window.registerSocketOnLoad = function (cb) {
91
+ window.socketLoadedHandler = cb;
92
+ };
93
+ const parts = (window.location.search || '').replace(/^\?/, '').split('&');
94
+ const query = {};
95
+ parts.forEach(item => {
96
+ const [name, val] = item.split('=');
97
+ query[decodeURIComponent(name)] = val !== undefined ? decodeURIComponent(val) : true;
98
+ });
99
+ script.onload = function () {
100
+ typeof window.socketLoadedHandler === 'function' && window.socketLoadedHandler();
101
+ };
102
+ script.src =
103
+ window.location.port === '3000'
104
+ ? window.location.protocol +
105
+ '//' +
106
+ (query.host || window.location.hostname) +
107
+ ':' +
108
+ (query.port || 8081) +
109
+ '/lib/js/socket.io.js'
110
+ : '%PUBLIC_URL%/../../lib/js/socket.io.js';
111
+
112
+ document.head.appendChild(script);
113
+ </script>
114
+ ```
115
+
116
+ 3. Add to App.js constructor initialization for I18n:
117
+
118
+ ```jsx
119
+ class App extends GenericApp {
120
+ constructor(props) {
121
+ const extendedProps = { ...props };
122
+ extendedProps.encryptedFields = ['pass']; // this parameter will be encrypted and decrypted automatically
123
+ extendedProps.translations = {
124
+ en: require('./i18n/en'),
125
+ de: require('./i18n/de'),
126
+ ru: require('./i18n/ru'),
127
+ pt: require('./i18n/pt'),
128
+ nl: require('./i18n/nl'),
129
+ fr: require('./i18n/fr'),
130
+ it: require('./i18n/it'),
131
+ es: require('./i18n/es'),
132
+ pl: require('./i18n/pl'),
133
+ uk: require('./i18n/uk'),
134
+ 'zh-cn': require('./i18n/zh-cn'),
135
+ };
136
+ // get actual admin port
137
+ extendedProps.socket = { port: parseInt(window.location.port, 10) };
138
+
139
+ // Only if close, save buttons are not required at the bottom (e.g. if admin tab)
140
+ // extendedProps.bottomButtons = false;
141
+
142
+ // only for debug purposes
143
+ if (extendedProps.socket.port === 3000) {
144
+ extendedProps.socket.port = 8081;
145
+ }
146
+
147
+ // allow to manage GenericApp the sentry initialisation or do not set the sentryDSN if no sentry available
148
+ extendedProps.sentryDSN = 'https://yyy@sentry.iobroker.net/xx';
149
+
150
+ super(extendedProps);
151
+ }
152
+ // ...
153
+ }
154
+ ```
155
+
156
+ 4. Replace `index.js` with the following code to support themes:
157
+
158
+ ```jsx
159
+ import React from 'react';
160
+ import { createRoot } from 'react-dom/client';
161
+ import * as serviceWorker from './serviceWorker';
162
+
163
+ import './index.css';
164
+ import App from './App';
165
+ import { version } from '../package.json';
166
+
167
+ console.log(`iobroker.scenes@${version}`);
168
+
169
+ const container = document.getElementById('root');
170
+ const root = createRoot(container);
171
+ root.render(<App />);
172
+
173
+ // If you want your app to work offline and load faster, you can change
174
+ // unregister() to register() below. Note this comes with some pitfalls.
175
+ // Learn more about service workers: http://bit.ly/CRA-PWA
176
+ serviceWorker.unregister();
177
+ ```
178
+
179
+ 5. Add to App.js encoding and decoding of values:
180
+
181
+ ```jsx
182
+ class App extends GenericApp {
183
+ // ...
184
+ onPrepareLoad(settings) {
185
+ settings.pass = this.decode(settings.pass);
186
+ }
187
+ onPrepareSave(settings) {
188
+ settings.pass = this.encode(settings.pass);
189
+ }
190
+ }
191
+ ```
192
+
193
+ 6. The optional step is to validate the data to be saved:
194
+
195
+ ```jsx
196
+ onPrepareSave(settings) {
197
+ super.onPrepareSave(settings);
198
+ if (DATA_INVALID) {
199
+ return false; // configuration will not be saved
200
+ } else {
201
+ return true;
202
+ }
203
+ }
204
+ ```
205
+
206
+ ## Components
207
+
208
+ ### Connection.tsx
209
+
210
+ This is a non-React class to provide the communication for socket connection with the server.
211
+
212
+ ### GenericApp.tsx
213
+
214
+ ### i18n.ts
215
+
216
+ ### Theme.tsx
217
+
218
+ ### Dialogs
219
+
220
+ Some dialogs are predefined and could be used out of the box.
221
+
222
+ #### Confirm.tsx
223
+
224
+ <!-- TODO: Provide screenshot here -->
225
+
226
+ Usage:
227
+
228
+ ```jsx
229
+ import React from 'react';
230
+ import { I18n, Confirm as ConfirmDialog } from '@iobroker/adapter-react-v5';
231
+
232
+ class ExportImportDialog extends React.Component {
233
+ constructor(props) {
234
+ super(props);
235
+
236
+ this.state = {
237
+ confirmDialog: false,
238
+ };
239
+ }
240
+
241
+ renderConfirmDialog() {
242
+ if (!this.state.confirmDialog) {
243
+ return null;
244
+ }
245
+ return (
246
+ <ConfirmDialog
247
+ title={I18n.t('Scene will be overwritten.')}
248
+ text={I18n.t('All data will be lost. Confirm?')}
249
+ ok={I18n.t('Yes')}
250
+ cancel={I18n.t('Cancel')}
251
+ suppressQuestionMinutes={5}
252
+ dialogName="myConfirmDialogThatCouldBeSuppressed"
253
+ suppressText={I18n.t('Suppress question for next %s minutes', 5)}
254
+ onClose={isYes => {
255
+ this.setState({ confirmDialog: false });
256
+ }}
257
+ />
258
+ );
259
+ }
260
+ render() {
261
+ return (
262
+ <div>
263
+ <Button onClick={() => this.setState({ confirmDialog: true })}>Click</Button>
264
+ {this.renderConfirmDialog()}
265
+ </div>
266
+ );
267
+ }
268
+ }
269
+
270
+ export default ExportImportDialog;
271
+ ```
272
+
273
+ #### Error.tsx
274
+
275
+ <!-- TODO: Provide screenshot here -->
276
+
277
+ #### Message.tsx
278
+
279
+ <!-- TODO: Provide screenshot here -->
280
+
281
+ ```jsx
282
+ renderMessage() {
283
+ if (this.state.showMessage) {
284
+ return <Message
285
+ text={this.state.showMessage}
286
+ onClose={() => this.setState({showMessage: false})}
287
+ />;
288
+ } else {
289
+ return null;
290
+ }
291
+ }
292
+ ```
293
+
294
+ #### SelectID.tsx
295
+
296
+ ![Logo](img/selectID.png)
297
+
298
+ ```jsx
299
+ import { SelectID as DialogSelectID } from '@iobroker/adapter-react-v5';
300
+
301
+ class MyComponent extends Component {
302
+ constructor(props) {
303
+ super(props);
304
+ this.state = {
305
+ showSelectId: false,
306
+ };
307
+ }
308
+
309
+ renderSelectIdDialog() {
310
+ if (this.state.showSelectId) {
311
+ return (
312
+ <DialogSelectID
313
+ key="tableSelect"
314
+ imagePrefix="../.."
315
+ dialogName={this.props.adapterName}
316
+ themeType={this.props.themeType}
317
+ socket={this.props.socket}
318
+ statesOnly={true}
319
+ selected={this.state.selectIdValue}
320
+ onClose={() => this.setState({ showSelectId: false })}
321
+ onOk={(selected, name) => {
322
+ this.setState({ showSelectId: false, selectIdValue: selected });
323
+ }}
324
+ />
325
+ );
326
+ } else {
327
+ return null;
328
+ }
329
+ }
330
+ render() {
331
+ return renderSelectIdDialog();
332
+ }
333
+ }
334
+ ```
335
+
336
+ #### Cron
337
+
338
+ Include `"react-text-mask": "^5.4.3",` in package.json.
339
+
340
+ <!-- TODO: Provide screenshot here -->
341
+
342
+ ```jsx
343
+ function renderCron() {
344
+ if (!showCron) {
345
+ return null;
346
+ } else {
347
+ return (
348
+ <DialogCron
349
+ key="dialogCron1"
350
+ cron={this.state.cronValue || '* * * * *'}
351
+ onClose={() => this.setState({ showCron: false })}
352
+ onOk={cronValue => {
353
+ this.setState({ cronValue });
354
+ }}
355
+ />
356
+ );
357
+ }
358
+ }
359
+ ```
360
+
361
+ ### Components
362
+
363
+ #### Utils.tsx
364
+
365
+ ##### getObjectNameFromObj
366
+
367
+ `getObjectNameFromObj(obj, settings, options, isDesc)`
368
+
369
+ Get object name from a single object.
370
+
371
+ Usage: `Utils.getObjectNameFromObj(this.objects[id], null, {language: I18n.getLanguage()})`
372
+
373
+ ##### getObjectIcon
374
+
375
+ `getObjectIcon(id, obj)`
376
+
377
+ Get icon from the object.
378
+
379
+ Usage:
380
+
381
+ ```jsx
382
+ const icon = Utils.getObjectIcon(id, this.objects[id]);
383
+ return <img src={icon} />;
384
+ ```
385
+
386
+ ##### isUseBright
387
+
388
+ `isUseBright(color, defaultValue)`
389
+
390
+ Usage: `
391
+
392
+ #### Loader.tsx
393
+
394
+ ![Logo](img/loader.png)
395
+
396
+ ```jsx
397
+ render() {
398
+ if (!this.state.loaded) {
399
+ return <MuiThemeProvider theme={this.state.theme}>
400
+ <Loader theme={this.state.themeType}/>
401
+ </MuiThemeProvider>;
402
+ }
403
+ // render loaded data
404
+ }
405
+
406
+ ```
407
+
408
+ #### Logo.tsx
409
+
410
+ ![Logo](img/logo.png)
411
+
412
+ ```jsx
413
+ render() {
414
+ return <form className={this.props.classes.tab}>
415
+ <Logo
416
+ instance={this.props.instance}
417
+ common={this.props.common}
418
+ native={this.props.native}
419
+ onError={text => this.setState({errorText: text})}
420
+ onLoad={this.props.onLoad}
421
+ />
422
+ ...
423
+ </form>;
424
+ }
425
+ ```
426
+
427
+ #### Router.tsx
428
+
429
+ #### ObjectBrowser.js
430
+
431
+ It is better to use `Dialog/SelectID`, but if you want:
432
+
433
+ ![Logo](img/objectBrowser.png)
434
+
435
+ ```jsx
436
+ <ObjectBrowser
437
+ foldersFirst={this.props.foldersFirst}
438
+ imagePrefix={this.props.imagePrefix || this.props.prefix} // prefix is for back compatibility
439
+ defaultFilters={this.filters}
440
+ dialogName={this.dialogName}
441
+ showExpertButton={this.props.showExpertButton !== undefined ? this.props.showExpertButton : true}
442
+ style={{ width: '100%', height: '100%' }}
443
+ columns={this.props.columns || ['name', 'type', 'role', 'room', 'func', 'val']}
444
+ types={this.props.types || ['state']}
445
+ t={I18n.t}
446
+ lang={this.props.lang || I18n.getLanguage()}
447
+ socket={this.props.socket}
448
+ selected={this.state.selected}
449
+ multiSelect={this.props.multiSelect}
450
+ notEditable={this.props.notEditable === undefined ? true : this.props.notEditable}
451
+ name={this.state.name}
452
+ theme={this.props.theme}
453
+ themeName={this.props.themeName}
454
+ themeType={this.props.themeType}
455
+ customFilter={this.props.customFilter}
456
+ onFilterChanged={filterConfig => {
457
+ this.filters = filterConfig;
458
+ window.localStorage.setItem(this.dialogName, JSON.stringify(filterConfig));
459
+ }}
460
+ onSelect={(selected, name, isDouble) => {
461
+ if (JSON.stringify(selected) !== JSON.stringify(this.state.selected)) {
462
+ this.setState({ selected, name }, () => isDouble && this.handleOk());
463
+ } else if (isDouble) {
464
+ this.handleOk();
465
+ }
466
+ }}
467
+ />
468
+ ```
469
+
470
+ #### TreeTable.ts
471
+
472
+ ![Logo](img/tableTree.png)
473
+
474
+ ```jsx
475
+ // STYLES
476
+ const styles = {
477
+ tableDiv: {
478
+ width: '100%',
479
+ overflow: 'hidden',
480
+ height: 'calc(100% - 48px)',
481
+ },
482
+ };
483
+ class MyComponent extends Component {
484
+ constructor(props) {
485
+ super(props);
486
+
487
+ this.state = {
488
+ data: [
489
+ {
490
+ id: 'UniqueID1', // required
491
+ fieldIdInData: 'Name1',
492
+ myType: 'number',
493
+ },
494
+ {
495
+ id: 'UniqueID2', // required
496
+ fieldIdInData: 'Name12',
497
+ myType: 'string',
498
+ },
499
+ ],
500
+ };
501
+
502
+ this.columns = [
503
+ {
504
+ title: 'Name of field', // required, else it will be "field"
505
+ field: 'fieldIdInData', // required
506
+ editable: false, // or true [default - true]
507
+ cellStyle: {
508
+ // CSS style - // optional
509
+ maxWidth: '12rem',
510
+ overflow: 'hidden',
511
+ wordBreak: 'break-word',
512
+ },
513
+ lookup: {
514
+ // optional => edit will be automatically "SELECT"
515
+ value1: 'text1',
516
+ value2: 'text2',
517
+ },
518
+ },
519
+ {
520
+ title: 'Type', // required, else it will be "field"
521
+ field: 'myType', // required
522
+ editable: true, // or true [default - true]
523
+ lookup: {
524
+ // optional => edit will be automatically "SELECT"
525
+ number: 'Number',
526
+ string: 'String',
527
+ boolean: 'Boolean',
528
+ },
529
+ type: 'number/string/color/oid/icon/boolean', // oid=ObjectID,icon=base64-icon
530
+ editComponent: props => (
531
+ <div>
532
+ Prefix&#123; <br />
533
+ <textarea
534
+ rows={4}
535
+ style={{ width: '100%', resize: 'vertical' }}
536
+ value={props.value}
537
+ onChange={e => props.onChange(e.target.value)}
538
+ />
539
+ Suffix
540
+ </div>
541
+ ),
542
+ },
543
+ ];
544
+ }
545
+ // renderTable
546
+ render() {
547
+ return (
548
+ <div className={this.props.classes.tableDiv}>
549
+ <TreeTable
550
+ columns={this.columns}
551
+ data={this.state.data}
552
+ onUpdate={(newData, oldData) => {
553
+ const data = JSON.parse(JSON.stringify(this.state.data));
554
+
555
+ // Added new line
556
+ if (newData === true) {
557
+ // find unique ID
558
+ let i = 1;
559
+ let id = 'line_' + i;
560
+
561
+ // eslint-disable-next-line
562
+ while (this.state.data.find(item => item.id === id)) {
563
+ i++;
564
+ id = 'line_' + i;
565
+ }
566
+
567
+ data.push({
568
+ id,
569
+ name: I18n.t('New resource') + '_' + i,
570
+ color: '',
571
+ icon: '',
572
+ unit: '',
573
+ price: 0,
574
+ });
575
+ } else {
576
+ // existing line was modifed
577
+ const pos = this.state.data.indexOf(oldData);
578
+ if (pos !== -1) {
579
+ Object.keys(newData).forEach(attr => (data[pos][attr] = newData[attr]));
580
+ }
581
+ }
582
+
583
+ this.setState({ data });
584
+ }}
585
+ onDelete={oldData => {
586
+ console.log('Delete: ' + JSON.stringify(oldData));
587
+ const pos = this.state.data.indexOf(oldData);
588
+ if (pos !== -1) {
589
+ const data = JSON.parse(JSON.stringify(this.state.data));
590
+ data.splice(pos, 1);
591
+ this.setState({ data });
592
+ }
593
+ }}
594
+ />
595
+ </div>
596
+ );
597
+ }
598
+ }
599
+ ```
600
+
601
+ #### Toast
602
+
603
+ <!-- TODO: Provide screenshot here -->
604
+
605
+ Toast is not a part of `adapter-react` but it is an example how to use toast in application:
606
+
607
+ ```jsx
608
+ import { Component } from 'react';
609
+ import { Snackbar } from '@mui/material';
610
+
611
+ class MyComponent extends Component {
612
+ constructor(props) {
613
+ super(props);
614
+ this.state = {
615
+ // ....
616
+ toast: '',
617
+ };
618
+ }
619
+
620
+ // ...
621
+ renderToast() {
622
+ if (!this.state.toast) {
623
+ return null;
624
+ }
625
+ return (
626
+ <Snackbar
627
+ anchorOrigin={{
628
+ vertical: 'bottom',
629
+ horizontal: 'left',
630
+ }}
631
+ open={true}
632
+ autoHideDuration={6000}
633
+ onClose={() => this.setState({ toast: '' })}
634
+ ContentProps={{ 'aria-describedby': 'message-id' }}
635
+ message={<span id="message-id">{this.state.toast}</span>}
636
+ action={[
637
+ <IconButton
638
+ key="close"
639
+ aria-label="Close"
640
+ color="inherit"
641
+ className={this.props.classes.close}
642
+ onClick={() => this.setState({ toast: '' })}
643
+ >
644
+ <IconClose />
645
+ </IconButton>,
646
+ ]}
647
+ />
648
+ );
649
+ }
650
+
651
+ render() {
652
+ return <div>{this.renderToast()}</div>;
653
+ }
654
+ }
655
+ ```
656
+
657
+ ## List of adapters that use adapter-react
658
+
659
+ - Admin
660
+ - Backitup
661
+ - iot
662
+ - echarts
663
+ - text2command
664
+ - scenes
665
+ - javascript
666
+ - devices
667
+ - eventlist
668
+ - cameras
669
+ - web
670
+ - vis-2
671
+ - vis-2-widgets-xxx
672
+ - fullcalendar
673
+ - openweathermap
674
+
675
+ ## Usability
676
+
677
+ In dialogs, the OK button is first (on the left) and the cancel button is last (on the right)
678
+
679
+ ## Used icons
680
+
681
+ This project uses icons from [Flaticon](https://www.flaticon.com/).
682
+
683
+ ioBroker GmbH has a valid license for all the used icons.
684
+ The icons may not be reused in other projects without the proper flaticon license or flaticon subscription.
685
+
686
+ ## Migration instructions
687
+
688
+ You can find the migration instructions:
689
+
690
+ - [from adapter-react-v5@6.x to adapter-react-v5@7.x](MIGRATION_6_7.md)
691
+ - [from adapter-react-v5@5.x to adapter-react-v5@6.x](MIGRATION_5_6.md)
692
+ - [from adapter-react to adapter-react-v5@5.x](MIGRATION_4_5.md)
693
+
694
+ <!--
695
+ Placeholder for the next version (at the beginning of the line):
696
+ ### **WORK IN PROGRESS**
697
+ -->
698
+
782
699
  ## Changelog
783
- ### 7.0.2 (2024-09-10)
784
- * (bluefox) Showed the context menu under cursor position in the object browser
785
- * (bluefox) Added links to aliases in the object browser
700
+ ### 7.1.1 (2024-09-13)
701
+
702
+ - (bluefox) Corrected TabContainer
703
+
704
+ ### 7.1.0 (2024-09-12)
705
+
706
+ - (bluefox) Optimized the icon picker
707
+ - (bluefox) Used common eslint-config
708
+
709
+ ### 7.0.2 (2024-09-10)
710
+
711
+ - (bluefox) Showed the context menu under cursor position in the object browser
712
+ - (bluefox) Added links to aliases in the object browser
713
+
714
+ ### 7.0.1 (2024-08-29)
715
+
716
+ - (bluefox) Updated the object browser
717
+ - (bluefox) Used MUI Library 6.0
718
+
719
+ ### 6.1.10 (2024-08-30)
720
+
721
+ - (bluefox) Updated the object browser
722
+
723
+ ### 6.1.9 (2024-08-14)
724
+
725
+ - (bluefox) Updated JSON schema
726
+
727
+ ### 6.1.8 (2024-08-03)
728
+
729
+ - (bluefox) Added translations
730
+
731
+ ### 6.1.6 (2024-07-23)
732
+
733
+ - (bluefox) Optimize package
734
+
735
+ ### 6.1.5 (2024-07-20)
736
+
737
+ - (bluefox) Added sources to package
738
+
739
+ ### 6.1.3 (2024-07-20)
740
+
741
+ - (bluefox) Better typing of legacy connection
742
+
743
+ ### 6.1.1 (2024-07-16)
744
+
745
+ - (bluefox) Added translations
746
+
747
+ ### 6.1.0 (2024-07-15)
748
+
749
+ - (bluefox) Replace by CRON to text the package to `cronstrue`
750
+
751
+ ### 6.0.19 (2024-07-14)
752
+
753
+ - (bluefox) added some packages for federation
754
+
755
+ ### 6.0.17 (2024-07-14)
756
+
757
+ - (bluefox) Allowed playing mp3 files in the file browser
758
+ - (bluefox) Corrected jump by object selection
759
+
760
+ ### 6.0.14 (2024-07-07)
761
+
762
+ - (bluefox) Corrected theme type selection
763
+
764
+ ### 6.0.13 (2024-06-30)
765
+
766
+ - (bluefox) Corrected color picker
767
+
768
+ ### 6.0.12 (2024-06-29)
769
+
770
+ - (bluefox) Added support for the overrides in the theme
771
+
772
+ ### 6.0.10 (2024-06-27)
773
+
774
+ - (bluefox) Added translation
775
+ - (bluefox) Mobile object browser improved
776
+
777
+ ### 6.0.9 (2024-06-26)
778
+
779
+ - (bluefox) Corrected Icons
780
+
781
+ ### 6.0.8 (2024-06-26)
782
+
783
+ - (bluefox) Corrected types of the select ID dialog
784
+ - (bluefox) Made the tooltips neutral to the pointer events
785
+
786
+ ### 6.0.6 (2024-06-24)
787
+
788
+ - (bluefox) Synchronised with admin
789
+ - (bluefox) Added translations for time scheduler
790
+
791
+ ### 6.0.4 (2024-06-21)
792
+
793
+ - (bluefox) Removed the usage of `withStyles` in favor of `sx` and `style` properties (see [Migration from v5 to v6](#migration-from-v5-to-v6)
794
+ - (bluefox) (BREAKING) Higher version of `@mui/material` (5.15.20) is used
795
+
796
+ ### 5.0.8 (2024-06-15)
797
+
798
+ - (bluefox) Added `modulefederation.admin.config.js` for module federation
799
+
800
+ ### 5.0.5 (2024-06-10)
801
+
802
+ - (bluefox) Sources were synchronized with admin
803
+
804
+ ### 5.0.4 (2024-06-07)
805
+
806
+ - (bluefox) Added better typing
807
+
808
+ ### 5.0.2 (2024-05-30)
809
+
810
+ - (bluefox) Added better typing
811
+ - (bluefox) Json-Config is now a separate package and must be installed additionally
812
+
813
+ ### 5.0.0 (2024-05-29)
814
+
815
+ - (bluefox) Types are now exported
816
+ - (bluefox) Translator renamed to Translate
817
+ - (bluefox) Breaking: Theme renamed to IobTheme because of the naming conflict
818
+
819
+ ### 4.13.24 (2024-05-25)
820
+
821
+ - (bluefox) Updated packages
822
+
823
+ - ### 4.13.22 (2024-05-23)
824
+ - (bluefox) Updated packages
825
+
826
+ ### 4.13.20 (2024-05-22)
827
+
828
+ - (bluefox) Better types added
829
+ - (bluefox) updated theme definitions
830
+ - (bluefox) corrected dates in cron dialog
831
+
832
+ ### 4.13.14 (2024-05-19)
833
+
834
+ - (bluefox) Updated packages
835
+
836
+ ### 4.13.13 (2024-05-09)
837
+
838
+ - (bluefox) Updated ioBroker types
839
+
840
+ ### 4.13.12 (2024-05-06)
841
+
842
+ - (bluefox) All files are migrated to Typescript
843
+
844
+ ### 4.13.11 (2024-04-23)
845
+
846
+ - (bluefox) Corrected the size of icons
847
+
848
+ ### 4.13.10 (2024-04-22)
849
+
850
+ - (bluefox) Migrated all icons to Typescript
851
+
852
+ ### 4.13.9 (2024-04-20)
853
+
854
+ - (bluefox) Updated socket-client package
855
+
856
+ ### 4.13.8 (2024-04-19)
857
+
858
+ - (bluefox) Corrected CRON selector
859
+
860
+ ### 4.13.7 (2024-04-19)
861
+
862
+ - (bluefox) Migrated ColorPicker to typescript
863
+
864
+ ### 4.13.6 (2024-04-11)
865
+
866
+ - (bluefox) Migrated TreeTable to typescript
867
+ - (bluefox) corrected the object subscription
868
+
869
+ ### 4.13.5 (2024-04-02)
870
+
871
+ - (bluefox) used new connection classes
872
+ - (bluefox) Improved the `SelectID` dialog
873
+
874
+ ### 4.13.3 (2024-04-01)
875
+
876
+ - (bluefox) used new connection classes
877
+
878
+ ### 4.12.3 (2024-03-30)
879
+
880
+ - (bluefox) Migrated legacy connection to typescript
881
+
882
+ ### 4.12.2 (2024-03-25)
883
+
884
+ - (bluefox) Added support for remote cloud
885
+
886
+ ### 4.11.6 (2024-03-19)
887
+
888
+ - (bluefox) Corrected rendering of LoaderMV
889
+
890
+ ### 4.11.4 (2024-03-18)
891
+
892
+ - (bluefox) Corrected types of IconPicker
893
+
894
+ ### 4.11.3 (2024-03-17)
895
+
896
+ - (bluefox) Made filters for the file selector dialog optional
897
+
898
+ ### 4.11.2 (2024-03-16)
899
+
900
+ - (bluefox) Migrated GenericApp to typescript
901
+
902
+ ### 4.10.4 (2024-03-16)
903
+
904
+ - (bluefox) Migrated some components to typescript
905
+
906
+ ### 4.10.1 (2024-03-11)
907
+
908
+ - (bluefox) Migrated some components to typescript
909
+
910
+ ### 4.9.11 (2024-03-08)
911
+
912
+ - (foxriver76) type GenericApp socket correctly
913
+
914
+ ### 4.9.10 (2024-02-21)
915
+
916
+ - (bluefox) translations
917
+ - (bluefox) updated JSON config
918
+
919
+ ### 4.9.9 (2024-02-16)
920
+
921
+ - (foxriver76) also check plugin state of instance to see if Sentry is explicitly disabled
922
+
923
+ ### 4.9.8 (2024-02-13)
924
+
925
+ - (bluefox) allowed hiding wizard in cron dialog
926
+
927
+ ### 4.9.7 (2024-02-03)
928
+
929
+ - (foxriver76) allow passing down the instance number do avoid determining from url
930
+
931
+ ### 4.9.5 (2024-01-01)
932
+
933
+ - (foxriver76) make `copyToClipboard` event parameter optional
934
+
935
+ ### 4.9.4 (2024-01-01)
936
+
937
+ - (foxriver76) try to fix `SelectID` scrolling
938
+
939
+ ### 4.9.2 (2023-12-30)
940
+
941
+ - (foxriver76) bump version of `@iobroker/json-config`
942
+
943
+ ### 4.9.1 (2023-12-22)
944
+
945
+ - (foxriver76) `@iobroker/json-config` moved to real dependencies
946
+
947
+ ### 4.9.0 (2023-12-22)
948
+
949
+ - (foxriver76) migrate to `@iobroker/json-config` module to have a single point of truth
950
+ - (bluefox) Allowed using of `filterFunc` as string
951
+
952
+ ### 4.8.1 (2023-12-14)
953
+
954
+ - (bluefox) Added Device manager to JSON Config
955
+
956
+ ### 4.7.15 (2023-12-12)
957
+
958
+ - (bluefox) Corrected parsing of a text
959
+
960
+ ### 4.7.13 (2023-12-10)
961
+
962
+ - (bluefox) Added possibility to define the root style and embedded property
963
+
964
+ ### 4.7.11 (2023-12-06)
965
+
966
+ - (bluefox) Extended color picker with "noInputField" option
967
+
968
+ ### 4.7.9 (2023-12-04)
969
+
970
+ - (bluefox) Corrected the icon picker
971
+
972
+ ### 4.7.8 (2023-12-04)
973
+
974
+ - (foxriver76) port to `@iobroker/types`
975
+
976
+ ### 4.7.6 (2023-11-29)
977
+
978
+ - (bluefox) Added translations
979
+
980
+ ### 4.7.5 (2023-11-28)
981
+
982
+ - (bluefox) Corrected subscribe on objects in the legacy connection
983
+
984
+ ### 4.7.4 (2023-11-23)
985
+
986
+ - (bluefox) Updated packages
987
+ - (bluefox) Made getStates method in legacy connection compatible with new one
988
+
989
+ ### 4.7.3 (2023-11-08)
990
+
991
+ - (bluefox) Updated packages
992
+
993
+ ### 4.7.2 (2023-11-03)
994
+
995
+ - (foxriver76) fixed problem with color picker, where editing TextField was buggy
996
+ - (foxriver76) fixed light mode color of a path in FileBrowser
997
+
998
+ ### 4.7.0 (2023-10-31)
999
+
1000
+ - (bluefox) Synced with admin
1001
+ - (bluefox) Added GIF to image files
1002
+
1003
+ ### 4.6.7 (2023-10-19)
1004
+
1005
+ - (bluefox) Added return value for `subscribeOnInstance` for Connection class
1006
+
1007
+ ### 4.6.6 (2023-10-13)
1008
+
1009
+ - (bluefox) Fixed the legacy connection
1010
+
1011
+ ### 4.6.5 (2023-10-12)
1012
+
1013
+ - (foxriver76) fixed object browser with date
1014
+
1015
+ ### 4.6.4 (2023-10-11)
1016
+
1017
+ - (bluefox) Updated the packages
1018
+
1019
+ ### 4.6.3 (2023-10-09)
1020
+
1021
+ - (bluefox) Just updated the packages
1022
+ - (bluefox) Synced with admin
1023
+
1024
+ ### 4.6.2 (2023-09-29)
1025
+
1026
+ - (bluefox) Experimental feature added: update states on re-subscribe
1027
+
1028
+ ### 4.5.5 (2023-09-27)
1029
+
1030
+ - (bluefox) Added export for IconNoIcon
1031
+
1032
+ ### 4.5.4 (2023-09-17)
1033
+
1034
+ - (bluefox) Added the restricting to folder property for select file dialog
1035
+
1036
+ ### 4.5.3 (2023-08-20)
1037
+
1038
+ - (foxriver76) fixed css classes of TableResize, see https://github.com/ioBroker/ioBroker.admin/issues/1860
1039
+
1040
+ ### 4.5.2 (2023-08-20)
1041
+
1042
+ - (foxriver76) added missing export of TableResize
1043
+
1044
+ ### 4.5.1 (2023-08-19)
1045
+
1046
+ - (foxriver76) fix dialog TextInput
1047
+
1048
+ ### 4.5.0 (2023-08-18)
1049
+
1050
+ - (bluefox) Synchronize components with admin
1051
+
1052
+ ### 4.4.8 (2023-08-17)
1053
+
1054
+ - (bluefox) Added translations
1055
+
1056
+ ### 4.4.7 (2023-08-10)
1057
+
1058
+ - (bluefox) Added `subscribeStateAsync` method to wait for answer
1059
+ - (bluefox) Added support for arrays for un/subscriptions
1060
+
1061
+ ### 4.4.5 (2023-08-01)
1062
+
1063
+ - (bluefox) Updated packages
1064
+
1065
+ ### 4.3.3 (2023-07-28)
1066
+
1067
+ - (bluefox) Added translations
1068
+
1069
+ ### 4.3.0 (2023-07-19)
1070
+
1071
+ - (bluefox) Updated packages
1072
+ - (bluefox) Added translations
1073
+ - (bluefox) Synced object browser
1074
+ - (bluefox) formatting
1075
+
1076
+ ### 4.2.1 (2023-07-17)
1077
+
1078
+ - (bluefox) Updated packages
1079
+ - (bluefox) Added translations
786
1080
 
787
- ### 7.0.1 (2024-08-29)
788
- * (bluefox) Updated the object browser
789
- * (bluefox) Used MUI Library 6.0
1081
+ ### 4.2.0 (2023-07-07)
790
1082
 
791
- ### 6.1.10 (2024-08-30)
792
- * (bluefox) Updated the object browser
1083
+ - (bluefox) Updated packages
1084
+ - (bluefox) Added new method `getObjectsById` to the socket communication
793
1085
 
794
- ### 6.1.9 (2024-08-14)
795
- * (bluefox) Updated JSON schema
1086
+ ### 4.1.2 (2023-06-20)
796
1087
 
797
- ### 6.1.8 (2024-08-03)
798
- * (bluefox) Added translations
1088
+ - (bluefox) Allowed setting theme name directly by theme toggle
799
1089
 
800
- ### 6.1.6 (2024-07-23)
801
- * (bluefox) Optimize package
1090
+ ### 4.1.0 (2023-05-10)
802
1091
 
803
- ### 6.1.5 (2024-07-20)
804
- * (bluefox) Added sources to package
1092
+ - (bluefox) `craco-module-federation.js` was added. For node 16
805
1093
 
806
- ### 6.1.3 (2024-07-20)
807
- * (bluefox) Better typing of legacy connection
1094
+ ### 4.0.27 (2023-05-09)
808
1095
 
809
- ### 6.1.1 (2024-07-16)
810
- * (bluefox) Added translations
1096
+ - (bluefox) Allowed showing only specific root in SelectIDDialog
811
1097
 
812
- ### 6.1.0 (2024-07-15)
813
- * (bluefox) Replace by CRON to text the package to `cronstrue`
1098
+ ### 4.0.26 (2023-05-08)
814
1099
 
815
- ### 6.0.19 (2024-07-14)
816
- * (bluefox) added some packages for federation
1100
+ - (bluefox) Added IDs to the buttons in the dialog for GUI tests
817
1101
 
818
- ### 6.0.17 (2024-07-14)
819
- * (bluefox) Allowed playing mp3 files in the file browser
820
- * (bluefox) Corrected jump by object selection
1102
+ ### 4.0.25 (2023-04-23)
821
1103
 
822
- ### 6.0.14 (2024-07-07)
823
- * (bluefox) Corrected theme type selection
1104
+ - (bluefox) Extended `TextWithIcon` with defined color and icon
824
1105
 
825
- ### 6.0.13 (2024-06-30)
826
- * (bluefox) Corrected color picker
1106
+ ### 4.0.24 (2023-04-03)
827
1107
 
828
- ### 6.0.12 (2024-06-29)
829
- * (bluefox) Added support for the overrides in the theme
1108
+ - (bluefox) Updated the file selector in tile mode
830
1109
 
831
- ### 6.0.10 (2024-06-27)
832
- * (bluefox) Added translation
833
- * (bluefox) Mobile object browser improved
1110
+ ### 4.0.23 (2023-03-27)
834
1111
 
835
- ### 6.0.9 (2024-06-26)
836
- * (bluefox) Corrected Icons
1112
+ - (bluefox) Added translations
837
1113
 
838
- ### 6.0.8 (2024-06-26)
839
- * (bluefox) Corrected types of the select ID dialog
840
- * (bluefox) Made the tooltips neutral to the pointer events
1114
+ ### 4.0.22 (2023-03-22)
841
1115
 
842
- ### 6.0.6 (2024-06-24)
843
- * (bluefox) Synchronised with admin
844
- * (bluefox) Added translations for time scheduler
1116
+ - (bluefox) Re-Activate legacy connection
845
1117
 
846
- ### 6.0.4 (2024-06-21)
847
- * (bluefox) Removed the usage of `withStyles` in favor of `sx` and `style` properties (see [Migration from v5 to v6](#migration-from-v5-to-v6)
848
- * (bluefox) (BREAKING) Higher version of `@mui/material` (5.15.20) is used
1118
+ ### 4.0.21 (2023-03-22)
849
1119
 
850
- ### 5.0.8 (2024-06-15)
851
- * (bluefox) Added `modulefederation.admin.config.js` for module federation
1120
+ - (bluefox) Added translations
852
1121
 
853
- ### 5.0.5 (2024-06-10)
854
- * (bluefox) Sources were synchronized with admin
1122
+ ### 4.0.20 (2023-03-21)
855
1123
 
856
- ### 5.0.4 (2024-06-07)
857
- * (bluefox) Added better typing
1124
+ - (bluefox) Color picker was improved
858
1125
 
859
- ### 5.0.2 (2024-05-30)
860
- * (bluefox) Added better typing
861
- * (bluefox) Json-Config is now a separate package and must be installed additionally
1126
+ ### 4.0.19 (2023-03-20)
862
1127
 
863
- ### 5.0.0 (2024-05-29)
864
- * (bluefox) Types are now exported
865
- * (bluefox) Translator renamed to Translate
866
- * (bluefox) Breaking: Theme renamed to IobTheme because of the naming conflict
1128
+ - (bluefox) Packages were updated
1129
+ - (bluefox) Added new translations
867
1130
 
868
- ### 4.13.24 (2024-05-25)
869
- * (bluefox) Updated packages
870
-
871
- * ### 4.13.22 (2024-05-23)
872
- * (bluefox) Updated packages
1131
+ ### 4.0.18 (2023-03-16)
873
1132
 
874
- ### 4.13.20 (2024-05-22)
875
- * (bluefox) Better types added
876
- * (bluefox) updated theme definitions
877
- * (bluefox) corrected dates in cron dialog
1133
+ - (bluefox) Packages were updated
878
1134
 
879
- ### 4.13.14 (2024-05-19)
880
- * (bluefox) Updated packages
1135
+ ### 4.0.17 (2023-03-15)
881
1136
 
882
- ### 4.13.13 (2024-05-09)
883
- * (bluefox) Updated ioBroker types
1137
+ - (bluefox) Added translations
1138
+ - (bluefox) Added port controller to JSON config
884
1139
 
885
- ### 4.13.12 (2024-05-06)
886
- * (bluefox) All files are migrated to Typescript
1140
+ ### 4.0.15 (2023-03-12)
887
1141
 
888
- ### 4.13.11 (2024-04-23)
889
- * (bluefox) Corrected the size of icons
1142
+ - (bluefox) Updated the object browser and file browser
890
1143
 
891
- ### 4.13.10 (2024-04-22)
892
- * (bluefox) Migrated all icons to Typescript
1144
+ ### 4.0.14 (2023-03-03)
893
1145
 
894
- ### 4.13.9 (2024-04-20)
895
- * (bluefox) Updated socket-client package
1146
+ - (bluefox) added handler of alert messages
896
1147
 
897
- ### 4.13.8 (2024-04-19)
898
- * (bluefox) Corrected CRON selector
1148
+ ### 4.0.13 (2023-02-15)
899
1149
 
900
- ### 4.13.7 (2024-04-19)
901
- * (bluefox) Migrated ColorPicker to typescript
1150
+ - (bluefox) Corrected the theme button
902
1151
 
903
- ### 4.13.6 (2024-04-11)
904
- * (bluefox) Migrated TreeTable to typescript
905
- * (bluefox) corrected the object subscription
1152
+ ### 4.0.12 (2023-02-15)
906
1153
 
907
- ### 4.13.5 (2024-04-02)
908
- * (bluefox) used new connection classes
909
- * (bluefox) Improved the `SelectID` dialog
1154
+ - (bluefox) made the fix for `echarts`
910
1155
 
911
- ### 4.13.3 (2024-04-01)
912
- * (bluefox) used new connection classes
1156
+ ### 4.0.11 (2023-02-14)
913
1157
 
914
- ### 4.12.3 (2024-03-30)
915
- * (bluefox) Migrated legacy connection to typescript
1158
+ - (bluefox) Updated packages
1159
+ - (bluefox) The `chartReady` event was omitted
916
1160
 
917
- ### 4.12.2 (2024-03-25)
918
- * (bluefox) Added support for remote cloud
1161
+ ### 4.0.10 (2023-02-10)
919
1162
 
920
- ### 4.11.6 (2024-03-19)
921
- * (bluefox) Corrected rendering of LoaderMV
1163
+ - (bluefox) Updated packages
1164
+ - (bluefox) made the fix for `material`
922
1165
 
923
- ### 4.11.4 (2024-03-18)
924
- * (bluefox) Corrected types of IconPicker
1166
+ ### 4.0.9 (2023-02-02)
925
1167
 
926
- ### 4.11.3 (2024-03-17)
927
- * (bluefox) Made filters for the file selector dialog optional
1168
+ - (bluefox) Updated packages
928
1169
 
929
- ### 4.11.2 (2024-03-16)
930
- * (bluefox) Migrated GenericApp to typescript
1170
+ ### 4.0.8 (2022-12-19)
931
1171
 
932
- ### 4.10.4 (2024-03-16)
933
- * (bluefox) Migrated some components to typescript
1172
+ - (bluefox) Extended socket with `log` command
934
1173
 
935
- ### 4.10.1 (2024-03-11)
936
- * (bluefox) Migrated some components to typescript
1174
+ ### 4.0.6 (2022-12-19)
937
1175
 
938
- ### 4.9.11 (2024-03-08)
939
- * (foxriver76) type GenericApp socket correctly
1176
+ - (bluefox) Corrected URL for the connection
940
1177
 
941
- ### 4.9.10 (2024-02-21)
942
- * (bluefox) translations
943
- * (bluefox) updated json config
1178
+ ### 4.0.5 (2022-12-14)
944
1179
 
945
- ### 4.9.9 (2024-02-16)
946
- * (foxriver76) also check plugin state of instance to see if Sentry is explicitly disabled
1180
+ - (bluefox) Added support of custom palette for color picker
947
1181
 
948
- ### 4.9.8 (2024-02-13)
949
- * (bluefox) allowed hiding wizard in cron dialog
1182
+ ### 4.0.2 (2022-12-01)
950
1183
 
951
- ### 4.9.7 (2024-02-03)
952
- * (foxriver76) allow passing down the instance number do avoid determining from url
1184
+ - (bluefox) use `@iobroker/socket-client` instead of `Connection.tsx`
953
1185
 
954
- ### 4.9.5 (2024-01-01)
955
- * (foxriver76) make `copyToClipboard` event parameter optional
1186
+ ### 3.5.3 (2022-11-30)
956
1187
 
957
- ### 4.9.4 (2024-01-01)
958
- * (foxriver76) try to fix `SelectID` scrolling
1188
+ - (bluefox) Improved `renderTextWithA` function to support `<b>` and `<i>` tags
959
1189
 
960
- ### 4.9.2 (2023-12-30)
961
- * (foxriver76) bump version of `@iobroker/json-config`
1190
+ ### 3.5.2 (2022-11-30)
962
1191
 
963
- ### 4.9.1 (2023-12-22)
964
- * (foxriver76) `@iobroker/json-config` moved to real dependencies
1192
+ - (bluefox) updated json config component
965
1193
 
966
- ### 4.9.0 (2023-12-22)
967
- * (foxriver76) migrate to `@iobroker/json-config` module to have a single point of truth
968
- * (bluefox) Allowed using of `filterFunc` as string
1194
+ ### 3.4.1 (2022-11-29)
969
1195
 
970
- ### 4.8.1 (2023-12-14)
971
- * (bluefox) Added Device manager to JSON Config
1196
+ - (bluefox) Added button text for message dialog
972
1197
 
973
- ### 4.7.15 (2023-12-12)
974
- * (bluefox) Corrected parsing of a text
1198
+ ### 3.4.0 (2022-11-29)
975
1199
 
976
- ### 4.7.13 (2023-12-10)
977
- * (bluefox) Added possibility to define the root style and embedded property
1200
+ - (bluefox) Added file selector
978
1201
 
979
- ### 4.7.11 (2023-12-06)
980
- * (bluefox) Extended color picker with "noInputField" option
1202
+ ### 3.3.0 (2022-11-26)
981
1203
 
982
- ### 4.7.9 (2023-12-04)
983
- * (bluefox) Corrected the icon picker
1204
+ - (bluefox) Added subscribe on files
984
1205
 
985
- ### 4.7.8 (2023-12-04)
986
- * (foxriver76) port to `@iobroker/types`
1206
+ ### 3.2.7 (2022-11-13)
987
1207
 
988
- ### 4.7.6 (2023-11-29)
989
- * (bluefox) Added translations
1208
+ - (bluefox) Added `fullWidth` property to `Dialog`
990
1209
 
991
- ### 4.7.5 (2023-11-28)
992
- * (bluefox) Corrected subscribe on objects in the legacy connection
1210
+ ### 3.2.6 (2022-11-08)
993
1211
 
994
- ### 4.7.4 (2023-11-23)
995
- * (bluefox) Updated packages
996
- * (bluefox) Made getStates method in legacy connection compatible with new one
1212
+ - (xXBJXx) Improved TreeTable component
997
1213
 
998
- ### 4.7.3 (2023-11-08)
999
- * (bluefox) Updated packages
1214
+ ### 3.2.5 (2022-11-08)
1000
1215
 
1001
- ### 4.7.2 (2023-11-03)
1002
- * (foxriver76) fixed problem with color picker, where editing TextField was buggy
1003
- * (foxriver76) fixed light mode color of a path in FileBrowser
1216
+ - (bluefox) Added the role filter for the object browser
1004
1217
 
1005
- ### 4.7.0 (2023-10-31)
1006
- * (bluefox) Synced with admin
1007
- * (bluefox) Added GIF to image files
1218
+ ### 3.2.4 (2022-11-03)
1008
1219
 
1009
- ### 4.6.7 (2023-10-19)
1010
- * (bluefox) Added return value for `subscribeOnInstance` for Connection class
1220
+ - (bluefox) Added support for alfa channel for `invertColor`
1011
1221
 
1012
- ### 4.6.6 (2023-10-13)
1013
- * (bluefox) Fixed the legacy connection
1222
+ ### 3.2.3 (2022-10-26)
1014
1223
 
1015
- ### 4.6.5 (2023-10-12)
1016
- * (foxriver76) fixed object browser with date
1224
+ - (bluefox) Corrected expert mode for object browser
1017
1225
 
1018
- ### 4.6.4 (2023-10-11)
1019
- * (bluefox) Updated the packages
1226
+ ### 3.2.2 (2022-10-25)
1020
1227
 
1021
- ### 4.6.3 (2023-10-09)
1022
- * (bluefox) Just updated the packages
1023
- * (bluefox) Synced with admin
1228
+ - (bluefox) Added support for prefixes for translations
1024
1229
 
1025
- ### 4.6.2 (2023-09-29)
1026
- * (bluefox) Experimental feature added: update states on re-subscribe
1230
+ ### 3.2.1 (2022-10-24)
1027
1231
 
1028
- ### 4.5.5 (2023-09-27)
1029
- * (bluefox) Added export for IconNoIcon
1232
+ - (bluefox) Corrected color inversion
1030
1233
 
1031
- ### 4.5.4 (2023-09-17)
1032
- * (bluefox) Added the restricting to folder property for select file dialog
1234
+ ### 3.2.0 (2022-10-19)
1033
1235
 
1034
- ### 4.5.3 (2023-08-20)
1035
- * (foxriver76) fixed css classes of TableResize, see https://github.com/ioBroker/ioBroker.admin/issues/1860
1236
+ - (bluefox) Added ukrainian translation
1036
1237
 
1037
- ### 4.5.2 (2023-08-20)
1038
- * (foxriver76) added missing export of TableResize
1238
+ ### 3.1.35 (2022-10-17)
1039
1239
 
1040
- ### 4.5.1 (2023-08-19)
1041
- * (foxriver76) fix dialog TextInput
1240
+ - (bluefox) small changes for material
1042
1241
 
1043
- ### 4.5.0 (2023-08-18)
1044
- * (bluefox) Synchronize components with admin
1242
+ ### 3.1.34 (2022-08-24)
1045
1243
 
1046
- ### 4.4.8 (2023-08-17)
1047
- * (bluefox) Added translations
1244
+ - (bluefox) Implemented fallback to english by translations
1048
1245
 
1049
- ### 4.4.7 (2023-08-10)
1050
- * (bluefox) Added `subscribeStateAsync` method to wait for answer
1051
- * (bluefox) Added support for arrays for un/subscriptions
1246
+ ### 3.1.33 (2022-08-24)
1052
1247
 
1053
- ### 4.4.5 (2023-08-01)
1054
- * (bluefox) Updated packages
1248
+ - (bluefox) Added support for onchange flag
1055
1249
 
1056
- ### 4.3.3 (2023-07-28)
1057
- * (bluefox) Added translations
1250
+ ### 3.1.30 (2022-08-23)
1058
1251
 
1059
- ### 4.3.0 (2023-07-19)
1060
- * (bluefox) Updated packages
1061
- * (bluefox) Added translations
1062
- * (bluefox) Synced object browser
1063
- * (bluefox) formatting
1252
+ - (bluefox) Added method `getCompactSystemRepositories`
1253
+ - (bluefox) corrected error in `ObjectBrowser`
1064
1254
 
1065
- ### 4.2.1 (2023-07-17)
1066
- * (bluefox) Updated packages
1067
- * (bluefox) Added translations
1255
+ ### 3.1.27 (2022-08-01)
1068
1256
 
1069
- ### 4.2.0 (2023-07-07)
1070
- * (bluefox) Updated packages
1071
- * (bluefox) Added new method `getObjectsById` to the socket communication
1257
+ - (bluefox) Disable file editing in FileViewer
1072
1258
 
1073
- ### 4.1.2 (2023-06-20)
1074
- * (bluefox) Allowed setting theme name directly by theme toggle
1259
+ ### 3.1.26 (2022-08-01)
1075
1260
 
1076
- ### 4.1.0 (2023-05-10)
1077
- * (bluefox) `craco-module-federation.js` was added. For node 16
1261
+ - (bluefox) Added translations
1262
+ - (bluefox) JSON schema was extended with missing definitions
1078
1263
 
1079
- ### 4.0.27 (2023-05-09)
1080
- * (bluefox) Allowed showing only specific root in SelectIDDialog
1264
+ ### 3.1.24 (2022-07-28)
1081
1265
 
1082
- ### 4.0.26 (2023-05-08)
1083
- * (bluefox) Added IDs to the buttons in the dialog for GUI tests
1266
+ - (bluefox) Updated file browser and object browser
1084
1267
 
1085
- ### 4.0.25 (2023-04-23)
1086
- * (bluefox) Extended `TextWithIcon` with defined color and icon
1268
+ ### 3.1.23 (2022-07-25)
1087
1269
 
1088
- ### 4.0.24 (2023-04-03)
1089
- * (bluefox) Updated the file selector in tile mode
1270
+ - (bluefox) Extend custom filter for object selector
1090
1271
 
1091
- ### 4.0.23 (2023-03-27)
1092
- * (bluefox) Added translations
1272
+ ### 3.1.22 (2022-07-22)
1093
1273
 
1094
- ### 4.0.22 (2023-03-22)
1095
- * (bluefox) Re-Activate legacy connection
1274
+ - (bluefox) Added i18n tools for development
1096
1275
 
1097
- ### 4.0.21 (2023-03-22)
1098
- * (bluefox) Added translations
1276
+ ### 3.1.20 (2022-07-14)
1099
1277
 
1100
- ### 4.0.20 (2023-03-21)
1101
- * (bluefox) Color picker was improved
1278
+ - (bluefox) Allowed to show select dialog with the expert mode enabled
1102
1279
 
1103
- ### 4.0.19 (2023-03-20)
1104
- * (bluefox) Packages were updated
1105
- * (bluefox) Added new translations
1280
+ ### 3.1.19 (2022-07-08)
1106
1281
 
1107
- ### 4.0.18 (2023-03-16)
1108
- * (bluefox) Packages were updated
1282
+ - (bluefox) Allowed extending translations for all languages together
1109
1283
 
1110
- ### 4.0.17 (2023-03-15)
1111
- * (bluefox) Added translations
1112
- * (bluefox) Added port controller to JSON config
1284
+ ### 3.1.18 (2022-07-06)
1113
1285
 
1114
- ### 4.0.15 (2023-03-12)
1115
- * (bluefox) Updated the object browser and file browser
1286
+ - (bluefox) Added translation
1116
1287
 
1117
- ### 4.0.14 (2023-03-03)
1118
- * (bluefox) added handler of alert messages
1288
+ ### 3.1.17 (2022-07-05)
1119
1289
 
1120
- ### 4.0.13 (2023-02-15)
1121
- * (bluefox) Corrected the theme button
1290
+ - (bluefox) Deactivate JSON editor for JSONConfig because of space
1122
1291
 
1123
- ### 4.0.12 (2023-02-15)
1124
- * (bluefox) made the fix for `echarts`
1292
+ ### 3.1.16 (2022-06-27)
1125
1293
 
1126
- ### 4.0.11 (2023-02-14)
1127
- * (bluefox) Updated packages
1128
- * (bluefox) The `chartReady` event was omitted
1294
+ - (bluefox) Update object browser
1129
1295
 
1130
- ### 4.0.10 (2023-02-10)
1131
- * (bluefox) Updated packages
1132
- * (bluefox) made the fix for `material`
1296
+ ### 3.1.15 (2022-06-27)
1133
1297
 
1134
- ### 4.0.9 (2023-02-02)
1135
- * (bluefox) Updated packages
1298
+ - (bluefox) Allowed using of spaces in name
1136
1299
 
1137
- ### 4.0.8 (2022-12-19)
1138
- * (bluefox) Extended socket with `log` command
1300
+ ### 3.1.14 (2022-06-23)
1139
1301
 
1140
- ### 4.0.6 (2022-12-19)
1141
- * (bluefox) Corrected URL for the connection
1302
+ - (bluefox) Added translations
1142
1303
 
1143
- ### 4.0.5 (2022-12-14)
1144
- * (bluefox) Added support of custom palette for color picker
1304
+ ### 3.1.11 (2022-06-22)
1145
1305
 
1146
- ### 4.0.2 (2022-12-01)
1147
- * (bluefox) use `@iobroker/socket-client` instead of `Connection.tsx`
1306
+ - (bluefox) Added preparations for iobroker cloud
1148
1307
 
1149
- ### 3.5.3 (2022-11-30)
1150
- * (bluefox) Improved `renderTextWithA` function to support `<b>` and `<i>` tags
1308
+ ### 3.1.10 (2022-06-22)
1151
1309
 
1152
- ### 3.5.2 (2022-11-30)
1153
- * (bluefox) updated json config component
1310
+ - (bluefox) Added translations
1154
1311
 
1155
- ### 3.4.1 (2022-11-29)
1156
- * (bluefox) Added button text for message dialog
1312
+ ### 3.1.9 (2022-06-20)
1157
1313
 
1158
- ### 3.4.0 (2022-11-29)
1159
- * (bluefox) Added file selector
1314
+ - (bluefox) Allowed working behind reverse proxy
1160
1315
 
1161
- ### 3.3.0 (2022-11-26)
1162
- * (bluefox) Added subscribe on files
1316
+ ### 3.1.7 (2022-06-19)
1163
1317
 
1164
- ### 3.2.7 (2022-11-13)
1165
- * (bluefox) Added `fullWidth` property to `Dialog`
1318
+ - (bluefox) Added file select dialog
1166
1319
 
1167
- ### 3.2.6 (2022-11-08)
1168
- * (xXBJXx) Improved TreeTable component
1320
+ ### 3.1.3 (2022-06-13)
1169
1321
 
1170
- ### 3.2.5 (2022-11-08)
1171
- * (bluefox) Added the role filter for the object browser
1322
+ - (bluefox) Added table with resized headers
1172
1323
 
1173
- ### 3.2.4 (2022-11-03)
1174
- * (bluefox) Added support for alfa channel for `invertColor`
1324
+ ### 3.1.2 (2022-06-09)
1175
1325
 
1176
- ### 3.2.3 (2022-10-26)
1177
- * (bluefox) Corrected expert mode for object browser
1326
+ - (bluefox) Added new document icon (read only)
1178
1327
 
1179
- ### 3.2.2 (2022-10-25)
1180
- * (bluefox) Added support for prefixes for translations
1328
+ ### 3.1.1 (2022-06-09)
1181
1329
 
1182
- ### 3.2.1 (2022-10-24)
1183
- * (bluefox) Corrected color inversion
1330
+ - (bluefox) Allowed working behind reverse proxy
1184
1331
 
1185
- ### 3.2.0 (2022-10-19)
1186
- * (bluefox) Added ukrainian translation
1332
+ ### 3.1.0 (2022-06-07)
1187
1333
 
1188
- ### 3.1.35 (2022-10-17)
1189
- * (bluefox) small changes for material
1334
+ - (bluefox) Some german texts were corrected
1190
1335
 
1191
- ### 3.1.34 (2022-08-24)
1192
- * (bluefox) Implemented fallback to english by translations
1336
+ ### 3.0.17 (2022-06-03)
1193
1337
 
1194
- ### 3.1.33 (2022-08-24)
1195
- * (bluefox) Added support for onchange flag
1338
+ - (bluefox) Allowed calling getAdapterInstances not for admin too
1196
1339
 
1197
- ### 3.1.30 (2022-08-23)
1198
- * (bluefox) Added method `getCompactSystemRepositories`
1199
- * (bluefox) corrected error in `ObjectBrowser`
1340
+ ### 3.0.15 (2022-06-01)
1200
1341
 
1201
- ### 3.1.27 (2022-08-01)
1202
- * (bluefox) Disable file editing in FileViewer
1342
+ - (bluefox) Updated JsonConfigComponent: password, table
1203
1343
 
1204
- ### 3.1.26 (2022-08-01)
1205
- * (bluefox) Added translations
1206
- * (bluefox) JSON schema was extended with missing definitions
1344
+ ### 3.0.14 (2022-05-25)
1207
1345
 
1208
- ### 3.1.24 (2022-07-28)
1209
- * (bluefox) Updated file browser and object browser
1346
+ - (bluefox) Added ConfigGeneric to import
1210
1347
 
1211
- ### 3.1.23 (2022-07-25)
1212
- * (bluefox) Extend custom filter for object selector
1348
+ ### 3.0.7 (2022-05-25)
1213
1349
 
1214
- ### 3.1.22 (2022-07-22)
1215
- * (bluefox) Added i18n tools for development
1350
+ - (bluefox) Made the module definitions
1216
1351
 
1217
- ### 3.1.20 (2022-07-14)
1218
- * (bluefox) Allowed to show select dialog with the expert mode enabled
1352
+ ### 3.0.6 (2022-05-25)
1219
1353
 
1220
- ### 3.1.19 (2022-07-08)
1221
- * (bluefox) Allowed extending translations for all languages together
1354
+ - (bluefox) Added JsonConfigComponent
1222
1355
 
1223
- ### 3.1.18 (2022-07-06)
1224
- * (bluefox) Added translation
1356
+ ### 2.1.11 (2022-05-24)
1225
1357
 
1226
- ### 3.1.17 (2022-07-05)
1227
- * (bluefox) Deactivate JSON editor for JSONConfig because of space
1358
+ - (bluefox) Update file browser. It supports now the file changed events.
1228
1359
 
1229
- ### 3.1.16 (2022-06-27)
1230
- * (bluefox) Update object browser
1360
+ ### 2.1.10 (2022-05-24)
1231
1361
 
1232
- ### 3.1.15 (2022-06-27)
1233
- * (bluefox) Allowed using of spaces in name
1362
+ - (bluefox) Corrected object browser
1234
1363
 
1235
- ### 3.1.14 (2022-06-23)
1236
- * (bluefox) Added translations
1364
+ ### 2.1.9 (2022-05-16)
1237
1365
 
1238
- ### 3.1.11 (2022-06-22)
1239
- * (bluefox) Added preparations for iobroker cloud
1366
+ - (bluefox) Corrected expert mode in object browser
1240
1367
 
1241
- ### 3.1.10 (2022-06-22)
1242
- * (bluefox) Added translations
1368
+ ### 2.1.7 (2022-05-09)
1243
1369
 
1244
- ### 3.1.9 (2022-06-20)
1245
- * (bluefox) Allowed working behind reverse proxy
1370
+ - (bluefox) Changes were synchronized with adapter-react-v5
1371
+ - (bluefox) Added `I18n.disableWarning` method
1246
1372
 
1247
- ### 3.1.7 (2022-06-19)
1248
- * (bluefox) Added file select dialog
1373
+ ### 2.1.6 (2022-03-28)
1249
1374
 
1250
- ### 3.1.3 (2022-06-13)
1251
- * (bluefox) Added table with resized headers
1375
+ - (bluefox) Added `log` method to connection
1376
+ - (bluefox) Corrected translations
1252
1377
 
1253
- ### 3.1.2 (2022-06-09)
1254
- * (bluefox) Added new document icon (read only)
1378
+ ### 2.1.1 (2022-03-27)
1255
1379
 
1256
- ### 3.1.1 (2022-06-09)
1257
- * (bluefox) Allowed working behind reverse proxy
1380
+ - (bluefox) Corrected error in TreeTable
1258
1381
 
1259
- ### 3.1.0 (2022-06-07)
1260
- * (bluefox) Some german texts were corrected
1382
+ ### 2.1.0 (2022-03-26)
1261
1383
 
1262
- ### 3.0.17 (2022-06-03)
1263
- * (bluefox) Allowed calling getAdapterInstances not for admin too
1384
+ - (bluefox) BREAKING_CHANGE: Corrected error with readFile(base64=false)
1264
1385
 
1265
- ### 3.0.15 (2022-06-01)
1266
- * (bluefox) Updated JsonConfigComponent: password, table
1386
+ ### 2.0.0 (2022-03-26)
1267
1387
 
1268
- ### 3.0.14 (2022-05-25)
1269
- * (bluefox) Added ConfigGeneric to import
1388
+ - (bluefox) Initial version
1270
1389
 
1271
- ### 3.0.7 (2022-05-25)
1272
- * (bluefox) Made the module definitions
1390
+ ### 0.1.0 (2022-03-23)
1273
1391
 
1274
- ### 3.0.6 (2022-05-25)
1275
- * (bluefox) Added JsonConfigComponent
1392
+ - (bluefox) Fixed theme errors
1276
1393
 
1277
- ### 2.1.11 (2022-05-24)
1278
- * (bluefox) Update file browser. It supports now the file changed events.
1394
+ ### 0.0.4 (2022-03-22)
1279
1395
 
1280
- ### 2.1.10 (2022-05-24)
1281
- * (bluefox) Corrected object browser
1396
+ - (bluefox) Fixed eslint warnings
1282
1397
 
1283
- ### 2.1.9 (2022-05-16)
1284
- * (bluefox) Corrected expert mode in object browser
1398
+ ### 0.0.3 (2022-03-19)
1285
1399
 
1286
- ### 2.1.7 (2022-05-09)
1287
- * (bluefox) Changes were synchronized with adapter-react-v5
1288
- * (bluefox) Added `I18n.disableWarning` method
1400
+ - (bluefox) beta version
1289
1401
 
1290
- ### 2.1.6 (2022-03-28)
1291
- * (bluefox) Added `log` method to connection
1292
- * (bluefox) Corrected translations
1402
+ ### 0.0.2 (2022-02-24)
1293
1403
 
1294
- ### 2.1.1 (2022-03-27)
1295
- * (bluefox) Corrected error in TreeTable
1404
+ - (bluefox) try to publish a first version
1296
1405
 
1297
- ### 2.1.0 (2022-03-26)
1298
- * (bluefox) BREAKING_CHANGE: Corrected error with readFile(base64=false)
1406
+ ### 0.0.1 (2022-02-24)
1299
1407
 
1300
- ### 2.0.0 (2022-03-26)
1301
- * (bluefox) Initial version
1408
+ - initial commit
1302
1409
 
1303
- ### 0.1.0 (2022-03-23)
1304
- * (bluefox) Fixed theme errors
1410
+ ## License
1305
1411
 
1306
- ### 0.0.4 (2022-03-22)
1307
- * (bluefox) Fixed eslint warnings
1412
+ The MIT License (MIT)
1308
1413
 
1309
- ### 0.0.3 (2022-03-19)
1310
- * (bluefox) beta version
1414
+ Copyright (c) 2019-2024 bluefox <dogafox@gmail.com>
1311
1415
 
1312
- ### 0.0.2 (2022-02-24)
1313
- * (bluefox) try to publish a first version
1416
+ Permission is hereby granted, free of charge, to any person obtaining a copy
1417
+ of this software and associated documentation files (the "Software"), to deal
1418
+ in the Software without restriction, including without limitation the rights
1419
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1420
+ copies of the Software, and to permit persons to whom the Software is
1421
+ furnished to do so, subject to the following conditions:
1314
1422
 
1315
- ### 0.0.1 (2022-02-24)
1316
- * initial commit
1423
+ The above copyright notice and this permission notice shall be included in all
1424
+ copies or substantial portions of the Software.
1317
1425
 
1318
- ## License
1319
- The MIT License (MIT)
1320
-
1321
- Copyright (c) 2019-2024 bluefox <dogafox@gmail.com>
1322
-
1323
- Permission is hereby granted, free of charge, to any person obtaining a copy
1324
- of this software and associated documentation files (the "Software"), to deal
1325
- in the Software without restriction, including without limitation the rights
1326
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1327
- copies of the Software, and to permit persons to whom the Software is
1328
- furnished to do so, subject to the following conditions:
1329
-
1330
- The above copyright notice and this permission notice shall be included in all
1331
- copies or substantial portions of the Software.
1332
-
1333
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1334
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1335
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1336
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1337
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1338
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1426
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1427
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1428
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1429
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1430
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1431
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1339
1432
  SOFTWARE.