@bagelink/vue 1.2.18 → 1.2.20

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/index.mjs CHANGED
@@ -631,16 +631,15 @@ function closePopover(state2) {
631
631
  state2.showPopover.value = false;
632
632
  state2.activeEvent.value = null;
633
633
  }
634
- const _hoisted_1$W = { class: "day-view" };
635
- const _hoisted_2$H = { class: "day-header" };
636
- const _hoisted_3$B = { class: "events-column" };
637
- const _hoisted_4$o = { class: "date-header" };
638
- const _hoisted_5$n = { class: "time-column" };
639
- const _hoisted_6$k = { class: "events-column" };
640
- const _hoisted_7$g = ["onClick"];
641
- const _hoisted_8$8 = { class: "event-content" };
642
- const _hoisted_9$7 = { class: "event-title" };
643
- const _hoisted_10$6 = { class: "event-time" };
634
+ const _hoisted_1$W = { class: "w-100p overflow-hidden m_overflow h-100p grid" };
635
+ const _hoisted_2$H = { class: "border-bottom me-1 txt-center p-05 dayGrid" };
636
+ const _hoisted_3$B = { class: "overflow h-100p pe-05" };
637
+ const _hoisted_4$o = { class: "time-column" };
638
+ const _hoisted_5$n = { class: "events-column" };
639
+ const _hoisted_6$k = ["onClick"];
640
+ const _hoisted_7$g = { class: "event-content" };
641
+ const _hoisted_8$8 = { class: "white-space ellipsis-1" };
642
+ const _hoisted_9$7 = { class: "event-time opacity-8" };
644
643
  const slotHeight$1 = 60;
645
644
  const slotDuration$1 = 60;
