@bagelink/vue 0.0.897 → 0.0.899

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.
@@ -1 +1 @@
1
- {"version":3,"file":"FileUpload.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/FileUpload.vue"],"names":[],"mappings":"AAwkBA,OAAO,EAAmC,KAAK,WAAW,EAAkB,MAAM,eAAe,CAAA;AAKjG,KAAK,MAAM,GAAG,MAAM,WAAW,CAAA;AAE/B,KAAK,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,CAAA;AAuJzC,iBAAS,MAAM,SAiBd;AA6BD,iBAAS,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA3KZ,MAAM;4BACJ,OAAO;uBACZ,MAAM;2BACF,OAAO;;YAglBS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;0BAnlBpB,MAAM;4BACJ,OAAO;uBACZ,MAAM;2BACF,OAAO;;;YAilBe,GAAG;;;WASvB,OAAO,IAA6B;EAEjD;AAuBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;YA9oBZ,MAAM;eACH,OAAO;YACV,WAAW,GAAG,WAAW,EAAE;cACzB,MAAM;iBACH,OAAO;YACZ,MAAM;aACL,MAAM,GAAG,MAAM;YAChB,MAAM;WACP,OAAO;WACP,OAAO;YACN,UAAU,GAAG,OAAO;aACnB,MAAM;;;;;YAXP,MAAM;eACH,OAAO;YACV,WAAW,GAAG,WAAW,EAAE;cACzB,MAAM;iBACH,OAAO;YACZ,MAAM;aACL,MAAM,GAAG,MAAM;YAChB,MAAM;WACP,OAAO;WACP,OAAO;YACN,UAAU,GAAG,OAAO;aACnB,MAAM;;;;kFA0oBd,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"FileUpload.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/FileUpload.vue"],"names":[],"mappings":"AAykBA,OAAO,EAAmC,KAAK,WAAW,EAAkB,MAAM,eAAe,CAAA;AAKjG,KAAK,MAAM,GAAG,MAAM,WAAW,CAAA;AAE/B,KAAK,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,CAAA;AAuJzC,iBAAS,MAAM,SAiBd;AA6BD,iBAAS,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA3KZ,MAAM;4BACJ,OAAO;uBACZ,MAAM;2BACF,OAAO;;YAilBS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;0BAplBpB,MAAM;4BACJ,OAAO;uBACZ,MAAM;2BACF,OAAO;;;YAklBe,GAAG;;;WASvB,OAAO,IAA6B;EAEjD;AAuBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;YA/oBZ,MAAM;eACH,OAAO;YACV,WAAW,GAAG,WAAW,EAAE;cACzB,MAAM;iBACH,OAAO;YACZ,MAAM;aACL,MAAM,GAAG,MAAM;YAChB,MAAM;WACP,OAAO;WACP,OAAO;YACN,UAAU,GAAG,OAAO;aACnB,MAAM;;;;;YAXP,MAAM;eACH,OAAO;YACV,WAAW,GAAG,WAAW,EAAE;cACzB,MAAM;iBACH,OAAO;YACZ,MAAM;aACL,MAAM,GAAG,MAAM;YAChB,MAAM;WACP,OAAO;WACP,OAAO;YACN,UAAU,GAAG,OAAO;aACnB,MAAM;;;;kFA2oBd,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Lightbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/Lightbox.vue"],"names":[],"mappings":"AA4PA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AASpD,iBAAS,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,QAO5D;AAED,iBAAS,KAAK,SAGb;;;;;AA8bD,wBAMG"}
1
+ {"version":3,"file":"Lightbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/Lightbox.vue"],"names":[],"mappings":"AAoQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAYpD,iBAAS,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,QAO5D;AAED,iBAAS,KAAK,SAGb;;;;;AAidD,wBAMG"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAA+B,MAAM,KAAK,CAAA;;iBAkF7C,GAAG;;AADjB,wBAIC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAA+B,MAAM,KAAK,CAAA;;iBAyF7C,GAAG;;AADjB,wBAIC"}
package/dist/index.cjs CHANGED
@@ -18661,8 +18661,8 @@ const _hoisted_11$1 = {
18661
18661
  key: 0,
18662
18662
  class: "h-100"
18663
18663
  };
18664
- const _hoisted_12 = ["src"];
18665
- const _hoisted_13 = { class: "position-start m-05 flex opacity-7" };
18664
+ const _hoisted_12$1 = ["src"];
18665
+ const _hoisted_13$1 = { class: "position-start m-05 flex opacity-7" };
18666
18666
  const _hoisted_14 = {
18667
18667
  key: 0,
18668
18668
  class: "progress"
@@ -18887,18 +18887,16 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
18887
18887
  }, () => [
18888
18888
  _ctx.multiple ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$c, [
18889
18889
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(storageFiles.value, (file) => {
18890
- return vue.openBlock(), vue.createElementBlock("div", {
18890
+ return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
18891
18891
  key: file.id,
18892
18892
  class: "multi-image-item-preview"
18893
18893
  }, [
18894
- isImage(file.extension || file.url) ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("img", {
18894
+ isImage(file.extension || file.url) ? (vue.openBlock(), vue.createElementBlock("img", {
18895
18895
  key: 0,
18896
18896
  class: "multi-preview",
18897
18897
  src: file.url,
18898
18898
  alt: ""
18899
- }, null, 8, _hoisted_5$a)), [
18900
- [_directive_lightbox]
18901
- ]) : (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
18899
+ }, null, 8, _hoisted_5$a)) : (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
18902
18900
  key: 1,
18903
18901
  icon: "draft",
18904
18902
  class: "multi-preview"
@@ -18911,6 +18909,8 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
18911
18909
  color: "red",
18912
18910
  onClick: vue.withModifiers(($event) => removeFile(file), ["stop"])
18913
18911
  }, null, 8, ["onClick"])
18912
+ ])), [
18913
+ [_directive_lightbox, { src: file.url, download: true }]
18914
18914
  ]);
