@gitlab/ui
Version:
GitLab UI Components
56 lines (50 loc) • 1.15 kB
JavaScript
import { extend, mergeData } from '../../vue';
import { NAME_DROPDOWN_TEXT } from '../../constants/components';
import { omit } from '../../utils/object';
// --- Props ---
const props = {
tag: {
type: String,
required: false,
default: 'p'
},
textClass: {
type: [Array, Object, String],
required: false,
default: undefined
},
variant: {
type: String,
required: false,
default: undefined
}
};
// --- Main component ---
// @vue/component
const BDropdownText = /*#__PURE__*/extend({
name: NAME_DROPDOWN_TEXT,
functional: true,
props,
render(h, _ref) {
let props = _ref.props,
data = _ref.data,
children = _ref.children;
const tag = props.tag,
textClass = props.textClass,
variant = props.variant;
return h('li', mergeData(omit(data, ['attrs']), {
attrs: {
role: 'presentation'
}
}), [h(tag, {
staticClass: 'b-dropdown-text',
class: [textClass, {
[`text-${variant}`]: variant
}],
props,
attrs: data.attrs || {},
ref: 'text'
}, children)]);
}
});
export { BDropdownText, props };