@bagelink/vue 0.0.893 → 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":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AAyYA,iBAAS,IAAI,SAIZ;AAED,iBAAS,IAAI,SAIZ;AAwCD,iBAAS,cAAc;;yBAsEM,GAAG;;;;YACN,GAAG;;;;YACH,GAAG;;;;;WAUf,OAAO,IAA6B;EAEjD;AA6BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAgBnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AA2ZA,iBAAS,IAAI,SAIZ;AAED,iBAAS,IAAI,SAIZ;AAwCD,iBAAS,cAAc;;yBAsEM,GAAG;;;;YACN,GAAG;;;;YACH,GAAG;;;;;WAUf,OAAO,IAA6B;EAEjD;AA6BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAgBnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,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":"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
@@ -597,13 +597,21 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
597
597
  child.addEventListener("click", preventDefaultClick);
598
598
  });
599
599
  }
600
- function updateHeight() {
601
- if (!props2.autoHeight || !bglSlider.value) return;
602
- setTimeout(() => {
603
- const children2 = Array.from(bglSlider.value.children[activeSlideIndex.value].children);
600
+ function calcHeight() {
601
+ if (!bglSlider.value) return;
602
+ try {
603
+ const slide = bglSlider.value.children[activeSlideIndex.value];
604
+ if (!slide) return;
605
+ const children2 = Array.from(slide.children);
604
606
  const totalHeight = children2.reduce((sum, el) => sum + el.clientHeight, 0);
605
607
  yHeight.value = `${totalHeight}px`;
606
- }, 200);
608
+ } catch (error) {
609
+ console.error(error);
610
+ }
611
+ }
612
+ function updateHeight() {
613
+ if (!props2.autoHeight) return;
614
+ setTimeout(calcHeight, 200);
607
615
  }
608
616
  function easeScroll(target, duration = 500) {
609
617
  if (!bglSlider.value || isPressed.value) return;
@@ -739,7 +747,7 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
739
747
  };
740
748
  }
741
749
  });
742
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-ca63f224"]]);
750
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-98e36ac5"]]);
743
751
  function _isPlaceholder(a2) {
744
752
  return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
745
753
  }
@@ -18653,8 +18661,8 @@ const _hoisted_11$1 = {
18653
18661
  key: 0,
18654
18662
  class: "h-100"
18655
18663
  };
18656
- const _hoisted_12 = ["src"];
18657
- 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" };
18658
18666
  const _hoisted_14 = {
18659
18667
  key: 0,
18660
18668
  class: "progress"
@@ -18879,18 +18887,16 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
18879
18887
  }, () => [
18880
18888
  _ctx.multiple ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$c, [
18881
18889
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(storageFiles.value, (file) => {
18882
- return vue.openBlock(), vue.createElementBlock("div", {
18890
+ return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
18883
18891
  key: file.id,
18884
18892
  class: "multi-image-item-preview"
18885
18893
  }, [
18886
- isImage(file.extension || file.url) ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("img", {
18894
+ isImage(file.extension || file.url) ? (vue.openBlock(), vue.createElementBlock("img", {
18887
18895
  key: 0,
18888
18896
  class: "multi-preview",
18889
18897
  src: file.url,
18890
18898
  alt: ""
18891
- }, null, 8, _hoisted_5$a)), [
18892
- [_directive_lightbox]
18893
- ]) : (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
18899
+ }, null, 8, _hoisted_5$a)) : (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
18894
18900
  key: 1,
18895
18901
  icon: "draft",
18896
18902
  class: "multi-preview"
@@ -18903,6 +18909,8 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
18903
18909
  color: "red",
18904
18910
  onClick: vue.withModifiers(($event) => removeFile(file), ["stop"])
18905
18911
  }, null, 8, ["onClick"])
18912
+ ])), [
18913
+ [_directive_lightbox, { src: file.url, download: true }]
18906
18914
  ]);
18907
18915
  }), 128)),
18908
18916
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fileQueue.value, (fileQ) => {
@@ -18948,10 +18956,10 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
18948
18956
  class: "single-preview",
18949
18957
  src: file.url,
18950
18958
  alt: ""
18951
- }, null, 8, _hoisted_12), [
18952
- [_directive_lightbox]
18959
+ }, null, 8, _hoisted_12$1), [
18960
+ [_directive_lightbox, { src: file.url, download: true }]
18953
18961
  ]),
