@iobroker/json-config 6.17.6 → 6.17.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/build/JsonConfig.d.ts +1 -1
- package/build/JsonConfig.js +18 -19
- package/build/JsonConfig.js.map +1 -1
- package/build/JsonConfigComponent/ChipInput.d.ts +89 -11
- package/build/JsonConfigComponent/ChipInput.js +48 -137
- package/build/JsonConfigComponent/ChipInput.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAccordion.d.ts +7 -14
- package/build/JsonConfigComponent/ConfigAccordion.js +10 -21
- package/build/JsonConfigComponent/ConfigAccordion.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAlive.d.ts +5 -1
- package/build/JsonConfigComponent/ConfigAlive.js +0 -1
- package/build/JsonConfigComponent/ConfigAlive.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAutocomplete.d.ts +5 -29
- package/build/JsonConfigComponent/ConfigAutocomplete.js +7 -5
- package/build/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +5 -14
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js +3 -3
- package/build/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCRON.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigCertCollection.d.ts +7 -13
- package/build/JsonConfigComponent/ConfigCertCollection.js +8 -18
- package/build/JsonConfigComponent/ConfigCertCollection.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCertificateSelect.d.ts +7 -13
- package/build/JsonConfigComponent/ConfigCertificateSelect.js +5 -18
- package/build/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCertificates.d.ts +7 -13
- package/build/JsonConfigComponent/ConfigCertificates.js +7 -18
- package/build/JsonConfigComponent/ConfigCertificates.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCheckbox.d.ts +3 -11
- package/build/JsonConfigComponent/ConfigCheckbox.js +2 -2
- package/build/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
- package/build/JsonConfigComponent/ConfigChip.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigColor.d.ts +13 -20
- package/build/JsonConfigComponent/ConfigColor.js +9 -23
- package/build/JsonConfigComponent/ConfigColor.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCoordinates.d.ts +8 -13
- package/build/JsonConfigComponent/ConfigCoordinates.js +29 -39
- package/build/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
- package/build/JsonConfigComponent/ConfigCustom.d.ts +4 -50
- package/build/JsonConfigComponent/ConfigCustom.js +0 -1
- package/build/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/build/JsonConfigComponent/ConfigDatePicker.d.ts +8 -3
- package/build/JsonConfigComponent/ConfigDatePicker.js +21 -13
- package/build/JsonConfigComponent/ConfigDatePicker.js.map +1 -1
- package/build/JsonConfigComponent/ConfigDeviceManager.d.ts +5 -1
- package/build/JsonConfigComponent/ConfigDeviceManager.js +1 -1
- package/build/JsonConfigComponent/ConfigDeviceManager.js.map +1 -1
- package/build/JsonConfigComponent/ConfigFile.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigFunc.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigGeneric.d.ts +46 -32
- package/build/JsonConfigComponent/ConfigGeneric.js +23 -12
- package/build/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/build/JsonConfigComponent/ConfigIP.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigImageSendTo.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigInstanceSelect.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigInterface.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigJsonEditor.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigLanguage.d.ts +3 -2
- package/build/JsonConfigComponent/ConfigLanguage.js +2 -2
- package/build/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/build/JsonConfigComponent/ConfigNumber.d.ts +3 -13
- package/build/JsonConfigComponent/ConfigNumber.js +2 -2
- package/build/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/build/JsonConfigComponent/ConfigObjectId.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigPanel.d.ts +7 -2
- package/build/JsonConfigComponent/ConfigPanel.js +5 -40
- package/build/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/build/JsonConfigComponent/ConfigPassword.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigPort.d.ts +6 -1
- package/build/JsonConfigComponent/ConfigPort.js +2 -3
- package/build/JsonConfigComponent/ConfigPort.js.map +1 -1
- package/build/JsonConfigComponent/ConfigRoom.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigSelect.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigSelectSendTo.d.ts +7 -16
- package/build/JsonConfigComponent/ConfigSelectSendTo.js +15 -61
- package/build/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
- package/build/JsonConfigComponent/ConfigSendto.d.ts +3 -20
- package/build/JsonConfigComponent/ConfigSendto.js +8 -8
- package/build/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/build/JsonConfigComponent/ConfigSetState.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigSlider.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigStaticDivider.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigStaticHeader.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigStaticImage.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigStaticText.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigTable.d.ts +4 -25
- package/build/JsonConfigComponent/ConfigTable.js +5 -4
- package/build/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTabs.d.ts +8 -33
- package/build/JsonConfigComponent/ConfigTabs.js +10 -43
- package/build/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/build/JsonConfigComponent/ConfigText.d.ts +7 -13
- package/build/JsonConfigComponent/ConfigText.js +13 -18
- package/build/JsonConfigComponent/ConfigText.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTextSendTo.d.ts +7 -9
- package/build/JsonConfigComponent/ConfigTextSendTo.js +11 -21
- package/build/JsonConfigComponent/ConfigTextSendTo.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTimePicker.d.ts +9 -3
- package/build/JsonConfigComponent/ConfigTimePicker.js +28 -18
- package/build/JsonConfigComponent/ConfigTimePicker.js.map +1 -1
- package/build/JsonConfigComponent/ConfigTopic.d.ts +1 -1
- package/build/JsonConfigComponent/ConfigUUID.d.ts +12 -13
- package/build/JsonConfigComponent/ConfigUUID.js +1 -6
- package/build/JsonConfigComponent/ConfigUUID.js.map +1 -1
- package/build/JsonConfigComponent/ConfigUser.d.ts +1 -1
- package/build/JsonConfigComponent/index.d.ts +66 -25
- package/build/JsonConfigComponent/index.js +48 -61
- package/build/JsonConfigComponent/index.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/package.json +27 -26
- package/src/JsonConfig.tsx +710 -0
- package/src/JsonConfigComponent/ChipInput.tsx +752 -0
- package/src/JsonConfigComponent/ConfigAccordion.tsx +278 -0
- package/src/JsonConfigComponent/ConfigAlive.tsx +74 -0
- package/src/JsonConfigComponent/ConfigAutocomplete.tsx +108 -0
- package/src/JsonConfigComponent/ConfigAutocompleteSendTo.tsx +183 -0
- package/src/JsonConfigComponent/ConfigCRON.jsx +101 -0
- package/src/JsonConfigComponent/ConfigCertCollection.tsx +102 -0
- package/src/JsonConfigComponent/ConfigCertificateSelect.tsx +92 -0
- package/src/JsonConfigComponent/ConfigCertificates.tsx +202 -0
- package/src/JsonConfigComponent/ConfigCheckLicense.jsx +662 -0
- package/src/JsonConfigComponent/ConfigCheckbox.tsx +67 -0
- package/src/JsonConfigComponent/ConfigChip.jsx +81 -0
- package/src/JsonConfigComponent/ConfigColor.tsx +86 -0
- package/src/JsonConfigComponent/ConfigCoordinates.tsx +234 -0
- package/src/JsonConfigComponent/ConfigCustom.tsx +246 -0
- package/src/JsonConfigComponent/ConfigDatePicker.tsx +48 -0
- package/src/JsonConfigComponent/ConfigDeviceManager.tsx +33 -0
- package/src/JsonConfigComponent/ConfigFile.jsx +181 -0
- package/src/JsonConfigComponent/ConfigFileSelector.jsx +520 -0
- package/src/JsonConfigComponent/ConfigFunc.jsx +90 -0
- package/src/JsonConfigComponent/ConfigGeneric.tsx +1027 -0
- package/src/JsonConfigComponent/ConfigIP.jsx +96 -0
- package/src/JsonConfigComponent/ConfigImageSendTo.jsx +79 -0
- package/src/JsonConfigComponent/ConfigImageUpload.jsx +114 -0
- package/src/JsonConfigComponent/ConfigInstanceSelect.jsx +172 -0
- package/src/JsonConfigComponent/ConfigInterface.jsx +112 -0
- package/src/JsonConfigComponent/ConfigJsonEditor.jsx +103 -0
- package/src/JsonConfigComponent/ConfigLanguage.tsx +153 -0
- package/src/JsonConfigComponent/ConfigLicense.jsx +148 -0
- package/src/JsonConfigComponent/ConfigNumber.tsx +207 -0
- package/src/JsonConfigComponent/ConfigObjectId.jsx +113 -0
- package/src/JsonConfigComponent/ConfigPanel.tsx +360 -0
- package/src/JsonConfigComponent/ConfigPassword.jsx +160 -0
- package/src/JsonConfigComponent/ConfigPattern.jsx +50 -0
- package/src/JsonConfigComponent/ConfigPort.tsx +232 -0
- package/src/JsonConfigComponent/ConfigRoom.jsx +90 -0
- package/src/JsonConfigComponent/ConfigSelect.jsx +124 -0
- package/src/JsonConfigComponent/ConfigSelectSendTo.tsx +251 -0
- package/src/JsonConfigComponent/ConfigSendto.tsx +340 -0
- package/src/JsonConfigComponent/ConfigSetState.jsx +116 -0
- package/src/JsonConfigComponent/ConfigSlider.jsx +97 -0
- package/src/JsonConfigComponent/ConfigStaticDivider.jsx +51 -0
- package/src/JsonConfigComponent/ConfigStaticHeader.jsx +63 -0
- package/src/JsonConfigComponent/ConfigStaticImage.jsx +48 -0
- package/src/JsonConfigComponent/ConfigStaticText.jsx +72 -0
- package/src/JsonConfigComponent/ConfigTable.tsx +1040 -0
- package/src/JsonConfigComponent/ConfigTabs.tsx +150 -0
- package/src/JsonConfigComponent/ConfigText.tsx +188 -0
- package/src/JsonConfigComponent/ConfigTextSendTo.tsx +102 -0
- package/src/JsonConfigComponent/ConfigTimePicker.tsx +63 -0
- package/src/JsonConfigComponent/ConfigTopic.jsx +78 -0
- package/src/JsonConfigComponent/ConfigUUID.tsx +55 -0
- package/src/JsonConfigComponent/ConfigUser.jsx +104 -0
- package/src/JsonConfigComponent/index.tsx +435 -0
- package/src/JsonConfigComponent/wrapper/Components/CustomModal.jsx +145 -0
- package/src/JsonConfigComponent/wrapper/Components/Editor.jsx +65 -0
- package/src/Utils.jsx +1683 -0
- package/src/index.tsx +14 -0
- package/src/types.d.ts +372 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { withStyles } from '@mui/styles';
|
|
4
|
+
|
|
5
|
+
import ConfigGeneric from './ConfigGeneric';
|
|
6
|
+
|
|
7
|
+
const styles = () => ({
|
|
8
|
+
fullWidth: {
|
|
9
|
+
height: '100%',
|
|
10
|
+
width: '100%',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
class ConfigStaticImage extends ConfigGeneric {
|
|
15
|
+
renderItem() {
|
|
16
|
+
let src = this.props.schema.src;
|
|
17
|
+
if (src && !src.startsWith('.') &&
|
|
18
|
+
!src.startsWith('http') &&
|
|
19
|
+
!src.startsWith(`adapter/${this.props.adapterName}/`) &&
|
|
20
|
+
!src.startsWith(`./adapter/${this.props.adapterName}/`)
|
|
21
|
+
) {
|
|
22
|
+
src = `adapter/${this.props.adapterName}/${src}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
26
|
+
return <img
|
|
27
|
+
className={this.props.classes.fullWidth}
|
|
28
|
+
src={src}
|
|
29
|
+
style={this.props.schema.href ? { cursor: 'pointer' } : {}}
|
|
30
|
+
onClick={this.props.schema.href ? () => this.props.schema.href && window.open(this.props.schema.href, '_blank') : null}
|
|
31
|
+
alt=""
|
|
32
|
+
/>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ConfigStaticImage.propTypes = {
|
|
37
|
+
socket: PropTypes.object.isRequired,
|
|
38
|
+
themeType: PropTypes.string,
|
|
39
|
+
themeName: PropTypes.string,
|
|
40
|
+
style: PropTypes.object,
|
|
41
|
+
className: PropTypes.string,
|
|
42
|
+
data: PropTypes.object.isRequired,
|
|
43
|
+
schema: PropTypes.object,
|
|
44
|
+
onError: PropTypes.func,
|
|
45
|
+
onChange: PropTypes.func,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default withStyles(styles)(ConfigStaticImage);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { withStyles } from '@mui/styles';
|
|
4
|
+
|
|
5
|
+
import { Button } from '@mui/material';
|
|
6
|
+
|
|
7
|
+
import { Utils } from '@iobroker/adapter-react-v5';
|
|
8
|
+
|
|
9
|
+
import ConfigGeneric from './ConfigGeneric';
|
|
10
|
+
|
|
11
|
+
const styles = theme => ({
|
|
12
|
+
fullWidth: {
|
|
13
|
+
height: '100%',
|
|
14
|
+
width: '100%',
|
|
15
|
+
},
|
|
16
|
+
link: {
|
|
17
|
+
textDecoration: 'underline',
|
|
18
|
+
color: theme.palette.mode === 'dark' ? '#4dabf5' : '#254e72',
|
|
19
|
+
cursor: 'pointer',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
class ConfigStaticText extends ConfigGeneric {
|
|
24
|
+
renderItem(error, disabled) {
|
|
25
|
+
if (this.props.schema.button) {
|
|
26
|
+
const icon = this.getIcon();
|
|
27
|
+
return <Button
|
|
28
|
+
variant={this.props.schema.variant || undefined}
|
|
29
|
+
color={this.props.schema.color || 'grey'}
|
|
30
|
+
className={this.props.classes.fullWidth}
|
|
31
|
+
disabled={disabled}
|
|
32
|
+
startIcon={icon}
|
|
33
|
+
onClick={this.props.schema.href ? () => {
|
|
34
|
+
// calculate one more time just before call
|
|
35
|
+
const href = this.props.schema.href ? this.getText(this.props.schema.href, true) : null;
|
|
36
|
+
href && window.open(href, '_blank');
|
|
37
|
+
} : null}
|
|
38
|
+
>
|
|
39
|
+
{this.getText(this.props.schema.text || this.props.schema.label, this.props.schema.noTranslation)}
|
|
40
|
+
</Button>;
|
|
41
|
+
}
|
|
42
|
+
let text = this.getText(this.props.schema.text || this.props.schema.label, this.props.schema.noTranslation);
|
|
43
|
+
if (text && (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))) {
|
|
44
|
+
text = Utils.renderTextWithA(text);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return <span
|
|
48
|
+
className={this.props.schema.href ? this.props.classes.link : ''}
|
|
49
|
+
onClick={this.props.schema.href ? () => {
|
|
50
|
+
// calculate one more time just before call
|
|
51
|
+
const href = this.props.schema.href ? this.getText(this.props.schema.href, true) : null;
|
|
52
|
+
href && window.open(href, '_blank');
|
|
53
|
+
} : null}
|
|
54
|
+
>
|
|
55
|
+
{text}
|
|
56
|
+
</span>;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
ConfigStaticText.propTypes = {
|
|
61
|
+
socket: PropTypes.object.isRequired,
|
|
62
|
+
themeType: PropTypes.string,
|
|
63
|
+
themeName: PropTypes.string,
|
|
64
|
+
style: PropTypes.object,
|
|
65
|
+
className: PropTypes.string,
|
|
66
|
+
data: PropTypes.object.isRequired,
|
|
67
|
+
schema: PropTypes.object,
|
|
68
|
+
onError: PropTypes.func,
|
|
69
|
+
onChange: PropTypes.func,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default withStyles(styles)(ConfigStaticText);
|