@iobroker/adapter-react-v5 4.13.10 → 4.13.12

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.
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
- interface Router<P = {}, S = {}> extends React.Component<P, S> {
1
+ import { Component } from 'react';
2
+ interface Router<P = {}, S = {}> extends Component<P, S> {
3
3
  }
4
- declare class Router<P, S> extends React.Component<P, S> {
4
+ declare class Router<P, S> extends Component<P, S> {
5
5
  protected onHashChangedBound: () => void;
6
6
  constructor(props: P);
7
7
  componentDidMount(): void;
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- class Router extends react_1.default.Component {
3
+ const react_1 = require("react");
4
+ class Router extends react_1.Component {
8
5
  constructor(props) {
9
6
  super(props);
10
7
  this.onHashChangedBound = this.onHashChanged.bind(this);
@@ -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" | "overflowHidden" | "container"> & object>;
16
+ declare const _export: React.JSXElementConstructor<Omit<TabContainerProps, "classes"> & import("@mui/styles").StyledComponentProps<"root" | "container" | "overflowHidden"> & object>;
17
17
  export default _export;
@@ -1165,7 +1165,8 @@ class Utils {
1165
1165
  * Set the theme name and theme type.
1166
1166
  */
1167
1167
  static setThemeName(themeName) {
1168
- if (window.vendorPrefix && window.vendorPrefix !== '@@vendorPrefix@@' && window.vendorPrefix !== 'MV') {
1168
+ const vendorPrefix = window.vendorPrefix;
1169
+ if (vendorPrefix && vendorPrefix !== '@@vendorPrefix@@' && vendorPrefix !== 'MV') {
1169
1170
  return; // ignore
1170
1171
  }
1171
1172
  (window._localStorage || window.localStorage).setItem('App.themeName', themeName);
@@ -1,2 +1,3 @@
1
+ import React, { JSXElementConstructor } from 'react';
2
+ declare const withWidth: () => (WrappedComponent: JSXElementConstructor<any>) => (props: Record<string, any>) => React.JSX.Element;
1
3
  export default withWidth;
2
- declare function withWidth(): (WrappedComponent: any) => (props: any) => React.JSX.Element;
@@ -1,35 +1,23 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports["default"] = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
- var _react = _interopRequireDefault(require("react"));
11
- var _styles = require("@mui/material/styles");
12
- var _material = require("@mui/material");
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const styles_1 = require("@mui/material/styles");
8
+ const material_1 = require("@mui/material");
13
9
  function useWidth() {
14
- var theme = (0, _styles.useTheme)();
15
- var keys = (0, _toConsumableArray2["default"])(theme.breakpoints.keys).reverse();
16
- return keys.reduce(function (output, key) {
17
- // eslint-disable-next-line react-hooks/rules-of-hooks
18
- var matches = (0, _material.useMediaQuery)(theme.breakpoints.up(key));
19
- return !output && matches ? key : output;
20
- }, null) || 'xs';
10
+ const theme = (0, styles_1.useTheme)();
11
+ const keys = [...theme.breakpoints.keys].reverse();
12
+ return keys.reduce((output, key) => {
13
+ // eslint-disable-next-line react-hooks/rules-of-hooks
14
+ const matches = (0, material_1.useMediaQuery)(theme.breakpoints.up(key));
15
+ return !output && matches ? key : output;
16
+ }, null) || 'xs';
21
17
  }
22
-
23
18
  // FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
24
- var withWidth = function withWidth() {
25
- return function (WrappedComponent) {
26
- return function (props) {
27
- var width = useWidth();
28
- return /*#__PURE__*/_react["default"].createElement(WrappedComponent, (0, _extends2["default"])({}, props, {
29
- width: width
30
- }));
31
- };
32
- };
19
+ const withWidth = () => (WrappedComponent) => (props) => {
20
+ const width = useWidth();
21
+ return react_1.default.createElement(WrappedComponent, Object.assign({}, props, { width: width }));
33
22
  };
34
- var _default = exports["default"] = withWidth;
35
- //# sourceMappingURL=withWidth.js.map
23
+ exports.default = withWidth;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const _default: (props: any) => React.JSX.Element;
2
+ declare const _default: (props: Record<string, any>) => React.JSX.Element;
3
3
  export default _default;
package/GenericApp.d.ts CHANGED
@@ -146,7 +146,7 @@ declare class GenericApp<TProps extends GenericAppProps = GenericAppProps, TStat
146
146
  * Gets the system configuration.
147
147
  * @returns {Promise<ioBroker.OtherObject>}
148
148
  */
149
- getSystemConfig(): Promise<import("@iobroker/socket-client").SystemConfig>;
149
+ getSystemConfig(): Promise<ioBroker.SystemConfigObject>;
150
150
  /**
151
151
  * Get current expert mode
152
152
  * @returns {boolean}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
- import { type HostInfo } from '@iobroker/js-controller-common/tools';
3
- import { type FilteredNotificationInformation } from '@iobroker/js-controller-common-db/build/lib/common/notificationHandler';
2
+ import { type HostInfo } from '@iobroker/js-controller-common/build/esm/lib/common/tools';
3
+ import { type FilteredNotificationInformation } from '@iobroker/js-controller-common-db/build/esm/lib/common/notificationHandler';
4
4
  /**
5
5
  * Copyright 2020-2024, Denis Haev (bluefox) <dogafox@gmail.com>
6
6
  *
package/README.md CHANGED
@@ -670,6 +670,12 @@ socket.getObjectViewCustom('custom', 'state', 'startKey', 'endKey')
670
670
  -->
671
671
 
672
672
  ## Changelog
673
+ ### 4.13.12 (2024-05-06)
674
+ * (bluefox) All files are migrated to Typescript
675
+
676
+ ### 4.13.11 (2024-04-23)
677
+ * (bluefox) Corrected the size of icons
678
+
673
679
  ### 4.13.10 (2024-04-22)
674
680
  * (bluefox) Migrated all icons to Typescript
675
681
 
package/icons/IconCopy.js CHANGED
@@ -4,6 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
- const IconCopy = (props) => react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", onClick: e => props.onClick && props.onClick(e), width: props.width || (props.fontSize === 'small' ? 16 : 20), height: props.height || props.width || (props.fontSize === 'small' ? 16 : 20), className: props.className, style: props.style },
7
+ const IconCopy = (props) => react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", onClick: e => props.onClick && props.onClick(e), viewBox: "0 0 512 512", width: props.width || (props.fontSize === 'small' ? 16 : 20), height: props.height || props.width || (props.fontSize === 'small' ? 16 : 20), className: props.className, style: props.style },
8
8
  react_1.default.createElement("path", { fill: "currentColor", d: "M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z" }));
9
9
  exports.default = IconCopy;
@@ -5,6 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
7
  // Icon copied from https://github.com/FortAwesome/Font-Awesome/blob/0d1f27efb836eb2ab994ba37221849ed64a73e5c/svgs/regular/
8
- const IconDocument = (props) => react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", onClick: e => props.onClick && props.onClick(e), width: props.width || (props.fontSize === 'small' ? 16 : 20), height: props.height || props.width || (props.fontSize === 'small' ? 16 : 20), className: props.className, style: props.style },
8
+ const IconDocument = (props) => react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", onClick: e => props.onClick && props.onClick(e), width: props.width || (props.fontSize === 'small' ? 16 : 20), height: props.height || props.width || (props.fontSize === 'small' ? 16 : 20), className: props.className, style: props.style },
9
9
  react_1.default.createElement("path", { fill: "currentColor", d: "M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z" }));
10
10
  exports.default = IconDocument;
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
7
  // Icon copied from https://github.com/FortAwesome/Font-Awesome/blob/0d1f27efb836eb2ab994ba37221849ed64a73e5c/svgs/regular/
8
- const IconDocumentReadOnly = (props) => react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", onClick: e => props.onClick && props.onClick(e), width: props.width || (props.fontSize === 'small' ? 16 : 20), height: props.height || props.width || (props.fontSize === 'small' ? 16 : 20), className: props.className, style: props.style },
8
+ const IconDocumentReadOnly = (props) => react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", onClick: e => props.onClick && props.onClick(e), viewBox: "0 0 512 512", width: props.width || (props.fontSize === 'small' ? 16 : 20), height: props.height || props.width || (props.fontSize === 'small' ? 16 : 20), className: props.className, style: props.style },
9
9
  react_1.default.createElement("path", { fill: "currentColor", d: "M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z" }),
10
10
  react_1.default.createElement("path", { fill: "currentColor", stroke: "null", d: "m261,270l-12,0l0,-24c0,-33.12 -26.88,-60 -60,-60s-60,26.88 -60,60l0,24l-12,0c-13.2,0 -24,10.8 -24,24l0,120c0,13.2 10.8,24 24,24l144,0c13.2,0 24,-10.8 24,-24l0,-120c0,-13.2 -10.8,-24 -24,-24zm-72,108c-13.2,0 -24,-10.8 -24,-24s10.8,-24 24,-24s24,10.8 24,24s-10.8,24 -24,24zm37.2,-108l-74.4,0l0,-24c0,-20.52 16.68,-37.2 37.2,-37.2c20.52,0 37.2,16.68 37.2,37.2l0,24z" }));
11
11
  exports.default = IconDocumentReadOnly;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
- const ExpertIcon = (props) => react_1.default.createElement("svg", { onClick: e => props.onClick && props.onClick(e), viewBox: "0 0 486.70625 486", width: props.width || (props.fontSize === 'small' ? 16 : 20), height: props.height || props.width || (props.fontSize === 'small' ? 16 : 20), xmlns: "http://www.w3.org/2000/svg", className: props.className, style: props.style },
7
+ const ExpertIcon = (props) => react_1.default.createElement("svg", { onClick: e => props.onClick && props.onClick(e), viewBox: "0 0 486 486", width: props.width || (props.fontSize === 'small' ? 16 : 20), height: props.height || props.width || (props.fontSize === 'small' ? 16 : 20), xmlns: "http://www.w3.org/2000/svg", className: props.className, style: props.style },
8
8
  react_1.default.createElement("path", { fill: "currentColor", d: "m414.928297,149.715165 c-2.639376,-57.222555 -35.669446,-106.505345 -83.345894,-132.039151 c-3.758948,-2.049842 -7.636885,-3.932022 -11.590542,-5.641125 c-19.303146,-8.394083 -40.607459,-13.050853 -63.004303,-13.050853 c-84.113909,0 -152.791790,65.703174 -157.718988,148.605566 l0.043268,-0.010816 v0.281245 c0,3.061243 -0.146031,16.750306 -0.146031,16.750306 l-2.352723,5.224668 h15.744315 c5.916964,-19.384275 24.078904,-32.635245 45.513024,-32.635245 c26.231510,0 47.573684,21.915481 47.573684,48.146991 c0,26.226103 -21.342174,47.146409 -47.573684,47.146409 c-25.111939,0 -45.734774,-19.735831 -47.443879,-44.658471 h-18.789334 c-0.400232,0 -0.778832,0.638209 -1.162839,0.584122 l-19.762875,55.199753 c-2.774590,7.696379 2.926030,16.214860 11.103771,16.214860 h17.020735 l-0.129805,87.899899 c0,17.356066 14.073071,31.174935 31.429136,31.174935 h56.205745 v82.648189 c0,12.877778 12.937273,22.580734 25.815051,22.580734 h144.597825 c12.877778,0 23.429877,-9.702955 23.429877,-22.580734 v-166.037352 c0,-22.645636 5.976457,-44.761234 16.561008,-64.789128 c11.055093,-20.925714 17.523731,-44.620611 18.129489,-69.792045 c0.027042,-1.260193 0.037858,-2.552839 0.037858,-3.845485 c0,-2.466302 -0.070310,-4.938014 -0.183890,-7.377273 zm-155.393308,-11.731165 h-13.456494 v13.559257 c0,4.732489 -4.267352,8.567157 -8.999842,8.567157 c-4.727079,0 -8.999842,-3.834667 -8.999842,-8.567157 v-13.559257 h-12.185483 c-4.732489,0 -8.567157,-4.267352 -8.567157,-8.999842 c0,-4.727079 3.834667,-8.999842 8.567157,-8.999842 h12.185483 v-12.077311 c0,-4.732489 4.272762,-8.567157 8.999842,-8.567157 c4.732489,0 8.999842,3.834667 8.999842,8.567157 v12.077311 h13.456494 c4.727079,0 8.567157,4.272762 8.567157,8.999842 c0,4.732489 -3.840077,8.999842 -8.567157,8.999842 zm0,0" }),
9
9
  react_1.default.createElement("path", { fill: "currentColor", d: "m187.695312 285.875c3.9375-3.980469 6.414063-9.449219 6.414063-15.523438 0-12.128906-9.855469-21.980468-21.984375-21.980468-6.007812 0-11.472656 2.410156-15.457031 6.347656-4.023438 4.003906-6.523438 9.539062-6.523438 15.636719 0 12.125 9.855469 21.980469 21.980469 21.980469 6.078125 0 11.585938-2.476563 15.570312-6.460938zm0 0" }));
10
10
  exports.default = ExpertIcon;
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as Theme } from './Theme';
2
2
  export * from './Theme';
3
+ export { default as GenericApp } from './GenericApp';
3
4
  export { default as i18n } from './i18n';
4
5
  export { default as I18n } from './i18n';
5
6
  export * from './i18n';
package/index.js CHANGED
@@ -17,14 +17,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.IconState = exports.IconOpen = exports.IconLogout = exports.IconInstance = exports.IconFx = exports.IconExpert = exports.IconDocument = exports.IconDevice = exports.IconCopy = exports.IconClosed = exports.IconChannel = exports.IconAlias = exports.IconAdapter = exports.JsonConfigComponent = exports.LoaderMV = exports.LoaderPT = exports.LoaderVendor = exports.SimpleCron = exports.withWidth = exports.Utils = exports.UploadImage = exports.TreeTable = exports.ToggleThemeMenu = exports.TextWithIcon = exports.TableResize = exports.TabHeader = exports.TabContent = exports.TabContainer = exports.SelectWithIcon = exports.Schedule = exports.SaveCloseButtons = exports.Router = exports.ObjectBrowser = exports.MDUtils = exports.Logo = exports.Loader = exports.Image = exports.IconSelector = exports.IconPicker = exports.Icon = exports.FileViewer = exports.FileBrowser = exports.CustomModal = exports.copy = exports.ComplexCron = exports.ColorPicker = exports.Prompt = exports.I18n = exports.i18n = exports.Theme = void 0;
21
- exports.LegacyConnection = exports.AdminConnection = exports.PROGRESS = exports.Connection = exports.ConfigGeneric = exports.TextInput = exports.SimpleCronDialog = exports.SelectFile = exports.SelectID = exports.Message = exports.Error = exports.Cron = exports.Confirm = exports.ComplexCronDialog = exports.IconClearFilter = exports.IconDocumentReadOnly = exports.IconNoIcon = void 0;
20
+ exports.IconOpen = exports.IconLogout = exports.IconInstance = exports.IconFx = exports.IconExpert = exports.IconDocument = exports.IconDevice = exports.IconCopy = exports.IconClosed = exports.IconChannel = exports.IconAlias = exports.IconAdapter = exports.JsonConfigComponent = exports.LoaderMV = exports.LoaderPT = exports.LoaderVendor = exports.SimpleCron = exports.withWidth = exports.Utils = exports.UploadImage = exports.TreeTable = exports.ToggleThemeMenu = exports.TextWithIcon = exports.TableResize = exports.TabHeader = exports.TabContent = exports.TabContainer = exports.SelectWithIcon = exports.Schedule = exports.SaveCloseButtons = exports.Router = exports.ObjectBrowser = exports.MDUtils = exports.Logo = exports.Loader = exports.Image = exports.IconSelector = exports.IconPicker = exports.Icon = exports.FileViewer = exports.FileBrowser = exports.CustomModal = exports.copy = exports.ComplexCron = exports.ColorPicker = exports.Prompt = exports.I18n = exports.i18n = exports.GenericApp = exports.Theme = void 0;
21
+ exports.LegacyConnection = exports.AdminConnection = exports.PROGRESS = exports.Connection = exports.ConfigGeneric = exports.TextInput = exports.SimpleCronDialog = exports.SelectFile = exports.SelectID = exports.Message = exports.Error = exports.Cron = exports.Confirm = exports.ComplexCronDialog = exports.IconClearFilter = exports.IconDocumentReadOnly = exports.IconNoIcon = exports.IconState = void 0;
22
22
  var Theme_1 = require("./Theme");
23
23
  Object.defineProperty(exports, "Theme", { enumerable: true, get: function () { return __importDefault(Theme_1).default; } });
24
24
  __exportStar(require("./Theme"), exports);
25
- // export { default as GenericApp } from './GenericApp';
25
+ var GenericApp_1 = require("./GenericApp");
26
+ Object.defineProperty(exports, "GenericApp", { enumerable: true, get: function () { return __importDefault(GenericApp_1).default; } });
26
27
  // export * from './GenericApp';
27
- var i18n_1 = require("./i18n");
28
+ var i18n_1 = require("./i18n"); // deprecated
28
29
  Object.defineProperty(exports, "i18n", { enumerable: true, get: function () { return __importDefault(i18n_1).default; } });
29
30
  var i18n_2 = require("./i18n");
30
31
  Object.defineProperty(exports, "I18n", { enumerable: true, get: function () { return __importDefault(i18n_2).default; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/adapter-react-v5",
3
- "version": "4.13.10",
3
+ "version": "4.13.12",
4
4
  "description": "React classes to develop admin interfaces for ioBroker with react.",
5
5
  "author": {
6
6
  "name": "Denis Haev (bluefox)",
@@ -31,16 +31,16 @@
31
31
  "@emotion/styled": "^11.11.5",
32
32
  "@iobroker/dm-utils": "^0.1.9",
33
33
  "@iobroker/json-config": "^6.17.6",
34
- "@iobroker/socket-client": "^2.4.7",
35
- "@iobroker/types": "^5.0.19",
36
- "@iobroker/js-controller-common": "^5.0.19",
37
- "@iobroker/js-controller-common-db": "^5.0.19",
34
+ "@iobroker/socket-client": "^2.4.9",
35
+ "@iobroker/types": "^5.0.20-alpha.0-20240429-12b5c7f4",
36
+ "@iobroker/js-controller-common": "^5.0.20-alpha.0-20240429-12b5c7f4",
37
+ "@iobroker/js-controller-common-db": "^5.0.20-alpha.0-20240429-12b5c7f4",
38
38
  "@mui/icons-material": "^5.15.15",
39
39
  "@mui/material": "5.14.14",
40
40
  "@mui/styles": "5.14.14",
41
- "@mui/x-date-pickers": "^7.2.0",
42
- "@sentry/browser": "^7.111.0",
43
- "@sentry/integrations": "^7.111.0",
41
+ "@mui/x-date-pickers": "^7.3.1",
42
+ "@sentry/browser": "^7.112.2",
43
+ "@sentry/integrations": "^7.112.2",
44
44
  "react-color": "^2.19.3",
45
45
  "react-colorful": "^5.6.1",
46
46
  "react-cropper": "^2.3.3",