18954
- vue.createElementVNode("div", _hoisted_13, [
18962
+ vue.createElementVNode("div", _hoisted_13$1, [
18955
18963
  vue.withDirectives(vue.createVNode(vue.unref(Btn), {
18956
18964
  color: "gray",
18957
18965
  thin: "",
@@ -18981,13 +18989,15 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
18981
18989
  [_directive_tooltip, "Download"]
18982
18990
  ])
18983
18991
  ])
18984
- ])) : (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
18992
+ ])) : vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
18985
18993
  key: 1,
18986
18994
  size: 4,
18987
18995
  weight: "2",
18988
18996
  icon: "draft",
18989
18997
  class: "color-primary w-100"
18990
- }))
18998
+ }, null, 512)), [
18999
+ [_directive_lightbox, { src: file.url, download: true }]
19000
+ ])
18991
19001
  ], 2);
18992
19002
  }), 128)),
18993
19003
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fileQueue.value, (fileQ) => {
@@ -19031,7 +19041,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
19031
19041
  };
19032
19042
  }
19033
19043
  });
19034
- 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"]]);
19035
19045
  const _hoisted_1$u = ["title"];
19036
19046
  const _hoisted_2$k = { key: 0 };
19037
19047
  const _hoisted_3$g = ["value", "placeholder"];
@@ -55223,7 +55233,7 @@ const _hoisted_1 = {
55223
55233
  key: 0,
55224
55234
  class: "navigation flex space-between px-3 w-100 absolute"
55225
55235
  };
55226
- 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" };
55227
55237
  const _hoisted_3 = {
55228
55238
  key: 0,
55229
55239
  class: "center"
@@ -55234,14 +55244,16 @@ const _hoisted_6 = ["src"];
55234
55244
  const _hoisted_7 = ["src", "title"];
55235
55245
  const _hoisted_8 = {
55236
55246
  key: 3,
55237
- class: "file-info txt-white"
55247
+ class: "file-info txt-white flex align-items-start gap-1"
55238
55248
  };
55239
- const _hoisted_9 = ["href"];
55240
- 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 = {
55241
55253
  key: 0,
55242
55254
  class: "flex justify-content-center mt-2 overflow p-1 fixed bottom start end gap-1 m_justify-content-start"
55243
55255
  };
55244
- const _hoisted_11 = ["src", "onClick"];
55256
+ const _hoisted_13 = ["src", "onClick"];
55245
55257
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55246
55258
  __name: "Lightbox",
55247
55259
  setup(__props, { expose: __expose }) {
@@ -55308,7 +55320,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55308
55320
  return [
55309
55321
  vue.unref(isOpen) ? (vue.openBlock(), vue.createElementBlock("div", {
55310
55322
  key: 0,
55311
- 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",
55312
55324
  onKeydown: [
55313
55325
  vue.withKeys(close2, ["esc"]),
55314
55326
  vue.withKeys(prev, ["left"]),
@@ -55422,15 +55434,26 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55422
55434
  title: (_o = vue.unref(currentItem)) == null ? void 0 : _o.name,
55423
55435
  class: "vw90"
55424
55436
  }, null, 8, _hoisted_7)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
55425
- vue.createElementVNode("p", null, "File: " + vue.toDisplayString((_p = vue.unref(currentItem)) == null ? void 0 : _p.name), 1),
55426
- vue.createElementVNode("p", null, "Type: " + vue.toDisplayString((_q = vue.unref(currentItem)) == null ? void 0 : _q.type), 1),
55427
- vue.createElementVNode("a", {
55428
- href: (_r2 = vue.unref(currentItem)) == null ? void 0 : _r2.src,
55429
- target: "_blank"
55430
- }, "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
+ ])
55431
55454
  ]))
55432
55455
  ]),
55433
- 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, [
55434
55457
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(group), (item, index2) => {
55435
55458
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index2 }, [
55436
55459
  item.type === "image" ? (vue.openBlock(), vue.createElementBlock("img", {
@@ -55439,7 +55462,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55439
55462
  src: item.src,
55440
55463
  alt: "",
55441
55464
  onClick: ($event) => selectItem(index2)
55442
- }, 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), {
55443
55466
  key: 1,
55444
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 }]),
55445
55468
  icon: "description",
@@ -55457,7 +55480,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
55457
55480
  };
