@bagelink/vue 0.0.1258 → 0.0.1260

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AAqzBA,iBAAS,IAAI,SAIZ;AAED,iBAAS,IAAI,SAIZ;AA4ZD,iBAAS,cAAc;WAyFT,OAAO,IAA6B;;yBAbrB,GAAG;;;;YACN,GAAG;;;;YACH,GAAG;;;;;;EAgB5B;AAmCD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmBnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAEpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"Carousel.vue.d.ts","sourceRoot":"","sources":["../../src/components/Carousel.vue"],"names":[],"mappings":"AAozBA,iBAAS,IAAI,SAIZ;AAED,iBAAS,IAAI,SAIZ;AA4ZD,iBAAS,cAAc;WAyFT,OAAO,IAA6B;;yBAbrB,GAAG;;;;YACN,GAAG;;;;YACH,GAAG;;;;;;EAgB5B;AAmCD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmBnB,CA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AG,IAAI;OA6O7B,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA1PzE,wBA0P4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
package/dist/index.cjs CHANGED
@@ -4438,7 +4438,7 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent({
4438
4438
  vue.createElementVNode("div", {
4439
4439
  ref_key: "bglSlider",
4440
4440
  ref: bglSlider,
4441
- class: vue.normalizeClass(["bgl-slider", { dragging: vue.unref(isDragging), clicking: vue.unref(isPressed), [`slides-${vue.unref(itemCount)}`]: true }]),
4441
+ class: vue.normalizeClass(["bgl-slider", { dragging: vue.unref(isDragging), clicking: vue.unref(isPressed), [`slides-${vue.unref(itemCount)}`]: true, grab: __props.freeDrag && vue.unref(slideCount) > 1 }]),
4442
4442
  style: vue.normalizeStyle({ "--item-count": vue.unref(itemCount) }),
4443
4443
  onMousedown: startDrag,
4444
4444
  onMouseover: clearAutoplay,
@@ -4477,7 +4477,7 @@ const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent({
4477
4477
  };
4478
4478
  }
4479
4479
  });
4480
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-d0b0c027"]]);
4480
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-31632a3b"]]);
4481
4481
  function _isPlaceholder(a2) {
4482
4482
  return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
4483
4483
  }
@@ -14997,8 +14997,9 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
14997
14997
  await ((_a2 = props2.onSubmit) == null ? void 0 : _a2.call(props2, formData.value));
14998
14998
  initialFormData.value = safeClone2(formData.value);
14999
14999
  formState.value = "success";
15000
- window.parent.postMessage({ type: "BAGEL_FORM_SUCCESS", data: formData.value }, "*");
15000
+ window.parent.postMessage({ type: "BAGEL_FORM_SUCCESS", data: JSON.stringify(formData.value) }, "*");
15001
15001
  } catch (error) {
15002
+ console.error("Form submission error:", error);
15002
15003
  formState.value = "error";
15003
15004
  }
15004
15005
  }
@@ -15027,30 +15028,34 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
15027
15028
  }
15028
15029
  __expose({ form, isDirty: isDirty.value, validateForm });
