react-dropzone 3.13.0 → 3.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +3 -54
- package/.travis.yml +2 -7
- package/README.md +12 -78
- package/commitlint.config.js +1 -0
- package/dist/index.js +94 -71
- package/dist/index.js.map +1 -1
- package/examples/.eslintrc +3 -0
- package/examples/Accept/Readme.md +63 -11
- package/examples/Basic/Readme.md +9 -12
- package/examples/File Dialog/Readme.md +16 -0
- package/examples/Fullscreen/Readme.md +19 -20
- package/examples/Styling/Readme.md +23 -0
- package/package.json +28 -30
- package/src/__snapshots__/index.spec.js.snap +5 -3
- package/src/getDataTransferItems.js +7 -12
- package/src/getDataTransferItems.spec.js +48 -61
- package/src/index.js +164 -142
- package/src/index.spec.js +604 -592
- package/styleguide.config.js +28 -5
- package/testSetup.js +3 -2
- package/wallaby.config.js +3 -9
- package/webpack.config.js +3 -6
- package/yarn.lock +1549 -1029
- package/examples/Accept/index.js +0 -38
- package/examples/Basic/index.js +0 -26
- package/examples/Fullscreen/index.js +0 -78
- package/examples/Readme.md +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 99cb647892adfe2f2ee0","webpack:///./src/index.js","webpack:///./~/process/browser.js","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///./~/attr-accept/dist/index.js","webpack:///./src/getDataTransferItems.js"],"names":["supportMultiple","document","createElement","Dropzone","e","preventDefault","props","context","renderChildren","children","state","onClick","bind","onDocumentDrop","onDragStart","onDragEnter","onDragLeave","onDragOver","onDrop","onFileDialogCancel","fileAccepted","setRef","isFileDialogActive","isDragActive","acceptedFiles","rejectedFiles","preventDropOnDocument","dragTargets","addEventListener","onDocumentDragOver","body","onfocus","removeEventListener","node","contains","target","call","indexOf","push","allFilesAccepted","multiple","setState","isDragReject","stopPropagation","dataTransfer","dropEffect","err","filter","el","length","onDropAccepted","onDropRejected","disablePreview","fileList","forEach","file","preview","window","URL","createObjectURL","process","env","NODE_ENV","console","error","fileMatchSize","disableClick","open","fileInputEl","setTimeout","FileList","files","ref","type","accept","size","maxSize","minSize","every","value","click","activeClassName","inputProps","name","rejectClassName","rest","activeStyle","className","rejectStyle","style","width","height","borderWidth","borderColor","borderStyle","borderRadius","backgroundColor","appliedStyle","inputAttributes","display","onChange","customProps","divProps","prop","Component","propTypes","string","oneOfType","func","bool","object","number","defaultProps","Infinity","getDataTransferFiles","event","isMultipleAllowed","dataTransferItemsList","dt","items","Array","prototype","slice"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;ACpCA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;gfALA;;AAOA,KAAMA,kBAAmB,OAAOC,QAAP,KAAoB,WAApB,IAAmCA,QAAnC,IAA+CA,SAASC,aAAzD,GACtB,cAAcD,SAASC,aAAT,CAAuB,OAAvB,CADQ,GAEtB,IAFF;;KAIMC,Q;;;;;wCACsBC,C,EAAG;AAC3B;AACAA,SAAEC,cAAF;AACD;;;AAED,qBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,qHACpBD,KADoB,EACbC,OADa;;AAAA,WA8N5BC,cA9N4B,GA8NX,UAACC,QAAD,EAAc;AAC7B,WAAI,OAAOA,QAAP,KAAoB,UAAxB,EAAoC;AAClC,gBAAOA,SAAS,MAAKC,KAAd,CAAP;AACD;AACD,cAAOD,QAAP;AACD,MAnO2B;;AAE1B,WAAKE,OAAL,GAAe,MAAKA,OAAL,CAAaC,IAAb,OAAf;AACA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA2B;AAC3B;AACA;AACA;AACA,6BAA4B,UAAU;;;;;;;ACnLtC,gD;;;;;;ACAA,gD;;;;;;ACAA,4BAA2B,cAAc,4BAA4B,YAAY,UAAU,iBAAiB,gEAAgE,SAAS,+BAA+B,kBAAkB,aAAa,qDAAqD,SAAS,iBAAiB,wFAAwF,OAAO,qBAAqB,eAAe,kHAAkH,GAAG,GAAG,iCAAiC,SAAS,wBAAwB,eAAe,iBAAiB,iBAAiB,8BAA8B,eAAe,8IAA8I,8BAA8B,iBAAiB,+DAA+D,kBAAkB,6BAA6B,mBAAmB,sDAAsD,WAAW,yBAAyB,EAAE,SAAS,kKAAkK,UAAU,2DAA2D,iBAAiB,mBAAmB,gCAAgC,6BAA6B,iBAAiB,iBAAiB,eAAe,aAAa,WAAW,mDAAmD,gNAAgN,eAAe,wBAAwB,sBAAsB,mEAAmE,iBAAiB,iCAAiC,sBAAsB,qDAAq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tC;AACA;AACAoE,+BAAwBC,GAAGC,KAA3B;AACD;AACF,IATD,MASO,IAAIJ,MAAMhF,MAAN,IAAgBgF,MAAMhF,MAAN,CAAaoC,KAAjC,EAAwC;AAC7C8C,6BAAwBF,MAAMhF,MAAN,CAAaoC,KAArC;AACD;;AAED,OAAI8C,sBAAsBpE,MAAtB,GAA+B,CAAnC,EAAsC;AACpCoE,6BAAwBD,oBAAoBC,qBAApB,GAA4C,CAACA,sBAAsB,CAAtB,CAAD,CAApE;AACD;;AAED;AACA,UAAOG,MAAMC,SAAN,CAAgBC,KAAhB,CAAsBtF,IAAtB,CAA2BiF,qBAA3B,CAAP;AACD","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"prop-types\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"prop-types\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Dropzone\"] = factory(require(\"react\"), require(\"prop-types\"));\n\telse\n\t\troot[\"Dropzone\"] = factory(root[\"react\"], root[\"prop-types\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 99cb647892adfe2f2ee0","/* eslint prefer-template: 0 */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport accepts from 'attr-accept';\nimport getDataTransferItems from './getDataTransferItems';\n\nconst supportMultiple = (typeof document !== 'undefined' && document && document.createElement) ?\n 'multiple' in document.createElement('input') :\n true;\n\nclass Dropzone extends React.Component {\n static onDocumentDragOver(e) {\n // allow the entire document to be a drag target\n e.preventDefault();\n }\n\n constructor(props, context) {\n super(props, context);\n this.onClick = this.onClick.bind(this);\n this.onDocumentDrop = this.onDocumentDrop.bind(this);\n this.onDragStart = this.onDragStart.bind(this);\n this.onDragEnter = this.onDragEnter.bind(this);\n this.onDragLeave = this.onDragLeave.bind(this);\n this.onDragOver = this.onDragOver.bind(this);\n this.onDrop = this.onDrop.bind(this);\n this.onFileDialogCancel = this.onFileDialogCancel.bind(this);\n this.fileAccepted = this.fileAccepted.bind(this);\n this.setRef = this.setRef.bind(this);\n this.isFileDialogActive = false;\n this.state = {\n isDragActive: false,\n acceptedFiles: [],\n rejectedFiles: []\n };\n }\n\n componentDidMount() {\n const { preventDropOnDocument } = this.props;\n this.dragTargets = [];\n\n if (preventDropOnDocument) {\n document.addEventListener('dragover', Dropzone.onDocumentDragOver, false);\n document.addEventListener('drop', this.onDocumentDrop, false);\n }\n // Tried implementing addEventListener, but didn't work out\n document.body.onfocus = this.onFileDialogCancel;\n }\n\n componentWillUnmount() {\n const { preventDropOnDocument } = this.props;\n if (preventDropOnDocument) {\n document.removeEventListener('dragover', Dropzone.onDocumentDragOver);\n document.removeEventListener('drop', this.onDocumentDrop);\n }\n // Can be replaced with removeEventListener, if addEventListener works\n document.body.onfocus = null;\n }\n\n onDocumentDrop(e) {\n if (this.node.contains(e.target)) {\n // if we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n e.preventDefault();\n this.dragTargets = [];\n }\n\n onDragStart(e) {\n if (this.props.onDragStart) {\n this.props.onDragStart.call(this, e);\n }\n }\n\n onDragEnter(e) {\n e.preventDefault();\n\n // Count the dropzone and any children that are entered.\n if (this.dragTargets.indexOf(e.target) === -1) {\n this.dragTargets.push(e.target);\n }\n\n const allFilesAccepted = this.allFilesAccepted(getDataTransferItems(e, this.props.multiple));\n\n this.setState({\n isDragActive: allFilesAccepted,\n isDragReject: !allFilesAccepted\n });\n\n if (this.props.onDragEnter) {\n this.props.onDragEnter.call(this, e);\n }\n }\n\n onDragOver(e) { // eslint-disable-line class-methods-use-this\n e.preventDefault();\n e.stopPropagation();\n try {\n e.dataTransfer.dropEffect = 'copy'; // eslint-disable-line no-param-reassign\n } catch (err) {\n // continue regardless of error\n }\n\n if (this.props.onDragOver) {\n this.props.onDragOver.call(this, e);\n }\n return false;\n }\n\n onDragLeave(e) {\n e.preventDefault();\n\n // Only deactivate once the dropzone and all children have been left.\n this.dragTargets = this.dragTargets.filter(el => el !== e.target && this.node.contains(el));\n if (this.dragTargets.length > 0) {\n return;\n }\n\n this.setState({\n isDragActive: false,\n isDragReject: false\n });\n\n if (this.props.onDragLeave) {\n this.props.onDragLeave.call(this, e);\n }\n }\n\n onDrop(e) {\n const { onDrop, onDropAccepted, onDropRejected, multiple, disablePreview } = this.props;\n const fileList = getDataTransferItems(e, multiple);\n const acceptedFiles = [];\n const rejectedFiles = [];\n\n // Stop default browser behavior\n e.preventDefault();\n\n // Reset the counter along with the drag on a drop.\n this.dragTargets = [];\n this.isFileDialogActive = false;\n\n fileList.forEach((file) => {\n if (!disablePreview) {\n try {\n file.preview = window.URL.createObjectURL(file); // eslint-disable-line no-param-reassign\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Failed to generate preview for file', file, err); // eslint-disable-line no-console\n }\n }\n }\n\n if (this.fileAccepted(file) && this.fileMatchSize(file)) {\n acceptedFiles.push(file);\n } else {\n rejectedFiles.push(file);\n }\n });\n\n if (onDrop) {\n onDrop.call(this, acceptedFiles, rejectedFiles, e);\n }\n\n if (rejectedFiles.length > 0 && onDropRejected) {\n onDropRejected.call(this, rejectedFiles, e);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted.call(this, acceptedFiles, e);\n }\n\n // Reset drag state\n this.setState({\n isDragActive: false,\n isDragReject: false,\n acceptedFiles,\n rejectedFiles\n });\n }\n\n onClick(e) {\n const { onClick, disableClick } = this.props;\n if (!disableClick) {\n e.stopPropagation();\n this.open();\n if (onClick) {\n onClick.call(this, e);\n }\n }\n }\n\n onFileDialogCancel() {\n // timeout will not recognize context of this method\n const { onFileDialogCancel } = this.props;\n const { fileInputEl } = this;\n let { isFileDialogActive } = this;\n // execute the timeout only if the onFileDialogCancel is defined and FileDialog\n // is opened in the browser\n if (onFileDialogCancel && isFileDialogActive) {\n setTimeout(() => {\n // Returns an object as FileList\n const FileList = fileInputEl.files;\n if (!FileList.length) {\n isFileDialogActive = false;\n onFileDialogCancel();\n }\n }, 300);\n }\n }\n\n setRef(ref) {\n this.node = ref;\n }\n\n fileAccepted(file) {\n // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n // that MIME type will always be accepted\n return file.type === 'application/x-moz-file' || accepts(file, this.props.accept);\n }\n\n fileMatchSize(file) {\n return file.size <= this.props.maxSize && file.size >= this.props.minSize;\n }\n\n allFilesAccepted(files) {\n return files.every(this.fileAccepted);\n }\n\n /**\n * Open system file upload dialog.\n *\n * @public\n */\n open() {\n this.isFileDialogActive = true;\n this.fileInputEl.value = null;\n this.fileInputEl.click();\n }\n\n renderChildren = (children) => {\n if (typeof children === 'function') {\n return children(this.state);\n }\n return children;\n }\n\n render() {\n const {\n accept,\n activeClassName,\n inputProps,\n multiple,\n name,\n rejectClassName,\n children,\n ...rest\n } = this.props;\n\n let {\n activeStyle,\n className,\n rejectStyle,\n style,\n ...props // eslint-disable-line prefer-const\n } = rest;\n\n const { isDragActive, isDragReject } = this.state;\n\n className = className || '';\n\n if (isDragActive && activeClassName) {\n className += ' ' + activeClassName;\n }\n if (isDragReject && rejectClassName) {\n className += ' ' + rejectClassName;\n }\n\n if (!className && !style && !activeStyle && !rejectStyle) {\n style = {\n width: 200,\n height: 200,\n borderWidth: 2,\n borderColor: '#666',\n borderStyle: 'dashed',\n borderRadius: 5\n };\n activeStyle = {\n borderStyle: 'solid',\n borderColor: '#6c6',\n backgroundColor: '#eee'\n };\n rejectStyle = {\n borderStyle: 'solid',\n borderColor: '#c66',\n backgroundColor: '#eee'\n };\n }\n\n let appliedStyle;\n if (activeStyle && isDragActive) {\n appliedStyle = {\n ...style,\n ...activeStyle\n };\n } else if (rejectStyle && isDragReject) {\n appliedStyle = {\n ...style,\n ...rejectStyle\n };\n } else {\n appliedStyle = {\n ...style\n };\n }\n\n const inputAttributes = {\n accept,\n type: 'file',\n style: { display: 'none' },\n multiple: supportMultiple && multiple,\n ref: el => this.fileInputEl = el, // eslint-disable-line\n onChange: this.onDrop\n };\n\n if (name && name.length) {\n inputAttributes.name = name;\n }\n\n // Remove custom properties before passing them to the wrapper div element\n const customProps = [\n 'acceptedFiles',\n 'preventDropOnDocument',\n 'disablePreview',\n 'disableClick',\n 'onDropAccepted',\n 'onDropRejected',\n 'onFileDialogCancel',\n 'maxSize',\n 'minSize'\n ];\n const divProps = { ...props };\n customProps.forEach(prop => delete divProps[prop]);\n\n return (\n <div\n className={className}\n style={appliedStyle}\n {...divProps/* expand user provided props first so event handlers are never overridden */}\n onClick={this.onClick}\n onDragStart={this.onDragStart}\n onDragEnter={this.onDragEnter}\n onDragOver={this.onDragOver}\n onDragLeave={this.onDragLeave}\n onDrop={this.onDrop}\n ref={this.setRef}\n >\n {this.renderChildren(children)}\n <input\n {...inputProps/* expand user provided inputProps first so inputAttributes override them */}\n {...inputAttributes}\n />\n </div>\n );\n }\n}\n\nDropzone.propTypes = {\n /**\n * Allow specific types of files. See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable accross platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/okonet/react-dropzone/issues/276\n */\n accept: PropTypes.string,\n\n /**\n * Contents of the dropzone\n */\n children: PropTypes.oneOfType([\n PropTypes.node,\n PropTypes.func\n ]),\n\n /**\n * Disallow clicking on the dropzone container to open file dialog\n */\n disableClick: PropTypes.bool,\n\n /**\n * Enable/disable preview generation\n */\n disablePreview: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * Pass additional attributes to the `<input type=\"file\"/>` tag\n */\n inputProps: PropTypes.object,\n\n /**\n * Allow dropping multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * `name` attribute for the input tag\n */\n name: PropTypes.string,\n\n /**\n * Maximum file size\n */\n maxSize: PropTypes.number,\n\n /**\n * Minimum file size\n */\n minSize: PropTypes.number,\n\n /**\n * className\n */\n className: PropTypes.string,\n\n /**\n * className for accepted state\n */\n activeClassName: PropTypes.string,\n\n /**\n * className for rejected state\n */\n rejectClassName: PropTypes.string,\n\n /**\n * CSS styles to apply\n */\n style: PropTypes.object,\n\n /**\n * CSS styles to apply when drop will be accepted\n */\n activeStyle: PropTypes.object,\n\n /**\n * CSS styles to apply when drop will be rejected\n */\n rejectStyle: PropTypes.object,\n\n /**\n * onClick callback\n * @param {Event} event\n */\n onClick: PropTypes.func,\n\n /**\n * onDrop callback\n */\n onDrop: PropTypes.func,\n\n /**\n * onDropAccepted callback\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * onDropRejected callback\n */\n onDropRejected: PropTypes.func,\n\n /**\n * onDragStart callback\n */\n onDragStart: PropTypes.func,\n\n /**\n * onDragEnter callback\n */\n onDragEnter: PropTypes.func,\n\n /**\n * onDragOver callback\n */\n onDragOver: PropTypes.func,\n\n /**\n * onDragLeave callback\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Provide a callback on clicking the cancel button of the file dialog\n */\n onFileDialogCancel: PropTypes.func\n};\n\nDropzone.defaultProps = {\n preventDropOnDocument: true,\n disablePreview: false,\n disableClick: false,\n multiple: true,\n maxSize: Infinity,\n minSize: 0\n};\n\nexport default Dropzone;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 1\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 2\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"prop-types\"\n// module id = 3\n// module chunks = 0","module.exports=function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p=\"\",n(0)}([function(t,n,r){\"use strict\";n.__esModule=!0,r(8),r(9),n[\"default\"]=function(t,n){if(t&&n){var r=function(){var r=Array.isArray(n)?n:n.split(\",\"),e=t.name||\"\",o=t.type||\"\",i=o.replace(/\\/.*$/,\"\");return{v:r.some(function(t){var n=t.trim();return\".\"===n.charAt(0)?e.toLowerCase().endsWith(n.toLowerCase()):/\\/\\*$/.test(n)?i===n.replace(/\\/.*$/,\"\"):o===n})}}();if(\"object\"==typeof r)return r.v}return!0},t.exports=n[\"default\"]},function(t,n){var r=t.exports={version:\"1.2.2\"};\"number\"==typeof __e&&(__e=r)},function(t,n){var r=t.exports=\"undefined\"!=typeof window&&window.Math==Math?window:\"undefined\"!=typeof self&&self.Math==Math?self:Function(\"return this\")();\"number\"==typeof __g&&(__g=r)},function(t,n,r){var e=r(2),o=r(1),i=r(4),u=r(19),c=\"prototype\",f=function(t,n){return function(){return t.apply(n,arguments)}},s=function(t,n,r){var a,p,l,y,d=t&s.G,h=t&s.P,v=d?e:t&s.S?e[n]||(e[n]={}):(e[n]||{})[c],x=d?o:o[n]||(o[n]={});d&&(r=n);for(a in r)p=!(t&s.F)&&v&&a in v,l=(p?v:r)[a],y=t&s.B&&p?f(l,e):h&&\"function\"==typeof l?f(Function.call,l):l,v&&!p&&u(v,a,l),x[a]!=l&&i(x,a,y),h&&((x[c]||(x[c]={}))[a]=l)};e.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,n,r){var e=r(5),o=r(18);t.exports=r(22)?function(t,n,r){return e.setDesc(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return\"Symbol(\".concat(void 0===t?\"\":t,\")_\",(++r+e).toString(36))}},function(t,n,r){var e=r(20)(\"wks\"),o=r(2).Symbol;t.exports=function(t){return e[t]||(e[t]=o&&o[t]||(o||r(6))(\"Symbol.\"+t))}},function(t,n,r){r(26),t.exports=r(1).Array.some},function(t,n,r){r(25),t.exports=r(1).String.endsWith},function(t,n){t.exports=function(t){if(\"function\"!=typeof t)throw TypeError(t+\" is not a function!\");return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(10);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError(\"Can't call method on \"+t);return t}},function(t,n,r){t.exports=function(t){var n=/./;try{\"/./\"[t](n)}catch(e){try{return n[r(7)(\"match\")]=!1,!\"/./\"[t](n)}catch(o){}}return!0}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return\"object\"==typeof t?null!==t:\"function\"==typeof t}},function(t,n,r){var e=r(16),o=r(11),i=r(7)(\"match\");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:\"RegExp\"==o(t))}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),o=r(4),i=r(6)(\"src\"),u=\"toString\",c=Function[u],f=(\"\"+c).split(u);r(1).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,r,u){\"function\"==typeof r&&(o(r,i,t[n]?\"\"+t[n]:f.join(String(n))),\"name\"in r||(r.name=n)),t===e?t[n]=r:(u||delete t[n],o(t,n,r))})(Function.prototype,u,function(){return\"function\"==typeof this&&this[i]||c.call(this)})},function(t,n,r){var e=r(2),o=\"__core-js_shared__\",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e=r(17),o=r(13);t.exports=function(t,n,r){if(e(n))throw TypeError(\"String#\"+r+\" doesn't accept regex!\");return String(o(t))}},function(t,n,r){t.exports=!r(15)(function(){return 7!=Object.defineProperty({},\"a\",{get:function(){return 7}}).a})},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(23),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){\"use strict\";var e=r(3),o=r(24),i=r(21),u=\"endsWith\",c=\"\"[u];e(e.P+e.F*r(14)(u),\"String\",{endsWith:function(t){var n=i(this,t,u),r=arguments,e=r.length>1?r[1]:void 0,f=o(n.length),s=void 0===e?f:Math.min(o(e),f),a=String(t);return c?c.call(n,a,s):n.slice(s-a.length,s)===a}})},function(t,n,r){var e=r(5),o=r(3),i=r(1).Array||Array,u={},c=function(t,n){e.each.call(t.split(\",\"),function(t){void 0==n&&t in i?u[t]=i[t]:t in[]&&(u[t]=r(12)(Function.call,[][t],n))})};c(\"pop,reverse,shift,keys,values,entries\",1),c(\"indexOf,every,some,forEach,map,filter,find,findIndex,includes\",3),c(\"join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill\"),o(o.S,\"Array\",u)}]);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/attr-accept/dist/index.js\n// module id = 4\n// module chunks = 0","export default function getDataTransferFiles(event, isMultipleAllowed = true) {\n let dataTransferItemsList = [];\n if (event.dataTransfer) {\n const dt = event.dataTransfer;\n if (dt.files && dt.files.length) {\n dataTransferItemsList = dt.files;\n } else if (dt.items && dt.items.length) {\n // During the drag even the dataTransfer.files is null\n // but Chrome implements some drag store, which is accesible via dataTransfer.items\n dataTransferItemsList = dt.items;\n }\n } else if (event.target && event.target.files) {\n dataTransferItemsList = event.target.files;\n }\n\n if (dataTransferItemsList.length > 0) {\n dataTransferItemsList = isMultipleAllowed ? dataTransferItemsList : [dataTransferItemsList[0]];\n }\n\n // Convert from DataTransferItemsList to the native Array\n return Array.prototype.slice.call(dataTransferItemsList);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/getDataTransferItems.js"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap b7b02f081916d4b544ef","webpack:///./src/index.js","webpack:///./~/process/browser.js","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///./~/attr-accept/dist/index.js","webpack:///./src/getDataTransferItems.js"],"names":["supportMultiple","document","createElement","fileAccepted","file","accept","type","Dropzone","evt","preventDefault","props","context","renderChildren","children","isDragActive","isDragReject","state","onClick","bind","onDocumentDrop","onDragStart","onDragEnter","onDragLeave","onDragOver","onDrop","onFileDialogCancel","setRef","setRefs","onInputElementClick","isFileDialogActive","draggedFiles","acceptedFiles","rejectedFiles","preventDropOnDocument","dragTargets","addEventListener","onDocumentDragOver","fileInputEl","body","onfocus","removeEventListener","node","contains","target","call","indexOf","push","setState","stopPropagation","dataTransfer","dropEffect","err","filter","el","length","onDropAccepted","onDropRejected","multiple","disablePreview","fileList","forEach","preview","window","URL","createObjectURL","process","env","NODE_ENV","console","error","fileMatchSize","splice","disableClick","setTimeout","open","inputProps","FileList","files","ref","size","maxSize","minSize","every","value","click","activeClassName","name","rejectClassName","rest","activeStyle","className","rejectStyle","style","filesCount","isMultipleAllowed","allFilesAccepted","width","height","borderWidth","borderColor","borderStyle","borderRadius","backgroundColor","appliedStyle","inputAttributes","display","onChange","customProps","divProps","prop","Component","propTypes","string","oneOfType","func","bool","object","number","defaultProps","Infinity","getDataTransferFiles","event","dataTransferItemsList","dt","items","Array","prototype","slice"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;ACpCA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;;;gfALA;;AAOA,KAAMA,kBAAkB,OAAOC,QAAP,KAAoB,WAApB,IAAmCA,QAAnC,IAA+CA,SAASC,aAAxD,GACpB,cAAcD,SAASC,aAAT,CAAuB,OAAvB,CADM,GAEpB,IAFJ;;AAIA,UAASC,YAAT,CAAsBC,IAAtB,EAA4BC,MAA5B,EAAoC;AAClC;AACA;AACA,UAAOD,KAAKE,IAAL,KAAc,wBAAd,IAA0C,0BAAQF,IAAR,EAA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AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAqC;;AAErC;AACA;AACA;;AAEA,4BAA2B;AAC3B;AACA;AACA;AACA,6BAA4B,UAAU;;;;;;;ACvLtC,gD;;;;;;ACAA,gD;;;;;;ACAA,4BAA2B,cAAc,4BAA4B,YAAY,UAAU,iBAAiB,gEAAgE,SAAS,+BAA+B,kBAAkB,aAAa,qDAAqD,SAAS,iBAAiB,wFAAwF,OAAO,qBAAqB,eAAe,kHAAkH,GAAG,GAAG,iCAAiC,SAAS,wBAAwB,eAAe,iBAAiB,iBAAiB,8BAA8B,eAAe,8IAA8I,8BAA8B,iBAAiB,+DAA+D,kBAAkB,6BAA6B,mBAAmB,sDAAsD,WAAW,yBAAyB,EAAE,SAAS,kKAAkK,UAAU,2DAA2D,iBAAiB,mBAAmB,gCAAgC,6BAA6B,iBAAiB,iBAAiB,eAAe,aAAa,WAAW,mDAAmD,gNAAgN,eAAe,wBAAwB,sBAAsB,mEAAmE,iBAAiB,iCAAiC,sBAAsB,qDAAqD,iBAAiB,gCAAgC,iBAAi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,MAAM9E,MAAN,IAAgB8E,MAAM9E,MAAN,CAAakC,KAAjC,EAAwC;AAC7C6C,6BAAwBD,MAAM9E,MAAN,CAAakC,KAArC;AACD;AACD;AACA,UAAOgD,MAAMC,SAAN,CAAgBC,KAAhB,CAAsBnF,IAAtB,CAA2B8E,qBAA3B,CAAP;AACD","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"prop-types\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"prop-types\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Dropzone\"] = factory(require(\"react\"), require(\"prop-types\"));\n\telse\n\t\troot[\"Dropzone\"] = factory(root[\"react\"], root[\"prop-types\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap b7b02f081916d4b544ef","/* eslint prefer-template: 0 */\n\nimport React from 'react'\nimport PropTypes from 'prop-types'\nimport accepts from 'attr-accept'\nimport getDataTransferItems from './getDataTransferItems'\n\nconst supportMultiple = typeof document !== 'undefined' && document && document.createElement\n ? 'multiple' in document.createElement('input')\n : true\n\nfunction fileAccepted(file, accept) {\n // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n // that MIME type will always be accepted\n return file.type === 'application/x-moz-file' || accepts(file, accept)\n}\n\nclass Dropzone extends React.Component {\n static onDocumentDragOver(evt) {\n // allow the entire document to be a drag target\n evt.preventDefault()\n }\n\n constructor(props, context) {\n super(props, context)\n this.onClick = this.onClick.bind(this)\n this.onDocumentDrop = this.onDocumentDrop.bind(this)\n this.onDragStart = this.onDragStart.bind(this)\n this.onDragEnter = this.onDragEnter.bind(this)\n this.onDragLeave = this.onDragLeave.bind(this)\n this.onDragOver = this.onDragOver.bind(this)\n this.onDrop = this.onDrop.bind(this)\n this.onFileDialogCancel = this.onFileDialogCancel.bind(this)\n this.setRef = this.setRef.bind(this)\n this.setRefs = this.setRefs.bind(this)\n this.onInputElementClick = this.onInputElementClick.bind(this)\n this.isFileDialogActive = false\n this.state = {\n draggedFiles: [],\n acceptedFiles: [],\n rejectedFiles: []\n }\n }\n\n componentDidMount() {\n const { preventDropOnDocument } = this.props\n this.dragTargets = []\n\n if (preventDropOnDocument) {\n document.addEventListener('dragover', Dropzone.onDocumentDragOver, false)\n document.addEventListener('drop', this.onDocumentDrop, false)\n }\n this.fileInputEl.addEventListener('click', this.onInputElementClick, false)\n // Tried implementing addEventListener, but didn't work out\n document.body.onfocus = this.onFileDialogCancel\n }\n\n componentWillUnmount() {\n const { preventDropOnDocument } = this.props\n if (preventDropOnDocument) {\n document.removeEventListener('dragover', Dropzone.onDocumentDragOver)\n document.removeEventListener('drop', this.onDocumentDrop)\n }\n this.fileInputEl.removeEventListener('click', this.onInputElementClick, false)\n // Can be replaced with removeEventListener, if addEventListener works\n document.body.onfocus = null\n }\n\n onDocumentDrop(evt) {\n if (this.node.contains(evt.target)) {\n // if we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return\n }\n evt.preventDefault()\n this.dragTargets = []\n }\n\n onDragStart(evt) {\n if (this.props.onDragStart) {\n this.props.onDragStart.call(this, evt)\n }\n }\n\n onDragEnter(evt) {\n evt.preventDefault()\n\n // Count the dropzone and any children that are entered.\n if (this.dragTargets.indexOf(evt.target) === -1) {\n this.dragTargets.push(evt.target)\n }\n\n this.setState({ draggedFiles: getDataTransferItems(evt) })\n\n if (this.props.onDragEnter) {\n this.props.onDragEnter.call(this, evt)\n }\n }\n\n onDragOver(evt) {\n // eslint-disable-line class-methods-use-this\n evt.preventDefault()\n evt.stopPropagation()\n try {\n evt.dataTransfer.dropEffect = 'copy' // eslint-disable-line no-param-reassign\n } catch (err) {\n // continue regardless of error\n }\n\n if (this.props.onDragOver) {\n this.props.onDragOver.call(this, evt)\n }\n return false\n }\n\n onDragLeave(evt) {\n evt.preventDefault()\n\n // Only deactivate once the dropzone and all children have been left.\n this.dragTargets = this.dragTargets.filter(el => el !== evt.target && this.node.contains(el))\n if (this.dragTargets.length > 0) {\n return\n }\n\n // Clear dragging files state\n this.setState({ draggedFiles: [] })\n\n if (this.props.onDragLeave) {\n this.props.onDragLeave.call(this, evt)\n }\n }\n\n onDrop(evt) {\n const { onDrop, onDropAccepted, onDropRejected, multiple, disablePreview, accept } = this.props\n const fileList = getDataTransferItems(evt)\n const acceptedFiles = []\n const rejectedFiles = []\n\n // Stop default browser behavior\n evt.preventDefault()\n\n // Reset the counter along with the drag on a drop.\n this.dragTargets = []\n this.isFileDialogActive = false\n\n fileList.forEach(file => {\n if (!disablePreview) {\n try {\n file.preview = window.URL.createObjectURL(file) // eslint-disable-line no-param-reassign\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Failed to generate preview for file', file, err) // eslint-disable-line no-console\n }\n }\n }\n\n if (fileAccepted(file, accept) && this.fileMatchSize(file)) {\n acceptedFiles.push(file)\n } else {\n rejectedFiles.push(file)\n }\n })\n\n if (!multiple) {\n // if not in multi mode add any extra accepted files to rejected.\n // This will allow end users to easily ignore a multi file drop in \"single\" mode.\n rejectedFiles.push(...acceptedFiles.splice(1))\n }\n\n if (onDrop) {\n onDrop.call(this, acceptedFiles, rejectedFiles, evt)\n }\n\n if (rejectedFiles.length > 0 && onDropRejected) {\n onDropRejected.call(this, rejectedFiles, evt)\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted.call(this, acceptedFiles, evt)\n }\n\n // Clear files value\n this.draggedFiles = null\n\n // Reset drag state\n this.setState({\n draggedFiles: [],\n acceptedFiles,\n rejectedFiles\n })\n }\n\n onClick(evt) {\n const { onClick, disableClick } = this.props\n if (!disableClick) {\n evt.stopPropagation()\n\n if (onClick) {\n onClick.call(this, evt)\n }\n\n // in IE11/Edge the file-browser dialog is blocking, ensure this is behind setTimeout\n // this is so react can handle state changes in the onClick prop above above\n // see: https://github.com/okonet/react-dropzone/issues/450\n setTimeout(this.open.bind(this), 0)\n }\n }\n\n onInputElementClick(evt) {\n evt.stopPropagation()\n if (this.props.inputProps && this.props.inputProps.onClick) {\n this.props.inputProps.onClick()\n }\n }\n\n onFileDialogCancel() {\n // timeout will not recognize context of this method\n const { onFileDialogCancel } = this.props\n const { fileInputEl } = this\n let { isFileDialogActive } = this\n // execute the timeout only if the onFileDialogCancel is defined and FileDialog\n // is opened in the browser\n if (onFileDialogCancel && isFileDialogActive) {\n setTimeout(() => {\n // Returns an object as FileList\n const FileList = fileInputEl.files\n if (!FileList.length) {\n isFileDialogActive = false\n onFileDialogCancel()\n }\n }, 300)\n }\n }\n\n setRef(ref) {\n this.node = ref\n }\n\n setRefs(ref) {\n this.fileInputEl = ref\n }\n\n fileMatchSize(file) {\n return file.size <= this.props.maxSize && file.size >= this.props.minSize\n }\n\n allFilesAccepted(files) {\n return files.every(file => fileAccepted(file, this.props.accept))\n }\n\n /**\n * Open system file upload dialog.\n *\n * @public\n */\n open() {\n this.isFileDialogActive = true\n this.fileInputEl.value = null\n this.fileInputEl.click()\n }\n\n renderChildren = (children, isDragActive, isDragReject) => {\n if (typeof children === 'function') {\n return children({ ...this.state, isDragActive, isDragReject })\n }\n return children\n }\n\n render() {\n const {\n accept,\n activeClassName,\n inputProps,\n multiple,\n name,\n rejectClassName,\n children,\n ...rest\n } = this.props\n\n let {\n activeStyle,\n className,\n rejectStyle,\n style,\n ...props // eslint-disable-line prefer-const\n } = rest\n\n const { draggedFiles } = this.state\n const filesCount = draggedFiles.length\n const isMultipleAllowed = multiple || filesCount <= 1\n const isDragActive = filesCount > 0 && this.allFilesAccepted(draggedFiles)\n const isDragReject = filesCount > 0 && (!isDragActive || !isMultipleAllowed)\n\n className = className || ''\n\n if (isDragActive && activeClassName) {\n className += ' ' + activeClassName\n }\n if (isDragReject && rejectClassName) {\n className += ' ' + rejectClassName\n }\n\n if (!className && !style && !activeStyle && !rejectStyle) {\n style = {\n width: 200,\n height: 200,\n borderWidth: 2,\n borderColor: '#666',\n borderStyle: 'dashed',\n borderRadius: 5\n }\n activeStyle = {\n borderStyle: 'solid',\n borderColor: '#6c6',\n backgroundColor: '#eee'\n }\n rejectStyle = {\n borderStyle: 'solid',\n borderColor: '#c66',\n backgroundColor: '#eee'\n }\n }\n\n let appliedStyle\n if (activeStyle && isDragActive) {\n appliedStyle = {\n ...style,\n ...activeStyle\n }\n } else if (rejectStyle && isDragReject) {\n appliedStyle = {\n ...style,\n ...rejectStyle\n }\n } else {\n appliedStyle = {\n ...style\n }\n }\n\n const inputAttributes = {\n accept,\n type: 'file',\n style: { display: 'none' },\n multiple: supportMultiple && multiple,\n ref: this.setRefs,\n onChange: this.onDrop\n }\n\n if (name && name.length) {\n inputAttributes.name = name\n }\n\n // Remove custom properties before passing them to the wrapper div element\n const customProps = [\n 'acceptedFiles',\n 'preventDropOnDocument',\n 'disablePreview',\n 'disableClick',\n 'onDropAccepted',\n 'onDropRejected',\n 'onFileDialogCancel',\n 'maxSize',\n 'minSize'\n ]\n const divProps = { ...props }\n customProps.forEach(prop => delete divProps[prop])\n\n return (\n <div\n className={className}\n style={appliedStyle}\n {...divProps /* expand user provided props first so event handlers are never overridden */}\n onClick={this.onClick}\n onDragStart={this.onDragStart}\n onDragEnter={this.onDragEnter}\n onDragOver={this.onDragOver}\n onDragLeave={this.onDragLeave}\n onDrop={this.onDrop}\n ref={this.setRef}\n >\n {this.renderChildren(children, isDragActive, isDragReject)}\n <input\n {...inputProps /* expand user provided inputProps first so inputAttributes override them */}\n {...inputAttributes}\n />\n </div>\n )\n }\n}\n\nDropzone.propTypes = {\n /**\n * Allow specific types of files. See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable accross platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all.\n * See: https://github.com/okonet/react-dropzone/issues/276\n */\n accept: PropTypes.string,\n\n /**\n * Contents of the dropzone\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n\n /**\n * Disallow clicking on the dropzone container to open file dialog\n */\n disableClick: PropTypes.bool,\n\n /**\n * Enable/disable preview generation\n */\n disablePreview: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * Pass additional attributes to the `<input type=\"file\"/>` tag\n */\n inputProps: PropTypes.object,\n\n /**\n * Allow dropping multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * `name` attribute for the input tag\n */\n name: PropTypes.string,\n\n /**\n * Maximum file size\n */\n maxSize: PropTypes.number,\n\n /**\n * Minimum file size\n */\n minSize: PropTypes.number,\n\n /**\n * className\n */\n className: PropTypes.string,\n\n /**\n * className for accepted state\n */\n activeClassName: PropTypes.string,\n\n /**\n * className for rejected state\n */\n rejectClassName: PropTypes.string,\n\n /**\n * CSS styles to apply\n */\n style: PropTypes.object,\n\n /**\n * CSS styles to apply when drop will be accepted\n */\n activeStyle: PropTypes.object,\n\n /**\n * CSS styles to apply when drop will be rejected\n */\n rejectStyle: PropTypes.object,\n\n /**\n * onClick callback\n * @param {Event} event\n */\n onClick: PropTypes.func,\n\n /**\n * onDrop callback\n */\n onDrop: PropTypes.func,\n\n /**\n * onDropAccepted callback\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * onDropRejected callback\n */\n onDropRejected: PropTypes.func,\n\n /**\n * onDragStart callback\n */\n onDragStart: PropTypes.func,\n\n /**\n * onDragEnter callback\n */\n onDragEnter: PropTypes.func,\n\n /**\n * onDragOver callback\n */\n onDragOver: PropTypes.func,\n\n /**\n * onDragLeave callback\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Provide a callback on clicking the cancel button of the file dialog\n */\n onFileDialogCancel: PropTypes.func\n}\n\nDropzone.defaultProps = {\n preventDropOnDocument: true,\n disablePreview: false,\n disableClick: false,\n multiple: true,\n maxSize: Infinity,\n minSize: 0\n}\n\nexport default Dropzone\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 1\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 2\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"prop-types\"\n// module id = 3\n// module chunks = 0","module.exports=function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p=\"\",n(0)}([function(t,n,r){\"use strict\";n.__esModule=!0,r(8),r(9),n[\"default\"]=function(t,n){if(t&&n){var r=function(){var r=Array.isArray(n)?n:n.split(\",\"),e=t.name||\"\",o=t.type||\"\",i=o.replace(/\\/.*$/,\"\");return{v:r.some(function(t){var n=t.trim();return\".\"===n.charAt(0)?e.toLowerCase().endsWith(n.toLowerCase()):/\\/\\*$/.test(n)?i===n.replace(/\\/.*$/,\"\"):o===n})}}();if(\"object\"==typeof r)return r.v}return!0},t.exports=n[\"default\"]},function(t,n){var r=t.exports={version:\"1.2.2\"};\"number\"==typeof __e&&(__e=r)},function(t,n){var r=t.exports=\"undefined\"!=typeof window&&window.Math==Math?window:\"undefined\"!=typeof self&&self.Math==Math?self:Function(\"return this\")();\"number\"==typeof __g&&(__g=r)},function(t,n,r){var e=r(2),o=r(1),i=r(4),u=r(19),c=\"prototype\",f=function(t,n){return function(){return t.apply(n,arguments)}},s=function(t,n,r){var a,p,l,y,d=t&s.G,h=t&s.P,v=d?e:t&s.S?e[n]||(e[n]={}):(e[n]||{})[c],x=d?o:o[n]||(o[n]={});d&&(r=n);for(a in r)p=!(t&s.F)&&v&&a in v,l=(p?v:r)[a],y=t&s.B&&p?f(l,e):h&&\"function\"==typeof l?f(Function.call,l):l,v&&!p&&u(v,a,l),x[a]!=l&&i(x,a,y),h&&((x[c]||(x[c]={}))[a]=l)};e.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,n,r){var e=r(5),o=r(18);t.exports=r(22)?function(t,n,r){return e.setDesc(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return\"Symbol(\".concat(void 0===t?\"\":t,\")_\",(++r+e).toString(36))}},function(t,n,r){var e=r(20)(\"wks\"),o=r(2).Symbol;t.exports=function(t){return e[t]||(e[t]=o&&o[t]||(o||r(6))(\"Symbol.\"+t))}},function(t,n,r){r(26),t.exports=r(1).Array.some},function(t,n,r){r(25),t.exports=r(1).String.endsWith},function(t,n){t.exports=function(t){if(\"function\"!=typeof t)throw TypeError(t+\" is not a function!\");return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(10);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError(\"Can't call method on \"+t);return t}},function(t,n,r){t.exports=function(t){var n=/./;try{\"/./\"[t](n)}catch(e){try{return n[r(7)(\"match\")]=!1,!\"/./\"[t](n)}catch(o){}}return!0}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return\"object\"==typeof t?null!==t:\"function\"==typeof t}},function(t,n,r){var e=r(16),o=r(11),i=r(7)(\"match\");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:\"RegExp\"==o(t))}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),o=r(4),i=r(6)(\"src\"),u=\"toString\",c=Function[u],f=(\"\"+c).split(u);r(1).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,r,u){\"function\"==typeof r&&(o(r,i,t[n]?\"\"+t[n]:f.join(String(n))),\"name\"in r||(r.name=n)),t===e?t[n]=r:(u||delete t[n],o(t,n,r))})(Function.prototype,u,function(){return\"function\"==typeof this&&this[i]||c.call(this)})},function(t,n,r){var e=r(2),o=\"__core-js_shared__\",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e=r(17),o=r(13);t.exports=function(t,n,r){if(e(n))throw TypeError(\"String#\"+r+\" doesn't accept regex!\");return String(o(t))}},function(t,n,r){t.exports=!r(15)(function(){return 7!=Object.defineProperty({},\"a\",{get:function(){return 7}}).a})},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(23),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){\"use strict\";var e=r(3),o=r(24),i=r(21),u=\"endsWith\",c=\"\"[u];e(e.P+e.F*r(14)(u),\"String\",{endsWith:function(t){var n=i(this,t,u),r=arguments,e=r.length>1?r[1]:void 0,f=o(n.length),s=void 0===e?f:Math.min(o(e),f),a=String(t);return c?c.call(n,a,s):n.slice(s-a.length,s)===a}})},function(t,n,r){var e=r(5),o=r(3),i=r(1).Array||Array,u={},c=function(t,n){e.each.call(t.split(\",\"),function(t){void 0==n&&t in i?u[t]=i[t]:t in[]&&(u[t]=r(12)(Function.call,[][t],n))})};c(\"pop,reverse,shift,keys,values,entries\",1),c(\"indexOf,every,some,forEach,map,filter,find,findIndex,includes\",3),c(\"join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill\"),o(o.S,\"Array\",u)}]);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/attr-accept/dist/index.js\n// module id = 4\n// module chunks = 0","export default function getDataTransferFiles(event) {\n let dataTransferItemsList = []\n if (event.dataTransfer) {\n const dt = event.dataTransfer\n if (dt.files && dt.files.length) {\n dataTransferItemsList = dt.files\n } else if (dt.items && dt.items.length) {\n // During the drag even the dataTransfer.files is null\n // but Chrome implements some drag store, which is accesible via dataTransfer.items\n dataTransferItemsList = dt.items\n }\n } else if (event.target && event.target.files) {\n dataTransferItemsList = event.target.files\n }\n // Convert from DataTransferItemsList to the native Array\n return Array.prototype.slice.call(dataTransferItemsList)\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/getDataTransferItems.js"],"sourceRoot":""}
|
package/examples/.eslintrc
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
By providing `accept` prop you can make Dropzone to accept specific file types and reject the others.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
The value must be a comma-separated list of unique content type specifiers:
|
|
4
|
+
* A file extension starting with the STOP character (U+002E). (e.g. .jpg, .png, .doc).
|
|
5
|
+
* A valid MIME type with no extensions.
|
|
6
|
+
* audio/* representing sound files.
|
|
7
|
+
* video/* representing video files.
|
|
8
|
+
* image/* representing image files.
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
import React from 'react';
|
|
10
|
+
For more information see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
```
|
|
13
|
+
class Accept extends React.Component {
|
|
14
|
+
constructor() {
|
|
15
|
+
super()
|
|
16
|
+
this.state = {
|
|
17
|
+
accepted: [],
|
|
18
|
+
rejected: []
|
|
19
|
+
}
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
render() {
|
|
@@ -19,7 +25,7 @@ export default class Accept extends React.Component {
|
|
|
19
25
|
<div className="dropzone">
|
|
20
26
|
<Dropzone
|
|
21
27
|
accept="image/jpeg, image/png"
|
|
22
|
-
onDrop={(accepted, rejected) => { this.setState({ accepted, rejected }) }}
|
|
28
|
+
onDrop={(accepted, rejected) => { this.setState({ accepted, rejected }); }}
|
|
23
29
|
>
|
|
24
30
|
<p>Try dropping some files here, or click to select files to upload.</p>
|
|
25
31
|
<p>Only *.jpeg and *.png images will be accepted</p>
|
|
@@ -44,4 +50,50 @@ export default class Accept extends React.Component {
|
|
|
44
50
|
}
|
|
45
51
|
}
|
|
46
52
|
|
|
53
|
+
<Accept />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Browser limitations
|
|
57
|
+
|
|
58
|
+
Because of HTML5 File API differences across different browsers during the drag, Dropzone will only display `rejected` styles in Chrome (and Chromium based browser). It isn't working in Safari nor IE.
|
|
59
|
+
|
|
60
|
+
Also, at this moment it's not possible to read file names (and thus, file extensions) during the drag operation. For that reason, if you want to react on different file types _during_ the drag operation, _you have to use_ mime types and not extensions! For example, the following example won't work even in Chrome:
|
|
61
|
+
|
|
47
62
|
```
|
|
63
|
+
<Dropzone
|
|
64
|
+
accept=".jpeg,.png"
|
|
65
|
+
>
|
|
66
|
+
{({ isDragActive, isDragReject }) => {
|
|
67
|
+
if (isDragActive) {
|
|
68
|
+
return "All files will be accepted";
|
|
69
|
+
}
|
|
70
|
+
if (isDragReject) {
|
|
71
|
+
return "Some files will be rejected";
|
|
72
|
+
}
|
|
73
|
+
return "Dropping some files here...";
|
|
74
|
+
}}
|
|
75
|
+
</Dropzone>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
but this one will:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
<Dropzone
|
|
82
|
+
accept="image/jpeg, image/png"
|
|
83
|
+
>
|
|
84
|
+
{({ isDragActive, isDragReject }) => {
|
|
85
|
+
if (isDragActive) {
|
|
86
|
+
return "All files will be accepted";
|
|
87
|
+
}
|
|
88
|
+
if (isDragReject) {
|
|
89
|
+
return "Some files will be rejected";
|
|
90
|
+
}
|
|
91
|
+
return "Dropping some files here...";
|
|
92
|
+
}}
|
|
93
|
+
</Dropzone>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Notes
|
|
97
|
+
|
|
98
|
+
Mime type determination is not reliable accross platforms. CSV files, for example, are reported as text/plain under macOS but as application/vnd.ms-excel under Windows. In some cases there might not be a mime type set at all.
|
|
99
|
+
|
package/examples/Basic/Readme.md
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
Dropzone with default properties and displays list of the dropped files.
|
|
2
2
|
|
|
3
3
|
```
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export default class Basic extends React.Component {
|
|
11
|
-
|
|
12
|
-
state = { files: [] }
|
|
4
|
+
class Basic extends React.Component {
|
|
5
|
+
constructor() {
|
|
6
|
+
super()
|
|
7
|
+
this.state = { files: [] }
|
|
8
|
+
}
|
|
13
9
|
|
|
14
|
-
onDrop
|
|
10
|
+
onDrop(files) {
|
|
15
11
|
this.setState({
|
|
16
12
|
files
|
|
17
13
|
});
|
|
@@ -21,7 +17,7 @@ export default class Basic extends React.Component {
|
|
|
21
17
|
return (
|
|
22
18
|
<section>
|
|
23
19
|
<div className="dropzone">
|
|
24
|
-
<Dropzone onDrop={this.onDrop}>
|
|
20
|
+
<Dropzone onDrop={this.onDrop.bind(this)}>
|
|
25
21
|
<p>Try dropping some files here, or click to select files to upload.</p>
|
|
26
22
|
</Dropzone>
|
|
27
23
|
</div>
|
|
@@ -38,4 +34,5 @@ export default class Basic extends React.Component {
|
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
36
|
|
|
37
|
+
<Basic />
|
|
41
38
|
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
You can programmatically invoke default OS file promt. In order to do that you'll have to set the ref on your `Dropzone` instance and call the instance `open` method.
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
let dropzoneRef;
|
|
5
|
+
|
|
6
|
+
<div>
|
|
7
|
+
<Dropzone ref={(node) => { dropzoneRef = node; }} onDrop={(accepted, rejected) => { alert(accepted) }}>
|
|
8
|
+
<p>Drop files here.</p>
|
|
9
|
+
</Dropzone>
|
|
10
|
+
<button type="button" onClick={() => { dropzoneRef.open() }}>
|
|
11
|
+
Open File Dialog
|
|
12
|
+
</button>
|
|
13
|
+
</div>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The completion handler for the `open` function is also the `onDrop` function.
|
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
You can wrap the whole app into the dropzone. This will make the whole app a Dropzone target.
|
|
2
2
|
|
|
3
3
|
```
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
accept: '',
|
|
13
|
-
files: [],
|
|
14
|
-
dropzoneActive: false
|
|
4
|
+
class FullScreen extends React.Component {
|
|
5
|
+
constructor() {
|
|
6
|
+
super()
|
|
7
|
+
this.state = {
|
|
8
|
+
accept: '',
|
|
9
|
+
files: [],
|
|
10
|
+
dropzoneActive: false
|
|
11
|
+
}
|
|
15
12
|
}
|
|
16
13
|
|
|
17
|
-
onDragEnter
|
|
14
|
+
onDragEnter() {
|
|
18
15
|
this.setState({
|
|
19
16
|
dropzoneActive: true
|
|
20
17
|
});
|
|
21
18
|
}
|
|
22
19
|
|
|
23
|
-
onDragLeave
|
|
20
|
+
onDragLeave() {
|
|
24
21
|
this.setState({
|
|
25
22
|
dropzoneActive: false
|
|
26
23
|
});
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
onDrop
|
|
26
|
+
onDrop(files) {
|
|
30
27
|
this.setState({
|
|
31
28
|
files,
|
|
32
29
|
dropzoneActive: false
|
|
@@ -39,7 +36,7 @@ export default class FullScreen extends React.Component {
|
|
|
39
36
|
});
|
|
40
37
|
}
|
|
41
38
|
|
|
42
|
-
render
|
|
39
|
+
render() {
|
|
43
40
|
const { accept, files, dropzoneActive } = this.state;
|
|
44
41
|
const overlayStyle = {
|
|
45
42
|
position: 'absolute',
|
|
@@ -57,9 +54,9 @@ export default class FullScreen extends React.Component {
|
|
|
57
54
|
disableClick
|
|
58
55
|
style={{}}
|
|
59
56
|
accept={accept}
|
|
60
|
-
onDrop={this.onDrop}
|
|
61
|
-
onDragEnter={this.onDragEnter}
|
|
62
|
-
onDragLeave={this.onDragLeave}
|
|
57
|
+
onDrop={this.onDrop.bind(this)}
|
|
58
|
+
onDragEnter={this.onDragEnter.bind(this)}
|
|
59
|
+
onDragLeave={this.onDragLeave.bind(this)}
|
|
63
60
|
>
|
|
64
61
|
{ dropzoneActive && <div style={overlayStyle}>Drop files...</div> }
|
|
65
62
|
<div>
|
|
@@ -68,7 +65,7 @@ export default class FullScreen extends React.Component {
|
|
|
68
65
|
<input
|
|
69
66
|
type="text"
|
|
70
67
|
id="mimetypes"
|
|
71
|
-
onChange={this.applyMimeTypes}
|
|
68
|
+
onChange={this.applyMimeTypes.bind(this)}
|
|
72
69
|
/>
|
|
73
70
|
|
|
74
71
|
<h2>Dropped files</h2>
|
|
@@ -83,4 +80,6 @@ export default class FullScreen extends React.Component {
|
|
|
83
80
|
);
|
|
84
81
|
}
|
|
85
82
|
}
|
|
83
|
+
|
|
84
|
+
<FullScreen />
|
|
86
85
|
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
By default, the Dropzone component picks up some default styling to get you started. You can customize `<Dropzone>` by specifying a `style`, `activeStyle` or `rejectStyle` which is applied when a file is dragged over the zone. You can also specify `className`, `activeClassName` or `rejectClassName` if you would rather style using CSS.
|
|
2
|
+
|
|
3
|
+
## Updating styles and contents based on user input
|
|
4
|
+
|
|
5
|
+
By providing a function that returns the component's children you can not only style Dropzone appropriately but also render appropriate content.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
<Dropzone
|
|
9
|
+
accept="image/png"
|
|
10
|
+
>
|
|
11
|
+
{({ isDragActive, isDragReject, acceptedFiles, rejectedFiles }) => {
|
|
12
|
+
if (isDragActive) {
|
|
13
|
+
return "This file is authorized";
|
|
14
|
+
}
|
|
15
|
+
if (isDragReject) {
|
|
16
|
+
return "This file is not authorized";
|
|
17
|
+
}
|
|
18
|
+
return acceptedFiles.length || rejectedFiles.length
|
|
19
|
+
? `Accepted ${acceptedFiles.length}, rejected ${rejectedFiles.length} files`
|
|
20
|
+
: "Try dropping some files.";
|
|
21
|
+
}}
|
|
22
|
+
</Dropzone>
|
|
23
|
+
```
|
package/package.json
CHANGED
|
@@ -3,35 +3,30 @@
|
|
|
3
3
|
"description": "Simple HTML5 drag-drop zone with React.js",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
|
+
"ci": "git-cz",
|
|
6
7
|
"clean": "rimraf ./dist",
|
|
7
8
|
"build": "npm run clean && webpack",
|
|
8
|
-
"prepublish": "NODE_ENV=production npm run build && jest",
|
|
9
9
|
"start": "styleguidist server",
|
|
10
10
|
"styleguide": "styleguidist build",
|
|
11
11
|
"test": "npm run eslint:src && jest --coverage",
|
|
12
|
-
"eslint:src": "eslint ./src ./*.js",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"deps": "npm-check -s",
|
|
17
|
-
"deps:update": "npm-check -u",
|
|
12
|
+
"eslint:src": "eslint ./src ./examples ./*.js",
|
|
13
|
+
"commitmsg": "commitlint -e",
|
|
14
|
+
"precommit": "lint-staged",
|
|
15
|
+
"prepublish": "NODE_ENV=production npm run build && jest",
|
|
18
16
|
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
|
|
19
17
|
"logo": "cd logo && sketchtool export artboards logo.sketch",
|
|
20
18
|
"imagemin": "imagemin --out-dir=logo --plugin=pngquant --plugin=svgo"
|
|
21
19
|
},
|
|
22
20
|
"lint-staged": {
|
|
23
21
|
"*.js": [
|
|
24
|
-
"eslint
|
|
25
|
-
"git
|
|
22
|
+
"eslint --fix",
|
|
23
|
+
"git add"
|
|
26
24
|
],
|
|
27
25
|
"*.{svg,png}": [
|
|
28
26
|
"imagemin",
|
|
29
27
|
"git add"
|
|
30
28
|
]
|
|
31
29
|
},
|
|
32
|
-
"pre-commit": [
|
|
33
|
-
"lint-staged"
|
|
34
|
-
],
|
|
35
30
|
"jest": {
|
|
36
31
|
"setupTestFrameworkScriptFile": "<rootDir>/testSetup.js"
|
|
37
32
|
},
|
|
@@ -54,17 +49,22 @@
|
|
|
54
49
|
"contributors": [
|
|
55
50
|
"Andrey Okonetchnikov <andrey@okonet.ru> (http://okonet.ru)",
|
|
56
51
|
"Mike Olson <me@mwolson.org>",
|
|
57
|
-
"Param Aggarwal"
|
|
52
|
+
"Param Aggarwal",
|
|
53
|
+
"Tyler Waters <tyler.waters@gmail.com>"
|
|
58
54
|
],
|
|
59
55
|
"license": "MIT",
|
|
60
56
|
"peerDependencies": {
|
|
61
|
-
"react": "
|
|
57
|
+
"react": ">=0.14.0"
|
|
62
58
|
},
|
|
63
59
|
"dependencies": {
|
|
64
60
|
"attr-accept": "^1.0.3",
|
|
65
61
|
"prop-types": "^15.5.7"
|
|
66
62
|
},
|
|
67
63
|
"devDependencies": {
|
|
64
|
+
"@commitlint/cli": "^3.0.3",
|
|
65
|
+
"@commitlint/config-angular": "^3.0.3",
|
|
66
|
+
"@commitlint/prompt": "^3.0.3",
|
|
67
|
+
"@commitlint/prompt-cli": "^3.0.3",
|
|
68
68
|
"babel-cli": "^6.9.0",
|
|
69
69
|
"babel-core": "^6.9.1",
|
|
70
70
|
"babel-eslint": "^7.1.1",
|
|
@@ -75,35 +75,33 @@
|
|
|
75
75
|
"babel-preset-react": "^6.3.13",
|
|
76
76
|
"babel-preset-stage-0": "^6.3.13",
|
|
77
77
|
"babel-register": "^6.9.0",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
78
|
+
"commitizen": "^2.9.6",
|
|
79
|
+
"css-loader": "^0.28.1",
|
|
80
80
|
"enzyme": "^2.6.0",
|
|
81
81
|
"eslint": "^3.11.0",
|
|
82
|
-
"eslint-config-
|
|
83
|
-
"
|
|
84
|
-
"eslint-plugin-jsx-a11y": "^2.2.3",
|
|
85
|
-
"eslint-plugin-react": "^6.7.1",
|
|
82
|
+
"eslint-config-okonet": "^4.0.2",
|
|
83
|
+
"husky": "^0.14.3",
|
|
86
84
|
"imagemin-cli": "^3.0.0",
|
|
87
85
|
"imagemin-pngquant": "^5.0.0",
|
|
88
|
-
"jest": "^
|
|
89
|
-
"
|
|
86
|
+
"jest": "^20.0.1",
|
|
87
|
+
"jest-enzyme": "^3.2.0",
|
|
88
|
+
"lint-staged": "^4.0.0",
|
|
90
89
|
"markdownlint-cli": "^0.2.0",
|
|
91
|
-
"
|
|
92
|
-
"pre-commit": "^1.1.3",
|
|
90
|
+
"prettier": "^1.3.1",
|
|
93
91
|
"react": "^15.4.1",
|
|
94
92
|
"react-addons-test-utils": "^15.4.1",
|
|
95
93
|
"react-dom": "^15.4.1",
|
|
96
|
-
"react-styleguidist": "^5.
|
|
94
|
+
"react-styleguidist": "^5.4.2",
|
|
97
95
|
"rimraf": "^2.5.2",
|
|
98
|
-
"semantic-release": "^6.3.
|
|
99
|
-
"sinon": "^
|
|
100
|
-
"style-loader": "^0.
|
|
96
|
+
"semantic-release": "^6.3.6",
|
|
97
|
+
"sinon": "^2.3.1",
|
|
98
|
+
"style-loader": "^0.17.0",
|
|
101
99
|
"webpack": "^1.13.1"
|
|
102
100
|
},
|
|
103
101
|
"config": {
|
|
104
102
|
"commitizen": {
|
|
105
|
-
"path": "
|
|
103
|
+
"path": "@commitlint/prompt"
|
|
106
104
|
}
|
|
107
105
|
},
|
|
108
|
-
"version": "3.13.
|
|
106
|
+
"version": "3.13.4"
|
|
109
107
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Dropzone
|
|
3
|
+
exports[`Dropzone basics should render children 1`] = `"<div class=\\"\\" style=\\"width: 200px; height: 200px; border-width: 2px; border-color: #666; border-style: dashed; border-radius: 5px;\\"><p>some content</p><input type=\\"file\\" multiple=\\"\\" style=\\"display: none;\\"></div>"`;
|
|
4
4
|
|
|
5
|
-
exports[`Dropzone document drop protection
|
|
5
|
+
exports[`Dropzone document drop protection does not prevent stray drops when preventDropOnDocument is false 1`] = `"<div class=\\"\\" style=\\"width: 200px; height: 200px; border-width: 2px; border-color: #666; border-style: dashed; border-radius: 5px;\\"><input type=\\"file\\" multiple=\\"\\" style=\\"display: none;\\"></div>"`;
|
|
6
|
+
|
|
7
|
+
exports[`Dropzone document drop protection installs hooks to prevent stray drops from taking over the browser window 1`] = `"<div class=\\"\\" style=\\"width: 200px; height: 200px; border-width: 2px; border-color: #666; border-style: dashed; border-radius: 5px;\\"><p>Content</p><input type=\\"file\\" multiple=\\"\\" style=\\"display: none;\\"></div>"`;
|