@bagelink/vue 1.2.93 → 1.2.99

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/dist/index.mjs CHANGED
@@ -15728,8 +15728,8 @@ const _hoisted_12$3 = {
15728
15728
  key: 1,
15729
15729
  class: "bgl-single-preview"
15730
15730
  };
15731
- const _hoisted_13$1 = { class: "position-start m-05 flex opacity-7 z-99 gap-025" };
15732
- const _hoisted_14$1 = {
15731
+ const _hoisted_13$2 = { class: "position-start m-05 flex opacity-7 z-99 gap-025" };
15732
+ const _hoisted_14$2 = {
15733
15733
  key: 0,
15734
15734
  class: "h-100"
15735
15735
  };
@@ -16079,7 +16079,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
16079
16079
  key: file.id,
16080
16080
  class: normalizeClass(["single-image-item-preview", { "bgl_fill-image": _ctx.fill }])
16081
16081
  }, [
16082
- createElementVNode("div", _hoisted_13$1, [
16082
+ createElementVNode("div", _hoisted_13$2, [
16083
16083
  withDirectives(createVNode(unref(Btn), {
16084
16084
  color: "gray",
16085
16085
  thin: "",
@@ -16109,7 +16109,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
16109
16109
  [_directive_tooltip, "Download"]
16110
16110
  ])
16111
16111
  ]),
16112
- isImage(file.extension || file.url) ? (openBlock(), createElementBlock("div", _hoisted_14$1, [
16112
+ isImage(file.extension || file.url) ? (openBlock(), createElementBlock("div", _hoisted_14$2, [
16113
16113
  withDirectives(createVNode(unref(Image$1), {
16114
16114
  class: "single-preview",
16115
16115
  src: file.url,
@@ -27655,6 +27655,108 @@ const files = {
27655
27655
  return axios$1.get("/files_v2/list", { params: { dir_path: dirPath } });
27656
27656
  }
27657
27657
  };
27658
+ function useFileUpload(props2 = {}) {
27659
+ files.setBaseUrl(useBagel().host);
27660
+ const fileQueue = ref([]);
27661
+ const storageFiles = ref([]);
27662
+ const pk = ref([]);
27663
+ const pathKeys = computed(() => {
27664
+ const storagePathKeys = storageFiles.value.map((file) => file.path_key);
27665
+ return [...pk.value, ...storagePathKeys];
27666
+ });
27667
+ const fileToUrl = (file) => URL.createObjectURL(file);
27668
+ const addFile = (file) => {
27669
+ if (!file) return;
27670
+ let filesToAdd = [];
27671
+ if (file instanceof File) {
27672
+ filesToAdd = [file];
27673
+ } else if (file instanceof FileList) {
27674
+ filesToAdd = Array.from(file);
27675
+ } else if (Array.isArray(file)) {
27676
+ filesToAdd = file;
27677
+ }
27678
+ const newQueueFiles = filesToAdd.map((f2) => ({
27679
+ name: f2.name,
27680
+ file: f2,
27681
+ progress: 0
27682
+ }));
27683
+ fileQueue.value.push(...newQueueFiles);
27684
+ };
27685
+ const removeFile = async (pathKeyOrFile) => {
27686
+ if (typeof pathKeyOrFile === "string") {
27687
+ storageFiles.value = storageFiles.value.filter((file) => file.path_key !== pathKeyOrFile);
27688
+ const pathKeyIndex = pk.value.indexOf(pathKeyOrFile);
27689
+ if (pathKeyIndex !== -1) {
27690
+ pk.value.splice(pathKeyIndex, 1);
27691
+ }
27692
+ try {
27693
+ await files.delete(pathKeyOrFile);
27694
+ } catch (error) {
27695
+ console.error("Error deleting file:", error);
27696
+ }
27697
+ } else if (pathKeyOrFile) {
27698
+ const index2 = fileQueue.value.findIndex(({ file }) => file.name === pathKeyOrFile.name);
27699
+ if (index2 !== -1) {
27700
+ fileQueue.value.splice(index2, 1);
27701
+ }
27702
+ }
27703
+ };
27704
+ const flushQueue = async () => {
27705
+ for (const file of fileQueue.value) {
27706
+ file.uploading = true;
27707
+ if (!props2.multiple) {
27708
+ pk.value.splice(0, 1);
27709
+ }
27710
+ try {
27711
+ const { data: data2 } = await files.upload(file.file, {
27712
+ onUploadProgress: (e) => {
27713
+ file.progress = e.loaded / e.total * 100 - 1;
27714
+ },
27715
+ dirPath: props2.dirPath
27716
+ });
27717
+ pk.value.push(data2.path_key);
27718
+ } catch (error) {
27719
+ console.error("Error uploading file:", error);
27720
+ }
27721
+ }
27722
+ fileQueue.value = [];
27723
+ };
27724
+ const browse = (upload = false) => {
27725
+ if (props2.disabled) return;
27726
+ const input = document.createElement("input");
27727
+ input.type = "file";
27728
+ input.multiple = !!props2.multiple;
27729
+ input.accept = props2.accept || "";
27730
+ input.onchange = (e) => {
27731
+ addFile(e.target.files);
27732
+ if (upload) {
27733
+ flushQueue();
27734
+ }
27735
+ };
27736
+ input.click();
27737
+ };
27738
+ onMounted(() => {
27739
+ if (props2.dirPath) {
27740
+ files.list(props2.dirPath).then((response) => {
27741
+ const responseData = Array.isArray(response.data) ? response.data : [response.data];
27742
+ storageFiles.value.push(...responseData);
27743
+ }).catch((error) => {
27744
+ console.error("Error loading files:", error);
27745
+ });
27746
+ }
27747
+ });
27748
+ return {
27749
+ fileQueue,
27750
+ storageFiles,
27751
+ pk,
27752
+ pathKeys,
27753
+ fileToUrl,
27754
+ removeFile,
27755
+ flushQueue,
27756
+ addFile,
27757
+ browse
27758
+ };
27759
+ }
27658
27760
  const _hoisted_1$o = { class: "bagel-input" };
27659
27761
  const _hoisted_2$e = { key: 0 };
27660
27762
  const _hoisted_3$b = {
@@ -27685,8 +27787,8 @@ const _hoisted_12$2 = {
27685
27787
  key: 1,
27686
27788
  class: "bgl-single-preview"
27687
27789
  };
27688
- const _hoisted_13 = { class: "position-start m-05 flex opacity-7 z-99 gap-025" };
27689
- const _hoisted_14 = {
27790
+ const _hoisted_13$1 = { class: "position-start m-05 flex opacity-7 z-99 gap-025" };
27791
+ const _hoisted_14$1 = {
27690
27792
  key: 0,
27691
27793
  class: "h-100"
27692
27794
  };
@@ -27720,111 +27822,61 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
27720
27822
  setup(__props, { emit: __emit }) {
27721
27823
  const props2 = __props;
27722
27824
  const emit2 = __emit;
27723
- const bagel = useBagel(bagelInjectionKey);
27724
- files.setBaseUrl(bagel.host);
27725
- const fileQueue = ref([]);
27726
- let storageFiles = ref([]);
27727
- const pk = ref([props2.modelValue].flat().filter(Boolean));
27728
- const pathKeys = computed(() => {
27729
- const sf = storageFiles.value.map((file) => file.path_key);
27730
- return [...pk.value, ...sf];
27731
- });
27732
- watch(() => pk.value, (value) => {
27733
- if (props2.multiple) emit2("update:modelValue", value);
27734
- else emit2("update:modelValue", value[0] || void 0);
27735
- }, { deep: true });
27825
+ const {
27826
+ fileQueue,
27827
+ pathKeys,
27828
+ removeFile,
27829
+ flushQueue,
27830
+ fileToUrl,
27831
+ addFile,
27832
+ browse
27833
+ } = useFileUpload({
27834
+ disabled: props2.disabled,
27835
+ dirPath: props2.dirPath,
27836
+ multiple: props2.multiple,
27837
+ accept: props2.accept
27838
+ });
27736
27839
  const isImage = (str) => IMAGE_FORMATS_REGEXP.test(str);
27737
- const fileToUrl = (file) => URL.createObjectURL(file);
27738
27840
  let isDragOver = ref(false);
27739
- async function removeFile(path_key) {
27740
- storageFiles.value = storageFiles.value.filter((file) => file.path_key !== path_key);
27741
- const pki = pk.value.indexOf(path_key);
27742
- if (pki !== -1) pk.value.splice(pki, 1);
27743
- try {
27744
- await files.delete(path_key);
27745
- } catch (error) {
27746
- console.error(error);
27747
- }
27748
- }
27749
- async function flushQueue() {
27750
- emit2("addFileStart");
27751
- for (const file of fileQueue.value) {
27752
- file.uploading = true;
27753
- if (!props2.multiple) pk.value.splice(0, 1);
27754
- try {
27755
- const { data: data2 } = await files.upload(file.file, {
27756
- onUploadProgress: (e) => {
27757
- file.progress = e.loaded / e.total * 100 - 1;
27758
- },
27759
- dirPath: props2.dirPath
27760
- });
27761
- pk.value.push(data2.path_key);
27762
- } catch (error) {
27763
- console.error("error flushing queue", error);
27764
- }
27765
- }
27766
- fileQueue.value.splice(0, fileQueue.value.length);
27767
- }
27768
- function browse() {
27769
- if (props2.disabled) return;
27770
- const input = document.createElement("input");
27771
- input.type = "file";
27772
- input.multiple = props2.multiple;
27773
- input.accept = props2.accept;
27774
- input.onchange = (e) => {
27775
- const files2 = Array.from(e.target.files || []);
27776
- fileQueue.value.push(...files2.map((file) => ({ name: file.name, file, progress: 0 })));
27777
- flushQueue();
27778
- };
27779
- input.click();
27780
- }
27781
27841
  function handleDrag(e, isDragging = false) {
27782
27842
  e.preventDefault();
27783
27843
  e.stopPropagation();
27784
27844
  if (!props2.disabled) isDragOver.value = isDragging;
27785
27845
  }
27786
- function handleDrop(e) {
27846
+ async function handleDrop(e) {
27787
27847
  var _a;
27788
27848
  if (props2.disabled) return;
27789
27849
  e.preventDefault();
27790
27850
  e.stopPropagation();
27791
- if ((_a = e.dataTransfer) == null ? void 0 : _a.files) {
27792
- fileQueue.value.push(...Array.from(e.dataTransfer.files).map((file) => ({ name: file.name, file, progress: 0 })));
27793
- flushQueue();
27794
- }
27851
+ emit2("addFileStart");
27852
+ addFile((_a = e.dataTransfer) == null ? void 0 : _a.files);
27853
+ await flushQueue();
27854
+ emit2("update:modelValue", pathKeys.value);
27795
27855
  isDragOver.value = false;
27796
27856
  }
27797
- if (props2.dirPath) {
27798
- files.list(props2.dirPath).then((response) => storageFiles.value.push(...[response.data].flat())).catch(console.error);
27799
- }
27800
- watch(() => props2.dirPath, () => {
27801
- if (props2.dirPath) {
27802
- files.list(props2.dirPath).then((response) => storageFiles.value.push(...[response.data].flat())).catch(console.error);
27803
- }
27804
- });
27805
27857
  return (_ctx, _cache) => {
27806
27858
  const _directive_tooltip = resolveDirective("tooltip");
27807
27859
  const _directive_lightbox = resolveDirective("lightbox");
27808
27860
  return openBlock(), createElementBlock("div", _hoisted_1$o, [
27809
27861
  _ctx.label ? (openBlock(), createElementBlock("label", _hoisted_2$e, toDisplayString(_ctx.label), 1)) : createCommentVNode("", true),
27810
- _ctx.required && !pathKeys.value.length ? (openBlock(), createElementBlock("input", _hoisted_3$b)) : createCommentVNode("", true),
27862
+ _ctx.required && !unref(pathKeys).length ? (openBlock(), createElementBlock("input", _hoisted_3$b)) : createCommentVNode("", true),
27811
27863
  _ctx.theme === "basic" ? (openBlock(), createBlock(unref(_sfc_main$13), {
27812
27864
  key: 2,
27813
27865
  outline: "",
27814
27866
  class: "flex p-05 gap-1",
27815
- onDragover: _cache[0] || (_cache[0] = (e) => handleDrag(e, true)),
27867
+ onDragover: _cache[2] || (_cache[2] = (e) => handleDrag(e, true)),
27816
27868
  onDrop: handleDrop
27817
27869
  }, {
27818
27870
  default: withCtx(() => [
27819
- !pathKeys.value.length && !fileQueue.value.length ? (openBlock(), createBlock(unref(Btn), {
27871
+ !unref(pathKeys).length && !unref(fileQueue).length ? (openBlock(), createBlock(unref(Btn), {
27820
27872
  key: 0,
27821
27873
  class: "px-1-5",
27822
27874
  icon: "upload",
27823
27875
  outline: "",
27824
27876
  value: _ctx.btnPlaceholder || "Upload",
27825
- onClick: browse
27877
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(browse)(true))
27826
27878
  }, null, 8, ["value"])) : createCommentVNode("", true),
27827
- (openBlock(true), createElementBlock(Fragment, null, renderList(pathKeys.value, (path_key) => {
27879
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(pathKeys), (path_key) => {
27828
27880
  return openBlock(), createElementBlock("div", {
27829
27881
  key: path_key,
27830
27882
  class: "txt-gray txt-12 flex"
@@ -27834,7 +27886,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
27834
27886
  color: "gray",
27835
27887
  thin: "",
27836
27888
  icon: "delete",
27837
- onClick: ($event) => removeFile(path_key)
27889
+ onClick: ($event) => unref(removeFile)(path_key)
27838
27890
  }, null, 8, ["onClick"]), [
27839
27891
  [_directive_tooltip, "Delete"]
27840
27892
  ]),
@@ -27842,7 +27894,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
27842
27894
  color: "gray",
27843
27895
  thin: "",
27844
27896
  icon: "autorenew",
27845
- onClick: browse
27897
+ onClick: _cache[1] || (_cache[1] = ($event) => unref(browse)(true))
27846
27898
  }, null, 512), [
27847
27899
  [_directive_tooltip, "Replace"]
27848
27900
  ]),
@@ -27867,28 +27919,28 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
27867
27919
  ])
27868
27920
  ]);
27869
27921
  }), 128)),
27870
- !pathKeys.value.length && !fileQueue.value.length ? (openBlock(), createElementBlock("span", _hoisted_7$4, toDisplayString(_ctx.noFilePlaceholder || "No file selected"), 1)) : createCommentVNode("", true)
27922
+ !unref(pathKeys).length && !unref(fileQueue).length ? (openBlock(), createElementBlock("span", _hoisted_7$4, toDisplayString(_ctx.noFilePlaceholder || "No file selected"), 1)) : createCommentVNode("", true)
27871
27923
  ]),
27872
27924
  _: 1
27873
27925
  })) : (openBlock(), createElementBlock("div", {
27874
27926
  key: 3,
27875
27927
  class: normalizeClass(["fileUploadWrap", {
27876
- "fileDropZone": !pathKeys.value.length && !fileQueue.value.length,
27928
+ "fileDropZone": !unref(pathKeys).length && !unref(fileQueue).length,
27877
27929
  "dragover": unref(isDragOver),
27878
27930
  "bgl_oval-upload": _ctx.oval
27879
27931
  }]),
27880
27932
  style: normalizeStyle({ width: _ctx.width, height: _ctx.height }),
27881
- onClick: browse,
27882
- onDragover: _cache[1] || (_cache[1] = (e) => handleDrag(e, true)),
27933
+ onClick: _cache[4] || (_cache[4] = ($event) => unref(browse)(true)),
27934
+ onDragover: _cache[5] || (_cache[5] = (e) => handleDrag(e, true)),
27883
27935
  onDrop: handleDrop,
27884
- onDragleave: _cache[2] || (_cache[2] = (e) => handleDrag(e))
27936
+ onDragleave: _cache[6] || (_cache[6] = (e) => handleDrag(e))
27885
27937
  }, [
27886
27938
  renderSlot(_ctx.$slots, "files", {
27887
- files: pathKeys.value,
27888
- fileQueue: fileQueue.value
27939
+ files: unref(pathKeys),
27940
+ fileQueue: unref(fileQueue)
27889
27941
  }, () => [
27890
27942
  _ctx.multiple ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
27891
- (openBlock(true), createElementBlock(Fragment, null, renderList(pathKeys.value, (path_key) => {
27943
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(pathKeys), (path_key) => {
27892
27944
  return withDirectives((openBlock(), createElementBlock("div", {
27893
27945
  key: path_key,
27894
27946
  class: normalizeClass(["multi-image-item-preview", { "bgl_fill-image": _ctx.fill }])
@@ -27908,13 +27960,13 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
27908
27960
  flat: "",
27909
27961
  icon: "delete",
27910
27962
  color: "red",
27911
- onClick: ($event) => removeFile(path_key)
27963
+ onClick: ($event) => unref(removeFile)(path_key)
27912
27964
  }, null, 8, ["onClick"])
27913
27965
  ], 2)), [
27914
27966
  [_directive_lightbox, { src: unref(pathKeyToURL)(path_key), download: true }]
27915
27967
  ]);
27916
27968
  }), 128)),
27917
- (openBlock(true), createElementBlock(Fragment, null, renderList(fileQueue.value, (file) => {
27969
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(fileQueue), (file) => {
27918
27970
  return openBlock(), createElementBlock("div", {
27919
27971
  key: file.name,
27920
27972
  class: normalizeClass(["multi-image-item-preview", { "bgl_fill-image": _ctx.fill }])
@@ -27922,7 +27974,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
27922
27974
  isImage(file.file.type) ? (openBlock(), createBlock(unref(Image$1), {
27923
27975
  key: 0,
27924
27976
  class: "multi-preview",
27925
- src: fileToUrl(file.file),
27977
+ src: unref(fileToUrl)(file.file),
27926
27978
  alt: ""
27927
27979
  }, null, 8, ["src"])) : (openBlock(), createBlock(unref(_sfc_main$u), {
27928
27980
  key: 1,
@@ -27942,18 +27994,18 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
27942
27994
  ], 6)
27943
27995
  ], 2);
27944
27996
  }), 128))
27945
- ])) : pathKeys.value.length > 0 || fileQueue.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_12$2, [
27946
- (openBlock(true), createElementBlock(Fragment, null, renderList(pathKeys.value, (path_key) => {
27997
+ ])) : unref(pathKeys).length > 0 || unref(fileQueue).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_12$2, [
27998
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(pathKeys), (path_key) => {
27947
27999
  return openBlock(), createElementBlock("div", {
27948
28000
  key: path_key,
27949
28001
  class: normalizeClass(["single-image-item-preview", { "bgl_fill-image": _ctx.fill }])
27950
28002
  }, [
27951
- createElementVNode("div", _hoisted_13, [
28003
+ createElementVNode("div", _hoisted_13$1, [
27952
28004
  withDirectives(createVNode(unref(Btn), {
27953
28005
  color: "gray",
27954
28006
  thin: "",
27955
28007
  icon: "delete",
27956
- onClick: ($event) => removeFile(path_key)
28008
+ onClick: ($event) => unref(removeFile)(path_key)
27957
28009
  }, null, 8, ["onClick"]), [
27958
28010
  [_directive_tooltip, "Delete"]
27959
28011
  ]),
@@ -27961,7 +28013,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
27961
28013
  color: "gray",
27962
28014
  thin: "",
27963
28015
  icon: "autorenew",
27964
- onClick: browse
28016
+ onClick: _cache[3] || (_cache[3] = ($event) => unref(browse)(true))
27965
28017
  }, null, 512), [
27966
28018
  [_directive_tooltip, "Replace"]
27967
28019
  ]),
@@ -27975,7 +28027,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
27975
28027
  [_directive_tooltip, "Download"]
27976
28028
  ])
27977
28029
  ]),
27978
- isImage(path_key) ? (openBlock(), createElementBlock("div", _hoisted_14, [
28030
+ isImage(path_key) ? (openBlock(), createElementBlock("div", _hoisted_14$1, [
27979
28031
  withDirectives(createVNode(unref(Image$1), {
27980
28032
  class: "single-preview",
27981
28033
  pathKey: path_key,
@@ -27994,7 +28046,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
27994
28046
  ])
27995
28047
  ], 2);
27996
28048
  }), 128)),
27997
- (openBlock(true), createElementBlock(Fragment, null, renderList(fileQueue.value, (file) => {
28049
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(fileQueue), (file) => {
27998
28050
  return openBlock(), createElementBlock("div", {
27999
28051
  key: file.name,
28000
28052
  class: normalizeClass(["single-image-item-preview", { "bgl_fill-image": _ctx.fill }])
@@ -28012,20 +28064,20 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
28012
28064
  isImage(file.file.type) ? withDirectives((openBlock(), createBlock(unref(Image$1), {
28013
28065
  key: 0,
28014
28066
  class: "single-preview",
28015
- src: fileToUrl(file.file),
28067
+ src: unref(fileToUrl)(file.file),
28016
28068
  alt: ""
28017
28069
  }, null, 8, ["src"])), [
28018
- [_directive_lightbox, { src: fileToUrl(file.file), download: true }]
28070
+ [_directive_lightbox, { src: unref(fileToUrl)(file.file), download: true }]
28019
28071
  ]) : createCommentVNode("", true)
28020
28072
  ], 2);
28021
28073
  }), 128))
28022
28074
  ])) : createCommentVNode("", true)
28023
28075
  ], true),
28024
- !pathKeys.value.length && !fileQueue.value.length || _ctx.multiple ? renderSlot(_ctx.$slots, "placeholder", {
28076
+ !unref(pathKeys).length && !unref(fileQueue).length || _ctx.multiple ? renderSlot(_ctx.$slots, "placeholder", {
28025
28077
  key: 0,
28026
- files: pathKeys.value,
28027
- fileQueue: fileQueue.value,
28028
- browse
28078
+ files: unref(pathKeys),
28079
+ fileQueue: unref(fileQueue),
28080
+ browse: unref(browse)
28029
28081
  }, () => [
28030
28082
  createElementVNode("p", _hoisted_16, [
28031
28083
  createVNode(unref(_sfc_main$u), { icon: "upload_2" }),
@@ -28037,7 +28089,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
28037
28089
  };
28038
28090
  }
28039
28091
  });
28040
- const UploadInput = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-d8f3ff01"]]);
28092
+ const UploadInput = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-38a4d4a9"]]);
28041
28093
  const FONT_AWESOME_ICONS = [
28042
28094
  "trash-can",
28043
28095
  "message",
@@ -34063,8 +34115,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
34063
34115
  },
34064
34116
  setup(__props) {
34065
34117
  useCssVars((_ctx) => ({
34066
- "dbb738e2": computedBackgroundColor.value,
34067
- "418961aa": cumputedTextColor.value
34118
+ "09d70b6a": computedBackgroundColor.value,
34119
+ "69df9534": cumputedTextColor.value
34068
34120
  }));
34069
34121
  const props2 = __props;
34070
34122
  const slots = useSlots();
@@ -34148,7 +34200,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
34148
34200
  createVNode(unref(Btn), mergeProps({
34149
34201
  class: "bgl_pill-btn",
34150
34202
  round: "",
34151
- thin: ""
34203
+ thin: "",
34204
+ flat: ""
34152
34205
  }, _ctx.btnEnd), null, 16)
34153
34206
  ])) : createCommentVNode("", true)
34154
34207
  ]))
@@ -34157,7 +34210,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
34157
34210
  };
34158
34211
  }
34159
34212
  });
34160
- const Pill = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-764b6b8b"]]);
34213
+ const Pill = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-ae730ec5"]]);
34161
34214
  const _sfc_main$8 = {};
34162
34215
  function _sfc_render$2(_ctx, _cache) {
34163
34216
  const _component_router_view = resolveComponent("router-view");
@@ -36587,17 +36640,22 @@ const _hoisted_3 = {
36587
36640
  class: "center"
36588
36641
  };
36589
36642
  const _hoisted_4 = { key: 3 };
36590
- const _hoisted_5 = ["src", "title"];
36591
- const _hoisted_6 = {
36643
+ const _hoisted_5 = {
36644
+ key: 2,
36645
+ class: "vw90"
36646
+ };
36647
+ const _hoisted_6 = ["src", "title"];
36648
+ const _hoisted_7 = {
36592
36649
  key: 3,
36593
- class: "file-info txt-white flex m_block align-items-start gap-025"
36650
+ class: "vw90"
36594
36651
  };
36595
- const _hoisted_7 = { class: "txt-start" };
36596
- const _hoisted_8 = { class: "mx-0 light" };
36597
- const _hoisted_9 = { class: "semi word-break-all" };
36598
- const _hoisted_10 = { class: "mx-0" };
36599
- const _hoisted_11 = { class: "semi" };
36600
- const _hoisted_12 = {
36652
+ const _hoisted_8 = { class: "file-info txt-white flex m_block align-items-start gap-025" };
36653
+ const _hoisted_9 = { class: "txt-start" };
36654
+ const _hoisted_10 = { class: "mx-0 light" };
36655
+ const _hoisted_11 = { class: "semi word-break-all" };
36656
+ const _hoisted_12 = { class: "mx-0" };
36657
+ const _hoisted_13 = { class: "semi" };
36658
+ const _hoisted_14 = {
36601
36659
  key: 0,
36602
36660
  class: "flex justify-content-center mt-2 overflow p-1 fixed bottom start end gap-1 m_justify-content-start"
36603
36661
  };
@@ -36652,11 +36710,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36652
36710
  if (zoom.value === 1) close();
36653
36711
  }
36654
36712
  const upgradeHeaders = (url) => url.replace(/http:\/\//, "//");
36713
+ function downloadFile() {
36714
+ const link = document.createElement("a");
36715
+ const src = currentItem.value.src || "";
36716
+ link.target = "_blank";
36717
+ link.href = upgradeHeaders(src);
36718
+ link.download = src ? src.split("/").pop() || "download" : "download";
36719
+ document.body.appendChild(link);
36720
+ link.click();
36721
+ document.body.removeChild(link);
36722
+ }
36655
36723
  __expose({ open, close });
36656
36724
  return (_ctx, _cache) => {
36657
36725
  return openBlock(), createBlock(Transition, { name: "fade" }, {
36658
36726
  default: withCtx(() => {
36659
- var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j;
36727
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i;
36660
36728
  return [
36661
36729
  unref(isOpen) ? (openBlock(), createElementBlock("div", {
36662
36730
  key: 0,
@@ -36736,10 +36804,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36736
36804
  flat: "",
36737
36805
  icon: "download",
36738
36806
  value: "Download File",
36739
- href: upgradeHeaders((_h = unref(currentItem)) == null ? void 0 : _h.src),
36740
- download: ""
36741
- }, null, 8, ["href"])) : createCommentVNode("", true),
36742
- !((_i = unref(currentItem)) == null ? void 0 : _i.openFile) && !((_j = unref(currentItem)) == null ? void 0 : _j.download) ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true)
36807
+ onClick: downloadFile
36808
+ })) : createCommentVNode("", true),
36809
+ !((_h = unref(currentItem)) == null ? void 0 : _h.openFile) && !((_i = unref(currentItem)) == null ? void 0 : _i.download) ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true)
36743
36810
  ]),
36744
36811
  createVNode(unref(Carousel), {
36745
36812
  index: unref(currentIndex),
@@ -36775,44 +36842,47 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36775
36842
  autoplay: "",
36776
36843
  controls: "",
36777
36844
  class: "vw90"
36778
- }, null, 8, ["src"])) : (item == null ? void 0 : item.type) === "pdf" && (item == null ? void 0 : item.src) ? (openBlock(), createElementBlock("embed", {
36779
- key: 2,
36780
- src: unref(normalizeURL)(item == null ? void 0 : item.src),
36781
- type: "application/pdf",
36782
- width: "100%",
36783
- height: "1080",
36784
- title: item == null ? void 0 : item.name,
36785
- class: "vw90"
36786
- }, null, 8, _hoisted_5)) : (openBlock(), createElementBlock("div", _hoisted_6, [
36787
- createVNode(unref(_sfc_main$u), {
36788
- class: "m-0 m_none",
36789
- icon: "draft",
36790
- size: 10,
36791
- weight: "12"
36792
- }),
36793
- createVNode(unref(_sfc_main$u), {
36794
- class: "m-0 none m_block m_-mb-1",
36795
- icon: "draft",
36796
- size: 4,
36797
- weight: "2"
36798
- }),
36799
- createElementVNode("div", _hoisted_7, [
36800
- createElementVNode("p", _hoisted_8, [
36801
- _cache[6] || (_cache[6] = createTextVNode(" File: ")),
36802
- createElementVNode("span", _hoisted_9, toDisplayString(item == null ? void 0 : item.name), 1)
36803
- ]),
36804
- createElementVNode("p", _hoisted_10, [
36805
- _cache[7] || (_cache[7] = createTextVNode(" Type: ")),
36806
- createElementVNode("span", _hoisted_11, toDisplayString(item == null ? void 0 : item.type), 1)
36807
- ]),
36808
- createVNode(unref(Btn), {
36809
- href: item == null ? void 0 : item.src,
36810
- target: "_blank",
36811
- round: "",
36812
- thin: "",
36813
- class: "mt-1",
36814
- value: "Open file"
36815
- }, null, 8, ["href"])
36845
+ }, null, 8, ["src"])) : (item == null ? void 0 : item.type) === "pdf" && (item == null ? void 0 : item.src) ? (openBlock(), createElementBlock("div", _hoisted_5, [
36846
+ createElementVNode("embed", {
36847
+ src: unref(normalizeURL)(item == null ? void 0 : item.src),
36848
+ type: "application/pdf",
36849
+ width: "100%",
36850
+ height: "1080",
36851
+ title: item == null ? void 0 : item.name,
36852
+ class: "vw90"
36853
+ }, null, 8, _hoisted_6)
36854
+ ])) : (openBlock(), createElementBlock("div", _hoisted_7, [
36855
+ createElementVNode("div", _hoisted_8, [
36856
+ createVNode(unref(_sfc_main$u), {
36857
+ class: "m-0 m_none",
36858
+ icon: "draft",
36859
+ size: 10,
36860
+ weight: "12"
36861
+ }),
36862
+ createVNode(unref(_sfc_main$u), {
36863
+ class: "m-0 none m_block m_-mb-1",
36864
+ icon: "draft",
36865
+ size: 4,
36866
+ weight: "2"
36867
+ }),
36868
+ createElementVNode("div", _hoisted_9, [
36869
+ createElementVNode("p", _hoisted_10, [
36870
+ _cache[6] || (_cache[6] = createTextVNode(" File: ")),
36871
+ createElementVNode("span", _hoisted_11, toDisplayString(item == null ? void 0 : item.name), 1)
36872
+ ]),
36873
+ createElementVNode("p", _hoisted_12, [
36874
+ _cache[7] || (_cache[7] = createTextVNode(" Type: ")),
36875
+ createElementVNode("span", _hoisted_13, toDisplayString(item == null ? void 0 : item.type), 1)
36876
+ ]),
36877
+ createVNode(unref(Btn), {
36878
+ href: item == null ? void 0 : item.src,
36879
+ target: "_blank",
36880
+ round: "",
36881
+ thin: "",
36882
+ class: "mt-1",
36883
+ value: "Open file"
36884
+ }, null, 8, ["href"])
36885
+ ])
36816
36886
  ])
36817
36887
  ]))
36818
36888
  ], 64);
@@ -36820,7 +36890,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36820
36890
  ]),
36821
36891
  _: 1
36822
36892
  }, 8, ["index", "class", "freeDrag"]),
36823
- unref(group) && unref(group).length > 1 ? (openBlock(), createElementBlock("div", _hoisted_12, [
36893
+ unref(group) && unref(group).length > 1 ? (openBlock(), createElementBlock("div", _hoisted_14, [
36824
36894
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(group), (item, index2) => {
36825
36895
  return openBlock(), createElementBlock(Fragment, { key: index2 }, [
36826
36896
  item.type === "image" ? (openBlock(), createBlock(unref(Image$1), {
@@ -36847,7 +36917,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36847
36917
  };
36848
36918
  }
36849
36919
  });
36850
- const Lightbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fb2d5763"]]);
36920
+ const Lightbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4789af69"]]);
36851
36921
  const groups = {};
36852
36922
  let clickHandler = (_e2) => void 0;
36853
36923
  const lightboxDirective = {
@@ -38110,6 +38180,7 @@ export {
38110
38180
  useDevice,
38111
38181
  useDraggable,
38112
38182
  useEscape,
38183
+ useFileUpload,
38113
38184
  useForm,
38114
38185
  useI18nT,
38115
38186
  useLang,