@bagelink/vue 0.0.1117 → 0.0.1119

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.cjs CHANGED
@@ -61,7 +61,7 @@ const _sfc_main$18 = /* @__PURE__ */ vue.defineComponent({
61
61
  };
62
62
  }
63
63
  });
64
- const _hoisted_1$X = ["aria-expanded", "aria-controls"];
64
+ const _hoisted_1$W = ["aria-expanded", "aria-controls"];
65
65
  const _hoisted_2$D = { class: "accordion-label" };
66
66
  const _hoisted_3$t = ["id", "aria-hidden"];
67
67
  const _sfc_main$17 = /* @__PURE__ */ vue.defineComponent({
@@ -138,7 +138,7 @@ const _sfc_main$17 = /* @__PURE__ */ vue.defineComponent({
138
138
  }, [
139
139
  vue.createVNode(vue.unref(_sfc_main$d), { icon: computedIcon.value }, null, 8, ["icon"])
140
140
  ], 2)) : vue.createCommentVNode("", true)
141
- ], 8, _hoisted_1$X),
141
+ ], 8, _hoisted_1$W),
142
142
  vue.createVNode(vue.Transition, { name: "expand" }, {
143
143
  default: vue.withCtx(() => [
144
144
  vue.unref(isOpen) ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -164,7 +164,7 @@ const _export_sfc = (sfc, props2) => {
164
164
  return target;
165
165
  };
166
166
  const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["__scopeId", "data-v-1e73ca3e"]]);
167
- const _hoisted_1$W = { class: "relative" };
167
+ const _hoisted_1$V = { class: "relative" };
168
168
  const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
169
169
  __name: "AddressSearch",
170
170
  emits: ["addressSelected"],
@@ -187,7 +187,7 @@ const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
187
187
  (_a2 = suggestion.value) == null ? void 0 : _a2.show();
188
188
  }
189
189
  return (_ctx, _cache) => {
190
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$W, [
190
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$V, [
191
191
  vue.createVNode(vue.unref(_sfc_main$X), {
192
192
  ref_key: "suggestion",
193
193
  ref: suggestion,
@@ -223,7 +223,7 @@ const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
223
223
  };
224
224
  }
225
225
  });
226
- const _hoisted_1$V = {
226
+ const _hoisted_1$U = {
227
227
  key: 1,
228
228
  class: "bgl_btn-flex"
229
229
  };
@@ -293,7 +293,7 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
293
293
  key: 0,
294
294
  class: "h-100p",
295
295
  size: "15"
296
- })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$V, [
296
+ })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$U, [
297
297
  _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$d), {
298
298
  key: 0,
299
299
  icon: _ctx.icon
@@ -316,7 +316,7 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
316
316
  }
317
317
  });
318
318
  const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-3efa79fb"]]);
319
- const _hoisted_1$U = ["dismissable"];
319
+ const _hoisted_1$T = ["dismissable"];
320
320
  const _hoisted_2$C = { class: "m-0" };
321
321
  const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent({
322
322
  __name: "Alert",
@@ -354,12 +354,12 @@ const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent({
354
354
  icon: "close",
355
355
  onClick: _cache[0] || (_cache[0] = ($event) => isDismissed.value = true)
356
356
  })
357
- ], 10, _hoisted_1$U)) : vue.createCommentVNode("", true);
357
+ ], 10, _hoisted_1$T)) : vue.createCommentVNode("", true);
358
358
  };
359
359
  }
360
360
  });
361
361
  const Alert = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-57141c32"]]);
362
- const _hoisted_1$T = ["src", "alt"];
362
+ const _hoisted_1$S = ["src", "alt"];
363
363
  const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
364
364
  __name: "Avatar",
