UNPKG

bootstrap-vue

Version:

With more than 85 components, over 45 available plugins, several directives, and 1000+ icons, BootstrapVue provides one of the most comprehensive implementations of the Bootstrap v4 component and grid system available for Vue.js v2.6, complete with extens

51 lines (44 loc) 1.18 kB
import { extend, mergeData } from '../../vue' import { NAME_NAV_FORM } from '../../constants/components' import { PROP_TYPE_ARRAY_OBJECT_STRING } from '../../constants/props' import { omit, sortKeys } from '../../utils/object' import { makeProp, makePropsConfigurable, pluckProps } from '../../utils/props' import { BForm, props as BFormProps } from '../form/form' // --- Props --- const formProps = omit(BFormProps, ['inline']) export const props = makePropsConfigurable( sortKeys({ ...formProps, formClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING) }), NAME_NAV_FORM ) // --- Main component --- // @vue/component export const BNavForm = /*#__PURE__*/ extend({ name: NAME_NAV_FORM, functional: true, props, render(h, { props, data, children, listeners }) { const $form = h( BForm, { class: props.formClass, props: { ...pluckProps(formProps, props), inline: true }, attrs: data.attrs, on: listeners }, children ) return h( 'li', mergeData(omit(data, ['attrs', 'on']), { staticClass: 'form-inline' }), [$form] ) } })