@gitlab/ui
Version:
GitLab UI Components
53 lines (47 loc) • 955 B
JavaScript
import { extend, mergeData } from '../../vue';
import { NAME_FORM_TEXT } from '../../constants/components';
// --- Props ---
const props = {
id: {
type: String,
required: false,
default: undefined
},
inline: {
type: Boolean,
required: false,
default: false
},
tag: {
type: String,
required: false,
default: 'small'
},
textVariant: {
type: String,
required: false,
default: 'muted'
}
};
// --- Main component ---
// @vue/component
const BFormText = /*#__PURE__*/extend({
name: NAME_FORM_TEXT,
functional: true,
props,
render(h, _ref) {
let props = _ref.props,
data = _ref.data,
children = _ref.children;
return h(props.tag, mergeData(data, {
class: {
'form-text': !props.inline,
[`text-${props.textVariant}`]: props.textVariant
},
attrs: {
id: props.id
}
}), children);
}
});
export { BFormText, props };