@iobroker/json-config 7.0.1 → 7.0.2

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 (167) hide show
  1. package/build/JsonConfig.d.ts +45 -5
  2. package/build/JsonConfig.js +13 -14
  3. package/build/JsonConfig.js.map +1 -1
  4. package/build/JsonConfigComponent/ChipInput.d.ts +78 -12
  5. package/build/JsonConfigComponent/ChipInput.js +47 -31
  6. package/build/JsonConfigComponent/ChipInput.js.map +1 -1
  7. package/build/JsonConfigComponent/ConfigAccordion.d.ts +21 -3
  8. package/build/JsonConfigComponent/ConfigAccordion.js +24 -21
  9. package/build/JsonConfigComponent/ConfigAccordion.js.map +1 -1
  10. package/build/JsonConfigComponent/ConfigAlive.d.ts +11 -3
  11. package/build/JsonConfigComponent/ConfigAlive.js +3 -4
  12. package/build/JsonConfigComponent/ConfigAlive.js.map +1 -1
  13. package/build/JsonConfigComponent/ConfigAutocomplete.d.ts +6 -3
  14. package/build/JsonConfigComponent/ConfigAutocomplete.js +2 -8
  15. package/build/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
  16. package/build/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +12 -3
  17. package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js +2 -8
  18. package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
  19. package/build/JsonConfigComponent/ConfigCRON.d.ts +13 -14
  20. package/build/JsonConfigComponent/ConfigCRON.js +9 -23
  21. package/build/JsonConfigComponent/ConfigCRON.js.map +1 -1
  22. package/build/JsonConfigComponent/ConfigCertCollection.d.ts +9 -3
  23. package/build/JsonConfigComponent/ConfigCertCollection.js +2 -9
  24. package/build/JsonConfigComponent/ConfigCertCollection.js.map +1 -1
  25. package/build/JsonConfigComponent/ConfigCertificateSelect.d.ts +12 -3
  26. package/build/JsonConfigComponent/ConfigCertificateSelect.js +2 -8
  27. package/build/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
  28. package/build/JsonConfigComponent/ConfigCertificates.d.ts +21 -3
  29. package/build/JsonConfigComponent/ConfigCertificates.js +6 -7
  30. package/build/JsonConfigComponent/ConfigCertificates.js.map +1 -1
  31. package/build/JsonConfigComponent/ConfigCheckLicense.d.ts +39 -2
  32. package/build/JsonConfigComponent/ConfigCheckLicense.js +23 -24
  33. package/build/JsonConfigComponent/ConfigCheckLicense.js.map +1 -1
  34. package/build/JsonConfigComponent/ConfigCheckbox.d.ts +5 -3
  35. package/build/JsonConfigComponent/ConfigCheckbox.js +3 -9
  36. package/build/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
  37. package/build/JsonConfigComponent/ConfigChip.d.ts +10 -13
  38. package/build/JsonConfigComponent/ConfigChip.js +12 -24
  39. package/build/JsonConfigComponent/ConfigChip.js.map +1 -1
  40. package/build/JsonConfigComponent/ConfigColor.js.map +1 -1
  41. package/build/JsonConfigComponent/ConfigCoordinates.d.ts +13 -4
  42. package/build/JsonConfigComponent/ConfigCoordinates.js +4 -5
  43. package/build/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
  44. package/build/JsonConfigComponent/ConfigCustom.d.ts +6 -6
  45. package/build/JsonConfigComponent/ConfigCustom.js +5 -8
  46. package/build/JsonConfigComponent/ConfigCustom.js.map +1 -1
  47. package/build/JsonConfigComponent/ConfigFile.d.ts +19 -14
  48. package/build/JsonConfigComponent/ConfigFile.js +12 -23
  49. package/build/JsonConfigComponent/ConfigFile.js.map +1 -1
  50. package/build/JsonConfigComponent/ConfigFileSelector.d.ts +49 -2
  51. package/build/JsonConfigComponent/ConfigFileSelector.js +29 -37
  52. package/build/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
  53. package/build/JsonConfigComponent/ConfigFunc.d.ts +17 -13
  54. package/build/JsonConfigComponent/ConfigFunc.js +3 -21
  55. package/build/JsonConfigComponent/ConfigFunc.js.map +1 -1
  56. package/build/JsonConfigComponent/ConfigGeneric.d.ts +7 -8
  57. package/build/JsonConfigComponent/ConfigGeneric.js +21 -5
  58. package/build/JsonConfigComponent/ConfigGeneric.js.map +1 -1
  59. package/build/JsonConfigComponent/ConfigIP.d.ts +18 -13
  60. package/build/JsonConfigComponent/ConfigIP.js +6 -22
  61. package/build/JsonConfigComponent/ConfigIP.js.map +1 -1
  62. package/build/JsonConfigComponent/ConfigImageSendTo.d.ts +16 -9
  63. package/build/JsonConfigComponent/ConfigImageSendTo.js +11 -23
  64. package/build/JsonConfigComponent/ConfigImageSendTo.js.map +1 -1
  65. package/build/JsonConfigComponent/ConfigImageUpload.d.ts +18 -13
  66. package/build/JsonConfigComponent/ConfigImageUpload.js +6 -27
  67. package/build/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
  68. package/build/JsonConfigComponent/ConfigInstanceSelect.d.ts +19 -13
  69. package/build/JsonConfigComponent/ConfigInstanceSelect.js +7 -23
  70. package/build/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
  71. package/build/JsonConfigComponent/ConfigInterface.d.ts +16 -13
  72. package/build/JsonConfigComponent/ConfigInterface.js +7 -23
  73. package/build/JsonConfigComponent/ConfigInterface.js.map +1 -1
  74. package/build/JsonConfigComponent/ConfigJsonEditor.d.ts +14 -12
  75. package/build/JsonConfigComponent/ConfigJsonEditor.js +11 -23
  76. package/build/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
  77. package/build/JsonConfigComponent/ConfigLanguage.d.ts +15 -3
  78. package/build/JsonConfigComponent/ConfigLanguage.js +2 -8
  79. package/build/JsonConfigComponent/ConfigLanguage.js.map +1 -1
  80. package/build/JsonConfigComponent/ConfigLicense.d.ts +19 -21
  81. package/build/JsonConfigComponent/ConfigLicense.js +8 -17
  82. package/build/JsonConfigComponent/ConfigLicense.js.map +1 -1
  83. package/build/JsonConfigComponent/ConfigNumber.d.ts +15 -3
  84. package/build/JsonConfigComponent/ConfigNumber.js +3 -4
  85. package/build/JsonConfigComponent/ConfigNumber.js.map +1 -1
  86. package/build/JsonConfigComponent/ConfigObjectId.d.ts +14 -16
  87. package/build/JsonConfigComponent/ConfigObjectId.js +9 -28
  88. package/build/JsonConfigComponent/ConfigObjectId.js.map +1 -1
  89. package/build/JsonConfigComponent/ConfigPanel.d.ts +11 -3
  90. package/build/JsonConfigComponent/ConfigPanel.js +31 -35
  91. package/build/JsonConfigComponent/ConfigPanel.js.map +1 -1
  92. package/build/JsonConfigComponent/ConfigPassword.d.ts +16 -13
  93. package/build/JsonConfigComponent/ConfigPassword.js +10 -23
  94. package/build/JsonConfigComponent/ConfigPassword.js.map +1 -1
  95. package/build/JsonConfigComponent/ConfigPattern.d.ts +8 -19
  96. package/build/JsonConfigComponent/ConfigPattern.js +2 -14
  97. package/build/JsonConfigComponent/ConfigPattern.js.map +1 -1
  98. package/build/JsonConfigComponent/ConfigPort.d.ts +23 -3
  99. package/build/JsonConfigComponent/ConfigPort.js +2 -10
  100. package/build/JsonConfigComponent/ConfigPort.js.map +1 -1
  101. package/build/JsonConfigComponent/ConfigRoom.d.ts +17 -13
  102. package/build/JsonConfigComponent/ConfigRoom.js +4 -22
  103. package/build/JsonConfigComponent/ConfigRoom.js.map +1 -1
  104. package/build/JsonConfigComponent/ConfigSelect.d.ts +19 -13
  105. package/build/JsonConfigComponent/ConfigSelect.js +22 -24
  106. package/build/JsonConfigComponent/ConfigSelect.js.map +1 -1
  107. package/build/JsonConfigComponent/ConfigSelectSendTo.d.ts +17 -3
  108. package/build/JsonConfigComponent/ConfigSelectSendTo.js +7 -7
  109. package/build/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
  110. package/build/JsonConfigComponent/ConfigSendto.d.ts +16 -3
  111. package/build/JsonConfigComponent/ConfigSendto.js +3 -9
  112. package/build/JsonConfigComponent/ConfigSendto.js.map +1 -1
  113. package/build/JsonConfigComponent/ConfigSetState.d.ts +11 -17
  114. package/build/JsonConfigComponent/ConfigSetState.js +8 -25
  115. package/build/JsonConfigComponent/ConfigSetState.js.map +1 -1
  116. package/build/JsonConfigComponent/ConfigSlider.d.ts +14 -13
  117. package/build/JsonConfigComponent/ConfigSlider.js +8 -21
  118. package/build/JsonConfigComponent/ConfigSlider.js.map +1 -1
  119. package/build/JsonConfigComponent/ConfigStaticDivider.d.ts +9 -13
  120. package/build/JsonConfigComponent/ConfigStaticDivider.js +16 -27
  121. package/build/JsonConfigComponent/ConfigStaticDivider.js.map +1 -1
  122. package/build/JsonConfigComponent/ConfigStaticHeader.d.ts +9 -13
  123. package/build/JsonConfigComponent/ConfigStaticHeader.js +14 -26
  124. package/build/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
  125. package/build/JsonConfigComponent/ConfigStaticImage.d.ts +9 -13
  126. package/build/JsonConfigComponent/ConfigStaticImage.js +4 -23
  127. package/build/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
  128. package/build/JsonConfigComponent/ConfigStaticText.d.ts +9 -13
  129. package/build/JsonConfigComponent/ConfigStaticText.js +10 -23
  130. package/build/JsonConfigComponent/ConfigStaticText.js.map +1 -1
  131. package/build/JsonConfigComponent/ConfigTable.d.ts +54 -3
  132. package/build/JsonConfigComponent/ConfigTable.js +51 -44
  133. package/build/JsonConfigComponent/ConfigTable.js.map +1 -1
  134. package/build/JsonConfigComponent/ConfigTabs.d.ts +9 -3
  135. package/build/JsonConfigComponent/ConfigTabs.js +17 -7
  136. package/build/JsonConfigComponent/ConfigTabs.js.map +1 -1
  137. package/build/JsonConfigComponent/ConfigText.d.ts +13 -3
  138. package/build/JsonConfigComponent/ConfigText.js +4 -5
  139. package/build/JsonConfigComponent/ConfigText.js.map +1 -1
  140. package/build/JsonConfigComponent/ConfigTextSendTo.d.ts +12 -3
  141. package/build/JsonConfigComponent/ConfigTextSendTo.js +2 -3
  142. package/build/JsonConfigComponent/ConfigTextSendTo.js.map +1 -1
  143. package/build/JsonConfigComponent/ConfigTimePicker.js +1 -1
  144. package/build/JsonConfigComponent/ConfigTimePicker.js.map +1 -1
  145. package/build/JsonConfigComponent/ConfigTopic.d.ts +10 -16
  146. package/build/JsonConfigComponent/ConfigTopic.js +5 -31
  147. package/build/JsonConfigComponent/ConfigTopic.js.map +1 -1
  148. package/build/JsonConfigComponent/ConfigUser.d.ts +17 -13
  149. package/build/JsonConfigComponent/ConfigUser.js +7 -23
  150. package/build/JsonConfigComponent/ConfigUser.js.map +1 -1
  151. package/build/JsonConfigComponent/index.d.ts +7 -8
  152. package/build/JsonConfigComponent/index.js +11 -7
  153. package/build/JsonConfigComponent/index.js.map +1 -1
  154. package/build/JsonConfigComponent/wrapper/Components/CustomModal.d.ts +22 -2
  155. package/build/JsonConfigComponent/wrapper/Components/CustomModal.js +14 -42
  156. package/build/JsonConfigComponent/wrapper/Components/CustomModal.js.map +1 -1
  157. package/build/JsonConfigComponent/wrapper/Components/Editor.d.ts +13 -2
  158. package/build/JsonConfigComponent/wrapper/Components/Editor.js +2 -3
  159. package/build/JsonConfigComponent/wrapper/Components/Editor.js.map +1 -1
  160. package/build/Utils.d.ts +2 -1
  161. package/build/Utils.js +31 -0
  162. package/build/Utils.js.map +1 -1
  163. package/build/index.d.ts +2 -2
  164. package/build/index.js +2 -2
  165. package/build/index.js.map +1 -1
  166. package/build/types.d.ts +278 -7
  167. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigStaticHeader.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigStaticHeader.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACrB,MAAM,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI;QACtC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY;QACzC,OAAO,EA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AO,oBAAC,GAAG,IAAC,SAAS,EAAC,IAAI,EAAC,EAAE,EAAE,MAAM,CAAC,MAAM,IACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CACpE,CAAC;QACf,CAAC;IACL,CAAC;CACJ;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,14 +1,10 @@
