@bagelink/vue 0.0.819 → 0.0.821
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/components/Carousel.vue.d.ts.map +1 -1
- package/dist/components/Pill.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
- package/dist/index.cjs +98 -48
- package/dist/index.mjs +98 -48
- package/dist/style.css +77 -87
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Carousel.vue +41 -48
- package/src/components/Pill.vue +1 -1
- package/src/components/form/inputs/FileUpload.vue +24 -2
- package/src/utils/index.ts +55 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AAscA,iBAAS,IAAI,SAMZ;AAED,iBAAS,IAAI,SAKZ;AAgDD,iBAAS,cAAc;;yBA8EM,GAAG;;;;YACN,GAAG;;;;YACH,GAAG;;;;;WAUf,OAAO,IAA6B;EAEjD;AAwCD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EA4BnB,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":"Pill.vue.d.ts","sourceRoot":"","sources":["../../src/components/Pill.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pill.vue.d.ts","sourceRoot":"","sources":["../../src/components/Pill.vue"],"names":[],"mappings":"AAmLA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI7D,UAAU,OAAO;IAChB,IAAI,EAAE,aAAa,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CACb;AAsED,iBAAS,cAAc;;yBA8GO,GAAG;;;WASnB,OAAO,IAA6B;EAEjD;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;eA1MT,OAAO;WACX,aAAa;aACX,aAAa;YACd,SAAS;YACT,SAAS;WACV,OAAO;aACL,OAAO;cACN,OAAO;cACP,OAAO;YACT,MAAM;YACN,OAAO;SACV,OAAO;YACJ,OAAO;;eAZJ,OAAO;WACX,aAAa;aACX,aAAa;YACd,SAAS;YACT,SAAS;WACV,OAAO;aACL,OAAO;cACN,OAAO;cACP,OAAO;YACT,MAAM;YACN,OAAO;SACV,OAAO;YACJ,OAAO;iGAoMd,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":"FileUpload.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/FileUpload.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileUpload.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/FileUpload.vue"],"names":[],"mappings":"AA8hBA,OAAO,EAAmC,KAAK,WAAW,EAAY,MAAM,eAAe,CAAA;AAK3F,KAAK,MAAM,GAAG,MAAM,WAAW,CAAA;AAE/B,KAAK,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,CAAA;AAmJzC,iBAAS,MAAM,SAgBd;AA6BD,iBAAS,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAxKZ,MAAM;4BACJ,OAAO;uBACZ,MAAM;2BACF,OAAO;;YAgdQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;0BAndnB,MAAM;4BACJ,OAAO;uBACZ,MAAM;2BACF,OAAO;;;YAide,GAAG;;;WASvB,OAAO,IAA6B;EAEjD;AAqBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;YA1gBZ,MAAM;eACH,OAAO;YACV,WAAW,GAAG,WAAW,EAAE;cACzB,MAAM;iBACH,OAAO;YACZ,MAAM;aACL,MAAM,GAAG,MAAM;YAChB,MAAM;WACP,OAAO;WACP,OAAO;;;;;YATN,MAAM;eACH,OAAO;YACV,WAAW,GAAG,WAAW,EAAE;cACzB,MAAM;iBACH,OAAO;YACZ,MAAM;aACL,MAAM,GAAG,MAAM;YAChB,MAAM;WACP,OAAO;WACP,OAAO;;;;kFAwgBb,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"}
|
package/dist/index.cjs
CHANGED
|
@@ -590,6 +590,7 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
|
590
590
|
const props2 = __props;
|
|
591
591
|
const emit2 = __emit;
|
|
592
592
|
const bglSlider = vue.ref();
|
|
593
|
+
let itemCount = vue.ref(props2.items);
|
|
593
594
|
let activeSlideIndex = vue.ref(0);
|
|
594
595
|
let isDragging = vue.ref(false);
|
|
595
596
|
let startX = vue.ref(0);
|
|
@@ -614,6 +615,7 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
|
614
615
|
}
|
|
615
616
|
function scrollEase(target, duration = 500) {
|
|
616
617
|
if (!bglSlider.value) return;
|
|
618
|
+
if (isPressed.value) return;
|
|
617
619
|
const start2 = bglSlider.value.scrollLeft;
|
|
618
620
|
const change = target - start2;
|
|
619
621
|
const startTime = performance.now();
|
|
@@ -654,16 +656,26 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
|
654
656
|
emit2("update:index", activeSlideIndex.value);
|
|
655
657
|
}
|
|
656
658
|
);
|
|
659
|
+
function goToSlideScrollEnd() {
|
|
660
|
+
if (!bglSlider.value) return;
|
|
661
|
+
const isDragForward = startX.value > bglSlider.value.offsetLeft;
|
|
662
|
+
if (itemCount.value === 1) {
|
|
663
|
+
if (isDragForward) activeSlideIndex.value = Math.ceil(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
664
|
+
else activeSlideIndex.value = Math.floor(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
665
|
+
} else {
|
|
666
|
+
activeSlideIndex.value = Math.round(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
667
|
+
}
|
|
668
|
+
startX.value = 0;
|
|
669
|
+
const nextSlide = Math.round(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
670
|
+
goToSlide(nextSlide);
|
|
671
|
+
}
|
|
672
|
+
let timeout = null;
|
|
673
|
+
function scrollEnd() {
|
|
674
|
+
if (timeout) clearTimeout(timeout);
|
|
675
|
+
timeout = setTimeout(goToSlideScrollEnd, 400);
|
|
676
|
+
}
|
|
657
677
|
function stopDragging(e) {
|
|
658
678
|
isPressed.value = false;
|
|
659
|
-
const slider = bglSlider.value;
|
|
660
|
-
if (!slider) return;
|
|
661
|
-
const isDragForward = startX.value > e.pageX + slider.offsetLeft;
|
|
662
|
-
if (isDragForward)
|
|
663
|
-
activeSlideIndex.value = Math.ceil(slider.scrollLeft / slider.offsetWidth);
|
|
664
|
-
else activeSlideIndex.value = Math.floor(slider.scrollLeft / slider.offsetWidth);
|
|
665
|
-
if (props2.items === 1) goToSlide(activeSlideIndex.value);
|
|
666
|
-
startX.value = 0;
|
|
667
679
|
document.removeEventListener("mousemove", move);
|
|
668
680
|
document.removeEventListener("mouseup", stopDragging);
|
|
669
681
|
document.removeEventListener("dragend", stopDragging);
|
|
@@ -685,7 +697,6 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
|
685
697
|
isPressed.value = true;
|
|
686
698
|
document.addEventListener("mousemove", move);
|
|
687
699
|
document.addEventListener("mouseup", stopDragging);
|
|
688
|
-
document.addEventListener("dragend", stopDragging);
|
|
689
700
|
}
|
|
690
701
|
function next() {
|
|
691
702
|
if (!bglSlider.value) return;
|
|
@@ -702,11 +713,17 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
|
702
713
|
}
|
|
703
714
|
function evalWidth() {
|
|
704
715
|
if (!bglSlider.value) return;
|
|
716
|
+
if (window.innerWidth < 600) itemCount.value = 1;
|
|
717
|
+
else if (window.innerWidth < 991) itemCount.value = Math.min(props2.items, 2);
|
|
718
|
+
else if (window.innerWidth < 1280) itemCount.value = Math.min(props2.items, 3);
|
|
719
|
+
else itemCount.value = props2.items;
|
|
720
|
+
console.log(itemCount.value, window.innerWidth);
|
|
705
721
|
goToSlide(activeSlideIndex.value);
|
|
706
722
|
}
|
|
707
723
|
vue.onMounted(() => {
|
|
708
724
|
window.addEventListener("resize", evalWidth);
|
|
709
725
|
evalHeight();
|
|
726
|
+
evalWidth();
|
|
710
727
|
disableDrag();
|
|
711
728
|
});
|
|
712
729
|
vue.onUnmounted(() => {
|
|
@@ -723,14 +740,19 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
|
723
740
|
class: vue.normalizeClass([{
|
|
724
741
|
dragging: vue.unref(isDragging),
|
|
725
742
|
clicking: vue.unref(isPressed),
|
|
726
|
-
|
|
727
|
-
|
|
743
|
+
allowScroll: __props.allowScroll,
|
|
744
|
+
odd: vue.unref(itemCount) % 2 !== 0,
|
|
745
|
+
[`slides-${vue.unref(itemCount)}`]: vue.unref(itemCount) === 1
|
|
728
746
|
}, "bgl-slider"]),
|
|
747
|
+
style: vue.normalizeStyle({
|
|
748
|
+
"--item-count": vue.unref(itemCount)
|
|
749
|
+
}),
|
|
750
|
+
onScroll: scrollEnd,
|
|
729
751
|
onMousedown: startDragging
|
|
730
752
|
}, [
|
|
731
753
|
vue.unref(isDragging) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$F)) : vue.createCommentVNode("", true),
|
|
732
754
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
733
|
-
],
|
|
755
|
+
], 38),
|
|
734
756
|
vue.createElementVNode("div", _hoisted_2$s, [
|
|
735
757
|
vue.createElementVNode("span", { onClick: prev }, [
|
|
736
758
|
vue.renderSlot(_ctx.$slots, "prev", {
|
|
@@ -749,7 +771,7 @@ const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
|
749
771
|
};
|
|
750
772
|
}
|
|
751
773
|
});
|
|
752
|
-
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-
|
|
774
|
+
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-e588f5a7"]]);
|
|
753
775
|
function _isPlaceholder(a2) {
|
|
754
776
|
return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
|
|
755
777
|
}
|
|
@@ -18652,13 +18674,18 @@ const _hoisted_8$3 = {
|
|
|
18652
18674
|
key: 1,
|
|
18653
18675
|
class: "bgl-single-preview"
|
|
18654
18676
|
};
|
|
18655
|
-
const _hoisted_9$2 =
|
|
18656
|
-
|
|
18677
|
+
const _hoisted_9$2 = {
|
|
18678
|
+
key: 0,
|
|
18679
|
+
class: "h-100"
|
|
18680
|
+
};
|
|
18681
|
+
const _hoisted_10$2 = ["src"];
|
|
18682
|
+
const _hoisted_11$1 = { class: "position-start m-05 gap-025 flex" };
|
|
18683
|
+
const _hoisted_12 = {
|
|
18657
18684
|
key: 0,
|
|
18658
18685
|
class: "progress"
|
|
18659
18686
|
};
|
|
18660
|
-
const
|
|
18661
|
-
const
|
|
18687
|
+
const _hoisted_13 = ["src"];
|
|
18688
|
+
const _hoisted_14 = { class: "p-1 flex column hover fileUploadPlaceHolder justify-content-center mb-05" };
|
|
18662
18689
|
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
18663
18690
|
__name: "FileUpload",
|
|
18664
18691
|
props: {
|
|
@@ -18814,6 +18841,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
18814
18841
|
}
|
|
18815
18842
|
return (_ctx, _cache) => {
|
|
18816
18843
|
const _directive_lightbox = vue.resolveDirective("lightbox");
|
|
18844
|
+
const _directive_tooltip = vue.resolveDirective("tooltip");
|
|
18817
18845
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$w, [
|
|
18818
18846
|
vue.createElementVNode("label", null, vue.toDisplayString(_ctx.label), 1),
|
|
18819
18847
|
vue.createElementVNode("div", {
|
|
@@ -18898,14 +18926,33 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
18898
18926
|
key: file.id,
|
|
18899
18927
|
class: vue.normalizeClass(["single-image-item-preview", { "bgl_fill-image": _ctx.fill }])
|
|
18900
18928
|
}, [
|
|
18901
|
-
isImage(file.extension || file.url) ?
|
|
18902
|
-
|
|
18903
|
-
|
|
18904
|
-
|
|
18905
|
-
|
|
18906
|
-
|
|
18907
|
-
|
|
18908
|
-
|
|
18929
|
+
isImage(file.extension || file.url) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$2, [
|
|
18930
|
+
vue.withDirectives(vue.createElementVNode("img", {
|
|
18931
|
+
class: "single-preview",
|
|
18932
|
+
src: file.url,
|
|
18933
|
+
alt: ""
|
|
18934
|
+
}, null, 8, _hoisted_10$2), [
|
|
18935
|
+
[_directive_lightbox]
|
|
18936
|
+
]),
|
|
18937
|
+
vue.createElementVNode("div", _hoisted_11$1, [
|
|
18938
|
+
vue.withDirectives(vue.createVNode(vue.unref(Btn), {
|
|
18939
|
+
color: "gray",
|
|
18940
|
+
thin: "",
|
|
18941
|
+
icon: "delete",
|
|
18942
|
+
onClick: vue.withModifiers(($event) => removeFile(file), ["stop"])
|
|
18943
|
+
}, null, 8, ["onClick"]), [
|
|
18944
|
+
[_directive_tooltip, "Delete"]
|
|
18945
|
+
]),
|
|
18946
|
+
vue.withDirectives(vue.createVNode(vue.unref(Btn), {
|
|
18947
|
+
color: "gray",
|
|
18948
|
+
thin: "",
|
|
18949
|
+
icon: "autorenew",
|
|
18950
|
+
onClick: browse
|
|
18951
|
+
}, null, 512), [
|
|
18952
|
+
[_directive_tooltip, "Replace"]
|
|
18953
|
+
])
|
|
18954
|
+
])
|
|
18955
|
+
])) : (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$c), {
|
|
18909
18956
|
key: 1,
|
|
18910
18957
|
size: 4,
|
|
18911
18958
|
weight: "2",
|
|
@@ -18923,7 +18970,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
18923
18970
|
class: vue.normalizeClass(["pie", { complete: fileQ.progress === 100 }]),
|
|
18924
18971
|
style: vue.normalizeStyle([`--p:${fileQ.progress}`, { "--b": "2px" }])
|
|
18925
18972
|
}, [
|
|
18926
|
-
fileQ.progress < 100 ? (vue.openBlock(), vue.createElementBlock("span",
|
|
18973
|
+
fileQ.progress < 100 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_12, vue.toDisplayString(`${fileQ.progress.toFixed(0)}`), 1)) : vue.createCommentVNode("", true),
|
|
18927
18974
|
vue.createVNode(vue.unref(_sfc_main$c), {
|
|
18928
18975
|
class: "success",
|
|
18929
18976
|
icon: "check"
|
|
@@ -18934,7 +18981,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
18934
18981
|
class: "single-preview",
|
|
18935
18982
|
src: fileToUrl(fileQ.file),
|
|
18936
18983
|
alt: ""
|
|
18937
|
-
}, null, 8,
|
|
18984
|
+
}, null, 8, _hoisted_13)) : vue.createCommentVNode("", true)
|
|
18938
18985
|
], 2);
|
|
18939
18986
|
}), 128))
|
|
18940
18987
|
])) : vue.createCommentVNode("", true)
|
|
@@ -18945,7 +18992,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
18945
18992
|
fileQueue: fileQueue.value,
|
|
18946
18993
|
browse
|
|
18947
18994
|
}, () => [
|
|
18948
|
-
vue.createElementVNode("p",
|
|
18995
|
+
vue.createElementVNode("p", _hoisted_14, [
|
|
18949
18996
|
vue.createVNode(vue.unref(_sfc_main$c), { icon: "upload_2" }),
|
|
18950
18997
|
_cache[0] || (_cache[0] = vue.createTextVNode(" Drop files here or click to upload "))
|
|
18951
18998
|
])
|
|
@@ -18955,7 +19002,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
|
18955
19002
|
};
|
|
18956
19003
|
}
|
|
18957
19004
|
});
|
|
18958
|
-
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
19005
|
+
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-bfb0bd63"]]);
|
|
18959
19006
|
const _hoisted_1$v = ["title"];
|
|
18960
19007
|
const _hoisted_2$k = { key: 0 };
|
|
18961
19008
|
const _hoisted_3$g = ["value", "placeholder"];
|
|
@@ -53549,8 +53596,8 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53549
53596
|
},
|
|
53550
53597
|
setup(__props) {
|
|
53551
53598
|
vue.useCssVars((_ctx) => ({
|
|
53552
|
-
"
|
|
53553
|
-
"
|
|
53599
|
+
"64b28dae": computedBackgroundColor.value,
|
|
53600
|
+
"e70b1a78": cumputedTextColor.value
|
|
53554
53601
|
}));
|
|
53555
53602
|
const props2 = __props;
|
|
53556
53603
|
const slots = vue.useSlots();
|
|
@@ -53641,7 +53688,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
53641
53688
|
};
|
|
53642
53689
|
}
|
|
53643
53690
|
});
|
|
53644
|
-
const Pill = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
53691
|
+
const Pill = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-40a0a2e2"]]);
|
|
53645
53692
|
const _sfc_main$5 = {};
|
|
53646
53693
|
function _sfc_render$1(_ctx, _cache) {
|
|
53647
53694
|
const _component_router_view = vue.resolveComponent("router-view");
|
|
@@ -55432,15 +55479,17 @@ function formatString(str, format2) {
|
|
|
55432
55479
|
}
|
|
55433
55480
|
return str;
|
|
55434
55481
|
}
|
|
55435
|
-
function debounce(
|
|
55436
|
-
let
|
|
55482
|
+
function debounce(callback, wait, immediate) {
|
|
55483
|
+
let timeout;
|
|
55437
55484
|
return function(...args) {
|
|
55438
|
-
|
|
55439
|
-
|
|
55440
|
-
|
|
55441
|
-
|
|
55442
|
-
|
|
55443
|
-
|
|
55485
|
+
const later = () => {
|
|
55486
|
+
timeout = void 0;
|
|
55487
|
+
if (!immediate) callback.apply(this, args);
|
|
55488
|
+
};
|
|
55489
|
+
const callNow = immediate && timeout === void 0;
|
|
55490
|
+
clearTimeout(timeout);
|
|
55491
|
+
timeout = setTimeout(later, wait);
|
|
55492
|
+
if (callNow) callback.apply(this, args);
|
|
55444
55493
|
};
|
|
55445
55494
|
}
|
|
55446
55495
|
function keyToLabel(key) {
|
|
@@ -55481,7 +55530,8 @@ function iffer(field, itemData) {
|
|
|
55481
55530
|
if (field["v-if"] === void 0) return true;
|
|
55482
55531
|
if (typeof field["v-if"] === "boolean") return field["v-if"];
|
|
55483
55532
|
if (typeof field["v-if"] === "string") return true;
|
|
55484
|
-
if (typeof field["v-if"] === "function")
|
|
55533
|
+
if (typeof field["v-if"] === "function")
|
|
55534
|
+
return (_a2 = field["v-if"]) == null ? void 0 : _a2.call(field, itemData == null ? void 0 : itemData[field.id], itemData);
|
|
55485
55535
|
return true;
|
|
55486
55536
|
}
|
|
55487
55537
|
function denullify(itemData, fieldID) {
|
|
@@ -55491,15 +55541,15 @@ function denullify(itemData, fieldID) {
|
|
|
55491
55541
|
const isDate = (dateToTest) => !Number.isNaN(Date.parse(dateToTest));
|
|
55492
55542
|
function getFallbackSchema(data2, showFields) {
|
|
55493
55543
|
const keys4 = Array.from(new Set((data2 ?? []).flatMap(Object.keys)));
|
|
55494
|
-
const schema = keys4.map(
|
|
55495
|
-
|
|
55496
|
-
|
|
55497
|
-
|
|
55498
|
-
})
|
|
55499
|
-
);
|
|
55544
|
+
const schema = keys4.map((id) => ({
|
|
55545
|
+
id,
|
|
55546
|
+
label: keyToLabel(id)
|
|
55547
|
+
}));
|
|
55500
55548
|
return showFields ? schema.filter((f2) => showFields.includes(f2.id) || !f2.id) : schema;
|
|
55501
55549
|
}
|
|
55502
|
-
|
|
55550
|
+
function sleep(ms = 100) {
|
|
55551
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
55552
|
+
}
|
|
55503
55553
|
function appendScript(src) {
|
|
55504
55554
|
return new Promise((resolve, reject3) => {
|
|
55505
55555
|
if (document.querySelector(`script[src="${src}"]`)) {
|
package/dist/index.mjs
CHANGED
|
@@ -588,6 +588,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
588
588
|
const props2 = __props;
|
|
589
589
|
const emit2 = __emit;
|
|
590
590
|
const bglSlider = ref();
|
|
591
|
+
let itemCount = ref(props2.items);
|
|
591
592
|
let activeSlideIndex = ref(0);
|
|
592
593
|
let isDragging = ref(false);
|
|
593
594
|
let startX = ref(0);
|
|
@@ -612,6 +613,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
612
613
|
}
|
|
613
614
|
function scrollEase(target, duration = 500) {
|
|
614
615
|
if (!bglSlider.value) return;
|
|
616
|
+
if (isPressed.value) return;
|
|
615
617
|
const start2 = bglSlider.value.scrollLeft;
|
|
616
618
|
const change = target - start2;
|
|
617
619
|
const startTime = performance.now();
|
|
@@ -652,16 +654,26 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
652
654
|
emit2("update:index", activeSlideIndex.value);
|
|
653
655
|
}
|
|
654
656
|
);
|
|
657
|
+
function goToSlideScrollEnd() {
|
|
658
|
+
if (!bglSlider.value) return;
|
|
659
|
+
const isDragForward = startX.value > bglSlider.value.offsetLeft;
|
|
660
|
+
if (itemCount.value === 1) {
|
|
661
|
+
if (isDragForward) activeSlideIndex.value = Math.ceil(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
662
|
+
else activeSlideIndex.value = Math.floor(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
663
|
+
} else {
|
|
664
|
+
activeSlideIndex.value = Math.round(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
665
|
+
}
|
|
666
|
+
startX.value = 0;
|
|
667
|
+
const nextSlide = Math.round(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
|
|
668
|
+
goToSlide(nextSlide);
|
|
669
|
+
}
|
|
670
|
+
let timeout = null;
|
|
671
|
+
function scrollEnd() {
|
|
672
|
+
if (timeout) clearTimeout(timeout);
|
|
673
|
+
timeout = setTimeout(goToSlideScrollEnd, 400);
|
|
674
|
+
}
|
|
655
675
|
function stopDragging(e) {
|
|
656
676
|
isPressed.value = false;
|
|
657
|
-
const slider = bglSlider.value;
|
|
658
|
-
if (!slider) return;
|
|
659
|
-
const isDragForward = startX.value > e.pageX + slider.offsetLeft;
|
|
660
|
-
if (isDragForward)
|
|
661
|
-
activeSlideIndex.value = Math.ceil(slider.scrollLeft / slider.offsetWidth);
|
|
662
|
-
else activeSlideIndex.value = Math.floor(slider.scrollLeft / slider.offsetWidth);
|
|
663
|
-
if (props2.items === 1) goToSlide(activeSlideIndex.value);
|
|
664
|
-
startX.value = 0;
|
|
665
677
|
document.removeEventListener("mousemove", move);
|
|
666
678
|
document.removeEventListener("mouseup", stopDragging);
|
|
667
679
|
document.removeEventListener("dragend", stopDragging);
|
|
@@ -683,7 +695,6 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
683
695
|
isPressed.value = true;
|
|
684
696
|
document.addEventListener("mousemove", move);
|
|
685
697
|
document.addEventListener("mouseup", stopDragging);
|
|
686
|
-
document.addEventListener("dragend", stopDragging);
|
|
687
698
|
}
|
|
688
699
|
function next() {
|
|
689
700
|
if (!bglSlider.value) return;
|
|
@@ -700,11 +711,17 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
700
711
|
}
|
|
701
712
|
function evalWidth() {
|
|
702
713
|
if (!bglSlider.value) return;
|
|
714
|
+
if (window.innerWidth < 600) itemCount.value = 1;
|
|
715
|
+
else if (window.innerWidth < 991) itemCount.value = Math.min(props2.items, 2);
|
|
716
|
+
else if (window.innerWidth < 1280) itemCount.value = Math.min(props2.items, 3);
|
|
717
|
+
else itemCount.value = props2.items;
|
|
718
|
+
console.log(itemCount.value, window.innerWidth);
|
|
703
719
|
goToSlide(activeSlideIndex.value);
|
|
704
720
|
}
|
|
705
721
|
onMounted(() => {
|
|
706
722
|
window.addEventListener("resize", evalWidth);
|
|
707
723
|
evalHeight();
|
|
724
|
+
evalWidth();
|
|
708
725
|
disableDrag();
|
|
709
726
|
});
|
|
710
727
|
onUnmounted(() => {
|
|
@@ -721,14 +738,19 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
721
738
|
class: normalizeClass([{
|
|
722
739
|
dragging: unref(isDragging),
|
|
723
740
|
clicking: unref(isPressed),
|
|
724
|
-
|
|
725
|
-
|
|
741
|
+
allowScroll: __props.allowScroll,
|
|
742
|
+
odd: unref(itemCount) % 2 !== 0,
|
|
743
|
+
[`slides-${unref(itemCount)}`]: unref(itemCount) === 1
|
|
726
744
|
}, "bgl-slider"]),
|
|
745
|
+
style: normalizeStyle({
|
|
746
|
+
"--item-count": unref(itemCount)
|
|
747
|
+
}),
|
|
748
|
+
onScroll: scrollEnd,
|
|
727
749
|
onMousedown: startDragging
|
|
728
750
|
}, [
|
|
729
751
|
unref(isDragging) ? (openBlock(), createElementBlock("div", _hoisted_1$F)) : createCommentVNode("", true),
|
|
730
752
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
731
|
-
],
|
|
753
|
+
], 38),
|
|
732
754
|
createElementVNode("div", _hoisted_2$s, [
|
|
733
755
|
createElementVNode("span", { onClick: prev }, [
|
|
734
756
|
renderSlot(_ctx.$slots, "prev", {
|
|
@@ -747,7 +769,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
747
769
|
};
|
|
748
770
|
}
|
|
749
771
|
});
|
|
750
|
-
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-
|
|
772
|
+
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-e588f5a7"]]);
|
|
751
773
|
function _isPlaceholder(a2) {
|
|
752
774
|
return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
|
|
753
775
|
}
|
|
@@ -18650,13 +18672,18 @@ const _hoisted_8$3 = {
|
|
|
18650
18672
|
key: 1,
|
|
18651
18673
|
class: "bgl-single-preview"
|
|
18652
18674
|
};
|
|
18653
|
-
const _hoisted_9$2 =
|
|
18654
|
-
|
|
18675
|
+
const _hoisted_9$2 = {
|
|
18676
|
+
key: 0,
|
|
18677
|
+
class: "h-100"
|
|
18678
|
+
};
|
|
18679
|
+
const _hoisted_10$2 = ["src"];
|
|
18680
|
+
const _hoisted_11$1 = { class: "position-start m-05 gap-025 flex" };
|
|
18681
|
+
const _hoisted_12 = {
|
|
18655
18682
|
key: 0,
|
|
18656
18683
|
class: "progress"
|
|
18657
18684
|
};
|
|
18658
|
-
const
|
|
18659
|
-
const
|
|
18685
|
+
const _hoisted_13 = ["src"];
|
|
18686
|
+
const _hoisted_14 = { class: "p-1 flex column hover fileUploadPlaceHolder justify-content-center mb-05" };
|
|
18660
18687
|
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
18661
18688
|
__name: "FileUpload",
|
|
18662
18689
|
props: {
|
|
@@ -18812,6 +18839,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
18812
18839
|
}
|
|
18813
18840
|
return (_ctx, _cache) => {
|
|
18814
18841
|
const _directive_lightbox = resolveDirective("lightbox");
|
|
18842
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
18815
18843
|
return openBlock(), createElementBlock("div", _hoisted_1$w, [
|
|
18816
18844
|
createElementVNode("label", null, toDisplayString(_ctx.label), 1),
|
|
18817
18845
|
createElementVNode("div", {
|
|
@@ -18896,14 +18924,33 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
18896
18924
|
key: file.id,
|
|
18897
18925
|
class: normalizeClass(["single-image-item-preview", { "bgl_fill-image": _ctx.fill }])
|
|
18898
18926
|
}, [
|
|
18899
|
-
isImage(file.extension || file.url) ?
|
|
18900
|
-
|
|
18901
|
-
|
|
18902
|
-
|
|
18903
|
-
|
|
18904
|
-
|
|
18905
|
-
|
|
18906
|
-
|
|
18927
|
+
isImage(file.extension || file.url) ? (openBlock(), createElementBlock("div", _hoisted_9$2, [
|
|
18928
|
+
withDirectives(createElementVNode("img", {
|
|
18929
|
+
class: "single-preview",
|
|
18930
|
+
src: file.url,
|
|
18931
|
+
alt: ""
|
|
18932
|
+
}, null, 8, _hoisted_10$2), [
|
|
18933
|
+
[_directive_lightbox]
|
|
18934
|
+
]),
|
|
18935
|
+
createElementVNode("div", _hoisted_11$1, [
|
|
18936
|
+
withDirectives(createVNode(unref(Btn), {
|
|
18937
|
+
color: "gray",
|
|
18938
|
+
thin: "",
|
|
18939
|
+
icon: "delete",
|
|
18940
|
+
onClick: withModifiers(($event) => removeFile(file), ["stop"])
|
|
18941
|
+
}, null, 8, ["onClick"]), [
|
|
18942
|
+
[_directive_tooltip, "Delete"]
|
|
18943
|
+
]),
|
|
18944
|
+
withDirectives(createVNode(unref(Btn), {
|
|
18945
|
+
color: "gray",
|
|
18946
|
+
thin: "",
|
|
18947
|
+
icon: "autorenew",
|
|
18948
|
+
onClick: browse
|
|
18949
|
+
}, null, 512), [
|
|
18950
|
+
[_directive_tooltip, "Replace"]
|
|
18951
|
+
])
|
|
18952
|
+
])
|
|
18953
|
+
])) : (openBlock(), createBlock(unref(_sfc_main$c), {
|
|
18907
18954
|
key: 1,
|
|
18908
18955
|
size: 4,
|
|
18909
18956
|
weight: "2",
|
|
@@ -18921,7 +18968,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
18921
18968
|
class: normalizeClass(["pie", { complete: fileQ.progress === 100 }]),
|
|
18922
18969
|
style: normalizeStyle([`--p:${fileQ.progress}`, { "--b": "2px" }])
|
|
18923
18970
|
}, [
|
|
18924
|
-
fileQ.progress < 100 ? (openBlock(), createElementBlock("span",
|
|
18971
|
+
fileQ.progress < 100 ? (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(`${fileQ.progress.toFixed(0)}`), 1)) : createCommentVNode("", true),
|
|
18925
18972
|
createVNode(unref(_sfc_main$c), {
|
|
18926
18973
|
class: "success",
|
|
18927
18974
|
icon: "check"
|
|
@@ -18932,7 +18979,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
18932
18979
|
class: "single-preview",
|
|
18933
18980
|
src: fileToUrl(fileQ.file),
|
|
18934
18981
|
alt: ""
|
|
18935
|
-
}, null, 8,
|
|
18982
|
+
}, null, 8, _hoisted_13)) : createCommentVNode("", true)
|
|
18936
18983
|
], 2);
|
|
18937
18984
|
}), 128))
|
|
18938
18985
|
])) : createCommentVNode("", true)
|
|
@@ -18943,7 +18990,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
18943
18990
|
fileQueue: fileQueue.value,
|
|
18944
18991
|
browse
|
|
18945
18992
|
}, () => [
|
|
18946
|
-
createElementVNode("p",
|
|
18993
|
+
createElementVNode("p", _hoisted_14, [
|
|
18947
18994
|
createVNode(unref(_sfc_main$c), { icon: "upload_2" }),
|
|
18948
18995
|
_cache[0] || (_cache[0] = createTextVNode(" Drop files here or click to upload "))
|
|
18949
18996
|
])
|
|
@@ -18953,7 +19000,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
18953
19000
|
};
|
|
18954
19001
|
}
|
|
18955
19002
|
});
|
|
18956
|
-
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
19003
|
+
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-bfb0bd63"]]);
|
|
18957
19004
|
const _hoisted_1$v = ["title"];
|
|
18958
19005
|
const _hoisted_2$k = { key: 0 };
|
|
18959
19006
|
const _hoisted_3$g = ["value", "placeholder"];
|
|
@@ -53547,8 +53594,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
53547
53594
|
},
|
|
53548
53595
|
setup(__props) {
|
|
53549
53596
|
useCssVars((_ctx) => ({
|
|
53550
|
-
"
|
|
53551
|
-
"
|
|
53597
|
+
"64b28dae": computedBackgroundColor.value,
|
|
53598
|
+
"e70b1a78": cumputedTextColor.value
|
|
53552
53599
|
}));
|
|
53553
53600
|
const props2 = __props;
|
|
53554
53601
|
const slots = useSlots();
|
|
@@ -53639,7 +53686,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
53639
53686
|
};
|
|
53640
53687
|
}
|
|
53641
53688
|
});
|
|
53642
|
-
const Pill = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
53689
|
+
const Pill = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-40a0a2e2"]]);
|
|
53643
53690
|
const _sfc_main$5 = {};
|
|
53644
53691
|
function _sfc_render$1(_ctx, _cache) {
|
|
53645
53692
|
const _component_router_view = resolveComponent("router-view");
|
|
@@ -55430,15 +55477,17 @@ function formatString(str, format2) {
|
|
|
55430
55477
|
}
|
|
55431
55478
|
return str;
|
|
55432
55479
|
}
|
|
55433
|
-
function debounce(
|
|
55434
|
-
let
|
|
55480
|
+
function debounce(callback, wait, immediate) {
|
|
55481
|
+
let timeout;
|
|
55435
55482
|
return function(...args) {
|
|
55436
|
-
|
|
55437
|
-
|
|
55438
|
-
|
|
55439
|
-
|
|
55440
|
-
|
|
55441
|
-
|
|
55483
|
+
const later = () => {
|
|
55484
|
+
timeout = void 0;
|
|
55485
|
+
if (!immediate) callback.apply(this, args);
|
|
55486
|
+
};
|
|
55487
|
+
const callNow = immediate && timeout === void 0;
|
|
55488
|
+
clearTimeout(timeout);
|
|
55489
|
+
timeout = setTimeout(later, wait);
|
|
55490
|
+
if (callNow) callback.apply(this, args);
|
|
55442
55491
|
};
|
|
55443
55492
|
}
|
|
55444
55493
|
function keyToLabel(key) {
|
|
@@ -55479,7 +55528,8 @@ function iffer(field, itemData) {
|
|
|
55479
55528
|
if (field["v-if"] === void 0) return true;
|
|
55480
55529
|
if (typeof field["v-if"] === "boolean") return field["v-if"];
|
|
55481
55530
|
if (typeof field["v-if"] === "string") return true;
|
|
55482
|
-
if (typeof field["v-if"] === "function")
|
|
55531
|
+
if (typeof field["v-if"] === "function")
|
|
55532
|
+
return (_a2 = field["v-if"]) == null ? void 0 : _a2.call(field, itemData == null ? void 0 : itemData[field.id], itemData);
|
|
55483
55533
|
return true;
|
|
55484
55534
|
}
|
|
55485
55535
|
function denullify(itemData, fieldID) {
|
|
@@ -55489,15 +55539,15 @@ function denullify(itemData, fieldID) {
|
|
|
55489
55539
|
const isDate = (dateToTest) => !Number.isNaN(Date.parse(dateToTest));
|
|
55490
55540
|
function getFallbackSchema(data2, showFields) {
|
|
55491
55541
|
const keys4 = Array.from(new Set((data2 ?? []).flatMap(Object.keys)));
|
|
55492
|
-
const schema = keys4.map(
|
|
55493
|
-
|
|
55494
|
-
|
|
55495
|
-
|
|
55496
|
-
})
|
|
55497
|
-
);
|
|
55542
|
+
const schema = keys4.map((id) => ({
|
|
55543
|
+
id,
|
|
55544
|
+
label: keyToLabel(id)
|
|
55545
|
+
}));
|
|
55498
55546
|
return showFields ? schema.filter((f2) => showFields.includes(f2.id) || !f2.id) : schema;
|
|
55499
55547
|
}
|
|
55500
|
-
|
|
55548
|
+
function sleep(ms = 100) {
|
|
55549
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
55550
|
+
}
|
|
55501
55551
|
function appendScript(src) {
|
|
55502
55552
|
return new Promise((resolve, reject3) => {
|
|
55503
55553
|
if (document.querySelector(`script[src="${src}"]`)) {
|