18915
18915
  }), 128)),
18916
18916
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fileQueue.value, (fileQ) => {
@@ -18956,10 +18956,10 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
18956
18956
  class: "single-preview",
18957
18957
  src: file.url,
18958
18958
  alt: ""
18959
- }, null, 8, _hoisted_12), [
18960
- [_directive_lightbox]
18959
+ }, null, 8, _hoisted_12$1), [
18960
+ [_directive_lightbox, { src: file.url, download: true }]
18961
18961
  ]),
18962
- vue.createElementVNode("div", _hoisted_13, [
18962
+ vue.createElementVNode("div", _hoisted_13$1, [
18963
18963
  vue.withDirectives(vue.createVNode(vue.unref(Btn), {
18964
18964
  color: "gray",
18965
18965
  thin: "",
@@ -18989,13 +18989,15 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
18989
18989
  [_directive_tooltip, "Download"]
18990
18990
  ])
18991
18991
  ])
18992
- ])) : (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
18992
+ ])) : vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
18993
18993
  key: 1,
18994
18994
  size: 4,
18995
18995
  weight: "2",
18996
18996
  icon: "draft",
18997
18997
  class: "color-primary w-100"
18998
- }))
18998
+ }, null, 512)), [
18999
+ [_directive_lightbox, { src: file.url, download: true }]
19000
+ ])
18999
19001
  ], 2);
19000
19002
  }), 128)),
19001
19003
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fileQueue.value, (fileQ) => {
@@ -19039,7 +19041,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
19039
19041
  };
19040
19042
  }
19041
19043
  });
19042
- const $el = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-963c1a6d"]]);
19044
+ const $el = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-c2732102"]]);
19043
19045
  const _hoisted_1$u = ["title"];
19044
19046
  const _hoisted_2$k = { key: 0 };
19045
19047
  const _hoisted_3$g = ["value", "placeholder"];
@@ -55231,7 +55233,7 @@ const _hoisted_1 = {
55231
55233
  key: 0,
55232
55234
  class: "navigation flex space-between px-3 w-100 absolute"
55233
55235
  };
55234
- const _hoisted_2 = { class: "flex start fixed top-1 w-100 space-between start-1" };
55236
+ const _hoisted_2 = { class: "flex start fixed top-1 w-100 space-between px-1" };
55235
55237
  const _hoisted_3 = {
55236
55238
  key: 0,
55237
55239
  class: "center"
@@ -55242,14 +55244,16 @@ const _hoisted_6 = ["src"];
55242
55244
  const _hoisted_7 = ["src", "title"];
55243
55245
  const _hoisted_8 = {
55244
55246
  key: 3,
55245
- class: "file-info txt-white"
55247
+ class: "file-info txt-white flex align-items-start gap-1"
55246
55248
  };
55247
- const _hoisted_9 = ["href"];
55248
- const _hoisted_10 = {
55249
+ const _hoisted_9 = { class: "txt-start" };
55250
+ const _hoisted_10 = { class: "m-0" };
55251
+ const _hoisted_11 = { class: "m-0" };
55252
+ const _hoisted_12 = {
55249
55253
  key: 0,
55250
55254
  class: "flex justify-content-center mt-2 overflow p-1 fixed bottom start end gap-1 m_justify-content-start"
55251
55255
  };
55252
- const _hoisted_11 = ["src", "onClick"];
55256
+ const _hoisted_13 = ["src", "onClick"];
55253
55257
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55254
55258
  __name: "Lightbox",
55255
55259
  setup(__props, { expose: __expose }) {
@@ -55316,7 +55320,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55316
55320
  return [
55317
55321
  vue.unref(isOpen) ? (vue.openBlock(), vue.createElementBlock("div", {
55318
55322
  key: 0,
55319
- class: "bgl-lightbox-overlay fixed w-100 h-100 flex justify-content-center z-999 inset mx-auto",
55323
+ class: "bgl-lightbox-overlay fixed w-100 h-100 flex justify-content-center z-9999 inset mx-auto",
55320
55324
  onKeydown: [
55321
55325
  vue.withKeys(close2, ["esc"]),
55322
55326
  vue.withKeys(prev, ["left"]),
@@ -55430,15 +55434,26 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55430
55434
  title: (_o = vue.unref(currentItem)) == null ? void 0 : _o.name,
55431
55435
  class: "vw90"
55432
55436
  }, null, 8, _hoisted_7)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
55433
- vue.createElementVNode("p", null, "File: " + vue.toDisplayString((_p = vue.unref(currentItem)) == null ? void 0 : _p.name), 1),
55434
- vue.createElementVNode("p", null, "Type: " + vue.toDisplayString((_q = vue.unref(currentItem)) == null ? void 0 : _q.type), 1),
55435
- vue.createElementVNode("a", {
55436
- href: (_r2 = vue.unref(currentItem)) == null ? void 0 : _r2.src,
55437
- target: "_blank"
55438
- }, "Open file", 8, _hoisted_9)
55437
+ vue.createVNode(vue.unref(_sfc_main$c), {
55438
+ class: "m-0",
55439
+ icon: "draft",
55440
+ size: 3
55441
+ }),
55442
+ vue.createElementVNode("div", _hoisted_9, [
55443
+ vue.createElementVNode("p", _hoisted_10, " File: " + vue.toDisplayString((_p = vue.unref(currentItem)) == null ? void 0 : _p.name), 1),
55444
+ vue.createElementVNode("p", _hoisted_11, " Type: " + vue.toDisplayString((_q = vue.unref(currentItem)) == null ? void 0 : _q.type), 1),
55445
+ vue.createVNode(vue.unref(Btn), {
55446
+ href: (_r2 = vue.unref(currentItem)) == null ? void 0 : _r2.src,
55447
+ target: "_blank",
55448
+ round: "",
55449
+ thin: "",
55450
+ class: "mt-1",
55451
+ value: "Open file"
55452
+ }, null, 8, ["href"])
55453
+ ])
55439
55454
  ]))
55440
55455
  ]),
55441
- vue.unref(group) && vue.unref(group).length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
55456
+ vue.unref(group) && vue.unref(group).length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
55442
55457
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(group), (item, index2) => {
55443
55458
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
55444
55459
  item.type === "image" ? (vue.openBlock(), vue.createElementBlock("img", {
@@ -55447,7 +55462,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55447
55462
  src: item.src,
55448
55463
  alt: "",
55449
55464
  onClick: ($event) => selectItem(index2)
55450
- }, null, 10, _hoisted_11)) : (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
55465
+ }, null, 10, _hoisted_13)) : (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
55451
55466
  key: 1,
55452
55467
  class: vue.normalizeClass(["thumbnail object-fit-cover hover opacity-5 ed flex bg-popup justify-content-center align-items-center flex-shrink-0", { active: vue.unref(currentIndex) === index2 }]),
55453
55468
  icon: "description",
@@ -55465,7 +55480,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55465
55480
  };
