@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/components/ModalForm.vue.d.ts +0 -125
- package/dist/components/ModalForm.vue.d.ts.map +1 -1
- package/dist/components/form/BagelForm.vue.d.ts +44 -0
- package/dist/components/form/BagelForm.vue.d.ts.map +1 -0
- package/dist/components/form/index.d.ts +1 -1
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/inputs/NumberInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/NumberInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +171 -160
- package/dist/index.mjs +171 -160
- package/dist/style.css +8 -8
- package/package.json +1 -1
- package/src/components/ModalForm.vue +6 -11
- package/src/components/form/BagelForm.vue +150 -0
- package/src/components/form/index.ts +1 -1
- package/src/components/form/inputs/NumberInput.vue +3 -3
package/dist/index.mjs
CHANGED
|
@@ -59,7 +59,7 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
|
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
-
const _hoisted_1$
|
|
62
|
+
const _hoisted_1$W = ["aria-expanded", "aria-controls"];
|
|
63
63
|
const _hoisted_2$D = { class: "accordion-label" };
|
|
64
64
|
const _hoisted_3$t = ["id", "aria-hidden"];
|
|
65
65
|
const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
@@ -136,7 +136,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
|
136
136
|
}, [
|
|
137
137
|
createVNode(unref(_sfc_main$d), { icon: computedIcon.value }, null, 8, ["icon"])
|
|
138
138
|
], 2)) : createCommentVNode("", true)
|
|
139
|
-
], 8, _hoisted_1$
|
|
139
|
+
], 8, _hoisted_1$W),
|
|
140
140
|
createVNode(Transition, { name: "expand" }, {
|
|
141
141
|
default: withCtx(() => [
|
|
142
142
|
unref(isOpen) ? (openBlock(), createElementBlock("div", {
|
|
@@ -162,7 +162,7 @@ const _export_sfc = (sfc, props2) => {
|
|
|
162
162
|
return target;
|
|
163
163
|
};
|
|
164
164
|
const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["__scopeId", "data-v-1e73ca3e"]]);
|
|
165
|
-
const _hoisted_1$
|
|
165
|
+
const _hoisted_1$V = { class: "relative" };
|
|
166
166
|
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
167
167
|
__name: "AddressSearch",
|
|
168
168
|
emits: ["addressSelected"],
|
|
@@ -185,7 +185,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
185
185
|
(_a2 = suggestion.value) == null ? void 0 : _a2.show();
|
|
186
186
|
}
|
|
187
187
|
return (_ctx, _cache) => {
|
|
188
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
188
|
+
return openBlock(), createElementBlock("div", _hoisted_1$V, [
|
|
189
189
|
createVNode(unref(_sfc_main$X), {
|
|
190
190
|
ref_key: "suggestion",
|
|
191
191
|
ref: suggestion,
|
|
@@ -221,7 +221,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
|
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
|
-
const _hoisted_1$
|
|
224
|
+
const _hoisted_1$U = {
|
|
225
225
|
key: 1,
|
|
226
226
|
class: "bgl_btn-flex"
|
|
227
227
|
};
|
|
@@ -291,7 +291,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
291
291
|
key: 0,
|
|
292
292
|
class: "h-100p",
|
|
293
293
|
size: "15"
|
|
294
|
-
})) : (openBlock(), createElementBlock("div", _hoisted_1$
|
|
294
|
+
})) : (openBlock(), createElementBlock("div", _hoisted_1$U, [
|
|
295
295
|
_ctx.icon ? (openBlock(), createBlock(unref(_sfc_main$d), {
|
|
296
296
|
key: 0,
|
|
297
297
|
icon: _ctx.icon
|
|
@@ -314,7 +314,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
|
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
316
|
const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-3efa79fb"]]);
|
|
317
|
-
const _hoisted_1$
|
|
317
|
+
const _hoisted_1$T = ["dismissable"];
|
|
318
318
|
const _hoisted_2$C = { class: "m-0" };
|
|
319
319
|
const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
320
320
|
__name: "Alert",
|
|
@@ -352,12 +352,12 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
|
|
|
352
352
|
icon: "close",
|
|
353
353
|
onClick: _cache[0] || (_cache[0] = ($event) => isDismissed.value = true)
|
|
354
354
|
})
|
|
355
|
-
], 10, _hoisted_1$
|
|
355
|
+
], 10, _hoisted_1$T)) : createCommentVNode("", true);
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
358
|
});
|
|
359
359
|
const Alert = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-57141c32"]]);
|
|
360
|
-
const _hoisted_1$
|
|
360
|
+
const _hoisted_1$S = ["src", "alt"];
|
|
361
361
|
const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
362
362
|
__name: "Avatar",
|
|
363
363
|
props: {
|
|
@@ -376,7 +376,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
|
|
|
376
376
|
key: 0,
|
|
377
377
|
src: _ctx.src,
|
|
378
378
|
alt: _ctx.name
|
|
379
|
-
}, null, 8, _hoisted_1$
|
|
379
|
+
}, null, 8, _hoisted_1$S)) : (openBlock(), createElementBlock("p", {
|
|
380
380
|
key: 1,
|
|
381
381
|
style: normalizeStyle({ "line-height": `${_ctx.size}px`, "font-size": `calc(1.5rem * ${_ctx.size} / 50)` })
|
|
382
382
|
}, toDisplayString((_ctx.fallback || unref(initials)(_ctx.name || "")).toUpperCase()), 5))
|
|
@@ -415,7 +415,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
415
415
|
}
|
|
416
416
|
});
|
|
417
417
|
const Badge = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__scopeId", "data-v-2f3caf93"]]);
|
|
418
|
-
const _hoisted_1$
|
|
418
|
+
const _hoisted_1$R = { key: 1 };
|
|
419
419
|
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
420
420
|
__name: "BglComponent",
|
|
421
421
|
props: {
|
|
@@ -445,7 +445,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
445
445
|
if (props2.field.$el === "file") return FileUpload;
|
|
446
446
|
if (props2.field.$el === "date") return _sfc_main$L;
|
|
447
447
|
if (props2.field.$el === "tabs") return TabsNav;
|
|
448
|
-
if (props2.field.$el === "form") return _sfc_main$
|
|
448
|
+
if (props2.field.$el === "form") return _sfc_main$R;
|
|
449
449
|
return props2.field.$el ?? "div";
|
|
450
450
|
});
|
|
451
451
|
function getFieldData(path) {
|
|
@@ -562,7 +562,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
562
562
|
id: [props2.id, child.id].filter(Boolean).join("."),
|
|
563
563
|
field: child,
|
|
564
564
|
"parent-path": props2.id
|
|
565
|
-
}, null, 8, ["id", "field", "parent-path"])) : (openBlock(), createElementBlock("span", _hoisted_1$
|
|
565
|
+
}, null, 8, ["id", "field", "parent-path"])) : (openBlock(), createElementBlock("span", _hoisted_1$R, toDisplayString(child), 1))
|
|
566
566
|
], 64);
|
|
567
567
|
}), 128))
|
|
568
568
|
], 64))
|
|
@@ -572,7 +572,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
572
572
|
};
|
|
573
573
|
}
|
|
574
574
|
});
|
|
575
|
-
const _hoisted_1$
|
|
575
|
+
const _hoisted_1$Q = ["src"];
|
|
576
576
|
const _hoisted_2$B = ["autoplay", "muted", "loop", "controls", "playsinline"];
|
|
577
577
|
const _hoisted_3$s = ["src", "type"];
|
|
578
578
|
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
@@ -652,7 +652,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
652
652
|
allowfullscreen: "",
|
|
653
653
|
title: "Video",
|
|
654
654
|
allow: "autoplay"
|
|
655
|
-
}, null, 12, _hoisted_1$
|
|
655
|
+
}, null, 12, _hoisted_1$Q)) : _ctx.src ? (openBlock(), createElementBlock("video", {
|
|
656
656
|
key: 1,
|
|
657
657
|
ref_key: "video",
|
|
658
658
|
ref: video,
|
|
@@ -673,7 +673,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
673
673
|
}
|
|
674
674
|
});
|
|
675
675
|
const BglVideo = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-006552f6"]]);
|
|
676
|
-
const _hoisted_1$
|
|
676
|
+
const _hoisted_1$P = {
|
|
677
677
|
key: 0,
|
|
678
678
|
class: "card_label"
|
|
679
679
|
};
|
|
@@ -706,7 +706,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
|
706
706
|
}])
|
|
707
707
|
}, {
|
|
708
708
|
default: withCtx(() => [
|
|
709
|
-
_ctx.label ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
709
|
+
_ctx.label ? (openBlock(), createElementBlock("span", _hoisted_1$P, toDisplayString(_ctx.label), 1)) : createCommentVNode("", true),
|
|
710
710
|
renderSlot(_ctx.$slots, "default")
|
|
711
711
|
]),
|
|
712
712
|
_: 3
|
|
@@ -716,7 +716,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
|
716
716
|
};
|
|
717
717
|
}
|
|
718
718
|
});
|
|
719
|
-
const _hoisted_1$
|
|
719
|
+
const _hoisted_1$O = ["dir"];
|
|
720
720
|
const _hoisted_2$A = {
|
|
721
721
|
key: 0,
|
|
722
722
|
class: "blocker"
|
|
@@ -931,7 +931,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
|
|
|
931
931
|
}, void 0, true)
|
|
932
932
|
])
|
|
933
933
|
])
|
|
934
|
-
], 14, _hoisted_1$
|
|
934
|
+
], 14, _hoisted_1$O);
|
|
935
935
|
};
|
|
936
936
|
}
|
|
937
937
|
});
|
|
@@ -6879,13 +6879,13 @@ var script = defineComponent({
|
|
|
6879
6879
|
return { bar, canvas, direction, mouse };
|
|
6880
6880
|
}
|
|
6881
6881
|
});
|
|
6882
|
-
const _hoisted_1$
|
|
6882
|
+
const _hoisted_1$N = {
|
|
6883
6883
|
key: 0,
|
|
6884
6884
|
class: "layer-hover-bar"
|
|
6885
6885
|
};
|
|
6886
6886
|
const _hoisted_2$z = ["x", "y", "width", "height"];
|
|
6887
6887
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6888
|
-
return _ctx.mouse.hover ? (openBlock(), createElementBlock("g", _hoisted_1$
|
|
6888
|
+
return _ctx.mouse.hover ? (openBlock(), createElementBlock("g", _hoisted_1$N, [
|
|
6889
6889
|
createElementVNode("rect", mergeProps({ class: "hover-bar" }, _ctx.barStyle, {
|
|
6890
6890
|
x: _ctx.bar.x,
|
|
6891
6891
|
y: _ctx.bar.y,
|
|
@@ -7037,7 +7037,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
7037
7037
|
};
|
|
7038
7038
|
}
|
|
7039
7039
|
});
|
|
7040
|
-
const _hoisted_1$
|
|
7040
|
+
const _hoisted_1$M = {
|
|
7041
7041
|
key: 0,
|
|
7042
7042
|
class: "data"
|
|
7043
7043
|
};
|
|
@@ -7094,7 +7094,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
7094
7094
|
const computedSchema = computed(() => getFallbackSchema([itemData.value], props2.showFields));
|
|
7095
7095
|
return (_ctx, _cache) => {
|
|
7096
7096
|
var _a2;
|
|
7097
|
-
return __props.data ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
7097
|
+
return __props.data ? (openBlock(), createElementBlock("div", _hoisted_1$M, [
|
|
7098
7098
|
_ctx.title ? (openBlock(), createBlock(unref(_sfc_main$4), {
|
|
7099
7099
|
key: 0,
|
|
7100
7100
|
label: _ctx.title
|
|
@@ -7107,7 +7107,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
7107
7107
|
createElementVNode("div", _hoisted_3$p, [
|
|
7108
7108
|
createElementVNode("p", _hoisted_4$h, toDisplayString((field == null ? void 0 : field.label) || unref(keyToLabel)(field.id)), 1)
|
|
7109
7109
|
]),
|
|
7110
|
-
createVNode(unref(_sfc_main$
|
|
7110
|
+
createVNode(unref(_sfc_main$S), {
|
|
7111
7111
|
modelValue: itemData.value,
|
|
7112
7112
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => itemData.value = $event),
|
|
7113
7113
|
label: "",
|
|
@@ -9761,7 +9761,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
9761
9761
|
};
|
|
9762
9762
|
}
|
|
9763
9763
|
});
|
|
9764
|
-
const _hoisted_1$
|
|
9764
|
+
const _hoisted_1$L = { class: "px-1 pt-025 pb-1" };
|
|
9765
9765
|
const _hoisted_2$x = { class: "ms-1" };
|
|
9766
9766
|
const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
9767
9767
|
__name: "FieldSetVue",
|
|
@@ -9771,7 +9771,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
|
9771
9771
|
},
|
|
9772
9772
|
setup(__props) {
|
|
9773
9773
|
return (_ctx, _cache) => {
|
|
9774
|
-
return openBlock(), createElementBlock("fieldset", _hoisted_1$
|
|
9774
|
+
return openBlock(), createElementBlock("fieldset", _hoisted_1$L, [
|
|
9775
9775
|
createElementVNode("legend", _hoisted_2$x, toDisplayString(_ctx.legend || _ctx.label), 1),
|
|
9776
9776
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
9777
9777
|
]);
|
|
@@ -9810,6 +9810,128 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
9810
9810
|
}
|
|
9811
9811
|
});
|
|
9812
9812
|
const Flag = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-f99f1900"]]);
|
|
9813
|
+
const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
9814
|
+
__name: "BagelForm",
|
|
9815
|
+
props: {
|
|
9816
|
+
modelValue: { default: () => ({}) },
|
|
9817
|
+
schema: { default: void 0 }
|
|
9818
|
+
},
|
|
9819
|
+
emits: ["update:modelValue", "submit"],
|
|
9820
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
9821
|
+
const props2 = __props;
|
|
9822
|
+
const emit2 = __emit;
|
|
9823
|
+
const form = ref();
|
|
9824
|
+
let formData = ref({ ...props2.modelValue });
|
|
9825
|
+
let initialFormData = ref({ ...props2.modelValue });
|
|
9826
|
+
watch(() => props2.modelValue, (newValue) => {
|
|
9827
|
+
formData.value = { ...newValue };
|
|
9828
|
+
}, { immediate: true, deep: true });
|
|
9829
|
+
const resolvedSchema = computed(() => {
|
|
9830
|
+
if (!props2.schema) return void 0;
|
|
9831
|
+
return typeof props2.schema === "function" ? props2.schema() : props2.schema;
|
|
9832
|
+
});
|
|
9833
|
+
const isDirty = computed(() => {
|
|
9834
|
+
const current = JSON.stringify(formData.value);
|
|
9835
|
+
const initial = JSON.stringify(initialFormData.value);
|
|
9836
|
+
return current !== initial;
|
|
9837
|
+
});
|
|
9838
|
+
function getComponent(field) {
|
|
9839
|
+
var _a2;
|
|
9840
|
+
const componentMap = {
|
|
9841
|
+
text: TextInput,
|
|
9842
|
+
textarea: TextInput,
|
|
9843
|
+
number: NumberInput,
|
|
9844
|
+
array: _sfc_main$Q,
|
|
9845
|
+
select: SelectInput,
|
|
9846
|
+
toggle: ToggleInput,
|
|
9847
|
+
check: CheckInput,
|
|
9848
|
+
richtext: RichText,
|
|
9849
|
+
upload: UploadInput,
|
|
9850
|
+
file: FileUpload,
|
|
9851
|
+
date: _sfc_main$L,
|
|
9852
|
+
tabs: TabsNav,
|
|
9853
|
+
bglform: _sfc_main$R
|
|
9854
|
+
};
|
|
9855
|
+
if (field.$el === "textarea" && !((_a2 = field.attrs) == null ? void 0 : _a2.multiline)) {
|
|
9856
|
+
field.attrs = { ...field.attrs, multiline: true };
|
|
9857
|
+
}
|
|
9858
|
+
return componentMap[field.$el] ?? field.$el ?? "div";
|
|
9859
|
+
}
|
|
9860
|
+
function processFieldValue(fieldType, value) {
|
|
9861
|
+
if (value == null) return value;
|
|
9862
|
+
if (fieldType === "select" && typeof value === "object") return value.value;
|
|
9863
|
+
if (typeof value === "object" && "value" in value) return value.value;
|
|
9864
|
+
return value;
|
|
9865
|
+
}
|
|
9866
|
+
function updateFormData(fieldId, value, fieldType) {
|
|
9867
|
+
formData.value = {
|
|
9868
|
+
...formData.value,
|
|
9869
|
+
[fieldId]: processFieldValue(fieldType, value)
|
|
9870
|
+
};
|
|
9871
|
+
emit2("update:modelValue", formData.value);
|
|
9872
|
+
}
|
|
9873
|
+
function handleSubmit() {
|
|
9874
|
+
emit2("submit", formData.value);
|
|
9875
|
+
initialFormData.value = { ...formData.value };
|
|
9876
|
+
}
|
|
9877
|
+
function renderSchemaField(field) {
|
|
9878
|
+
var _a2;
|
|
9879
|
+
const Component = getComponent(field);
|
|
9880
|
+
if (!Component) return null;
|
|
9881
|
+
const { $el, vIf, "v-if": vIf2, children: children2, ...fieldProps } = field;
|
|
9882
|
+
const currentValue = field.id ? formData.value[field.id] : void 0;
|
|
9883
|
+
const props22 = {
|
|
9884
|
+
...fieldProps,
|
|
9885
|
+
"modelValue": processFieldValue(field.$el, currentValue),
|
|
9886
|
+
"onUpdate:modelValue": (value) => {
|
|
9887
|
+
var _a3;
|
|
9888
|
+
if (!field.id) return;
|
|
9889
|
+
updateFormData(field.id, value, field.$el);
|
|
9890
|
+
(_a3 = field.onUpdate) == null ? void 0 : _a3.call(field, value, formData.value);
|
|
9891
|
+
}
|
|
9892
|
+
};
|
|
9893
|
+
if (field.attrs) {
|
|
9894
|
+
Object.entries(field.attrs).forEach(([key, value]) => {
|
|
9895
|
+
props22[key] = typeof value === "function" ? value(field, formData.value) : value;
|
|
9896
|
+
});
|
|
9897
|
+
}
|
|
9898
|
+
if (field.class) {
|
|
9899
|
+
props22.class = typeof field.class === "function" ? field.class(field, formData.value) : field.class;
|
|
9900
|
+
}
|
|
9901
|
+
const slots = ((_a2 = field.children) == null ? void 0 : _a2.length) ? {
|
|
9902
|
+
default: () => field.children.map(
|
|
9903
|
+
(child) => typeof child === "string" ? child : renderSchemaField(child)
|
|
9904
|
+
)
|
|
9905
|
+
} : void 0;
|
|
9906
|
+
return h$2(Component, props22, slots);
|
|
9907
|
+
}
|
|
9908
|
+
function shouldRenderField(field) {
|
|
9909
|
+
const condition = field.vIf ?? field["v-if"];
|
|
9910
|
+
if (condition === void 0) return true;
|
|
9911
|
+
return typeof condition === "function" ? condition(formData.value[field.id], formData.value) : !!condition;
|
|
9912
|
+
}
|
|
9913
|
+
__expose({ form: form.value, isDirty: isDirty.value });
|
|
9914
|
+
return (_ctx, _cache) => {
|
|
9915
|
+
return openBlock(), createElementBlock("form", {
|
|
9916
|
+
ref_key: "form",
|
|
9917
|
+
ref: form,
|
|
9918
|
+
onSubmit: withModifiers(handleSubmit, ["prevent"])
|
|
9919
|
+
}, [
|
|
9920
|
+
resolvedSchema.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(resolvedSchema.value, (field, index2) => {
|
|
9921
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
9922
|
+
key: field.id || index2
|
|
9923
|
+
}, [
|
|
9924
|
+
shouldRenderField(field) ? (openBlock(), createBlock(resolveDynamicComponent(renderSchemaField(field)), { key: 0 })) : createCommentVNode("", true)
|
|
9925
|
+
], 64);
|
|
9926
|
+
}), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 }),
|
|
9927
|
+
renderSlot(_ctx.$slots, "submit", {
|
|
9928
|
+
submit: handleSubmit,
|
|
9929
|
+
isDirty: isDirty.value
|
|
9930
|
+
})
|
|
9931
|
+
], 544);
|
|
9932
|
+
};
|
|
9933
|
+
}
|
|
9934
|
+
});
|
|
9813
9935
|
const state$1 = reactive(/* @__PURE__ */ new Map());
|
|
9814
9936
|
function useTabs(group) {
|
|
9815
9937
|
if (!state$1.has(group)) {
|
|
@@ -9823,8 +9945,8 @@ function useTabs(group) {
|
|
|
9823
9945
|
});
|
|
9824
9946
|
return { currentTab };
|
|
9825
9947
|
}
|
|
9826
|
-
const _hoisted_1$
|
|
9827
|
-
const _sfc_main$
|
|
9948
|
+
const _hoisted_1$K = ["onClick"];
|
|
9949
|
+
const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
9828
9950
|
__name: "TabsNav",
|
|
9829
9951
|
props: {
|
|
9830
9952
|
title: {},
|
|
@@ -9906,14 +10028,14 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
9906
10028
|
icon: tab.icon
|
|
9907
10029
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
9908
10030
|
createTextVNode(" " + toDisplayString(tabLabel(tab)), 1)
|
|
9909
|
-
], 10, _hoisted_1$
|
|
10031
|
+
], 10, _hoisted_1$K);
|
|
9910
10032
|
}), 128))
|
|
9911
10033
|
], true)
|
|
9912
10034
|
], 2);
|
|
9913
10035
|
};
|
|
9914
10036
|
}
|
|
9915
10037
|
});
|
|
9916
|
-
const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
10038
|
+
const TabsNav = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-307612a9"]]);
|
|
9917
10039
|
const FORM_STATE_KEY = Symbol("bagelFormState");
|
|
9918
10040
|
function safeClone(obj) {
|
|
9919
10041
|
if (obj === null || typeof obj !== "object") return obj;
|
|
@@ -9975,8 +10097,8 @@ function useBagelFormState() {
|
|
|
9975
10097
|
if (!state2) throw new Error("BagelFormState must be provided");
|
|
9976
10098
|
return state2;
|
|
9977
10099
|
}
|
|
9978
|
-
const _hoisted_1$
|
|
9979
|
-
const _sfc_main$
|
|
10100
|
+
const _hoisted_1$J = { key: 1 };
|
|
10101
|
+
const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
9980
10102
|
__name: "BglField",
|
|
9981
10103
|
props: {
|
|
9982
10104
|
field: {},
|
|
@@ -10006,7 +10128,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
10006
10128
|
if (props2.field.$el === "file") return FileUpload;
|
|
10007
10129
|
if (props2.field.$el === "date") return _sfc_main$L;
|
|
10008
10130
|
if (props2.field.$el === "tabs") return TabsNav;
|
|
10009
|
-
if (props2.field.$el === "bglform") return _sfc_main$
|
|
10131
|
+
if (props2.field.$el === "bglform") return _sfc_main$R;
|
|
10010
10132
|
return props2.field.$el ?? "div";
|
|
10011
10133
|
});
|
|
10012
10134
|
const fieldData = computed({
|
|
@@ -10071,7 +10193,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
10071
10193
|
fieldID: [props2.fieldID, child.id].filter(Boolean).join("."),
|
|
10072
10194
|
field: child,
|
|
10073
10195
|
"parent-path": props2.fieldID
|
|
10074
|
-
}, null, 8, ["fieldID", "field", "parent-path"])) : (openBlock(), createElementBlock("span", _hoisted_1$
|
|
10196
|
+
}, null, 8, ["fieldID", "field", "parent-path"])) : (openBlock(), createElementBlock("span", _hoisted_1$J, toDisplayString(child), 1))
|
|
10075
10197
|
], 64);
|
|
10076
10198
|
}), 128))
|
|
10077
10199
|
]),
|
|
@@ -10080,7 +10202,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
10080
10202
|
};
|
|
10081
10203
|
}
|
|
10082
10204
|
});
|
|
10083
|
-
const _sfc_main$
|
|
10205
|
+
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
10084
10206
|
__name: "BglForm",
|
|
10085
10207
|
props: {
|
|
10086
10208
|
label: {},
|
|
@@ -10182,7 +10304,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
10182
10304
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
10183
10305
|
_ctx.tag === "template" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
10184
10306
|
(openBlock(true), createElementBlock(Fragment, null, renderList(computedSchema.value, (field, i2) => {
|
|
10185
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
10307
|
+
return openBlock(), createBlock(unref(_sfc_main$S), {
|
|
10186
10308
|
key: field.id || `${i2}p`,
|
|
10187
10309
|
fieldID: field.id,
|
|
10188
10310
|
field
|
|
@@ -10205,7 +10327,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
10205
10327
|
label: _ctx.label
|
|
10206
10328
|
}, null, 8, ["label"])) : createCommentVNode("", true),
|
|
10207
10329
|
(openBlock(true), createElementBlock(Fragment, null, renderList(computedSchema.value, (field, i2) => {
|
|
10208
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
10330
|
+
return openBlock(), createBlock(unref(_sfc_main$S), {
|
|
10209
10331
|
key: field.id || `${i2}p`,
|
|
10210
10332
|
fieldID: field.id,
|
|
10211
10333
|
field
|
|
@@ -10223,114 +10345,6 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
10223
10345
|
};
|
|
10224
10346
|
}
|
|
10225
10347
|
});
|
|
10226
|
-
const _hoisted_1$J = { key: 0 };
|
|
10227
|
-
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
10228
|
-
__name: "BglMultiStepForm",
|
|
10229
|
-
props: /* @__PURE__ */ mergeModels({
|
|
10230
|
-
bagelFormProps: { default: () => ({}) },
|
|
10231
|
-
schema: {}
|
|
10232
|
-
}, {
|
|
10233
|
-
"modelValue": { default: () => {
|
|
10234
|
-
}, required: true },
|
|
10235
|
-
"modelModifiers": {}
|
|
10236
|
-
}),
|
|
10237
|
-
emits: /* @__PURE__ */ mergeModels(["submit"], ["update:modelValue"]),
|
|
10238
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
10239
|
-
var _a2, _b, _c, _d;
|
|
10240
|
-
const props2 = __props;
|
|
10241
|
-
const emits = __emit;
|
|
10242
|
-
const formRef = ref();
|
|
10243
|
-
const formData = useModel(
|
|
10244
|
-
__props,
|
|
10245
|
-
"modelValue"
|
|
10246
|
-
);
|
|
10247
|
-
function reportValidity() {
|
|
10248
|
-
if (!formRef.value) return false;
|
|
10249
|
-
return formRef.value.validateForm();
|
|
10250
|
-
}
|
|
10251
|
-
const computedSchema = computed(
|
|
10252
|
-
() => useBglSchema({ schema: props2.schema })
|
|
10253
|
-
);
|
|
10254
|
-
const numberOfSteps = ref(computedSchema.value.length);
|
|
10255
|
-
let currentStep = ref(0);
|
|
10256
|
-
const currentStepSchema = computed(() => computedSchema.value[currentStep.value]);
|
|
10257
|
-
let isStepping = ref(false);
|
|
10258
|
-
let isSteppingTO;
|
|
10259
|
-
watch(
|
|
10260
|
-
() => currentStep.value,
|
|
10261
|
-
() => {
|
|
10262
|
-
clearTimeout(isSteppingTO);
|
|
10263
|
-
isStepping.value = true;
|
|
10264
|
-
isSteppingTO = setTimeout(() => isStepping.value = false, 600);
|
|
10265
|
-
}
|
|
10266
|
-
);
|
|
10267
|
-
const canDoNext = computed(() => currentStep.value < numberOfSteps.value - 1);
|
|
10268
|
-
function prevStep() {
|
|
10269
|
-
if (currentStep.value > 0) currentStep.value--;
|
|
10270
|
-
}
|
|
10271
|
-
function nextStep() {
|
|
10272
|
-
if (reportValidity() === false) return;
|
|
10273
|
-
if (canDoNext.value) currentStep.value++;
|
|
10274
|
-
}
|
|
10275
|
-
function handleSubmit() {
|
|
10276
|
-
if (reportValidity() === false) return;
|
|
10277
|
-
emits("submit", formData.value);
|
|
10278
|
-
}
|
|
10279
|
-
__expose({
|
|
10280
|
-
submit: handleSubmit,
|
|
10281
|
-
validateForm: (_a2 = formRef.value) == null ? void 0 : _a2.validateForm,
|
|
10282
|
-
deleteItem: (_b = formRef.value) == null ? void 0 : _b.deleteItem,
|
|
10283
|
-
isDirty: (_c = formRef.value) == null ? void 0 : _c.isDirty,
|
|
10284
|
-
clearForm: (_d = formRef.value) == null ? void 0 : _d.clearForm
|
|
10285
|
-
});
|
|
10286
|
-
return (_ctx, _cache) => {
|
|
10287
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
10288
|
-
createVNode(Transition, {
|
|
10289
|
-
duration: 600,
|
|
10290
|
-
name: "fade",
|
|
10291
|
-
mode: "out-in"
|
|
10292
|
-
}, {
|
|
10293
|
-
default: withCtx(() => [
|
|
10294
|
-
!unref(isStepping) ? (openBlock(), createElementBlock("div", _hoisted_1$J, [
|
|
10295
|
-
createVNode(unref(_sfc_main$S), mergeProps({
|
|
10296
|
-
ref_key: "formRef",
|
|
10297
|
-
ref: formRef,
|
|
10298
|
-
modelValue: formData.value,
|
|
10299
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value = $event),
|
|
10300
|
-
schema: [currentStepSchema.value]
|
|
10301
|
-
}, _ctx.bagelFormProps), {
|
|
10302
|
-
success: withCtx(() => [
|
|
10303
|
-
renderSlot(_ctx.$slots, "success")
|
|
10304
|
-
]),
|
|
10305
|
-
error: withCtx(() => [
|
|
10306
|
-
renderSlot(_ctx.$slots, "error")
|
|
10307
|
-
]),
|
|
10308
|
-
_: 3
|
|
10309
|
-
}, 16, ["modelValue", "schema"])
|
|
10310
|
-
])) : createCommentVNode("", true)
|
|
10311
|
-
]),
|
|
10312
|
-
_: 3
|
|
10313
|
-
}),
|
|
10314
|
-
renderSlot(_ctx.$slots, "steppers", normalizeProps(guardReactiveProps({ prevStep, nextStep, submit: handleSubmit })), () => [
|
|
10315
|
-
createVNode(unref(Btn), {
|
|
10316
|
-
disabled: unref(currentStep) === 0,
|
|
10317
|
-
value: "Back",
|
|
10318
|
-
onClick: prevStep
|
|
10319
|
-
}, null, 8, ["disabled"]),
|
|
10320
|
-
canDoNext.value ? (openBlock(), createBlock(unref(Btn), {
|
|
10321
|
-
key: 0,
|
|
10322
|
-
value: "Next",
|
|
10323
|
-
onClick: nextStep
|
|
10324
|
-
})) : (openBlock(), createBlock(unref(Btn), {
|
|
10325
|
-
key: 1,
|
|
10326
|
-
value: "Submit",
|
|
10327
|
-
onClick: handleSubmit
|
|
10328
|
-
}))
|
|
10329
|
-
])
|
|
10330
|
-
], 64);
|
|
10331
|
-
};
|
|
10332
|
-
}
|
|
10333
|
-
});
|
|
10334
10348
|
const _hoisted_1$I = { class: "label mb-05" };
|
|
10335
10349
|
const _hoisted_2$w = {
|
|
10336
10350
|
key: 0,
|
|
@@ -10402,7 +10416,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
|
10402
10416
|
thin: "",
|
|
10403
10417
|
class: "mb-05 itemBox transition p-05"
|
|
10404
10418
|
}, [
|
|
10405
|
-
createVNode(unref(_sfc_main$
|
|
10419
|
+
createVNode(unref(_sfc_main$R), {
|
|
10406
10420
|
modelValue: data2.value[i2],
|
|
10407
10421
|
"onUpdate:modelValue": [($event) => data2.value[i2] = $event, emitValue],
|
|
10408
10422
|
schema: _ctx.schema
|
|
@@ -10432,7 +10446,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
|
10432
10446
|
_: 1
|
|
10433
10447
|
})) : createCommentVNode("", true)
|
|
10434
10448
|
])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(data2.value, (_2, i2) => {
|
|
10435
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
10449
|
+
return openBlock(), createBlock(unref(_sfc_main$S), {
|
|
10436
10450
|
key: i2,
|
|
10437
10451
|
modelValue: data2.value[i2],
|
|
10438
10452
|
"onUpdate:modelValue": [($event) => data2.value[i2] = $event, emitValue],
|
|
@@ -20284,7 +20298,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
20284
20298
|
emits: ["update:modelValue"],
|
|
20285
20299
|
setup(__props, { emit: __emit }) {
|
|
20286
20300
|
const emit2 = __emit;
|
|
20287
|
-
let numberValue = ref(__props.modelValue || 0);
|
|
20301
|
+
let numberValue = ref(Number.parseFloat(`${__props.modelValue}`) || 0);
|
|
20288
20302
|
const btnLayouts = ["horizontal", "vertical"];
|
|
20289
20303
|
const canAdd = computed(() => !(__props.max !== void 0 && numberValue.value + __props.step > __props.max));
|
|
20290
20304
|
const canDecrement = computed(() => !(__props.min !== void 0 && numberValue.value - __props.step < __props.min));
|
|
@@ -20318,7 +20332,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
20318
20332
|
}, { immediate: true });
|
|
20319
20333
|
watch(() => __props.modelValue, (newVal) => {
|
|
20320
20334
|
if (newVal !== numberValue.value) {
|
|
20321
|
-
numberValue.value = newVal || 0;
|
|
20335
|
+
numberValue.value = Number.parseFloat(`${newVal}`) || 0;
|
|
20322
20336
|
}
|
|
20323
20337
|
}, { immediate: true });
|
|
20324
20338
|
return (_ctx, _cache) => {
|
|
@@ -20422,7 +20436,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
20422
20436
|
};
|
|
20423
20437
|
}
|
|
20424
20438
|
});
|
|
20425
|
-
const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-
|
|
20439
|
+
const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-4a70ce50"]]);
|
|
20426
20440
|
const _hoisted_1$x = ["value", "autofocus", "onKeydown", "onPaste"];
|
|
20427
20441
|
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
20428
20442
|
__name: "OTP",
|
|
@@ -32282,15 +32296,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
32282
32296
|
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => emit2("update:visible", $event))
|
|
32283
32297
|
}, createSlots({
|
|
32284
32298
|
default: withCtx(() => [
|
|
32285
|
-
|
|
32286
|
-
key: 0,
|
|
32287
|
-
ref_key: "form",
|
|
32288
|
-
ref: form,
|
|
32299
|
+
createVNode(unref(_sfc_main$U), {
|
|
32289
32300
|
modelValue: formData.value,
|
|
32290
32301
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value = $event),
|
|
32291
32302
|
schema: computedFormSchema.value,
|
|
32292
32303
|
onSubmit: runSubmit
|
|
32293
|
-
}, null, 8, ["modelValue", "schema"])
|
|
32304
|
+
}, null, 8, ["modelValue", "schema"])
|
|
32294
32305
|
]),
|
|
32295
32306
|
_: 2
|
|
32296
32307
|
}, [
|
|
@@ -32325,7 +32336,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
32325
32336
|
};
|
|
32326
32337
|
}
|
|
32327
32338
|
});
|
|
32328
|
-
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-
|
|
32339
|
+
const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-f796c518"]]);
|
|
32329
32340
|
const _hoisted_1$6 = { class: "full-nav" };
|
|
32330
32341
|
const _hoisted_2$4 = { class: "nav-scroll" };
|
|
32331
32342
|
const _hoisted_3$3 = { class: "nav-links-wrapper" };
|
|
@@ -35534,12 +35545,12 @@ export {
|
|
|
35534
35545
|
Alert,
|
|
35535
35546
|
Avatar,
|
|
35536
35547
|
Badge,
|
|
35537
|
-
_sfc_main$
|
|
35548
|
+
_sfc_main$R as BagelForm,
|
|
35549
|
+
_sfc_main$U as BagelForm2,
|
|
35538
35550
|
BagelVue,
|
|
35539
35551
|
_sfc_main$11 as BglComponent,
|
|
35540
|
-
_sfc_main$
|
|
35541
|
-
_sfc_main$
|
|
35542
|
-
_sfc_main$R as BglMultiStepForm,
|
|
35552
|
+
_sfc_main$S as BglField,
|
|
35553
|
+
_sfc_main$R as BglForm,
|
|
35543
35554
|
BglVideo,
|
|
35544
35555
|
BottomMenu,
|
|
35545
35556
|
Btn,
|
package/dist/style.css
CHANGED
|
@@ -1244,14 +1244,14 @@ pre code.hljs{
|
|
|
1244
1244
|
direction: ltr;
|
|
1245
1245
|
}
|
|
1246
1246
|
|
|
1247
|
-
.txtInputIconStart .iconStart[data-v-
|
|
1247
|
+
.txtInputIconStart .iconStart[data-v-4a70ce50] {
|
|
1248
1248
|
color: var(--input-color);
|
|
1249
1249
|
position: absolute;
|
|
1250
1250
|
inset-inline-start:calc(var(--input-height) / 3 - 0.25rem);
|
|
1251
1251
|
margin-top: calc(var(--input-height) / 2 );
|
|
1252
1252
|
line-height: 0;
|
|
1253
1253
|
}
|
|
1254
|
-
.textInputSpinnerWrap .spinner[data-v-
|
|
1254
|
+
.textInputSpinnerWrap .spinner[data-v-4a70ce50] {
|
|
1255
1255
|
color: var(--input-color);
|
|
1256
1256
|
position: absolute;
|
|
1257
1257
|
inset-inline-end: 0;
|
|
@@ -1261,18 +1261,18 @@ pre code.hljs{
|
|
|
1261
1261
|
flex-direction: column;
|
|
1262
1262
|
gap: 0;
|
|
1263
1263
|
}
|
|
1264
|
-
.top-bgl-ctrl-num-btn[data-v-
|
|
1264
|
+
.top-bgl-ctrl-num-btn[data-v-4a70ce50]{
|
|
1265
1265
|
margin-top: calc(var(--input-height) / 10) !important;
|
|
1266
1266
|
}
|
|
1267
|
-
.bgl-ctrl-num-btn[data-v-
|
|
1267
|
+
.bgl-ctrl-num-btn[data-v-4a70ce50]{
|
|
1268
1268
|
height: calc(var(--input-height) / 2.5) !important;
|
|
1269
1269
|
isolation: isolate;
|
|
1270
1270
|
}
|
|
1271
|
-
.bgl-big-ctrl-num-btn[data-v-
|
|
1271
|
+
.bgl-big-ctrl-num-btn[data-v-4a70ce50]{
|
|
1272
1272
|
width: 100% !important;
|
|
1273
1273
|
isolation: isolate;
|
|
1274
1274
|
}
|
|
1275
|
-
.bgl-number-input[data-v-
|
|
1275
|
+
.bgl-number-input[data-v-4a70ce50]{
|
|
1276
1276
|
padding-inline-end: 1.75rem !important;
|
|
1277
1277
|
}
|
|
1278
1278
|
|
|
@@ -3336,11 +3336,11 @@ body:has(.bg-dark.is-active) {
|
|
|
3336
3336
|
border-radius: var(--card-border-radius);
|
|
3337
3337
|
}
|
|
3338
3338
|
|
|
3339
|
-
.modal-title[data-v-
|
|
3339
|
+
.modal-title[data-v-f796c518] {
|
|
3340
3340
|
margin-top: 0.5rem;
|
|
3341
3341
|
}
|
|
3342
3342
|
@media screen and (max-width: 910px) {
|
|
3343
|
-
.modal-title[data-v-
|
|
3343
|
+
.modal-title[data-v-f796c518] {
|
|
3344
3344
|
margin-top: 1rem;
|
|
3345
3345
|
}
|
|
3346
3346
|
}
|