365
365
  props: {
@@ -378,7 +378,7 @@ const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
378
378
  key: 0,
379
379
  src: _ctx.src,
380
380
  alt: _ctx.name
381
- }, null, 8, _hoisted_1$T)) : (vue.openBlock(), vue.createElementBlock("p", {
381
+ }, null, 8, _hoisted_1$S)) : (vue.openBlock(), vue.createElementBlock("p", {
382
382
  key: 1,
383
383
  style: vue.normalizeStyle({ "line-height": `${_ctx.size}px`, "font-size": `calc(1.5rem * ${_ctx.size} / 50)` })
384
384
  }, vue.toDisplayString((_ctx.fallback || vue.unref(initials)(_ctx.name || "")).toUpperCase()), 5))
@@ -417,7 +417,7 @@ const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
417
417
  }
418
418
  });
419
419
  const Badge = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-2f3caf93"]]);
420
- const _hoisted_1$S = { key: 1 };
420
+ const _hoisted_1$R = { key: 1 };
421
421
  const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
422
422
  __name: "BglComponent",
423
423
  props: {
@@ -447,7 +447,7 @@ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
447
447
  if (props2.field.$el === "file") return FileUpload;
448
448
  if (props2.field.$el === "date") return _sfc_main$L;
449
449
  if (props2.field.$el === "tabs") return TabsNav;
450
- if (props2.field.$el === "form") return _sfc_main$S;
450
+ if (props2.field.$el === "form") return _sfc_main$R;
451
451
  return props2.field.$el ?? "div";
452
452
  });
453
453
  function getFieldData(path) {
@@ -564,7 +564,7 @@ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
564
564
  id: [props2.id, child.id].filter(Boolean).join("."),
565
565
  field: child,
566
566
  "parent-path": props2.id
567
- }, null, 8, ["id", "field", "parent-path"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$S, vue.toDisplayString(child), 1))
567
+ }, null, 8, ["id", "field", "parent-path"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$R, vue.toDisplayString(child), 1))
568
568
  ], 64);
569
569
  }), 128))
570
570
  ], 64))
@@ -574,7 +574,7 @@ const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
574
574
  };
575
575
  }
576
576
  });
577
- const _hoisted_1$R = ["src"];
577
+ const _hoisted_1$Q = ["src"];
578
578
  const _hoisted_2$B = ["autoplay", "muted", "loop", "controls", "playsinline"];
579
579
  const _hoisted_3$s = ["src", "type"];
580
580
  const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
@@ -654,7 +654,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
654
654
  allowfullscreen: "",
655
655
  title: "Video",
656
656
  allow: "autoplay"
657
- }, null, 12, _hoisted_1$R)) : _ctx.src ? (vue.openBlock(), vue.createElementBlock("video", {
657
+ }, null, 12, _hoisted_1$Q)) : _ctx.src ? (vue.openBlock(), vue.createElementBlock("video", {
658
658
  key: 1,
659
659
  ref_key: "video",
660
660
  ref: video,
@@ -675,7 +675,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
675
675
  }
676
676
  });
677
677
  const BglVideo = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-006552f6"]]);
678
- const _hoisted_1$Q = {
678
+ const _hoisted_1$P = {
679
679
  key: 0,
680
680
  class: "card_label"
681
681
  };
@@ -708,7 +708,7 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
708
708
  }])
709
709
  }, {
710
710
  default: vue.withCtx(() => [
711
- _ctx.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$Q, vue.toDisplayString(_ctx.label), 1)) : vue.createCommentVNode("", true),
711
+ _ctx.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$P, vue.toDisplayString(_ctx.label), 1)) : vue.createCommentVNode("", true),
712
712
  vue.renderSlot(_ctx.$slots, "default")
713
713
  ]),
714
714
  _: 3
@@ -718,7 +718,7 @@ const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
718
718
  };
719
719
  }
720
720
  });
721
- const _hoisted_1$P = ["dir"];
721
+ const _hoisted_1$O = ["dir"];
722
722
  const _hoisted_2$A = {
723
723
  key: 0,
724
724
  class: "blocker"
@@ -933,7 +933,7 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent({
933
933
  }, void 0, true)
934
934
  ])