15029
15030
  return (_ctx, _cache) => {
15030
- return props2.tag === "form" ? (vue.openBlock(), vue.createElementBlock("form", {
15031
- key: 0,
15032
- ref_key: "form",
15033
- ref: form,
15034
- onSubmit: vue.withModifiers(handleSubmit, ["prevent"])
15035
- }, [
15036
- resolvedSchema.value ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(resolvedSchema.value, (field) => {
15037
- return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderSchemaField(field)), {
15038
- key: field.id
15039
- });
15040
- }), 128)) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }),
15041
- vue.renderSlot(_ctx.$slots, "submit", {
15042
- submit: handleSubmit,
15043
- isDirty: isDirty.value,
15044
- validateForm,
15045
- formState: formState.value
15046
- }),
15047
- formState.value === "success" ? vue.renderSlot(_ctx.$slots, "success", { key: 2 }) : vue.createCommentVNode("", true),
15048
- formState.value === "error" ? vue.renderSlot(_ctx.$slots, "error", { key: 3 }) : vue.createCommentVNode("", true)
15049
- ], 544)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(resolvedSchema.value, (field) => {
15050
- return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderSchemaField(field)), {
15051
- key: field.id
15052
- });
15053
- }), 128));
15031
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
15032
+ formState.value !== "success" || !_ctx.$slots.success ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
15033
+ props2.tag === "form" ? (vue.openBlock(), vue.createElementBlock("form", {
15034
+ key: 0,
15035
+ ref_key: "form",
15036
+ ref: form,
15037
+ onSubmit: vue.withModifiers(handleSubmit, ["prevent"])
15038
+ }, [
15039
+ resolvedSchema.value ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(resolvedSchema.value, (field) => {
15040
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderSchemaField(field)), {
15041
+ key: field.id
15042
+ });
15043
+ }), 128)) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }),
15044
+ vue.renderSlot(_ctx.$slots, "submit", {
15045
+ submit: handleSubmit,
15046
+ isDirty: isDirty.value,
15047
+ validateForm,
15048
+ formState: formState.value
15049
+ })
15050
+ ], 544)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(resolvedSchema.value, (field) => {
15051
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderSchemaField(field)), {
15052
+ key: field.id
15053
+ });
15054
+ }), 128))
15055
+ ], 64)) : vue.createCommentVNode("", true),
15056
+ formState.value === "success" ? vue.renderSlot(_ctx.$slots, "success", { key: 1 }) : vue.createCommentVNode("", true),
15057
+ formState.value === "error" ? vue.renderSlot(_ctx.$slots, "error", { key: 2 }) : vue.createCommentVNode("", true)
15058
+ ], 64);
15054
15059
  };
15055
15060
  }
15056
15061
  });
package/dist/index.mjs CHANGED
@@ -4436,7 +4436,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
4436
4436
  createElementVNode("div", {
4437
4437
  ref_key: "bglSlider",
4438
4438
  ref: bglSlider,
4439
- class: normalizeClass(["bgl-slider", { dragging: unref(isDragging), clicking: unref(isPressed), [`slides-${unref(itemCount)}`]: true }]),
4439
+ class: normalizeClass(["bgl-slider", { dragging: unref(isDragging), clicking: unref(isPressed), [`slides-${unref(itemCount)}`]: true, grab: __props.freeDrag && unref(slideCount) > 1 }]),
4440
4440
  style: normalizeStyle({ "--item-count": unref(itemCount) }),
4441
4441
  onMousedown: startDrag,
4442
4442
  onMouseover: clearAutoplay,
@@ -4475,7 +4475,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
4475
4475
  };
4476
4476
  }
4477
4477
  });
4478
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-d0b0c027"]]);
4478
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-31632a3b"]]);
4479
4479
  function _isPlaceholder(a2) {
4480
4480
  return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
4481
4481
  }
@@ -14995,8 +14995,9 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
14995
14995
  await ((_a2 = props2.onSubmit) == null ? void 0 : _a2.call(props2, formData.value));
14996
14996
  initialFormData.value = safeClone2(formData.value);
14997
14997
  formState.value = "success";
14998
- window.parent.postMessage({ type: "BAGEL_FORM_SUCCESS", data: formData.value }, "*");
14998
+ window.parent.postMessage({ type: "BAGEL_FORM_SUCCESS", data: JSON.stringify(formData.value) }, "*");
14999
14999
  } catch (error) {
15000
+ console.error("Form submission error:", error);
15000
15001
  formState.value = "error";
15001
15002
  }
15002
15003
  }
@@ -15025,30 +15026,34 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
15025
15026
  }
15026
15027
  __expose({ form, isDirty: isDirty.value, validateForm });