55466
55481
  }
55467
55482
  });
55468
- const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f5f9581d"]]);
55483
+ const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6ceb84fe"]]);
55469
55484
  const groups = {};
55470
55485
  let clickHandler = (_e2) => void 0;
55471
55486
  const lightboxDirective = {
@@ -55511,17 +55526,23 @@ function bindingToItem(binding, el) {
55511
55526
  let { group, src, type: type3, name, thumbnail, enableZoom, openFile, download } = binding.value || {};
55512
55527
  src = src || binding.value || el.getAttribute("src") || "";
55513
55528
  type3 = type3 || determineFileType(src);
55529
+ name = name || urlToName(src) || el.getAttribute("alt") || "";
55514
55530
  return { src, type: type3, name, thumbnail, group, enableZoom, openFile, download };
55515
55531
  }
55516
55532
  const youtubeRegex = /youtube\.com|youtu\.be/;
55517
55533
  const vimeoRegex = /vimeo\.com/;
55534
+ function urlToName(url) {
55535
+ if (!url) return "";
55536
+ const name = url.split("/").pop() || "";
55537
+ return name.replace(/\.[^/.]+$/, "");
55538
+ }
55518
55539
  function determineFileType(url) {
55519
55540
  if (!url) return "unknown";
55520
55541
  const extension = (url.split(".").pop() || "").toLowerCase();
55521
55542
  if (IMAGE_FORMATS_REGEXP.test(extension)) return "image";
55522
55543
  if (VIDEO_FORMATS_REGEXP.test(extension) || youtubeRegex.test(url) || vimeoRegex.test(url)) return "video";
55523
55544
  if (["pdf"].includes(extension)) return "pdf";
55524
- return "unknown";
55545
+ return extension ?? "unknown";
55525
55546
  }
55526
55547
  let lightboxInstance;
55527
55548
  function getLightboxInstance() {
package/dist/index.mjs CHANGED
@@ -18659,8 +18659,8 @@ const _hoisted_11$1 = {
18659
18659
  key: 0,
18660
18660
  class: "h-100"
18661
18661
  };
18662
- const _hoisted_12 = ["src"];
18663
- const _hoisted_13 = { class: "position-start m-05 flex opacity-7" };
18662
+ const _hoisted_12$1 = ["src"];
18663
+ const _hoisted_13$1 = { class: "position-start m-05 flex opacity-7" };
18664
18664
  const _hoisted_14 = {
18665
18665
  key: 0,
18666
18666
  class: "progress"
@@ -18885,18 +18885,16 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
18885
18885
  }, () => [
18886
18886
  _ctx.multiple ? (openBlock(), createElementBlock("div", _hoisted_4$c, [
18887
18887
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(storageFiles.value, (file) => {
18888
- return openBlock(), createElementBlock("div", {
18888
+ return withDirectives((openBlock(), createElementBlock("div", {
18889
18889
  key: file.id,
18890
18890
  class: "multi-image-item-preview"
18891
18891
  }, [
18892
- isImage(file.extension || file.url) ? withDirectives((openBlock(), createElementBlock("img", {
18892
+ isImage(file.extension || file.url) ? (openBlock(), createElementBlock("img", {
18893
18893
  key: 0,
18894
18894
  class: "multi-preview",
18895
18895
  src: file.url,
18896
18896
  alt: ""
18897
- }, null, 8, _hoisted_5$a)), [
18898
- [_directive_lightbox]
18899
- ]) : (openBlock(), createBlock(unref(_sfc_main$c), {
18897
+ }, null, 8, _hoisted_5$a)) : (openBlock(), createBlock(unref(_sfc_main$c), {
18900
18898
  key: 1,
18901
18899
  icon: "draft",
18902
18900
  class: "multi-preview"
@@ -18909,6 +18907,8 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
18909
18907
  color: "red",
18910
18908
  onClick: withModifiers(($event) => removeFile(file), ["stop"])
18911
18909
  }, null, 8, ["onClick"])
18910
+ ])), [
18911
+ [_directive_lightbox, { src: file.url, download: true }]
18912
18912
  ]);
18913
18913
  }), 128)),
18914
18914
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(fileQueue.value, (fileQ) => {
@@ -18954,10 +18954,10 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
18954
18954
  class: "single-preview",
18955
18955
  src: file.url,
18956
18956
  alt: ""
18957
- }, null, 8, _hoisted_12), [
18958
- [_directive_lightbox]
18957
+ }, null, 8, _hoisted_12$1), [
18958
+ [_directive_lightbox, { src: file.url, download: true }]
18959
18959
  ]),
18960
- createElementVNode("div", _hoisted_13, [
18960
+ createElementVNode("div", _hoisted_13$1, [
18961
18961
  withDirectives(createVNode(unref(Btn), {
18962
18962
  color: "gray",
18963
18963
  thin: "",
@@ -18987,13 +18987,15 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
18987
18987
  [_directive_tooltip, "Download"]
18988
18988
  ])
18989
18989
  ])
18990
- ])) : (openBlock(), createBlock(unref(_sfc_main$c), {
18990
+ ])) : withDirectives((openBlock(), createBlock(unref(_sfc_main$c), {
18991
18991
  key: 1,
18992
18992
  size: 4,
18993
18993
  weight: "2",
18994
18994
  icon: "draft",
18995
18995
  class: "color-primary w-100"
18996
- }))
18996
+ }, null, 512)), [
18997
+ [_directive_lightbox, { src: file.url, download: true }]
18998
+ ])
18997
18999
  ], 2);
18998
19000
  }), 128)),
