@iobroker/adapter-react-v5 6.0.16 → 6.0.18
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.
|
@@ -355,12 +355,11 @@ export declare class ObjectBrowserClass extends Component<ObjectBrowserProps, Ob
|
|
|
355
355
|
#private;
|
|
356
356
|
private info;
|
|
357
357
|
private localStorage;
|
|
358
|
-
private lastSelectedItems;
|
|
359
358
|
private lastAppliedFilter;
|
|
360
359
|
private readonly tableRef;
|
|
361
360
|
private readonly filterRefs;
|
|
362
361
|
private pausedSubscribes;
|
|
363
|
-
private
|
|
362
|
+
private selectFirst;
|
|
364
363
|
private root;
|
|
365
364
|
private readonly states;
|
|
366
365
|
private subscribes;
|
|
@@ -2187,18 +2187,18 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2187
2187
|
this.localStorage.removeItem(`${this.props.dialogName || 'App'}.table`);
|
|
2188
2188
|
this.forceUpdate();
|
|
2189
2189
|
};
|
|
2190
|
-
const
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
this.
|
|
2190
|
+
const lastSelectedItemStr = this.localStorage.getItem(`${props.dialogName || 'App'}.objectSelected`) || '';
|
|
2191
|
+
if (lastSelectedItemStr.startsWith('[')) {
|
|
2192
|
+
try {
|
|
2193
|
+
const lastSelectedItems = JSON.parse(lastSelectedItemStr);
|
|
2194
|
+
this.selectFirst = lastSelectedItems[0] || '';
|
|
2195
|
+
}
|
|
2196
|
+
catch (e) {
|
|
2197
|
+
// ignore
|
|
2195
2198
|
}
|
|
2196
|
-
// remove empty items
|
|
2197
|
-
this.lastSelectedItems = this.lastSelectedItems.filter((id) => id);
|
|
2198
2199
|
}
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
this.lastSelectedItems = [];
|
|
2200
|
+
else {
|
|
2201
|
+
this.selectFirst = lastSelectedItemStr;
|
|
2202
2202
|
}
|
|
2203
2203
|
let expanded;
|
|
2204
2204
|
const expandedStr = this.localStorage.getItem(`${props.dialogName || 'App'}.objectExpanded`) || '[]';
|
|
@@ -2256,7 +2256,7 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2256
2256
|
selected = props.selected;
|
|
2257
2257
|
}
|
|
2258
2258
|
selected = selected.map(id => id.replace(/["']/g, '')).filter(id => id);
|
|
2259
|
-
this.
|
|
2259
|
+
this.selectFirst = selected.length && selected[0] ? selected[0] : this.selectFirst;
|
|
2260
2260
|
const columnsStr = this.localStorage.getItem(`${props.dialogName || 'App'}.columns`);
|
|
2261
2261
|
let columns;
|
|
2262
2262
|
try {
|
|
@@ -2588,19 +2588,19 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
2588
2588
|
*/
|
|
2589
2589
|
onAfterSelect(isDouble) {
|
|
2590
2590
|
var _b;
|
|
2591
|
-
this.
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
if (this.
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2591
|
+
if (((_b = this.state.selected) === null || _b === void 0 ? void 0 : _b.length) && this.state.selected[0]) {
|
|
2592
|
+
this.localStorage.setItem(`${this.props.dialogName || 'App'}.objectSelected`, this.state.selected[0]);
|
|
2593
|
+
// remove a task to select the pre-selected item if now we want to see another object
|
|
2594
|
+
if (this.selectFirst && this.selectFirst !== this.state.selected[0]) {
|
|
2595
|
+
this.selectFirst = '';
|
|
2596
|
+
}
|
|
2597
|
+
if (this.state.selected.length === 1 && this.objects[this.state.selected[0]]) {
|
|
2598
|
+
const name = Utils_1.default.getObjectName(this.objects, this.state.selected[0], null, { language: this.props.lang });
|
|
2599
|
+
this.props.onSelect && this.props.onSelect(this.state.selected, name, isDouble);
|
|
2599
2600
|
}
|
|
2600
2601
|
}
|
|
2601
2602
|
else {
|
|
2602
2603
|
this.localStorage.removeItem(`${this.props.dialogName || 'App'}.objectSelected`);
|
|
2603
|
-
this.selectedFound = true;
|
|
2604
2604
|
if (this.state.selected.length) {
|
|
2605
2605
|
this.setState({ selected: [] }, () => this.props.onSelect && this.props.onSelect([], ''));
|
|
2606
2606
|
}
|
|
@@ -5040,22 +5040,18 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5040
5040
|
* Called when component is updated.
|
|
5041
5041
|
*/
|
|
5042
5042
|
componentDidUpdate() {
|
|
5043
|
-
var _b, _c, _d, _e, _f, _g;
|
|
5044
|
-
if (!this.selectedFound && !((_b = this.state.selected) === null || _b === void 0 ? void 0 : _b.length) && !((_c = this.lastSelectedItems) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
5045
|
-
this.selectedFound = true;
|
|
5046
|
-
}
|
|
5047
5043
|
if (this.tableRef.current) {
|
|
5048
5044
|
const scrollBarWidth = this.tableRef.current.offsetWidth - this.tableRef.current.clientWidth;
|
|
5049
5045
|
if (this.state.scrollBarWidth !== scrollBarWidth) {
|
|
5050
5046
|
setTimeout(() => this.setState({ scrollBarWidth }), 100);
|
|
5051
5047
|
}
|
|
5052
|
-
else if (
|
|
5053
|
-
|
|
5054
|
-
this.scrollToItem(((_f = this.state.selected) === null || _f === void 0 ? void 0 : _f[0]) || ((_g = this.lastSelectedItems) === null || _g === void 0 ? void 0 : _g[0]));
|
|
5048
|
+
else if (this.selectFirst) {
|
|
5049
|
+
this.scrollToItem(this.selectFirst);
|
|
5055
5050
|
}
|
|
5056
5051
|
}
|
|
5057
5052
|
}
|
|
5058
5053
|
scrollToItem(id) {
|
|
5054
|
+
this.selectFirst = '';
|
|
5059
5055
|
const node = window.document.getElementById(id);
|
|
5060
5056
|
node &&
|
|
5061
5057
|
node.scrollIntoView({
|
|
@@ -5063,7 +5059,6 @@ class ObjectBrowserClass extends react_1.Component {
|
|
|
5063
5059
|
block: 'center',
|
|
5064
5060
|
inline: 'center',
|
|
5065
5061
|
});
|
|
5066
|
-
this.selectedFound = true;
|
|
5067
5062
|
}
|
|
5068
5063
|
renderCustomDialog() {
|
|
5069
5064
|
if (this.state.customDialog && this.props.objectCustomDialog) {
|
package/README.md
CHANGED
|
@@ -781,7 +781,10 @@ The best practice is to replace `padding` with `p` and `margin` with `m`, so you
|
|
|
781
781
|
-->
|
|
782
782
|
|
|
783
783
|
## Changelog
|
|
784
|
-
### 6.0.
|
|
784
|
+
### 6.0.18 (2024-07-14)
|
|
785
|
+
* (bluefox) added some packages for federation
|
|
786
|
+
|
|
787
|
+
### 6.0.17 (2024-07-14)
|
|
785
788
|
* (bluefox) Allowed playing mp3 files in the file browser
|
|
786
789
|
* (bluefox) Corrected jump by object selection
|
|
787
790
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
const paths = require('react-scripts/config/paths');
|
|
3
3
|
|
|
4
4
|
const getModuleFederationConfigPath = (additionalPaths = []) => {
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const fs = require('fs');
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
const fs = require('node:fs');
|
|
7
7
|
const appDirectory = fs.realpathSync(process.cwd());
|
|
8
8
|
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
|
|
9
9
|
|