@iobroker/adapter-react-v5 3.1.25 → 3.1.28

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.
Files changed (155) hide show
  1. package/Components/404.d.ts +3 -0
  2. package/Components/ColorPicker.d.ts +138 -0
  3. package/Components/ComplexCron.d.ts +8 -0
  4. package/Components/CustomModal.d.ts +3 -0
  5. package/Components/FileBrowser.d.ts +125 -0
  6. package/Components/FileViewer.d.ts +80 -0
  7. package/Components/FileViewer.js +10 -9
  8. package/Components/FileViewer.js.map +1 -1
  9. package/Components/Icon.d.ts +21 -0
  10. package/Components/IconPicker.d.ts +64 -0
  11. package/Components/IconPicker.js.map +1 -1
  12. package/Components/IconSelector.d.ts +25 -0
  13. package/Components/Image.d.ts +64 -0
  14. package/Components/JsonConfigComponent/ChipInput.d.ts +13 -0
  15. package/Components/JsonConfigComponent/ConfigAlive.d.ts +10 -0
  16. package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +14 -0
  17. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +14 -0
  18. package/Components/JsonConfigComponent/ConfigCRON.d.ts +15 -0
  19. package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +14 -0
  20. package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +14 -0
  21. package/Components/JsonConfigComponent/ConfigChip.d.ts +14 -0
  22. package/Components/JsonConfigComponent/ConfigColor.d.ts +14 -0
  23. package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +14 -0
  24. package/Components/JsonConfigComponent/ConfigCustom.d.ts +26 -0
  25. package/Components/JsonConfigComponent/ConfigCustom.js +4 -3
  26. package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
  27. package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +14 -0
  28. package/Components/JsonConfigComponent/ConfigFile.d.ts +15 -0
  29. package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +3 -0
  30. package/Components/JsonConfigComponent/ConfigFunc.d.ts +14 -0
  31. package/Components/JsonConfigComponent/ConfigGeneric.d.ts +71 -0
  32. package/Components/JsonConfigComponent/ConfigGeneric.js +9 -7
  33. package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
  34. package/Components/JsonConfigComponent/ConfigIP.d.ts +14 -0
  35. package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +14 -0
  36. package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +14 -0
  37. package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +14 -0
  38. package/Components/JsonConfigComponent/ConfigLanguage.d.ts +14 -0
  39. package/Components/JsonConfigComponent/ConfigLanguage.js +1 -1
  40. package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
  41. package/Components/JsonConfigComponent/ConfigNumber.d.ts +3 -0
  42. package/Components/JsonConfigComponent/ConfigNumber.js +33 -11
  43. package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
  44. package/Components/JsonConfigComponent/ConfigObjectId.d.ts +17 -0
  45. package/Components/JsonConfigComponent/ConfigPanel.d.ts +3 -0
  46. package/Components/JsonConfigComponent/ConfigPanel.js +1 -0
  47. package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
  48. package/Components/JsonConfigComponent/ConfigPassword.d.ts +14 -0
  49. package/Components/JsonConfigComponent/ConfigPattern.d.ts +14 -0
  50. package/Components/JsonConfigComponent/ConfigRoom.d.ts +14 -0
  51. package/Components/JsonConfigComponent/ConfigSelect.d.ts +14 -0
  52. package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +17 -0
  53. package/Components/JsonConfigComponent/ConfigSelectSendTo.js +3 -3
  54. package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
  55. package/Components/JsonConfigComponent/ConfigSendto.d.ts +18 -0
  56. package/Components/JsonConfigComponent/ConfigSendto.js +85 -24
  57. package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
  58. package/Components/JsonConfigComponent/ConfigSetState.d.ts +18 -0
  59. package/Components/JsonConfigComponent/ConfigSlider.d.ts +14 -0
  60. package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +14 -0
  61. package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +14 -0
  62. package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +14 -0
  63. package/Components/JsonConfigComponent/ConfigStaticText.d.ts +14 -0
  64. package/Components/JsonConfigComponent/ConfigStaticText.js +45 -4
  65. package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -1
  66. package/Components/JsonConfigComponent/ConfigTable.d.ts +3 -0
  67. package/Components/JsonConfigComponent/ConfigTable.js +36 -25
  68. package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
  69. package/Components/JsonConfigComponent/ConfigTabs.d.ts +33 -0
  70. package/Components/JsonConfigComponent/ConfigText.d.ts +14 -0
  71. package/Components/JsonConfigComponent/ConfigText.js +15 -12
  72. package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
  73. package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +10 -0
  74. package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +14 -0
  75. package/Components/JsonConfigComponent/ConfigTopic.d.ts +17 -0
  76. package/Components/JsonConfigComponent/ConfigUser.d.ts +14 -0
  77. package/Components/JsonConfigComponent/index.d.ts +27 -0
  78. package/Components/JsonConfigComponent/index.js +4 -6
  79. package/Components/JsonConfigComponent/index.js.map +1 -1
  80. package/Components/Loader.d.ts +37 -0
  81. package/Components/Loaders/PT.d.ts +41 -0
  82. package/Components/Loaders/Vendor.d.ts +41 -0
  83. package/Components/Logo.d.ts +59 -0
  84. package/Components/MDUtils.d.ts +12 -0
  85. package/Components/ObjectBrowser.d.ts +632 -0
  86. package/Components/ObjectBrowser.js +57 -12
  87. package/Components/ObjectBrowser.js.map +1 -1
  88. package/Components/Router.d.ts +35 -0
  89. package/Components/SaveCloseButtons.d.ts +64 -0
  90. package/Components/Schedule.d.ts +7 -0
  91. package/Components/SelectWithIcon.d.ts +21 -0
  92. package/Components/SimpleCron/cron2text.d.ts +8 -0
  93. package/Components/SimpleCron/cronText.d.ts +2 -0
  94. package/Components/SimpleCron/index.d.ts +8 -0
  95. package/Components/SimpleCron/jquery.cron.locale.d.ts +2 -0
  96. package/Components/TabContainer.d.ts +42 -0
  97. package/Components/TabContent.d.ts +32 -0
  98. package/Components/TabHeader.d.ts +13 -0
  99. package/Components/TableResize.d.ts +14 -0
  100. package/Components/TextWithIcon.d.ts +3 -0
  101. package/Components/ToggleThemeMenu.d.ts +8 -0
  102. package/Components/TreeTable.d.ts +3 -0
  103. package/Components/UploadImage.d.ts +2 -0
  104. package/Components/Utils.d.ts +334 -0
  105. package/Components/copy-to-clipboard.d.ts +2 -0
  106. package/Components/withWidth.d.ts +2 -0
  107. package/Connection.d.ts +766 -0
  108. package/Connection.js +87 -17
  109. package/Connection.js.map +1 -1
  110. package/Dialogs/ComplexCron.d.ts +15 -0
  111. package/Dialogs/Confirm.d.ts +48 -0
  112. package/Dialogs/Cron.d.ts +15 -0
  113. package/Dialogs/Error.d.ts +49 -0
  114. package/Dialogs/FileSelect.d.ts +148 -0
  115. package/Dialogs/FileSelect.js +2 -1
  116. package/Dialogs/FileSelect.js.map +1 -1
  117. package/Dialogs/Message.d.ts +39 -0
  118. package/Dialogs/SelectID.d.ts +161 -0
  119. package/Dialogs/SimpleCron.d.ts +14 -0
  120. package/Dialogs/TextInput.d.ts +87 -0
  121. package/GenericApp.d.ts +213 -0
  122. package/Prompt.d.ts +5 -0
  123. package/README.md +9 -1
  124. package/Theme.d.ts +7 -0
  125. package/assets/devices/parseNames.d.ts +1 -0
  126. package/assets/rooms/parseNames.d.ts +1 -0
  127. package/i18n/de.json +2 -1
  128. package/i18n/en.json +2 -1
  129. package/i18n/es.json +2 -1
  130. package/i18n/fr.json +2 -1
  131. package/i18n/it.json +2 -1
  132. package/i18n/nl.json +2 -1
  133. package/i18n/pl.json +2 -1
  134. package/i18n/pt.json +2 -1
  135. package/i18n/ru.json +2 -1
  136. package/i18n/zh-cn.json +2 -1
  137. package/i18n.d.ts +92 -0
  138. package/icons/IconAdapter.d.ts +11 -0
  139. package/icons/IconAlias.d.ts +11 -0
  140. package/icons/IconChannel.d.ts +11 -0
  141. package/icons/IconClearFilter.d.ts +11 -0
  142. package/icons/IconClosed.d.ts +11 -0
  143. package/icons/IconCopy.d.ts +38 -0
  144. package/icons/IconDevice.d.ts +11 -0
  145. package/icons/IconDocument.d.ts +11 -0
  146. package/icons/IconDocumentReadOnly.d.ts +11 -0
  147. package/icons/IconExpert.d.ts +38 -0
  148. package/icons/IconFx.d.ts +11 -0
  149. package/icons/IconInstance.d.ts +11 -0
  150. package/icons/IconLogout.d.ts +38 -0
  151. package/icons/IconNoIcon.d.ts +38 -0
  152. package/icons/IconOpen.d.ts +11 -0
  153. package/icons/IconState.d.ts +11 -0
  154. package/index.d.ts +113 -0
  155. package/package.json +8 -8