18999
19001
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(fileQueue.value, (fileQ) => {
@@ -19037,7 +19039,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
19037
19039
  };
19038
19040
  }
19039
19041
  });
19040
- const $el = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-963c1a6d"]]);
19042
+ const $el = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-c2732102"]]);
19041
19043
  const _hoisted_1$u = ["title"];
19042
19044
  const _hoisted_2$k = { key: 0 };
19043
19045
  const _hoisted_3$g = ["value", "placeholder"];
@@ -55229,7 +55231,7 @@ const _hoisted_1 = {
55229
55231
  key: 0,
55230
55232
  class: "navigation flex space-between px-3 w-100 absolute"
55231
55233
  };
55232
- const _hoisted_2 = { class: "flex start fixed top-1 w-100 space-between start-1" };
55234
+ const _hoisted_2 = { class: "flex start fixed top-1 w-100 space-between px-1" };
55233
55235
  const _hoisted_3 = {
55234
55236
  key: 0,
55235
55237
  class: "center"
@@ -55240,14 +55242,16 @@ const _hoisted_6 = ["src"];
55240
55242
  const _hoisted_7 = ["src", "title"];
55241
55243
  const _hoisted_8 = {
55242
55244
  key: 3,
55243
- class: "file-info txt-white"
55245
+ class: "file-info txt-white flex align-items-start gap-1"
55244
55246
  };
55245
- const _hoisted_9 = ["href"];
55246
- const _hoisted_10 = {
55247
+ const _hoisted_9 = { class: "txt-start" };
55248
+ const _hoisted_10 = { class: "m-0" };
55249
+ const _hoisted_11 = { class: "m-0" };
55250
+ const _hoisted_12 = {
55247
55251
  key: 0,
55248
55252
  class: "flex justify-content-center mt-2 overflow p-1 fixed bottom start end gap-1 m_justify-content-start"
55249
55253
  };
55250
- const _hoisted_11 = ["src", "onClick"];
55254
+ const _hoisted_13 = ["src", "onClick"];
55251
55255
  const _sfc_main = /* @__PURE__ */ defineComponent({
55252
55256
  __name: "Lightbox",
55253
55257
  setup(__props, { expose: __expose }) {
@@ -55314,7 +55318,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55314
55318
  return [
55315
55319
  unref(isOpen) ? (openBlock(), createElementBlock("div", {
55316
55320
  key: 0,
55317
- class: "bgl-lightbox-overlay fixed w-100 h-100 flex justify-content-center z-999 inset mx-auto",
55321
+ class: "bgl-lightbox-overlay fixed w-100 h-100 flex justify-content-center z-9999 inset mx-auto",
55318
55322
  onKeydown: [
55319
55323
  withKeys(close2, ["esc"]),
55320
55324
  withKeys(prev, ["left"]),
@@ -55428,15 +55432,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55428
55432
  title: (_o = unref(currentItem)) == null ? void 0 : _o.name,
55429
55433
  class: "vw90"
55430
55434
  }, null, 8, _hoisted_7)) : (openBlock(), createElementBlock("div", _hoisted_8, [
55431
- createElementVNode("p", null, "File: " + toDisplayString((_p = unref(currentItem)) == null ? void 0 : _p.name), 1),
55432
- createElementVNode("p", null, "Type: " + toDisplayString((_q = unref(currentItem)) == null ? void 0 : _q.type), 1),
55433
- createElementVNode("a", {
55434
- href: (_r2 = unref(currentItem)) == null ? void 0 : _r2.src,
55435
- target: "_blank"
55436
- }, "Open file", 8, _hoisted_9)
55435
+ createVNode(unref(_sfc_main$c), {
55436
+ class: "m-0",
55437
+ icon: "draft",
55438
+ size: 3
55439
+ }),
55440
+ createElementVNode("div", _hoisted_9, [
55441
+ createElementVNode("p", _hoisted_10, " File: " + toDisplayString((_p = unref(currentItem)) == null ? void 0 : _p.name), 1),
55442
+ createElementVNode("p", _hoisted_11, " Type: " + toDisplayString((_q = unref(currentItem)) == null ? void 0 : _q.type), 1),
55443
+ createVNode(unref(Btn), {
55444
+ href: (_r2 = unref(currentItem)) == null ? void 0 : _r2.src,
55445
+ target: "_blank",
55446
+ round: "",
55447
+ thin: "",
55448
+ class: "mt-1",
55449
+ value: "Open file"
55450
+ }, null, 8, ["href"])
55451
+ ])
55437
55452
  ]))
55438
55453
  ]),
55439
- unref(group) && unref(group).length > 1 ? (openBlock(), createElementBlock("div", _hoisted_10, [
55454
+ unref(group) && unref(group).length > 1 ? (openBlock(), createElementBlock("div", _hoisted_12, [
55440
55455
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(group), (item, index2) => {
55441
55456
  return openBlock(), createElementBlock(Fragment$1, { key: index2 }, [
55442
55457
  item.type === "image" ? (openBlock(), createElementBlock("img", {
@@ -55445,7 +55460,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55445
55460
  src: item.src,
55446
55461
  alt: "",
55447
55462
  onClick: ($event) => selectItem(index2)
55448
- }, null, 10, _hoisted_11)) : (openBlock(), createBlock(unref(_sfc_main$c), {
55463
+ }, null, 10, _hoisted_13)) : (openBlock(), createBlock(unref(_sfc_main$c), {
55449
55464
  key: 1,
55450
55465
  class: normalizeClass(["thumbnail object-fit-cover hover opacity-5 ed flex bg-popup justify-content-center align-items-center flex-shrink-0", { active: unref(currentIndex) === index2 }]),
55451
55466
  icon: "description",
@@ -55463,7 +55478,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55463
55478
  };
55464
55479
  }
55465
55480
  });
55466
- const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f5f9581d"]]);
55481
+ const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6ceb84fe"]]);
55467
55482
  const groups = {};
55468
55483
  let clickHandler = (_e2) => void 0;
55469
55484
  const lightboxDirective = {
@@ -55509,17 +55524,23 @@ function bindingToItem(binding, el) {
55509
55524
  let { group, src, type: type3, name, thumbnail, enableZoom, openFile, download } = binding.value || {};
55510
55525
  src = src || binding.value || el.getAttribute("src") || "";
55511
55526
  type3 = type3 || determineFileType(src);
55527
+ name = name || urlToName(src) || el.getAttribute("alt") || "";
55512
55528
  return { src, type: type3, name, thumbnail, group, enableZoom, openFile, download };
55513
55529
  }
55514
55530
  const youtubeRegex = /youtube\.com|youtu\.be/;
55515
55531
  const vimeoRegex = /vimeo\.com/;
55532
+ function urlToName(url) {
55533
+ if (!url) return "";
55534
+ const name = url.split("/").pop() || "";
55535
+ return name.replace(/\.[^/.]+$/, "");
55536
+ }
55516
55537
  function determineFileType(url) {
55517
55538
  if (!url) return "unknown";
55518
55539
  const extension = (url.split(".").pop() || "").toLowerCase();
55519
55540
  if (IMAGE_FORMATS_REGEXP.test(extension)) return "image";
55520
55541
  if (VIDEO_FORMATS_REGEXP.test(extension) || youtubeRegex.test(url) || vimeoRegex.test(url)) return "video";
55521
55542
  if (["pdf"].includes(extension)) return "pdf";
55522
- return "unknown";
55543
+ return extension ?? "unknown";
55523
55544
  }
55524
55545
  let lightboxInstance;
55525
55546
  function getLightboxInstance() {
package/dist/style.css CHANGED
@@ -706,7 +706,7 @@ data[data-v-6c27f163] {
706
706
  }
707
707
  }
708
708
 
709
- .fileUploadWrap[data-v-963c1a6d] {
709
+ .fileUploadWrap[data-v-c2732102] {
710
710
  outline: 1px solid var(--border-color);
711
711
  border-radius: var(--input-border-radius);
712
712
  text-align: center;
@@ -718,7 +718,7 @@ data[data-v-6c27f163] {
718
718
  background: var(--input-bg);
719
719
  height: 215px;
720
720
  }
721
- .bagel-input .fileUploadWrap.fileDropZone[data-v-963c1a6d] {
721
+ .bagel-input .fileUploadWrap.fileDropZone[data-v-c2732102] {
722
722
  background: var(--input-bg);
723
723
  display: flex;
724
724
  align-items: center;
@@ -726,14 +726,14 @@ data[data-v-6c27f163] {
726
726
  color: var(--bgl-gray);
727
727
  flex-direction: column;
728
728
  }
729
- .fileUploadWrap.dragover[data-v-963c1a6d],
730
- .fileUploadWrap[data-v-963c1a6d]:hover {
729
+ .fileUploadWrap.dragover[data-v-c2732102],
730
+ .fileUploadWrap[data-v-c2732102]:hover {
731
731
  box-shadow: inset 0 0 10px #00000012;
732
732
  }
733
- .fileUploadWrap[style*="height: auto;"][data-v-963c1a6d] {
733
+ .fileUploadWrap[style*="height: auto;"][data-v-c2732102] {
734
734
  min-height: 215px;
735
735
  }
736
- .multi-image-item-preview[data-v-963c1a6d] {
736
+ .multi-image-item-preview[data-v-c2732102] {
737
737
  border: 1px solid var(--border-color) !important;
738
738
  border-radius: var(--input-border-radius);
739
739
  margin: 0.5rem !important;
@@ -747,12 +747,12 @@ data[data-v-6c27f163] {
747
747
  gap: 1rem;
748
748
  align-items: center;
749
749
  }
750
- .multi-image-item-preview p[data-v-963c1a6d] {
750
+ .multi-image-item-preview p[data-v-c2732102] {
751
751
  overflow: hidden;
752
752
  text-overflow: ellipsis;
753
753
  white-space: nowrap;
754
754
  }
755
- .multi-preview[data-v-963c1a6d]{
755
+ .multi-preview[data-v-c2732102]{
756
756
  width: 40px;
757
757
  height: 40px;
758
758
  border-radius: var(--input-border-radius);
@@ -763,17 +763,17 @@ data[data-v-6c27f163] {
763
763
  align-items: center;
764
764
  display: flex;
765
765
  }
766
- .bgl-single-preview[data-v-963c1a6d]{
766
+ .bgl-single-preview[data-v-c2732102]{
767
767
  height: 100%;
768
768
  position: relative;
769
769
  }
770
- .bgl-single-preview + .fileUploadPlaceHolder[data-v-963c1a6d]{
770
+ .bgl-single-preview + .fileUploadPlaceHolder[data-v-c2732102]{
771
771
  position: absolute;
772
772
  inset: 0;
773
773
  margin: auto;
774
774
  top: calc(50% - 2rem);
775
775
  }
776
- .single-image-item-preview[data-v-963c1a6d] {
776
+ .single-image-item-preview[data-v-c2732102] {
777
777
  height: 100%;
778
778
  min-height: 100%;
779
779
  position: relative;
@@ -781,13 +781,13 @@ data[data-v-6c27f163] {
781
781
  align-items: center;
782
782
  justify-content: center;
783
783
  }
784
- .fileUploadWrap[style*="height: auto"] .single-image-item-preview[data-v-963c1a6d] {
784
+ .fileUploadWrap[style*="height: auto"] .single-image-item-preview[data-v-c2732102] {
785
785
  min-height: 215px;
786
786
  }
787
- .fileUploadWrap[style*="height: auto"] .single-preview[data-v-963c1a6d] {
787
+ .fileUploadWrap[style*="height: auto"] .single-preview[data-v-c2732102] {
788
788
  margin: 0rem !important;
789
789
  }
790
- .single-preview[data-v-963c1a6d]{
790
+ .single-preview[data-v-c2732102]{
791
791
  border-radius: var(--input-border-radius);
792
792
  margin: 1rem;
793
793
  padding: 0px;
@@ -796,7 +796,7 @@ data[data-v-6c27f163] {
796
796
  object-fit: cover;
797
797
  background: var(--bgl-gray-light);
798
798
  }
799
- .single-image-item-preview[data-v-963c1a6d]:hover::after{
799
+ .single-image-item-preview[data-v-c2732102]:hover::after{
800
800
  content: "zoom_in";
801
801
  font-size: 32px;
802
802
  font-family: "Material Symbols Outlined", serif;
@@ -806,20 +806,20 @@ data[data-v-6c27f163] {
806
806
  z-index: 9;
807
807
  pointer-events: none;
808
808
  }
809
- .single-image-item-preview:hover img[data-v-963c1a6d]{
809
+ .single-image-item-preview:hover img[data-v-c2732102]{
810
810
  filter: brightness(70%);
811
811
  }
812
- .bgl_fill-image.single-image-item-preview[data-v-963c1a6d] {
812
+ .bgl_fill-image.single-image-item-preview[data-v-c2732102] {
813
813
  height: 100%;
814
814
  }
815
- .bgl_fill-image.single-image-item-preview .single-preview[data-v-963c1a6d]{
815
+ .bgl_fill-image.single-image-item-preview .single-preview[data-v-c2732102]{
816
816
  border-radius: unset;
817
817
  object-fit: cover;
818
818
  box-shadow: unset;
819
819
  width: 100%;
820
820
  height: auto;
821
821
  }
822
- .single-image-item-preview .pie[data-v-963c1a6d] {
822
+ .single-image-item-preview .pie[data-v-c2732102] {
823
823
  transform-origin: top;
824
824
  transform: scale(1.4);
825
825
  position: absolute;
@@ -833,31 +833,31 @@ data[data-v-6c27f163] {
833
833
  border: none !important;
834
834
  padding: 0 !important;
835
835
  }
836
- .bgl_oval-upload[data-v-963c1a6d] {
836
+ .bgl_oval-upload[data-v-c2732102] {
837
837
  border-radius: 100% !important;
838
838
  overflow: hidden;
839
839
  }
840
- .bgl_oval-upload p[data-v-963c1a6d] {
840
+ .bgl_oval-upload p[data-v-c2732102] {
841
841
  padding: 0.75rem !important;
842
842
  font-size: 12px
843
843
  }
844
- .bgl_oval-upload .fileUploadPlaceHolder[data-v-963c1a6d]{
844
+ .bgl_oval-upload .fileUploadPlaceHolder[data-v-c2732102]{
845
845
  top: 0;
846
846
  }
847
- .bgl_oval-upload .pie[data-v-963c1a6d] {
847
+ .bgl_oval-upload .pie[data-v-c2732102] {
848
848
  transform: scale(1);
849
849
  }
850
- .bgl_oval-upload span.bgl_icon-font.color-primary[data-v-963c1a6d] {
850
+ .bgl_oval-upload span.bgl_icon-font.color-primary[data-v-c2732102] {
851
851
  transform: scale(0.4) !important;
852
852
  }
853
- .bgl_oval-upload .single-image-item-preview[data-v-963c1a6d]{
853
+ .bgl_oval-upload .single-image-item-preview[data-v-c2732102]{
854
854
  height: 100%;
855
855
  }
856
- .bgl_oval-upload .single-preview[data-v-963c1a6d] {
856
+ .bgl_oval-upload .single-preview[data-v-c2732102] {
857
857
  margin: 0;
858
858
  height: 100% !important;
859
859
  }
860
- .pie[data-v-963c1a6d] {
860
+ .pie[data-v-c2732102] {
861
861
  width: 30px;
862
862
  height: 30px;
863
863
  position: relative;
@@ -865,7 +865,7 @@ data[data-v-6c27f163] {
865
865
  align-items: center;
866
866
  justify-content: center;
867
867
  }
868
- .pie[data-v-963c1a6d]:before {
868
+ .pie[data-v-c2732102]:before {
869
869
  content: '';
870
870
  position: absolute;
871
871
  border-radius: 50%;
@@ -883,26 +883,26 @@ data[data-v-6c27f163] {
883
883
  #000 calc(100% - var(--b))
884
884
  );
885
885
  }
886
- .pie .success[data-v-963c1a6d] {
886
+ .pie .success[data-v-c2732102] {
887
887
  transform: scale(0);
888
888
  opacity: 0;
889
889
  transition: all 0.3s ease-in-out;
890
890
  }
891
- .pie .progress[data-v-963c1a6d] {
891
+ .pie .progress[data-v-c2732102] {
892
892
  position: absolute;
893
893
  font-size: 10px;
894
894
  }
895
- .pie.complete .progress[data-v-963c1a6d] {
895
+ .pie.complete .progress[data-v-c2732102] {
896
896
  display: none;
897
897
  }
898
- .pie.complete .success[data-v-963c1a6d] {
898
+ .pie.complete .success[data-v-c2732102] {
899
899
  transform: scale(1.3);
900
900
  opacity: 1;
901
901
  }
902
- .pie.complete[data-v-963c1a6d]:before {
902
+ .pie.complete[data-v-c2732102]:before {
903
903
  background: conic-gradient(var(--bgl-green) calc(var(--p) * 1%), #0000 0);
904
904
  }
905
- .pie.complete[data-v-963c1a6d] {
905
+ .pie.complete[data-v-c2732102] {
906
906
  color: var(--bgl-green);
907
907
  }
908
908
 
@@ -3488,19 +3488,19 @@ tbody tr[data-v-d8ca38b1]:hover {
3488
3488
  -moz-user-drag: none;
3489
3489
  }
3490
3490
 
3491
- .lightbox-image[data-v-f5f9581d]{
3491
+ .lightbox-image[data-v-6ceb84fe]{
3492
3492
  object-fit: contain;
3493
3493
  }
3494
- .bgl-lightbox-overlay[data-v-f5f9581d] {
3494
+ .bgl-lightbox-overlay[data-v-6ceb84fe] {
3495
3495
  background: rgba(0, 0, 0, 0.8);
3496
3496
  }
3497
- .bgl-lightbox[data-v-f5f9581d] {
3497
+ .bgl-lightbox[data-v-6ceb84fe] {
3498
3498
  max-height: 90%;
3499
3499
  }
3500
- .bgl-lightbox-item[data-v-f5f9581d]{
3501
- animation: 500ms ease bgl-lightbox-load-f5f9581d;
3500
+ .bgl-lightbox-item[data-v-6ceb84fe]{
3501
+ animation: 500ms ease bgl-lightbox-load-6ceb84fe;
3502
3502
  }
3503
- @keyframes bgl-lightbox-load-f5f9581d {
3503
+ @keyframes bgl-lightbox-load-6ceb84fe {
3504
3504
  from {
3505
3505
  scale:0.7;
3506
3506
  }
@@ -3508,35 +3508,38 @@ to {
3508
3508
  scale:1;
3509
3509
  }
3510
3510
  }
3511
- .bgl-lightbox-item[data-v-f5f9581d] * {
3511
+ .bgl-lightbox-item[data-v-6ceb84fe] * {
3512
3512
  max-width: 90%;
3513
3513
  max-height: calc(80vh - 90px);
3514
3514
  border-radius: 3px;
3515
3515
  margin: auto;
3516
- animation: 200ms ease bgl-lightbox-load-f5f9581d;
3516
+ animation: 200ms ease bgl-lightbox-load-6ceb84fe;
3517
3517
  }
3518
- .navigation[data-v-f5f9581d] {
3518
+ .navigation[data-v-6ceb84fe] {
3519
3519
  top: 50%;
3520
3520
  transform: translateY(-50%);
3521
3521
  }
3522
- .navigation-btn[data-v-f5f9581d] {
3522
+ .navigation-btn[data-v-6ceb84fe] {
3523
3523
  width: var(--input-height);
3524
3524
  height: var(--input-height);
3525
3525
  }
3526
- .thumbnail[data-v-f5f9581d] {
3526
+ .thumbnail[data-v-6ceb84fe] {
3527
3527
  height: 50px;
3528
3528
  width: 50px;
3529
3529
  }
3530
- .thumbnail[data-v-f5f9581d]:hover {
3530
+ .thumbnail[data-v-6ceb84fe]:hover {
3531
3531
  opacity: 1;
3532
3532
  }
3533
- .thumbnail[data-v-f5f9581d]:active {
3533
+ .thumbnail[data-v-6ceb84fe]:active {
3534
3534
  opacity: 0.8;
3535
3535
  }
3536
- .thumbnail.active[data-v-f5f9581d] {
3536
+ .thumbnail.active[data-v-6ceb84fe] {
3537
3537
  opacity: 1;
3538
3538
  outline: 2px solid white;
3539
3539
  }
3540
+ .file-info[data-v-6ceb84fe]{
3541
+ min-width: 180px
3542
+ }
3540
3543
 
3541
3544
 
3542
3545
  .grid {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.897",
4
+ "version": "0.0.899",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -249,9 +249,10 @@ function drop(e: DragEvent) {
249
249
  <div
250
250
  v-for="file in storageFiles"
251
251
  :key="file.id"
252
+ v-lightbox="{ src: file.url, download: true }"
252
253
  class="multi-image-item-preview"
253
254
  >
254
- <img v-if="isImage(file.extension || file.url)" v-lightbox class="multi-preview" :src="file.url" alt="">
255
+ <img v-if="isImage(file.extension || file.url)" class="multi-preview" :src="file.url" alt="">
255
256
  <Icon v-else icon="draft" class="multi-preview" />
256
257
  <p class="m-0">
257
258
  {{ file.name }}
@@ -306,7 +307,7 @@ function drop(e: DragEvent) {
306
307
  :class="{ 'bgl_fill-image': fill }"
307
308
  >
308
309
  <div v-if="isImage(file.extension || file.url)" class="h-100">
309
- <img v-lightbox class="single-preview" :src="file.url" alt="">
310
+ <img v-lightbox="{ src: file.url, download: true }" class="single-preview" :src="file.url" alt="">
310
311
  <div class="position-start m-05 flex opacity-7">
311
312
  <Btn v-tooltip="'Delete'" color="gray" thin icon="delete" @click.stop="removeFile(file)" />
312
313
  <Btn
@@ -322,7 +323,7 @@ function drop(e: DragEvent) {
322
323
  />
323
324
  </div>
324
325
  </div>
325
- <Icon v-else :size="4" weight="2" icon="draft" class="color-primary w-100" />
326
+ <Icon v-else v-lightbox="{ src: file.url, download: true }" :size="4" weight="2" icon="draft" class="color-primary w-100" />
326
327
  </div>
327
328
 
328
329
  <div
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
+ import type { LightboxItem } from './lightbox.types'
2
3
  import { BglVideo, Btn, Icon, Zoomer } from '@bagelink/vue'
3
- import { watch } from 'vue'
4
4
 
5
- import type { LightboxItem } from './lightbox.types'
5
+ import { watch } from 'vue'
6
6
 
7
7
  let isOpen = $ref(false)
8
8
  let currentItem = $ref<LightboxItem>()
@@ -78,7 +78,7 @@ defineExpose({ open, close })
78
78
  <transition name="fade">
79
79
  <div
80
80
  v-if="isOpen"
81
- class="bgl-lightbox-overlay fixed w-100 h-100 flex justify-content-center z-999 inset mx-auto"
81
+ class="bgl-lightbox-overlay fixed w-100 h-100 flex justify-content-center z-9999 inset mx-auto"
82
82
  @keydown.esc="close"
83
83
  @keydown.left="prev"
84
84
  @keydown.right="next"
@@ -98,7 +98,7 @@ defineExpose({ open, close })
98
98
  />
99
99
  </div>
100
100
  <div class="bgl-lightbox relative txt-center" @click.stop>
101
- <div class="flex start fixed top-1 w-100 space-between start-1">
101
+ <div class="flex start fixed top-1 w-100 space-between px-1">
102
102
  <Btn flat class="color-white" icon="close" @click="close" />
103
103
  <div v-if="currentItem?.enableZoom && currentItem?.type === 'image'" class="center">
104
104
  <Btn flat class="color-white" icon="remove" :disabled="zoom === 1" @click="zoom--" />
@@ -144,10 +144,18 @@ defineExpose({ open, close })
144
144
  >
145
145
  </template>
146
146
  <template v-else>
147
- <div class="file-info txt-white">
148
- <p>File: {{ currentItem?.name }}</p>
149
- <p>Type: {{ currentItem?.type }}</p>
150
- <a :href="currentItem?.src" target="_blank">Open file</a>
147
+ <div class="file-info txt-white flex align-items-start gap-1">
148
+ <Icon class="m-0" icon="draft" :size="3" />
149
+ <div class="txt-start">
150
+ <p class="m-0">
151
+ File: {{ currentItem?.name }}
152
+ </p>
153
+ <p class="m-0">
154
+ Type: {{ currentItem?.type }}
155
+ </p>
156
+ <Btn :href="currentItem?.src" target="_blank" round thin class="mt-1" value="Open file" />
157
+ <!-- <a :href="currentItem?.src" target="_blank">Open file</a> -->
158
+ </div>
151
159
  </div>
152
160
  </template>
153
161
  </div>
@@ -244,4 +252,7 @@ defineExpose({ open, close })
244
252
  opacity: 1;
245
253
  outline: 2px solid white;
246
254
  }
255
+ .file-info{
256
+ min-width: 180px
257
+ }
247
258
  </style>
@@ -52,19 +52,26 @@ function bindingToItem(binding: DirectiveBinding, el: HTMLElement): LightboxItem
52
52
  let { group, src, type, name, thumbnail, enableZoom, openFile, download } = binding.value || {}
53
53
  src = src || binding.value || el.getAttribute('src') || ''
54
54
  type = type || determineFileType(src)
55
+ name = name || urlToName(src) || el.getAttribute('alt') || ''
55
56
  return { src, type, name, thumbnail, group, enableZoom, openFile, download }
56
57
  }
57
58
 
58
59
  const youtubeRegex = /youtube\.com|youtu\.be/
59
60
  const vimeoRegex = /vimeo\.com/
60
61
 
62
+ function urlToName(url: string): string {
63
+ if (!url) return ''
64
+ const name = url.split('/').pop() || ''
65
+ return name.replace(/\.[^/.]+$/, '')
66
+ }
67
+
61
68
  function determineFileType(url: string): string {
62
69
  if (!url) return 'unknown'
63
70
  const extension = (url.split('.').pop() || '').toLowerCase()
64
71
  if (IMAGE_FORMATS_REGEXP.test(extension)) return 'image'
65
72
  if (VIDEO_FORMATS_REGEXP.test(extension) || youtubeRegex.test(url) || vimeoRegex.test(url)) return 'video'
66
73
  if (['pdf'].includes(extension)) return 'pdf'
67
- return 'unknown'
74
+ return extension ?? 'unknown'
68
75
  }
69
76
 
70
77
  let lightboxInstance: InstanceType<typeof Lightbox> | undefined