79 lines
1.7 KiB
JavaScript
79 lines
1.7 KiB
JavaScript
import {
|
|
createForm,
|
|
makeFormProps
|
|
} from "./chunk-GAYXO4FM.js";
|
|
import {
|
|
forwardRefs
|
|
} from "./chunk-GUNW7S2L.js";
|
|
import {
|
|
genericComponent,
|
|
makeComponentProps,
|
|
propsFactory,
|
|
useRender
|
|
} from "./chunk-LZ5T2ERG.js";
|
|
import {
|
|
createBaseVNode,
|
|
normalizeClass,
|
|
normalizeStyle,
|
|
ref
|
|
} from "./chunk-2MKFL3BX.js";
|
|
|
|
// node_modules/vuetify/lib/components/VForm/VForm.js
|
|
var makeVFormProps = propsFactory({
|
|
...makeComponentProps(),
|
|
...makeFormProps()
|
|
}, "VForm");
|
|
var VForm = genericComponent()({
|
|
name: "VForm",
|
|
props: makeVFormProps(),
|
|
emits: {
|
|
"update:modelValue": (val) => true,
|
|
submit: (e) => true
|
|
},
|
|
setup(props, _ref) {
|
|
let {
|
|
slots,
|
|
emit
|
|
} = _ref;
|
|
const form = createForm(props);
|
|
const formRef = ref();
|
|
function onReset(e) {
|
|
e.preventDefault();
|
|
form.reset();
|
|
}
|
|
function onSubmit(_e) {
|
|
const e = _e;
|
|
const ready = form.validate();
|
|
e.then = ready.then.bind(ready);
|
|
e.catch = ready.catch.bind(ready);
|
|
e.finally = ready.finally.bind(ready);
|
|
emit("submit", e);
|
|
if (!e.defaultPrevented) {
|
|
ready.then((_ref2) => {
|
|
let {
|
|
valid
|
|
} = _ref2;
|
|
if (valid) {
|
|
formRef.value?.submit();
|
|
}
|
|
});
|
|
}
|
|
e.preventDefault();
|
|
}
|
|
useRender(() => createBaseVNode("form", {
|
|
"ref": formRef,
|
|
"class": normalizeClass(["v-form", props.class]),
|
|
"style": normalizeStyle(props.style),
|
|
"novalidate": true,
|
|
"onReset": onReset,
|
|
"onSubmit": onSubmit
|
|
}, [slots.default?.(form)]));
|
|
return forwardRefs(form, formRef);
|
|
}
|
|
});
|
|
|
|
export {
|
|
VForm
|
|
};
|
|
//# sourceMappingURL=chunk-5LZQZ6A5.js.map
|