935
935
  ])
936
- ], 14, _hoisted_1$P);
936
+ ], 14, _hoisted_1$O);
937
937
  };
938
938
  }
939
939
  });
@@ -6881,13 +6881,13 @@ var script = vue.defineComponent({
6881
6881
  return { bar, canvas, direction, mouse };
6882
6882
  }
6883
6883
  });
6884
- const _hoisted_1$O = {
6884
+ const _hoisted_1$N = {
6885
6885
  key: 0,
6886
6886
  class: "layer-hover-bar"
6887
6887
  };
6888
6888
  const _hoisted_2$z = ["x", "y", "width", "height"];
6889
6889
  function render(_ctx, _cache, $props, $setup, $data, $options) {
6890
- return _ctx.mouse.hover ? (vue.openBlock(), vue.createElementBlock("g", _hoisted_1$O, [
6890
+ return _ctx.mouse.hover ? (vue.openBlock(), vue.createElementBlock("g", _hoisted_1$N, [
6891
6891
  vue.createElementVNode("rect", vue.mergeProps({ class: "hover-bar" }, _ctx.barStyle, {
6892
6892
  x: _ctx.bar.x,
6893
6893
  y: _ctx.bar.y,
@@ -7039,7 +7039,7 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
7039
7039
  };
7040
7040
  }
7041
7041
  });
7042
- const _hoisted_1$N = {
7042
+ const _hoisted_1$M = {
7043
7043
  key: 0,
7044
7044
  class: "data"
7045
7045
  };
@@ -7096,7 +7096,7 @@ const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
7096
7096
  const computedSchema = vue.computed(() => getFallbackSchema([itemData.value], props2.showFields));
7097
7097
  return (_ctx, _cache) => {
7098
7098
  var _a2;
7099
- return __props.data ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$N, [
7099
+ return __props.data ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$M, [
7100
7100
  _ctx.title ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$4), {
7101
7101
  key: 0,
7102
7102
  label: _ctx.title
@@ -7109,7 +7109,7 @@ const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
7109
7109
  vue.createElementVNode("div", _hoisted_3$p, [
7110
7110
  vue.createElementVNode("p", _hoisted_4$h, vue.toDisplayString((field == null ? void 0 : field.label) || vue.unref(keyToLabel)(field.id)), 1)
7111
7111
  ]),
7112
- vue.createVNode(vue.unref(_sfc_main$T), {
7112
+ vue.createVNode(vue.unref(_sfc_main$S), {
7113
7113
  modelValue: itemData.value,
7114
7114
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => itemData.value = $event),
7115
7115
  label: "",
@@ -9763,7 +9763,7 @@ const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
9763
9763
  };
9764
9764
  }
9765
9765
  });
9766
- const _hoisted_1$M = { class: "px-1 pt-025 pb-1" };
9766
+ const _hoisted_1$L = { class: "px-1 pt-025 pb-1" };
9767
9767
  const _hoisted_2$x = { class: "ms-1" };
9768
9768
  const _sfc_main$W = /* @__PURE__ */ vue.defineComponent({
9769
9769
  __name: "FieldSetVue",
@@ -9773,7 +9773,7 @@ const _sfc_main$W = /* @__PURE__ */ vue.defineComponent({
9773
9773
  },
9774
9774
  setup(__props) {
9775
9775
  return (_ctx, _cache) => {
9776
- return vue.openBlock(), vue.createElementBlock("fieldset", _hoisted_1$M, [
9776
+ return vue.openBlock(), vue.createElementBlock("fieldset", _hoisted_1$L, [
9777
9777
  vue.createElementVNode("legend", _hoisted_2$x, vue.toDisplayString(_ctx.legend || _ctx.label), 1),
9778
9778
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
9779
9779
  ]);
@@ -9812,6 +9812,128 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
9812
9812
  }
9813
9813
  });
9814
9814
  const Flag = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-f99f1900"]]);
9815
+ const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
9816
+ __name: "BagelForm",
9817
+ props: {
9818
+ modelValue: { default: () => ({}) },
9819
+ schema: { default: void 0 }
9820
+ },
9821
+ emits: ["update:modelValue", "submit"],
9822
+ setup(__props, { expose: __expose, emit: __emit }) {
9823
+ const props2 = __props;
9824
+ const emit2 = __emit;
9825
+ const form = vue.ref();
9826
+ let formData = vue.ref({ ...props2.modelValue });
9827
+ let initialFormData = vue.ref({ ...props2.modelValue });
9828
+ vue.watch(() => props2.modelValue, (newValue) => {
9829
+ formData.value = { ...newValue };
9830
+ }, { immediate: true, deep: true });
9831
+ const resolvedSchema = vue.computed(() => {
9832
+ if (!props2.schema) return void 0;
9833
+ return typeof props2.schema === "function" ? props2.schema() : props2.schema;
9834
+ });
9835
+ const isDirty = vue.computed(() => {
9836
+ const current = JSON.stringify(formData.value);
9837
+ const initial = JSON.stringify(initialFormData.value);
9838
+ return current !== initial;
9839
+ });
9840
+ function getComponent(field) {
9841
+ var _a2;
9842
+ const componentMap = {
9843
+ text: TextInput,
9844
+ textarea: TextInput,
9845
+ number: NumberInput,
9846
+ array: _sfc_main$Q,
9847
+ select: SelectInput,
9848
+ toggle: ToggleInput,
9849
+ check: CheckInput,
9850
+ richtext: RichText,
9851
+ upload: UploadInput,
9852
+ file: FileUpload,
9853
+ date: _sfc_main$L,
9854
+ tabs: TabsNav,
9855
+ bglform: _sfc_main$R
9856
+ };
9857
+ if (field.$el === "textarea" && !((_a2 = field.attrs) == null ? void 0 : _a2.multiline)) {
9858
+ field.attrs = { ...field.attrs, multiline: true };
9859
+ }
9860
+ return componentMap[field.$el] ?? field.$el ?? "div";
9861
+ }
9862
+ function processFieldValue(fieldType, value) {
9863
+ if (value == null) return value;
9864
+ if (fieldType === "select" && typeof value === "object") return value.value;
9865
+ if (typeof value === "object" && "value" in value) return value.value;
9866
+ return value;
9867
+ }
9868
+ function updateFormData(fieldId, value, fieldType) {
9869
+ formData.value = {
9870
+ ...formData.value,
9871
+ [fieldId]: processFieldValue(fieldType, value)
9872
+ };
9873
+ emit2("update:modelValue", formData.value);
9874
+ }
9875
+ function handleSubmit() {
9876
+ emit2("submit", formData.value);
9877
+ initialFormData.value = { ...formData.value };
9878
+ }
9879
+ function renderSchemaField(field) {
9880
+ var _a2;
9881
+ const Component = getComponent(field);
9882
+ if (!Component) return null;
9883
+ const { $el, vIf, "v-if": vIf2, children: children2, ...fieldProps } = field;
9884
+ const currentValue = field.id ? formData.value[field.id] : void 0;
9885
+ const props22 = {
9886
+ ...fieldProps,
9887
+ "modelValue": processFieldValue(field.$el, currentValue),
9888
+ "onUpdate:modelValue": (value) => {
9889
+ var _a3;
9890
+ if (!field.id) return;
9891
+ updateFormData(field.id, value, field.$el);
9892
+ (_a3 = field.onUpdate) == null ? void 0 : _a3.call(field, value, formData.value);
9893
+ }
9894
+ };
9895
+ if (field.attrs) {
9896
+ Object.entries(field.attrs).forEach(([key, value]) => {
9897
+ props22[key] = typeof value === "function" ? value(field, formData.value) : value;
9898
+ });
9899
+ }
9900
+ if (field.class) {
9901
+ props22.class = typeof field.class === "function" ? field.class(field, formData.value) : field.class;
9902
+ }
9903
+ const slots = ((_a2 = field.children) == null ? void 0 : _a2.length) ? {
9904
+ default: () => field.children.map(
9905
+ (child) => typeof child === "string" ? child : renderSchemaField(child)
9906
+ )
9907
+ } : void 0;
9908
+ return vue.h(Component, props22, slots);
9909
+ }
9910
+ function shouldRenderField(field) {
9911
+ const condition = field.vIf ?? field["v-if"];
9912
+ if (condition === void 0) return true;
9913
+ return typeof condition === "function" ? condition(formData.value[field.id], formData.value) : !!condition;
9914
+ }
9915
+ __expose({ form: form.value, isDirty: isDirty.value });
9916
+ return (_ctx, _cache) => {
9917
+ return vue.openBlock(), vue.createElementBlock("form", {
9918
+ ref_key: "form",
9919
+ ref: form,
9920
+ onSubmit: vue.withModifiers(handleSubmit, ["prevent"])
9921
+ }, [
9922
+ resolvedSchema.value ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(resolvedSchema.value, (field, index2) => {
9923
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
9924
+ key: field.id || index2
9925
+ }, [
9926
+ shouldRenderField(field) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderSchemaField(field)), { key: 0 })) : vue.createCommentVNode("", true)
9927
+ ], 64);
9928
+ }), 128)) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }),
9929
+ vue.renderSlot(_ctx.$slots, "submit", {
9930
+ submit: handleSubmit,
9931
+ isDirty: isDirty.value
9932
+ })
9933
+ ], 544);
9934
+ };
9935
+ }
9936
+ });
9815
9937
  const state$1 = vue.reactive(/* @__PURE__ */ new Map());
9816
9938
  function useTabs(group) {
9817
9939
  if (!state$1.has(group)) {
@@ -9825,8 +9947,8 @@ function useTabs(group) {
9825
9947
  });
9826
9948
  return { currentTab };
9827
9949
  }
9828
- const _hoisted_1$L = ["onClick"];
9829
- const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
9950
+ const _hoisted_1$K = ["onClick"];
9951
+ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
9830
9952
  __name: "TabsNav",
9831
9953
  props: {
9832
9954
  title: {},
@@ -9908,14 +10030,14 @@ const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
9908
10030
  icon: tab.icon
9909
10031
  }, null, 8, ["icon"])) : vue.createCommentVNode("", true),
9910
10032
  vue.createTextVNode(" " + vue.toDisplayString(tabLabel(tab)), 1)
9911
- ], 10, _hoisted_1$L);
10033
+ ], 10, _hoisted_1$K);
9912
10034
  }), 128))
