@iobroker/adapter-react-v5 3.3.0 → 3.4.1

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.
@@ -33,6 +33,7 @@ declare namespace DialogMessage {
33
33
  const onClose: PropTypes.Validator<(...args: any[]) => any>;
34
34
  const title: PropTypes.Requireable<string>;
35
35
  const text: PropTypes.Requireable<string>;
36
+ const ok: PropTypes.Requireable<string>;
36
37
  const icon: PropTypes.Requireable<object>;
37
38
  }
38
39
  }
@@ -59,7 +59,11 @@ var DialogMessage = /*#__PURE__*/function (_React$Component) {
59
59
  id: "message-dialog-title"
60
60
  }, this.props.title || _i18n["default"].t('ra_Message')), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
61
61
  id: "message-dialog-description"
62
- }, this.props.text)), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
62
+ }, /*#__PURE__*/_react["default"].createElement("span", {
63
+ style: {
64
+ marginRight: this.props.icon ? 8 : 0
65
+ }
66
+ }, this.props.icon || null), this.props.text)), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
63
67
  variant: "contained",
64
68
  onClick: function onClick() {
65
69
  return _this.handleOk();
@@ -67,7 +71,7 @@ var DialogMessage = /*#__PURE__*/function (_React$Component) {
67
71
  color: "primary",
68
72
  autoFocus: true,
69
73
  startIcon: /*#__PURE__*/_react["default"].createElement(_Close["default"], null)
70
- }, _i18n["default"].t('ra_Close'))));
74
+ }, this.props.ok || _i18n["default"].t('ra_Close'))));
71
75
  }
72
76
  }]);
73
77
  return DialogMessage;
@@ -77,6 +81,7 @@ DialogMessage.propTypes = {
77
81
  onClose: _propTypes["default"].func.isRequired,
78
82
  title: _propTypes["default"].string,
79
83
  text: _propTypes["default"].string,
84
+ ok: _propTypes["default"].string,
80
85
  icon: _propTypes["default"].object
81
86
  };
82
87
  var _default = DialogMessage;
