@iobroker/adapter-react-v5 7.1.3 → 7.2.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.
- package/AdminConnection.js +2 -0
- package/Components/UploadImage.js +14 -3
- package/Dialogs/Confirm.d.ts +1 -1
- package/Dialogs/Error.d.ts +1 -1
- package/Dialogs/Message.d.ts +1 -1
- package/LegacyConnection.d.ts +1 -0
- package/LegacyConnection.js +2 -2
- package/README.md +1446 -1437
- package/assets/lamp_ceiling.svg +8 -8
- package/assets/lamp_table.svg +7 -7
- package/assets/no_icon.svg +9 -9
- package/i18n/de.json +438 -438
- package/i18n/en.json +438 -438
- package/i18n/es.json +438 -438
- package/i18n/fr.json +438 -438
- package/i18n/it.json +438 -438
- package/i18n/nl.json +438 -438
- package/i18n/pl.json +438 -438
- package/i18n/pt.json +438 -438
- package/i18n/ru.json +438 -438
- package/i18n/uk.json +438 -438
- package/i18n/zh-cn.json +438 -438
- package/index.js +3 -1
- package/package.json +6 -6
- package/src/Components/ComplexCron.tsx +561 -561
- package/src/Components/TabContainer.tsx +57 -57
- package/src/Components/UploadImage.tsx +15 -3
- package/src/Dialogs/ComplexCron.tsx +163 -163
- package/src/Dialogs/Confirm.tsx +1 -1
- package/src/Dialogs/Error.tsx +1 -1
- package/src/Dialogs/Message.tsx +1 -1
- package/src/LegacyConnection.tsx +3 -2
- package/tasks.js +91 -91
package/AdminConnection.js
CHANGED
|
@@ -471,8 +471,19 @@ class UploadImage extends react_1.Component {
|
|
|
471
471
|
render() {
|
|
472
472
|
const { disabled, icon, removeIconFunc, error, crop, onChange } = this.props;
|
|
473
473
|
const maxSize = this.props.maxSize || 10 * 1024;
|
|
474
|
-
|
|
474
|
+
let accept = this.props.accept || { 'image/*': [] };
|
|
475
475
|
const { uploadFile, anchorEl, cropHandler } = this.state;
|
|
476
|
+
// covert '"image/png"' to { 'image/*': [] }
|
|
477
|
+
if (typeof accept === 'string') {
|
|
478
|
+
accept = { [accept]: [] };
|
|
479
|
+
}
|
|
480
|
+
else if (Array.isArray(accept)) {
|
|
481
|
+
const result = {};
|
|
482
|
+
accept.forEach(item => {
|
|
483
|
+
result[item] = [];
|
|
484
|
+
});
|
|
485
|
+
accept = result;
|
|
486
|
+
}
|
|
476
487
|
return (react_1.default.createElement(react_dropzone_1.default, { disabled: !!disabled || cropHandler, key: "dropzone", multiple: false, accept: accept, maxSize: maxSize, onDragEnter: () => this.setState({ uploadFile: 'dragging' }), onDragLeave: () => this.setState({ uploadFile: true }), onDrop: (acceptedFiles, errors) => {
|
|
477
488
|
this.setState({ uploadFile: false });
|
|
478
489
|
if (!acceptedFiles.length) {
|
|
@@ -495,14 +506,14 @@ class UploadImage extends react_1.Component {
|
|
|
495
506
|
? i18n_1.default.t('ra_Drop file here')
|
|
496
507
|
: i18n_1.default.t('ra_Place your files here or click here to open the browse dialog')))) : (removeIconFunc &&
|
|
497
508
|
!cropHandler && (react_1.default.createElement("div", { style: styles.buttonRemoveWrapper },
|
|
498
|
-
react_1.default.createElement(material_1.Tooltip, { title: i18n_1.default.t('ra_Clear'),
|
|
509
|
+
react_1.default.createElement(material_1.Tooltip, { title: i18n_1.default.t('ra_Clear'), slotProps: { popper: { sx: { pointerEvents: 'none' } } } },
|
|
499
510
|
react_1.default.createElement(material_1.IconButton, { size: "large", onClick: e => {
|
|
500
511
|
removeIconFunc && removeIconFunc();
|
|
501
512
|
e.stopPropagation();
|
|
502
513
|
} },
|
|
503
514
|
react_1.default.createElement(icons_material_1.Close, null)))))),
|
|
504
515
|
icon && crop && (react_1.default.createElement("div", { style: styles.buttonCropWrapper },
|
|
505
|
-
react_1.default.createElement(material_1.Tooltip, { title: i18n_1.default.t('ra_Crop'),
|
|
516
|
+
react_1.default.createElement(material_1.Tooltip, { title: i18n_1.default.t('ra_Crop'), slotProps: { popper: { sx: { pointerEvents: 'none' } } } },
|
|
506
517
|
react_1.default.createElement(material_1.IconButton, { size: "large", onClick: e => {
|
|
507
518
|
if (!cropHandler) {
|
|
508
519
|
this.setState({ cropHandler: true });
|
package/Dialogs/Confirm.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface DialogConfirmProps {
|
|
|
9
9
|
/** The dialog title; default: Are you sure? (translated) */
|
|
10
10
|
title?: string;
|
|
11
11
|
/** The dialog text */
|
|
12
|
-
text?: string | React.JSX.Element;
|
|
12
|
+
text?: string | React.JSX.Element | React.JSX.Element[];
|
|
13
13
|
/** Close handler. */
|
|
14
14
|
onClose?: (ok: boolean) => void;
|
|
15
15
|
/** if the dialog must be fill sized */
|
package/Dialogs/Error.d.ts
CHANGED
package/Dialogs/Message.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React, { Component, type JSX } from 'react';
|
|
8
8
|
interface DialogMessageProps {
|
|
9
9
|
title?: string;
|
|
10
|
-
text: string | React.JSX.Element;
|
|
10
|
+
text: string | React.JSX.Element | React.JSX.Element[];
|
|
11
11
|
onClose?: () => void;
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
icon?: React.JSX.Element;
|
package/LegacyConnection.d.ts
CHANGED
package/LegacyConnection.js
CHANGED
|
@@ -164,7 +164,7 @@ class Connection {
|
|
|
164
164
|
*/
|
|
165
165
|
startSocket() {
|
|
166
166
|
// if socket io is not yet loaded
|
|
167
|
-
if (typeof window.io === 'undefined') {
|
|
167
|
+
if (typeof window.io === 'undefined' && typeof window.iob === 'undefined') {
|
|
168
168
|
// if in index.html the onLoad function not defined
|
|
169
169
|
if (typeof window.registerSocketOnLoad !== 'function') {
|
|
170
170
|
// poll if loaded
|
|
@@ -225,7 +225,7 @@ class Connection {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
const url = port ? `${protocol}://${host}:${port}${path}` : `${protocol}://${host}${path}`;
|
|
228
|
-
this._socket = window.io.connect(url, {
|
|
228
|
+
this._socket = (window.io || window.iob).connect(url, {
|
|
229
229
|
path: path.endsWith('/') ? `${path}socket.io` : `${path}/socket.io`,
|
|
230
230
|
query: 'ws=true',
|
|
231
231
|
name: this.props.name,
|