UNPKG

@gitlab/ui

Version:
107 lines (96 loc) 3.6 kB
import GlButton from '../../base/button/button'; import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js'; var script = { components: { GlButton: GlButton }, props: { title: { type: String, required: true }, svgPath: { type: String, required: false, default: null }, svgHeight: { type: Number, required: false, default: null }, description: { type: String, required: false, default: null }, primaryButtonLink: { type: String, required: false, default: null }, primaryButtonText: { type: String, required: false, default: null }, secondaryButtonLink: { type: String, required: false, default: null }, secondaryButtonText: { type: String, required: false, default: null }, compact: { type: Boolean, required: false, default: false } }, computed: { height: function height() { return this.shouldPreventImageReflow ? this.svgHeight : null; }, shouldPreventImageReflow: function shouldPreventImageReflow() { return Boolean(this.svgHeight); }, shouldRenderPrimaryButton: function shouldRenderPrimaryButton() { return Boolean(this.primaryButtonLink && this.primaryButtonText); }, shouldRenderSecondaryButton: function shouldRenderSecondaryButton() { return Boolean(this.secondaryButtonLink && this.secondaryButtonText); } } }; /* 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('section',{staticClass:"row",class:{ 'empty-state text-center': !_vm.compact }},[_c('div',{class:{ 'col-3 d-none d-sm-block': _vm.compact, 'col-12': !_vm.compact }},[(_vm.svgPath)?_c('div',{staticClass:"svg-250",class:{ 'svg-content': !_vm.compact }},[_c('img',{staticClass:"gl-max-w-full",attrs:{"src":_vm.svgPath,"alt":"","height":_vm.height}})]):_vm._e()]),_vm._v(" "),_c('div',{class:_vm.compact ? 'col-sm-9' : 'col-12'},[_c('div',{staticClass:"text-content gl-mx-auto gl-my-0",class:{ 'gl-p-5': !_vm.compact }},[_c('h1',{ref:"title",class:_vm.compact ? 'h5' : 'h4'},[_vm._v(_vm._s(_vm.title))]),_vm._v(" "),(_vm.description || _vm.$scopedSlots.description)?_c('p',{ref:"description"},[_vm._t("description",[_vm._v("\n "+_vm._s(_vm.description)+"\n ")])],2):_vm._e(),_vm._v(" "),_c('div',[_vm._t("actions",[(_vm.shouldRenderPrimaryButton)?_c('gl-button',{attrs:{"variant":"success","href":_vm.primaryButtonLink}},[_vm._v(_vm._s(_vm.primaryButtonText))]):_vm._e(),_vm._v(" "),(_vm.shouldRenderSecondaryButton)?_c('gl-button',{attrs:{"href":_vm.secondaryButtonLink}},[_vm._v(_vm._s(_vm.secondaryButtonText))]):_vm._e()])],2)])])])}; 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__;