UNPKG

@gitlab/ui

Version:
83 lines (70 loc) 2.06 kB
import { BFormInput } from 'bootstrap-vue/esm/index.js'; import { formInputSizes } from '../../../../utils/constants'; import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js'; const model = { prop: 'value', event: 'input' }; var script = { components: { BFormInput }, inheritAttrs: false, model, props: { size: { type: String, required: false, default: null, validator: value => Object.values(formInputSizes).includes(value) } }, computed: { cssClasses() { return { [`gl-form-input-${this.size}`]: this.size !== null }; }, listeners() { return { ...this.$listeners, // Swap purpose of input and update events from underlying BFormInput. // See https://gitlab.com/gitlab-org/gitlab-ui/-/issues/631. input: (...args) => { this.$emit('update', ...args); }, update: (...args) => { this.$emit(model.event, ...args); } }; } } }; /* script */ const __vue_script__ = script; /* template */ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-form-input',_vm._g(_vm._b({staticClass:"gl-form-input",class:_vm.cssClasses},'b-form-input',_vm.$attrs,false),_vm.listeners))}; var __vue_staticRenderFns__ = []; /* style */ const __vue_inject_styles__ = undefined; /* scoped */ const __vue_scope_id__ = undefined; /* module identifier */ const __vue_module_identifier__ = undefined; /* functional template */ const __vue_is_functional_template__ = false; /* style inject */ /* style inject SSR */ /* style inject shadow dom */ const __vue_component__ = __vue_normalize__( { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined ); export default __vue_component__;