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 { makePropsConfigurable, makeProp, pluckProps } from '../../utils/props';
import { props as props$1, BForm } from '../form/form';

// --- Props ---

const formProps = omit(props$1, ['inline']);
const props = makePropsConfigurable(sortKeys({
  ...formProps,
  formClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING)
}), NAME_NAV_FORM);

// --- Main component ---

// @vue/component
const BNavForm = /*#__PURE__*/extend({
  name: NAME_NAV_FORM,
  functional: true,
  props,
  render(h, _ref) {
    let {
      props,
      data,
      children,
      listeners
    } = _ref;
    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]);
  }
});

export { BNavForm, props };