@@ -1 +1 @@
1
- {"version":3,"file":"Message.js","names":["DialogMessage","props","onClose","fullWidth","undefined","handleOk","title","I18n","t","text","React","Component","propTypes","PropTypes","bool","func","isRequired","string","icon","object"],"sources":["Message.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\n/**\n * @typedef {object} DialogMessageProps\n * @property {string} [title] The dialog title; default: Message (translated)\n * @property {string} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogMessageProps>}\n */\nclass DialogMessage extends React.Component {\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={!0}\n maxWidth=\"sm\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"message-dialog-title\"\n aria-describedby=\"message-dialog-description\"\n >\n <DialogTitle id=\"message-dialog-title\">{this.props.title || I18n.t('ra_Message')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"message-dialog-description\">\n {this.props.text}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconClose />}>{I18n.t('ra_Close')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogMessage.propTypes = {\n fullWidth: PropTypes.bool,\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: P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BuBE,iBAAK,CAACC,SAAS;AA2B3CX,aAAa,CAACY,SAAS,GAAG;EACtBT,SAAS,EAAEU,qBAAS,CAACC,IAAI;EACzBZ,OAAO,EAAEW,qBAAS,CAACE,IAAI,CAACC,UAAU;EAClCV,KAAK,EAAEO,qBAAS,CAACI,MAAM;EACvBR,IAAI,EAAEI,qBAAS,CAACI,MAAM;EACtBC,IAAI,EAAEL,qBAAS,CAACM;AACpB,CAAC;AAAC,eAEanB,aAAa;AAAA"}
1
+ {"version":3,"file":"Message.js","names":["DialogMessage","props","onClose","fullWidth","undefined","handleOk","title","I18n","t","marginRight","icon","text","ok","React","Component","propTypes","PropTypes","bool","func","isRequired","string","object"],"sources":["Message.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\n/**\n * @typedef {object} DialogMessageProps\n * @property {string} [title] The dialog title; default: Message (translated)\n * @property {string} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogMessageProps>}\n */\nclass DialogMessage extends React.Component {\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={!0}\n maxWidth=\"sm\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"message-dialog-title\"\n aria-describedby=\"message-dialog-description\"\n >\n <DialogTitle id=\"message-dialog-title\">{this.props.title || I18n.t('ra_Message')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"message-dialog-description\">\n <span style={{ marginRight: this.props.icon ? 8 : 0 }}>{this.props.icon || null}</span>{this.props.text}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconClose />}>{this.props.ok || I18n.t('ra_Close')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogMessage.propTypes = {\n fullWidth: PropTypes.bool,\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.string,\n ok: PropTypes.string,\n icon: PropTypes.object\n};\n\nexport default DialogMessage;\n"],"mappings":";;;;;;;;;;;;AAQA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAA2B;AAAA;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQMA,aAAa;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OACf,oBAAW;MACP,IAAI,CAACC,KAAK,CAACC,OAAO,IAAI,IAAI,CAACD,KAAK,CAACC,OAAO,EAAE;IAC9C;EAAC;IAAA;IAAA,OAED,kBAAS;MAAA;MACL,oBAAO,gCAAC,kBAAM;QACV,IAAI,EAAE,CAAC,CAAE;QACT,QAAQ,EAAC,IAAI;QACb,SAAS,EAAE,IAAI,CAACD,KAAK,CAACE,SAAS,KAAKC,SAAS,GAAG,IAAI,CAACH,KAAK,CAACE,SAAS,GAAG,IAAK;QAC5E,OAAO,EAAE;UAAA,OAAM,KAAI,CAACE,QAAQ,EAAE;QAAA,CAAC;QAC/B,mBAAgB,sBAAsB;QACtC,oBAAiB;MAA4B,gBAE7C,gCAAC,uBAAW;QAAC,EAAE,EAAC;MAAsB,GAAE,IAAI,CAACJ,KAAK,CAACK,KAAK,IAAIC,gBAAI,CAACC,CAAC,CAAC,YAAY,CAAC,CAAe,eAC/F,gCAAC,yBAAa,qBACV,gCAAC,6BAAiB;QAAC,EAAE,EAAC;MAA4B,gBAC9C;QAAM,KAAK,EAAE;UAAEC,WAAW,EAAE,IAAI,CAACR,KAAK,CAACS,IAAI,GAAG,CAAC,GAAG;QAAE;MAAE,GAAE,IAAI,CAACT,KAAK,CAACS,IAAI,IAAI,IAAI,CAAQ,EAAC,IAAI,CAACT,KAAK,CAACU,IAAI,CACvF,CACR,eAChB,gCAAC,yBAAa,qBACV,gCAAC,kBAAM;QAAC,OAAO,EAAC,WAAW;QAAC,OAAO,EAAE;UAAA,OAAM,KAAI,CAACN,QAAQ,EAAE;QAAA,CAAC;QAAC,KAAK,EAAC,SAAS;QAAC,SAAS;QAAC,SAAS,eAAE,gCAAC,iBAAS;MAAI,GAAE,IAAI,CAACJ,KAAK,CAACW,EAAE,IAAIL,gBAAI,CAACC,CAAC,CAAC,UAAU,CAAC,CAAU,CAClJ,CACX;IACb;EAAC;EAAA;AAAA,EAxBuBK,iBAAK,CAACC,SAAS;AA2B3Cd,aAAa,CAACe,SAAS,GAAG;EACtBZ,SAAS,EAAEa,qBAAS,CAACC,IAAI;EACzBf,OAAO,EAAEc,qBAAS,CAACE,IAAI,CAACC,UAAU;EAClCb,KAAK,EAAEU,qBAAS,CAACI,MAAM;EACvBT,IAAI,EAAEK,qBAAS,CAACI,MAAM;EACtBR,EAAE,EAAEI,qBAAS,CAACI,MAAM;EACpBV,IAAI,EAAEM,qBAAS,CAACK;AACpB,CAAC;AAAC,eAEarB,aAAa;AAAA"}
@@ -0,0 +1,133 @@
1
+ export default _export;
2
+ export type DialogSelectIDProps = {
3
+ /**
4
+ * The internal name of the dialog; default: "default"
5
+ */
6
+ dialogName?: string;
7
+ /**
8
+ * The dialog title; default: Please select object ID... (translated)
9
+ */
10
+ title?: string;
11
+ /**
12
+ * Set to true to allow the selection of multiple IDs.
13
+ */
14
+ multiSelect?: boolean;
15
+ /**
16
+ * Prefix (default: '.')
17
+ */
18
+ imagePrefix?: string;
19
+ /**
20
+ * Show the expert button?
21
+ */
22
+ showExpertButton?: boolean;
23
+ /**
24
+ * The language.
25
+ */
26
+ lang?: ioBroker.Languages;
27
+ /**
28
+ * The socket connection.
29
+ */
30
+ socket: import('../Connection').default;
31
+ /**
32
+ * Theme name.
33
+ */
34
+ themeName?: string;
35
+ /**
36
+ * Theme type.
37
+ */
38
+ themeType?: string;
39
+ /**
40
+ * The selected IDs.
41
+ */
42
+ selected?: string | string[];
43
+ /**
44
+ * The ok button text; default: OK (translated)
45
+ */
46
+ ok?: string;
47
+ /**
48
+ * The cancel button text; default: Cancel (translated)
49
+ */
50
+ cancel?: string;
51
+ /**
52
+ * Close handler that is always called when the dialog is closed.
53
+ */
54
+ onClose: () => void;
55
+ /**
56
+ * Handler that is called when the user presses OK.
57
+ */
58
+ onOk: (selected: string | string[] | undefined, name: string) => void;
59
+ /**
60
+ * The styling class names.
61
+ */
62
+ classes?: {
63
+ headerID: string;
64
+ dialog: string;
65
+ content: string;
66
+ };
67
+ };
68
+ /** @type {typeof DialogSelectFile} */
69
+ declare const _export: typeof DialogSelectFile;
70
+ /**
71
+ * @typedef {object} DialogSelectIDProps
72
+ * @property {string} [dialogName] The internal name of the dialog; default: "default"
73
+ * @property {string} [title] The dialog title; default: Please select object ID... (translated)
74
+ * @property {boolean} [multiSelect] Set to true to allow the selection of multiple IDs.
75
+ * @property {string} [imagePrefix] Prefix (default: '.')
76
+ * @property {boolean} [showExpertButton] Show the expert button?
77
+ * @property {ioBroker.Languages} [lang] The language.
78
+ * @property {import('../Connection').default} socket The socket connection.
79
+ * @property {string} [themeName] Theme name.
80
+ * @property {string} [themeType] Theme type.
81
+ * @property {string | string[]} [selected] The selected IDs.
82
+ * @property {string} [ok] The ok button text; default: OK (translated)
83
+ * @property {string} [cancel] The cancel button text; default: Cancel (translated)
84
+ * @property {() => void} onClose Close handler that is always called when the dialog is closed.
85
+ * @property {(selected: string | string[] | undefined, name: string) => void} onOk Handler that is called when the user presses OK.
86
+ * @property {{headerID: string; dialog: string; content: string}} [classes] The styling class names.
87
+ *
88
+ * @extends {React.Component<DialogSelectIDProps>}
89
+ */
90
+ declare class DialogSelectFile extends React.Component<DialogSelectIDProps, any, any> {
91
+ /**
92
+ * @param {DialogSelectIDProps} props
93
+ */
94
+ constructor(props: DialogSelectIDProps);
95
+ dialogName: string;
96
+ filters: any;
97
+ state: {
98
+ selected: string[];
99
+ };
100
+ handleCancel(): void;
101
+ handleOk(): void;
102
+ render(): JSX.Element;
103
+ }
104
+ declare namespace DialogSelectFile {
105
+ namespace propTypes {
106
+ const dialogName: PropTypes.Requireable<string>;
107
+ const classes: PropTypes.Requireable<object>;
108
+ const allowUpload: PropTypes.Requireable<boolean>;
109
+ const allowDownload: PropTypes.Requireable<boolean>;
110
+ const allowCreateFolder: PropTypes.Requireable<boolean>;
111
+ const allowDelete: PropTypes.Requireable<boolean>;
112
+ const allowView: PropTypes.Requireable<boolean>;
113
+ const showToolbar: PropTypes.Requireable<boolean>;
114
+ const filterByType: PropTypes.Requireable<string>;
115
+ const showTypeSelector: PropTypes.Requireable<boolean>;
116
+ const onClose: PropTypes.Validator<(...args: any[]) => any>;
117
+ const onOk: PropTypes.Validator<(...args: any[]) => any>;
118
+ const title: PropTypes.Requireable<string>;
119
+ const lang: PropTypes.Requireable<string>;
120
+ const selected: PropTypes.Requireable<NonNullable<string | any[]>>;
121
+ const socket: PropTypes.Validator<object>;
122
+ const cancel: PropTypes.Requireable<string>;
123
+ const imagePrefix: PropTypes.Requireable<string>;
124
+ const ok: PropTypes.Requireable<string>;
125
+ const themeName: PropTypes.Requireable<string>;
126
+ const themeType: PropTypes.Requireable<string>;
127
+ const showExpertButton: PropTypes.Requireable<boolean>;
128
+ const expertMode: PropTypes.Requireable<boolean>;
129
+ const multiSelect: PropTypes.Requireable<boolean>;
130
+ }
131
+ }
132
+ import React from "react";
133
+ import PropTypes from "prop-types";
@@ -0,0 +1,261 @@
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 _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
16
+ var _react = _interopRequireDefault(require("react"));
17
+ var _propTypes = _interopRequireDefault(require("prop-types"));
18
+ var _withStyles = _interopRequireDefault(require("@mui/styles/withStyles"));
19
+ var _Button = _interopRequireDefault(require("@mui/material/Button"));
20
+ var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
21
+ var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
22
+ var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
23
+ var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
24
+ var _Cancel = _interopRequireDefault(require("@mui/icons-material/Cancel"));
25
+ var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
26
+ var _Utils = _interopRequireDefault(require("../Components/Utils"));
27
+ var _i18n = _interopRequireDefault(require("../i18n"));
28
+ var _FileBrowser = _interopRequireDefault(require("../Components/FileBrowser"));
29
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
30
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
31
+ 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); }; }
32
+ 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; } }
33
+ var styles = function styles() {
34
+ return {
35
+ headerID: {
36
+ fontWeight: 'bold',
37
+ fontStyle: 'italic'
38
+ },
39
+ dialog: {
40
+ height: '95%'
41
+ },
42
+ dialogMobile: {
43
+ padding: 4,
44
+ width: '100%',
45
+ maxWidth: '100%',
46
+ maxHeight: 'calc(100% - 16px)',
47
+ height: '100%'
48
+ },
49
+ content: {
50
+ height: '100%',
51
+ overflow: 'hidden'
52
+ },
53
+ contentMobile: {
54
+ padding: '8px 4px'
55
+ },
56
+ titleRoot: {
57
+ whiteSpace: 'nowrap',
58
+ width: 'calc(100% - 72px)',
59
+ overflow: 'hidden',
60
+ display: 'inline-block',
61
+ textOverflow: 'ellipsis'
62
+ }
63
+ };
64
+ };
65
+
66
+ /**
67
+ * @typedef {object} DialogSelectIDProps
68
+ * @property {string} [dialogName] The internal name of the dialog; default: "default"
69
+ * @property {string} [title] The dialog title; default: Please select object ID... (translated)
70
+ * @property {boolean} [multiSelect] Set to true to allow the selection of multiple IDs.
71
+ * @property {string} [imagePrefix] Prefix (default: '.')
72
+ * @property {boolean} [showExpertButton] Show the expert button?
73
+ * @property {ioBroker.Languages} [lang] The language.
74
+ * @property {import('../Connection').default} socket The socket connection.
75
+ * @property {string} [themeName] Theme name.
76
+ * @property {string} [themeType] Theme type.
77
+ * @property {string | string[]} [selected] The selected IDs.
78
+ * @property {string} [ok] The ok button text; default: OK (translated)
79
+ * @property {string} [cancel] The cancel button text; default: Cancel (translated)
80
+ * @property {() => void} onClose Close handler that is always called when the dialog is closed.
81
+ * @property {(selected: string | string[] | undefined, name: string) => void} onOk Handler that is called when the user presses OK.
82
+ * @property {{headerID: string; dialog: string; content: string}} [classes] The styling class names.
83
+ *
84
+ * @extends {React.Component<DialogSelectIDProps>}
85
+ */
86
+ var DialogSelectFile = /*#__PURE__*/function (_React$Component) {
87
+ (0, _inherits2["default"])(DialogSelectFile, _React$Component);
88
+ var _super = _createSuper(DialogSelectFile);
89
+ /**
90
+ * @param {DialogSelectIDProps} props
91
+ */
92
+ function DialogSelectFile(props) {
93
+ var _this;
94
+ (0, _classCallCheck2["default"])(this, DialogSelectFile);
95
+ _this = _super.call(this, props);
96
+ _this.dialogName = _this.props.dialogName || 'default';
97
+ _this.dialogName = "SelectFile.".concat(_this.dialogName);
98
+ _this.filters = (window._localStorage || window.localStorage).getItem(_this.dialogName) || '{}';
99
+ try {
100
+ _this.filters = JSON.parse(_this.filters);
101
+ } catch (e) {
102
+ _this.filters = {};
103
+ }
104
+ if (props.filters) {
105
+ _this.filters = _objectSpread(_objectSpread({}, _this.filters), props.filters);
106
+ }
107
+ var selected = _this.props.selected || [];
108
+ if ((0, _typeof2["default"])(selected) !== 'object') {
109
+ selected = [selected];
110
+ } else {
111
+ selected = (0, _toConsumableArray2["default"])(selected);
112
+ }
113
+ selected = selected.filter(function (id) {
114
+ return id;
115
+ });
116
+ _this.state = {
117
+ selected: selected
118
+ };
119
+ return _this;
120
+ }
121
+ (0, _createClass2["default"])(DialogSelectFile, [{
122
+ key: "handleCancel",
123
+ value: function handleCancel() {
124
+ this.props.onClose();
125
+ }
126
+ }, {
127
+ key: "handleOk",
128
+ value: function handleOk() {
129
+ this.props.onOk(this.props.multiSelect || !Array.isArray(this.state.selected) ? this.state.selected : this.state.selected[0] || '');
130
+ this.props.onClose();
131
+ }
132
+ }, {
133
+ key: "render",
134
+ value: function render() {
135
+ var _this2 = this;
136
+ var title;
137
+ if (this.state.selected.length) {
138
+ if (!Array.isArray(this.state.selected) || this.state.selected.length === 1) {
139
+ title = [/*#__PURE__*/_react["default"].createElement("span", {
140
+ key: "selected"
141
+ }, _i18n["default"].t('ra_Selected'), "\xA0"), /*#__PURE__*/_react["default"].createElement("span", {
142
+ key: "id",
143
+ className: this.props.classes.headerID
144
+ }, this.state.selected)];
145
+ } else {
146
+ title = [/*#__PURE__*/_react["default"].createElement("span", {
147
+ key: "selected"
148
+ }, _i18n["default"].t('ra_Selected'), "\xA0"), /*#__PURE__*/_react["default"].createElement("span", {
149
+ key: "id",
150
+ className: this.props.classes.headerID
151
+ }, _i18n["default"].t('%s items', this.state.selected.length))];
152
+ }
153
+ } else {
154
+ title = this.props.title || _i18n["default"].t('ra_Please select file...');
155
+ }
156
+ return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
157
+ onClose: function onClose() {},
158
+ maxWidth: false,
159
+ classes: {
160
+ paper: _Utils["default"].clsx(this.props.classes.dialog, this.props.classes.dialogMobile)
161
+ },
162
+ fullWidth: true,
163
+ open: !0,
164
+ "aria-labelledby": "selectfile-dialog-title"
165
+ }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
166
+ id: "selectfile-dialog-title",
167
+ classes: {
168
+ root: this.props.classes.titleRoot
169
+ }
170
+ }, title), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], {
171
+ className: _Utils["default"].clsx(this.props.classes.content, this.props.classes.contentMobile)
172
+ }, /*#__PURE__*/_react["default"].createElement(_FileBrowser["default"], {
173
+ ready: true,
174
+ allowUpload: this.props.allowUpload,
175
+ allowDownload: this.props.allowDownload,
176
+ allowCreateFolder: this.props.allowCreateFolder,
177
+ allowDelete: this.props.allowDelete,
178
+ allowView: this.props.allowView,
179
+ showToolbar: this.props.showToolbar,
180
+ imagePrefix: this.props.imagePrefix || this.props.prefix || '../' // prefix is for back compatibility
181
+ ,
182
+ selected: this.props.selected,
183
+ filterByType: this.props.filterByType,
184
+ t: this.props.t || _i18n["default"].t,
185
+ lang: this.props.lang || _i18n["default"].getLanguage(),
186
+ socket: this.props.socket,
187
+ themeType: this.props.themeType,
188
+ themeName: this.props.themeName,
189
+ showExpertButton: this.props.showExpertButton,
190
+ expertMode: this.props.expertMode,
191
+ showTypeSelector: this.props.showTypeSelector,
192
+ onSelect: function onSelect(selected, isDouble) {
193
+ if (JSON.stringify(selected) !== JSON.stringify(_this2.state.selected)) {
194
+ _this2.setState({
195
+ selected: selected
196
+ }, function () {
197
+ return isDouble && _this2.handleOk();
198
+ });
199
+ } else if (isDouble) {
200
+ _this2.handleOk();
201
+ }
202
+ }
203
+ })), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
204
+ variant: "contained",
205
+ onClick: function onClick() {
206
+ return _this2.handleOk();
207
+ },
208
+ startIcon: /*#__PURE__*/_react["default"].createElement(_Check["default"], null),
209
+ disabled: !this.state.selected.length,
210
+ color: "primary"
211
+ }, this.props.ok || _i18n["default"].t('ra_Ok')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
212
+ color: "grey",
213
+ variant: "contained",
214
+ onClick: function onClick() {
215
+ return _this2.handleCancel();
216
+ },
217
+ startIcon: /*#__PURE__*/_react["default"].createElement(_Cancel["default"], null)
218
+ }, this.props.cancel || _i18n["default"].t('ra_Cancel'))));
219
+ }
220
+ }]);
221
+ return DialogSelectFile;
222
+ }(_react["default"].Component);
223
+ DialogSelectFile.propTypes = {
224
+ dialogName: _propTypes["default"].string,
225
+ // where to store settings in localStorage
226
+ classes: _propTypes["default"].object,
227
+ allowUpload: _propTypes["default"].bool,
228
+ allowDownload: _propTypes["default"].bool,
229
+ allowCreateFolder: _propTypes["default"].bool,
230
+ allowDelete: _propTypes["default"].bool,
231
+ allowView: _propTypes["default"].bool,
232
+ showToolbar: _propTypes["default"].bool,
233
+ filterByType: _propTypes["default"].string,
234
+ // e.g. images
235
+ showTypeSelector: _propTypes["default"].bool,
236
+ // If type selector should be shown
237
+
238
+ onClose: _propTypes["default"].func.isRequired,
239
+ onOk: _propTypes["default"].func.isRequired,
240
+ title: _propTypes["default"].string,
241
+ lang: _propTypes["default"].string,
242
+ selected: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].array // not implemented
243
+ ]),
244
+
245
+ socket: _propTypes["default"].object.isRequired,
246
+ cancel: _propTypes["default"].string,
247
+ imagePrefix: _propTypes["default"].string,
248
+ ok: _propTypes["default"].string,
249
+ themeName: _propTypes["default"].string,
250
+ themeType: _propTypes["default"].string,
251
+ showExpertButton: _propTypes["default"].bool,
252
+ expertMode: _propTypes["default"].bool,
253
+ // force expert mode
254
+ multiSelect: _propTypes["default"].bool // not implemented
255
+ };
256
+
257
+ /** @type {typeof DialogSelectFile} */
258
+ var _export = (0, _withStyles["default"])(styles)(DialogSelectFile);
259
+ var _default = _export;
260
+ exports["default"] = _default;
261
+ //# sourceMappingURL=SelectFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectFile.js","names":["styles","headerID","fontWeight","fontStyle","dialog","height","dialogMobile","padding","width","maxWidth","maxHeight","content","overflow","contentMobile","titleRoot","whiteSpace","display","textOverflow","DialogSelectFile","props","dialogName","filters","window","_localStorage","localStorage","getItem","JSON","parse","e","selected","filter","id","state","onClose","onOk","multiSelect","Array","isArray","title","length","I18n","t","classes","paper","Utils","clsx","root","allowUpload","allowDownload","allowCreateFolder","allowDelete","allowView","showToolbar","imagePrefix","prefix","filterByType","lang","getLanguage","socket","themeType","themeName","showExpertButton","expertMode","showTypeSelector","isDouble","stringify","setState","handleOk","ok","handleCancel","cancel","React","Component","propTypes","PropTypes","string","object","bool","func","isRequired","oneOfType","array","_export","withStyles"],"sources":["SelectFile.jsx"],"sourcesContent":["/*\n * Copyright 2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n */\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogActions from '@mui/material/DialogActions';\nimport Dialog from '@mui/material/Dialog';\n\nimport IconCancel from '@mui/icons-material/Cancel';\nimport IconOk from '@mui/icons-material/Check';\n\nimport Utils from '../Components/Utils';\nimport I18n from '../i18n';\nimport FileBrowser from '../Components/FileBrowser';\n\nconst styles = () => ({\n headerID: {\n fontWeight: 'bold',\n fontStyle: 'italic',\n },\n dialog: {\n height: '95%',\n },\n dialogMobile: {\n padding: 4,\n width: '100%',\n maxWidth: '100%',\n maxHeight: 'calc(100% - 16px)',\n height: '100%',\n },\n content: {\n height: '100%',\n overflow: 'hidden',\n },\n contentMobile: {\n padding: '8px 4px',\n },\n titleRoot: {\n whiteSpace: 'nowrap',\n width: 'calc(100% - 72px)',\n overflow: 'hidden',\n display: 'inline-block',\n textOverflow: 'ellipsis',\n },\n});\n\n/**\n * @typedef {object} DialogSelectIDProps\n * @property {string} [dialogName] The internal name of the dialog; default: \"default\"\n * @property {string} [title] The dialog title; default: Please select object ID... (translated)\n * @property {boolean} [multiSelect] Set to true to allow the selection of multiple IDs.\n * @property {string} [imagePrefix] Prefix (default: '.')\n * @property {boolean} [showExpertButton] Show the expert button?\n * @property {ioBroker.Languages} [lang] The language.\n * @property {import('../Connection').default} socket The socket connection.\n * @property {string} [themeName] Theme name.\n * @property {string} [themeType] Theme type.\n * @property {string | string[]} [selected] The selected IDs.\n * @property {string} [ok] The ok button text; default: OK (translated)\n * @property {string} [cancel] The cancel button text; default: Cancel (translated)\n * @property {() => void} onClose Close handler that is always called when the dialog is closed.\n * @property {(selected: string | string[] | undefined, name: string) => void} onOk Handler that is called when the user presses OK.\n * @property {{headerID: string; dialog: string; content: string}} [classes] The styling class names.\n *\n * @extends {React.Component<DialogSelectIDProps>}\n */\nclass DialogSelectFile extends React.Component {\n /**\n * @param {DialogSelectIDProps} props\n */\n constructor(props) {\n super(props);\n this.dialogName = this.props.dialogName || 'default';\n this.dialogName = `SelectFile.${this.dialogName}`;\n\n this.filters = (window._localStorage || window.localStorage).getItem(this.dialogName) || '{}';\n\n try {\n this.filters = JSON.parse(this.filters);\n } catch (e) {\n this.filters = {};\n }\n\n if (props.filters) {\n this.filters = { ...this.filters, ...props.filters };\n }\n\n let selected = this.props.selected || [];\n if (typeof selected !== 'object') {\n selected = [selected];\n } else {\n selected = [...selected];\n }\n selected = selected.filter(id => id);\n\n this.state = {\n selected,\n };\n }\n\n handleCancel() {\n this.props.onClose();\n }\n\n handleOk() {\n this.props.onOk(this.props.multiSelect || !Array.isArray(this.state.selected) ? this.state.selected : this.state.selected[0] || '');\n this.props.onClose();\n }\n\n render() {\n let title;\n if (this.state.selected.length) {\n if (!Array.isArray(this.state.selected) || this.state.selected.length === 1) {\n title = [\n <span key=\"selected\">\n {I18n.t('ra_Selected')}\n &nbsp;\n </span>,\n <span key=\"id\" className={this.props.classes.headerID}>\n {this.state.selected}\n </span>,\n ];\n } else {\n title = [\n <span key=\"selected\">\n {I18n.t('ra_Selected')}\n &nbsp;\n </span>,\n <span key=\"id\" className={this.props.classes.headerID}>\n {I18n.t('%s items', this.state.selected.length)}\n </span>,\n ];\n }\n } else {\n title = this.props.title || I18n.t('ra_Please select file...');\n }\n\n return <Dialog\n onClose={() => {}}\n maxWidth={false}\n classes={{ paper: Utils.clsx(this.props.classes.dialog, this.props.classes.dialogMobile) }}\n fullWidth\n open={!0}\n aria-labelledby=\"selectfile-dialog-title\"\n >\n <DialogTitle id=\"selectfile-dialog-title\" classes={{ root: this.props.classes.titleRoot }}>{title}</DialogTitle>\n <DialogContent className={Utils.clsx(this.props.classes.content, this.props.classes.contentMobile)}>\n <FileBrowser\n ready\n allowUpload={this.props.allowUpload}\n allowDownload={this.props.allowDownload}\n allowCreateFolder={this.props.allowCreateFolder}\n allowDelete={this.props.allowDelete}\n allowView={this.props.allowView}\n showToolbar={this.props.showToolbar}\n imagePrefix={this.props.imagePrefix || this.props.prefix || '../'} // prefix is for back compatibility\n selected={this.props.selected}\n filterByType={this.props.filterByType}\n t={this.props.t || I18n.t}\n lang={this.props.lang || I18n.getLanguage()}\n socket={this.props.socket}\n themeType={this.props.themeType}\n themeName={this.props.themeName}\n showExpertButton={this.props.showExpertButton}\n expertMode={this.props.expertMode}\n showTypeSelector={this.props.showTypeSelector}\n onSelect={(selected, isDouble) => {\n if (JSON.stringify(selected) !== JSON.stringify(this.state.selected)) {\n this.setState({ selected }, () =>\n isDouble && this.handleOk());\n } else if (isDouble) {\n this.handleOk();\n }\n }}\n />\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} startIcon={<IconOk />} disabled={!this.state.selected.length} color=\"primary\">{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button color=\"grey\" variant=\"contained\" onClick={() => this.handleCancel()} startIcon={<IconCancel />}>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogSelectFile.propTypes = {\n dialogName: PropTypes.string, // where to store settings in localStorage\n classes: PropTypes.object,\n allowUpload: PropTypes.bool,\n allowDownload: PropTypes.bool,\n allowCreateFolder: PropTypes.bool,\n allowDelete: PropTypes.bool,\n allowView: PropTypes.bool,\n showToolbar: PropTypes.bool,\n filterByType: PropTypes.string, // e.g. images\n showTypeSelector: PropTypes.bool, // If type selector should be shown\n\n onClose: PropTypes.func.isRequired,\n onOk: PropTypes.func.isRequired,\n title: PropTypes.string,\n lang: PropTypes.string,\n selected: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.array, // not implemented\n ]),\n socket: PropTypes.object.isRequired,\n cancel: PropTypes.string,\n imagePrefix: PropTypes.string,\n ok: PropTypes.string,\n themeName: PropTypes.string,\n themeType: PropTypes.string,\n showExpertButton: PropTypes.bool,\n expertMode: PropTypes.bool, // force expert mode\n multiSelect: PropTypes.bool, // not implemented\n};\n\n/** @type {typeof DialogSelectFile} */\nconst _export = withStyles(styles)(DialogSelectFile);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;;;;AAOA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAAoD;AAAA;AAAA;AAAA;AAEpD,IAAMA,MAAM,GAAG,SAATA,MAAM;EAAA,OAAU;IAClBC,QAAQ,EAAE;MACNC,UAAU,EAAE,MAAM;MAClBC,SAAS,EAAE;IACf,CAAC;IACDC,MAAM,EAAE;MACJC,MAAM,EAAE;IACZ,CAAC;IACDC,YAAY,EAAE;MACVC,OAAO,EAAE,CAAC;MACVC,KAAK,EAAE,MAAM;MACbC,QAAQ,EAAE,MAAM;MAChBC,SAAS,EAAE,mBAAmB;MAC9BL,MAAM,EAAE;IACZ,CAAC;IACDM,OAAO,EAAE;MACLN,MAAM,EAAE,MAAM;MACdO,QAAQ,EAAE;IACd,CAAC;IACDC,aAAa,EAAE;MACXN,OAAO,EAAE;IACb,CAAC;IACDO,SAAS,EAAE;MACPC,UAAU,EAAE,QAAQ;MACpBP,KAAK,EAAE,mBAAmB;MAC1BI,QAAQ,EAAE,QAAQ;MAClBI,OAAO,EAAE,cAAc;MACvBC,YAAY,EAAE;IAClB;EACJ,CAAC;AAAA,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnBA,IAoBMC,gBAAgB;EAAA;EAAA;EAClB;AACJ;AACA;EACI,0BAAYC,KA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MAAM;EAC3Bd,gBAAgB,EAAEa,qBAAS,CAACG,IAAI;EAChCf,UAAU,EAAEY,qBAAS,CAACG,IAAI;EAAE;EAC5B1C,WAAW,EAAEuC,qBAAS,CAACG,IAAI,CAAE;AACjC,CAAC;;AAED;AACA,IAAMK,OAAO,GAAG,IAAAC,sBAAU,EAACnF,MAAM,CAAC,CAACkB,gBAAgB,CAAC;AAAC,eACtCgE,OAAO;AAAA"}
package/README.md CHANGED
@@ -10,7 +10,7 @@ If you want to create the configuration page with react:
10
10
  - Change `name` from `src` to `ADAPTERNAME-admin` (Of course replace `ADAPTERNAME` with yours)
