@iobroker/dm-gui-components 0.0.2 → 0.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/DeviceList.d.ts CHANGED
@@ -4,7 +4,7 @@ import Communication, { CommunicationProps, CommunicationState } from './Communi
4
4
  interface DeviceListProps extends CommunicationProps {
5
5
  uploadImagesToInstance?: string;
6
6
  filter?: string;
7
- empbedded?: boolean;
7
+ embedded?: boolean;
8
8
  title?: string;
9
9
  style: React.CSSProperties;
10
10
  }
@@ -33,7 +33,7 @@ export default class DeviceList extends Communication<DeviceListProps, DeviceLis
33
33
  private lastPropsFilter;
34
34
  private lastInstance;
35
35
  private filterTimeout;
36
- private language;
36
+ private readonly language;
37
37
  constructor(props: DeviceListProps);
38
38
  componentDidMount(): Promise<void>;
39
39
  componentWillUnmount(): void;
package/DeviceList.js CHANGED
@@ -67,7 +67,7 @@ class DeviceList extends Communication_1.default {
67
67
  });
68
68
  }
69
69
  // @ts-ignore
70
- Object.assing(this.state, {
70
+ Object.assign(this.state, {
71
71
  devices: [],
72
72
  filteredDevices: [],
73
73
  filter: '',
@@ -81,7 +81,7 @@ class DeviceList extends Communication_1.default {
81
81
  this.language = adapter_react_v5_1.I18n.getLanguage();
82
82
  }
83
83
  async componentDidMount() {
84
- if (!this.props.empbedded) {
84
+ if (!this.props.embedded) {
85
85
  try {
86
86
  // check if instance is alive
87
87
  const alive = await this.props.socket.getState(`system.adapter.${this.props.selectedInstance}.alive`);
@@ -106,7 +106,7 @@ class DeviceList extends Communication_1.default {
106
106
  }
107
107
  }
108
108
  componentWillUnmount() {
109
- if (!this.props.empbedded) {
109
+ if (!this.props.embedded) {
110
110
  this.props.socket.unsubscribeState(`system.adapter.${this.props.selectedInstance}.alive`, this.aliveHandler);
111
111
  }
112
112
  }
@@ -129,7 +129,7 @@ class DeviceList extends Communication_1.default {
129
129
  return text;
130
130
  }
131
131
  applyFilter() {
132
- const filter = this.props.empbedded ? this.props.filter : this.state.filter;
132
+ const filter = this.props.embedded ? this.props.filter : this.state.filter;
133
133
  // filter devices name
134
134
  if (filter) {
135
135
  const filteredDevices = this.state.devices.filter(device => this.getText(device.name).toLowerCase().includes(filter.toLowerCase()));
@@ -154,16 +154,16 @@ class DeviceList extends Communication_1.default {
154
154
  const emptyStyle = {
155
155
  padding: 25,
156
156
  };
157
- if (this.props.empbedded && this.lastPropsFilter !== this.props.filter) {
157
+ if (this.props.embedded && this.lastPropsFilter !== this.props.filter) {
158
158
  this.lastPropsFilter = this.props.filter;
159
159
  setTimeout(() => this.applyFilter(), 50);
160
160
  }
161
- if (this.props.empbedded && this.lastInstance !== this.props.selectedInstance) {
161
+ if (this.props.embedded && this.lastInstance !== this.props.selectedInstance) {
162
162
  this.lastInstance = this.props.selectedInstance;
163
163
  setTimeout(() => this.loadData().catch(console.error), 50);
164
164
  }
165
165
  let list;
166
- if (!this.props.empbedded && !this.state.alive) {
166
+ if (!this.props.embedded && !this.state.alive) {
167
167
  list = react_1.default.createElement("div", { style: emptyStyle },
168
168
  react_1.default.createElement("span", null, (0, Utils_1.getTranslation)('instanceNotAlive')));
169
169
  }
@@ -178,7 +178,7 @@ class DeviceList extends Communication_1.default {
178
178
  else {
179
179
  list = this.state.filteredDevices.map(device => react_1.default.createElement(DeviceCard_1.default, { key: device.id, id: device.id, title: this.getText(device.name), device: device, instanceId: this.props.selectedInstance, uploadImagesToInstance: this.props.uploadImagesToInstance, deviceHandler: this.deviceHandler, controlHandler: this.controlHandler, controlStateHandler: this.controlStateHandler, socket: this.props.socket }));
180
180
  }
181
- if (this.props.empbedded) {
181
+ if (this.props.embedded) {
182
182
  return list;
183
183
  }
184
184
  return react_1.default.createElement("div", { style: { width: '100%', height: '100%', overflow: 'hidden' } },
package/README.md CHANGED
@@ -20,7 +20,7 @@ render() {
20
20
  -->
21
21
 
22
22
  ## Changelog
23
- ### 0.0.2 (2023-12-12)
23
+ ### 0.0.3 (2023-12-12)
24
24
  * (bluefox) initial commit
25
25
 
26
26
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/dm-gui-components",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "ReactJS components to develop admin interface for ioBroker device manager.",
5
5
  "author": {
6
6
  "name": "Jey Cee",