9913
10035
  ], true)
9914
10036
  ], 2);
9915
10037
  };
9916
10038
  }
9917
10039
  });
9918
- const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-307612a9"]]);
10040
+ const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-307612a9"]]);
9919
10041
  const FORM_STATE_KEY = Symbol("bagelFormState");
9920
10042
  function safeClone(obj) {
9921
10043
  if (obj === null || typeof obj !== "object") return obj;
@@ -9977,8 +10099,8 @@ function useBagelFormState() {
9977
10099
  if (!state2) throw new Error("BagelFormState must be provided");
9978
10100
  return state2;
9979
10101
  }
9980
- const _hoisted_1$K = { key: 1 };
9981
- const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
10102
+ const _hoisted_1$J = { key: 1 };
10103
+ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
9982
10104
  __name: "BglField",
9983
10105
  props: {
9984
10106
  field: {},
@@ -10008,7 +10130,7 @@ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
10008
10130
  if (props2.field.$el === "file") return FileUpload;
10009
10131
  if (props2.field.$el === "date") return _sfc_main$L;
10010
10132
  if (props2.field.$el === "tabs") return TabsNav;
10011
- if (props2.field.$el === "bglform") return _sfc_main$S;
10133
+ if (props2.field.$el === "bglform") return _sfc_main$R;
10012
10134
  return props2.field.$el ?? "div";
10013
10135
  });
