Code Monkey home page Code Monkey logo

dropzone-ui-react's Introduction

🚀 Spanish README

Dropzone UI

license npm latest package Rate on Openbase kandi X-Ray Node.js CI Build Status Known Vulnerabilities Package Quality install size Average time to resolve an issue PRs Welcome GitHub Repo stars

Thank you so much for using dropzone-ui/react ❤️ !

Dropzone UI has grown very fast and has exceeded its original scope. That's why we find reasonable to rebrand it and create a new package taking the best of this one and adding more features and new components. This new package is here and its name is Files UI ⚡. In an very near future we'll stop giving support to dropzone-ui, so we enforce you to upgrade to this new package. In the meanwhile this package will become a wrapper for files-ui.

⚡ Live demos and full documentation : files-ui.com

❤️ it ?, support us by giving a ⭐ on :octocat: Github :D

Important

From now on @files-ui/react is the only dependency. Check out the changelog file to know what's new.

Sample result:

This is a small part of what you can find on files-ui 👀

fui-logo

  • More previews here.

Requirement

@dropzone-ui/react is based on React Hooks. It requires react v16.8+.

Installation

@dropzone-ui/react is available as an npm package.

// with npm
npm i @dropzone-ui/react
// with yarn
yarn add @dropzone-ui/react

Usage and examples

Here is a quick example to get you started, it's all you need:

import * as React from "react";
import ReactDOM from "react-dom";
import { Dropzone, FileMosaic } from "@dropzone-ui/react";

function App() {
  const [files, setFiles] = React.useState([]);
  const updateFiles = (incommingFiles) => {
    setFiles(incommingFiles);
  };
  return (
    <Dropzone onChange={updateFiles} value={files}>
      {files.map((file) => (
        <FileMosaic {...file} preview />
      ))}
    </Dropzone>
  );
}

ReactDOM.render(<App />, document.querySelector("#app"));

Yes, it's really all you need to get started as you can see in these live and interactive demos:

Basic Sample 🍰 Advanced Sample 🔨
Edit Button Edit Button

API documentation

The complete documentation of every component has been moved to files-ui.com API page.

However if you are still using dropzone-ui version 6.7.0 or lower, you can find the documentation and demos here:

Supporters

Special thanks to these amazing people ⭐ :

👏 Stargazers

Stargazers repo roster for @dropzone-ui/dropzone-ui-react

👏 Forkers

Forkers repo roster for @dropzone-ui/dropzone-ui-react

More Previews

Image full screen preview 🖼️

Image full screen preview

Video full screen preview 🎞️

Video full screen preview

FileCard, FileInputButton and Avatar preview 🎴

Video full screen preview

DarkMode 🌙 🌞

darkmode 1 preview

darkmode 2 preview

License

This project is licensed under the terms of the MIT license.

Animated footer bars


Back to top

dropzone-ui-react's People

Contributors

animeallstar avatar corrector-yui avatar dependabot[bot] avatar jinssj3 avatar mateusmx avatar rajinwonderland avatar ssimk0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dropzone-ui-react's Issues

Multiple Files - FileList

Hi Guys, I'm working with the package for a while now, So far is working great with 1 file upload but for some reason I can't make it work with multiple files.

FIrst let me tell you my stack:
In the back I'm using as follows:

  • Nodejs
  • Express js
  • Type-Graphql
  • Typeorm

In the front:

  • Nextjs
  • MUI
  • Apollo Client.

