You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0 lines
6.3 KiB

1 month ago
  1. {"ast":null,"code":"import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { mutable } from '../../../utils/typescript.mjs';\nimport { isNumber } from '../../../utils/types.mjs';\nconst imageProps = buildProps({\n hideOnClickModal: Boolean,\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 loading: {\n type: String,\n values: [\"eager\", \"lazy\"]\n },\n lazy: Boolean,\n scrollContainer: {\n type: definePropType([String, Object])\n },\n previewSrcList: {\n type: definePropType(Array),\n default: () => mutable([])\n },\n previewTeleported: Boolean,\n zIndex: {\n type: Number\n },\n initialIndex: {\n type: Number,\n default: 0\n },\n infinite: {\n type: Boolean,\n default: true\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true\n },\n zoomRate: {\n type: Number,\n default: 1.2\n },\n minScale: {\n type: Number,\n default: 0.2\n },\n maxScale: {\n type: Number,\n default: 7\n },\n crossorigin: {\n type: definePropType(String)\n }\n});\nconst imageEmits = {\n load: evt => evt instanceof Event,\n error: evt => evt instanceof Event,\n switch: val => isNumber(val),\n close: () => true,\n show: () => true\n};\nexport { imageEmits, imageProps };","map":{"version":3,"names":["imageProps","buildProps","hideOnClickModal","Boolean","src","type","String","default","fit","values","loading","lazy","scrollContainer","definePropType","Object","previewSrcList","Array","mutable","previewTeleported","zIndex","Number","initialIndex","infinite","closeOnPressEscape","zoomRate","minScale","maxScale","crossorigin","imageEmits","load","evt","Event","error","switch","val","isNumber","close","show"],"sources":["../../../../../../packages/components/image/src/image.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isNumber,\n mutable,\n} from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const imageProps = buildProps({\n /**\n * @description when enabling preview, use this flag to control whether clicking on backdrop can exit preview mode.\n */\n hideOnClickModal: Boolean,\n /**\n * @description image source, same as native.\n */\n src: {\n type: String,\n default: '',\n },\n /**\n * @description indicate how the image should be resized to fit its container, same as [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit).\n */\n fit: {\n type: String,\n values: ['', 'contain', 'cover', 'fill', 'none', 'scale-down'],\n default: '',\n },\n /**\n * @description Indicates how the browser should load the image, same as [native](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading)\n */\n loading: {\n type: String,\n values: ['eager', 'lazy'],\n },\n /**\n * @description whether to use lazy load.\n */\n lazy: Boolean,\n /**\n * @description the container to add scroll listener when using lazy load.\n */\n scrollContainer: {\n type: definePropType<string | HTMLElement | undefined>([String, Object]),\n },\n /**\n * @description allow big image preview.\n */\n previewSrcList: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n /**\n * @description whether to append image-viewer to body. A nested parent element attribute transform should have this attribute set to `true`.\n */\n previewTeleported: Boolean,\n /**\n * @description set image preview z-index.\n */\n zIndex: {\n type: Number,\n },\n /**\n * @description initial preview image index, less than the length of `url-list`.\n */\n initialIndex: {\n type: Number,\n default: 0,\n },\n /**\n * @description whether the viewer preview is infinite.\n */\n infinite: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether the image-viewer can be closed by pressing ESC.\n */\n