@iobroker/adapter-react-v5 3.4.3 → 3.4.5

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.
@@ -59,23 +59,22 @@ function deselectCurrent() {
59
59
  // https://github.com/sudodoki/copy-to-clipboard/blob/master/index.js
60
60
 
61
61
  var clipboardToIE11Formatting = {
62
- "text/plain": "Text",
63
- "text/html": "Url",
64
- "default": "Text"
62
+ 'text/plain': 'Text',
63
+ 'text/html': 'Url',
64
+ 'default': 'Text'
65
65
  };
66
- var defaultMessage = "Copy to clipboard: #{key}, Enter";
66
+ var defaultMessage = 'Copy to clipboard: #{key}, Enter';
67
67
  function format(message) {
68
- var copyKey = (/mac os x/i.test(navigator.userAgent) ? "" : "Ctrl") + "+C";
68
+ var copyKey = (/mac os x/i.test(navigator.userAgent) ? '' : 'Ctrl') + '+C';
69
69
  return message.replace(/#{\s*key\s*}/g, copyKey);
70
70
  }
71
71
  function copy(text, options) {
72
- var debug,
73
- message,
74
- reselectPrevious,
75
- range,
76
- selection,
77
- mark,
78
- success = false;
72
+ var debug;
73
+ var reselectPrevious;
74
+ var range;
75
+ var selection;
76
+ var mark;
77
+ var success = false;
79
78
  if (!options) {
80
79
  options = {};
81
80
  }
@@ -84,31 +83,33 @@ function copy(text, options) {
84
83
  reselectPrevious = deselectCurrent();
85
84
  range = document.createRange();
86
85
  selection = document.getSelection();
87
- mark = document.createElement("span");
86
+ mark = document.createElement('span');
88
87
  mark.textContent = text;
88
+ // avoid screen readers from reading out loud the text
89
+ mark.ariaHidden = 'true';
89
90
  // reset user styles for span element
90
- mark.style.all = "unset";
91
+ mark.style.all = 'unset';
91
92
  // prevents scrolling to the end of the page
92
- mark.style.position = "fixed";
93
+ mark.style.position = 'fixed';
93
94
  mark.style.top = 0;
94
- mark.style.clip = "rect(0, 0, 0, 0)";
95
+ mark.style.clip = 'rect(0, 0, 0, 0)';
95
96
  // used to preserve spaces and line breaks
96
- mark.style.whiteSpace = "pre";
97
+ mark.style.whiteSpace = 'pre';
97
98
  // do not inherit user-select (it may be `none`)
98
- mark.style.webkitUserSelect = "text";
99
- mark.style.MozUserSelect = "text";
100
- mark.style.msUserSelect = "text";
101
- mark.style.userSelect = "text";
102
- mark.addEventListener("copy", function (e) {
99
+ mark.style.webkitUserSelect = 'text';
100
+ mark.style.MozUserSelect = 'text';
101
+ mark.style.msUserSelect = 'text';
102
+ mark.style.userSelect = 'text';
103
+ mark.addEventListener('copy', function (e) {
103
104
  e.stopPropagation();
104
105
  if (options.format) {
105
106
  e.preventDefault();
106
- if (typeof e.clipboardData === "undefined") {
107
+ if (typeof e.clipboardData === 'undefined') {
107
108
  // IE 11
108
- debug && console.warn("unable to use e.clipboardData");
109
- debug && console.warn("trying IE specific stuff");
109
+ debug && console.warn('unable to use e.clipboardData');
110
+ debug && console.warn('trying IE specific stuff');
110
111
  window.clipboardData.clearData();
111
- var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"];
112
+ var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting['default'];
112
113
  window.clipboardData.setData(format, text);
113
114
  } else {
114
115
  // all other browsers
@@ -124,27 +125,27 @@ function copy(text, options) {
124
125
  document.body.appendChild(mark);
125
126
  range.selectNodeContents(mark);
126
127
  selection.addRange(range);
127
- var successful = document.execCommand("copy");
128
+ var successful = document.execCommand('copy');
128
129
  if (!successful) {
129
- throw new Error("copy command was unsuccessful");
130
+ throw new Error('copy command was unsuccessful');
130
131
  }
131
132
  success = true;
132
133
  } catch (err) {
133
- debug && console.error("unable to copy using execCommand: ", err);
134
- debug && console.warn("trying IE specific stuff");
134
+ debug && console.error('unable to copy using execCommand: ', err);
135
+ debug && console.warn('trying IE specific stuff');
135
136
  try {
136
- window.clipboardData.setData(options.format || "text", text);
137
+ window.clipboardData.setData(options.format || 'text', text);
137
138
  options.onCopy && options.onCopy(window.clipboardData);
138
139
  success = true;
139
140
  } catch (err) {
140
- debug && console.error("unable to copy using clipboardData: ", err);
141
- debug && console.error("falling back to prompt");
142
- message = format("message" in options ? options.message : defaultMessage);
141
+ debug && console.error('unable to copy using clipboardData: ', err);
142
+ debug && console.error('falling back to prompt');
143
+ var message = format('message' in options ? options.message : defaultMessage);
143
144
  window.prompt(message, text);
144
145
  }
145
146
  } finally {
146
147
  if (selection) {
147
- if (typeof selection.removeRange == "function") {
148
+ if (typeof selection.removeRange === 'function') {
148
149
  selection.removeRange(range);
149
150
  } else {
150
151
  selection.removeAllRanges();
@@ -1 +1 @@
1
- {"version":3,"file":"copy-to-clipboard.js","names":["deselectCurrent","selection","document","getSelection","rangeCount","active","activeElement","ranges","i","push","getRangeAt","tagName","toUpperCase","blur","removeAllRanges","type","forEach","range","addRange","focus","clipboardToIE11Formatting","defaultMessage","format","message","copyKey","test","navigator","userAgent","replace","copy","text","options","debug","reselectPrevious","mark","success","createRange","createElement","textContent","style","all","position","top","clip","whiteSpace","webkitUserSelect","MozUserSelect","msUserSelect","userSelect","addEventListener","e","stopPropagation","preventDefault","clipboardData","console","warn","window","clearData","setData","onCopy","body","appendChild","selectNodeContents","successful","execCommand","Error","err","error","prompt","removeRange","removeChild","module","exports"],"sources":["copy-to-clipboard.js"],"sourcesContent":["/*\nMIT License\n\nCopyright (c) 2017 sudodoki <smd.deluzion@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n */\n// https://github.com/sudodoki/toggle-selection/blob/gh-pages/index.js\nfunction deselectCurrent () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n}\n\n// https://github.com/sudodoki/copy-to-clipboard/blob/master/index.js\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n};\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,eAAe,GAAI;EACxB,IAAIC,SAAS,GAAGC,QAAQ,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OAAO,CAACT,MAAM,IAAI,MAAM,EAAEQ,IAAI,CAAC;MAC5DC,OAAO,CAAC4B,MAAM,IAAI5B,OAAO,CAAC4B,MAAM,CAACH,MAAM,CAACH,aAAa,CAAC;MACtDlB,OAAO,GAAG,IAAI;IAClB,CAAC,CAAC,OAAO+B,GAAG,EAAE;MACVlC,KAAK,IAAIsB,OAAO,CAACa,KAAK,CAAC,sCAAsC,EAAED,GAAG,CAAC;MACnElC,KAAK,IAAIsB,OAAO,CAACa,KAAK,CAAC,wBAAwB,CAAC;MAChD5C,OAAO,GAAGD,MAAM,CAAC,SAAS,IAAIS,OAAO,GAAGA,OAAO,CAACR,OAAO,GAAGF,cAAc,CAAC;MACzEmC,MAAM,CAACY,MAAM,CAAC7C,OAAO,EAAEO,IAAI,CAAC;IAChC;EACJ,CAAC,SAAS;IACN,IAAI7B,SAAS,EAAE;MACX,IAAI,OAAOA,SAAS,CAACoE,WAAW,IAAI,UAAU,EAAE;QAC5CpE,SAAS,CAACoE,WAAW,CAACpD,KAAK,CAAC;MAChC,CAAC,MAAM;QACHhB,SAAS,CAACa,eAAe,EAAE;MAC/B;IACJ;IAEA,IAAIoB,IAAI,EAAE;MACNhC,QAAQ,CAAC0D,IAAI,CAACU,WAAW,CAACpC,IAAI,CAAC;IACnC;IACAD,gBAAgB,EAAE;EACtB;EAEA,OAAOE,OAAO;AAClB;AAEAoC,MAAM,CAACC,OAAO,GAAG3C,IAAI"}
1
+ {"version":3,"file":"copy-to-clipboard.js","names":["deselectCurrent","selection","document","getSelection","rangeCount","active","activeElement","ranges","i","push","getRangeAt","tagName","toUpperCase","blur","removeAllRanges","type","forEach","range","addRange","focus","clipboardToIE11Formatting","defaultMessage","format","message","copyKey","test","navigator","userAgent","replace","copy","text","options","debug","reselectPrevious","mark","success","createRange","createElement","textContent","ariaHidden","style","all","position","top","clip","whiteSpace","webkitUserSelect","MozUserSelect","msUserSelect","userSelect","addEventListener","e","stopPropagation","preventDefault","clipboardData","console","warn","window","clearData","setData","onCopy","body","appendChild","selectNodeContents","successful","execCommand","Error","err","error","prompt","removeRange","removeChild","module","exports"],"sources":["copy-to-clipboard.js"],"sourcesContent":["/*\nMIT License\n\nCopyright (c) 2017 sudodoki <smd.deluzion@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n */\n// https://github.com/sudodoki/toggle-selection/blob/gh-pages/index.js\nfunction deselectCurrent () {\n const selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n let active = document.activeElement;\n\n const ranges = [];\n for (let i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function (range) {\n selection.addRange(range);\n });\n }\n\n active && active.focus();\n };\n}\n\n// https://github.com/sudodoki/copy-to-clipboard/blob/master/index.js\n\nconst clipboardToIE11Formatting = {\n 'text/plain': 'Text',\n 'text/html': 'Url',\n 'default': 'Text',\n};\n\nconst defaultMessage = 'Copy to clipboard: #{key}, Enter';\n\nfunction format(message) {\n const copyKey = (/mac os x/i.test(navigator.userAgent) ? '⌘' : 'Ctrl') + '+C';\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n let debug;\n let reselectPrevious;\n let range;\n let selection;\n let mark;\n let success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement('span');\n mark.textContent = text;\n // avoid screen readers from reading out loud the text\n mark.ariaHidden = 'true';\n // reset user styles for span element\n mark.style.all = 'unset';\n // prevents scrolling to the end of the page\n mark.style.position = 'fixed';\n mark.style.top = 0;\n mark.style.clip = 'rect(0, 0, 0, 0)';\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = 'pre';\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = 'text';\n mark.style.MozUserSelect = 'text';\n mark.style.msUserSelect = 'text';\n mark.style.userSelect = 'text';\n mark.addEventListener('copy', function (e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === 'undefined') { // IE 11\n debug && console.warn('unable to use e.clipboardData');\n debug && console.warn('trying IE specific stuff');\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting['default']\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n const successful = document.execCommand('copy');\n if (!successful) {\n throw new Error('copy command was unsuccessful');\n }\n success = true;\n } catch (err) {\n debug && console.error('unable to copy using execCommand: ', err);\n debug && console.warn('trying IE specific stuff');\n try {\n window.clipboardData.setData(options.format || 'text', text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error('unable to copy using clipboardData: ', err);\n debug && console.error('falling back to prompt');\n let message = format('message' in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange === 'function') {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,eAAe,GAAI;EACxB,IAAMC,SAAS,GAAGC,QAAQ,CAACC,YAAY,EAAE;EACzC,IAAI,CAACF,SAAS,CAACG,UAAU,EAAE;IACvB,OAAO,YAAY,CAAC,CAAC;EACzB;EACA,IAAIC,MAAM,GAAGH,QAAQ,CAACI,aAAa;EAEnC,IAAMC,MAAM,GAAG,EAAE;EACjB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGP,SAAS,CAACG,UAAU,EAAEI,CAAC,EAAE,EAAE;IAC3CD,MAAM,CAACE,IAAI,CAACR,SAAS,CAACS,UAAU,CAACF,CAAC,CAAC,CAAC;EACxC;EAEA,QAAQH,MAAM,CAACM,OAAO,CAACC,WAAW,EAAE;IAAI;IACpC,KAAK,OAAO;IACZ,KAAK,UAAU;MACXP,MAAM,CAACQ,IAAI,EAAE;MACb;IAEJ;MACIR,MAAM,GAAG,IAAI;MACb;EAAM;EAGdJ,SAAS,CAACa,eAAe,EAAE;EAC3B,OAAO,YAAY;IACfb,SAAS,CAACc,IAAI,KAAK,OAAO,IAC1Bd,SAAS,CAACa,eAAe,EAAE;IAE3B,IAAI,CAACb,SAAS,CA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E;QAC7CrE,SAAS,CAACqE,WAAW,CAACrD,KAAK,CAAC;MAChC,CAAC,MAAM;QACHhB,SAAS,CAACa,eAAe,EAAE;MAC/B;IACJ;IAEA,IAAIoB,IAAI,EAAE;MACNhC,QAAQ,CAAC2D,IAAI,CAACU,WAAW,CAACrC,IAAI,CAAC;IACnC;IACAD,gBAAgB,EAAE;EACtB;EAEA,OAAOE,OAAO;AAClB;AAEAqC,MAAM,CAACC,OAAO,GAAG5C,IAAI"}
@@ -1,9 +1,9 @@
1
1
  export default _export;
2
- export type DialogSelectIDProps = {
2
+ export type DialogSelectFileProps = {
3
3
  /**
4
- * The internal name of the dialog; default: "default"
4
+ * PropTypes.string, // where to store settings in localStorage *
5
5
  */
6
- dialogName?: string;
6
+ dialogName?: boolean;
7
7
  /**
8
8
  * The dialog title; default: Please select object ID... (translated)
9
9
  */
@@ -27,7 +27,7 @@ export type DialogSelectIDProps = {
27
27
  /**
28
28
  * The socket connection.
29
29
  */
30
- socket: import('../Connection').default;
30
+ socket?: import('../Connection').default;
31
31
  /**
32
32
  * Theme name.
33
33
  */
@@ -48,14 +48,54 @@ export type DialogSelectIDProps = {
48
48
  * The cancel button text; default: Cancel (translated)
49
49
  */
50
50
  cancel?: string;
51
+ /**
52
+ * If download of files enabled
53
+ */
54
+ allowUpload?: boolean;
55
+ /**
56
+ * If download of files enabled
57
+ */
58
+ allowDownload?: boolean;
59
+ /**
60
+ * If creation of folders enabled
61
+ */
62
+ allowCreateFolder?: boolean;
63
+ /**
64
+ * If creation of folders enabled
65
+ */
66
+ allowDelete?: boolean;
67
+ /**
68
+ * if tile view enabled (default true)
69
+ */
70
+ allowView?: boolean;
71
+ /**
72
+ * Show toolbar (default true)
73
+ */
74
+ showToolbar?: boolean;
75
+ /**
76
+ * Limit file browser to one specific objectID of type meta and following path (like vis.0/main)
77
+ */
78
+ limitPath?: any[];
79
+ /**
80
+ * like `['png', 'svg', 'bmp', 'jpg', 'jpeg']`
81
+ */
82
+ filterFiles?: any[];
83
+ /**
84
+ * images, code, txt, audio, video
85
+ */
86
+ filterByType?: string;
87
+ /**
88
+ * allow only folder's selection *
89
+ */
90
+ selectOnlyFolders?: bool;
51
91
  /**
52
92
  * Close handler that is always called when the dialog is closed.
53
93
  */
54
94
  onClose: () => void;
55
95
  /**
56
- * Handler that is called when the user presses OK.
96
+ * Handler that is called when the user presses OK or by double click.
57
97
  */
58
- onOk: (selected: string | string[] | undefined, name: string) => void;
98
+ onOk: (selected: string | string[] | undefined) => void;
59
99
  /**
60
100
  * The styling class names.
61
101
  */
@@ -68,9 +108,8 @@ export type DialogSelectIDProps = {
68
108
  /** @type {typeof DialogSelectFile} */
69
109
  declare const _export: typeof DialogSelectFile;
70
110
  /**
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)
111
+ * @typedef {object} DialogSelectFileProps
112
+ * @property {boolean} [dialogName] PropTypes.string, // where to store settings in localStorage * @property {string} [title] The dialog title; default: Please select object ID... (translated)
74
113
  * @property {boolean} [multiSelect] Set to true to allow the selection of multiple IDs.
75
114
  * @property {string} [imagePrefix] Prefix (default: '.')
76
115
  * @property {boolean} [showExpertButton] Show the expert button?
@@ -81,21 +120,32 @@ declare const _export: typeof DialogSelectFile;
81
120
  * @property {string | string[]} [selected] The selected IDs.
82
121
  * @property {string} [ok] The ok button text; default: OK (translated)
83
122
  * @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.
123
+ * @property {boolean} [socket] Socket class (required)
124
+ * @property {boolean} [allowUpload] If download of files enabled
125
+ * @property {boolean} [allowDownload] If download of files enabled
126
+ * @property {boolean} [allowCreateFolder] If creation of folders enabled
127
+ * @property {boolean} [allowDelete] If creation of folders enabled
128
+ * @property {boolean} [allowView] if tile view enabled (default true)
129
+ * @property {boolean} [showToolbar] Show toolbar (default true)
130
+ * @property {array} [limitPath] Limit file browser to one specific objectID of type meta and following path (like vis.0/main)
131
+ * @property {array} [filterFiles] like `['png', 'svg', 'bmp', 'jpg', 'jpeg']`
132
+ * @property {string} [filterByType] images, code, txt, audio, video
133
+ * @property {bool} [selectOnlyFolders] allow only folder's selection * @property {() => void} onClose Close handler that is always called when the dialog is closed.
134
+ * @property {(selected: string | string[] | undefined) => void} onOk Handler that is called when the user presses OK or by double click.
86
135
  * @property {{headerID: string; dialog: string; content: string}} [classes] The styling class names.
87
136
  *
88
137
  * @extends {React.Component<DialogSelectIDProps>}
89
138
  */
90
139
  declare class DialogSelectFile extends React.Component<DialogSelectIDProps, any, any> {
91
140
  /**
92
- * @param {DialogSelectIDProps} props
141
+ * @param {DialogSelectFileProps} props
93
142
  */
94
- constructor(props: DialogSelectIDProps);
143
+ constructor(props: DialogSelectFileProps);
95
144
  dialogName: string;
96
145
  filters: any;
97
146
  state: {
98
- selected: string[];
147
+ selected: any;
148
+ isFolder: boolean;
99
149
  };
100
150
  handleCancel(): void;
101
151
  handleOk(): void;
@@ -103,25 +153,29 @@ declare class DialogSelectFile extends React.Component<DialogSelectIDProps, any,
103
153
  }
104
154
  declare namespace DialogSelectFile {
105
155
  namespace propTypes {
156
+ const imagePrefix: PropTypes.Requireable<string>;
106
157
  const dialogName: PropTypes.Requireable<string>;
158
+ const selected: PropTypes.Requireable<NonNullable<string | any[]>>;
107
159
  const classes: PropTypes.Requireable<object>;
160
+ const onClose: PropTypes.Validator<(...args: any[]) => any>;
161
+ const onOk: PropTypes.Validator<(...args: any[]) => any>;
162
+ const ok: PropTypes.Requireable<string>;
163
+ const cancel: PropTypes.Requireable<string>;
164
+ const socket: PropTypes.Validator<object>;
108
165
  const allowUpload: PropTypes.Requireable<boolean>;
109
166
  const allowDownload: PropTypes.Requireable<boolean>;
110
167
  const allowCreateFolder: PropTypes.Requireable<boolean>;
111
168
  const allowDelete: PropTypes.Requireable<boolean>;
112
169
  const allowView: PropTypes.Requireable<boolean>;
113
170
  const showToolbar: PropTypes.Requireable<boolean>;
171
+ const filterFiles: PropTypes.Requireable<string[]>;
114
172
  const filterByType: PropTypes.Requireable<string>;
173
+ const limitPath: PropTypes.Requireable<string>;
174
+ const selectOnlyFolders: PropTypes.Requireable<boolean>;
175
+ const showViewTypeButton: PropTypes.Requireable<boolean>;
115
176
  const showTypeSelector: PropTypes.Requireable<boolean>;
116
- const onClose: PropTypes.Validator<(...args: any[]) => any>;
117
- const onOk: PropTypes.Validator<(...args: any[]) => any>;
118
177
  const title: PropTypes.Requireable<string>;
119
178
  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
179
  const themeName: PropTypes.Requireable<string>;
126
180
  const themeType: PropTypes.Requireable<string>;
127
181
  const showExpertButton: PropTypes.Requireable<boolean>;
@@ -64,9 +64,8 @@ var styles = function styles() {
64
64
  };
65
65
 
66
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)
67
+ * @typedef {object} DialogSelectFileProps
68
+ * @property {boolean} [dialogName] PropTypes.string, // where to store settings in localStorage * @property {string} [title] The dialog title; default: Please select object ID... (translated)
70
69
  * @property {boolean} [multiSelect] Set to true to allow the selection of multiple IDs.
71
70
  * @property {string} [imagePrefix] Prefix (default: '.')
72
71
  * @property {boolean} [showExpertButton] Show the expert button?
@@ -77,8 +76,18 @@ var styles = function styles() {
77
76
  * @property {string | string[]} [selected] The selected IDs.
78
77
  * @property {string} [ok] The ok button text; default: OK (translated)
79
78
  * @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.
79
+ * @property {boolean} [socket] Socket class (required)
80
+ * @property {boolean} [allowUpload] If download of files enabled
81
+ * @property {boolean} [allowDownload] If download of files enabled
82
+ * @property {boolean} [allowCreateFolder] If creation of folders enabled
83
+ * @property {boolean} [allowDelete] If creation of folders enabled
84
+ * @property {boolean} [allowView] if tile view enabled (default true)
85
+ * @property {boolean} [showToolbar] Show toolbar (default true)
86
+ * @property {array} [limitPath] Limit file browser to one specific objectID of type meta and following path (like vis.0/main)
87
+ * @property {array} [filterFiles] like `['png', 'svg', 'bmp', 'jpg', 'jpeg']`
88
+ * @property {string} [filterByType] images, code, txt, audio, video
89
+ * @property {bool} [selectOnlyFolders] allow only folder's selection * @property {() => void} onClose Close handler that is always called when the dialog is closed.
90
+ * @property {(selected: string | string[] | undefined) => void} onOk Handler that is called when the user presses OK or by double click.
82
91
  * @property {{headerID: string; dialog: string; content: string}} [classes] The styling class names.
83
92
  *
84
93
  * @extends {React.Component<DialogSelectIDProps>}
@@ -87,7 +96,7 @@ var DialogSelectFile = /*#__PURE__*/function (_React$Component) {
87
96
  (0, _inherits2["default"])(DialogSelectFile, _React$Component);
88
97
  var _super = _createSuper(DialogSelectFile);
89
98
  /**
90
- * @param {DialogSelectIDProps} props
99
+ * @param {DialogSelectFileProps} props
91
100
  */
92
101
  function DialogSelectFile(props) {
93
102
  var _this;
@@ -114,7 +123,8 @@ var DialogSelectFile = /*#__PURE__*/function (_React$Component) {
114
123
  return id;
115
124
  });
116
125
  _this.state = {
117
- selected: selected
126
+ selected: selected,
127
+ isFolder: false
118
128
  };
119
129
  return _this;
120
130
  }
@@ -171,16 +181,27 @@ var DialogSelectFile = /*#__PURE__*/function (_React$Component) {
171
181
  className: _Utils["default"].clsx(this.props.classes.content, this.props.classes.contentMobile)
172
182
  }, /*#__PURE__*/_react["default"].createElement(_FileBrowser["default"], {
173
183
  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
184
  imagePrefix: this.props.imagePrefix || this.props.prefix || '../' // prefix is for back compatibility
181
185
  ,
182
- selected: this.props.selected,
186
+ allowUpload: !!this.props.allowUpload,
187
+ allowDownload: this.props.allowDownload !== false,
188
+ allowCreateFolder: !!this.props.allowCreateFolder,
189
+ allowDelete: !!this.props.allowDelete,
190
+ allowView: this.props.allowView !== false,
191
+ showViewTypeButton: this.props.showViewTypeButton !== false,
192
+ showToolbar: this.props.showToolbar !== false,
193
+ limitPath: this.props.limitPath,
194
+ filterFiles: this.props.filterFiles,
183
195
  filterByType: this.props.filterByType,
196
+ selected: this.props.selected,
197
+ onSelect: function onSelect(selected, isDoubleClick, isFolder) {
198
+ _this2.setState({
199
+ selected: selected,
200
+ isFolder: isFolder
201
+ }, function () {
202
+ return isDoubleClick && (!_this2.props.selectOnlyFolders || isFolder) && _this2.handleOk();
203
+ });
204
+ },
184
205
  t: this.props.t || _i18n["default"].t,
185
206
  lang: this.props.lang || _i18n["default"].getLanguage(),
186
207
  socket: this.props.socket,
@@ -188,18 +209,7 @@ var DialogSelectFile = /*#__PURE__*/function (_React$Component) {
188
209
  themeName: this.props.themeName,
189
210
  showExpertButton: this.props.showExpertButton,
190
211
  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
- }
212
+ showTypeSelector: this.props.showTypeSelector
203
213
  })), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
204
214
  variant: "contained",
205
215
  onClick: function onClick() {
@@ -221,31 +231,37 @@ var DialogSelectFile = /*#__PURE__*/function (_React$Component) {
221
231
  return DialogSelectFile;
222
232
  }(_react["default"].Component);
223
233
  DialogSelectFile.propTypes = {
234
+ imagePrefix: _propTypes["default"].string,
224
235
  dialogName: _propTypes["default"].string,
225
236
  // where to store settings in localStorage
237
+ selected: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].array // not implemented
238
+ ]),
226
239
  classes: _propTypes["default"].object,
240
+ onClose: _propTypes["default"].func.isRequired,
241
+ onOk: _propTypes["default"].func.isRequired,
242
+ ok: _propTypes["default"].string,
243
+ cancel: _propTypes["default"].string,
244
+ socket: _propTypes["default"].object.isRequired,
227
245
  allowUpload: _propTypes["default"].bool,
228
246
  allowDownload: _propTypes["default"].bool,
229
247
  allowCreateFolder: _propTypes["default"].bool,
230
248
  allowDelete: _propTypes["default"].bool,
231
249
  allowView: _propTypes["default"].bool,
250
+ // allow view of files
232
251
  showToolbar: _propTypes["default"].bool,
252
+ filterFiles: _propTypes["default"].arrayOf(_propTypes["default"].string),
253
+ // array of extensions ['jpg', 'png]
233
254
  filterByType: _propTypes["default"].string,
234
255
  // e.g. images
256
+ limitPath: _propTypes["default"].string,
257
+ selectOnlyFolders: _propTypes["default"].bool,
258
+ showViewTypeButton: _propTypes["default"].bool,
259
+ // Allow switch views Table<=>Rows
235
260
  showTypeSelector: _propTypes["default"].bool,
236
261
  // If type selector should be shown
237
262
 
238
- onClose: _propTypes["default"].func.isRequired,
239
- onOk: _propTypes["default"].func.isRequired,
240
263
  title: _propTypes["default"].string,
241
264
  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
265
  themeName: _propTypes["default"].string,
250
266
  themeType: _propTypes["default"].string,
251
267
  showExpertButton: _propTypes["default"].bool,
@@ -1 +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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,EAAE6C,qBAAS,CAACM,SAAS,CAAC,CAC1BN,qBAAS,CAACC,MAAM,EAChBD,qBAAS,CAACO,KAAK,CAAE;EAAA,CACpB,CAAC;;EACFvB,MAAM,EAAEgB,qBAAS,CAACE,MAAM,CAACG,UAAU;EACnCT,MAAM,EAAEI,qBAAS,CAACC,MAAM;EACxBtB,WAAW,EAAEqB,qBAAS,CAACC,MAAM;EAC7BP,EAAE,EAAEM,qBAAS,CAACC,MAAM;EACpBf,SAAS,EAAEc,qBAAS,CAACC,MAAM;EAC3BhB,SAAS,EAAEe,qBAAS,CAACC,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"}
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","isFolder","onClose","onOk","multiSelect","Array","isArray","title","length","I18n","t","classes","paper","Utils","clsx","root","imagePrefix","prefix","allowUpload","allowDownload","allowCreateFolder","allowDelete","allowView","showViewTypeButton","showToolbar","limitPath","filterFiles","filterByType","isDoubleClick","setState","selectOnlyFolders","handleOk","lang","getLanguage","socket","themeType","themeName","showExpertButton","expertMode","showTypeSelector","ok","handleCancel","cancel","React","Component","propTypes","PropTypes","string","oneOfType","array","object","func","isRequired","bool","arrayOf","_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} DialogSelectFileProps\n * @property {boolean} [dialogName] PropTypes.string, // where to store settings in localStorage * @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 {boolean} [socket] Socket class (required)\n * @property {boolean} [allowUpload] If download of files enabled\n * @property {boolean} [allowDownload] If download of files enabled\n * @property {boolean} [allowCreateFolder] If creation of folders enabled\n * @property {boolean} [allowDelete] If creation of folders enabled\n * @property {boolean} [allowView] if tile view enabled (default true)\n * @property {boolean} [showToolbar] Show toolbar (default true)\n * @property {array} [limitPath] Limit file browser to one specific objectID of type meta and following path (like vis.0/main)\n * @property {array} [filterFiles] like `['png', 'svg', 'bmp', 'jpg', 'jpeg']`\n * @property {string} [filterByType] images, code, txt, audio, video\n * @property {bool} [selectOnlyFolders] allow only folder's selection * @property {() => void} onClose Close handler that is always called when the dialog is closed.\n * @property {(selected: string | string[] | undefined) => void} onOk Handler that is called when the user presses OK or by double click.\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 {DialogSelectFileProps} 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 isFolder: false,\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 imagePrefix={this.props.imagePrefix || this.props.prefix || '../'} // prefix is for back compatibility\n allowUpload={!!this.props.allowUpload}\n allowDownload={this.props.allowDownload !== false}\n allowCreateFolder={!!this.props.allowCreateFolder}\n allowDelete={!!this.props.allowDelete}\n allowView={this.props.allowView !== false}\n showViewTypeButton={this.props.showViewTypeButton !== false}\n showToolbar={this.props.showToolbar !== false}\n limitPath={this.props.limitPath}\n filterFiles={this.props.filterFiles}\n filterByType={this.props.filterByType}\n selected={this.props.selected}\n onSelect={(selected, isDoubleClick, isFolder) => {\n this.setState({ selected, isFolder }, () =>\n isDoubleClick && (!this.props.selectOnlyFolders || isFolder) && this.handleOk());\n }}\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 />\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 imagePrefix: PropTypes.string,\n dialogName: PropTypes.string, // where to store settings in localStorage\n selected: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.array, // not implemented\n ]), classes: PropTypes.object,\n onClose: PropTypes.func.isRequired,\n onOk: PropTypes.func.isRequired,\n ok: PropTypes.string,\n cancel: PropTypes.string,\n socket: PropTypes.object.isRequired,\n allowUpload: PropTypes.bool,\n allowDownload: PropTypes.bool,\n allowCreateFolder: PropTypes.bool,\n allowDelete: PropTypes.bool,\n allowView: PropTypes.bool, // allow view of files\n showToolbar: PropTypes.bool,\n filterFiles: PropTypes.arrayOf(PropTypes.string), // array of extensions ['jpg', 'png]\n filterByType: PropTypes.string, // e.g. images\n limitPath: PropTypes.string,\n selectOnlyFolders: PropTypes.bool,\n showViewTypeButton: PropTypes.bool, // Allow switch views Table<=>Rows\n showTypeSelector: PropTypes.bool, // If type selector should be shown\n\n title: PropTypes.string,\n lang: PropTypes.string,\n\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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AACC,MAAM;EACpBL,MAAM,EAAEI,qBAAS,CAACC,MAAM;EACxBb,MAAM,EAAEY,qBAAS,CAACI,MAAM,CAACE,UAAU;EACnClC,WAAW,EAAE4B,qBAAS,CAACO,IAAI;EAC3BlC,aAAa,EAAE2B,qBAAS,CAACO,IAAI;EAC7BjC,iBAAiB,EAAE0B,qBAAS,CAACO,IAAI;EACjChC,WAAW,EAAEyB,qBAAS,CAACO,IAAI;EAC3B/B,SAAS,EAAEwB,qBAAS,CAACO,IAAI;EAAE;EAC3B7B,WAAW,EAAEsB,qBAAS,CAACO,IAAI;EAC3B3B,WAAW,EAAEoB,qBAAS,CAACQ,OAAO,CAACR,qBAAS,CAACC,MAAM,CAAC;EAAE;EAClDpB,YAAY,EAAEmB,qBAAS,CAACC,MAAM;EAAE;EAChCtB,SAAS,EAAEqB,qBAAS,CAACC,MAAM;EAC3BjB,iBAAiB,EAAEgB,qBAAS,CAACO,IAAI;EACjC9B,kBAAkB,EAAEuB,qBAAS,CAACO,IAAI;EAAE;EACpCd,gBAAgB,EAAEO,qBAAS,CAACO,IAAI;EAAE;;EAElC9C,KAAK,EAAEuC,qBAAS,CAACC,MAAM;EACvBf,IAAI,EAAEc,qBAAS,CAACC,MAAM;EAEtBX,SAAS,EAAEU,qBAAS,CAACC,MAAM;EAC3BZ,SAAS,EAAEW,qBAAS,CAACC,MAAM;EAC3BV,gBAAgB,EAAES,qBAAS,CAACO,IAAI;EAChCf,UAAU,EAAEQ,qBAAS,CAACO,IAAI;EAAE;EAC5BjD,WAAW,EAAE0C,qBAAS,CAACO,IAAI,CAAE;AACjC,CAAC;;AAED;AACA,IAAME,OAAO,GAAG,IAAAC,sBAAU,EAACxF,MAAM,CAAC,CAACkB,gBAAgB,CAAC;AAAC,eACtCqE,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.4.3",
13
+ "@iobroker/adapter-react": "^3.4.5",
14
14
  ```
15
15
  Versions can be higher.
16
16
  So your src/package.json should look like:
@@ -643,7 +643,7 @@ 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.3 (2022-11-30)
646
+ ### 3.4.5 (2022-11-30)
647
647
  * (bluefox) updated json config component
648
648
 
649
649
  ### 3.4.1 (2022-11-29)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/adapter-react-v5",
3
- "version": "3.4.3",
3
+ "version": "3.4.5",
4
4
  "description": "React classes to develop admin interfaces for ioBroker with react.",
5
5
  "author": {
6
6
  "name": "bluefox",