@iobroker/adapter-react-v5 4.8.0 → 4.9.0

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 (265) hide show
  1. package/Components/Logo.d.ts +9 -50
  2. package/Components/Logo.js +106 -173
  3. package/Components/ObjectBrowser.d.ts +9 -0
  4. package/Components/ObjectBrowser.js +370 -165
  5. package/Components/ObjectBrowser.js.map +1 -1
  6. package/Components/SaveCloseButtons.d.ts +17 -61
  7. package/Components/SaveCloseButtons.js +64 -124
  8. package/Components/Schedule.d.ts +31 -6
  9. package/Components/Schedule.js +1144 -1562
  10. package/Components/TabContainer.d.ts +9 -37
  11. package/Components/TabContainer.js +49 -74
  12. package/Components/TabContent.d.ts +6 -27
  13. package/Components/TabContent.js +24 -67
  14. package/Components/TabHeader.d.ts +6 -11
  15. package/Components/TabHeader.js +11 -40
  16. package/Components/ToggleThemeMenu.d.ts +10 -8
  17. package/Components/ToggleThemeMenu.js +16 -36
  18. package/Components/types.d.ts +10 -2
  19. package/Dialogs/SelectID.d.ts +39 -114
  20. package/Dialogs/SelectID.js +141 -246
  21. package/LegacyConnection.d.ts +1 -1
  22. package/README.md +7 -3
  23. package/i18n.d.ts +2 -2
  24. package/index.d.ts +127 -126
  25. package/index.js +213 -192
  26. package/package.json +7 -8
  27. package/Components/JsonConfigComponent/ChipInput.d.ts +0 -12
  28. package/Components/JsonConfigComponent/ChipInput.js +0 -763
  29. package/Components/JsonConfigComponent/ChipInput.js.map +0 -1
  30. package/Components/JsonConfigComponent/ConfigAccordion.d.ts +0 -15
  31. package/Components/JsonConfigComponent/ConfigAccordion.js +0 -348
  32. package/Components/JsonConfigComponent/ConfigAccordion.js.map +0 -1
  33. package/Components/JsonConfigComponent/ConfigAlive.d.ts +0 -10
  34. package/Components/JsonConfigComponent/ConfigAlive.js +0 -105
  35. package/Components/JsonConfigComponent/ConfigAlive.js.map +0 -1
  36. package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +0 -37
  37. package/Components/JsonConfigComponent/ConfigAutocomplete.js +0 -73
  38. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +0 -17
  39. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +0 -131
  40. package/Components/JsonConfigComponent/ConfigCRON.d.ts +0 -15
  41. package/Components/JsonConfigComponent/ConfigCRON.js +0 -157
  42. package/Components/JsonConfigComponent/ConfigCRON.js.map +0 -1
  43. package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +0 -14
  44. package/Components/JsonConfigComponent/ConfigCertCollection.js +0 -128
  45. package/Components/JsonConfigComponent/ConfigCertCollection.js.map +0 -1
  46. package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +0 -14
  47. package/Components/JsonConfigComponent/ConfigCertificateSelect.js +0 -149
  48. package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +0 -1
  49. package/Components/JsonConfigComponent/ConfigCertificates.d.ts +0 -14
  50. package/Components/JsonConfigComponent/ConfigCertificates.js +0 -284
  51. package/Components/JsonConfigComponent/ConfigCertificates.js.map +0 -1
  52. package/Components/JsonConfigComponent/ConfigCheckLicense.d.ts +0 -3
  53. package/Components/JsonConfigComponent/ConfigCheckLicense.js +0 -821
  54. package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +0 -1
  55. package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +0 -15
  56. package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -40
  57. package/Components/JsonConfigComponent/ConfigChip.d.ts +0 -14
  58. package/Components/JsonConfigComponent/ConfigChip.js +0 -120
  59. package/Components/JsonConfigComponent/ConfigChip.js.map +0 -1
  60. package/Components/JsonConfigComponent/ConfigColor.d.ts +0 -22
  61. package/Components/JsonConfigComponent/ConfigColor.js +0 -120
  62. package/Components/JsonConfigComponent/ConfigColor.js.map +0 -1
  63. package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +0 -14
  64. package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -265
  65. package/Components/JsonConfigComponent/ConfigCoordinates.js.map +0 -1
  66. package/Components/JsonConfigComponent/ConfigCustom.d.ts +0 -26
  67. package/Components/JsonConfigComponent/ConfigCustom.js +0 -316
  68. package/Components/JsonConfigComponent/ConfigCustom.js.map +0 -1
  69. package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +0 -14
  70. package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -91
  71. package/Components/JsonConfigComponent/ConfigDatePicker.js.map +0 -1
  72. package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +0 -6
  73. package/Components/JsonConfigComponent/ConfigDeviceManager.js +0 -18
  74. package/Components/JsonConfigComponent/ConfigFile.d.ts +0 -15
  75. package/Components/JsonConfigComponent/ConfigFile.js +0 -228
  76. package/Components/JsonConfigComponent/ConfigFile.js.map +0 -1
  77. package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +0 -3
  78. package/Components/JsonConfigComponent/ConfigFileSelector.js +0 -625
  79. package/Components/JsonConfigComponent/ConfigFileSelector.js.map +0 -1
  80. package/Components/JsonConfigComponent/ConfigFunc.d.ts +0 -14
  81. package/Components/JsonConfigComponent/ConfigFunc.js +0 -124
  82. package/Components/JsonConfigComponent/ConfigFunc.js.map +0 -1
  83. package/Components/JsonConfigComponent/ConfigGeneric.d.ts +0 -95
  84. package/Components/JsonConfigComponent/ConfigGeneric.js +0 -646
  85. package/Components/JsonConfigComponent/ConfigIP.d.ts +0 -14
  86. package/Components/JsonConfigComponent/ConfigIP.js +0 -130
  87. package/Components/JsonConfigComponent/ConfigIP.js.map +0 -1
  88. package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +0 -10
  89. package/Components/JsonConfigComponent/ConfigImageSendTo.js +0 -114
  90. package/Components/JsonConfigComponent/ConfigImageSendTo.js.map +0 -1
  91. package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +0 -14
  92. package/Components/JsonConfigComponent/ConfigImageUpload.js +0 -166
  93. package/Components/JsonConfigComponent/ConfigImageUpload.js.map +0 -1
  94. package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +0 -14
  95. package/Components/JsonConfigComponent/ConfigInstanceSelect.js +0 -264
  96. package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +0 -1
  97. package/Components/JsonConfigComponent/ConfigInterface.d.ts +0 -14
  98. package/Components/JsonConfigComponent/ConfigInterface.js +0 -146
  99. package/Components/JsonConfigComponent/ConfigInterface.js.map +0 -1
  100. package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +0 -13
  101. package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -145
  102. package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +0 -1
  103. package/Components/JsonConfigComponent/ConfigLanguage.d.ts +0 -7
  104. package/Components/JsonConfigComponent/ConfigLanguage.js +0 -110
  105. package/Components/JsonConfigComponent/ConfigLicense.d.ts +0 -24
  106. package/Components/JsonConfigComponent/ConfigLicense.js +0 -183
  107. package/Components/JsonConfigComponent/ConfigLicense.js.map +0 -1
  108. package/Components/JsonConfigComponent/ConfigNumber.d.ts +0 -17
  109. package/Components/JsonConfigComponent/ConfigNumber.js +0 -117
  110. package/Components/JsonConfigComponent/ConfigObjectId.d.ts +0 -17
  111. package/Components/JsonConfigComponent/ConfigObjectId.js +0 -167
  112. package/Components/JsonConfigComponent/ConfigObjectId.js.map +0 -1
  113. package/Components/JsonConfigComponent/ConfigPanel.d.ts +0 -3
  114. package/Components/JsonConfigComponent/ConfigPanel.js +0 -396
  115. package/Components/JsonConfigComponent/ConfigPanel.js.map +0 -1
  116. package/Components/JsonConfigComponent/ConfigPassword.d.ts +0 -14
  117. package/Components/JsonConfigComponent/ConfigPassword.js +0 -193
  118. package/Components/JsonConfigComponent/ConfigPassword.js.map +0 -1
  119. package/Components/JsonConfigComponent/ConfigPattern.d.ts +0 -21
  120. package/Components/JsonConfigComponent/ConfigPattern.js +0 -65
  121. package/Components/JsonConfigComponent/ConfigPattern.js.map +0 -1
  122. package/Components/JsonConfigComponent/ConfigPort.d.ts +0 -3
  123. package/Components/JsonConfigComponent/ConfigPort.js +0 -176
  124. package/Components/JsonConfigComponent/ConfigRoom.d.ts +0 -14
  125. package/Components/JsonConfigComponent/ConfigRoom.js +0 -124
  126. package/Components/JsonConfigComponent/ConfigRoom.js.map +0 -1
  127. package/Components/JsonConfigComponent/ConfigSelect.d.ts +0 -14
  128. package/Components/JsonConfigComponent/ConfigSelect.js +0 -159
  129. package/Components/JsonConfigComponent/ConfigSelect.js.map +0 -1
  130. package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +0 -17
  131. package/Components/JsonConfigComponent/ConfigSelectSendTo.js +0 -272
  132. package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +0 -1
  133. package/Components/JsonConfigComponent/ConfigSendto.d.ts +0 -24
  134. package/Components/JsonConfigComponent/ConfigSendto.js +0 -294
  135. package/Components/JsonConfigComponent/ConfigSetState.d.ts +0 -18
  136. package/Components/JsonConfigComponent/ConfigSetState.js +0 -185
  137. package/Components/JsonConfigComponent/ConfigSetState.js.map +0 -1
  138. package/Components/JsonConfigComponent/ConfigSlider.d.ts +0 -14
  139. package/Components/JsonConfigComponent/ConfigSlider.js +0 -119
  140. package/Components/JsonConfigComponent/ConfigSlider.js.map +0 -1
  141. package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +0 -14
  142. package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -68
  143. package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +0 -1
  144. package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +0 -14
  145. package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -81
  146. package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +0 -1
  147. package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +0 -14
  148. package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -71
  149. package/Components/JsonConfigComponent/ConfigStaticImage.js.map +0 -1
  150. package/Components/JsonConfigComponent/ConfigStaticText.d.ts +0 -14
  151. package/Components/JsonConfigComponent/ConfigStaticText.js +0 -88
  152. package/Components/JsonConfigComponent/ConfigStaticText.js.map +0 -1
  153. package/Components/JsonConfigComponent/ConfigTable.d.ts +0 -3
  154. package/Components/JsonConfigComponent/ConfigTable.js +0 -1064
  155. package/Components/JsonConfigComponent/ConfigTable.js.map +0 -1
  156. package/Components/JsonConfigComponent/ConfigTabs.d.ts +0 -34
  157. package/Components/JsonConfigComponent/ConfigTabs.js +0 -162
  158. package/Components/JsonConfigComponent/ConfigTabs.js.map +0 -1
  159. package/Components/JsonConfigComponent/ConfigText.d.ts +0 -14
  160. package/Components/JsonConfigComponent/ConfigText.js +0 -226
  161. package/Components/JsonConfigComponent/ConfigText.js.map +0 -1
  162. package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +0 -10
  163. package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -129
  164. package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +0 -1
  165. package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +0 -14
  166. package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -85
  167. package/Components/JsonConfigComponent/ConfigTimePicker.js.map +0 -1
  168. package/Components/JsonConfigComponent/ConfigTopic.d.ts +0 -17
  169. package/Components/JsonConfigComponent/ConfigTopic.js +0 -110
  170. package/Components/JsonConfigComponent/ConfigTopic.js.map +0 -1
  171. package/Components/JsonConfigComponent/ConfigUUID.d.ts +0 -15
  172. package/Components/JsonConfigComponent/ConfigUUID.js +0 -95
  173. package/Components/JsonConfigComponent/ConfigUUID.js.map +0 -1
  174. package/Components/JsonConfigComponent/ConfigUser.d.ts +0 -14
  175. package/Components/JsonConfigComponent/ConfigUser.js +0 -142
  176. package/Components/JsonConfigComponent/ConfigUser.js.map +0 -1
  177. package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +0 -63
  178. package/Components/JsonConfigComponent/DeviceManager/Communication.js +0 -268
  179. package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +0 -11
  180. package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +0 -15
  181. package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +0 -53
  182. package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +0 -340
  183. package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +0 -45
  184. package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +0 -146
  185. package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +0 -12
  186. package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +0 -69
  187. package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +0 -51
  188. package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +0 -216
  189. package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +0 -13
  190. package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +0 -111
  191. package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +0 -7
  192. package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +0 -16
  193. package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +0 -11
  194. package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +0 -94
  195. package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +0 -10
  196. package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +0 -22
  197. package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +0 -12
  198. package/Components/JsonConfigComponent/DeviceManager/Utils.js +0 -158
  199. package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +0 -21
  200. package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +0 -21
  201. package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +0 -21
  202. package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +0 -21
  203. package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +0 -26
  204. package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +0 -21
  205. package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +0 -21
  206. package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +0 -21
  207. package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +0 -21
  208. package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +0 -21
  209. package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +0 -21
  210. package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +0 -21
  211. package/Components/JsonConfigComponent/DeviceManager/index.d.ts +0 -2
  212. package/Components/JsonConfigComponent/DeviceManager/index.js +0 -10
  213. package/Components/JsonConfigComponent/DeviceManager/index.js.map +0 -1
  214. package/Components/JsonConfigComponent/index.d.ts +0 -26
  215. package/Components/JsonConfigComponent/index.js +0 -520
  216. package/Components/JsonConfigComponent/index.js.map +0 -1
  217. package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +0 -2
  218. package/Components/JsonConfigComponent/wrapper/AdminConnection.js +0 -7
  219. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +0 -2
  220. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js +0 -10
  221. package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +0 -1
  222. package/Components/JsonConfigComponent/wrapper/Components/Icon.d.ts +0 -2
  223. package/Components/JsonConfigComponent/wrapper/Components/Icon.js +0 -10
  224. package/Components/JsonConfigComponent/wrapper/Components/Icon.js.map +0 -1
  225. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +0 -2
  226. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js +0 -10
  227. package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +0 -1
  228. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +0 -2
  229. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js +0 -10
  230. package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js.map +0 -1
  231. package/Components/JsonConfigComponent/wrapper/Components/Utils.d.ts +0 -2
  232. package/Components/JsonConfigComponent/wrapper/Components/Utils.js +0 -10
  233. package/Components/JsonConfigComponent/wrapper/Components/Utils.js.map +0 -1
  234. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +0 -2
  235. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js +0 -10
  236. package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +0 -1
  237. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +0 -2
  238. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js +0 -10
  239. package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +0 -1
  240. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +0 -2
  241. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js +0 -10
  242. package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js.map +0 -1
  243. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +0 -2
  244. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js +0 -10
  245. package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js.map +0 -1
  246. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +0 -2
  247. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +0 -10
  248. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +0 -1
  249. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +0 -2
  250. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js +0 -10
  251. package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +0 -1
  252. package/Components/JsonConfigComponent/wrapper/i18n.d.ts +0 -2
  253. package/Components/JsonConfigComponent/wrapper/i18n.js +0 -10
  254. package/Components/JsonConfigComponent/wrapper/i18n.js.map +0 -1
  255. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +0 -2
  256. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js +0 -10
  257. package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js.map +0 -1
  258. package/Components/Logo.js.map +0 -1
  259. package/Components/SaveCloseButtons.js.map +0 -1
  260. package/Components/Schedule.js.map +0 -1
  261. package/Components/TabContainer.js.map +0 -1
  262. package/Components/TabContent.js.map +0 -1
  263. package/Components/TabHeader.js.map +0 -1
  264. package/Components/ToggleThemeMenu.js.map +0 -1
  265. package/Dialogs/SelectID.js.map +0 -1