646
645
  const _sfc_main$14 = /* @__PURE__ */ defineComponent({
@@ -782,62 +781,60 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
782
781
  const _directive_click_outside = resolveDirective("click-outside");
783
782
  return openBlock(), createElementBlock("div", _hoisted_1$W, [
784
783
  createElementVNode("div", _hoisted_2$H, [
785
- _cache[0] || (_cache[0] = createElementVNode("div", { class: "time-column" }, [
786
- createElementVNode("div", { class: "time-slot" })
787
- ], -1)),
788
- createElementVNode("div", _hoisted_3$B, [
789
- createElementVNode("div", _hoisted_4$o, toDisplayString(unref(formatDate)(_ctx.startDate)), 1)
790
- ])
784
+ _cache[0] || (_cache[0] = createElementVNode("div", null, null, -1)),
785
+ createElementVNode("div", null, toDisplayString(unref(formatDate)(_ctx.startDate)), 1)
791
786
  ]),
792
- createElementVNode("div", {
793
- class: "time-slots",
794
- onMousedown: handleMouseDown
795
- }, [
796
- createElementVNode("div", _hoisted_5$n, [
797
- (openBlock(true), createElementBlock(Fragment, null, renderList(timeSlots.value, (slot) => {
798
- return openBlock(), createElementBlock("div", {
799
- key: slot.time,
800
- class: "time-slot txt-light txt-12 color-gray",
801
- style: normalizeStyle({ height: `${slotHeight$1}px` })
802
- }, toDisplayString(slot.time), 5);
803
- }), 128))
804
- ]),
805
- createElementVNode("div", _hoisted_6$k, [
806
- isToday.value ? (openBlock(), createElementBlock("div", {
787
+ createElementVNode("div", _hoisted_3$B, [
788
+ createElementVNode("div", {
789
+ class: "time-slots dayGrid border-end relative",
790
+ onMousedown: handleMouseDown
791
+ }, [
792
+ createElementVNode("div", _hoisted_4$o, [
793
+ (openBlock(true), createElementBlock(Fragment, null, renderList(timeSlots.value, (slot) => {
794
+ return openBlock(), createElementBlock("div", {
795
+ key: slot.time,
796
+ class: "time-slot txt-light txt-12 color-gray bg-gray-light border-start",
797
+ style: normalizeStyle({ height: `${slotHeight$1}px` })
798
+ }, toDisplayString(slot.time), 5);
799
+ }), 128))
800
+ ]),
801
+ createElementVNode("div", _hoisted_5$n, [
802
+ isToday.value ? (openBlock(), createElementBlock("div", {
803
+ key: 0,
804
+ class: "absolute end w-100p z-2 flex pointer-events-none",
805
+ style: normalizeStyle({ top: `${currentTimeTop.value}px` })
806
+ }, _cache[1] || (_cache[1] = [
807
+ createElementVNode("div", { class: "current-time-dot h-10px aspect-ratio-1 round bg-primary" }, null, -1),
808
+ createElementVNode("div", { class: "current-time-line w-100p bg-primary" }, null, -1)
809
+ ]), 4)) : createCommentVNode("", true),
810
+ (openBlock(true), createElementBlock(Fragment, null, renderList(processedEvents.value, (event) => {
811
+ return openBlock(), createElementBlock("div", {
812
+ key: event.id,
813
+ class: "event absolute radius-05 overflow-hidden pointer transition z-1",
814
+ style: normalizeStyle({
815
+ top: `${event.top}px`,
816
+ height: `${event.height}px`,
817
+ backgroundColor: event.color || "var(--bgl-primary)"
818
+ }),
819
+ onClick: withModifiers(($event) => unref(slots).eventContent ? openPopover$1(event, $event) : emit2("eventClick", event), ["stop"])
820
+ }, [
821
+ createElementVNode("div", _hoisted_7$g, [
822
+ createElementVNode("div", _hoisted_8$8, toDisplayString(event.title), 1),
823
+ createElementVNode("div", _hoisted_9$7, toDisplayString(unref(formatDate)(new Date(event.start_time))), 1)
824
+ ])
825
+ ], 12, _hoisted_6$k);
826
+ }), 128))
827
+ ]),
828
+ dragState.value.isDragging && dragState.value.start && dragState.value.end ? (openBlock(), createElementBlock("div", {
807
829
  key: 0,
808
- class: "current-time-indicator",
809
- style: normalizeStyle({ top: `${currentTimeTop.value}px` })
810
- }, _cache[1] || (_cache[1] = [
811
- createElementVNode("div", { class: "current-time-dot" }, null, -1),
812
- createElementVNode("div", { class: "current-time-line" }, null, -1)
813
- ]), 4)) : createCommentVNode("", true),
814
- (openBlock(true), createElementBlock(Fragment, null, renderList(processedEvents.value, (event) => {
815
- return openBlock(), createElementBlock("div", {
816
- key: event.id,
817
- class: "event",
818
- style: normalizeStyle({
819
- top: `${event.top}px`,
820
- height: `${event.height}px`,
821
- backgroundColor: event.color || "var(--bgl-primary)"
822
- }),
823
- onClick: withModifiers(($event) => unref(slots).eventContent ? openPopover$1(event, $event) : emit2("eventClick", event), ["stop"])
824
- }, [
825
- createElementVNode("div", _hoisted_8$8, [
826
- createElementVNode("div", _hoisted_9$7, toDisplayString(event.title), 1),
827
- createElementVNode("div", _hoisted_10$6, toDisplayString(unref(formatDate)(new Date(event.start_time))), 1)
828
- ])
829
- ], 12, _hoisted_7$g);
830
- }), 128))
831
- ]),
832
- dragState.value.isDragging && dragState.value.start && dragState.value.end ? (openBlock(), createElementBlock("div", {
833
- key: 0,
834
- class: "drag-preview",
835
- style: normalizeStyle({
836
- top: `${Math.min(dragState.value.start.y, dragState.value.end.y)}px`,
837
- height: `${Math.abs(dragState.value.end.y - dragState.value.start.y)}px`
838
- })
839
- }, null, 4)) : createCommentVNode("", true)
840
- ], 32),
830
+ class: "drag-preview absolute bg-primary pointer-events-none",
831
+ style: normalizeStyle({
832
+ top: `${Math.min(dragState.value.start.y, dragState.value.end.y)}px`,
833
+ height: `${Math.abs(dragState.value.end.y - dragState.value.start.y)}px`
834
+ })
835
+ }, null, 4)) : createCommentVNode("", true)
836
+ ], 32)
837
+ ]),
841
838
  showPopover.value && activeEvent.value ? withDirectives((openBlock(), createElementBlock("div", {
842
839
  key: 0,
843
840
  ref_key: "popoverRef",
@@ -852,12 +849,13 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
852
849
  renderSlot(_ctx.$slots, "eventContent", { event: activeEvent.value }, void 0, true)
853
850
  ], 4)), [
854
851
  [_directive_click_outside, closePopover$1]
855
- ]) : createCommentVNode("", true)
852
+ ]) : createCommentVNode("", true),
853
+ _cache[2] || (_cache[2] = createElementVNode("div", { class: "border-bottom me-1" }, null, -1))
856
854
  ]);