1
- declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, keyof import("./ConfigGeneric").ConfigGenericProps> & Pick<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
- }>, "style"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "DeviceManager" | "adapterName" | "alive" | "arrayIndex" | "attr" | "changeLanguage" | "changed" | "classes" | "commandRunning" | "common" | "custom" | "customObj" | "customs" | "dateFormat" | "disabled" | "forceUpdate" | "globalData" | "imagePrefix" | "index" | "instance" | "instanceObj" | "isFloatComma" | "isParentTab" | "multiEdit" | "onCommandRunning" | "originalData" | "registerOnForceUpdate" | "systemConfig" | "table">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
12
- export default _default;
13
- import PropTypes from 'prop-types';
14
1
  import React from 'react';
2
+ import type { ConfigItemStaticImage } from '#JC/types';
3
+ import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
+ interface ConfigInstanceSelectProps extends ConfigGenericProps {
5
+ schema: ConfigItemStaticImage;
6
+ }
7
+ declare class ConfigStaticImage extends ConfigGeneric<ConfigInstanceSelectProps, ConfigGenericState> {
8
+ renderItem(): React.JSX.Element;
9
+ }
10
+ export default ConfigStaticImage;
@@ -1,15 +1,7 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { withStyles } from '@mui/styles';
4
- import ConfigGeneric from './ConfigGeneric';
5
- const styles = () => ({
6
- fullWidth: {
7
- height: '100%',
8
- width: '100%',
9
- },
10
- });
2
+ import ConfigGeneric, {} from './ConfigGeneric';
11
3
  class ConfigStaticImage extends ConfigGeneric {
12
- renderItem() {
4
+ renderItem( /* error: string, disabled: boolean, defaultValue */) {
13
5
  let src = this.props.schema.src;
14
6
  if (src && !src.startsWith('.') &&
15
7
  !src.startsWith('http') &&
@@ -18,19 +10,8 @@ class ConfigStaticImage extends ConfigGeneric {
18
10
  src = `adapter/${this.props.adapterName}/${src}`;
19
11
  }
20
12
  // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
21
- return React.createElement("img", { className: this.props.classes.fullWidth, src: src, style: this.props.schema.href ? { cursor: 'pointer' } : {}, onClick: this.props.schema.href ? () => this.props.schema.href && window.open(this.props.schema.href, '_blank') : null, alt: "" });
13
+ return React.createElement("img", { src: src, style: { cursor: this.props.schema.href ? 'pointer' : undefined, width: '100%', height: '100%' }, onClick: this.props.schema.href ? () => this.props.schema.href && window.open(this.props.schema.href, '_blank') : null, alt: "" });
22
14
  }
23
15
  }
24
- ConfigStaticImage.propTypes = {
25
- socket: PropTypes.object.isRequired,
26
- themeType: PropTypes.string,
27
- themeName: PropTypes.string,
28
- style: PropTypes.object,
29
- className: PropTypes.string,
30
- data: PropTypes.object.isRequired,
31
- schema: PropTypes.object,
32
- onError: PropTypes.func,
33
- onChange: PropTypes.func,
34
- };
35
- export default withStyles(styles)(ConfigStaticImage);
16
+ export default ConfigStaticImage;
36
17
  //# sourceMappingURL=ConfigStaticImage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigStaticImage.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigSta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AAG,WAAW,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,GAAG,EAAE,CAAC;QACrD,CAAC;QAED,2EAA2E;QAC3E,OAAO,6BACH,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAChG,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EACtH,GAAG,EAAC,EAAE,GACR,CAAC;IACP,CAAC;CACJ;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,14 +1,10 @@
1
- declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, keyof import("./ConfigGeneric").ConfigGenericProps> & Pick<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
- }>, "style"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "DeviceManager" | "adapterName" | "alive" | "arrayIndex" | "attr" | "changeLanguage" | "changed" | "classes" | "commandRunning" | "common" | "custom" | "customObj" | "customs" | "dateFormat" | "disabled" | "forceUpdate" | "globalData" | "imagePrefix" | "index" | "instance" | "instanceObj" | "isFloatComma" | "isParentTab" | "multiEdit" | "onCommandRunning" | "originalData" | "registerOnForceUpdate" | "systemConfig" | "table">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "link"> & object>;
12
- export default _default;
13
- import PropTypes from 'prop-types';
14
1
  import React from 'react';
2
+ import type { ConfigItemStaticText } from '#JC/types';
3
+ import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
+ interface ConfigInstanceSelectProps extends ConfigGenericProps {
5
+ schema: ConfigItemStaticText;
6
+ }
7
+ declare class ConfigStaticText extends ConfigGeneric<ConfigInstanceSelectProps, ConfigGenericState> {
8
+ renderItem(error: string, disabled: boolean): React.JSX.Element;
9
+ }
10
+ export default ConfigStaticText;
@@ -1,25 +1,23 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { withStyles } from '@mui/styles';
4
- import { Button } from '@mui/material';
2
+ import { Box, Button } from '@mui/material';
5
3
  import { Utils } from '@iobroker/adapter-react-v5';
6
- import ConfigGeneric from './ConfigGeneric';
7
- const styles = theme => ({
4
+ import ConfigGeneric, {} from './ConfigGeneric';
5
+ const styles = {
8
6
  fullWidth: {
9
7
  height: '100%',
10
8
  width: '100%',
11
9
  },
12
- link: {
10
+ link: (theme) => ({
13
11
  textDecoration: 'underline',
14
12
  color: theme.palette.mode === 'dark' ? '#4dabf5' : '#254e72',
15
13
  cursor: 'pointer',
16
- },
17
- });
14
+ }),
15
+ };
18
16
  class ConfigStaticText extends ConfigGeneric {
19
- renderItem(error, disabled) {
17
+ renderItem(error, disabled /* , defaultValue */) {
20
18
  if (this.props.schema.button) {
21
19
  const icon = this.getIcon();
22
- return React.createElement(Button, { variant: this.props.schema.variant || undefined, color: this.props.schema.color || 'grey', className: this.props.classes.fullWidth, disabled: disabled, startIcon: icon, onClick: this.props.schema.href ? () => {
20
+ return React.createElement(Button, { variant: this.props.schema.variant || undefined, color: this.props.schema.color || 'grey', style: styles.fullWidth, disabled: disabled, startIcon: icon, onClick: this.props.schema.href ? () => {
23
21
  // calculate one more time just before call
24
22
  const href = this.props.schema.href ? this.getText(this.props.schema.href, true) : null;
25
23
  href && window.open(href, '_blank');
@@ -29,23 +27,12 @@ class ConfigStaticText extends ConfigGeneric {
29
27
  if (text && (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))) {
30
28
  text = Utils.renderTextWithA(text);
31
29
  }
32
- return React.createElement("span", { className: this.props.schema.href ? this.props.classes.link : '', onClick: this.props.schema.href ? () => {
30
+ return React.createElement(Box, { component: "span", sx: this.props.schema.href ? styles.link : undefined, onClick: this.props.schema.href ? () => {
33
31
  // calculate one more time just before call
34
32
  const href = this.props.schema.href ? this.getText(this.props.schema.href, true) : null;
35
33
  href && window.open(href, '_blank');
36
34
  } : null }, text);
37
35
  }
38
36
  }
39
- ConfigStaticText.propTypes = {
40
- socket: PropTypes.object.isRequired,
41
- themeType: PropTypes.string,
42
- themeName: PropTypes.string,
43
- style: PropTypes.object,
44
- className: PropTypes.string,
45
- data: PropTypes.object.isRequired,
46
- schema: PropTypes.object,
47
- onError: PropTypes.func,
48
- onChange: PropTypes.func,
49
- };
50
- export default withStyles(styles)(ConfigStaticText);
37
+ export default ConfigStaticText;
51
38
  //# sourceMappingURL=ConfigStaticText.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigStaticText.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigStaticText.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACrB,SAAS,EAA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,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YACzG,IAAI,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,oBAAC,GAAG,IACP,SAAS,EAAC,MAAM,EAChB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACpD,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE;gBACnC,2CAA2C;gBAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;gBACxF,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YACxC,CAAC,CAAC,CAAC,CAAC,IAAI,IAEP,IAAI,CACH,CAAC;IACX,CAAC;CACJ;AAED,eAAe,gBAAgB,CAAC"}
@@ -1,8 +1,59 @@
1
1
  import React from 'react';
2
2
  import type { ConfigItemTable } from '#JC/types';
3
- import { type ConfigGenericProps } from './ConfigGeneric';
3
+ import ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';
4
4
  interface ConfigTableProps extends ConfigGenericProps {
5
5
  schema: ConfigItemTable;
6
6
  }
7
- declare const _default: React.JSXElementConstructor<Omit<ConfigTableProps, "classes"> & import("@mui/styles").StyledComponentProps<string> & object>;
8
- export default _default;
7
+ interface ConfigTableState extends ConfigGenericState {
8
+ value: Record<string, any>[];
9
+ visibleValue: number[] | null;
10
+ orderBy: string;
11
+ order: 'asc' | 'desc';
12
+ iteration: number;
13
+ filterOn: string[];
14
+ errorMessage: string;
15
+ showImportDialog: boolean;
16
+ showTypeOfImportDialog: Record<string, any>[] | false;
17
+ instanceObj: ioBroker.InstanceObject;
18
+ customObj: Record<string, any>;
19
+ uploadFile: boolean | 'dragging';
20
+ icon: boolean;
21
+ }
22
+ declare class ConfigTable extends ConfigGeneric<ConfigTableProps, ConfigTableState> {
23
+ private readonly filterRefs;
24
+ private typingTimer;
25
+ private secret;
26
+ constructor(props: ConfigTableProps);
27
+ /**
28
+ * React lifecycle hook, called once as component is mounted
29
+ */
30
+ componentDidMount(): Promise<void>;
31
+ componentWillUnmount(): void;
32
+ itemTable(attrItem: string, data: Record<string, any>, idx: number): React.JSX.Element;
33
+ /**
34
+ * Validate that columns configured in `uniqueColumns` have unique values
35
+ */
36
+ validateUniqueProps(): void;
37
+ static descendingComparator(a: Record<string, any>, b: Record<string, any>, orderBy: string): number;
38
+ static getComparator(order: 'desc' | 'asc', orderBy: string): (a: Record<string, any>, b: Record<string, any>) => number;
39
+ static getFilterValue(el: React.RefObject<HTMLInputElement>): string;
40
+ static setFilterValue(el: React.RefObject<HTMLInputElement>, filterValue: string): string;
41
+ handleRequestSort: (property: string, orderCheck?: boolean) => void;
42
+ stableSort: (order: "desc" | "asc", orderBy: string) => Record<string, any>[];
43
+ enhancedTableHead(buttonsWidth: number, doAnyFilterSet: boolean): React.JSX.Element;
44
+ onDelete: (index: number) => () => void;
45
+ onExport(): void;
46
+ onImport(text: string): void;
47
+ onClone: (index: number) => () => void;
48
+ onChangeWrapper: (newValue: Record<string, any>[], updateVisible?: boolean) => void;
49
+ onAdd: () => void;
50
+ isAnyFilterSet(): boolean;
51
+ applyFilter: (clear?: boolean, value?: Record<string, any>[], cb?: () => void) => void;
52
+ onMoveUp(idx: number): void;
53
+ onMoveDown(idx: number): void;
54
+ onDrop(acceptedFiles: File[]): void;
55
+ showTypeOfImportDialog(): React.JSX.Element;
56
+ showImportDialog(): React.JSX.Element;
57
+ renderItem(): React.JSX.Element;
58
+ }
59
+ export default ConfigTable;
@@ -1,14 +1,13 @@
1
1
  import React, { createRef } from 'react';
2
- import { /* lighten, */ withStyles } from '@mui/styles';
3
2
  import Dropzone from 'react-dropzone';
4
3
  import { Button, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, InputAdornment, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TableSortLabel, TextField, Toolbar, Tooltip, Typography, FormHelperText, } from '@mui/material';
5
4
  import { Add as AddIcon, Delete as DeleteIcon, Close as CloseIcon, ArrowUpward as UpIcon, ArrowDownward as DownIcon, FilterAlt as IconFilterOn, FilterAltOff as IconFilterOff, ContentCopy as CopyContentIcon, Download as ExportIcon, Warning as ErrorIcon, UploadFile as ImportIcon, Close as IconClose, } from '@mui/icons-material';
6
- import { Utils, I18n } from '@iobroker/adapter-react-v5';
5
+ import { I18n } from '@iobroker/adapter-react-v5';
7
6
  import ConfigGeneric, {} from './ConfigGeneric';
8
7
  // eslint-disable-next-line import/no-cycle
9
8
  import ConfigPanel from './ConfigPanel';
10
9
  const MAX_SIZE = 1024 * 1024; // 1MB
11
- const styles = (theme) => ({
10
+ const styles = {
12
11
  fullWidth: {
13
12
  width: '100%',
14
13
  },
@@ -17,7 +16,7 @@ const styles = (theme) => ({
17
16
  },
18
17
  paper: {
19
18
  width: '100%',
20
- marginBottom: theme.spacing(2),
19
+ marginBottom: 16,
21
20
  backgroundColor: 'rgba(255, 255, 255, 0.1)',
22
21
  },
23
22
  headerText: {
@@ -41,21 +40,21 @@ const styles = (theme) => ({
41
40
  display: 'flex',
42
41
  justifyContent: 'space-between',
43
42
  },
44
- highlight: theme.palette.mode === 'light'
45
- ? {
46
- color: theme.palette.secondary.main,
47
- // backgroundColor: lighten(theme.palette.secondary.light, 0.85),
48
- }
49
- : {
50
- color: theme.palette.text.primary,
51
- backgroundColor: theme.palette.secondary.dark,
52
- },
43
+ // highlight: (theme: IobTheme) => (theme.palette.mode === 'light'
44
+ // ? {
45
+ // color: theme.palette.secondary.main,
46
+ // // backgroundColor: lighten(theme.palette.secondary.light, 0.85),
47
+ // }
48
+ // : {
49
+ // color: theme.palette.text.primary,
50
+ // backgroundColor: theme.palette.secondary.dark,
51
+ // }),
53
52
  title: {
54
53
  flex: '1 1 100%',
55
54
  },
56
55
  rootTool: {
57
- paddingLeft: theme.spacing(2),
58
- paddingRight: theme.spacing(1),
56
+ paddingLeft: 16,
57
+ paddingRight: 8,
59
58
  },
60
59
  silver: {
61
60
  opacity: 0.2,
@@ -141,7 +140,10 @@ const styles = (theme) => ({
141
140
  border: '2px solid red',
142
141
  boxSizing: 'border-box',
143
142
  },
144
- });
143
+ tooltip: {
144
+ pointerEvents: 'none',
145
+ },
146
+ };
145
147
  function objectToArray(object, nameOfFirstAttr, nameOfSecondAttr) {
146
148
  nameOfFirstAttr = nameOfFirstAttr || 'key';
147
149
  const array = [];
@@ -258,7 +260,7 @@ class ConfigTable extends ConfigGeneric {
258
260
  [attrItem]: schemaForAttribute,
259
261
  },
260
262
  };
261
- return React.createElement(ConfigPanel, { index: idx + this.state.iteration, arrayIndex: idx, changed: this.props.changed, globalData: this.props.data, socket: this.props.socket, adapterName: this.props.adapterName, instance: this.props.instance, common: this.props.common, alive: this.props.alive, themeType: this.props.themeType, themeName: this.props.themeName, data: data, table: true, custom: true, schema: schemaItem, systemConfig: this.props.systemConfig, dateFormat: this.props.dateFormat, isFloatComma: this.props.isFloatComma, imagePrefix: this.props.imagePrefix, onCommandRunning: this.props.onCommandRunning, forceUpdate: this.props.forceUpdate, originalData: this.props.originalData, customs: this.props.customs, onChange: (attr, valueChange) => {
263
+ return React.createElement(ConfigPanel, { index: idx + this.state.iteration, arrayIndex: idx, changed: this.props.changed, globalData: this.props.data, socket: this.props.socket, adapterName: this.props.adapterName, instance: this.props.instance, common: this.props.common, alive: this.props.alive, themeType: this.props.themeType, themeName: this.props.themeName, data: data, table: true, custom: true, schema: schemaItem, systemConfig: this.props.systemConfig, dateFormat: this.props.dateFormat, isFloatComma: this.props.isFloatComma, imagePrefix: this.props.imagePrefix, onCommandRunning: this.props.onCommandRunning, forceUpdate: this.props.forceUpdate, originalData: this.props.originalData, customs: this.props.customs, theme: this.props.theme, onChange: (attr, valueChange) => {
262
264
  const newObj = JSON.parse(JSON.stringify(value));
263
265
  newObj[idx][attr] = valueChange;
264
266
  this.setState({ value: newObj }, () => {
@@ -336,17 +338,17 @@ class ConfigTable extends ConfigGeneric {
336
338
  return stabilizedThis.map(el => el.el);
337
339
  };
338
340
  enhancedTableHead(buttonsWidth, doAnyFilterSet) {
339
- const { schema, classes } = this.props;
341
+ const { schema } = this.props;
340
342
  const { order, orderBy } = this.state;
341
343
  return React.createElement(TableHead, null,
342
344
  React.createElement(TableRow, null,
343
345
  schema.items && schema.items.map((headCell, i) => React.createElement(TableCell, { style: { width: typeof headCell.width === 'string' && headCell.width.endsWith('%') ? headCell.width : headCell.width }, key: `${headCell.attr}_${i}`, align: "left", sortDirection: orderBy === headCell.attr ? order : false },
344
- React.createElement("div", { className: classes.flex, style: schema.showFirstAddOnTop ? { flexDirection: 'column' } : undefined },
345
- !i && !schema.noDelete ? React.createElement(Tooltip, { title: doAnyFilterSet ? I18n.t('ra_Cannot add items with set filter') : I18n.t('ra_Add row') },
346
+ React.createElement("div", { style: { ...styles.flex, ...(schema.showFirstAddOnTop ? { flexDirection: 'column' } : undefined) } },
347
+ !i && !schema.noDelete ? React.createElement(Tooltip, { title: doAnyFilterSet ? I18n.t('ra_Cannot add items with set filter') : I18n.t('ra_Add row'), componentsProps: { popper: { sx: styles.tooltip } } },
346
348
  React.createElement("span", null,
347
349
  React.createElement(IconButton, { size: "small", color: "primary", disabled: !!doAnyFilterSet && !this.props.schema.allowAddByFilter, onClick: this.onAdd },
348
350
  React.createElement(AddIcon, null)))) : null,
349
- headCell.sort && React.createElement(TableSortLabel, { active: true, className: Utils.clsx(orderBy !== headCell.attr && classes.silver), direction: orderBy === headCell.attr ? order : 'asc', onClick: () => this.handleRequestSort(headCell.attr) }),
351
+ headCell.sort && React.createElement(TableSortLabel, { active: true, style: orderBy !== headCell.attr ? styles.silver : undefined, direction: orderBy === headCell.attr ? order : 'asc', onClick: () => this.handleRequestSort(headCell.attr) }),
350
352
  headCell.filter && this.state.filterOn.includes(headCell.attr) ?
351
353
  React.createElement(TextField, { variant: "standard", ref: this.filterRefs[headCell.attr], onChange: () => this.applyFilter(), title: I18n.t('ra_You can filter entries by entering here some text'), InputProps: {
352
354
  endAdornment: ConfigTable.getFilterValue(this.filterRefs[headCell.attr]) && React.createElement(InputAdornment, { position: "end" },
@@ -356,7 +358,7 @@ class ConfigTable extends ConfigGeneric {
356
358
  } },
357
359
  React.createElement(CloseIcon, null))),
358
360
  }, fullWidth: true, placeholder: this.getText(headCell.title) })
359
- : React.createElement("span", { className: this.props.classes.headerText }, this.getText(headCell.title)),
361
+ : React.createElement("span", { style: styles.headerText }, this.getText(headCell.title)),
360
362
  headCell.filter ? React.createElement(IconButton, { title: I18n.t('ra_Show/hide filter input'), size: "small", onClick: () => {
361
363
  const filterOn = [...this.state.filterOn];
362
364
  const pos = this.state.filterOn.indexOf(headCell.attr);
@@ -652,59 +654,64 @@ class ConfigTable extends ConfigGeneric {
652
654
  else {
653
655
  this.onDrop(acceptedFiles);
654
656
  }
655
- } }, ({ getRootProps, getInputProps }) => React.createElement("div", { className: Utils.clsx(this.props.classes.uploadDiv, this.state.uploadFile === 'dragging' && this.props.classes.uploadDivDragging, this.props.classes.dropZone, !this.state.icon && this.props.classes.dropZoneEmpty), ...getRootProps() },
657
+ } }, ({ getRootProps, getInputProps }) => React.createElement("div", { style: {
658
+ ...styles.uploadDiv,
659
+ ...(this.state.uploadFile === 'dragging' ? styles.uploadDivDragging : undefined),
660
+ ...styles.dropZone,
661
+ ...(!this.state.icon ? styles.dropZoneEmpty : undefined),
662
+ }, ...getRootProps() },
656
663
  React.createElement("input", { ...getInputProps() }),
657
- React.createElement("div", { className: Utils.clsx(this.props.classes.uploadCenterDiv) },
658
- React.createElement("div", { className: this.props.classes.uploadCenterTextAndIcon },
659
- React.createElement(ImportIcon, { className: this.props.classes.uploadCenterIcon }),
660
- React.createElement("div", { className: this.props.classes.uploadCenterText }, this.state.uploadFile === 'dragging' ? I18n.t('ra_Drop file here') :
664
+ React.createElement("div", { style: styles.uploadCenterDiv },
665
+ React.createElement("div", { style: styles.uploadCenterTextAndIcon },
666
+ React.createElement(ImportIcon, { style: styles.uploadCenterIcon }),
667
+ React.createElement("div", { style: styles.uploadCenterText }, this.state.uploadFile === 'dragging' ? I18n.t('ra_Drop file here') :
661
668
  I18n.t('ra_Place your files here or click here to open the browse dialog'))))))),
662
669
  React.createElement(DialogActions, null,
663
670
  React.createElement(Button, { variant: "contained", onClick: () => this.setState({ showImportDialog: false }), color: "primary", startIcon: React.createElement(IconClose, null) }, I18n.t('Cancel'))));
664
671
  }
665
672
  renderItem( /* error, disabled, defaultValue */) {
666
- const { classes, schema } = this.props;
673
+ const { schema } = this.props;
667
674
  let { visibleValue } = this.state;
668
675
  if (!this.state.value) {
669
676
  return null;
670
677
  }
671
678
  visibleValue = visibleValue || this.state.value.map((_, i) => i);
672
679
  const doAnyFilterSet = this.isAnyFilterSet();
673
- return React.createElement(Paper, { className: classes.paper },
680
+ return React.createElement(Paper, { style: styles.paper },
674
681
  this.showImportDialog(),
675
682
  this.showTypeOfImportDialog(),
676
- schema.label ? React.createElement("div", { className: classes.label },
677
- React.createElement(Toolbar, { variant: "dense", className: classes.rootTool },
678
- React.createElement(Typography, { className: classes.title, variant: "h6", id: "tableTitle", component: "div" }, this.getText(schema.label)))) : null,
683
+ schema.label ? React.createElement("div", { style: styles.label },
684
+ React.createElement(Toolbar, { variant: "dense", style: styles.rootTool },
685
+ React.createElement(Typography, { style: styles.title, variant: "h6", id: "tableTitle", component: "div" }, this.getText(schema.label)))) : null,
679
686
  React.createElement(TableContainer, null,
680
- React.createElement(Table, { className: classes.table, size: "small" },
687
+ React.createElement(Table, { style: styles.table, size: "small" },
681
688
  this.enhancedTableHead(!doAnyFilterSet && !this.state.orderBy ? 120 : 64, doAnyFilterSet),
682
689
  React.createElement(TableBody, null,
683
690
  visibleValue.map((idx, i) => React.createElement(TableRow, { hover: true, key: `${idx}_${i}` },
684
691
  schema.items && schema.items.map((headCell) => React.createElement(TableCell, { key: `${headCell.attr}_${idx}`, align: "left" }, this.itemTable(headCell.attr, this.state.value[idx], idx))),
685
- !schema.noDelete && React.createElement(TableCell, { align: "left", className: classes.buttonCell },
686
- !doAnyFilterSet && !this.state.orderBy ? (i ? React.createElement(Tooltip, { title: I18n.t('ra_Move up') },
692
+ !schema.noDelete && React.createElement(TableCell, { align: "left", style: styles.buttonCell },
693
+ !doAnyFilterSet && !this.state.orderBy ? (i ? React.createElement(Tooltip, { title: I18n.t('ra_Move up'), componentsProps: { popper: { sx: styles.tooltip } } },
687
694
  React.createElement(IconButton, { size: "small", onClick: () => this.onMoveUp(idx) },
688
- React.createElement(UpIcon, null))) : React.createElement("div", { className: classes.buttonEmpty })) : null,
689
- !doAnyFilterSet && !this.state.orderBy ? (i < visibleValue.length - 1 ? React.createElement(Tooltip, { title: I18n.t('ra_Move down') },
695
+ React.createElement(UpIcon, null))) : React.createElement("div", { style: styles.buttonEmpty })) : null,
696
+ !doAnyFilterSet && !this.state.orderBy ? (i < visibleValue.length - 1 ? React.createElement(Tooltip, { title: I18n.t('ra_Move down'), componentsProps: { popper: { sx: styles.tooltip } } },
690
697
  React.createElement(IconButton, { size: "small", onClick: () => this.onMoveDown(idx) },
691
- React.createElement(DownIcon, null))) : React.createElement("div", { className: classes.buttonEmpty })) : null,
692
- React.createElement(Tooltip, { title: I18n.t('ra_Delete current row') },
698
+ React.createElement(DownIcon, null))) : React.createElement("div", { style: styles.buttonEmpty })) : null,
699
+ React.createElement(Tooltip, { title: I18n.t('ra_Delete current row'), componentsProps: { popper: { sx: styles.tooltip } } },
693
700
  React.createElement(IconButton, { size: "small", onClick: this.onDelete(idx) },
694
701
  React.createElement(DeleteIcon, null))),
695
- this.props.schema.clone ? React.createElement(Tooltip, { title: I18n.t('ra_Clone current row') },
702
+ this.props.schema.clone ? React.createElement(Tooltip, { title: I18n.t('ra_Clone current row'), componentsProps: { popper: { sx: styles.tooltip } } },
696
703
  React.createElement(IconButton, { size: "small", onClick: this.onClone(idx) },
697
704
  React.createElement(CopyContentIcon, null))) : null))),
698
705
  !schema.noDelete && visibleValue.length >= (schema.showSecondAddAt || 5) ?
699
706
  React.createElement(TableRow, null,
700
707
  React.createElement(TableCell, { colSpan: schema.items.length + 1 },
701
- React.createElement(Tooltip, { title: doAnyFilterSet ? I18n.t('ra_Cannot add items with set filter') : I18n.t('ra_Add row') },
708
+ React.createElement(Tooltip, { title: doAnyFilterSet ? I18n.t('ra_Cannot add items with set filter') : I18n.t('ra_Add row'), componentsProps: { popper: { sx: styles.tooltip } } },
702
709
  React.createElement("span", null,
703
710
  React.createElement(IconButton, { size: "small", color: "primary", disabled: !!doAnyFilterSet && !this.props.schema.allowAddByFilter, onClick: this.onAdd },
704
711
  React.createElement(AddIcon, null)))))) : null)),
705
712
  !visibleValue.length && this.state.value.length ?
706
- React.createElement("div", { className: classes.filteredOut },
707
- React.createElement(Typography, { className: classes.title, variant: "h6", id: "tableTitle", component: "div" },
713
+ React.createElement("div", { style: styles.filteredOut },
714
+ React.createElement(Typography, { style: styles.title, variant: "h6", id: "tableTitle", component: "div" },
708
715
  I18n.t('ra_All items are filtered out'),
709
716
  React.createElement(IconButton, { size: "small", onClick: () => this.applyFilter(true) },
710
717
  React.createElement(CloseIcon, null)))) : null),
@@ -716,5 +723,5 @@ class ConfigTable extends ConfigGeneric {
716
723
  React.createElement("span", { style: { color: 'red', alignSelf: 'center' } }, this.state.errorMessage)) : null);
717
724
  }
718
725
  }
719
- export default withStyles(styles)(ConfigTable);
726
+ export default ConfigTable;
720
727
  //# sourceMappingURL=ConfigTable.js.map