UNPKG

@gitlab/ui

Version:
42 lines (36 loc) 929 B
import { extend, mergeData } from '../../vue'; import { NAME_DROPDOWN_DIVIDER } from '../../constants/components'; import { PROP_TYPE_STRING } from '../../constants/props'; import { makeProp } from '../../utils/props'; import { omit } from '../../utils/object'; // --- Props --- const props = { tag: makeProp(PROP_TYPE_STRING, 'hr') }; // --- Main component --- // @vue/component const BDropdownDivider = /*#__PURE__*/extend({ name: NAME_DROPDOWN_DIVIDER, functional: true, props, render(h, _ref) { let { props, data } = _ref; return h('li', mergeData(omit(data, ['attrs']), { attrs: { role: 'presentation' } }), [h(props.tag, { staticClass: 'dropdown-divider', attrs: { ...(data.attrs || {}), role: 'separator', 'aria-orientation': 'horizontal' }, ref: 'divider' })]); } }); export { BDropdownDivider, props };