55458
55481
  }
55459
55482
  });
55460
- 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"]]);
55461
55484
  const groups = {};
55462
55485
  let clickHandler = (_e2) => void 0;
55463
55486
  const lightboxDirective = {
@@ -55503,17 +55526,23 @@ function bindingToItem(binding, el) {
55503
55526
  let { group, src, type: type3, name, thumbnail, enableZoom, openFile, download } = binding.value || {};
55504
55527
  src = src || binding.value || el.getAttribute("src") || "";
55505
55528
  type3 = type3 || determineFileType(src);
55529
+ name = name || urlToName(src) || el.getAttribute("alt") || "";
55506
55530
  return { src, type: type3, name, thumbnail, group, enableZoom, openFile, download };
55507
55531
  }
55508
55532
  const youtubeRegex = /youtube\.com|youtu\.be/;
55509
55533
  const vimeoRegex = /vimeo\.com/;
55534
+ function urlToName(url) {
55535
+ if (!url) return "";
55536
+ const name = url.split("/").pop() || "";
55537
+ return name.replace(/\.[^/.]+$/, "");
55538
+ }
55510
55539
  function determineFileType(url) {
55511
55540
  if (!url) return "unknown";
55512
55541
  const extension = (url.split(".").pop() || "").toLowerCase();
55513
55542
  if (IMAGE_FORMATS_REGEXP.test(extension)) return "image";
55514
55543
  if (VIDEO_FORMATS_REGEXP.test(extension) || youtubeRegex.test(url) || vimeoRegex.test(url)) return "video";
55515
55544
  if (["pdf"].includes(extension)) return "pdf";
55516
- return "unknown";
55545
+ return extension ?? "unknown";
55517
55546
  }
55518
55547
  let lightboxInstance;
55519
55548
  function getLightboxInstance() {
package/dist/index.mjs CHANGED
@@ -595,13 +595,21 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
595
595
  child.addEventListener("click", preventDefaultClick);
596
596
  });
597
597
  }
598
- function updateHeight() {
599
- if (!props2.autoHeight || !bglSlider.value) return;
600
- setTimeout(() => {
601
- const children2 = Array.from(bglSlider.value.children[activeSlideIndex.value].children);
598
+ function calcHeight() {
599
+ if (!bglSlider.value) return;
600
+ try {
601
+ const slide = bglSlider.value.children[activeSlideIndex.value];
602
+ if (!slide) return;
603
+ const children2 = Array.from(slide.children);
602
604
  const totalHeight = children2.reduce((sum, el) => sum + el.clientHeight, 0);
603
605
  yHeight.value = `${totalHeight}px`;
604
- }, 200);
606
+ } catch (error) {
607
+ console.error(error);
608
+ }
609
+ }
610
+ function updateHeight() {
611
+ if (!props2.autoHeight) return;
612
+ setTimeout(calcHeight, 200);
605
613
  }
606
614
  function easeScroll(target, duration = 500) {
607
615
  if (!bglSlider.value || isPressed.value) return;
@@ -737,7 +745,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
737
745
  };
738
746
  }
739
747
  });
740
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-ca63f224"]]);
748
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-98e36ac5"]]);
741
749
  function _isPlaceholder(a2) {
742
750
  return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
743
751
  }
@@ -18651,8 +18659,8 @@ const _hoisted_11$1 = {
18651
18659
  key: 0,
18652
18660
  class: "h-100"
18653
18661
  };