So this is what is happening:

  • When I make a submit with 1 file, we have no issues, it gets upload, creates the url and everything works nice.
  • The problem is when uploading multiple files. So far I've been trying to change everything in the back, and for some reason I'm unable to make it work.
  • But when I try to make a simple it actually works the uploading.
  • So what I was able to figure it out. Is that the component is giving me an array of files .... But for some reason the input is generating something called 'fileList' (unfortunately is read only so I can't create that object) so I tried to create an object from the array, but still I was unable to make it work (Adding some screenshots)

Captura de Pantalla 2022-01-16 a la(s) 15 52 38

So my question is, is there any form we can make this 'fileList' as result when using multiple files instead of just making an array of files ?

I'm happy to pair to figure out the issue/any solution, just send me an email ([email protected]

Regards,

Pablo.

TS new 2.X version not working

Hi,
not sure what you change after version 2.X but I install the new version of dropzone and its start complaning that I should install @types/dropzone-ui, but it looks like that something is wrong.

Could not find a declaration file for module 'dropzone-ui'. '/xxx/node_modules/dropzone-ui/build/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/dropzone-ui` if it exists or add a new declaration (.d.ts) file containing `declare module 'dropzone-ui';`

When I open the npm_modules the structure not look right I add the screenshot of that. Could you help me with that ?

image

The content in the children prop should be visible always

The content in the children's prop should be visible always so you can add custom content when there are no items. This would allow you to add a image and anything else you want to the dropzone when it loads. However, the children's prop only shows once you select items to upload.

  • Prop Name: children
  • Prop Type: Node
  • Prop Desc: The content of the component. Normally a list of FileItem components or a label

Link is not working

Describe the bug
Going to https://dropzone-ui.herokuapp.com/ renders a page with an Application Error from Heroku

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://dropzone-ui.herokuapp.com/
  2. See error

Expected behavior
This URL would load the "Live demo and code generator", as indicated in the README

Screenshots
image

Desktop (please complete the following information):

  • OS: OSX Ventura / 13.0.1 (22A400)
  • Browser: Chrome
  • Version: 108.0.5359.94 (Official Build) (arm64)

Additional context
N/A

Unable to upload the same picture with behaviour "replace" after deleting it

Describe the bug
I wanna to upload one picture. Then I delete it and then I would like to upload it again.
It doesn't work. I need to upload another picture and then I'll be able to upload the picture I wanted.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/complete-946hz?file=/src/index.js
  2. Click on the dropzone
  3. Upload one picture as for example then try to upload the same picture
  4. You can't upload the same picture

Expected behavior
I would like to add a picture, then remove it add the same picture.

Desktop (please complete the following information):

  • OS: windows 10
  • Browser: chrome
  • Version: 97

Axios is required.

Hi there, as always, this is an amazing development you have over here. But I'm currently developing an application with the Backend using TypeGraphql so no need for axios. And I did not had it installed in the front-end but suddenly when I was implementing the dropzone component I got this error:

image

Which kind of force me to install axios.

Is there any chance we can make the package 'axios' independent ?

I placed it as a bug, but if is not up to you guys, feel free to close it.

Let me know if I can help you somehow.

@JinSSJ3 you already have my email so feel free to drop any question and if you like to pair also let me know.

Regards,

Pablo.

Annoying console.log

Describe the bug
on any action, console.log is called
image

"hideViewIcon false" on DropzoneHeader.tsx:41

To Reproduce
Do any action on

styling support

Any change on having more flexibility for the upload button.
location, styling, ...

Selecting same image after delete doesn't work

Describe the bug
When you select same image as before to upload. It doesn't work. However this only happens in case of on click and not in case of drop.

To Reproduce
Steps to reproduce the behavior:

  1. Click on dropzone.
  2. Click on image to select from file manager.
  3. Delete the file from dropzone.
  4. Click on file menu to select same image again.
  5. You'll see it's not showing in the dropzone.

Expected behavior
Image gets selected and previewed second time too via on click manner.

MaxFiles issue

Describe the bug
Setting the following 2 props should result in replacing a single file, however it produces an error every other time. Also not crazy about the end-user experience of showing the files over the maxFile limit with errors on each. It should just replace the files up to the maxFiles size. (I have a workaround for both of these issues in the comment below).
maxFiles={1}
behaviour="replace"

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/dropzone-ui-complete-forked-4wempi
  2. Drop a single image multiple times. Every other drop will produce a max files error

Expected behavior
No error should happen for a single file dropped multiple times.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Version 7.0.2 "Compiled with problems"

Hello,

I encountered a syntax error while using the '@dropzone-ui/react' library in my project. The error message is:

Compiled with problems:

ERROR in ./node_modules/@dropzone-ui/react/build/index.es.js

Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\Users\adiha\OneDrive\Desktop\projects\projects_frontend\node_modules\@dropzone-ui\react\build\index.es.js: Identifier 'e' has already been declared. (1:447)

I have tried the following steps to resolve the issue, but none of them worked:

  1. Updating the package to the latest version.
  2. Uninstalling and reinstalling the package.

I am using the following dependencies:


"dependencies": {
    "@dropzone-ui/react": "^7.0.2",
    "@react-oauth/google": "^0.9.0",
    "@reduxjs/toolkit": "^1.8.6",
    "@tinymce/tinymce-react": "^4.2.0",
    "aws-sdk": "^2.1361.0",
    "axios": "^0.26.1",
    "dropzone": "^6.0.0-beta.2",
    "jwt-decode": "^3.1.2",
    "lodash": "^4.17.21",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.37",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-feather": "^2.0.10",
    "react-image-gallery": "^1.2.11",
    "react-loading-skeleton": "^3.1.0",
    "react-nl2br": "^1.0.4",
    "react-redux": "^8.0.4",
    "react-router-dom": "^6.3.0",
    "react-scripts": "^5.0.0",
    "react-show-more-text": "^1.6.2",
    "react-slick": "^0.29.0",
    "react-tag-input": "^6.8.1",
    "react-waypoint": "^10.3.0",
    "redux-persist": "^6.0.0",
    "slick-carousel": "^1.8.1",
    "underscore": "^1.13.6"
  },

It would be great if you could look into this issue and provide some guidance on how to resolve it. If you need any further information or details, please let me know.

Thank you for your assistance!

React 18 Support

Will there be an update to DropZone UI React to support React 18? Currently I am trying to upgrade my project to use 18 but I am unable to due to dropzone using react 17. I really like using DropZone UI and hope it will be upgraded soon.

Last deleted item always comming back

Everytime I select multiple itens just for view, not upload, and I delete them to select new ones, the last deleted file comes back with selected files.
e.g.: I select files: 'a', 'b', 'c', and I delete all, being 'c' the last one deleted. Then I select 'd' and 'e', in this new selection, file 'c' appears in the list too.

Anyone has already seen something like this? And how could I solve it?
Note: I used the complete example to make a custom dropzone. In my case, the file list appears above dropzone, not inside.

Can't use Dropzone in React 18 Typescript

Describe the bug
Whenever I try to use Dropzone component with children it shows

Property 'children' does not exist on type 'IntrinsicAttributes & DropzoneProps'

To Reproduce
Steps to reproduce the behavior:

  1. Just try to use in project with React 18 and Typescript.

Expected behavior
It should allow me to use the Dropzone

Screenshots

Screenshot 2022-09-17 at 12 23 20 PM

Desktop (please complete the following information):

  • OS: Mac
  • Browser: Any
  • Version: 6.7.10

Footer and Header className prop

Is your feature request related to a problem? Please describe.
We need a className prop for header/footer to be added to "dz-ui-header" "and dz-ui-footer".

Describe the solution you'd like
Add headerClassName footerClassName to specify custom className for header and footer like

<Dropzone
    headerClassName={"headerCustomClass"}
    footerClassName={"footerCustomClass"}
>
  ...
</Dropzone>

Additional context
I tried to specify more than 10 file types with "accept" prop, and the width of the footer is too long, we have a custom css class to wrap the words to prevent line goes offscreen, but there is no way to add our custom class to footer. You can see an example in the following image:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.