@@ -1,646 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.isObject = void 0;
30
- const react_1 = __importStar(require("react"));
31
- const material_1 = require("@mui/material");
32
- const icons_material_1 = require("@mui/icons-material");
33
- const i18n_1 = __importDefault(require("./wrapper/i18n"));
34
- const Utils_1 = __importDefault(require("./wrapper/Components/Utils"));
35
- const Confirm_1 = __importDefault(require("./wrapper/Dialogs/Confirm"));
36
- const Icon_1 = __importDefault(require("./wrapper/Components/Icon"));
37
- // because this class is used in adapter-react-v5, do not include here any foreign files like from '../../helpers/utils.ts'
38
- function isObject(it) {
39
- // This is necessary because:
40
- // typeof null === 'object'
41
- // typeof [] === 'object'
42
- // [] instanceof Object === true
43
- return Object.prototype.toString.call(it) === '[object Object]'; // this code is 25% faster than below one
44
- // return it && typeof it === 'object' && !(it instanceof Array);
45
- }
46
- exports.isObject = isObject;
47
- class ConfigGeneric extends react_1.Component {
48
- constructor(props) {
49
- super(props);
50
- this.onUpdate = (data) => {
51
- const value = ConfigGeneric.getValue(data || this.props.data, this.props.attr) || '';
52
- if (this.state.value !== value) {
53
- this.setState({ value });
54
- }
55
- else {
56
- this.forceUpdate();
57
- }
58
- };
59
- // @ts-expect-error of course, as we just
60
- this.state = {
61
- confirmDialog: false,
62
- confirmNewValue: null,
63
- confirmAttr: null,
64
- confirmData: null,
65
- };
66
- this.isError = {};
67
- if (props.schema) {
68
- if (props.custom) {
69
- this.defaultValue = props.schema.defaultFunc
70
- ? this.executeCustom(props.schema.defaultFunc, props.schema.default, props.data, props.instanceObj, props.arrayIndex, props.globalData)
71
- : props.schema.default;
72
- }
73
- else {
74
- this.defaultValue = props.schema.defaultFunc
75
- ? this.execute(props.schema.defaultFunc, props.schema.default, props.data, props.arrayIndex, props.globalData)
76
- : props.schema.default;
77
- }
78
- }
79
- this.lang = i18n_1.default.getLanguage();
80
- }
81
- componentDidMount() {
82
- this.props.registerOnForceUpdate && this.props.registerOnForceUpdate(this.props.attr, this.onUpdate);
83
- const LIKE_SELECT = ['select', 'autocomplete', 'autocompleteSendTo'];
84
- // init default value
85
- if (this.defaultValue !== undefined) {
86
- const value = ConfigGeneric.getValue(this.props.data, this.props.attr);
87
- if (value === undefined ||
88
- (LIKE_SELECT.includes(this.props.schema.type) && (value === '' || value === null))) {
89
- setTimeout(() => {
90
- if (this.props.custom) {
91
- this.props.onChange(this.props.attr, this.defaultValue, () => setTimeout(() => this.props.forceUpdate([this.props.attr], this.props.data), 100));
92
- }
93
- else {
94
- ConfigGeneric.setValue(this.props.data, this.props.attr, this.defaultValue);
95
- this.props.onChange(this.props.data, undefined, () => this.props.forceUpdate([this.props.attr], this.props.data));
96
- }
97
- }, 100);
98
- }
99
- }
100
- else if (this.props.schema.defaultSendTo) {
101
- this.sendTo();
102
- }
103
- }
104
- sendTo() {
105
- if (this.props.alive) {
106
- this.defaultSendToDone = true;
107
- let data = this.props.schema.data;
108
- if (data === undefined && this.props.schema.jsonData) {
109
- data = this.getPattern(this.props.schema.jsonData);
110
- try {
111
- data = JSON.parse(data);
112
- }
113
- catch (e) {
114
- console.error(`Cannot parse json data: ${data}`);
115
- }
116
- }
117
- else {
118
- data = {
119
- attr: this.props.attr,
120
- value: ConfigGeneric.getValue(this.props.data, this.props.attr),
121
- };
122
- }
123
- if (data === undefined) {
124
- data = null;
125
- }
126
- this.props.socket
127
- .sendTo(`${this.props.adapterName}.${this.props.instance}`, this.props.schema.defaultSendTo, data)
128
- .then((value) => {
129
- if (value !== null && value !== undefined) {
130
- if (this.props.custom) {
131
- this.props.onChange(this.props.attr, value, () => this.props.forceUpdate([this.props.attr], this.props.data));
132
- }
133
- else {
134
- ConfigGeneric.setValue(this.props.data, this.props.attr, value);
135
- this.props.onChange(this.props.data, undefined, () => this.props.forceUpdate([this.props.attr], this.props.data));
136
- }
137
- }
138
- });
139
- }
140
- else {
141
- this.defaultSendToDone = false;
142
- // show error, that instance did not start
143
- this.onError(this.props.attr, i18n_1.default.t('ra_Instance %s is not alive', this.props.instance.toString()));
144
- }
145
- }
146
- componentWillUnmount() {
147
- this.props.registerOnForceUpdate && this.props.registerOnForceUpdate(this.props.attr);
148
- if (this.sendToTimeout) {
149
- clearTimeout(this.sendToTimeout);
150
- this.sendToTimeout = null;
151
- }
152
- }
153
- /**
154
- * Extract attribute out of data
155
- *
156
- * @param data
157
- * @param attr
158
- */
159
- static getValue(data, attr) {
160
- if (typeof attr === 'string') {
161
- return ConfigGeneric.getValue(data, attr.split('.'));
162
- }
163
- if (attr.length === 1) {
164
- return data[attr[0]];
165
- }
166
- const part = attr.shift();
167
- if (typeof part === 'string' && typeof data[part] === 'object') {
168
- return ConfigGeneric.getValue(data[part], attr);
169
- }
170
- return null;
171
- }
172
- static setValue(data, attr, value) {
173
- if (typeof attr === 'string') {
174
- ConfigGeneric.setValue(data, attr.split('.'), value);
175
- return;
176
- }
177
- if (attr.length === 1) {
178
- if (value === null) {
179
- delete data[attr[0]];
180
- }
181
- else {
182
- data[attr[0]] = value;
183
- }
184
- }
185
- else {
186
- const part = attr.shift();
187
- if (typeof part !== 'string') {
188
- return;
189
- }
190
- if (!data[part] || typeof data[part] === 'object') {
191
- data[part] = data[part] || {};
192
- }
193
- ConfigGeneric.setValue(data[part], attr, value);
194
- }
195
- }
196
- getText(text, noTranslation) {
197
- if (!text) {
198
- return '';
199
- }
200
- if (typeof text === 'string') {
201
- const strText = noTranslation ? text : i18n_1.default.t(text);
202
- if (strText.includes('${')) {
203
- return this.getPattern(strText);
204
- }
205
- return strText;
206
- }
207
- if (isObject(text)) {
208
- if (text.func) {
209
- // calculate pattern
210
- if (typeof text.func === 'object') {
211
- return this.getPattern(text.func[this.lang] || text.func.en || '');
212
- }
213
- return this.getPattern(text.func);
214
- }
215
- return text[this.lang] || text.en || '';
216
- }
217
- return text.toString();
218
- }
219
- renderConfirmDialog() {
220
- if (!this.state.confirmDialog) {
221
- return null;
222
- }
223
- const confirm = this.state.confirmData || this.props.schema.confirm;
224
- let icon = null;
225
- if (confirm.type === 'warning') {
226
- icon = react_1.default.createElement(icons_material_1.Warning, null);
227
- }
228
- else if (confirm.type === 'error') {
229
- icon = react_1.default.createElement(icons_material_1.Error, null);
230
- }
231
- else if (confirm.type === 'info') {
232
- icon = react_1.default.createElement(icons_material_1.Info, null);
233
- }
234
- return (react_1.default.createElement(Confirm_1.default, { title: this.getText(confirm.title) || i18n_1.default.t('ra_Please confirm'), text: this.getText(confirm.text), ok: this.getText(confirm.ok) || i18n_1.default.t('ra_Ok'), cancel: this.getText(confirm.cancel) || i18n_1.default.t('ra_Cancel'), icon: icon, onClose: isOk => this.setState({ confirmDialog: false }, () => {
235
- if (isOk) {
236
- const data = JSON.parse(JSON.stringify(this.props.data));
237
- if (this.state.confirmDepAttr) {
238
- ConfigGeneric.setValue(data, this.state.confirmDepAttr, this.state.confirmDepNewValue);
239
- }
240
- ConfigGeneric.setValue(data, this.state.confirmAttr, this.state.confirmNewValue);
241
- this.setState({
242
- confirmDialog: false,
243
- confirmDepAttr: null,
244
- confirmDepNewValue: null,
245
- confirmNewValue: null,
246
- confirmAttr: null,
247
- confirmData: null,
248
- }, () => this.props.onChange(data));
249
- }
250
- else {
251
- this.setState({
252
- confirmDialog: false,
253
- confirmDepAttr: null,
254
- confirmDepNewValue: null,
255
- confirmNewValue: null,
256
- confirmAttr: null,
257
- confirmData: null,
258
- });
259
- }
260
- }) }));
261
- }
262
- // eslint-disable-next-line react/no-unused-class-component-methods
263
- getIcon(iconSettings) {
264
- iconSettings = iconSettings || this.props.schema.icon;
265
- let icon = null;
266
- if (iconSettings === 'auth') {
267
- icon = react_1.default.createElement(icons_material_1.Key, null);
268
- }
269
- else if (iconSettings === 'send') {
270
- icon = react_1.default.createElement(icons_material_1.Send, null);
271
- }
272
- else if (iconSettings === 'web') {
273
- icon = react_1.default.createElement(icons_material_1.Public, null);
274
- }
275
- else if (iconSettings === 'warning') {
276
- icon = react_1.default.createElement(icons_material_1.Warning, null);
277
- }
278
- else if (iconSettings === 'error') {
279
- icon = react_1.default.createElement(icons_material_1.Error, null);
280
- }
281
- else if (iconSettings === 'info') {
282
- icon = react_1.default.createElement(icons_material_1.Info, null);
283
- }
284
- else if (iconSettings === 'search') {
285
- icon = react_1.default.createElement(icons_material_1.Search, null);
286
- }
287
- else if (iconSettings === 'book') {
288
- icon = react_1.default.createElement(icons_material_1.MenuBook, null);
289
- }
290
- else if (iconSettings === 'help') {
291
- icon = react_1.default.createElement(icons_material_1.Help, null);
292
- }
293
- else if (iconSettings === 'upload') {
294
- icon = react_1.default.createElement(icons_material_1.UploadFile, null);
295
- }
296
- else if (iconSettings) {
297
- if (iconSettings.endsWith('.png') || iconSettings.endsWith('.svg') || iconSettings.endsWith('.jpg')) {
298
- // this path is relative to ./adapter/NAME
299
- if (!iconSettings.startsWith('http://') && !iconSettings.startsWith('https://')) {
300
- iconSettings = `./adapter/${this.props.adapterName}/${iconSettings}`;
301
- }
302
- }
303
- icon = react_1.default.createElement(Icon_1.default, { src: iconSettings, style: { width: 22, height: 22 } });
304
- }
305
- return icon;
306
- }
307
- /**
308
- * Trigger onChange, to activate save button on change
309
- *
310
- * @param attr the changed attribute
311
- * @param newValue new value of the attribute
312
- */
313
- onChangeAsync(attr, newValue) {
314
- return new Promise(resolve => this.onChange(attr, newValue, resolve));
315
- }
316
- /**
317
- * Trigger onChange, to activate save button on change
318
- *
319
- * @param attr the changed attribute
320
- * @param newValue new value of the attribute
321
- * @param cb optional callback function, else returns a Promise
322
- */
323
- // eslint-disable-next-line react/no-unused-class-component-methods
324
- onChange(attr, newValue, cb) {
325
- // Do not use here deep copy, as it is not JsonConfig
326
- const data = JSON.parse(JSON.stringify(this.props.data));
327
- ConfigGeneric.setValue(data, attr, newValue);
328
- if (this.props.schema.confirm &&
329
- this.execute(this.props.schema.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {
330
- return new Promise(resolve => {
331
- this.setState({
332
- confirmDialog: true,
333
- confirmNewValue: newValue,
334
- confirmAttr: attr,
335
- confirmData: null,
336
- }, () => {
337
- if (typeof cb === 'function') {
338
- cb();
339
- }
340
- else {
341
- resolve();
342
- }
343
- });
344
- });
345
- }
346
- // find any inputs with confirmation
347
- if (this.props.schema.confirmDependsOn) {
348
- for (let z = 0; z < this.props.schema.confirmDependsOn.length; z++) {
349
- const dep = this.props.schema.confirmDependsOn[z];
350
- if (dep.confirm) {
351
- const val = ConfigGeneric.getValue(data, dep.attr);
352
- if (this.execute(dep.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {
353
- return new Promise(resolve => {
354
- this.setState({
355
- confirmDialog: true,
356
- confirmNewValue: newValue,
357
- confirmAttr: attr,
358
- confirmDepNewValue: val,
359
- confirmDepAttr: dep.attr,
360
- confirmData: dep.confirm,
361
- }, () => {
362
- if (typeof cb === 'function') {
363
- cb();
364
- }
365
- else {
366
- resolve();
367
- }
368
- });
369
- });
370
- }
371
- }
372
- }
373
- }
374
- const changed = [];
375
- if (this.props.schema.onChangeDependsOn) {
376
- for (let z = 0; z < this.props.schema.onChangeDependsOn.length; z++) {
377
- const dep = this.props.schema.onChangeDependsOn[z];
378
- if (dep.onChange) {
379
- const val = ConfigGeneric.getValue(data, dep.attr);
380
- let _newValue;
381
- if (this.props.custom) {
382
- _newValue = this.executeCustom(dep.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData);
383
- }
384
- else {
385
- _newValue = this.execute(dep.onChange.calculateFunc, val, data, this.props.arrayIndex, this.props.globalData);
386
- }
387
- if (_newValue !== val) {
388
- ConfigGeneric.setValue(data, dep.attr, _newValue);
389
- changed.push(dep.attr);
390
- }
391
- }
392
- }
393
- }
394
- if (this.props.schema.hiddenDependsOn) {
395
- for (let z = 0; z < this.props.schema.hiddenDependsOn.length; z++) {
396
- const dep = this.props.schema.hiddenDependsOn[z];
397
- dep.hidden && changed.push(dep.attr);
398
- }
399
- }
400
- if (this.props.schema.labelDependsOn) {
401
- for (let z = 0; z < this.props.schema.labelDependsOn.length; z++) {
402
- const dep = this.props.schema.labelDependsOn[z];
403
- dep.hidden && changed.push(dep.attr);
404
- }
405
- }
406
- if (this.props.schema.helpDependsOn) {
407
- for (let z = 0; z < this.props.schema.helpDependsOn.length; z++) {
408
- const dep = this.props.schema.helpDependsOn[z];
409
- dep.hidden && changed.push(dep.attr);
410
- }
411
- }
412
- if (this.props.schema.onChange && !this.props.schema.onChange.ignoreOwnChanges) {
413
- const val = ConfigGeneric.getValue(data, this.props.attr);
414
- const newValue_ = this.props.custom
415
- ? this.executeCustom(this.props.schema.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
416
- : this.execute(this.props.schema.onChange.calculateFunc, val, data, this.props.arrayIndex, this.props.globalData);
417
- if (newValue_ !== val) {
418
- ConfigGeneric.setValue(data, this.props.attr, newValue_);
419
- }
420
- }
421
- if (this.props.custom) {
422
- this.props.onChange(attr, newValue, () => cb && cb());
423
- changed &&
424
- changed.length &&
425
- changed.forEach((_attr, i) => setTimeout(() => this.props.onChange(_attr, ConfigGeneric.getValue(data, _attr)), i * 50));
426
- }
427
- else {
428
- this.props.onChange(data, undefined, () => {
429
- changed.length && this.props.forceUpdate(changed, data);
430
- cb && cb();
431
- });
432
- }
433
- return Promise.resolve();
434
- }
435
- execute(func, defaultValue, data, arrayIndex, globalData) {
436
- let fun;
437
- if (isObject(func)) {
438
- fun = func.func;
439
- }
440
- else {
441
- fun = func;
442
- }
443
- if (!fun) {
444
- return defaultValue;
445
- }
446
- try {
447
- // eslint-disable-next-line no-new-func
448
- const f = new Function('data', 'originalData', '_system', '_alive', '_common', '_socket', '_instance', 'arrayIndex', 'globalData', '_changed', fun.includes('return') ? fun : `return ${fun}`);
449
- return f(data || this.props.data, this.props.originalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket, this.props.instance, arrayIndex, globalData, this.props.changed);
450
- }
451
- catch (e) {
452
- console.error(`Cannot execute ${func}: ${e}`);
453
- return defaultValue;
454
- }
455
- }
456
- executeCustom(func, data, customObj, instanceObj, arrayIndex, globalData) {
457
- let fun;
458
- if (isObject(func)) {
459
- fun = func.func;
460
- }
461
- else {
462
- fun = func;
463
- }
464
- if (!fun) {
465
- return null;
466
- }
467
- try {
468
- // eslint-disable-next-line no-new-func
469
- const f = new Function('data', 'originalData', '_system', 'instanceObj', 'customObj', '_socket', 'arrayIndex', 'globalData', '_changed', fun.includes('return') ? fun : `return ${fun}`);
470
- return f(data || this.props.data, this.props.originalData, this.props.systemConfig, instanceObj, customObj, this.props.socket, arrayIndex, globalData, this.props.changed);
471
- }
472
- catch (e) {
473
- console.error(`Cannot execute ${fun}: ${e}`);
474
- return null;
475
- }
476
- }
477
- calculate(schema) {
478
- let error;
479
- let disabled;
480
- let hidden;
481
- let defaultValue;
482
- if (this.props.custom) {
483
- error = schema.validator
484
- ? !this.executeCustom(schema.validator, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
485
- : false;
486
- disabled = schema.disabled
487
- ? this.executeCustom(schema.disabled, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
488
- : false;
489
- hidden = schema.hidden
490
- ? this.executeCustom(schema.hidden, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
491
- : false;
492
- defaultValue = schema.defaultFunc
493
- ? this.executeCustom(schema.defaultFunc, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)
494
- : schema.default;
495
- }
496
- else {
497
- error = schema.validator
498
- ? !this.execute(schema.validator, false, this.props.data, this.props.arrayIndex, this.props.globalData)
499
- : false;
500
- disabled = schema.disabled
501
- ? this.execute(schema.disabled, false, this.props.data, this.props.arrayIndex, this.props.globalData)
502
- : false;
503
- hidden = schema.hidden
504
- ? this.execute(schema.hidden, false, this.props.data, this.props.arrayIndex, this.props.globalData)
505
- : false;
506
- defaultValue = schema.defaultFunc
507
- ? this.execute(schema.defaultFunc, schema.default, this.props.data, this.props.arrayIndex, this.props.globalData)
508
- : schema.default;
509
- }
510
- return {
511
- error, disabled, hidden, defaultValue,
512
- };
513
- }
514
- onError(attr, error) {
515
- if (!error) {
516
- delete this.isError[attr];
517
- }
518
- else {
519
- this.isError[attr] = error;
520
- }
521
- this.props.onError && this.props.onError(attr, error);
522
- }
523
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
524
- renderItem(_error, _disabled, _defaultValue) {
525
- return this.getText(this.props.schema.label) || this.getText(this.props.schema.text);
526
- }
527
- // eslint-disable-next-line react/no-unused-class-component-methods
528
- renderHelp(text, link, noTranslation) {
529
- if (!link) {
530
- text = this.getText(text, noTranslation) || '';
531
- if (text &&
532
- (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))) {
533
- return Utils_1.default.renderTextWithA(text);
534
- }
535
- return text;
536
- }
537
- return react_1.default.createElement("a", { href: link, target: "_blank", rel: "noreferrer", style: {
538
- color: this.props.themeType === 'dark' ? '#a147ff' : '#5b238f',
539
- textDecoration: 'underline',
540
- } }, this.getText(text, noTranslation));
541
- }
542
- getPattern(pattern, data) {
543
- data = data || this.props.data;
544
- if (!pattern) {
545
- return '';
546
- }
547
- if (typeof pattern === 'object') {
548
- if (pattern.func) {
549
- pattern = pattern.func;
550
- }
551
- else {
552
- console.log(`Object must be stringified: ${JSON.stringify(pattern)}`);
553
- pattern = JSON.stringify(pattern);
554
- }
555
- }
556
- try {
557
- if (this.props.custom) {
558
- // eslint-disable-next-line no-new-func
559
- const f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', 'instanceObj', 'customObj', '_socket', '_changed', `return \`${pattern.replace(/`/g, '\\`')}\``);
560
- 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.changed);
561
- }
562
- // eslint-disable-next-line no-new-func
563
- const f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', '_alive', '_common', '_socket', '_changed', `return \`${pattern.replace(/`/g, '\\`')}\``);
564
- return f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket, this.props.changed);
565
- }
566
- catch (e) {
567
- console.error(`Cannot execute ${pattern}: ${e}`);
568
- return pattern;
569
- }
570
- }
571
- render() {
572
- const schema = this.props.schema;
573
- if (!schema) {
574
- return null;
575
- }
576
- if (this.props.alive && this.defaultSendToDone === false) {
577
- this.sendToTimeout = setTimeout(() => {
578
- this.sendToTimeout = null;
579
- this.sendTo();
580
- }, 200);
581
- }
582
- const { error, disabled, hidden, defaultValue, } = this.calculate(schema);
583
- if (hidden) {
584
- // Remove all errors if element is hidden
585
- if (Object.keys(this.isError).length) {
586
- setTimeout(isError => Object.keys(isError).forEach(attr => this.props.onError(attr)), 100, JSON.parse(JSON.stringify(this.isError)));
587
- this.isError = {};
588
- }
589
- if (schema.hideOnlyControl) {
590
- const item = react_1.default.createElement(material_1.Grid, { item: true, xs: schema.xs || undefined, lg: schema.lg || undefined, md: schema.md || undefined, sm: schema.sm || undefined, style: (Object.assign(Object.assign({ marginBottom: 0, textAlign: 'left' }, schema.style), (this.props.themeType === 'dark' ? schema.darkStyle : {}))) });
591
- if (schema.newLine) {
592
- return react_1.default.createElement(react_1.default.Fragment, null,
593
- react_1.default.createElement("div", { style: { flexBasis: '100%', height: 0 } }),
594
- item);
595
- }
596
- return item;
597
- }
598
- return null;
599
- }
600
- // Add error
601
- if (schema.validatorNoSaveOnError) {
602
- if (error && !Object.keys(this.isError).length) {
603
- this.isError = {
604
- [this.props.attr]: schema.validatorErrorText ? i18n_1.default.t(schema.validatorErrorText) : true,
605
- };
606
- setTimeout(isError => Object.keys(isError).forEach(attr => this.props.onError(attr, isError[attr])), 100, JSON.parse(JSON.stringify(this.isError)));
607
- }
608
- else if (!error && Object.keys(this.isError).length) {
609
- setTimeout(isError => Object.keys(isError).forEach(attr => this.props.onError(attr)), 100, JSON.parse(JSON.stringify(this.isError)));
610
- this.isError = {};
611
- }
612
- }
613
- const renderedItem = this.renderItem(error, disabled || this.props.commandRunning || this.props.disabled, defaultValue);
614
- if (this.noPlaceRequired) {
615
- return renderedItem;
616
- }
617
- const item = react_1.default.createElement(material_1.Grid, { item: true, title: this.getText(schema.tooltip), xs: schema.xs || undefined, lg: schema.lg || undefined, md: schema.md || undefined, sm: schema.sm || undefined, style: (Object.assign(Object.assign({ marginBottom: 0,
618
- // marginRight: 8,
619
- textAlign: 'left', width: schema.type === 'divider' || schema.type === 'header'
620
- ? schema.width || '100%'
621
- : undefined }, schema.style), (this.props.themeType === 'dark' ? schema.darkStyle : {}))) }, this.props.schema.defaultSendTo && this.props.schema.button ?
622
- react_1.default.createElement(material_1.Grid, { container: true, style: { width: '100%' } },
623
- react_1.default.createElement(material_1.Grid, { item: true, flex: 1 }, renderedItem),
624
- react_1.default.createElement(material_1.Grid, { item: true },
625
- react_1.default.createElement(material_1.Button, { variant: "outlined", onClick: () => this.sendTo(), title: this.props.schema.buttonTooltip
626
- ? this.getText(this.props.schema.buttonTooltip, this.props.schema.buttonTooltipNoTranslation)
627
- : i18n_1.default.t('ra_Request data by instance') }, this.getText(this.props.schema.button)))) : renderedItem);
628
- if (schema.newLine) {
629
- return react_1.default.createElement(react_1.default.Fragment, null,
630
- react_1.default.createElement("div", { style: { flexBasis: '100%', height: 0 } }),
631
- this.renderConfirmDialog(),
632
- item);
633
- }
634
- if (this.state.confirmDialog) {
635
- return react_1.default.createElement(react_1.default.Fragment, null,
636
- this.renderConfirmDialog(),
637
- item);
638
- }
639
- return item;
640
- }
641
- }
642
- ConfigGeneric.DIFFERENT_VALUE = '__different__';
643
- ConfigGeneric.DIFFERENT_LABEL = 'ra___different__';
644
- ConfigGeneric.NONE_VALUE = '';
645
- ConfigGeneric.NONE_LABEL = 'ra_none';
646
- exports.default = ConfigGeneric;
@@ -1,14 +0,0 @@
1
- declare const _default: React.JSXElementConstructor<Omit<Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "data" | "onChange" | "onError" | "originalData" | "instanceObj" | "customObj" | "schema" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "socket" | "changed" | "adapterName" | "instance" | "common" | "themeType"> & 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" | "className" | "themeName"> & Pick<import("./ConfigGeneric").ConfigGenericProps, "classes" | "disabled" | "originalData" | "instanceObj" | "customObj" | "arrayIndex" | "globalData" | "registerOnForceUpdate" | "attr" | "custom" | "forceUpdate" | "alive" | "systemConfig" | "changed" | "adapterName" | "instance" | "common" | "commandRunning">, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
12
- export default _default;
13
- import PropTypes from 'prop-types';
14
- import React from 'react';