11
11
  - Add to devDependencies:
12
12
  ```
13
- "@iobroker/adapter-react": "^3.3.0",
13
+ "@iobroker/adapter-react": "^3.4.1",
14
14
  ```
15
15
  Versions can be higher.
16
16
  So your src/package.json should look like:
@@ -643,6 +643,12 @@ If you still have questions, try to find an answer [here](https://mui.com/guides
643
643
  -->
644
644
 
645
645
  ## Changelog
646
+ ### 3.4.1 (2022-11-29)
647
+ * (bluefox) Added button text for message dialog
648
+
649
+ ### 3.4.0 (2022-11-29)
650
+ * (bluefox) Added file selector
651
+
646
652
  ### 3.3.0 (2022-11-26)
647
653
  * (bluefox) Added subscribe on files
648
654
 
package/i18n/de.json CHANGED
@@ -334,5 +334,13 @@
334
334
  "ra_month_Sep": "Sep",
335
335
  "ra_month_Oct": "Okt",
336
336
  "ra_month_Nov": "Nov",
337
- "ra_month_Dec": "Dez"
337
+ "ra_month_Dec": "Dez",
338
+ "ra_Filter files": "Dateien filtern",
339
+ "ra_Please select file...": "Bitte Datei auswählen...",
340
+ "ra_fileType_all": "Alle Dateien",
341
+ "ra_fileType_audio": "Audio",
342
+ "ra_fileType_code": "Code/JSON",
343
+ "ra_fileType_images": "Bilder",
344
+ "ra_fileType_txt": "Text",
345
+ "ra_fileType_video,": "Video"
338
346
  }