10014
10136
  const fieldData = vue.computed({
@@ -10073,7 +10195,7 @@ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
10073
10195
  fieldID: [props2.fieldID, child.id].filter(Boolean).join("."),
10074
10196
  field: child,
10075
10197
  "parent-path": props2.fieldID
10076
- }, null, 8, ["fieldID", "field", "parent-path"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$K, vue.toDisplayString(child), 1))
10198
+ }, null, 8, ["fieldID", "field", "parent-path"])) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$J, vue.toDisplayString(child), 1))
10077
10199
  ], 64);
10078
10200
  }), 128))
10079
10201
  ]),
@@ -10082,7 +10204,7 @@ const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
10082
10204
  };
10083
10205
  }
10084
10206
  });
10085
- const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
10207
+ const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
10086
10208
  __name: "BglForm",
10087
10209
  props: {
10088
10210
  label: {},
@@ -10184,7 +10306,7 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
10184
10306
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
10185
10307
  _ctx.tag === "template" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
10186
10308
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, (field, i2) => {
10187
- return vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$T), {
10309
+ return vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$S), {
10188
10310
  key: field.id || `${i2}p`,
10189
10311
  fieldID: field.id,
10190
10312
  field
@@ -10207,7 +10329,7 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
10207
10329
  label: _ctx.label
10208
10330
  }, null, 8, ["label"])) : vue.createCommentVNode("", true),
