@bagelink/vue 0.0.522 → 0.0.526

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.
@@ -3,12 +3,12 @@ declare function prev(): void;
3
3
  declare function __VLS_template(): {
4
4
  default?(_: {}): any;
5
5
  prev?(_: {
6
- index: import('@vue-macros/reactivity-transform/macros.js').ReactiveVariable<number>;
7
6
  prev: typeof prev;
7
+ index: import('@vue-macros/reactivity-transform/macros.js').ReactiveVariable<number>;
8
8
  }): any;
9
9
  next?(_: {
10
- index: import('@vue-macros/reactivity-transform/macros.js').ReactiveVariable<number>;
11
10
  next: typeof next;
11
+ index: import('@vue-macros/reactivity-transform/macros.js').ReactiveVariable<number>;
12
12
  }): any;
13
13
  };
14
14
  declare const __VLS_component: import('vue').DefineComponent<{
@@ -32,18 +32,6 @@ declare const __VLS_component: import('vue').DefineComponent<{
32
32
  type: NumberConstructor;
33
33
  default: number;
34
34
  };
35
- autoplay: {
36
- type: BooleanConstructor;
37
- default: boolean;
38
- };
39
- autoplaySpeed: {
40
- type: NumberConstructor;
41
- default: number;
42
- };
43
- loop: {
44
- type: BooleanConstructor;
45
- default: boolean;
46
- };
47
35
  }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
48
36
  "update:index": (...args: any[]) => void;
49
37
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
@@ -67,29 +55,14 @@ declare const __VLS_component: import('vue').DefineComponent<{
67
55
  type: NumberConstructor;
68
56
  default: number;
69
57
  };
70
- autoplay: {
71
- type: BooleanConstructor;
72
- default: boolean;
73
- };
74
- autoplaySpeed: {
75
- type: NumberConstructor;
76
- default: number;
77
- };
78
- loop: {
79
- type: BooleanConstructor;
80
- default: boolean;
81
- };
82
58
  }>> & {
83
59
  "onUpdate:index"?: ((...args: any[]) => any) | undefined;
84
60
  }, {
85
- autoplay: boolean;
86
- loop: boolean;
87
61
  autoHeight: boolean;
88
62
  allowScroll: boolean;
89
63
  freeDrag: boolean;
90
64
  items: number;
91
65
  index: number;
92
- autoplaySpeed: number;
93
66
  }, {}>;
94
67
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
95
68
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AA2GA,iBAAS,IAAI,SAIZ;AAED,iBAAS,IAAI,SAIZ;AAiDD,iBAAS,cAAc;qBAsKO,GAAG;;;;QACN,GAAG;;;;QACH,GAAG;EAK7B;AA6BD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AAsHA,iBAAS,IAAI,SAMZ;AAED,iBAAS,IAAI,SAKZ;AAkBD,iBAAS,cAAc;qBAwKO,GAAG;;;;QACN,GAAG;;;;QACH,GAAG;EAK7B;AAuCD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA4BnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
package/dist/index.cjs CHANGED
@@ -6524,28 +6524,37 @@ const _hoisted_2$n = { class: "Handlers" };
6524
6524
  const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
6525
6525
  __name: "Carousel",
6526
6526
  props: {
6527
- autoHeight: { type: Boolean, default: false },
6528
- allowScroll: { type: Boolean, default: true },
6529
- freeDrag: { type: Boolean, default: true },
6530
- items: { type: Number, default: 4 },
6531
- index: { type: Number, default: 0 },
6532
- autoplay: { type: Boolean, default: false },
6533
- autoplaySpeed: { type: Number, default: 3e3 },
6534
- loop: { type: Boolean, default: false }
6527
+ autoHeight: {
6528
+ type: Boolean,
6529
+ default: false
6530
+ },
6531
+ allowScroll: {
6532
+ type: Boolean,
6533
+ default: true
6534
+ },
6535
+ freeDrag: {
6536
+ type: Boolean,
6537
+ default: true
6538
+ },
6539
+ items: {
6540
+ type: Number,
6541
+ default: 4
6542
+ },
6543
+ index: {
6544
+ type: Number,
6545
+ default: 0
6546
+ }
6535
6547
  },
6536
6548
  emits: ["update:index"],