15027
15028
  return (_ctx, _cache) => {
15028
- return props2.tag === "form" ? (openBlock(), createElementBlock("form", {
15029
- key: 0,
15030
- ref_key: "form",
15031
- ref: form,
15032
- onSubmit: withModifiers(handleSubmit, ["prevent"])
15033
- }, [
15034
- resolvedSchema.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(resolvedSchema.value, (field) => {
15035
- return openBlock(), createBlock(resolveDynamicComponent(renderSchemaField(field)), {
15036
- key: field.id
15037
- });
15038
- }), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 }),
15039
- renderSlot(_ctx.$slots, "submit", {
15040
- submit: handleSubmit,
15041
- isDirty: isDirty.value,
15042
- validateForm,
15043
- formState: formState.value
15044
- }),
15045
- formState.value === "success" ? renderSlot(_ctx.$slots, "success", { key: 2 }) : createCommentVNode("", true),
15046
- formState.value === "error" ? renderSlot(_ctx.$slots, "error", { key: 3 }) : createCommentVNode("", true)
15047
- ], 544)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(resolvedSchema.value, (field) => {
15048
- return openBlock(), createBlock(resolveDynamicComponent(renderSchemaField(field)), {
15049
- key: field.id
15050
- });
15051
- }), 128));
15029
+ return openBlock(), createElementBlock(Fragment, null, [
15030
+ formState.value !== "success" || !_ctx.$slots.success ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
15031
+ props2.tag === "form" ? (openBlock(), createElementBlock("form", {
15032
+ key: 0,
15033
+ ref_key: "form",
15034
+ ref: form,
15035
+ onSubmit: withModifiers(handleSubmit, ["prevent"])
15036
+ }, [
15037
+ resolvedSchema.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(resolvedSchema.value, (field) => {
15038
+ return openBlock(), createBlock(resolveDynamicComponent(renderSchemaField(field)), {
15039
+ key: field.id
15040
+ });
15041
+ }), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 }),
15042
+ renderSlot(_ctx.$slots, "submit", {
15043
+ submit: handleSubmit,
15044
+ isDirty: isDirty.value,
15045
+ validateForm,
15046
+ formState: formState.value
15047
+ })
15048
+ ], 544)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(resolvedSchema.value, (field) => {
15049
+ return openBlock(), createBlock(resolveDynamicComponent(renderSchemaField(field)), {
15050
+ key: field.id
15051
+ });
15052
+ }), 128))
15053
+ ], 64)) : createCommentVNode("", true),
15054
+ formState.value === "success" ? renderSlot(_ctx.$slots, "success", { key: 1 }) : createCommentVNode("", true),
15055
+ formState.value === "error" ? renderSlot(_ctx.$slots, "error", { key: 2 }) : createCommentVNode("", true)
15056
+ ], 64);
15052
15057
  };
15053
15058
  }
15054
15059
  });
package/dist/style.css CHANGED
@@ -899,13 +899,13 @@ display: block;
899
899
  padding: 0;
900
900
  }
901
901
 