10209
10331
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, (field, i2) => {
10210
- return vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$T), {
10332
+ return vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$S), {
10211
10333
  key: field.id || `${i2}p`,
10212
10334
  fieldID: field.id,
10213
10335
  field
@@ -10225,114 +10347,6 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
10225
10347
  };
10226
10348
  }
10227
10349
  });
10228
- const _hoisted_1$J = { key: 0 };
10229
- const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
10230
- __name: "BglMultiStepForm",
10231
- props: /* @__PURE__ */ vue.mergeModels({
10232
- bagelFormProps: { default: () => ({}) },
10233
- schema: {}
10234
- }, {
10235
- "modelValue": { default: () => {
10236
- }, required: true },
10237
- "modelModifiers": {}
10238
- }),
10239
- emits: /* @__PURE__ */ vue.mergeModels(["submit"], ["update:modelValue"]),
10240
- setup(__props, { expose: __expose, emit: __emit }) {
10241
- var _a2, _b, _c, _d;
10242
- const props2 = __props;
10243
- const emits = __emit;
10244
- const formRef = vue.ref();
10245
- const formData = vue.useModel(
10246
- __props,
10247
- "modelValue"
10248
- );
10249
- function reportValidity() {
10250
- if (!formRef.value) return false;
10251
- return formRef.value.validateForm();
10252
- }
10253
- const computedSchema = vue.computed(
10254
- () => useBglSchema({ schema: props2.schema })
10255
- );
10256
- const numberOfSteps = vue.ref(computedSchema.value.length);
10257
- let currentStep = vue.ref(0);
10258
- const currentStepSchema = vue.computed(() => computedSchema.value[currentStep.value]);
10259
- let isStepping = vue.ref(false);
10260
- let isSteppingTO;
10261
- vue.watch(
10262
- () => currentStep.value,
10263
- () => {
10264
- clearTimeout(isSteppingTO);
10265
- isStepping.value = true;
10266
- isSteppingTO = setTimeout(() => isStepping.value = false, 600);
10267
- }
10268
- );
10269
- const canDoNext = vue.computed(() => currentStep.value < numberOfSteps.value - 1);
10270
- function prevStep() {
10271
- if (currentStep.value > 0) currentStep.value--;
10272
- }
10273
- function nextStep() {
10274
- if (reportValidity() === false) return;
10275
- if (canDoNext.value) currentStep.value++;
10276
- }
10277
- function handleSubmit() {
10278
- if (reportValidity() === false) return;
10279
- emits("submit", formData.value);
10280
- }
10281
- __expose({
10282
- submit: handleSubmit,
10283
- validateForm: (_a2 = formRef.value) == null ? void 0 : _a2.validateForm,
10284
- deleteItem: (_b = formRef.value) == null ? void 0 : _b.deleteItem,
10285
- isDirty: (_c = formRef.value) == null ? void 0 : _c.isDirty,
10286
- clearForm: (_d = formRef.value) == null ? void 0 : _d.clearForm
10287
- });
10288
- return (_ctx, _cache) => {
10289
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
10290
- vue.createVNode(vue.Transition, {
10291
- duration: 600,
10292
- name: "fade",
10293
- mode: "out-in"
10294
- }, {
10295
- default: vue.withCtx(() => [
10296
- !vue.unref(isStepping) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$J, [
10297
- vue.createVNode(vue.unref(_sfc_main$S), vue.mergeProps({
10298
- ref_key: "formRef",
10299
- ref: formRef,
10300
- modelValue: formData.value,
10301
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value = $event),
10302
- schema: [currentStepSchema.value]
10303
- }, _ctx.bagelFormProps), {
10304
- success: vue.withCtx(() => [
10305
- vue.renderSlot(_ctx.$slots, "success")
10306
- ]),
10307
- error: vue.withCtx(() => [
10308
- vue.renderSlot(_ctx.$slots, "error")
10309
- ]),
10310
- _: 3
10311
- }, 16, ["modelValue", "schema"])
10312
- ])) : vue.createCommentVNode("", true)
10313
- ]),
10314
- _: 3
10315
- }),
10316
- vue.renderSlot(_ctx.$slots, "steppers", vue.normalizeProps(vue.guardReactiveProps({ prevStep, nextStep, submit: handleSubmit })), () => [
10317
- vue.createVNode(vue.unref(Btn), {
10318
- disabled: vue.unref(currentStep) === 0,
10319
- value: "Back",
10320
- onClick: prevStep
10321
- }, null, 8, ["disabled"]),
10322
- canDoNext.value ? (vue.openBlock(), vue.createBlock(vue.unref(Btn), {
10323
- key: 0,
10324
- value: "Next",
10325
- onClick: nextStep
10326
- })) : (vue.openBlock(), vue.createBlock(vue.unref(Btn), {
10327
- key: 1,
10328
- value: "Submit",
10329
- onClick: handleSubmit
10330
- }))
10331
- ])
10332
- ], 64);
10333
- };
10334
- }
10335
- });
10336
10350
  const _hoisted_1$I = { class: "label mb-05" };