6537
6549
  setup(__props, { emit: __emit }) {
6538
6550
  const props2 = __props;
6539
6551
  const emit2 = __emit;
6540
- const bglSlider = vue.ref(null);
6552
+ const bglSlider = vue.ref();
6541
6553
  let activeSlideIndex = vue.ref(0);
6542
6554
  let isDragging = vue.ref(false);
6543
6555
  let startX = vue.ref(0);
6544
6556
  let scrollLeft = vue.ref(0);
6545
6557
  let isPressed = vue.ref(false);
6546
- let yHeight = vue.ref("auto");
6547
- let autoplayInterval = vue.ref(null);
6548
- let originalSlideCount = vue.ref(0);
6549
6558
  function disableDrag() {
6550
6559
  var _a2, _b;
6551
6560
  (_a2 = bglSlider.value) == null ? void 0 : _a2.querySelectorAll("img").forEach((e) => {
@@ -6553,40 +6562,36 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
6553
6562
  });
6554
6563
  for (const e of ((_b = bglSlider.value) == null ? void 0 : _b.children) || []) {
6555
6564
  e.setAttribute("draggable", "false");
6556
- e.addEventListener("click", (el) => el.preventDefault());
6565
+ e.addEventListener("click", (e22) => e22.preventDefault());
6557
6566
  }
6558
6567
  }
6568
+ let yHeight = vue.ref("auto");
6559
6569
  function evalHeight() {
6560
6570
  if (!props2.autoHeight || !bglSlider.value) return;
6561
- const height = Array.from(bglSlider.value.children[activeSlideIndex.value].children).map((el) => el.clientHeight).reduce((a2, b2) => a2 + b2, 0);
6571
+ const slidChildren = bglSlider.value.children[activeSlideIndex.value].children;
6572
+ const height = Array.from(slidChildren).map((el) => el.clientHeight).reduce((a2, b2) => a2 + b2, 0);
6562
6573
  yHeight.value = `${height}px`;
6563
6574
  }
6564
- function goToSlide(index2, behavior = "smooth") {
6565
- if (!bglSlider.value) return;
6566
- if (props2.loop) {
6567
- if (index2 >= originalSlideCount.value) {
6568
- index2 = index2 % originalSlideCount.value;
6569
- behavior = "auto";
6570
- } else if (index2 < 0) {
6571
- index2 = originalSlideCount.value - -index2 % originalSlideCount.value;
6572
- behavior = "auto";
6573
- }
6574
- }
6575
+ function goToSlide(index2) {
6576
+ if (!bglSlider.value || index2 < 0 || index2 > bglSlider.value.children.length - 1) return;
6577
+ const slider = bglSlider.value;
6575
6578
  const isRTL = getComputedStyle(bglSlider.value).direction === "rtl";
6576
- const scrollX = bglSlider.value.offsetWidth * index2 * (isRTL ? -1 : 1);
6577
- bglSlider.value.scrollTo({ left: scrollX, behavior });
6579
+ const scrollX = slider.offsetWidth * index2 * (isRTL ? -1 : 1);
6580
+ slider.scrollTo({ left: scrollX, behavior: "smooth" });
6578
6581
  activeSlideIndex.value = index2;
6579
6582
  evalHeight();
6580
6583
  }
6581
- vue.watch(() => props2.index, (index2) => {
6582
- goToSlide(index2);
6583
- });
6584
- vue.watch(() => activeSlideIndex.value, (index2) => {
6585
- emit2("update:index", index2);
6586
- });
6584
+ vue.watch(() => props2.index, goToSlide);
6585
+ vue.watch(
6586
+ () => activeSlideIndex.value,
6587
+ (index2) => {
6588
+ emit2("update:index", index2);
6589
+ }
6590
+ );
6587
6591
  function scrollEnd() {
6588
- if (props2.items !== 1 || !bglSlider.value) return;
6589
- const nextSlide = Math.round(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
6592
+ const slider = bglSlider.value;
6593
+ if (!slider || props2.items !== 1) return;
6594
+ const nextSlide = Math.round(slider.scrollLeft / slider.offsetWidth);
6590
6595
  goToSlide(nextSlide);
6591
6596
  }
6592
6597
  function stopDragging(e) {
@@ -6594,8 +6599,11 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
6594
6599
  const slider = bglSlider.value;
6595
6600
  if (!slider) return;
6596
6601
  const isDragForward = startX.value > e.pageX + slider.offsetLeft;
6597
- activeSlideIndex.value = isDragForward ? Math.ceil(slider.scrollLeft / slider.offsetWidth) : Math.floor(slider.scrollLeft / slider.offsetWidth);
6602
+ if (isDragForward)
6603
+ activeSlideIndex.value = Math.ceil(slider.scrollLeft / slider.offsetWidth);
6604
+ else activeSlideIndex.value = Math.floor(slider.scrollLeft / slider.offsetWidth);
6598
6605
  if (props2.items === 1) goToSlide(activeSlideIndex.value);
6606
+ startX.value = 0;
6599
6607
  document.removeEventListener("mousemove", move);
6600
6608
  document.removeEventListener("mouseup", stopDragging);
6601
6609
  document.removeEventListener("dragend", stopDragging);
@@ -6604,9 +6612,11 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
6604
6612
  function move(e) {
6605
6613
  if (!bglSlider.value) return;
6606
6614
  const x2 = e.pageX - bglSlider.value.offsetLeft;
6607
- if (Math.abs(x2 - startX.value) > 20) isDragging.value = true;
6615
+ const walk = x2 - startX.value;
6616
+ if (walk > 20 || walk < -20) isDragging.value = true;
6608
6617
  if (!isDragging.value) return;
6609
- bglSlider.value.scrollLeft = scrollLeft.value - (x2 - startX.value);
6618
+ const scroll = x2 - startX.value;
6619
+ bglSlider.value.scrollLeft = scrollLeft.value - scroll;
6610
6620
  }
6611
6621
  function startDragging(e) {
6612
6622
  if (e.button !== 0 || !props2.freeDrag || !bglSlider.value) return;
@@ -6618,70 +6628,46 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
6618
6628
  document.addEventListener("dragend", stopDragging);
6619
6629
  }
6620
6630
  function next() {
6621
- if (bglSlider.value) {
6622
- goToSlide(activeSlideIndex.value + 1);
6623
- }
6631
+ if (!bglSlider.value) return;
6632
+ const slideCount = bglSlider.value.children.length;
6633
+ const isLastSlide = activeSlideIndex.value >= slideCount - 1;
6634
+ if (isLastSlide) goToSlide(0);
6635
+ else goToSlide(activeSlideIndex.value + 1);
6624
6636
  }
6625
6637
  function prev() {
6626
- if (bglSlider.value) {
6627
- goToSlide(activeSlideIndex.value - 1);
6628
- }
6638
+ if (!bglSlider.value) return;
6639
+ const slideCount = bglSlider.value.children.length;
6640
+ if (activeSlideIndex.value === 0) goToSlide(slideCount - 1);
6641
+ else goToSlide(activeSlideIndex.value - 1);
6629
6642
  }
6630
6643
  function evalWidth() {
6631
- if (bglSlider.value) goToSlide(activeSlideIndex.value);
6632
- }
6633
- function startAutoplay() {
6634
- if (props2.autoplay) {
6635
- autoplayInterval.value = setInterval(next, props2.autoplaySpeed);
6636
- }
6637
- }
6638
- function stopAutoplay() {
6639
- if (autoplayInterval.value) {
6640
- clearInterval(autoplayInterval.value);
6641
- autoplayInterval.value = null;
6642
- }
6643
- }
6644
- function cloneSlides() {
6645
- if (!bglSlider.value || !props2.loop) return;
6646
- const slides = Array.from(bglSlider.value.children);
6647
- originalSlideCount.value = slides.length;
6648
- slides.forEach((slide) => {
6649
- const clone2 = slide.cloneNode(true);
6650
- bglSlider.value.appendChild(clone2);
6651
- });
6652
- slides.forEach((slide) => {
6653
- const clone2 = slide.cloneNode(true);
6654
- bglSlider.value.insertBefore(clone2, bglSlider.value.firstChild);
6655
- });
6644
+ if (!bglSlider.value) return;
6645
+ goToSlide(activeSlideIndex.value);
6656
6646
  }
6657
6647
  vue.onMounted(() => {
6658
- cloneSlides();
6659
6648
  window.addEventListener("resize", evalWidth);
6660
6649
  evalHeight();
6661
6650
  disableDrag();
6662
- startAutoplay();
6663
6651
  });
6664
6652
  vue.onUnmounted(() => {
6665
6653
  window.removeEventListener("resize", evalWidth);
6666
- stopAutoplay();
6667
6654
  });
6668
6655
  return (_ctx, _cache) => {
6669
6656
  return vue.openBlock(), vue.createElementBlock("div", {
6670
- class: vue.normalizeClass(["BglCarousel", { autoHeight: props2.autoHeight }]),
6657
+ class: vue.normalizeClass(["BglCarousel", { autoHeight: __props.autoHeight }]),
6671
6658
  style: vue.normalizeStyle({ height: vue.unref(yHeight) })
6672
6659
  }, [
6673
6660
  vue.createElementVNode("div", {
6674
6661
  ref_key: "bglSlider",
6675
6662
  ref: bglSlider,
6676
- class: vue.normalizeClass(["bgl-slider", [
6677
- { dragging: vue.unref(isDragging), clicking: vue.unref(isPressed), [`slides-${props2.items}`]: true, allowScroll: props2.allowScroll }
6678
- ]]),
6663
+ class: vue.normalizeClass([{
6664
+ dragging: vue.unref(isDragging),
6665
+ clicking: vue.unref(isPressed),
6666
+ [`slides-${__props.items}`]: true,
6667
+ allowScroll: __props.allowScroll
6668
+ }, "bgl-slider"]),
6679
6669
  onScrollend: scrollEnd,
6680
- onMousedown: startDragging,
6681
- onMouseenter: stopAutoplay,
6682
- onMouseleave: startAutoplay,
6683
- onFocusin: stopAutoplay,
6684
- onFocusout: startAutoplay
6670
+ onMousedown: startDragging
6685
6671
  }, [
6686
6672
  vue.unref(isDragging) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$t)) : vue.createCommentVNode("", true),
6687
6673
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
@@ -6689,14 +6675,14 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
6689
6675
  vue.createElementVNode("div", _hoisted_2$n, [
6690
6676
  vue.createElementVNode("span", { onClick: prev }, [
6691
6677
  vue.renderSlot(_ctx.$slots, "prev", {
6692
- index: vue.unref(activeSlideIndex),
6693
- prev
6678
+ prev,
6679
+ index: vue.unref(activeSlideIndex)
6694
6680
  }, void 0, true)
6695
6681
  ]),
6696
6682
  vue.createElementVNode("span", { onClick: next }, [
6697
6683
  vue.renderSlot(_ctx.$slots, "next", {
6698
- index: vue.unref(activeSlideIndex),
6699
- next
6684
+ next,
6685
+ index: vue.unref(activeSlideIndex)
6700
6686
  }, void 0, true)
6701
6687
  ])
6702
6688
  ])
@@ -6704,7 +6690,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
6704
6690
  };
6705
6691
  }
6706
6692
  });
6707
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-f21373a1"]]);
6693
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-1f9c6644"]]);
6708
6694
  const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
6709
6695
  __name: "ModalConfirm",
6710
6696
  props: {
package/dist/index.mjs CHANGED
@@ -6522,28 +6522,37 @@ const _hoisted_2$n = { class: "Handlers" };
6522
6522
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
6523
6523
  __name: "Carousel",
6524
6524
  props: {
6525
- autoHeight: { type: Boolean, default: false },
6526
- allowScroll: { type: Boolean, default: true },
6527
- freeDrag: { type: Boolean, default: true },
6528
- items: { type: Number, default: 4 },
6529
- index: { type: Number, default: 0 },
6530
- autoplay: { type: Boolean, default: false },
6531
- autoplaySpeed: { type: Number, default: 3e3 },
6532
- loop: { type: Boolean, default: false }
6525
+ autoHeight: {
6526
+ type: Boolean,
6527
+ default: false
6528
+ },
6529
+ allowScroll: {
6530
+ type: Boolean,
6531
+ default: true
6532
+ },
6533
+ freeDrag: {
6534
+ type: Boolean,
6535
+ default: true
6536
+ },
6537
+ items: {
6538
+ type: Number,
6539
+ default: 4
6540
+ },
6541
+ index: {
6542
+ type: Number,
6543
+ default: 0
6544
+ }
6533
6545
  },
6534
6546
  emits: ["update:index"],
6535
6547
  setup(__props, { emit: __emit }) {
6536
6548
  const props2 = __props;
6537
6549
  const emit2 = __emit;
6538
- const bglSlider = ref(null);
6550
+ const bglSlider = ref();
6539
6551
  let activeSlideIndex = ref(0);
6540
6552
  let isDragging = ref(false);
6541
6553
  let startX = ref(0);
6542
6554
  let scrollLeft = ref(0);
6543
6555
  let isPressed = ref(false);
6544
- let yHeight = ref("auto");
6545
- let autoplayInterval = ref(null);
6546
- let originalSlideCount = ref(0);
6547
6556
  function disableDrag() {
6548
6557
  var _a2, _b;
6549
6558
  (_a2 = bglSlider.value) == null ? void 0 : _a2.querySelectorAll("img").forEach((e) => {
@@ -6551,40 +6560,36 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
6551
6560
  });
6552
6561
  for (const e of ((_b = bglSlider.value) == null ? void 0 : _b.children) || []) {
6553
6562
  e.setAttribute("draggable", "false");
6554
- e.addEventListener("click", (el) => el.preventDefault());
6563
+ e.addEventListener("click", (e22) => e22.preventDefault());
6555
6564
  }
6556
6565
  }
6566
+ let yHeight = ref("auto");
6557
6567
  function evalHeight() {
6558
6568
  if (!props2.autoHeight || !bglSlider.value) return;
6559
- const height = Array.from(bglSlider.value.children[activeSlideIndex.value].children).map((el) => el.clientHeight).reduce((a2, b2) => a2 + b2, 0);
6569
+ const slidChildren = bglSlider.value.children[activeSlideIndex.value].children;
6570
+ const height = Array.from(slidChildren).map((el) => el.clientHeight).reduce((a2, b2) => a2 + b2, 0);
6560
6571
  yHeight.value = `${height}px`;
6561
6572
  }
6562
- function goToSlide(index2, behavior = "smooth") {
6563
- if (!bglSlider.value) return;
6564
- if (props2.loop) {
6565
- if (index2 >= originalSlideCount.value) {
6566
- index2 = index2 % originalSlideCount.value;
6567
- behavior = "auto";
6568
- } else if (index2 < 0) {
6569
- index2 = originalSlideCount.value - -index2 % originalSlideCount.value;
6570
- behavior = "auto";
6571
- }
6572
- }
6573
+ function goToSlide(index2) {
6574
+ if (!bglSlider.value || index2 < 0 || index2 > bglSlider.value.children.length - 1) return;
6575
+ const slider = bglSlider.value;
6573
6576
  const isRTL = getComputedStyle(bglSlider.value).direction === "rtl";
6574
- const scrollX = bglSlider.value.offsetWidth * index2 * (isRTL ? -1 : 1);
6575
- bglSlider.value.scrollTo({ left: scrollX, behavior });
6577
+ const scrollX = slider.offsetWidth * index2 * (isRTL ? -1 : 1);
6578
+ slider.scrollTo({ left: scrollX, behavior: "smooth" });
6576
6579
  activeSlideIndex.value = index2;
6577
6580
  evalHeight();
6578
6581
  }
6579
- watch(() => props2.index, (index2) => {
6580
- goToSlide(index2);
6581
- });
6582
- watch(() => activeSlideIndex.value, (index2) => {
6583
- emit2("update:index", index2);
6584
- });
6582
+ watch(() => props2.index, goToSlide);
6583
+ watch(
6584
+ () => activeSlideIndex.value,
6585
+ (index2) => {
6586
+ emit2("update:index", index2);
6587
+ }
6588
+ );
6585
6589
  function scrollEnd() {
6586
- if (props2.items !== 1 || !bglSlider.value) return;
6587
- const nextSlide = Math.round(bglSlider.value.scrollLeft / bglSlider.value.offsetWidth);
6590
+ const slider = bglSlider.value;
6591
+ if (!slider || props2.items !== 1) return;
6592
+ const nextSlide = Math.round(slider.scrollLeft / slider.offsetWidth);
6588
6593
  goToSlide(nextSlide);
6589
6594
  }
6590
6595
  function stopDragging(e) {
@@ -6592,8 +6597,11 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
6592
6597
  const slider = bglSlider.value;
6593
6598
  if (!slider) return;
6594
6599
  const isDragForward = startX.value > e.pageX + slider.offsetLeft;
6595
- activeSlideIndex.value = isDragForward ? Math.ceil(slider.scrollLeft / slider.offsetWidth) : Math.floor(slider.scrollLeft / slider.offsetWidth);
6600
+ if (isDragForward)
6601
+ activeSlideIndex.value = Math.ceil(slider.scrollLeft / slider.offsetWidth);
6602
+ else activeSlideIndex.value = Math.floor(slider.scrollLeft / slider.offsetWidth);
6596
6603
  if (props2.items === 1) goToSlide(activeSlideIndex.value);
6604
+ startX.value = 0;
6597
6605
  document.removeEventListener("mousemove", move);
6598
6606
  document.removeEventListener("mouseup", stopDragging);
6599
6607
  document.removeEventListener("dragend", stopDragging);
@@ -6602,9 +6610,11 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
6602
6610
  function move(e) {
6603
6611
  if (!bglSlider.value) return;
6604
6612
  const x2 = e.pageX - bglSlider.value.offsetLeft;
6605
- if (Math.abs(x2 - startX.value) > 20) isDragging.value = true;
6613
+ const walk = x2 - startX.value;
6614
+ if (walk > 20 || walk < -20) isDragging.value = true;
6606
6615
  if (!isDragging.value) return;
6607
- bglSlider.value.scrollLeft = scrollLeft.value - (x2 - startX.value);
6616
+ const scroll = x2 - startX.value;
6617
+ bglSlider.value.scrollLeft = scrollLeft.value - scroll;
6608
6618
  }
6609
6619
  function startDragging(e) {
6610
6620
  if (e.button !== 0 || !props2.freeDrag || !bglSlider.value) return;
@@ -6616,70 +6626,46 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
6616
6626
  document.addEventListener("dragend", stopDragging);
6617
6627
  }
6618
6628
  function next() {
6619
- if (bglSlider.value) {
6620
- goToSlide(activeSlideIndex.value + 1);
6621
- }
6629
+ if (!bglSlider.value) return;
6630
+ const slideCount = bglSlider.value.children.length;
6631
+ const isLastSlide = activeSlideIndex.value >= slideCount - 1;
6632
+ if (isLastSlide) goToSlide(0);
6633
+ else goToSlide(activeSlideIndex.value + 1);
6622
6634
  }
6623
6635
  function prev() {
6624
- if (bglSlider.value) {
6625
- goToSlide(activeSlideIndex.value - 1);
6626
- }
6636
+ if (!bglSlider.value) return;
6637
+ const slideCount = bglSlider.value.children.length;
6638
+ if (activeSlideIndex.value === 0) goToSlide(slideCount - 1);
6639
+ else goToSlide(activeSlideIndex.value - 1);
6627
6640
  }
6628
6641
  function evalWidth() {
6629
- if (bglSlider.value) goToSlide(activeSlideIndex.value);
6630
- }
6631
- function startAutoplay() {
6632
- if (props2.autoplay) {
6633
- autoplayInterval.value = setInterval(next, props2.autoplaySpeed);
6634
- }
6635
- }
6636
- function stopAutoplay() {
6637
- if (autoplayInterval.value) {
6638
- clearInterval(autoplayInterval.value);
6639
- autoplayInterval.value = null;
6640
- }
6641
- }
6642
- function cloneSlides() {
6643
- if (!bglSlider.value || !props2.loop) return;
6644
- const slides = Array.from(bglSlider.value.children);
6645
- originalSlideCount.value = slides.length;
6646
- slides.forEach((slide) => {
6647
- const clone2 = slide.cloneNode(true);
6648
- bglSlider.value.appendChild(clone2);
6649
- });
6650
- slides.forEach((slide) => {
6651
- const clone2 = slide.cloneNode(true);
6652
- bglSlider.value.insertBefore(clone2, bglSlider.value.firstChild);
6653
- });
6642
+ if (!bglSlider.value) return;
6643
+ goToSlide(activeSlideIndex.value);
6654
6644
  }
6655
6645
  onMounted(() => {
6656
- cloneSlides();
6657
6646
  window.addEventListener("resize", evalWidth);
6658
6647
  evalHeight();
6659
6648
  disableDrag();
6660
- startAutoplay();
6661
6649
  });
6662
6650
  onUnmounted(() => {
6663
6651
  window.removeEventListener("resize", evalWidth);
6664
- stopAutoplay();
6665
6652
  });
6666
6653
  return (_ctx, _cache) => {
6667
6654
  return openBlock(), createElementBlock("div", {
6668
- class: normalizeClass(["BglCarousel", { autoHeight: props2.autoHeight }]),
6655
+ class: normalizeClass(["BglCarousel", { autoHeight: __props.autoHeight }]),
6669
6656
  style: normalizeStyle({ height: unref(yHeight) })
6670
6657
  }, [
6671
6658
  createElementVNode("div", {
6672
6659
  ref_key: "bglSlider",
6673
6660
  ref: bglSlider,
6674
- class: normalizeClass(["bgl-slider", [
6675
- { dragging: unref(isDragging), clicking: unref(isPressed), [`slides-${props2.items}`]: true, allowScroll: props2.allowScroll }
6676
- ]]),
6661
+ class: normalizeClass([{
6662
+ dragging: unref(isDragging),
6663
+ clicking: unref(isPressed),
6664
+ [`slides-${__props.items}`]: true,
6665
+ allowScroll: __props.allowScroll
6666
+ }, "bgl-slider"]),
6677
6667
  onScrollend: scrollEnd,
6678
- onMousedown: startDragging,
6679
- onMouseenter: stopAutoplay,
6680
- onMouseleave: startAutoplay,
6681
- onFocusin: stopAutoplay,
6682
- onFocusout: startAutoplay
6668
+ onMousedown: startDragging
6683
6669
  }, [
6684
6670
  unref(isDragging) ? (openBlock(), createElementBlock("div", _hoisted_1$t)) : createCommentVNode("", true),
6685
6671
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
@@ -6687,14 +6673,14 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
6687
6673
  createElementVNode("div", _hoisted_2$n, [
6688
6674
  createElementVNode("span", { onClick: prev }, [
6689
6675
  renderSlot(_ctx.$slots, "prev", {
6690
- index: unref(activeSlideIndex),
6691
- prev
6676
+ prev,
6677
+ index: unref(activeSlideIndex)
6692
6678
  }, void 0, true)
6693
6679
  ]),
6694
6680
  createElementVNode("span", { onClick: next }, [
6695
6681
  renderSlot(_ctx.$slots, "next", {
6696
- index: unref(activeSlideIndex),
6697
- next
6682
+ next,
6683
+ index: unref(activeSlideIndex)
6698
6684
  }, void 0, true)
6699
6685
  ])
6700
6686
  ])
@@ -6702,7 +6688,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
6702
6688
  };
6703
6689
  }
6704
6690
  });
6705
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-f21373a1"]]);
6691
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-1f9c6644"]]);
6706
6692
  const _sfc_main$r = /* @__PURE__ */ defineComponent({
6707
6693
  __name: "ModalConfirm",
6708
6694
  props: {
package/dist/style.css CHANGED
@@ -934,83 +934,83 @@ display: block;
934
934
  border-radius: var(--input-border-radius);
935
935
  }
936
936
 
937
- .blocker[data-v-f21373a1] {
938
- position: fixed;
939
- top: 0;
940
- left: 0;
941
- width: 100%;
942
- height: 100%;
943
- z-index: 100;
937
+ .blocker[data-v-1f9c6644] {
938
+ position: fixed;
939
+ top: 0;
940
+ left: 0;
941
+ width: 100%;
942
+ height: 100%;
943
+ z-index: 100;
944
944
  }
945
- .bgl-slider[data-v-f21373a1] {
946
- display: grid;
947
- position: relative;
948
- scroll-behavior: smooth;
949
- grid-auto-flow: column;
950
- grid-auto-columns: 100%;
951
- scroll-snap-type: x mandatory;
952
- overflow-x: hidden;
945
+ .bgl-slider[data-v-1f9c6644] {
946
+ display: grid;
947
+ position: relative;
948
+ scroll-behavior: smooth;
949
+ grid-auto-flow: column;
950
+ grid-auto-columns: 100%;
951
+ scroll-snap-type: x mandatory;
952
+ overflow-x: hidden;
953
953
  }
954
- .autoHeight[data-v-f21373a1] {
955
- transition: height ease 0.7s;
954
+ .autoHeight[data-v-1f9c6644] {
955
+ transition: height ease 0.7s;
956
956
  }
957
- .bgl-slider.allowScroll[data-v-f21373a1] {
958
- overflow-x: scroll;
957
+ .bgl-slider.allowScroll[data-v-1f9c6644] {
958
+ overflow-x: scroll;
959
959
  }
960
- .bgl-slider.slides-6[data-v-f21373a1] {
961
- grid-auto-columns: 15.9%;
962
- gap: 1%;
960
+ .bgl-slider.slides-6[data-v-1f9c6644] {
961
+ grid-auto-columns: 15.9%;
962
+ gap: 1%;
963
963
  }
964
- .bgl-slider.slides-5[data-v-f21373a1] {
965
- grid-auto-columns: 19.3%;
966
- gap: 1%;
964
+ .bgl-slider.slides-5[data-v-1f9c6644] {
965
+ grid-auto-columns: 19.3%;
966
+ gap: 1%;
967
967
  }
968
- .bgl-slider.slides-4[data-v-f21373a1] {
969
- grid-auto-columns: 25%;
970
- gap: 1%;
968
+ .bgl-slider.slides-4[data-v-1f9c6644] {
969
+ grid-auto-columns: 24.3%;
970
+ gap: 1%;
971
971
  }
972
- .bgl-slider.slides-3[data-v-f21373a1] {
973
- grid-auto-columns: 33%;
974
- gap: 1%;
972
+ .bgl-slider.slides-3[data-v-1f9c6644] {
973
+ grid-auto-columns: 33%;
974
+ gap: 1%;
975
975
  }
976
- .bgl-slider.slides-2[data-v-f21373a1] {
977
- grid-auto-columns: 50%;
978
- gap: 1%;
976
+ .bgl-slider.slides-2[data-v-1f9c6644] {
977
+ grid-auto-columns: 50%;
978
+ gap: 1%;
979
979
  }
980
- .bgl-slider.slides-1[data-v-f21373a1] {
981
- grid-auto-columns: 100%;
980
+ .bgl-slider.slides-1[data-v-1f9c6644] {
981
+ grid-auto-columns: 100%;
982
982
  }
983
- .bgl-slider[data-v-f21373a1]::-webkit-scrollbar {
984
- display: none;
983
+ .bgl-slider[data-v-1f9c6644]::-webkit-scrollbar {
984
+ display: none;
985
985
  }
986
- .bgl-slider[data-v-f21373a1] * {
987
- scroll-snap-align: center;
986
+ .bgl-slider[data-v-1f9c6644] * {
987
+ scroll-snap-align: start;
988
988
  }
989
- .dragging.bgl-slider[data-v-f21373a1] {
990
- cursor: grabbing;
991
- cursor: -webkit-grabbing;
992
- scroll-snap-type: unset;
989
+ .dragging.bgl-slider[data-v-1f9c6644] {
990
+ cursor: grabbing;
991
+ cursor: -webkit-grabbing;
992
+ scroll-snap-type: unset;
993
993
  }
994
- .clicking.bgl-slider[data-v-f21373a1] {
995
- scroll-behavior: unset;
994
+ .clicking.bgl-slider[data-v-1f9c6644] {
995
+ scroll-behavior: unset;
996
996
  }
997
- .dragging.bgl-slider[data-v-f21373a1] * {
998
- scroll-snap-align: unset;
999
- user-select: none;
997
+ .dragging.bgl-slider[data-v-1f9c6644] * {
998
+ scroll-snap-align: unset;
999
+ user-select: none;
1000
1000
  }
1001
1001
  @media screen and (max-width: 1280px) {
1002
- .bgl-slider.slides-4[data-v-f21373a1] {
1003
- grid-auto-columns: 33%;
1002
+ .bgl-slider.slides-4[data-v-1f9c6644] {
1003
+ grid-auto-columns: 33%;
1004
1004
  }
1005
1005
  }
1006
1006
  @media screen and (max-width: 991px) {
1007
- .bgl-slider.slides-4[data-v-f21373a1] {
1008
- grid-auto-columns: 50%;
1007
+ .bgl-slider.slides-4[data-v-1f9c6644] {
1008
+ grid-auto-columns: 50%;
1009
1009
  }
1010
1010
  }
1011
1011
  @media screen and (max-width: 600px) {
1012
- .bgl-slider.slides-4[data-v-f21373a1] {
1013
- grid-auto-columns: 100%;
1012
+ .bgl-slider.slides-4[data-v-1f9c6644] {
1013
+ grid-auto-columns: 100%;
1014
1014
  }
1015
1015
  }
1016
1016
  /* required styles */
@@ -1791,6 +1791,9 @@ svg.leaflet-image-layer.leaflet-interactive path {
1791
1791
  .dp__calendar_row>div:last-child {
1792
1792
  pointer-events: auto !important;
1793
1793
  }
1794
+ .dp__time_input {
1795
+ direction: ltr;
1796
+ }
1794
1797
 
1795
1798
  .bagel-input textarea[data-v-1cbaeab2] {
1796
1799
  font-family: monospace;
@@ -2952,7 +2955,8 @@ p {
2952
2955
  min-height: 100%;
2953
2956
  }
2954
2957
  .w-100,
2955
- .width-100 {
2958
+ .w-100p,
2959
+ .w100p .width-100 {
2956
2960
  width: 100%;
2957
2961
  }
2958
2962
  .w300,
@@ -3125,6 +3129,36 @@ p {
3125
3129
  .w1600 {
3126
3130
  max-width: 1600px;
3127
3131
  }
3132
+ .vw10 {
3133
+ width: 10vw;
3134
+ }
3135
+ .vw20 {
3136
+ width: 20vw;
3137
+ }
3138
+ .vw30 {
3139
+ width: 30vw;
3140
+ }
3141
+ .vw40 {
3142
+ width: 40vw;
3143
+ }
3144
+ .vw50 {
3145
+ width: 50vw;
3146
+ }
3147
+ .vw60 {
3148
+ width: 60vw;
3149
+ }
3150
+ .vw70 {
3151
+ width: 70vw;
3152
+ }
3153
+ .vw80 {
3154
+ width: 80vw;
3155
+ }
3156
+ .vw90 {
3157
+ width: 90vw;
3158
+ }
3159
+ .vw100 {
3160
+ width: 100vw;
3161
+ }
3128
3162
  .w-all,
3129
3163
  .wall {
3130
3164
  width: -webkit-fill-available;
@@ -4434,10 +4468,12 @@ p {
4434
4468
  }
4435
4469
 
4436
4470
  .m_w-100,
4437
- .m_width-100 {
4471
+ .m_w100p,
4472
+ .m_w100p .m_width-100 {
4438
4473
  width: 100% !important;
4439
4474
  }
4440
4475
 
4476
+
4441
4477
  .m_w300,
4442
4478
  .m_w350,
4443
4479
  .m_w400,
@@ -4565,6 +4601,47 @@ p {
4565
4601
  max-width: 850px;
4566
4602
  }
4567
4603
 
4604
+ .m_vw10 {
4605
+ width: 10vw;
4606
+ }
4607
+
4608
+ .m_vw20 {
4609
+ width: 20vw;
4610
+ }
4611
+
4612
+ .m_vw30 {
4613
+ width: 30vw;
4614
+ }
4615
+
4616
+ .m_vw40 {
4617
+ width: 40vw;
4618
+ }
4619
+
4620
+ .m_vw50 {
4621
+ width: 50vw;
4622
+ }
4623
+
4624
+ .m_vw60 {
4625
+ width: 60vw;
4626
+ }
4627
+
4628
+ .m_vw70 {
4629
+ width: 70vw;
4630
+ }
4631
+
4632
+ .m_vw80 {
4633
+ width: 80vw;
4634
+ }
4635
+
4636
+ .m_vw90 {
4637
+ width: 90vw;
4638
+ }
4639
+
4640
+ .m_vw100 {
4641
+ width: 100vw;
4642
+ }
4643
+
4644
+
4568
4645
  .m_w-all,
4569
4646
  .m_wall {
4570
4647
  width: -webkit-fill-available;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.522",
4
+ "version": "0.0.526",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -2,70 +2,78 @@
2
2
  import { onMounted, onUnmounted, watch } from 'vue'
3
3
 
4
4
  const props = defineProps({
5
- autoHeight: { type: Boolean, default: false },
6
- allowScroll: { type: Boolean, default: true },
7
- freeDrag: { type: Boolean, default: true },
8
- items: { type: Number, default: 4 },
9
- index: { type: Number, default: 0 },
10
- autoplay: { type: Boolean, default: false },
11
- autoplaySpeed: { type: Number, default: 3000 },
12
- loop: { type: Boolean, default: false },
5
+ autoHeight: {
6
+ type: Boolean,
7
+ default: false,
8
+ },
9
+ allowScroll: {
10
+ type: Boolean,
11
+ default: true,
12
+ },
13
+ freeDrag: {
14
+ type: Boolean,
15
+ default: true,
16
+ },
17
+ items: {
18
+ type: Number,
19
+ default: 4,
20
+ },
21
+ index: {
22
+ type: Number,
23
+ default: 0,
24
+ },
13
25
  })
14
-
15
26
  const emit = defineEmits(['update:index'])
16
-
17
- const bglSlider = $ref<HTMLElement | null>(null)
27
+ const bglSlider = $ref<HTMLElement>()
18
28
  let activeSlideIndex = $ref(0)
19
29
  let isDragging = $ref(false)
20
30
  let startX = $ref(0)
21
31
  let scrollLeft = $ref(0)
22
32
  let isPressed = $ref(false)
23
- let yHeight = $ref('auto')
24
- let autoplayInterval = $ref<ReturnType<typeof setInterval> | null>(null)
25
- let originalSlideCount = $ref(0)
26
33
 
27
34
  function disableDrag() {
28
- bglSlider?.querySelectorAll('img').forEach((e) => { e.setAttribute('draggable', 'false') })
35
+ bglSlider
36
+ ?.querySelectorAll('img')
37
+ .forEach((e) => { e.setAttribute('draggable', 'false') })
38
+
29
39
  for (const e of (bglSlider?.children as any[] | undefined) || []) {
30
40
  e.setAttribute('draggable', 'false')
31
- e.addEventListener('click', (el: any) => el.preventDefault())
41
+ e.addEventListener('click', (e: any) => e.preventDefault())
32
42
  }
33
43
  }
34
44
 
45
+ let yHeight = $ref('auto')
35
46
  function evalHeight() {
36
47
  if (!props.autoHeight || !bglSlider) return
37
- const height = Array.from(bglSlider.children[activeSlideIndex].children)
48
+ const slidChildren = bglSlider.children[activeSlideIndex].children
49
+ const height = Array.from(slidChildren)
38
50
  .map(el => el.clientHeight)
39
51
  .reduce((a, b) => a + b, 0)
52
+
40
53
  yHeight = `${height}px`
41
54
  }
42
55
 
43
- function goToSlide(index: number, behavior: ScrollBehavior = 'smooth') {
44
- if (!bglSlider) return
45
- if (props.loop) {
46
- if (index >= originalSlideCount) {
47
- index = index % originalSlideCount
48
- behavior = 'auto'
49
- } else if (index < 0) {
50
- index = originalSlideCount - (-index % originalSlideCount)
51
- behavior = 'auto'
52
- }
53
- }
54
-
56
+ function goToSlide(index: number) {
57
+ if (!bglSlider || index < 0 || index > bglSlider.children.length - 1) return
58
+ const slider = bglSlider
55
59
  const isRTL = getComputedStyle(bglSlider).direction === 'rtl'
56
- const scrollX = bglSlider.offsetWidth * index * (isRTL ? -1 : 1)
57
- bglSlider.scrollTo({ left: scrollX, behavior })
60
+ const scrollX = slider.offsetWidth * index * (isRTL ? -1 : 1)
61
+ slider.scrollTo({ left: scrollX, behavior: 'smooth' })
58
62
  activeSlideIndex = index
59
63
  evalHeight()
60
64
  }
61
65
 
62
- watch(() => props.index, (index) => { goToSlide(index) })
66
+ watch(() => props.index, goToSlide)
63
67
 
64
- watch(() => activeSlideIndex, (index) => { emit('update:index', index) })
68
+ watch(
69
+ () => activeSlideIndex,
70
+ (index) => { emit('update:index', index) }
71
+ )
65
72
 
66
73
  function scrollEnd() {
67
- if (props.items !== 1 || !bglSlider) return
68
- const nextSlide = Math.round(bglSlider.scrollLeft / bglSlider.offsetWidth)
74
+ const slider = bglSlider
75
+ if (!slider || props.items !== 1) return
76
+ const nextSlide = Math.round(slider.scrollLeft / slider.offsetWidth)
69
77
  goToSlide(nextSlide)
70
78
  }
71
79
 
@@ -74,10 +82,11 @@ function stopDragging(e: MouseEvent) {
74
82
  const slider = bglSlider
75
83
  if (!slider) return
76
84
  const isDragForward = startX > e.pageX + slider.offsetLeft
77
- activeSlideIndex = isDragForward
78
- ? Math.ceil(slider.scrollLeft / slider.offsetWidth)
79
- : Math.floor(slider.scrollLeft / slider.offsetWidth)
85
+ if (isDragForward)
86
+ activeSlideIndex = Math.ceil(slider.scrollLeft / slider.offsetWidth)
87
+ else activeSlideIndex = Math.floor(slider.scrollLeft / slider.offsetWidth)
80
88
  if (props.items === 1) goToSlide(activeSlideIndex)
89
+ startX = 0
81
90
  document.removeEventListener('mousemove', move)
82
91
  document.removeEventListener('mouseup', stopDragging)
83
92
  document.removeEventListener('dragend', stopDragging)
@@ -87,9 +96,11 @@ function stopDragging(e: MouseEvent) {
87
96
  function move(e: MouseEvent) {
88
97
  if (!bglSlider) return
89
98
  const x = e.pageX - bglSlider.offsetLeft
90
- if (Math.abs(x - startX) > 20) isDragging = true
99
+ const walk = x - startX
100
+ if (walk > 20 || walk < -20) isDragging = true
91
101
  if (!isDragging) return
92
- bglSlider.scrollLeft = scrollLeft - (x - startX)
102
+ const scroll = x - startX
103
+ bglSlider.scrollLeft = scrollLeft - scroll
93
104
  }
94
105
 
95
106
  function startDragging(e: MouseEvent) {
@@ -103,85 +114,57 @@ function startDragging(e: MouseEvent) {
103
114
  }
104
115
 
105
116
  function next() {
106
- if (bglSlider) {
107
- goToSlide(activeSlideIndex + 1)
108
- }
117
+ if (!bglSlider) return
118
+ const slideCount = bglSlider.children.length
119
+ const isLastSlide = activeSlideIndex >= slideCount - 1
120
+ if (isLastSlide) goToSlide(0)
121
+ else goToSlide(activeSlideIndex + 1)
109
122
  }
110
123
 
111
124
  function prev() {
112
- if (bglSlider) {
113
- goToSlide(activeSlideIndex - 1)
114
- }
125
+ if (!bglSlider) return
126
+ const slideCount = bglSlider.children.length
127
+ if (activeSlideIndex === 0) goToSlide(slideCount - 1)
128
+ else goToSlide(activeSlideIndex - 1)
115
129
  }
116
130
 
117
131
  function evalWidth() {
118
- if (bglSlider) goToSlide(activeSlideIndex)
119
- }
120
-
121
- function startAutoplay() {
122
- if (props.autoplay) {
123
- autoplayInterval = setInterval(next, props.autoplaySpeed)
124
- }
125
- }
126
-
127
- function stopAutoplay() {
128
- if (autoplayInterval) {
129
- clearInterval(autoplayInterval)
130
- autoplayInterval = null
131
- }
132
- }
133
-
134
- function cloneSlides() {
135
- if (!bglSlider || !props.loop) return
136
- const slides = Array.from(bglSlider.children)
137
- originalSlideCount = slides.length
138
- slides.forEach((slide) => {
139
- const clone = slide.cloneNode(true) as HTMLElement
140
- bglSlider.appendChild(clone)
141
- })
142
- slides.forEach((slide) => {
143
- const clone = slide.cloneNode(true) as HTMLElement
144
- bglSlider.insertBefore(clone, bglSlider.firstChild)
145
- })
132
+ if (!bglSlider) return
133
+ goToSlide(activeSlideIndex)
146
134
  }
147
135
 
148
136
  onMounted(() => {
149
- cloneSlides()
150
137
  window.addEventListener('resize', evalWidth)
151
138
  evalHeight()
152
139
  disableDrag()
153
- startAutoplay()
154
140
  })
155
141
 
156
- onUnmounted(() => {
157
- window.removeEventListener('resize', evalWidth)
158
- stopAutoplay()
159
- })
142
+ onUnmounted(() => { window.removeEventListener('resize', evalWidth) })
160
143
  </script>
161
144
 
162
145
  <template>
163
- <div class="BglCarousel" :style="{ height: yHeight }" :class="{ autoHeight: props.autoHeight }">
146
+ <div class="BglCarousel" :style="{ height: yHeight }" :class="{ autoHeight }">
164
147
  <div
165
148
  ref="bglSlider"
166
- class="bgl-slider" :class="[
167
- { dragging: isDragging, clicking: isPressed, [`slides-${props.items}`]: true, allowScroll: props.allowScroll },
168
- ]"
149
+ :class="{
150
+ dragging: isDragging,
151
+ clicking: isPressed,
152
+ [`slides-${items}`]: true,
153
+ allowScroll,
154
+ }"
155
+ class="bgl-slider"
169
156
  @scrollend="scrollEnd"
170
157
  @mousedown="startDragging"
171
- @mouseenter="stopAutoplay"
172
- @mouseleave="startAutoplay"
173
- @focusin="stopAutoplay"
174
- @focusout="startAutoplay"
175
158
  >
176
159
  <div v-if="isDragging" class="blocker" />
177
160
  <slot />
178
161
  </div>
179
162
  <div class="Handlers">
180
163
  <span @click="prev">
181
- <slot name="prev" :index="activeSlideIndex" :prev />
164
+ <slot :prev :index="activeSlideIndex" name="prev" />
182
165
  </span>
183
166
  <span @click="next">
184
- <slot name="next" :index="activeSlideIndex" :next />
167
+ <slot :next :index="activeSlideIndex" name="next" />
185
168
  </span>
186
169
  </div>
187
170
  </div>
@@ -189,99 +172,99 @@ onUnmounted(() => {
189
172
 
190
173
  <style scoped>
191
174
  .blocker {
192
- position: fixed;
193
- top: 0;
194
- left: 0;
195
- width: 100%;
196
- height: 100%;
197
- z-index: 100;
175
+ position: fixed;
176
+ top: 0;
177
+ left: 0;
178
+ width: 100%;
179
+ height: 100%;
180
+ z-index: 100;
198
181
  }
199
182
 
200
183
  .bgl-slider {
201
- display: grid;
202
- position: relative;
203
- scroll-behavior: smooth;
204
- grid-auto-flow: column;
205
- grid-auto-columns: 100%;
206
- scroll-snap-type: x mandatory;
207
- overflow-x: hidden;
184
+ display: grid;
185
+ position: relative;
186
+ scroll-behavior: smooth;
187
+ grid-auto-flow: column;
188
+ grid-auto-columns: 100%;
189
+ scroll-snap-type: x mandatory;
190
+ overflow-x: hidden;
208
191
  }
209
192
 
210
193
  .autoHeight {
211
- transition: height ease 0.7s;
194
+ transition: height ease 0.7s;
212
195
  }
213
196
 
214
197
  .bgl-slider.allowScroll {
215
- overflow-x: scroll;
198
+ overflow-x: scroll;
216
199
  }
217
200
 
218
201
  .bgl-slider.slides-6 {
219
- grid-auto-columns: 15.9%;
220
- gap: 1%;
202
+ grid-auto-columns: 15.9%;
203
+ gap: 1%;
221
204
  }
222
205
 
223
206
  .bgl-slider.slides-5 {
224
- grid-auto-columns: 19.3%;
225
- gap: 1%;
207
+ grid-auto-columns: 19.3%;
208
+ gap: 1%;
226
209
  }
227
210
 
228
211
  .bgl-slider.slides-4 {
229
- grid-auto-columns: 25%;
230
- gap: 1%;
231
- }
212
+ grid-auto-columns: 24.3%;
213
+ gap: 1%;
214
+ }
232
215
 
233
216
  .bgl-slider.slides-3 {
234
- grid-auto-columns: 33%;
235
- gap: 1%;
217
+ grid-auto-columns: 33%;
218
+ gap: 1%;
236
219
  }
237
220
 
238
221
  .bgl-slider.slides-2 {
239
- grid-auto-columns: 50%;
240
- gap: 1%;
222
+ grid-auto-columns: 50%;
223
+ gap: 1%;
241
224
  }
242
225
 
243
226
  .bgl-slider.slides-1 {
244
- grid-auto-columns: 100%;
227
+ grid-auto-columns: 100%;
245
228
  }
246
229
 
247
230
  .bgl-slider::-webkit-scrollbar {
248
- display: none;
231
+ display: none;
249
232
  }
250
233
 
251
234
  .bgl-slider * {
252
- scroll-snap-align: center;
235
+ scroll-snap-align: start;
253
236
  }
254
237
 
255
238
  .dragging.bgl-slider {
256
- cursor: grabbing;
257
- cursor: -webkit-grabbing;
258
- scroll-snap-type: unset;
239
+ cursor: grabbing;
240
+ cursor: -webkit-grabbing;
241
+ scroll-snap-type: unset;
259
242
  }
260
243
 
261
244
  .clicking.bgl-slider {
262
- scroll-behavior: unset;
245
+ scroll-behavior: unset;
263
246
  }
264
247
 
265
248
  .dragging.bgl-slider * {
266
- scroll-snap-align: unset;
267
- user-select: none;
249
+ scroll-snap-align: unset;
250
+ user-select: none;
268
251
  }
269
252
 
270
253
  @media screen and (max-width: 1280px) {
271
- .bgl-slider.slides-4 {
272
- grid-auto-columns: 33%;
273
- }
254
+ .bgl-slider.slides-4 {
255
+ grid-auto-columns: 33%;
256
+ }
274
257
  }
275
258
 
276
259
  @media screen and (max-width: 991px) {
277
- .bgl-slider.slides-4 {
278
- grid-auto-columns: 50%;
279
- }
260
+ .bgl-slider.slides-4 {
261
+ grid-auto-columns: 50%;
262
+ }
280
263
  }
281
264
 
282
265
  @media screen and (max-width: 600px) {
283
- .bgl-slider.slides-4 {
284
- grid-auto-columns: 100%;
285
- }
266
+ .bgl-slider.slides-4 {
267
+ grid-auto-columns: 100%;
268
+ }
286
269
  }
287
270
  </style>
@@ -81,4 +81,8 @@ onMounted(() => {
81
81
  .dp__calendar_row>div:last-child {
82
82
  pointer-events: auto !important;
83
83
  }
84
+
85
+ .dp__time_input {
86
+ direction: ltr;
87
+ }
84
88
  </style>
@@ -167,7 +167,8 @@
167
167
  }
168
168
 
169
169
  .w-100,
170
- .width-100 {
170
+ .w-100p,
171
+ .w100p .width-100 {
171
172
  width: 100%;
172
173
  }
173
174
 
@@ -387,6 +388,47 @@
387
388
  max-width: 1600px;
388
389
  }
389
390
 
391
+ .vw10 {
392
+ width: 10vw;
393
+ }
394
+
395
+ .vw20 {
396
+ width: 20vw;
397
+ }
398
+
399
+ .vw30 {
400
+ width: 30vw;
401
+ }
402
+
403
+ .vw40 {
404
+ width: 40vw;
405
+ }
406
+
407
+ .vw50 {
408
+ width: 50vw;
409
+ }
410
+
411
+ .vw60 {
412
+ width: 60vw;
413
+ }
414
+
415
+ .vw70 {
416
+ width: 70vw;
417
+ }
418
+
419
+ .vw80 {
420
+ width: 80vw;
421
+ }
422
+
423
+ .vw90 {
424
+ width: 90vw;
425
+ }
426
+
427
+ .vw100 {
428
+ width: 100vw;
429
+ }
430
+
431
+
390
432
  .w-all,
391
433
  .wall {
392
434
  width: -webkit-fill-available;
@@ -186,10 +186,12 @@
186
186
  }
187
187
 
188
188
  .m_w-100,
189
- .m_width-100 {
189
+ .m_w100p,
190
+ .m_w100p .m_width-100 {
190
191
  width: 100% !important;
191
192
  }
192
193
 
194
+
193
195
  .m_w300,
194
196
  .m_w350,
195
197
  .m_w400,
@@ -317,6 +319,47 @@
317
319
  max-width: 850px;
318
320
  }
319
321
 
322
+ .m_vw10 {
323
+ width: 10vw;
324
+ }
325
+
326
+ .m_vw20 {
327
+ width: 20vw;
328
+ }
329
+
330
+ .m_vw30 {
331
+ width: 30vw;
332
+ }
333
+
334
+ .m_vw40 {
335
+ width: 40vw;
336
+ }
337
+
338
+ .m_vw50 {
339
+ width: 50vw;
340
+ }
341
+
342
+ .m_vw60 {
343
+ width: 60vw;
344
+ }
345
+
346
+ .m_vw70 {
347
+ width: 70vw;
348
+ }
349
+
350
+ .m_vw80 {
351
+ width: 80vw;
352
+ }
353
+
354
+ .m_vw90 {
355
+ width: 90vw;
356
+ }
357
+
358
+ .m_vw100 {
359
+ width: 100vw;
360
+ }
361
+
362
+
320
363
  .m_w-all,
321
364
  .m_wall {
322
365
  width: -webkit-fill-available;