{"version":3,"file":"install.mjs","sources":["../../src/utils/install.ts"],"sourcesContent":["import type { App, Component } from 'vue'\n\n// const camelizeRE = /-(\\w)/g\n// const camelize = (str: string) =>\n//   str.replace(camelizeRE, (_, c) => c.toUpperCase())\n\ntype EventShim = {\n  new (...args: any[]): {\n    $props: {\n      onClick?: (...args: any[]) => void\n    }\n  }\n}\nexport type WithInstall<T> = T & {\n  install(app: App): void\n} & EventShim\n\nexport const withInstall = <T extends Component>(\n  options: T\n): WithInstall<T> => {\n  // @ts-ignore\n  options.install = (app: App) => {\n    const { name } = options\n    if (name) {\n      app.component(name, options)\n      // app.component(camelize(`-${name}`), options)\n    }\n  }\n  return options as WithInstall<T>\n}\n"],"names":[],"mappings":"AAiBa,MAAA,WAAA,GAAc,CACzB,OACmB,KAAA;AAEnB,EAAQ,OAAA,CAAA,OAAA,GAAU,CAAC,GAAa,KAAA;AAC9B,IAAM,MAAA,EAAE,MAAS,GAAA,OAAA,CAAA;AACjB,IAAA,IAAI,IAAM,EAAA;AACR,MAAI,GAAA,CAAA,SAAA,CAAU,MAAM,OAAO,CAAA,CAAA;AAAA,KAE7B;AAAA,GACF,CAAA;AACA,EAAO,OAAA,OAAA,CAAA;AACT;;;;"}