18654
- const _hoisted_12 = ["src"];
18655
- 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" };
18656
18664
  const _hoisted_14 = {
18657
18665
  key: 0,
18658
18666
  class: "progress"
@@ -18877,18 +18885,16 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
18877
18885
  }, () => [
18878
18886
  _ctx.multiple ? (openBlock(), createElementBlock("div", _hoisted_4$c, [
18879
18887
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(storageFiles.value, (file) => {
18880
- return openBlock(), createElementBlock("div", {
18888
+ return withDirectives((openBlock(), createElementBlock("div", {
18881
18889
  key: file.id,
18882
18890
  class: "multi-image-item-preview"
18883
18891
  }, [
18884
- isImage(file.extension || file.url) ? withDirectives((openBlock(), createElementBlock("img", {
18892
+ isImage(file.extension || file.url) ? (openBlock(), createElementBlock("img", {
18885
18893
  key: 0,
18886
18894
  class: "multi-preview",
18887
18895
  src: file.url,
18888
18896
  alt: ""
18889
- }, null, 8, _hoisted_5$a)), [
18890
- [_directive_lightbox]
18891
- ]) : (openBlock(), createBlock(unref(_sfc_main$c), {
18897
+ }, null, 8, _hoisted_5$a)) : (openBlock(), createBlock(unref(_sfc_main$c), {
18892
18898
  key: 1,
18893
18899
  icon: "draft",
18894
18900
  class: "multi-preview"
@@ -18901,6 +18907,8 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
18901
18907
  color: "red",
18902
18908
  onClick: withModifiers(($event) => removeFile(file), ["stop"])
18903
18909
  }, null, 8, ["onClick"])
18910
+ ])), [
18911
+ [_directive_lightbox, { src: file.url, download: true }]
18904
18912
  ]);
18905
18913
  }), 128)),
18906
18914
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(fileQueue.value, (fileQ) => {
@@ -18946,10 +18954,10 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
18946
18954
  class: "single-preview",
18947
18955
  src: file.url,
18948
18956
  alt: ""
18949
- }, null, 8, _hoisted_12), [
18950
- [_directive_lightbox]
18957
+ }, null, 8, _hoisted_12$1), [
18958
+ [_directive_lightbox, { src: file.url, download: true }]
18951
18959
  ]),
18952
- createElementVNode("div", _hoisted_13, [
18960
+ createElementVNode("div", _hoisted_13$1, [
18953
18961
  withDirectives(createVNode(unref(Btn), {
18954
18962
  color: "gray",
18955
18963
  thin: "",
@@ -18979,13 +18987,15 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
18979
18987
  [_directive_tooltip, "Download"]
18980
18988
  ])
18981
18989
  ])
18982
- ])) : (openBlock(), createBlock(unref(_sfc_main$c), {
18990
+ ])) : withDirectives((openBlock(), createBlock(unref(_sfc_main$c), {
18983
18991
  key: 1,
18984
18992
  size: 4,
18985
18993
  weight: "2",
18986
18994
  icon: "draft",
18987
18995
  class: "color-primary w-100"
18988
- }))
18996
+ }, null, 512)), [
18997
+ [_directive_lightbox, { src: file.url, download: true }]
18998
+ ])
18989
18999
  ], 2);
18990
19000
  }), 128)),
18991
19001
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(fileQueue.value, (fileQ) => {
@@ -19029,7 +19039,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
19029
19039
  };
19030
19040
  }
19031
19041
  });
19032
- 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"]]);
19033
19043
  const _hoisted_1$u = ["title"];
19034
19044
  const _hoisted_2$k = { key: 0 };
19035
19045
  const _hoisted_3$g = ["value", "placeholder"];
@@ -55221,7 +55231,7 @@ const _hoisted_1 = {
55221
55231
  key: 0,
55222
55232
  class: "navigation flex space-between px-3 w-100 absolute"
55223
55233
  };