857
855
  };
858
856
  }
859
857
  });
860
- const DayView = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-fdbceae7"]]);
858
+ const DayView = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-8aa8e541"]]);
861
859
  const _hoisted_1$V = { class: "month-view" };
862
860
  const _hoisted_2$G = { class: "month-header" };
863
861
  const _hoisted_3$A = { class: "month-grid" };
@@ -1229,7 +1227,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
1229
1227
  (openBlock(true), createElementBlock(Fragment, null, renderList(timeSlots.value, (slot) => {
1230
1228
  return openBlock(), createElementBlock("div", {
1231
1229
  key: slot.time,
1232
- class: "txt-light txt-12 color-gray flex justify-content-center",
1230
+ class: "txt-light txt-12 color-gray flex justify-content-center bg-gray-light border-start",
1233
1231
  style: normalizeStyle({ height: `${slotHeight}px` })
1234
1232
  }, toDisplayString(slot.time), 5);
1235
1233
  }), 128))
@@ -1304,7 +1302,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
1304
1302
  };
1305
1303
  }
1306
1304
  });
1307
- const WeekView = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-b31e0d33"]]);
1305
+ const WeekView = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-f774fc40"]]);
1308
1306
  const _hoisted_1$T = { class: "calendar" };
1309
1307
  const _hoisted_2$E = { class: "flex m_block m_pb-1" };
1310
1308
  const _hoisted_3$y = { class: "txt-light my-0" };
@@ -13527,8 +13525,49 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
13527
13525
  const computedSchema = computed(
13528
13526
  () => useBglSchema({ schema: props2.schema })
13529
13527
  );
13530
- const numberOfSteps = computed(() => computedSchema.value.length);
13531
- const currentStepSchema = computed(() => [computedSchema.value[currentStep.value]]);
13528
+ const filteredSchema = computed(() => {
13529
+ const schema = computedSchema.value;
13530
+ return schema.filter((step, index2) => {
13531
+ if (step.vIf !== void 0 || step["v-if"] !== void 0) {
13532
+ const condition = step.vIf ?? step["v-if"];
13533
+ if (typeof condition === "function") {
13534
+ return condition(void 0, formData.value);
13535
+ }
13536
+ if (typeof condition === "boolean") {
13537
+ return condition;
13538
+ }
13539
+ if (typeof condition === "string") {
13540
+ return !!condition;
13541
+ }
13542
+ }
13543
+ return true;
13544
+ });
13545
+ });
13546
+ const numberOfSteps = computed(() => filteredSchema.value.length);
13547
+ const schemaIndexMap = computed(() => {
13548
+ const map3 = [];
13549
+ computedSchema.value.forEach((step, index2) => {
13550
+ const vIfCondition = step.vIf ?? step["v-if"];
13551
+ let shouldInclude = true;
13552
+ if (vIfCondition !== void 0) {
13553
+ if (typeof vIfCondition === "function") {
13554
+ shouldInclude = vIfCondition(void 0, formData.value);
13555
+ } else if (typeof vIfCondition === "boolean") {
13556
+ shouldInclude = vIfCondition;
13557
+ } else if (typeof vIfCondition === "string") {
13558
+ shouldInclude = !!vIfCondition;
13559
+ }
13560
+ }
13561
+ if (shouldInclude) {
13562
+ map3.push(index2);
13563
+ }
13564
+ });
13565
+ return map3;
13566
+ });
13567
+ const currentStepSchema = computed(() => {
13568
+ const actualIndex = schemaIndexMap.value[currentStep.value];
13569
+ return [computedSchema.value[actualIndex]];
13570
+ });
13532
13571
  const isStepping = ref(false);
13533
13572
  let isSteppingTO;
