@iobroker/adapter-react-v5 4.7.15 → 4.8.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.
- package/Components/JsonConfigComponent/ConfigAccordion.d.ts +1 -1
- package/Components/JsonConfigComponent/ConfigAccordion.js +4 -6
- package/Components/JsonConfigComponent/ConfigAccordion.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAlive.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +36 -13
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +66 -164
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +16 -13
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +119 -251
- package/Components/JsonConfigComponent/ConfigCRON.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigCertificates.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +14 -13
- package/Components/JsonConfigComponent/ConfigCheckbox.js +37 -79
- package/Components/JsonConfigComponent/ConfigChip.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigColor.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +6 -0
- package/Components/JsonConfigComponent/ConfigDeviceManager.js +18 -0
- package/Components/JsonConfigComponent/ConfigFile.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigFile.js +2 -2
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.js +8 -5
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFunc.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +12 -4
- package/Components/JsonConfigComponent/ConfigGeneric.js +11 -2
- package/Components/JsonConfigComponent/ConfigIP.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigImageUpload.js +38 -44
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigInterface.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigInterface.js +1 -1
- package/Components/JsonConfigComponent/ConfigInterface.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.d.ts +6 -13
- package/Components/JsonConfigComponent/ConfigLanguage.js +105 -154
- package/Components/JsonConfigComponent/ConfigLicense.d.ts +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigPanel.js +8 -1
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPassword.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigPattern.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigRoom.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigSelect.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigSendto.d.ts +23 -17
- package/Components/JsonConfigComponent/ConfigSendto.js +259 -399
- package/Components/JsonConfigComponent/ConfigSetState.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigSlider.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigStaticText.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigText.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigText.js +18 -0
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigTopic.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigUUID.d.ts +2 -2
- package/Components/JsonConfigComponent/ConfigUser.d.ts +2 -2
- package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +63 -0
- package/Components/JsonConfigComponent/DeviceManager/Communication.js +268 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +11 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +15 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +53 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +340 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +45 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +146 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +12 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +69 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +51 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +216 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +13 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +111 -0
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +7 -0
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +16 -0
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +11 -0
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +94 -0
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +10 -0
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +22 -0
- package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +12 -0
- package/Components/JsonConfigComponent/DeviceManager/Utils.js +158 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +26 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/index.d.ts +2 -0
- package/Components/JsonConfigComponent/DeviceManager/index.js +10 -0
- package/Components/JsonConfigComponent/DeviceManager/index.js.map +1 -0
- package/Components/JsonConfigComponent/index.js +2 -7
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/Components/TextWithIcon.d.ts +1 -1
- package/Dialogs/ComplexCron.js +15 -17
- package/Dialogs/ComplexCron.js.map +1 -1
- package/Dialogs/Confirm.d.ts +20 -44
- package/Dialogs/Confirm.js +102 -158
- package/Dialogs/Error.d.ts +20 -39
- package/Dialogs/Error.js +50 -76
- package/Dialogs/Message.d.ts +22 -32
- package/Dialogs/Message.js +51 -83
- package/LegacyConnection.d.ts +3 -3
- package/README.md +7 -4
- package/i18n.d.ts +6 -6
- package/package.json +6 -5
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSendto.js.map +0 -1
- package/Dialogs/Confirm.js.map +0 -1
- package/Dialogs/Error.js.map +0 -1
- package/Dialogs/Message.js.map +0 -1
package/Dialogs/Confirm.js
CHANGED
|
@@ -1,170 +1,114 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
-
var _react = _interopRequireDefault(require("react"));
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
var _styles = require("@mui/styles");
|
|
16
|
-
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
17
|
-
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
18
|
-
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
19
|
-
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
20
|
-
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
21
|
-
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
22
|
-
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
23
|
-
var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
24
|
-
var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
|
|
25
|
-
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
26
|
-
var _i18n = _interopRequireDefault(require("../i18n"));
|
|
27
|
-
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); }; }
|
|
28
|
-
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; } } /**
|
|
2
|
+
/**
|
|
29
3
|
* Copyright 2019-2023 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
30
4
|
*
|
|
31
5
|
* MIT License
|
|
32
6
|
*
|
|
33
|
-
**/
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
7
|
+
**/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
36
|
+
const react_1 = __importStar(require("react"));
|
|
37
|
+
const styles_1 = require("@mui/styles");
|
|
38
|
+
const material_1 = require("@mui/material");
|
|
39
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
40
|
+
const i18n_1 = __importDefault(require("../i18n"));
|
|
41
|
+
const styles = {
|
|
42
|
+
suppress: {
|
|
43
|
+
fontSize: 12,
|
|
44
|
+
},
|
|
45
|
+
suppressRoot: {
|
|
46
|
+
marginTop: 16,
|
|
47
|
+
},
|
|
41
48
|
};
|
|
42
|
-
|
|
43
49
|
/**
|
|
44
|
-
* @
|
|
45
|
-
* @property
|
|
46
|
-
* @property
|
|
47
|
-
* @property
|
|
48
|
-
* @property
|
|
49
|
-
* @property
|
|
50
|
-
* @property
|
|
51
|
-
* @property
|
|
52
|
-
* @property {(ok: boolean) => void} [onClose] Close handler.
|
|
53
|
-
*
|
|
54
|
-
* @extends {React.Component<DialogConfirmProps>}
|
|
50
|
+
* @property title The dialog title; default: Are you sure? (translated)
|
|
51
|
+
* @property text The dialog text.
|
|
52
|
+
* @property ok The ok button text; default: OK (translated)
|
|
53
|
+
* @property cancel The cancel button text; default: Cancel (translated)
|
|
54
|
+
* @property suppressQuestionMinutes interval in minutes for which the confirmation dialog will be suppressed if activated.
|
|
55
|
+
* @property suppressText The suppress checkbox text; default: Suppress question for next %s minutes (translated)
|
|
56
|
+
* @property dialogName Name of the dialog. Used only with suppressQuestionMinutes to store the user choice
|
|
57
|
+
* @property onClose Close handler.
|
|
55
58
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
class DialogConfirm extends react_1.Component {
|
|
60
|
+
constructor(props) {
|
|
61
|
+
super(props);
|
|
62
|
+
if (!this.props.dialogName && this.props.suppressQuestionMinutes) {
|
|
63
|
+
throw new Error('dialogName required if suppressQuestionMinutes used');
|
|
64
|
+
}
|
|
65
|
+
let suppress = false;
|
|
66
|
+
if (this.props.suppressQuestionMinutes) {
|
|
67
|
+
suppress = parseInt((window._localStorage || window.localStorage).getItem(this.props.dialogName), 10) || 0;
|
|
68
|
+
if (!suppress) {
|
|
69
|
+
suppress = false;
|
|
70
|
+
}
|
|
71
|
+
else if (Date.now() > suppress) {
|
|
72
|
+
(window._localStorage || window.localStorage).removeItem(this.props.dialogName);
|
|
73
|
+
suppress = false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
this.state = {
|
|
77
|
+
suppress,
|
|
78
|
+
};
|
|
65
79
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
} else if (Date.now() > suppress) {
|
|
72
|
-
(window._localStorage || window.localStorage).removeItem(_this.props.dialogName);
|
|
73
|
-
suppress = false;
|
|
74
|
-
}
|
|
80
|
+
handleOk() {
|
|
81
|
+
if (this.state.suppress) {
|
|
82
|
+
(window._localStorage || window.localStorage).setItem(this.props.dialogName, Date.now() + (this.props.suppressQuestionMinutes || 2) * 60000);
|
|
83
|
+
}
|
|
84
|
+
this.props.onClose && this.props.onClose(true);
|
|
75
85
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
return _this;
|
|
80
|
-
}
|
|
81
|
-
(0, _createClass2["default"])(DialogConfirm, [{
|
|
82
|
-
key: "handleOk",
|
|
83
|
-
value: function handleOk() {
|
|
84
|
-
if (this.state.suppress) {
|
|
85
|
-
(window._localStorage || window.localStorage).setItem(this.props.dialogName, Date.now() + this.props.suppressQuestionMinutes * 60000);
|
|
86
|
-
}
|
|
87
|
-
this.props.onClose && this.props.onClose(true);
|
|
86
|
+
handleCancel() {
|
|
87
|
+
this.props.onClose && this.props.onClose(false);
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
render() {
|
|
90
|
+
if (typeof this.state.suppress === 'number') {
|
|
91
|
+
setTimeout(() => this.props.onClose && this.props.onClose(true), 100);
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return react_1.default.createElement(material_1.Dialog, { open: !0, maxWidth: "md", fullWidth: this.props.fullWidth !== undefined ? this.props.fullWidth : true, onClose: (event, reason) => {
|
|
95
|
+
if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {
|
|
96
|
+
this.handleCancel();
|
|
97
|
+
}
|
|
98
|
+
}, "aria-labelledby": "ar_confirmation_dialog_title", "aria-describedby": "ar_confirmation_dialog_description" },
|
|
99
|
+
react_1.default.createElement(material_1.DialogTitle, { id: "ar_confirmation_dialog_title" }, this.props.title || i18n_1.default.t('ra_Are you sure?')),
|
|
100
|
+
react_1.default.createElement(material_1.DialogContent, null,
|
|
101
|
+
react_1.default.createElement(material_1.DialogContentText, { id: "ar_confirmation_dialog_description" },
|
|
102
|
+
this.props.icon || null,
|
|
103
|
+
this.props.text,
|
|
104
|
+
this.props.suppressQuestionMinutes ? react_1.default.createElement("br", null) : null,
|
|
105
|
+
this.props.suppressQuestionMinutes ? react_1.default.createElement(material_1.FormControlLabel, { classes: { label: this.props.classes.suppress, root: this.props.classes.suppressRoot }, control: react_1.default.createElement(material_1.Checkbox, { id: `ar_dialog_confirm_suppress_${this.props.dialogName || ''}`, checked: !!this.state.suppress, onChange: () => this.setState({ suppress: !this.state.suppress }) }), label: this.props.suppressText || i18n_1.default.t('ra_Suppress question for next %s minutes', (this.props.suppressQuestionMinutes || 2).toString()) }) : null)),
|
|
106
|
+
react_1.default.createElement(material_1.DialogActions, null,
|
|
107
|
+
react_1.default.createElement(material_1.Button, { id: `ar_dialog_confirm_ok_${this.props.dialogName || ''}`, variant: "contained", onClick: () => this.handleOk(), color: "primary", autoFocus: true, startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
108
|
+
react_1.default.createElement(material_1.Button, { id: `ar_dialog_confirm_cancel_${this.props.dialogName || ''}`, variant: "contained", onClick: () => this.handleCancel(),
|
|
109
|
+
// @ts-expect-error
|
|
110
|
+
color: "grey", startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
93
111
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
var _this2 = this;
|
|
98
|
-
if (typeof this.state.suppress === 'number') {
|
|
99
|
-
setTimeout(function () {
|
|
100
|
-
return _this2.props.onClose && _this2.props.onClose(true);
|
|
101
|
-
}, 100);
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
105
|
-
open: !0,
|
|
106
|
-
maxWidth: "md",
|
|
107
|
-
fullWidth: this.props.fullWidth !== undefined ? this.props.fullWidth : true,
|
|
108
|
-
onClose: function onClose(event, reason) {
|
|
109
|
-
if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {
|
|
110
|
-
_this2.handleCancel();
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"aria-labelledby": "ar_confirmation_dialog_title",
|
|
114
|
-
"aria-describedby": "ar_confirmation_dialog_description"
|
|
115
|
-
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
116
|
-
id: "ar_confirmation_dialog_title"
|
|
117
|
-
}, this.props.title || _i18n["default"].t('ra_Are you sure?')), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
118
|
-
id: "ar_confirmation_dialog_description"
|
|
119
|
-
}, this.props.icon || null, this.props.text, this.props.suppressQuestionMinutes ? /*#__PURE__*/_react["default"].createElement("br", null) : null, this.props.suppressQuestionMinutes ? /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
120
|
-
classes: {
|
|
121
|
-
label: this.props.classes.suppress,
|
|
122
|
-
root: this.props.classes.suppressRoot
|
|
123
|
-
},
|
|
124
|
-
control: /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
125
|
-
id: "ar_dialog_confirm_suppress_".concat(this.props.dialogName || ''),
|
|
126
|
-
checked: !!this.state.suppress,
|
|
127
|
-
onChange: function onChange() {
|
|
128
|
-
return _this2.setState({
|
|
129
|
-
suppress: !_this2.state.suppress
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}),
|
|
133
|
-
label: this.props.suppressText || _i18n["default"].t('ra_Suppress question for next %s minutes', this.props.suppressQuestionMinutes)
|
|
134
|
-
}) : null)), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
135
|
-
id: "ar_dialog_confirm_ok_".concat(this.props.dialogName || ''),
|
|
136
|
-
variant: "contained",
|
|
137
|
-
onClick: function onClick() {
|
|
138
|
-
return _this2.handleOk();
|
|
139
|
-
},
|
|
140
|
-
color: "primary",
|
|
141
|
-
autoFocus: true,
|
|
142
|
-
startIcon: /*#__PURE__*/_react["default"].createElement(_Check["default"], null)
|
|
143
|
-
}, this.props.ok || _i18n["default"].t('ra_Ok')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
144
|
-
id: "ar_dialog_confirm_cancel_".concat(this.props.dialogName || ''),
|
|
145
|
-
variant: "contained",
|
|
146
|
-
onClick: function onClick() {
|
|
147
|
-
return _this2.handleCancel();
|
|
148
|
-
},
|
|
149
|
-
color: "grey",
|
|
150
|
-
startIcon: /*#__PURE__*/_react["default"].createElement(_Close["default"], null)
|
|
151
|
-
}, this.props.cancel || _i18n["default"].t('ra_Cancel'))));
|
|
152
|
-
}
|
|
153
|
-
}]);
|
|
154
|
-
return DialogConfirm;
|
|
155
|
-
}(_react["default"].Component);
|
|
156
|
-
DialogConfirm.propTypes = {
|
|
157
|
-
onClose: _propTypes["default"].func.isRequired,
|
|
158
|
-
fullWidth: _propTypes["default"].bool,
|
|
159
|
-
title: _propTypes["default"].string,
|
|
160
|
-
text: _propTypes["default"].string,
|
|
161
|
-
ok: _propTypes["default"].string,
|
|
162
|
-
cancel: _propTypes["default"].string,
|
|
163
|
-
icon: _propTypes["default"].object,
|
|
164
|
-
suppressQuestionMinutes: _propTypes["default"].number,
|
|
165
|
-
suppressText: _propTypes["default"].string,
|
|
166
|
-
dialogName: _propTypes["default"].string
|
|
167
|
-
};
|
|
168
|
-
var _export = (0, _styles.withStyles)(styles)(DialogConfirm);
|
|
169
|
-
var _default = exports["default"] = _export;
|
|
170
|
-
//# sourceMappingURL=Confirm.js.map
|
|
112
|
+
}
|
|
113
|
+
const _export = (0, styles_1.withStyles)(styles)(DialogConfirm);
|
|
114
|
+
exports.default = _export;
|
package/Dialogs/Error.d.ts
CHANGED
|
@@ -1,49 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
**/
|
|
7
|
+
import React, { Component } from 'react';
|
|
8
|
+
interface DialogErrorProps {
|
|
6
9
|
title?: string;
|
|
7
|
-
|
|
8
|
-
* The dialog text.
|
|
9
|
-
*/
|
|
10
|
-
text: string | JSX.Element;
|
|
11
|
-
/**
|
|
12
|
-
* Close handler.
|
|
13
|
-
*/
|
|
10
|
+
text: string | React.JSX.Element;
|
|
14
11
|
onClose?: () => void;
|
|
15
|
-
|
|
16
|
-
* The styling class names.
|
|
17
|
-
*/
|
|
18
|
-
classes: {
|
|
12
|
+
classes?: {
|
|
19
13
|
titleBackground: string;
|
|
20
14
|
titleColor: string;
|
|
21
15
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
declare const _export: typeof DialogError;
|
|
16
|
+
fullWidth?: boolean;
|
|
17
|
+
}
|
|
25
18
|
/**
|
|
26
|
-
* @
|
|
27
|
-
* @property
|
|
28
|
-
* @property
|
|
29
|
-
* @property
|
|
30
|
-
* @property {{titleBackground: string; titleColor: string}} classes The styling class names.
|
|
31
|
-
*
|
|
32
|
-
* @extends {React.Component<DialogErrorProps>}
|
|
19
|
+
* @property title The dialog title; default: Error (translated)
|
|
20
|
+
* @property text The dialog text.
|
|
21
|
+
* @property onClose Close handler.
|
|
22
|
+
* @property classes The styling class names.
|
|
33
23
|
*/
|
|
34
|
-
declare class DialogError extends
|
|
35
|
-
constructor(props: DialogErrorProps | Readonly<DialogErrorProps>);
|
|
36
|
-
constructor(props: DialogErrorProps, context: any);
|
|
24
|
+
declare class DialogError extends Component<DialogErrorProps> {
|
|
37
25
|
handleOk(): void;
|
|
38
26
|
render(): React.JSX.Element;
|
|
39
27
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
let fullWidth: PropTypes.Requireable<boolean>;
|
|
44
|
-
let title: PropTypes.Requireable<string>;
|
|
45
|
-
let text: PropTypes.Requireable<NonNullable<string | PropTypes.ReactElementLike>>;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
import React from 'react';
|
|
49
|
-
import PropTypes from 'prop-types';
|
|
28
|
+
/** @type {typeof DialogError} */
|
|
29
|
+
declare const _export: typeof DialogError;
|
|
30
|
+
export default _export;
|
package/Dialogs/Error.js
CHANGED
|
@@ -1,87 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.
|
|
5
|
-
|
|
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;
|
|
6
17
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
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; } } /**
|
|
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
|
+
/**
|
|
20
30
|
* Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
21
31
|
*
|
|
22
32
|
* MIT License
|
|
23
33
|
*
|
|
24
|
-
**/
|
|
34
|
+
**/
|
|
35
|
+
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
36
|
+
const react_1 = __importStar(require("react"));
|
|
37
|
+
const material_1 = require("@mui/material");
|
|
38
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
39
|
+
const i18n_1 = __importDefault(require("../i18n"));
|
|
25
40
|
/**
|
|
26
|
-
* @
|
|
27
|
-
* @property
|
|
28
|
-
* @property
|
|
29
|
-
* @property
|
|
30
|
-
* @property {{titleBackground: string; titleColor: string}} classes The styling class names.
|
|
31
|
-
*
|
|
32
|
-
* @extends {React.Component<DialogErrorProps>}
|
|
41
|
+
* @property title The dialog title; default: Error (translated)
|
|
42
|
+
* @property text The dialog text.
|
|
43
|
+
* @property onClose Close handler.
|
|
44
|
+
* @property classes The styling class names.
|
|
33
45
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
function DialogError() {
|
|
38
|
-
(0, _classCallCheck2["default"])(this, DialogError);
|
|
39
|
-
return _super.apply(this, arguments);
|
|
40
|
-
}
|
|
41
|
-
(0, _createClass2["default"])(DialogError, [{
|
|
42
|
-
key: "handleOk",
|
|
43
|
-
value: function handleOk() {
|
|
44
|
-
this.props.onClose && this.props.onClose();
|
|
46
|
+
class DialogError extends react_1.Component {
|
|
47
|
+
handleOk() {
|
|
48
|
+
this.props.onClose && this.props.onClose();
|
|
45
49
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
fullWidth: this.props.fullWidth !== undefined ? this.props.fullWidth : true,
|
|
54
|
-
onClose: function onClose() {
|
|
55
|
-
return _this.handleOk();
|
|
56
|
-
},
|
|
57
|
-
"aria-labelledby": "alert-dialog-title",
|
|
58
|
-
"aria-describedby": "alert-dialog-description"
|
|
59
|
-
}, /*#__PURE__*/_react["default"].createElement(_material.DialogTitle, {
|
|
60
|
-
id: "ar_alert_dialog_title"
|
|
61
|
-
}, this.props.title || _i18n["default"].t('ra_Error')), /*#__PURE__*/_react["default"].createElement(_material.DialogContent, null, /*#__PURE__*/_react["default"].createElement(_material.DialogContentText, {
|
|
62
|
-
id: "ar_alert_dialog_description"
|
|
63
|
-
}, this.props.text || _i18n["default"].t('ra_Unknown error!'))), /*#__PURE__*/_react["default"].createElement(_material.DialogActions, null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
64
|
-
id: "ar_dialog_error_ok",
|
|
65
|
-
variant: "contained",
|
|
66
|
-
onClick: function onClick() {
|
|
67
|
-
return _this.handleOk();
|
|
68
|
-
},
|
|
69
|
-
color: "primary",
|
|
70
|
-
autoFocus: true,
|
|
71
|
-
startIcon: /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Check, null)
|
|
72
|
-
}, _i18n["default"].t('ra_Ok'))));
|
|
50
|
+
render() {
|
|
51
|
+
return react_1.default.createElement(material_1.Dialog, { open: !0, maxWidth: "sm", fullWidth: this.props.fullWidth !== undefined ? this.props.fullWidth : true, onClose: () => this.handleOk(), "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description" },
|
|
52
|
+
react_1.default.createElement(material_1.DialogTitle, { id: "ar_alert_dialog_title" }, this.props.title || i18n_1.default.t('ra_Error')),
|
|
53
|
+
react_1.default.createElement(material_1.DialogContent, null,
|
|
54
|
+
react_1.default.createElement(material_1.DialogContentText, { id: "ar_alert_dialog_description" }, this.props.text || i18n_1.default.t('ra_Unknown error!'))),
|
|
55
|
+
react_1.default.createElement(material_1.DialogActions, null,
|
|
56
|
+
react_1.default.createElement(material_1.Button, { id: "ar_dialog_error_ok", variant: "contained", onClick: () => this.handleOk(), color: "primary", autoFocus: true, startIcon: react_1.default.createElement(icons_material_1.Check, null) }, i18n_1.default.t('ra_Ok'))));
|
|
73
57
|
}
|
|
74
|
-
|
|
75
|
-
return DialogError;
|
|
76
|
-
}(_react["default"].Component);
|
|
77
|
-
DialogError.propTypes = {
|
|
78
|
-
onClose: _propTypes["default"].func.isRequired,
|
|
79
|
-
fullWidth: _propTypes["default"].bool,
|
|
80
|
-
title: _propTypes["default"].string,
|
|
81
|
-
text: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].element])
|
|
82
|
-
};
|
|
83
|
-
|
|
58
|
+
}
|
|
84
59
|
/** @type {typeof DialogError} */
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
//# sourceMappingURL=Error.js.map
|
|
60
|
+
const _export = DialogError;
|
|
61
|
+
exports.default = _export;
|
package/Dialogs/Message.d.ts
CHANGED
|
@@ -1,41 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2018-2023 Denis Haev (bluefox) <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
**/
|
|
7
|
+
import React, { Component } from 'react';
|
|
8
|
+
interface DialogMessageProps {
|
|
6
9
|
title?: string;
|
|
7
|
-
|
|
8
|
-
* The dialog text.
|
|
9
|
-
*/
|
|
10
|
-
text: string;
|
|
11
|
-
/**
|
|
12
|
-
* Close handler.
|
|
13
|
-
*/
|
|
10
|
+
text: string | React.JSX.Element;
|
|
14
11
|
onClose?: () => void;
|
|
15
|
-
|
|
12
|
+
classes?: {
|
|
13
|
+
titleBackground: string;
|
|
14
|
+
titleColor: string;
|
|
15
|
+
};
|
|
16
|
+
fullWidth?: boolean;
|
|
17
|
+
icon?: React.JSX.Element;
|
|
18
|
+
ok?: string;
|
|
19
|
+
}
|
|
16
20
|
/**
|
|
17
|
-
* @
|
|
18
|
-
* @property
|
|
19
|
-
* @property
|
|
20
|
-
* @property {() => void} [onClose] Close handler.
|
|
21
|
+
* @property title The dialog title; default: Message (translated)
|
|
22
|
+
* @property text The dialog text.
|
|
23
|
+
* @property onClose Close handler.
|
|
21
24
|
*
|
|
22
25
|
* @extends {React.Component<DialogMessageProps>}
|
|
23
26
|
*/
|
|
24
|
-
declare class DialogMessage extends
|
|
25
|
-
constructor(props: DialogMessageProps | Readonly<DialogMessageProps>);
|
|
26
|
-
constructor(props: DialogMessageProps, context: any);
|
|
27
|
+
declare class DialogMessage extends Component<DialogMessageProps> {
|
|
27
28
|
handleOk(): void;
|
|
28
29
|
render(): React.JSX.Element;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
namespace propTypes {
|
|
32
|
-
let fullWidth: PropTypes.Requireable<boolean>;
|
|
33
|
-
let onClose: PropTypes.Validator<(...args: any[]) => any>;
|
|
34
|
-
let title: PropTypes.Requireable<string>;
|
|
35
|
-
let text: PropTypes.Requireable<string>;
|
|
36
|
-
let ok: PropTypes.Requireable<string>;
|
|
37
|
-
let icon: PropTypes.Requireable<object>;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
import React from 'react';
|
|
41
|
-
import PropTypes from 'prop-types';
|
|
31
|
+
export default DialogMessage;
|