| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- 'use strict';
- Object.defineProperty(exports, '__esModule', { value: true });
- var ajax = require('./ajax.js');
- var runtime = require('../../../utils/vue/props/runtime.js');
- var typescript = require('../../../utils/typescript.js');
- var shared = require('@vue/shared');
- const uploadListTypes = ["text", "picture", "picture-card"];
- let fileId = 1;
- const genFileId = () => Date.now() + fileId++;
- const uploadBaseProps = runtime.buildProps({
- action: {
- type: String,
- default: "#"
- },
- headers: {
- type: runtime.definePropType(Object)
- },
- method: {
- type: String,
- default: "post"
- },
- data: {
- type: runtime.definePropType([Object, Function, Promise]),
- default: () => typescript.mutable({})
- },
- multiple: Boolean,
- name: {
- type: String,
- default: "file"
- },
- drag: Boolean,
- withCredentials: Boolean,
- showFileList: {
- type: Boolean,
- default: true
- },
- accept: {
- type: String,
- default: ""
- },
- fileList: {
- type: runtime.definePropType(Array),
- default: () => typescript.mutable([])
- },
- autoUpload: {
- type: Boolean,
- default: true
- },
- listType: {
- type: String,
- values: uploadListTypes,
- default: "text"
- },
- httpRequest: {
- type: runtime.definePropType(Function),
- default: ajax.ajaxUpload
- },
- disabled: Boolean,
- limit: Number
- });
- const uploadProps = runtime.buildProps({
- ...uploadBaseProps,
- beforeUpload: {
- type: runtime.definePropType(Function),
- default: shared.NOOP
- },
- beforeRemove: {
- type: runtime.definePropType(Function)
- },
- onRemove: {
- type: runtime.definePropType(Function),
- default: shared.NOOP
- },
- onChange: {
- type: runtime.definePropType(Function),
- default: shared.NOOP
- },
- onPreview: {
- type: runtime.definePropType(Function),
- default: shared.NOOP
- },
- onSuccess: {
- type: runtime.definePropType(Function),
- default: shared.NOOP
- },
- onProgress: {
- type: runtime.definePropType(Function),
- default: shared.NOOP
- },
- onError: {
- type: runtime.definePropType(Function),
- default: shared.NOOP
- },
- onExceed: {
- type: runtime.definePropType(Function),
- default: shared.NOOP
- },
- crossorigin: {
- type: runtime.definePropType(String)
- }
- });
- exports.genFileId = genFileId;
- exports.uploadBaseProps = uploadBaseProps;
- exports.uploadListTypes = uploadListTypes;
- exports.uploadProps = uploadProps;
- //# sourceMappingURL=upload.js.map
|