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,IACL,KAAK,EAAL,KAAY,OAAO,KAAK,EAAZ,CAAZ,IAA+B,KAAK,EAAL,CAAQ,IAAR,KAAiB,GADnD;AAED;AAED,gBAAI,KAAK,EAAT,EAAa;AACX;AACA;AACA,oBAAI,cAAc,KAAK,WAAvB;AACA,oBAAI,mBAAmB,KAAK,gBAAL,IAAyB,WAAhD;AAEA;AACA,oBAAK,KAAa,UAAlB,EAA8B;AAC5B,mCAAe,MAAO,KAAa,UAAnC;AACA,wCAAoB,MAAO,KAAa,UAAxC;AACD;AAED,sBAAM,KAAK,IAAL,GAAY,WAAZ,GAA0B,aAAhC;AACA,uBAAO,MAAP,CAAc,KAAK,KAAnB,EAA0B;AACxB,wBAAI,KAAK,EADe;AAExB,gCAFwB;AAGxB,4CAHwB;AAIxB,sDAJwB;AAKxB,4BAAQ,KAAK,MALW;AAMxB,6BAAS,KAAK;AANU,iBAA1B;AAQD,aArBD,MAqBO;AACL,sBAAO,KAAK,IAAL,IAAa,GAAd,IAAsB,KAAK,GAA3B,IAAkC,GAAxC;AAEA,oBAAI,QAAQ,GAAR,IAAe,KAAK,IAAxB,EAA8B,KAAK,KAAL,CAAY,IAAZ,GAAmB,KAAK,IAAxB;AAC/B;AAED,gBAAI,KAAK,MAAT,EAAiB,KAAK,KAAL,CAAY,MAAZ,GAAqB,KAAK,MAA1B;AAEjB,mBAAO,EAAE,QAAF,EAAO,UAAP,EAAP;AACD;AAzDM;AA/Be,CAAX,CAAf","sourcesContent":["import Vue, { VNodeData } from 'vue'\nimport { PropValidator } from 'vue/types/options'\n\nimport Ripple, { RippleOptions } from '../directives/ripple'\n\nexport default Vue.extend({\n name: 'routable',\n\n directives: {\n Ripple\n },\n\n props: {\n activeClass: String,\n append: Boolean,\n disabled: Boolean,\n exact: {\n type: Boolean,\n default: undefined\n } as PropValidator<boolean | undefined>,\n exactActiveClass: String,\n href: [String, Object],\n to: [String, Object],\n nuxt: Boolean,\n replace: Boolean,\n ripple: [Boolean, Object],\n tag: String,\n target: String\n },\n\n computed: {\n computedRipple (): RippleOptions | boolean {\n return (this.ripple && !this.disabled) ? this.ripple : false\n }\n },\n\n methods: {\n click (e: MouseEvent): void {\n this.$emit('click', e)\n },\n generateRouteLink (classes: any) {\n let exact = this.exact\n let tag\n\n const data: VNodeData = {\n attrs: { disabled: this.disabled },\n class: classes,\n props: {},\n directives: [{\n name: 'ripple',\n value: this.computedRipple\n }],\n [this.to ? 'nativeOn' : 'on']: {\n ...this.$listeners,\n click: this.click\n }\n }\n\n if (typeof this.exact === 'undefined') {\n exact = this.to === '/' ||\n (this.to === Object(this.to) && this.to.path === '/')\n }\n\n if (this.to) {\n // Add a special activeClass hook\n // for component level styles\n let activeClass = this.activeClass\n let exactActiveClass = this.exactActiveClass || activeClass\n\n // TODO: apply only in VListTile\n if ((this as any).proxyClass) {\n activeClass += ' ' + (this as any).proxyClass\n exactActiveClass += ' ' + (this as any).proxyClass\n }\n\n tag = this.nuxt ? 'nuxt-link' : 'router-link'\n Object.assign(data.props, {\n to: this.to,\n exact,\n activeClass,\n exactActiveClass,\n append: this.append,\n replace: this.replace\n })\n } else {\n tag = (this.href && 'a') || this.tag || 'a'\n\n if (tag === 'a' && this.href) data.attrs!.href = this.href\n }\n\n if (this.target) data.attrs!.target = this.target\n\n return { tag, data }\n }\n }\n})\n"],"sourceRoot":""}
|