@bagelink/vue 0.0.1117 → 0.0.1121

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",
@@ -21113,6 +21127,7 @@ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
21113
21127
  flat: "",
21114
21128
  "aria-label": action.name,
21115
21129
  class: vue.normalizeClass([[action.class, { active: _ctx.selectedStyles.has(action.name) }], ""]),
21130
+ tabindex: "-1",
21116
21131
  onClick: ($event) => runAction(action.name)
21117
21132
  }, null, 8, ["icon", "aria-label", "class", "onClick"])), [
21118
21133
  [_directive_tooltip, action.label]
@@ -21126,7 +21141,7 @@ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
21126
21141
  };
21127
21142
  }
21128
21143
  });
21129
- const EditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-33dff8fa"]]);
21144
+ const EditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-bcd681b9"]]);
21130
21145
  function createCommandExecutor(state2, commands) {
21131
21146
  return {
21132
21147
  execute(command, value) {
@@ -31386,65 +31401,82 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
31386
31401
  props: {
31387
31402
  src: {},
31388
31403
  pathKey: {},
31389
- alt: { default: "" },
31404
+ alt: {},
31390
31405
  width: {},
31391
31406
  height: {},
31392
31407
  caption: {}
31393
31408
  },
31394
31409
  setup(__props) {
31410
+ const props2 = __props;
31395
31411
  let imageSrc = vue.ref(null);
31396
- const fileBaseUrl = vue.computed(() => "https://files.bagel.design".replace(/\/$/, ""));
31397
- function pathToUrl() {
31412
+ let loadingError = vue.ref(false);
31413
+ const fileBaseUrl = vue.computed(() => "https://files.bagel.design");
31414
+ function getImageUrl() {
31398
31415
  var _a2;
31399
- if ((_a2 = __props.pathKey) == null ? void 0 : _a2.startsWith("static/")) return `${void 0}/${__props.pathKey}`;
31400
- return `${fileBaseUrl.value}/${__props.pathKey}`;
31416
+ if (!props2.src && !props2.pathKey) return null;
31417
+ if (props2.src) return props2.src;
31418
+ if ((_a2 = props2.pathKey) == null ? void 0 : _a2.startsWith("static/")) {
31419
+ return `${void 0}/${props2.pathKey}`;
31420
+ }
31421
+ return `${fileBaseUrl.value}/${props2.pathKey}`;
31422
+ }
31423
+ async function getCachedImage(url) {
31424
+ if (!("caches" in window)) return null;
31425
+ try {
31426
+ const imgCache = await window.caches.open("img-cache");
31427
+ const cachedResponse = await imgCache.match(url);
31428
+ if (cachedResponse) {
31429
+ return URL.createObjectURL(await cachedResponse.blob());
31430
+ }
31431
+ } catch (error) {
31432
+ console.warn("Cache access error:", error);
31433
+ }
31434
+ return null;
31435
+ }
31436
+ async function cacheImage(url, blob) {
31437
+ if (!("caches" in window)) return;
31438
+ try {
31439
+ const imgCache = await window.caches.open("img-cache");
31440
+ await imgCache.put(url, new Response(blob));
31441
+ } catch (error) {
31442
+ console.warn("Cache write error:", error);
31443
+ }
31444
+ }
31445
+ async function convertHeicImage(url) {
31446
+ await appendScript("https://cdnjs.cloudflare.com/ajax/libs/heic2any/0.0.1/index.min.js");
31447
+ const response = await fetch(normalizeURL(url));
31448
+ const blob = await response.blob();
31449
+ const convertedBlob = await window.heic2any({ blob });
31450
+ await cacheImage(url, convertedBlob);
31451
+ return URL.createObjectURL(convertedBlob);
31401
31452
  }
31402
31453
  async function loadImage() {
31403
31454
  var _a2;
31404
- const url = __props.src || pathToUrl();
31405
- console.log(url);
31455
+ loadingError.value = false;
31456
+ const url = getImageUrl();
31406
31457
  if (!url) {
31407
31458
  imageSrc.value = null;
31408
31459
  return;
31409
31460
  }
31410
- const ext = (_a2 = url.split(".").pop()) == null ? void 0 : _a2.toLowerCase().split("?").shift();
31411
- if (ext === "heic") {
31412
- if (!("caches" in window)) {
31413
- console.warn("Caching is not available. Proceeding without cache.");
31414
- } else {
31415
- try {
31416
- const imgCache = await window.caches.open("img-cache");
31417
- const cachedResponse = await imgCache.match(url);
31418
- if (cachedResponse) {
31419
- imageSrc.value = URL.createObjectURL(await cachedResponse.blob());
31420
- return;
31421
- }
31422
- } catch (error) {
31423
- console.warn("Error accessing cache:", error);
31424
- }
31425
- }
31426
- try {
31427
- await appendScript("https://cdnjs.cloudflare.com/ajax/libs/heic2any/0.0.1/index.min.js");
31428
- const response = await fetch(normalizeURL(url));
31429
- const blob = await response.blob();
31430
- const convertedBlob = await window.heic2any({ blob });
31431
- imageSrc.value = URL.createObjectURL(convertedBlob);
31432
- if ("caches" in window) {
31433
- try {
31434
- const imgCache = await window.caches.open("img-cache");
31435
- imgCache.put(url, new Response(convertedBlob));
31436
- } catch (cacheError) {
31437
- console.warn("Failed to cache the image:", cacheError);
31438
- }
31461
+ try {
31462
+ const ext = (_a2 = url.split(".").pop()) == null ? void 0 : _a2.toLowerCase().split("?")[0];
31463
+ if (ext === "heic") {
31464
+ const cachedSrc = await getCachedImage(url);
31465
+ if (cachedSrc) {
31466
+ imageSrc.value = cachedSrc;
31467
+ return;
31439
31468
  }
31440
- } catch (error) {
31441
- console.error("Error converting HEIC file:", error);
31469
+ imageSrc.value = await convertHeicImage(url);
31470
+ } else {
31471
+ imageSrc.value = url;
31442
31472
  }
31443
- } else {
31444
- imageSrc.value = url;
31473
+ } catch (error) {
31474
+ console.error("Image loading error:", error);
31475
+ loadingError.value = true;
31476
+ imageSrc.value = null;
31445
31477
  }
31446
31478
  }
31447
- vue.watch(() => [__props.src, __props.pathKey], loadImage, { immediate: true });
31479
+ vue.watch(() => [props2.src, props2.pathKey], loadImage, { immediate: true });
31448
31480
  return (_ctx, _cache) => {
31449
31481
  return _ctx.caption ? (vue.openBlock(), vue.createElementBlock("figcaption", _hoisted_1$h, [
31450
31482
  vue.unref(imageSrc) ? (vue.openBlock(), vue.createElementBlock("img", vue.mergeProps({
@@ -31467,8 +31499,17 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
31467
31499
  alt: _ctx.alt,
31468
31500
  width: vue.unref(normalizeDimension)(_ctx.width),
31469
31501
  height: vue.unref(normalizeDimension)(_ctx.height)
31470
- }), null, 16, _hoisted_3$7)) : (vue.openBlock(), vue.createBlock(vue.unref(Skeleton), {
31502
+ }), null, 16, _hoisted_3$7)) : vue.unref(loadingError) ? (vue.openBlock(), vue.createElementBlock("div", {
31471
31503
  key: 2,
31504
+ class: "flex-center error-image",
31505
+ style: vue.normalizeStyle({
31506
+ width: vue.unref(normalizeDimension)(_ctx.width),
31507
+ height: vue.unref(normalizeDimension)(_ctx.height)
31508
+ })
31509
+ }, [
31510
+ vue.createVNode(vue.unref(_sfc_main$d), { name: "broken_image" })
31511
+ ], 4)) : (vue.openBlock(), vue.createBlock(vue.unref(Skeleton), {
31512
+ key: 3,
31472
31513
  class: "img-web-kit",
31473
31514
  width: vue.unref(normalizeDimension)(_ctx.width),
31474
31515
  height: vue.unref(normalizeDimension)(_ctx.height)
@@ -31476,7 +31517,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
31476
31517
  };
31477
31518
  }
31478
31519
  });
31479
- const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-1b7f9bb3"]]);
31520
+ const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-6f277b5b"]]);
31480
31521
  const _hoisted_1$g = { class: "m-0 pb-025 txt14 line-height-1 w60 menu-text" };
31481
31522
  const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
31482
31523
  __name: "BottomMenu",
@@ -32284,15 +32325,12 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
32284
32325
  "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => emit2("update:visible", $event))
32285
32326
  }, vue.createSlots({
32286
32327
  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,
32328
+ vue.createVNode(vue.unref(_sfc_main$U), {
32291
32329
  modelValue: formData.value,
32292
32330
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value = $event),
32293
32331
  schema: computedFormSchema.value,
32294
32332
  onSubmit: runSubmit
32295
- }, null, 8, ["modelValue", "schema"])) : vue.createCommentVNode("", true)
32333
+ }, null, 8, ["modelValue", "schema"])
32296
32334
  ]),
32297
32335
  _: 2
32298
32336
  }, [
@@ -32327,7 +32365,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
32327
32365
  };
32328
32366
  }
32329
32367
  });
32330
- const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-7361477b"]]);
32368
+ const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-f796c518"]]);
32331
32369
  const _hoisted_1$6 = { class: "full-nav" };
32332
32370
  const _hoisted_2$4 = { class: "nav-scroll" };
32333
32371
  const _hoisted_3$3 = { class: "nav-links-wrapper" };
@@ -32633,6 +32671,7 @@ function debounceFilter(ms, options = {}) {
32633
32671
  lastRejector();
32634
32672
  lastRejector = noop;
32635
32673
  };
32674
+ let lastInvoker;
32636
32675
  const filter3 = (invoke) => {
32637
32676
  const duration = vue.toValue(ms);
32638
32677
  const maxDuration = vue.toValue(options.maxWait);
@@ -32647,12 +32686,13 @@ function debounceFilter(ms, options = {}) {
32647
32686
  }
32648
32687
  return new Promise((resolve, reject3) => {
32649
32688
  lastRejector = options.rejectOnCancel ? reject3 : resolve;
32689
+ lastInvoker = invoke;
32650
32690
  if (maxDuration && !maxTimer) {
32651
32691
  maxTimer = setTimeout(() => {
32652
32692
  if (timer)
32653
32693
  _clearTimeout(timer);
32654
32694
  maxTimer = null;
32655
- resolve(invoke());
32695
+ resolve(lastInvoker());
32656
32696
  }, maxDuration);
32657
32697
  }
32658
32698
  timer = setTimeout(() => {
@@ -35535,12 +35575,12 @@ exports.AddressSearch = _sfc_main$16;
35535
35575
  exports.Alert = Alert;
35536
35576
  exports.Avatar = Avatar;
35537
35577
  exports.Badge = Badge;
35538
- exports.BagelForm = _sfc_main$S;
35578
+ exports.BagelForm = _sfc_main$R;
35579
+ exports.BagelForm2 = _sfc_main$U;
35539
35580
  exports.BagelVue = BagelVue;
35540
35581
  exports.BglComponent = _sfc_main$11;
35541
- exports.BglField = _sfc_main$T;
35542
- exports.BglForm = _sfc_main$S;
35543
- exports.BglMultiStepForm = _sfc_main$R;
35582
+ exports.BglField = _sfc_main$S;
35583
+ exports.BglForm = _sfc_main$R;
35544
35584
  exports.BglVideo = BglVideo;
35545
35585
  exports.BottomMenu = BottomMenu;
35546
35586
  exports.Btn = Btn;