1 |
- {"version":3,"sources":["../../../src/components/VDataTable/VEditDialog.js"],"names":[],"mappings":"AAAA,OAAO,mDAAP;AAEA;AACA,OAAO,UAAP,MAAuB,yBAAvB;AACA,OAAO,SAAP,MAAsB,wBAAtB;AAEA;AACA,SAAS,QAAT,QAAyB,oBAAzB;AAEA,OAAO,IAAP,MAAiB,SAAjB;AACA,OAAO,KAAP,MAAkB,UAAlB;AAEA;AACA,eAAe;AACb,UAAM,eADO;AAGb,YAAQ,CAAC,UAAD,EAAa,SAAb,CAHK;AAKb,WAAO;AACL,oBAAY;AACV,qBAAS;AADC,SADP;AAIL,eAAO,OAJF;AAKL,cAAM,OALD;AAML,oBAAY,OANP;AAOL,kBAAU;AACR,qBAAS;AADD,SAPL;AAUL,oBAAY;AACV,kBAAM,MADI;AAEV,qBAAS;AAFC;AAVP,KALM;AAqBb,QArBa,kBAqBT;AACF,eAAO;AACL,sBAAU;AADL,SAAP;AAGD,KAzBY;;AA2Bb,WAAO;AACL,gBADK,oBACK,GADL,EACQ;AACX,gBAAI,GAAJ,EAAS;AACP,qBAAK,KAAL,CAAW,MAAX;AACA,2BAAW,KAAK,KAAhB,EAAuB,EAAvB,EAFO,CAEoB;AAC5B,aAHD,MAGO;AACL,qBAAK,KAAL,CAAW,OAAX;AACD;AACF;AARI,KA3BM;AAsCb,aAAS;AACP,cADO,oBACD;AACJ,iBAAK,QAAL,GAAgB,KAAhB;AACA,iBAAK,KAAL,CAAW,QAAX;AACD,SAJM;AAKP,aALO,mBAKF;AACH,gBAAM,QAAQ,KAAK,KAAL,CAAW,OAAX,CAAmB,aAAnB,CAAiC,OAAjC,CAAd;AACA,qBAAS,MAAM,KAAN,EAAT;AACD,SARM;AASP,iBATO,qBASI,EATJ,EASQ,IATR,EASY;AACjB,mBAAO,KAAK,cAAL,CAAoB,IAApB,EAA0B;AAC/B,uBAAO;AACL,0BAAM,IADD;AAEL,2BAAO,SAFF;AAGL,2BAAO;AAHF,iBADwB;AAM/B,oBAAI,EAA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BAAM,KAAK;AAVN,aAHO;AAed,gBAAI;AACF,uBAAO;AAAA,2BAAQ,OAAK,QAAL,GAAgB,GAAxB;AAAA;AADL;AAfU,SAAT,EAkBJ,CACD,EAAE,GAAF,EAAO;AACL,kBAAM;AADD,SAAP,EAEG,KAAK,MAAL,CAAY,OAFf,CADC,EAID,KAAK,UAAL,EAJC,EAKD,KAAK,KAAL,GAAa,KAAK,UAAL,EAAb,GAAiC,IALhC,CAlBI,CAAP;AAyBD;AA/GY,CAAf","sourcesContent":["import '../../stylus/components/_small-dialog.styl'\n\n// Mixins\nimport Returnable from '../../mixins/returnable'\nimport Themeable from '../../mixins/themeable'\n\n// Utils\nimport { keyCodes } from '../../util/helpers'\n\nimport VBtn from '../VBtn'\nimport VMenu from '../VMenu'\n\n/* @vue/component */\nexport default {\n name: 'v-edit-dialog',\n\n mixins: [Returnable, Themeable],\n\n props: {\n cancelText: {\n default: 'Cancel'\n },\n large: Boolean,\n lazy: Boolean,\n persistent: Boolean,\n saveText: {\n default: 'Save'\n },\n transition: {\n type: String,\n default: 'slide-x-reverse-transition'\n }\n },\n\n data () {\n return {\n isActive: false\n }\n },\n\n watch: {\n isActive (val) {\n if (val) {\n this.$emit('open')\n setTimeout(this.focus, 50) // Give DOM time to paint\n } else {\n this.$emit('close')\n }\n }\n },\n\n methods: {\n cancel () {\n this.isActive = false\n this.$emit('cancel')\n },\n focus () {\n const input = this.$refs.content.querySelector('input')\n input && input.focus()\n },\n genButton (fn, text) {\n return this.$createElement(VBtn, {\n props: {\n flat: true,\n color: 'primary',\n light: true\n },\n on: { click: fn }\n }, text)\n },\n genActions () {\n return this.$createElement('div', {\n 'class': 'v-small-dialog__actions'\n }, [\n this.genButton(this.cancel, this.cancelText),\n this.genButton(() => {\n this.save(this.returnValue)\n this.$emit('save')\n }, this.saveText)\n ])\n },\n genContent () {\n return this.$createElement('div', {\n on: {\n keydown: e => {\n const input = this.$refs.content.querySelector('input')\n e.keyCode === keyCodes.esc && this.cancel()\n if (e.keyCode === keyCodes.enter && input) {\n this.save(input.value)\n this.$emit('save')\n }\n }\n },\n ref: 'content'\n }, [this.$slots.input])\n }\n },\n\n render (h) {\n return h(VMenu, {\n staticClass: 'v-small-dialog',\n class: this.themeClasses,\n props: {\n contentClass: 'v-small-dialog__content',\n transition: this.transition,\n origin: 'top right',\n right: true,\n value: this.isActive,\n closeOnClick: !this.persistent,\n closeOnContentClick: false,\n lazy: this.lazy,\n light: this.light,\n dark: this.dark\n },\n on: {\n input: val => (this.isActive = val)\n }\n }, [\n h('a', {\n slot: 'activator'\n }, this.$slots.default),\n this.genContent(),\n this.large ? this.genActions() : null\n ])\n }\n}\n"],"sourceRoot":""}
|