vuetify-form-dialog
Version:
Form dialog for Vuetify
2 lines • 8.63 kB
JavaScript
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vuetify-form-dialog"]=e():t["vuetify-form-dialog"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s="fae3")}({f6fd:function(t,e){(function(t){var e="currentScript",o=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(n){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(n.stack)||[!1])[1];for(t in o)if(o[t].src==e||"interactive"==o[t].readyState)return o[t];return null}}})})(document)},fae3:function(t,e,o){"use strict";var n;(o.r(e),o.d(e,"VDialogWrapper",(function(){return S})),o.d(e,"VDialogFooter",(function(){return s})),o.d(e,"VDialogHeader",(function(){return h})),o.d(e,"VFormDialog",(function(){return k})),"undefined"!==typeof window)&&(o("f6fd"),(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(o.p=n[1]));var r=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("v-card-actions",[t.buttonsRight?o("v-spacer"):t._e(),t._t("beforeButtons"),t._t("buttons",[t.hideSaveButton?t._e():o("v-btn",{attrs:{color:t.$saveButtonColor,disabled:!t.isValid},on:{click:function(e){return t.$emit("save")}}},[t._v(t._s(t.saveButtonText))]),t.hideCancelButton?t._e():o("v-btn",{attrs:{color:t.$cancelButtonColor},on:{click:function(e){return t.$emit("cancel")}}},[t._v(t._s(t.cancelButtonText))]),t.hideClearButton?t._e():o("v-btn",{attrs:{color:t.$clearButtonColor},on:{click:function(e){return t.$emit("clear")}}},[t._v(t._s(t.clearButtonText))])]),t._t("afterButtons")],2)},l=[],a={name:"VDialogFooter",props:{buttonsRight:Boolean,cancelButtonColor:String,cancelButtonText:{type:String,default:"Cancel"},clearButtonColor:String,clearButtonText:{type:String,default:"Clear"},coloredButtons:Boolean,hideCancelButton:Boolean,hideClearButton:Boolean,hideSaveButton:Boolean,isValid:Boolean,saveButtonColor:String,saveButtonText:{type:String,default:"Save"}},computed:{$cancelButtonColor:function(){return this.cancelButtonColor?this.cancelButtonColor:this.coloredButtons?"error":"primary"},$clearButtonColor:function(){return this.clearButtonColor?this.clearButtonColor:this.coloredButtons?"warning":"primary"},$saveButtonColor:function(){return this.saveButtonColor?this.saveButtonColor:this.coloredButtons?"success":"primary"}}},i=a;function u(t,e,o,n,r,l,a,i){var u,c="function"===typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=o,c._compiled=!0),n&&(c.functional=!0),l&&(c._scopeId="data-v-"+l),a?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=u):r&&(u=i?function(){r.call(this,this.$root.$options.shadowRoot)}:r),u)if(c.functional){c._injectStyles=u;var s=c.render;c.render=function(t,e){return u.call(e),s(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,u):[u]}return{exports:t,options:c}}var c=u(i,r,l,!1,null,null,null),s=c.exports,d=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("v-toolbar",{attrs:{color:t.titleColor,dark:t.darkTitle}},[o("v-toolbar-title",[t._v(t._s(t.title))]),t.hideCancelIcon?t._e():o("v-spacer"),t.hideCancelIcon?t._e():o("v-btn",{attrs:{icon:""},on:{click:function(e){return t.$emit("cancel")}}},[o("v-icon",[t._v("clear")])],1)],1)},f=[],B={name:"VDialogHeader",props:{darkTitle:Boolean,hideCancelIcon:Boolean,title:String,titleColor:{type:String,default:"primary"}}},p=B,v=u(p,d,f,!1,null,null,null),h=v.exports,C=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("v-dialog",{model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},[o("v-dialog-header",{attrs:{darkTitle:t.darkTitle,hideCancelIcon:t.hideCancelIcon,title:t.title,titleColor:t.titleColor},on:{click:t.cancel}}),o("v-card",[o("v-card-text",[t._t("default")],2),o("v-dialog-footer",{attrs:{buttonsRight:t.buttonsRight,cancelButtonColor:t.cancelButtonColor,cancelButtonText:t.cancelButtonText,clearButtonText:t.clearButtonText,clearButtonColor:t.clearButtonColor,coloredButtons:t.coloredButtons,hideCancelButton:t.hideCancelButton,hideClearButton:t.hideClearButton,hideSaveButton:t.hideSaveButton,isValid:t.isValid,saveButtonColor:t.saveButtonColor,saveButtonText:t.saveButtonText},on:{cancel:t.cancel,clear:t.clear,save:t.save}},[o("template",{slot:"beforeButtons"},[t._t("beforeButtons")],2),o("template",{slot:"buttons"},[t._t("buttons")],2),o("template",{slot:"afterButtons"},[t._t("afterButtons")],2)],2)],1)],1)},m=[],g={name:"VDialogWrapper",components:{VDialogFooter:s,VDialogHeader:h},props:{buttonsRight:Boolean,cancelButtonColor:String,cancelButtonText:{type:String,default:"Cancel"},clearButtonColor:String,clearButtonText:{type:String,default:"Clear"},coloredButtons:Boolean,darkTitle:Boolean,hideCancelIcon:Boolean,hideCancelButton:Boolean,hideClearButton:Boolean,hideSaveButton:Boolean,isValid:Boolean,saveButtonColor:String,saveButtonText:{type:String,default:"Save"},title:String,titleColor:{type:String,default:"primary"},value:{type:Boolean,default:!0}},computed:{$cancelButtonColor:function(){return this.cancelButtonColor?this.cancelButtonColor:this.coloredButtons?"error":"primary"},$clearButtonColor:function(){return this.clearButtonColor?this.clearButtonColor:this.coloredButtons?"warning":"primary"},$saveButtonColor:function(){return this.saveButtonColor?this.saveButtonColor:this.coloredButtons?"success":"primary"}},methods:{cancel:function(){this.$emit("cancel"),this.$emit("close"),this.$emit("input",!1)},clear:function(){this.$emit("clear")},save:function(){this.$emit("save"),this.$emit("close"),this.$emit("input",!1)}}},_=g,y=u(_,C,m,!1,null,null,null),S=y.exports,b=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("VDialogWrapper",{ref:"dialog",attrs:{value:t.value,buttonsRight:t.buttonsRight,cancelButtonColor:t.cancelButtonColor,cancelButtonText:t.cancelButtonText,clearButtonText:t.clearButtonText,coloredButtons:t.coloredButtons,hideCancelIcon:t.hideCancelIcon,hideCancelButton:t.hideCancelButton,hideClearButton:t.hideClearButton,hideSaveButton:t.hideSaveButton,isValid:t.formValid,saveButtonColor:t.saveButtonColor,saveButtonText:t.saveButtonText,title:t.title,titleColor:t.titleColor,darkTitle:t.darkTitle},on:{input:function(e){return t.$emit("input",e)},cancel:function(e){return t.$emit("cancel")},clear:t.handleClear,close:function(e){return t.$emit("close")},save:function(e){return t.$emit("save")}}},[o("v-form",{ref:"form",model:{value:t.formValid,callback:function(e){t.formValid=e},expression:"formValid"}},[t._t("default")],2),o("template",{slot:"beforeButtons"},[t._t("beforeButtons")],2),o("template",{slot:"buttons"},[t._t("buttons")],2),o("template",{slot:"afterButtons"},[t._t("afterButtons")],2)],2)},x=[],T={name:"VFormDialog",data:function(){return{formValid:!1}},components:{VDialogWrapper:S},props:{buttonsRight:Boolean,cancelButtonColor:String,cancelButtonText:{type:String,default:"Cancel"},clearButtonColor:String,clearButtonText:{type:String,default:"Clear"},coloredButtons:Boolean,darkTitle:Boolean,hideCancelIcon:Boolean,hideCancelButton:Boolean,hideClearButton:Boolean,hideSaveButton:Boolean,saveButtonColor:String,saveButtonText:{type:String,default:"Save"},title:String,titleColor:{type:String,default:"primary"},value:{type:Boolean,default:!0}},methods:{handleClear:function(){this.$refs.form.reset(),this.$emit("clear")}}},$=T,V=u($,b,x,!1,null,null,null),k=V.exports}})}));
//# sourceMappingURL=vuetify-form-dialog.umd.min.js.map