@mmb-digital/ds-lilly 1.0.0-alpha.14 → 1.0.0-alpha.15
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/cjs/_virtual/index.js +1 -1
- package/cjs/_virtual/index2.js +1 -1
- package/cjs/components/Components/Button/Button.d.ts +5 -3
- package/cjs/components/Components/Button/Button.d.ts.map +1 -1
- package/cjs/components/Components/Button/Button.js.map +1 -1
- package/cjs/components/Components/CompactButtons/CompactButtons.d.ts +14 -9
- package/cjs/components/Components/CompactButtons/CompactButtons.d.ts.map +1 -1
- package/cjs/components/Components/CompactButtons/CompactButtons.js +1 -1
- package/cjs/components/Components/CompactButtons/CompactButtons.js.map +1 -1
- package/cjs/components/Components/Dropdown/_elements_/DropdownItem.d.ts +3 -1
- package/cjs/components/Components/Dropdown/_elements_/DropdownItem.d.ts.map +1 -1
- package/cjs/components/Components/Dropdown/_elements_/DropdownItem.js +1 -1
- package/cjs/components/Components/Dropdown/_elements_/DropdownItem.js.map +1 -1
- package/cjs/ds-lilly.css +9 -80
- package/cjs/ext/camelcase/index.js +1 -1
- package/cjs/ext/camelcase/index.js.map +1 -1
- package/cjs/ext/react-dropzone/dist/es/index.js +1 -1
- package/cjs/ext/react-dropzone/dist/es/index.js.map +1 -1
- package/components/Components/Button/Button.d.ts +5 -3
- package/components/Components/Button/Button.d.ts.map +1 -1
- package/components/Components/Button/Button.js.map +1 -1
- package/components/Components/CompactButtons/CompactButtons.d.ts +14 -9
- package/components/Components/CompactButtons/CompactButtons.d.ts.map +1 -1
- package/components/Components/CompactButtons/CompactButtons.js +1 -1
- package/components/Components/CompactButtons/CompactButtons.js.map +1 -1
- package/components/Components/Dropdown/_elements_/DropdownItem.d.ts +3 -1
- package/components/Components/Dropdown/_elements_/DropdownItem.d.ts.map +1 -1
- package/components/Components/Dropdown/_elements_/DropdownItem.js +1 -1
- package/components/Components/Dropdown/_elements_/DropdownItem.js.map +1 -1
- package/ds-lilly.css +9 -80
- package/package.json +1 -1
- /package/assets/{01420ff016daa34fdefb.ttf → 061f2e6070843e2bdf2b.ttf} +0 -0
- /package/assets/{0155dc52849998bcf051.eot → 24cd7e50995435b1d508.eot} +0 -0
- /package/assets/{da97efdffda4f784687f.svg → 593d0da366013fb84dc0.svg} +0 -0
- /package/assets/{a0747b0121c67ec02ebd.eot → 5eaed598b6d24c4b9e0c.eot} +0 -0
- /package/assets/{f102eb9bb1c6c9cf21cd.svg → 637808902e739f90411b.svg} +0 -0
- /package/assets/{ac9c0496cb75ae75f4f2.ttf → 649f003b9ca976a42042.ttf} +0 -0
- /package/assets/{b650ae28703410526950.eot → 791081126ede272967dc.eot} +0 -0
- /package/assets/{8b5644bd1c98f85f56a6.gif → 80a61bd1982ef01771b9.gif} +0 -0
- /package/assets/{65a531ed68dcf5074646.woff → ab0d81996ba12a4f7ad0.woff} +0 -0
- /package/assets/{7386b9ba1155874b6ea5.woff → b807a58bae17e3ac2f93.woff} +0 -0
- /package/assets/{9288da3de8c05c02b14a.gif → d2abd3db573c3cf64583.gif} +0 -0
- /package/assets/{cc21b92903379a739adb.eot → da5a6e78f2fa9496893f.eot} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/react-dropzone/dist/es/index.js"],"sourcesContent":["var _excluded = [\"children\"],\n _excluded2 = [\"open\"],\n _excluded3 = [\"refKey\", \"role\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"],\n _excluded4 = [\"refKey\", \"onChange\", \"onClick\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { fromEvent } from 'file-selector';\nimport { allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, filePickerOptionsTypes, canUseFileSystemAccessAPI, isEvtWithFiles, isIeOrEdge, isPropagationStopped, onDocumentDragOver, TOO_MANY_FILES_REJECTION } from './utils/index';\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * <Dropzone>\n * {({getRootProps, getInputProps}) => (\n * <div {...getRootProps()}>\n * <input {...getInputProps()} />\n * <p>Drag 'n' drop some files here, or click to select files</p>\n * </div>\n * )}\n * </Dropzone>\n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, _excluded);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, _excluded2);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = 'Dropzone'; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null,\n useFsAccessApi: false\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.draggedFiles Files in active drag\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across 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/react-dropzone/react-dropzone/issues/276\n */\n accept: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: 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 * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when opening the file dialog\n */\n onFileDialogOpen: PropTypes.func,\n\n /**\n * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `<input type=\"file\">` click event.\n */\n useFsAccessApi: PropTypes.bool,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Custom validation function\n * @param {File} file\n * @returns {FileError|FileError[]}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise<File[]>)}\n */\n\n/**\n * An object with the current dropzone state and some helper functions.\n *\n * @typedef {object} DropzoneState\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} draggedFiles Files in active drag\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n draggedFiles: [],\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n * <div {...getRootProps()}>\n * <input {...getInputProps()} />\n * <p>Drag and drop some files here, or click to select files</p>\n * </div>\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {string|string[]} [props.accept] Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across 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/react-dropzone/react-dropzone/issues/276\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {boolean} [props.useFsAccessApi] Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `<input type=\"file\">` click event.\n * @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n *\n * @returns {DropzoneState}\n */\n\nexport function useDropzone() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$options = _objectSpread(_objectSpread({}, defaultProps), options),\n accept = _defaultProps$options.accept,\n disabled = _defaultProps$options.disabled,\n getFilesFromEvent = _defaultProps$options.getFilesFromEvent,\n maxSize = _defaultProps$options.maxSize,\n minSize = _defaultProps$options.minSize,\n multiple = _defaultProps$options.multiple,\n maxFiles = _defaultProps$options.maxFiles,\n onDragEnter = _defaultProps$options.onDragEnter,\n onDragLeave = _defaultProps$options.onDragLeave,\n onDragOver = _defaultProps$options.onDragOver,\n onDrop = _defaultProps$options.onDrop,\n onDropAccepted = _defaultProps$options.onDropAccepted,\n onDropRejected = _defaultProps$options.onDropRejected,\n onFileDialogCancel = _defaultProps$options.onFileDialogCancel,\n onFileDialogOpen = _defaultProps$options.onFileDialogOpen,\n useFsAccessApi = _defaultProps$options.useFsAccessApi,\n preventDropOnDocument = _defaultProps$options.preventDropOnDocument,\n noClick = _defaultProps$options.noClick,\n noKeyboard = _defaultProps$options.noKeyboard,\n noDrag = _defaultProps$options.noDrag,\n noDragEventsBubbling = _defaultProps$options.noDragEventsBubbling,\n validator = _defaultProps$options.validator;\n\n var onFileDialogOpenCb = useMemo(function () {\n return typeof onFileDialogOpen === 'function' ? onFileDialogOpen : noop;\n }, [onFileDialogOpen]);\n var onFileDialogCancelCb = useMemo(function () {\n return typeof onFileDialogCancel === 'function' ? onFileDialogCancel : noop;\n }, [onFileDialogCancel]);\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive,\n draggedFiles = state.draggedFiles; // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: 'closeDialog'\n });\n onFileDialogCancelCb();\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n if (useFsAccessApi && canUseFileSystemAccessAPI()) {\n return function () {};\n }\n\n window.addEventListener('focus', onWindowFocus, false);\n return function () {\n window.removeEventListener('focus', onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancelCb, useFsAccessApi]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener('dragover', onDocumentDragOver, false);\n document.addEventListener('drop', onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener('dragover', onDocumentDragOver);\n document.removeEventListener('drop', onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (draggedFiles) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n dispatch({\n draggedFiles: draggedFiles,\n isDragActive: true,\n type: 'setDraggedFiles'\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n });\n }\n }, [getFilesFromEvent, onDragEnter, noDragEventsBubbling]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = 'copy';\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n isDragActive: false,\n type: 'setDraggedFiles',\n draggedFiles: []\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var setFiles = useCallback(function (files, event) {\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n type: 'setFiles'\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n }, [dispatch, multiple, accept, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n setFiles(files, event);\n });\n }\n\n dispatch({\n type: 'reset'\n });\n }, [getFilesFromEvent, setFiles, noDragEventsBubbling]); // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n if (useFsAccessApi && canUseFileSystemAccessAPI()) {\n dispatch({\n type: 'openDialog'\n });\n onFileDialogOpenCb(); // https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n\n var opts = {\n multiple: multiple,\n types: filePickerOptionsTypes(accept)\n };\n window.showOpenFilePicker(opts).then(function (handles) {\n return getFilesFromEvent(handles);\n }).then(function (files) {\n return setFiles(files, null);\n }).catch(function (e) {\n return onFileDialogCancelCb(e);\n }).finally(function () {\n return dispatch({\n type: 'closeDialog'\n });\n });\n return;\n }\n\n if (inputRef.current) {\n dispatch({\n type: 'openDialog'\n });\n onFileDialogOpenCb();\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, accept, multiple]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, inputRef, openFileDialog]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: 'focus'\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: 'blur'\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [inputRef, noClick, openFileDialog]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? 'ref' : _ref2$refKey,\n role = _ref2.role,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, _excluded3);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),\n role: typeof role === 'string' && role !== '' ? role : 'button'\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, _excluded4);\n\n var inputProps = _defineProperty({\n accept: accept,\n multiple: multiple,\n type: 'file',\n style: {\n display: 'none'\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n autoComplete: 'off',\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n var fileCount = draggedFiles.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: draggedFiles,\n accept: accept,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case 'focus':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case 'blur':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case 'openDialog':\n return _objectSpread(_objectSpread({}, initialState), {}, {\n isFileDialogActive: true\n });\n\n case 'closeDialog':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case 'setDraggedFiles':\n /* eslint no-case-declarations: 0 */\n var isDragActive = action.isDragActive,\n draggedFiles = action.draggedFiles;\n return _objectSpread(_objectSpread({}, state), {}, {\n draggedFiles: draggedFiles,\n isDragActive: isDragActive\n });\n\n case 'setFiles':\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections\n });\n\n case 'reset':\n return _objectSpread({}, initialState);\n\n default:\n return state;\n }\n}\n\nfunction noop() {}\n\nexport { ErrorCode } from './utils';"],"names":["_excluded","_excluded2","_excluded3","_excluded4","_toConsumableArray","arr","Array","isArray","_arrayLikeToArray","_arrayWithoutHoles","iter","Symbol","iterator","from","_iterableToArray","_unsupportedIterableToArray","TypeError","_nonIterableSpread","_slicedToArray","i","_arrayWithHoles","_i","_s","_e","_arr","_n","_d","call","next","done","push","value","length","err","_iterableToArrayLimit","_nonIterableRest","o","minLen","n","Object","prototype","toString","slice","constructor","name","test","len","arr2","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread","target","arguments","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","configurable","writable","_objectWithoutProperties","excluded","sourceKeys","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","Dropzone","forwardRef","_ref","ref","children","_useDropzone","useDropzone","open","props","useImperativeHandle","React","createElement","Fragment","displayName","defaultProps","disabled","getFilesFromEvent","fromEvent","maxSize","Infinity","minSize","multiple","maxFiles","preventDropOnDocument","noClick","noKeyboard","noDrag","noDragEventsBubbling","validator","useFsAccessApi","propTypes","PropTypes","default","func","accept","oneOfType","string","arrayOf","bool","number","onFileDialogCancel","onFileDialogOpen","onDragEnter","onDragLeave","onDragOver","onDrop","onDropAccepted","onDropRejected","initialState","isFocused","isFileDialogActive","isDragActive","isDragAccept","isDragReject","draggedFiles","acceptedFiles","fileRejections","options","undefined","_defaultProps$options","onFileDialogOpenCb","useMemo","noop","onFileDialogCancelCb","rootRef","useRef","inputRef","_useReducer2","useReducer","reducer","state","dispatch","onWindowFocus","setTimeout","current","files","type","useEffect","canUseFileSystemAccessAPI","window","addEventListener","removeEventListener","dragTargetsRef","onDocumentDrop","event","contains","preventDefault","document","onDocumentDragOver","onDragEnterCb","useCallback","persist","stopPropagation","concat","isEvtWithFiles","Promise","resolve","then","isPropagationStopped","onDragOverCb","hasFiles","dataTransfer","dropEffect","_unused","onDragLeaveCb","targets","targetIdx","splice","setFiles","file","_fileAccepted2","fileAccepted","accepted","acceptError","_fileMatchSize2","fileMatchSize","sizeMatch","sizeError","customErrors","errors","e","TOO_MANY_FILES_REJECTION","onDropCb","openFileDialog","opts","types","filePickerOptionsTypes","showOpenFilePicker","handles","catch","finally","click","onKeyDownCb","isEqualNode","keyCode","onFocusCb","onBlurCb","onClickCb","isIeOrEdge","composeHandler","fn","composeKeyboardHandler","composeDragHandler","getRootProps","_ref2","_ref2$refKey","refKey","role","onKeyDown","onFocus","onBlur","onClick","rest","composeEventHandlers","tabIndex","onInputElementClick","getInputProps","_ref3","_ref3$refKey","onChange","style","display","autoComplete","fileCount","allFilesAccepted","action"],"mappings":"kOAAIA,EAAY,CAAC,YACbC,EAAa,CAAC,QACdC,EAAa,CAAC,SAAU,OAAQ,YAAa,UAAW,SAAU,UAAW,cAAe,aAAc,cAAe,UACzHC,EAAa,CAAC,SAAU,WAAY,WAExC,SAASC,EAAmBC,GAAO,OAMnC,SAA4BA,GAAO,GAAIC,MAAMC,QAAQF,GAAM,OAAOG,EAAkBH,EAAO,CANjDI,CAAmBJ,IAI7D,SAA0BK,GAAQ,GAAsB,oBAAXC,QAAmD,MAAzBD,EAAKC,OAAOC,WAA2C,MAAtBF,EAAK,cAAuB,OAAOJ,MAAMO,KAAKH,EAAQ,CAJzFI,CAAiBT,IAAQU,EAA4BV,IAE1H,WAAgC,MAAM,IAAIW,UAAU,uIAA0I,CAF5DC,EAAuB,CAQzJ,SAASC,EAAeb,EAAKc,GAAK,OAUlC,SAAyBd,G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EAAI,CACjDrB,WAAW,IAGf,IAAK,aACH,OAAOrE,EAAcA,EAAc,CAAE,EAAEoE,GAAe,CAAA,EAAI,CACxDE,oBAAoB,IAGxB,IAAK,cACH,OAAOtE,EAAcA,EAAc,CAAE,EAAE0F,GAAQ,CAAA,EAAI,CACjDpB,oBAAoB,IAGxB,IAAK,kBAEH,IAAIC,EAAekH,EAAOlH,aACtBG,EAAe+G,EAAO/G,aAC1B,OAAO1E,EAAcA,EAAc,CAAE,EAAE0F,GAAQ,CAAA,EAAI,CACjDhB,aAAcA,EACdH,aAAcA,IAGlB,IAAK,WACH,OAAOvE,EAAcA,EAAc,CAAE,EAAE0F,GAAQ,CAAA,EAAI,CACjDf,cAAe8G,EAAO9G,cACtBC,eAAgB6G,EAAO7G,iBAG3B,IAAK,QACH,OAAO5E,EAAc,GAAIoE,GAE3B,QACE,OAAOsB,EAEb,CAEA,SAASR,IAAO","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/react-dropzone/dist/es/index.js"],"sourcesContent":["var _excluded = [\"children\"],\n _excluded2 = [\"open\"],\n _excluded3 = [\"refKey\", \"role\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"],\n _excluded4 = [\"refKey\", \"onChange\", \"onClick\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { fromEvent } from 'file-selector';\nimport { allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, filePickerOptionsTypes, canUseFileSystemAccessAPI, isEvtWithFiles, isIeOrEdge, isPropagationStopped, onDocumentDragOver, TOO_MANY_FILES_REJECTION } from './utils/index';\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * <Dropzone>\n * {({getRootProps, getInputProps}) => (\n * <div {...getRootProps()}>\n * <input {...getInputProps()} />\n * <p>Drag 'n' drop some files here, or click to select files</p>\n * </div>\n * )}\n * </Dropzone>\n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, _excluded);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, _excluded2);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = 'Dropzone'; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null,\n useFsAccessApi: false\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.draggedFiles Files in active drag\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across 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/react-dropzone/react-dropzone/issues/276\n */\n accept: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: 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 * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when opening the file dialog\n */\n onFileDialogOpen: PropTypes.func,\n\n /**\n * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `<input type=\"file\">` click event.\n */\n useFsAccessApi: PropTypes.bool,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Custom validation function\n * @param {File} file\n * @returns {FileError|FileError[]}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise<File[]>)}\n */\n\n/**\n * An object with the current dropzone state and some helper functions.\n *\n * @typedef {object} DropzoneState\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} draggedFiles Files in active drag\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n draggedFiles: [],\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n * <div {...getRootProps()}>\n * <input {...getInputProps()} />\n * <p>Drag and drop some files here, or click to select files</p>\n * </div>\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {string|string[]} [props.accept] Set accepted file types.\n * See https://github.com/okonet/attr-accept for more information.\n * Keep in mind that mime type determination is not reliable across 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/react-dropzone/react-dropzone/issues/276\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {boolean} [props.useFsAccessApi] Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `<input type=\"file\">` click event.\n * @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n *\n * @returns {DropzoneState}\n */\n\nexport function useDropzone() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$options = _objectSpread(_objectSpread({}, defaultProps), options),\n accept = _defaultProps$options.accept,\n disabled = _defaultProps$options.disabled,\n getFilesFromEvent = _defaultProps$options.getFilesFromEvent,\n maxSize = _defaultProps$options.maxSize,\n minSize = _defaultProps$options.minSize,\n multiple = _defaultProps$options.multiple,\n maxFiles = _defaultProps$options.maxFiles,\n onDragEnter = _defaultProps$options.onDragEnter,\n onDragLeave = _defaultProps$options.onDragLeave,\n onDragOver = _defaultProps$options.onDragOver,\n onDrop = _defaultProps$options.onDrop,\n onDropAccepted = _defaultProps$options.onDropAccepted,\n onDropRejected = _defaultProps$options.onDropRejected,\n onFileDialogCancel = _defaultProps$options.onFileDialogCancel,\n onFileDialogOpen = _defaultProps$options.onFileDialogOpen,\n useFsAccessApi = _defaultProps$options.useFsAccessApi,\n preventDropOnDocument = _defaultProps$options.preventDropOnDocument,\n noClick = _defaultProps$options.noClick,\n noKeyboard = _defaultProps$options.noKeyboard,\n noDrag = _defaultProps$options.noDrag,\n noDragEventsBubbling = _defaultProps$options.noDragEventsBubbling,\n validator = _defaultProps$options.validator;\n\n var onFileDialogOpenCb = useMemo(function () {\n return typeof onFileDialogOpen === 'function' ? onFileDialogOpen : noop;\n }, [onFileDialogOpen]);\n var onFileDialogCancelCb = useMemo(function () {\n return typeof onFileDialogCancel === 'function' ? onFileDialogCancel : noop;\n }, [onFileDialogCancel]);\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive,\n draggedFiles = state.draggedFiles; // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: 'closeDialog'\n });\n onFileDialogCancelCb();\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n if (useFsAccessApi && canUseFileSystemAccessAPI()) {\n return function () {};\n }\n\n window.addEventListener('focus', onWindowFocus, false);\n return function () {\n window.removeEventListener('focus', onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancelCb, useFsAccessApi]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener('dragover', onDocumentDragOver, false);\n document.addEventListener('drop', onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener('dragover', onDocumentDragOver);\n document.removeEventListener('drop', onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (draggedFiles) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n dispatch({\n draggedFiles: draggedFiles,\n isDragActive: true,\n type: 'setDraggedFiles'\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n });\n }\n }, [getFilesFromEvent, onDragEnter, noDragEventsBubbling]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = 'copy';\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n isDragActive: false,\n type: 'setDraggedFiles',\n draggedFiles: []\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var setFiles = useCallback(function (files, event) {\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n type: 'setFiles'\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n }, [dispatch, multiple, accept, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n setFiles(files, event);\n });\n }\n\n dispatch({\n type: 'reset'\n });\n }, [getFilesFromEvent, setFiles, noDragEventsBubbling]); // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n if (useFsAccessApi && canUseFileSystemAccessAPI()) {\n dispatch({\n type: 'openDialog'\n });\n onFileDialogOpenCb(); // https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n\n var opts = {\n multiple: multiple,\n types: filePickerOptionsTypes(accept)\n };\n window.showOpenFilePicker(opts).then(function (handles) {\n return getFilesFromEvent(handles);\n }).then(function (files) {\n return setFiles(files, null);\n }).catch(function (e) {\n return onFileDialogCancelCb(e);\n }).finally(function () {\n return dispatch({\n type: 'closeDialog'\n });\n });\n return;\n }\n\n if (inputRef.current) {\n dispatch({\n type: 'openDialog'\n });\n onFileDialogOpenCb();\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, accept, multiple]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, inputRef, openFileDialog]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: 'focus'\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: 'blur'\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [inputRef, noClick, openFileDialog]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? 'ref' : _ref2$refKey,\n role = _ref2.role,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, _excluded3);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),\n role: typeof role === 'string' && role !== '' ? role : 'button'\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, _excluded4);\n\n var inputProps = _defineProperty({\n accept: accept,\n multiple: multiple,\n type: 'file',\n style: {\n display: 'none'\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n autoComplete: 'off',\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n var fileCount = draggedFiles.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: draggedFiles,\n accept: accept,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case 'focus':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case 'blur':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case 'openDialog':\n return _objectSpread(_objectSpread({}, initialState), {}, {\n isFileDialogActive: true\n });\n\n case 'closeDialog':\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case 'setDraggedFiles':\n /* eslint no-case-declarations: 0 */\n var isDragActive = action.isDragActive,\n draggedFiles = action.draggedFiles;\n return _objectSpread(_objectSpread({}, state), {}, {\n draggedFiles: draggedFiles,\n isDragActive: isDragActive\n });\n\n case 'setFiles':\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections\n });\n\n case 'reset':\n return _objectSpread({}, initialState);\n\n default:\n return state;\n }\n}\n\nfunction noop() {}\n\nexport { ErrorCode } from './utils';"],"names":["_excluded","_excluded2","_excluded3","_excluded4","_toConsumableArray","arr","Array","isArray","_arrayLikeToArray","_arrayWithoutHoles","iter","Symbol","iterator","from","_iterableToArray","_unsupportedIterableToArray","TypeError","_nonIterableSpread","_slicedToArray","i","_arrayWithHoles","_i","_s","_e","_arr","_n","_d","call","next","done","push","value","length","err","_iterableToArrayLimit","_nonIterableRest","o","minLen","n","Object","prototype","toString","slice","constructor","name","test","len","arr2","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread","target","arguments","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","configurable","writable","_objectWithoutProperties","excluded","sourceKeys","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","Dropzone","forwardRef","_ref","ref","children","_useDropzone","useDropzone","open","props","useImperativeHandle","React","createElement","Fragment","displayName","defaultProps","disabled","getFilesFromEvent","fromEvent","maxSize","Infinity","minSize","multiple","maxFiles","preventDropOnDocument","noClick","noKeyboard","noDrag","noDragEventsBubbling","validator","useFsAccessApi","propTypes","PropTypes","default","func","accept","oneOfType","string","arrayOf","bool","number","onFileDialogCancel","onFileDialogOpen","onDragEnter","onDragLeave","onDragOver","onDrop","onDropAccepted","onDropRejected","initialState","isFocused","isFileDialogActive","isDragActive","isDragAccept","isDragReject","draggedFiles","acceptedFiles","fileRejections","options","undefined","_defaultProps$options","onFileDialogOpenCb","useMemo","noop","onFileDialogCancelCb","rootRef","useRef","inputRef","_useReducer2","useReducer","reducer","state","dispatch","onWindowFocus","setTimeout","current","files","type","useEffect","canUseFileSystemAccessAPI","window","addEventListener","removeEventListener","dragTargetsRef","onDocumentDrop","event","contains","preventDefault","document","onDocumentDragOver","onDragEnterCb","useCallback","persist","stopPropagation","concat","isEvtWithFiles","Promise","resolve","then","isPropagationStopped","onDragOverCb","hasFiles","dataTransfer","dropEffect","_unused","onDragLeaveCb","targets","targetIdx","splice","setFiles","file","_fileAccepted2","fileAccepted","accepted","acceptError","_fileMatchSize2","fileMatchSize","sizeMatch","sizeError","customErrors","errors","e","TOO_MANY_FILES_REJECTION","onDropCb","openFileDialog","opts","types","filePickerOptionsTypes","showOpenFilePicker","handles","catch","finally","click","onKeyDownCb","isEqualNode","keyCode","onFocusCb","onBlurCb","onClickCb","isIeOrEdge","composeHandler","fn","composeKeyboardHandler","composeDragHandler","getRootProps","_ref2","_ref2$refKey","refKey","role","onKeyDown","onFocus","onBlur","onClick","rest","composeEventHandlers","tabIndex","onInputElementClick","getInputProps","_ref3","_ref3$refKey","onChange","style","display","autoComplete","fileCount","allFilesAccepted","action"],"mappings":"mOAAIA,EAAY,CAAC,YACbC,EAAa,CAAC,QACdC,EAAa,CAAC,SAAU,OAAQ,YAAa,UAAW,SAAU,UAAW,cAAe,aAAc,cAAe,UACzHC,EAAa,CAAC,SAAU,WAAY,WAExC,SAASC,EAAmBC,GAAO,OAMnC,SAA4BA,GAAO,GAAIC,MAAMC,QAAQF,GAAM,OAAOG,EAAkBH,EAAO,CANjDI,CAAmBJ,IAI7D,SAA0BK,GAAQ,GAAsB,oBAAXC,QAAmD,MAAzBD,EAAKC,OAAOC,WAA2C,MAAtBF,EAAK,cAAuB,OAAOJ,MAAMO,KAAKH,EAAQ,CAJzFI,CAAiBT,IAAQU,EAA4BV,IAE1H,WAAgC,MAAM,IAAIW,UAAU,uIAA0I,CAF5DC,EAAuB,CAQzJ,SAASC,EAAeb,EAAKc,GAAK,OAUlC,SAAyBd,GAAO,GAAIC,MAAMC,QAAQF,GAAM,OAAOA,CAAM,CAV5Be,CAAgBf,IAQzD,SAA+BA,EAAKc,GAAK,IAAIE,EAAY,MAAPhB,EAAc,KAAyB,oBAAXM,QAA0BN,EAAIM,OAAOC,WAA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GAAQ,CAAA,EAAI,CACjDpB,oBAAoB,IAGxB,IAAK,kBAEH,IAAIC,EAAekH,EAAOlH,aACtBG,EAAe+G,EAAO/G,aAC1B,OAAO1E,EAAcA,EAAc,CAAE,EAAE0F,GAAQ,CAAA,EAAI,CACjDhB,aAAcA,EACdH,aAAcA,IAGlB,IAAK,WACH,OAAOvE,EAAcA,EAAc,CAAE,EAAE0F,GAAQ,CAAA,EAAI,CACjDf,cAAe8G,EAAO9G,cACtBC,eAAgB6G,EAAO7G,iBAG3B,IAAK,QACH,OAAO5E,EAAc,GAAIoE,GAE3B,QACE,OAAOsB,EAEb,CAEA,SAASR,IAAO","x_google_ignoreList":[0]}
|
|
@@ -9,6 +9,8 @@ type ButtonOnlyIconType = Omit<BasicButtonType, 'ariaLabel' | 'onlyIconName'> &
|
|
|
9
9
|
onlyIconName: IconNameType;
|
|
10
10
|
};
|
|
11
11
|
export type ButtonColorType = 'success' | 'promo' | 'error';
|
|
12
|
+
export type ButtonType = 'border' | 'filled' | 'transparent';
|
|
13
|
+
export type ButtonSize = 'default' | 'small' | 'xSmall';
|
|
12
14
|
interface BasicButtonType extends ComponentPropsType, DisabledTooltipPropsType {
|
|
13
15
|
/** Allow click event propagation */
|
|
14
16
|
allowEventPropagation?: boolean;
|
|
@@ -34,7 +36,7 @@ interface BasicButtonType extends ComponentPropsType, DisabledTooltipPropsType {
|
|
|
34
36
|
/** Flag indicating that the button is rounded. */
|
|
35
37
|
isRounded?: boolean;
|
|
36
38
|
/** Button size. */
|
|
37
|
-
size?:
|
|
39
|
+
size?: ButtonSize;
|
|
38
40
|
/** Title used for file naming when linkUrl leads to file download */
|
|
39
41
|
linkDownloadTitle?: string;
|
|
40
42
|
/** Link used when redirecting outside application. */
|
|
@@ -46,11 +48,11 @@ interface BasicButtonType extends ComponentPropsType, DisabledTooltipPropsType {
|
|
|
46
48
|
/** Key down event handler. */
|
|
47
49
|
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
48
50
|
/** Name of icon, that should be displayed stand alone. If you need icon and text (or something else) use children property. */
|
|
49
|
-
onlyIconName?:
|
|
51
|
+
onlyIconName?: IconNameType;
|
|
50
52
|
/** Title of the button element */
|
|
51
53
|
title?: string;
|
|
52
54
|
/** Type of the button. Primary is filled with color, secondary is border-only and transparent is for links. */
|
|
53
|
-
type?:
|
|
55
|
+
type?: ButtonType;
|
|
54
56
|
/** Flag to prevent doubling the click event (double-click by mistake) */
|
|
55
57
|
preventDoubleClick?: boolean;
|
|
56
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAwB,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG5F,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAM,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAG7F,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,kBAAkB,CAAA;AAElE,KAAK,kBAAkB,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,cAAc,CAAC,GAAG;IAC9E,2BAA2B;IAC3B,SAAS,EAAE,MAAM,GAAG,YAAY,CAAA;IAChC,+HAA+H;IAC/H,YAAY,EAAE,YAAY,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAwB,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG5F,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAA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AAC,EAAE,MAAM,CAAA;IAChB,mCAAmC;IACnC,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,GAAG,aAAa,KAAK,IAAI,CAAA;IACrD,8BAA8B;IAC9B,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAA;IAChD,+HAA+H;IAC/H,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+GAA+G;IAC/G,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,eAAO,MAAM,MAAM,iFAuFlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../src/components/Components/Button/Button.tsx"],"sourcesContent":[null],"names":["Button","forwardRef","_a","ref","_c","allowEventPropagation","ariaLabel","children","color","disabledTooltip","_d","elementType","isBlock","isDisabled","isLoading","isRounded","linkDownloadTitle","linkUrl","onClick","onKeyDown","onlyIconName","preventDoubleClick","_e","size","_f","testId","theme","title","_g","type","rest","__rest","handleOnClick","event","preventDefault","stopPropagation","Component","content","React","createElement","className","cx","_b","concat","disabled","download","href","undefined","throttle","leading","trailing","Avatar","iconName","Fragment","withDisabledTooltip","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../src/components/Components/Button/Button.tsx"],"sourcesContent":[null],"names":["Button","forwardRef","_a","ref","_c","allowEventPropagation","ariaLabel","children","color","disabledTooltip","_d","elementType","isBlock","isDisabled","isLoading","isRounded","linkDownloadTitle","linkUrl","onClick","onKeyDown","onlyIconName","preventDoubleClick","_e","size","_f","testId","theme","title","_g","type","rest","__rest","handleOnClick","event","preventDefault","stopPropagation","Component","content","React","createElement","className","cx","_b","concat","disabled","download","href","undefined","throttle","leading","trailing","Avatar","iconName","Fragment","withDisabledTooltip","displayName"],"mappings":"2WAmEaA,EAASC,GACpB,SACEC,EAwBAC,SAvBEC,0BAAAC,cAA6BD,EAC7BE,EAASJ,EAAAI,UACTC,aACAC,UACAC,oBACAC,EAAAR,EAAAS,YAAAA,aAAc,SAAQD,EACtBE,EAAOV,EAAAU,QACPC,EAAUX,EAAAW,WACVC,EAASZ,EAAAY,UACTC,EAASb,EAAAa,UACTC,EAAiBd,EAAAc,kBACjBC,EAAOf,EAAAe,QACPC,YACAC,cACAC,iBACAC,EAAkBnB,EAAAmB,mBAClBC,SAAAC,aAAO,UAASD,EAChBE,EAAiBtB,EAAAuB,OAAjBA,OAAM,IAAAD,EAAG,SAAQA,EACjBE,EAAKxB,EAAAwB,MACLC,EAAKzB,EAAAyB,MACLC,SAAAC,aAAO,SAAQD,EACZE,EAAIC,EAAA7B,EAtBT,wQA0BM8B,EAAgB,SAACC,GACjBpB,GAAcC,EAChBmB,EAAMC,iBACGhB,GACTA,EAAQe,GAGL5B,GACH4B,EAAME,iBAEV,EAEMC,EAAYnB,EAAU,IAAM,SAC5BoB,EACJC,EAAAC,cAACH,KAGCjC,IAAKA,EACU,gBAAAU,GAAcC,EACjB,aAAAR,EACZkC,UAAWC,EACT,SAAOC,EAAA,CAEL,eAAgB9B,EAChB,kBAAmBC,EACnB,iBAAkBC,EAClB,eAAyB,UAATS,EAChB,gBAA0B,WAATA,EACjB,iBAAkBR,GAClB2B,EAAC,iBAAUb,IAAkB,WAATA,EACpBa,EAAC,UAAUC,OAAAnC,IAAUA,EACrBkC,EAAA,mBAAmBtB,EAErBsB,GAAAhB,GACD,cACYD,EACbmB,UAAW/B,GAAcC,KAAeL,EACxCoC,SAAU7B,EACV8B,KAAM7B,EACNU,MAAOA,EACPE,KAAMZ,OAAU8B,EAAYpC,EAC5BO,QAASG,EAAqB2B,EAAShB,EAAe,IAAK,CAAEiB,SAAS,EAAMC,UAAU,IAAWlB,EACjGb,UAAWA,GACPW,GAEHhB,GAAawB,gBAACa,EAAM,CAACC,SAAS,UAAU7B,KAAe,WAATA,EAAoBA,OAAOwB,IACzE3B,EACCkB,gBAACe,EAAQ,KACPf,EAAAC,cAACY,EAAO,CAAAC,SAAUhC,EAAcG,KAAe,WAATA,EAAoBA,OAAOwB,IACjET,EAAAC,cAAA,OAAA,CAAMC,UAAWC,EAAG,YAAanC,OAQzC,OAAOgD,EAAoB,CAAEzC,WAAUA,EAAEJ,gBAAeA,GAAjD6C,CAAqDjB,IAAYC,EAACC,cAAAc,OAC3E,IAGFrD,EAAOuD,YAAc"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement, ReactNode, SyntheticEvent } from 'react';
|
|
2
2
|
import { IconNameType, TargetType } from '../../../types';
|
|
3
3
|
import { AriaPropsType, ComponentPropsType, DisabledTooltipPropsType } from '../../../utils';
|
|
4
|
+
import { ButtonColorType, ButtonSize, ButtonType } from '../Button';
|
|
4
5
|
interface CompactButtonsButtonType extends ComponentPropsType, DisabledTooltipPropsType {
|
|
5
6
|
/** Allow click event propagation */
|
|
6
7
|
allowEventPropagation?: boolean;
|
|
@@ -13,7 +14,9 @@ interface CompactButtonsButtonType extends ComponentPropsType, DisabledTooltipPr
|
|
|
13
14
|
/** ARIA label for tabs. */
|
|
14
15
|
ariaLabel?: string | ReactElement;
|
|
15
16
|
/** Sets color of Button. Default color is `primary` */
|
|
16
|
-
color?:
|
|
17
|
+
color?: ButtonColorType;
|
|
18
|
+
/** Type of the buttons. Primary is filled with color, secondary is border-only and transparent is for links. */
|
|
19
|
+
type?: ButtonType;
|
|
17
20
|
/** Flag indicating that the button is disabled. */
|
|
18
21
|
isDisabled?: boolean;
|
|
19
22
|
/**
|
|
@@ -30,28 +33,30 @@ interface CompactButtonsButtonType extends ComponentPropsType, DisabledTooltipPr
|
|
|
30
33
|
/** Click event handler. */
|
|
31
34
|
onClick?: (e: SyntheticEvent | KeyboardEvent | React.KeyboardEvent) => void;
|
|
32
35
|
/** Name of icon, that should be displayed stand alone. */
|
|
33
|
-
onlyIconName?:
|
|
36
|
+
onlyIconName?: IconNameType;
|
|
34
37
|
/** Title of the button element */
|
|
35
38
|
title?: string;
|
|
36
39
|
}
|
|
37
40
|
interface CompactButtonOtherPropsType extends Omit<AriaPropsType, 'ariaLabel'> {
|
|
38
41
|
ariaLabel: string | ReactElement;
|
|
39
42
|
label?: string | ReactElement;
|
|
43
|
+
showOtherIcon?: boolean;
|
|
44
|
+
isOnlyIcon?: boolean;
|
|
40
45
|
}
|
|
41
46
|
export interface CompactButtonsPropsType extends ComponentPropsType {
|
|
42
|
-
/** Background color of compacted buttons wrapper. Default color is `primary` */
|
|
43
|
-
background?: 'green' | 'gold' | 'red' | 'secondary';
|
|
44
47
|
/** Compacted buttons */
|
|
45
48
|
buttons: CompactButtonsButtonType[];
|
|
46
|
-
/**
|
|
47
|
-
|
|
49
|
+
/** Button size. */
|
|
50
|
+
size?: ButtonSize;
|
|
48
51
|
/** Max number of visible buttons */
|
|
49
52
|
maxVisibleButtons?: number;
|
|
50
53
|
/** Type of the buttons. Primary is filled with color, secondary is border-only and transparent is for links. */
|
|
51
|
-
type?:
|
|
54
|
+
type?: ButtonType;
|
|
52
55
|
/** Props for other button */
|
|
53
|
-
otherButton
|
|
56
|
+
otherButton?: CompactButtonOtherPropsType;
|
|
57
|
+
/** Flag indicating that the first button is filled. */
|
|
58
|
+
isFirstPrimary?: boolean;
|
|
54
59
|
}
|
|
55
|
-
export declare const CompactButtons: ({
|
|
60
|
+
export declare const CompactButtons: ({ buttons, otherButton, maxVisibleButtons, theme, size, type, isFirstPrimary }: CompactButtonsPropsType) => JSX.Element;
|
|
56
61
|
export {};
|
|
57
62
|
//# sourceMappingURL=CompactButtons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactButtons.d.ts","sourceRoot":"","sources":["../../../../src/components/Components/CompactButtons/CompactButtons.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,YAAY,EACZ,SAAS,EACT,cAAc,EAMf,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EACL,aAAa,EACb,kBAAkB,EAElB,wBAAwB,EAGzB,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"CompactButtons.d.ts","sourceRoot":"","sources":["../../../../src/components/Components/CompactButtons/CompactButtons.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,YAAY,EACZ,SAAS,EACT,cAAc,EAMf,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EACL,aAAa,EACb,kBAAkB,EAElB,wBAAwB,EAGzB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAU,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAG3E,UAAU,wBAAyB,SAAQ,kBAAkB,EAAE,wBAAwB;IACrF,oCAAoC;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,uBAAuB;IACvB,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,CAAA;IACjC,uDAAuD;IACvD,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,gHAAgH;IAChH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;SAGK;IACL,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mCAAmC;IACnC,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,GAAG,aAAa,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,CAAA;IAC3E,0DAA0D;IAC1D,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,UAAU,2BAA4B,SAAQ,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC;IAC5E,SAAS,EAAE,MAAM,GAAG,YAAY,CAAA;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,CAAA;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,wBAAwB;IACxB,OAAO,EAAE,wBAAwB,EAAE,CAAA;IACnC,mBAAmB;IACnB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gHAAgH;IAChH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,2BAA2B,CAAA;IACzC,uDAAuD;IACvD,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAID,eAAO,MAAM,cAAc,mFAQxB,uBAAuB,KAAG,WA2O5B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as
|
|
1
|
+
import{__rest as e,__assign as t}from'./../../../ext/tslib/tslib.es6.js';import o from'./../../../ext/lodash/uniqueId.js';import n,{useRef as r,useState as i,useEffect as a,useCallback as c,useMemo as l}from"react";import"../../../utils/getDisplayName.js";import"../../../utils/getIntegerMask.js";import"../../../utils/isFilled.js";import"../../../utils/isNotFilled.js";import"../../../utils/isNotNilNorEmpty.js";import'./../../../ext/diacritic/diacritics.js';import{cx as s}from"../../../utils/classBinder.js";import'./../../../ext/text-mask-addons/dist/textMaskAddons.js';import{KEYS as u}from"../../../utils/constants.js";import{useContainerDimensions as m}from"../../../utils/hooks.js";import'./../../../ext/moment/dist/locale/cs.js';import{Avatar as d}from"../Avatar/Avatar.js";import{Button as p}from"../Button/Button.js";import{Dropdown as f}from"../Dropdown/Dropdown.js";import"../Dropdown/_elements_/DropdownDivider.js";import{DropdownItem as b}from"../Dropdown/_elements_/DropdownItem.js";import{DropdownMenu as v}from"../Dropdown/_elements_/DropdownMenu.js";var _=function(_){var w=_.buttons,h=_.otherButton,D=_.maxVisibleButtons,y=void 0===D?w.length:D,k=_.theme,g=_.size,j=_.type,E=void 0===j?"border":j,N=_.isFirstPrimary,B=r(null),C=r([]),I=r(),x=m(B).width,A=i(!1),F=A[0],L=A[1],K=i(-1),M=K[0],O=K[1],P=i(""),T=P[0],V=P[1],z="border"===E?40:56,S=h||{ariaLabel:"Other"},U=S.ariaLabel,q=S.isOnlyIcon,H=S.label,W=S.showOtherIcon,G=void 0===W||W;a((function(){V(o("menu"))}),[]);var J=c((function(){var e,t;null===(t=null===(e=B.current)||void 0===e?void 0:e.getElementsByClassName("c-compact-buttons__opener")[0])||void 0===t||t.focus()}),[B]),Q=c((function(){var e;null===(e=null==I?void 0:I.current)||void 0===e||e.focus()}),[I]),R=c((function(){F?O(-1):setTimeout((function(){Q()})),L((function(e){return!e}))}),[F,Q,O,L]),X=l((function(){var e=0;return C.current.map((function(t){var o=(null==t?void 0:t.clientWidth)||0,n=e+o;return e+=o,n}))}),[C.current.length,x]),Y=c((function(e){return X[e]+z<=x&&e<y}),[X,x,y,z]),Z=c((function(e){return function(t){C.current[e]=t}}),[]),$=l((function(){return w.map((function(e,t){return e.isDisabled||Y(t)?null:t})).filter((function(e){return null!==e}))}),[w,Y]);a((function(){var e;if(M>-1){var t=null===(e=I.current)||void 0===e?void 0:e.getElementsByClassName("c-compact-buttons__dropdown-item")[M];null==t||t.focus()}}),[M]);var ee=c((function(e){switch(e.key){case u.ArrowDown:e.preventDefault(),-1===M?O(0):void 0!==$[M+1]?O(M+1):(O(-1),J());break;case u.Tab:case u.Escape:O(-1),L(!1);break;case u.ArrowUp:e.preventDefault(),-1===M?O($.length-1):void 0!==$[M-1]?O(M-1):(O(-1),J());break;case u.Home:e.preventDefault(),O(0);break;case u.End:e.preventDefault(),O($.length-1)}}),[O,J,M,$]),te=c((function(e){switch(e.key){case u.ArrowDown:e.preventDefault(),Q(),O(0);break;case u.ArrowUp:e.preventDefault(),Q(),O($.length-1);break;case u.Tab:O(-1),L(!1)}}),[Q,O,L,$]),oe=c((function(e){return function(t){var o=t.key;o!==u.Enter&&o!==u.Space||(t.preventDefault(),e&&e(t))}}),[]);return n.createElement("div",{ref:B,className:"c-compact-buttons"},n.createElement("div",{className:s("c-compact-buttons__wrapper",k)},w.map((function(o,r){var i=o.color,a=o.icon,c=o.key,l=o.label,u=o.theme,m=e(o,["color","icon","key","label","theme"]);return n.createElement("div",{key:c,ref:Z(r),className:s("c-compact-buttons__button_box",{"c-compact-buttons__button_box--hidden":!Y(r)})},n.createElement(p,t({color:i,size:g,theme:s("c-compact-buttons__button",{"c-compact-buttons__button--hidden":!Y(r)},u),type:N&&0==r?"filled":E},m),a&&n.createElement(d,{isLeft:!0,iconName:a}),l))})),!Y(w.length-1)&&n.createElement(f,{forceVisibility:F,placement:"bottom-end",trigger:null,triggerComponent:n.createElement(p,t({ariaLabel:U,onlyIconName:q?"otherFill":void 0,theme:"c-compact-buttons__button c-compact-buttons__opener",type:E,onClick:R,onKeyDown:te},h),G&&n.createElement(d,{iconName:"otherFill",theme:s({"u-mr--xSmall":H})}),H,n.createElement("span",{className:"c-compact-buttons__dropdown__opener"})),onVisibleChange:function(e){return L(e)}},n.createElement(v,{ref:I,id:T,role:"menu",onKeyDown:ee},w.map((function(e,t){var o=e.allowEventPropagation,r=e.icon,i=e.isDisabled,a=e.isLoading,c=e.key,l=e.label,u=e.onClick,m=e.testId;if(!Y(t))return n.createElement(b,{key:c,allowEventPropagation:o,iconColor:"fgBrandDefault",iconName:r,isDisabled:i,isFocused:$[M]===t,testId:"".concat(m,"-dropdown"),theme:s("c-compact-buttons__dropdown-item",{"c-compact-buttons__dropdown-item--disabled":i||a}),onClick:u,onKeyDown:oe(u)},l)}))))))};export{_ as CompactButtons};
|
|
2
2
|
//# sourceMappingURL=CompactButtons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactButtons.js","sources":["../../../../src/components/Components/CompactButtons/CompactButtons.tsx"],"sourcesContent":[null],"names":["CompactButtons","_a","
|
|
1
|
+
{"version":3,"file":"CompactButtons.js","sources":["../../../../src/components/Components/CompactButtons/CompactButtons.tsx"],"sourcesContent":[null],"names":["CompactButtons","_a","buttons","otherButton","_b","maxVisibleButtons","length","theme","size","_c","type","isFirstPrimary","container","useRef","refs","dropdownRef","width","useContainerDimensions","_d","useState","isDropdownVisible","setIsDropdownVisible","_e","focusedItemIndex","setFocusedItemIndex","_f","menuId","setMenuId","openerWidth","_g","ariaLabel","otherButtonAriaLabel","isOnlyIcon","otherButtonLabel","label","_h","showOtherIcon","useEffect","uniqueId","focusOpener","useCallback","current","getElementsByClassName","focus","focusDropdown","toggleDropdownVisibility","setTimeout","prev","ends","useMemo","offset","map","ref","buttonWidth","clientWidth","end","isButtonVisible","position","registerButtonRef","pos","selectableItems","i","isDisabled","filter","item","handleOptionKeyPress","event","key","KEYS","ArrowDown","preventDefault","undefined","Tab","Escape","ArrowUp","Home","End","handleOpenerKeyPress","handleDropdownItemKeyPress","onClick","Enter","Space","React","className","createElement","cx","color","icon","props","__rest","Button","Avatar","isLeft","iconName","Dropdown","forceVisibility","placement","trigger","triggerComponent","__assign","onlyIconName","onKeyDown","onVisibleChange","state","DropdownMenu","id","role","allowEventPropagation","isLoading","testId","DropdownItem","iconColor","isFocused","concat"],"mappings":"glCAqFO,IAAMA,EAAiB,SAACC,GAC7B,IAAAC,EA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,gBAACS,EAAM,CAACC,QAAO,EAAAC,SAAUN,IACjCrD,QAILsB,EAAgBtD,EAAQI,OAAS,IACjC4E,EAACE,cAAAU,EACC,CAAAC,gBAAiB3E,EACjB4E,UAAU,aACVC,QAAS,KACTC,iBACEhB,EAAAE,cAACM,EACCS,EAAA,CAAArE,UAAWC,EACXqE,aAAcpE,EAAa,iBAAcuC,EACzChE,MAAM,sDACNG,KAAMA,EACNqE,QAASlC,EACTwD,UAAWxB,IACP1E,GAEHiC,GAAiB8C,EAACE,cAAAO,GAAOE,SAAS,YAAYtF,MAAO8E,EAAG,CAAE,eAAgBpD,MAC1EA,EACDiD,EAAAE,cAAA,OAAA,CAAMD,UAAU,yCAGpBmB,gBAAiB,SAACC,GAAU,OAAAlF,EAAqBkF,KAEjDrB,EAACE,cAAAoB,EAAa,CAAApD,IAAKrC,EAAa0F,GAAI/E,EAAQgF,KAAK,OAAOL,UAAWpC,IAChE/D,EAAQiD,KAAI,SAAClD,EAAqF4D,OAAnF8C,EAAqB1G,EAAA0G,sBAAEpB,EAAItF,EAAAsF,KAAEzB,EAAU7D,EAAA6D,WAAE8C,EAAS3G,EAAA2G,UAAEzC,EAAGlE,EAAAkE,IAAEjC,EAAKjC,EAAAiC,MAAE6C,EAAO9E,EAAA8E,QAAE8B,EAAM5G,EAAA4G,OAC7F,IAAIrD,EAAgBK,GAEpB,OACEqB,gBAAC4B,EAAY,CACX3C,IAAKA,EACLwC,sBAAuBA,EACvBI,UAAU,iBACVlB,SAAUN,EACVzB,WAAYA,EACZkD,UAAWpD,EAAgBrC,KAAsBsC,EACjDgD,OAAQ,GAAGI,OAAAJ,eACXtG,MAAO8E,EAAG,mCAAoC,CAC5C,6CAA8CvB,GAAc8C,IAE9D7B,QAASA,EACTsB,UAAWvB,GAA2BC,IAErC7C,EAGP,OAOd"}
|
|
@@ -10,6 +10,8 @@ export interface DropdownItemPropsType extends ComponentPropsType {
|
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
/** Color of icon background. */
|
|
12
12
|
iconBackground?: ColorType;
|
|
13
|
+
/** Color of Avatar text fill from _semantic-palette--(light|dark).scss example 'fgNeutralDefault' */
|
|
14
|
+
iconColor?: ColorType;
|
|
13
15
|
/** Icon name/type enum type. */
|
|
14
16
|
iconName?: IconNameType;
|
|
15
17
|
/** Set if item is disabled. */
|
|
@@ -32,7 +34,7 @@ export interface DropdownItemPropsType extends ComponentPropsType {
|
|
|
32
34
|
withCheckbox?: boolean;
|
|
33
35
|
}
|
|
34
36
|
export declare const DropdownItem: {
|
|
35
|
-
({ allowEventPropagation, amount, children, iconBackground, iconName, id, isDisabled, isFocused, isSelected, onClick, onKeyDown, onMouseOver, perex, role, testId, theme, value, withCheckbox }: DropdownItemPropsType): JSX.Element;
|
|
37
|
+
({ allowEventPropagation, amount, children, iconBackground, iconColor, iconName, id, isDisabled, isFocused, isSelected, onClick, onKeyDown, onMouseOver, perex, role, testId, theme, value, withCheckbox }: DropdownItemPropsType): JSX.Element;
|
|
36
38
|
displayName: string;
|
|
37
39
|
};
|
|
38
40
|
//# sourceMappingURL=DropdownItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Components/Dropdown/_elements_/DropdownItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,SAAS,EAAE,MAAM,OAAO,CAAA;AAElD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAM,MAAM,mBAAmB,CAAA;AAK1D,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,oCAAoC;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,6CAA6C;IAC7C,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,qDAAqD;IACrD,QAAQ,EAAE,SAAS,CAAA;IACnB,gCAAgC;IAChC,cAAc,CAAC,EAAE,SAAS,CAAA;IAC1B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,+BAA+B;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+BAA+B;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;IAC/F,gCAAgC;IAChC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;IACnG,2CAA2C;IAC3C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,IAAI,CAAA;IAC/D,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,eAAO,MAAM,YAAY;
|
|
1
|
+
{"version":3,"file":"DropdownItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Components/Dropdown/_elements_/DropdownItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,SAAS,EAAE,MAAM,OAAO,CAAA;AAElD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAM,MAAM,mBAAmB,CAAA;AAK1D,MAAM,WAAW,qBAAsB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
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{Fragment as o}from"react";import"../../../../utils/getDisplayName.js";import"../../../../utils/getIntegerMask.js";import"../../../../utils/isFilled.js";import"../../../../utils/isNotFilled.js";import"../../../../utils/isNotNilNorEmpty.js";import'./../../../../ext/diacritic/diacritics.js';import{cx as t}from"../../../../utils/classBinder.js";import'./../../../../ext/text-mask-addons/dist/textMaskAddons.js';import'./../../../../ext/moment/dist/locale/cs.js';import{Checkbox as i}from"../../../Form/Checkbox/Checkbox.js";import{Flex as a}from"../../../Layout/Flex/Flex.js";import{Avatar as r}from"../../Avatar/Avatar.js";var n=function(n){var s
|
|
1
|
+
import e,{Fragment as o}from"react";import"../../../../utils/getDisplayName.js";import"../../../../utils/getIntegerMask.js";import"../../../../utils/isFilled.js";import"../../../../utils/isNotFilled.js";import"../../../../utils/isNotNilNorEmpty.js";import'./../../../../ext/diacritic/diacritics.js';import{cx as t}from"../../../../utils/classBinder.js";import'./../../../../ext/text-mask-addons/dist/textMaskAddons.js';import'./../../../../ext/moment/dist/locale/cs.js';import{Checkbox as i}from"../../../Form/Checkbox/Checkbox.js";import{Flex as a}from"../../../Layout/Flex/Flex.js";import{Avatar as r}from"../../Avatar/Avatar.js";var n=function(n){var l,s=n.allowEventPropagation,d=void 0!==s&&s,m=n.amount,c=n.children,p=n.iconBackground,u=n.iconColor,v=n.iconName,_=n.id,w=n.isDisabled,j=n.isFocused,N=n.isSelected,f=void 0!==N&&N,x=n.onClick,E=n.onKeyDown,k=n.onMouseOver,b=n.perex,g=n.role,C=void 0===g?"option":g,h=n.testId,y=n.theme,D=n.value,F=n.withCheckbox,I=F?a:o;return e.createElement("li",{"aria-selected":f,className:t("c-dropdown__item",(l={},l["c-dropdown__item--focused"]=j,l["c-dropdown__item--disabled"]=w,l["c-dropdown__item--selected"]=f,l),y),"data-testid":h,"data-value":D,id:_,role:C,onClick:function(e){x&&!w&&(D?x(e,D):x(e),e.preventDefault()),d||e.stopPropagation()},onKeyDown:E,onMouseOver:function(e){k&&!w&&(D?k(e,D):k(e))}},e.createElement("div",{className:t("c-dropdown__itemContent"),tabIndex:j?0:-1},e.createElement(I,null,F?e.createElement(i,{allowEventPropagation:!0,label:c,name:_||"option",value:f}):e.createElement(o,null,v&&e.createElement(r,{isLeft:!0,backgroundColor:p,color:u,iconName:v}),c)),b&&e.createElement("div",{className:t("c-dropdown__perex")},b)),m&&e.createElement("div",{className:t("c-dropdown__amount")},m))};n.displayName="DropdownItem";export{n as DropdownItem};
|
|
2
2
|
//# sourceMappingURL=DropdownItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownItem.js","sources":["../../../../../src/components/Components/Dropdown/_elements_/DropdownItem.tsx"],"sourcesContent":[null],"names":["DropdownItem","_a","_c","allowEventPropagation","amount","children","iconBackground","iconName","id","isDisabled","isFocused","_d","isSelected","onClick","onKeyDown","onMouseOver","perex","_e","role","testId","theme","value","withCheckbox","ContentWrapper","Flex","Fragment","React","className","cx","_b","event","preventDefault","stopPropagation","createElement","tabIndex","Checkbox","label","name","Avatar","isLeft","backgroundColor","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DropdownItem.js","sources":["../../../../../src/components/Components/Dropdown/_elements_/DropdownItem.tsx"],"sourcesContent":[null],"names":["DropdownItem","_a","_c","allowEventPropagation","amount","children","iconBackground","iconColor","iconName","id","isDisabled","isFocused","_d","isSelected","onClick","onKeyDown","onMouseOver","perex","_e","role","testId","theme","value","withCheckbox","ContentWrapper","Flex","Fragment","React","className","cx","_b","event","preventDefault","stopPropagation","createElement","tabIndex","Checkbox","label","name","Avatar","isLeft","backgroundColor","color","displayName"],"mappings":"6oBAyCO,IAAMA,EAAe,SAACC,SAC3BC,EAAAD,EAAAE,sBAAAA,OAAwB,IAAAD,GAAKA,EAC7BE,EAAMH,EAAAG,OACNC,EAAQJ,EAAAI,SACRC,EAAcL,EAAAK,eACdC,EAASN,EAAAM,UACTC,EAAQP,EAAAO,SACRC,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