10337
10351
  const _hoisted_2$w = {
10338
10352
  key: 0,
@@ -10404,7 +10418,7 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
10404
10418
  thin: "",
10405
10419
  class: "mb-05 itemBox transition p-05"
10406
10420
  }, [
10407
- vue.createVNode(vue.unref(_sfc_main$S), {
10421
+ vue.createVNode(vue.unref(_sfc_main$R), {
10408
10422
  modelValue: data2.value[i2],
10409
10423
  "onUpdate:modelValue": [($event) => data2.value[i2] = $event, emitValue],
10410
10424
  schema: _ctx.schema
@@ -10434,7 +10448,7 @@ const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
10434
10448
  _: 1
10435
10449
  })) : vue.createCommentVNode("", true)
10436
10450
  ])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(data2.value, (_2, i2) => {
10437
- return vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$T), {
10451
+ return vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$S), {
10438
10452
  key: i2,
10439
10453
  modelValue: data2.value[i2],
10440
10454
  "onUpdate:modelValue": [($event) => data2.value[i2] = $event, emitValue],
@@ -20286,7 +20300,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
20286
20300
  emits: ["update:modelValue"],
20287
20301
  setup(__props, { emit: __emit }) {
20288
20302
  const emit2 = __emit;
20289
- let numberValue = vue.ref(__props.modelValue || 0);
20303
+ let numberValue = vue.ref(Number.parseFloat(`${__props.modelValue}`) || 0);
20290
20304
  const btnLayouts = ["horizontal", "vertical"];
20291
20305
  const canAdd = vue.computed(() => !(__props.max !== void 0 && numberValue.value + __props.step > __props.max));
20292
20306
  const canDecrement = vue.computed(() => !(__props.min !== void 0 && numberValue.value - __props.step < __props.min));
@@ -20320,7 +20334,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
20320
20334
  }, { immediate: true });
20321
20335
  vue.watch(() => __props.modelValue, (newVal) => {
20322
20336
  if (newVal !== numberValue.value) {
20323
- numberValue.value = newVal || 0;
20337
+ numberValue.value = Number.parseFloat(`${newVal}`) || 0;
20324
20338
  }
20325
20339
  }, { immediate: true });
20326
20340
  return (_ctx, _cache) => {
@@ -20424,7 +20438,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
20424
20438
  };
20425
20439
  }