55224
- 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" };
55225
55235
  const _hoisted_3 = {
55226
55236
  key: 0,
55227
55237
  class: "center"
@@ -55232,14 +55242,16 @@ const _hoisted_6 = ["src"];
55232
55242
  const _hoisted_7 = ["src", "title"];
55233
55243
  const _hoisted_8 = {
55234
55244
  key: 3,
55235
- class: "file-info txt-white"
55245
+ class: "file-info txt-white flex align-items-start gap-1"
55236
55246
  };
55237
- const _hoisted_9 = ["href"];
55238
- 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 = {
55239
55251
  key: 0,
55240
55252
  class: "flex justify-content-center mt-2 overflow p-1 fixed bottom start end gap-1 m_justify-content-start"
55241
55253
  };
55242
- const _hoisted_11 = ["src", "onClick"];
55254
+ const _hoisted_13 = ["src", "onClick"];
55243
55255
  const _sfc_main = /* @__PURE__ */ defineComponent({
55244
55256
  __name: "Lightbox",
55245
55257
  setup(__props, { expose: __expose }) {
@@ -55306,7 +55318,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55306
55318
  return [
55307
55319
  unref(isOpen) ? (openBlock(), createElementBlock("div", {
55308
55320
  key: 0,
55309
- 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",
55310
55322
  onKeydown: [
55311
55323
  withKeys(close2, ["esc"]),
55312
55324
  withKeys(prev, ["left"]),
@@ -55420,15 +55432,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55420
55432
  title: (_o = unref(currentItem)) == null ? void 0 : _o.name,
55421
55433
  class: "vw90"
55422
55434
  }, null, 8, _hoisted_7)) : (openBlock(), createElementBlock("div", _hoisted_8, [
55423
- createElementVNode("p", null, "File: " + toDisplayString((_p = unref(currentItem)) == null ? void 0 : _p.name), 1),
55424
- createElementVNode("p", null, "Type: " + toDisplayString((_q = unref(currentItem)) == null ? void 0 : _q.type), 1),
55425
- createElementVNode("a", {
55426
- href: (_r2 = unref(currentItem)) == null ? void 0 : _r2.src,
55427
- target: "_blank"
55428
- }, "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
+ ])
55429
55452
  ]))
55430
55453
  ]),
55431
- unref(group) && unref(group).length > 1 ? (openBlock(), createElementBlock("div", _hoisted_10, [
55454
+ unref(group) && unref(group).length > 1 ? (openBlock(), createElementBlock("div", _hoisted_12, [
55432
55455
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(group), (item, index2) => {
55433
55456
  return openBlock(), createElementBlock(Fragment$1, { key: index2 }, [
55434
55457
  item.type === "image" ? (openBlock(), createElementBlock("img", {
@@ -55437,7 +55460,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55437
55460
  src: item.src,
55438
55461
  alt: "",
55439
55462
  onClick: ($event) => selectItem(index2)
55440
- }, null, 10, _hoisted_11)) : (openBlock(), createBlock(unref(_sfc_main$c), {
55463
+ }, null, 10, _hoisted_13)) : (openBlock(), createBlock(unref(_sfc_main$c), {
55441
55464
  key: 1,
55442
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 }]),
55443
55466
  icon: "description",
@@ -55455,7 +55478,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55455
55478
  };
55456
55479
  }
55457
55480
  });
55458
- 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"]]);
55459
55482
  const groups = {};
55460
55483
  let clickHandler = (_e2) => void 0;
55461
55484
  const lightboxDirective = {
@@ -55501,17 +55524,23 @@ function bindingToItem(binding, el) {
55501
55524
  let { group, src, type: type3, name, thumbnail, enableZoom, openFile, download } = binding.value || {};
55502
55525
  src = src || binding.value || el.getAttribute("src") || "";
55503
55526
  type3 = type3 || determineFileType(src);
55527
+ name = name || urlToName(src) || el.getAttribute("alt") || "";
55504
55528
  return { src, type: type3, name, thumbnail, group, enableZoom, openFile, download };
55505
55529
  }
55506
55530
  const youtubeRegex = /youtube\.com|youtu\.be/;
55507
55531
  const vimeoRegex = /vimeo\.com/;
55532
+ function urlToName(url) {
55533
+ if (!url) return "";
55534
+ const name = url.split("/").pop() || "";
55535
+ return name.replace(/\.[^/.]+$/, "");
55536
+ }
55508
55537
  function determineFileType(url) {
55509
55538
  if (!url) return "unknown";
55510
55539
  const extension = (url.split(".").pop() || "").toLowerCase();
55511
55540
  if (IMAGE_FORMATS_REGEXP.test(extension)) return "image";
55512
55541
  if (VIDEO_FORMATS_REGEXP.test(extension) || youtubeRegex.test(url) || vimeoRegex.test(url)) return "video";
55513
55542
  if (["pdf"].includes(extension)) return "pdf";
55514
- return "unknown";
55543
+ return extension ?? "unknown";
55515
55544
  }
55516
55545
  let lightboxInstance;
55517
55546
  function getLightboxInstance() {
package/dist/style.css CHANGED
@@ -350,7 +350,7 @@ display: block;
350
350
  padding: 0;
351
351
  }
352
352
 
353
- .blocker[data-v-ca63f224] {
353
+ .blocker[data-v-98e36ac5] {
354
354
  position: fixed;
355
355
  top: 0;
356
356
  left: 0;
@@ -358,7 +358,7 @@ display: block;
358
358
  height: 100%;
359
359
  z-index: 100;
360
360
  }
361
- .bgl-slider[data-v-ca63f224] {
361
+ .bgl-slider[data-v-98e36ac5] {
362
362
  display: grid;
363
363
  position: relative;
364
364
  /* scroll-behavior: smooth; */
@@ -367,43 +367,43 @@ display: block;
367
367
  /* scroll-snap-type: x mandatory; */
368
368
  overflow-x: hidden;
369
369
  }
370
- .autoHeight[data-v-ca63f224] {
370
+ .autoHeight[data-v-98e36ac5] {
371
371
  transition: height ease 0.7s;
372
372
  }
373
- .bgl-slider.allowScroll[data-v-ca63f224] {
373
+ .bgl-slider.allowScroll[data-v-98e36ac5] {
374
374
  overflow-x: scroll;
375
375
  }
376
- .bgl-slider[data-v-ca63f224] {
376
+ .bgl-slider[data-v-98e36ac5] {
377
377
  grid-auto-columns: calc(100% / var(--item-count) - calc(var(--item-count) - 1) * 1%);
378
378
  gap: 1%;
379
379
  }
380
- .bgl-slider.odd[data-v-ca63f224] {
380
+ .bgl-slider.odd[data-v-98e36ac5] {
381
381
  grid-auto-columns: calc(100% / var(--item-count) - calc(var(--item-count) - 2) * 1%);
382
382
  }
383
- .bgl-slider.slides-1[data-v-ca63f224] {
383
+ .bgl-slider.slides-1[data-v-98e36ac5] {
384
384
  grid-auto-columns: 100%;
385
385
  gap: 0;
386
386
  }
387
- .bgl-slider[data-v-ca63f224]::-webkit-scrollbar {
387
+ .bgl-slider[data-v-98e36ac5]::-webkit-scrollbar {
388
388
  display: none;
389
389
  }
390
- .bgl-slider[data-v-ca63f224] * {
390
+ .bgl-slider[data-v-98e36ac5] * {
391
391
  scroll-snap-align: start;
392
392
  }
393
- .dragging.bgl-slider[data-v-ca63f224] {
393
+ .dragging.bgl-slider[data-v-98e36ac5] {
394
394
  cursor: grabbing;
395
395
  cursor: -webkit-grabbing;
396
396
  scroll-snap-type: unset;
397
397
  }
398
- .clicking.bgl-slider[data-v-ca63f224] {
398
+ .clicking.bgl-slider[data-v-98e36ac5] {
399
399
  scroll-behavior: unset;
400
400
  }
401
- .dragging.bgl-slider[data-v-ca63f224] * {
401
+ .dragging.bgl-slider[data-v-98e36ac5] * {
402
402
  scroll-snap-align: unset;
403
403
  user-select: none;
404
404
  }
405
405
  @media screen and (max-width: 600px) {
406
- .bgl-slider.slides-1[data-v-ca63f224]> * {
406
+ .bgl-slider.slides-1[data-v-98e36ac5]> * {
407
407
  margin-inline-start: 0%;
408
408
  }
409
409
  }
@@ -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.893",
4
+ "version": "0.0.899",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -38,13 +38,22 @@ function disableDrag() {
38
38
  })
39
39
  }
40
40
 
41
- function updateHeight() {
42
- if (!props.autoHeight || !bglSlider) return
43
- setTimeout(() => {
44
- const children = Array.from(bglSlider.children[activeSlideIndex].children)
41
+ function calcHeight() {
42
+ if (!bglSlider) return
43
+ try {
44
+ const slide = bglSlider.children[activeSlideIndex]
45
+ if (!slide) return
46
+ const children = Array.from(slide.children)
45
47
  const totalHeight = children.reduce((sum, el) => sum + el.clientHeight, 0)
46
48
  yHeight = `${totalHeight}px`
47
- }, 200)
49
+ } catch (error) {
50
+ console.error(error)
51
+ }
52
+ }
53
+
54
+ function updateHeight() {
55
+ if (!props.autoHeight) return
56
+ setTimeout(calcHeight, 200)
48
57
  }
49
58
 
50
59
  function easeScroll(target: number, duration = 500) {
@@ -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