package/i18n/en.json CHANGED
@@ -334,5 +334,13 @@
334
334
  "ra_month_Sep": "Sep",
335
335
  "ra_month_Oct": "Oct",
336
336
  "ra_month_Nov": "Nov",
337
- "ra_month_Dec": "Dec"
337
+ "ra_month_Dec": "Dec",
338
+ "ra_fileType_all": "All files",
339
+ "ra_fileType_images": "Images",
340
+ "ra_fileType_code": "Code/JSON",
341
+ "ra_fileType_txt": "Text",
342
+ "ra_fileType_audio": "Audio",
343
+ "ra_fileType_video,": "Video",
344
+ "ra_Filter files": "Filter files",
345
+ "ra_Please select file...": "Please select file..."
338
346
  }
package/i18n/es.json CHANGED
@@ -309,5 +309,38 @@
309
309
  "ra_Configure": "Configurar",
310
310
  "ra_Invalid CRON": "CRON no válido",
311
311
  "ra_Discard": "Desechar",
312
- "ra_Some data are not stored. Discard?": "Algunos datos no se almacenan. ¿Desechar?"
312
+ "ra_Some data are not stored. Discard?": "Algunos datos no se almacenan. ¿Desechar?",
313
+ "ra_Filter files": "Filtrar archivos",
314
+ "ra_Please select file...": "Seleccione el archivo...",
315
+ "ra_dow_We": "Nosotros",
316
+ "ra_fileType_all": "Todos los archivos",
317
+ "ra_fileType_audio": "Audio",
318
+ "ra_fileType_code": "Código/JSON",
319
+ "ra_fileType_images": "Imágenes",
320
+ "ra_fileType_txt": "Texto",
321
+ "ra_fileType_video,": "Video",
322
+ "ra_month_Apr": "Abr",
323
+ "ra_month_Aug": "Ago",
324
+ "ra_month_Dec": "Dic",
325
+ "ra_month_Feb": "Feb",
326
+ "ra_month_Jan": "Ene",
327
+ "ra_month_Jul": "Jul",
328
+ "ra_month_Jun": "Jun",
329
+ "ra_month_Mai": "Mai",
330
+ "ra_month_Mar": "Mar",
331
+ "ra_month_Nov": "Nov",
332
+ "ra_month_Oct": "Oct",
333
+ "ra_month_Sep": "Sep",
334
+ "ra_months_Apr": "Abr",
335
+ "ra_months_Aug": "Ago",
336
+ "ra_months_Dec": "Dic",
337
+ "ra_months_Feb": "Feb",
338
+ "ra_months_Jan": "Ene",
339
+ "ra_months_Jul": "Jul",
340
+ "ra_months_Jun": "Jun",
341
+ "ra_months_Mai": "Mai",
342
+ "ra_months_Mar": "Mar",
343
+ "ra_months_Nov": "Nov",
344
+ "ra_months_Oct": "Oct",
345
+ "ra_months_Sep": "Sep"
313
346
  }
