1 |
- {"version":3,"sources":["../../src/mixins/registrable.ts"],"names":[],"mappings":";;AAAA,OAAO,GAAP,MAAgB,KAAhB;AAEA,SAAS,WAAT,QAA4B,iBAA5B;AAEA,SAAS,eAAT,CAA0B,KAA1B,EAAyC,MAAzC,EAAuD;AACrD,WAAO;AAAA,eAAM,qBAAmB,KAAnB,yCAA4D,MAA5D,CAAN;AAAA,KAAP;AACD;AASD,OAAM,SAAU,MAAV,CAAoC,SAApC,EAAkD,KAAlD,EAAkE,MAAlE,EAAiF;AACrF,QAAM,cAAc,SAAS,MAAT,GAAkB;AACpC,kBAAU,gBAAgB,KAAhB,EAAuB,MAAvB,CAD0B;AAEpC,oBAAY,gBAAgB,KAAhB,EAAuB,MAAvB;AAFwB,KAAlB,GAGhB,IAHJ;AAKA,WAAO,IAAI,MAAJ,CAAW;AAChB,cAAM,oBADU;AAGhB,oCACG,SADH,EACe;AACX,qBAAS;AADE,SADf;AAHgB,KAAX,CAAP;AASD;AAED,OAAM,SAAU,OAAV,CAAmB,SAAnB,EAAoC;AACxC,WAAO,IAAI,MAAJ,CAAW;AAChB,cAAM,qBADU;AAGhB,iBAAS;AACP,sBAAU,IADH;AAEP,wBAAY;AAFL,SAHO;AAOhB,eAPgB,qBAOT;AACL,uCACG,SADH,EACe;AACX,0BAAU,KAAK,QADJ;AAEX,4BAAY,KAAK;AAFN,aADf;AAMD;AAde,KAAX,CAAP;AAgBD","sourcesContent":["import Vue from 'vue'\nimport { VueConstructor } from 'vue/types/vue'\nimport { consoleWarn } from '../util/console'\n\nfunction generateWarning (child: string, parent: string) {\n return () => consoleWarn(`The ${child} component must be used inside a ${parent}`)\n}\n\nexport type Registrable<T extends string> = VueConstructor<Vue & {\n [K in T]: {\n register (...props: any[]): void\n unregister (self: any): void\n }\n}>\n\nexport function inject<T extends string> (namespace: T, child?: string, parent?: string): Registrable<T> {\n const defaultImpl = child && parent ? {\n register: generateWarning(child, parent),\n unregister: generateWarning(child, parent)\n } : null\n\n return Vue.extend({\n name: 'registrable-inject',\n\n inject: {\n [namespace]: {\n default: defaultImpl\n }\n }\n })\n}\n\nexport function provide (namespace: string) {\n return Vue.extend({\n name: 'registrable-provide',\n\n methods: {\n register: null,\n unregister: null\n },\n provide () {\n return {\n [namespace]: {\n register: this.register,\n unregister: this.unregister\n }\n }\n }\n })\n}\n"],"sourceRoot":""}
|