@iobroker/adapter-react-v5 4.10.2 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Components/ComplexCron.d.ts +1 -1
- package/Components/CustomModal.d.ts +24 -2
- package/Components/CustomModal.js +77 -145
- package/Components/FileBrowser.d.ts +3 -3
- package/Components/IconSelector.d.ts +28 -22
- package/Components/IconSelector.js +2122 -2073
- package/Components/Loader.d.ts +8 -3
- package/Components/Loader.js +4 -2
- package/Components/Loaders/MV.d.ts +6 -1
- package/Components/Loaders/MV.js +24 -21
- package/Components/Loaders/PT.d.ts +7 -2
- package/Components/Loaders/PT.js +7 -1
- package/Components/Loaders/Vendor.d.ts +7 -2
- package/Components/Loaders/Vendor.js +5 -0
- package/Components/Router.d.ts +11 -22
- package/Components/Router.js +65 -105
- package/Components/SelectWithIcon.d.ts +23 -20
- package/Components/SelectWithIcon.js +143 -204
- package/Components/SimpleCron/index.d.ts +1 -1
- package/Components/TabContainer.d.ts +1 -1
- package/Components/Utils.d.ts +7 -9
- package/Components/Utils.js +2 -5
- package/Components/types.d.ts +0 -53
- package/GenericApp.d.ts +151 -116
- package/GenericApp.js +667 -914
- package/LegacyConnection.d.ts +3 -3
- package/README.md +6 -3
- package/package.json +3 -3
- package/types.d.ts +9 -7
- package/Components/CustomModal.js.map +0 -1
- package/Components/IconSelector.js.map +0 -1
- package/Components/Router.js.map +0 -1
- package/Components/SelectWithIcon.js.map +0 -1
- package/GenericApp.js.map +0 -1
|
@@ -1,214 +1,153 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
7
17
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return {
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const styles_1 = require("@mui/styles");
|
|
31
|
+
const material_1 = require("@mui/material");
|
|
32
|
+
const Icon_1 = __importDefault(require("./Icon"));
|
|
33
|
+
const Utils_1 = __importDefault(require("./Utils"));
|
|
34
|
+
const i18n_1 = __importDefault(require("../i18n"));
|
|
35
|
+
const styles = {
|
|
27
36
|
different: {
|
|
28
|
-
|
|
37
|
+
opacity: 0.5,
|
|
29
38
|
},
|
|
30
39
|
icon: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
};
|
|
40
|
+
width: 16,
|
|
41
|
+
height: 16,
|
|
42
|
+
marginRight: 8,
|
|
43
|
+
},
|
|
36
44
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
class SelectWithIcon extends react_1.Component {
|
|
46
|
+
constructor(props) {
|
|
47
|
+
super(props);
|
|
48
|
+
this.timeout = null;
|
|
49
|
+
if (props.different) {
|
|
50
|
+
this.wordDifferent = props.t('ra___different__');
|
|
51
|
+
}
|
|
52
|
+
let list;
|
|
53
|
+
if (Array.isArray(props.list || props.options)) {
|
|
54
|
+
list = (props.list || props.options)
|
|
55
|
+
.map(obj => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
return ({
|
|
58
|
+
name: Utils_1.default.getObjectNameFromObj(obj, props.lang)
|
|
59
|
+
.replace('system.group.', '')
|
|
60
|
+
.replace('system.user.', '')
|
|
61
|
+
.replace('enum.rooms.', '')
|
|
62
|
+
.replace('enum.functions.', ''),
|
|
63
|
+
value: obj._id,
|
|
64
|
+
icon: (_a = obj.common) === null || _a === void 0 ? void 0 : _a.icon,
|
|
65
|
+
color: (_b = obj.common) === null || _b === void 0 ? void 0 : _b.color,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
list = Object.values((props.list || props.options))
|
|
71
|
+
.map(obj => {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
return ({
|
|
74
|
+
name: Utils_1.default.getObjectNameFromObj(obj, props.lang)
|
|
75
|
+
.replace('system.group.', '')
|
|
76
|
+
.replace('system.user.', '')
|
|
77
|
+
.replace('enum.rooms.', '')
|
|
78
|
+
.replace('enum.functions.', ''),
|
|
79
|
+
value: obj._id,
|
|
80
|
+
icon: (_a = obj.common) === null || _a === void 0 ? void 0 : _a.icon,
|
|
81
|
+
color: (_b = obj.common) === null || _b === void 0 ? void 0 : _b.color,
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (props.different && props.value === props.different) {
|
|
86
|
+
list.unshift({ value: props.different, name: this.wordDifferent || '' });
|
|
87
|
+
}
|
|
88
|
+
if (props.allowNone) {
|
|
89
|
+
list.unshift({ value: '', name: i18n_1.default.t('ra_none') });
|
|
90
|
+
}
|
|
91
|
+
this.state = {
|
|
92
|
+
list,
|
|
65
93
|
};
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
if (_this.props.different && _this.props.value === _this.props.different) {
|
|
69
|
-
list.unshift({
|
|
70
|
-
value: _this.props.different,
|
|
71
|
-
name: _this.wordDifferent
|
|
72
|
-
});
|
|
73
94
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})) {
|
|
92
|
-
this.timeout = this.timeout || setTimeout(function () {
|
|
93
|
-
_this2.timeout = null;
|
|
94
|
-
var list = JSON.parse(JSON.stringify(_this2.state.list));
|
|
95
|
-
list.unshift({
|
|
96
|
-
value: '',
|
|
97
|
-
name: _i18n["default"].t('ra_none')
|
|
98
|
-
});
|
|
99
|
-
_this2.setState({
|
|
100
|
-
list: list
|
|
101
|
-
});
|
|
102
|
-
}, 100);
|
|
103
|
-
} else if (!this.props.allowNone && this.state.list.find(function (obj) {
|
|
104
|
-
return obj.value === '';
|
|
105
|
-
})) {
|
|
106
|
-
this.timeout = this.timeout || setTimeout(function () {
|
|
107
|
-
_this2.timeout = null;
|
|
108
|
-
var list = JSON.parse(JSON.stringify(_this2.state.list));
|
|
109
|
-
var i = _this2.state.list.findIndex(function (obj) {
|
|
110
|
-
return obj.value === '';
|
|
111
|
-
});
|
|
112
|
-
list.splice(i, 1);
|
|
113
|
-
_this2.setState({
|
|
114
|
-
list: list
|
|
115
|
-
});
|
|
116
|
-
}, 100);
|
|
117
|
-
}
|
|
118
|
-
var item = this.state.list.find(function (it) {
|
|
119
|
-
return it.value === _this2.props.value || _this2.props.removePrefix && it.value.replace(_this2.props.removePrefix, '') === _this2.props.value;
|
|
120
|
-
});
|
|
121
|
-
var style = this.props.value === this.props.different ? {} : {
|
|
122
|
-
color: (item === null || item === void 0 ? void 0 : item.color) || undefined,
|
|
123
|
-
backgroundColor: _Utils["default"].getInvertedColor(item === null || item === void 0 ? void 0 : item.color, this.props.themeType)
|
|
124
|
-
};
|
|
125
|
-
if (this.props.dense && this.props.style) {
|
|
126
|
-
Object.assign(style, this.props.style);
|
|
127
|
-
}
|
|
128
|
-
var select = /*#__PURE__*/_react["default"].createElement(_material.Select, {
|
|
129
|
-
variant: "standard",
|
|
130
|
-
disabled: this.props.disabled,
|
|
131
|
-
value: this.props.value,
|
|
132
|
-
inputProps: this.props.inputProps,
|
|
133
|
-
renderValue: function renderValue( /* value */
|
|
134
|
-
) {
|
|
135
|
-
return /*#__PURE__*/_react["default"].createElement("span", null, item !== null && item !== void 0 && item.icon ? /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
136
|
-
src: item === null || item === void 0 ? void 0 : item.icon,
|
|
137
|
-
className: _this2.props.classes.icon
|
|
138
|
-
}) : null, item === null || item === void 0 ? void 0 : item.name);
|
|
139
|
-
},
|
|
140
|
-
classes: {
|
|
141
|
-
root: _Utils["default"].clsx(this.props.value === this.props.different ? this.props.classes.different : '', this.props.dense ? this.props.className : '')
|
|
142
|
-
},
|
|
143
|
-
style: style,
|
|
144
|
-
onChange: function onChange(el) {
|
|
145
|
-
if (_this2.props.different && el.target.value !== _this2.props.different) {
|
|
146
|
-
var pos = null;
|
|
147
|
-
for (var i = 0; i < _this2.state.list.length; i++) {
|
|
148
|
-
if (_this2.state.list[i].value === _this2.props.different) {
|
|
149
|
-
pos = i;
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
if (pos !== null) {
|
|
154
|
-
var list = _Utils["default"].clone(_this2.state.list);
|
|
155
|
-
list.splice(pos, 1);
|
|
156
|
-
_this2.setState({
|
|
157
|
-
list: list
|
|
158
|
-
}, function () {
|
|
159
|
-
return _this2.props.onChange(el.target.value);
|
|
160
|
-
});
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
_this2.props.onChange(_this2.props.removePrefix ? el.target.value.replace(_this2.props.removePrefix, '') : el.target.value);
|
|
95
|
+
render() {
|
|
96
|
+
if (this.props.allowNone && !this.state.list.find(obj => obj.value === '')) {
|
|
97
|
+
this.timeout = this.timeout || setTimeout(() => {
|
|
98
|
+
this.timeout = null;
|
|
99
|
+
const list = JSON.parse(JSON.stringify(this.state.list));
|
|
100
|
+
list.unshift({ value: '', name: i18n_1.default.t('ra_none') });
|
|
101
|
+
this.setState({ list });
|
|
102
|
+
}, 100);
|
|
103
|
+
}
|
|
104
|
+
else if (!this.props.allowNone && this.state.list.find(obj => obj.value === '')) {
|
|
105
|
+
this.timeout = this.timeout || setTimeout(() => {
|
|
106
|
+
this.timeout = null;
|
|
107
|
+
const list = JSON.parse(JSON.stringify(this.state.list));
|
|
108
|
+
const i = this.state.list.findIndex(obj => obj.value === '');
|
|
109
|
+
list.splice(i, 1);
|
|
110
|
+
this.setState({ list });
|
|
111
|
+
}, 100);
|
|
165
112
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
113
|
+
const item = this.state.list.find(it => it.value === this.props.value || (this.props.removePrefix && it.value.replace(this.props.removePrefix, '') === this.props.value));
|
|
114
|
+
const style = this.props.value === this.props.different ? {} : {
|
|
115
|
+
color: (item === null || item === void 0 ? void 0 : item.color) || undefined,
|
|
116
|
+
backgroundColor: Utils_1.default.getInvertedColor((item === null || item === void 0 ? void 0 : item.color) || '', this.props.themeType),
|
|
117
|
+
};
|
|
118
|
+
if (this.props.dense && this.props.style) {
|
|
119
|
+
Object.assign(style, this.props.style);
|
|
120
|
+
}
|
|
121
|
+
const select = react_1.default.createElement(material_1.Select, { variant: "standard", disabled: this.props.disabled, value: this.props.value, inputProps: this.props.inputProps, renderValue: ( /* value */) => react_1.default.createElement("span", null,
|
|
122
|
+
(item === null || item === void 0 ? void 0 : item.icon) ? react_1.default.createElement(Icon_1.default, { src: item === null || item === void 0 ? void 0 : item.icon, className: this.props.classes.icon }) : null, item === null || item === void 0 ? void 0 :
|
|
123
|
+
item.name), classes: {
|
|
124
|
+
root: Utils_1.default.clsx(this.props.value === this.props.different ? this.props.classes.different : '', this.props.dense ? this.props.className : ''),
|
|
125
|
+
}, style: style, onChange: el => {
|
|
126
|
+
if (this.props.different && el.target.value !== this.props.different) {
|
|
127
|
+
let pos = null;
|
|
128
|
+
for (let i = 0; i < this.state.list.length; i++) {
|
|
129
|
+
if (this.state.list[i].value === this.props.different) {
|
|
130
|
+
pos = i;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (pos !== null) {
|
|
135
|
+
const list = Utils_1.default.clone(this.state.list);
|
|
136
|
+
list.splice(pos, 1);
|
|
137
|
+
this.setState({ list }, () => this.props.onChange(el.target.value));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
this.props.onChange(this.props.removePrefix ? el.target.value.replace(this.props.removePrefix, '') : el.target.value);
|
|
142
|
+
} }, this.state.list.map(el => react_1.default.createElement(material_1.MenuItem, { className: this.props.different && el.value === this.props.different ? this.props.classes.different : '', style: this.props.different && el.value === this.props.different ? {} : { color: el.color || undefined, backgroundColor: Utils_1.default.getInvertedColor(el.color || '', this.props.themeType) }, key: el.value, value: el.value },
|
|
143
|
+
el.icon ? react_1.default.createElement(Icon_1.default, { src: el.icon, className: this.props.classes.icon }) : null,
|
|
144
|
+
el.name)));
|
|
145
|
+
if (this.props.dense) {
|
|
146
|
+
return select;
|
|
147
|
+
}
|
|
148
|
+
return react_1.default.createElement(material_1.FormControl, { variant: "standard", fullWidth: !!this.props.fullWidth, style: this.props.style, className: this.props.className },
|
|
149
|
+
react_1.default.createElement(material_1.InputLabel, null, this.props.label),
|
|
150
|
+
select);
|
|
189
151
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}(_react.Component);
|
|
193
|
-
SelectWithIcon.propTypes = {
|
|
194
|
-
t: _propTypes["default"].func.isRequired,
|
|
195
|
-
lang: _propTypes["default"].string.isRequired,
|
|
196
|
-
themeType: _propTypes["default"].string,
|
|
197
|
-
value: _propTypes["default"].string,
|
|
198
|
-
onChange: _propTypes["default"].func.isRequired,
|
|
199
|
-
disabled: _propTypes["default"].bool,
|
|
200
|
-
list: _propTypes["default"].oneOfType([_propTypes["default"].array, _propTypes["default"].object]),
|
|
201
|
-
// one of "list"(Array) or "options"(object) is required
|
|
202
|
-
options: _propTypes["default"].oneOfType([_propTypes["default"].array, _propTypes["default"].object]),
|
|
203
|
-
// one of "list"(Array) or "options"(object) is required
|
|
204
|
-
different: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].bool]),
|
|
205
|
-
label: _propTypes["default"].string,
|
|
206
|
-
fullWidth: _propTypes["default"].bool,
|
|
207
|
-
className: _propTypes["default"].string,
|
|
208
|
-
style: _propTypes["default"].object,
|
|
209
|
-
removePrefix: _propTypes["default"].string,
|
|
210
|
-
allowNone: _propTypes["default"].bool,
|
|
211
|
-
inputProps: _propTypes["default"].object
|
|
212
|
-
};
|
|
213
|
-
var _default = exports["default"] = (0, _styles.withStyles)(styles)(SelectWithIcon);
|
|
214
|
-
//# sourceMappingURL=SelectWithIcon.js.map
|
|
152
|
+
}
|
|
153
|
+
exports.default = (0, styles_1.withStyles)(styles)(SelectWithIcon);
|
|
@@ -2,7 +2,7 @@ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
|
2
2
|
cronExpression: PropTypes.Requireable<string>;
|
|
3
3
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
4
4
|
language: PropTypes.Requireable<string>;
|
|
5
|
-
}>, "classes"> & import("@mui/styles").StyledComponentProps<"
|
|
5
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"mainDiv" | "formControl" | "formControlMarginRight" | "formControlPaddingTop"> & object>;
|
|
6
6
|
export default _default;
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import React from 'react';
|
|
@@ -13,5 +13,5 @@ interface TabContainerProps {
|
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
}
|
|
15
15
|
/** @type {typeof TabContainer} */
|
|
16
|
-
declare const _export: React.JSXElementConstructor<Omit<TabContainerProps, "classes"> & import("@mui/styles").StyledComponentProps<"root" | "
|
|
16
|
+
declare const _export: React.JSXElementConstructor<Omit<TabContainerProps, "classes"> & import("@mui/styles").StyledComponentProps<"root" | "overflowHidden" | "container"> & object>;
|
|
17
17
|
export default _export;
|
package/Components/Utils.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
**/
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import { ThemeName, ThemeType } from "../types";
|
|
8
9
|
interface GetObjectNameOptions {
|
|
9
10
|
name?: ioBroker.StringOrTranslated;
|
|
10
11
|
language?: ioBroker.Languages;
|
|
@@ -213,29 +214,26 @@ declare class Utils {
|
|
|
213
214
|
static clsx(...inputs: clsx.ClassValue[]): string;
|
|
214
215
|
/**
|
|
215
216
|
* Get the current theme name (either from local storage or the browser settings).
|
|
216
|
-
* @param {string} [themeName]
|
|
217
|
-
* @returns {string}
|
|
218
217
|
*/
|
|
219
|
-
static getThemeName(themeName?:
|
|
218
|
+
static getThemeName(themeName?: ThemeName | null): ThemeName;
|
|
220
219
|
/**
|
|
221
220
|
* Get the type of theme.
|
|
222
221
|
*/
|
|
223
|
-
static getThemeType(themeName?:
|
|
222
|
+
static getThemeType(themeName?: ThemeName): ThemeType;
|
|
224
223
|
/**
|
|
225
224
|
* Set the theme name and theme type.
|
|
226
225
|
*/
|
|
227
|
-
static setThemeName(themeName:
|
|
226
|
+
static setThemeName(themeName: ThemeName): void;
|
|
228
227
|
/**
|
|
229
228
|
* Toggle the theme name between 'dark' and 'colored'.
|
|
230
|
-
* @
|
|
231
|
-
* @returns {string} the new theme name.
|
|
229
|
+
* @returns the new theme name.
|
|
232
230
|
*/
|
|
233
|
-
static toggleTheme(themeName:
|
|
231
|
+
static toggleTheme(themeName: ThemeName | null): ThemeName;
|
|
234
232
|
/**
|
|
235
233
|
* Get the list of themes
|
|
236
234
|
* @returns list of possible themes
|
|
237
235
|
*/
|
|
238
|
-
static getThemeNames():
|
|
236
|
+
static getThemeNames(): ThemeName[];
|
|
239
237
|
/**
|
|
240
238
|
* Parse a query string into its parts.
|
|
241
239
|
*/
|
package/Components/Utils.js
CHANGED
|
@@ -1143,10 +1143,8 @@ class Utils {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
/**
|
|
1145
1145
|
* Get the current theme name (either from local storage or the browser settings).
|
|
1146
|
-
* @param {string} [themeName]
|
|
1147
|
-
* @returns {string}
|
|
1148
1146
|
*/
|
|
1149
|
-
static getThemeName(themeName
|
|
1147
|
+
static getThemeName(themeName) {
|
|
1150
1148
|
if (window.vendorPrefix && window.vendorPrefix !== '@@vendorPrefix@@') {
|
|
1151
1149
|
return window.vendorPrefix;
|
|
1152
1150
|
}
|
|
@@ -1175,8 +1173,7 @@ class Utils {
|
|
|
1175
1173
|
}
|
|
1176
1174
|
/**
|
|
1177
1175
|
* Toggle the theme name between 'dark' and 'colored'.
|
|
1178
|
-
* @
|
|
1179
|
-
* @returns {string} the new theme name.
|
|
1176
|
+
* @returns the new theme name.
|
|
1180
1177
|
*/
|
|
1181
1178
|
static toggleTheme(themeName) {
|
|
1182
1179
|
if (window.vendorPrefix && window.vendorPrefix !== '@@vendorPrefix@@') {
|
package/Components/types.d.ts
CHANGED
|
@@ -2,59 +2,6 @@ import { Translator, Width } from '../types';
|
|
|
2
2
|
import Connection from '../Connection';
|
|
3
3
|
import Router from './Router';
|
|
4
4
|
|
|
5
|
-
export interface FileBrowserProps {
|
|
6
|
-
/** The key to identify this component. */
|
|
7
|
-
key?: string;
|
|
8
|
-
/** Additional styling for this component. */
|
|
9
|
-
style?: React.CSSProperties;
|
|
10
|
-
/** The CSS class name. */
|
|
11
|
-
className?: string;
|
|
12
|
-
/** Translation function. */
|
|
13
|
-
t: Translator;
|
|
14
|
-
/** The selected language. */
|
|
15
|
-
lang: ioBroker.Languages;
|
|
16
|
-
/** The socket connection. */
|
|
17
|
-
socket: Connection;
|
|
18
|
-
/** Is the component data ready. */
|
|
19
|
-
ready?: boolean;
|
|
20
|
-
/** Is expert mode enabled? (default: false) */
|
|
21
|
-
expertMode?: boolean;
|
|
22
|
-
/** Show the toolbar? (default: false) */
|
|
23
|
-
showToolbar?: boolean;
|
|
24
|
-
/** If defined, allow selecting only files from this folder and subfolders */
|
|
25
|
-
limitPath?: string;
|
|
26
|
-
/** Allow upload of new files? (default: false) */
|
|
27
|
-
allowUpload?: boolean;
|
|
28
|
-
/** Allow download of files? (default: false) */
|
|
29
|
-
allowDownload?: boolean;
|
|
30
|
-
/** Allow creation of new folders? (default: false) */
|
|
31
|
-
allowCreateFolder?: boolean;
|
|
32
|
-
/** Allow deleting files? (default: false) */
|
|
33
|
-
allowDelete?: boolean;
|
|
34
|
-
/** Allow viewing files? (default: false) */
|
|
35
|
-
allowView?: boolean;
|
|
36
|
-
/** Prefix (default: '.') */
|
|
37
|
-
imagePrefix?: string;
|
|
38
|
-
/** Show the expert button? */
|
|
39
|
-
showExpertButton?: boolean;
|
|
40
|
-
/** Type of view */
|
|
41
|
-
viewType?: 'Table' | 'Tile';
|
|
42
|
-
/** Show the buttons to switch the view from table to tile? (default: false) */
|
|
43
|
-
showViewTypeButton?: boolean;
|
|
44
|
-
/** The ID of the selected file. */
|
|
45
|
-
selected?: string | string[];
|
|
46
|
-
/** The file extensions to show, like ['png', 'svg', 'bmp', 'jpg', 'jpeg', 'gif']. */
|
|
47
|
-
filterFiles?: string[];
|
|
48
|
-
/** The file extension categories to show. */
|
|
49
|
-
filterByType?: 'images' | 'code' | 'txt';
|
|
50
|
-
/** Callback for file selection. */
|
|
51
|
-
onSelect?: (id: string | string[], isDoubleClick?: boolean, isFolder?: boolean) => void;
|
|
52
|
-
/** Theme name */
|
|
53
|
-
themeName?: string;
|
|
54
|
-
/** Theme type. */
|
|
55
|
-
themeType?: 'dark' | 'light';
|
|
56
|
-
}
|
|
57
|
-
|
|
58
5
|
export interface ObjectBrowserTableFilter {
|
|
59
6
|
id?: string;
|
|
60
7
|
name?: string;
|