UNPKG

element-plus

Version:

A Component Library for Vue 3

1 lines 2.11 kB
{"version":3,"file":"upload-list.mjs","names":[],"sources":["../../../../../../packages/components/upload/src/upload-list.ts"],"sourcesContent":["import { NOOP, buildProps, definePropType, mutable } from '@element-plus/utils'\nimport { uploadListTypes } from './upload'\n\nimport type { ExtractPublicPropTypes } from 'vue'\nimport type {\n Crossorigin,\n ListType,\n UploadFile,\n UploadFiles,\n UploadHooks,\n} from './upload'\nimport type UploadList from './upload-list.vue'\n\nexport interface UploadListProps {\n files?: UploadFiles\n disabled?: boolean\n handlePreview?: UploadHooks['onPreview']\n listType?: ListType\n /**\n * @description set HTML attribute: crossorigin.\n */\n crossorigin?: Crossorigin\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `UploadListProps` instead.\n */\nexport const uploadListProps = buildProps({\n files: {\n type: definePropType<UploadFiles>(Array),\n default: () => mutable([]),\n },\n disabled: {\n type: Boolean,\n default: undefined,\n },\n handlePreview: {\n type: definePropType<UploadHooks['onPreview']>(Function),\n default: NOOP,\n },\n listType: {\n type: String,\n values: uploadListTypes,\n default: 'text',\n },\n /**\n * @description set HTML attribute: crossorigin.\n */\n crossorigin: {\n type: definePropType<'anonymous' | 'use-credentials' | ''>(String),\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `UploadListProps` instead.\n */\nexport type UploadListPropsPublic = ExtractPublicPropTypes<\n typeof uploadListProps\n>\nexport const uploadListEmits = {\n remove: (file: UploadFile) => !!file,\n}\nexport type UploadListEmits = typeof uploadListEmits\nexport type UploadListInstance = InstanceType<typeof UploadList> & unknown\n"],"mappings":";;;;;;;;;AA2BA,MAAa,kBAAkB,WAAW;CACxC,OAAO;EACL,MAAM,eAA4B,MAAM;EACxC,eAAe,QAAQ,EAAE,CAAC;EAC3B;CACD,UAAU;EACR,MAAM;EACN,SAAS;EACV;CACD,eAAe;EACb,MAAM,eAAyC,SAAS;EACxD,SAAS;EACV;CACD,UAAU;EACR,MAAM;EACN,QAAQ;EACR,SAAS;EACV;CAID,aAAa,EACX,MAAM,eAAqD,OAAO,EACnE;CACF,CAAU;AAQX,MAAa,kBAAkB,EAC7B,SAAS,SAAqB,CAAC,CAAC,MACjC"}