@iobroker/adapter-react-v5 6.0.1 → 6.0.3
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/Components/FileBrowser.js +1 -1
- package/Components/Icon.js +3 -4
- package/Components/ObjectBrowser.js +2 -2
- package/Components/SimpleCron/index.js +2 -3
- package/Components/TabContainer.d.ts +5 -2
- package/Components/TabContainer.js +2 -1
- package/Components/TabContent.d.ts +5 -2
- package/Components/TabContent.js +1 -1
- package/Components/ToggleThemeMenu.js +1 -1
- package/Dialogs/SelectFile.d.ts +3 -0
- package/Dialogs/SelectFile.js +1 -1
- package/Dialogs/SelectID.d.ts +3 -0
- package/Dialogs/SelectID.js +1 -1
- package/LegacyConnection.d.ts +0 -1
- package/LegacyConnection.js +2 -2
- package/README.md +9 -3
- package/package.json +3 -3
|
@@ -1231,7 +1231,7 @@ class FileBrowserClass extends react_1.Component {
|
|
|
1231
1231
|
!this.state.selected.startsWith(`${this.limitToPath}/`) &&
|
|
1232
1232
|
this.limitToPath !== this.state.selected), title: this.props.t('ra_Upload file'), style: styles.menuButton, color: "inherit", "aria-label": "upload file", onClick: () => this.setState({ uploadFile: true }), size: "small" },
|
|
1233
1233
|
react_1.default.createElement(icons_material_1.Publish, { fontSize: "small" })) : null,
|
|
1234
|
-
this.props.showTypeSelector && IconType ? react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Filter files') },
|
|
1234
|
+
this.props.showTypeSelector && IconType ? react_1.default.createElement(material_1.Tooltip, { title: this.props.t('ra_Filter files'), componentsProps: { popper: { sx: styles.tooltip } } },
|
|
1235
1235
|
react_1.default.createElement(material_1.IconButton, { size: "small", onClick: e => this.setState({ showTypesMenu: e.target }) },
|
|
1236
1236
|
react_1.default.createElement(IconType, { fontSize: "small" }))) : null,
|
|
1237
1237
|
this.state.showTypesMenu ? react_1.default.createElement(material_1.Menu, { open: !0, anchorEl: this.state.showTypesMenu, onClose: () => this.setState({ showTypesMenu: null }) }, Object.keys(FILE_TYPE_ICONS).map(type => {
|
package/Components/Icon.js
CHANGED
|
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getSystemIcon = getSystemIcon;
|
|
7
|
+
exports.getSelectIdIcon = getSelectIdIcon;
|
|
8
|
+
exports.default = Icon;
|
|
7
9
|
const react_1 = __importDefault(require("react"));
|
|
8
10
|
const react_inlinesvg_1 = __importDefault(require("react-inlinesvg"));
|
|
9
11
|
const icons_material_1 = require("@mui/icons-material");
|
|
@@ -49,7 +51,6 @@ function getSystemIcon(obj) {
|
|
|
49
51
|
}
|
|
50
52
|
return icon || null;
|
|
51
53
|
}
|
|
52
|
-
exports.getSystemIcon = getSystemIcon;
|
|
53
54
|
function getSelectIdIcon(obj, imagePrefix) {
|
|
54
55
|
imagePrefix = imagePrefix || '.'; // http://localhost:8081';
|
|
55
56
|
let src = '';
|
|
@@ -96,7 +97,6 @@ function getSelectIdIcon(obj, imagePrefix) {
|
|
|
96
97
|
}
|
|
97
98
|
return src || null;
|
|
98
99
|
}
|
|
99
|
-
exports.getSelectIdIcon = getSelectIdIcon;
|
|
100
100
|
const REMOTE_SERVER = window.location.hostname.includes('iobroker.in');
|
|
101
101
|
const REMOTE_PREFIX = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1);
|
|
102
102
|
function Icon(props) {
|
|
@@ -135,4 +135,3 @@ function Icon(props) {
|
|
|
135
135
|
}
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
|
-
exports.default = Icon;
|
|
@@ -32,7 +32,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
};
|
|
33
33
|
var _a, _ObjectBrowserClass_NON_EXPERT_NAMESPACES;
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.ObjectBrowserClass = exports.ITEM_IMAGES =
|
|
35
|
+
exports.ObjectBrowserClass = exports.ITEM_IMAGES = void 0;
|
|
36
|
+
exports.getSelectIdIconFromObjects = getSelectIdIconFromObjects;
|
|
36
37
|
/**
|
|
37
38
|
* Copyright 2020-2024, Denis Haev <dogafox@gmail.com>
|
|
38
39
|
*
|
|
@@ -916,7 +917,6 @@ function getSelectIdIconFromObjects(objects, id, imagePrefix) {
|
|
|
916
917
|
}
|
|
917
918
|
return src || null;
|
|
918
919
|
}
|
|
919
|
-
exports.getSelectIdIconFromObjects = getSelectIdIconFromObjects;
|
|
920
920
|
function applyFilter(item, filters, lang, objects, context, counter, customFilter, selectedTypes, _depth) {
|
|
921
921
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
922
922
|
_depth = _depth || 0;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.cron2state =
|
|
6
|
+
exports.cron2state = cron2state;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
9
|
const cronText_1 = __importDefault(require("./cronText"));
|
|
@@ -213,7 +213,6 @@ function cron2state(cron, force) {
|
|
|
213
213
|
}
|
|
214
214
|
return state;
|
|
215
215
|
}
|
|
216
|
-
exports.cron2state = cron2state;
|
|
217
216
|
class SimpleCron extends react_1.default.Component {
|
|
218
217
|
constructor(props) {
|
|
219
218
|
super(props);
|
|
@@ -604,7 +603,7 @@ class SimpleCron extends react_1.default.Component {
|
|
|
604
603
|
render() {
|
|
605
604
|
return react_1.default.createElement("div", { style: styles.mainDiv },
|
|
606
605
|
react_1.default.createElement("div", { style: { paddingLeft: 8, width: '100%' } },
|
|
607
|
-
react_1.default.createElement(material_1.TextField, { style: { width: '100%' }, value: this.state.cron, disabled: true })),
|
|
606
|
+
react_1.default.createElement(material_1.TextField, { variant: "standard", style: { width: '100%' }, value: this.state.cron, disabled: true })),
|
|
608
607
|
react_1.default.createElement("div", { style: { paddingLeft: 8, width: '100%', height: 60 } }, (0, cronText_1.default)(this.state.cron, this.props.language || 'en')),
|
|
609
608
|
react_1.default.createElement("div", null,
|
|
610
609
|
react_1.default.createElement(material_1.FormControl, { variant: "standard", style: Object.assign(Object.assign({}, styles.formControl), { marginLeft: 8, marginTop: 8 }) },
|
|
@@ -2,10 +2,13 @@ import React from 'react';
|
|
|
2
2
|
interface TabContainerProps {
|
|
3
3
|
elevation?: number;
|
|
4
4
|
overflow?: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
styles?: {
|
|
6
|
+
root?: React.CSSProperties;
|
|
7
|
+
container?: React.CSSProperties;
|
|
8
|
+
};
|
|
7
9
|
onKeyDown?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
8
10
|
tabIndex?: number;
|
|
11
|
+
/** The content of the component. */
|
|
9
12
|
children: React.ReactNode;
|
|
10
13
|
}
|
|
11
14
|
declare function TabContainer(props: TabContainerProps): React.JSX.Element;
|
|
@@ -18,7 +18,8 @@ const styles = {
|
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
function TabContainer(props) {
|
|
21
|
-
|
|
21
|
+
var _a;
|
|
22
|
+
return react_1.default.createElement(material_1.Paper, { elevation: !Number.isNaN(props.elevation) ? props.elevation : 1, style: Object.assign(Object.assign(Object.assign({}, styles.root), (((_a = props.styles) === null || _a === void 0 ? void 0 : _a.root) || undefined)), (props.overflow !== 'visible' ? styles.overflowHidden : undefined)), onKeyDown: props.onKeyDown, tabIndex: props.tabIndex },
|
|
22
23
|
react_1.default.createElement(material_1.Grid, { container: true, direction: "column", wrap: "nowrap", sx: styles.container }, props.children));
|
|
23
24
|
}
|
|
24
25
|
exports.default = TabContainer;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface TabContentProps {
|
|
3
|
-
|
|
4
|
-
children: React.
|
|
3
|
+
/** The content of the component. */
|
|
4
|
+
children: React.JSX.Element | (React.JSX.Element | null | React.JSX.Element[])[];
|
|
5
|
+
/** Overflow behavior */
|
|
6
|
+
overflow?: 'auto';
|
|
7
|
+
style?: React.CSSProperties;
|
|
5
8
|
}
|
|
6
9
|
declare function TabContent(props: TabContentProps): React.JSX.Element;
|
|
7
10
|
export default TabContent;
|
package/Components/TabContent.js
CHANGED
|
@@ -16,6 +16,6 @@ const styles = {
|
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
18
|
function TabContent(props) {
|
|
19
|
-
return react_1.default.createElement(material_1.Grid, { item: true, sx: Object.assign(Object.assign({}, styles.root), (props.overflow === 'auto' ? styles.overflowAuto : undefined)) }, props.children);
|
|
19
|
+
return react_1.default.createElement(material_1.Grid, { item: true, sx: Object.assign(Object.assign(Object.assign({}, styles.root), ((props === null || props === void 0 ? void 0 : props.style) || undefined)), (props.overflow === 'auto' ? styles.overflowAuto : undefined)) }, props.children);
|
|
20
20
|
}
|
|
21
21
|
exports.default = TabContent;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = ToggleThemeMenu;
|
|
6
7
|
const react_1 = __importDefault(require("react"));
|
|
7
8
|
const material_1 = require("@mui/material");
|
|
8
9
|
const icons_material_1 = require("@mui/icons-material");
|
|
@@ -15,4 +16,3 @@ function ToggleThemeMenu({ themeName, toggleTheme, t, className, style, size, })
|
|
|
15
16
|
themeName === 'colored' && react_1.default.createElement(icons_material_1.Brightness6, { className: className }),
|
|
16
17
|
themeName !== 'dark' && themeName !== 'blue' && themeName !== 'colored' && react_1.default.createElement(icons_material_1.Brightness7, { className: className }))));
|
|
17
18
|
}
|
|
18
|
-
exports.default = ToggleThemeMenu;
|
package/Dialogs/SelectFile.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Connection } from '@iobroker/socket-client';
|
|
3
|
+
import { IobTheme } from '../types';
|
|
3
4
|
interface DialogSelectFileProps {
|
|
4
5
|
/** where to store settings in localStorage * @property {string} [title] The dialog title; default: Please select object ID... (translated) */
|
|
5
6
|
dialogName?: string;
|
|
@@ -21,6 +22,8 @@ interface DialogSelectFileProps {
|
|
|
21
22
|
themeName?: string;
|
|
22
23
|
/** Theme type. */
|
|
23
24
|
themeType?: 'dark' | 'light';
|
|
25
|
+
/** Theme object. */
|
|
26
|
+
theme: IobTheme;
|
|
24
27
|
/** The selected IDs. */
|
|
25
28
|
selected?: string | string[];
|
|
26
29
|
/** The ok button text; default: OK (translated) */
|
package/Dialogs/SelectFile.js
CHANGED
|
@@ -108,7 +108,7 @@ class DialogSelectFile extends react_1.default.Component {
|
|
|
108
108
|
react_1.default.createElement(material_1.DialogContent, { style: Object.assign(Object.assign({}, styles.content), styles.contentMobile) },
|
|
109
109
|
react_1.default.createElement(FileBrowser_1.default, { ready: true, imagePrefix: this.props.imagePrefix || this.props.prefix || '../', allowUpload: !!this.props.allowUpload, allowDownload: this.props.allowDownload !== false, allowCreateFolder: !!this.props.allowCreateFolder, allowDelete: !!this.props.allowDelete, allowView: this.props.allowView !== false, showViewTypeButton: this.props.showViewTypeButton !== false, showToolbar: this.props.showToolbar !== false, limitPath: this.props.limitPath, filterFiles: this.props.filterFiles, filterByType: this.props.filterByType, selected: this.props.selected, restrictToFolder: this.props.restrictToFolder, allowNonRestricted: this.props.allowNonRestricted, onSelect: (selected, isDoubleClick, isFolder) => {
|
|
110
110
|
this.setState({ selected: Array.isArray(selected) ? selected : [selected] }, () => isDoubleClick && (!this.props.selectOnlyFolders || isFolder) && this.handleOk());
|
|
111
|
-
}, t: this.props.t || i18n_1.default.t, lang: this.props.lang || i18n_1.default.getLanguage(), socket: this.props.socket, themeType: this.props.themeType, themeName: this.props.themeName, showExpertButton: this.props.showExpertButton, expertMode: this.props.expertMode, showTypeSelector: this.props.showTypeSelector })),
|
|
111
|
+
}, t: this.props.t || i18n_1.default.t, lang: this.props.lang || i18n_1.default.getLanguage(), socket: this.props.socket, themeType: this.props.themeType, themeName: this.props.themeName, theme: this.props.theme, showExpertButton: this.props.showExpertButton, expertMode: this.props.expertMode, showTypeSelector: this.props.showTypeSelector })),
|
|
112
112
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
113
113
|
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleOk(), startIcon: react_1.default.createElement(icons_material_1.Check, null), disabled: !this.state.selected.length, color: "primary" }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
114
114
|
react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
package/Dialogs/SelectID.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import React, { Component } from 'react';
|
|
8
8
|
import type Connection from '../Connection';
|
|
9
9
|
import { ObjectBrowserColumn, ObjectBrowserCustomFilter, ObjectBrowserType } from '../Components/types';
|
|
10
|
+
import { IobTheme } from '../types';
|
|
10
11
|
export interface SelectIDFilters {
|
|
11
12
|
id?: string;
|
|
12
13
|
name?: string;
|
|
@@ -32,6 +33,8 @@ interface DialogSelectIDProps {
|
|
|
32
33
|
notEditable?: boolean;
|
|
33
34
|
themeName?: string;
|
|
34
35
|
themeType?: string;
|
|
36
|
+
/** The theme object */
|
|
37
|
+
theme?: IobTheme;
|
|
35
38
|
customFilter?: ObjectBrowserCustomFilter;
|
|
36
39
|
selected?: string | string[];
|
|
37
40
|
ok?: string;
|
package/Dialogs/SelectID.js
CHANGED
|
@@ -133,7 +133,7 @@ class DialogSelectID extends react_1.Component {
|
|
|
133
133
|
// style={{ width: '100%', height: '100%' }}
|
|
134
134
|
columns: this.props.columns || ['name', 'type', 'role', 'room', 'func', 'val'], types: this.props.types ? (Array.isArray(this.props.types) ? this.props.types : [this.props.types]) : ['state'], root: this.props.root, t: i18n_1.default.t, lang: this.props.lang || i18n_1.default.getLanguage(), socket: this.props.socket, selected: this.state.selected, multiSelect: this.props.multiSelect, notEditable: this.props.notEditable === undefined ? true : this.props.notEditable,
|
|
135
135
|
// name={this.state.name}
|
|
136
|
-
themeName: this.props.themeName, themeType: this.props.themeType, customFilter: this.props.customFilter, onFilterChanged: (filterConfig) => {
|
|
136
|
+
themeName: this.props.themeName, themeType: this.props.themeType, theme: this.props.theme, customFilter: this.props.customFilter, onFilterChanged: (filterConfig) => {
|
|
137
137
|
this.filters = filterConfig;
|
|
138
138
|
(window._localStorage || window.localStorage).setItem(this.dialogName, JSON.stringify(filterConfig));
|
|
139
139
|
}, onSelect: (_selected, name, isDouble) => {
|
package/LegacyConnection.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* MIT License
|
|
5
5
|
*
|
|
6
6
|
* */
|
|
7
|
-
/// <reference types="node" />
|
|
8
7
|
import { type HostInfo } from '@iobroker/js-controller-common-db/build/esm/lib/common/tools';
|
|
9
8
|
import { type FilteredNotificationInformation } from '@iobroker/js-controller-common/build/esm/lib/common/notificationHandler';
|
|
10
9
|
declare global {
|
package/LegacyConnection.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* */
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.ERRORS = exports.PROGRESS = void 0;
|
|
10
|
+
exports.pattern2RegEx = pattern2RegEx;
|
|
10
11
|
/** Possible progress states. */
|
|
11
12
|
exports.PROGRESS = {
|
|
12
13
|
/** The socket is connecting. */
|
|
@@ -95,7 +96,6 @@ function pattern2RegEx(pattern) {
|
|
|
95
96
|
.replace(/\*/g, '.*');
|
|
96
97
|
return (startsWithWildcard ? '' : '^') + pattern + (endsWithWildcard ? '' : '$');
|
|
97
98
|
}
|
|
98
|
-
exports.pattern2RegEx = pattern2RegEx;
|
|
99
99
|
class Connection {
|
|
100
100
|
constructor(props) {
|
|
101
101
|
this.systemLang = 'en';
|
package/README.md
CHANGED
|
@@ -752,20 +752,26 @@ The best practice is to replace `padding` with `p` and `margin` with `m`, so you
|
|
|
752
752
|
|
|
753
753
|
After: `<Badge sx={{ '& .MuiBadge-badge': styles.expertBadge }}>`
|
|
754
754
|
|
|
755
|
+
Before: `<Tab classes={{ selected: styles.selected }} />`
|
|
756
|
+
|
|
757
|
+
After: `<Tab sx={{ '&.Mui-selected': styles.selected }} />`
|
|
758
|
+
|
|
755
759
|
Before: `<Tooltip title={this.props.t('ra_Refresh tree')} classes={{ popper: styles.tooltip }}>`
|
|
756
760
|
|
|
757
761
|
After: `<Tooltip title={this.props.t('ra_Refresh tree')} componentsProps={{ popper: { sx: { pointerEvents: 'none' } } }}>`
|
|
758
762
|
Or: `<Tooltip title={this.props.t('ra_Refresh tree')} componentsProps={{ popper: { sx: styles.tooltip } }}>`
|
|
759
763
|
|
|
760
|
-
|
|
761
|
-
|
|
764
|
+
Before. `<AccordionSummary classes={{ root: styles.rootStyle, content: styles.content }}>`
|
|
765
|
+
|
|
766
|
+
After. `<AccordionSummary sx={{ '&.MuiAccordionSummary-root': styles.rootStyle, '& .MuiAccordionSummary-content': styles.content }}>`
|
|
767
|
+
|
|
762
768
|
<!--
|
|
763
769
|
Placeholder for the next version (at the beginning of the line):
|
|
764
770
|
### **WORK IN PROGRESS**
|
|
765
771
|
-->
|
|
766
772
|
|
|
767
773
|
## Changelog
|
|
768
|
-
### 6.0.
|
|
774
|
+
### 6.0.3 (2024-06-21)
|
|
769
775
|
* (bluefox) Removed the usage of `withStyles` in favor of `sx` and `style` properties (see [Migration from v5 to v6](#migration-from-v5-to-v6)
|
|
770
776
|
* (bluefox) (BREAKING) Higher version of `@mui/material` (5.15.20) is used
|
|
771
777
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/adapter-react-v5",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.3",
|
|
4
4
|
"description": "React classes to develop admin interfaces for ioBroker with react.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Denis Haev (bluefox)",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"@mui/icons-material": "^5.15.20",
|
|
37
37
|
"@mui/material": "^5.15.20",
|
|
38
38
|
"@mui/x-date-pickers": "^7.7.0",
|
|
39
|
-
"@sentry/browser": "^8.
|
|
39
|
+
"@sentry/browser": "^8.10.0",
|
|
40
40
|
"react-color": "^2.19.3",
|
|
41
41
|
"react-colorful": "^5.6.1",
|
|
42
42
|
"react-cropper": "^2.3.3",
|
|
43
43
|
"react-dropzone": "^14.2.3",
|
|
44
44
|
"react-icons": "^5.2.1",
|
|
45
|
-
"react-inlinesvg": "4.1.3"
|
|
45
|
+
"react-inlinesvg": "^4.1.3"
|
|
46
46
|
}
|
|
47
47
|
}
|