@iobroker/adapter-react-v5 3.1.3 → 3.1.6
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/FileBrowser.js +277 -237
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.js +3 -1
- package/Components/FileViewer.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +5 -3
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +5 -3
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +16 -2
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCustom.js +148 -25
- package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFile.js +183 -0
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigFileSelector.js +747 -0
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigGeneric.js +105 -20
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +132 -46
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +25 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js +5 -4
- package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.js +3 -2
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPanel.js +51 -40
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelect.js +4 -2
- package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +2 -2
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.js +2 -2
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +31 -8
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTabs.js +12 -3
- package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigText.js +4 -2
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -1
- package/Components/JsonConfigComponent/index.js +12 -4
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/Components/ObjectBrowser.js +228 -222
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/TableResize.js +34 -16
- package/Components/TableResize.js.map +1 -1
- package/Components/TreeTable.js +2 -2
- package/Components/TreeTable.js.map +1 -1
- package/Components/Utils.js +5 -5
- package/Components/Utils.js.map +1 -1
- package/Dialogs/Confirm.js +3 -3
- package/Dialogs/Confirm.js.map +1 -1
- package/Dialogs/FileSelect.js +259 -0
- package/Dialogs/FileSelect.js.map +1 -0
- package/Dialogs/SelectID.js +15 -16
- package/Dialogs/SelectID.js.map +1 -1
- package/GenericApp.js +3 -3
- package/GenericApp.js.map +1 -1
- package/README.md +3 -0
- package/package.json +1 -1
|
@@ -15,8 +15,6 @@ var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray")
|
|
|
15
15
|
|
|
16
16
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
17
|
|
|
18
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
|
-
|
|
20
18
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
19
|
|
|
22
20
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -27,6 +25,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
27
25
|
|
|
28
26
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
27
|
|
|
28
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
29
|
+
|
|
30
30
|
var _react = _interopRequireWildcard(require("react"));
|
|
31
31
|
|
|
32
32
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -45,6 +45,132 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
45
45
|
|
|
46
46
|
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
47
|
|
|
48
|
+
var getOrLoadRemote = function getOrLoadRemote(remote, shareScope) {
|
|
49
|
+
var remoteFallbackUrl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
50
|
+
return new Promise(function (resolve, reject) {
|
|
51
|
+
// check if remote exists on window
|
|
52
|
+
if (!window[remote]) {
|
|
53
|
+
// search dom to see if remote tag exists, but might still be loading (async)
|
|
54
|
+
var existingRemote = document.querySelector("script[data-webpack=\"".concat(remote, "\"]")); // when remote is loaded.
|
|
55
|
+
|
|
56
|
+
var onload = /*#__PURE__*/function () {
|
|
57
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
58
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
59
|
+
while (1) {
|
|
60
|
+
switch (_context.prev = _context.next) {
|
|
61
|
+
case 0:
|
|
62
|
+
if (!window[remote]) {
|
|
63
|
+
_context.next = 12;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (window[remote].__initialized) {
|
|
68
|
+
_context.next = 10;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!(typeof __webpack_share_scopes__ === 'undefined')) {
|
|
73
|
+
_context.next = 7;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
_context.next = 5;
|
|
78
|
+
return window[remote].init(shareScope["default"]);
|
|
79
|
+
|
|
80
|
+
case 5:
|
|
81
|
+
_context.next = 9;
|
|
82
|
+
break;
|
|
83
|
+
|
|
84
|
+
case 7:
|
|
85
|
+
_context.next = 9;
|
|
86
|
+
return window[remote].init(__webpack_share_scopes__[shareScope]);
|
|
87
|
+
|
|
88
|
+
case 9:
|
|
89
|
+
// mark remote as initialized
|
|
90
|
+
window[remote].__initialized = true;
|
|
91
|
+
|
|
92
|
+
case 10:
|
|
93
|
+
_context.next = 14;
|
|
94
|
+
break;
|
|
95
|
+
|
|
96
|
+
case 12:
|
|
97
|
+
console.error('Cannot load ' + remote);
|
|
98
|
+
return _context.abrupt("return", reject('Cannot load ' + remote));
|
|
99
|
+
|
|
100
|
+
case 14:
|
|
101
|
+
// resolve promise so marking remote as loaded
|
|
102
|
+
resolve(window[remote]);
|
|
103
|
+
|
|
104
|
+
case 15:
|
|
105
|
+
case "end":
|
|
106
|
+
return _context.stop();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, _callee);
|
|
110
|
+
}));
|
|
111
|
+
|
|
112
|
+
return function onload() {
|
|
113
|
+
return _ref.apply(this, arguments);
|
|
114
|
+
};
|
|
115
|
+
}();
|
|
116
|
+
|
|
117
|
+
if (existingRemote) {
|
|
118
|
+
// if existing remote but not loaded, hook into its onload and wait for it to be ready
|
|
119
|
+
existingRemote.onload = onload;
|
|
120
|
+
existingRemote.onerror = reject; // check if remote fallback exists as param passed to function
|
|
121
|
+
// TODO: should scan public config for a matching key if no override exists
|
|
122
|
+
} else if (remoteFallbackUrl) {
|
|
123
|
+
// inject remote if a fallback exists and call the same onload function
|
|
124
|
+
var d = document;
|
|
125
|
+
var script = d.createElement('script');
|
|
126
|
+
script.type = 'text/javascript'; // mark as data-webpack so runtime can track it internally
|
|
127
|
+
|
|
128
|
+
script.setAttribute('data-webpack', "".concat(remote));
|
|
129
|
+
script.async = true;
|
|
130
|
+
script.onerror = reject;
|
|
131
|
+
script.onload = onload;
|
|
132
|
+
script.src = remoteFallbackUrl;
|
|
133
|
+
d.getElementsByTagName('head')[0].appendChild(script);
|
|
134
|
+
} else {
|
|
135
|
+
// no remote and no fallback exist, reject
|
|
136
|
+
reject("Cannot Find Remote ".concat(remote, " to inject"));
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
// remote already instantiated, resolve
|
|
140
|
+
resolve(window[remote]);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
var loadComponent = function loadComponent(remote, sharedScope, module, url) {
|
|
146
|
+
return /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
147
|
+
var container, factory, Module;
|
|
148
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
149
|
+
while (1) {
|
|
150
|
+
switch (_context2.prev = _context2.next) {
|
|
151
|
+
case 0:
|
|
152
|
+
_context2.next = 2;
|
|
153
|
+
return getOrLoadRemote(remote, sharedScope, url);
|
|
154
|
+
|
|
155
|
+
case 2:
|
|
156
|
+
container = _context2.sent;
|
|
157
|
+
_context2.next = 5;
|
|
158
|
+
return container.get(module);
|
|
159
|
+
|
|
160
|
+
case 5:
|
|
161
|
+
factory = _context2.sent;
|
|
162
|
+
Module = factory();
|
|
163
|
+
return _context2.abrupt("return", Module);
|
|
164
|
+
|
|
165
|
+
case 8:
|
|
166
|
+
case "end":
|
|
167
|
+
return _context2.stop();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}, _callee2);
|
|
171
|
+
}));
|
|
172
|
+
};
|
|
173
|
+
|
|
48
174
|
var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
49
175
|
(0, _inherits2["default"])(ConfigCustom, _Component);
|
|
50
176
|
|
|
@@ -69,15 +195,15 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
69
195
|
(0, _createClass2["default"])(ConfigCustom, [{
|
|
70
196
|
key: "componentDidMount",
|
|
71
197
|
value: function () {
|
|
72
|
-
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
198
|
+
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
73
199
|
var url, pos, i18nURL, lang, file, _this$props$schema$na, _this$props$schema$na2, uniqueName, fileToLoad, componentName, component, keys;
|
|
74
200
|
|
|
75
|
-
return _regenerator["default"].wrap(function
|
|
201
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
76
202
|
while (1) {
|
|
77
|
-
switch (
|
|
203
|
+
switch (_context3.prev = _context3.next) {
|
|
78
204
|
case 0:
|
|
79
205
|
if (this.props.schema.url) {
|
|
80
|
-
|
|
206
|
+
_context3.next = 4;
|
|
81
207
|
break;
|
|
82
208
|
}
|
|
83
209
|
|
|
@@ -85,7 +211,7 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
85
211
|
this.setState({
|
|
86
212
|
error: 'URL is empty. Cannot load custom component!'
|
|
87
213
|
});
|
|
88
|
-
return
|
|
214
|
+
return _context3.abrupt("return");
|
|
89
215
|
|
|
90
216
|
case 4:
|
|
91
217
|
if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {
|
|
@@ -97,7 +223,7 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
97
223
|
}
|
|
98
224
|
|
|
99
225
|
if (!(this.props.schema.i18n === true)) {
|
|
100
|
-
|
|
226
|
+
_context3.next = 14;
|
|
101
227
|
break;
|
|
102
228
|
}
|
|
103
229
|
|
|
@@ -112,7 +238,7 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
112
238
|
|
|
113
239
|
lang = _i18n["default"].getLanguage();
|
|
114
240
|
file = "".concat(i18nURL, "/i18n/").concat(lang, ".json");
|
|
115
|
-
|
|
241
|
+
_context3.next = 12;
|
|
116
242
|
return fetch(file).then(function (data) {
|
|
117
243
|
return data.json();
|
|
118
244
|
}).then(function (json) {
|
|
@@ -122,7 +248,7 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
122
248
|
});
|
|
123
249
|
|
|
124
250
|
case 12:
|
|
125
|
-
|
|
251
|
+
_context3.next = 15;
|
|
126
252
|
break;
|
|
127
253
|
|
|
128
254
|
case 14:
|
|
@@ -135,18 +261,15 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
135
261
|
}
|
|
136
262
|
|
|
137
263
|
case 15:
|
|
138
|
-
|
|
264
|
+
_context3.prev = 15;
|
|
139
265
|
_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);
|
|
140
|
-
console.log(uniqueName, fileToLoad, componentName.join('/'));
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
format: 'esm',
|
|
145
|
-
from: 'vite'
|
|
146
|
-
}, fileToLoad);
|
|
266
|
+
console.log(uniqueName, fileToLoad, componentName.join('/')); // const component = await window.importFederation(uniqueName, {url, format: 'esm', from: 'vite'}, fileToLoad);
|
|
267
|
+
|
|
268
|
+
_context3.next = 20;
|
|
269
|
+
return loadComponent(uniqueName, 'default', "./".concat(fileToLoad), url)();
|
|
147
270
|
|
|
148
271
|
case 20:
|
|
149
|
-
component =
|
|
272
|
+
component = _context3.sent["default"];
|
|
150
273
|
|
|
151
274
|
if (!component || !component || !component[componentName.join('/')]) {
|
|
152
275
|
keys = Object.keys(component || {});
|
|
@@ -160,22 +283,22 @@ var ConfigCustom = /*#__PURE__*/function (_Component) {
|
|
|
160
283
|
});
|
|
161
284
|
}
|
|
162
285
|
|
|
163
|
-
|
|
286
|
+
_context3.next = 27;
|
|
164
287
|
break;
|
|
165
288
|
|
|
166
289
|
case 24:
|
|
167
|
-
|
|
168
|
-
|
|
290
|
+
_context3.prev = 24;
|
|
291
|
+
_context3.t0 = _context3["catch"](15);
|
|
169
292
|
this.setState({
|
|
170
|
-
error: "Cannot import from ".concat(this.props.schema.url, ": ").concat(
|
|
293
|
+
error: "Cannot import from ".concat(this.props.schema.url, ": ").concat(_context3.t0)
|
|
171
294
|
});
|
|
172
295
|
|
|
173
296
|
case 27:
|
|
174
297
|
case "end":
|
|
175
|
-
return
|
|
298
|
+
return _context3.stop();
|
|
176
299
|
}
|
|
177
300
|
}
|
|
178
|
-
},
|
|
301
|
+
}, _callee3, this, [[15, 24]]);
|
|
179
302
|
}));
|
|
180
303
|
|
|
181
304
|
function componentDidMount() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigCustom.js","names":["ConfigCustom","props","state","Component","error","schema","url","console","setState","startsWith","window","location","protocol","host","replace","adapterName","i18n","pos","lastIndexOf","i18nURL","substring","lang","getLanguage","file","fetch","then","data","json","extendTranslations","log","name","split","uniqueName","fileToLoad","componentName","join","importFederation","format","from","component","keys","Object","item","xs","undefined","lg","md","sm","assign","marginBottom","textAlign","width","type","style","themeType","darkStyle","newLine","flexBasis","height","propTypes","socket","PropTypes","object","string","themeName","className","attr","isRequired","onError","func","onChange"],"sources":["JsonConfigComponent/ConfigCustom.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport LinearProgress from '@mui/material/LinearProgress';\nimport Grid from '@mui/material/Grid';\nimport i18n from '../../i18n';\n\nclass ConfigCustom extends Component {\n constructor(props) {\n super(props);\n // schema.url - location of Widget\n // schema.name - Component name\n // schema.i18n - i18n\n\n this.state = {\n Component: null,\n error: '',\n };\n }\n\n // load component dynamically\n async componentDidMount() {\n if (!this.props.schema.url) {\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: 'URL is empty. Cannot load custom component!' });\n return;\n }\n\n let url;\n if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {\n url = this.props.schema.url;\n } else if (this.props.schema.url.startsWith('./')) {\n url = `${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\\./, '')}`;\n } else {\n url = `${window.location.protocol}//${window.location.host}/adapter/${this.props.adapterName}/${this.props.schema.url}`;\n }\n\n if (this.props.schema.i18n === true) {\n // load i18n from files\n const pos = url.lastIndexOf('/');\n let i18nURL;\n if (pos !== -1) {\n i18nURL = url.substring(0, pos);\n } else {\n i18nURL = url;\n }\n const lang = i18n.getLanguage();\n const file = `${i18nURL}/i18n/${lang}.json`;\n\n await fetch(file)\n .then(data => data.json())\n .then(json => i18n.extendTranslations(json, lang))\n .catch(error => console.log(`Cannot load i18n \"${file}\": ${error}`));\n } else if (this.props.schema.i18n && typeof this.props.schema.i18n === 'object') {\n try {\n i18n.extendTranslations(this.props.schema.i18n);\n } catch (error) {\n console.error(`Cannot import i18n: ${error}`);\n }\n }\n\n try {\n const [uniqueName, fileToLoad, ...componentName] = this.props.schema.name.split('/');\n console.log(uniqueName, fileToLoad, componentName.join('/'));\n const component = await window.importFederation(uniqueName, {url, format: 'esm', from: 'vite'}, fileToLoad);\n\n if (!component || !component || !component[componentName.join('/')]) {\n const keys = Object.keys(component || {});\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: `Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${keys.join(', ')}` });\n } else {\n this.setState({ Component: component[componentName.join('/')] });\n }\n } catch (error) {\n this.setState({ error: `Cannot import from ${this.props.schema.url}: ${error}` });\n }\n }\n\n render() {\n const Component = this.state.Component;\n\n // render temporary placeholder\n if (!Component) {\n if (this.state.error) {\n return;\n } else {\n const schema = this.props.schema || {};\n\n const item = <Grid\n item\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign({}, {\n marginBottom: 0,\n //marginRight: 8,\n textAlign: 'left',\n width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined\n }, schema.style, this.props.themeType === 'dark' ? schema.darkStyle : {})}>\n {this.state.error ? <div>{this.state.error}</div> : <LinearProgress />}\n </Grid>;\n\n if (schema.newLine) {\n return <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>;\n } else {\n return item;\n }\n }\n }\n\n return <Component {...this.props} />;\n }\n}\n\nConfigCustom.propTypes = {\n socket: PropTypes.object,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n attr: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default ConfigCustom;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;IAEMA,Y;;;;;EACF,sBAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN,EADe,CAEf;IACA;IACA;;IAEA,MAAKC,KAAL,GAAa;MACTC,SAAS,EAAE,IADF;MAETC,KAAK,EAAE;IAFE,CAAb;IANe;EAUlB,C,CAED;;;;;;6GACA;QAAA;;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;EAIrBV,KAAK,EAAEQ,qBAAA,CAAUC,MAJI;EAKrBG,SAAS,EAAEJ,qBAAA,CAAUE,MALA;EAMrBG,IAAI,EAAEL,qBAAA,CAAUE,MANK;EAOrBrC,IAAI,EAAEmC,qBAAA,CAAUC,MAAV,CAAiBK,UAPF;EAQrB9D,MAAM,EAAEwD,qBAAA,CAAUC,MAAV,CAAiBK,UARJ;EASrBC,OAAO,EAAEP,qBAAA,CAAUQ,IATE;EAUrBC,QAAQ,EAAET,qBAAA,CAAUQ;AAVC,CAAzB;eAaerE,Y"}
|
|
1
|
+
{"version":3,"file":"ConfigCustom.js","names":["getOrLoadRemote","remote","shareScope","remoteFallbackUrl","undefined","Promise","resolve","reject","window","existingRemote","document","querySelector","onload","__initialized","__webpack_share_scopes__","init","console","error","onerror","d","script","createElement","type","setAttribute","async","src","getElementsByTagName","appendChild","loadComponent","sharedScope","module","url","container","get","factory","Module","ConfigCustom","props","state","Component","schema","setState","startsWith","location","protocol","host","replace","adapterName","i18n","pos","lastIndexOf","i18nURL","substring","lang","getLanguage","file","fetch","then","data","json","extendTranslations","log","name","split","uniqueName","fileToLoad","componentName","join","component","keys","Object","item","xs","lg","md","sm","assign","marginBottom","textAlign","width","style","themeType","darkStyle","newLine","flexBasis","height","propTypes","socket","PropTypes","object","string","themeName","className","attr","isRequired","onError","func","onChange"],"sources":["JsonConfigComponent/ConfigCustom.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport LinearProgress from '@mui/material/LinearProgress';\nimport Grid from '@mui/material/Grid';\n\nimport i18n from '../../i18n';\nconst getOrLoadRemote = (remote, shareScope, remoteFallbackUrl = undefined) =>\n new Promise((resolve, reject) => {\n // check if remote exists on window\n if (!window[remote]) {\n // search dom to see if remote tag exists, but might still be loading (async)\n const existingRemote = document.querySelector(`script[data-webpack=\"${remote}\"]`);\n // when remote is loaded.\n const onload = async () => {\n // check if it was initialized\n if (window[remote]) {\n if (!window[remote].__initialized) {\n // if share scope doesn't exist (like in webpack 4) then expect shareScope to be a manual object\n if (typeof __webpack_share_scopes__ === 'undefined') {\n // use default share scope object passed in manually\n await window[remote].init(shareScope.default);\n } else {\n // otherwise, init share scope as usual\n // eslint-disable-next-line\n await window[remote].init(__webpack_share_scopes__[shareScope]);\n }\n // mark remote as initialized\n window[remote].__initialized = true;\n }\n } else {\n console.error('Cannot load ' + remote);\n return reject('Cannot load ' + remote);\n }\n // resolve promise so marking remote as loaded\n resolve(window[remote]);\n };\n\n if (existingRemote) {\n // if existing remote but not loaded, hook into its onload and wait for it to be ready\n existingRemote.onload = onload;\n existingRemote.onerror = reject;\n // check if remote fallback exists as param passed to function\n // TODO: should scan public config for a matching key if no override exists\n } else if (remoteFallbackUrl) {\n // inject remote if a fallback exists and call the same onload function\n const d = document;\n const script = d.createElement('script');\n script.type = 'text/javascript';\n // mark as data-webpack so runtime can track it internally\n script.setAttribute('data-webpack', `${remote}`);\n script.async = true;\n script.onerror = reject;\n script.onload = onload;\n script.src = remoteFallbackUrl;\n d.getElementsByTagName('head')[0].appendChild(script);\n } else {\n // no remote and no fallback exist, reject\n reject(`Cannot Find Remote ${remote} to inject`);\n }\n } else {\n // remote already instantiated, resolve\n resolve(window[remote]);\n }\n });\n\nconst loadComponent = (remote, sharedScope, module, url) => async () => {\n const container = await getOrLoadRemote(remote, sharedScope, url);\n const factory = await container.get(module);\n const Module = factory();\n return Module;\n};\n\nclass ConfigCustom extends Component {\n constructor(props) {\n super(props);\n // schema.url - location of Widget\n // schema.name - Component name\n // schema.i18n - i18n\n\n this.state = {\n Component: null,\n error: '',\n };\n }\n\n // load component dynamically\n async componentDidMount() {\n if (!this.props.schema.url) {\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: 'URL is empty. Cannot load custom component!' });\n return;\n }\n\n let url;\n if (this.props.schema.url.startsWith('http:') || this.props.schema.url.startsWith('https:')) {\n url = this.props.schema.url;\n } else if (this.props.schema.url.startsWith('./')) {\n url = `${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\\./, '')}`;\n } else {\n url = `${window.location.protocol}//${window.location.host}/adapter/${this.props.adapterName}/${this.props.schema.url}`;\n }\n\n if (this.props.schema.i18n === true) {\n // load i18n from files\n const pos = url.lastIndexOf('/');\n let i18nURL;\n if (pos !== -1) {\n i18nURL = url.substring(0, pos);\n } else {\n i18nURL = url;\n }\n const lang = i18n.getLanguage();\n const file = `${i18nURL}/i18n/${lang}.json`;\n\n await fetch(file)\n .then(data => data.json())\n .then(json => i18n.extendTranslations(json, lang))\n .catch(error => console.log(`Cannot load i18n \"${file}\": ${error}`));\n } else if (this.props.schema.i18n && typeof this.props.schema.i18n === 'object') {\n try {\n i18n.extendTranslations(this.props.schema.i18n);\n } catch (error) {\n console.error(`Cannot import i18n: ${error}`);\n }\n }\n\n try {\n const [uniqueName, fileToLoad, ...componentName] = this.props.schema.name.split('/');\n console.log(uniqueName, fileToLoad, componentName.join('/'));\n // const component = await window.importFederation(uniqueName, {url, format: 'esm', from: 'vite'}, fileToLoad);\n const component = (await loadComponent(uniqueName, 'default', `./${fileToLoad}`, url)()).default;\n\n if (!component || !component || !component[componentName.join('/')]) {\n const keys = Object.keys(component || {});\n console.error('URL is empty. Cannot load custom component!');\n this.setState({ error: `Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${keys.join(', ')}` });\n } else {\n this.setState({ Component: component[componentName.join('/')] });\n }\n } catch (error) {\n this.setState({ error: `Cannot import from ${this.props.schema.url}: ${error}` });\n }\n }\n\n render() {\n const Component = this.state.Component;\n\n // render temporary placeholder\n if (!Component) {\n if (this.state.error) {\n return;\n } else {\n const schema = this.props.schema || {};\n\n const item = <Grid\n item\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign({}, {\n marginBottom: 0,\n //marginRight: 8,\n textAlign: 'left',\n width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined\n }, schema.style, this.props.themeType === 'dark' ? schema.darkStyle : {})}>\n {this.state.error ? <div>{this.state.error}</div> : <LinearProgress />}\n </Grid>;\n\n if (schema.newLine) {\n return <>\n <div style={{ flexBasis: '100%', height: 0 }} />\n {item}\n </>;\n } else {\n return item;\n }\n }\n }\n\n return <Component {...this.props} />;\n }\n}\n\nConfigCustom.propTypes = {\n socket: PropTypes.object,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n attr: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object.isRequired,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default ConfigCustom;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;;;;;;;;;AACA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,MAAD,EAASC,UAAT;EAAA,IAAqBC,iBAArB,uEAAyCC,SAAzC;EAAA,OACpB,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAUC,MAAV,EAAqB;IACjC;IACI,IAAI,CAACC,MAAM,CAACP,MAAD,CAAX,EAAqB;MACjB;MACA,IAAMQ,cAAc,GAAGC,QAAQ,CAACC,aAAT,iCAA+CV,MAA/C,SAAvB,CAFiB,CAGjB;;MACA,IAAMW,MAAM;QAAA,yFAAG;UAAA;YAAA;cAAA;gBAAA;kBAAA,KAEPJ,MAAM,CAACP,MAAD,CAFC;oBAAA;oBAAA;kBAAA;;kBAAA,IAGFO,MAAM,CAACP,MAAD,CAAN,CAAeY,aAHb;oBAAA;oBAAA;kBAAA;;kBAAA,MAKC,OAAOC,wBAAP,KAAoC,WALrC;oBAAA;oBAAA;kBAAA;;kBAAA;kBAAA,OAOON,MAAM,CAACP,MAAD,CAAN,CAAec,IAAf,CAAoBb,UAAU,WAA9B,CAPP;;gBAAA;kBAAA;kBAAA;;gBAAA;kBAAA;kBAAA,OAWOM,MAAM,CAACP,MAAD,CAAN,CAAec,IAAf,CAA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MAAM,CAAC0C,SAAzC,GAAqD,EAL/D;UANE,GAYR,KAAK5C,KAAL,CAAWrB,KAAX,gBAAmB,6CAAM,KAAKqB,KAAL,CAAWrB,KAAjB,CAAnB,gBAAmD,gCAAC,0BAAD,OAZ3C,CAAb;;UAeA,IAAIuB,MAAM,CAAC2C,OAAX,EAAoB;YAChB,oBAAO,+EACH;cAAK,KAAK,EAAE;gBAAEC,SAAS,EAAE,MAAb;gBAAqBC,MAAM,EAAE;cAA7B;YAAZ,EADG,EAEFd,IAFE,CAAP;UAIH,CALD,MAKO;YACH,OAAOA,IAAP;UACH;QACJ;MACJ;;MAED,oBAAO,gCAAC,SAAD,EAAe,KAAKlC,KAApB,CAAP;IACH;;;EA7GsBE,gB;;AAgH3BH,YAAY,CAACkD,SAAb,GAAyB;EACrBC,MAAM,EAAEC,qBAAA,CAAUC,MADG;EAErBR,SAAS,EAAEO,qBAAA,CAAUE,MAFA;EAGrBC,SAAS,EAAEH,qBAAA,CAAUE,MAHA;EAIrBV,KAAK,EAAEQ,qBAAA,CAAUC,MAJI;EAKrBG,SAAS,EAAEJ,qBAAA,CAAUE,MALA;EAMrBG,IAAI,EAAEL,qBAAA,CAAUE,MANK;EAOrBhC,IAAI,EAAE8B,qBAAA,CAAUC,MAAV,CAAiBK,UAPF;EAQrBtD,MAAM,EAAEgD,qBAAA,CAAUC,MAAV,CAAiBK,UARJ;EASrBC,OAAO,EAAEP,qBAAA,CAAUQ,IATE;EAUrBC,QAAQ,EAAET,qBAAA,CAAUQ;AAVC,CAAzB;eAae5D,Y"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
15
|
+
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
+
|
|
18
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
+
|
|
20
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
+
|
|
22
|
+
var _react = _interopRequireDefault(require("react"));
|
|
23
|
+
|
|
24
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
+
|
|
26
|
+
var _styles = require("@mui/styles");
|
|
27
|
+
|
|
28
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
29
|
+
|
|
30
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
31
|
+
|
|
32
|
+
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
33
|
+
|
|
34
|
+
var _FileSelect = _interopRequireDefault(require("../../Dialogs/FileSelect"));
|
|
35
|
+
|
|
36
|
+
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); }; }
|
|
37
|
+
|
|
38
|
+
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; } }
|
|
39
|
+
|
|
40
|
+
var styles = function styles(theme) {
|
|
41
|
+
return {
|
|
42
|
+
fullWidth: {
|
|
43
|
+
width: '100%'
|
|
44
|
+
},
|
|
45
|
+
fullWidthOneButton: {
|
|
46
|
+
width: 'calc(100% - 65px)'
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var IMAGE_EXT = ['jpg', 'jpeg', 'svg', 'png', 'webp'];
|
|
52
|
+
var AUDIO_EXT = ['mp3', 'ogg', 'wav', 'aac'];
|
|
53
|
+
var VIDEO_EXT = ['avi', 'mp4', 'mov'];
|
|
54
|
+
var DOC_EXT = ['txt', 'log', 'html', 'htm'];
|
|
55
|
+
var JS_EXT = ['json', 'js', 'ts'];
|
|
56
|
+
|
|
57
|
+
var ConfigFile = /*#__PURE__*/function (_ConfigGeneric) {
|
|
58
|
+
(0, _inherits2["default"])(ConfigFile, _ConfigGeneric);
|
|
59
|
+
|
|
60
|
+
var _super = _createSuper(ConfigFile);
|
|
61
|
+
|
|
62
|
+
function ConfigFile() {
|
|
63
|
+
(0, _classCallCheck2["default"])(this, ConfigFile);
|
|
64
|
+
return _super.apply(this, arguments);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
(0, _createClass2["default"])(ConfigFile, [{
|
|
68
|
+
key: "componentDidMount",
|
|
69
|
+
value: function componentDidMount() {
|
|
70
|
+
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigFile.prototype), "componentDidMount", this).call(this);
|
|
71
|
+
|
|
72
|
+
var value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
73
|
+
|
|
74
|
+
this.setState({
|
|
75
|
+
value: value
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "renderFileBrowser",
|
|
80
|
+
value: function renderFileBrowser() {
|
|
81
|
+
var _this = this;
|
|
82
|
+
|
|
83
|
+
if (!this.state.showFileBrowser) {
|
|
84
|
+
return null;
|
|
85
|
+
} else {
|
|
86
|
+
return /*#__PURE__*/_react["default"].createElement(_FileSelect["default"], {
|
|
87
|
+
imagePrefix: this.props.imagePrefix,
|
|
88
|
+
socket: this.props.socket,
|
|
89
|
+
selected: this.state.value,
|
|
90
|
+
onClose: function onClose() {
|
|
91
|
+
return _this.setState({
|
|
92
|
+
showFileBrowser: false
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
onOk: function onOk(value) {
|
|
96
|
+
_this.setState({
|
|
97
|
+
value: value
|
|
98
|
+
}, function () {
|
|
99
|
+
return _this.onChange(_this.props.attr, _this.props.schema.trim === false ? value : (value || '').trim());
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
selectOnlyFolders: this.props.schema.selectOnlyFolders,
|
|
103
|
+
allowUpload: this.props.schema.allowUpload,
|
|
104
|
+
allowDownload: this.props.schema.allowDownload,
|
|
105
|
+
allowCreateFolder: this.props.schema.allowCreateFolder,
|
|
106
|
+
allowView: this.props.schema.allowView,
|
|
107
|
+
showToolbar: this.props.schema.showToolbar,
|
|
108
|
+
limitPath: this.props.schema.limitPath
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}, {
|
|
113
|
+
key: "renderItem",
|
|
114
|
+
value: function renderItem(error, disabled, defaultValue) {
|
|
115
|
+
var _this2 = this;
|
|
116
|
+
|
|
117
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
118
|
+
className: this.props.classes.fullWidth
|
|
119
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
120
|
+
variant: "standard",
|
|
121
|
+
className: this.props.classes.fullWidthOneButton,
|
|
122
|
+
value: this.state.value === null || this.state.value === undefined ? '' : this.state.value,
|
|
123
|
+
error: !!error,
|
|
124
|
+
disabled: !!disabled,
|
|
125
|
+
inputProps: {
|
|
126
|
+
maxLength: this.props.schema.maxLength || this.props.schema.max || undefined,
|
|
127
|
+
readOnly: !!this.props.schema.disableEdit
|
|
128
|
+
},
|
|
129
|
+
onChange: function onChange(e) {
|
|
130
|
+
var value = e.target.value;
|
|
131
|
+
|
|
132
|
+
_this2.setState({
|
|
133
|
+
value: value
|
|
134
|
+
}, function () {
|
|
135
|
+
return _this2.onChange(_this2.props.attr, _this2.props.schema.trim === false ? value : (value || '').trim());
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
placeholder: this.getText(this.props.schema.placeholder),
|
|
139
|
+
label: this.getText(this.props.schema.label),
|
|
140
|
+
helperText: this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)
|
|
141
|
+
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
142
|
+
variant: "outlined",
|
|
143
|
+
onClick: function onClick() {
|
|
144
|
+
return _this2.setState({
|
|
145
|
+
showFileBrowser: true
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}, "..."), this.renderFileBrowser());
|
|
149
|
+
}
|
|
150
|
+
}], [{
|
|
151
|
+
key: "getDerivedStateFromProps",
|
|
152
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
153
|
+
var value = _ConfigGeneric2["default"].getValue(props.data, props.attr);
|
|
154
|
+
|
|
155
|
+
if (value === null || value === undefined || value.toString().trim() !== (state.value || '').toString().trim()) {
|
|
156
|
+
return {
|
|
157
|
+
value: value
|
|
158
|
+
};
|
|
159
|
+
} else {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}]);
|
|
164
|
+
return ConfigFile;
|
|
165
|
+
}(_ConfigGeneric2["default"]);
|
|
166
|
+
|
|
167
|
+
ConfigFile.propTypes = {
|
|
168
|
+
socket: _propTypes["default"].object.isRequired,
|
|
169
|
+
themeType: _propTypes["default"].string,
|
|
170
|
+
themeName: _propTypes["default"].string,
|
|
171
|
+
style: _propTypes["default"].object,
|
|
172
|
+
className: _propTypes["default"].string,
|
|
173
|
+
data: _propTypes["default"].object.isRequired,
|
|
174
|
+
schema: _propTypes["default"].object,
|
|
175
|
+
onError: _propTypes["default"].func,
|
|
176
|
+
onChange: _propTypes["default"].func,
|
|
177
|
+
imagePrefix: _propTypes["default"].func
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
var _default = (0, _styles.withStyles)(styles)(ConfigFile);
|
|
181
|
+
|
|
182
|
+
exports["default"] = _default;
|
|
183
|
+
//# sourceMappingURL=ConfigFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigFile.js","names":["styles","theme","fullWidth","width","fullWidthOneButton","IMAGE_EXT","AUDIO_EXT","VIDEO_EXT","DOC_EXT","JS_EXT","ConfigFile","value","ConfigGeneric","getValue","props","data","attr","setState","state","showFileBrowser","imagePrefix","socket","onChange","schema","trim","selectOnlyFolders","allowUpload","allowDownload","allowCreateFolder","allowView","showToolbar","limitPath","error","disabled","defaultValue","classes","undefined","maxLength","max","readOnly","disableEdit","e","target","getText","placeholder","label","renderHelp","help","helpLink","noTranslation","renderFileBrowser","toString","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigFile.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport Button from '@mui/material/Button';\nimport TextField from '@mui/material/TextField';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport FileSelectDialog from '../../Dialogs/FileSelect';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n },\n fullWidthOneButton: {\n width: 'calc(100% - 65px)'\n },\n\n});\n\nconst IMAGE_EXT = ['jpg', 'jpeg', 'svg', 'png', 'webp'];\nconst AUDIO_EXT = ['mp3', 'ogg', 'wav', 'aac'];\nconst VIDEO_EXT = ['avi', 'mp4', 'mov'];\nconst DOC_EXT = ['txt', 'log', 'html', 'htm'];\nconst JS_EXT = ['json', 'js', 'ts'];\n\nclass ConfigFile extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n this.setState({ value });\n }\n\n static getDerivedStateFromProps(props, state) {\n const value = ConfigGeneric.getValue(props.data, props.attr);\n if (value === null || value === undefined || value.toString().trim() !== (state.value || '').toString().trim()) {\n return { value };\n } else {\n return null;\n }\n }\n\n renderFileBrowser() {\n if (!this.state.showFileBrowser) {\n return null;\n } else {\n return <FileSelectDialog\n imagePrefix={this.props.imagePrefix}\n socket={this.props.socket}\n selected={this.state.value}\n onClose={() => this.setState({ showFileBrowser: false})}\n onOk={value => {\n this.setState({ value }, () =>\n this.onChange(this.props.attr, this.props.schema.trim === false ? value : (value || '').trim()));\n }}\n selectOnlyFolders={this.props.schema.selectOnlyFolders}\n allowUpload={this.props.schema.allowUpload}\n allowDownload={this.props.schema.allowDownload}\n allowCreateFolder={this.props.schema.allowCreateFolder}\n allowView={this.props.schema.allowView}\n showToolbar={this.props.schema.showToolbar}\n limitPath={this.props.schema.limitPath}\n />;\n }\n }\n\n renderItem(error, disabled, defaultValue) {\n return <div className={this.props.classes.fullWidth}>\n <TextField\n variant=\"standard\"\n className={this.props.classes.fullWidthOneButton}\n value={this.state.value === null || this.state.value === undefined ? '' : this.state.value}\n error={!!error}\n disabled={!!disabled}\n inputProps={{\n maxLength: this.props.schema.maxLength || this.props.schema.max || undefined,\n readOnly: !!this.props.schema.disableEdit\n }}\n onChange={e => {\n const value = e.target.value;\n this.setState({ value }, () =>\n this.onChange(this.props.attr, this.props.schema.trim === false ? value : (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 <Button variant=\"outlined\" onClick={() => this.setState({ showFileBrowser: true })}>...</Button>\n {this.renderFileBrowser()}\n </div>;\n }\n}\n\nConfigFile.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 imagePrefix: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigFile);"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IADA,CADU;IAIrBC,kBAAkB,EAAE;MAChBD,KAAK,EAAE;IADS;EAJC,CAAL;AAAA,CAApB;;AAUA,IAAME,SAAS,GAAG,CAAC,KAAD,EAAQ,MAAR,EAAgB,KAAhB,EAAuB,KAAvB,EAA8B,MAA9B,CAAlB;AACA,IAAMC,SAAS,GAAG,CAAC,KAAD,EAAQ,KAAR,EAAe,KAAf,EAAsB,KAAtB,CAAlB;AACA,IAAMC,SAAS,GAAG,CAAC,KAAD,EAAQ,KAAR,EAAe,KAAf,CAAlB;AACA,IAAMC,OAAO,GAAG,CAAC,KAAD,EAAQ,KAAR,EAAe,MAAf,EAAuB,KAAvB,CAAhB;AACA,IAAMC,MAAM,GAAG,CAAC,MAAD,EAAS,IAAT,EAAe,IAAf,CAAf;;IAEMC,U;;;;;;;;;;;;WACF,6BAAoB;MAChB;;MACA,IAAMC,KAAK,GAAGC,0BAAA,CAAcC,QAAd,CAAuB,KAAKC,KAAL,CAAWC,IAAlC,EAAwC,KAAKD,KAAL,CAAWE,IAAnD,CAAd;;MACA,KAAKC,QAAL,CAAc;QAAEN,KAAK,EAALA;MAAF,CAAd;IACH;;;WAWD,6BAAoB;MAAA;;MAChB,IAAI,CAAC,KAAKO,KAAL,CAAWC,eAAhB,EAAiC;QAC7B,OAAO,IAAP;MACH,CAFD,MAEO;QACH,oBAAO,gCAAC,sBAAD;UACH,WAAW,EAAE,KAAKL,KAAL,CAAWM,WADrB;UAEH,MAAM,EAAE,KAA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