package/i18n/fr.json CHANGED
@@ -309,5 +309,38 @@
309
309
  "ra_Configure": "Configurer",
310
310
  "ra_Invalid CRON": "CRON invalide",
311
311
  "ra_Discard": "Jeter",
312
- "ra_Some data are not stored. Discard?": "Certaines données ne sont pas stockées. Jeter?"
312
+ "ra_Some data are not stored. Discard?": "Certaines données ne sont pas stockées. Jeter?",
313
+ "ra_Filter files": "Filtrer les fichiers",
314
+ "ra_Please select file...": "Veuillez sélectionner le fichier...",
315
+ "ra_dow_We": "Nous",
316
+ "ra_fileType_all": "Tous les fichiers",
317
+ "ra_fileType_audio": "l'audio",
318
+ "ra_fileType_code": "Code/JSON",
319
+ "ra_fileType_images": "Images",
320
+ "ra_fileType_txt": "Texte",
321
+ "ra_fileType_video,": "Vidéo",
322
+ "ra_month_Apr": "Avr",
323
+ "ra_month_Aug": "Août",
324
+ "ra_month_Dec": "Déc",
325
+ "ra_month_Feb": "Fév",
326
+ "ra_month_Jan": "Jan",
327
+ "ra_month_Jul": "Juil",
328
+ "ra_month_Jun": "Juin",
329
+ "ra_month_Mai": "Mai",
330
+ "ra_month_Mar": "Mar",
331
+ "ra_month_Nov": "Nov",
332
+ "ra_month_Oct": "Oct",
333
+ "ra_month_Sep": "Sep",
334
+ "ra_months_Apr": "Avr",
335
+ "ra_months_Aug": "Août",
336
+ "ra_months_Dec": "Déc",
337
+ "ra_months_Feb": "Fév",
338
+ "ra_months_Jan": "Jan",
339
+ "ra_months_Jul": "Juil",
340
+ "ra_months_Jun": "Juin",
341
+ "ra_months_Mai": "Mai",
342
+ "ra_months_Mar": "Mar",
343
+ "ra_months_Nov": "Nov",
344
+ "ra_months_Oct": "Oct",
345
+ "ra_months_Sep": "Sep"
313
346
  }