@purple/phoenix-components
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -364,5 +364,7 @@ 'use strict'; | ||
var onDrop = React.useCallback(function (acceptedFiles) { | ||
var newFiles = acceptedFiles.map(function (file) { return Object.assign(file, { | ||
preview: URL.createObjectURL(file) | ||
}); }); | ||
var newFiles = acceptedFiles.map(function (file) { | ||
return Object.assign(file, { | ||
preview: URL.createObjectURL(file) | ||
}); | ||
}); | ||
typeof onFileDrop !== 'undefined' && onFileDrop(newFiles); | ||
@@ -372,3 +374,3 @@ setFiles(newFiles); | ||
var _c = reactDropzone.useDropzone({ | ||
accept: acceptedFilePattern || 'image/*', | ||
accept: acceptedFilePattern || ['image/*'], | ||
onDrop: onDrop, | ||
@@ -390,8 +392,6 @@ noClick: true, | ||
React__default.createElement(fa.FaTrashAlt, { size: 15 }))))); })), | ||
isDragActive ? | ||
React__default.createElement("p", null, | ||
dragInstructions || "Drop the files here ...", | ||
" ") : | ||
React__default.createElement("p", null, label || "Drag 'n' drop some files here, or "), | ||
React__default.createElement(UploadButton, { type: "button", onClick: open }, uploadButtonText || "Select files from computer")), | ||
isDragActive ? (React__default.createElement("p", null, | ||
dragInstructions || 'Drop the files here ...', | ||
" ")) : (React__default.createElement("p", null, label || "Drag 'n' drop some files here, or ")), | ||
React__default.createElement(UploadButton, { type: "button", onClick: open }, uploadButtonText || 'Select files from computer')), | ||
typeof error === 'string' && React__default.createElement(Error$4, null, error))); | ||
@@ -398,0 +398,0 @@ }; |
@@ -356,5 +356,7 @@ import React__default, { createElement, useState, useEffect, useCallback } from 'react'; | ||
var onDrop = useCallback(function (acceptedFiles) { | ||
var newFiles = acceptedFiles.map(function (file) { return Object.assign(file, { | ||
preview: URL.createObjectURL(file) | ||
}); }); | ||
var newFiles = acceptedFiles.map(function (file) { | ||
return Object.assign(file, { | ||
preview: URL.createObjectURL(file) | ||
}); | ||
}); | ||
typeof onFileDrop !== 'undefined' && onFileDrop(newFiles); | ||
@@ -364,3 +366,3 @@ setFiles(newFiles); | ||
var _c = useDropzone({ | ||
accept: acceptedFilePattern || 'image/*', | ||
accept: acceptedFilePattern || ['image/*'], | ||
onDrop: onDrop, | ||
@@ -382,8 +384,6 @@ noClick: true, | ||
React__default.createElement(FaTrashAlt, { size: 15 }))))); })), | ||
isDragActive ? | ||
React__default.createElement("p", null, | ||
dragInstructions || "Drop the files here ...", | ||
" ") : | ||
React__default.createElement("p", null, label || "Drag 'n' drop some files here, or "), | ||
React__default.createElement(UploadButton, { type: "button", onClick: open }, uploadButtonText || "Select files from computer")), | ||
isDragActive ? (React__default.createElement("p", null, | ||
dragInstructions || 'Drop the files here ...', | ||
" ")) : (React__default.createElement("p", null, label || "Drag 'n' drop some files here, or ")), | ||
React__default.createElement(UploadButton, { type: "button", onClick: open }, uploadButtonText || 'Select files from computer')), | ||
typeof error === 'string' && React__default.createElement(Error$4, null, error))); | ||
@@ -390,0 +390,0 @@ }; |
@@ -360,5 +360,7 @@ (function (global, factory) { | ||
var onDrop = React.useCallback(function (acceptedFiles) { | ||
var newFiles = acceptedFiles.map(function (file) { return Object.assign(file, { | ||
preview: URL.createObjectURL(file) | ||
}); }); | ||
var newFiles = acceptedFiles.map(function (file) { | ||
return Object.assign(file, { | ||
preview: URL.createObjectURL(file) | ||
}); | ||
}); | ||
typeof onFileDrop !== 'undefined' && onFileDrop(newFiles); | ||
@@ -368,3 +370,3 @@ setFiles(newFiles); | ||
var _c = reactDropzone.useDropzone({ | ||
accept: acceptedFilePattern || 'image/*', | ||
accept: acceptedFilePattern || ['image/*'], | ||
onDrop: onDrop, | ||
@@ -386,8 +388,6 @@ noClick: true, | ||
React__default.createElement(fa.FaTrashAlt, { size: 15 }))))); })), | ||
isDragActive ? | ||
React__default.createElement("p", null, | ||
dragInstructions || "Drop the files here ...", | ||
" ") : | ||
React__default.createElement("p", null, label || "Drag 'n' drop some files here, or "), | ||
React__default.createElement(UploadButton, { type: "button", onClick: open }, uploadButtonText || "Select files from computer")), | ||
isDragActive ? (React__default.createElement("p", null, | ||
dragInstructions || 'Drop the files here ...', | ||
" ")) : (React__default.createElement("p", null, label || "Drag 'n' drop some files here, or ")), | ||
React__default.createElement(UploadButton, { type: "button", onClick: open }, uploadButtonText || 'Select files from computer')), | ||
typeof error === 'string' && React__default.createElement(Error$4, null, error))); | ||
@@ -394,0 +394,0 @@ }; |
@@ -6,3 +6,3 @@ /// <reference types="react" /> | ||
onFileDrop?: (newFiles: File[]) => void; | ||
acceptedFilePattern?: string; | ||
acceptedFilePattern?: Array<string>; | ||
uploadButtonText?: string; | ||
@@ -9,0 +9,0 @@ onFileRemove?: (file: File) => void; |
{ | ||
"name": "@purple/phoenix-components", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124250