@progress/kendo-vue-form
Version:
59 lines (58 loc) • 1.5 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { defineComponent as t, createVNode as o } from "vue";
import { packageMetadata as r } from "./package-metadata.mjs";
import { validatePackage as m, kendoThemeMaps as n, getDefaultSlots as a } from "@progress/kendo-vue-common";
const d = /* @__PURE__ */ t({
name: "KendoFormElement",
props: {
horizontal: Boolean,
size: {
type: String,
default: "medium",
validator: function(e) {
return [null, "small", "medium", "large"].includes(e);
}
}
},
created() {
m(r);
},
inject: {
kendoForm: {
default: null
}
},
computed: {
formElementClassName() {
const {
size: e
} = this.$props;
return {
"k-form": !0,
[`k-form-${n.sizeMap[e] || e}`]: e,
"k-form-horizontal": this.$props.horizontal === !0
};
}
},
methods: {
handleSubmit(e) {
this.kendoForm && this.kendoForm.onSubmit(e);
}
},
render() {
const e = a(this);
return o("form", {
class: this.formElementClassName,
onSubmit: this.handleSubmit
}, [e]);
}
});
export {
d as FormElement
};