@saltcorn/filemanager 1.5.0-beta.0 → 1.5.0-beta.10

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/src/Picker.svelte CHANGED
@@ -19,6 +19,7 @@
19
19
 
20
20
  export let currentFolder = "/";
21
21
  export let noSubdirs = false;
22
+ export let file_exts = null;
22
23
  export let inputId = "";
23
24
 
24
25
  let files = [];
@@ -34,10 +35,13 @@
34
35
  });
35
36
 
36
37
  const fetchAndReset = async function () {
37
- const response = await fetch(
38
- `/files/visible_entries?dir=${encodeURIComponent(currentFolder)}${
38
+ const url = `/files/visible_entries?dir=${encodeURIComponent(currentFolder)}${
39
39
  noSubdirs ? "&no_subdirs=true" : ""
40
- }`,
40
+ }${
41
+ file_exts ? "&file_exts="+file_exts : ""
42
+ }`
43
+ const response = await fetch(
44
+ url,
41
45
  {
42
46
  headers: { "X-Requested-With": "XMLHttpRequest" },
43
47
  }
package/src/main.js CHANGED
@@ -13,12 +13,14 @@ if (fullManager) {
13
13
  const currentFolder = target?.getAttribute("folder") || "/";
14
14
  const inputId = target?.getAttribute("input_id");
15
15
  const noSubdirs = target?.getAttribute("no_subdirs") === "true";
16
+ const file_exts = target?.getAttribute("file_exts");
16
17
  app = new Picker({
17
18
  target: target,
18
19
  props: {
19
20
  currentFolder: currentFolder,
20
21
  inputId: inputId,
21
22
  noSubdirs: noSubdirs,
23
+ file_exts,
22
24
  },
23
25
  });
24
26
  }