@iobroker/adapter-react-v5 3.1.34 → 3.1.35
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/Components/404.js +0 -23
- package/Components/404.js.map +1 -1
- package/Components/ColorPicker.js +6 -37
- package/Components/ColorPicker.js.map +1 -1
- package/Components/ComplexCron.js +10 -84
- package/Components/ComplexCron.js.map +1 -1
- package/Components/CustomModal.js +29 -54
- package/Components/CustomModal.js.map +1 -1
- package/Components/FileBrowser.js +15 -265
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.js +7 -68
- package/Components/FileViewer.js.map +1 -1
- package/Components/Icon.d.ts +1 -1
- package/Components/Icon.js +2 -42
- package/Components/Icon.js.map +1 -1
- package/Components/IconPicker.js +6 -28
- package/Components/IconPicker.js.map +1 -1
- package/Components/IconSelector.js +3 -55
- package/Components/IconSelector.js.map +1 -1
- package/Components/Image.js +1 -38
- package/Components/Image.js.map +1 -1
- package/Components/JsonConfigComponent/ChipInput.js +66 -197
- package/Components/JsonConfigComponent/ChipInput.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAlive.js +0 -31
- package/Components/JsonConfigComponent/ConfigAlive.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +6 -39
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +6 -52
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCRON.js +5 -39
- package/Components/JsonConfigComponent/ConfigCRON.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +4 -42
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -28
- package/Components/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigChip.js +4 -33
- package/Components/JsonConfigComponent/ConfigChip.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigColor.js +0 -34
- package/Components/JsonConfigComponent/ConfigColor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -33
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCustom.js +14 -73
- package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -25
- package/Components/JsonConfigComponent/ConfigDatePicker.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFile.js +0 -46
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.js +7 -126
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFunc.js +0 -34
- package/Components/JsonConfigComponent/ConfigFunc.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigGeneric.js +15 -110
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigIP.js +2 -35
- package/Components/JsonConfigComponent/ConfigIP.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigImageUpload.js +4 -44
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +1 -59
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +7 -40
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +2 -42
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js +2 -45
- package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.js +6 -40
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPanel.js +7 -91
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPassword.js +0 -42
- package/Components/JsonConfigComponent/ConfigPassword.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js +0 -25
- package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigRoom.js +0 -34
- package/Components/JsonConfigComponent/ConfigRoom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelect.js +4 -34
- package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +11 -67
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +8 -91
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.js +0 -55
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSlider.js +0 -28
- package/Components/JsonConfigComponent/ConfigSlider.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -21
- package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -24
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -23
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticText.js +0 -31
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +13 -105
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTabs.js +2 -35
- package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigText.js +0 -34
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -37
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -25
- package/Components/JsonConfigComponent/ConfigTimePicker.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTopic.js +0 -29
- package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigUser.js +2 -40
- package/Components/JsonConfigComponent/ConfigUser.js.map +1 -1
- package/Components/JsonConfigComponent/index.js +5 -81
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/Components/Loader.js +2 -20
- package/Components/Loader.js.map +1 -1
- package/Components/Loaders/PT.js +2 -20
- package/Components/Loaders/PT.js.map +1 -1
- package/Components/Loaders/Vendor.js +2 -21
- package/Components/Loaders/Vendor.js.map +1 -1
- package/Components/Logo.js +6 -39
- package/Components/Logo.js.map +1 -1
- package/Components/MDUtils.js +3 -27
- package/Components/MDUtils.js.map +1 -1
- package/Components/ObjectBrowser.d.ts +1 -1
- package/Components/ObjectBrowser.js +181 -788
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Router.js +7 -31
- package/Components/Router.js.map +1 -1
- package/Components/SaveCloseButtons.js +2 -32
- package/Components/SaveCloseButtons.js.map +1 -1
- package/Components/Schedule.js +29 -251
- package/Components/Schedule.js.map +1 -1
- package/Components/SelectWithIcon.d.ts +1 -1
- package/Components/SelectWithIcon.js +0 -48
- package/Components/SelectWithIcon.js.map +1 -1
- package/Components/SimpleCron/cron2text.js +45 -91
- package/Components/SimpleCron/cron2text.js.map +1 -1
- package/Components/SimpleCron/cronText.js +0 -6
- package/Components/SimpleCron/cronText.js.map +1 -1
- package/Components/SimpleCron/index.js +19 -102
- package/Components/SimpleCron/index.js.map +1 -1
- package/Components/SimpleCron/jquery.cron.locale.js +44 -24
- package/Components/SimpleCron/jquery.cron.locale.js.map +1 -1
- package/Components/TabContainer.js +2 -23
- package/Components/TabContainer.js.map +1 -1
- package/Components/TabContent.js +2 -22
- package/Components/TabContent.js.map +1 -1
- package/Components/TabHeader.js +1 -17
- package/Components/TabHeader.js.map +1 -1
- package/Components/TableResize.js +6 -51
- package/Components/TableResize.js.map +1 -1
- package/Components/TextWithIcon.js +0 -20
- package/Components/TextWithIcon.js.map +1 -1
- package/Components/ToggleThemeMenu.js +5 -13
- package/Components/ToggleThemeMenu.js.map +1 -1
- package/Components/TreeTable.js +4 -121
- package/Components/TreeTable.js.map +1 -1
- package/Components/UploadImage.js +17 -60
- package/Components/UploadImage.js.map +1 -1
- package/Components/Utils.js +87 -263
- package/Components/Utils.js.map +1 -1
- package/Components/copy-to-clipboard.js +16 -38
- package/Components/copy-to-clipboard.js.map +1 -1
- package/Components/withWidth.js +2 -10
- package/Components/withWidth.js.map +1 -1
- package/Connection.d.ts +1 -0
- package/Connection.js +156 -527
- package/Connection.js.map +1 -1
- package/Dialogs/ComplexCron.js +0 -34
- package/Dialogs/ComplexCron.js.map +1 -1
- package/Dialogs/Confirm.js +1 -39
- package/Dialogs/Confirm.js.map +1 -1
- package/Dialogs/Cron.js +1 -37
- package/Dialogs/Cron.js.map +1 -1
- package/Dialogs/Error.d.ts +1 -1
- package/Dialogs/Error.js +2 -29
- package/Dialogs/Error.js.map +1 -1
- package/Dialogs/FileSelect.js +2 -36
- package/Dialogs/FileSelect.js.map +1 -1
- package/Dialogs/Message.js +2 -27
- package/Dialogs/Message.js.map +1 -1
- package/Dialogs/SelectID.d.ts +1 -1
- package/Dialogs/SelectID.js +3 -40
- package/Dialogs/SelectID.js.map +1 -1
- package/Dialogs/SimpleCron.js +1 -33
- package/Dialogs/SimpleCron.js.map +1 -1
- package/Dialogs/TextInput.js +2 -34
- package/Dialogs/TextInput.js.map +1 -1
- package/GenericApp.js +54 -150
- package/GenericApp.js.map +1 -1
- package/Prompt.js +0 -2
- package/Prompt.js.map +1 -1
- package/README.md +8 -4
- package/Theme.js +7 -22
- package/Theme.js.map +1 -1
- package/i18n.d.ts +2 -0
- package/i18n.js +9 -29
- package/i18n.js.map +1 -1
- package/icons/IconAdapter.d.ts +2 -2
- package/icons/IconAdapter.js +2 -6
- package/icons/IconAdapter.js.map +1 -1
- package/icons/IconAlias.d.ts +2 -2
- package/icons/IconAlias.js +2 -6
- package/icons/IconAlias.js.map +1 -1
- package/icons/IconChannel.d.ts +2 -2
- package/icons/IconChannel.js +2 -6
- package/icons/IconChannel.js.map +1 -1
- package/icons/IconClearFilter.d.ts +2 -2
- package/icons/IconClearFilter.js +0 -5
- package/icons/IconClearFilter.js.map +1 -1
- package/icons/IconClosed.d.ts +2 -2
- package/icons/IconClosed.js +0 -5
- package/icons/IconClosed.js.map +1 -1
- package/icons/IconCopy.d.ts +2 -2
- package/icons/IconCopy.js +0 -5
- package/icons/IconCopy.js.map +1 -1
- package/icons/IconDevice.d.ts +2 -2
- package/icons/IconDevice.js +0 -5
- package/icons/IconDevice.js.map +1 -1
- package/icons/IconDocument.d.ts +2 -2
- package/icons/IconDocument.js +0 -5
- package/icons/IconDocument.js.map +1 -1
- package/icons/IconDocumentReadOnly.d.ts +2 -2
- package/icons/IconDocumentReadOnly.js +0 -5
- package/icons/IconDocumentReadOnly.js.map +1 -1
- package/icons/IconExpert.d.ts +2 -2
- package/icons/IconExpert.js +0 -5
- package/icons/IconExpert.js.map +1 -1
- package/icons/IconFx.d.ts +2 -2
- package/icons/IconFx.js +0 -5
- package/icons/IconFx.js.map +1 -1
- package/icons/IconInstance.d.ts +2 -2
- package/icons/IconInstance.js +0 -5
- package/icons/IconInstance.js.map +1 -1
- package/icons/IconLogout.d.ts +2 -2
- package/icons/IconLogout.js +0 -5
- package/icons/IconLogout.js.map +1 -1
- package/icons/IconNoIcon.d.ts +2 -2
- package/icons/IconNoIcon.js +0 -5
- package/icons/IconNoIcon.js.map +1 -1
- package/icons/IconOpen.d.ts +2 -2
- package/icons/IconOpen.js +0 -5
- package/icons/IconOpen.js.map +1 -1
- package/icons/IconState.d.ts +2 -2
- package/icons/IconState.js +0 -6
- package/icons/IconState.js.map +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigColor.js","names":["styles","theme","ConfigColor","state","showColorDialog","setState","colorDialogValue","value","onChange","props","attr","ColorPicker","getColor","error","disabled","defaultValue","ConfigGeneric","getValue","data","textColor","Utils","isUseBright","undefined","renderColorDialog","minWidth","width","getText","schema","label","e","color","target","style","backgroundColor","endAdornment","onPaste","stopPropagation","shrink","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigColor.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {withStyles} from '@mui/styles';\nimport { ChromePicker } from 'react-color';\n\nimport IconButton from '@mui/material/IconButton';\nimport TextField from '@mui/material/TextField';\nimport Dialog from '@mui/material/Dialog';\n\nimport ClearIcon from '@mui/icons-material/Close';\n\nimport Utils from '../Utils';\nimport ColorPicker from '../ColorPicker';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({});\n\nclass ConfigColor extends ConfigGeneric {\n renderColorDialog() {\n return !!this.state.showColorDialog && <Dialog\n onClose={() => this.setState({showColorDialog: false})}\n open={this.state.showColorDialog}>\n <ChromePicker\n color={this.state.colorDialogValue}\n onChange={value => {\n this.setState({colorDialogValue: value}, () =>\n this.onChange(this.props.attr, ColorPicker.getColor(this.state.colorDialogValue, true)));\n }}\n />\n </Dialog>;\n }\n\n renderItem(error, disabled, defaultValue) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let textColor = Utils.isUseBright(value, null);\n if (textColor === null) {\n textColor = undefined;\n }\n return <>\n { this.renderColorDialog() }\n <TextField\n variant=\"standard\"\n disabled={!!disabled}\n style={{minWidth: 100, width: 'calc(100% - 8px)'}}\n label={this.getText(this.props.schema.label)}\n value={value || ''}\n onClick={() => this.setState({showColorDialog: true, colorDialogValue: value})}\n onChange={e => {\n const color = e.target.value;\n this.onChange(this.props.attr, color);\n }}\n inputProps={{\n style: {\n //paddingLeft: noPadding ? 0 : 8,\n backgroundColor: value,\n color: textColor ? '#FFF' : '#000'\n }\n }}\n InputProps={{\n endAdornment: value ?\n <IconButton\n disabled={!!this.props.onPaste}\n size=\"small\"\n onClick={e => {\n e.stopPropagation();\n this.onChange(this.props.attr, '');\n }}>\n <ClearIcon/>\n </IconButton>\n : undefined,\n }}\n InputLabelProps={{shrink: true}}\n />\n </>;\n }\n}\n\nConfigColor.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigColor);"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigColor.js","names":["styles","theme","ConfigColor","state","showColorDialog","setState","colorDialogValue","value","onChange","props","attr","ColorPicker","getColor","error","disabled","defaultValue","ConfigGeneric","getValue","data","textColor","Utils","isUseBright","undefined","renderColorDialog","minWidth","width","getText","schema","label","e","color","target","style","backgroundColor","endAdornment","onPaste","stopPropagation","shrink","propTypes","socket","PropTypes","object","isRequired","themeType","string","themeName","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigColor.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {withStyles} from '@mui/styles';\nimport { ChromePicker } from 'react-color';\n\nimport IconButton from '@mui/material/IconButton';\nimport TextField from '@mui/material/TextField';\nimport Dialog from '@mui/material/Dialog';\n\nimport ClearIcon from '@mui/icons-material/Close';\n\nimport Utils from '../Utils';\nimport ColorPicker from '../ColorPicker';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({});\n\nclass ConfigColor extends ConfigGeneric {\n renderColorDialog() {\n return !!this.state.showColorDialog && <Dialog\n onClose={() => this.setState({showColorDialog: false})}\n open={this.state.showColorDialog}>\n <ChromePicker\n color={this.state.colorDialogValue}\n onChange={value => {\n this.setState({colorDialogValue: value}, () =>\n this.onChange(this.props.attr, ColorPicker.getColor(this.state.colorDialogValue, true)));\n }}\n />\n </Dialog>;\n }\n\n renderItem(error, disabled, defaultValue) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n let textColor = Utils.isUseBright(value, null);\n if (textColor === null) {\n textColor = undefined;\n }\n return <>\n { this.renderColorDialog() }\n <TextField\n variant=\"standard\"\n disabled={!!disabled}\n style={{minWidth: 100, width: 'calc(100% - 8px)'}}\n label={this.getText(this.props.schema.label)}\n value={value || ''}\n onClick={() => this.setState({showColorDialog: true, colorDialogValue: value})}\n onChange={e => {\n const color = e.target.value;\n this.onChange(this.props.attr, color);\n }}\n inputProps={{\n style: {\n //paddingLeft: noPadding ? 0 : 8,\n backgroundColor: value,\n color: textColor ? '#FFF' : '#000'\n }\n }}\n InputProps={{\n endAdornment: value ?\n <IconButton\n disabled={!!this.props.onPaste}\n size=\"small\"\n onClick={e => {\n e.stopPropagation();\n this.onChange(this.props.attr, '');\n }}>\n <ClearIcon/>\n </IconButton>\n : undefined,\n }}\n InputLabelProps={{shrink: true}}\n />\n </>;\n }\n}\n\nConfigColor.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigColor);"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAA4C;AAAA;AAE5C,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAGC,KAAK;EAAA,OAAK,CAAC,CAAC;AAAA,CAAC;AAAC,IAEvBC,WAAW;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OACb,6BAAoB;MA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C3B1B,IAAI,EAAEsB,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjCf,MAAM,EAAEa,qBAAS,CAACC,MAAM;EACxBM,OAAO,EAAEP,qBAAS,CAACQ,IAAI;EACvBxC,QAAQ,EAAEgC,qBAAS,CAACQ;AACxB,CAAC;AAAC,eAEa,IAAAC,kBAAU,EAACjD,MAAM,CAAC,CAACE,WAAW,CAAC;AAAA"}
|
|
@@ -1,44 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
15
|
-
|
|
16
11
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
14
|
var _react = _interopRequireDefault(require("react"));
|
|
23
|
-
|
|
24
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
16
|
var _styles = require("@mui/styles");
|
|
27
|
-
|
|
28
17
|
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
29
|
-
|
|
30
18
|
var _Fab = _interopRequireDefault(require("@mui/material/Fab"));
|
|
31
|
-
|
|
32
19
|
var _GpsFixed = _interopRequireDefault(require("@mui/icons-material/GpsFixed"));
|
|
33
|
-
|
|
34
20
|
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
35
|
-
|
|
36
21
|
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
37
|
-
|
|
38
22
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
39
|
-
|
|
40
23
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
-
|
|
42
24
|
var styles = function styles(theme) {
|
|
43
25
|
return {
|
|
44
26
|
width: {
|
|
@@ -46,26 +28,19 @@ var styles = function styles(theme) {
|
|
|
46
28
|
}
|
|
47
29
|
};
|
|
48
30
|
};
|
|
49
|
-
|
|
50
31
|
var ConfigCoordinates = /*#__PURE__*/function (_ConfigGeneric) {
|
|
51
32
|
(0, _inherits2["default"])(ConfigCoordinates, _ConfigGeneric);
|
|
52
|
-
|
|
53
33
|
var _super = _createSuper(ConfigCoordinates);
|
|
54
|
-
|
|
55
34
|
function ConfigCoordinates() {
|
|
56
35
|
(0, _classCallCheck2["default"])(this, ConfigCoordinates);
|
|
57
36
|
return _super.apply(this, arguments);
|
|
58
37
|
}
|
|
59
|
-
|
|
60
38
|
(0, _createClass2["default"])(ConfigCoordinates, [{
|
|
61
39
|
key: "componentDidMount",
|
|
62
40
|
value: function componentDidMount() {
|
|
63
41
|
var _this = this;
|
|
64
|
-
|
|
65
42
|
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigCoordinates.prototype), "componentDidMount", this).call(this);
|
|
66
|
-
|
|
67
43
|
var value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
68
|
-
|
|
69
44
|
if (!value && this.props.schema.autoInit) {
|
|
70
45
|
setTimeout(function () {
|
|
71
46
|
return _this.getCoordinates();
|
|
@@ -76,11 +51,9 @@ var ConfigCoordinates = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
76
51
|
key: "getSystemCoordinates",
|
|
77
52
|
value: function getSystemCoordinates() {
|
|
78
53
|
var _this2 = this;
|
|
79
|
-
|
|
80
54
|
return this.props.socket.getSystemConfig().then(function (obj) {
|
|
81
55
|
if (obj && obj.common && (obj.common.longitude || obj.common.latitude)) {
|
|
82
56
|
window.alert(_i18n["default"].t('ra_Used system settings'));
|
|
83
|
-
|
|
84
57
|
_this2.setState({
|
|
85
58
|
value: obj.common.latitude + (_this2.props.schema.divider || ',') + obj.common.longitude
|
|
86
59
|
});
|
|
@@ -93,7 +66,6 @@ var ConfigCoordinates = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
93
66
|
key: "getCoordinates",
|
|
94
67
|
value: function getCoordinates() {
|
|
95
68
|
var _this3 = this;
|
|
96
|
-
|
|
97
69
|
if (navigator.geolocation) {
|
|
98
70
|
navigator.geolocation.getCurrentPosition(function (position) {
|
|
99
71
|
if (position && position.coords) {
|
|
@@ -114,7 +86,6 @@ var ConfigCoordinates = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
114
86
|
key: "renderItem",
|
|
115
87
|
value: function renderItem(error, disabled, defaultValue) {
|
|
116
88
|
var _this4 = this;
|
|
117
|
-
|
|
118
89
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
119
90
|
variant: "standard",
|
|
120
91
|
className: this.props.classes.width,
|
|
@@ -126,7 +97,6 @@ var ConfigCoordinates = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
126
97
|
},
|
|
127
98
|
onChange: function onChange(e) {
|
|
128
99
|
var value = e.target.value;
|
|
129
|
-
|
|
130
100
|
_this4.setState({
|
|
131
101
|
value: value
|
|
132
102
|
}, function () {
|
|
@@ -146,7 +116,6 @@ var ConfigCoordinates = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
146
116
|
}]);
|
|
147
117
|
return ConfigCoordinates;
|
|
148
118
|
}(_ConfigGeneric2["default"]);
|
|
149
|
-
|
|
150
119
|
ConfigCoordinates.propTypes = {
|
|
151
120
|
socket: _propTypes["default"].object.isRequired,
|
|
152
121
|
themeType: _propTypes["default"].string,
|
|
@@ -158,8 +127,6 @@ ConfigCoordinates.propTypes = {
|
|
|
158
127
|
onError: _propTypes["default"].func,
|
|
159
128
|
onChange: _propTypes["default"].func
|
|
160
129
|
};
|
|
161
|
-
|
|
162
130
|
var _default = (0, _styles.withStyles)(styles)(ConfigCoordinates);
|
|
163
|
-
|
|
164
131
|
exports["default"] = _default;
|
|
165
132
|
//# sourceMappingURL=ConfigCoordinates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigCoordinates.js","names":["styles","theme","width","ConfigCoordinates","value","ConfigGeneric","getValue","props","data","attr","schema","autoInit","setTimeout","getCoordinates","socket","getSystemConfig","then","obj","common","longitude","latitude","window","alert","I18n","t","setState","divider","navigator","geolocation","getCurrentPosition","position","coords","getSystemCoordinates","error","disabled","defaultValue","classes","state","undefined","maxLength","max","e","target","onChange","trim","getText","placeholder","label","renderHelp","help","helpLink","noTranslation","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCoordinates.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport TextField from '@mui/material/TextField';\nimport Fab from '@mui/material/Fab';\n\nimport IconGpsFixed from '@mui/icons-material/GpsFixed';\n\nimport I18n from '../../i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n width: {\n width: 'calc(100% - 40px)',\n }\n});\n\nclass ConfigCoordinates extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n if (!value && this.props.schema.autoInit) {\n setTimeout(() => this.getCoordinates(), 300);\n }\n }\n\n getSystemCoordinates() {\n return this.props.socket.getSystemConfig()\n .then(obj => {\n if (obj && obj.common && (obj.common.longitude || obj.common.latitude)) {\n window.alert(I18n.t('ra_Used system settings'));\n this.setState({ value: obj.common.latitude + (this.props.schema.divider || ',') + obj.common.longitude });\n } else {\n window.alert(I18n.t('ra_Cannot determine position: System settings are empty and GPS detection is disabled in browser'));\n }\n });\n }\n\n getCoordinates() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n position => {\n if (position && position.coords) {\n this.setState({value: position.coords.latitude + (this.props.schema.divider || ',') + position.coords.longitude});\n } else {\n this.getSystemCoordinates();\n }\n },\n error => {\n this.getSystemCoordinates();\n }\n );\n } else {\n this.getSystemCoordinates();\n }\n }\n\n renderItem(error, disabled, defaultValue) {\n return <>\n <TextField\n variant=\"standard\"\n className={this.props.classes.width}\n value={this.state.value === null || this.state.value === undefined ? '' : this.state.value}\n error={!!error}\n disabled={!!disabled}\n inputProps={{maxLength: this.props.schema.maxLength || this.props.schema.max || undefined}}\n onChange={e => {\n const value = e.target.value;\n this.setState({value}, () =>\n this.onChange(this.props.attr, (value || '').trim()));\n }}\n placeholder={this.getText(this.props.schema.placeholder)}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}\n />\n <Fab size=\"small\" onClick={() => this.getCoordinates()}><IconGpsFixed /></Fab>\n </>;\n }\n}\n\nConfigCoordinates.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigCoordinates);"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfigCoordinates.js","names":["styles","theme","width","ConfigCoordinates","value","ConfigGeneric","getValue","props","data","attr","schema","autoInit","setTimeout","getCoordinates","socket","getSystemConfig","then","obj","common","longitude","latitude","window","alert","I18n","t","setState","divider","navigator","geolocation","getCurrentPosition","position","coords","getSystemCoordinates","error","disabled","defaultValue","classes","state","undefined","maxLength","max","e","target","onChange","trim","getText","placeholder","label","renderHelp","help","helpLink","noTranslation","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigCoordinates.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport TextField from '@mui/material/TextField';\nimport Fab from '@mui/material/Fab';\n\nimport IconGpsFixed from '@mui/icons-material/GpsFixed';\n\nimport I18n from '../../i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n width: {\n width: 'calc(100% - 40px)',\n }\n});\n\nclass ConfigCoordinates extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n if (!value && this.props.schema.autoInit) {\n setTimeout(() => this.getCoordinates(), 300);\n }\n }\n\n getSystemCoordinates() {\n return this.props.socket.getSystemConfig()\n .then(obj => {\n if (obj && obj.common && (obj.common.longitude || obj.common.latitude)) {\n window.alert(I18n.t('ra_Used system settings'));\n this.setState({ value: obj.common.latitude + (this.props.schema.divider || ',') + obj.common.longitude });\n } else {\n window.alert(I18n.t('ra_Cannot determine position: System settings are empty and GPS detection is disabled in browser'));\n }\n });\n }\n\n getCoordinates() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n position => {\n if (position && position.coords) {\n this.setState({value: position.coords.latitude + (this.props.schema.divider || ',') + position.coords.longitude});\n } else {\n this.getSystemCoordinates();\n }\n },\n error => {\n this.getSystemCoordinates();\n }\n );\n } else {\n this.getSystemCoordinates();\n }\n }\n\n renderItem(error, disabled, defaultValue) {\n return <>\n <TextField\n variant=\"standard\"\n className={this.props.classes.width}\n value={this.state.value === null || this.state.value === undefined ? '' : this.state.value}\n error={!!error}\n disabled={!!disabled}\n inputProps={{maxLength: this.props.schema.maxLength || this.props.schema.max || undefined}}\n onChange={e => {\n const value = e.target.value;\n this.setState({value}, () =>\n this.onChange(this.props.attr, (value || '').trim()));\n }}\n placeholder={this.getText(this.props.schema.placeholder)}\n label={this.getText(this.props.schema.label)}\n helperText={this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}\n />\n <Fab size=\"small\" onClick={() => this.getCoordinates()}><IconGpsFixed /></Fab>\n </>;\n }\n}\n\nConfigCoordinates.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigCoordinates);"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AAEA;AAA4C;AAAA;AAE5C,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAGC,KAAK;EAAA,OAAK;IACrBC,KAAK,EAAE;MACHA,KAAK,EAAE;IACX;EACJ,CAAC;AAAA,CAAC;AAAC,IAEGC,iBAAiB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OACnB,6BAAoB;MAAA;MAChB;MACA,IAAMC,KAAK,GAAGC,0BAAa,CAACC,QAAQ,CAAC,IAAI,CAACC,KAAK,CAACC,IAAI,EAAE,IAAI,CAACD,KAAK,CAACE,IAAI,CAAC;MACtE,IAAI,CAACL,KAAK,IAAI,IAAI,CAACG,KAAK,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AACG,MAAM,CAACqC,KAAK,CAAE;QAC7C,UAAU,EAAE,IAAI,CAACC,UAAU,CAAC,IAAI,CAACzC,KAAK,CAACG,MAAM,CAACuC,IAAI,EAAE,IAAI,CAAC1C,KAAK,CAACG,MAAM,CAACwC,QAAQ,EAAE,IAAI,CAAC3C,KAAK,CAACG,MAAM,CAACyC,aAAa;MAAE,EACnH,eACF,gCAAC,eAAG;QAAC,IAAI,EAAC,OAAO;QAAC,OAAO,EAAE;UAAA,OAAM,MAAI,CAACtC,cAAc,EAAE;QAAA;MAAC,gBAAC,gCAAC,oBAAY,OAAG,CAAM,CAC/E;IACP;EAAC;EAAA;AAAA,EA5D2BR,0BAAa;AA+D7CF,iBAAiB,CAACiD,SAAS,GAAG;EAC1BtC,MAAM,EAAEuC,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnCC,SAAS,EAAEH,qBAAS,CAACI,MAAM;EAC3BC,SAAS,EAAEL,qBAAS,CAACI,MAAM;EAC3BE,KAAK,EAAEN,qBAAS,CAACC,MAAM;EACvBM,SAAS,EAAEP,qBAAS,CAACI,MAAM;EAC3BjD,IAAI,EAAE6C,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjC7C,MAAM,EAAE2C,qBAAS,CAACC,MAAM;EACxBO,OAAO,EAAER,qBAAS,CAACS,IAAI;EACvBnB,QAAQ,EAAEU,qBAAS,CAACS;AACxB,CAAC;AAAC,eAEa,IAAAC,kBAAU,EAAC/D,MAAM,CAAC,CAACG,iBAAiB,CAAC;AAAA"}
|
|
@@ -1,58 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
10
|
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
|
|
15
|
-
|
|
16
11
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
|
-
|
|
18
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
19
|
-
|
|
20
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
21
|
-
|
|
22
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
-
|
|
24
15
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
-
|
|
26
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
-
|
|
28
17
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
29
|
-
|
|
30
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
31
|
-
|
|
32
19
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
33
|
-
|
|
34
20
|
var _LinearProgress = _interopRequireDefault(require("@mui/material/LinearProgress"));
|
|
35
|
-
|
|
36
21
|
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
37
|
-
|
|
38
22
|
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
39
|
-
|
|
40
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
41
|
-
|
|
42
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
|
-
|
|
44
25
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
45
|
-
|
|
46
26
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
|
-
|
|
48
27
|
var getOrLoadRemote = function getOrLoadRemote(remote, shareScope) {
|
|
49
28
|
var remoteFallbackUrl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
50
29
|
return new Promise(function (resolve, reject) {
|
|
51
30
|
// check if remote exists on window
|
|
52
31
|
if (!window[remote]) {
|
|
53
32
|
// search dom to see if remote tag exists, but might still be loading (async)
|
|
54
|
-
var existingRemote = document.querySelector("script[data-webpack=\"".concat(remote, "\"]"));
|
|
55
|
-
|
|
33
|
+
var existingRemote = document.querySelector("script[data-webpack=\"".concat(remote, "\"]"));
|
|
34
|
+
// when remote is loaded.
|
|
56
35
|
var onload = /*#__PURE__*/function () {
|
|
57
36
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
58
37
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
@@ -63,44 +42,34 @@ var getOrLoadRemote = function getOrLoadRemote(remote, shareScope) {
|
|
|
63
42
|
_context.next = 12;
|
|
64
43
|
break;
|
|
65
44
|
}
|
|
66
|
-
|
|
67
45
|
if (window[remote].__initialized) {
|
|
68
46
|
_context.next = 10;
|
|
69
47
|
break;
|
|
70
48
|
}
|
|
71
|
-
|
|
72
49
|
if (!(typeof __webpack_share_scopes__ === 'undefined')) {
|
|
73
50
|
_context.next = 7;
|
|
74
51
|
break;
|
|
75
52
|
}
|
|
76
|
-
|
|
77
53
|
_context.next = 5;
|
|
78
54
|
return window[remote].init(shareScope["default"]);
|
|
79
|
-
|
|
80
55
|
case 5:
|
|
81
56
|
_context.next = 9;
|
|
82
57
|
break;
|
|
83
|
-
|
|
84
58
|
case 7:
|
|
85
59
|
_context.next = 9;
|
|
86
60
|
return window[remote].init(__webpack_share_scopes__[shareScope]);
|
|
87
|
-
|
|
88
61
|
case 9:
|
|
89
62
|
// mark remote as initialized
|
|
90
63
|
window[remote].__initialized = true;
|
|
91
|
-
|
|
92
64
|
case 10:
|
|
93
65
|
_context.next = 14;
|
|
94
66
|
break;
|
|
95
|
-
|
|
96
67
|
case 12:
|
|
97
68
|
console.error('Cannot load ' + remote);
|
|
98
69
|
return _context.abrupt("return", reject('Cannot load ' + remote));
|
|
99
|
-
|
|
100
70
|
case 14:
|
|
101
71
|
// resolve promise so marking remote as loaded
|
|
102
72
|
resolve(window[remote]);
|
|
103
|
-
|
|
104
73
|
case 15:
|
|
105
74
|
case "end":
|
|
106
75
|
return _context.stop();
|
|
@@ -108,23 +77,22 @@ var getOrLoadRemote = function getOrLoadRemote(remote, shareScope) {
|
|
|
108
77
|
}
|
|
109
78
|
}, _callee);
|
|
110
79
|
}));
|
|
111
|
-
|
|
112
80
|
return function onload() {
|
|
113
81
|
return _ref.apply(this, arguments);
|
|
114
82
|
};
|
|
115
83
|
}();
|
|
116
|
-
|
|
117
84
|
if (existingRemote) {
|
|
118
85
|
// if existing remote but not loaded, hook into its onload and wait for it to be ready
|
|
119
86
|
existingRemote.onload = onload;
|
|
120
|
-
existingRemote.onerror = reject;
|
|
87
|
+
existingRemote.onerror = reject;
|
|
88
|
+
// check if remote fallback exists as param passed to function
|
|
121
89
|
// TODO: should scan public config for a matching key if no override exists
|
|
122
90
|
} else if (remoteFallbackUrl) {
|
|
123
91
|
// inject remote if a fallback exists and call the same onload function
|
|
124
92
|
var d = document;
|
|
125
93
|
var script = d.createElement('script');
|
|
126
|
-
script.type = 'text/javascript';
|
|
127
|
-
|
|
94
|
+
script.type = 'text/javascript';
|
|
95
|
+
// mark as data-webpack so runtime can track it internally
|
|
128
96
|
script.setAttribute('data-webpack', "".concat(remote));
|
|
129
97
|
script.async = true;
|
|
130
98
|
script.onerror = reject;
|
|
@@ -141,7 +109,6 @@ var getOrLoadRemote = function getOrLoadRemote(remote, shareScope) {
|
|
|
141
109
|
}
|
|
142
110
|
});
|
|
143
111
|
};
|
|
144
|
-
|
|
145
112
|
var loadComponent = function loadComponent(remote, sharedScope, module, url) {
|
|
146
113
|
return /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
147
114
|
var container, factory, Module;
|
|
@@ -151,17 +118,14 @@ var loadComponent = function loadComponent(remote, sharedScope, module, url) {
|
|
|
151
118
|
case 0:
|
|
152
119
|
_context2.next = 2;
|
|
153
120
|
return getOrLoadRemote(remote, sharedScope, url);
|
|
154
|
-
|
|
155
121
|
case 2:
|
|
156
122
|
container = _context2.sent;
|
|
157
123
|
_context2.next = 5;
|
|
158
124
|
return container.get(module);
|
|
159
|
-
|
|
160
125
|
case 5:
|
|
161
126
|
factory = _context2.sent;
|
|
162
127
|
Module = factory();
|
|
163
128
|
return _context2.abrupt("return", Module);
|
|
164
|
-
|
|
165
129
|
case 8:
|
|
166
130
|
case "end":
|
|
167
131
|
return _context2.stop();
|
|
@@ -170,17 +134,14 @@ var loadComponent = function loadComponent(remote, sharedScope, module, url) {
|
|
|
170
134
|
}, _callee2);
|
|
171
135
|
}));
|
|
172
136
|
};
|
|
173
|
-
|
|
174
137
|
var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
175
138
|
(0, _inherits2["default"])(ConfigCustom, _Component);
|
|
176
|
-
|
|
177
139
|
var _super = _createSuper(ConfigCustom);
|
|
178
|
-
|
|
179
140
|
function ConfigCustom(props) {
|
|
180
141
|
var _this;
|
|
181
|
-
|
|
182
142
|
(0, _classCallCheck2["default"])(this, ConfigCustom);
|
|
183
|
-
_this = _super.call(this, props);
|
|
143
|
+
_this = _super.call(this, props);
|
|
144
|
+
// schema.url - location of Widget
|
|
184
145
|
// schema.name - Component name
|
|
185
146
|
// schema.i18n - i18n
|
|
186
147
|
|
|
@@ -189,15 +150,14 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
189
150
|
error: ''
|
|
190
151
|
};
|
|
191
152
|
return _this;
|
|
192
|
-
}
|
|
193
|
-
|
|
153
|
+
}
|
|
194
154
|
|
|
155
|
+
// load component dynamically
|
|
195
156
|
(0, _createClass2["default"])(ConfigCustom, [{
|
|
196
157
|
key: "componentDidMount",
|
|
197
158
|
value: function () {
|
|
198
159
|
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
199
160
|
var url, pos, i18nURL, lang, file, _this$props$schema$na, _this$props$schema$na2, uniqueName, fileToLoad, componentName, component, keys;
|
|
200
|
-
|
|
201
161
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
202
162
|
while (1) {
|
|
203
163
|
switch (_context3.prev = _context3.next) {
|
|
@@ -206,13 +166,11 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
206
166
|
_context3.next = 4;
|
|
207
167
|
break;
|
|
208
168
|
}
|
|
209
|
-
|
|
210
169
|
console.error('URL is empty. Cannot load custom component!');
|
|
211
170
|
this.setState({
|
|
212
171
|
error: 'URL is empty. Cannot load custom component!'
|
|
213
172
|
});
|
|
214
173
|
return _context3.abrupt("return");
|
|
215
|
-
|
|
216
174
|
case 4:
|
|
217
175
|
/*if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {
|
|
218
176
|
url = this.props.schema.url;
|
|
@@ -222,21 +180,17 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
222
180
|
} else {
|
|
223
181
|
url = "".concat(window.location.protocol, "//").concat(window.location.host, "/adapter/").concat(this.props.adapterName, "/").concat(this.props.schema.url);
|
|
224
182
|
}
|
|
225
|
-
|
|
226
183
|
if (!(this.props.schema.i18n === true)) {
|
|
227
184
|
_context3.next = 14;
|
|
228
185
|
break;
|
|
229
186
|
}
|
|
230
|
-
|
|
231
187
|
// load i18n from files
|
|
232
188
|
pos = url.lastIndexOf('/');
|
|
233
|
-
|
|
234
189
|
if (pos !== -1) {
|
|
235
190
|
i18nURL = url.substring(0, pos);
|
|
236
191
|
} else {
|
|
237
192
|
i18nURL = url;
|
|
238
193
|
}
|
|
239
|
-
|
|
240
194
|
lang = _i18n["default"].getLanguage();
|
|
241
195
|
file = "".concat(i18nURL, "/i18n/").concat(lang, ".json");
|
|
242
196
|
_context3.next = 12;
|
|
@@ -247,11 +201,9 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
247
201
|
})["catch"](function (error) {
|
|
248
202
|
return console.log("Cannot load i18n \"".concat(file, "\": ").concat(error));
|
|
249
203
|
});
|
|
250
|
-
|
|
251
204
|
case 12:
|
|
252
205
|
_context3.next = 15;
|
|
253
206
|
break;
|
|
254
|
-
|
|
255
207
|
case 14:
|
|
256
208
|
if (this.props.schema.i18n && (0, _typeof2["default"])(this.props.schema.i18n) === 'object') {
|
|
257
209
|
try {
|
|
@@ -260,18 +212,15 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
260
212
|
console.error("Cannot import i18n: ".concat(error));
|
|
261
213
|
}
|
|
262
214
|
}
|
|
263
|
-
|
|
264
215
|
case 15:
|
|
265
216
|
_context3.prev = 15;
|
|
266
217
|
_this$props$schema$na = this.props.schema.name.split('/'), _this$props$schema$na2 = (0, _toArray2["default"])(_this$props$schema$na), uniqueName = _this$props$schema$na2[0], fileToLoad = _this$props$schema$na2[1], componentName = _this$props$schema$na2.slice(2);
|
|
267
|
-
console.log(uniqueName, fileToLoad, componentName.join('/'));
|
|
268
|
-
|
|
218
|
+
console.log(uniqueName, fileToLoad, componentName.join('/'));
|
|
219
|
+
// const component = await window.importFederation(uniqueName, {url, format: 'esm', from: 'vite'}, fileToLoad);
|
|
269
220
|
_context3.next = 20;
|
|
270
221
|
return loadComponent(uniqueName, 'default', "./".concat(fileToLoad), url)();
|
|
271
|
-
|
|
272
222
|
case 20:
|
|
273
223
|
component = _context3.sent["default"];
|
|
274
|
-
|
|
275
224
|
if (!component || !component || !component[componentName.join('/')]) {
|
|
276
225
|
keys = Object.keys(component || {});
|
|
277
226
|
console.error('URL is empty. Cannot load custom component!');
|
|
@@ -283,17 +232,14 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
283
232
|
Component: component[componentName.join('/')]
|
|
284
233
|
});
|
|
285
234
|
}
|
|
286
|
-
|
|
287
235
|
_context3.next = 27;
|
|
288
236
|
break;
|
|
289
|
-
|
|
290
237
|
case 24:
|
|
291
238
|
_context3.prev = 24;
|
|
292
239
|
_context3.t0 = _context3["catch"](15);
|
|
293
240
|
this.setState({
|
|
294
241
|
error: "Cannot import from ".concat(this.props.schema.url, ": ").concat(_context3.t0)
|
|
295
242
|
});
|
|
296
|
-
|
|
297
243
|
case 27:
|
|
298
244
|
case "end":
|
|
299
245
|
return _context3.stop();
|
|
@@ -301,24 +247,22 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
301
247
|
}
|
|
302
248
|
}, _callee3, this, [[15, 24]]);
|
|
303
249
|
}));
|
|
304
|
-
|
|
305
250
|
function componentDidMount() {
|
|
306
251
|
return _componentDidMount.apply(this, arguments);
|
|
307
252
|
}
|
|
308
|
-
|
|
309
253
|
return componentDidMount;
|
|
310
254
|
}()
|
|
311
255
|
}, {
|
|
312
256
|
key: "render",
|
|
313
257
|
value: function render() {
|
|
314
|
-
var Component = this.state.Component;
|
|
258
|
+
var Component = this.state.Component;
|
|
315
259
|
|
|
260
|
+
// render temporary placeholder
|
|
316
261
|
if (!Component) {
|
|
317
262
|
if (this.state.error) {
|
|
318
263
|
return;
|
|
319
264
|
} else {
|
|
320
265
|
var schema = this.props.schema || {};
|
|
321
|
-
|
|
322
266
|
var item = /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
323
267
|
item: true,
|
|
324
268
|
xs: schema.xs || undefined,
|
|
@@ -332,7 +276,6 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
332
276
|
width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined
|
|
333
277
|
}, schema.style, this.props.themeType === 'dark' ? schema.darkStyle : {})
|
|
334
278
|
}, this.state.error ? /*#__PURE__*/_react["default"].createElement("div", null, this.state.error) : /*#__PURE__*/_react["default"].createElement(_LinearProgress["default"], null));
|
|
335
|
-
|
|
336
279
|
if (schema.newLine) {
|
|
337
280
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
338
281
|
style: {
|
|
@@ -345,13 +288,11 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
345
288
|
}
|
|
346
289
|
}
|
|
347
290
|
}
|
|
348
|
-
|
|
349
291
|
return /*#__PURE__*/_react["default"].createElement(Component, this.props);
|
|
350
292
|
}
|
|
351
293
|
}]);
|
|
352
294
|
return ConfigCustom;
|
|
353
295
|
}(_react.Component);
|
|
354
|
-
|
|
355
296
|
ConfigCustom.propTypes = {
|
|
356
297
|
socket: _propTypes["default"].object,
|
|
357
298
|
themeType: _propTypes["default"].string,
|