@@ -0,0 +1,25 @@
1
+ export default IconSelector;
2
+ declare class IconSelector extends React.Component<any, any, any> {
3
+ constructor(props: any);
4
+ state: {
5
+ opened: boolean;
6
+ names: any[];
7
+ filter: string;
8
+ icons: any;
9
+ };
10
+ loadAllIcons(): void;
11
+ render(): JSX.Element;
12
+ }
13
+ declare namespace IconSelector {
14
+ namespace propTypes {
15
+ const icons: PropTypes.Requireable<any[]>;
16
+ const onlyRooms: PropTypes.Requireable<boolean>;
17
+ const onlyDevices: PropTypes.Requireable<boolean>;
18
+ const onSelect: PropTypes.Requireable<(...args: any[]) => any>;
19
+ const onChange: PropTypes.Requireable<(...args: any[]) => any>;
20
+ const t: PropTypes.Validator<(...args: any[]) => any>;
21
+ const lang: PropTypes.Validator<string>;
22
+ }
23
+ }
24
+ import React from "react";
25
+ import PropTypes from "prop-types";
@@ -0,0 +1,64 @@
1
+ export default Image;
2
+ export type ImageProps = {
3
+ /**
4
+ * The color.
5
+ */
6
+ color?: string;
7
+ /**
8
+ * The source of the image.
9
+ */
10
+ src?: string;
11
+ /**
12
+ * The image prefix (default: './files/')
13
+ */
14
+ imagePrefix?: string;
15
+ /**
16
+ * The CSS class name.
17
+ */
18
+ className?: string;
19
+ /**
20
+ * Show image errors (or just show no image)?
21
+ */
22
+ showError?: boolean;
23
+ };
24
+ /**
25
+ * @typedef {object} ImageProps
26
+ * @property {string} [color] The color.
27
+ * @property {string} [src] The source of the image.
28
+ * @property {string} [imagePrefix] The image prefix (default: './files/')
29
+ * @property {string} [className] The CSS class name.
30
+ * @property {boolean} [showError] Show image errors (or just show no image)?
31
+ *
32
+ * @extends {React.Component<ImageProps>}
33
+ */
34
+ declare class Image extends React.Component<ImageProps, any, any> {
35
+ static getDerivedStateFromProps(props: any, state: any): {
36
+ src: any;
37
+ svg: any;
38
+ created: boolean;
39
+ color: any;
40
+ showError: any;
41
+ };
42
+ constructor(props: any);
43
+ state: {
44
+ svg: boolean;
45
+ created: boolean;
46
+ color: string;
47
+ src: string;
48
+ imgError: boolean;
49
+ showError: boolean;
50
+ };
51
+ svg: JSX.Element;
52
+ getSvgFromData(src: any): JSX.Element;
53
+ render(): JSX.Element;
54
+ }
55
+ declare namespace Image {
56
+ namespace propTypes {
57
+ const color: PropTypes.Requireable<string>;
58
+ const src: PropTypes.Validator<string>;
59
+ const className: PropTypes.Requireable<string>;
60
+ const imagePrefix: PropTypes.Requireable<string>;
61
+ }
62
+ }
63
+ import React from "react";
64
+ import PropTypes from "prop-types";
@@ -0,0 +1,13 @@
1
+ declare const _default: React.JSXElementConstructor<any>;
2
+ export default _default;
3
+ export function defaultChipRenderer({ value, text, isFocused, isDisabled, isReadOnly, handleClick, handleDelete, className }: {
4
+ value: any;
5
+ text: any;
6
+ isFocused: any;
7
+ isDisabled: any;
8
+ isReadOnly: any;
9
+ handleClick: any;
10
+ handleDelete: any;
11
+ className: any;
12
+ }, key: any): JSX.Element;
13
+ import React from "react";
@@ -0,0 +1,10 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ data: PropTypes.Validator<object>;
4
+ schema: PropTypes.Requireable<object>;
5
+ adapterName: PropTypes.Requireable<string>;
6
+ instance: PropTypes.Requireable<number>;
7
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"root" | "notAlive"> & object>;
8
+ export default _default;
9
+ import PropTypes from "prop-types";
10
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,15 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ themeType: PropTypes.Requireable<string>;
3
+ themeName: PropTypes.Requireable<string>;
4
+ style: PropTypes.Requireable<object>;
5
+ className: PropTypes.Requireable<string>;
6
+ data: PropTypes.Validator<object>;
7
+ schema: PropTypes.Requireable<object>;
8
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
9
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
10
+ dateFormat: PropTypes.Requireable<string>;
11
+ isFloatComma: PropTypes.Requireable<boolean>;
12
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"button" | "flex" | "fullWidth"> & object>;
13
+ export default _default;
14
+ import PropTypes from "prop-types";
15
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"error"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<never> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"width"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,26 @@
1
+ export default ConfigCustom;
2
+ declare class ConfigCustom extends React.Component<any, any, any> {
3
+ constructor(props: any);
4
+ state: {
5
+ Component: any;
6
+ error: string;
7
+ };
8
+ componentDidMount(): Promise<void>;
9
+ render(): JSX.Element;
10
+ }
11
+ declare namespace ConfigCustom {
12
+ namespace propTypes {
13
+ const socket: PropTypes.Requireable<object>;
14
+ const themeType: PropTypes.Requireable<string>;
15
+ const themeName: PropTypes.Requireable<string>;
16
+ const style: PropTypes.Requireable<object>;
17
+ const className: PropTypes.Requireable<string>;
18
+ const attr: PropTypes.Requireable<string>;
19
+ const data: PropTypes.Validator<object>;
20
+ const schema: PropTypes.Validator<object>;
21
+ const onError: PropTypes.Requireable<(...args: any[]) => any>;
22
+ const onChange: PropTypes.Requireable<(...args: any[]) => any>;
23
+ }
24
+ }
25
+ import React from "react";
26
+ import PropTypes from "prop-types";
@@ -214,9 +214,10 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
214
214
  return _context3.abrupt("return");
