@gitlab/ui
Version:
GitLab UI Components
90 lines (73 loc) • 2.59 kB
JavaScript
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
var script = {
data() {
return {
enteredText: ''
};
},
computed: {
primaryProps() {
return {
text: 'Okay',
attributes: [{
disabled: !this.canSubmit
}, {
variant: 'confirm'
}]
};
},
secondaryProps() {
return {
text: 'Secondary',
attributes: [{
disabled: !this.canSubmit
}, {
variant: 'confirm',
category: 'secondary'
}]
};
},
cancelProps() {
return {
text: 'Cancel'
};
},
canSubmit() {
return this.enteredText === 'gitlab';
}
},
methods: {
clearInput() {
this.enteredText = '';
}
}
};
/* 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('div',[_c('gl-button',{directives:[{name:"gl-modal-directive",rawName:"v-gl-modal-directive",value:('basic-modal-id'),expression:"'basic-modal-id'"}],attrs:{"category":"primary","variant":"confirm"}},[_vm._v("\n Open modal\n ")]),_vm._v(" "),_c('gl-modal',{attrs:{"modal-id":"basic-modal-id","title":"Example title","no-fade":"","action-primary":_vm.primaryProps,"action-secondary":_vm.secondaryProps,"action-cancel":_vm.cancelProps},on:{"primary":_vm.clearInput,"secondary":_vm.clearInput,"cancel":_vm.clearInput}},[_c('p',[_vm._v("Enter \"gitlab\" to change the button state.")]),_vm._v(" "),_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.enteredText),expression:"enteredText"}],attrs:{"type":"text"},domProps:{"value":(_vm.enteredText)},on:{"input":function($event){if($event.target.composing){ return; }_vm.enteredText=$event.target.value;}}})])],1)};
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__;