UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 2 kB
{"version":3,"file":"image.mjs","sources":["../../../../../../packages/components/image/src/image.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '@element-plus/utils/props'\nimport { isNumber } from '@element-plus/utils/util'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const imageProps = buildProps({\n appendToBody: {\n type: Boolean,\n default: false,\n },\n hideOnClickModal: {\n type: Boolean,\n default: false,\n },\n src: {\n type: String,\n default: '',\n },\n fit: {\n type: String,\n values: ['', 'contain', 'cover', 'fill', 'none', 'scale-down'],\n default: '',\n },\n lazy: {\n type: Boolean,\n default: false,\n },\n scrollContainer: {\n type: definePropType<string | HTMLElement | undefined>([String, Object]),\n },\n previewSrcList: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n zIndex: {\n type: Number,\n default: 2000,\n },\n initialIndex: {\n type: Number,\n default: 0,\n },\n} as const)\nexport type ImageProps = ExtractPropTypes<typeof imageProps>\n\nexport const imageEmits = {\n error: (evt: Event) => evt instanceof Event,\n switch: (val: number) => isNumber(val),\n close: () => true,\n}\nexport type ImageEmits = typeof imageEmits\n"],"names":[],"mappings":";;;MAKa,aAAa,WAAW;AAAA,EACnC,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,IACH,MAAM;AAAA,IACN,QAAQ,CAAC,IAAI,WAAW,SAAS,QAAQ,QAAQ;AAAA,IACjD,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,iBAAiB;AAAA,IACf,MAAM,eAAiD,CAAC,QAAQ;AAAA;AAAA,EAElE,gBAAgB;AAAA,IACd,MAAM,eAAyB;AAAA,IAC/B,SAAS,MAAM,QAAQ;AAAA;AAAA,EAEzB,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;MAKA,aAAa;AAAA,EACxB,OAAO,CAAC,QAAe,eAAe;AAAA,EACtC,QAAQ,CAAC,QAAgB,SAAS;AAAA,EAClC,OAAO,MAAM;AAAA;;;;"}