13534
13573
  const slideDirection = ref(props2.rtl ? "right" : "left");
@@ -13584,6 +13623,11 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
13584
13623
  validatedSteps.value = [];
13585
13624
  currentStep.value = 0;
13586
13625
  }
13626
+ watch(() => formData.value, () => {
13627
+ if (currentStep.value >= numberOfSteps.value && numberOfSteps.value > 0) {
13628
+ currentStep.value = 0;
13629
+ }
13630
+ }, { deep: true });
13587
13631
  __expose({
13588
13632
  submit: handleSubmit,
13589
13633
  validateForm: reportValidity,
@@ -13698,7 +13742,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
13698
13742
  };
13699
13743
  }
13700
13744
  });
13701
- const BglMultiStepForm = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-f90b1af3"]]);
13745
+ const BglMultiStepForm = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-4ead8342"]]);
13702
13746
  const _hoisted_1$K = {
13703
13747
  key: 0,
13704
13748
  class: "label mb-05"
@@ -14693,17 +14737,15 @@ const _hoisted_8$5 = {
14693
14737
  key: 1,
14694
14738
  class: "month-grid grid gap-05 p-05"
14695
14739
  };
14696
- const _hoisted_9$4 = ["disabled", "onClick"];
14697
- const _hoisted_10$4 = {
14740
+ const _hoisted_9$4 = {
14698
14741
  key: 2,
14699
14742
  class: "year-grid grid gap-05 p-0"
14700
14743
  };
14701
- const _hoisted_11$4 = ["disabled", "onClick"];
14702
- const _hoisted_12$3 = {
14744
+ const _hoisted_10$4 = {
14703
14745
  key: 0,
14704
14746
  class: "time-picker border-start flex column gap-1 w-120px px-025"
14705
14747
  };
14706
- const _hoisted_13$2 = { class: "flex gap-025" };
14748
+ const _hoisted_11$4 = { class: "flex gap-025" };
14707
14749
  const _sfc_main$M = /* @__PURE__ */ defineComponent({
14708
14750
  __name: "DatePicker",
14709
14751
  props: {
@@ -14762,7 +14804,15 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
14762
14804
  const currentMonthDays2 = computed(() => {
14763
14805
  const year = currentMonth.value.getFullYear();
14764
14806
  const month = currentMonth.value.getMonth();
14765
- return time.getCalendarMonthSplitInWeeks(year, month).flat();
14807
+ const weeksInMonth = time.getCalendarMonthSplitInWeeks(year, month);
14808
+ while (weeksInMonth.length < 6) {
14809
+ const lastWeek = weeksInMonth[weeksInMonth.length - 1];
14810
+ const lastDay = lastWeek[lastWeek.length - 1];
14811
+ const nextDay = new Date(lastDay.getFullYear(), lastDay.getMonth(), lastDay.getDate() + 1);
14812
+ const nextWeek = time.getCalendarWeekDateObjects(nextDay);
14813
+ weeksInMonth.push(nextWeek);
14814
+ }
14815
+ return weeksInMonth.flat();
14766
14816
  });
14767
14817
  const currentMonthValue2 = computed(() => ({
14768
14818
  month: currentMonth.value.getMonth(),
@@ -14912,12 +14962,14 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
14912
14962
  currentView.value === "days" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
14913
14963
  createVNode(unref(Btn), {
14914
14964
  flat: "",
14965
+ thin: "",
14915
14966
  icon: "chevron_left",
14916
14967
  onClick: unref(previousMonth)
14917
14968
  }, null, 8, ["onClick"]),
14918
14969
  createElementVNode("div", _hoisted_4$f, [
14919
14970
  createVNode(unref(Btn), {
14920
14971
  flat: "",
14972
+ thin: "",
14921
14973
  class: "month-btn",
14922
14974
  onClick: _cache[0] || (_cache[0] = ($event) => currentView.value = "months")
14923
14975
  }, {
@@ -14928,6 +14980,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
14928
14980
  }),
14929
14981
  createVNode(unref(Btn), {
14930
14982
  flat: "",
14983
+ thin: "",
14931
14984
  class: "year-btn",
14932
14985
  onClick: _cache[1] || (_cache[1] = ($event) => currentView.value = "years")
14933
14986
  }, {
@@ -14939,18 +14992,21 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
14939
14992
  ]),
14940
14993
  createVNode(unref(Btn), {
14941
14994
  flat: "",
14995
+ thin: "",
14942
14996
  icon: "chevron_right",
14943
14997
  onClick: unref(nextMonth)
14944
14998
  }, null, 8, ["onClick"])
14945
14999
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
14946
15000
  createVNode(unref(Btn), {
14947
15001
  flat: "",
15002
+ thin: "",
14948
15003
  icon: "chevron_left",
14949
15004
  onClick: unref(previousYear)
14950
15005
  }, null, 8, ["onClick"]),
14951
15006
  createElementVNode("span", _hoisted_5$f, toDisplayString(unref(currentMonthValue).formatted.year), 1),
14952
15007
  createVNode(unref(Btn), {
14953
15008
  flat: "",
15009
+ thin: "",
14954
15010
  icon: "chevron_right",
14955
15011
  onClick: unref(nextYear)
14956
15012
  }, null, 8, ["onClick"])
@@ -14979,32 +15035,30 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
14979
15035
  }), 128))
14980
15036
  ])) : currentView.value === "months" ? (openBlock(), createElementBlock("div", _hoisted_8$5, [
14981
15037
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(months), (month) => {
14982
- return openBlock(), createElementBlock("button", {
15038
+ return openBlock(), createBlock(unref(Btn), {
14983
15039
  key: month.value,
14984
- class: normalizeClass(["month-item flex align-items-center justify-content-center pointer rounded p-05 txt14 border-none", {
14985
- selected: month.value === unref(currentMonthValue).month,
14986
- disabled: month.disabled
14987
- }]),
15040
+ thin: "",
15041
+ flat: month.value !== unref(currentMonthValue).month,
14988
15042
  disabled: month.disabled,
15043
+ value: month.name,
14989
15044
  onClick: ($event) => unref(selectMonth)(month.value)
14990
- }, toDisplayString(month.name), 11, _hoisted_9$4);
15045
+ }, null, 8, ["flat", "disabled", "value", "onClick"]);
14991
15046
  }), 128))
14992
- ])) : (openBlock(), createElementBlock("div", _hoisted_10$4, [
15047
+ ])) : (openBlock(), createElementBlock("div", _hoisted_9$4, [
14993
15048
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(years), (year) => {
14994
- return openBlock(), createElementBlock("button", {
15049
+ return openBlock(), createBlock(unref(Btn), {
14995
15050
  key: year.value,
14996
- class: normalizeClass(["year-item flex align-items-center justify-content-center pointer rounded p-05 txt14 border-none", {
14997
- selected: year.value === unref(currentMonthValue).year,
14998
- disabled: year.disabled
14999
- }]),
15051
+ thin: "",
15052
+ flat: year.value !== unref(currentMonthValue).year,
15000
15053
  disabled: year.disabled,
15054
+ value: year.value.toString(),
15001
15055
  onClick: ($event) => unref(selectYear)(year.value)
15002
- }, toDisplayString(year.value), 11, _hoisted_11$4);
15056
+ }, null, 8, ["flat", "disabled", "value", "onClick"]);
15003
15057
  }), 128))
15004
15058
  ]))
15005
15059
  ]),
15006
- _ctx.enableTime && currentView.value === "days" ? (openBlock(), createElementBlock("div", _hoisted_12$3, [
15007
- createElementVNode("div", _hoisted_13$2, [
15060
+ _ctx.enableTime && currentView.value === "days" ? (openBlock(), createElementBlock("div", _hoisted_10$4, [
15061
+ createElementVNode("div", _hoisted_11$4, [
15008
15062
  createVNode(unref(NumberInput), {
15009
15063
  center: "",
15010
15064
  modelValue: unref(hours),
@@ -15032,7 +15086,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
15032
15086
  };
15033
15087
  }
15034
15088
  });
15035
- const DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-d1e1ff1f"]]);
15089
+ const DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-9c8816c6"]]);
15036
15090
  const _hoisted_1$E = ["title"];
15037
15091
  const _hoisted_2$s = { key: 0 };
15038
15092
  const _hoisted_3$o = {