{"version":3,"file":"qr-code.mjs","sources":["../../../../../../packages/components/qr-code/src/qr-code.ts"],"sourcesContent":["import QRCode from 'qrcode'\nimport { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes, MaybeRefOrGetter } from 'vue'\n\nexport interface ColorType {\n  light: string\n  dark: string\n}\n\nexport interface IconConfig {\n  radius: number\n  size: number\n  backgroundColor: string\n  padding: number\n}\n\nexport const getDefaultIconConfig = () => {\n  return {\n    radius: 4,\n    size: 40,\n    backgroundColor: '#fff',\n    padding: 4,\n  }\n}\n\nexport const qrCodeProps = buildProps({\n  text: {\n    type: definePropType<string>(String),\n    default: '',\n  },\n  options: {\n    type: definePropType<QRCode.QRCodeToDataURLOptions>(Object),\n    default: () => ({}),\n  },\n  size: {\n    type: definePropType<number | string>([Number, String]),\n    default: 120,\n  },\n  margin: {\n    type: definePropType<number | string>([Number, String]),\n    default: 2,\n  },\n  color: {\n    type: definePropType<MaybeRefOrGetter<string>>(String),\n  },\n  backgroundColor: {\n    type: definePropType<MaybeRefOrGetter<string>>(String),\n  },\n  iconSrc: {\n    type: definePropType<string>(String),\n  },\n  iconConfig: {\n    type: definePropType<IconConfig>(Object),\n    default: () => getDefaultIconConfig(),\n  },\n} as const)\nexport type QrCodeProps = ExtractPropTypes<typeof qrCodeProps>\n\nexport const qrCodeEmits = {}\nexport type QrCodeEmits = typeof qrCodeEmits\n"],"names":[],"mappings":";;AAgBO,MAAM,uBAAuB,MAAM;AACxC,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA,CAAA;AAAA,IACR,IAAM,EAAA,EAAA;AAAA,IACN,eAAiB,EAAA,MAAA;AAAA,IACjB,OAAS,EAAA,CAAA;AAAA,GACX,CAAA;AACF,EAAA;AAEO,MAAM,cAAc,UAAW,CAAA;AAAA,EACpC,IAAM,EAAA;AAAA,IACJ,IAAA,EAAM,eAAuB,MAAM,CAAA;AAAA,IACnC,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAA,EAAM,eAA8C,MAAM,CAAA;AAAA,IAC1D,OAAA,EAAS,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,cAAA,CAAgC,CAAC,MAAA,EAAQ,MAAM,CAAC,CAAA;AAAA,IACtD,OAAS,EAAA,GAAA;AAAA,GACX;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,cAAA,CAAgC,CAAC,MAAA,EAAQ,MAAM,CAAC,CAAA;AAAA,IACtD,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EACA,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAAyC,MAAM,CAAA;AAAA,GACvD;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,IAAA,EAAM,eAAyC,MAAM,CAAA;AAAA,GACvD;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAA,EAAM,eAAuB,MAAM,CAAA;AAAA,GACrC;AAAA,EACA,UAAY,EAAA;AAAA,IACV,IAAA,EAAM,eAA2B,MAAM,CAAA;AAAA,IACvC,OAAA,EAAS,MAAM,oBAAqB,EAAA;AAAA,GACtC;AACF,CAAU,EAAA;AAGH,MAAM,cAAc;;;;"}