902
- .BglCarousel[data-v-d0b0c027] {
902
+ .BglCarousel[data-v-31632a3b] {
903
903
  position: relative;
904
904
  width: 100%;
905
905
  overflow: hidden;
906
906
  touch-action: pan-y pinch-zoom; /* Allow vertical scrolling */
907
907
  }
908
- .bgl-slider[data-v-d0b0c027] {
908
+ .bgl-slider[data-v-31632a3b] {
909
909
  display: flex;
910
910
  position: relative;
911
911
  width: 100%;
@@ -913,31 +913,30 @@ display: block;
913
913
  will-change: transform;
914
914
  transform: translateX(0);
915
915
  gap: 1%;
916
- cursor: grab;
917
916
  transition: none;
918
917
  -webkit-user-select: none;
919
918
  user-select: none;
920
919
  }
921
- .bgl-slider[data-v-d0b0c027] > * {
920
+ .bgl-slider[data-v-31632a3b] > * {
922
921
  flex: 0 0 calc((100% - (var(--item-count) - 1) * 1%) / var(--item-count));
923
922
  width: calc((100% - (var(--item-count) - 1) * 1%) / var(--item-count));
924
923
  min-width: calc((100% - (var(--item-count) - 1) * 1%) / var(--item-count));
925
924
  position: relative;
926
925
  overflow: hidden;
927
926
  }
928
- .bgl-slider.slides-1[data-v-d0b0c027] > * {
927
+ .bgl-slider.slides-1[data-v-31632a3b] > * {
929
928
  flex: 0 0 100%;
930
929
  width: 100%;
931
930
  min-width: 100%;
932
931
  }
933
- .dragging .bgl-slider[data-v-d0b0c027] > * {
932
+ .dragging .bgl-slider[data-v-31632a3b] > * {
934
933
  pointer-events: none;
935
934
  user-select: none;
936
935
  }
937
- .autoHeight[data-v-d0b0c027] {
936
+ .autoHeight[data-v-31632a3b] {
938
937
  transition: height ease 0.7s;
939
938
  }
940
- .dots[data-v-d0b0c027] {
939
+ .dots[data-v-31632a3b] {
941
940
  display: flex;
942
941
  justify-content: center;
943
942
  align-items: center;
@@ -945,7 +944,7 @@ display: block;
945
944
  margin-top: 1rem;
946
945
  gap: 8px;
947
946
  }
948
- .dot[data-v-d0b0c027] {
947
+ .dot[data-v-31632a3b] {
949
948
  height: 10px;
950
949
  width: 10px;
951
950
  border-radius: 50%;
@@ -954,10 +953,10 @@ display: block;
954
953
  transition: opacity 0.3s ease;
955
954
  cursor: pointer;
956
955
  }
957
- .dot[data-v-d0b0c027]:hover {
956
+ .dot[data-v-31632a3b]:hover {
958
957
  opacity: 0.6;
959
958
  }
960
- .dot.current[data-v-d0b0c027] {
959
+ .dot.current[data-v-31632a3b] {
961
960
  opacity: 0.8;
962
961
  }
963
962
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.1258",
4
+ "version": "0.0.1260",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -571,7 +571,7 @@ watch(() => activeSlideIndex, handleSlideChange)
571
571
  <div
572
572
  ref="bglSlider"
573
573
  class="bgl-slider"
574
- :class="{ dragging: isDragging, clicking: isPressed, [`slides-${itemCount}`]: true }"
574
+ :class="{ dragging: isDragging, clicking: isPressed, [`slides-${itemCount}`]: true, grab: freeDrag && slideCount > 1 }"
575
575
  :style="{ '--item-count': itemCount }"
576
576
  @mousedown="startDrag"
577
577
  @mouseover="clearAutoplay"
@@ -615,7 +615,6 @@ watch(() => activeSlideIndex, handleSlideChange)
615
615
  will-change: transform;
616
616
  transform: translateX(0);
617
617
  gap: 1%;
618
- cursor: grab;
619
618
  transition: none;
620
619
  -webkit-user-select: none;
621
620
  user-select: none;
@@ -106,8 +106,9 @@ async function handleSubmit() {
106
106
  initialFormData.value = safeClone(formData.value)
107
107
  formState.value = 'success'
108
108
  // Notify parent window of successful submission
109
- window.parent.postMessage({ type: 'BAGEL_FORM_SUCCESS', data: formData.value }, '*')
109
+ window.parent.postMessage({ type: 'BAGEL_FORM_SUCCESS', data: JSON.stringify(formData.value) }, '*')
110
110
  } catch (error) {
111
+ console.error('Form submission error:', error)
111
112
  formState.value = 'error'
112
113
  }
113
114
  }
@@ -141,20 +142,22 @@ defineExpose({ form, isDirty, validateForm })
141
142
  </script>
142
143
 
143
144
  <template>
144
- <form v-if="props.tag === 'form'" ref="form" @submit.prevent="handleSubmit">
145
- <template v-if="resolvedSchema">
145
+ <template v-if="formState !== 'success' || !$slots.success">
146
+ <form v-if="props.tag === 'form'" ref="form" @submit.prevent="handleSubmit">
147
+ <template v-if="resolvedSchema">
148
+ <template v-for="field in (resolvedSchema as Field[])" :key="field.id">
149
+ <component :is="renderSchemaField(field)" />
150
+ </template>
151
+ </template>
152
+ <slot v-else />
153
+ <slot name="submit" :submit="handleSubmit" :isDirty="isDirty" :validateForm="validateForm" :formState="formState" />
154
+ </form>
155
+ <template v-else>
146
156
  <template v-for="field in (resolvedSchema as Field[])" :key="field.id">
147
157
  <component :is="renderSchemaField(field)" />
148
158
  </template>
149
159
  </template>
150
- <slot v-else />
151
- <slot name="submit" :submit="handleSubmit" :isDirty="isDirty" :validateForm="validateForm" :formState="formState" />
152
- <slot v-if="formState === 'success'" name="success" />
153
- <slot v-if="formState === 'error'" name="error" />
154
- </form>
155
- <template v-else>
156
- <template v-for="field in (resolvedSchema as Field[])" :key="field.id">
157
- <component :is="renderSchemaField(field)" />
158
- </template>
159
160
  </template>
161
+ <slot v-if="formState === 'success'" name="success" />
162
+ <slot v-if="formState === 'error'" name="error" />
160
163
  </template>