@craterapp/vue-sdk
Version:
Embedded Invoicing & Bill Pay for platforms.
71 lines (70 loc) • 1.76 kB
JavaScript
import { c as s, t as c, r as p, a as f, u as m, d as v, b as q } from "./index-IlzZ4Xqv.js";
import { defineComponent as y, computed as S, resolveDirective as $, openBlock as _, createBlock as b, unref as a, withCtx as h, withDirectives as V, createVNode as g } from "vue";
const B = /* @__PURE__ */ y({
__name: "SSNType",
props: {
modelValue: {
type: String,
default: null
},
requirements: {
type: Array,
default: () => []
},
field: {
type: Object,
required: !0
},
placeholder: {
type: String,
default: ""
},
validationScope: {
type: String,
required: !0
},
step: {
type: Object,
required: !0
}
},
setup(e) {
const r = e, i = {
value: {
required: s.withMessage(
c("validation.required"),
p(r.field.is_required)
)
}
}, t = f(
i,
S(() => r.field),
{ $scope: r.validationScope }
);
return m(), (k, l) => {
const o = v, u = q, d = $("maska");
return _(), b(u, {
label: e.field.label,
required: !!e.field.is_required,
error: a(t).value.$error && a(t).value.$errors[0].$message
}, {
default: h(() => [
V(g(o, {
modelValue: e.field.value,
"onUpdate:modelValue": l[0] || (l[0] = (n) => e.field.value = n),
type: "text",
invalid: a(t).value.$error,
"container-class": "w-24",
placeholder: e.field.placeholder
}, null, 8, ["modelValue", "invalid", "placeholder"]), [
[d, "####"]
])
]),
_: 1
}, 8, ["label", "required", "error"]);
};
}
});
export {
B as default
};