20426
20440
  });
20427
- const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-f265687e"]]);
20441
+ const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-4a70ce50"]]);
20428
20442
  const _hoisted_1$x = ["value", "autofocus", "onKeydown", "onPaste"];
20429
20443
  const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
20430
20444
  __name: "OTP",
@@ -32284,15 +32298,12 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
32284
32298
  "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => emit2("update:visible", $event))
32285
32299
  }, vue.createSlots({
32286
32300
  default: vue.withCtx(() => [
32287
- _ctx.visible ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$S), {
32288
- key: 0,
32289
- ref_key: "form",
32290
- ref: form,
32301
+ vue.createVNode(vue.unref(_sfc_main$U), {
32291
32302
  modelValue: formData.value,
32292
32303
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value = $event),
32293
32304
  schema: computedFormSchema.value,
32294
32305
  onSubmit: runSubmit
32295
- }, null, 8, ["modelValue", "schema"])) : vue.createCommentVNode("", true)
32306
+ }, null, 8, ["modelValue", "schema"])
32296
32307
  ]),
32297
32308
  _: 2
32298
32309
  }, [
@@ -32327,7 +32338,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
32327
32338
  };
32328
32339
  }
32329
32340
  });
32330
- const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-7361477b"]]);
32341
+ const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-f796c518"]]);
32331
32342
  const _hoisted_1$6 = { class: "full-nav" };
32332
32343
  const _hoisted_2$4 = { class: "nav-scroll" };
32333
32344
  const _hoisted_3$3 = { class: "nav-links-wrapper" };
@@ -35535,12 +35546,12 @@ exports.AddressSearch = _sfc_main$16;
35535
35546
  exports.Alert = Alert;
35536
35547
  exports.Avatar = Avatar;
35537
35548
  exports.Badge = Badge;
35538
- exports.BagelForm = _sfc_main$S;
35549
+ exports.BagelForm = _sfc_main$R;
35550
+ exports.BagelForm2 = _sfc_main$U;
35539
35551
  exports.BagelVue = BagelVue;
35540
35552
  exports.BglComponent = _sfc_main$11;
35541
- exports.BglField = _sfc_main$T;
35542
- exports.BglForm = _sfc_main$S;
35543
- exports.BglMultiStepForm = _sfc_main$R;
35553
+ exports.BglField = _sfc_main$S;
35554
+ exports.BglForm = _sfc_main$R;
35544
35555
  exports.BglVideo = BglVideo;
35545
35556
  exports.BottomMenu = BottomMenu;
35546
35557
  exports.Btn = Btn;