@hunter-industries/hunter-components 0.0.90 → 0.0.91
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.
|
@@ -3391,7 +3391,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
3391
3391
|
}
|
|
3392
3392
|
});
|
|
3393
3393
|
const FormInput = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-7719e3d0"]]);
|
|
3394
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
3394
|
+
const _withScopeId = (n) => (pushScopeId("data-v-26606b3a"), n = n(), popScopeId(), n);
|
|
3395
3395
|
const _hoisted_1$3 = { class: "unit-selection-container" };
|
|
3396
3396
|
const _hoisted_2$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "font-medium" }, "Units", -1));
|
|
3397
3397
|
const _hoisted_3$1 = { class: "unit-selection" };
|
|
@@ -3416,7 +3416,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3416
3416
|
submitButtonText: {},
|
|
3417
3417
|
cancelButtonText: {},
|
|
3418
3418
|
showCancelButton: { type: Boolean },
|
|
3419
|
-
successSubmitButtonDisabled: { type: Boolean }
|
|
3419
|
+
successSubmitButtonDisabled: { type: Boolean },
|
|
3420
|
+
focusOnFirstInput: { type: Boolean }
|
|
3420
3421
|
},
|
|
3421
3422
|
emits: ["cancelSubmit", "submitForm"],
|
|
3422
3423
|
setup(__props, { emit: __emit }) {
|
|
@@ -3429,6 +3430,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3429
3430
|
} = toRefs(props);
|
|
3430
3431
|
const status = ref(props.submitStatus);
|
|
3431
3432
|
const formInputs = ref(props.inputs);
|
|
3433
|
+
const form = ref();
|
|
3432
3434
|
const unit = ref("en");
|
|
3433
3435
|
const emit = __emit;
|
|
3434
3436
|
const canSubmit = computed(() => {
|
|
@@ -3531,6 +3533,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3531
3533
|
handleFormSubmit(e);
|
|
3532
3534
|
}
|
|
3533
3535
|
});
|
|
3536
|
+
if (props.focusOnFirstInput) {
|
|
3537
|
+
if (form.value && form.value[0]) {
|
|
3538
|
+
form.value[0].focus();
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3534
3541
|
});
|
|
3535
3542
|
onBeforeUnmount(() => {
|
|
3536
3543
|
document.removeEventListener("keydown", (e) => {
|
|
@@ -3548,7 +3555,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3548
3555
|
return openBlock(), createElementBlock("form", {
|
|
3549
3556
|
class: "hunter-component hunter-form",
|
|
3550
3557
|
onSubmit: withModifiers(handleFormSubmit, ["prevent"]),
|
|
3551
|
-
novalidate: ""
|
|
3558
|
+
novalidate: "",
|
|
3559
|
+
ref_key: "form",
|
|
3560
|
+
ref: form
|
|
3552
3561
|
}, [
|
|
3553
3562
|
(openBlock(true), createElementBlock(Fragment, null, renderList(formInputs.value, (input, index2) => {
|
|
3554
3563
|
return openBlock(), createBlock(FormInput, mergeProps({
|
|
@@ -3611,11 +3620,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3611
3620
|
type: "submit"
|
|
3612
3621
|
}), null, 16, ["class", "status", "disabled"])
|
|
3613
3622
|
])
|
|
3614
|
-
],
|
|
3623
|
+
], 544);
|
|
3615
3624
|
};
|
|
3616
3625
|
}
|
|
3617
3626
|
});
|
|
3618
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
3627
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-26606b3a"]]);
|
|
3619
3628
|
const _hoisted_1$2 = ["href"];
|
|
3620
3629
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3621
3630
|
__name: "Link",
|