94 lines
1.5 KiB
JavaScript
94 lines
1.5 KiB
JavaScript
const DEFAULT_TOOLS = [
|
|
"zoomIn, zoomOut",
|
|
"moveL, moveR, moveT, moveB",
|
|
"rotateL, rotateR",
|
|
"scaleX, scaleY",
|
|
"reset, upload",
|
|
"crop"
|
|
].join(" | ");
|
|
const props = {
|
|
src: String,
|
|
imageType: {
|
|
type: String,
|
|
default: "image/png"
|
|
},
|
|
accept: {
|
|
type: String,
|
|
default: "image/*"
|
|
},
|
|
tools: {
|
|
type: String,
|
|
default: DEFAULT_TOOLS
|
|
},
|
|
showPreview: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
previewWidth: {
|
|
type: Number,
|
|
default: 120
|
|
},
|
|
okText: String,
|
|
toBlob: Boolean,
|
|
options: Object,
|
|
croppedOptions: Object,
|
|
aspectRatio: {
|
|
type: Number,
|
|
default: 1
|
|
},
|
|
viewMode: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
dragMode: {
|
|
type: String,
|
|
default: "crop"
|
|
},
|
|
initialAspectRatio: Number,
|
|
minContainerWidth: {
|
|
type: Number,
|
|
default: 200
|
|
},
|
|
minContainerHeight: {
|
|
type: Number,
|
|
default: 100
|
|
},
|
|
minCanvasWidth: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
minCanvasHeight: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
minCropBoxWidth: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
minCropBoxHeight: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
croppedWidth: Number,
|
|
croppedHeight: Number,
|
|
croppedMinWidth: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
croppedMinHeight: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
croppedMaxWidth: Number,
|
|
croppedMaxHeight: Number,
|
|
croppedFillColor: {
|
|
type: String,
|
|
default: "transparent"
|
|
},
|
|
imageSmoothingEnabled: Boolean,
|
|
imageSmoothingQuality: String
|
|
};
|
|
export {
|
|
props as default
|
|
};
|