215
215
 
216
216
  case 4:
217
- if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {
218
- url = this.props.schema.url;
219
- } else if (this.props.schema.url.startsWith('./')) {
217
+ /*if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {
218
+ url = this.props.schema.url;
219
+ } else */
220
+ if (this.props.schema.url.startsWith('./')) {
220
221
  url = "".concat(window.location.protocol, "//").concat(window.location.host).concat(this.props.schema.url.replace(/^\./, ''));
221
222
  } else {
222
223
  url = "".concat(window.location.protocol, "//").concat(window.location.host, "/adapter/").concat(this.props.adapterName, "/").concat(this.props.schema.url);
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigCustom.js","names":["getOrLoadRemote","remote","shareScope","remoteFallbackUrl","undefined","Promise","resolve","reject","window","existingRemote","document","querySelector","onload","__initialized","__webpack_share_scopes__","init","console","error","onerror","d","script","createElement","type","setAttribute","async","src","getElementsByTagName","appendChild","loadComponent","sharedScope","module","url","container","get","factory","Module","ConfigCustom","props","state","Component","schema","setState","startsWith","location","protocol","host","replace","adapterName","i18n","pos","lastIndexOf","i18nURL","substring","lang","getLanguage","file","fetch","then","data","json","extendTranslations","log","name","split","uniqueName","fileToLoad","componentName","join","component","keys","Object","item","xs","lg","md","sm","assign","marginBottom","textAlign","width","style","themeType","darkStyle","newLine","flexBasis","height","propTypes","socket","PropTypes","object","string","themeName","className","attr","isRequired","onError","func","onChange"],"sources":["JsonConfigComponent/ConfigCustom.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport LinearProgress from '@mui/material/LinearProgress';\nimport Grid from '@mui/material/Grid';\n\nimport i18n from '../../i18n';\nconst getOrLoadRemote = (remote, shareScope, remoteFallbackUrl = undefined) =>\n new Promise((resolve, reject) => {\n // check if remote exists on window\n if (!window[remote]) {\n // search dom to see if remote tag exists, but might still be loading (async)\n const existingRemote = document.querySelector(`script[data-webpack=\"${remote}\"]`);\n // when remote is loaded.\n const onload = async () => {\n // check if it was initialized\n if (window[remote]) {\n if (!window[remote].__initialized) {\n // if share scope doesn't exist (like in webpack 4) then expect shareScope to be a manual object\n if (typeof __webpack_share_scopes__ === 'undefined') {\n // use default share scope object passed in manually\n await window[remote].init(shareScope.default);\n } else {\n // otherwise, init share scope as usual\n // eslint-disable-next-line\n await window[remote].init(__webpack_share_scopes__[shareScope]);\n }\n // mark remote as initialized\n window[remote].__initialized = true;\n }\n } else {\n console.error('Cannot load ' + remote);\n return reject('Cannot load ' + remote);\n }\n // resolve promise so marking remote as loaded\n resolve(window[remote]);\n };\n\n if (existingRemote) {\n // if existing remote but not loaded, hook into its onload and wait for it to be ready\n existingRemote.onload = onload;\n existingRemote.onerror = reject;\n // check if remote fallback exists as param passed to function\n // TODO: should scan public config for a matching key if no override exists\n } else if (remoteFallbackUrl) {\n // inject remote if a fallback exists and call the same onload function\n const d = document;\n const script = d.createElement('script');\n script.type = 'text/javascript';\n // mark as data-webpack so runtime can track it internally\n script.setAttribute('data-webpack', `${remote}`);\n script.async = true;\n script.onerror = reject;\n script.onload = onload;\n script.src = remoteFallbackUrl;\n d.getElementsByTagName('head')[0].appendChild(script);\n } else {\n // no remote and no fallback exist, reject\n reject(`Cannot Find Remote ${remote} to inject`);\n }\n } else {\n // remote already instantiated, resolve\n resolve(window[remote]);\n }\n });\n\nconst loadComponent = (remote, sharedScope, module, url) => async () => {\n const container = await getOrLoadRemote(remote, sharedScope, url);\n const factory = await container.get(module);\n const Module = factory();\n return Module;\n};\n\nclass ConfigCustom extends Component {\n constructor(props) {\n super(props);\n // schema.url - location of Widget\n // schema.name - Component name\n // schema.i18n - i18n\n\n this.state = {\n Component: null,\n error: '',\n };\n }\n\n // load component dynamically\n async componentDidMount() {\n if (!this.props.schema.url) {\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: 'URL is empty. Cannot load custom component!' });\n return;\n }\n\n let url;\n if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {\n url = this.props.schema.url;\n } else if (this.props.schema.url.startsWith('./')) {\n url = `${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\\./, '')}`;\n } else {\n url = `${window.location.protocol}//${window.location.host}/adapter/${this.props.adapterName}/${this.props.schema.url}`;\n }\n\n if (this.props.schema.i18n === true) {\n // load i18n from files\n const pos = url.lastIndexOf('/');\n let i18nURL;\n if (pos !== -1) {\n i18nURL = url.substring(0, pos);\n } else {\n i18nURL = url;\n }\n const lang = i18n.getLanguage();\n const file = `${i18nURL}/i18n/${lang}.json`;\n\n await fetch(file)\n .then(data => data.json())\n .then(json => i18n.extendTranslations(json, lang))\n .catch(error => console.log(`Cannot load i18n \"${file}\": ${error}`));\n } else if (this.props.schema.i18n && typeof this.props.schema.i18n === 'object') {\n try {\n i18n.extendTranslations(this.props.schema.i18n);\n } catch (error) {\n console.error(`Cannot import i18n: ${error}`);\n }\n }\n\n try {\n const [uniqueName, fileToLoad, ...componentName] = this.props.schema.name.split('/');\n console.log(uniqueName, fileToLoad, componentName.join('/'));\n // const component = await window.importFederation(uniqueName, {url, format: 'esm', from: 'vite'}, fileToLoad);\n const component = (await loadComponent(uniqueName, 'default', `./${fileToLoad}`, url)()).default;\n\n if (!component || !component || !component[componentName.join('/')]) {\n const keys = Object.keys(component || {});\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: `Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${keys.join(', ')}` });\n } else {\n this.setState({ Component: component[componentName.join('/')] });\n }\n } catch (error) {\n this.setState({ error: `Cannot import from ${this.props.schema.url}: ${error}` });\n }\n }\n\n render() {\n const Component = this.state.Component;\n\n // render temporary placeholder\n if (!Component) {\n if (this.state.error) {\n return;\n } else {\n const schema = this.props.schema || {};\n\n const item = <Grid\n item\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign({}, {\n marginBottom: 0,\n //marginRight: 8,\n textAlign: 'left',\n width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined\n }, schema.style, this.props.themeType === 'dark' ? schema.darkStyle : {})}>\n {this.state.error ? <div>{this.state.error}</div> : <LinearProgress />}\n </Grid>;\n\n if (schema.newLine) {\n return <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>;\n } else {\n return item;\n }\n }\n }\n\n return <Component {...this.props} />;\n }\n}\n\nConfigCustom.propTypes = {\n socket: PropTypes.object,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n attr: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default ConfigCustom;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;;;;;;;;;AACA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,MAAD,EAASC,UAAT;EAAA,IAAqBC,iBAArB,uEAAyCC,SAAzC;EAAA,OACpB,IAAIC,OAAJ,CAAY,UAACC,O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KAAK,EAAEQ,qBAAA,CAAUC,MAJI;EAKrBG,SAAS,EAAEJ,qBAAA,CAAUE,MALA;EAMrBG,IAAI,EAAEL,qBAAA,CAAUE,MANK;EAOrBhC,IAAI,EAAE8B,qBAAA,CAAUC,MAAV,CAAiBK,UAPF;EAQrBtD,MAAM,EAAEgD,qBAAA,CAAUC,MAAV,CAAiBK,UARJ;EASrBC,OAAO,EAAEP,qBAAA,CAAUQ,IATE;EAUrBC,QAAQ,EAAET,qBAAA,CAAUQ;AAVC,CAAzB;eAae5D,Y"}
1
+ {"version":3,"file":"ConfigCustom.js","names":["getOrLoadRemote","remote","shareScope","remoteFallbackUrl","undefined","Promise","resolve","reject","window","existingRemote","document","querySelector","onload","__initialized","__webpack_share_scopes__","init","console","error","onerror","d","script","createElement","type","setAttribute","async","src","getElementsByTagName","appendChild","loadComponent","sharedScope","module","url","container","get","factory","Module","ConfigCustom","props","state","Component","schema","setState","startsWith","location","protocol","host","replace","adapterName","i18n","pos","lastIndexOf","i18nURL","substring","lang","I18n","getLanguage","file","fetch","then","data","json","extendTranslations","log","name","split","uniqueName","fileToLoad","componentName","join","component","keys","Object","item","xs","lg","md","sm","assign","marginBottom","textAlign","width","style","themeType","darkStyle","newLine","flexBasis","height","propTypes","socket","PropTypes","object","string","themeName","className","attr","isRequired","onError","func","onChange"],"sources":["JsonConfigComponent/ConfigCustom.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport LinearProgress from '@mui/material/LinearProgress';\nimport Grid from '@mui/material/Grid';\n\nimport I18n from '../../i18n';\nconst getOrLoadRemote = (remote, shareScope, remoteFallbackUrl = undefined) =>\n new Promise((resolve, reject) => {\n // check if remote exists on window\n if (!window[remote]) {\n // search dom to see if remote tag exists, but might still be loading (async)\n const existingRemote = document.querySelector(`script[data-webpack=\"${remote}\"]`);\n // when remote is loaded.\n const onload = async () => {\n // check if it was initialized\n if (window[remote]) {\n if (!window[remote].__initialized) {\n // if share scope doesn't exist (like in webpack 4) then expect shareScope to be a manual object\n if (typeof __webpack_share_scopes__ === 'undefined') {\n // use default share scope object passed in manually\n await window[remote].init(shareScope.default);\n } else {\n // otherwise, init share scope as usual\n // eslint-disable-next-line\n await window[remote].init(__webpack_share_scopes__[shareScope]);\n }\n // mark remote as initialized\n window[remote].__initialized = true;\n }\n } else {\n console.error('Cannot load ' + remote);\n return reject('Cannot load ' + remote);\n }\n // resolve promise so marking remote as loaded\n resolve(window[remote]);\n };\n\n if (existingRemote) {\n // if existing remote but not loaded, hook into its onload and wait for it to be ready\n existingRemote.onload = onload;\n existingRemote.onerror = reject;\n // check if remote fallback exists as param passed to function\n // TODO: should scan public config for a matching key if no override exists\n } else if (remoteFallbackUrl) {\n // inject remote if a fallback exists and call the same onload function\n const d = document;\n const script = d.createElement('script');\n script.type = 'text/javascript';\n // mark as data-webpack so runtime can track it internally\n script.setAttribute('data-webpack', `${remote}`);\n script.async = true;\n script.onerror = reject;\n script.onload = onload;\n script.src = remoteFallbackUrl;\n d.getElementsByTagName('head')[0].appendChild(script);\n } else {\n // no remote and no fallback exist, reject\n reject(`Cannot Find Remote ${remote} to inject`);\n }\n } else {\n // remote already instantiated, resolve\n resolve(window[remote]);\n }\n });\n\nconst loadComponent = (remote, sharedScope, module, url) => async () => {\n const container = await getOrLoadRemote(remote, sharedScope, url);\n const factory = await container.get(module);\n const Module = factory();\n return Module;\n};\n\nclass ConfigCustom extends Component {\n constructor(props) {\n super(props);\n // schema.url - location of Widget\n // schema.name - Component name\n // schema.i18n - i18n\n\n this.state = {\n Component: null,\n error: '',\n };\n }\n\n // load component dynamically\n async componentDidMount() {\n if (!this.props.schema.url) {\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: 'URL is empty. Cannot load custom component!' });\n return;\n }\n\n let url;\n /*if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {\n url = this.props.schema.url;\n } else */\n if (this.props.schema.url.startsWith('./')) {\n url = `${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\\./, '')}`;\n } else {\n url = `${window.location.protocol}//${window.location.host}/adapter/${this.props.adapterName}/${this.props.schema.url}`;\n }\n\n if (this.props.schema.i18n === true) {\n // load i18n from files\n const pos = url.lastIndexOf('/');\n let i18nURL;\n if (pos !== -1) {\n i18nURL = url.substring(0, pos);\n } else {\n i18nURL = url;\n }\n const lang = I18n.getLanguage();\n const file = `${i18nURL}/i18n/${lang}.json`;\n\n await fetch(file)\n .then(data => data.json())\n .then(json => I18n.extendTranslations(json, lang))\n .catch(error => console.log(`Cannot load i18n \"${file}\": ${error}`));\n } else if (this.props.schema.i18n && typeof this.props.schema.i18n === 'object') {\n try {\n I18n.extendTranslations(this.props.schema.i18n);\n } catch (error) {\n console.error(`Cannot import i18n: ${error}`);\n }\n }\n\n try {\n const [uniqueName, fileToLoad, ...componentName] = this.props.schema.name.split('/');\n console.log(uniqueName, fileToLoad, componentName.join('/'));\n // const component = await window.importFederation(uniqueName, {url, format: 'esm', from: 'vite'}, fileToLoad);\n const component = (await loadComponent(uniqueName, 'default', `./${fileToLoad}`, url)()).default;\n\n if (!component || !component || !component[componentName.join('/')]) {\n const keys = Object.keys(component || {});\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: `Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${keys.join(', ')}` });\n } else {\n this.setState({ Component: component[componentName.join('/')] });\n }\n } catch (error) {\n this.setState({ error: `Cannot import from ${this.props.schema.url}: ${error}` });\n }\n }\n\n render() {\n const Component = this.state.Component;\n\n // render temporary placeholder\n if (!Component) {\n if (this.state.error) {\n return;\n } else {\n const schema = this.props.schema || {};\n\n const item = <Grid\n item\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign({}, {\n marginBottom: 0,\n //marginRight: 8,\n textAlign: 'left',\n width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined\n }, schema.style, this.props.themeType === 'dark' ? schema.darkStyle : {})}>\n {this.state.error ? <div>{this.state.error}</div> : <LinearProgress />}\n </Grid>;\n\n if (schema.newLine) {\n return <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>;\n } else {\n return item;\n }\n }\n }\n\n return <Component {...this.props} />;\n }\n}\n\nConfigCustom.propTypes = {\n socket: PropTypes.object,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n attr: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default ConfigCustom;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;;;;;;;;;AACA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,MAAD,EAASC,UAAT;EAAA,IAAqBC,iBAArB,uEAAyCC,SAAzC;EAAA,OACpB,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAUC,MAAV,EAAqB;IACjC;IACI,IAAI,CAACC,MAAM,CAACP,MAAD,CAAX,EAAqB;MACjB;MACA,IAAMQ,cAAc,GAAGC,QAAQ,CAACC,aAAT,iCAA+CV,MAA/C,SAAvB,CAFiB,CAGjB;;MACA,IAAMW,MAAM;QAAA,yFAAG;UAAA;YAAA;cAAA;gBAAA;kBAAA,KAEPJ,MAAM,CAACP,MAAD,CAFC;oBAAA;oBAAA;kBAAA;;kBAAA,IAGFO,MAAM,CAACP,MAAD,CAAN,CAAeY,aAHb;oBAAA;oBAAA;kBAAA;;kBAAA,MAKC,OAAOC,wBAAP,KAAoC,WALrC;oBAAA;oBAAA;kBAAA;;kBAAA;kBAAA,OAOON,MAAM,CAACP,MAAD,CAAN,CAAec,IAAf,CAAoBb,UAAU,WAA9B,CAPP;;gBAAA;kBAAA;kBAAA;;gBAAA;kBAAA;kBAAA,OAWOM,MAAM,CAACP,MAAD,CAAN,CAAec,IAAf,CAAoBD,w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AE;gBAAEC,SAAS,EAAE,MAAb;gBAAqBC,MAAM,EAAE;cAA7B;YAAZ,EADG,EAEFd,IAFE,CAAP;UAIH,CALD,MAKO;YACH,OAAOA,IAAP;UACH;QACJ;MACJ;;MAED,oBAAO,gCAAC,SAAD,EAAe,KAAKnC,KAApB,CAAP;IACH;;;EA9GsBE,gB;;AAiH3BH,YAAY,CAACmD,SAAb,GAAyB;EACrBC,MAAM,EAAEC,qBAAA,CAAUC,MADG;EAErBR,SAAS,EAAEO,qBAAA,CAAUE,MAFA;EAGrBC,SAAS,EAAEH,qBAAA,CAAUE,MAHA;EAIrBV,KAAK,EAAEQ,qBAAA,CAAUC,MAJI;EAKrBG,SAAS,EAAEJ,qBAAA,CAAUE,MALA;EAMrBG,IAAI,EAAEL,qBAAA,CAAUE,MANK;EAOrBhC,IAAI,EAAE8B,qBAAA,CAAUC,MAAV,CAAiBK,UAPF;EAQrBvD,MAAM,EAAEiD,qBAAA,CAAUC,MAAV,CAAiBK,UARJ;EASrBC,OAAO,EAAEP,qBAAA,CAAUQ,IATE;EAUrBC,QAAQ,EAAET,qBAAA,CAAUQ;AAVC,CAAzB;eAae7D,Y"}
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"indeterminate"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,15 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ imagePrefix: PropTypes.Requireable<(...args: any[]) => any>;
12
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "fullWidthOneButton" | "selectedImage" | "fullWidthIcon"> & object>;
13
+ export default _default;
14
+ import PropTypes from "prop-types";
15
+ import React from "react";
@@ -0,0 +1,3 @@
1
+ declare const _default: React.JSXElementConstructor<any>;
2
+ export default _default;
3
+ import React from "react";
@@ -0,0 +1,14 @@
1
+ declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
2
+ socket: PropTypes.Validator<object>;
3
+ themeType: PropTypes.Requireable<string>;
4
+ themeName: PropTypes.Requireable<string>;
5
+ style: PropTypes.Requireable<object>;
6
+ className: PropTypes.Requireable<string>;
7
+ data: PropTypes.Validator<object>;
8
+ schema: PropTypes.Requireable<object>;
9
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
10
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
11
+ }>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
12
+ export default _default;
13
+ import PropTypes from "prop-types";
14
+ import React from "react";
@@ -0,0 +1,71 @@
1
+ export default ConfigGeneric;
2
+ declare class ConfigGeneric extends React.Component<any, any, any> {
3
+ static DIFFERENT_VALUE: string;
4
+ static DIFFERENT_LABEL: string;
5
+ static NONE_VALUE: string;
6
+ static NONE_LABEL: string;
7
+ static AsyncFunction: any;
8
+ static getValue(data: any, attr: any): any;
9
+ static setValue(data: any, attr: any, value: any): any;
10
+ constructor(props: any);
11
+ state: {
12
+ confirmDialog: boolean;
13
+ confirmNewValue: any;
14
+ confirmAttr: any;
15
+ confirmData: any;
16
+ };
17
+ isError: {};
18
+ defaultValue: any;
19
+ lang: ioBroker.Languages;
20
+ componentDidMount(): void;
21
+ sendTo(): void;
22
+ defaultSendToDone: boolean;
23
+ componentWillUnmount(): void;
24
+ sendToTimeout: any;
25
+ onUpdate: (data: any) => void;
26
+ getText(text: any, noTranslation: any): any;
27
+ renderConfirmDialog(): JSX.Element;
28
+ onChange(attr: any, newValue: any): void;
29
+ execute(func: any, defaultValue: any, data: any, arrayIndex: any, globalData: any): any;
30
+ executeCustom(func: any, data: any, customObj: any, instanceObj: any, arrayIndex: any, globalData: any): any;
31
+ calculate(schema: any): {
32
+ error: boolean;
33
+ disabled: any;
34
+ hidden: any;
35
+ defaultValue: any;
36
+ };
37
+ onError(attr: any, error: any): void;
38
+ renderItem(error: any, disabled: any, defaultValue: any): any;
39
+ renderHelp(text: any, link: any, noTranslation: any): any;
40
+ getPattern(pattern: any, data: any): any;
41
+ render(): JSX.Element;
42
+ }
43
+ declare namespace ConfigGeneric {
44
+ namespace propTypes {
45
+ const socket: PropTypes.Validator<object>;
46
+ const data: PropTypes.Requireable<object>;
47
+ const originalData: PropTypes.Requireable<object>;
48
+ const schema: PropTypes.Requireable<object>;
49
+ const attr: PropTypes.Requireable<string>;
50
+ const value: PropTypes.Requireable<any>;
51
+ const themeName: PropTypes.Requireable<string>;
52
+ const style: PropTypes.Requireable<object>;
53
+ const onError: PropTypes.Requireable<(...args: any[]) => any>;
54
+ const onChange: PropTypes.Requireable<(...args: any[]) => any>;
55
+ const customs: PropTypes.Requireable<object>;
56
+ const forceUpdate: PropTypes.Validator<(...args: any[]) => any>;
57
+ const disabled: PropTypes.Requireable<boolean>;
58
+ const systemConfig: PropTypes.Requireable<object>;
59
+ const alive: PropTypes.Requireable<boolean>;
60
+ const common: PropTypes.Requireable<object>;
61
+ const adapterName: PropTypes.Requireable<string>;
62
+ const instance: PropTypes.Requireable<number>;
63
+ const dateFormat: PropTypes.Requireable<string>;
64
+ const isFloatComma: PropTypes.Requireable<boolean>;
65
+ const customObj: PropTypes.Requireable<object>;
66
+ const instanceObj: PropTypes.Requireable<object>;
67
+ const custom: PropTypes.Requireable<boolean>;
68
+ }
69
+ }
70
+ import React from "react";
71
+ import PropTypes from "prop-types";
@@ -488,14 +488,17 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
488
488
  target: "_blank",
489
489
  rel: "noreferrer",
490
490
  style: {
491
- color: this.props.themeType === 'dark' ? '#eee' : '#111'
491
+ color: this.props.themeType === 'dark' ? '#a147ff' : '#5b238f',
492
+ textDecoration: 'underline'
492
493
  }
493
494
  }, this.getText(text, noTranslation));
494
495
  }
495
496
  }
