@bagelink/vue 0.0.815 → 0.0.819
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/AccordionItem.vue.d.ts +8 -0
- package/dist/components/AccordionItem.vue.d.ts.map +1 -1
- package/dist/components/Carousel.vue.d.ts.map +1 -1
- package/dist/components/Pill.vue.d.ts +12 -14
- 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 +90 -51
- package/dist/index.mjs +91 -52
- package/dist/style.css +84 -76
- package/package.json +11 -11
- package/src/components/AccordionItem.vue +42 -11
- package/src/components/Carousel.vue +39 -7
- package/src/components/Pill.vue +27 -33
- package/src/components/form/inputs/FileUpload.vue +6 -0
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp2 = Object.defineProperty;
|
|
2
2
|
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { defineComponent, reactive, provide, openBlock, createElementBlock, renderSlot, ref, computed, onMounted, inject, watch, createElementVNode, unref,
|
|
4
|
+
import { defineComponent, reactive, provide, openBlock, createElementBlock, renderSlot, ref, computed, onMounted, inject, watch, normalizeClass, createElementVNode, unref, createVNode, createCommentVNode, toDisplayString, Transition, withCtx, isRef, Fragment as Fragment$1, renderList, createBlock, useCssVars, useSlots, resolveDynamicComponent, withModifiers, createTextVNode, normalizeStyle, onUnmounted, resolveComponent, mergeProps, mergeModels, useModel, pushScopeId, popScopeId, nextTick, normalizeProps, guardReactiveProps, withScopeId, withKeys, createApp, h as h$2, withDirectives, vModelCheckbox, vModelText, toRef, createSlots, Teleport, render as render$f, onBeforeUpdate, vShow, getCurrentScope, onScopeDispose, vModelRadio, resolveDirective, onBeforeUnmount, getCurrentInstance, watchEffect, markRaw, customRef, TransitionGroup, vModelDynamic, shallowRef } from "vue";
|
|
5
5
|
const bagelFormUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
6
|
__proto__: null,
|
|
7
7
|
get bglForm() {
|
|
@@ -52,16 +52,19 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
const _hoisted_1$M =
|
|
56
|
-
const _hoisted_2$w =
|
|
57
|
-
const _hoisted_3$m =
|
|
58
|
-
const _hoisted_4$g = ["id", "aria-hidden"];
|
|
55
|
+
const _hoisted_1$M = ["aria-expanded", "aria-controls"];
|
|
56
|
+
const _hoisted_2$w = { class: "accordion-label" };
|
|
57
|
+
const _hoisted_3$m = ["id", "aria-hidden"];
|
|
59
58
|
const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
60
59
|
__name: "AccordionItem",
|
|
61
60
|
props: {
|
|
62
61
|
label: {},
|
|
63
62
|
id: {},
|
|
64
|
-
open: { type: Boolean }
|
|
63
|
+
open: { type: Boolean },
|
|
64
|
+
iconType: {},
|
|
65
|
+
iconPosition: {},
|
|
66
|
+
flat: { type: Boolean },
|
|
67
|
+
iconClass: {}
|
|
65
68
|
},
|
|
66
69
|
emits: ["update:open"],
|
|
67
70
|
setup(__props, { emit: __emit }) {
|
|
@@ -80,6 +83,10 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
80
83
|
});
|
|
81
84
|
const accordionState = inject("accordionState");
|
|
82
85
|
const id = props2.id || Math.random().toString(36).slice(7);
|
|
86
|
+
const computedIcon = computed(() => {
|
|
87
|
+
return props2.iconType === "plus_minus" ? isOpen.value ? "remove" : "add" : "expand_more";
|
|
88
|
+
});
|
|
89
|
+
const iconPosition = computed(() => props2.iconPosition || "end");
|
|
83
90
|
if (accordionState) {
|
|
84
91
|
watch(
|
|
85
92
|
() => accordionState.openItem,
|
|
@@ -100,22 +107,31 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
100
107
|
}
|
|
101
108
|
}
|
|
102
109
|
return (_ctx, _cache) => {
|
|
103
|
-
return openBlock(), createElementBlock("div",
|
|
110
|
+
return openBlock(), createElementBlock("div", {
|
|
111
|
+
class: normalizeClass(["accordion-item txt-start", [{ flat: _ctx.flat }]])
|
|
112
|
+
}, [
|
|
104
113
|
createElementVNode("button", {
|
|
105
114
|
"aria-expanded": unref(isOpen) ? "true" : "false",
|
|
106
115
|
class: "accordion-head",
|
|
107
116
|
"aria-controls": `accordion-body-${unref(id)}`,
|
|
108
117
|
onClick: _cache[0] || (_cache[0] = ($event) => toggle())
|
|
109
118
|
}, [
|
|
119
|
+
iconPosition.value === "start" ? (openBlock(), createElementBlock("span", {
|
|
120
|
+
key: 0,
|
|
121
|
+
class: normalizeClass(["accordion-icon", [_ctx.iconClass, { open: unref(isOpen) && _ctx.iconType === "expand_more" }]])
|
|
122
|
+
}, [
|
|
123
|
+
createVNode(unref(_sfc_main$c), { icon: computedIcon.value }, null, 8, ["icon"])
|
|
124
|
+
], 2)) : createCommentVNode("", true),
|
|
110
125
|
renderSlot(_ctx.$slots, "head", {}, () => [
|
|
111
|
-
createElementVNode("span",
|
|
126
|
+
createElementVNode("span", _hoisted_2$w, toDisplayString(_ctx.label), 1)
|
|
112
127
|
], true),
|
|
113
|
-
|
|
114
|
-
|
|
128
|
+
iconPosition.value === "end" ? (openBlock(), createElementBlock("span", {
|
|
129
|
+
key: 1,
|
|
130
|
+
class: normalizeClass(["accordion-icon", [_ctx.iconClass, { open: unref(isOpen) && _ctx.iconType === "expand_more" }]])
|
|
115
131
|
}, [
|
|
116
|
-
createVNode(unref(_sfc_main$c), { icon: "
|
|
117
|
-
], 2)
|
|
118
|
-
], 8,
|
|
132
|
+
createVNode(unref(_sfc_main$c), { icon: computedIcon.value }, null, 8, ["icon"])
|
|
133
|
+
], 2)) : createCommentVNode("", true)
|
|
134
|
+
], 8, _hoisted_1$M),
|
|
119
135
|
createVNode(Transition, { name: "expand" }, {
|
|
120
136
|
default: withCtx(() => [
|
|
121
137
|
unref(isOpen) ? (openBlock(), createElementBlock("div", {
|
|
@@ -125,11 +141,11 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
125
141
|
"aria-hidden": unref(isOpen) ? "false" : "true"
|
|
126
142
|
}, [
|
|
127
143
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
128
|
-
], 8,
|
|
144
|
+
], 8, _hoisted_3$m)) : createCommentVNode("", true)
|
|
129
145
|
]),
|
|
130
146
|
_: 3
|
|
131
147
|
})
|
|
132
|
-
]);
|
|
148
|
+
], 2);
|
|
133
149
|
};
|
|
134
150
|
}
|
|
135
151
|
});
|
|
@@ -140,7 +156,7 @@ const _export_sfc = (sfc, props2) => {
|
|
|
140
156
|
}
|
|
141
157
|
return target;
|
|
142
158
|
};
|
|
143
|
-
const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-
|
|
159
|
+
const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-9d8335fa"]]);
|
|
144
160
|
const _hoisted_1$L = { class: "relative" };
|
|
145
161
|
const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
146
162
|
__name: "AddressSearch",
|
|
@@ -594,28 +610,48 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
594
610
|
const height = Array.from(slidChildren).map((el) => el.clientHeight).reduce((a2, b2) => a2 + b2, 0);
|
|
595
611
|
yHeight.value = `${height}px`;
|
|
596
612
|
}
|
|
613
|
+
function scrollEase(target, duration = 500) {
|
|
614
|
+
if (!bglSlider.value) return;
|
|
615
|
+
const start2 = bglSlider.value.scrollLeft;
|
|
616
|
+
const change = target - start2;
|
|
617
|
+
const startTime = performance.now();
|
|
618
|
+
function animateScroll(currentTime) {
|
|
619
|
+
if (!bglSlider.value) return;
|
|
620
|
+
const timeElapsed = currentTime - startTime;
|
|
621
|
+
const progress = Math.min(timeElapsed / duration, 1);
|
|
622
|
+
bglSlider.value.scrollLeft = start2 + change * easeInOutQuad(progress);
|
|
623
|
+
if (progress < 1) {
|
|
624
|
+
requestAnimationFrame(animateScroll);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
function easeInOutQuad(t) {
|
|
628
|
+
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
|
629
|
+
}
|
|
630
|
+
requestAnimationFrame(animateScroll);
|
|
631
|
+
}
|
|
597
632
|
function goToSlide(index2) {
|
|
598
633
|
if (!bglSlider.value || index2 < 0 || index2 > bglSlider.value.children.length - 1) return;
|
|
599
|
-
const slider = bglSlider.value;
|
|
600
634
|
const isRTL = getComputedStyle(bglSlider.value).direction === "rtl";
|
|
601
|
-
const scrollX =
|
|
602
|
-
|
|
635
|
+
const scrollX = bglSlider.value.offsetWidth * index2 * (isRTL ? -1 : 1);
|
|
636
|
+
const screenWidth = window.innerWidth;
|
|
637
|
+
let duration = 700;
|
|
638
|
+
if (screenWidth < 600) {
|
|
639
|
+
duration = 400;
|
|
640
|
+
} else if (screenWidth < 991) {
|
|
641
|
+
duration = 500;
|
|
642
|
+
}
|
|
643
|
+
scrollEase(scrollX, duration);
|
|
603
644
|
activeSlideIndex.value = index2;
|
|
604
645
|
evalHeight();
|
|
605
646
|
}
|
|
606
647
|
watch(() => props2.index, goToSlide);
|
|
607
648
|
watch(
|
|
608
649
|
() => activeSlideIndex.value,
|
|
609
|
-
(
|
|
610
|
-
|
|
650
|
+
() => {
|
|
651
|
+
if (props2.index === activeSlideIndex.value) return;
|
|
652
|
+
emit2("update:index", activeSlideIndex.value);
|
|
611
653
|
}
|
|
612
654
|
);
|
|
613
|
-
function scrollEnd() {
|
|
614
|
-
const slider = bglSlider.value;
|
|
615
|
-
if (!slider || props2.items !== 1) return;
|
|
616
|
-
const nextSlide = Math.round(slider.scrollLeft / slider.offsetWidth);
|
|
617
|
-
goToSlide(nextSlide);
|
|
618
|
-
}
|
|
619
655
|
function stopDragging(e) {
|
|
620
656
|
isPressed.value = false;
|
|
621
657
|
const slider = bglSlider.value;
|
|
@@ -688,7 +724,6 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
688
724
|
[`slides-${__props.items}`]: true,
|
|
689
725
|
allowScroll: __props.allowScroll
|
|
690
726
|
}, "bgl-slider"]),
|
|
691
|
-
onScrollend: scrollEnd,
|
|
692
727
|
onMousedown: startDragging
|
|
693
728
|
}, [
|
|
694
729
|
unref(isDragging) ? (openBlock(), createElementBlock("div", _hoisted_1$F)) : createCommentVNode("", true),
|
|
@@ -712,7 +747,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
712
747
|
};
|
|
713
748
|
}
|
|
714
749
|
});
|
|
715
|
-
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-
|
|
750
|
+
const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-619a1cb2"]]);
|
|
716
751
|
function _isPlaceholder(a2) {
|
|
717
752
|
return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
|
|
718
753
|
}
|
|
@@ -18654,6 +18689,12 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
18654
18689
|
if (!props2.files && [file_bindkeys.value].flat().length > 0) {
|
|
18655
18690
|
const ids = [file_bindkeys.value].flat().filter(Boolean);
|
|
18656
18691
|
if (!(ids == null ? void 0 : ids.length)) return;
|
|
18692
|
+
if (bindKey2 === "url") {
|
|
18693
|
+
ids.forEach((url) => {
|
|
18694
|
+
storageFiles.value.push({ url });
|
|
18695
|
+
});
|
|
18696
|
+
return;
|
|
18697
|
+
}
|
|
18657
18698
|
if (props2.multiple) {
|
|
18658
18699
|
ids.forEach((id) => {
|
|
18659
18700
|
void bagel.get(`/files/${id}`).then((file) => {
|
|
@@ -18912,7 +18953,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
18912
18953
|
};
|
|
18913
18954
|
}
|
|
18914
18955
|
});
|
|
18915
|
-
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
18956
|
+
const $el = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-1db5afa3"]]);
|
|
18916
18957
|
const _hoisted_1$v = ["title"];
|
|
18917
18958
|
const _hoisted_2$k = { key: 0 };
|
|
18918
18959
|
const _hoisted_3$g = ["value", "placeholder"];
|
|
@@ -53490,24 +53531,24 @@ const _hoisted_8$2 = {
|
|
|
53490
53531
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
53491
53532
|
__name: "Pill",
|
|
53492
53533
|
props: {
|
|
53493
|
-
disabled: { type: Boolean
|
|
53534
|
+
disabled: { type: Boolean },
|
|
53494
53535
|
icon: {},
|
|
53495
53536
|
iconEnd: {},
|
|
53496
53537
|
color: {},
|
|
53497
53538
|
theme: {},
|
|
53498
53539
|
flat: { type: Boolean },
|
|
53499
|
-
border: { type: Boolean
|
|
53500
|
-
outline: { type: Boolean
|
|
53501
|
-
loading: { type: Boolean
|
|
53540
|
+
border: { type: Boolean },
|
|
53541
|
+
outline: { type: Boolean },
|
|
53542
|
+
loading: { type: Boolean },
|
|
53502
53543
|
value: {},
|
|
53503
|
-
round: { type: Boolean
|
|
53504
|
-
|
|
53505
|
-
btnEnd: {
|
|
53544
|
+
round: { type: Boolean },
|
|
53545
|
+
btn: {},
|
|
53546
|
+
btnEnd: {}
|
|
53506
53547
|
},
|
|
53507
53548
|
setup(__props) {
|
|
53508
53549
|
useCssVars((_ctx) => ({
|
|
53509
|
-
"
|
|
53510
|
-
"
|
|
53550
|
+
"4779ddec": computedBackgroundColor.value,
|
|
53551
|
+
"04aaf136": cumputedTextColor.value
|
|
53511
53552
|
}));
|
|
53512
53553
|
const props2 = __props;
|
|
53513
53554
|
const slots = useSlots();
|
|
@@ -53566,12 +53607,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
53566
53607
|
}, [
|
|
53567
53608
|
createElementVNode("div", _hoisted_2$2, [
|
|
53568
53609
|
_ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_3$2)) : (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
53569
|
-
_ctx.
|
|
53570
|
-
createVNode(unref(Btn), {
|
|
53610
|
+
_ctx.btn ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
|
|
53611
|
+
createVNode(unref(Btn), mergeProps({
|
|
53571
53612
|
class: "bgl_pill-btn",
|
|
53572
|
-
thin: ""
|
|
53573
|
-
|
|
53574
|
-
})
|
|
53613
|
+
thin: ""
|
|
53614
|
+
}, _ctx.btn), null, 16)
|
|
53575
53615
|
])) : createCommentVNode("", true)
|
|
53576
53616
|
])),
|
|
53577
53617
|
_ctx.icon ? (openBlock(), createBlock(unref(_sfc_main$c), {
|
|
@@ -53582,17 +53622,16 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
53582
53622
|
!unref(slots).default && _ctx.value ? (openBlock(), createElementBlock(Fragment$1, { key: 3 }, [
|
|
53583
53623
|
createTextVNode(toDisplayString(_ctx.value), 1)
|
|
53584
53624
|
], 64)) : createCommentVNode("", true),
|
|
53585
|
-
|
|
53625
|
+
_ctx.iconEnd ? (openBlock(), createBlock(unref(_sfc_main$c), {
|
|
53586
53626
|
key: 4,
|
|
53587
|
-
icon:
|
|
53627
|
+
icon: _ctx.iconEnd
|
|
53588
53628
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
53589
53629
|
_ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_6$2)) : (openBlock(), createElementBlock("div", _hoisted_7$2, [
|
|
53590
|
-
|
|
53591
|
-
createVNode(unref(Btn), {
|
|
53630
|
+
_ctx.btnEnd ? (openBlock(), createElementBlock("div", _hoisted_8$2, [
|
|
53631
|
+
createVNode(unref(Btn), mergeProps({
|
|
53592
53632
|
class: "bgl_pill-btn",
|
|
53593
|
-
thin: ""
|
|
53594
|
-
|
|
53595
|
-
})
|
|
53633
|
+
thin: ""
|
|
53634
|
+
}, _ctx.btnEnd), null, 16)
|
|
53596
53635
|
])) : createCommentVNode("", true)
|
|
53597
53636
|
]))
|
|
53598
53637
|
])
|
|
@@ -53600,7 +53639,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
53600
53639
|
};
|
|
53601
53640
|
}
|
|
53602
53641
|
});
|
|
53603
|
-
const Pill = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
53642
|
+
const Pill = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-8c7388de"]]);
|
|
53604
53643
|
const _sfc_main$5 = {};
|
|
53605
53644
|
function _sfc_render$1(_ctx, _cache) {
|
|
53606
53645
|
const _component_router_view = resolveComponent("router-view");
|