496
497
  }, {
497
498
  key: "getPattern",
498
- value: function getPattern(pattern) {
499
+ value: function getPattern(pattern, data) {
500
+ data = data || this.props.data;
501
+
499
502
  if (!pattern) {
500
503
  return '';
501
504
  } else {
@@ -506,14 +509,13 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
506
509
  try {
507
510
  if (this.props.custom) {
508
511
  // eslint-disable-next-line no-new-func
509
- var f = new Function('data', 'originalData', '_system', 'instanceObj', 'customObj', '_socket', 'return `' + pattern.replace(/`/g, '\\`') + '`');
510
- var result = f(this.props.data, this.props.originalData, this.props.systemConfig, this.props.instanceObj, this.props.customObj, this.props.socket);
511
- return result;
512
+ var f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', 'instanceObj', 'customObj', '_socket', 'return `' + pattern.replace(/`/g, '\\`') + '`');
513
+ return f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.instanceObj, this.props.customObj, this.props.socket, this.props.arrayIndex, this.props.globalData);
512
514
  } else {
513
515
  // eslint-disable-next-line no-new-func
514
- var _f = new Function('data', 'originalData', '_system', '_alive', '_common', '_socket', 'return `' + pattern.replace(/`/g, '\\`') + '`');
516
+ var _f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', '_alive', '_common', '_socket', 'return `' + pattern.replace(/`/g, '\\`') + '`');
515
517
 
516
- return _f(this.props.data, this.props.originalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket);
518
+ return _f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket);
517
519
  }
518
520
  } catch (e) {
519
521
  console.error("Cannot execute ".concat(pattern, ": ").concat(e));